aboutsummaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/gdb
diff options
context:
space:
mode:
authorsvn2git <svn2git@FreeBSD.org>1994-07-01 00:00:00 -0800
committersvn2git <svn2git@FreeBSD.org>1994-07-01 00:00:00 -0800
commit5e0e9b99dc3fc0ecd49d929db0d57c784b66f481 (patch)
treee779b5a6edddbb949b7990751b12d6f25304ba86 /gnu/usr.bin/gdb
parenta16f65c7d117419bd266c28a1901ef129a337569 (diff)
downloadsrc-releng/1.tar.gz
src-releng/1.zip
Release FreeBSD 1.1.5.1release/1.1.5.1_cvsreleng/1
This commit was manufactured to restore the state of the 1.1.5.1-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'gnu/usr.bin/gdb')
-rw-r--r--gnu/usr.bin/gdb/COPYING354
-rw-r--r--gnu/usr.bin/gdb/COPYING.LIB481
-rw-r--r--gnu/usr.bin/gdb/ChangeLog4887
-rw-r--r--gnu/usr.bin/gdb/Gdbinit15
-rw-r--r--gnu/usr.bin/gdb/Makefile39
-rw-r--r--gnu/usr.bin/gdb/Makefile.dist371
-rw-r--r--gnu/usr.bin/gdb/Projects114
-rw-r--r--gnu/usr.bin/gdb/README.FreeBSD15
-rw-r--r--gnu/usr.bin/gdb/README.gnu142
-rw-r--r--gnu/usr.bin/gdb/VERSION1
-rw-r--r--gnu/usr.bin/gdb/XGdbinit.samp15
-rw-r--r--gnu/usr.bin/gdb/Xgdb.ad8
-rw-r--r--gnu/usr.bin/gdb/bfd/COPYING339
-rw-r--r--gnu/usr.bin/gdb/bfd/Makefile17
-rw-r--r--gnu/usr.bin/gdb/bfd/README.FreeBSD7
-rw-r--r--gnu/usr.bin/gdb/bfd/VERSION1
-rw-r--r--gnu/usr.bin/gdb/bfd/aout-target.h429
-rw-r--r--gnu/usr.bin/gdb/bfd/aout32.c23
-rw-r--r--gnu/usr.bin/gdb/bfd/aoutx.h2568
-rw-r--r--gnu/usr.bin/gdb/bfd/archive.c1770
-rw-r--r--gnu/usr.bin/gdb/bfd/archures.c731
-rw-r--r--gnu/usr.bin/gdb/bfd/bfd.c733
-rw-r--r--gnu/usr.bin/gdb/bfd/bfd.h1803
-rw-r--r--gnu/usr.bin/gdb/bfd/cache.c311
-rw-r--r--gnu/usr.bin/gdb/bfd/coffgen.c1519
-rw-r--r--gnu/usr.bin/gdb/bfd/core.c106
-rw-r--r--gnu/usr.bin/gdb/bfd/cpu-i386.c43
-rw-r--r--gnu/usr.bin/gdb/bfd/ctor.c148
-rw-r--r--gnu/usr.bin/gdb/bfd/ecoff.c3994
-rw-r--r--gnu/usr.bin/gdb/bfd/elf.c248
-rw-r--r--gnu/usr.bin/gdb/bfd/format.c258
-rw-r--r--gnu/usr.bin/gdb/bfd/freebsd386.c110
-rw-r--r--gnu/usr.bin/gdb/bfd/init.c78
-rw-r--r--gnu/usr.bin/gdb/bfd/libaout.h393
-rw-r--r--gnu/usr.bin/gdb/bfd/libbfd.c850
-rw-r--r--gnu/usr.bin/gdb/bfd/libbfd.h273
-rw-r--r--gnu/usr.bin/gdb/bfd/libcoff.h352
-rw-r--r--gnu/usr.bin/gdb/bfd/libecoff.h265
-rw-r--r--gnu/usr.bin/gdb/bfd/libelf.h249
-rw-r--r--gnu/usr.bin/gdb/bfd/opncls.c534
-rw-r--r--gnu/usr.bin/gdb/bfd/reloc.c1225
-rw-r--r--gnu/usr.bin/gdb/bfd/seclet.c185
-rw-r--r--gnu/usr.bin/gdb/bfd/seclet.h55
-rw-r--r--gnu/usr.bin/gdb/bfd/section.c899
-rw-r--r--gnu/usr.bin/gdb/bfd/srec.c1001
-rw-r--r--gnu/usr.bin/gdb/bfd/stab-syms.c59
-rw-r--r--gnu/usr.bin/gdb/bfd/syms.c527
-rw-r--r--gnu/usr.bin/gdb/bfd/sysdep.h47
-rw-r--r--gnu/usr.bin/gdb/bfd/targets.c635
-rw-r--r--gnu/usr.bin/gdb/bfd/trad-core.c384
-rw-r--r--gnu/usr.bin/gdb/blockframe.c622
-rw-r--r--gnu/usr.bin/gdb/breakpoint.c1383
-rw-r--r--gnu/usr.bin/gdb/command.h77
-rw-r--r--gnu/usr.bin/gdb/config/Makefile.i3866
-rw-r--r--gnu/usr.bin/gdb/config/default-dep.c585
-rw-r--r--gnu/usr.bin/gdb/config/i386-dep.c1275
-rw-r--r--gnu/usr.bin/gdb/config/i386bsd-dep.c1886
-rw-r--r--gnu/usr.bin/gdb/config/m-i386-sv32.h28
-rw-r--r--gnu/usr.bin/gdb/config/m-i386bsd.h375
-rw-r--r--gnu/usr.bin/gdb/config/m-i386g-sv32.h28
-rw-r--r--gnu/usr.bin/gdb/config/m-i386gas.h37
-rw-r--r--gnu/usr.bin/gdb/copying.c215
-rw-r--r--gnu/usr.bin/gdb/core.c581
-rw-r--r--gnu/usr.bin/gdb/cplus-dem.c996
-rw-r--r--gnu/usr.bin/gdb/dbxread.c5727
-rw-r--r--gnu/usr.bin/gdb/defs.h122
-rw-r--r--gnu/usr.bin/gdb/doc/ChangeLog783
-rw-r--r--gnu/usr.bin/gdb/doc/Makefile340
-rw-r--r--gnu/usr.bin/gdb/doc/Makefile.in327
-rw-r--r--gnu/usr.bin/gdb/doc/a4rc.sed11
-rw-r--r--gnu/usr.bin/gdb/doc/all-cfg.texi117
-rwxr-xr-xgnu/usr.bin/gdb/doc/config.status5
-rw-r--r--gnu/usr.bin/gdb/doc/configure.in7
-rw-r--r--gnu/usr.bin/gdb/doc/gdb-cfg.texi117
-rw-r--r--gnu/usr.bin/gdb/doc/gdb.info213
-rw-r--r--gnu/usr.bin/gdb/doc/gdb.info-11304
-rw-r--r--gnu/usr.bin/gdb/doc/gdb.info-21165
-rw-r--r--gnu/usr.bin/gdb/doc/gdb.info-31264
-rw-r--r--gnu/usr.bin/gdb/doc/gdb.info-41349
-rw-r--r--gnu/usr.bin/gdb/doc/gdb.info-51215
-rw-r--r--gnu/usr.bin/gdb/doc/gdb.info-61220
-rw-r--r--gnu/usr.bin/gdb/doc/gdb.info-71233
-rw-r--r--gnu/usr.bin/gdb/doc/gdb.info-8657
-rw-r--r--gnu/usr.bin/gdb/doc/gdb.texinfo8591
-rw-r--r--gnu/usr.bin/gdb/doc/gdbint.texinfo2658
-rw-r--r--gnu/usr.bin/gdb/doc/h8-cfg.texi47
-rw-r--r--gnu/usr.bin/gdb/doc/libgdb.texinfo1471
-rw-r--r--gnu/usr.bin/gdb/doc/lpsrc.sed13
-rw-r--r--gnu/usr.bin/gdb/doc/psrc.sed13
-rw-r--r--gnu/usr.bin/gdb/doc/refcard.ps798
-rw-r--r--gnu/usr.bin/gdb/doc/refcard.tex646
-rw-r--r--gnu/usr.bin/gdb/doc/remote.texi1294
-rw-r--r--gnu/usr.bin/gdb/doc/stabs.texinfo3795
-rw-r--r--gnu/usr.bin/gdb/environ.c185
-rw-r--r--gnu/usr.bin/gdb/environ.h39
-rw-r--r--gnu/usr.bin/gdb/expprint.c324
-rw-r--r--gnu/usr.bin/gdb/expread.y1782
-rw-r--r--gnu/usr.bin/gdb/findvar.c579
-rw-r--r--gnu/usr.bin/gdb/frame.h115
-rw-r--r--gnu/usr.bin/gdb/gdb.13
-rw-r--r--gnu/usr.bin/gdb/gdb/COPYING339
-rw-r--r--gnu/usr.bin/gdb/gdb/Makefile72
-rw-r--r--gnu/usr.bin/gdb/gdb/ansidecl.h139
-rw-r--r--gnu/usr.bin/gdb/gdb/aout/aout64.h431
-rw-r--r--gnu/usr.bin/gdb/gdb/aout/ar.h32
-rw-r--r--gnu/usr.bin/gdb/gdb/aout/ranlib.h62
-rw-r--r--gnu/usr.bin/gdb/gdb/aout/stab.def264
-rw-r--r--gnu/usr.bin/gdb/gdb/aout/stab_gnu.h36
-rw-r--r--gnu/usr.bin/gdb/gdb/blockframe.c821
-rw-r--r--gnu/usr.bin/gdb/gdb/breakpoint.c3301
-rw-r--r--gnu/usr.bin/gdb/gdb/breakpoint.h372
-rw-r--r--gnu/usr.bin/gdb/gdb/buildsym.c950
-rw-r--r--gnu/usr.bin/gdb/gdb/buildsym.h259
-rw-r--r--gnu/usr.bin/gdb/gdb/c-exp.y1601
-rw-r--r--gnu/usr.bin/gdb/gdb/c-lang.c447
-rw-r--r--gnu/usr.bin/gdb/gdb/c-lang.h31
-rw-r--r--gnu/usr.bin/gdb/gdb/c-typeprint.c797
-rw-r--r--gnu/usr.bin/gdb/gdb/c-valprint.c416
-rw-r--r--gnu/usr.bin/gdb/gdb/call-cmds.h28
-rw-r--r--gnu/usr.bin/gdb/gdb/ch-exp.y1997
-rw-r--r--gnu/usr.bin/gdb/gdb/ch-lang.c341
-rw-r--r--gnu/usr.bin/gdb/gdb/ch-lang.h31
-rw-r--r--gnu/usr.bin/gdb/gdb/ch-typeprint.c225
-rw-r--r--gnu/usr.bin/gdb/gdb/ch-valprint.c332
-rw-r--r--gnu/usr.bin/gdb/gdb/coff/ecoff.h262
-rw-r--r--gnu/usr.bin/gdb/gdb/coff/internal.h538
-rw-r--r--gnu/usr.bin/gdb/gdb/coff/sym.h477
-rw-r--r--gnu/usr.bin/gdb/gdb/coff/symconst.h175
-rw-r--r--gnu/usr.bin/gdb/gdb/coffread.c2071
-rw-r--r--gnu/usr.bin/gdb/gdb/command.c (renamed from gnu/usr.bin/gdb/command.c)744
-rw-r--r--gnu/usr.bin/gdb/gdb/command.h241
-rw-r--r--gnu/usr.bin/gdb/gdb/complaints.c158
-rw-r--r--gnu/usr.bin/gdb/gdb/complaints.h46
-rw-r--r--gnu/usr.bin/gdb/gdb/copying.c327
-rw-r--r--gnu/usr.bin/gdb/gdb/core.c291
-rw-r--r--gnu/usr.bin/gdb/gdb/coredep.c118
-rw-r--r--gnu/usr.bin/gdb/gdb/corelow.c328
-rw-r--r--gnu/usr.bin/gdb/gdb/cp-valprint.c484
-rw-r--r--gnu/usr.bin/gdb/gdb/dbxread.c2234
-rw-r--r--gnu/usr.bin/gdb/gdb/dcache.c236
-rw-r--r--gnu/usr.bin/gdb/gdb/dcache.h83
-rw-r--r--gnu/usr.bin/gdb/gdb/defs.h901
-rw-r--r--gnu/usr.bin/gdb/gdb/demangle.c190
-rw-r--r--gnu/usr.bin/gdb/gdb/demangle.h77
-rw-r--r--gnu/usr.bin/gdb/gdb/dis-asm.h176
-rw-r--r--gnu/usr.bin/gdb/gdb/dis-buf.c69
-rw-r--r--gnu/usr.bin/gdb/gdb/dwarfread.c3866
-rw-r--r--gnu/usr.bin/gdb/gdb/elf/common.h216
-rw-r--r--gnu/usr.bin/gdb/gdb/elf/dwarf.h314
-rw-r--r--gnu/usr.bin/gdb/gdb/elf/external.h190
-rw-r--r--gnu/usr.bin/gdb/gdb/elf/internal.h195
-rw-r--r--gnu/usr.bin/gdb/gdb/elfread.c729
-rw-r--r--gnu/usr.bin/gdb/gdb/environ.c198
-rw-r--r--gnu/usr.bin/gdb/gdb/environ.h58
-rw-r--r--gnu/usr.bin/gdb/gdb/eval.c (renamed from gnu/usr.bin/gdb/eval.c)744
-rw-r--r--gnu/usr.bin/gdb/gdb/exec.c489
-rw-r--r--gnu/usr.bin/gdb/gdb/expprint.c623
-rw-r--r--gnu/usr.bin/gdb/gdb/expression.h (renamed from gnu/usr.bin/gdb/expression.h)164
-rw-r--r--gnu/usr.bin/gdb/gdb/findvar.c971
-rw-r--r--gnu/usr.bin/gdb/gdb/fopen-same.h27
-rw-r--r--gnu/usr.bin/gdb/gdb/fork-child.c310
-rw-r--r--gnu/usr.bin/gdb/gdb/frame.h238
-rw-r--r--gnu/usr.bin/gdb/gdb/freebsd-nat.c323
-rw-r--r--gnu/usr.bin/gdb/gdb/freebsd-solib.c1469
-rw-r--r--gnu/usr.bin/gdb/gdb/gdb-stabs.h76
-rw-r--r--gnu/usr.bin/gdb/gdb/gdb.1371
-rw-r--r--gnu/usr.bin/gdb/gdb/gdbcmd.h101
-rw-r--r--gnu/usr.bin/gdb/gdb/gdbcore.h129
-rw-r--r--gnu/usr.bin/gdb/gdb/gdbtypes.c1440
-rw-r--r--gnu/usr.bin/gdb/gdb/gdbtypes.h704
-rw-r--r--gnu/usr.bin/gdb/gdb/getopt.h129
-rw-r--r--gnu/usr.bin/gdb/gdb/i386-dis.c (renamed from gnu/usr.bin/gdb/config/i386-pinsn.c)302
-rw-r--r--gnu/usr.bin/gdb/gdb/i386-pinsn.c37
-rw-r--r--gnu/usr.bin/gdb/gdb/i386-tdep.c595
-rw-r--r--gnu/usr.bin/gdb/gdb/infcmd.c1423
-rw-r--r--gnu/usr.bin/gdb/gdb/inferior.h401
-rw-r--r--gnu/usr.bin/gdb/gdb/inflow.c662
-rw-r--r--gnu/usr.bin/gdb/gdb/infptrace.c436
-rw-r--r--gnu/usr.bin/gdb/gdb/infrun.c1848
-rw-r--r--gnu/usr.bin/gdb/gdb/inftarg.c310
-rw-r--r--gnu/usr.bin/gdb/gdb/init.c47
-rw-r--r--gnu/usr.bin/gdb/gdb/language.c1332
-rw-r--r--gnu/usr.bin/gdb/gdb/language.h413
-rw-r--r--gnu/usr.bin/gdb/gdb/m2-exp.y1169
-rw-r--r--gnu/usr.bin/gdb/gdb/m2-lang.c457
-rw-r--r--gnu/usr.bin/gdb/gdb/m2-lang.h31
-rw-r--r--gnu/usr.bin/gdb/gdb/m2-typeprint.c49
-rw-r--r--gnu/usr.bin/gdb/gdb/m2-valprint.c45
-rw-r--r--gnu/usr.bin/gdb/gdb/main.c2799
-rw-r--r--gnu/usr.bin/gdb/gdb/maint.c305
-rw-r--r--gnu/usr.bin/gdb/gdb/mem-break.c104
-rw-r--r--gnu/usr.bin/gdb/gdb/minsyms.c597
-rw-r--r--gnu/usr.bin/gdb/gdb/mipsread.c3653
-rw-r--r--gnu/usr.bin/gdb/gdb/nlmread.c300
-rw-r--r--gnu/usr.bin/gdb/gdb/nm.h44
-rw-r--r--gnu/usr.bin/gdb/gdb/objfiles.c773
-rw-r--r--gnu/usr.bin/gdb/gdb/objfiles.h437
-rw-r--r--gnu/usr.bin/gdb/gdb/obstack.h (renamed from gnu/usr.bin/gdb/obstack.h)226
-rw-r--r--gnu/usr.bin/gdb/gdb/parse.c827
-rw-r--r--gnu/usr.bin/gdb/gdb/parser-defs.h188
-rw-r--r--gnu/usr.bin/gdb/gdb/partial-stab.h618
-rw-r--r--gnu/usr.bin/gdb/gdb/printcmd.c (renamed from gnu/usr.bin/gdb/printcmd.c)1459
-rw-r--r--gnu/usr.bin/gdb/gdb/putenv.c111
-rw-r--r--gnu/usr.bin/gdb/gdb/regex.c (renamed from gnu/usr.bin/gdb/regex.c)61
-rw-r--r--gnu/usr.bin/gdb/gdb/regex.h (renamed from gnu/usr.bin/gdb/regex.h)32
-rw-r--r--gnu/usr.bin/gdb/gdb/remote-utils.c645
-rw-r--r--gnu/usr.bin/gdb/gdb/remote-utils.h149
-rw-r--r--gnu/usr.bin/gdb/gdb/remote.c1272
-rw-r--r--gnu/usr.bin/gdb/gdb/ser-unix.c633
-rw-r--r--gnu/usr.bin/gdb/gdb/serial.c261
-rw-r--r--gnu/usr.bin/gdb/gdb/serial.h153
-rw-r--r--gnu/usr.bin/gdb/gdb/signals.h27
-rw-r--r--gnu/usr.bin/gdb/gdb/solib.h56
-rw-r--r--gnu/usr.bin/gdb/gdb/source.c1398
-rw-r--r--gnu/usr.bin/gdb/gdb/stabsread.c3770
-rw-r--r--gnu/usr.bin/gdb/gdb/stabsread.h194
-rw-r--r--gnu/usr.bin/gdb/gdb/stack.c1379
-rw-r--r--gnu/usr.bin/gdb/gdb/symfile.c1489
-rw-r--r--gnu/usr.bin/gdb/gdb/symfile.h228
-rw-r--r--gnu/usr.bin/gdb/gdb/symmisc.c857
-rw-r--r--gnu/usr.bin/gdb/gdb/symtab.c3035
-rw-r--r--gnu/usr.bin/gdb/gdb/symtab.h1124
-rw-r--r--gnu/usr.bin/gdb/gdb/target.c789
-rw-r--r--gnu/usr.bin/gdb/gdb/target.h465
-rw-r--r--gnu/usr.bin/gdb/gdb/terminal.h62
-rw-r--r--gnu/usr.bin/gdb/gdb/thread.c248
-rw-r--r--gnu/usr.bin/gdb/gdb/thread.h36
-rw-r--r--gnu/usr.bin/gdb/gdb/tm-i386v.h (renamed from gnu/usr.bin/gdb/config/m-i386.h)213
-rw-r--r--gnu/usr.bin/gdb/gdb/tm.h76
-rw-r--r--gnu/usr.bin/gdb/gdb/typeprint.c297
-rw-r--r--gnu/usr.bin/gdb/gdb/typeprint.h21
-rw-r--r--gnu/usr.bin/gdb/gdb/utils.c1547
-rw-r--r--gnu/usr.bin/gdb/gdb/valarith.c969
-rw-r--r--gnu/usr.bin/gdb/gdb/valops.c1819
-rw-r--r--gnu/usr.bin/gdb/gdb/valprint.c1063
-rw-r--r--gnu/usr.bin/gdb/gdb/valprint.h40
-rw-r--r--gnu/usr.bin/gdb/gdb/value.h502
-rw-r--r--gnu/usr.bin/gdb/gdb/values.c1502
-rw-r--r--gnu/usr.bin/gdb/gdb/version.c3
-rw-r--r--gnu/usr.bin/gdb/gdb/wait.h38
-rw-r--r--gnu/usr.bin/gdb/gdb/xm.h31
-rw-r--r--gnu/usr.bin/gdb/getpagesize.h25
-rw-r--r--gnu/usr.bin/gdb/infcmd.c1204
-rw-r--r--gnu/usr.bin/gdb/inferior.h142
-rw-r--r--gnu/usr.bin/gdb/inflow.c569
-rw-r--r--gnu/usr.bin/gdb/infrun.c1459
-rw-r--r--gnu/usr.bin/gdb/kgdb_proto.h63
-rw-r--r--gnu/usr.bin/gdb/libiberty/COPYING.LIB481
-rw-r--r--gnu/usr.bin/gdb/libiberty/Makefile13
-rw-r--r--gnu/usr.bin/gdb/libiberty/README.FreeBSD7
-rw-r--r--gnu/usr.bin/gdb/libiberty/alloca-conf.h11
-rw-r--r--gnu/usr.bin/gdb/libiberty/argv.c332
-rw-r--r--gnu/usr.bin/gdb/libiberty/basename.c56
-rw-r--r--gnu/usr.bin/gdb/libiberty/concat.c118
-rw-r--r--gnu/usr.bin/gdb/libiberty/config.h1
-rw-r--r--gnu/usr.bin/gdb/libiberty/cplus-dem.c2669
-rw-r--r--gnu/usr.bin/gdb/libiberty/fdmatch.c71
-rw-r--r--gnu/usr.bin/gdb/libiberty/getopt.c750
-rw-r--r--gnu/usr.bin/gdb/libiberty/getopt1.c180
-rw-r--r--gnu/usr.bin/gdb/libiberty/ieee-float.c150
-rw-r--r--gnu/usr.bin/gdb/libiberty/ieee-float.h65
-rw-r--r--gnu/usr.bin/gdb/libiberty/obstack.c460
-rw-r--r--gnu/usr.bin/gdb/libiberty/sigsetmask.c44
-rw-r--r--gnu/usr.bin/gdb/libiberty/spaces.c67
-rw-r--r--gnu/usr.bin/gdb/libiberty/strerror.c811
-rw-r--r--gnu/usr.bin/gdb/libiberty/strsignal.c634
-rw-r--r--gnu/usr.bin/gdb/libiberty/xmalloc.c58
-rw-r--r--gnu/usr.bin/gdb/main.c2241
-rw-r--r--gnu/usr.bin/gdb/mmalloc/Makefile10
-rw-r--r--gnu/usr.bin/gdb/mmalloc/README.FreeBSD7
-rw-r--r--gnu/usr.bin/gdb/mmalloc/attach.c218
-rw-r--r--gnu/usr.bin/gdb/mmalloc/detach.c71
-rw-r--r--gnu/usr.bin/gdb/mmalloc/keys.c66
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mcalloc.c53
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mfree.c247
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mmalloc.c334
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mmalloc.h390
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mmalloc.texi258
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mmap-sup.c144
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mmcheck.c196
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mmemalign.c64
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mmstats.c46
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mmtrace.c166
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mrealloc.c160
-rw-r--r--gnu/usr.bin/gdb/mmalloc/mvalloc.c40
-rw-r--r--gnu/usr.bin/gdb/mmalloc/sbrk-sup.c96
-rw-r--r--gnu/usr.bin/gdb/ngdb.i386/Makefile27
-rw-r--r--gnu/usr.bin/gdb/obstack.c313
-rw-r--r--gnu/usr.bin/gdb/readline/ChangeLog98
-rw-r--r--gnu/usr.bin/gdb/readline/Makefile.gnu114
-rw-r--r--gnu/usr.bin/gdb/readline/chardefs.h50
-rw-r--r--gnu/usr.bin/gdb/readline/emacs_keymap.c472
-rw-r--r--gnu/usr.bin/gdb/readline/funmap.c217
-rw-r--r--gnu/usr.bin/gdb/readline/history.c1462
-rw-r--r--gnu/usr.bin/gdb/readline/history.h108
-rw-r--r--gnu/usr.bin/gdb/readline/keymaps.c172
-rw-r--r--gnu/usr.bin/gdb/readline/keymaps.h53
-rw-r--r--gnu/usr.bin/gdb/readline/readline.c5557
-rw-r--r--gnu/usr.bin/gdb/readline/readline.h161
-rw-r--r--gnu/usr.bin/gdb/readline/vi_keymap.c484
-rw-r--r--gnu/usr.bin/gdb/readline/vi_mode.c875
-rw-r--r--gnu/usr.bin/gdb/remote-sl.c10
-rw-r--r--gnu/usr.bin/gdb/remote.c626
-rw-r--r--gnu/usr.bin/gdb/source.c1166
-rw-r--r--gnu/usr.bin/gdb/stab.def115
-rw-r--r--gnu/usr.bin/gdb/stack.c960
-rw-r--r--gnu/usr.bin/gdb/symmisc.c584
-rw-r--r--gnu/usr.bin/gdb/symseg.h523
-rw-r--r--gnu/usr.bin/gdb/symtab.c2473
-rw-r--r--gnu/usr.bin/gdb/symtab.h384
-rw-r--r--gnu/usr.bin/gdb/utils.c1096
-rw-r--r--gnu/usr.bin/gdb/valarith.c690
-rw-r--r--gnu/usr.bin/gdb/valops.c1418
-rw-r--r--gnu/usr.bin/gdb/valprint.c1430
-rw-r--r--gnu/usr.bin/gdb/value.h212
-rw-r--r--gnu/usr.bin/gdb/values.c1059
-rw-r--r--gnu/usr.bin/gdb/version.c20
-rw-r--r--gnu/usr.bin/gdb/wait.h81
-rw-r--r--gnu/usr.bin/gdb/xgdb/Makefile33
-rw-r--r--gnu/usr.bin/gdb/xgdb/xgdb.c700
320 files changed, 148765 insertions, 53565 deletions
diff --git a/gnu/usr.bin/gdb/COPYING b/gnu/usr.bin/gdb/COPYING
index 9a1703758111..a43ea2126fb6 100644
--- a/gnu/usr.bin/gdb/COPYING
+++ b/gnu/usr.bin/gdb/COPYING
@@ -1,38 +1,40 @@
-
GNU GENERAL PUBLIC LICENSE
- Version 1, February 1989
+ Version 2, June 1991
- Copyright (C) 1989 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
- The license agreements of most software companies try to keep users
-at the mercy of those companies. By contrast, our General Public
+ 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. The
-General Public License applies to the Free Software Foundation's
-software and to any other program whose authors commit to using it.
-You can use it for your programs, too.
+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. Specifically, the General Public License is designed to make
-sure that you have the freedom to give away or sell copies of free
-software, 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.
+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 a such a program, whether
+ 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 tell them their rights.
+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,
@@ -45,120 +47,207 @@ 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.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- 0. This License Agreement 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 work containing the
-Program or a portion of it, either verbatim or with modifications. Each
-licensee is addressed as "you".
-
- 1. 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
-General Public License and to the absence of any warranty; and give any
-other recipients of the Program a copy of this General Public License
-along with the Program. You may charge a fee for the physical act of
-transferring a copy.
-
- 2. You may modify your copy or copies of the Program or any portion of
-it, and copy and distribute such modifications under the terms of Paragraph
-1 above, provided that you also do the following:
-
- a) cause the modified files to carry prominent notices stating that
- you changed the files and the date of any change; and
-
- b) cause the whole of any work that you distribute or publish, that
- in whole or in part contains the Program or any part thereof, either
- with or without modifications, to be licensed at no charge to all
- third parties under the terms of this General Public License (except
- that you may choose to grant warranty protection to some or all
- third parties, at your option).
-
- c) If the modified program normally reads commands interactively when
- run, you must cause it, when started running for such interactive use
- in the simplest and most usual 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 General
- Public License.
-
- d) 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.
-
-Mere aggregation of another independent work with the Program (or its
-derivative) on a volume of a storage or distribution medium does not bring
-the other work under the scope of these terms.
+ 0. 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.
+
+ 1. 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.
+
+ 2. 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:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) 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.
+
+ c) 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.)
- 3. You may copy and distribute the Program (or a portion or derivative of
-it, under Paragraph 2) in object code or executable form under the terms of
-Paragraphs 1 and 2 above provided that you also do one of the following:
-
- a) accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of
- Paragraphs 1 and 2 above; or,
-
- b) accompany it with a written offer, valid for at least three
- years, to give any third party free (except for a nominal charge
- for the cost of distribution) a complete machine-readable copy of the
- corresponding source code, to be distributed under the terms of
- Paragraphs 1 and 2 above; or,
-
- c) accompany it with the information you received as to where the
- corresponding source code may be obtained. (This alternative is
+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.
+
+ 3. 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:
+
+ a) 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,
+
+ b) 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,
+
+ c) 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 alone.)
-
-Source code for a work means the preferred form of the work for making
-modifications to it. For an executable file, complete source code means
-all the source code for all modules it contains; but, as a special
-exception, it need not include source code for modules which are standard
-libraries that accompany the operating system on which the executable
-file runs, or for standard header files or definitions files that
-accompany that operating system.
-
- 4. You may not copy, modify, sublicense, distribute or transfer the
-Program except as expressly provided under this General Public License.
-Any attempt otherwise to copy, modify, sublicense, distribute or transfer
-the Program is void, and will automatically terminate your rights to use
-the Program under this License. However, parties who have received
-copies, or rights to use copies, from you under this General Public
-License will not have their licenses terminated so long as such parties
-remain in full compliance.
-
- 5. By copying, distributing or modifying 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.
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+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.
+
+ 4. 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.
+
+ 5. 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.
6. 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.
+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.
+
+ 7. 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.
- 7. The Free Software Foundation may publish revised and/or new versions
+ 8. 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.
+
+ 9. 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 the license which applies to it and "any
+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
-the license, you may choose any version ever published by the Free Software
+this License, you may choose any version ever published by the Free Software
Foundation.
- 8. If you wish to incorporate parts of the Program into other free
+ 10. 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
@@ -168,7 +257,7 @@ of promoting the sharing and reuse of software generally.
NO WARRANTY
- 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+ 11. 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
@@ -178,7 +267,7 @@ 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.
- 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+ 12. 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
@@ -193,22 +282,21 @@ POSSIBILITY OF SUCH DAMAGES.
Appendix: 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 humanity, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these
-terms.
+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.
+ 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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <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 1, or (at your option)
- any later version.
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -224,26 +312,28 @@ 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:
- Gnomovision version 69, Copyright (C) 19xx name of author
+ Gnomovision version 69, Copyright (C) 19yy 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.
-The hypothetical commands `show w' and `show c' should show the
-appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than `show w' and `show
-c'; they could even be mouse-clicks or menu items--whatever suits your
-program.
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `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 a sample; alter the names:
+necessary. Here is a sample; alter the names:
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- program `Gnomovision' (a program to direct compilers to make passes
- at assemblers) written by James Hacker.
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
-That's all there is to it!
+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.
diff --git a/gnu/usr.bin/gdb/COPYING.LIB b/gnu/usr.bin/gdb/COPYING.LIB
new file mode 100644
index 000000000000..eb685a5ec981
--- /dev/null
+++ b/gnu/usr.bin/gdb/COPYING.LIB
@@ -0,0 +1,481 @@
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, 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 library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, 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 companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, 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 library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete 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 distribute a copy of this License along with the
+Library.
+
+ 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.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+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 Library, 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 Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you 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.
+
+ If distribution of 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 satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ c) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ d) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. 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.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library 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.
+
+ 9. 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 Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+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.
+
+ 11. 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 Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library 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 Library.
+
+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.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library 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.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Library 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 Library
+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 Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+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.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "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
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. 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 LIBRARY 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
+LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. 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.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This 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.
+
+ This 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 this library; if not, write to the Free
+ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/gnu/usr.bin/gdb/ChangeLog b/gnu/usr.bin/gdb/ChangeLog
deleted file mode 100644
index 1f2342b797a7..000000000000
--- a/gnu/usr.bin/gdb/ChangeLog
+++ /dev/null
@@ -1,4887 +0,0 @@
-Thu Feb 8 01:11:55 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * GDB 3.5 released.
-
- * version.c: Change version number to 3.5
-
-Tue Feb 6 15:58:06 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * m-hp9k320.h: define ATTACH_DETACH.
- hp9k320-dep.c [ATTACH_DETACH]: New code.
-
-Thu Feb 1 17:43:00 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * valprint.c (is_nan, val_print): Use char * not void *.
-
- * symmisc.c (print_symbol): Print newline after label.
-
-Tue Jan 30 15:35:52 1990 Jim Kingdon (kingdon at albert.ai.mit.edu)
-
- * Makefile.dist (READLINE): Add {readline,history}.texinfo.
-
- * m-merlin.h: Put in clarifying comments about SHELL_FILE.
- config.gdb (merlin): Explain about /usr/local/lib/gdb-sh.
-
-Sat Jan 27 02:30:27 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
-
- * version.c: Change version number to 3.5alpha.1.
-
- * dbxread.c (process_one_symbol): Compare context_stack_depth
- with !VARIABLES_INSIDE_BLOCK, not VARIABLES_INSIDE_BLOCK.
-
-Fri Jan 26 01:21:51 1990 Jim Kingdon (kingdon at mole.ai.mit.edu)
-
- * main.c [ALIGN_STACK_ON_STARTUP]: New code.
- m-i386.h: Define ALIGN_STACK_ON_STARTUP.
-
- * m-merlin.h (NO_SIGINTERRUPT, SHELL_FILE): Define.
-
- * umax-dep.c (exec_file_command): Add commas to call to
- read_section_hdr.
-
-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 depen_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
- inflo, m-sun3.h: Cleaned up dealings with
- functions returning structu0 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 sure currently configured machine
- dependent files come first in e 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
-eval: (auto-fill-mode 1)
-left-margin: 8
-fill-column: 74
-version-control: never
-End:
-
- 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/gnu/usr.bin/gdb/Gdbinit b/gnu/usr.bin/gdb/Gdbinit
deleted file mode 100644
index bcacd5dc7e84..000000000000
--- a/gnu/usr.bin/gdb/Gdbinit
+++ /dev/null
@@ -1,15 +0,0 @@
-echo Setting up the environment for debugging gdb.\n
-
-b fatal
-
-b info_command
-commands
- silent
- return
-end
-
-define rr
- run
-end
-
-set prompt (top-gdb)
diff --git a/gnu/usr.bin/gdb/Makefile b/gnu/usr.bin/gdb/Makefile
index 550ed07a7575..8536444cda0b 100644
--- a/gnu/usr.bin/gdb/Makefile
+++ b/gnu/usr.bin/gdb/Makefile
@@ -1,38 +1,3 @@
-# @(#)Makefile 6.4 (Berkley) 5/6/91
+SUBDIR= bfd libiberty mmalloc gdb
-PROG= gdb
-GDBSRCS= blockframe.c breakpoint.c command.c copying.c core.c \
- cplus-dem.c dbxread.c environ.c eval.c expprint.c \
- expread.y findvar.c infcmd.c inflow.c infrun.c \
- main.c obstack.c printcmd.c regex.c remote.c \
- remote-sl.c source.c stack.c symmisc.c symtab.c \
- utils.c valarith.c valops.c valprint.c values.c \
- version.c
-READLINESRCS= funmap.c history.c keymaps.c readline.c
-SRCS= $(CONFIGSRCS) $(GDBSRCS) $(READLINESRCS) init.c
-CFLAGS+= -I. -I$(.CURDIR) -I$(.CURDIR)/config -I$(.CURDIR)/readline \
- -DHAVE_VPRINTF -DVI_MODE -DKERNELDEBUG -DNEWVM
-LDADD= -ltermcap
-YFLAGS=
-.PATH: $(.CURDIR)/config $(.CURDIR)/readline
-
-depend:
-
-.include "config/Makefile.$(MACHINE)"
-.include <bsd.prog.mk>
-
-$(OBJS): param.h
-
-#
-# Generate the constructor
-#
-init.c: $(CONFIGSRCS) $(GDBSRCS) $(READLINESRCS)
- -((cd $(.CURDIR)/config; \
- egrep -h '^_initialize_[^ ]* *\(\)' $(CONFIGSRCS)); \
- (cd $(.CURDIR); egrep -h '^_initialize_[^ ]* *\(\)' $(GDBSRCS)); \
- (cd $(.CURDIR)/readline; \
- egrep -h '^_initialize_[^ ]* *\(\)' $(READLINESRCS))) | \
- (echo 'void initialize_all_files () {'; sed -e 's/$$/;/'; echo '}') \
- > init.c
-
-CLEANFILES+= init.c param.h
+.include <bsd.subdir.mk>
diff --git a/gnu/usr.bin/gdb/Makefile.dist b/gnu/usr.bin/gdb/Makefile.dist
deleted file mode 100644
index 3cbc91f9786f..000000000000
--- a/gnu/usr.bin/gdb/Makefile.dist
+++ /dev/null
@@ -1,371 +0,0 @@
-/* This file should be run through the C preprocessor by config.gdb
- to produce the Makefile. */
-
-/* Define this to xgdb if you want to compile xgdb as well as gdb. */
-XGDB=
-/* Place to install binaries. */
-bindir=/usr/local/bin
-/* Place to install X binaries. */
-xbindir=$(bindir)
-
-/* System V: If you compile gdb with a compiler which uses the coff
- encapsulation feature (this is a function of the compiler used, NOT
- of the m-?.h file selected by config.gdb), you must make sure that
- the GNU nm is the one that is used by munch. */
-
-/* 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 and readline.c
- will be incorrectly compiled. The "fixincludes" script in the gcc
- distribution will fix your include files up. */
-/* CC=gcc -traditional */
-CC=cc
-
-/* 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
- is where it should be according to Posix). */
-
-YACC=bison -y -v
-/* YACC=yacc */
-SHELL=/bin/sh
-MAKE=make
-
-/* Set this up with gcc if you have gnu ld and the loader will print out
- line numbers for undefinded refs. */
-/* CC-LD=gcc -static */
-CC-LD=${CC}
-
-/* If you are using the GNU C library, uncomment the following line. */
-/* HAVE_VPRINTF_DEFINE = -DHAVE_VPRINTF */
-
-/* -I. for "#include <obstack.h>". Possibly regex.h also. */
-
-/* M_CFLAGS, if defined, has system-dependent CFLAGS. */
-#if !defined(M_CFLAGS)
-#define M_CFLAGS
-#endif
-
-/* CFLAGS for both GDB and readline. */
-GLOBAL_CFLAGS = -g M_CFLAGS
-CFLAGS = -I. ${HAVE_VPRINTF_DEFINE} ${GLOBAL_CFLAGS}
-/* None of the things in CFLAGS will do any harm, and on some systems
- (e.g. SunOS4) it is important to use the M_CFLAGS. */
-LDFLAGS = $(CFLAGS)
-
-/*
- define this to be "obstack.o" if you don't have the obstack library installed
- you must at the same time define OBSTACK1 as "obstack.o"
- so that the dependencies work right. Similarly with REGEX and "regex.o".
- You must define REGEX and REGEX1 on USG machines.
- If your sysyem is missing alloca(), or, more likely, it's there but
- it doesn't work, define ALLOCA & ALLOCA1 */
-OBSTACK = obstack.o
-OBSTACK1 = obstack.o
-
-#ifdef M_REGEX
-REGEX = M_REGEX
-REGEX1 = M_REGEX
-#else
-REGEX =
-REGEX1 =
-#endif
-
-#ifdef M_ALLOCA
-ALLOCA = M_ALLOCA
-ALLOCA1 = M_ALLOCA
-#else
-ALLOCA =
-ALLOCA1 =
-#endif
-
-/*
- define this to be "malloc.o" if you want to use the gnu malloc routine
- (useful for debugging memory allocation problems in gdb). Otherwise, leave
- it blank. */
-/* GNU_MALLOC = */
-GNU_MALLOC = malloc.o
-
-/* Flags to be used in compiling malloc.o
- Specify range checking for storage allocation. */
-/* MALLOC_FLAGS = ${CFLAGS} */
-MALLOC_FLAGS = ${CFLAGS} -Drcheck -Dbotch=fatal_dump_core -DMSTATS
-
-/* Define SYSV if compiling on a system V or HP machine. */
-#ifdef M_SYSV
-SYSV_DEFINE = -DSYSV
-#else
-SYSV_DEFINE =
-#endif
-
-/* MUNCH_DEFINE should be -DSYSV if have System V-style nm,
- or null if have BSD-style nm. */
-#ifdef M_BSD_NM
-MUNCH_DEFINE =
-#else
-MUNCH_DEFINE = ${SYSV_DEFINE}
-#endif
-
-/* Flags that describe where you can find the termcap library.
- You may need to make other arrangements for USG. */
-TERMCAP = -ltermcap
-
-/* M_CLIBS, if defined, has system-dependent libs
- For example, -lPW for System V to get alloca(). */
-#ifndef M_CLIBS
-#define M_CLIBS
-#endif
-CLIBS = ${ADD_FILES} ${TERMCAP} M_CLIBS
-
-ADD_FILES = ${OBSTACK} ${REGEX} ${ALLOCA} ${GNU_MALLOC}
-ADD_DEPS = ${OBSTACK1} ${REGEX1} ${ALLOCA1} ${GNU_MALLOC}
-
-SFILES = blockframe.c breakpoint.c dbxread.c coffread.c command.c core.c \
- environ.c eval.c expprint.c findvar.c infcmd.c inflow.c infrun.c \
- kdb-start.c main.c printcmd.c \
- remote.c source.c stack.c standalone.c stuff.c symmisc.c symtab.c \
- utils.c valarith.c valops.c valprint.c values.c version.c expread.y \
- xgdb.c
-
-DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
- sparc-dep.c hp9k320-dep.c hp300bsd-dep.c news-dep.c i386-dep.c \
- symmetry-dep.c convex-dep.c altos-dep.c isi-dep.c pyr-dep.c
-
-PINSNS = gld-pinsn.c i386-pinsn.c sparc-pinsn.c vax-pinsn.c m68k-pinsn.c \
- ns32k-pinsn.c convex-pinsn.c pyr-pinsn.c
-
-HFILES = command.h defs.h environ.h expression.h frame.h getpagesize.h \
- inferior.h symseg.h symtab.h value.h wait.h \
- a.out.encap.h a.out.gnu.h stab.gnu.h
-
-OPCODES = m68k-opcode.h pn-opcode.h sparc-opcode.h npl-opcode.h vax-opcode.h \
- ns32k-opcode.h convex-opcode.h pyr-opcode.h
-
-MFILES = m-hp9k320.h m-hp300bsd.h m-i386.h m-i386gas.h \
- m-i386-sv32.h m-i386g-sv32.h m-isi.h m-merlin.h \
- m-altos.h m-news.h m-newsos3.h m-npl.h m-pn.h \
- m-sparc.h m-sun2.h m-sun3.h m-sun2os4.h \
- m-sun3os4.h m-sun4os4.h m-umax.h m-vax.h m-symmetry.h m-convex.h \
- m-pyr.h
-
-/* This list of files really shouldn't be in this makefile, but I can't think
- of any good way to get the readline makefile to tell us what files
- to put in our tarfile. */
-READLINE = readline.c history.c funmap.c \
- emacs_keymap.c vi_keymap.c vi_mode.c keymaps.c \
- readline.h history.h keymaps.h chardefs.h \
- inc-readline.texinfo inc-history.texinfo \
- readline.texinfo history.texinfo \
- Makefile ChangeLog
-
-REMOTE_EXAMPLES = remote-sa.m68k.shar remote-multi.shar
-
-POSSLIBS = obstack.h obstack.c regex.c regex.h malloc.c alloca.c
-
-TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c
-
-OTHERS = Makefile.dist createtags munch config.gdb ChangeLog README TAGS \
- gdb.texinfo .gdbinit COPYING expread.tab.c stab.def \
- XGDB-README copying.c Projects Convex.notes copying.awk hp-include
-
-TAGFILES = ${SFILES} ${DEPFILES} ${PINSNS} ${HFILES} ${OPCODES} ${MFILES} \
- ${POSSLIBS}
-TARFILES = ${TAGFILES} ${OTHERS} ${REMOTE_EXAMPLES}
-
-OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
- values.o eval.o valops.o valarith.o valprint.o printcmd.o \
- symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o \
- command.o utils.o expread.o expprint.o pinsn.o environ.o version.o \
- copying.o ${READLINEOBS}
-
-TSOBS = core.o inflow.o dep.o
-
-NTSOBS = standalone.o
-
-TSSTART = /lib/crt0.o
-
-NTSSTART = kdb-start.o
-
-RL_LIB = readline/libreadline.a
-
-/* Do some fancy trickery to produce a line like
- -DM_MAKEDEFINE="-DM_SYSV -DM_BSD_NM".
-*/
-MD=M_MAKEDEFINE
-
-/* Avoid funny things that Sun's make throws in for us. */
-/* TARGET_ARCH is supposed to get around it putting in the machine type.
- If the "things" up there really is plural, we'll need to do something
- else as well. */
-/*.c.o:
- ${CC} -c ${CFLAGS} $< */
-TARGET_ARCH=
-
-all: gdb $(XGDB)
-
-install: gdb $(XGDB)
- cp gdb $(bindir)/gdb.new
- mv $(bindir)/gdb.new $(bindir)/gdb
- -if [ "$(XGDB)" = xgdb ]; then \
- cp xgdb $(xbindir)/xgdb.new; \
- mv $(xbindir)/xgdb.new $(xbindir)xgdb; \
- fi
-
-gdb : $(OBS) $(TSOBS) ${ADD_DEPS} ${RL_LIB}
- rm -f init.c
- ./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
- ${CC-LD} $(LDFLAGS) -o gdb init.c $(OBS) $(TSOBS) ${RL_LIB} $(CLIBS)
-
-/* This is useful when debugging GDB, because Unix doesn't let you run GDB
- on itself without copying the executable. So "make gdb1" will make
- gdb and put a copy in gdb1, and you can run it with "gdb gdb1". */
-gdb1 : gdb
- cp gdb gdb1
-
-Makefile : Makefile.dist
- cp Makefile.dist tmp.c
- $(CC) -E >Makefile tmp.c $(MD) "-DM_MAKEDEFINE=$(MD)"
- -rm tmp.c
-/* This did not work-- -Usparc became "-Usparc" became "-Usparc.
- Or something like that. */
-/* $(CC) -E >Makefile tmp.c $(MD) "-DM_MAKEDEFINE=\"$(MD)\"" */
-
-xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS} ${RL_LIB}
- rm -f init.c
- ./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) xgdb.o > init.c
- $(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
- -lXaw -lXmu -lXt -lX11 ${RL_LIB} $(CLIBS)
-
-/* Old (pre R3) xgdb comp.
- $(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
- -lXaw -lXt -lX11 $(CLIBS) */
-
-kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${RL_LIB}
- rm -f init.c
- ./munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
- $(CC) $(LDFLAGS) -c init.c $(CLIBS)
- ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o ${RL_LIB} -lc $(CLIBS)
-
-/* If it can figure out the appropriate order, createtags will make sure
- that the proper m-*, *-dep, *-pinsn, and *-opcode files come first
- in the tags list. It will attempt to do the same for dbxread.c and
- coffread.c. This makes using M-. on machine dependent routines much
- easier. */
-
-TAGS: ${TAGFILES}
- createtags ${TAGFILES}
-tags: TAGS
-
-gdb.tar: ${TARFILES}
- rm -f gdb.tar
- mkdir dist-gdb
- cd dist-gdb ; for i in ${TARFILES} ; do ln -s ../$$i . ; done
- mkdir dist-gdb/readline
- cd dist-gdb/readline ; for i in ${READLINE} ; do ln -s ../../readline/$$i . ; done
- tar chf gdb.tar dist-gdb
- rm -rf dist-gdb
-
-/* Remove gdb.tar.Z so stupid compress doesn't ask whether we want to
- overwrite it. compress -f is not what we want, because we do want
- to know if compress would not make it smaller. */
-gdb.tar.Z: gdb.tar
- if [ -f gdb.tar.Z ]; then rm -f gdb.tar.Z; else true; fi
- compress gdb.tar
-
-clean:
- rm -f ${OBS} ${TSOBS} ${NTSOBS} ${OBSTACK} ${REGEX} ${GNU_MALLOC}
- rm -f init.c init.o
- rm -f xgdb.o xgdb
- rm -f gdb core gdb.tar gdb.tar.Z make.log
- rm -f gdb[0-9]
- cd readline ; make clean
-
-distclean: clean expread.tab.c TAGS
- rm -f dep.c opcode.h param.h pinsn.c config.status
- rm -f y.output yacc.acts yacc.tmp
- rm -f ${TESTS} Makefile
-
-realclean: clean
- rm -f expread.tab.c TAGS
- rm -f dep.c opcode.h param.h pinsn.c config.status
- rm -f Makefile
-
-xgdb.o : defs.h param.h symtab.h frame.h
-
-/* Make copying.c from COPYING */
-copying.c : COPYING copying.awk
- awk -f copying.awk < COPYING > copying.c
-
-expread.tab.c : expread.y
- @echo 'Expect 4 shift/reduce conflict.'
- ${YACC} expread.y
- mv y.tab.c expread.tab.c
-
-expread.o : expread.tab.c defs.h param.h symtab.h frame.h expression.h
- $(CC) -c ${CFLAGS} expread.tab.c
- mv expread.tab.o expread.o
-
-readline/libreadline.a : force_update
- cd readline ; ${MAKE} "SYSV=${SYSV_DEFINE}" \
- "DEBUG_FLAGS=${GLOBAL_CFLAGS}" "CC=${CC}" libreadline.a
-
-force_update :
-
-/* Only useful if you are using the gnu malloc routines. */
-malloc.o : malloc.c
- ${CC} -c ${MALLOC_FLAGS} malloc.c
-
-/* dep.o depends on config.status in case someone reconfigures gdb out
- from under an already compiled gdb. */
-dep.o : dep.c config.status defs.h param.h frame.h inferior.h obstack.h \
- a.out.encap.h
-
-/* pinsn.o depends on config.status in case someone reconfigures gdb out
- from under an already compiled gdb. */
-pinsn.o : pinsn.c config.status defs.h param.h symtab.h obstack.h symseg.h \
- frame.h opcode.h
-
-/* The rest of this is a standard dependencies list (hand edited output of
- cpp -M). It does not include dependencies of .o files on .c files. */
-/* All files which depend on config.status also depend on param.h in case
- someone reconfigures gdb out from under an already compiled gdb. */
-blockframe.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h
-breakpoint.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h
-coffread.o : defs.h param.h config.status
-command.o : command.h defs.h
-core.o : defs.h param.h config.status a.out.encap.h
-dbxread.o : param.h config.status defs.h symtab.h obstack.h symseg.h a.out.encap.h \
- stab.gnu.h
-environ.o : environ.h
-eval.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h expression.h
-expprint.o : defs.h symtab.h obstack.h symseg.h param.h config.status expression.h
-findvar.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h value.h
-infcmd.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h inferior.h \
- environ.h value.h
-inflow.o : defs.h param.h config.status frame.h inferior.h
-infrun.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h inferior.h \
- wait.h
-kdb-start.o : defs.h param.h config.status
-main.o : defs.h command.h param.h config.status
-malloc.o : getpagesize.h
-obstack.o : obstack.h
-printcmd.o : defs.h param.h config.status frame.h symtab.h obstack.h symseg.h value.h \
- expression.h
-regex.o : regex.h
-remote.o : defs.h param.h config.status frame.h inferior.h wait.h
-source.o : defs.h symtab.h obstack.h symseg.h param.h config.status
-stack.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h
-standalone.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h \
- inferior.h wait.h
-symmisc.o : defs.h symtab.h obstack.h symseg.h obstack.h
-symtab.o : defs.h symtab.h obstack.h symseg.h param.h config.status obstack.h
-utils.o : defs.h param.h config.status
-valarith.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h expression.h
-valops.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h frame.h \
- inferior.h
-valprint.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h
-values.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h
-
-robotussin.h : getpagesize.h
-symtab.h : obstack.h symseg.h
-a.out.encap.h : a.out.gnu.h
-
diff --git a/gnu/usr.bin/gdb/Projects b/gnu/usr.bin/gdb/Projects
deleted file mode 100644
index f38f6c74e959..000000000000
--- a/gnu/usr.bin/gdb/Projects
+++ /dev/null
@@ -1,114 +0,0 @@
-
- Suggested projects for aspiring or current GDB hackers
- ======================================================
-
- (You should probably chat with kingdon@ai.mit.edu to make sure that
- no one else is doing the project you chose).
-
-Add watchpoints (break if a memory location changes). This would
-usually have to involve constant single stepping, but occasionally
-there is operating system support which gdb should be able to cleanly
-use (e.g. on the 80386, there are 4 debug registers. By ptracing an
-address into them, you can get a trap on writes or on reads and
-writes).
-
-Rewrite proceed, wait_for_inferior, and normal_stop to clean them up.
-Suggestions:
-
- 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?
-
-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.
-
-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.
-
-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.
-
-Make "handle" understand symbolic signal names.
-
-Work out and implement a reasonably general mechanism for multi-threaded
-processies. There are parts of one implemented in convex-dep.c, if
-you want an example.
-
-A standalone version of gdb on the i386 exists. Anyone who wants to
-do some serious working cleaning it up and making it a general
-standalone gdb should contact pace@wheaties.ai.mit.edu.
-
-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"?).
-
-Implement support for specifying arbitrary locations of stack frames
-(in practice, this usually requires specification of both the top and
-bottom of the stack frame (fp and sp), since you *must* retrieve the
-pc that was saved in the innermost frame).
-
-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.
-
-Work out some method of saving breakpoints across the reloading of an
-executable. Probably this should be by saving the commands by which
-the breakpoints were set and re-executing them (as text locations may
-change).
-
-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.
-
-Rewrite macros that handle frame chaining and frameless functions.
-They should be able to tell the difference between start, main, and a
-frameless function called from main.
-
-Work out what information would need to be included in an executable
-by the compiler to allow gdb to debug functions which do not have a
-frame pointer. Modify gdb and gcc to do this.
-
-When `attached' to a program (via either OS support or remote
-debugging), gdb should arrange to catch signals which the terminal
-might send, as it is unlikely that the program will be able to notice
-them. SIGINT and SIGTSTP are obvious examples.
-
-Enhance the gdb manual with extra examples where needed.
-
-Arrange for list_command not to use decode_line_1 and thus not require
-symbols to be read in simply to read a source file.
-
-Problem in xgdb; the readline library needs the terminal in CBREAK
-mode for command line editing, but this makes it difficult to dispatch
-on button presses. Possible solution: use a define to replace getc in
-readline.c with a routine that does button dispatches. You should
-probably see XGDB-README before you fiddle with XGDB. Also, someone
-is implementing a new xgdb; it may not be worth while fiddling with
-the old one.
-
-# Local Variables:
-# mode: text
-# End:
diff --git a/gnu/usr.bin/gdb/README.FreeBSD b/gnu/usr.bin/gdb/README.FreeBSD
new file mode 100644
index 000000000000..75a30b2cb431
--- /dev/null
+++ b/gnu/usr.bin/gdb/README.FreeBSD
@@ -0,0 +1,15 @@
+This is a greatly pared down version of GDB-4.12 for FreeBSD 1.1.5 that
+supports debugging of shared executables and the new a.out format.
+
+I've collapsed some of the directories and removed lots of files from others.
+All that's included is those necessary to compile on FreeBSD 1.1.5, this was
+to keep the replacement for GDB-3 compact since none of the multiple
+architecture stuff is used. All the documentation has been put in the doc/
+directory.
+
+A full port of each library will probably be done for FreeBSD 2.0 and
+included as system libraries so that other build tools can share them.
+At that time a more complete port of GDB-4 will be done that allows
+configuration for different systems and uses the full libraries.
+
+paul@freefall.cdrom.com
diff --git a/gnu/usr.bin/gdb/README.gnu b/gnu/usr.bin/gdb/README.gnu
deleted file mode 100644
index fa54dec236fd..000000000000
--- a/gnu/usr.bin/gdb/README.gnu
+++ /dev/null
@@ -1,142 +0,0 @@
-This is GDB, the GNU source-level debugger, presently running under un*x.
-
-Before compiling GDB, you must tell GDB what kind of machine you are
-running on. To do this, type `config.gdb machine', where machine is
-something like `vax' or `sun2'. For a list of valid machine types,
-type `config.gdb'.
-
-Normally config.gdb edits the makefile as necessary. If you have to
-edit the makefile on a standard machine listed in config.gdb this
-should be considered a bug and reported as such.
-
-Once these files are set up, just `make' will do everything,
-producing an executable `gdb' in this directory.
-
-If you want a new (current to this release) version of the manual, you
-will have to use the gdb.texinfo file provided with this distribution.
-The gdb.texinfo file requires the texinfo-format-buffer command from
-emacs 18.55 or later.
-
-About languages other than C...
-
-C++ support has been integrated into gdb. GDB should work with
-FORTRAN programs (if you have problem, please send a bug report), but
-I am not aware of anyone who is working on getting it to use the
-syntax of any language other than C or C++. Pascal programs which use
-sets, subranges, file variables, or nested functions will not
-currently work.
-
-About -gg format...
-
-Currently GDB version 3.x does *not* support GCC's -gg format. This
-is because it (in theory) has fast enough startup on dbx debugging
-format object files that -gg format is unnecessary (and hence
-undesirable, since it wastes space and processing power in gcc). I
-would like to hear people's opinions on the amount of time currently
-spent in startup; is it fast enough?
-
-About remote debugging...
-
-The two files remote-multi.shar and remote-sa.m68k.shar contain two
-examples of a remote stub to be used with remote.c. The the -multi
-file is a general stub that can probably be running on various
-different flavors of unix to allow debugging over a serial line from
-one machine to another. The remote-sa.m68k.shar is designed to run
-standalone on a 68k type cpu and communicate properley with the
-remote.c stub over a serial line.
-
-About reporting bugs...
-
-The correct address for reporting bugs found with gdb is
-"bug-gdb@prep.ai.mit.edu". Please send all bugs to that address.
-
-About xgdb...
-
-xgdb.c was provided to us by the user community; it is not an integral
-part of the gdb distribution. The problem of providing visual
-debugging support on top of gdb is peripheral to the GNU project and
-(at least right now) we can't afford to put time into it. So while we
-will be happy to incorporate user fixes to xgdb.c, we do not guarantee
-that it will work and we will not fix bugs reported in it. Someone is
-working on writing a new XGDB, so improving (e.g. by fixing it so that
-it will work, if it doesn't currently) the current one is not worth it.
-
-For those intersted in auto display of source and the availability of
-an editor while debugging I suggest trying gdb-mode in gnu-emacs.
-Comments on this mode are welcome.
-
-About the machine-dependent files...
-
-m-<machine>.h (param.h is a link to this file).
-This file contains macro definitions that express information
-about the machine's registers, stack frame format and instructions.
-
-<machine>-opcode.h (opcode.h is a link to this file).
-<machine>-pinsn.c (pinsn.c is a link to this file).
-These files contain the information necessary to print instructions
-for your cpu type.
-
-<machine>-dep.c (dep.c is a link to this file).
-Those routines which provide a low level interface to ptrace and which
-tend to be machine-dependent. (The machine-independent routines are in
-`infrun.c' and `inflow.c')
-
-About writing code for GDB...
-
-We appreciate having users contribute code that is of general use, but
-for it to be included in future GDB releases it must be cleanly
-written. We do not want to include changes that will needlessly make future
-maintainance difficult. It is not much harder to do things right, and
-in the long term it is worth it to the GNU project, and probably to
-you individually as well.
-
-Please code according to the GNU coding standards. If you do not have
-a copy, you can request one by sending mail to gnu@prep.ai.mit.edu.
-
-Please try to avoid making machine-specific changes to
-machine-independent files (i.e. all files except "param.h" and
-"dep.c". "pinsn.c" and "opcode.h" are processor-specific but not
-operating system-dependent). If this is unavoidable, put a hook in
-the machine-independent file which calls a (possibly)
-machine-dependent macro (for example, the IGNORE_SYMBOL macro can be
-used for any symbols which need to be ignored on a specific machine.
-Calling IGNORE_SYMBOL in dbxread.c is a lot cleaner than a maze of #if
-defined's). The machine-independent code should do whatever "most"
-machines want if the macro is not defined in param.h. Using #if
-defined can sometimes be OK (e.g. SET_STACK_LIMIT_HUGE) but should be
-conditionalized on a specific feature of an operating system (set in
-param.h) rather than something like #if defined(vax) or #if
-defined(SYSV).
-
-It is better to replace entire routines which may be system-specific,
-rather than put in a whole bunch of hooks which are probably not going
-to be helpful for any purpose other than your changes. For example,
-if you want to modify dbxread.c to deal with DBX debugging symbols
-which are in COFF files rather than BSD a.out files, do something
-along the lines of a macro GET_NEXT_SYMBOL, which could have
-different definitions for COFF and a.out, rather than trying to put
-the necessary changes throughout all the code in dbxread.c that
-currently assumes BSD format.
-
-Please avoid duplicating code. For example, if something needs to be
-changed in read_inferior_memory, it is very painful because there is a
-copy in every dep.c file. The correct way to do this is to put (in
-this case) the standard ptrace interfaces in a separate file ptrace.c,
-which is used by all systems which have ptrace. ptrace.c would deal
-with variations between systems the same way any system-independent
-file would (hooks, #if defined, etc.).
-
-About debugging gdb with itself...
-
-You probably want to do a "make TAGS" after you configure your
-distribution; this will put the machine dependent routines for your
-local machine where they will be accessed first by a M-period .
-
-Also, make sure that you've compiled gdb with your local cc or taken
-appropriate precautions regarding ansification of include files. See
-the Makefile for more information.
-
-The "info" command, when executed without a subcommand in a gdb being
-debugged by gdb, will pop you back up to the top level gdb. See
-.gdbinit for more details.
-
diff --git a/gnu/usr.bin/gdb/VERSION b/gnu/usr.bin/gdb/VERSION
new file mode 100644
index 000000000000..b849ff8ebf1f
--- /dev/null
+++ b/gnu/usr.bin/gdb/VERSION
@@ -0,0 +1 @@
+4.11
diff --git a/gnu/usr.bin/gdb/XGdbinit.samp b/gnu/usr.bin/gdb/XGdbinit.samp
deleted file mode 100644
index a99f10695606..000000000000
--- a/gnu/usr.bin/gdb/XGdbinit.samp
+++ /dev/null
@@ -1,15 +0,0 @@
-button "show" push-to-file %S
-button "back" pop-file
-button "break in" break %S
-button "break at" break %l
-button delete delete %b%e
-button backtrace
-button up
-button down
-button print print %E
-button print* print *(%E)
-button next
-button step
-button "do upto" until %l%e
-button finish
-button continue cont%e
diff --git a/gnu/usr.bin/gdb/Xgdb.ad b/gnu/usr.bin/gdb/Xgdb.ad
deleted file mode 100644
index 5f9fe9920b49..000000000000
--- a/gnu/usr.bin/gdb/Xgdb.ad
+++ /dev/null
@@ -1,8 +0,0 @@
-Xgdb*geometry: 580x874-0+28
-Xgdb*src*scrollVertical: whenneeded
-Xgdb*src*scrollHorizontal: whenneeded
-Xgdb*src*wrap: never
-Xgdb*src*editType: read
-Xgdb*frame.buttons.allowResize: true
-Xgdb*frame.buttons.skipAdjust: true
-Xgdb*frame*showGrip: false
diff --git a/gnu/usr.bin/gdb/bfd/COPYING b/gnu/usr.bin/gdb/bfd/COPYING
new file mode 100644
index 000000000000..a43ea2126fb6
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ 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.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. 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.
+
+ 1. 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.
+
+ 2. 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:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) 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.
+
+ c) 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.)
+
+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.
+
+ 3. 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:
+
+ a) 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,
+
+ b) 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,
+
+ c) 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.)
+
+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.
+
+ 4. 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.
+
+ 5. 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.
+
+ 6. 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.
+
+ 7. 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.
+
+ 8. 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.
+
+ 9. 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.
+
+ 10. 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.
+
+ NO WARRANTY
+
+ 11. 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.
+
+ 12. 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 OF TERMS AND CONDITIONS
+
+ Appendix: 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.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+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:
+
+ Gnomovision version 69, Copyright (C) 19yy 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.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `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:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+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.
diff --git a/gnu/usr.bin/gdb/bfd/Makefile b/gnu/usr.bin/gdb/bfd/Makefile
new file mode 100644
index 000000000000..ea29afed0d86
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/Makefile
@@ -0,0 +1,17 @@
+LIB = bfd
+SRCS = archive.c archures.c bfd.c cache.c coffgen.c core.c ctor.c \
+ format.c init.c libbfd.c opncls.c reloc.c seclet.c section.c syms.c \
+ targets.c ecoff.c elf.c srec.c freebsd386.c aout32.c stab-syms.c \
+ cpu-i386.c trad-core.c
+
+CFLAGS+= -I$(.CURDIR)/. -I$(.CURDIR)/../gdb/.
+CFLAGS+= -DDEFAULT_VECTOR=freebsd386_vec -DSELECT_VECS='&freebsd386_vec' \
+ -DSELECT_ARCHITECTURES='bfd_i386_arch' -DTRAD_CORE
+
+NOPROFILE=no
+NOPIC=no
+
+install:
+ @echo -n
+
+.include <bsd.lib.mk>
diff --git a/gnu/usr.bin/gdb/bfd/README.FreeBSD b/gnu/usr.bin/gdb/bfd/README.FreeBSD
new file mode 100644
index 000000000000..204119c1af74
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/README.FreeBSD
@@ -0,0 +1,7 @@
+This is a greatly pared down libbfd directory. Only what's required to build
+gdb-4.12 on FreeBSD was kept.
+
+This is temporary. In FreeBSD 2.0 a fully ported libbfd will likely appear
+as a system library for use by all the build tools.
+
+paul@freefall.cdrom.com
diff --git a/gnu/usr.bin/gdb/bfd/VERSION b/gnu/usr.bin/gdb/bfd/VERSION
new file mode 100644
index 000000000000..8bbe6cf74a1e
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/VERSION
@@ -0,0 +1 @@
+2.2
diff --git a/gnu/usr.bin/gdb/bfd/aout-target.h b/gnu/usr.bin/gdb/bfd/aout-target.h
new file mode 100644
index 000000000000..65a22fff9b04
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/aout-target.h
@@ -0,0 +1,429 @@
+/* Define a target vector and some small routines for a variant of a.out.
+ Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You 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. */
+
+#include "aout/aout64.h"
+#include "aout/stab_gnu.h"
+#include "aout/ar.h"
+/*#include "libaout.h"*/
+
+extern CONST struct reloc_howto_struct * NAME(aout,reloc_type_lookup) ();
+
+/* Set parameters about this a.out file that are machine-dependent.
+ This routine is called from some_aout_object_p just before it returns. */
+#ifndef MY_callback
+static bfd_target *
+DEFUN(MY(callback),(abfd),
+ bfd *abfd)
+{
+ struct internal_exec *execp = exec_hdr (abfd);
+
+ /* Calculate the file positions of the parts of a newly read aout header */
+ obj_textsec (abfd)->_raw_size = N_TXTSIZE(*execp);
+
+ /* The virtual memory addresses of the sections */
+ obj_textsec (abfd)->vma = N_TXTADDR(*execp);
+ obj_datasec (abfd)->vma = N_DATADDR(*execp);
+ obj_bsssec (abfd)->vma = N_BSSADDR(*execp);
+
+ /* The file offsets of the sections */
+ obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
+ obj_datasec (abfd)->filepos = N_DATOFF (*execp);
+
+ /* The file offsets of the relocation info */
+ obj_textsec (abfd)->rel_filepos = N_TRELOFF(*execp);
+ obj_datasec (abfd)->rel_filepos = N_DRELOFF(*execp);
+
+ /* The file offsets of the string table and symbol table. */
+ obj_sym_filepos (abfd) = N_SYMOFF (*execp);
+ obj_str_filepos (abfd) = N_STROFF (*execp);
+
+ /* Determine the architecture and machine type of the object file. */
+#ifdef SET_ARCH_MACH
+ SET_ARCH_MACH(abfd, *execp);
+#else
+ bfd_default_set_arch_mach(abfd, DEFAULT_ARCH, 0);
+#endif
+
+ /* Don't set sizes now -- can't be sure until we know arch & mach.
+ Sizes get set in set_sizes callback, later. */
+#if 0
+ adata(abfd).page_size = PAGE_SIZE;
+#ifdef SEGMENT_SIZE
+ adata(abfd).segment_size = SEGMENT_SIZE;
+#else
+ adata(abfd).segment_size = PAGE_SIZE;
+#endif
+ adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
+#endif
+
+ return abfd->xvec;
+}
+#endif
+
+#ifndef MY_object_p
+/* Finish up the reading of an a.out file header */
+
+static bfd_target *
+DEFUN(MY(object_p),(abfd),
+ bfd *abfd)
+{
+ struct external_exec exec_bytes; /* Raw exec header from file */
+ struct internal_exec exec; /* Cleaned-up exec header */
+ bfd_target *target;
+
+ if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
+ != EXEC_BYTES_SIZE) {
+ bfd_error = wrong_format;
+ return 0;
+ }
+
+#ifdef NO_SWAP_MAGIC
+ memcpy (&exec.a_info, exec_bytes.e_info, sizeof(exec.a_info));
+#else
+ exec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info);
+#endif /* NO_SWAP_MAGIC */
+
+ if (N_BADMAG (exec)) return 0;
+#ifdef MACHTYPE_OK
+ if (!(MACHTYPE_OK (N_MACHTYPE (exec)))) return 0;
+#endif
+
+ NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec);
+ target = NAME(aout,some_aout_object_p) (abfd, &exec, MY(callback));
+
+#ifdef ENTRY_CAN_BE_ZERO
+ /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
+ * means that it isn't obvious if EXEC_P should be set.
+ * All of the following must be true for an executable:
+ * There must be no relocations, the bfd can be neither an
+ * archive nor an archive element, and the file must be executable. */
+
+ if (exec.a_trsize + exec.a_drsize == 0
+ && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
+ {
+ struct stat buf;
+#ifndef S_IXUSR
+#define S_IXUSR 0100 /* Execute by owner. */
+#endif
+ if (stat(abfd->filename, &buf) == 0 && (buf.st_mode & S_IXUSR))
+ abfd->flags |= EXEC_P;
+ }
+#endif /* ENTRY_CAN_BE_ZERO */
+
+ return target;
+}
+#define MY_object_p MY(object_p)
+#endif
+
+
+#ifndef MY_mkobject
+static boolean
+DEFUN(MY(mkobject),(abfd),
+ bfd *abfd)
+{
+ if (NAME(aout,mkobject)(abfd) == false)
+ return false;
+#if 0 /* Sizes get set in set_sizes callback, later, after we know
+ the architecture and machine. */
+ adata(abfd).page_size = PAGE_SIZE;
+#ifdef SEGMENT_SIZE
+ adata(abfd).segment_size = SEGMENT_SIZE;
+#else
+ adata(abfd).segment_size = PAGE_SIZE;
+#endif
+ adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
+#endif
+ return true;
+}
+#define MY_mkobject MY(mkobject)
+#endif
+
+/* Write an object file.
+ Section contents have already been written. We write the
+ file header, symbols, and relocation. */
+
+#ifndef MY_write_object_contents
+static boolean
+DEFUN(MY(write_object_contents),(abfd),
+ bfd *abfd)
+{
+ struct external_exec exec_bytes;
+ struct internal_exec *execp = exec_hdr (abfd);
+
+#if CHOOSE_RELOC_SIZE
+ CHOOSE_RELOC_SIZE(abfd);
+#else
+ obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
+#endif
+
+ WRITE_HEADERS(abfd, execp);
+
+ return true;
+}
+#define MY_write_object_contents MY(write_object_contents)
+#endif
+
+#ifndef MY_set_sizes
+static boolean
+DEFUN(MY(set_sizes),(abfd), bfd *abfd)
+{
+ adata(abfd).page_size = PAGE_SIZE;
+#ifdef SEGMENT_SIZE
+ adata(abfd).segment_size = SEGMENT_SIZE;
+#else
+ adata(abfd).segment_size = PAGE_SIZE;
+#endif
+ adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
+ return true;
+}
+#define MY_set_sizes MY(set_sizes)
+#endif
+
+#ifndef MY_backend_data
+static CONST struct aout_backend_data MY(backend_data) = {
+ 0, /* zmagic contiguous */
+ 0, /* text incl header */
+ 0, /* text vma? */
+ MY_set_sizes,
+ 0, /* exec header is counted */
+};
+#define MY_backend_data &MY(backend_data)
+#endif
+
+/* We assume BFD generic archive files. */
+#ifndef MY_openr_next_archived_file
+#define MY_openr_next_archived_file bfd_generic_openr_next_archived_file
+#endif
+#ifndef MY_generic_stat_arch_elt
+#define MY_generic_stat_arch_elt bfd_generic_stat_arch_elt
+#endif
+#ifndef MY_slurp_armap
+#define MY_slurp_armap bfd_slurp_bsd_armap
+#endif
+#ifndef MY_slurp_extended_name_table
+#define MY_slurp_extended_name_table _bfd_slurp_extended_name_table
+#endif
+#ifndef MY_write_armap
+#define MY_write_armap bsd_write_armap
+#endif
+#ifndef MY_truncate_arname
+#define MY_truncate_arname bfd_bsd_truncate_arname
+#endif
+
+/* No core file defined here -- configure in trad-core.c separately. */
+#ifndef MY_core_file_failing_command
+#define MY_core_file_failing_command _bfd_dummy_core_file_failing_command
+#endif
+#ifndef MY_core_file_failing_signal
+#define MY_core_file_failing_signal _bfd_dummy_core_file_failing_signal
+#endif
+#ifndef MY_core_file_matches_executable_p
+#define MY_core_file_matches_executable_p \
+ _bfd_dummy_core_file_matches_executable_p
+#endif
+#ifndef MY_core_file_p
+#define MY_core_file_p _bfd_dummy_target
+#endif
+
+#ifndef MY_bfd_debug_info_start
+#define MY_bfd_debug_info_start bfd_void
+#endif
+#ifndef MY_bfd_debug_info_end
+#define MY_bfd_debug_info_end bfd_void
+#endif
+#ifndef MY_bfd_debug_info_accumulate
+#define MY_bfd_debug_info_accumulate \
+ (void (*) PARAMS ((bfd*, struct sec *))) bfd_void
+#endif
+
+#ifndef MY_core_file_failing_command
+#define MY_core_file_failing_command NAME(aout,core_file_failing_command)
+#endif
+#ifndef MY_core_file_failing_signal
+#define MY_core_file_failing_signal NAME(aout,core_file_failing_signal)
+#endif
+#ifndef MY_core_file_matches_executable_p
+#define MY_core_file_matches_executable_p NAME(aout,core_file_matches_executable_p)
+#endif
+#ifndef MY_slurp_armap
+#define MY_slurp_armap NAME(aout,slurp_armap)
+#endif
+#ifndef MY_slurp_extended_name_table
+#define MY_slurp_extended_name_table NAME(aout,slurp_extended_name_table)
+#endif
+#ifndef MY_truncate_arname
+#define MY_truncate_arname NAME(aout,truncate_arname)
+#endif
+#ifndef MY_write_armap
+#define MY_write_armap NAME(aout,write_armap)
+#endif
+#ifndef MY_close_and_cleanup
+#define MY_close_and_cleanup NAME(aout,close_and_cleanup)
+#endif
+#ifndef MY_set_section_contents
+#define MY_set_section_contents NAME(aout,set_section_contents)
+#endif
+#ifndef MY_get_section_contents
+#define MY_get_section_contents NAME(aout,get_section_contents)
+#endif
+#ifndef MY_new_section_hook
+#define MY_new_section_hook NAME(aout,new_section_hook)
+#endif
+#ifndef MY_get_symtab_upper_bound
+#define MY_get_symtab_upper_bound NAME(aout,get_symtab_upper_bound)
+#endif
+#ifndef MY_get_symtab
+#define MY_get_symtab NAME(aout,get_symtab)
+#endif
+#ifndef MY_get_reloc_upper_bound
+#define MY_get_reloc_upper_bound NAME(aout,get_reloc_upper_bound)
+#endif
+#ifndef MY_canonicalize_reloc
+#define MY_canonicalize_reloc NAME(aout,canonicalize_reloc)
+#endif
+#ifndef MY_make_empty_symbol
+#define MY_make_empty_symbol NAME(aout,make_empty_symbol)
+#endif
+#ifndef MY_print_symbol
+#define MY_print_symbol NAME(aout,print_symbol)
+#endif
+#ifndef MY_get_symbol_info
+#define MY_get_symbol_info NAME(aout,get_symbol_info)
+#endif
+#ifndef MY_get_lineno
+#define MY_get_lineno NAME(aout,get_lineno)
+#endif
+#ifndef MY_set_arch_mach
+#define MY_set_arch_mach NAME(aout,set_arch_mach)
+#endif
+#ifndef MY_openr_next_archived_file
+#define MY_openr_next_archived_file NAME(aout,openr_next_archived_file)
+#endif
+#ifndef MY_find_nearest_line
+#define MY_find_nearest_line NAME(aout,find_nearest_line)
+#endif
+#ifndef MY_generic_stat_arch_elt
+#define MY_generic_stat_arch_elt NAME(aout,generic_stat_arch_elt)
+#endif
+#ifndef MY_sizeof_headers
+#define MY_sizeof_headers NAME(aout,sizeof_headers)
+#endif
+#ifndef MY_bfd_debug_info_start
+#define MY_bfd_debug_info_start NAME(aout,bfd_debug_info_start)
+#endif
+#ifndef MY_bfd_debug_info_end
+#define MY_bfd_debug_info_end NAME(aout,bfd_debug_info_end)
+#endif
+#ifndef MY_bfd_debug_info_accumulat
+#define MY_bfd_debug_info_accumulat NAME(aout,bfd_debug_info_accumulat)
+#endif
+#ifndef MY_reloc_howto_type_lookup
+#define MY_reloc_howto_type_lookup NAME(aout,reloc_type_lookup)
+#endif
+#ifndef MY_make_debug_symbol
+#define MY_make_debug_symbol 0
+#endif
+
+/* Aout symbols normally have leading underscores */
+#ifndef MY_symbol_leading_char
+#define MY_symbol_leading_char '_'
+#endif
+
+/* Aout archives normally use spaces for padding */
+#ifndef AR_PAD_CHAR
+#define AR_PAD_CHAR ' '
+#endif
+
+#ifndef MY_BFD_TARGET
+bfd_target MY(vec) =
+{
+ TARGETNAME, /* name */
+ bfd_target_aout_flavour,
+#ifdef TARGET_IS_BIG_ENDIAN_P
+ true, /* target byte order (big) */
+ true, /* target headers byte order (big) */
+#else
+ false, /* target byte order (little) */
+ false, /* target headers byte order (little) */
+#endif
+ (HAS_RELOC | EXEC_P | /* object flags */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
+ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
+ MY_symbol_leading_char,
+ AR_PAD_CHAR, /* ar_pad_char */
+ 15, /* ar_max_namelen */
+ 3, /* minimum alignment */
+#ifdef TARGET_IS_BIG_ENDIAN_P
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
+ bfd_getb64, bfd_getb_signed_64, bfd_putb64,
+ bfd_getb32, bfd_getb_signed_32, bfd_putb32,
+ bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
+#else
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
+#endif
+ {_bfd_dummy_target, MY_object_p, /* bfd_check_format */
+ bfd_generic_archive_p, MY_core_file_p},
+ {bfd_false, MY_mkobject, /* bfd_set_format */
+ _bfd_generic_mkarchive, bfd_false},
+ {bfd_false, MY_write_object_contents, /* bfd_write_contents */
+ _bfd_write_archive_contents, bfd_false},
+
+ MY_core_file_failing_command,
+ MY_core_file_failing_signal,
+ MY_core_file_matches_executable_p,
+ MY_slurp_armap,
+ MY_slurp_extended_name_table,
+ MY_truncate_arname,
+ MY_write_armap,
+ MY_close_and_cleanup,
+ MY_set_section_contents,
+ MY_get_section_contents,
+ MY_new_section_hook,
+ MY_get_symtab_upper_bound,
+ MY_get_symtab,
+ MY_get_reloc_upper_bound,
+ MY_canonicalize_reloc,
+ MY_make_empty_symbol,
+ MY_print_symbol,
+ MY_get_symbol_info,
+ MY_get_lineno,
+ MY_set_arch_mach,
+ MY_openr_next_archived_file,
+ MY_find_nearest_line,
+ MY_generic_stat_arch_elt,
+ MY_sizeof_headers,
+ MY_bfd_debug_info_start,
+ MY_bfd_debug_info_end,
+ MY_bfd_debug_info_accumulate,
+ bfd_generic_get_relocated_section_contents,
+ bfd_generic_relax_section,
+ bfd_generic_seclet_link,
+ MY_reloc_howto_type_lookup,
+ MY_make_debug_symbol,
+ (PTR) MY_backend_data,
+};
+#endif /* MY_BFD_TARGET */
diff --git a/gnu/usr.bin/gdb/bfd/aout32.c b/gnu/usr.bin/gdb/bfd/aout32.c
new file mode 100644
index 000000000000..84d20872fc96
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/aout32.c
@@ -0,0 +1,23 @@
+/* BFD back-end for 32-bit a.out files.
+ Copyright (C) 1990-1991 Free Software Foundation, Inc.
+ Written by Cygnus Support.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You 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. */
+
+#define ARCH_SIZE 32
+
+#include "aoutx.h"
diff --git a/gnu/usr.bin/gdb/bfd/aoutx.h b/gnu/usr.bin/gdb/bfd/aoutx.h
new file mode 100644
index 000000000000..1ab442926ff2
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/aoutx.h
@@ -0,0 +1,2568 @@
+/* BFD semi-generic back-end for a.out binaries.
+ Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Written by Cygnus Support.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You 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. */
+
+/*
+SECTION
+ a.out backends
+
+
+DESCRIPTION
+
+ BFD supports a number of different flavours of a.out format,
+ though the major differences are only the sizes of the
+ structures on disk, and the shape of the relocation
+ information.
+
+ The support is split into a basic support file @code{aoutx.h}
+ and other files which derive functions from the base. One
+ derivation file is @code{aoutf1.h} (for a.out flavour 1), and
+ adds to the basic a.out functions support for sun3, sun4, 386
+ and 29k a.out files, to create a target jump vector for a
+ specific target.
+
+ This information is further split out into more specific files
+ for each machine, including @code{sunos.c} for sun3 and sun4,
+ @code{newsos3.c} for the Sony NEWS, and @code{demo64.c} for a
+ demonstration of a 64 bit a.out format.
+
+ The base file @code{aoutx.h} defines general mechanisms for
+ reading and writing records to and from disk, and various
+ other methods which BFD requires. It is included by
+ @code{aout32.c} and @code{aout64.c} to form the names
+ aout_32_swap_exec_header_in, aout_64_swap_exec_header_in, etc.
+
+ As an example, this is what goes on to make the back end for a
+ sun4, from aout32.c
+
+| #define ARCH_SIZE 32
+| #include "aoutx.h"
+
+ Which exports names:
+
+| ...
+| aout_32_canonicalize_reloc
+| aout_32_find_nearest_line
+| aout_32_get_lineno
+| aout_32_get_reloc_upper_bound
+| ...
+
+ from sunos.c
+
+| #define ARCH 32
+| #define TARGET_NAME "a.out-sunos-big"
+| #define VECNAME sunos_big_vec
+| #include "aoutf1.h"
+
+ requires all the names from aout32.c, and produces the jump vector
+
+| sunos_big_vec
+
+ The file host-aout.c is a special case. It is for a large set
+ of hosts that use ``more or less standard'' a.out files, and
+ for which cross-debugging is not interesting. It uses the
+ standard 32-bit a.out support routines, but determines the
+ file offsets and addresses of the text, data, and BSS
+ sections, the machine architecture and machine type, and the
+ entry point address, in a host-dependent manner. Once these
+ values have been determined, generic code is used to handle
+ the object file.
+
+ When porting it to run on a new system, you must supply:
+
+| HOST_PAGE_SIZE
+| HOST_SEGMENT_SIZE
+| HOST_MACHINE_ARCH (optional)
+| HOST_MACHINE_MACHINE (optional)
+| HOST_TEXT_START_ADDR
+| HOST_STACK_END_ADDR
+
+ in the file <<../include/sys/h-XXX.h>> (for your host). These
+ values, plus the structures and macros defined in <<a.out.h>> on
+ your host system, will produce a BFD target that will access
+ ordinary a.out files on your host. To configure a new machine
+ to use <<host-aout.c>., specify:
+
+| TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec
+| TDEPFILES= host-aout.o trad-core.o
+
+ in the <<config/mt-XXX>> file, and modify configure.in to use the
+ <<mt-XXX>> file (by setting "<<bfd_target=XXX>>") when your
+ configuration is selected.
+
+*/
+
+/* Some assumptions:
+ * Any BFD with D_PAGED set is ZMAGIC, and vice versa.
+ Doesn't matter what the setting of WP_TEXT is on output, but it'll
+ get set on input.
+ * Any BFD with D_PAGED clear and WP_TEXT set is NMAGIC.
+ * Any BFD with both flags clear is OMAGIC.
+ (Just want to make these explicit, so the conditions tested in this
+ file make sense if you're more familiar with a.out than with BFD.) */
+
+#define KEEPIT flags
+#define KEEPITTYPE int
+
+#include <assert.h>
+#include <string.h> /* For strchr and friends */
+#include "bfd.h"
+#include <sysdep.h>
+#include <ansidecl.h>
+
+struct external_exec;
+#include "libaout.h"
+#include "libbfd.h"
+#include "aout/aout64.h"
+#include "aout/stab_gnu.h"
+#include "aout/ar.h"
+
+extern void (*bfd_error_trap)();
+
+/*
+SUBSECTION
+ relocations
+
+DESCRIPTION
+ The file @code{aoutx.h} caters for both the @emph{standard}
+ and @emph{extended} forms of a.out relocation records.
+
+ The standard records are characterised by containing only an
+ address, a symbol index and a type field. The extended records
+ (used on 29ks and sparcs) also have a full integer for an
+ addend.
+
+*/
+#define CTOR_TABLE_RELOC_IDX 2
+
+#define howto_table_ext NAME(aout,ext_howto_table)
+#define howto_table_std NAME(aout,std_howto_table)
+
+reloc_howto_type howto_table_ext[] =
+{
+ /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */
+ HOWTO(RELOC_8, 0, 0, 8, false, 0, complain_overflow_bitfield,0,"8", false, 0,0x000000ff, false),
+ HOWTO(RELOC_16, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"16", false, 0,0x0000ffff, false),
+ HOWTO(RELOC_32, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"32", false, 0,0xffffffff, false),
+ HOWTO(RELOC_DISP8, 0, 0, 8, true, 0, complain_overflow_signed,0,"DISP8", false, 0,0x000000ff, false),
+ HOWTO(RELOC_DISP16, 0, 1, 16, true, 0, complain_overflow_signed,0,"DISP16", false, 0,0x0000ffff, false),
+ HOWTO(RELOC_DISP32, 0, 2, 32, true, 0, complain_overflow_signed,0,"DISP32", false, 0,0xffffffff, false),
+ HOWTO(RELOC_WDISP30,2, 2, 30, true, 0, complain_overflow_signed,0,"WDISP30", false, 0,0x3fffffff, false),
+ HOWTO(RELOC_WDISP22,2, 2, 22, true, 0, complain_overflow_signed,0,"WDISP22", false, 0,0x003fffff, false),
+ HOWTO(RELOC_HI22, 10, 2, 22, false, 0, complain_overflow_bitfield,0,"HI22", false, 0,0x003fffff, false),
+ HOWTO(RELOC_22, 0, 2, 22, false, 0, complain_overflow_bitfield,0,"22", false, 0,0x003fffff, false),
+ HOWTO(RELOC_13, 0, 2, 13, false, 0, complain_overflow_bitfield,0,"13", false, 0,0x00001fff, false),
+ HOWTO(RELOC_LO10, 0, 2, 10, false, 0, complain_overflow_dont,0,"LO10", false, 0,0x000003ff, false),
+ HOWTO(RELOC_SFA_BASE,0, 2, 32, false, 0, complain_overflow_bitfield,0,"SFA_BASE", false, 0,0xffffffff, false),
+ HOWTO(RELOC_SFA_OFF13,0,2, 32, false, 0, complain_overflow_bitfield,0,"SFA_OFF13",false, 0,0xffffffff, false),
+ HOWTO(RELOC_BASE10, 0, 2, 16, false, 0, complain_overflow_bitfield,0,"BASE10", false, 0,0x0000ffff, false),
+ HOWTO(RELOC_BASE13, 0, 2, 13, false, 0, complain_overflow_bitfield,0,"BASE13", false, 0,0x00001fff, false),
+ HOWTO(RELOC_BASE22, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"BASE22", false, 0,0x00000000, false),
+ HOWTO(RELOC_PC10, 0, 2, 10, false, 0, complain_overflow_bitfield,0,"PC10", false, 0,0x000003ff, false),
+ HOWTO(RELOC_PC22, 0, 2, 22, false, 0, complain_overflow_bitfield,0,"PC22", false, 0,0x003fffff, false),
+ HOWTO(RELOC_JMP_TBL,0, 2, 32, false, 0, complain_overflow_bitfield,0,"JMP_TBL", false, 0,0xffffffff, false),
+ HOWTO(RELOC_SEGOFF16,0, 2, 0, false, 0, complain_overflow_bitfield,0,"SEGOFF16", false, 0,0x00000000, false),
+ HOWTO(RELOC_GLOB_DAT,0, 2, 0, false, 0, complain_overflow_bitfield,0,"GLOB_DAT", false, 0,0x00000000, false),
+ HOWTO(RELOC_JMP_SLOT,0, 2, 0, false, 0, complain_overflow_bitfield,0,"JMP_SLOT", false, 0,0x00000000, false),
+ HOWTO(RELOC_RELATIVE,0, 2, 0, false, 0, complain_overflow_bitfield,0,"RELATIVE", false, 0,0x00000000, false),
+};
+
+/* Convert standard reloc records to "arelent" format (incl byte swap). */
+
+reloc_howto_type howto_table_std[] = {
+ /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */
+HOWTO( 0, 0, 0, 8, false, 0, complain_overflow_bitfield,0,"8", true, 0x000000ff,0x000000ff, false),
+HOWTO( 1, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"16", true, 0x0000ffff,0x0000ffff, false),
+HOWTO( 2, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"32", true, 0xffffffff,0xffffffff, false),
+HOWTO( 3, 0, 4, 64, false, 0, complain_overflow_bitfield,0,"64", true, 0xdeaddead,0xdeaddead, false),
+HOWTO( 4, 0, 0, 8, true, 0, complain_overflow_signed, 0,"DISP8", true, 0x000000ff,0x000000ff, false),
+HOWTO( 5, 0, 1, 16, true, 0, complain_overflow_signed, 0,"DISP16", true, 0x0000ffff,0x0000ffff, false),
+HOWTO( 6, 0, 2, 32, true, 0, complain_overflow_signed, 0,"DISP32", true, 0xffffffff,0xffffffff, false),
+HOWTO( 7, 0, 4, 64, true, 0, complain_overflow_signed, 0,"DISP64", true, 0xfeedface,0xfeedface, false),
+{ -1 },
+HOWTO( 9, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"BASE16", false,0xffffffff,0xffffffff, false),
+HOWTO(10, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"BASE32", false,0xffffffff,0xffffffff, false),
+};
+
+#define TABLE_SIZE(TABLE) (sizeof(TABLE)/sizeof(TABLE[0]))
+
+CONST struct reloc_howto_struct *
+DEFUN(NAME(aout,reloc_type_lookup),(abfd,code),
+ bfd *abfd AND
+ bfd_reloc_code_real_type code)
+{
+#define EXT(i,j) case i: return &howto_table_ext[j]
+#define STD(i,j) case i: return &howto_table_std[j]
+ int ext = obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE;
+ if (code == BFD_RELOC_CTOR)
+ switch (bfd_get_arch_info (abfd)->bits_per_address)
+ {
+ case 32:
+ code = BFD_RELOC_32;
+ break;
+ }
+ if (ext)
+ switch (code)
+ {
+ EXT (BFD_RELOC_32, 2);
+ EXT (BFD_RELOC_HI22, 8);
+ EXT (BFD_RELOC_LO10, 11);
+ EXT (BFD_RELOC_32_PCREL_S2, 6);
+ default: return (CONST struct reloc_howto_struct *) 0;
+ }
+ else
+ /* std relocs */
+ switch (code)
+ {
+ STD (BFD_RELOC_16, 1);
+ STD (BFD_RELOC_32, 2);
+ STD (BFD_RELOC_8_PCREL, 4);
+ STD (BFD_RELOC_16_PCREL, 5);
+ STD (BFD_RELOC_32_PCREL, 6);
+ STD (BFD_RELOC_16_BASEREL, 9);
+ STD (BFD_RELOC_32_BASEREL, 10);
+ default: return (CONST struct reloc_howto_struct *) 0;
+ }
+}
+
+extern bfd_error_vector_type bfd_error_vector;
+
+/*
+SUBSECTION
+ Internal Entry Points
+
+DESCRIPTION
+ @code{aoutx.h} exports several routines for accessing the
+ contents of an a.out file, which are gathered and exported in
+ turn by various format specific files (eg sunos.c).
+
+*/
+
+/*
+FUNCTION
+ aout_<size>_swap_exec_header_in
+
+DESCRIPTION
+ Swaps the information in an executable header taken from a raw
+ byte stream memory image, into the internal exec_header
+ structure.
+
+SYNOPSIS
+ void aout_<size>_swap_exec_header_in,
+ (bfd *abfd,
+ struct external_exec *raw_bytes,
+ struct internal_exec *execp);
+*/
+
+#ifndef NAME_swap_exec_header_in
+void
+DEFUN(NAME(aout,swap_exec_header_in),(abfd, raw_bytes, execp),
+ bfd *abfd AND
+ struct external_exec *raw_bytes AND
+ struct internal_exec *execp)
+{
+ struct external_exec *bytes = (struct external_exec *)raw_bytes;
+
+ /* The internal_exec structure has some fields that are unused in this
+ configuration (IE for i960), so ensure that all such uninitialized
+ fields are zero'd out. There are places where two of these structs
+ are memcmp'd, and thus the contents do matter. */
+ memset (execp, 0, sizeof (struct internal_exec));
+ /* Now fill in fields in the execp, from the bytes in the raw data. */
+ execp->a_info = bfd_h_get_32 (abfd, bytes->e_info);
+ execp->a_text = GET_WORD (abfd, bytes->e_text);
+ execp->a_data = GET_WORD (abfd, bytes->e_data);
+ execp->a_bss = GET_WORD (abfd, bytes->e_bss);
+ execp->a_syms = GET_WORD (abfd, bytes->e_syms);
+ execp->a_entry = GET_WORD (abfd, bytes->e_entry);
+ execp->a_trsize = GET_WORD (abfd, bytes->e_trsize);
+ execp->a_drsize = GET_WORD (abfd, bytes->e_drsize);
+}
+#define NAME_swap_exec_header_in NAME(aout,swap_exec_header_in)
+#endif
+
+/*
+FUNCTION
+ aout_<size>_swap_exec_header_out
+
+DESCRIPTION
+ Swaps the information in an internal exec header structure
+ into the supplied buffer ready for writing to disk.
+
+SYNOPSIS
+ void aout_<size>_swap_exec_header_out
+ (bfd *abfd,
+ struct internal_exec *execp,
+ struct external_exec *raw_bytes);
+*/
+void
+DEFUN(NAME(aout,swap_exec_header_out),(abfd, execp, raw_bytes),
+ bfd *abfd AND
+ struct internal_exec *execp AND
+ struct external_exec *raw_bytes)
+{
+ struct external_exec *bytes = (struct external_exec *)raw_bytes;
+
+ /* Now fill in fields in the raw data, from the fields in the exec struct. */
+ bfd_h_put_32 (abfd, execp->a_info , bytes->e_info);
+ PUT_WORD (abfd, execp->a_text , bytes->e_text);
+ PUT_WORD (abfd, execp->a_data , bytes->e_data);
+ PUT_WORD (abfd, execp->a_bss , bytes->e_bss);
+ PUT_WORD (abfd, execp->a_syms , bytes->e_syms);
+ PUT_WORD (abfd, execp->a_entry , bytes->e_entry);
+ PUT_WORD (abfd, execp->a_trsize, bytes->e_trsize);
+ PUT_WORD (abfd, execp->a_drsize, bytes->e_drsize);
+}
+
+
+
+/*
+FUNCTION
+ aout_<size>_some_aout_object_p
+
+DESCRIPTION
+ Some A.OUT variant thinks that the file whose format we're
+ checking is an a.out file. Do some more checking, and set up
+ for access if it really is. Call back to the calling
+ environments "finish up" function just before returning, to
+ handle any last-minute setup.
+
+SYNOPSIS
+ bfd_target *aout_<size>_some_aout_object_p
+ (bfd *abfd,
+ bfd_target *(*callback_to_real_object_p)());
+*/
+
+bfd_target *
+DEFUN(NAME(aout,some_aout_object_p),(abfd, execp, callback_to_real_object_p),
+ bfd *abfd AND
+ struct internal_exec *execp AND
+ bfd_target *(*callback_to_real_object_p) PARAMS ((bfd *)))
+{
+ struct aout_data_struct *rawptr, *oldrawptr;
+ bfd_target *result;
+
+ rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, sizeof (struct aout_data_struct ));
+ if (rawptr == NULL) {
+ bfd_error = no_memory;
+ return 0;
+ }
+
+ oldrawptr = abfd->tdata.aout_data;
+ abfd->tdata.aout_data = rawptr;
+
+ /* Copy the contents of the old tdata struct.
+ In particular, we want the subformat, since for hpux it was set in
+ hp300hpux.c:swap_exec_header_in and will be used in
+ hp300hpux.c:callback. */
+ if (oldrawptr != NULL)
+ *abfd->tdata.aout_data = *oldrawptr;
+
+ abfd->tdata.aout_data->a.hdr = &rawptr->e;
+ *(abfd->tdata.aout_data->a.hdr) = *execp; /* Copy in the internal_exec struct */
+ execp = abfd->tdata.aout_data->a.hdr;
+
+ /* Set the file flags */
+ abfd->flags = NO_FLAGS;
+ if (execp->a_drsize || execp->a_trsize)
+ abfd->flags |= HAS_RELOC;
+ /* Setting of EXEC_P has been deferred to the bottom of this function */
+ if (execp->a_syms)
+ abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
+
+ if (N_MAGIC (*execp) == ZMAGIC)
+ {
+ abfd->flags |= D_PAGED|WP_TEXT;
+ adata(abfd).magic = z_magic;
+ }
+ else if (N_MAGIC (*execp) == NMAGIC)
+ {
+ abfd->flags |= WP_TEXT;
+ adata(abfd).magic = n_magic;
+ }
+ else
+ adata(abfd).magic = o_magic;
+
+ bfd_get_start_address (abfd) = execp->a_entry;
+
+ obj_aout_symbols (abfd) = (aout_symbol_type *)NULL;
+ bfd_get_symcount (abfd) = execp->a_syms / sizeof (struct external_nlist);
+
+ /* The default relocation entry size is that of traditional V7 Unix. */
+ obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
+
+ /* The default symbol entry size is that of traditional Unix. */
+ obj_symbol_entry_size (abfd) = EXTERNAL_NLIST_SIZE;
+
+ /* Create the sections. This is raunchy, but bfd_close wants to reclaim
+ them. */
+
+ obj_textsec (abfd) = bfd_make_section_old_way (abfd, ".text");
+ obj_datasec (abfd) = bfd_make_section_old_way (abfd, ".data");
+ obj_bsssec (abfd) = bfd_make_section_old_way (abfd, ".bss");
+
+#if 0
+ (void)bfd_make_section (abfd, ".text");
+ (void)bfd_make_section (abfd, ".data");
+ (void)bfd_make_section (abfd, ".bss");
+#endif
+
+ obj_datasec (abfd)->_raw_size = execp->a_data;
+ obj_bsssec (abfd)->_raw_size = execp->a_bss;
+
+ obj_textsec (abfd)->flags = (execp->a_trsize != 0 ?
+ (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS | SEC_RELOC) :
+ (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS));
+ obj_datasec (abfd)->flags = (execp->a_drsize != 0 ?
+ (SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS | SEC_RELOC) :
+ (SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS));
+ obj_bsssec (abfd)->flags = SEC_ALLOC;
+
+#ifdef THIS_IS_ONLY_DOCUMENTATION
+ /* The common code can't fill in these things because they depend
+ on either the start address of the text segment, the rounding
+ up of virtual addersses between segments, or the starting file
+ position of the text segment -- all of which varies among different
+ versions of a.out. */
+
+ /* Call back to the format-dependent code to fill in the rest of the
+ fields and do any further cleanup. Things that should be filled
+ in by the callback: */
+
+ struct exec *execp = exec_hdr (abfd);
+
+ obj_textsec (abfd)->size = N_TXTSIZE(*execp);
+ obj_textsec (abfd)->raw_size = N_TXTSIZE(*execp);
+ /* data and bss are already filled in since they're so standard */
+
+ /* The virtual memory addresses of the sections */
+ obj_textsec (abfd)->vma = N_TXTADDR(*execp);
+ obj_datasec (abfd)->vma = N_DATADDR(*execp);
+ obj_bsssec (abfd)->vma = N_BSSADDR(*execp);
+
+ /* The file offsets of the sections */
+ obj_textsec (abfd)->filepos = N_TXTOFF(*execp);
+ obj_datasec (abfd)->filepos = N_DATOFF(*execp);
+
+ /* The file offsets of the relocation info */
+ obj_textsec (abfd)->rel_filepos = N_TRELOFF(*execp);
+ obj_datasec (abfd)->rel_filepos = N_DRELOFF(*execp);
+
+ /* The file offsets of the string table and symbol table. */
+ obj_str_filepos (abfd) = N_STROFF (*execp);
+ obj_sym_filepos (abfd) = N_SYMOFF (*execp);
+
+ /* Determine the architecture and machine type of the object file. */
+ switch (N_MACHTYPE (*exec_hdr (abfd))) {
+ default:
+ abfd->obj_arch = bfd_arch_obscure;
+ break;
+ }
+
+ adata(abfd)->page_size = PAGE_SIZE;
+ adata(abfd)->segment_size = SEGMENT_SIZE;
+ adata(abfd)->exec_bytes_size = EXEC_BYTES_SIZE;
+
+ return abfd->xvec;
+
+ /* The architecture is encoded in various ways in various a.out variants,
+ or is not encoded at all in some of them. The relocation size depends
+ on the architecture and the a.out variant. Finally, the return value
+ is the bfd_target vector in use. If an error occurs, return zero and
+ set bfd_error to the appropriate error code.
+
+ Formats such as b.out, which have additional fields in the a.out
+ header, should cope with them in this callback as well. */
+#endif /* DOCUMENTATION */
+
+ result = (*callback_to_real_object_p)(abfd);
+
+ /* Now that the segment addresses have been worked out, take a better
+ guess at whether the file is executable. If the entry point
+ is within the text segment, assume it is. (This makes files
+ executable even if their entry point address is 0, as long as
+ their text starts at zero.)
+
+ At some point we should probably break down and stat the file and
+ declare it executable if (one of) its 'x' bits are on... */
+ if ((execp->a_entry >= obj_textsec(abfd)->vma) &&
+ (execp->a_entry < obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size))
+ abfd->flags |= EXEC_P;
+ if (result)
+ {
+#if 0 /* These should be set correctly anyways. */
+ abfd->sections = obj_textsec (abfd);
+ obj_textsec (abfd)->next = obj_datasec (abfd);
+ obj_datasec (abfd)->next = obj_bsssec (abfd);
+#endif
+ }
+ else
+ {
+ free (rawptr);
+ abfd->tdata.aout_data = oldrawptr;
+ }
+ return result;
+}
+
+/*
+FUNCTION
+ aout_<size>_mkobject
+
+DESCRIPTION
+ This routine initializes a BFD for use with a.out files.
+
+SYNOPSIS
+ boolean aout_<size>_mkobject, (bfd *);
+*/
+
+boolean
+DEFUN(NAME(aout,mkobject),(abfd),
+ bfd *abfd)
+{
+ struct aout_data_struct *rawptr;
+
+ bfd_error = system_call_error;
+
+ /* Use an intermediate variable for clarity */
+ rawptr = (struct aout_data_struct *)bfd_zalloc (abfd, sizeof (struct aout_data_struct ));
+
+ if (rawptr == NULL) {
+ bfd_error = no_memory;
+ return false;
+ }
+
+ abfd->tdata.aout_data = rawptr;
+ exec_hdr (abfd) = &(rawptr->e);
+
+ /* For simplicity's sake we just make all the sections right here. */
+
+ obj_textsec (abfd) = (asection *)NULL;
+ obj_datasec (abfd) = (asection *)NULL;
+ obj_bsssec (abfd) = (asection *)NULL;
+ bfd_make_section (abfd, ".text");
+ bfd_make_section (abfd, ".data");
+ bfd_make_section (abfd, ".bss");
+ bfd_make_section (abfd, BFD_ABS_SECTION_NAME);
+ bfd_make_section (abfd, BFD_UND_SECTION_NAME);
+ bfd_make_section (abfd, BFD_COM_SECTION_NAME);
+
+ return true;
+}
+
+
+/*
+FUNCTION
+ aout_<size>_machine_type
+
+DESCRIPTION
+ Keep track of machine architecture and machine type for
+ a.out's. Return the machine_type for a particular
+ arch&machine, or M_UNKNOWN if that exact arch&machine can't be
+ represented in a.out format.
+
+ If the architecture is understood, machine type 0 (default)
+ should always be understood.
+
+SYNOPSIS
+ enum machine_type aout_<size>_machine_type
+ (enum bfd_architecture arch,
+ unsigned long machine));
+*/
+
+enum machine_type
+DEFUN(NAME(aout,machine_type),(arch, machine),
+ enum bfd_architecture arch AND
+ unsigned long machine)
+{
+ enum machine_type arch_flags;
+
+ arch_flags = M_UNKNOWN;
+
+ switch (arch) {
+ case bfd_arch_sparc:
+ if (machine == 0) arch_flags = M_SPARC;
+ break;
+
+ case bfd_arch_m68k:
+ switch (machine) {
+ case 0: arch_flags = M_68010; break;
+ case 68000: arch_flags = M_UNKNOWN; break;
+ case 68010: arch_flags = M_68010; break;
+ case 68020: arch_flags = M_68020; break;
+ default: arch_flags = M_UNKNOWN; break;
+ }
+ break;
+
+ case bfd_arch_i386:
+ if (machine == 0) arch_flags = M_386;
+ break;
+
+ case bfd_arch_a29k:
+ if (machine == 0) arch_flags = M_29K;
+ break;
+
+ case bfd_arch_mips:
+ switch (machine) {
+ case 0:
+ case 2000:
+ case 3000: arch_flags = M_MIPS1; break;
+ case 4000:
+ case 4400:
+ case 6000: arch_flags = M_MIPS2; break;
+ default: arch_flags = M_UNKNOWN; break;
+ }
+ break;
+
+ default:
+ arch_flags = M_UNKNOWN;
+ }
+ return arch_flags;
+}
+
+
+/*
+FUNCTION
+ aout_<size>_set_arch_mach
+
+DESCRIPTION
+ Sets the architecture and the machine of the BFD to those
+ values supplied. Verifies that the format can support the
+ architecture required.
+
+SYNOPSIS
+ boolean aout_<size>_set_arch_mach,
+ (bfd *,
+ enum bfd_architecture,
+ unsigned long machine));
+*/
+
+boolean
+DEFUN(NAME(aout,set_arch_mach),(abfd, arch, machine),
+ bfd *abfd AND
+ enum bfd_architecture arch AND
+ unsigned long machine)
+{
+ if (! bfd_default_set_arch_mach (abfd, arch, machine))
+ return false;
+
+ if (arch != bfd_arch_unknown &&
+ NAME(aout,machine_type) (arch, machine) == M_UNKNOWN)
+ return false; /* We can't represent this type */
+
+ /* Determine the size of a relocation entry */
+ switch (arch) {
+ case bfd_arch_sparc:
+ case bfd_arch_a29k:
+ case bfd_arch_mips:
+ obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
+ break;
+ default:
+ obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
+ break;
+ }
+
+ return (*aout_backend_info(abfd)->set_sizes) (abfd);
+}
+
+boolean
+DEFUN (NAME (aout,adjust_sizes_and_vmas), (abfd, text_size, text_end),
+ bfd *abfd AND bfd_size_type *text_size AND file_ptr *text_end)
+{
+ struct internal_exec *execp = exec_hdr (abfd);
+ if ((obj_textsec (abfd) == NULL) || (obj_datasec (abfd) == NULL))
+ {
+ bfd_error = invalid_operation;
+ return false;
+ }
+ if (adata(abfd).magic != undecided_magic) return true;
+ obj_textsec(abfd)->_raw_size =
+ align_power(obj_textsec(abfd)->_raw_size,
+ obj_textsec(abfd)->alignment_power);
+
+ *text_size = obj_textsec (abfd)->_raw_size;
+ /* Rule (heuristic) for when to pad to a new page. Note that there
+ * are (at least) two ways demand-paged (ZMAGIC) files have been
+ * handled. Most Berkeley-based systems start the text segment at
+ * (PAGE_SIZE). However, newer versions of SUNOS start the text
+ * segment right after the exec header; the latter is counted in the
+ * text segment size, and is paged in by the kernel with the rest of
+ * the text. */
+
+ /* This perhaps isn't the right way to do this, but made it simpler for me
+ to understand enough to implement it. Better would probably be to go
+ right from BFD flags to alignment/positioning characteristics. But the
+ old code was sloppy enough about handling the flags, and had enough
+ other magic, that it was a little hard for me to understand. I think
+ I understand it better now, but I haven't time to do the cleanup this
+ minute. */
+ if (adata(abfd).magic == undecided_magic)
+ {
+ if (abfd->flags & D_PAGED)
+ /* Whether or not WP_TEXT is set -- let D_PAGED override. */
+ /* @@ What about QMAGIC? */
+ adata(abfd).magic = z_magic;
+ else if (abfd->flags & WP_TEXT)
+ adata(abfd).magic = n_magic;
+ else
+ adata(abfd).magic = o_magic;
+ }
+
+#ifdef BFD_AOUT_DEBUG /* requires gcc2 */
+#if __GNUC__ >= 2
+ fprintf (stderr, "%s text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x,%x>\n",
+ ({ char *str;
+ switch (adata(abfd).magic) {
+ case n_magic: str = "NMAGIC"; break;
+ case o_magic: str = "OMAGIC"; break;
+ case z_magic: str = "ZMAGIC"; break;
+ default: abort ();
+ }
+ str;
+ }),
+ obj_textsec(abfd)->vma, obj_textsec(abfd)->_raw_size, obj_textsec(abfd)->alignment_power,
+ obj_datasec(abfd)->vma, obj_datasec(abfd)->_raw_size, obj_datasec(abfd)->alignment_power,
+ obj_bsssec(abfd)->vma, obj_bsssec(abfd)->_raw_size, obj_bsssec(abfd)->alignment_power);
+#endif
+#endif
+
+ switch (adata(abfd).magic)
+ {
+ case o_magic:
+ {
+ file_ptr pos = adata (abfd).exec_bytes_size;
+ bfd_vma vma = 0;
+ int pad = 0;
+
+ obj_textsec(abfd)->filepos = pos;
+ pos += obj_textsec(abfd)->_raw_size;
+ vma += obj_textsec(abfd)->_raw_size;
+ if (!obj_datasec(abfd)->user_set_vma)
+ {
+#if 0 /* ?? Does alignment in the file image really matter? */
+ pad = align_power (vma, obj_datasec(abfd)->alignment_power) - vma;
+#endif
+ obj_textsec(abfd)->_raw_size += pad;
+ pos += pad;
+ vma += pad;
+ obj_datasec(abfd)->vma = vma;
+ }
+ obj_datasec(abfd)->filepos = pos;
+ pos += obj_datasec(abfd)->_raw_size;
+ vma += obj_datasec(abfd)->_raw_size;
+ if (!obj_bsssec(abfd)->user_set_vma)
+ {
+#if 0
+ pad = align_power (vma, obj_bsssec(abfd)->alignment_power) - vma;
+#endif
+ obj_datasec(abfd)->_raw_size += pad;
+ pos += pad;
+ vma += pad;
+ obj_bsssec(abfd)->vma = vma;
+ }
+ obj_bsssec(abfd)->filepos = pos;
+ execp->a_text = obj_textsec(abfd)->_raw_size;
+ execp->a_data = obj_datasec(abfd)->_raw_size;
+ execp->a_bss = obj_bsssec(abfd)->_raw_size;
+ N_SET_MAGIC (*execp, OMAGIC);
+ }
+ break;
+ case z_magic:
+ {
+ bfd_size_type data_pad, text_pad;
+ file_ptr text_end;
+ CONST struct aout_backend_data *abdp;
+ int ztih;
+ bfd_vma data_vma;
+
+ abdp = aout_backend_info (abfd);
+ ztih = abdp && abdp->text_includes_header;
+ obj_textsec(abfd)->filepos = (ztih
+ ? adata(abfd).exec_bytes_size
+ : adata(abfd).page_size);
+ if (! obj_textsec(abfd)->user_set_vma)
+ /* ?? Do we really need to check for relocs here? */
+ obj_textsec(abfd)->vma = ((abfd->flags & HAS_RELOC)
+ ? 0
+ : (ztih
+ ? (abdp->default_text_vma
+ + adata(abfd).exec_bytes_size)
+ : abdp->default_text_vma));
+ /* Could take strange alignment of text section into account here? */
+
+ /* Find start of data. */
+ text_end = obj_textsec(abfd)->filepos + obj_textsec(abfd)->_raw_size;
+ text_pad = BFD_ALIGN (text_end, adata(abfd).page_size) - text_end;
+ obj_textsec(abfd)->_raw_size += text_pad;
+ text_end += text_pad;
+
+ if (!obj_datasec(abfd)->user_set_vma)
+ {
+ bfd_vma vma;
+ vma = obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size;
+ obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size);
+ }
+ data_vma = obj_datasec(abfd)->vma;
+ if (abdp && abdp->zmagic_mapped_contiguous)
+ {
+ text_pad = (obj_datasec(abfd)->vma
+ - obj_textsec(abfd)->vma
+ - obj_textsec(abfd)->_raw_size);
+ obj_textsec(abfd)->_raw_size += text_pad;
+ }
+ obj_datasec(abfd)->filepos = (obj_textsec(abfd)->filepos
+ + obj_textsec(abfd)->_raw_size);
+
+ /* Fix up exec header while we're at it. */
+ execp->a_text = obj_textsec(abfd)->_raw_size;
+ if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
+ execp->a_text += adata(abfd).exec_bytes_size;
+ N_SET_MAGIC (*execp, ZMAGIC);
+ /* Spec says data section should be rounded up to page boundary. */
+ /* If extra space in page is left after data section, fudge data
+ in the header so that the bss section looks smaller by that
+ amount. We'll start the bss section there, and lie to the OS. */
+ obj_datasec(abfd)->_raw_size
+ = align_power (obj_datasec(abfd)->_raw_size,
+ obj_bsssec(abfd)->alignment_power);
+ execp->a_data = BFD_ALIGN (obj_datasec(abfd)->_raw_size,
+ adata(abfd).page_size);
+ data_pad = execp->a_data - obj_datasec(abfd)->_raw_size;
+
+ if (!obj_bsssec(abfd)->user_set_vma)
+ obj_bsssec(abfd)->vma = (obj_datasec(abfd)->vma
+ + obj_datasec(abfd)->_raw_size);
+ if (data_pad > obj_bsssec(abfd)->_raw_size)
+ execp->a_bss = 0;
+ else
+ execp->a_bss = obj_bsssec(abfd)->_raw_size - data_pad;
+ }
+ break;
+ case n_magic:
+ {
+ file_ptr pos = adata(abfd).exec_bytes_size;
+ bfd_vma vma = 0;
+ int pad;
+
+ obj_textsec(abfd)->filepos = pos;
+ if (!obj_textsec(abfd)->user_set_vma)
+ obj_textsec(abfd)->vma = vma;
+ else
+ vma = obj_textsec(abfd)->vma;
+ pos += obj_textsec(abfd)->_raw_size;
+ vma += obj_textsec(abfd)->_raw_size;
+ obj_datasec(abfd)->filepos = pos;
+ if (!obj_datasec(abfd)->user_set_vma)
+ obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size);
+ vma = obj_datasec(abfd)->vma;
+
+ /* Since BSS follows data immediately, see if it needs alignment. */
+ vma += obj_datasec(abfd)->_raw_size;
+ pad = align_power (vma, obj_bsssec(abfd)->alignment_power) - vma;
+ obj_datasec(abfd)->_raw_size += pad;
+ pos += obj_datasec(abfd)->_raw_size;
+
+ if (!obj_bsssec(abfd)->user_set_vma)
+ obj_bsssec(abfd)->vma = vma;
+ else
+ vma = obj_bsssec(abfd)->vma;
+ }
+ execp->a_text = obj_textsec(abfd)->_raw_size;
+ execp->a_data = obj_datasec(abfd)->_raw_size;
+ execp->a_bss = obj_bsssec(abfd)->_raw_size;
+ N_SET_MAGIC (*execp, NMAGIC);
+ break;
+ default:
+ abort ();
+ }
+#ifdef BFD_AOUT_DEBUG
+ fprintf (stderr, " text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x>\n",
+ obj_textsec(abfd)->vma, obj_textsec(abfd)->_raw_size, obj_textsec(abfd)->filepos,
+ obj_datasec(abfd)->vma, obj_datasec(abfd)->_raw_size, obj_datasec(abfd)->filepos,
+ obj_bsssec(abfd)->vma, obj_bsssec(abfd)->_raw_size);
+#endif
+ return true;
+}
+
+/*
+FUNCTION
+ aout_<size>_new_section_hook
+
+DESCRIPTION
+ Called by the BFD in response to a @code{bfd_make_section}
+ request.
+
+SYNOPSIS
+ boolean aout_<size>_new_section_hook,
+ (bfd *abfd,
+ asection *newsect));
+*/
+boolean
+DEFUN(NAME(aout,new_section_hook),(abfd, newsect),
+ bfd *abfd AND
+ asection *newsect)
+{
+ /* align to double at least */
+ newsect->alignment_power = bfd_get_arch_info(abfd)->section_align_power;
+
+
+ if (bfd_get_format (abfd) == bfd_object)
+ {
+ if (obj_textsec(abfd) == NULL && !strcmp(newsect->name, ".text")) {
+ obj_textsec(abfd)= newsect;
+ newsect->target_index = N_TEXT | N_EXT;
+ return true;
+ }
+
+ if (obj_datasec(abfd) == NULL && !strcmp(newsect->name, ".data")) {
+ obj_datasec(abfd) = newsect;
+ newsect->target_index = N_DATA | N_EXT;
+ return true;
+ }
+
+ if (obj_bsssec(abfd) == NULL && !strcmp(newsect->name, ".bss")) {
+ obj_bsssec(abfd) = newsect;
+ newsect->target_index = N_BSS | N_EXT;
+ return true;
+ }
+
+ }
+
+ /* We allow more than three sections internally */
+ return true;
+}
+
+boolean
+DEFUN(NAME(aout,set_section_contents),(abfd, section, location, offset, count),
+ bfd *abfd AND
+ sec_ptr section AND
+ PTR location AND
+ file_ptr offset AND
+ bfd_size_type count)
+{
+ file_ptr text_end;
+ bfd_size_type text_size;
+
+ if (abfd->output_has_begun == false)
+ {
+ if (NAME(aout,adjust_sizes_and_vmas) (abfd,
+ &text_size,
+ &text_end) == false)
+ return false;
+ }
+
+ /* regardless, once we know what we're doing, we might as well get going */
+ if (section != obj_bsssec(abfd))
+ {
+ bfd_seek (abfd, section->filepos + offset, SEEK_SET);
+
+ if (count) {
+ return (bfd_write ((PTR)location, 1, count, abfd) == count) ?
+ true : false;
+ }
+ return true;
+ }
+ return true;
+}
+
+/* Classify stabs symbols */
+
+#define sym_in_text_section(sym) \
+ (((sym)->type & (N_ABS | N_TEXT | N_DATA | N_BSS))== N_TEXT)
+
+#define sym_in_data_section(sym) \
+ (((sym)->type & (N_ABS | N_TEXT | N_DATA | N_BSS))== N_DATA)
+
+#define sym_in_bss_section(sym) \
+ (((sym)->type & (N_ABS | N_TEXT | N_DATA | N_BSS))== N_BSS)
+
+/* Symbol is undefined if type is N_UNDF|N_EXT and if it has
+ zero in the "value" field. Nonzeroes there are fortrancommon
+ symbols. */
+#define sym_is_undefined(sym) \
+ ((sym)->type == (N_UNDF | N_EXT) && (sym)->symbol.value == 0)
+
+/* Symbol is a global definition if N_EXT is on and if it has
+ a nonzero type field. */
+#define sym_is_global_defn(sym) \
+ (((sym)->type & N_EXT) && (sym)->type & N_TYPE)
+
+/* Symbol is debugger info if any bits outside N_TYPE or N_EXT
+ are on. */
+#define sym_is_debugger_info(sym) \
+ (((sym)->type & ~(N_EXT | N_TYPE)) || (sym)->type == N_FN)
+
+#define sym_is_fortrancommon(sym) \
+ (((sym)->type == (N_EXT)) && (sym)->symbol.value != 0)
+
+/* Symbol is absolute if it has N_ABS set */
+#define sym_is_absolute(sym) \
+ (((sym)->type & N_TYPE)== N_ABS)
+
+
+#define sym_is_indirect(sym) \
+ (((sym)->type & N_ABS)== N_ABS)
+
+/* Only in their own functions for ease of debugging; when sym flags have
+ stabilised these should be inlined into their (single) caller */
+
+static void
+DEFUN (translate_from_native_sym_flags, (sym_pointer, cache_ptr, abfd),
+ struct external_nlist *sym_pointer AND
+ aout_symbol_type * cache_ptr AND
+ bfd * abfd)
+{
+ cache_ptr->symbol.section = 0;
+ switch (cache_ptr->type & N_TYPE)
+ {
+ case N_SETA:
+ case N_SETT:
+ case N_SETD:
+ case N_SETB:
+ {
+ char *copy = bfd_alloc (abfd, strlen (cache_ptr->symbol.name) + 1);
+ asection *section;
+ asection *into_section;
+
+ arelent_chain *reloc = (arelent_chain *) bfd_alloc (abfd, sizeof (arelent_chain));
+ strcpy (copy, cache_ptr->symbol.name);
+
+ /* Make sure that this bfd has a section with the right contructor
+ name */
+ section = bfd_get_section_by_name (abfd, copy);
+ if (!section)
+ section = bfd_make_section (abfd, copy);
+
+ /* Build a relocation entry for the constructor */
+ switch ((cache_ptr->type & N_TYPE))
+ {
+ case N_SETA:
+ into_section = &bfd_abs_section;
+ cache_ptr->type = N_ABS;
+ break;
+ case N_SETT:
+ into_section = (asection *) obj_textsec (abfd);
+ cache_ptr->type = N_TEXT;
+ break;
+ case N_SETD:
+ into_section = (asection *) obj_datasec (abfd);
+ cache_ptr->type = N_DATA;
+ break;
+ case N_SETB:
+ into_section = (asection *) obj_bsssec (abfd);
+ cache_ptr->type = N_BSS;
+ break;
+ default:
+ abort ();
+ }
+
+ /* Build a relocation pointing into the constuctor section
+ pointing at the symbol in the set vector specified */
+
+ reloc->relent.addend = cache_ptr->symbol.value;
+ cache_ptr->symbol.section = into_section->symbol->section;
+ reloc->relent.sym_ptr_ptr = into_section->symbol_ptr_ptr;
+
+
+ /* We modify the symbol to belong to a section depending upon the
+ name of the symbol - probably __CTOR__ or __DTOR__ but we don't
+ really care, and add to the size of the section to contain a
+ pointer to the symbol. Build a reloc entry to relocate to this
+ symbol attached to this section. */
+
+ section->flags = SEC_CONSTRUCTOR;
+
+
+ section->reloc_count++;
+ section->alignment_power = 2;
+
+ reloc->next = section->constructor_chain;
+ section->constructor_chain = reloc;
+ reloc->relent.address = section->_raw_size;
+ section->_raw_size += sizeof (int *);
+
+ reloc->relent.howto
+ = (obj_reloc_entry_size(abfd) == RELOC_EXT_SIZE
+ ? howto_table_ext : howto_table_std)
+ + CTOR_TABLE_RELOC_IDX;
+ cache_ptr->symbol.flags |= BSF_CONSTRUCTOR;
+ }
+ break;
+ default:
+ if (cache_ptr->type == N_WARNING)
+ {
+ /* This symbol is the text of a warning message, the next symbol
+ is the symbol to associate the warning with */
+ cache_ptr->symbol.flags = BSF_DEBUGGING | BSF_WARNING;
+
+ /* @@ Stuffing pointers into integers is a no-no.
+ We can usually get away with it if the integer is
+ large enough though. */
+ if (sizeof (cache_ptr + 1) > sizeof (bfd_vma))
+ abort ();
+ cache_ptr->symbol.value = (bfd_vma) ((cache_ptr + 1));
+
+ /* We furgle with the next symbol in place.
+ We don't want it to be undefined, we'll trample the type */
+ (sym_pointer + 1)->e_type[0] = 0xff;
+ break;
+ }
+ if ((cache_ptr->type | N_EXT) == (N_INDR | N_EXT))
+ {
+ /* Two symbols in a row for an INDR message. The first symbol
+ contains the name we will match, the second symbol contains
+ the name the first name is translated into. It is supplied to
+ us undefined. This is good, since we want to pull in any files
+ which define it */
+ cache_ptr->symbol.flags = BSF_DEBUGGING | BSF_INDIRECT;
+
+ /* @@ Stuffing pointers into integers is a no-no.
+ We can usually get away with it if the integer is
+ large enough though. */
+ if (sizeof (cache_ptr + 1) > sizeof (bfd_vma))
+ abort ();
+
+ cache_ptr->symbol.value = (bfd_vma) ((cache_ptr + 1));
+ cache_ptr->symbol.section = &bfd_ind_section;
+ }
+
+ else if (sym_is_debugger_info (cache_ptr))
+ {
+ cache_ptr->symbol.flags = BSF_DEBUGGING;
+ /* Work out the section correct for this symbol */
+ switch (cache_ptr->type & N_TYPE)
+ {
+ case N_TEXT:
+ case N_FN:
+ cache_ptr->symbol.section = obj_textsec (abfd);
+ cache_ptr->symbol.value -= obj_textsec (abfd)->vma;
+ break;
+ case N_DATA:
+ cache_ptr->symbol.value -= obj_datasec (abfd)->vma;
+ cache_ptr->symbol.section = obj_datasec (abfd);
+ break;
+ case N_BSS:
+ cache_ptr->symbol.section = obj_bsssec (abfd);
+ cache_ptr->symbol.value -= obj_bsssec (abfd)->vma;
+ break;
+ default:
+ case N_ABS:
+
+ cache_ptr->symbol.section = &bfd_abs_section;
+ break;
+ }
+ }
+ else
+ {
+
+ if (sym_is_fortrancommon (cache_ptr))
+ {
+ cache_ptr->symbol.flags = 0;
+ cache_ptr->symbol.section = &bfd_com_section;
+ }
+ else
+ {
+
+
+ }
+
+ /* In a.out, the value of a symbol is always relative to the
+ * start of the file, if this is a data symbol we'll subtract
+ * the size of the text section to get the section relative
+ * value. If this is a bss symbol (which would be strange)
+ * we'll subtract the size of the previous two sections
+ * to find the section relative address.
+ */
+
+ if (sym_in_text_section (cache_ptr))
+ {
+ cache_ptr->symbol.value -= obj_textsec (abfd)->vma;
+ cache_ptr->symbol.section = obj_textsec (abfd);
+ }
+ else if (sym_in_data_section (cache_ptr))
+ {
+ cache_ptr->symbol.value -= obj_datasec (abfd)->vma;
+ cache_ptr->symbol.section = obj_datasec (abfd);
+ }
+ else if (sym_in_bss_section (cache_ptr))
+ {
+ cache_ptr->symbol.section = obj_bsssec (abfd);
+ cache_ptr->symbol.value -= obj_bsssec (abfd)->vma;
+ }
+ else if (sym_is_undefined (cache_ptr))
+ {
+ cache_ptr->symbol.flags = 0;
+ cache_ptr->symbol.section = &bfd_und_section;
+ }
+ else if (sym_is_absolute (cache_ptr))
+ {
+ cache_ptr->symbol.section = &bfd_abs_section;
+ }
+
+ if (sym_is_global_defn (cache_ptr))
+ {
+ cache_ptr->symbol.flags = BSF_GLOBAL | BSF_EXPORT;
+ }
+ else
+ {
+ cache_ptr->symbol.flags = BSF_LOCAL;
+ }
+ }
+ }
+ if (cache_ptr->symbol.section == 0)
+ abort ();
+}
+
+
+
+static void
+DEFUN(translate_to_native_sym_flags,(sym_pointer, cache_ptr, abfd),
+ struct external_nlist *sym_pointer AND
+ asymbol *cache_ptr AND
+ bfd *abfd)
+{
+ bfd_vma value = cache_ptr->value;
+
+ /* mask out any existing type bits in case copying from one section
+ to another */
+ sym_pointer->e_type[0] &= ~N_TYPE;
+
+
+ /* We attempt to order these tests by decreasing frequency of success,
+ according to tcov when linking the linker. */
+ if (bfd_get_output_section(cache_ptr) == &bfd_abs_section) {
+ sym_pointer->e_type[0] |= N_ABS;
+ }
+ else if (bfd_get_output_section(cache_ptr) == obj_textsec (abfd)) {
+ sym_pointer->e_type[0] |= N_TEXT;
+ }
+ else if (bfd_get_output_section(cache_ptr) == obj_datasec (abfd)) {
+ sym_pointer->e_type[0] |= N_DATA;
+ }
+ else if (bfd_get_output_section(cache_ptr) == obj_bsssec (abfd)) {
+ sym_pointer->e_type[0] |= N_BSS;
+ }
+ else if (bfd_get_output_section(cache_ptr) == &bfd_und_section)
+ {
+ sym_pointer->e_type[0] = (N_UNDF | N_EXT);
+ }
+ else if (bfd_get_output_section(cache_ptr) == &bfd_ind_section)
+ {
+ sym_pointer->e_type[0] = N_INDR;
+ }
+ else if (bfd_is_com_section (bfd_get_output_section (cache_ptr))) {
+ sym_pointer->e_type[0] = (N_UNDF | N_EXT);
+ }
+ else {
+ if (cache_ptr->section->output_section)
+ {
+
+ bfd_error_vector.nonrepresentable_section(abfd,
+ bfd_get_output_section(cache_ptr)->name);
+ }
+ else
+ {
+ bfd_error_vector.nonrepresentable_section(abfd,
+ cache_ptr->section->name);
+
+ }
+
+ }
+ /* Turn the symbol from section relative to absolute again */
+
+ value += cache_ptr->section->output_section->vma + cache_ptr->section->output_offset ;
+
+
+ if (cache_ptr->flags & (BSF_WARNING)) {
+ (sym_pointer+1)->e_type[0] = 1;
+ }
+
+ if (cache_ptr->flags & BSF_DEBUGGING) {
+ sym_pointer->e_type[0] = ((aout_symbol_type *)cache_ptr)->type;
+ }
+ else if (cache_ptr->flags & (BSF_GLOBAL | BSF_EXPORT)) {
+ sym_pointer->e_type[0] |= N_EXT;
+ }
+ if (cache_ptr->flags & BSF_CONSTRUCTOR) {
+ int type = ((aout_symbol_type *)cache_ptr)->type;
+ switch (type)
+ {
+ case N_ABS: type = N_SETA; break;
+ case N_TEXT: type = N_SETT; break;
+ case N_DATA: type = N_SETD; break;
+ case N_BSS: type = N_SETB; break;
+ }
+ sym_pointer->e_type[0] = type;
+ }
+
+ PUT_WORD(abfd, value, sym_pointer->e_value);
+}
+
+/* Native-level interface to symbols. */
+
+/* We read the symbols into a buffer, which is discarded when this
+function exits. We read the strings into a buffer large enough to
+hold them all plus all the cached symbol entries. */
+
+asymbol *
+DEFUN(NAME(aout,make_empty_symbol),(abfd),
+ bfd *abfd)
+{
+ aout_symbol_type *new =
+ (aout_symbol_type *)bfd_zalloc (abfd, sizeof (aout_symbol_type));
+ new->symbol.the_bfd = abfd;
+
+ return &new->symbol;
+}
+
+boolean
+DEFUN(NAME(aout,slurp_symbol_table),(abfd),
+ bfd *abfd)
+{
+ bfd_size_type symbol_size;
+ bfd_size_type string_size;
+ unsigned char string_chars[BYTES_IN_WORD];
+ struct external_nlist *syms;
+ char *strings;
+ aout_symbol_type *cached;
+
+ /* If there's no work to be done, don't do any */
+ if (obj_aout_symbols (abfd) != (aout_symbol_type *)NULL) return true;
+ symbol_size = exec_hdr(abfd)->a_syms;
+ if (symbol_size == 0)
+ {
+ bfd_error = no_symbols;
+ return false;
+ }
+
+ bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET);
+ if (bfd_read ((PTR)string_chars, BYTES_IN_WORD, 1, abfd) != BYTES_IN_WORD)
+ return false;
+ string_size = GET_WORD (abfd, string_chars);
+
+ strings =(char *) bfd_alloc(abfd, string_size + 1);
+ cached = (aout_symbol_type *)
+ bfd_zalloc(abfd, (bfd_size_type)(bfd_get_symcount (abfd) * sizeof(aout_symbol_type)));
+
+ /* malloc this, so we can free it if simply. The symbol caching
+ might want to allocate onto the bfd's obstack */
+ syms = (struct external_nlist *) bfd_xmalloc(symbol_size);
+ bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET);
+ if (bfd_read ((PTR)syms, 1, symbol_size, abfd) != symbol_size)
+ {
+ bailout:
+ if (syms)
+ free (syms);
+ if (cached)
+ bfd_release (abfd, cached);
+ if (strings)
+ bfd_release (abfd, strings);
+ return false;
+ }
+
+ bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET);
+ if (bfd_read ((PTR)strings, 1, string_size, abfd) != string_size)
+ {
+ goto bailout;
+ }
+ strings[string_size] = 0; /* Just in case. */
+
+ /* OK, now walk the new symtable, cacheing symbol properties */
+ {
+ register struct external_nlist *sym_pointer;
+ register struct external_nlist *sym_end = syms + bfd_get_symcount (abfd);
+ register aout_symbol_type *cache_ptr = cached;
+
+ /* Run through table and copy values */
+ for (sym_pointer = syms, cache_ptr = cached;
+ sym_pointer < sym_end; sym_pointer ++, cache_ptr++)
+ {
+ long x = GET_WORD(abfd, sym_pointer->e_strx);
+ cache_ptr->symbol.the_bfd = abfd;
+ if (x == 0)
+ cache_ptr->symbol.name = "";
+ else if (x >= 0 && x < string_size)
+ cache_ptr->symbol.name = x + strings;
+ else
+ goto bailout;
+
+ cache_ptr->symbol.value = GET_SWORD(abfd, sym_pointer->e_value);
+ cache_ptr->desc = bfd_h_get_16(abfd, sym_pointer->e_desc);
+ cache_ptr->other = bfd_h_get_8(abfd, sym_pointer->e_other);
+ cache_ptr->type = bfd_h_get_8(abfd, sym_pointer->e_type);
+ cache_ptr->symbol.udata = 0;
+ translate_from_native_sym_flags (sym_pointer, cache_ptr, abfd);
+ }
+ }
+
+ obj_aout_symbols (abfd) = cached;
+ free((PTR)syms);
+
+ return true;
+}
+
+
+/* Possible improvements:
+ + look for strings matching trailing substrings of other strings
+ + better data structures? balanced trees?
+ + smaller per-string or per-symbol data? re-use some of the symbol's
+ data fields?
+ + also look at reducing memory use elsewhere -- maybe if we didn't have to
+ construct the entire symbol table at once, we could get by with smaller
+ amounts of VM? (What effect does that have on the string table
+ reductions?)
+ + rip this out of here, put it into its own file in bfd or libiberty, so
+ coff and elf can use it too. I'll work on this soon, but have more
+ pressing tasks right now.
+
+ A hash table might(?) be more efficient for handling exactly the cases that
+ are handled now, but for trailing substring matches, I think we want to
+ examine the `nearest' values (reverse-)lexically, not merely impose a strict
+ order, nor look only for exact-match or not-match. I don't think a hash
+ table would be very useful for that, and I don't feel like fleshing out two
+ completely different implementations. [raeburn:930419.0331EDT] */
+
+struct stringtab_entry {
+ /* Hash value for this string. Only useful so long as we aren't doing
+ substring matches. */
+ unsigned int hash;
+
+ /* Next node to look at, depending on whether the hash value of the string
+ being searched for is less than or greater than the hash value of the
+ current node. For now, `equal to' is lumped in with `greater than', for
+ space efficiency. It's not a common enough case to warrant another field
+ to be used for all nodes. */
+ struct stringtab_entry *less;
+ struct stringtab_entry *greater;
+
+ /* The string itself. */
+ CONST char *string;
+
+ /* The index allocated for this string. */
+ bfd_size_type index;
+
+#ifdef GATHER_STATISTICS
+ /* How many references have there been to this string? (Not currently used;
+ could be dumped out for anaylsis, if anyone's interested.) */
+ unsigned long count;
+#endif
+
+ /* Next node in linked list, in suggested output order. */
+ struct stringtab_entry *next_to_output;
+};
+
+struct stringtab_data {
+ /* Tree of string table entries. */
+ struct stringtab_entry *strings;
+
+ /* Fudge factor used to center top node of tree. */
+ int hash_zero;
+
+ /* Next index value to issue. */
+ bfd_size_type index;
+
+ /* Index used for empty strings. Cached here because checking for them
+ is really easy, and we can avoid searching the tree. */
+ bfd_size_type empty_string_index;
+
+ /* These fields indicate the two ends of a singly-linked list that indicates
+ the order strings should be written out in. Use this order, and no
+ seeking will need to be done, so output efficiency should be maximized. */
+ struct stringtab_entry **end;
+ struct stringtab_entry *output_order;
+
+#ifdef GATHER_STATISTICS
+ /* Number of strings which duplicate strings already in the table. */
+ unsigned long duplicates;
+
+ /* Number of bytes saved by not having to write all the duplicate strings. */
+ unsigned long bytes_saved;
+
+ /* Number of zero-length strings. Currently, these all turn into
+ references to the null byte at the end of the first string. In some
+ cases (possibly not all? explore this...), it should be possible to
+ simply write out a zero index value. */
+ unsigned long empty_strings;
+
+ /* Number of times the hash values matched but the strings were different.
+ Note that this includes the number of times the other string(s) occurs, so
+ there may only be two strings hashing to the same value, even if this
+ number is very large. */
+ unsigned long bad_hash_matches;
+
+ /* Null strings aren't counted in this one.
+ This will probably only be nonzero if we've got an input file
+ which was produced by `ld -r' (i.e., it's already been processed
+ through this code). Under some operating systems, native tools
+ may make all empty strings have the same index; but the pointer
+ check won't catch those, because to get to that stage we'd already
+ have to compute the checksum, which requires reading the string,
+ so we short-circuit that case with empty_string_index above. */
+ unsigned long pointer_matches;
+
+ /* Number of comparisons done. I figure with the algorithms in use below,
+ the average number of comparisons done (per symbol) should be roughly
+ log-base-2 of the number of unique strings. */
+ unsigned long n_compares;
+#endif
+};
+
+/* Some utility functions for the string table code. */
+
+/* For speed, only hash on the first this many bytes of strings.
+ This number was chosen by profiling ld linking itself, with -g. */
+#define HASHMAXLEN 25
+
+#define HASH_CHAR(c) (sum ^= sum >> 20, sum ^= sum << 7, sum += (c))
+
+static INLINE unsigned int
+hash (string, len)
+ unsigned char *string;
+ register unsigned int len;
+{
+ register unsigned int sum = 0;
+
+ if (len > HASHMAXLEN)
+ {
+ HASH_CHAR (len);
+ len = HASHMAXLEN;
+ }
+
+ while (len--)
+ {
+ HASH_CHAR (*string++);
+ }
+ return sum;
+}
+
+static INLINE void
+stringtab_init (tab)
+ struct stringtab_data *tab;
+{
+ tab->strings = 0;
+ tab->output_order = 0;
+ tab->end = &tab->output_order;
+
+ /* Initial string table length includes size of length field. */
+ tab->index = BYTES_IN_WORD;
+ tab->empty_string_index = -1;
+#ifdef GATHER_STATISTICS
+ tab->duplicates = 0;
+ tab->empty_strings = 0;
+ tab->bad_hash_matches = 0;
+ tab->pointer_matches = 0;
+ tab->bytes_saved = 0;
+ tab->n_compares = 0;
+#endif
+}
+
+static INLINE int
+compare (entry, str, hash)
+ struct stringtab_entry *entry;
+ CONST char *str;
+ unsigned int hash;
+{
+ return hash - entry->hash;
+}
+
+#ifdef GATHER_STATISTICS
+/* Don't want to have to link in math library with all bfd applications... */
+static INLINE double
+log2 (num)
+ int num;
+{
+ double d = num;
+ int n = 0;
+ while (d >= 2.0)
+ n++, d /= 2.0;
+ return ((d > 1.41) ? 0.5 : 0) + n;
+}
+#endif
+
+/* Main string table routines. */
+/* Returns index in string table. Whether or not this actually adds an
+ entry into the string table should be irrelevant -- it just has to
+ return a valid index. */
+static bfd_size_type
+add_to_stringtab (abfd, str, tab, check)
+ bfd *abfd;
+ CONST char *str;
+ struct stringtab_data *tab;
+ int check;
+{
+ struct stringtab_entry **ep;
+ register struct stringtab_entry *entry;
+ unsigned int hashval, len;
+
+ if (str[0] == 0)
+ {
+ bfd_size_type index;
+ CONST bfd_size_type minus_one = -1;
+
+#ifdef GATHER_STATISTICS
+ tab->empty_strings++;
+#endif
+ index = tab->empty_string_index;
+ if (index != minus_one)
+ {
+ got_empty:
+#ifdef GATHER_STATISTICS
+ tab->bytes_saved++;
+ tab->duplicates++;
+#endif
+ return index;
+ }
+
+ /* Need to find it. */
+ entry = tab->strings;
+ if (entry)
+ {
+ index = entry->index + strlen (entry->string);
+ tab->empty_string_index = index;
+ goto got_empty;
+ }
+ len = 0;
+ }
+ else
+ len = strlen (str);
+
+ /* The hash_zero value is chosen such that the first symbol gets a value of
+ zero. With a balanced tree, this wouldn't be very useful, but without it,
+ we might get a more even split at the top level, instead of skewing it
+ badly should hash("/usr/lib/crt0.o") (or whatever) be far from zero. */
+ hashval = hash (str, len) ^ tab->hash_zero;
+ ep = &tab->strings;
+ if (!*ep)
+ {
+ tab->hash_zero = hashval;
+ hashval = 0;
+ goto add_it;
+ }
+
+ while (*ep)
+ {
+ register int cmp;
+
+ entry = *ep;
+#ifdef GATHER_STATISTICS
+ tab->n_compares++;
+#endif
+ cmp = compare (entry, str, hashval);
+ /* The not-equal cases are more frequent, so check them first. */
+ if (cmp > 0)
+ ep = &entry->greater;
+ else if (cmp < 0)
+ ep = &entry->less;
+ else
+ {
+ if (entry->string == str)
+ {
+#ifdef GATHER_STATISTICS
+ tab->pointer_matches++;
+#endif
+ goto match;
+ }
+ /* Compare the first bytes to save a function call if they
+ don't match. */
+ if (entry->string[0] == str[0] && !strcmp (entry->string, str))
+ {
+ match:
+#ifdef GATHER_STATISTICS
+ entry->count++;
+ tab->bytes_saved += len + 1;
+ tab->duplicates++;
+#endif
+ /* If we're in the linker, and the new string is from a new
+ input file which might have already had these reductions
+ run over it, we want to keep the new string pointer. I
+ don't think we're likely to see any (or nearly as many,
+ at least) cases where a later string is in the same location
+ as an earlier one rather than this one. */
+ entry->string = str;
+ return entry->index;
+ }
+#ifdef GATHER_STATISTICS
+ tab->bad_hash_matches++;
+#endif
+ ep = &entry->greater;
+ }
+ }
+
+ /* If we get here, nothing that's in the table already matched.
+ EP points to the `next' field at the end of the chain; stick a
+ new entry on here. */
+ add_it:
+ entry = (struct stringtab_entry *)
+ bfd_alloc_by_size_t (abfd, sizeof (struct stringtab_entry));
+
+ entry->less = entry->greater = 0;
+ entry->hash = hashval;
+ entry->index = tab->index;
+ entry->string = str;
+ entry->next_to_output = 0;
+#ifdef GATHER_STATISTICS
+ entry->count = 1;
+#endif
+
+ assert (*tab->end == 0);
+ *(tab->end) = entry;
+ tab->end = &entry->next_to_output;
+ assert (*tab->end == 0);
+
+ {
+ tab->index += len + 1;
+ if (len == 0)
+ tab->empty_string_index = entry->index;
+ }
+ assert (*ep == 0);
+ *ep = entry;
+ return entry->index;
+}
+
+static void
+emit_strtab (abfd, tab)
+ bfd *abfd;
+ struct stringtab_data *tab;
+{
+ struct stringtab_entry *entry;
+#ifdef GATHER_STATISTICS
+ int count = 0;
+#endif
+
+ /* Be sure to put string length into correct byte ordering before writing
+ it out. */
+ char buffer[BYTES_IN_WORD];
+
+ PUT_WORD (abfd, tab->index, (unsigned char *) buffer);
+ bfd_write ((PTR) buffer, 1, BYTES_IN_WORD, abfd);
+
+ for (entry = tab->output_order; entry; entry = entry->next_to_output)
+ {
+ bfd_write ((PTR) entry->string, 1, strlen (entry->string) + 1, abfd);
+#ifdef GATHER_STATISTICS
+ count++;
+#endif
+ }
+
+#ifdef GATHER_STATISTICS
+ /* Short form only, for now.
+ To do: Specify output file. Conditionalize on environment? Detailed
+ analysis if desired. */
+ {
+ int n_syms = bfd_get_symcount (abfd);
+
+ fprintf (stderr, "String table data for output file:\n");
+ fprintf (stderr, " %8d symbols output\n", n_syms);
+ fprintf (stderr, " %8d duplicate strings\n", tab->duplicates);
+ fprintf (stderr, " %8d empty strings\n", tab->empty_strings);
+ fprintf (stderr, " %8d unique strings output\n", count);
+ fprintf (stderr, " %8d pointer matches\n", tab->pointer_matches);
+ fprintf (stderr, " %8d bytes saved\n", tab->bytes_saved);
+ fprintf (stderr, " %8d bad hash matches\n", tab->bad_hash_matches);
+ fprintf (stderr, " %8d hash-val comparisons\n", tab->n_compares);
+ if (n_syms)
+ {
+ double n_compares = tab->n_compares;
+ double avg_compares = n_compares / n_syms;
+ /* The second value here should usually be near one. */
+ fprintf (stderr,
+ "\t average %f comparisons per symbol (%f * log2 nstrings)\n",
+ avg_compares, avg_compares / log2 (count));
+ }
+ }
+#endif
+
+/* Old code:
+ unsigned int count;
+ generic = bfd_get_outsymbols(abfd);
+ for (count = 0; count < bfd_get_symcount(abfd); count++)
+ {
+ asymbol *g = *(generic++);
+
+ if (g->name)
+ {
+ size_t length = strlen(g->name)+1;
+ bfd_write((PTR)g->name, 1, length, abfd);
+ }
+ g->KEEPIT = (KEEPITTYPE) count;
+ } */
+}
+
+void
+DEFUN(NAME(aout,write_syms),(abfd),
+ bfd *abfd)
+{
+ unsigned int count ;
+ asymbol **generic = bfd_get_outsymbols (abfd);
+ struct stringtab_data strtab;
+
+ stringtab_init (&strtab);
+
+ for (count = 0; count < bfd_get_symcount (abfd); count++)
+ {
+ asymbol *g = generic[count];
+ struct external_nlist nsp;
+
+ if (g->name)
+ PUT_WORD (abfd, add_to_stringtab (abfd, g->name, &strtab),
+ (unsigned char *) nsp.e_strx);
+ else
+ PUT_WORD (abfd, 0, (unsigned char *)nsp.e_strx);
+
+ if (bfd_asymbol_flavour(g) == abfd->xvec->flavour)
+ {
+ bfd_h_put_16(abfd, aout_symbol(g)->desc, nsp.e_desc);
+ bfd_h_put_8(abfd, aout_symbol(g)->other, nsp.e_other);
+ bfd_h_put_8(abfd, aout_symbol(g)->type, nsp.e_type);
+ }
+ else
+ {
+ bfd_h_put_16(abfd,0, nsp.e_desc);
+ bfd_h_put_8(abfd, 0, nsp.e_other);
+ bfd_h_put_8(abfd, 0, nsp.e_type);
+ }
+
+ translate_to_native_sym_flags (&nsp, g, abfd);
+
+ bfd_write((PTR)&nsp,1,EXTERNAL_NLIST_SIZE, abfd);
+
+ /* NB: `KEEPIT' currently overlays `flags', so set this only
+ here, at the end. */
+ g->KEEPIT = count;
+ }
+
+ emit_strtab (abfd, &strtab);
+}
+
+
+unsigned int
+DEFUN(NAME(aout,get_symtab),(abfd, location),
+ bfd *abfd AND
+ asymbol **location)
+{
+ unsigned int counter = 0;
+ aout_symbol_type *symbase;
+
+ if (!NAME(aout,slurp_symbol_table)(abfd)) return 0;
+
+ for (symbase = obj_aout_symbols(abfd); counter++ < bfd_get_symcount (abfd);)
+ *(location++) = (asymbol *)( symbase++);
+ *location++ =0;
+ return bfd_get_symcount (abfd);
+}
+
+
+/* Standard reloc stuff */
+/* Output standard relocation information to a file in target byte order. */
+
+void
+DEFUN(NAME(aout,swap_std_reloc_out),(abfd, g, natptr),
+ bfd *abfd AND
+ arelent *g AND
+ struct reloc_std_external *natptr)
+{
+ int r_index;
+ asymbol *sym = *(g->sym_ptr_ptr);
+ int r_extern;
+ unsigned int r_length;
+ int r_pcrel;
+ int r_baserel, r_jmptable, r_relative;
+ unsigned int r_addend;
+ asection *output_section = sym->section->output_section;
+
+ PUT_WORD(abfd, g->address, natptr->r_address);
+
+ r_length = g->howto->size ; /* Size as a power of two */
+ r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */
+ /* XXX This relies on relocs coming from a.out files. */
+ r_baserel = (g->howto->type & 8) != 0;
+ /* r_jmptable, r_relative??? FIXME-soon */
+ r_jmptable = 0;
+ r_relative = 0;
+
+ r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
+
+ /* name was clobbered by aout_write_syms to be symbol index */
+
+ /* If this relocation is relative to a symbol then set the
+ r_index to the symbols index, and the r_extern bit.
+
+ Absolute symbols can come in in two ways, either as an offset
+ from the abs section, or as a symbol which has an abs value.
+ check for that here
+ */
+
+
+ if (bfd_is_com_section (output_section)
+ || output_section == &bfd_abs_section
+ || output_section == &bfd_und_section)
+ {
+ if (bfd_abs_section.symbol == sym)
+ {
+ /* Whoops, looked like an abs symbol, but is really an offset
+ from the abs section */
+ r_index = 0;
+ r_extern = 0;
+ }
+ else
+ {
+ /* Fill in symbol */
+ r_extern = 1;
+ r_index = stoi((*(g->sym_ptr_ptr))->KEEPIT);
+
+ }
+ }
+ else
+ {
+ /* Just an ordinary section */
+ r_extern = 0;
+ r_index = output_section->target_index;
+ }
+
+ /* now the fun stuff */
+ if (abfd->xvec->header_byteorder_big_p != false) {
+ natptr->r_index[0] = r_index >> 16;
+ natptr->r_index[1] = r_index >> 8;
+ natptr->r_index[2] = r_index;
+ natptr->r_type[0] =
+ (r_extern? RELOC_STD_BITS_EXTERN_BIG: 0)
+ | (r_pcrel? RELOC_STD_BITS_PCREL_BIG: 0)
+ | (r_baserel? RELOC_STD_BITS_BASEREL_BIG: 0)
+ | (r_jmptable? RELOC_STD_BITS_JMPTABLE_BIG: 0)
+ | (r_relative? RELOC_STD_BITS_RELATIVE_BIG: 0)
+ | (r_length << RELOC_STD_BITS_LENGTH_SH_BIG);
+ } else {
+ natptr->r_index[2] = r_index >> 16;
+ natptr->r_index[1] = r_index >> 8;
+ natptr->r_index[0] = r_index;
+ natptr->r_type[0] =
+ (r_extern? RELOC_STD_BITS_EXTERN_LITTLE: 0)
+ | (r_pcrel? RELOC_STD_BITS_PCREL_LITTLE: 0)
+ | (r_baserel? RELOC_STD_BITS_BASEREL_LITTLE: 0)
+ | (r_jmptable? RELOC_STD_BITS_JMPTABLE_LITTLE: 0)
+ | (r_relative? RELOC_STD_BITS_RELATIVE_LITTLE: 0)
+ | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE);
+ }
+}
+
+
+/* Extended stuff */
+/* Output extended relocation information to a file in target byte order. */
+
+void
+DEFUN(NAME(aout,swap_ext_reloc_out),(abfd, g, natptr),
+ bfd *abfd AND
+ arelent *g AND
+ register struct reloc_ext_external *natptr)
+{
+ int r_index;
+ int r_extern;
+ unsigned int r_type;
+ unsigned int r_addend;
+ asymbol *sym = *(g->sym_ptr_ptr);
+ asection *output_section = sym->section->output_section;
+
+ PUT_WORD (abfd, g->address, natptr->r_address);
+
+ r_type = (unsigned int) g->howto->type;
+
+ r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
+
+ /* If this relocation is relative to a symbol then set the
+ r_index to the symbols index, and the r_extern bit.
+
+ Absolute symbols can come in in two ways, either as an offset
+ from the abs section, or as a symbol which has an abs value.
+ check for that here. */
+
+ if (bfd_is_com_section (output_section)
+ || output_section == &bfd_abs_section
+ || output_section == &bfd_und_section)
+ {
+ if (bfd_abs_section.symbol == sym)
+ {
+ /* Whoops, looked like an abs symbol, but is really an offset
+ from the abs section */
+ r_index = 0;
+ r_extern = 0;
+ }
+ else
+ {
+ r_extern = 1;
+ r_index = stoi((*(g->sym_ptr_ptr))->KEEPIT);
+ }
+ }
+ else
+ {
+ /* Just an ordinary section */
+ r_extern = 0;
+ r_index = output_section->target_index;
+ }
+
+ /* now the fun stuff */
+ if (abfd->xvec->header_byteorder_big_p != false) {
+ natptr->r_index[0] = r_index >> 16;
+ natptr->r_index[1] = r_index >> 8;
+ natptr->r_index[2] = r_index;
+ natptr->r_type[0] =
+ ((r_extern? RELOC_EXT_BITS_EXTERN_BIG: 0)
+ | (r_type << RELOC_EXT_BITS_TYPE_SH_BIG));
+ } else {
+ natptr->r_index[2] = r_index >> 16;
+ natptr->r_index[1] = r_index >> 8;
+ natptr->r_index[0] = r_index;
+ natptr->r_type[0] =
+ (r_extern? RELOC_EXT_BITS_EXTERN_LITTLE: 0)
+ | (r_type << RELOC_EXT_BITS_TYPE_SH_LITTLE);
+ }
+
+ PUT_WORD (abfd, r_addend, natptr->r_addend);
+}
+
+/* BFD deals internally with all things based from the section they're
+ in. so, something in 10 bytes into a text section with a base of
+ 50 would have a symbol (.text+10) and know .text vma was 50.
+
+ Aout keeps all it's symbols based from zero, so the symbol would
+ contain 60. This macro subs the base of each section from the value
+ to give the true offset from the section */
+
+
+#define MOVE_ADDRESS(ad) \
+ if (r_extern) { \
+ /* undefined symbol */ \
+ cache_ptr->sym_ptr_ptr = symbols + r_index; \
+ cache_ptr->addend = ad; \
+ } else { \
+ /* defined, section relative. replace symbol with pointer to \
+ symbol which points to section */ \
+ switch (r_index) { \
+ case N_TEXT: \
+ case N_TEXT | N_EXT: \
+ cache_ptr->sym_ptr_ptr = obj_textsec(abfd)->symbol_ptr_ptr; \
+ cache_ptr->addend = ad - su->textsec->vma; \
+ break; \
+ case N_DATA: \
+ case N_DATA | N_EXT: \
+ cache_ptr->sym_ptr_ptr = obj_datasec(abfd)->symbol_ptr_ptr; \
+ cache_ptr->addend = ad - su->datasec->vma; \
+ break; \
+ case N_BSS: \
+ case N_BSS | N_EXT: \
+ cache_ptr->sym_ptr_ptr = obj_bsssec(abfd)->symbol_ptr_ptr; \
+ cache_ptr->addend = ad - su->bsssec->vma; \
+ break; \
+ default: \
+ case N_ABS: \
+ case N_ABS | N_EXT: \
+ cache_ptr->sym_ptr_ptr = bfd_abs_section.symbol_ptr_ptr; \
+ cache_ptr->addend = ad; \
+ break; \
+ } \
+ } \
+
+void
+DEFUN(NAME(aout,swap_ext_reloc_in), (abfd, bytes, cache_ptr, symbols),
+ bfd *abfd AND
+ struct reloc_ext_external *bytes AND
+ arelent *cache_ptr AND
+ asymbol **symbols)
+{
+ int r_index;
+ int r_extern;
+ unsigned int r_type;
+ struct aoutdata *su = &(abfd->tdata.aout_data->a);
+
+ cache_ptr->address = (GET_SWORD (abfd, bytes->r_address));
+
+ /* now the fun stuff */
+ if (abfd->xvec->header_byteorder_big_p != false) {
+ r_index = (bytes->r_index[0] << 16)
+ | (bytes->r_index[1] << 8)
+ | bytes->r_index[2];
+ r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_BIG));
+ r_type = (bytes->r_type[0] & RELOC_EXT_BITS_TYPE_BIG)
+ >> RELOC_EXT_BITS_TYPE_SH_BIG;
+ } else {
+ r_index = (bytes->r_index[2] << 16)
+ | (bytes->r_index[1] << 8)
+ | bytes->r_index[0];
+ r_extern = (0 != (bytes->r_type[0] & RELOC_EXT_BITS_EXTERN_LITTLE));
+ r_type = (bytes->r_type[0] & RELOC_EXT_BITS_TYPE_LITTLE)
+ >> RELOC_EXT_BITS_TYPE_SH_LITTLE;
+ }
+
+ cache_ptr->howto = howto_table_ext + r_type;
+ MOVE_ADDRESS(GET_SWORD(abfd, bytes->r_addend));
+}
+
+void
+DEFUN(NAME(aout,swap_std_reloc_in), (abfd, bytes, cache_ptr, symbols),
+ bfd *abfd AND
+ struct reloc_std_external *bytes AND
+ arelent *cache_ptr AND
+ asymbol **symbols)
+{
+ int r_index;
+ int r_extern;
+ unsigned int r_length;
+ int r_pcrel;
+ int r_baserel, r_jmptable, r_relative;
+ struct aoutdata *su = &(abfd->tdata.aout_data->a);
+ int howto_idx;
+
+ cache_ptr->address = bfd_h_get_32 (abfd, bytes->r_address);
+
+ /* now the fun stuff */
+ if (abfd->xvec->header_byteorder_big_p != false) {
+ r_index = (bytes->r_index[0] << 16)
+ | (bytes->r_index[1] << 8)
+ | bytes->r_index[2];
+ r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
+ r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
+ r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_BIG));
+ r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_BIG));
+ r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_BIG));
+ r_length = (bytes->r_type[0] & RELOC_STD_BITS_LENGTH_BIG)
+ >> RELOC_STD_BITS_LENGTH_SH_BIG;
+ } else {
+ r_index = (bytes->r_index[2] << 16)
+ | (bytes->r_index[1] << 8)
+ | bytes->r_index[0];
+ r_extern = (0 != (bytes->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
+ r_pcrel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
+ r_baserel = (0 != (bytes->r_type[0] & RELOC_STD_BITS_BASEREL_LITTLE));
+ r_jmptable= (0 != (bytes->r_type[0] & RELOC_STD_BITS_JMPTABLE_LITTLE));
+ r_relative= (0 != (bytes->r_type[0] & RELOC_STD_BITS_RELATIVE_LITTLE));
+ r_length = (bytes->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE)
+ >> RELOC_STD_BITS_LENGTH_SH_LITTLE;
+ }
+
+ howto_idx = r_length + 4 * r_pcrel + 8 * r_baserel;
+ BFD_ASSERT (howto_idx < TABLE_SIZE (howto_table_std));
+ cache_ptr->howto = howto_table_std + howto_idx;
+ BFD_ASSERT (cache_ptr->howto->type != -1);
+ BFD_ASSERT (r_jmptable == 0);
+ BFD_ASSERT (r_relative == 0);
+ /* FIXME-soon: Roll jmptable, relative bits into howto setting */
+
+ MOVE_ADDRESS(0);
+}
+
+/* Reloc hackery */
+
+boolean
+DEFUN(NAME(aout,slurp_reloc_table),(abfd, asect, symbols),
+ bfd *abfd AND
+ sec_ptr asect AND
+ asymbol **symbols)
+{
+ unsigned int count;
+ bfd_size_type reloc_size;
+ PTR relocs;
+ arelent *reloc_cache;
+ size_t each_size;
+
+ if (asect->relocation) return true;
+
+ if (asect->flags & SEC_CONSTRUCTOR) return true;
+
+ if (asect == obj_datasec (abfd)) {
+ reloc_size = exec_hdr(abfd)->a_drsize;
+ goto doit;
+ }
+
+ if (asect == obj_textsec (abfd)) {
+ reloc_size = exec_hdr(abfd)->a_trsize;
+ goto doit;
+ }
+
+ bfd_error = invalid_operation;
+ return false;
+
+ doit:
+ bfd_seek (abfd, asect->rel_filepos, SEEK_SET);
+ each_size = obj_reloc_entry_size (abfd);
+
+ count = reloc_size / each_size;
+
+
+ reloc_cache = (arelent *) bfd_zalloc (abfd, (size_t)(count * sizeof
+ (arelent)));
+ if (!reloc_cache) {
+nomem:
+ bfd_error = no_memory;
+ return false;
+ }
+
+ relocs = (PTR) bfd_alloc (abfd, reloc_size);
+ if (!relocs) {
+ bfd_release (abfd, reloc_cache);
+ goto nomem;
+ }
+
+ if (bfd_read (relocs, 1, reloc_size, abfd) != reloc_size) {
+ bfd_release (abfd, relocs);
+ bfd_release (abfd, reloc_cache);
+ bfd_error = system_call_error;
+ return false;
+ }
+
+ if (each_size == RELOC_EXT_SIZE) {
+ register struct reloc_ext_external *rptr = (struct reloc_ext_external *) relocs;
+ unsigned int counter = 0;
+ arelent *cache_ptr = reloc_cache;
+
+ for (; counter < count; counter++, rptr++, cache_ptr++) {
+ NAME(aout,swap_ext_reloc_in)(abfd, rptr, cache_ptr, symbols);
+ }
+ } else {
+ register struct reloc_std_external *rptr = (struct reloc_std_external*) relocs;
+ unsigned int counter = 0;
+ arelent *cache_ptr = reloc_cache;
+
+ for (; counter < count; counter++, rptr++, cache_ptr++) {
+ NAME(aout,swap_std_reloc_in)(abfd, rptr, cache_ptr, symbols);
+ }
+
+ }
+
+ bfd_release (abfd,relocs);
+ asect->relocation = reloc_cache;
+ asect->reloc_count = count;
+ return true;
+}
+
+
+
+/* Write out a relocation section into an object file. */
+
+boolean
+DEFUN(NAME(aout,squirt_out_relocs),(abfd, section),
+ bfd *abfd AND
+ asection *section)
+{
+ arelent **generic;
+ unsigned char *native, *natptr;
+ size_t each_size;
+
+ unsigned int count = section->reloc_count;
+ size_t natsize;
+
+ if (count == 0) return true;
+
+ each_size = obj_reloc_entry_size (abfd);
+ natsize = each_size * count;
+ native = (unsigned char *) bfd_zalloc (abfd, natsize);
+ if (!native) {
+ bfd_error = no_memory;
+ return false;
+ }
+
+ generic = section->orelocation;
+
+ if (each_size == RELOC_EXT_SIZE)
+ {
+ for (natptr = native;
+ count != 0;
+ --count, natptr += each_size, ++generic)
+ NAME(aout,swap_ext_reloc_out) (abfd, *generic, (struct reloc_ext_external *)natptr);
+ }
+ else
+ {
+ for (natptr = native;
+ count != 0;
+ --count, natptr += each_size, ++generic)
+ NAME(aout,swap_std_reloc_out)(abfd, *generic, (struct reloc_std_external *)natptr);
+ }
+
+ if ( bfd_write ((PTR) native, 1, natsize, abfd) != natsize) {
+ bfd_release(abfd, native);
+ return false;
+ }
+ bfd_release (abfd, native);
+
+ return true;
+}
+
+/* This is stupid. This function should be a boolean predicate */
+unsigned int
+DEFUN(NAME(aout,canonicalize_reloc),(abfd, section, relptr, symbols),
+ bfd *abfd AND
+ sec_ptr section AND
+ arelent **relptr AND
+ asymbol **symbols)
+{
+ arelent *tblptr = section->relocation;
+ unsigned int count;
+
+ if (!(tblptr || NAME(aout,slurp_reloc_table)(abfd, section, symbols)))
+ return 0;
+
+ if (section->flags & SEC_CONSTRUCTOR) {
+ arelent_chain *chain = section->constructor_chain;
+ for (count = 0; count < section->reloc_count; count ++) {
+ *relptr ++ = &chain->relent;
+ chain = chain->next;
+ }
+ }
+ else {
+ tblptr = section->relocation;
+ if (!tblptr) return 0;
+
+ for (count = 0; count++ < section->reloc_count;)
+ {
+ *relptr++ = tblptr++;
+ }
+ }
+ *relptr = 0;
+
+ return section->reloc_count;
+}
+
+unsigned int
+DEFUN(NAME(aout,get_reloc_upper_bound),(abfd, asect),
+ bfd *abfd AND
+ sec_ptr asect)
+{
+ if (bfd_get_format (abfd) != bfd_object) {
+ bfd_error = invalid_operation;
+ return 0;
+ }
+ if (asect->flags & SEC_CONSTRUCTOR) {
+ return (sizeof (arelent *) * (asect->reloc_count+1));
+ }
+
+
+ if (asect == obj_datasec (abfd))
+ return (sizeof (arelent *) *
+ ((exec_hdr(abfd)->a_drsize / obj_reloc_entry_size (abfd))
+ +1));
+
+ if (asect == obj_textsec (abfd))
+ return (sizeof (arelent *) *
+ ((exec_hdr(abfd)->a_trsize / obj_reloc_entry_size (abfd))
+ +1));
+
+ bfd_error = invalid_operation;
+ return 0;
+}
+
+
+ unsigned int
+DEFUN(NAME(aout,get_symtab_upper_bound),(abfd),
+ bfd *abfd)
+{
+ if (!NAME(aout,slurp_symbol_table)(abfd)) return 0;
+
+ return (bfd_get_symcount (abfd)+1) * (sizeof (aout_symbol_type *));
+}
+ alent *
+DEFUN(NAME(aout,get_lineno),(ignore_abfd, ignore_symbol),
+ bfd *ignore_abfd AND
+ asymbol *ignore_symbol)
+{
+return (alent *)NULL;
+}
+
+void
+DEFUN(NAME(aout,get_symbol_info),(ignore_abfd, symbol, ret),
+ bfd *ignore_abfd AND
+ asymbol *symbol AND
+ symbol_info *ret)
+{
+ bfd_symbol_info (symbol, ret);
+
+ if (ret->type == '?')
+ {
+ int type_code = aout_symbol(symbol)->type & 0xff;
+ CONST char *stab_name = aout_stab_name(type_code);
+ static char buf[10];
+
+ if (stab_name == NULL)
+ {
+ sprintf(buf, "(%d)", type_code);
+ stab_name = buf;
+ }
+ ret->type = '-';
+ ret->stab_other = (unsigned)(aout_symbol(symbol)->other & 0xff);
+ ret->stab_desc = (unsigned)(aout_symbol(symbol)->desc & 0xffff);
+ ret->stab_name = stab_name;
+ }
+}
+
+void
+DEFUN(NAME(aout,print_symbol),(ignore_abfd, afile, symbol, how),
+ bfd *ignore_abfd AND
+ PTR afile AND
+ asymbol *symbol AND
+ bfd_print_symbol_type how)
+{
+ FILE *file = (FILE *)afile;
+
+ switch (how) {
+ case bfd_print_symbol_name:
+ if (symbol->name)
+ fprintf(file,"%s", symbol->name);
+ break;
+ case bfd_print_symbol_more:
+ fprintf(file,"%4x %2x %2x",(unsigned)(aout_symbol(symbol)->desc & 0xffff),
+ (unsigned)(aout_symbol(symbol)->other & 0xff),
+ (unsigned)(aout_symbol(symbol)->type));
+ break;
+ case bfd_print_symbol_all:
+ {
+ CONST char *section_name = symbol->section->name;
+
+
+ bfd_print_symbol_vandf((PTR)file,symbol);
+
+ fprintf(file," %-5s %04x %02x %02x",
+ section_name,
+ (unsigned)(aout_symbol(symbol)->desc & 0xffff),
+ (unsigned)(aout_symbol(symbol)->other & 0xff),
+ (unsigned)(aout_symbol(symbol)->type & 0xff));
+ if (symbol->name)
+ fprintf(file," %s", symbol->name);
+ }
+ break;
+ }
+}
+
+/*
+ provided a BFD, a section and an offset into the section, calculate
+ and return the name of the source file and the line nearest to the
+ wanted location.
+*/
+
+boolean
+DEFUN(NAME(aout,find_nearest_line),(abfd,
+ section,
+ symbols,
+ offset,
+ filename_ptr,
+ functionname_ptr,
+ line_ptr),
+ bfd *abfd AND
+ asection *section AND
+ asymbol **symbols AND
+ bfd_vma offset AND
+ CONST char **filename_ptr AND
+ CONST char **functionname_ptr AND
+ unsigned int *line_ptr)
+{
+ /* Run down the file looking for the filename, function and linenumber */
+ asymbol **p;
+ static char buffer[100];
+ static char filename_buffer[200];
+ CONST char *directory_name = NULL;
+ CONST char *main_file_name = NULL;
+ CONST char *current_file_name = NULL;
+ CONST char *line_file_name = NULL; /* Value of current_file_name at line number. */
+ bfd_vma high_line_vma = ~0;
+ bfd_vma low_func_vma = 0;
+ asymbol *func = 0;
+ *filename_ptr = abfd->filename;
+ *functionname_ptr = 0;
+ *line_ptr = 0;
+ if (symbols != (asymbol **)NULL) {
+ for (p = symbols; *p; p++) {
+ aout_symbol_type *q = (aout_symbol_type *)(*p);
+ next:
+ switch (q->type){
+ case N_SO:
+ main_file_name = current_file_name = q->symbol.name;
+ /* Look ahead to next symbol to check if that too is an N_SO. */
+ p++;
+ if (*p == NULL)
+ break;
+ q = (aout_symbol_type *)(*p);
+ if (q->type != (int)N_SO)
+ goto next;
+
+ /* Found a second N_SO First is directory; second is filename. */
+ directory_name = current_file_name;
+ main_file_name = current_file_name = q->symbol.name;
+ if (obj_textsec(abfd) != section)
+ goto done;
+ break;
+ case N_SOL:
+ current_file_name = q->symbol.name;
+ break;
+
+ case N_SLINE:
+
+ case N_DSLINE:
+ case N_BSLINE:
+ /* We'll keep this if it resolves nearer than the one we have already */
+ if (q->symbol.value >= offset &&
+ q->symbol.value < high_line_vma) {
+ *line_ptr = q->desc;
+ high_line_vma = q->symbol.value;
+ line_file_name = current_file_name;
+ }
+ break;
+ case N_FUN:
+ {
+ /* We'll keep this if it is nearer than the one we have already */
+ if (q->symbol.value >= low_func_vma &&
+ q->symbol.value <= offset) {
+ low_func_vma = q->symbol.value;
+ func = (asymbol *)q;
+ }
+ if (*line_ptr && func) {
+ CONST char *function = func->name;
+ char *p;
+ strncpy(buffer, function, sizeof(buffer)-1);
+ buffer[sizeof(buffer)-1] = 0;
+ /* Have to remove : stuff */
+ p = strchr(buffer,':');
+ if (p != NULL) { *p = '\0'; }
+ *functionname_ptr = buffer;
+ goto done;
+
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ done:
+ if (*line_ptr)
+ main_file_name = line_file_name;
+ if (main_file_name) {
+ if (main_file_name[0] == '/' || directory_name == NULL)
+ *filename_ptr = main_file_name;
+ else {
+ sprintf(filename_buffer, "%.140s%.50s",
+ directory_name, main_file_name);
+ *filename_ptr = filename_buffer;
+ }
+ }
+ return true;
+
+}
+
+int
+DEFUN(NAME(aout,sizeof_headers),(abfd, execable),
+ bfd *abfd AND
+ boolean execable)
+{
+ return adata(abfd).exec_bytes_size;
+}
diff --git a/gnu/usr.bin/gdb/bfd/archive.c b/gnu/usr.bin/gdb/bfd/archive.c
new file mode 100644
index 000000000000..5edae9d3db0a
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/archive.c
@@ -0,0 +1,1770 @@
+/* BFD back-end for archive files (libraries).
+ Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You 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. */
+
+/*
+@setfilename archive-info
+SECTION
+ Archives
+
+DESCRIPTION
+ Archives are supported in BFD in <<archive.c>>.
+
+ An archive (or library) is just another BFD. It has a symbol
+ table, although there's not much a user program will do with it.
+
+ The big difference between an archive BFD and an ordinary BFD
+ is that the archive doesn't have sections. Instead it has a
+ chain of BFDs considered its contents. These BFDs can be
+ manipulated just like any other. The BFDs contained in an
+ archive opened for reading will all be opened for reading; you
+ may put either input or output BFDs into an archive opened for
+ output; it will be handled correctly when the archive is closed.
+
+ Use <<bfd_openr_next_archived_file>> to step through all
+ the contents of an archive opened for input. It's not
+ required that you read the entire archive if you don't want
+ to! Read it until you find what you want.
+
+ Archive contents of output BFDs are chained through the
+ <<next>> pointer in a BFD. The first one is findable through
+ the <<archive_head>> slot of the archive. Set it with
+ <<set_archive_head>> (q.v.). A given BFD may be in only one
+ open output archive at a time.
+
+ As expected, the BFD archive code is more general than the
+ archive code of any given environment. BFD archives may
+ contain files of different formats (e.g., a.out and coff) and
+ even different architectures. You may even place archives
+ recursively into archives!
+
+ This can cause unexpected confusion, since some archive
+ formats are more expressive than others. For instance, Intel
+ COFF archives can preserve long filenames; Sun a.out archives
+ cannot. If you move a file from the first to the second
+ format and back again, the filename may be truncated.
+ Likewise, different a.out environments have different
+ conventions as to how they truncate filenames, whether they
+ preserve directory names in filenames, etc. When
+ interoperating with native tools, be sure your files are
+ homogeneous.
+
+ Beware: most of these formats do not react well to the
+ presence of spaces in filenames. We do the best we can, but
+ can't always handle this due to restrctions in the format of
+ archives. Many unix utilities are braindead in regards to
+ spaces and such in filenames anyway, so this shouldn't be much
+ of a restriction.
+*/
+
+/* Assumes:
+ o - all archive elements start on an even boundary, newline padded;
+ o - all arch headers are char *;
+ o - all arch headers are the same size (across architectures).
+*/
+
+/* Some formats provide a way to cram a long filename into the short
+ (16 chars) space provided by a bsd archive. The trick is: make a
+ special "file" in the front of the archive, sort of like the SYMDEF
+ entry. If the filename is too long to fit, put it in the extended
+ name table, and use its index as the filename. To prevent
+ confusion prepend the index with a space. This means you can't
+ have filenames that start with a space, but then again, many unix
+ utilities can't handle that anyway.
+
+ This scheme unfortunately requires that you stand on your head in
+ order to write an archive since you need to put a magic file at the
+ front, and need to touch every entry to do so. C'est la vie.
+
+ We support two variants of this idea:
+ The SVR4 format (extended name table is named "//"),
+ and an extended pseudo-BSD variant (extended name table is named
+ "ARFILENAMES/"). The origin of the latter format is uncertain.
+
+ BSD 4.4 uses a third scheme: It writes a long filename
+ directly after the header. This allows 'ar q' to work.
+ We current can read BSD 4.4 archives, but not write them.
+*/
+
+/* Summary of archive member names:
+
+ Symbol table (must be first):
+ "__.SYMDEF " - Symbol table, Berkeley style, produced by ranlib.
+ "/ " - Symbol table, system 5 style.
+
+ Long name table (must be before regular file members):
+ "// " - Long name table, System 5 R4 style.
+ "ARFILENAMES/ " - Long name table, non-standard extended BSD (not BSD 4.4).
+
+ Regular file members with short names:
+ "filename.o/ " - Regular file, System 5 style (embedded spaces ok).
+ "filename.o " - Regular file, Berkeley style (no embedded spaces).
+
+ Regular files with long names (or embedded spaces, for BSD variants):
+ "/18 " - SVR4 style, name at offset 18 in name table.
+ "#1/23 " - Long name (or embedded paces) 23 characters long,
+ BSD 4.4 style, full name follows header.
+ Implemented for reading, not writing.
+ " 18 " - Long name 18 characters long, extended pseudo-BSD.
+ */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "aout/ar.h"
+#include "aout/ranlib.h"
+#include <errno.h>
+#include <string.h> /* For memchr, strrchr and friends */
+#include <ctype.h>
+
+#ifndef errno
+extern int errno;
+#endif
+
+#ifdef GNU960
+#define BFD_GNU960_ARMAG(abfd) (BFD_COFF_FILE_P((abfd)) ? ARMAG : ARMAGB)
+#endif
+
+/* Can't define this in hosts/*.h, because (e.g. in gprof) the hosts file
+ is included, then obstack.h, which thinks if offsetof is defined, it
+ doesn't need to include stddef.h. */
+/* Define offsetof for those systems which lack it */
+
+#if !defined (offsetof)
+#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
+#endif
+
+/* We keep a cache of archive filepointers to archive elements to
+ speed up searching the archive by filepos. We only add an entry to
+ the cache when we actually read one. We also don't sort the cache;
+ it's generally short enough to search linearly.
+ Note that the pointers here point to the front of the ar_hdr, not
+ to the front of the contents!
+*/
+struct ar_cache {
+ file_ptr ptr;
+ bfd* arelt;
+ struct ar_cache *next;
+};
+
+#define ar_padchar(abfd) ((abfd)->xvec->ar_pad_char)
+#define ar_maxnamelen(abfd) ((abfd)->xvec->ar_max_namelen)
+
+#define arch_eltdata(bfd) ((struct areltdata *)((bfd)->arelt_data))
+#define arch_hdr(bfd) ((struct ar_hdr *)arch_eltdata(bfd)->arch_header)
+
+/* Forward declarations of functions */
+
+boolean
+compute_and_write_armap PARAMS ((bfd *arch, unsigned int elength));
+
+static boolean
+bsd_update_armap_timestamp PARAMS ((bfd *arch));
+
+
+
+boolean
+_bfd_generic_mkarchive (abfd)
+ bfd *abfd;
+{
+ abfd->tdata.aout_ar_data = (struct artdata *)bfd_zalloc(abfd,
+ sizeof (struct artdata));
+
+ if (bfd_ardata (abfd) == NULL) {
+ bfd_error = no_memory;
+ return false;
+ }
+ bfd_ardata(abfd)->cache = 0;
+ return true;
+}
+
+/*
+FUNCTION
+ bfd_get_next_mapent
+
+SYNOPSIS
+ symindex bfd_get_next_mapent(bfd *, symindex previous, carsym ** sym);
+
+DESCRIPTION
+ This function steps through an archive's symbol table (if it
+ has one). Successively updates <<sym>> with the next symbol's
+ information, returning that symbol's (internal) index into the
+ symbol table.
+
+ Supply BFD_NO_MORE_SYMBOLS as the <<previous>> entry to get
+ the first one; returns BFD_NO_MORE_SYMBOLS when you're already
+ got the last one.
+
+ A <<carsym>> is a canonical archive symbol. The only
+ user-visible element is its name, a null-terminated string.
+*/
+
+symindex
+DEFUN(bfd_get_next_mapent,(abfd, prev, entry),
+ bfd *abfd AND
+ symindex prev AND
+ carsym **entry)
+{
+ if (!bfd_has_map (abfd)) {
+ bfd_error = invalid_operation;
+ return BFD_NO_MORE_SYMBOLS;
+ }
+
+ if (prev == BFD_NO_MORE_SYMBOLS) prev = 0;
+ else if (++prev >= bfd_ardata (abfd)->symdef_count)
+ return BFD_NO_MORE_SYMBOLS;
+
+ *entry = (bfd_ardata (abfd)->symdefs + prev);
+ return prev;
+}
+
+/* To be called by backends only */
+
+bfd *
+_bfd_create_empty_archive_element_shell (obfd)
+ bfd *obfd;
+{
+ bfd *nbfd;
+
+ nbfd = new_bfd_contained_in(obfd);
+ if (nbfd == NULL)
+ {
+ bfd_error = no_memory;
+ return NULL;
+ }
+ return nbfd;
+}
+
+/*
+FUNCTION
+ bfd_set_archive_head
+
+SYNOPSIS
+ boolean bfd_set_archive_head(bfd *output, bfd *new_head);
+
+DESCRIPTION
+ Used whilst processing archives. Sets the head of the chain of
+ BFDs contained in an archive to @var{new_head}.
+*/
+
+boolean
+DEFUN(bfd_set_archive_head,(output_archive, new_head),
+ bfd *output_archive AND
+ bfd *new_head)
+{
+
+ output_archive->archive_head = new_head;
+ return true;
+}
+
+bfd *
+look_for_bfd_in_cache (arch_bfd, filepos)
+ bfd *arch_bfd;
+ file_ptr filepos;
+{
+ struct ar_cache *current;
+
+ for (current = bfd_ardata (arch_bfd)->cache; current != NULL;
+ current = current->next)
+ if (current->ptr == filepos) return current->arelt;
+
+ return NULL;
+}
+
+/* Kind of stupid to call cons for each one, but we don't do too many */
+boolean
+add_bfd_to_cache (arch_bfd, filepos, new_elt)
+ bfd *arch_bfd, *new_elt;
+ file_ptr filepos;
+{
+ struct ar_cache *new_cache = (struct ar_cache *)
+ bfd_zalloc(arch_bfd, sizeof (struct ar_cache));
+
+ if (new_cache == NULL) {
+ bfd_error = no_memory;
+ return false;
+ }
+
+ new_cache->ptr = filepos;
+ new_cache->arelt = new_elt;
+ new_cache->next = (struct ar_cache *)NULL;
+ if (bfd_ardata (arch_bfd)->cache == NULL)
+ bfd_ardata (arch_bfd)->cache = new_cache;
+ else {
+ struct ar_cache *current = bfd_ardata (arch_bfd)->cache;
+
+ for (; current->next != NULL; current = current->next);
+ current->next = new_cache;
+ }
+
+ return true;
+}
+
+
+
+/* The name begins with space. Hence the rest of the name is an index into
+ the string table. */
+char *
+get_extended_arelt_filename (arch, name)
+ bfd *arch;
+ char *name;
+{
+ unsigned long index = 0;
+
+ /* Should extract string so that I can guarantee not to overflow into
+ the next region, but I'm too lazy. */
+ errno = 0;
+ /* Skip first char, which is '/' in SVR4 or ' ' in some other variants. */
+ index = strtol (name+1, NULL, 10);
+ if (errno != 0) {
+ bfd_error = malformed_archive;
+ return NULL;
+ }
+
+ return bfd_ardata (arch)->extended_names + index;
+}
+
+/* This functions reads an arch header and returns an areltdata pointer, or
+ NULL on error.
+
+ Presumes the file pointer is already in the right place (ie pointing
+ to the ar_hdr in the file). Moves the file pointer; on success it
+ should be pointing to the front of the file contents; on failure it
+ could have been moved arbitrarily.
+*/
+
+struct areltdata *
+snarf_ar_hdr (abfd)
+ bfd *abfd;
+{
+#ifndef errno
+ extern int errno;
+#endif
+
+ struct ar_hdr hdr;
+ char *hdrp = (char *) &hdr;
+ unsigned int parsed_size;
+ struct areltdata *ared;
+ char *filename = NULL;
+ unsigned int namelen = 0;
+ unsigned int allocsize = sizeof (struct areltdata) + sizeof (struct ar_hdr);
+ char *allocptr = 0;
+
+ if (bfd_read ((PTR)hdrp, 1, sizeof (struct ar_hdr), abfd)
+ != sizeof (struct ar_hdr)) {
+ bfd_error = no_more_archived_files;
+ return NULL;
+ }
+ if (strncmp ((hdr.ar_fmag), ARFMAG, 2)) {
+ bfd_error = malformed_archive;
+ return NULL;
+ }
+
+ errno = 0;
+ parsed_size = strtol (hdr.ar_size, NULL, 10);
+ if (errno != 0) {
+ bfd_error = malformed_archive;
+ return NULL;
+ }
+
+ /* extract the filename from the archive - there are two ways to
+ specify an extendend name table, either the first char of the
+ name is a space, or it's a slash. */
+ if ((hdr.ar_name[0] == '/'
+ || (hdr.ar_name[0] == ' '
+ && memchr (hdr.ar_name, '/', ar_maxnamelen(abfd)) == NULL))
+ && bfd_ardata (abfd)->extended_names != NULL) {
+ filename = get_extended_arelt_filename (abfd, hdr.ar_name);
+ if (filename == NULL) {
+ bfd_error = malformed_archive;
+ return NULL;
+ }
+ }
+ /* BSD4.4-style long filename.
+ Only implemented for reading, so far! */
+ else if (hdr.ar_name[0] == '#' && hdr.ar_name[1] == '1'
+ && hdr.ar_name[2] == '/' && isdigit(hdr.ar_name[3]))
+ {
+ /* BSD-4.4 extended name */
+ namelen = atoi (&hdr.ar_name[3]);
+ allocsize += namelen + 1;
+ parsed_size -= namelen;
+
+ allocptr = bfd_zalloc(abfd, allocsize);
+ if (allocptr == NULL) {
+ bfd_error = no_memory;
+ return NULL;
+ }
+ filename = allocptr
+ + (sizeof (struct areltdata) + sizeof (struct ar_hdr));
+ if (bfd_read (filename, 1, namelen, abfd) != namelen) {
+ bfd_error = no_more_archived_files;
+ return NULL;
+ }
+ filename[namelen] = '\0';
+ }
+ else
+ {
+ /* We judge the end of the name by looking for '/' or ' '.
+ Note: The SYSV format (terminated by '/') allows embedded
+ spaces, so only look for ' ' if we don't find '/'. */
+
+ namelen = 0;
+ while (hdr.ar_name[namelen] != '\0' &&
+ hdr.ar_name[namelen] != '/') {
+ namelen++;
+ if (namelen == (unsigned)ar_maxnamelen(abfd)) {
+ namelen = 0;
+ while (hdr.ar_name[namelen] != ' '
+ && namelen < (unsigned)ar_maxnamelen(abfd)) {
+ namelen++;
+ }
+ break;
+ }
+ }
+
+ allocsize += namelen + 1;
+ }
+
+ if (!allocptr) {
+ allocptr = bfd_zalloc(abfd, allocsize);
+ if (allocptr == NULL) {
+ bfd_error = no_memory;
+ return NULL;
+ }
+ }
+
+ ared = (struct areltdata *) allocptr;
+
+ ared->arch_header = allocptr + sizeof (struct areltdata);
+ memcpy ((char *) ared->arch_header, (char *) &hdr, sizeof (struct ar_hdr));
+ ared->parsed_size = parsed_size;
+
+ if (filename != NULL) ared->filename = filename;
+ else {
+ ared->filename = allocptr + (sizeof (struct areltdata) +
+ sizeof (struct ar_hdr));
+ if (namelen)
+ memcpy (ared->filename, hdr.ar_name, namelen);
+ ared->filename[namelen] = '\0';
+ }
+
+ return ared;
+}
+
+/* This is an internal function; it's mainly used when indexing
+ through the archive symbol table, but also used to get the next
+ element, since it handles the bookkeeping so nicely for us.
+*/
+
+bfd *
+get_elt_at_filepos (archive, filepos)
+ bfd *archive;
+ file_ptr filepos;
+{
+ struct areltdata *new_areldata;
+ bfd *n_nfd;
+
+ n_nfd = look_for_bfd_in_cache (archive, filepos);
+ if (n_nfd)
+ return n_nfd;
+
+ if (0 > bfd_seek (archive, filepos, SEEK_SET))
+ {
+ bfd_error = system_call_error;
+ return NULL;
+ }
+
+ if ((new_areldata = snarf_ar_hdr (archive)) == NULL)
+ return NULL;
+
+ n_nfd = _bfd_create_empty_archive_element_shell (archive);
+ if (n_nfd == NULL)
+ {
+ bfd_release (archive, (PTR)new_areldata);
+ return NULL;
+ }
+
+ n_nfd->origin = bfd_tell (archive);
+ n_nfd->arelt_data = (PTR) new_areldata;
+ n_nfd->filename = new_areldata->filename;
+
+ if (add_bfd_to_cache (archive, filepos, n_nfd))
+ return n_nfd;
+
+ /* huh? */
+ bfd_release (archive, (PTR)n_nfd);
+ bfd_release (archive, (PTR)new_areldata);
+ return NULL;
+}
+
+/*
+FUNCTION
+ bfd_get_elt_at_index
+
+SYNOPSIS
+ bfd *bfd_get_elt_at_index(bfd * archive, int index);
+
+DESCRIPTION
+ Return the bfd which is referenced by the symbol indexed by <<index>>.
+ <<index>> should have been returned by <<bfd_get_next_mapent>> (q.v.).
+
+*/
+bfd *
+DEFUN(bfd_get_elt_at_index,(abfd, index),
+ bfd *abfd AND
+ int index)
+{
+ bfd *result =
+ get_elt_at_filepos
+ (abfd, (bfd_ardata (abfd)->symdefs + index)->file_offset);
+ return result;
+}
+
+/*
+FUNCTION
+ bfd_openr_next_archived_file
+
+SYNOPSIS
+ bfd* bfd_openr_next_archived_file(bfd *archive, bfd *previous);
+
+DESCRIPTION
+ Initially provided a BFD containing an archive and NULL, opens
+ an inpout BFD on the first contained element and returns that.
+ Subsequent calls to bfd_openr_next_archived_file should pass
+ the archive and the previous return value to return a created
+ BFD to the next contained element. NULL is returned when there
+ are no more.
+
+*/
+
+bfd *
+bfd_openr_next_archived_file (archive, last_file)
+ bfd *archive;
+ bfd *last_file;
+{
+ if ((bfd_get_format (archive) != bfd_archive) ||
+ (archive->direction == write_direction))
+ {
+ bfd_error = invalid_operation;
+ return NULL;
+ }
+
+ return BFD_SEND (archive,
+ openr_next_archived_file,
+ (archive,
+ last_file));
+}
+
+bfd *
+bfd_generic_openr_next_archived_file (archive, last_file)
+ bfd *archive;
+ bfd *last_file;
+{
+ file_ptr filestart;
+
+ if (!last_file)
+ filestart = bfd_ardata (archive)->first_file_filepos;
+ else {
+ unsigned int size = arelt_size(last_file);
+ /* Pad to an even boundary...
+ Note that last_file->origin can be odd in the case of
+ BSD-4.4-style element with a long odd size. */
+ filestart = last_file->origin + size;
+ filestart += filestart % 2;
+ }
+
+ return get_elt_at_filepos (archive, filestart);
+}
+
+
+bfd_target *
+bfd_generic_archive_p (abfd)
+ bfd *abfd;
+{
+ char armag[SARMAG+1];
+
+ if (bfd_read ((PTR)armag, 1, SARMAG, abfd) != SARMAG) {
+ bfd_error = wrong_format;
+ return 0;
+ }
+
+#ifdef GNU960
+ if (strncmp (armag, BFD_GNU960_ARMAG(abfd), SARMAG)) return 0;
+#else
+ if (strncmp (armag, ARMAG, SARMAG) &&
+ strncmp (armag, ARMAGB, SARMAG)) return 0;
+#endif
+
+
+
+ /* We are setting bfd_ardata(abfd) here, but since bfd_ardata
+ involves a cast, we can't do it as the left operand of assignment. */
+ abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc(abfd,sizeof (struct artdata));
+
+ if (bfd_ardata (abfd) == NULL) {
+ bfd_error = no_memory;
+ return 0;
+ }
+
+ bfd_ardata (abfd)->first_file_filepos = SARMAG;
+
+ if (!BFD_SEND (abfd, _bfd_slurp_armap, (abfd))) {
+ bfd_release(abfd, bfd_ardata (abfd));
+ abfd->tdata.aout_ar_data = NULL;
+ return 0;
+ }
+
+ if (!BFD_SEND (abfd, _bfd_slurp_extended_name_table, (abfd))) {
+ bfd_release(abfd, bfd_ardata (abfd));
+ abfd->tdata.aout_ar_data = NULL;
+ return 0;
+ }
+
+ return abfd->xvec;
+}
+
+/* Returns false on error, true otherwise */
+static boolean
+DEFUN (do_slurp_bsd_armap, (abfd),
+ bfd *abfd)
+{
+ struct areltdata *mapdata;
+ unsigned int counter = 0;
+ int *raw_armap, *rbase;
+ struct artdata *ardata = bfd_ardata (abfd);
+ char *stringbase;
+ unsigned int parsed_size;
+
+ mapdata = snarf_ar_hdr (abfd);
+ if (mapdata == NULL) return false;
+ parsed_size = mapdata->parsed_size;
+ bfd_release (abfd, (PTR)mapdata); /* Don't need it any more. */
+
+ raw_armap = (int *) bfd_zalloc(abfd, parsed_size);
+ if (raw_armap == NULL) {
+ bfd_error = no_memory;
+ return false;
+ }
+
+ if (bfd_read ((PTR)raw_armap, 1, parsed_size, abfd) != parsed_size) {
+ bfd_error = malformed_archive;
+ byebye:
+ bfd_release (abfd, (PTR)raw_armap);
+ return false;
+ }
+
+ ardata->symdef_count =
+ bfd_h_get_32(abfd, (PTR)raw_armap) / sizeof (struct symdef);
+
+ if (ardata->symdef_count * sizeof (struct symdef)
+ > parsed_size - sizeof (*raw_armap)) {
+ /* Probably we're using the wrong byte ordering. */
+ bfd_error = wrong_format;
+ goto byebye;
+ }
+
+ ardata->cache = 0;
+ rbase = raw_armap+1;
+ ardata->symdefs = (carsym *) rbase;
+ stringbase = ((char *) (ardata->symdefs + ardata->symdef_count)) + 4;
+
+ for (;counter < ardata->symdef_count; counter++) {
+ struct symdef *sym = ((struct symdef *) rbase) + counter;
+ sym->s.name = bfd_h_get_32(abfd, (PTR)(&(sym->s.string_offset))) + stringbase;
+ sym->file_offset = bfd_h_get_32(abfd, (PTR)( &(sym->file_offset)));
+ }
+
+ ardata->first_file_filepos = bfd_tell (abfd);
+ /* Pad to an even boundary if you have to */
+ ardata->first_file_filepos += (ardata-> first_file_filepos) %2;
+ /* FIXME, we should provide some way to free raw_ardata when
+ we are done using the strings from it. For now, it seems
+ to be allocated on an obstack anyway... */
+ bfd_has_map (abfd) = true;
+ return true;
+}
+
+/* Returns false on error, true otherwise */
+static boolean
+DEFUN (do_slurp_coff_armap, (abfd),
+ bfd *abfd)
+{
+ struct areltdata *mapdata;
+ int *raw_armap, *rawptr;
+ struct artdata *ardata = bfd_ardata (abfd);
+ char *stringbase;
+ unsigned int stringsize;
+ unsigned int parsed_size;
+ carsym *carsyms;
+ unsigned int nsymz; /* Number of symbols in armap. */
+
+ bfd_vma (*swap) PARAMS ((bfd_byte*));
+ char int_buf[sizeof(long)];
+ unsigned int carsym_size, ptrsize, i;
+
+ mapdata = snarf_ar_hdr (abfd);
+ if (mapdata == NULL) return false;
+ parsed_size = mapdata->parsed_size;
+ bfd_release (abfd, (PTR)mapdata); /* Don't need it any more. */
+
+ if (bfd_read ((PTR)int_buf, 1, 4, abfd) != 4) {
+ bfd_error = malformed_archive;
+ return false;
+ }
+ /* It seems that all numeric information in a coff archive is always
+ in big endian format, nomatter the host or target. */
+ swap = bfd_getb32;
+ nsymz = bfd_getb32((PTR)int_buf);
+ stringsize = parsed_size - (4 * nsymz) - 4;
+
+#if 1
+ /* ... except that some archive formats are broken, and it may be our
+ fault - the i960 little endian coff sometimes has big and sometimes
+ little, because our tools changed. Here's a horrible hack to clean
+ up the crap. */
+
+ if (stringsize > 0xfffff) {
+ /* This looks dangerous, let's do it the other way around */
+ nsymz = bfd_getl32((PTR)int_buf);
+ stringsize = parsed_size - (4 * nsymz) - 4;
+ swap = bfd_getl32;
+ }
+#endif
+
+ /* The coff armap must be read sequentially. So we construct a bsd-style
+ one in core all at once, for simplicity. */
+
+ carsym_size = (nsymz * sizeof (carsym));
+ ptrsize = (4 * nsymz);
+
+ ardata->symdefs = (carsym *) bfd_zalloc(abfd, carsym_size + stringsize + 1);
+ if (ardata->symdefs == NULL) {
+ bfd_error = no_memory;
+ return false;
+ }
+ carsyms = ardata->symdefs;
+ stringbase = ((char *) ardata->symdefs) + carsym_size;
+
+ /* Allocate and read in the raw offsets. */
+ raw_armap = (int *) bfd_alloc(abfd, ptrsize);
+ if (raw_armap == NULL) {
+ bfd_error = no_memory;
+ goto release_symdefs;
+ }
+ if (bfd_read ((PTR)raw_armap, 1, ptrsize, abfd) != ptrsize
+ || bfd_read ((PTR)stringbase, 1, stringsize, abfd) != stringsize) {
+ bfd_error = malformed_archive;
+ goto release_raw_armap;
+ }
+
+ /* OK, build the carsyms */
+ for (i = 0; i < nsymz; i++) {
+ rawptr = raw_armap + i;
+ carsyms->file_offset = swap((PTR)rawptr);
+ carsyms->name = stringbase;
+ while (*stringbase++) ;
+ carsyms++;
+ }
+ *stringbase = 0;
+
+ ardata->symdef_count = nsymz;
+ ardata->first_file_filepos = bfd_tell (abfd);
+ /* Pad to an even boundary if you have to */
+ ardata->first_file_filepos += (ardata->first_file_filepos) %2;
+
+ bfd_has_map (abfd) = true;
+ bfd_release (abfd, (PTR)raw_armap);
+ return true;
+
+ release_raw_armap:
+ bfd_release (abfd, (PTR)raw_armap);
+ release_symdefs:
+ bfd_release (abfd, (PTR)(ardata)->symdefs);
+ return false;
+}
+
+/* This routine can handle either coff-style or bsd-style armaps.
+ Returns false on error, true otherwise */
+
+boolean
+bfd_slurp_armap (abfd)
+ bfd *abfd;
+{
+ char nextname[17];
+ int i = bfd_read ((PTR)nextname, 1, 16, abfd);
+
+ if (i == 0)
+ return true;
+ if (i != 16)
+ return false;
+
+ bfd_seek (abfd, (file_ptr) -16, SEEK_CUR);
+
+ if (!strncmp (nextname, "__.SYMDEF ", 16))
+ return do_slurp_bsd_armap (abfd);
+ else if (!strncmp (nextname, "/ ", 16))
+ return do_slurp_coff_armap (abfd);
+
+ bfd_has_map (abfd) = false;
+ return true;
+}
+
+/* Returns false on error, true otherwise */
+/* flavor 2 of a bsd armap, similar to bfd_slurp_bsd_armap except the
+ header is in a slightly different order and the map name is '/'.
+ This flavour is used by hp300hpux. */
+boolean
+bfd_slurp_bsd_armap_f2 (abfd)
+ bfd *abfd;
+{
+ struct areltdata *mapdata;
+ char nextname[17];
+ unsigned int counter = 0;
+ int *raw_armap, *rbase;
+ struct artdata *ardata = bfd_ardata (abfd);
+ char *stringbase;
+ unsigned int stringsize;
+ int i = bfd_read ((PTR)nextname, 1, 16, abfd);
+
+ if (i == 0)
+ return true;
+ if (i != 16)
+ return false;
+
+ /* The archive has at least 16 bytes in it */
+ bfd_seek (abfd, -16L, SEEK_CUR);
+
+ if (!strncmp (nextname, "__.SYMDEF ", 16))
+ return do_slurp_bsd_armap (abfd);
+
+ if (strncmp (nextname, "/ ", 16))
+ {
+ bfd_has_map (abfd) = false;
+ return true;
+ }
+
+ mapdata = snarf_ar_hdr (abfd);
+ if (mapdata == NULL) return false;
+
+ raw_armap = (int *) bfd_zalloc(abfd,mapdata->parsed_size);
+ if (raw_armap == NULL)
+ {
+ bfd_error = no_memory;
+ byebye:
+ bfd_release (abfd, (PTR)mapdata);
+ return false;
+ }
+
+ if (bfd_read ((PTR)raw_armap, 1, mapdata->parsed_size, abfd) !=
+ mapdata->parsed_size)
+ {
+ bfd_error = malformed_archive;
+ byebyebye:
+ bfd_release (abfd, (PTR)raw_armap);
+ goto byebye;
+ }
+
+ ardata->symdef_count = bfd_h_get_16(abfd, (PTR)raw_armap);
+
+ if (ardata->symdef_count * sizeof (struct symdef)
+ > mapdata->parsed_size - sizeof (*raw_armap))
+ {
+ /* Probably we're using the wrong byte ordering. */
+ bfd_error = wrong_format;
+ goto byebyebye;
+ }
+
+ ardata->cache = 0;
+
+ stringsize = bfd_h_get_32(abfd, (PTR)(((char*)raw_armap)+2));
+ /* skip sym count and string sz */
+ rbase = (int*)(((char*)raw_armap) + 6);
+ stringbase = (char *) rbase;
+ ardata->symdefs = (carsym *)(((char*) rbase) + stringsize);
+
+ for (;counter < ardata->symdef_count; counter++)
+ {
+ struct symdef *sym = ((struct symdef *) ardata->symdefs) + counter;
+ sym->s.name = bfd_h_get_32(abfd, (PTR)(&(sym->s.string_offset))) + stringbase;
+ sym->file_offset = bfd_h_get_32(abfd, (PTR)( &(sym->file_offset)));
+ }
+
+ ardata->first_file_filepos = bfd_tell (abfd);
+ /* Pad to an even boundary if you have to */
+ ardata->first_file_filepos += (ardata-> first_file_filepos) %2;
+ /* FIXME, we should provide some way to free raw_ardata when
+ we are done using the strings from it. For now, it seems
+ to be allocated on an obstack anyway... */
+ bfd_has_map (abfd) = true;
+ return true;
+}
+
+/** Extended name table.
+
+ Normally archives support only 14-character filenames.
+
+ Intel has extended the format: longer names are stored in a special
+ element (the first in the archive, or second if there is an armap);
+ the name in the ar_hdr is replaced by <space><index into filename
+ element>. Index is the P.R. of an int (decimal). Data General have
+ extended the format by using the prefix // for the special element */
+
+/* Returns false on error, true otherwise */
+boolean
+_bfd_slurp_extended_name_table (abfd)
+ bfd *abfd;
+{
+ char nextname[17];
+ struct areltdata *namedata;
+
+ /* FIXME: Formatting sucks here, and in case of failure of BFD_READ,
+ we probably don't want to return true. */
+ if (bfd_read ((PTR)nextname, 1, 16, abfd) == 16) {
+
+ bfd_seek (abfd, (file_ptr) -16, SEEK_CUR);
+
+ if (strncmp (nextname, "ARFILENAMES/ ", 16) != 0 &&
+ strncmp (nextname, "// ", 16) != 0)
+ {
+ bfd_ardata (abfd)->extended_names = NULL;
+ return true;
+ }
+
+ namedata = snarf_ar_hdr (abfd);
+ if (namedata == NULL) return false;
+
+ bfd_ardata (abfd)->extended_names = bfd_zalloc(abfd,namedata->parsed_size);
+ if (bfd_ardata (abfd)->extended_names == NULL) {
+ bfd_error = no_memory;
+ byebye:
+ bfd_release (abfd, (PTR)namedata);
+ return false;
+ }
+
+ if (bfd_read ((PTR)bfd_ardata (abfd)->extended_names, 1,
+ namedata->parsed_size, abfd) != namedata->parsed_size) {
+ bfd_error = malformed_archive;
+ bfd_release (abfd, (PTR)(bfd_ardata (abfd)->extended_names));
+ bfd_ardata (abfd)->extended_names = NULL;
+ goto byebye;
+ }
+
+ /* Since the archive is supposed to be printable if it contains
+ text, the entries in the list are newline-padded, not null
+ padded. In SVR4-style archives, the names also have a
+ trailing '/'. We'll fix both problems here.. */
+ {
+ char *temp = bfd_ardata (abfd)->extended_names;
+ char *limit = temp + namedata->parsed_size;
+ for (; temp < limit; ++temp)
+ if (*temp == '\n')
+ temp[temp[-1] == '/' ? -1 : 0] = '\0';
+ }
+
+ /* Pad to an even boundary if you have to */
+ bfd_ardata (abfd)->first_file_filepos = bfd_tell (abfd);
+ bfd_ardata (abfd)->first_file_filepos +=
+ (bfd_ardata (abfd)->first_file_filepos) %2;
+
+ /* FIXME, we can't release namedata here because it was allocated
+ below extended_names on the obstack... */
+ /* bfd_release (abfd, namedata); */
+ }
+ return true;
+}
+
+#ifdef VMS
+
+/* Return a copy of the stuff in the filename between any :]> and a
+ semicolon */
+static CONST char *
+DEFUN(normalize,(file),
+ CONST char *file)
+{
+ CONST char *first;
+ CONST char *last;
+ char *copy;
+
+ first = file + strlen(file)-1;
+ last = first+1;
+
+ while (first != file)
+ {
+ if (*first == ';')
+ last = first;
+ if (*first == ':' || *first == ']' ||*first == '>')
+ {
+ first++;
+ break;
+ }
+ first --;
+ }
+
+
+ copy = bfd_xmalloc(last - first + 1);
+ memcpy(copy, first, last-first);
+ copy[last-first] = 0;
+
+ return copy;
+}
+
+#else
+static CONST char *
+DEFUN (normalize, (file),
+ CONST char *file)
+{
+ CONST char * filename = strrchr(file, '/');
+
+ if (filename != (char *)NULL) {
+ filename ++;
+ }
+ else {
+ filename = file;
+ }
+ return filename;
+}
+#endif
+/* Follows archive_head and produces an extended name table if necessary.
+ Returns (in tabloc) a pointer to an extended name table, and in tablen
+ the length of the table. If it makes an entry it clobbers the filename
+ so that the element may be written without further massage.
+ Returns true if it ran successfully, false if something went wrong.
+ A successful return may still involve a zero-length tablen!
+ */
+boolean
+DEFUN (bfd_construct_extended_name_table, (abfd, tabloc, tablen),
+ bfd *abfd AND
+ char **tabloc AND
+ unsigned int *tablen)
+{
+ unsigned int maxname = abfd->xvec->ar_max_namelen;
+ unsigned int total_namelen = 0;
+ bfd *current;
+ char *strptr;
+
+ *tablen = 0;
+
+ /* Figure out how long the table should be */
+ for (current = abfd->archive_head; current != NULL; current = current->next){
+ unsigned int thislen = strlen (normalize(current->filename));
+ if (thislen > maxname) total_namelen += thislen + 1; /* leave room for \n */
+ }
+
+ if (total_namelen == 0) return true;
+
+ *tabloc = bfd_zalloc (abfd,total_namelen);
+ if (*tabloc == NULL) {
+ bfd_error = no_memory;
+ return false;
+ }
+
+ *tablen = total_namelen;
+ strptr = *tabloc;
+
+ for (current = abfd->archive_head; current != NULL; current =
+ current->next) {
+ CONST char *normal =normalize( current->filename);
+ unsigned int thislen = strlen (normal);
+ if (thislen > maxname) {
+ /* Works for now; may need to be re-engineered if we encounter an oddball
+ archive format and want to generalise this hack. */
+ struct ar_hdr *hdr = arch_hdr(current);
+ strcpy (strptr, normal);
+ strptr[thislen] = '\n';
+ hdr->ar_name[0] = ' ';
+ /* We know there will always be enough room (one of the few cases
+ where you may safely use sprintf). */
+ sprintf ((hdr->ar_name) + 1, "%-d", (unsigned) (strptr - *tabloc));
+ /* Kinda Kludgy. We should just use the returned value of sprintf
+ but not all implementations get this right */
+ {
+ char *temp = hdr->ar_name +2;
+ for (; temp < hdr->ar_name + maxname; temp++)
+ if (*temp == '\0') *temp = ' ';
+ }
+ strptr += thislen + 1;
+ }
+ }
+
+ return true;
+}
+
+/** A couple of functions for creating ar_hdrs */
+
+/* Takes a filename, returns an arelt_data for it, or NULL if it can't make one.
+ The filename must refer to a filename in the filesystem.
+ The filename field of the ar_hdr will NOT be initialized
+*/
+
+struct areltdata *
+DEFUN(bfd_ar_hdr_from_filesystem, (abfd,filename),
+ bfd* abfd AND
+ CONST char *filename)
+{
+ struct stat status;
+ struct areltdata *ared;
+ struct ar_hdr *hdr;
+ char *temp, *temp1;
+
+
+ if (stat (filename, &status) != 0) {
+ bfd_error = system_call_error;
+ return NULL;
+ }
+
+ ared = (struct areltdata *) bfd_zalloc(abfd, sizeof (struct ar_hdr) +
+ sizeof (struct areltdata));
+ if (ared == NULL) {
+ bfd_error = no_memory;
+ return NULL;
+ }
+ hdr = (struct ar_hdr *) (((char *) ared) + sizeof (struct areltdata));
+
+ /* ar headers are space padded, not null padded! */
+ temp = (char *) hdr;
+ temp1 = temp + sizeof (struct ar_hdr) - 2;
+ for (; temp < temp1; *(temp++) = ' ');
+ strncpy (hdr->ar_fmag, ARFMAG, 2);
+
+ /* Goddamned sprintf doesn't permit MAXIMUM field lengths */
+ sprintf ((hdr->ar_date), "%-12ld", status.st_mtime);
+ sprintf ((hdr->ar_uid), "%d", status.st_uid);
+ sprintf ((hdr->ar_gid), "%d", status.st_gid);
+ sprintf ((hdr->ar_mode), "%-8o", (unsigned) status.st_mode);
+ sprintf ((hdr->ar_size), "%-10ld", status.st_size);
+ /* Correct for a lossage in sprintf whereby it null-terminates. I cannot
+ understand how these C losers could design such a ramshackle bunch of
+ IO operations */
+ temp = (char *) hdr;
+ temp1 = temp + sizeof (struct ar_hdr) - 2;
+ for (; temp < temp1; temp++) {
+ if (*temp == '\0') *temp = ' ';
+ }
+ strncpy (hdr->ar_fmag, ARFMAG, 2);
+ ared->parsed_size = status.st_size;
+ ared->arch_header = (char *) hdr;
+
+ return ared;
+}
+
+/* This is magic required by the "ar" program. Since it's
+ undocumented, it's undocumented. You may think that it would
+ take a strong stomach to write this, and it does, but it takes
+ even a stronger stomach to try to code around such a thing!
+*/
+
+struct ar_hdr *
+DEFUN(bfd_special_undocumented_glue, (abfd, filename),
+ bfd *abfd AND
+ char *filename)
+{
+ struct areltdata *ar_elt = bfd_ar_hdr_from_filesystem (abfd, filename);
+ if (ar_elt == NULL)
+ return NULL;
+ return (struct ar_hdr *) ar_elt->arch_header;
+}
+
+
+/* Analogous to stat call */
+int
+bfd_generic_stat_arch_elt (abfd, buf)
+ bfd *abfd;
+ struct stat *buf;
+{
+ struct ar_hdr *hdr;
+ char *aloser;
+
+ if (abfd->arelt_data == NULL) {
+ bfd_error = invalid_operation;
+ return -1;
+ }
+
+ hdr = arch_hdr (abfd);
+
+#define foo(arelt, stelt, size) \
+ buf->stelt = strtol (hdr->arelt, &aloser, size); \
+ if (aloser == hdr->arelt) return -1;
+
+ foo (ar_date, st_mtime, 10);
+ foo (ar_uid, st_uid, 10);
+ foo (ar_gid, st_gid, 10);
+ foo (ar_mode, st_mode, 8);
+
+ buf->st_size = arch_eltdata (abfd)->parsed_size;
+
+ return 0;
+}
+
+void
+bfd_dont_truncate_arname (abfd, pathname, arhdr)
+ bfd *abfd;
+ CONST char *pathname;
+ char *arhdr;
+{
+ /* FIXME: This interacts unpleasantly with ar's quick-append option.
+ Fortunately ic960 users will never use that option. Fixing this
+ is very hard; fortunately I know how to do it and will do so once
+ intel's release is out the door. */
+
+ struct ar_hdr *hdr = (struct ar_hdr *) arhdr;
+ int length;
+ CONST char *filename = normalize(pathname);
+ int maxlen = ar_maxnamelen (abfd);
+
+ length = strlen (filename);
+
+ if (length <= maxlen)
+ memcpy (hdr->ar_name, filename, length);
+
+ if (length < maxlen) (hdr->ar_name)[length] = ar_padchar (abfd);
+ return;
+
+}
+
+void
+bfd_bsd_truncate_arname (abfd, pathname, arhdr)
+ bfd *abfd;
+ CONST char *pathname;
+ char *arhdr;
+{
+ struct ar_hdr *hdr = (struct ar_hdr *) arhdr;
+ int length;
+ CONST char *filename = strrchr (pathname, '/');
+ int maxlen = ar_maxnamelen (abfd);
+
+
+ if (filename == NULL)
+ filename = pathname;
+ else
+ ++filename;
+
+ length = strlen (filename);
+
+ if (length <= maxlen)
+ memcpy (hdr->ar_name, filename, length);
+ else {
+ /* pathname: meet procrustes */
+ memcpy (hdr->ar_name, filename, maxlen);
+ length = maxlen;
+ }
+
+ if (length < maxlen) (hdr->ar_name)[length] = ar_padchar (abfd);
+}
+
+/* Store name into ar header. Truncates the name to fit.
+ 1> strip pathname to be just the basename.
+ 2> if it's short enuf to fit, stuff it in.
+ 3> If it doesn't end with .o, truncate it to fit
+ 4> truncate it before the .o, append .o, stuff THAT in.
+*/
+
+/* This is what gnu ar does. It's better but incompatible with the bsd ar. */
+void
+bfd_gnu_truncate_arname (abfd, pathname, arhdr)
+ bfd *abfd;
+ CONST char *pathname;
+ char *arhdr;
+{
+ struct ar_hdr *hdr = (struct ar_hdr *) arhdr;
+ int length;
+ CONST char *filename = strrchr (pathname, '/');
+ int maxlen = ar_maxnamelen (abfd);
+
+ if (filename == NULL)
+ filename = pathname;
+ else
+ ++filename;
+
+ length = strlen (filename);
+
+ if (length <= maxlen)
+ memcpy (hdr->ar_name, filename, length);
+ else { /* pathname: meet procrustes */
+ memcpy (hdr->ar_name, filename, maxlen);
+ if ((filename[length - 2] == '.') && (filename[length - 1] == 'o')) {
+ hdr->ar_name[maxlen - 2] = '.';
+ hdr->ar_name[maxlen - 1] = 'o';
+ }
+ length = maxlen;
+ }
+
+ if (length < 16) (hdr->ar_name)[length] = ar_padchar (abfd);
+}
+
+
+/* The BFD is open for write and has its format set to bfd_archive */
+boolean
+_bfd_write_archive_contents (arch)
+ bfd *arch;
+{
+ bfd *current;
+ char *etable = NULL;
+ unsigned int elength = 0;
+ boolean makemap = bfd_has_map (arch);
+ boolean hasobjects = false; /* if no .o's, don't bother to make a map */
+ unsigned int i;
+ int tries;
+
+ /* Verify the viability of all entries; if any of them live in the
+ filesystem (as opposed to living in an archive open for input)
+ then construct a fresh ar_hdr for them.
+ */
+ for (current = arch->archive_head; current; current = current->next) {
+ if (bfd_write_p (current)) {
+ bfd_error = invalid_operation;
+ return false;
+ }
+ if (!current->arelt_data) {
+ current->arelt_data =
+ (PTR) bfd_ar_hdr_from_filesystem (arch, current->filename);
+ if (!current->arelt_data) return false;
+
+ /* Put in the file name */
+
+ BFD_SEND (arch, _bfd_truncate_arname,(arch,
+ current->filename,
+ (char *) arch_hdr(current)));
+
+
+ }
+
+ if (makemap) { /* don't bother if we won't make a map! */
+ if ((bfd_check_format (current, bfd_object))
+#if 0 /* FIXME -- these are not set correctly */
+ && ((bfd_get_file_flags (current) & HAS_SYMS))
+#endif
+ )
+ hasobjects = true;
+ }
+ }
+
+ if (!bfd_construct_extended_name_table (arch, &etable, &elength))
+ return false;
+
+ bfd_seek (arch, (file_ptr) 0, SEEK_SET);
+#ifdef GNU960
+ bfd_write (BFD_GNU960_ARMAG(arch), 1, SARMAG, arch);
+#else
+ bfd_write (ARMAG, 1, SARMAG, arch);
+#endif
+
+ if (makemap && hasobjects) {
+
+ if (compute_and_write_armap (arch, elength) != true) {
+ return false;
+ }
+ }
+
+ if (elength != 0) {
+ struct ar_hdr hdr;
+
+ memset ((char *)(&hdr), 0, sizeof (struct ar_hdr));
+ sprintf (&(hdr.ar_name[0]), "ARFILENAMES/");
+ sprintf (&(hdr.ar_size[0]), "%-10d", (int) elength);
+ hdr.ar_fmag[0] = '`'; hdr.ar_fmag[1] = '\n';
+ for (i = 0; i < sizeof (struct ar_hdr); i++)
+ if (((char *)(&hdr))[i] == '\0') (((char *)(&hdr))[i]) = ' ';
+ bfd_write ((char *)&hdr, 1, sizeof (struct ar_hdr), arch);
+ bfd_write (etable, 1, elength, arch);
+ if ((elength % 2) == 1) bfd_write ("\n", 1, 1, arch);
+
+ }
+
+ for (current = arch->archive_head; current; current = current->next) {
+ char buffer[DEFAULT_BUFFERSIZE];
+ unsigned int remaining = arelt_size (current);
+ struct ar_hdr *hdr = arch_hdr(current);
+ /* write ar header */
+
+ if (bfd_write ((char *)hdr, 1, sizeof(*hdr), arch) != sizeof(*hdr)) {
+ syserr:
+ bfd_error = system_call_error;
+ return false;
+ }
+ if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0) goto syserr;
+ while (remaining)
+ {
+ unsigned int amt = DEFAULT_BUFFERSIZE;
+ if (amt > remaining) {
+ amt = remaining;
+ }
+ errno = 0;
+ if (bfd_read (buffer, amt, 1, current) != amt) {
+ if (errno) goto syserr;
+ /* Looks like a truncated archive. */
+ bfd_error = malformed_archive;
+ return false;
+ }
+ if (bfd_write (buffer, amt, 1, arch) != amt) goto syserr;
+ remaining -= amt;
+ }
+ if ((arelt_size (current) % 2) == 1) bfd_write ("\n", 1, 1, arch);
+ }
+
+ /* Verify the timestamp in the archive file. If it would
+ not be accepted by the linker, rewrite it until it would be.
+ If anything odd happens, break out and just return.
+ (The Berkeley linker checks the timestamp and refuses to read the
+ table-of-contents if it is >60 seconds less than the file's
+ modified-time. That painful hack requires this painful hack. */
+
+ tries = 1;
+ do {
+ /* FIXME! This kludge is to avoid adding a member to the xvec,
+ while generating a small patch for Adobe. FIXME! The
+ update_armap_timestamp function call should be in the xvec,
+ thus:
+
+ if (bfd_update_armap_timestamp (arch) == true) break;
+ ^
+
+ Instead, we check whether in a BSD archive, and call directly. */
+
+ if (arch->xvec->write_armap != bsd_write_armap)
+ break;
+ if (bsd_update_armap_timestamp(arch) == true) /* FIXME!!! Vector it */
+ break;
+ if (tries > 0)
+ fprintf (stderr,
+ "Warning: writing archive was slow: rewriting timestamp\n");
+ } while (++tries < 6 );
+
+ return true;
+}
+
+/* Note that the namidx for the first symbol is 0 */
+
+boolean
+compute_and_write_armap (arch, elength)
+ bfd *arch;
+ unsigned int elength;
+{
+ bfd *current;
+ file_ptr elt_no = 0;
+ struct orl *map;
+ int orl_max = 15000; /* fine initial default */
+ int orl_count = 0;
+ int stridx = 0; /* string index */
+
+ /* Dunno if this is the best place for this info... */
+ if (elength != 0) elength += sizeof (struct ar_hdr);
+ elength += elength %2 ;
+
+ map = (struct orl *) bfd_zalloc (arch,orl_max * sizeof (struct orl));
+ if (map == NULL) {
+ bfd_error = no_memory;
+ return false;
+ }
+
+ /* Drop all the files called __.SYMDEF, we're going to make our
+ own */
+ while (arch->archive_head &&
+ strcmp(arch->archive_head->filename,"__.SYMDEF") == 0)
+ {
+ arch->archive_head = arch->archive_head->next;
+ }
+ /* Map over each element */
+ for (current = arch->archive_head;
+ current != (bfd *)NULL;
+ current = current->next, elt_no++)
+ {
+ if ((bfd_check_format (current, bfd_object) == true)
+ && ((bfd_get_file_flags (current) & HAS_SYMS))) {
+ asymbol **syms;
+ unsigned int storage;
+ unsigned int symcount;
+ unsigned int src_count;
+
+ storage = get_symtab_upper_bound (current);
+ if (storage != 0) {
+
+ syms = (asymbol **) bfd_zalloc (arch,storage);
+ if (syms == NULL) {
+ bfd_error = no_memory; /* FIXME -- memory leak */
+ return false;
+ }
+ symcount = bfd_canonicalize_symtab (current, syms);
+
+
+ /* Now map over all the symbols, picking out the ones we want */
+ for (src_count = 0; src_count <symcount; src_count++) {
+ flagword flags =
+ (syms[src_count])->flags;
+ asection *sec =
+ syms[src_count]->section;
+
+ if ((flags & BSF_GLOBAL ||
+ flags & BSF_WEAK ||
+ flags & BSF_INDIRECT ||
+ bfd_is_com_section (sec))
+ && (sec != &bfd_und_section)) {
+
+ /* This symbol will go into the archive header */
+ if (orl_count == orl_max)
+ {
+ orl_max *= 2;
+ map = (struct orl *) bfd_realloc (arch, (char *) map,
+ orl_max * sizeof (struct orl));
+ }
+
+ (map[orl_count]).name = (char **) &((syms[src_count])->name);
+ (map[orl_count]).pos = (file_ptr) current;
+ (map[orl_count]).namidx = stridx;
+
+ stridx += strlen ((syms[src_count])->name) + 1;
+ ++orl_count;
+ }
+ }
+ }
+ }
+ }
+ /* OK, now we have collected all the data, let's write them out */
+ if (!BFD_SEND (arch, write_armap,
+ (arch, elength, map, orl_count, stridx))) {
+
+ return false;
+ }
+
+
+ return true;
+}
+
+boolean
+bsd_write_armap (arch, elength, map, orl_count, stridx)
+ bfd *arch;
+ unsigned int elength;
+ struct orl *map;
+ unsigned int orl_count;
+ int stridx;
+{
+ int padit = stridx & 1;
+ unsigned int ranlibsize = orl_count * sizeof (struct ranlib);
+ unsigned int stringsize = stridx + padit;
+ /* Include 8 bytes to store ranlibsize and stringsize in output. */
+ unsigned int mapsize = ranlibsize + stringsize + 8;
+ file_ptr firstreal;
+ bfd *current = arch->archive_head;
+ bfd *last_elt = current; /* last element arch seen */
+ int temp;
+ int count;
+ struct ar_hdr hdr;
+ struct stat statbuf;
+ unsigned int i;
+
+ firstreal = mapsize + elength + sizeof (struct ar_hdr) + SARMAG;
+
+ stat (arch->filename, &statbuf);
+ memset ((char *)(&hdr), 0, sizeof (struct ar_hdr));
+ sprintf (hdr.ar_name, RANLIBMAG);
+ /* Remember the timestamp, to keep it holy. But fudge it a little. */
+ bfd_ardata(arch)->armap_timestamp = statbuf.st_mtime + ARMAP_TIME_OFFSET;
+ bfd_ardata(arch)->armap_datepos = SARMAG +
+ offsetof(struct ar_hdr, ar_date[0]);
+ sprintf (hdr.ar_date, "%ld", bfd_ardata(arch)->armap_timestamp);
+ sprintf (hdr.ar_uid, "%d", getuid());
+ sprintf (hdr.ar_gid, "%d", getgid());
+ sprintf (hdr.ar_size, "%-10d", (int) mapsize);
+ hdr.ar_fmag[0] = '`'; hdr.ar_fmag[1] = '\n';
+ for (i = 0; i < sizeof (struct ar_hdr); i++)
+ if (((char *)(&hdr))[i] == '\0') (((char *)(&hdr))[i]) = ' ';
+ bfd_write ((char *)&hdr, 1, sizeof (struct ar_hdr), arch);
+ bfd_h_put_32(arch, (bfd_vma) ranlibsize, (PTR)&temp);
+ bfd_write (&temp, 1, sizeof (temp), arch);
+
+ for (count = 0; count < orl_count; count++) {
+ struct symdef outs;
+ struct symdef *outp = &outs;
+
+ if (((bfd *)(map[count]).pos) != last_elt) {
+ do {
+ firstreal += arelt_size (current) + sizeof (struct ar_hdr);
+ firstreal += firstreal % 2;
+ current = current->next;
+ } while (current != (bfd *)(map[count]).pos);
+ } /* if new archive element */
+
+ last_elt = current;
+ bfd_h_put_32(arch, ((map[count]).namidx),(PTR) &outs.s.string_offset);
+ bfd_h_put_32(arch, firstreal,(PTR) &outs.file_offset);
+ bfd_write ((char *)outp, 1, sizeof (outs), arch);
+ }
+
+ /* now write the strings themselves */
+ bfd_h_put_32(arch, stringsize, (PTR)&temp);
+ bfd_write ((PTR)&temp, 1, sizeof (temp), arch);
+ for (count = 0; count < orl_count; count++)
+ bfd_write (*((map[count]).name), 1, strlen (*((map[count]).name))+1, arch);
+
+ /* The spec sez this should be a newline. But in order to be
+ bug-compatible for sun's ar we use a null. */
+ if (padit)
+ bfd_write("\0",1,1,arch);
+
+ return true;
+}
+
+
+/* At the end of archive file handling, update the timestamp in the
+ file, so the linker will accept it.
+
+ Return true if the timestamp was OK, or an unusual problem happened.
+ Return false if we updated the timestamp. */
+
+static boolean
+bsd_update_armap_timestamp (arch)
+ bfd *arch;
+{
+ struct stat archstat;
+ struct ar_hdr hdr;
+ int i;
+
+ /* Flush writes, get last-write timestamp from file, and compare it
+ to the timestamp IN the file. */
+ bfd_flush (arch);
+ if (bfd_stat (arch, &archstat) == -1) {
+ perror ("Reading archive file mod timestamp");
+ return true; /* Can't read mod time for some reason */
+ }
+ if (archstat.st_mtime <= bfd_ardata(arch)->armap_timestamp)
+ return true; /* OK by the linker's rules */
+
+ /* Update the timestamp. */
+ bfd_ardata(arch)->armap_timestamp = archstat.st_mtime + ARMAP_TIME_OFFSET;
+
+ /* Prepare an ASCII version suitable for writing. */
+ memset (hdr.ar_date, 0, sizeof (hdr.ar_date));
+ sprintf (hdr.ar_date, "%ld", bfd_ardata(arch)->armap_timestamp);
+ for (i = 0; i < sizeof (hdr.ar_date); i++)
+ if (hdr.ar_date[i] == '\0')
+ (hdr.ar_date)[i] = ' ';
+
+ /* Write it into the file. */
+ bfd_seek (arch, bfd_ardata(arch)->armap_datepos, SEEK_SET);
+ if (bfd_write (hdr.ar_date, sizeof(hdr.ar_date), 1, arch)
+ != sizeof(hdr.ar_date)) {
+ perror ("Writing updated armap timestamp");
+ return true; /* Some error while writing */
+ }
+
+ return false; /* We updated the timestamp successfully. */
+}
+
+
+/* A coff armap looks like :
+ lARMAG
+ struct ar_hdr with name = '/'
+ number of symbols
+ offset of file for symbol 0
+ offset of file for symbol 1
+
+ offset of file for symbol n-1
+ symbol name 0
+ symbol name 1
+
+ symbol name n-1
+
+*/
+
+boolean
+coff_write_armap (arch, elength, map, symbol_count, stridx)
+ bfd *arch;
+ unsigned int elength;
+ struct orl *map;
+ unsigned int symbol_count;
+ int stridx;
+{
+ /* The size of the ranlib is the number of exported symbols in the
+ archive * the number of bytes in a int, + an int for the count */
+
+ unsigned int ranlibsize = (symbol_count * 4) + 4;
+ unsigned int stringsize = stridx;
+ unsigned int mapsize = stringsize + ranlibsize;
+ file_ptr archive_member_file_ptr;
+ bfd *current = arch->archive_head;
+ int count;
+ struct ar_hdr hdr;
+ unsigned int i;
+ int padit = mapsize & 1;
+
+ if (padit) mapsize ++;
+
+ /* work out where the first object file will go in the archive */
+ archive_member_file_ptr = mapsize + elength + sizeof (struct ar_hdr) + SARMAG;
+
+ memset ((char *)(&hdr), 0, sizeof (struct ar_hdr));
+ hdr.ar_name[0] = '/';
+ sprintf (hdr.ar_size, "%-10d", (int) mapsize);
+ sprintf (hdr.ar_date, "%ld", (long)time (NULL));
+ /* This, at least, is what Intel coff sets the values to.: */
+ sprintf ((hdr.ar_uid), "%d", 0);
+ sprintf ((hdr.ar_gid), "%d", 0);
+ sprintf ((hdr.ar_mode), "%-7o",(unsigned ) 0);
+ hdr.ar_fmag[0] = '`'; hdr.ar_fmag[1] = '\n';
+
+ for (i = 0; i < sizeof (struct ar_hdr); i++)
+ if (((char *)(&hdr))[i] == '\0') (((char *)(&hdr))[i]) = ' ';
+
+ /* Write the ar header for this item and the number of symbols */
+
+
+ bfd_write ((PTR)&hdr, 1, sizeof (struct ar_hdr), arch);
+
+ bfd_write_bigendian_4byte_int(arch, symbol_count);
+
+ /* Two passes, first write the file offsets for each symbol -
+ remembering that each offset is on a two byte boundary. */
+
+ /* Write out the file offset for the file associated with each
+ symbol, and remember to keep the offsets padded out. */
+
+ current = arch->archive_head;
+ count = 0;
+ while (current != (bfd *)NULL && count < symbol_count) {
+ /* For each symbol which is used defined in this object, write out
+ the object file's address in the archive */
+
+ while (((bfd *)(map[count]).pos) == current) {
+ bfd_write_bigendian_4byte_int(arch, archive_member_file_ptr);
+ count++;
+ }
+ /* Add size of this archive entry */
+ archive_member_file_ptr += arelt_size (current) + sizeof (struct
+ ar_hdr);
+ /* remember aboout the even alignment */
+ archive_member_file_ptr += archive_member_file_ptr % 2;
+ current = current->next;
+ }
+
+
+
+ /* now write the strings themselves */
+ for (count = 0; count < symbol_count; count++) {
+ bfd_write ((PTR)*((map[count]).name),
+ 1,
+ strlen (*((map[count]).name))+1, arch);
+
+ }
+ /* The spec sez this should be a newline. But in order to be
+ bug-compatible for arc960 we use a null. */
+ if (padit)
+ bfd_write("\0",1,1,arch);
+
+ return true;
+}
diff --git a/gnu/usr.bin/gdb/bfd/archures.c b/gnu/usr.bin/gdb/bfd/archures.c
new file mode 100644
index 000000000000..9697904bd733
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/archures.c
@@ -0,0 +1,731 @@
+/* BFD library support routines for architectures.
+ Copyright (C) 1990-1991 Free Software Foundation, Inc.
+ Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
+
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You 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. */
+
+/*
+
+SECTION
+ Architectures
+
+ BFD's idea of an architecture is implimented in
+ <<archures.c>>. BFD keeps one atom in a BFD describing the
+ architecture of the data attached to the BFD; a pointer to a
+ <<bfd_arch_info_type>>.
+
+ Pointers to structures can be requested independently of a bfd
+ so that an architecture's information can be interrogated
+ without access to an open bfd.
+
+ The arch information is provided by each architecture package.
+ The set of default architectures is selected by the #define
+ <<SELECT_ARCHITECTURES>>. This is normally set up in the
+ <<config/target.mt>> file of your choice. If the name is not
+ defined, then all the architectures supported are included.
+
+ When BFD starts up, all the architectures are called with an
+ initialize method. It is up to the architecture back end to
+ insert as many items into the list of architectures as it wants to;
+ generally this would be one for each machine and one for the
+ default case (an item with a machine field of 0).
+*/
+
+/*
+
+SUBSECTION
+ bfd_architecture
+
+DESCRIPTION
+ This enum gives the object file's CPU architecture, in a
+ global sense --- i.e., what processor family does it belong to?
+ There is another field, which indicates what processor within
+ the family is in use. The machine gives a number which
+ distingushes different versions of the architecture,
+ containing for example 2 and 3 for Intel i960 KA and i960 KB,
+ and 68020 and 68030 for Motorola 68020 and 68030.
+
+.enum bfd_architecture
+.{
+. bfd_arch_unknown, {* File arch not known *}
+. bfd_arch_obscure, {* Arch known, not one of these *}
+. bfd_arch_m68k, {* Motorola 68xxx *}
+. bfd_arch_vax, {* DEC Vax *}
+. bfd_arch_i960, {* Intel 960 *}
+. {* The order of the following is important.
+. lower number indicates a machine type that
+. only accepts a subset of the instructions
+. available to machines with higher numbers.
+. The exception is the "ca", which is
+. incompatible with all other machines except
+. "core". *}
+.
+.#define bfd_mach_i960_core 1
+.#define bfd_mach_i960_ka_sa 2
+.#define bfd_mach_i960_kb_sb 3
+.#define bfd_mach_i960_mc 4
+.#define bfd_mach_i960_xa 5
+.#define bfd_mach_i960_ca 6
+.
+. bfd_arch_a29k, {* AMD 29000 *}
+. bfd_arch_sparc, {* SPARC *}
+. bfd_arch_mips, {* MIPS Rxxxx *}
+. bfd_arch_i386, {* Intel 386 *}
+. bfd_arch_we32k, {* AT&T WE32xxx *}
+. bfd_arch_tahoe, {* CCI/Harris Tahoe *}
+. bfd_arch_i860, {* Intel 860 *}
+. bfd_arch_romp, {* IBM ROMP PC/RT *}
+. bfd_arch_alliant, {* Alliant *}
+. bfd_arch_convex, {* Convex *}
+. bfd_arch_m88k, {* Motorola 88xxx *}
+. bfd_arch_pyramid, {* Pyramid Technology *}
+. bfd_arch_h8300, {* Hitachi H8/300 *}
+.#define bfd_mach_h8300 1
+.#define bfd_mach_h8300h 2
+. bfd_arch_rs6000, {* IBM RS/6000 *}
+. bfd_arch_hppa, {* HP PA RISC *}
+. bfd_arch_z8k, {* Zilog Z8000 *}
+.#define bfd_mach_z8001 1
+.#define bfd_mach_z8002 2
+. bfd_arch_h8500, {* Hitachi H8/500 *}
+. bfd_arch_sh, {* Hitachi SH *}
+. bfd_arch_alpha, {* Dec Alpha *}
+. bfd_arch_last
+. };
+
+
+*/
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+/*
+
+SUBSECTION
+ bfd_arch_info
+
+DESCRIPTION
+ This structure contains information on architectures for use
+ within BFD.
+
+.
+.typedef struct bfd_arch_info
+.{
+. int bits_per_word;
+. int bits_per_address;
+. int bits_per_byte;
+. enum bfd_architecture arch;
+. long mach;
+. char *arch_name;
+. CONST char *printable_name;
+. unsigned int section_align_power;
+. {* true if this is the default machine for the architecture *}
+. boolean the_default;
+. CONST struct bfd_arch_info * (*compatible)
+. PARAMS ((CONST struct bfd_arch_info *a,
+. CONST struct bfd_arch_info *b));
+.
+. boolean (*scan) PARAMS ((CONST struct bfd_arch_info *, CONST char *));
+. {* How to disassemble an instruction, producing a printable
+. representation on a specified stdio stream. This isn't
+. defined for most processors at present, because of the size
+. of the additional tables it would drag in, and because gdb
+. wants to use a different interface. *}
+. unsigned int (*disassemble) PARAMS ((bfd_vma addr, CONST char *data,
+. PTR stream));
+.
+. struct bfd_arch_info *next;
+.} bfd_arch_info_type;
+*/
+
+bfd_arch_info_type *bfd_arch_info_list;
+
+
+/*
+FUNCTION
+ bfd_printable_name
+
+SYNOPSIS
+ CONST char *bfd_printable_name(bfd *abfd);
+
+DESCRIPTION
+ Return a printable string representing the architecture and machine
+ from the pointer to the arch info structure
+
+*/
+
+CONST char *
+DEFUN(bfd_printable_name, (abfd),
+ bfd *abfd)
+{
+ return abfd->arch_info->printable_name;
+}
+
+
+
+/*
+FUNCTION
+ bfd_scan_arch
+
+SYNOPSIS
+ bfd_arch_info_type *bfd_scan_arch(CONST char *);
+
+DESCRIPTION
+ This routine is provided with a string and tries to work out
+ if bfd supports any cpu which could be described with the name
+ provided. The routine returns a pointer to an arch_info
+ structure if a machine is found, otherwise NULL.
+
+*/
+
+bfd_arch_info_type *
+DEFUN(bfd_scan_arch,(string),
+ CONST char *string)
+{
+ struct bfd_arch_info *ap;
+
+ /* Look through all the installed architectures */
+ for (ap = bfd_arch_info_list;
+ ap != (bfd_arch_info_type *)NULL;
+ ap = ap->next) {
+
+ if (ap->scan(ap, string))
+ return ap;
+ }
+ return (bfd_arch_info_type *)NULL;
+}
+
+
+
+/*
+FUNCTION
+ bfd_arch_get_compatible
+
+SYNOPSIS
+ CONST bfd_arch_info_type *bfd_arch_get_compatible(
+ CONST bfd *abfd,
+ CONST bfd *bbfd);
+
+DESCRIPTION
+ This routine is used to determine whether two BFDs'
+ architectures and achine types are compatible. It calculates
+ the lowest common denominator between the two architectures
+ and machine types implied by the BFDs and returns a pointer to
+ an arch_info structure describing the compatible machine.
+*/
+
+CONST bfd_arch_info_type *
+DEFUN(bfd_arch_get_compatible,(abfd, bbfd),
+CONST bfd *abfd AND
+CONST bfd *bbfd)
+
+{
+ return abfd->arch_info->compatible(abfd->arch_info,bbfd->arch_info);
+}
+
+
+/*
+INTERNAL_DEFINITION
+ bfd_default_arch_struct
+
+DESCRIPTION
+ The <<bfd_default_arch_struct>> is an item of
+ <<bfd_arch_info_type>> which has been initialized to a fairly
+ generic state. A BFD starts life by pointing to this
+ structure, until the correct back end has determined the real
+ architecture of the file.
+
+.extern bfd_arch_info_type bfd_default_arch_struct;
+
+*/
+
+bfd_arch_info_type bfd_default_arch_struct =
+{
+ 32,32,8,bfd_arch_unknown,0,"unknown","unknown",2,true,
+ bfd_default_compatible,
+ bfd_default_scan,
+ 0,
+};
+
+/*
+FUNCTION
+ bfd_set_arch_info
+
+SYNOPSIS
+ void bfd_set_arch_info(bfd *, bfd_arch_info_type *);
+
+*/
+
+void DEFUN(bfd_set_arch_info,(abfd, arg),
+bfd *abfd AND
+bfd_arch_info_type *arg)
+{
+ abfd->arch_info = arg;
+}
+
+/*
+INTERNAL_FUNCTION
+ bfd_default_set_arch_mach
+
+SYNOPSIS
+ boolean bfd_default_set_arch_mach(bfd *abfd,
+ enum bfd_architecture arch,
+ unsigned long mach);
+
+DESCRIPTION
+ Set the architecture and machine type in a bfd. This finds the
+ correct pointer to structure and inserts it into the arch_info
+ pointer.
+*/
+
+boolean DEFUN(bfd_default_set_arch_mach,(abfd, arch, mach),
+ bfd *abfd AND
+ enum bfd_architecture arch AND
+ unsigned long mach)
+{
+ static struct bfd_arch_info *old_ptr = &bfd_default_arch_struct;
+ boolean found = false;
+ /* run through the table to find the one we want, we keep a little
+ cache to speed things up */
+ if (old_ptr == 0 || arch != old_ptr->arch || mach != old_ptr->mach) {
+ bfd_arch_info_type *ptr;
+ old_ptr = (bfd_arch_info_type *)NULL;
+ for (ptr = bfd_arch_info_list;
+ ptr != (bfd_arch_info_type *)NULL;
+ ptr= ptr->next) {
+ if (ptr->arch == arch &&
+ ((ptr->mach == mach) || (ptr->the_default && mach == 0))) {
+ old_ptr = ptr;
+ found = true;
+ break;
+ }
+ }
+ if (found==false) {
+ /*looked for it and it wasn't there, so put in the default */
+ old_ptr = &bfd_default_arch_struct;
+ bfd_error = bad_value;
+ }
+ }
+ else {
+ /* it was in the cache */
+ found = true;
+ }
+
+ abfd->arch_info = old_ptr;
+
+ return found;
+}
+
+
+
+
+
+/*
+FUNCTION
+ bfd_get_arch
+
+SYNOPSIS
+ enum bfd_architecture bfd_get_arch(bfd *abfd);
+
+DESCRIPTION
+ Returns the enumerated type which describes the supplied bfd's
+ architecture
+
+*/
+
+enum bfd_architecture DEFUN(bfd_get_arch, (abfd), bfd *abfd)
+{
+ return abfd->arch_info->arch;
+}
+
+/*
+FUNCTION
+ bfd_get_mach
+
+SYNOPSIS
+ unsigned long bfd_get_mach(bfd *abfd);
+
+DESCRIPTION
+ Returns the long type which describes the supplied bfd's
+ machine
+*/
+
+unsigned long
+DEFUN(bfd_get_mach, (abfd), bfd *abfd)
+{
+ return abfd->arch_info->mach;
+}
+
+/*
+FUNCTION
+ bfd_arch_bits_per_byte
+
+SYNOPSIS
+ unsigned int bfd_arch_bits_per_byte(bfd *abfd);
+
+DESCRIPTION
+ Returns the number of bits in one of the architectures bytes
+
+*/
+
+unsigned int DEFUN(bfd_arch_bits_per_byte, (abfd), bfd *abfd)
+ {
+ return abfd->arch_info->bits_per_byte;
+ }
+
+/*
+FUNCTION
+ bfd_arch_bits_per_address
+
+SYNOPSIS
+ unsigned int bfd_arch_bits_per_address(bfd *abfd);
+
+DESCRIPTION
+ Returns the number of bits in one of the architectures addresses
+*/
+
+unsigned int DEFUN(bfd_arch_bits_per_address, (abfd), bfd *abfd)
+ {
+ return abfd->arch_info->bits_per_address;
+ }
+
+
+extern void bfd_a29k_arch PARAMS ((void));
+extern void bfd_alpha_arch PARAMS ((void));
+extern void bfd_h8300_arch PARAMS ((void));
+extern void bfd_h8500_arch PARAMS ((void));
+extern void bfd_hppa_arch PARAMS ((void));
+extern void bfd_i386_arch PARAMS ((void));
+extern void bfd_i960_arch PARAMS ((void));
+extern void bfd_m68k_arch PARAMS ((void));
+extern void bfd_m88k_arch PARAMS ((void));
+extern void bfd_mips_arch PARAMS ((void));
+extern void bfd_rs6000_arch PARAMS ((void));
+extern void bfd_sh_arch PARAMS ((void));
+extern void bfd_sparc_arch PARAMS ((void));
+extern void bfd_vax_arch PARAMS ((void));
+extern void bfd_we32k_arch PARAMS ((void));
+extern void bfd_z8k_arch PARAMS ((void));
+
+static void (*archures_init_table[]) PARAMS ((void)) =
+{
+#ifdef SELECT_ARCHITECTURES
+ SELECT_ARCHITECTURES,
+#else
+ bfd_a29k_arch,
+ bfd_alpha_arch,
+ bfd_h8300_arch,
+ bfd_h8500_arch,
+ bfd_hppa_arch,
+ bfd_i386_arch,
+ bfd_i960_arch,
+ bfd_m68k_arch,
+ bfd_m88k_arch,
+ bfd_mips_arch,
+ bfd_rs6000_arch,
+ bfd_sh_arch,
+ bfd_sparc_arch,
+ bfd_vax_arch,
+ bfd_we32k_arch,
+ bfd_z8k_arch,
+#endif
+ 0
+ };
+
+
+
+/*
+INTERNAL_FUNCTION
+ bfd_arch_init
+
+SYNOPSIS
+ void bfd_arch_init(void);
+
+DESCRIPTION
+ This routine initializes the architecture dispatch table by
+ calling all installed architecture packages and getting them
+ to poke around.
+*/
+
+void
+DEFUN_VOID(bfd_arch_init)
+{
+ void (**ptable) PARAMS ((void));
+ for (ptable = archures_init_table;
+ *ptable ;
+ ptable++)
+ {
+ (*ptable)();
+ }
+}
+
+
+/*
+INTERNAL_FUNCTION
+ bfd_arch_linkin
+
+SYNOPSIS
+ void bfd_arch_linkin(bfd_arch_info_type *);
+
+DESCRIPTION
+ Link the provided arch info structure into the list
+*/
+
+void DEFUN(bfd_arch_linkin,(ptr),
+ bfd_arch_info_type *ptr)
+{
+ ptr->next = bfd_arch_info_list;
+ bfd_arch_info_list = ptr;
+}
+
+
+/*
+INTERNAL_FUNCTION
+ bfd_default_compatible
+
+SYNOPSIS
+ CONST bfd_arch_info_type *bfd_default_compatible
+ (CONST bfd_arch_info_type *a,
+ CONST bfd_arch_info_type *b);
+
+DESCRIPTION
+ The default function for testing for compatibility.
+*/
+
+CONST bfd_arch_info_type *
+DEFUN(bfd_default_compatible,(a,b),
+ CONST bfd_arch_info_type *a AND
+ CONST bfd_arch_info_type *b)
+{
+ if(a->arch != b->arch) return NULL;
+
+ if (a->mach > b->mach) {
+ return a;
+ }
+ if (b->mach > a->mach) {
+ return b;
+ }
+ return a;
+}
+
+
+/*
+INTERNAL_FUNCTION
+ bfd_default_scan
+
+SYNOPSIS
+ boolean bfd_default_scan(CONST struct bfd_arch_info *, CONST char *);
+
+DESCRIPTION
+ The default function for working out whether this is an
+ architecture hit and a machine hit.
+*/
+
+boolean
+DEFUN(bfd_default_scan,(info, string),
+CONST struct bfd_arch_info *info AND
+CONST char *string)
+{
+ CONST char *ptr_src;
+ CONST char *ptr_tst;
+ unsigned long number;
+ enum bfd_architecture arch;
+ /* First test for an exact match */
+ if (strcmp(string, info->printable_name) == 0) return true;
+
+ /* See how much of the supplied string matches with the
+ architecture, eg the string m68k:68020 would match the 68k entry
+ up to the :, then we get left with the machine number */
+
+ for (ptr_src = string,
+ ptr_tst = info->arch_name;
+ *ptr_src && *ptr_tst;
+ ptr_src++,
+ ptr_tst++)
+ {
+ if (*ptr_src != *ptr_tst) break;
+ }
+
+ /* Chewed up as much of the architecture as will match, skip any
+ colons */
+ if (*ptr_src == ':') ptr_src++;
+
+ if (*ptr_src == 0) {
+ /* nothing more, then only keep this one if it is the default
+ machine for this architecture */
+ return info->the_default;
+ }
+ number = 0;
+ while (isdigit(*ptr_src)) {
+ number = number * 10 + *ptr_src - '0';
+ ptr_src++;
+ }
+
+ switch (number)
+ {
+ case 300:
+ arch = bfd_arch_h8300;
+ break;
+
+ case 500:
+ arch = bfd_arch_h8500;
+ break;
+
+ case 68010:
+ case 68020:
+ case 68030:
+ case 68040:
+ case 68332:
+ case 68050:
+ case 68000:
+ arch = bfd_arch_m68k;
+ break;
+ case 386:
+ case 80386:
+ case 486:
+ case 80486:
+ arch = bfd_arch_i386;
+ break;
+ case 29000:
+ arch = bfd_arch_a29k;
+ break;
+
+ case 8000:
+ arch = bfd_arch_z8k;
+ break;
+
+ case 32000:
+ arch = bfd_arch_we32k;
+ break;
+
+ case 860:
+ case 80860:
+ arch = bfd_arch_i860;
+ break;
+ case 960:
+ case 80960:
+ arch = bfd_arch_i960;
+ break;
+
+ case 2000:
+ case 3000:
+ case 4000:
+ case 4400:
+ arch = bfd_arch_mips;
+ break;
+
+ case 6000:
+ arch = bfd_arch_rs6000;
+ break;
+
+ default:
+ return false;
+ }
+ if (arch != info->arch)
+ return false;
+
+ if (number != info->mach)
+ return false;
+
+ return true;
+}
+
+
+
+
+/*
+FUNCTION
+ bfd_get_arch_info
+
+
+SYNOPSIS
+ bfd_arch_info_type * bfd_get_arch_info(bfd *);
+
+*/
+
+bfd_arch_info_type *
+DEFUN(bfd_get_arch_info,(abfd),
+bfd *abfd)
+{
+ return abfd->arch_info;
+}
+
+
+/*
+FUNCTION
+ bfd_lookup_arch
+
+SYNOPSIS
+ bfd_arch_info_type *bfd_lookup_arch
+ (enum bfd_architecture
+ arch,
+ long machine);
+
+DESCRIPTION
+ Look for the architecure info struct which matches the
+ arguments given. A machine of 0 will match the
+ machine/architecture structure which marks itself as the
+ default.
+*/
+
+bfd_arch_info_type *
+DEFUN(bfd_lookup_arch,(arch, machine),
+enum bfd_architecture arch AND
+long machine)
+{
+ bfd_arch_info_type *ap;
+ bfd_check_init();
+ for (ap = bfd_arch_info_list;
+ ap != (bfd_arch_info_type *)NULL;
+ ap = ap->next) {
+ if (ap->arch == arch &&
+ ((ap->mach == machine)
+ || (ap->the_default && machine == 0))) {
+ return ap;
+ }
+ }
+ return (bfd_arch_info_type *)NULL;
+}
+
+
+
+/*
+FUNCTION
+ bfd_printable_arch_mach
+
+SYNOPSIS
+ CONST char * bfd_printable_arch_mach
+ (enum bfd_architecture arch, unsigned long machine);
+
+DESCRIPTION
+ Return a printable string representing the architecture and
+ machine type.
+
+ NB. The use of this routine is depreciated.
+*/
+
+CONST char *
+DEFUN(bfd_printable_arch_mach,(arch, machine),
+ enum bfd_architecture arch AND
+ unsigned long machine)
+{
+ bfd_arch_info_type *ap = bfd_lookup_arch(arch, machine);
+ if(ap) return ap->printable_name;
+ return "UNKNOWN!";
+}
diff --git a/gnu/usr.bin/gdb/bfd/bfd.c b/gnu/usr.bin/gdb/bfd/bfd.c
new file mode 100644
index 000000000000..a994cd170a00
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/bfd.c
@@ -0,0 +1,733 @@
+/* Generic BFD library interface and support routines.
+ Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Written by Cygnus Support.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You 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. */
+
+/*
+SECTION
+ <<typedef bfd>>
+
+ A BFD is has type <<bfd>>; objects of this type are the
+ cornerstone of any application using <<libbfd>>. References
+ though the BFD and to data in the BFD give the entire BFD
+ functionality.
+
+ Here is the struct used to define the type <<bfd>>. This
+ contains the major data about the file, and contains pointers
+ to the rest of the data.
+
+CODE_FRAGMENT
+.
+.struct _bfd
+.{
+. {* The filename the application opened the BFD with. *}
+. CONST char *filename;
+.
+. {* A pointer to the target jump table. *}
+. struct bfd_target *xvec;
+.
+. {* To avoid dragging too many header files into every file that
+. includes `<<bfd.h>>', IOSTREAM has been declared as a "char
+. *", and MTIME as a "long". Their correct types, to which they
+. are cast when used, are "FILE *" and "time_t". The iostream
+. is the result of an fopen on the filename. *}
+. char *iostream;
+.
+. {* Is the file being cached *}
+.
+. boolean cacheable;
+.
+. {* Marks whether there was a default target specified when the
+. BFD was opened. This is used to select what matching algorithm
+. to use to chose the back end. *}
+.
+. boolean target_defaulted;
+.
+. {* The caching routines use these to maintain a
+. least-recently-used list of BFDs *}
+.
+. struct _bfd *lru_prev, *lru_next;
+.
+. {* When a file is closed by the caching routines, BFD retains
+. state information on the file here:
+. *}
+.
+. file_ptr where;
+.
+. {* and here:*}
+.
+. boolean opened_once;
+.
+. {* Set if we have a locally maintained mtime value, rather than
+. getting it from the file each time: *}
+.
+. boolean mtime_set;
+.
+. {* File modified time, if mtime_set is true: *}
+.
+. long mtime;
+.
+. {* Reserved for an unimplemented file locking extension.*}
+.
+. int ifd;
+.
+. {* The format which belongs to the BFD.*}
+.
+. bfd_format format;
+.
+. {* The direction the BFD was opened with*}
+.
+. enum bfd_direction {no_direction = 0,
+. read_direction = 1,
+. write_direction = 2,
+. both_direction = 3} direction;
+.
+. {* Format_specific flags*}
+.
+. flagword flags;
+.
+. {* Currently my_archive is tested before adding origin to
+. anything. I believe that this can become always an add of
+. origin, with origin set to 0 for non archive files. *}
+.
+. file_ptr origin;
+.
+. {* Remember when output has begun, to stop strange things
+. happening. *}
+. boolean output_has_begun;
+.
+. {* Pointer to linked list of sections*}
+. struct sec *sections;
+.
+. {* The number of sections *}
+. unsigned int section_count;
+.
+. {* Stuff only useful for object files:
+. The start address. *}
+. bfd_vma start_address;
+.
+. {* Used for input and output*}
+. unsigned int symcount;
+.
+. {* Symbol table for output BFD*}
+. struct symbol_cache_entry **outsymbols;
+.
+. {* Pointer to structure which contains architecture information*}
+. struct bfd_arch_info *arch_info;
+.
+. {* Stuff only useful for archives:*}
+. PTR arelt_data;
+. struct _bfd *my_archive;
+. struct _bfd *next;
+. struct _bfd *archive_head;
+. boolean has_armap;
+.
+. {* Used by the back end to hold private data. *}
+.
+. union
+. {
+. struct aout_data_struct *aout_data;
+. struct artdata *aout_ar_data;
+. struct _oasys_data *oasys_obj_data;
+. struct _oasys_ar_data *oasys_ar_data;
+. struct coff_tdata *coff_obj_data;
+. struct ecoff_tdata *ecoff_obj_data;
+. struct ieee_data_struct *ieee_data;
+. struct ieee_ar_data_struct *ieee_ar_data;
+. struct srec_data_struct *srec_data;
+. struct tekhex_data_struct *tekhex_data;
+. struct elf_obj_tdata *elf_obj_data;
+. struct nlm_obj_tdata *nlm_obj_data;
+. struct bout_data_struct *bout_data;
+. struct sun_core_struct *sun_core_data;
+. struct trad_core_struct *trad_core_data;
+. struct hppa_data_struct *hppa_data;
+. struct hpux_core_struct *hpux_core_data;
+. struct sgi_core_struct *sgi_core_data;
+. struct lynx_core_struct *lynx_core_data;
+. struct osf_core_struct *osf_core_data;
+. PTR any;
+. } tdata;
+.
+. {* Used by the application to hold private data*}
+. PTR usrdata;
+.
+. {* Where all the allocated stuff under this BFD goes *}
+. struct obstack memory;
+.
+. {* Is this really needed in addition to usrdata? *}
+. asymbol **ld_symbols;
+.};
+.
+*/
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "coff/internal.h"
+#include "coff/sym.h"
+#include "libcoff.h"
+#include "libecoff.h"
+#undef obj_symbols
+#include "libelf.h"
+
+#undef strerror
+extern char *strerror();
+
+/** Error handling
+ o - Most functions return nonzero on success (check doc for
+ precise semantics); 0 or NULL on error.
+ o - Internal errors are documented by the value of bfd_error.
+ If that is system_call_error then check errno.
+ o - The easiest way to report this to the user is to use bfd_perror.
+*/
+
+bfd_ec bfd_error = no_error;
+
+CONST char *CONST bfd_errmsgs[] = {
+ "No error",
+ "System call error",
+ "Invalid target",
+ "File in wrong format",
+ "Invalid operation",
+ "Memory exhausted",
+ "No symbols",
+ "No relocation info",
+ "No more archived files",
+ "Malformed archive",
+ "Symbol not found",
+ "File format not recognized",
+ "File format is ambiguous",
+ "Section has no contents",
+ "Nonrepresentable section on output",
+ "Symbol needs debug section which does not exist",
+ "Bad value",
+ "File truncated",
+ "#<Invalid error code>"
+ };
+
+static
+void
+DEFUN(bfd_nonrepresentable_section,(abfd, name),
+ CONST bfd * CONST abfd AND
+ CONST char * CONST name)
+{
+ fprintf(stderr,
+ "bfd error writing file %s, format %s can't represent section %s\n",
+ abfd->filename,
+ abfd->xvec->name,
+ name);
+ exit(1);
+}
+
+/*ARGSUSED*/
+static
+void
+DEFUN(bfd_undefined_symbol,(relent, seclet),
+ CONST arelent *relent AND
+ CONST struct bfd_seclet *seclet)
+{
+ asymbol *symbol = *(relent->sym_ptr_ptr);
+ fprintf(stderr, "bfd error relocating, symbol %s is undefined\n",
+ symbol->name);
+ exit(1);
+}
+/*ARGSUSED*/
+static
+void
+DEFUN(bfd_reloc_value_truncated,(relent, seclet),
+ CONST arelent *relent AND
+ struct bfd_seclet *seclet)
+{
+ fprintf(stderr, "bfd error relocating, value truncated\n");
+ exit(1);
+}
+/*ARGSUSED*/
+static
+void
+DEFUN(bfd_reloc_is_dangerous,(relent, seclet),
+ CONST arelent *relent AND
+ CONST struct bfd_seclet *seclet)
+{
+ fprintf(stderr, "bfd error relocating, dangerous\n");
+ exit(1);
+}
+
+bfd_error_vector_type bfd_error_vector =
+ {
+ bfd_nonrepresentable_section ,
+ bfd_undefined_symbol,
+ bfd_reloc_value_truncated,
+ bfd_reloc_is_dangerous,
+ };
+
+
+CONST char *
+bfd_errmsg (error_tag)
+ bfd_ec error_tag;
+{
+#ifndef errno
+ extern int errno;
+#endif
+ if (error_tag == system_call_error)
+ return strerror (errno);
+
+ if ((((int)error_tag <(int) no_error) ||
+ ((int)error_tag > (int)invalid_error_code)))
+ error_tag = invalid_error_code;/* sanity check */
+
+ return bfd_errmsgs [(int)error_tag];
+}
+
+void
+DEFUN (bfd_default_error_trap, (error_tag),
+ bfd_ec error_tag)
+{
+ fprintf(stderr, "bfd assert fail (%s)\n", bfd_errmsg(error_tag));
+}
+
+void (*bfd_error_trap) PARAMS ((bfd_ec)) = bfd_default_error_trap;
+void (*bfd_error_nonrepresentabltrap) PARAMS ((bfd_ec)) = bfd_default_error_trap;
+
+void
+DEFUN(bfd_perror,(message),
+ CONST char *message)
+{
+ if (bfd_error == system_call_error)
+ perror((char *)message); /* must be system error then... */
+ else {
+ if (message == NULL || *message == '\0')
+ fprintf (stderr, "%s\n", bfd_errmsg (bfd_error));
+ else
+ fprintf (stderr, "%s: %s\n", message, bfd_errmsg (bfd_error));
+ }
+}
+
+
+/** Symbols */
+
+
+/*
+FUNCTION
+ bfd_get_reloc_upper_bound
+
+SYNOPSIS
+ unsigned int bfd_get_reloc_upper_bound(bfd *abfd, asection *sect);
+
+DESCRIPTION
+ This function return the number of bytes required to store the
+ relocation information associated with section <<sect>>
+ attached to bfd <<abfd>>
+
+*/
+
+
+unsigned int
+DEFUN(bfd_get_reloc_upper_bound,(abfd, asect),
+ bfd *abfd AND
+ sec_ptr asect)
+{
+ if (abfd->format != bfd_object) {
+ bfd_error = invalid_operation;
+ return 0;
+ }
+
+ return BFD_SEND (abfd, _get_reloc_upper_bound, (abfd, asect));
+}
+
+/*
+FUNCTION
+ bfd_canonicalize_reloc
+
+SYNOPSIS
+ unsigned int bfd_canonicalize_reloc
+ (bfd *abfd,
+ asection *sec,
+ arelent **loc,
+ asymbol **syms);
+
+DESCRIPTION
+ This function calls the back end associated with the open
+ <<abfd>> and translates the external form of the relocation
+ information attached to <<sec>> into the internal canonical
+ form. The table is placed into memory at <<loc>>, which has
+ been preallocated, usually by a call to
+ <<bfd_get_reloc_upper_bound>>.
+
+ The <<syms>> table is also needed for horrible internal magic
+ reasons.
+
+
+*/
+unsigned int
+DEFUN(bfd_canonicalize_reloc,(abfd, asect, location, symbols),
+ bfd *abfd AND
+ sec_ptr asect AND
+ arelent **location AND
+ asymbol **symbols)
+{
+ if (abfd->format != bfd_object) {
+ bfd_error = invalid_operation;
+ return 0;
+ }
+ return BFD_SEND (abfd, _bfd_canonicalize_reloc,
+ (abfd, asect, location, symbols));
+ }
+
+
+/*
+FUNCTION
+ bfd_set_file_flags
+
+SYNOPSIS
+ boolean bfd_set_file_flags(bfd *abfd, flagword flags);
+
+DESCRIPTION
+ This function attempts to set the flag word in the referenced
+ BFD structure to the value supplied.
+
+ Possible errors are:
+ o wrong_format - The target bfd was not of object format.
+ o invalid_operation - The target bfd was open for reading.
+ o invalid_operation -
+ The flag word contained a bit which was not applicable to the
+ type of file. eg, an attempt was made to set the D_PAGED bit
+ on a bfd format which does not support demand paging
+
+*/
+
+boolean
+bfd_set_file_flags (abfd, flags)
+ bfd *abfd;
+ flagword flags;
+{
+ if (abfd->format != bfd_object) {
+ bfd_error = wrong_format;
+ return false;
+ }
+
+ if (bfd_read_p (abfd)) {
+ bfd_error = invalid_operation;
+ return false;
+ }
+
+ bfd_get_file_flags (abfd) = flags;
+ if ((flags & bfd_applicable_file_flags (abfd)) != flags) {
+ bfd_error = invalid_operation;
+ return false;
+ }
+
+return true;
+}
+
+/*
+FUNCTION
+ bfd_set_reloc
+
+SYNOPSIS
+ void bfd_set_reloc
+ (bfd *abfd, asection *sec, arelent **rel, unsigned int count)
+
+DESCRIPTION
+ This function sets the relocation pointer and count within a
+ section to the supplied values.
+
+*/
+/*ARGSUSED*/
+void
+bfd_set_reloc (ignore_abfd, asect, location, count)
+ bfd *ignore_abfd;
+ sec_ptr asect;
+ arelent **location;
+ unsigned int count;
+{
+ asect->orelocation = location;
+ asect->reloc_count = count;
+}
+
+void
+bfd_assert(file, line)
+char *file;
+int line;
+{
+ fprintf(stderr, "bfd assertion fail %s:%d\n",file,line);
+}
+
+
+/*
+FUNCTION
+ bfd_set_start_address
+
+DESCRIPTION
+ Marks the entry point of an output BFD.
+
+RETURNS
+ Returns <<true>> on success, <<false>> otherwise.
+
+SYNOPSIS
+ boolean bfd_set_start_address(bfd *, bfd_vma);
+*/
+
+boolean
+bfd_set_start_address(abfd, vma)
+bfd *abfd;
+bfd_vma vma;
+{
+ abfd->start_address = vma;
+ return true;
+}
+
+
+/*
+FUNCTION
+ The bfd_get_mtime function
+
+SYNOPSIS
+ long bfd_get_mtime(bfd *);
+
+DESCRIPTION
+ Return file modification time (as read from file system, or
+ from archive header for archive members).
+
+*/
+
+long
+bfd_get_mtime (abfd)
+ bfd *abfd;
+{
+ FILE *fp;
+ struct stat buf;
+
+ if (abfd->mtime_set)
+ return abfd->mtime;
+
+ fp = bfd_cache_lookup (abfd);
+ if (0 != fstat (fileno (fp), &buf))
+ return 0;
+
+ abfd->mtime = buf.st_mtime; /* Save value in case anyone wants it */
+ return buf.st_mtime;
+}
+
+/*
+FUNCTION
+ The bfd_get_size function
+
+SYNOPSIS
+ long bfd_get_size(bfd *);
+
+DESCRIPTION
+ Return file size (as read from file system) for the file
+ associated with a bfd.
+
+ Note that the initial motivation for, and use of, this routine is not
+ so we can get the exact size of the object the bfd applies to, since
+ that might not be generally possible (archive members for example?).
+ Although it would be ideal if someone could eventually modify
+ it so that such results were guaranteed.
+
+ Instead, we want to ask questions like "is this NNN byte sized
+ object I'm about to try read from file offset YYY reasonable?"
+ As as example of where we might want to do this, some object formats
+ use string tables for which the first sizeof(long) bytes of the table
+ contain the size of the table itself, including the size bytes.
+ If an application tries to read what it thinks is one of these
+ string tables, without some way to validate the size, and for
+ some reason the size is wrong (byte swapping error, wrong location
+ for the string table, etc), the only clue is likely to be a read
+ error when it tries to read the table, or a "virtual memory
+ exhausted" error when it tries to allocated 15 bazillon bytes
+ of space for the 15 bazillon byte table it is about to read.
+ This function at least allows us to answer the quesion, "is the
+ size reasonable?".
+*/
+
+long
+bfd_get_size (abfd)
+ bfd *abfd;
+{
+ FILE *fp;
+ struct stat buf;
+
+ fp = bfd_cache_lookup (abfd);
+ if (0 != fstat (fileno (fp), &buf))
+ return 0;
+
+ return buf.st_size;
+}
+
+/*
+FUNCTION
+ The bfd_get_gp_size function
+
+SYNOPSIS
+ int bfd_get_gp_size(bfd *);
+
+DESCRIPTION
+ Get the maximum size of objects to be optimized using the GP
+ register under MIPS ECOFF. This is typically set by the -G
+ argument to the compiler, assembler or linker.
+*/
+
+int
+bfd_get_gp_size (abfd)
+ bfd *abfd;
+{
+ if (abfd->xvec->flavour == bfd_target_ecoff_flavour)
+ return ecoff_data (abfd)->gp_size;
+ return 0;
+}
+
+/*
+FUNCTION
+ The bfd_set_gp_size function
+
+SYNOPSIS
+ void bfd_set_gp_size(bfd *, int);
+
+DESCRIPTION
+ Set the maximum size of objects to be optimized using the GP
+ register under ECOFF or MIPS ELF. This is typically set by
+ the -G argument to the compiler, assembler or linker.
+*/
+
+void
+bfd_set_gp_size (abfd, i)
+ bfd *abfd;
+ int i;
+{
+ if (abfd->xvec->flavour == bfd_target_ecoff_flavour)
+ ecoff_data (abfd)->gp_size = i;
+ else if (abfd->xvec->flavour == bfd_target_elf_flavour)
+ elf_gp_size (abfd) = i;
+}
+
+/*
+FUNCTION
+ bfd_scan_vma
+
+DESCRIPTION
+ Converts, like strtoul, a numerical expression as a
+ string into a bfd_vma integer, and returns that integer.
+ (Though without as many bells and whistles as strtoul.)
+ The expression is assumed to be unsigned (i.e. positive).
+ If given a base, it is used as the base for conversion.
+ A base of 0 causes the function to interpret the string
+ in hex if a leading "0x" or "0X" is found, otherwise
+ in octal if a leading zero is found, otherwise in decimal.
+
+ Overflow is not detected.
+
+SYNOPSIS
+ bfd_vma bfd_scan_vma(CONST char *string, CONST char **end, int base);
+*/
+
+bfd_vma
+DEFUN(bfd_scan_vma,(string, end, base),
+ CONST char *string AND
+ CONST char **end AND
+ int base)
+{
+ bfd_vma value;
+ int digit;
+
+ /* Let the host do it if possible. */
+ if (sizeof(bfd_vma) <= sizeof(unsigned long))
+ return (bfd_vma) strtoul (string, 0, base);
+
+ /* A negative base makes no sense, and we only need to go as high as hex. */
+ if ((base < 0) || (base > 16))
+ return (bfd_vma) 0;
+
+ if (base == 0)
+ {
+ if (string[0] == '0')
+ {
+ if ((string[1] == 'x') || (string[1] == 'X'))
+ base = 16;
+ /* XXX should we also allow "0b" or "0B" to set base to 2? */
+ else
+ base = 8;
+ }
+ else
+ base = 10;
+ }
+ if ((base == 16) &&
+ (string[0] == '0') && ((string[1] == 'x') || (string[1] == 'X')))
+ string += 2;
+ /* XXX should we also skip over "0b" or "0B" if base is 2? */
+
+/* Speed could be improved with a table like hex_value[] in gas. */
+#define HEX_VALUE(c) \
+ (isxdigit(c) ? \
+ (isdigit(c) ? \
+ (c - '0') : \
+ (10 + c - (islower(c) ? 'a' : 'A'))) : \
+ 42)
+
+ for (value = 0; (digit = HEX_VALUE(*string)) < base; string++)
+ {
+ value = value * base + digit;
+ }
+
+ if (end)
+ *end = string;
+
+ return value;
+}
+
+/*
+FUNCTION
+ stuff
+
+DESCRIPTION
+ stuff which should be documented
+
+.#define bfd_sizeof_headers(abfd, reloc) \
+. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
+.
+.#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
+. BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))
+.
+. {* Do these three do anything useful at all, for any back end? *}
+.#define bfd_debug_info_start(abfd) \
+. BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
+.
+.#define bfd_debug_info_end(abfd) \
+. BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
+.
+.#define bfd_debug_info_accumulate(abfd, section) \
+. BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
+.
+.
+.#define bfd_stat_arch_elt(abfd, stat) \
+. BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
+.
+.#define bfd_set_arch_mach(abfd, arch, mach)\
+. BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
+.
+.#define bfd_get_relocated_section_contents(abfd, seclet, data, relocateable) \
+. BFD_SEND (abfd, _bfd_get_relocated_section_contents, (abfd, seclet, data, relocateable))
+.
+.#define bfd_relax_section(abfd, section, symbols) \
+. BFD_SEND (abfd, _bfd_relax_section, (abfd, section, symbols))
+.
+.#define bfd_seclet_link(abfd, data, relocateable) \
+. BFD_SEND (abfd, _bfd_seclet_link, (abfd, data, relocateable))
+
+*/
diff --git a/gnu/usr.bin/gdb/bfd/bfd.h b/gnu/usr.bin/gdb/bfd/bfd.h
new file mode 100644
index 000000000000..fbe0f0f36ba4
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/bfd.h
@@ -0,0 +1,1803 @@
+/* Main header file for the bfd library -- portable access to object files.
+ Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Contributed by Cygnus Support.
+
+** NOTE: bfd.h and bfd-in2.h are GENERATED files. Don't change them;
+** instead, change bfd-in.h or the other BFD source files processed to
+** generate these files.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You 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. */
+
+/* bfd.h -- The only header file required by users of the bfd library
+
+The bfd.h file is generated from bfd-in.h and various .c files; if you
+change it, your changes will probably be lost.
+
+All the prototypes and definitions following the comment "THE FOLLOWING
+IS EXTRACTED FROM THE SOURCE" are extracted from the source files for
+BFD. If you change it, someone oneday will extract it from the source
+again, and your changes will be lost. To save yourself from this bind,
+change the definitions in the source in the bfd directory. Type "make
+docs" and then "make headers" in that directory, and magically this file
+will change to reflect your changes.
+
+If you don't have the tools to perform the extraction, then you are
+safe from someone on your system trampling over your header files.
+You should still maintain the equivalence between the source and this
+file though; every change you make to the .c file should be reflected
+here. */
+
+#ifndef __BFD_H_SEEN__
+#define __BFD_H_SEEN__
+
+#include "ansidecl.h"
+#include "obstack.h"
+
+#define BFD_VERSION "2.2"
+
+#define BFD_ARCH_SIZE 32
+
+#if BFD_ARCH_SIZE >= 64
+#define BFD64
+#endif
+
+#ifndef INLINE
+#if __GNUC__ >= 2
+#define INLINE __inline__
+#else
+#define INLINE
+#endif
+#endif
+
+/* 64-bit type definition (if any) from bfd's sysdep.h goes here */
+
+
+/* forward declaration */
+typedef struct _bfd bfd;
+
+/* To squelch erroneous compiler warnings ("illegal pointer
+ combination") from the SVR3 compiler, we would like to typedef
+ boolean to int (it doesn't like functions which return boolean.
+ Making sure they are never implicitly declared to return int
+ doesn't seem to help). But this file is not configured based on
+ the host. */
+/* General rules: functions which are boolean return true on success
+ and false on failure (unless they're a predicate). -- bfd.doc */
+/* I'm sure this is going to break something and someone is going to
+ force me to change it. */
+/* typedef enum boolean {false, true} boolean; */
+/* Yup, SVR4 has a "typedef enum boolean" in <sys/types.h> -fnf */
+typedef enum bfd_boolean {false, true} boolean;
+
+/* A pointer to a position in a file. */
+/* FIXME: This should be using off_t from <sys/types.h>.
+ For now, try to avoid breaking stuff by not including <sys/types.h> here.
+ This will break on systems with 64-bit file offsets (e.g. 4.4BSD).
+ Probably the best long-term answer is to avoid using file_ptr AND off_t
+ in this header file, and to handle this in the BFD implementation
+ rather than in its interface. */
+/* typedef off_t file_ptr; */
+typedef long int file_ptr;
+
+/* Support for different sizes of target format ints and addresses. If the
+ host implements 64-bit values, it defines HOST_64_BIT to be the appropriate
+ type. Otherwise, this code will fall back on gcc's "long long" type if gcc
+ is being used. HOST_64_BIT must be defined in such a way as to be a valid
+ type name by itself or with "unsigned" prefixed. It should be a signed
+ type by itself.
+
+ If neither is the case, then compilation will fail if 64-bit targets are
+ requested. If you don't request any 64-bit targets, you should be safe. */
+
+#ifdef BFD64
+
+#if defined (__GNUC__) && !defined (HOST_64_BIT)
+#define HOST_64_BIT long long
+typedef HOST_64_BIT int64_type;
+typedef unsigned HOST_64_BIT uint64_type;
+#endif
+
+#if !defined (uint64_type) && defined (__GNUC__)
+#define uint64_type unsigned long long
+#define int64_type long long
+#define uint64_typeLOW(x) (unsigned long)(((x) & 0xffffffff))
+#define uint64_typeHIGH(x) (unsigned long)(((x) >> 32) & 0xffffffff)
+#endif
+
+typedef unsigned HOST_64_BIT bfd_vma;
+typedef HOST_64_BIT bfd_signed_vma;
+typedef unsigned HOST_64_BIT bfd_size_type;
+typedef unsigned HOST_64_BIT symvalue;
+#define fprintf_vma(s,x) \
+ fprintf(s,"%08x%08x", uint64_typeHIGH(x), uint64_typeLOW(x))
+#define sprintf_vma(s,x) \
+ sprintf(s,"%08x%08x", uint64_typeHIGH(x), uint64_typeLOW(x))
+#else /* not BFD64 */
+
+/* Represent a target address. Also used as a generic unsigned type
+ which is guaranteed to be big enough to hold any arithmetic types
+ we need to deal with. */
+typedef unsigned long bfd_vma;
+
+/* A generic signed type which is guaranteed to be big enough to hold any
+ arithmetic types we need to deal with. Can be assumed to be compatible
+ with bfd_vma in the same way that signed and unsigned ints are compatible
+ (as parameters, in assignment, etc). */
+typedef long bfd_signed_vma;
+
+typedef unsigned long symvalue;
+typedef unsigned long bfd_size_type;
+
+/* Print a bfd_vma x on stream s. */
+#define fprintf_vma(s,x) fprintf(s, "%08lx", x)
+#define sprintf_vma(s,x) sprintf(s, "%08lx", x)
+#endif /* not BFD64 */
+#define printf_vma(x) fprintf_vma(stdout,x)
+
+typedef unsigned int flagword; /* 32 bits of flags */
+
+/** File formats */
+
+typedef enum bfd_format {
+ bfd_unknown = 0, /* file format is unknown */
+ bfd_object, /* linker/assember/compiler output */
+ bfd_archive, /* object archive file */
+ bfd_core, /* core dump */
+ bfd_type_end} /* marks the end; don't use it! */
+ bfd_format;
+
+/* Object file flag values */
+#define NO_FLAGS 0x00
+#define HAS_RELOC 0x01
+#define EXEC_P 0x02
+#define HAS_LINENO 0x04
+#define HAS_DEBUG 0x08
+#define HAS_SYMS 0x10
+#define HAS_LOCALS 0x20
+#define DYNAMIC 0x40
+#define WP_TEXT 0x80
+#define D_PAGED 0x100
+#define BFD_IS_RELAXABLE 0x200
+
+/* symbols and relocation */
+
+typedef unsigned long symindex;
+
+#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
+
+typedef enum bfd_symclass {
+ bfd_symclass_unknown = 0,
+ bfd_symclass_fcommon, /* fortran common symbols */
+ bfd_symclass_global, /* global symbol, what a surprise */
+ bfd_symclass_debugger, /* some debugger symbol */
+ bfd_symclass_undefined /* none known */
+ } symclass;
+
+
+/* general purpose part of a symbol;
+ target specific parts will be found in libcoff.h, liba.out.h etc */
+
+
+#define bfd_get_section(x) ((x)->section)
+#define bfd_get_output_section(x) ((x)->section->output_section)
+#define bfd_set_section(x,y) ((x)->section) = (y)
+#define bfd_asymbol_base(x) ((x)->section->vma)
+#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
+#define bfd_asymbol_name(x) ((x)->name)
+/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
+#define bfd_asymbol_bfd(x) ((x)->the_bfd)
+#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)
+
+/* This is a type pun with struct ranlib on purpose! */
+typedef struct carsym {
+ char *name;
+ file_ptr file_offset; /* look here to find the file */
+} carsym; /* to make these you call a carsymogen */
+
+
+/* Used in generating armaps. Perhaps just a forward definition would do? */
+struct orl { /* output ranlib */
+ char **name; /* symbol name */
+ file_ptr pos; /* bfd* or file position */
+ int namidx; /* index into string table */
+};
+
+
+
+/* Linenumber stuff */
+typedef struct lineno_cache_entry {
+ unsigned int line_number; /* Linenumber from start of function*/
+ union {
+ struct symbol_cache_entry *sym; /* Function name */
+ unsigned long offset; /* Offset into section */
+ } u;
+} alent;
+
+/* object and core file sections */
+
+
+#define align_power(addr, align) \
+ ( ((addr) + ((1<<(align))-1)) & (-1 << (align)))
+
+typedef struct sec *sec_ptr;
+
+#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
+#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
+#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
+#define bfd_section_name(bfd, ptr) ((ptr)->name)
+#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
+#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
+#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
+#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
+#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
+
+#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+
+#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma= (val)), ((ptr)->user_set_vma = true), true)
+#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true)
+#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true)
+
+typedef struct stat stat_type;
+
+/** Error handling */
+
+typedef enum bfd_error {
+ no_error = 0, system_call_error, invalid_target,
+ wrong_format, invalid_operation, no_memory,
+ no_symbols, no_relocation_info,
+ no_more_archived_files, malformed_archive,
+ symbol_not_found, file_not_recognized,
+ file_ambiguously_recognized, no_contents,
+ bfd_error_nonrepresentable_section,
+ no_debug_section, bad_value,
+
+ /* An input file is shorter than expected. */
+ file_truncated,
+
+ invalid_error_code} bfd_ec;
+
+extern bfd_ec bfd_error;
+struct reloc_cache_entry;
+struct bfd_seclet;
+
+
+typedef struct bfd_error_vector {
+ void (* nonrepresentable_section ) PARAMS ((CONST bfd *CONST abfd,
+ CONST char *CONST name));
+ void (* undefined_symbol) PARAMS ((CONST struct reloc_cache_entry *rel,
+ CONST struct bfd_seclet *sec));
+ void (* reloc_value_truncated) PARAMS ((CONST struct
+ reloc_cache_entry *rel,
+ struct bfd_seclet *sec));
+
+ void (* reloc_dangerous) PARAMS ((CONST struct reloc_cache_entry *rel,
+ CONST struct bfd_seclet *sec));
+
+} bfd_error_vector_type;
+
+CONST char *bfd_errmsg PARAMS ((bfd_ec error_tag));
+void bfd_perror PARAMS ((CONST char *message));
+
+
+typedef enum bfd_print_symbol
+{
+ bfd_print_symbol_name,
+ bfd_print_symbol_more,
+ bfd_print_symbol_all
+} bfd_print_symbol_type;
+
+
+/* Information about a symbol that nm needs. */
+
+typedef struct _symbol_info
+{
+ symvalue value;
+ char type; /* */
+ CONST char *name; /* Symbol name. */
+ char stab_other; /* Unused. */
+ short stab_desc; /* Info for N_TYPE. */
+ CONST char *stab_name;
+} symbol_info;
+
+/* The code that implements targets can initialize a jump table with this
+ macro. It must name all its routines the same way (a prefix plus
+ the standard routine suffix), or it must #define the routines that
+ are not so named, before calling JUMP_TABLE in the initializer. */
+
+/* Semi-portable string concatenation in cpp.
+ The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors.
+ The problem is, "32_" is not a valid preprocessing token, and we don't
+ want extra underscores (e.g., "nlm_32_"). The XCAT2 macro will cause the
+ inner CAT macros to be evaluated first, producing still-valid pp-tokens.
+ Then the final concatenation can be done. (Sigh.) */
+#ifndef CAT
+#ifdef SABER
+#define CAT(a,b) a##b
+#define CAT3(a,b,c) a##b##c
+#define CAT4(a,b,c,d) a##b##c##d
+#else
+#ifdef __STDC__
+#define CAT(a,b) a##b
+#define CAT3(a,b,c) a##b##c
+#define XCAT2(a,b) CAT(a,b)
+#define CAT4(a,b,c,d) XCAT2(CAT(a,b),CAT(c,d))
+#else
+#define CAT(a,b) a/**/b
+#define CAT3(a,b,c) a/**/b/**/c
+#define CAT4(a,b,c,d) a/**/b/**/c/**/d
+#endif
+#endif
+#endif
+
+#define JUMP_TABLE(NAME)\
+CAT(NAME,_core_file_failing_command),\
+CAT(NAME,_core_file_failing_signal),\
+CAT(NAME,_core_file_matches_executable_p),\
+CAT(NAME,_slurp_armap),\
+CAT(NAME,_slurp_extended_name_table),\
+CAT(NAME,_truncate_arname),\
+CAT(NAME,_write_armap),\
+CAT(NAME,_close_and_cleanup),\
+CAT(NAME,_set_section_contents),\
+CAT(NAME,_get_section_contents),\
+CAT(NAME,_new_section_hook),\
+CAT(NAME,_get_symtab_upper_bound),\
+CAT(NAME,_get_symtab),\
+CAT(NAME,_get_reloc_upper_bound),\
+CAT(NAME,_canonicalize_reloc),\
+CAT(NAME,_make_empty_symbol),\
+CAT(NAME,_print_symbol),\
+CAT(NAME,_get_symbol_info),\
+CAT(NAME,_get_lineno),\
+CAT(NAME,_set_arch_mach),\
+CAT(NAME,_openr_next_archived_file),\
+CAT(NAME,_find_nearest_line),\
+CAT(NAME,_generic_stat_arch_elt),\
+CAT(NAME,_sizeof_headers),\
+CAT(NAME,_bfd_debug_info_start),\
+CAT(NAME,_bfd_debug_info_end),\
+CAT(NAME,_bfd_debug_info_accumulate),\
+CAT(NAME,_bfd_get_relocated_section_contents),\
+CAT(NAME,_bfd_relax_section),\
+CAT(NAME,_bfd_seclet_link),\
+CAT(NAME,_bfd_reloc_type_lookup),\
+CAT(NAME,_bfd_make_debug_symbol)
+
+#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
+
+
+/* User program access to BFD facilities */
+
+/* Cast from const char * to char * so that caller can assign to
+ a char * without a warning. */
+#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
+#define bfd_get_format(abfd) ((abfd)->format)
+#define bfd_get_target(abfd) ((abfd)->xvec->name)
+#define bfd_get_file_flags(abfd) ((abfd)->flags)
+#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
+#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
+#define bfd_my_archive(abfd) ((abfd)->my_archive)
+#define bfd_has_map(abfd) ((abfd)->has_armap)
+
+#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
+#define bfd_usrdata(abfd) ((abfd)->usrdata)
+
+#define bfd_get_start_address(abfd) ((abfd)->start_address)
+#define bfd_get_symcount(abfd) ((abfd)->symcount)
+#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
+#define bfd_count_sections(abfd) ((abfd)->section_count)
+
+#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+
+/* Byte swapping routines. */
+
+bfd_vma bfd_getb64 PARAMS ((unsigned char *));
+bfd_vma bfd_getl64 PARAMS ((unsigned char *));
+bfd_signed_vma bfd_getb_signed_64 PARAMS ((unsigned char *));
+bfd_signed_vma bfd_getl_signed_64 PARAMS ((unsigned char *));
+bfd_vma bfd_getb32 PARAMS ((unsigned char *));
+bfd_vma bfd_getl32 PARAMS ((unsigned char *));
+bfd_signed_vma bfd_getb_signed_32 PARAMS ((unsigned char *));
+bfd_signed_vma bfd_getl_signed_32 PARAMS ((unsigned char *));
+bfd_vma bfd_getb16 PARAMS ((unsigned char *));
+bfd_vma bfd_getl16 PARAMS ((unsigned char *));
+bfd_signed_vma bfd_getb_signed_16 PARAMS ((unsigned char *));
+bfd_signed_vma bfd_getl_signed_16 PARAMS ((unsigned char *));
+void bfd_putb64 PARAMS ((bfd_vma, unsigned char *));
+void bfd_putl64 PARAMS ((bfd_vma, unsigned char *));
+void bfd_putb32 PARAMS ((bfd_vma, unsigned char *));
+void bfd_putl32 PARAMS ((bfd_vma, unsigned char *));
+void bfd_putb16 PARAMS ((bfd_vma, unsigned char *));
+void bfd_putl16 PARAMS ((bfd_vma, unsigned char *));
+
+/* And more from the source. */
+void
+bfd_init PARAMS ((void));
+
+bfd *
+bfd_openr PARAMS ((CONST char *filename, CONST char*target));
+
+bfd *
+bfd_fdopenr PARAMS ((CONST char *filename, CONST char *target, int fd));
+
+bfd *
+bfd_openw PARAMS ((CONST char *filename, CONST char *target));
+
+boolean
+bfd_close PARAMS ((bfd *));
+
+boolean
+bfd_close_all_done PARAMS ((bfd *));
+
+bfd_size_type
+bfd_alloc_size PARAMS ((bfd *abfd));
+
+bfd *
+bfd_create PARAMS ((CONST char *filename, bfd *templ));
+
+
+ /* Byte swapping macros for user section data. */
+
+#define bfd_put_8(abfd, val, ptr) \
+ (*((unsigned char *)(ptr)) = (unsigned char)val)
+#define bfd_put_signed_8 \
+ bfd_put_8
+#define bfd_get_8(abfd, ptr) \
+ (*(unsigned char *)(ptr))
+#define bfd_get_signed_8(abfd, ptr) \
+ ((*(unsigned char *)(ptr) ^ 0x80) - 0x80)
+
+#define bfd_put_16(abfd, val, ptr) \
+ BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
+#define bfd_put_signed_16 \
+ bfd_put_16
+#define bfd_get_16(abfd, ptr) \
+ BFD_SEND(abfd, bfd_getx16, (ptr))
+#define bfd_get_signed_16(abfd, ptr) \
+ BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
+
+#define bfd_put_32(abfd, val, ptr) \
+ BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))
+#define bfd_put_signed_32 \
+ bfd_put_32
+#define bfd_get_32(abfd, ptr) \
+ BFD_SEND(abfd, bfd_getx32, (ptr))
+#define bfd_get_signed_32(abfd, ptr) \
+ BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
+
+#define bfd_put_64(abfd, val, ptr) \
+ BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))
+#define bfd_put_signed_64 \
+ bfd_put_64
+#define bfd_get_64(abfd, ptr) \
+ BFD_SEND(abfd, bfd_getx64, (ptr))
+#define bfd_get_signed_64(abfd, ptr) \
+ BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
+
+
+ /* Byte swapping macros for file header data. */
+
+#define bfd_h_put_8(abfd, val, ptr) \
+ bfd_put_8 (abfd, val, ptr)
+#define bfd_h_put_signed_8(abfd, val, ptr) \
+ bfd_put_8 (abfd, val, ptr)
+#define bfd_h_get_8(abfd, ptr) \
+ bfd_get_8 (abfd, ptr)
+#define bfd_h_get_signed_8(abfd, ptr) \
+ bfd_get_signed_8 (abfd, ptr)
+
+#define bfd_h_put_16(abfd, val, ptr) \
+ BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
+#define bfd_h_put_signed_16 \
+ bfd_h_put_16
+#define bfd_h_get_16(abfd, ptr) \
+ BFD_SEND(abfd, bfd_h_getx16,(ptr))
+#define bfd_h_get_signed_16(abfd, ptr) \
+ BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))
+
+#define bfd_h_put_32(abfd, val, ptr) \
+ BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
+#define bfd_h_put_signed_32 \
+ bfd_h_put_32
+#define bfd_h_get_32(abfd, ptr) \
+ BFD_SEND(abfd, bfd_h_getx32,(ptr))
+#define bfd_h_get_signed_32(abfd, ptr) \
+ BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))
+
+#define bfd_h_put_64(abfd, val, ptr) \
+ BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
+#define bfd_h_put_signed_64 \
+ bfd_h_put_64
+#define bfd_h_get_64(abfd, ptr) \
+ BFD_SEND(abfd, bfd_h_getx64,(ptr))
+#define bfd_h_get_signed_64(abfd, ptr) \
+ BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
+
+typedef struct sec
+{
+ /* The name of the section, the name isn't a copy, the pointer is
+ the same as that passed to bfd_make_section. */
+
+ CONST char *name;
+
+ /* Which section is it 0.nth */
+
+ int index;
+
+ /* The next section in the list belonging to the BFD, or NULL. */
+
+ struct sec *next;
+
+ /* The field flags contains attributes of the section. Some of
+ flags are read in from the object file, and some are
+ synthesized from other information. */
+
+ flagword flags;
+
+#define SEC_NO_FLAGS 0x000
+
+ /* Tells the OS to allocate space for this section when loaded.
+ This would clear for a section containing debug information
+ only. */
+#define SEC_ALLOC 0x001
+
+ /* Tells the OS to load the section from the file when loading.
+ This would be clear for a .bss section */
+#define SEC_LOAD 0x002
+
+ /* The section contains data still to be relocated, so there will
+ be some relocation information too. */
+#define SEC_RELOC 0x004
+
+#if 0 /* Obsolete ? */
+#define SEC_BALIGN 0x008
+#endif
+
+ /* A signal to the OS that the section contains read only
+ data. */
+#define SEC_READONLY 0x010
+
+ /* The section contains code only. */
+#define SEC_CODE 0x020
+
+ /* The section contains data only. */
+#define SEC_DATA 0x040
+
+ /* The section will reside in ROM. */
+#define SEC_ROM 0x080
+
+ /* The section contains constructor information. This section
+ type is used by the linker to create lists of constructors and
+ destructors used by <<g++>>. When a back end sees a symbol
+ which should be used in a constructor list, it creates a new
+ section for the type of name (eg <<__CTOR_LIST__>>), attaches
+ the symbol to it and builds a relocation. To build the lists
+ of constructors, all the linker has to do is catenate all the
+ sections called <<__CTOR_LIST__>> and relocte the data
+ contained within - exactly the operations it would peform on
+ standard data. */
+#define SEC_CONSTRUCTOR 0x100
+
+ /* The section is a constuctor, and should be placed at the
+ end of the text, data, or bss section(?). */
+#define SEC_CONSTRUCTOR_TEXT 0x1100
+#define SEC_CONSTRUCTOR_DATA 0x2100
+#define SEC_CONSTRUCTOR_BSS 0x3100
+
+ /* The section has contents - a data section could be
+ <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>, a debug section could be
+ <<SEC_HAS_CONTENTS>> */
+#define SEC_HAS_CONTENTS 0x200
+
+ /* An instruction to the linker not to output sections
+ containing this flag even if they have information which
+ would normally be written. */
+#define SEC_NEVER_LOAD 0x400
+
+ /* The section is a shared library section. The linker must leave
+ these completely alone, as the vma and size are used when
+ the executable is loaded. */
+#define SEC_SHARED_LIBRARY 0x800
+
+ /* The section is a common section (symbols may be defined
+ multiple times, the value of a symbol is the amount of
+ space it requires, and the largest symbol value is the one
+ used). Most targets have exactly one of these (which we
+ translate to bfd_com_section), but ECOFF has two. */
+#define SEC_IS_COMMON 0x8000
+
+ /* The section contains only debugging information. For
+ example, this is set for ELF .debug and .stab sections.
+ strip tests this flag to see if a section can be
+ discarded. */
+#define SEC_DEBUGGING 0x10000
+
+ /* End of section flags. */
+
+ /* The virtual memory address of the section - where it will be
+ at run time. The symbols are relocated against this. The
+ user_set_vma flag is maintained by bfd; if it's not set, the
+ backend can assign addresses (for example, in <<a.out>>, where
+ the default address for <<.data>> is dependent on the specific
+ target and various flags). */
+
+ bfd_vma vma;
+ boolean user_set_vma;
+
+ /* The load address of the section - where it would be in a
+ rom image, really only used for writing section header
+ information. */
+
+ bfd_vma lma;
+
+ /* The size of the section in bytes, as it will be output.
+ contains a value even if the section has no contents (eg, the
+ size of <<.bss>>). This will be filled in after relocation */
+
+ bfd_size_type _cooked_size;
+
+ /* The size on disk of the section in bytes originally. Normally this
+ value is the same as the size, but if some relaxing has
+ been done, then this value will be bigger. */
+
+ bfd_size_type _raw_size;
+
+ /* If this section is going to be output, then this value is the
+ offset into the output section of the first byte in the input
+ section. Eg, if this was going to start at the 100th byte in
+ the output section, this value would be 100. */
+
+ bfd_vma output_offset;
+
+ /* The output section through which to map on output. */
+
+ struct sec *output_section;
+
+ /* The alignment requirement of the section, as an exponent - eg
+ 3 aligns to 2^3 (or 8) */
+
+ unsigned int alignment_power;
+
+ /* If an input section, a pointer to a vector of relocation
+ records for the data in this section. */
+
+ struct reloc_cache_entry *relocation;
+
+ /* If an output section, a pointer to a vector of pointers to
+ relocation records for the data in this section. */
+
+ struct reloc_cache_entry **orelocation;
+
+ /* The number of relocation records in one of the above */
+
+ unsigned reloc_count;
+
+ /* Information below is back end specific - and not always used
+ or updated. */
+
+ /* File position of section data */
+
+ file_ptr filepos;
+
+ /* File position of relocation info */
+
+ file_ptr rel_filepos;
+
+ /* File position of line data */
+
+ file_ptr line_filepos;
+
+ /* Pointer to data for applications */
+
+ PTR userdata;
+
+ struct lang_output_section *otheruserdata;
+
+ /* Attached line number information */
+
+ alent *lineno;
+
+ /* Number of line number records */
+
+ unsigned int lineno_count;
+
+ /* When a section is being output, this value changes as more
+ linenumbers are written out */
+
+ file_ptr moving_line_filepos;
+
+ /* what the section number is in the target world */
+
+ int target_index;
+
+ PTR used_by_bfd;
+
+ /* If this is a constructor section then here is a list of the
+ relocations created to relocate items within it. */
+
+ struct relent_chain *constructor_chain;
+
+ /* The BFD which owns the section. */
+
+ bfd *owner;
+
+ boolean reloc_done;
+ /* A symbol which points at this section only */
+ struct symbol_cache_entry *symbol;
+ struct symbol_cache_entry **symbol_ptr_ptr;
+
+ struct bfd_seclet *seclets_head;
+ struct bfd_seclet *seclets_tail;
+} asection ;
+
+
+ /* These sections are global, and are managed by BFD. The application
+ and target back end are not permitted to change the values in
+ these sections. */
+#define BFD_ABS_SECTION_NAME "*ABS*"
+#define BFD_UND_SECTION_NAME "*UND*"
+#define BFD_COM_SECTION_NAME "*COM*"
+#define BFD_IND_SECTION_NAME "*IND*"
+
+ /* the absolute section */
+extern asection bfd_abs_section;
+ /* Pointer to the undefined section */
+extern asection bfd_und_section;
+ /* Pointer to the common section */
+extern asection bfd_com_section;
+ /* Pointer to the indirect section */
+extern asection bfd_ind_section;
+
+extern struct symbol_cache_entry *bfd_abs_symbol;
+extern struct symbol_cache_entry *bfd_com_symbol;
+extern struct symbol_cache_entry *bfd_und_symbol;
+extern struct symbol_cache_entry *bfd_ind_symbol;
+#define bfd_get_section_size_before_reloc(section) \
+ (section->reloc_done ? (abort(),1): (section)->_raw_size)
+#define bfd_get_section_size_after_reloc(section) \
+ ((section->reloc_done) ? (section)->_cooked_size: (abort(),1))
+asection *
+bfd_get_section_by_name PARAMS ((bfd *abfd, CONST char *name));
+
+asection *
+bfd_make_section_old_way PARAMS ((bfd *, CONST char *name));
+
+asection *
+bfd_make_section_anyway PARAMS ((bfd *, CONST char *name));
+
+asection *
+bfd_make_section PARAMS ((bfd *, CONST char *name));
+
+boolean
+bfd_set_section_flags PARAMS ((bfd *, asection *, flagword));
+
+void
+bfd_map_over_sections PARAMS ((bfd *abfd,
+ void (*func)(bfd *abfd,
+ asection *sect,
+ PTR obj),
+ PTR obj));
+
+boolean
+bfd_set_section_size PARAMS ((bfd *, asection *, bfd_size_type val));
+
+boolean
+bfd_set_section_contents
+ PARAMS ((bfd *abfd,
+ asection *section,
+ PTR data,
+ file_ptr offset,
+ bfd_size_type count));
+
+boolean
+bfd_get_section_contents
+ PARAMS ((bfd *abfd, asection *section, PTR location,
+ file_ptr offset, bfd_size_type count));
+
+enum bfd_architecture
+{
+ bfd_arch_unknown, /* File arch not known */
+ bfd_arch_obscure, /* Arch known, not one of these */
+ bfd_arch_m68k, /* Motorola 68xxx */
+ bfd_arch_vax, /* DEC Vax */
+ bfd_arch_i960, /* Intel 960 */
+ /* The order of the following is important.
+ lower number indicates a machine type that
+ only accepts a subset of the instructions
+ available to machines with higher numbers.
+ The exception is the "ca", which is
+ incompatible with all other machines except
+ "core". */
+
+#define bfd_mach_i960_core 1
+#define bfd_mach_i960_ka_sa 2
+#define bfd_mach_i960_kb_sb 3
+#define bfd_mach_i960_mc 4
+#define bfd_mach_i960_xa 5
+#define bfd_mach_i960_ca 6
+
+ bfd_arch_a29k, /* AMD 29000 */
+ bfd_arch_sparc, /* SPARC */
+ bfd_arch_mips, /* MIPS Rxxxx */
+ bfd_arch_i386, /* Intel 386 */
+ bfd_arch_we32k, /* AT&T WE32xxx */
+ bfd_arch_tahoe, /* CCI/Harris Tahoe */
+ bfd_arch_i860, /* Intel 860 */
+ bfd_arch_romp, /* IBM ROMP PC/RT */
+ bfd_arch_alliant, /* Alliant */
+ bfd_arch_convex, /* Convex */
+ bfd_arch_m88k, /* Motorola 88xxx */
+ bfd_arch_pyramid, /* Pyramid Technology */
+ bfd_arch_h8300, /* Hitachi H8/300 */
+#define bfd_mach_h8300 1
+#define bfd_mach_h8300h 2
+ bfd_arch_rs6000, /* IBM RS/6000 */
+ bfd_arch_hppa, /* HP PA RISC */
+ bfd_arch_z8k, /* Zilog Z8000 */
+#define bfd_mach_z8001 1
+#define bfd_mach_z8002 2
+ bfd_arch_h8500, /* Hitachi H8/500 */
+ bfd_arch_sh, /* Hitachi SH */
+ bfd_arch_alpha, /* Dec Alpha */
+ bfd_arch_last
+ };
+
+typedef struct bfd_arch_info
+{
+ int bits_per_word;
+ int bits_per_address;
+ int bits_per_byte;
+ enum bfd_architecture arch;
+ long mach;
+ char *arch_name;
+ CONST char *printable_name;
+ unsigned int section_align_power;
+ /* true if this is the default machine for the architecture */
+ boolean the_default;
+ CONST struct bfd_arch_info * (*compatible)
+ PARAMS ((CONST struct bfd_arch_info *a,
+ CONST struct bfd_arch_info *b));
+
+ boolean (*scan) PARAMS ((CONST struct bfd_arch_info *, CONST char *));
+ /* How to disassemble an instruction, producing a printable
+ representation on a specified stdio stream. This isn't
+ defined for most processors at present, because of the size
+ of the additional tables it would drag in, and because gdb
+ wants to use a different interface. */
+ unsigned int (*disassemble) PARAMS ((bfd_vma addr, CONST char *data,
+ PTR stream));
+
+ struct bfd_arch_info *next;
+} bfd_arch_info_type;
+CONST char *
+bfd_printable_name PARAMS ((bfd *abfd));
+
+bfd_arch_info_type *
+bfd_scan_arch PARAMS ((CONST char *));
+
+CONST bfd_arch_info_type *
+bfd_arch_get_compatible PARAMS ((
+ CONST bfd *abfd,
+ CONST bfd *bbfd));
+
+void
+bfd_set_arch_info PARAMS ((bfd *, bfd_arch_info_type *));
+
+enum bfd_architecture
+bfd_get_arch PARAMS ((bfd *abfd));
+
+unsigned long
+bfd_get_mach PARAMS ((bfd *abfd));
+
+unsigned int
+bfd_arch_bits_per_byte PARAMS ((bfd *abfd));
+
+unsigned int
+bfd_arch_bits_per_address PARAMS ((bfd *abfd));
+
+bfd_arch_info_type *
+bfd_get_arch_info PARAMS ((bfd *));
+
+bfd_arch_info_type *
+bfd_lookup_arch
+ PARAMS ((enum bfd_architecture
+ arch,
+ long machine));
+
+CONST char *
+bfd_printable_arch_mach
+ PARAMS ((enum bfd_architecture arch, unsigned long machine));
+
+typedef enum bfd_reloc_status
+{
+ /* No errors detected */
+ bfd_reloc_ok,
+
+ /* The relocation was performed, but there was an overflow. */
+ bfd_reloc_overflow,
+
+ /* The address to relocate was not within the section supplied. */
+ bfd_reloc_outofrange,
+
+ /* Used by special functions */
+ bfd_reloc_continue,
+
+ /* Unused */
+ bfd_reloc_notsupported,
+
+ /* Unsupported relocation size requested. */
+ bfd_reloc_other,
+
+ /* The symbol to relocate against was undefined. */
+ bfd_reloc_undefined,
+
+ /* The relocation was performed, but may not be ok - presently
+ generated only when linking i960 coff files with i960 b.out
+ symbols. */
+ bfd_reloc_dangerous
+ }
+ bfd_reloc_status_type;
+
+
+typedef struct reloc_cache_entry
+{
+ /* A pointer into the canonical table of pointers */
+ struct symbol_cache_entry **sym_ptr_ptr;
+
+ /* offset in section */
+ bfd_size_type address;
+
+ /* addend for relocation value */
+ bfd_vma addend;
+
+ /* Pointer to how to perform the required relocation */
+ CONST struct reloc_howto_struct *howto;
+
+} arelent;
+enum complain_overflow
+{
+ /* Do not complain on overflow. */
+ complain_overflow_dont,
+
+ /* Complain if the bitfield overflows, whether it is considered
+ as signed or unsigned. */
+ complain_overflow_bitfield,
+
+ /* Complain if the value overflows when considered as signed
+ number. */
+ complain_overflow_signed,
+
+ /* Complain if the value overflows when considered as an
+ unsigned number. */
+ complain_overflow_unsigned
+};
+
+typedef CONST struct reloc_howto_struct
+{
+ /* The type field has mainly a documetary use - the back end can
+ to what it wants with it, though the normally the back end's
+ external idea of what a reloc number would be would be stored
+ in this field. For example, the a PC relative word relocation
+ in a coff environment would have the type 023 - because that's
+ what the outside world calls a R_PCRWORD reloc. */
+ unsigned int type;
+
+ /* The value the final relocation is shifted right by. This drops
+ unwanted data from the relocation. */
+ unsigned int rightshift;
+
+ /* The size of the item to be relocated. This is *not* a
+ power-of-two measure.
+ 0 : one byte
+ 1 : two bytes
+ 2 : four bytes
+ 3 : nothing done (unless special_function is nonzero)
+ 4 : eight bytes
+ -2 : two bytes, result should be subtracted from the
+ data instead of added
+ There is currently no trivial way to extract a "number of
+ bytes" from a howto pointer. */
+ int size;
+
+ /* The number of bits in the item to be relocated. This is used
+ when doing overflow checking. */
+ unsigned int bitsize;
+
+ /* Notes that the relocation is relative to the location in the
+ data section of the addend. The relocation function will
+ subtract from the relocation value the address of the location
+ being relocated. */
+ boolean pc_relative;
+
+ /* The bit position of the reloc value in the destination.
+ The relocated value is left shifted by this amount. */
+ unsigned int bitpos;
+
+ /* What type of overflow error should be checked for when
+ relocating. */
+ enum complain_overflow complain_on_overflow;
+
+ /* If this field is non null, then the supplied function is
+ called rather than the normal function. This allows really
+ strange relocation methods to be accomodated (e.g., i960 callj
+ instructions). */
+ bfd_reloc_status_type (*special_function)
+ PARAMS ((bfd *abfd,
+ arelent *reloc_entry,
+ struct symbol_cache_entry *symbol,
+ PTR data,
+ asection *input_section,
+ bfd *output_bfd));
+
+ /* The textual name of the relocation type. */
+ char *name;
+
+ /* When performing a partial link, some formats must modify the
+ relocations rather than the data - this flag signals this.*/
+ boolean partial_inplace;
+
+ /* The src_mask is used to select what parts of the read in data
+ are to be used in the relocation sum. E.g., if this was an 8 bit
+ bit of data which we read and relocated, this would be
+ 0x000000ff. When we have relocs which have an addend, such as
+ sun4 extended relocs, the value in the offset part of a
+ relocating field is garbage so we never use it. In this case
+ the mask would be 0x00000000. */
+ bfd_vma src_mask;
+
+ /* The dst_mask is what parts of the instruction are replaced
+ into the instruction. In most cases src_mask == dst_mask,
+ except in the above special case, where dst_mask would be
+ 0x000000ff, and src_mask would be 0x00000000. */
+ bfd_vma dst_mask;
+
+ /* When some formats create PC relative instructions, they leave
+ the value of the pc of the place being relocated in the offset
+ slot of the instruction, so that a PC relative relocation can
+ be made just by adding in an ordinary offset (e.g., sun3 a.out).
+ Some formats leave the displacement part of an instruction
+ empty (e.g., m88k bcs), this flag signals the fact.*/
+ boolean pcrel_offset;
+
+} reloc_howto_type;
+#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
+ {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
+#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
+
+#define HOWTO_PREPARE(relocation, symbol) \
+ { \
+ if (symbol != (asymbol *)NULL) { \
+ if (bfd_is_com_section (symbol->section)) { \
+ relocation = 0; \
+ } \
+ else { \
+ relocation = symbol->value; \
+ } \
+ } \
+}
+typedef unsigned char bfd_byte;
+
+typedef struct relent_chain {
+ arelent relent;
+ struct relent_chain *next;
+} arelent_chain;
+bfd_reloc_status_type
+
+bfd_perform_relocation
+ PARAMS ((bfd * abfd,
+ arelent *reloc_entry,
+ PTR data,
+ asection *input_section,
+ bfd *output_bfd));
+
+typedef enum bfd_reloc_code_real
+{
+ /* Basic absolute relocations */
+ BFD_RELOC_64,
+ BFD_RELOC_32,
+ BFD_RELOC_16,
+ BFD_RELOC_8,
+
+ /* PC-relative relocations */
+ BFD_RELOC_64_PCREL,
+ BFD_RELOC_32_PCREL,
+ BFD_RELOC_24_PCREL, /* used by i960 */
+ BFD_RELOC_16_PCREL,
+ BFD_RELOC_8_PCREL,
+
+ /* Linkage-table relative */
+ BFD_RELOC_32_BASEREL,
+ BFD_RELOC_16_BASEREL,
+ BFD_RELOC_8_BASEREL,
+
+ /* The type of reloc used to build a contructor table - at the moment
+ probably a 32 bit wide abs address, but the cpu can choose. */
+ BFD_RELOC_CTOR,
+
+ /* 8 bits wide, but used to form an address like 0xffnn */
+ BFD_RELOC_8_FFnn,
+
+ /* 32-bit pc-relative, shifted right 2 bits (i.e., 30-bit
+ word displacement, e.g. for SPARC) */
+ BFD_RELOC_32_PCREL_S2,
+
+ /* High 22 bits of 32-bit value, placed into lower 22 bits of
+ target word; simple reloc. */
+ BFD_RELOC_HI22,
+ /* Low 10 bits. */
+ BFD_RELOC_LO10,
+
+ /* Reloc types used for i960/b.out. */
+ BFD_RELOC_I960_CALLJ,
+
+ /* now for the sparc/elf codes */
+ BFD_RELOC_NONE, /* actually used */
+ BFD_RELOC_SPARC_WDISP22,
+ BFD_RELOC_SPARC22,
+ BFD_RELOC_SPARC13,
+ BFD_RELOC_SPARC_GOT10,
+ BFD_RELOC_SPARC_GOT13,
+ BFD_RELOC_SPARC_GOT22,
+ BFD_RELOC_SPARC_PC10,
+ BFD_RELOC_SPARC_PC22,
+ BFD_RELOC_SPARC_WPLT30,
+ BFD_RELOC_SPARC_COPY,
+ BFD_RELOC_SPARC_GLOB_DAT,
+ BFD_RELOC_SPARC_JMP_SLOT,
+ BFD_RELOC_SPARC_RELATIVE,
+ BFD_RELOC_SPARC_UA32,
+
+ /* these are a.out specific? */
+ BFD_RELOC_SPARC_BASE13,
+ BFD_RELOC_SPARC_BASE22,
+
+
+ /* Bits 27..2 of the relocation address shifted right 2 bits;
+ simple reloc otherwise. */
+ BFD_RELOC_MIPS_JMP,
+
+ /* signed 16-bit pc-relative, shifted right 2 bits (e.g. for MIPS) */
+ BFD_RELOC_16_PCREL_S2,
+
+ /* High 16 bits of 32-bit value; simple reloc. */
+ BFD_RELOC_HI16,
+ /* High 16 bits of 32-bit value but the low 16 bits will be sign
+ extended and added to form the final result. If the low 16
+ bits form a negative number, we need to add one to the high value
+ to compensate for the borrow when the low bits are added. */
+ BFD_RELOC_HI16_S,
+ /* Low 16 bits. */
+ BFD_RELOC_LO16,
+
+ /* 16 bit relocation relative to the global pointer. */
+ BFD_RELOC_MIPS_GPREL,
+
+ /* These are, so far, specific to HPPA processors. I'm not sure that some
+ don't duplicate other reloc types, such as BFD_RELOC_32 and _32_PCREL.
+ Also, many more were in the list I got that don't fit in well in the
+ model BFD uses, so I've omitted them for now. If we do make this reloc
+ type get used for code that really does implement the funky reloc types,
+ they'll have to be added to this list. */
+ BFD_RELOC_HPPA_32,
+ BFD_RELOC_HPPA_11,
+ BFD_RELOC_HPPA_14,
+ BFD_RELOC_HPPA_17,
+
+ BFD_RELOC_HPPA_L21,
+ BFD_RELOC_HPPA_R11,
+ BFD_RELOC_HPPA_R14,
+ BFD_RELOC_HPPA_R17,
+ BFD_RELOC_HPPA_LS21,
+ BFD_RELOC_HPPA_RS11,
+ BFD_RELOC_HPPA_RS14,
+ BFD_RELOC_HPPA_RS17,
+ BFD_RELOC_HPPA_LD21,
+ BFD_RELOC_HPPA_RD11,
+ BFD_RELOC_HPPA_RD14,
+ BFD_RELOC_HPPA_RD17,
+ BFD_RELOC_HPPA_LR21,
+ BFD_RELOC_HPPA_RR14,
+ BFD_RELOC_HPPA_RR17,
+
+ BFD_RELOC_HPPA_GOTOFF_11,
+ BFD_RELOC_HPPA_GOTOFF_14,
+ BFD_RELOC_HPPA_GOTOFF_L21,
+ BFD_RELOC_HPPA_GOTOFF_R11,
+ BFD_RELOC_HPPA_GOTOFF_R14,
+ BFD_RELOC_HPPA_GOTOFF_LS21,
+ BFD_RELOC_HPPA_GOTOFF_RS11,
+ BFD_RELOC_HPPA_GOTOFF_RS14,
+ BFD_RELOC_HPPA_GOTOFF_LD21,
+ BFD_RELOC_HPPA_GOTOFF_RD11,
+ BFD_RELOC_HPPA_GOTOFF_RD14,
+ BFD_RELOC_HPPA_GOTOFF_LR21,
+ BFD_RELOC_HPPA_GOTOFF_RR14,
+
+ BFD_RELOC_HPPA_DLT_32,
+ BFD_RELOC_HPPA_DLT_11,
+ BFD_RELOC_HPPA_DLT_14,
+ BFD_RELOC_HPPA_DLT_L21,
+ BFD_RELOC_HPPA_DLT_R11,
+ BFD_RELOC_HPPA_DLT_R14,
+
+ BFD_RELOC_HPPA_ABS_CALL_11,
+ BFD_RELOC_HPPA_ABS_CALL_14,
+ BFD_RELOC_HPPA_ABS_CALL_17,
+ BFD_RELOC_HPPA_ABS_CALL_L21,
+ BFD_RELOC_HPPA_ABS_CALL_R11,
+ BFD_RELOC_HPPA_ABS_CALL_R14,
+ BFD_RELOC_HPPA_ABS_CALL_R17,
+ BFD_RELOC_HPPA_ABS_CALL_LS21,
+ BFD_RELOC_HPPA_ABS_CALL_RS11,
+ BFD_RELOC_HPPA_ABS_CALL_RS14,
+ BFD_RELOC_HPPA_ABS_CALL_RS17,
+ BFD_RELOC_HPPA_ABS_CALL_LD21,
+ BFD_RELOC_HPPA_ABS_CALL_RD11,
+ BFD_RELOC_HPPA_ABS_CALL_RD14,
+ BFD_RELOC_HPPA_ABS_CALL_RD17,
+ BFD_RELOC_HPPA_ABS_CALL_LR21,
+ BFD_RELOC_HPPA_ABS_CALL_RR14,
+ BFD_RELOC_HPPA_ABS_CALL_RR17,
+
+ BFD_RELOC_HPPA_PCREL_CALL_11,
+ BFD_RELOC_HPPA_PCREL_CALL_12,
+ BFD_RELOC_HPPA_PCREL_CALL_14,
+ BFD_RELOC_HPPA_PCREL_CALL_17,
+ BFD_RELOC_HPPA_PCREL_CALL_L21,
+ BFD_RELOC_HPPA_PCREL_CALL_R11,
+ BFD_RELOC_HPPA_PCREL_CALL_R14,
+ BFD_RELOC_HPPA_PCREL_CALL_R17,
+ BFD_RELOC_HPPA_PCREL_CALL_LS21,
+ BFD_RELOC_HPPA_PCREL_CALL_RS11,
+ BFD_RELOC_HPPA_PCREL_CALL_RS14,
+ BFD_RELOC_HPPA_PCREL_CALL_RS17,
+ BFD_RELOC_HPPA_PCREL_CALL_LD21,
+ BFD_RELOC_HPPA_PCREL_CALL_RD11,
+ BFD_RELOC_HPPA_PCREL_CALL_RD14,
+ BFD_RELOC_HPPA_PCREL_CALL_RD17,
+ BFD_RELOC_HPPA_PCREL_CALL_LR21,
+ BFD_RELOC_HPPA_PCREL_CALL_RR14,
+ BFD_RELOC_HPPA_PCREL_CALL_RR17,
+
+ BFD_RELOC_HPPA_PLABEL_32,
+ BFD_RELOC_HPPA_PLABEL_11,
+ BFD_RELOC_HPPA_PLABEL_14,
+ BFD_RELOC_HPPA_PLABEL_L21,
+ BFD_RELOC_HPPA_PLABEL_R11,
+ BFD_RELOC_HPPA_PLABEL_R14,
+
+ BFD_RELOC_HPPA_UNWIND_ENTRY,
+ BFD_RELOC_HPPA_UNWIND_ENTRIES,
+
+ /* i386/elf relocations */
+ BFD_RELOC_386_GOT32,
+ BFD_RELOC_386_PLT32,
+ BFD_RELOC_386_COPY,
+ BFD_RELOC_386_GLOB_DAT,
+ BFD_RELOC_386_JUMP_SLOT,
+ BFD_RELOC_386_RELATIVE,
+ BFD_RELOC_386_GOTOFF,
+ BFD_RELOC_386_GOTPC,
+
+ /* this must be the highest numeric value */
+ BFD_RELOC_UNUSED
+ } bfd_reloc_code_real_type;
+CONST struct reloc_howto_struct *
+
+bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
+
+
+typedef struct symbol_cache_entry
+{
+ /* A pointer to the BFD which owns the symbol. This information
+ is necessary so that a back end can work out what additional
+ information (invisible to the application writer) is carried
+ with the symbol.
+
+ This field is *almost* redundant, since you can use section->owner
+ instead, except that some symbols point to the global sections
+ bfd_{abs,com,und}_section. This could be fixed by making
+ these globals be per-bfd (or per-target-flavor). FIXME. */
+
+ struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */
+
+ /* The text of the symbol. The name is left alone, and not copied - the
+ application may not alter it. */
+ CONST char *name;
+
+ /* The value of the symbol. This really should be a union of a
+ numeric value with a pointer, since some flags indicate that
+ a pointer to another symbol is stored here. */
+ symvalue value;
+
+ /* Attributes of a symbol: */
+
+#define BSF_NO_FLAGS 0x00
+
+ /* The symbol has local scope; <<static>> in <<C>>. The value
+ is the offset into the section of the data. */
+#define BSF_LOCAL 0x01
+
+ /* The symbol has global scope; initialized data in <<C>>. The
+ value is the offset into the section of the data. */
+#define BSF_GLOBAL 0x02
+
+ /* The symbol has global scope, and is exported. The value is
+ the offset into the section of the data. */
+#define BSF_EXPORT BSF_GLOBAL /* no real difference */
+
+ /* A normal C symbol would be one of:
+ <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or
+ <<BSF_GLOBAL>> */
+
+ /* The symbol is a debugging record. The value has an arbitary
+ meaning. */
+#define BSF_DEBUGGING 0x08
+
+ /* The symbol denotes a function entry point. Used in ELF,
+ perhaps others someday. */
+#define BSF_FUNCTION 0x10
+
+ /* Used by the linker. */
+#define BSF_KEEP 0x20
+#define BSF_KEEP_G 0x40
+
+ /* A weak global symbol, overridable without warnings by
+ a regular global symbol of the same name. */
+#define BSF_WEAK 0x80
+
+ /* This symbol was created to point to a section, e.g. ELF's
+ STT_SECTION symbols. */
+#define BSF_SECTION_SYM 0x100
+
+ /* The symbol used to be a common symbol, but now it is
+ allocated. */
+#define BSF_OLD_COMMON 0x200
+
+ /* The default value for common data. */
+#define BFD_FORT_COMM_DEFAULT_VALUE 0
+
+ /* In some files the type of a symbol sometimes alters its
+ location in an output file - ie in coff a <<ISFCN>> symbol
+ which is also <<C_EXT>> symbol appears where it was
+ declared and not at the end of a section. This bit is set
+ by the target BFD part to convey this information. */
+
+#define BSF_NOT_AT_END 0x400
+
+ /* Signal that the symbol is the label of constructor section. */
+#define BSF_CONSTRUCTOR 0x800
+
+ /* Signal that the symbol is a warning symbol. If the symbol
+ is a warning symbol, then the value field (I know this is
+ tacky) will point to the asymbol which when referenced will
+ cause the warning. */
+#define BSF_WARNING 0x1000
+
+ /* Signal that the symbol is indirect. The value of the symbol
+ is a pointer to an undefined asymbol which contains the
+ name to use instead. */
+#define BSF_INDIRECT 0x2000
+
+ /* BSF_FILE marks symbols that contain a file name. This is used
+ for ELF STT_FILE symbols. */
+#define BSF_FILE 0x4000
+
+ flagword flags;
+
+ /* A pointer to the section to which this symbol is
+ relative. This will always be non NULL, there are special
+ sections for undefined and absolute symbols */
+ struct sec *section;
+
+ /* Back end special data. This is being phased out in favour
+ of making this a union. */
+ PTR udata;
+
+} asymbol;
+#define get_symtab_upper_bound(abfd) \
+ BFD_SEND (abfd, _get_symtab_upper_bound, (abfd))
+#define bfd_canonicalize_symtab(abfd, location) \
+ BFD_SEND (abfd, _bfd_canonicalize_symtab,\
+ (abfd, location))
+boolean
+bfd_set_symtab PARAMS ((bfd *, asymbol **, unsigned int ));
+
+void
+bfd_print_symbol_vandf PARAMS ((PTR file, asymbol *symbol));
+
+#define bfd_make_empty_symbol(abfd) \
+ BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
+#define bfd_make_debug_symbol(abfd,ptr,size) \
+ BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
+int
+bfd_decode_symclass PARAMS ((asymbol *symbol));
+
+void
+bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret));
+
+struct _bfd
+{
+ /* The filename the application opened the BFD with. */
+ CONST char *filename;
+
+ /* A pointer to the target jump table. */
+ struct bfd_target *xvec;
+
+ /* To avoid dragging too many header files into every file that
+ includes `<<bfd.h>>', IOSTREAM has been declared as a "char
+ *", and MTIME as a "long". Their correct types, to which they
+ are cast when used, are "FILE *" and "time_t". The iostream
+ is the result of an fopen on the filename. */
+ char *iostream;
+
+ /* Is the file being cached */
+
+ boolean cacheable;
+
+ /* Marks whether there was a default target specified when the
+ BFD was opened. This is used to select what matching algorithm
+ to use to chose the back end. */
+
+ boolean target_defaulted;
+
+ /* The caching routines use these to maintain a
+ least-recently-used list of BFDs */
+
+ struct _bfd *lru_prev, *lru_next;
+
+ /* When a file is closed by the caching routines, BFD retains
+ state information on the file here:
+ */
+
+ file_ptr where;
+
+ /* and here:*/
+
+ boolean opened_once;
+
+ /* Set if we have a locally maintained mtime value, rather than
+ getting it from the file each time: */
+
+ boolean mtime_set;
+
+ /* File modified time, if mtime_set is true: */
+
+ long mtime;
+
+ /* Reserved for an unimplemented file locking extension.*/
+
+ int ifd;
+
+ /* The format which belongs to the BFD.*/
+
+ bfd_format format;
+
+ /* The direction the BFD was opened with*/
+
+ enum bfd_direction {no_direction = 0,
+ read_direction = 1,
+ write_direction = 2,
+ both_direction = 3} direction;
+
+ /* Format_specific flags*/
+
+ flagword flags;
+
+ /* Currently my_archive is tested before adding origin to
+ anything. I believe that this can become always an add of
+ origin, with origin set to 0 for non archive files. */
+
+ file_ptr origin;
+
+ /* Remember when output has begun, to stop strange things
+ happening. */
+ boolean output_has_begun;
+
+ /* Pointer to linked list of sections*/
+ struct sec *sections;
+
+ /* The number of sections */
+ unsigned int section_count;
+
+ /* Stuff only useful for object files:
+ The start address. */
+ bfd_vma start_address;
+
+ /* Used for input and output*/
+ unsigned int symcount;
+
+ /* Symbol table for output BFD*/
+ struct symbol_cache_entry **outsymbols;
+
+ /* Pointer to structure which contains architecture information*/
+ struct bfd_arch_info *arch_info;
+
+ /* Stuff only useful for archives:*/
+ PTR arelt_data;
+ struct _bfd *my_archive;
+ struct _bfd *next;
+ struct _bfd *archive_head;
+ boolean has_armap;
+
+ /* Used by the back end to hold private data. */
+
+ union
+ {
+ struct aout_data_struct *aout_data;
+ struct artdata *aout_ar_data;
+ struct _oasys_data *oasys_obj_data;
+ struct _oasys_ar_data *oasys_ar_data;
+ struct coff_tdata *coff_obj_data;
+ struct ecoff_tdata *ecoff_obj_data;
+ struct ieee_data_struct *ieee_data;
+ struct ieee_ar_data_struct *ieee_ar_data;
+ struct srec_data_struct *srec_data;
+ struct tekhex_data_struct *tekhex_data;
+ struct elf_obj_tdata *elf_obj_data;
+ struct nlm_obj_tdata *nlm_obj_data;
+ struct bout_data_struct *bout_data;
+ struct sun_core_struct *sun_core_data;
+ struct trad_core_struct *trad_core_data;
+ struct hppa_data_struct *hppa_data;
+ struct hpux_core_struct *hpux_core_data;
+ struct sgi_core_struct *sgi_core_data;
+ struct lynx_core_struct *lynx_core_data;
+ struct osf_core_struct *osf_core_data;
+ PTR any;
+ } tdata;
+
+ /* Used by the application to hold private data*/
+ PTR usrdata;
+
+ /* Where all the allocated stuff under this BFD goes */
+ struct obstack memory;
+
+ /* Is this really needed in addition to usrdata? */
+ asymbol **ld_symbols;
+};
+
+unsigned int
+bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect));
+
+unsigned int
+bfd_canonicalize_reloc
+ PARAMS ((bfd *abfd,
+ asection *sec,
+ arelent **loc,
+ asymbol **syms));
+
+boolean
+bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags));
+
+void
+bfd_set_reloc
+ PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count)
+
+ );
+
+boolean
+bfd_set_start_address PARAMS ((bfd *, bfd_vma));
+
+long
+bfd_get_mtime PARAMS ((bfd *));
+
+long
+bfd_get_size PARAMS ((bfd *));
+
+int
+bfd_get_gp_size PARAMS ((bfd *));
+
+void
+bfd_set_gp_size PARAMS ((bfd *, int));
+
+bfd_vma
+bfd_scan_vma PARAMS ((CONST char *string, CONST char **end, int base));
+
+#define bfd_sizeof_headers(abfd, reloc) \
+ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))
+
+#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
+ BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line))
+
+ /* Do these three do anything useful at all, for any back end? */
+#define bfd_debug_info_start(abfd) \
+ BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
+
+#define bfd_debug_info_end(abfd) \
+ BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
+
+#define bfd_debug_info_accumulate(abfd, section) \
+ BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
+
+
+#define bfd_stat_arch_elt(abfd, stat) \
+ BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
+
+#define bfd_set_arch_mach(abfd, arch, mach)\
+ BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
+
+#define bfd_get_relocated_section_contents(abfd, seclet, data, relocateable) \
+ BFD_SEND (abfd, _bfd_get_relocated_section_contents, (abfd, seclet, data, relocateable))
+
+#define bfd_relax_section(abfd, section, symbols) \
+ BFD_SEND (abfd, _bfd_relax_section, (abfd, section, symbols))
+
+#define bfd_seclet_link(abfd, data, relocateable) \
+ BFD_SEND (abfd, _bfd_seclet_link, (abfd, data, relocateable))
+symindex
+bfd_get_next_mapent PARAMS ((bfd *, symindex previous, carsym ** sym));
+
+boolean
+bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head));
+
+bfd *
+bfd_get_elt_at_index PARAMS ((bfd * archive, int index));
+
+bfd*
+bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous));
+
+CONST char *
+bfd_core_file_failing_command PARAMS ((bfd *));
+
+int
+bfd_core_file_failing_signal PARAMS ((bfd *));
+
+boolean
+core_file_matches_executable_p
+ PARAMS ((bfd *core_bfd, bfd *exec_bfd));
+
+#define BFD_SEND(bfd, message, arglist) \
+ ((*((bfd)->xvec->message)) arglist)
+#define BFD_SEND_FMT(bfd, message, arglist) \
+ (((bfd)->xvec->message[(int)((bfd)->format)]) arglist)
+typedef struct bfd_target
+{
+ char *name;
+ enum target_flavour {
+ bfd_target_unknown_flavour,
+ bfd_target_aout_flavour,
+ bfd_target_coff_flavour,
+ bfd_target_ecoff_flavour,
+ bfd_target_elf_flavour,
+ bfd_target_ieee_flavour,
+ bfd_target_nlm_flavour,
+ bfd_target_oasys_flavour,
+ bfd_target_tekhex_flavour,
+ bfd_target_srec_flavour,
+ bfd_target_hppa_flavour} flavour;
+ boolean byteorder_big_p;
+ boolean header_byteorder_big_p;
+ flagword object_flags;
+ flagword section_flags;
+ char symbol_leading_char;
+ char ar_pad_char;
+ unsigned short ar_max_namelen;
+ unsigned int align_power_min;
+ bfd_vma (*bfd_getx64) PARAMS ((bfd_byte *));
+ bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((bfd_byte *));
+ void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
+ bfd_vma (*bfd_getx32) PARAMS ((bfd_byte *));
+ bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((bfd_byte *));
+ void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
+ bfd_vma (*bfd_getx16) PARAMS ((bfd_byte *));
+ bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((bfd_byte *));
+ void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
+ bfd_vma (*bfd_h_getx64) PARAMS ((bfd_byte *));
+ bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((bfd_byte *));
+ void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
+ bfd_vma (*bfd_h_getx32) PARAMS ((bfd_byte *));
+ bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((bfd_byte *));
+ void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
+ bfd_vma (*bfd_h_getx16) PARAMS ((bfd_byte *));
+ bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((bfd_byte *));
+ void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
+ struct bfd_target * (*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
+ boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
+ boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
+ char * (*_core_file_failing_command) PARAMS ((bfd *));
+ int (*_core_file_failing_signal) PARAMS ((bfd *));
+ boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
+ boolean (*_bfd_slurp_armap) PARAMS ((bfd *));
+ boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
+ void (*_bfd_truncate_arname) PARAMS ((bfd *, CONST char *, char *));
+ boolean (*write_armap) PARAMS ((bfd *arch,
+ unsigned int elength,
+ struct orl *map,
+ unsigned int orl_count,
+ int stridx));
+ boolean (*_close_and_cleanup) PARAMS ((bfd *));
+ boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
+ file_ptr, bfd_size_type));
+ boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR,
+ file_ptr, bfd_size_type));
+ boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
+ unsigned int (*_get_symtab_upper_bound) PARAMS ((bfd *));
+ unsigned int (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
+ struct symbol_cache_entry **));
+ unsigned int (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
+ unsigned int (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **,
+ struct symbol_cache_entry **));
+ struct symbol_cache_entry *
+ (*_bfd_make_empty_symbol) PARAMS ((bfd *));
+ void (*_bfd_print_symbol) PARAMS ((bfd *, PTR,
+ struct symbol_cache_entry *,
+ bfd_print_symbol_type));
+#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e))
+ void (*_bfd_get_symbol_info) PARAMS ((bfd *,
+ struct symbol_cache_entry *,
+ symbol_info *));
+#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
+ alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
+
+ boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture,
+ unsigned long));
+
+ bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev));
+
+ boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,
+ struct sec *section, struct symbol_cache_entry **symbols,
+ bfd_vma offset, CONST char **file, CONST char **func,
+ unsigned int *line));
+
+ int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
+
+ int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean));
+
+ void (*_bfd_debug_info_start) PARAMS ((bfd *));
+ void (*_bfd_debug_info_end) PARAMS ((bfd *));
+ void (*_bfd_debug_info_accumulate) PARAMS ((bfd *, struct sec *));
+
+ bfd_byte * (*_bfd_get_relocated_section_contents) PARAMS ((bfd *,
+ struct bfd_seclet *, bfd_byte *data,
+ boolean relocateable));
+
+ boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *,
+ struct symbol_cache_entry **));
+
+ boolean (*_bfd_seclet_link) PARAMS ((bfd *, PTR data,
+ boolean relocateable));
+ /* See documentation on reloc types. */
+ CONST struct reloc_howto_struct *
+ (*reloc_type_lookup) PARAMS ((bfd *abfd,
+ bfd_reloc_code_real_type code));
+
+ /* Back-door to allow format-aware applications to create debug symbols
+ while using BFD for everything else. Currently used by the assembler
+ when creating COFF files. */
+ asymbol * (*_bfd_make_debug_symbol) PARAMS ((
+ bfd *abfd,
+ void *ptr,
+ unsigned long size));
+ PTR backend_data;
+} bfd_target;
+bfd_target *
+bfd_find_target PARAMS ((CONST char *, bfd *));
+
+CONST char **
+bfd_target_list PARAMS ((void));
+
+boolean
+bfd_check_format PARAMS ((bfd *abfd, bfd_format format));
+
+boolean
+bfd_set_format PARAMS ((bfd *, bfd_format));
+
+CONST char *
+bfd_format_string PARAMS ((bfd_format));
+
+#endif
diff --git a/gnu/usr.bin/gdb/bfd/cache.c b/gnu/usr.bin/gdb/bfd/cache.c
new file mode 100644
index 000000000000..f8cfd19fed5c
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/cache.c
@@ -0,0 +1,311 @@
+/* BFD library -- caching of file descriptors.
+ Copyright 1990, 1991, 1992 Free Software Foundation, Inc.
+ Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You 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. */
+
+/*
+SECTION
+ File Caching
+
+ The file caching mechanism is embedded within BFD and allows
+ the application to open as many BFDs as it wants without
+ regard to the underlying operating system's file descriptor
+ limit (often as low as 20 open files). The module in
+ <<cache.c>> maintains a least recently used list of
+ <<BFD_CACHE_MAX_OPEN>> files, and exports the name
+ <<bfd_cache_lookup>> which runs around and makes sure that
+ the required BFD is open. If not, then it chooses a file to
+ close, closes it and opens the one wanted, returning its file
+ handle.
+
+*/
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+/*
+INTERNAL_FUNCTION
+ BFD_CACHE_MAX_OPEN macro
+
+DESCRIPTION
+ The maximum number of files which the cache will keep open at
+ one time.
+
+.#define BFD_CACHE_MAX_OPEN 10
+
+*/
+
+
+static boolean
+bfd_cache_delete PARAMS ((bfd *));
+
+/* Number of bfds on the chain. All such bfds have their file open;
+ if it closed, they get snipd()d from the chain. */
+
+static int open_files;
+
+static bfd *cache_sentinel; /* Chain of BFDs with active fds we've
+ opened */
+
+/*
+INTERNAL_FUNCTION
+ bfd_last_cache
+
+SYNOPSIS
+ extern bfd *bfd_last_cache;
+
+DESCRIPTION
+ Zero, or a pointer to the topmost BFD on the chain. This is
+ used by the <<bfd_cache_lookup>> macro in @file{libbfd.h} to
+ determine when it can avoid a function call.
+*/
+
+bfd *bfd_last_cache;
+
+/*
+ * INTERNAL_FUNCTION
+ * bfd_cache_lookup
+ *
+ * DESCRIPTION
+ * Checks to see if the required BFD is the same as the last one
+ * looked up. If so then it can use the iostream in the BFD with
+ * impunity, since it can't have changed since the last lookup,
+ * otherwise it has to perform the complicated lookup function
+ *
+ * .#define bfd_cache_lookup(x) \
+ * . ((x)==bfd_last_cache? \
+ * . (FILE*)(bfd_last_cache->iostream): \
+ * . bfd_cache_lookup_worker(x))
+ *
+ *
+ */
+
+static void
+DEFUN_VOID(close_one)
+{
+ bfd *kill = cache_sentinel;
+ if (kill == 0) /* Nothing in the cache */
+ return ;
+
+ /* We can only close files that want to play this game. */
+ while (!kill->cacheable) {
+ kill = kill->lru_prev;
+ if (kill == cache_sentinel) /* Nobody wants to play */
+ return ;
+ }
+
+ kill->where = ftell((FILE *)(kill->iostream));
+ (void) bfd_cache_delete(kill);
+}
+
+/* Cuts the BFD abfd out of the chain in the cache */
+static void
+DEFUN(snip,(abfd),
+ bfd *abfd)
+{
+ abfd->lru_prev->lru_next = abfd->lru_next;
+ abfd->lru_next->lru_prev = abfd->lru_prev;
+ if (cache_sentinel == abfd) cache_sentinel = (bfd *)NULL;
+}
+
+static boolean
+DEFUN(bfd_cache_delete,(abfd),
+ bfd *abfd)
+{
+ boolean ret;
+
+ if (fclose ((FILE *)(abfd->iostream)) == 0)
+ ret = true;
+ else
+ {
+ ret = false;
+ bfd_error = system_call_error;
+ }
+ snip (abfd);
+ abfd->iostream = NULL;
+ open_files--;
+ bfd_last_cache = 0;
+ return ret;
+}
+
+static bfd *
+DEFUN(insert,(x,y),
+ bfd *x AND
+ bfd *y)
+{
+ if (y) {
+ x->lru_next = y;
+ x->lru_prev = y->lru_prev;
+ y->lru_prev->lru_next = x;
+ y->lru_prev = x;
+
+ }
+ else {
+ x->lru_prev = x;
+ x->lru_next = x;
+ }
+ return x;
+}
+
+
+/* Initialize a BFD by putting it on the cache LRU. */
+
+void
+DEFUN(bfd_cache_init,(abfd),
+ bfd *abfd)
+{
+ if (open_files >= BFD_CACHE_MAX_OPEN)
+ close_one ();
+ cache_sentinel = insert(abfd, cache_sentinel);
+ ++open_files;
+}
+
+
+/*
+INTERNAL_FUNCTION
+ bfd_cache_close
+
+DESCRIPTION
+ Remove the BFD from the cache. If the attached file is open,
+ then close it too.
+
+SYNOPSIS
+ boolean bfd_cache_close (bfd *);
+
+RETURNS
+ <<false>> is returned if closing the file fails, <<true>> is
+ returned if all is well.
+*/
+boolean
+DEFUN(bfd_cache_close,(abfd),
+ bfd *abfd)
+{
+ /* If this file is open then remove from the chain */
+ if (abfd->iostream)
+ {
+ return bfd_cache_delete(abfd);
+ }
+ else
+ {
+ return true;
+ }
+}
+
+/*
+INTERNAL_FUNCTION
+ bfd_open_file
+
+DESCRIPTION
+ Call the OS to open a file for this BFD. Returns the FILE *
+ (possibly null) that results from this operation. Sets up the
+ BFD so that future accesses know the file is open. If the FILE
+ * returned is null, then there is won't have been put in the
+ cache, so it won't have to be removed from it.
+
+SYNOPSIS
+ FILE* bfd_open_file(bfd *);
+*/
+
+FILE *
+DEFUN(bfd_open_file, (abfd),
+ bfd *abfd)
+{
+ abfd->cacheable = true; /* Allow it to be closed later. */
+
+ if(open_files >= BFD_CACHE_MAX_OPEN) {
+ close_one();
+ }
+
+ switch (abfd->direction) {
+ case read_direction:
+ case no_direction:
+ abfd->iostream = (char *) fopen(abfd->filename, FOPEN_RB);
+ break;
+ case both_direction:
+ case write_direction:
+ if (abfd->opened_once == true) {
+ abfd->iostream = (char *) fopen(abfd->filename, FOPEN_RUB);
+ if (!abfd->iostream) {
+ abfd->iostream = (char *) fopen(abfd->filename, FOPEN_WUB);
+ }
+ } else {
+ /*open for creat */
+ abfd->iostream = (char *) fopen(abfd->filename, FOPEN_WB);
+ abfd->opened_once = true;
+ }
+ break;
+ }
+
+ if (abfd->iostream) {
+ bfd_cache_init (abfd);
+ }
+
+ return (FILE *)(abfd->iostream);
+}
+
+/*
+INTERNAL_FUNCTION
+ bfd_cache_lookup_worker
+
+DESCRIPTION
+ Called when the macro <<bfd_cache_lookup>> fails to find a
+ quick answer. Finds a file descriptor for this BFD. If
+ necessary, it open it. If there are already more than
+ BFD_CACHE_MAX_OPEN files open, it trys to close one first, to
+ avoid running out of file descriptors.
+
+SYNOPSIS
+ FILE *bfd_cache_lookup_worker(bfd *);
+
+*/
+
+FILE *
+DEFUN(bfd_cache_lookup_worker,(abfd),
+ bfd *abfd)
+{
+ if (abfd->my_archive)
+ {
+ abfd = abfd->my_archive;
+ }
+ /* Is this file already open .. if so then quick exit */
+ if (abfd->iostream)
+ {
+ if (abfd != cache_sentinel) {
+ /* Place onto head of lru chain */
+ snip (abfd);
+ cache_sentinel = insert(abfd, cache_sentinel);
+ }
+ }
+ /* This is a BFD without a stream -
+ so it must have been closed or never opened.
+ find an empty cache entry and use it. */
+ else
+ {
+
+ if (open_files >= BFD_CACHE_MAX_OPEN)
+ {
+ close_one();
+ }
+
+ BFD_ASSERT(bfd_open_file (abfd) != (FILE *)NULL) ;
+ fseek((FILE *)(abfd->iostream), abfd->where, false);
+ }
+ bfd_last_cache = abfd;
+ return (FILE *)(abfd->iostream);
+}
diff --git a/gnu/usr.bin/gdb/bfd/coffgen.c b/gnu/usr.bin/gdb/bfd/coffgen.c
new file mode 100644
index 000000000000..94cc225d098c
--- /dev/null
+++ b/gnu/usr.bin/gdb/bfd/coffgen.c
@@ -0,0 +1,1519 @@
+/* Support for the generic parts of COFF, for BFD.
+ Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Written by Cygnus Support.
+
+This file is part of BFD, the Binary File Descriptor library.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You 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. */
+
+/* Most of this hacked by Steve Chamberlain, sac@cygnus.com.
+ Split out of coffcode.h by Ian Taylor, ian@cygnus.com. */
+
+/* This file contains COFF code that is not dependent on any
+ particular COFF target. There is only one version of this file in
+ libbfd.a, so no target specific code may be put in here. Or, to
+ put it another way,
+
+ ********** DO NOT PUT TARGET SPECIFIC CODE IN THIS FILE **********
+
+ If you need to add some target specific behaviour, add a new hook
+ function to bfd_coff_backend_data.
+
+ Some of these functions are also called by the ECOFF routines.
+ Those functions may not use any COFF specific information, such as
+ coff_data (abfd). */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "coff/internal.h"
+#include "seclet.h"
+#include "libcoff.h"
+
+static asection bfd_debug_section = { "*DEBUG*" };
+
+/* Take a section header read from a coff file (in HOST byte order),
+ and make a BFD "section" out of it. This is used by ECOFF. */
+static boolean
+DEFUN(make_a_section_from_file,(abfd, hdr, target_index),
+ bfd *abfd AND
+ struct internal_scnhdr *hdr AND
+ unsigned int target_index)
+{
+ asection *return_section;
+ char *name;
+
+ /* Assorted wastage to null-terminate the name, thanks AT&T! */
+ name = bfd_alloc(abfd, sizeof (hdr->s_name)+1);
+ if (name == NULL) {
+ bfd_error = no_memory;
+ return false;
+ }
+ strncpy(name, (char *) &hdr->s_name[0], sizeof (hdr->s_name));
+ name[sizeof (hdr->s_name)] = 0;
+
+ return_section = bfd_make_section(abfd, name);
+ if (return_section == NULL)
+ return_section = bfd_coff_make_section_hook (abfd, name);
+
+ /* Handle several sections of the same name. For example, if an executable
+ has two .bss sections, GDB better be able to find both of them
+ (PR 3562). */
+ if (return_section == NULL)
+ return_section = bfd_make_section_anyway (abfd, name);
+
+ if (return_section == NULL)
+ return false;
+
+ /* s_paddr is presumed to be = to s_vaddr */
+
+ return_section->vma = hdr->s_vaddr;
+ return_section->_raw_size = hdr->s_size;
+ return_section->filepos = hdr->s_scnptr;
+ return_section->rel_filepos = hdr->s_relptr;
+ return_section->reloc_count = hdr->s_nreloc;
+
+ bfd_coff_set_alignment_hook (abfd, return_section, hdr);
+
+ return_section->line_filepos = hdr->s_lnnoptr;
+
+ return_section->lineno_count = hdr->s_nlnno;
+ return_section->userdata = NULL;
+ return_section->next = (asection *) NULL;
+ return_section->flags = bfd_coff_styp_to_sec_flags_hook (abfd, hdr);
+
+ return_section->target_index = target_index;
+
+ /* At least on i386-coff, the line number count for a shared library
+ section must be ignored. */
+ if ((return_section->flags & SEC_SHARED_LIBRARY) != 0)
+ return_section->lineno_count = 0;
+
+ if (hdr->s_nreloc != 0)
+ return_section->flags |= SEC_RELOC;
+ /* FIXME: should this check 'hdr->s_size > 0' */
+ if (hdr->s_scnptr != 0)
+ return_section->flags |= SEC_HAS_CONTENTS;
+ return true;
+}
+
+/* Read in a COFF object and make it into a BFD. This is used by
+ ECOFF as well. */
+
+static
+bfd_target *
+DEFUN(coff_real_object_p,(abfd, nscns, internal_f, internal_a),
+ bfd *abfd AND
+ unsigned nscns AND
+ struct internal_filehdr *internal_f AND
+ struct internal_aouthdr *internal_a)
+{
+ PTR tdata;
+ size_t readsize; /* length of file_info */
+ unsigned int scnhsz;
+ char *external_sections;
+
+ /* Build a play area */
+ tdata = bfd_coff_mkobject_hook (abfd, (PTR) internal_f, (PTR) internal_a);
+ if (tdata == NULL)
+ return 0;
+
+ scnhsz = bfd_coff_scnhsz (abfd);
+ readsize = nscns * scnhsz;
+ external_sections = (char *)bfd_alloc(abfd, readsize);
+
+ if (bfd_read((PTR)external_sections, 1, readsize, abfd) != readsize) {
+ goto fail;
+ }
+
+ /* Now copy data as required; construct all asections etc */
+ if (nscns != 0) {
+ unsigned int i;
+ for (i = 0; i < nscns; i++) {
+ struct internal_scnhdr tmp;
+ bfd_coff_swap_scnhdr_in(abfd, (PTR) (external_sections + i * scnhsz),
+ (PTR) &tmp);
+ make_a_section_from_file(abfd,&tmp, i+1);
+ }
+ }
+
+/* make_abs_section(abfd);*/
+
+ if (bfd_coff_set_arch_mach_hook (abfd, (PTR) internal_f) == false)
+ goto fail;
+
+ if (!(internal_f->f_flags & F_RELFLG))
+ abfd->flags |= HAS_RELOC;
+ if ((internal_f->f_flags & F_EXEC))
+ abfd->flags |= EXEC_P;
+ if (!(internal_f->f_flags & F_LNNO))
+ abfd->flags |= HAS_LINENO;
+ if (!(internal_f->f_flags & F_LSYMS))
+ abfd->flags |= HAS_LOCALS;
+
+
+ bfd_get_symcount(abfd) = internal_f->f_nsyms;
+ if (internal_f->f_nsyms)
+ abfd->flags |= HAS_SYMS;
+
+ if (internal_a != (struct internal_aouthdr *) NULL)
+ bfd_get_start_address (abfd) = internal_a->entry;
+ else
+ bfd_get_start_address (abfd) = 0;
+
+ return abfd->xvec;
+ fail:
+ bfd_release(abfd, tdata);
+ return (bfd_target *)NULL;
+}
+
+/* Turn a COFF file into a BFD, but fail with wrong_format if it is
+ not a COFF file. This is also used by ECOFF. */
+
+bfd_target *
+DEFUN(coff_object_p,(abfd),
+ bfd *abfd)
+{
+ unsigned int filhsz;
+ unsigned int aoutsz;
+ int nscns;
+ PTR filehdr;
+ struct internal_filehdr internal_f;
+ struct internal_aouthdr internal_a;
+
+ bfd_error = system_call_error;
+
+ /* figure out how much to read */
+ fi