summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlton <carlton@bactrian.org>2003-09-17 21:29:05 +0000
committerDavid Carlton <carlton@bactrian.org>2003-09-17 21:29:05 +0000
commit5993e46956fada1bbe5ad7b95b63c22a5c858746 (patch)
tree94451834539b4a3459fcd3b18f22ea6cdd838f0f
parent6ac3a292f75ffbdc018a333c89e23809dc90bc56 (diff)
downloadgdb-5993e46956fada1bbe5ad7b95b63c22a5c858746.tar.gz
2003-09-17 David Carlton <carlton@kealia.com>
* Merge with mainline; tag is carlton_dictionary-20030917-merge.
-rw-r--r--ChangeLog76
-rw-r--r--MAINTAINERS14
-rw-r--r--bfd/ChangeLog342
-rw-r--r--bfd/Makefile.am16
-rw-r--r--bfd/Makefile.in20
-rw-r--r--bfd/archures.c14
-rw-r--r--bfd/bfd-in.h13
-rw-r--r--bfd/bfd-in2.h31
-rw-r--r--bfd/bfd.c5
-rw-r--r--bfd/coff-i860.c311
-rw-r--r--bfd/cofflink.c559
-rw-r--r--bfd/config.bfd12
-rw-r--r--bfd/config.in3
-rwxr-xr-xbfd/configure309
-rw-r--r--bfd/configure.in24
-rw-r--r--bfd/cpu-frv.c7
-rw-r--r--bfd/cpu-hppa.c12
-rw-r--r--bfd/cpu-msp430.c40
-rw-r--r--bfd/cpu-v850.c4
-rw-r--r--bfd/dep-in.sed1
-rw-r--r--bfd/doc/Makefile.in1
-rw-r--r--bfd/elf-bfd.h635
-rw-r--r--bfd/elf-eh-frame.c137
-rw-r--r--bfd/elf-hppa.h228
-rw-r--r--bfd/elf-m10300.c98
-rw-r--r--bfd/elf-strtab.c102
-rw-r--r--bfd/elf.c55
-rw-r--r--bfd/elf32-arm.h102
-rw-r--r--bfd/elf32-cris.c111
-rw-r--r--bfd/elf32-frv.c4
-rw-r--r--bfd/elf32-hppa.c759
-rw-r--r--bfd/elf32-hppa.h19
-rw-r--r--bfd/elf32-i386.c39
-rw-r--r--bfd/elf32-i860.c246
-rw-r--r--bfd/elf32-ip2k.c27
-rw-r--r--bfd/elf32-iq2000.c46
-rw-r--r--bfd/elf32-m68hc11.c4
-rw-r--r--bfd/elf32-m68hc12.c20
-rw-r--r--bfd/elf32-m68hc1x.c79
-rw-r--r--bfd/elf32-m68hc1x.h1
-rw-r--r--bfd/elf32-m68k.c38
-rw-r--r--bfd/elf32-msp430.c68
-rw-r--r--bfd/elf32-ppc.c101
-rw-r--r--bfd/elf32-s390.c47
-rw-r--r--bfd/elf32-sh.c23
-rw-r--r--bfd/elf32-sh64.c2
-rw-r--r--bfd/elf32-sparc.c44
-rw-r--r--bfd/elf32-v850.c25
-rw-r--r--bfd/elf32-vax.c49
-rw-r--r--bfd/elf32-xtensa.c55
-rw-r--r--bfd/elf64-alpha.c57
-rw-r--r--bfd/elf64-hppa.c22
-rw-r--r--bfd/elf64-mips.c4
-rw-r--r--bfd/elf64-ppc.c185
-rw-r--r--bfd/elf64-s390.c47
-rw-r--r--bfd/elf64-sh64.c10
-rw-r--r--bfd/elf64-sparc.c42
-rw-r--r--bfd/elf64-x86-64.c45
-rw-r--r--bfd/elfcode.h12
-rw-r--r--bfd/elfcore.h6
-rw-r--r--bfd/elflink.c28
-rw-r--r--bfd/elflink.h64
-rw-r--r--bfd/elfxx-ia64.c65
-rw-r--r--bfd/elfxx-mips.c21
-rw-r--r--bfd/elfxx-mips.h2
-rw-r--r--bfd/elfxx-target.h4
-rw-r--r--bfd/libbfd.h2
-rw-r--r--bfd/libhppa.h121
-rw-r--r--bfd/libpei.h4
-rw-r--r--bfd/merge.c111
-rw-r--r--bfd/po/fr.po6
-rw-r--r--bfd/po/sv.po6
-rw-r--r--bfd/reloc.c7
-rw-r--r--bfd/simple.c38
-rw-r--r--bfd/targets.c2
-rw-r--r--bfd/version.h2
-rw-r--r--config-ml.in28
-rwxr-xr-xconfig.sub4
-rw-r--r--config/no-executables.m461
-rwxr-xr-xconfigure135
-rw-r--r--configure.in69
-rw-r--r--gdb/ChangeLog1838
-rw-r--r--gdb/MAINTAINERS14
-rw-r--r--gdb/Makefile.in163
-rw-r--r--gdb/NEWS23
-rw-r--r--gdb/ada-lang.c4
-rw-r--r--gdb/alpha-nat.c12
-rw-r--r--gdb/alpha-osf1-tdep.c29
-rw-r--r--gdb/alpha-tdep.c6
-rw-r--r--gdb/alphafbsd-tdep.c5
-rw-r--r--gdb/amd64-nat.c144
-rw-r--r--gdb/amd64-nat.h53
-rw-r--r--gdb/amd64fbsd-nat.c116
-rw-r--r--gdb/amd64fbsd-tdep.c52
-rw-r--r--gdb/arch-utils.c228
-rw-r--r--gdb/arch-utils.h19
-rw-r--r--gdb/arm-linux-tdep.c16
-rw-r--r--gdb/arm-tdep.c593
-rw-r--r--gdb/avr-tdep.c3
-rw-r--r--gdb/blockframe.c25
-rw-r--r--gdb/breakpoint.c271
-rw-r--r--gdb/buildsym.c46
-rw-r--r--gdb/c-lang.c6
-rw-r--r--gdb/c-typeprint.c2
-rw-r--r--gdb/c-valprint.c2
-rw-r--r--gdb/cli/cli-decode.c20
-rw-r--r--gdb/coffread.c86
-rw-r--r--gdb/command.h10
-rw-r--r--gdb/config.in3
-rw-r--r--gdb/config/alpha/nm-fbsd.h2
-rw-r--r--gdb/config/alpha/tm-alpha.h2
-rw-r--r--gdb/config/arm/tm-arm.h2
-rw-r--r--gdb/config/arm/wince.mt2
-rw-r--r--gdb/config/djgpp/fnchange.lst15
-rw-r--r--gdb/config/frv/frv.mt4
-rw-r--r--gdb/config/frv/tm-frv.h17
-rw-r--r--gdb/config/h8300/tm-h8300.h2
-rw-r--r--gdb/config/i386/fbsd64.mh2
-rw-r--r--gdb/config/i386/nm-i386sol2.h1
-rw-r--r--gdb/config/i386/nm-linux.h9
-rw-r--r--gdb/config/i386/nm-x86-64linux.h5
-rw-r--r--gdb/config/i386/tm-cygwin.h7
-rw-r--r--gdb/config/i386/tm-i386.h2
-rw-r--r--gdb/config/i386/x86-64linux.mh2
-rw-r--r--gdb/config/i386/x86-64linux.mt2
-rw-r--r--gdb/config/m68hc11/m68hc11.mt1
-rw-r--r--gdb/config/m68k/nm-apollo68v.h21
-rw-r--r--gdb/config/m68k/nm-hp300hpux.h55
-rw-r--r--gdb/config/m68k/tm-cisco.h2
-rw-r--r--gdb/config/m68k/tm-delta68.h4
-rw-r--r--gdb/config/m68k/tm-hp300hpux.h33
-rw-r--r--gdb/config/m68k/tm-m68k.h2
-rw-r--r--gdb/config/m68k/xm-apollo68v.h42
-rw-r--r--gdb/config/m68k/xm-hp300bsd.h83
-rw-r--r--gdb/config/m68k/xm-hp300hpux.h150
-rw-r--r--gdb/config/mips/embed.mt3
-rw-r--r--gdb/config/mips/embed64.mt1
-rw-r--r--gdb/config/mips/embedl.mt5
-rw-r--r--gdb/config/mips/embedl64.mt5
-rw-r--r--gdb/config/mips/irix3.mh5
-rw-r--r--gdb/config/mips/irix3.mt3
-rw-r--r--gdb/config/mips/irix4.mh10
-rw-r--r--gdb/config/mips/mips.mt5
-rw-r--r--gdb/config/mips/mips64.mt5
-rw-r--r--gdb/config/mips/nm-irix3.h38
-rw-r--r--gdb/config/mips/nm-irix4.h67
-rw-r--r--gdb/config/mips/nm-irix5.h2
-rw-r--r--gdb/config/mips/tm-embed.h46
-rw-r--r--gdb/config/mips/tm-irix3.h68
-rw-r--r--gdb/config/mips/tm-irix5.h48
-rw-r--r--gdb/config/mips/wince.mt2
-rw-r--r--gdb/config/nm-linux.h4
-rw-r--r--gdb/config/ns32k/tm-ns32k.h2
-rw-r--r--gdb/config/pa/hppa64.mt1
-rw-r--r--gdb/config/pa/nm-hppah.h8
-rw-r--r--gdb/config/pa/tm-hppa.h2
-rw-r--r--gdb/config/pa/tm-hppa64.h521
-rw-r--r--gdb/config/pa/tm-hppah.h6
-rw-r--r--gdb/config/powerpc/tm-linux.h4
-rw-r--r--gdb/config/powerpc/tm-nbsd.h2
-rw-r--r--gdb/config/rs6000/nm-rs6000.h3
-rw-r--r--gdb/config/rs6000/tm-rs6000.h3
-rw-r--r--gdb/config/s390/s390.mt1
-rw-r--r--gdb/config/s390/s390x.mt1
-rw-r--r--gdb/config/sh/embed.mt2
-rw-r--r--gdb/config/sh/linux.mt2
-rw-r--r--gdb/config/sh/nbsd.mt2
-rw-r--r--gdb/config/sh/tm-sh.h2
-rw-r--r--gdb/config/sh/wince.mt4
-rw-r--r--gdb/config/sparc/fbsd.mh22
-rw-r--r--gdb/config/sparc/fbsd.mt22
-rw-r--r--gdb/config/sparc/nm-fbsd.h36
-rw-r--r--gdb/config/sparc/sp64.mt3
-rw-r--r--gdb/config/sparc/tm-fbsd.h15
-rw-r--r--gdb/config/sparc/tm-linux.h2
-rw-r--r--gdb/config/sparc/tm-nbsd.h2
-rw-r--r--gdb/config/sparc/tm-sp64.h361
-rw-r--r--gdb/config/sparc/tm-sparc.h350
-rw-r--r--gdb/config/sparc/tm-sun4sol2.h2
-rw-r--r--gdb/config/v850/v850.mt1
-rw-r--r--gdb/config/vax/tm-vax.h2
-rwxr-xr-xgdb/configure857
-rw-r--r--gdb/configure.host3
-rw-r--r--gdb/configure.in35
-rw-r--r--gdb/configure.tgt49
-rw-r--r--gdb/core-sol2.c20
-rw-r--r--gdb/corefile.c4
-rw-r--r--gdb/cp-namespace.c15
-rw-r--r--gdb/cp-support.h1
-rw-r--r--gdb/cp-valprint.c2
-rw-r--r--gdb/cris-tdep.c52
-rw-r--r--gdb/d10v-tdep.c8
-rw-r--r--gdb/dbxread.c74
-rw-r--r--gdb/dcache.c17
-rw-r--r--gdb/defs.h29
-rw-r--r--gdb/disasm.c51
-rw-r--r--gdb/doc/ChangeLog46
-rw-r--r--gdb/doc/Makefile.in12
-rw-r--r--gdb/doc/gdb.texinfo584
-rw-r--r--gdb/doc/gdbint.texinfo36
-rw-r--r--gdb/doublest.c2
-rw-r--r--gdb/dsrec.c16
-rw-r--r--gdb/dwarf2-frame.c227
-rw-r--r--gdb/dwarf2loc.c5
-rw-r--r--gdb/dwarf2read.c59
-rw-r--r--gdb/dwarfread.c4
-rw-r--r--gdb/elfread.c2
-rw-r--r--gdb/environ.c39
-rw-r--r--gdb/eval.c52
-rw-r--r--gdb/event-top.c2
-rw-r--r--gdb/exec.c4
-rw-r--r--gdb/expprint.c12
-rw-r--r--gdb/f-lang.c6
-rw-r--r--gdb/f-typeprint.c2
-rw-r--r--gdb/f-valprint.c33
-rw-r--r--gdb/findvar.c11
-rw-r--r--gdb/frame.c117
-rw-r--r--gdb/frame.h13
-rw-r--r--gdb/frv-tdep.c408
-rw-r--r--gdb/gcore.c273
-rw-r--r--gdb/gdbarch.c1373
-rw-r--r--gdb/gdbarch.h927
-rwxr-xr-xgdb/gdbarch.sh189
-rw-r--r--gdb/gdbserver/ChangeLog9
-rw-r--r--gdb/gdbserver/Makefile.in8
-rw-r--r--gdb/gdbserver/configure.srv5
-rw-r--r--gdb/gdbtypes.c60
-rw-r--r--gdb/gdbtypes.h51
-rw-r--r--gdb/gnu-nat.c22
-rw-r--r--gdb/gnu-v2-abi.c4
-rw-r--r--gdb/gnu-v3-abi.c9
-rw-r--r--gdb/go32-nat.c4
-rw-r--r--gdb/h8300-tdep.c6
-rw-r--r--gdb/hppa-hpux-tdep.c86
-rw-r--r--gdb/hppa-tdep.c278
-rw-r--r--gdb/hppa-tdep.h (renamed from gdb/config/mips/xm-irix3.h)22
-rw-r--r--gdb/hppab-nat.c12
-rw-r--r--gdb/hppah-nat.c30
-rw-r--r--gdb/hppam3-nat.c14
-rw-r--r--gdb/hpread.c10
-rw-r--r--gdb/hpux-thread.c8
-rw-r--r--gdb/i386-interix-nat.c2
-rw-r--r--gdb/i386-interix-tdep.c4
-rw-r--r--gdb/i386-linux-nat.c67
-rw-r--r--gdb/i386-linux-tdep.h5
-rw-r--r--gdb/i386-nat.c2
-rw-r--r--gdb/i386-nto-tdep.c4
-rw-r--r--gdb/i386-tdep.c134
-rw-r--r--gdb/i386-tdep.h13
-rw-r--r--gdb/i386bsd-nat.c33
-rw-r--r--gdb/i386fbsd-nat.c15
-rw-r--r--gdb/i386gnu-nat.c6
-rw-r--r--gdb/i386nbsd-tdep.c11
-rw-r--r--gdb/i386obsd-nat.c7
-rw-r--r--gdb/i386obsd-tdep.c2
-rw-r--r--gdb/i386v4-nat.c2
-rw-r--r--gdb/i387-tdep.c206
-rw-r--r--gdb/i387-tdep.h31
-rw-r--r--gdb/ia64-aix-nat.c17
-rw-r--r--gdb/ia64-linux-nat.c6
-rw-r--r--gdb/ia64-tdep.c1683
-rw-r--r--gdb/infcall.c118
-rw-r--r--gdb/infcmd.c26
-rw-r--r--gdb/inferior.h1
-rw-r--r--gdb/inflow.c2
-rw-r--r--gdb/infptrace.c6
-rw-r--r--gdb/infrun.c24
-rw-r--r--gdb/infttrace.c8
-rw-r--r--gdb/interps.c2
-rw-r--r--gdb/interps.h2
-rw-r--r--gdb/irix4-nat.c207
-rw-r--r--gdb/irix5-nat.c22
-rw-r--r--gdb/jv-lang.c4
-rw-r--r--gdb/jv-typeprint.c4
-rw-r--r--gdb/jv-valprint.c2
-rw-r--r--gdb/language.c205
-rw-r--r--gdb/language.h8
-rw-r--r--gdb/lin-lwp.c267
-rw-r--r--gdb/linux-nat.c319
-rw-r--r--gdb/linux-nat.h9
-rw-r--r--gdb/linux-proc.c132
-rw-r--r--gdb/lynx-nat.c32
-rw-r--r--gdb/m2-lang.c6
-rw-r--r--gdb/m32r-tdep.c2
-rw-r--r--gdb/m68hc11-tdep.c9
-rw-r--r--gdb/m68k-tdep.c11
-rw-r--r--gdb/m68klinux-nat.c4
-rw-r--r--gdb/m68knbsd-nat.c12
-rw-r--r--gdb/macroexp.c4
-rw-r--r--gdb/main.c2
-rw-r--r--gdb/mcore-tdep.c24
-rw-r--r--gdb/mdebugread.c25
-rw-r--r--gdb/mi/ChangeLog29
-rw-r--r--gdb/mi/mi-cmd-env.c22
-rw-r--r--gdb/mi/mi-interp.c21
-rw-r--r--gdb/mi/mi-main.c15
-rw-r--r--gdb/minsyms.c29
-rw-r--r--gdb/mips-linux-tdep.c12
-rw-r--r--gdb/mips-nat.c12
-rw-r--r--gdb/mips-tdep.c149
-rw-r--r--gdb/mipsread.c8
-rw-r--r--gdb/mipsv4-nat.c22
-rw-r--r--gdb/mn10300-tdep.c20
-rw-r--r--gdb/ns32k-tdep.c12
-rw-r--r--gdb/ns32knbsd-nat.c4
-rw-r--r--gdb/objc-lang.c18
-rw-r--r--gdb/objfiles.c85
-rw-r--r--gdb/objfiles.h52
-rw-r--r--gdb/osabi.c21
-rw-r--r--gdb/p-lang.c8
-rw-r--r--gdb/p-typeprint.c8
-rw-r--r--gdb/p-valprint.c4
-rw-r--r--gdb/parse.c52
-rw-r--r--gdb/ppc-bdm.c2
-rw-r--r--gdb/ppc-linux-nat.c4
-rw-r--r--gdb/ppc-linux-tdep.c46
-rw-r--r--gdb/ppc-sysv-tdep.c499
-rw-r--r--gdb/ppc-tdep.h10
-rw-r--r--gdb/printcmd.c70
-rw-r--r--gdb/procfs.c4
-rw-r--r--gdb/regcache.c130
-rw-r--r--gdb/regcache.h4
-rw-r--r--gdb/reggroups.c15
-rw-r--r--gdb/remote-mips.c20
-rw-r--r--gdb/remote-sds.c2
-rw-r--r--gdb/remote-vx.c18
-rw-r--r--gdb/remote-vx68.c20
-rw-r--r--gdb/remote-vxmips.c28
-rw-r--r--gdb/remote-vxsparc.c30
-rw-r--r--gdb/remote.c2
-rw-r--r--gdb/rs6000-nat.c6
-rw-r--r--gdb/rs6000-tdep.c161
-rw-r--r--gdb/s390-tdep.c72
-rw-r--r--gdb/scm-exp.c5
-rw-r--r--gdb/scm-lang.c4
-rw-r--r--gdb/sh-stub.c6
-rw-r--r--gdb/sh-tdep.c2997
-rw-r--r--gdb/sh-tdep.h111
-rw-r--r--gdb/sh3-rom.c21
-rw-r--r--gdb/sh64-tdep.c2950
-rw-r--r--gdb/sol-thread.c15
-rw-r--r--gdb/solib-svr4.c29
-rw-r--r--gdb/solib.c6
-rw-r--r--gdb/somread.c12
-rw-r--r--gdb/somsolib.c3
-rw-r--r--gdb/source.c50
-rw-r--r--gdb/sparc-linux-nat.c6
-rw-r--r--gdb/sparc-nat.c70
-rw-r--r--gdb/sparc-tdep.c146
-rw-r--r--gdb/sparc64-tdep.c1500
-rw-r--r--gdb/sparc64-tdep.h103
-rw-r--r--gdb/sparc64fbsd-nat.c80
-rw-r--r--gdb/sparc64fbsd-tdep.c237
-rw-r--r--gdb/sparcbsd-nat.c126
-rw-r--r--gdb/sparcbsd-nat.h (renamed from gdb/config/mips/xm-irix4.h)27
-rw-r--r--gdb/sparcnbsd-tdep.c16
-rw-r--r--gdb/stabsread.c66
-rw-r--r--gdb/stack.c62
-rw-r--r--gdb/standalone.c17
-rw-r--r--gdb/std-regs.c2
-rw-r--r--gdb/sun3-nat.c20
-rw-r--r--gdb/symfile.c66
-rw-r--r--gdb/symmisc.c22
-rw-r--r--gdb/symtab.c97
-rw-r--r--gdb/symtab.h139
-rw-r--r--gdb/testsuite/ChangeLog125
-rw-r--r--gdb/testsuite/config.hin4
-rwxr-xr-xgdb/testsuite/configure166
-rw-r--r--gdb/testsuite/configure.in1
-rw-r--r--gdb/testsuite/gdb.arch/i386-prologue.c37
-rw-r--r--gdb/testsuite/gdb.arch/i386-prologue.exp78
-rw-r--r--gdb/testsuite/gdb.asm/asm-source.exp10
-rw-r--r--gdb/testsuite/gdb.asm/ia64.inc49
-rw-r--r--gdb/testsuite/gdb.asm/m32r.inc5
-rw-r--r--gdb/testsuite/gdb.asm/sh.inc85
-rw-r--r--gdb/testsuite/gdb.base/annota3.exp2
-rw-r--r--gdb/testsuite/gdb.base/attach.exp14
-rw-r--r--gdb/testsuite/gdb.base/completion.exp34
-rw-r--r--gdb/testsuite/gdb.base/detach.exp4
-rw-r--r--gdb/testsuite/gdb.base/dump.exp134
-rw-r--r--gdb/testsuite/gdb.base/float.exp10
-rw-r--r--gdb/testsuite/gdb.base/gcore.exp4
-rw-r--r--gdb/testsuite/gdb.base/gdb1250.c8
-rw-r--r--gdb/testsuite/gdb.base/interrupt.exp2
-rw-r--r--gdb/testsuite/gdb.base/relocate.exp4
-rw-r--r--gdb/testsuite/gdb.base/selftest.exp9
-rw-r--r--gdb/testsuite/gdb.cp/classes.exp10
-rw-r--r--gdb/testsuite/gdb.cp/psmang.exp226
-rw-r--r--gdb/testsuite/gdb.cp/psmang1.cc159
-rw-r--r--gdb/testsuite/gdb.cp/psmang2.cc152
-rw-r--r--gdb/testsuite/gdb.disasm/h8300s.exp128
-rw-r--r--gdb/testsuite/gdb.disasm/h8300s.s4
-rw-r--r--gdb/testsuite/gdb.gdb/observer.exp9
-rw-r--r--gdb/testsuite/gdb.gdb/xfullpath.exp11
-rw-r--r--gdb/testsuite/gdb.java/jmisc1.exp28
-rw-r--r--gdb/testsuite/gdb.mi/ChangeLog11
-rw-r--r--gdb/testsuite/gdb.mi/mi-basics.exp24
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-display.exp2
-rw-r--r--gdb/testsuite/gdb.mi/mi1-var-display.exp2
-rw-r--r--gdb/testsuite/gdb.mi/mi2-basics.exp246
-rw-r--r--gdb/testsuite/gdb.mi/mi2-break.exp138
-rw-r--r--gdb/testsuite/gdb.mi/mi2-cli.exp208
-rw-r--r--gdb/testsuite/gdb.mi/mi2-console.exp97
-rw-r--r--gdb/testsuite/gdb.mi/mi2-disassemble.exp178
-rw-r--r--gdb/testsuite/gdb.mi/mi2-eval.exp62
-rw-r--r--gdb/testsuite/gdb.mi/mi2-file.exp65
-rw-r--r--gdb/testsuite/gdb.mi/mi2-hack-cli.exp40
-rw-r--r--gdb/testsuite/gdb.mi/mi2-pthreads.exp221
-rw-r--r--gdb/testsuite/gdb.mi/mi2-read-memory.exp86
-rw-r--r--gdb/testsuite/gdb.mi/mi2-regs.exp129
-rw-r--r--gdb/testsuite/gdb.mi/mi2-return.exp72
-rw-r--r--gdb/testsuite/gdb.mi/mi2-simplerun.exp199
-rw-r--r--gdb/testsuite/gdb.mi/mi2-stack.exp203
-rw-r--r--gdb/testsuite/gdb.mi/mi2-stepi.exp86
-rw-r--r--gdb/testsuite/gdb.mi/mi2-syn-frame.exp111
-rw-r--r--gdb/testsuite/gdb.mi/mi2-until.exp127
-rw-r--r--gdb/testsuite/gdb.mi/mi2-var-block.exp173
-rw-r--r--gdb/testsuite/gdb.mi/mi2-var-child.exp1203
-rw-r--r--gdb/testsuite/gdb.mi/mi2-var-cmd.exp560
-rw-r--r--gdb/testsuite/gdb.mi/mi2-var-display.exp627
-rw-r--r--gdb/testsuite/gdb.mi/mi2-watch.exp166
-rw-r--r--gdb/testsuite/gdb.mi/pthreads.c23
-rw-r--r--gdb/testsuite/gdb.stabs/weird.exp2
-rw-r--r--gdb/testsuite/gdb.threads/gcore-thread.exp3
-rw-r--r--gdb/testsuite/gdb.threads/pthreads.c23
-rw-r--r--gdb/testsuite/gdb.trace/save-trace.exp3
-rw-r--r--gdb/thread-db.c57
-rw-r--r--gdb/top.c322
-rw-r--r--gdb/tracepoint.c6
-rw-r--r--gdb/trad-frame.c2
-rw-r--r--gdb/tui/ChangeLog4
-rw-r--r--gdb/tui/tui.h2
-rw-r--r--gdb/typeprint.c10
-rw-r--r--gdb/utils.c183
-rw-r--r--gdb/v850-tdep.c17
-rw-r--r--gdb/v850ice.c2
-rw-r--r--gdb/valarith.c20
-rw-r--r--gdb/valops.c40
-rw-r--r--gdb/value.h3
-rw-r--r--gdb/values.c67
-rw-r--r--gdb/varobj.c2
-rw-r--r--gdb/vax-tdep.c9
-rw-r--r--gdb/version.in2
-rw-r--r--gdb/win32-nat.c5
-rw-r--r--gdb/x86-64-linux-nat.c162
-rw-r--r--gdb/x86-64-linux-tdep.c4
-rw-r--r--gdb/x86-64-tdep.c32
-rw-r--r--gdb/x86-64-tdep.h17
-rw-r--r--gdb/xcoffread.c6
-rw-r--r--gdb/xstormy16-tdep.c16
-rw-r--r--include/ChangeLog34
-rw-r--r--include/bfdlink.h113
-rw-r--r--include/coff/ChangeLog15
-rw-r--r--include/coff/i860.h33
-rw-r--r--include/coff/ti.h36
-rw-r--r--include/dis-asm.h227
-rw-r--r--include/elf/ChangeLog28
-rw-r--r--include/elf/dwarf2.h69
-rw-r--r--include/elf/msp430.h7
-rw-r--r--include/elf/reloc-macros.h23
-rw-r--r--include/elf/v850.h5
-rw-r--r--include/floatformat.h19
-rw-r--r--include/nlm/ChangeLog4
-rw-r--r--include/nlm/internal.h4
-rw-r--r--include/opcode/ChangeLog39
-rw-r--r--include/opcode/alpha.h7
-rw-r--r--include/opcode/arc.h52
-rw-r--r--include/opcode/cgen.h177
-rw-r--r--include/opcode/d10v.h5
-rw-r--r--include/opcode/d30v.h4
-rw-r--r--include/opcode/i370.h8
-rw-r--r--include/opcode/i860.h6
-rw-r--r--include/opcode/or32.h130
-rw-r--r--include/opcode/pj.h4
-rw-r--r--include/opcode/ppc.h57
-rw-r--r--include/opcode/sparc.h23
-rw-r--r--include/opcode/tic80.h25
-rw-r--r--include/opcode/v850.h9
-rwxr-xr-xinstall-sh167
-rw-r--r--libiberty/ChangeLog38
-rw-r--r--libiberty/aclocal.m495
-rwxr-xr-xlibiberty/configure7932
-rw-r--r--libiberty/configure.in36
-rw-r--r--libiberty/cp-demangle.c4
-rw-r--r--libiberty/fibheap.c2
-rw-r--r--libiberty/floatformat.c49
-rwxr-xr-xmissing166
-rw-r--r--opcodes/ChangeLog215
-rw-r--r--opcodes/Makefile.am44
-rw-r--r--opcodes/Makefile.in52
-rw-r--r--opcodes/arm-dis.c20
-rw-r--r--opcodes/cgen-asm.c90
-rw-r--r--opcodes/cgen-asm.in29
-rw-r--r--opcodes/cgen-dis.c58
-rw-r--r--opcodes/cgen-dis.in104
-rw-r--r--opcodes/cgen-ibld.in136
-rw-r--r--opcodes/cgen-opc.c129
-rw-r--r--opcodes/cgen.sh21
-rw-r--r--opcodes/dep-in.sed1
-rw-r--r--opcodes/dis-init.c41
-rw-r--r--opcodes/fr30-asm.c29
-rw-r--r--opcodes/fr30-dis.c104
-rw-r--r--opcodes/fr30-ibld.c136
-rw-r--r--opcodes/frv-asm.c85
-rw-r--r--opcodes/frv-desc.c556
-rw-r--r--opcodes/frv-desc.h24
-rw-r--r--opcodes/frv-dis.c111
-rw-r--r--opcodes/frv-ibld.c166
-rw-r--r--opcodes/frv-opc.c90
-rw-r--r--opcodes/frv-opc.h7
-rw-r--r--opcodes/i370-dis.c7
-rw-r--r--opcodes/i370-opc.c122
-rw-r--r--opcodes/i386-dis.c281
-rw-r--r--opcodes/i960-dis.c105
-rw-r--r--opcodes/ia64-opc.c88
-rw-r--r--opcodes/ip2k-asm.c29
-rw-r--r--opcodes/ip2k-dis.c104
-rw-r--r--opcodes/ip2k-ibld.c136
-rw-r--r--opcodes/iq2000-asm.c29
-rw-r--r--opcodes/iq2000-dis.c104
-rw-r--r--opcodes/iq2000-ibld.c136
-rw-r--r--opcodes/m32r-asm.c29
-rw-r--r--opcodes/m32r-dis.c104
-rw-r--r--opcodes/m32r-ibld.c136
-rw-r--r--opcodes/openrisc-asm.c29
-rw-r--r--opcodes/openrisc-dis.c104
-rw-r--r--opcodes/openrisc-ibld.c136
-rw-r--r--opcodes/po/fr.po38
-rw-r--r--opcodes/ppc-dis.c107
-rw-r--r--opcodes/ppc-opc.c650
-rw-r--r--opcodes/v850-dis.c28
-rw-r--r--opcodes/v850-opc.c134
-rw-r--r--opcodes/xstormy16-asm.c29
-rw-r--r--opcodes/xstormy16-dis.c104
-rw-r--r--opcodes/xstormy16-ibld.c136
-rw-r--r--readline/doc/ChangeLog.gdb4
-rw-r--r--readline/doc/history.0660
-rw-r--r--sim/ChangeLog25
-rw-r--r--sim/MAINTAINERS13
-rw-r--r--sim/Makefile.in2
-rw-r--r--sim/common/ChangeLog23
-rw-r--r--sim/common/Make-common.in18
-rw-r--r--sim/common/cgen-par.h4
-rw-r--r--sim/common/cgen.sh11
-rw-r--r--sim/common/dv-glue.c4
-rw-r--r--sim/common/gennltvals.sh5
-rw-r--r--sim/common/nltvals.def26
-rw-r--r--sim/common/sim-options.c5
-rwxr-xr-xsim/configure3
-rw-r--r--sim/configure.in3
-rw-r--r--sim/i960/ChangeLog5
-rw-r--r--sim/i960/Makefile.in9
-rw-r--r--sim/m32r/ChangeLog5
-rw-r--r--sim/m32r/Makefile.in7
-rw-r--r--sim/m68hc11/ChangeLog54
-rw-r--r--sim/m68hc11/dv-m68hc11.c20
-rw-r--r--sim/m68hc11/dv-m68hc11sio.c5
-rw-r--r--sim/m68hc11/dv-m68hc11spi.c8
-rw-r--r--sim/m68hc11/dv-m68hc11tim.c190
-rw-r--r--sim/m68hc11/interp.c108
-rw-r--r--sim/m68hc11/interrupts.c63
-rw-r--r--sim/m68hc11/m68hc11_sim.c28
-rw-r--r--sim/m68hc11/sim-main.h32
-rw-r--r--sim/mn10300/ChangeLog9
-rw-r--r--sim/mn10300/dv-mn103ser.c4
-rw-r--r--sim/mn10300/dv-mn103tim.c13
-rw-r--r--sim/sh/ChangeLog10
-rw-r--r--sim/sh/gencode.c7
-rw-r--r--sim/sh/interp.c52
-rw-r--r--sim/testsuite/ChangeLog28
-rw-r--r--sim/testsuite/lib/sim-defs.exp8
-rw-r--r--sim/v850/ChangeLog12
-rw-r--r--sim/v850/interp.c1
-rw-r--r--sim/v850/v850-dc1
-rw-r--r--sim/v850/v850.igen62
-rwxr-xr-xsymlink-tree25
576 files changed, 34890 insertions, 22041 deletions
diff --git a/ChangeLog b/ChangeLog
index ec71cb3a8be..6bd77ff454a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,79 @@
+2003-09-12 Michael Chastain <mec@shout.net>
+
+ Fix PR gdb/857.
+ * src-release (do-proto-topleve): Remove junk files
+ intl/config.cache, intl/config.status,
+ intl/config.h, intl/stamp-h.
+
+2003-09-14 Andrew Cagney <cagney@redhat.com>
+
+ * src-release (dejagnu.tar): New target.
+ (dejagnu.tar.bz2): Recursively call "gdb-taz" rule.
+ (do-djunpack): Use $(PACKAGE) for the package name.
+
+2003-09-04 DJ Delorie <dj@redhat.com>
+
+ * configure: Regenerate.
+
+2003-09-04 Robert Millan <robertmh@gnu.org>
+
+ * configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu triplet.
+
+2003-09-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * configure.in: Ensure arguments to sed are properly spaced.
+ * configure: Regenerate.
+
+2003-08-28 Daniel Jacobowitz <drow@mvista.com>
+
+ Merge from gcc:
+ 2003-07-20 Phil Edwards <pme@gcc.gnu.org>
+ * install-sh: Update to newer upstream versions (associated with
+ aclocal 1.7).
+ * missing: Likewise, plus $1Help2man -> $1 typo fix.
+
+2003-08-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * configure.in: Set RAW_CXX_FOR_TARGET if unset.
+ * configure: Regenerated.
+
+2003-08-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/no-executables.m4: New file.
+
+2003-08-23 Phil Edwards <pme@gcc.gnu.org>
+
+ * configure.in: Use newline instead of semicolon when assuming
+ shell arguments in a for loop.
+ * configure: Regenerated.
+
+2003-08-20 Geoffrey Keating <geoffk@apple.com>
+
+ PR 8180
+ * configure.in: When testing with_libs and with_headers, treat
+ 'no' as unset. Based on a patch by Dan Kegel <dank@kegel.com>.
+ * configure: Regenerate.
+
+ * configure.in (TOPLEVEL_CONFIGURE_ARGUMENTS): Quote properly for
+ make, shell, etc.
+ (baseargs): Likewise.
+ * configure: Regenerate.
+
+2003-08-19 Geoffrey Keating <geoffk@apple.com>
+
+ * configure.in: Disable libgcj for darwin not on powerpc.
+ * configure: Rebuild.
+
+2003-08-15 Michael Chastain <mec@shout.net>
+
+ * src-release (do-proto-toplev): Remove junk files
+ dejagnu/example/calc/config.status,
+ dejagnu/example/calc/config.log.
+
+2003-08-14 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * config-ml.in, symlink-tree: Add license.
+
2003-08-01 Nathanael Nerode <neroden@gcc.gnu.org>
Merge from gcc:
diff --git a/MAINTAINERS b/MAINTAINERS
index 718d3741000..c9ad6b30f87 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4,7 +4,7 @@ Please do not make ChangeLog entries.
COPYING, COPYING.LIB, README
http://gnu.org.
-Makefile.in; configure; configure.in
+Makefile.in; configure; configure.in; src-release
Please notify the following of any committed patches.
binutils@sources.redhat.com
gdb-patches@sources.redhat.com
@@ -34,12 +34,12 @@ readline/support/config.sub; readline/support/config.guess
gdb-patches@sources.redhat.com
dejagnu/
- Send all patches to:
- http://www.gnu.org/software/dejagnu/
- mail:bug-dejagnu@gnu.org
- For changes to the local repostory, send them to
- gdb-patches@sources.redhat.com when generic; and sid@,
- binutils@, gcc@, etc. for sub-components.
+ dejagnu: http://www.gnu.org/software/dejagnu/
+ Patches to bug-dejagnu@gnu.org
+ Avoid making changes to the local repository; please send
+ patches upstream. Important and approved patches can be
+ checked into the src repository, otheriwse patches will be
+ imported from the next release.
gdb/; mmalloc/; readline/; sim/; GDB's part of include/ & dejagnu/
gdb: http://sources.redhat.com/gdb/
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e4c4f92d6ef..a2f8f86e2c9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,6 +1,346 @@
+2003-09-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-ia64.c (elfNN_ia64_special_sections): Mark all sections
+ started with ".sbss" or "".sdata" as SHF_IA_64_SHORT.
+
+2003-09-10 John David Anglin <dave.anglin@nrc-cnrc.nrc.ca>
+ Randolph Chung <randolph@tausq.org>
+
+ * elf32-hppa.c (struct elf32_hppa_link_hash_entry,
+ hppa_link_hash_newfunc, hppa_build_one_stub,
+ elf32_hppa_adjust_dynamic_symbol, mark_PIC_calls, allocate_plt_static,
+ allocate_dynrelocs, elf32_hppa_size_dynamic_sections,
+ elf32_hppa_finish_dynamic_symbol): Remove pic_call field and all code
+ for generating import stubs for calls to statically linked PIC
+ functions.
+ (hppa_type_of_stub): Don't generate an import stub for calls to
+ statically linked pic functions. Generate import stubs for calls
+ in a shared object, to functions not in a regular file, and to
+ defined weak functions. Add new argument INFO.
+ (hppa_build_one_stub): Don't undef ADDIL_DP.
+ (elf32_hppa_check_relocs): Don't set SEC_HAS_GOT_REF flag.
+ (elf32_hppa_size_stubs): Pass info to hppa_type_of_stub.
+ (final_link_relocate): Change all DLTIND relocs to DPREL relocs in a
+ non-shared link. Convert instructions that use the the linkage table
+ pointer, or a facsimile thereof, to use the global data pointer when
+ the reloc has been changed.
+
+2003-09-08 Joel Brobecker <brobecker@gnat.com>
+
+ * archures.c: Add new machine names for hppa.
+ * bfd-in2.h: Regenerate.
+ * cpu-hppa.c: Use the new machine names.
+
+2003-09-06 Stephane Carrez <stcarrez@nerim.fr>
+
+ * elf32-m68hc1x.h (struct m68hc11_elf_link_hash_table): Remove
+ all_local_syms member.
+ * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Use bfd_elf_get_elf_syms
+ to get the local symbols.
+
+2003-09-06 Stephane Carrez <stcarrez@nerim.fr>
+
+ * elf32-m68hc12.c (elf32_m68hc12_special_sections): New for hc11.
+ (elf_backend_special_sections): Define.a
+
+ PR savannah/4950:
+ * elf32-m68hc11.c (elf32_m68hc11_special_sections): The .vectors
+ section is read-only.
+
+2003-09-04 Nick Clifton <nickc@redhat.com>
+
+ * archures.c (bfd_mach_v850e1): Define.
+ * bfd-in2.h: Regenerate.
+ * cpu-v850.h (scan): Accept bfd_mach_v850e1.
+ (arch_info_struct): Include an entry for bfd_mach_v850e1.
+ * elf32-v850.c (v850_elf_object_p): Accept E_V850E1_ARCH flag.
+ (v850_elf_final_write_processing): Accept bfd_mach_v850e1.
+ (v850_elf_print_private_bfd_data): Interpret E_V850E1_ARCH flag.
+ (v850_elf_merge_private_bfd_data): Allow v850e1 binaries to be
+ linked with v850e binaries. Mark the output as v850e.
+
+2003-09-03 Nick Clifton <nickc@redhat.com>
+
+ * cofflink.c (_bfd_coff_link_input_bfd): Do not skip section
+ symbols that are used in relocs.
+
+2003-08-30 Robert Millan <robertmh@gnu.org>
+
+ * configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu triplet.
+ * config.bfd: Likewise.
+ * configure: Regenerate.
+
+2003-08-31 Christian Groessler <chris@groessler.org>
+
+ * elf32-i860.c (i860_howto_pc26_reloc): Finish relocation here
+ instead of returning bfd_reloc_continue.
+
+2003-08-31 Andreas Jaeger <aj@suse.de>
+
+ * merge.c: Update to ISO C90.
+
+2003-08-27 Ian Lance Taylor <ian@airs.com>
+
+ * configure.in: Check for strtoull.
+ * bfd.c (bfd_scan_vma): Use strtoull when available.
+ * configure, config.in: Regenerate.
+
+ * configure.in: Define and substitute BFD_HOST_LONG_LONG.
+ * bfd-in.h: Define BFD_HOST_LONG_LONG. Test it rather than
+ __GNUC__ when deciding whether to use long long for
+ BFD_HOST_64_BIT.
+ * configure, Makefile.in, doc/Makefile.in, bfd-in2.h: Regenerate.
+
+2003-08-27 Christian Groessler <chris@groessler.org>
+
+ * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc,
+ i860_howto_splitn_reloc, i860_howto_highadj_reloc): New
+ functions.
+ (elf32_i860_howto_table): Insert the new functions as
+ 'special_function's in the proper reloc type entries.
+
+2003-08-27 Richard Sandiford <rsandifo@redhat.com>
+
+ * elf32-frv.c (elf32_frv_relocate_section): Use
+ _bfd_elf_rela_local_sym.
+
+2003-08-26 Michael Snyder <msnyder@redhat.com>
+
+ * cpu-frv.c: Remove unused enum.
+
+2003-08-25 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
+
+ * reloc.c: Fix documentation for MIPS ELF relocations.
+ libbfd.h: Regenerate.
+ bfd-in2.h: Regenerate.
+
+2003-08-24 Jason Eckhardt <jle@rice.edu>
+
+ * coff-i860.c (CALC_ADDEND): Define to be a no-op.
+
+2003-08-24 Jason Eckhardt <jle@rice.edu>
+
+ * elf32-i860.c (elf32_i860_relocate_pc16): Subtract 4 and
+ shift by 2 before storing the relocated value.
+
+2003-08-23 Jason Eckhardt <jle@rice.edu>
+
+ * coff-i860.c (coff_i860_reloc_nyi): New function.
+ (howto_table): Add entries for relocations PAIR, HIGHADJ, HIGH,
+ LOWn, SPLITn, and BRADDR.
+ (RTYPE2HOWTO): Check that the r_type is within the howto_table
+ before trying to access the entry.
+ (coff_i860_rtype_to_howto): Likewise.
+ (coff_i860_reloc_type_lookup): New function.
+ (i860_reloc_processing): New function.
+ (coff_bfd_reloc_type_lookup): Define macro.
+ (RELOC_PROCESSING): Define macro.
+ Minor formatting adjustments.
+
+2003-08-23 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.h (elf_link_add_object_symbols): Don't crash on NULL owner.
+
+2003-08-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elfxx-ia64.c (elfNN_ia64_create_dynamic_sections): Align the
+ .got section at 8 bytes.
+
+2003-08-21 Nick Clifton <nickc@redhat.com>
+
+ * cofflink.c: Update to ISO C90 and tidy up formatting.
+
+2003-08-21 Randolph Chung <tausq@debian.org>
+
+ * elf32-hppa.c (elf32_hppa_object_p): For elf32-hppa-linux, objects
+ can have OSABI=Linux or OSABI=SysV. Check for both.
+ * elf64-hppa.c (elf64_hppa_object_p): Likewise.
+
+2003-08-21 Nick Clifton <nickc@redhat.com>
+
+ * po/sv.po: Updated Swedish translation.
+
+2003-08-20 Richard Sandiford <rsandifo@redhat.com>
+
+ * elf64-mips.c (elf_backend_copy_indirect_symbol): Define.
+
+2003-08-20 Nick Clifton <nickc@redhat.com>
+
+ * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): New macro used to
+ replace some duplicated code in most elfxx-xxxx.c files. This
+ version uses the new fields in bfd_link_info.
+
+ * elf-m10300.c (mn10300_elf_relocate_section): Use new macro.
+ * elf32-arm.h (elf32_arm_relocate_section): Likewise.
+ * elf32-cris.c (cris_elf_relocate_section): Likewise.
+ * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
+ * elf32-i386.c (elf_i386_relocate_section): Likewise.
+ * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
+ * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-s390.c (elf_s390_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf32-vax.c (elf_vax_relocate_section): Likewise.
+ * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+ * elf64-s390.c (elf_s390_relocate_section): Likewise.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+ * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
+ * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
+
+ * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols,
+ elf_hppa_remark_useless_dynamic_symbols,
+ elf_hppa_relocate_section): Use the new fields in
+ bfd_link_info structure.
+ * elf32-sh.c (sh_elf_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
+ * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
+ * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
+ * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise.
+ * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
+
+ * elflink.h (elf_link_output_extsym): Fix test for reporting
+ undefined symbols in shared libraries. Remove redundant test
+ of shlib_undefined when reporting references to forced local
+ symbols.
+
+2003-08-18 Andreas Schwab <schwab@suse.de>
+
+ * libpei.h (bfd_pe_executable_p): Also recognize efi-app
+ executables.
+
+2003-08-17 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * simple.c (bfd_simple_get_relocated_section_contents): Move
+ reloc_done hack to before first bfd_section_size call. Change all
+ returns to use new wrapper macro RETURN, restoring sec->reloc_done.
+
+2003-08-16 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c: Don't include elf/ppc.h.
+
+2003-08-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Fix PT_DYNAMIC
+ code to work with 64-bit bfds.
+
+2003-08-14 Alan Modra <amodra@bigpond.net.au>
+
+ * dep-in.sed: Remove libintl.h.
+ * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Unset LC_COLLATE.
+ (POTFILES.in): Remove target.
+ * Makefile.in: Regenerate.
+
+2003-08-12 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_next_input_section): Update comment.
+ (ppc64_elf_relocate_section): For zero sym R_PPC64_TOC relocs,
+ use the function sym from the previous reloc.
+
+2003-08-11 Jakub Jelinek <jakub@redhat.com>
+
+ * elf32-i386.c (elf_i386_relocate_section): Make undefined symbols
+ fatal if -pie.
+ * elf32-s390.c (elf_s390_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+ * elf64-s390.c (elf_s390_relocate_section): Likewise.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+ * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
+ * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ (ppc_elf_relocate_section) <case R_PPC_RELAX32>: Issue fatal error
+ on undefined symbols if -pie.
+ * elf32-sh.c (sh_elf_relocate_section): Likewise.
+
+2003-08-11 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_relocate_section): Add special case for crt1.o
+ branch to __libc_start_main.
+
+2003-08-08 Dmitry Diky <diwil@mail.ru>
+
+ * archures.c: Add xW42 and xE42 parts. Sort MPU list according to
+ gcc order.
+ * cpu-msp430.c: Likewise.
+ * elf32-msp430.c: Likewise.
+ * bfd-in2.h: Regenerate.
+
+2003-08-07 Alan Modra <amodra@bigpond.net.au>
+
+ * elfxx-target.h: Remove PTR cast.
+ * targets.c (bfd_target): Make backend_data const void *.
+ * elf-bfd.h: Constify all occurrences of struct elf_backend_data.
+ * elf-m10300.c: Likewise.
+ * elf.c: Likewise.
+ * elf32-hppa.c: Likewise.
+ * elf32-i386.c: Likewise.
+ * elf32-m68hc1x.c: Likewise.
+ * elf32-ppc.c: Likewise.
+ * elf32-s390.c: Likewise.
+ * elf32-sh.c: Likewise.
+ * elf32-sh64.c: Likewise.
+ * elf32-sparc.c: Likewise.
+ * elf32-xtensa.c: Likewise.
+ * elf64-mips.c: Likewise.
+ * elf64-ppc.c: Likewise.
+ * elf64-s390.c: Likewise.
+ * elf64-sh64.c: Likewise.
+ * elf64-sparc.c: Likewise.
+ * elf64-x86-64.c: Likewise.
+ * elfcode.h: Likewise.
+ * elfcore.h: Likewise.
+ * elflink.c: Likewise.
+ * elflink.h: Likewise.
+ * elfxx-ia64.c: Likewise.
+ * elfxx-mips.c: Likewise.
+ * elfxx-mips.h: Likewise.
+ * elf.c (prep_headers): Remove useless check for null backend_data.
+ * bfd-in2.h: Regenerate.
+
+ * elf-bfd.h: Remove PARAMS macro. Replace PTR with void *.
+ (NAME): Use ## rather than CONCAT4 macro.
+ * elfcode.h: Remove one remaining PARAMS macro.
+ * elf-eh-frame.c: Convert to C90, remove unneeded casts and prototypes.
+ * elf-strtab.c: Likewise.
+ * elf-hppa.h: Likewise.
+ * elf32-hppa.h: Likewise.
+ * elf32-hppa.c: Likewise.
+ (elf32_hppa_add_symbol_hook): Delete.
+ (elf_backend_add_symbol_hook): Don't define.
+ * libhppa.h: Convert to C90. Replace INLINE with inline.
+
+2003-08-06 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc_stub_name): Tweak names for better readability.
+ (ppc64_elf_adjust_dynamic_symbol): Allow copy relocs against
+ function descriptors, but warn.
+ (ppc_build_one_stub): Remove a couple of vars. Move code creating
+ stub syms so that we can avoid a stub sym if we already have a
+ plt sym. Do not redefine an existing symbol.
+ (ppc64_elf_build_stubs): When --emit-stub-syms, print a symbol for
+ glink.
+
+2003-08-06 Nick Clifton <nickc@redhat.com>
+
+ * po/fr.po: Updated French translation.
+
+2003-08-06 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.c (_bfd_elf_create_dynamic_sections): Mark .dynbss with
+ SEC_LINKER_CREATED.
+
+2003-08-05 Daniel Jacobowitz <drow@mvista.com>
+
+ * elf32-arm.h (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
+ (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Use it.
+
2003-08-03 Jeff Muizelaar <muizelaar@rogers.com>
- * coffcode.h: (coff_slurp_line_table) Return with a warning
+ * coffcode.h (coff_slurp_line_table): Return with a warning
message if the line number table could not be read.
2003-08-04 Nick Clifton <nickc@redhat.com>
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index eaec9756365..d27c873e904 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -606,23 +606,15 @@ SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES)
BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES)
- for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp.src \
+ for file in $(SRC_POTFILES); do echo $$file; done \
+ | LC_COLLATE= sort > tmp.src \
&& mv tmp.src $(srcdir)/po/SRC-POTFILES.in
po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
- for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp.bld \
+ for file in $(BLD_POTFILES); do echo $$file; done \
+ | LC_COLLATE= sort > tmp.bld \
&& mv tmp.bld $(srcdir)/po/BLD-POTFILES.in
-# The following target is retained for upgrade purposes.
-# This target used to exist in older versions of this makefile, and was
-# referenced by <builddir>/po/Makefile (which is created from <srcdir>/po/Make-in)
-# So old versions of <builddir>/po/Makefile will try to regenerate themselves
-# when make is next run, but that dependency cannot be completed without a build
-# of po/POTFILES.in. Hence the presence of this rule. This rule will be deleted
-# once it is no longer needed - probably in the fall of 2001.
-po/POTFILES.in:
-
-
diststuff: info
# Various kinds of .o files to put in libbfd.a:
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 38ecfab33a6..5ca774a112d 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
@@ -68,6 +68,7 @@ AS = @AS@
BFD_HOST_64BIT_LONG = @BFD_HOST_64BIT_LONG@
BFD_HOST_64_BIT = @BFD_HOST_64_BIT@
BFD_HOST_64_BIT_DEFINED = @BFD_HOST_64_BIT_DEFINED@
+BFD_HOST_LONG_LONG = @BFD_HOST_LONG_LONG@
BFD_HOST_U_64_BIT = @BFD_HOST_U_64_BIT@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
@@ -811,7 +812,7 @@ configure.in version.h
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP_ENV = --best
SOURCES = $(libbfd_a_SOURCES) $(libbfd_la_SOURCES)
OBJECTS = $(libbfd_a_OBJECTS) $(libbfd_la_OBJECTS)
@@ -1177,22 +1178,15 @@ mostlyclean distclean maintainer-clean
po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES)
- for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp.src \
+ for file in $(SRC_POTFILES); do echo $$file; done \
+ | LC_COLLATE= sort > tmp.src \
&& mv tmp.src $(srcdir)/po/SRC-POTFILES.in
po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES)
- for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp.bld \
+ for file in $(BLD_POTFILES); do echo $$file; done \
+ | LC_COLLATE= sort > tmp.bld \
&& mv tmp.bld $(srcdir)/po/BLD-POTFILES.in
-# The following target is retained for upgrade purposes.
-# This target used to exist in older versions of this makefile, and was
-# referenced by <builddir>/po/Makefile (which is created from <srcdir>/po/Make-in)
-# So old versions of <builddir>/po/Makefile will try to regenerate themselves
-# when make is next run, but that dependency cannot be completed without a build
-# of po/POTFILES.in. Hence the presence of this rule. This rule will be deleted
-# once it is no longer needed - probably in the fall of 2001.
-po/POTFILES.in:
-
diststuff: info
stamp-ofiles: Makefile
diff --git a/bfd/archures.c b/bfd/archures.c
index 77f6a9e6e13..9033f2826de 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -199,6 +199,10 @@ DESCRIPTION
.#define bfd_mach_rs6k_rsc 6003
.#define bfd_mach_rs6k_rs2 6002
. bfd_arch_hppa, {* HP PA RISC *}
+.#define bfd_mach_hppa10 10
+.#define bfd_mach_hppa11 11
+.#define bfd_mach_hppa20 20
+.#define bfd_mach_hppa20w 25
. bfd_arch_d10v, {* Mitsubishi D10V *}
.#define bfd_mach_d10v 1
.#define bfd_mach_d10v_ts2 2
@@ -253,6 +257,7 @@ DESCRIPTION
. bfd_arch_v850, {* NEC V850 *}
.#define bfd_mach_v850 1
.#define bfd_mach_v850e 'E'
+.#define bfd_mach_v850e1 '1'
. bfd_arch_arc, {* ARC Cores *}
.#define bfd_mach_arc_5 5
.#define bfd_mach_arc_6 6
@@ -301,19 +306,20 @@ DESCRIPTION
. bfd_arch_xstormy16,
.#define bfd_mach_xstormy16 1
. bfd_arch_msp430, {* Texas Instruments MSP430 architecture. *}
-.#define bfd_mach_msp110 110
.#define bfd_mach_msp11 11
+.#define bfd_mach_msp110 110
.#define bfd_mach_msp12 12
.#define bfd_mach_msp13 13
.#define bfd_mach_msp14 14
-.#define bfd_mach_msp41 41
+.#define bfd_mach_msp15 15
+.#define bfd_mach_msp16 16
.#define bfd_mach_msp31 31
.#define bfd_mach_msp32 32
.#define bfd_mach_msp33 33
+.#define bfd_mach_msp41 41
+.#define bfd_mach_msp42 42
.#define bfd_mach_msp43 43
.#define bfd_mach_msp44 44
-.#define bfd_mach_msp15 15
-.#define bfd_mach_msp16 16
. bfd_arch_xtensa, {* Tensilica's Xtensa cores. *}
.#define bfd_mach_xtensa 1
. bfd_arch_last
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 63c86f7f91f..49ebee7237a 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -51,6 +51,7 @@ extern "C" {
#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
+#define BFD_HOST_LONG_LONG @BFD_HOST_LONG_LONG@
#if @BFD_HOST_64_BIT_DEFINED@
#define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
#define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@
@@ -96,21 +97,19 @@ typedef int bfd_boolean;
/* Support for different sizes of target format ints and addresses.
If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be
- set to 1 above. Otherwise, if gcc is being used, this code will
- use gcc's "long long" type. Otherwise, BFD_HOST_64_BIT must be
- defined above. */
+ set to 1 above. Otherwise, if the host compiler used during
+ configuration supports long long, this code will use it.
+ Otherwise, BFD_HOST_64_BIT must be defined above. */
#ifndef BFD_HOST_64_BIT
# if BFD_HOST_64BIT_LONG
# define BFD_HOST_64_BIT long
# define BFD_HOST_U_64_BIT unsigned long
# else
-# ifdef __GNUC__
-# if __GNUC__ >= 2
+# if BFD_HOST_LONG_LONG
# define BFD_HOST_64_BIT long long
# define BFD_HOST_U_64_BIT unsigned long long
-# endif /* __GNUC__ >= 2 */
-# endif /* ! defined (__GNUC__) */
+# endif /* ! BFD_HOST_LONG_LONG */
# endif /* ! BFD_HOST_64BIT_LONG */
#endif /* ! defined (BFD_HOST_64_BIT) */
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 11d4e90e34f..a7cca3e26cd 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -58,6 +58,7 @@ extern "C" {
#define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@
#define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@
+#define BFD_HOST_LONG_LONG @BFD_HOST_LONG_LONG@
#if @BFD_HOST_64_BIT_DEFINED@
#define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
#define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@
@@ -103,21 +104,19 @@ typedef int bfd_boolean;
/* Support for different sizes of target format ints and addresses.
If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be
- set to 1 above. Otherwise, if gcc is being used, this code will
- use gcc's "long long" type. Otherwise, BFD_HOST_64_BIT must be
- defined above. */
+ set to 1 above. Otherwise, if the host compiler used during
+ configuration supports long long, this code will use it.
+ Otherwise, BFD_HOST_64_BIT must be defined above. */
#ifndef BFD_HOST_64_BIT
# if BFD_HOST_64BIT_LONG
# define BFD_HOST_64_BIT long
# define BFD_HOST_U_64_BIT unsigned long
# else
-# ifdef __GNUC__
-# if __GNUC__ >= 2
+# if BFD_HOST_LONG_LONG
# define BFD_HOST_64_BIT long long
# define BFD_HOST_U_64_BIT unsigned long long
-# endif /* __GNUC__ >= 2 */
-# endif /* ! defined (__GNUC__) */
+# endif /* ! BFD_HOST_LONG_LONG */
# endif /* ! BFD_HOST_64BIT_LONG */
#endif /* ! defined (BFD_HOST_64_BIT) */
@@ -1629,6 +1628,10 @@ enum bfd_architecture
#define bfd_mach_rs6k_rsc 6003
#define bfd_mach_rs6k_rs2 6002
bfd_arch_hppa, /* HP PA RISC */
+#define bfd_mach_hppa10 10
+#define bfd_mach_hppa11 11
+#define bfd_mach_hppa20 20
+#define bfd_mach_hppa20w 25
bfd_arch_d10v, /* Mitsubishi D10V */
#define bfd_mach_d10v 1
#define bfd_mach_d10v_ts2 2
@@ -1683,6 +1686,7 @@ enum bfd_architecture
bfd_arch_v850, /* NEC V850 */
#define bfd_mach_v850 1
#define bfd_mach_v850e 'E'
+#define bfd_mach_v850e1 '1'
bfd_arch_arc, /* ARC Cores */
#define bfd_mach_arc_5 5
#define bfd_mach_arc_6 6
@@ -1731,19 +1735,20 @@ enum bfd_architecture
bfd_arch_xstormy16,
#define bfd_mach_xstormy16 1
bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
-#define bfd_mach_msp110 110
#define bfd_mach_msp11 11
+#define bfd_mach_msp110 110
#define bfd_mach_msp12 12
#define bfd_mach_msp13 13
#define bfd_mach_msp14 14
-#define bfd_mach_msp41 41
+#define bfd_mach_msp15 15
+#define bfd_mach_msp16 16
#define bfd_mach_msp31 31
#define bfd_mach_msp32 32
#define bfd_mach_msp33 33
+#define bfd_mach_msp41 41
+#define bfd_mach_msp42 42
#define bfd_mach_msp43 43
#define bfd_mach_msp44 44
-#define bfd_mach_msp15 15
-#define bfd_mach_msp16 16
bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
#define bfd_mach_xtensa 1
bfd_arch_last
@@ -2323,6 +2328,7 @@ to compensate for the borrow when the low bits are added. */
BFD_RELOC_MIPS_RELGOT,
BFD_RELOC_MIPS_JALR,
+
/* Fujitsu Frv Relocations. */
BFD_RELOC_FRV_LABEL16,
BFD_RELOC_FRV_LABEL24,
@@ -2334,6 +2340,7 @@ to compensate for the borrow when the low bits are added. */
BFD_RELOC_FRV_GPRELHI,
BFD_RELOC_FRV_GPRELLO,
+
/* This is a 24bit GOT-relative reloc for the mn10300. */
BFD_RELOC_MN10300_GOTOFF24,
@@ -4339,7 +4346,7 @@ typedef struct bfd_target
/* Data for use by back-end routines, which isn't
generic enough to belong in this structure. */
- void *backend_data;
+ const void *backend_data;
} bfd_target;
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 472d0ed9fbf..29577476541 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -920,6 +920,11 @@ bfd_scan_vma (const char *string, const char **end, int base)
if (sizeof (bfd_vma) <= sizeof (unsigned long))
return strtoul (string, (char **) end, base);
+#ifdef HAVE_STRTOULL
+ if (sizeof (bfd_vma) <= sizeof (unsigned long long))
+ return strtoull (string, (char **) end, base);
+#endif
+
if (base == 0)
{
if (string[0] == '0')
diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c
index 1906615bee3..74b599c91da 100644
--- a/bfd/coff-i860.c
+++ b/bfd/coff-i860.c
@@ -1,4 +1,4 @@
-/* BFD back-end for Intel 860 COFF files.
+/* BFD back-end for Intel i860 COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Created mostly by substituting "860" for "386" in coff-i386.c
@@ -126,6 +126,22 @@ coff_i860_reloc (bfd *abfd,
return bfd_reloc_continue;
}
+/* This is just a temporary measure until we teach bfd to generate
+ these relocations. */
+
+static bfd_reloc_status_type
+coff_i860_reloc_nyi (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
+{
+ reloc_howto_type *howto = reloc_entry->howto;
+ fprintf (stderr, _("Relocation `%s' not yet implemented\n"), howto->name);
+}
+
#ifndef PCRELOFFSET
#define PCRELOFFSET FALSE
#endif
@@ -249,17 +265,184 @@ static reloc_howto_type howto_table[] =
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- PCRELOFFSET) /* pcrel_offset */
+ PCRELOFFSET), /* pcrel_offset */
+ EMPTY_HOWTO (0x15),
+ EMPTY_HOWTO (0x16),
+ EMPTY_HOWTO (0x17),
+ EMPTY_HOWTO (0x18),
+ EMPTY_HOWTO (0x19),
+ EMPTY_HOWTO (0x1a),
+ EMPTY_HOWTO (0x1b),
+ HOWTO (COFF860_R_PAIR, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_i860_reloc_nyi, /* special_function */
+ "PAIR", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ EMPTY_HOWTO (0x1d),
+ HOWTO (COFF860_R_HIGH, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_i860_reloc, /* special_function */
+ "HIGH", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_LOW0, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_i860_reloc, /* special_function */
+ "LOW0", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_LOW1, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_i860_reloc, /* special_function */
+ "LOW1", /* name */
+ FALSE, /* partial_inplace */
+ 0xfffe, /* src_mask */
+ 0xfffe, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_LOW2, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_i860_reloc, /* special_function */
+ "LOW2", /* name */
+ FALSE, /* partial_inplace */
+ 0xfffc, /* src_mask */
+ 0xfffc, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_LOW3, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_i860_reloc, /* special_function */
+ "LOW3", /* name */
+ FALSE, /* partial_inplace */
+ 0xfff8, /* src_mask */
+ 0xfff8, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_LOW4, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_i860_reloc, /* special_function */
+ "LOW4", /* name */
+ FALSE, /* partial_inplace */
+ 0xfff0, /* src_mask */
+ 0xfff0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_SPLIT0, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_i860_reloc_nyi, /* special_function */
+ "SPLIT0", /* name */
+ FALSE, /* partial_inplace */
+ 0x1f07ff, /* src_mask */
+ 0x1f07ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_SPLIT1, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_i860_reloc_nyi, /* special_function */
+ "SPLIT1", /* name */
+ FALSE, /* partial_inplace */
+ 0x1f07fe, /* src_mask */
+ 0x1f07fe, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_SPLIT2, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_i860_reloc_nyi, /* special_function */
+ "SPLIT2", /* name */
+ FALSE, /* partial_inplace */
+ 0x1f07fc, /* src_mask */
+ 0x1f07fc, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_HIGHADJ, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ coff_i860_reloc_nyi, /* special_function */
+ "HIGHADJ", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_BRADDR, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ coff_i860_reloc_nyi, /* special_function */
+ "BRADDR", /* name */
+ FALSE, /* partial_inplace */
+ 0x3ffffff, /* src_mask */
+ 0x3ffffff, /* dst_mask */
+ TRUE) /* pcrel_offset */
};
-/* Turn a howto into a reloc nunmber */
+/* Turn a howto into a reloc number. */
#define SELECT_RELOC(x,howto) { x.r_type = howto->type; }
#define BADMAG(x) I860BADMAG(x)
#define I860 1 /* Customize coffcode.h */
-#define RTYPE2HOWTO(cache_ptr, dst) \
- (cache_ptr)->howto = howto_table + (dst)->r_type;
+#define RTYPE2HOWTO(cache_ptr, dst) \
+ ((cache_ptr)->howto = \
+ ((dst)->r_type < sizeof (howto_table) / sizeof (howto_table[0]) \
+ ? howto_table + (dst)->r_type \
+ : NULL))
/* For 860 COFF a STYP_NOLOAD | STYP_BSS section is part of a shared
library. On some other COFF targets STYP_BSS is normally
@@ -279,6 +462,9 @@ static reloc_howto_type howto_table[] =
FIXME: This macro refers to symbols and asect; these are from the
calling function, not the macro arguments. */
+/* FIXME: This was copied from the i386 version originally but
+ appears to be wrong for i860. For now we'll do nothing. */
+#if 0
#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \
{ \
coff_symbol_type *coffsym = (coff_symbol_type *) NULL; \
@@ -298,6 +484,9 @@ static reloc_howto_type howto_table[] =
if (ptr && howto_table[reloc.r_type].pc_relative) \
cache_ptr->addend += asect->vma; \
}
+#else
+#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr)
+#endif
/* We use the special COFF backend linker. */
#define coff_relocate_section _bfd_coff_generic_relocate_section
@@ -313,6 +502,12 @@ coff_i860_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
reloc_howto_type *howto;
+ if (rel->r_type > sizeof (howto_table) / sizeof (howto_table[0]))
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return NULL;
+ }
+
howto = howto_table + rel->r_type;
if (howto->pc_relative)
@@ -346,7 +541,111 @@ coff_i860_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
return howto;
}
-#define coff_rtype_to_howto coff_i860_rtype_to_howto
+static reloc_howto_type *
+coff_i860_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
+{
+ switch (code)
+ {
+ case BFD_RELOC_32:
+ return howto_table + R_DIR32;
+ case BFD_RELOC_860_PC26:
+ return howto_table + COFF860_R_BRADDR;
+ case BFD_RELOC_860_PC16:
+ /* ??? How to handle PC16 for COFF? SPLIT0 is close for now. */
+ return howto_table + COFF860_R_SPLIT0;
+ case BFD_RELOC_860_LOW0:
+ return howto_table + COFF860_R_LOW0;
+ case BFD_RELOC_860_SPLIT0:
+ return howto_table + COFF860_R_SPLIT0;
+ case BFD_RELOC_860_LOW1:
+ return howto_table + COFF860_R_LOW1;
+ case BFD_RELOC_860_SPLIT1:
+ return howto_table + COFF860_R_SPLIT1;
+ case BFD_RELOC_860_LOW2:
+ return howto_table + COFF860_R_LOW2;
+ case BFD_RELOC_860_SPLIT2:
+ return howto_table + COFF860_R_SPLIT2;
+ case BFD_RELOC_860_LOW3:
+ return howto_table + COFF860_R_LOW3;
+ case BFD_RELOC_860_HIGHADJ:
+ return howto_table + COFF860_R_HIGHADJ;
+ case BFD_RELOC_860_HIGH:
+ return howto_table + COFF860_R_HIGH;
+ default:
+ BFD_FAIL ();
+ return 0;
+ }
+}
+
+/* This is called from coff_slurp_reloc_table for each relocation
+ entry. This special handling is due to the `PAIR' relocation
+ which has a different meaning for the `r_symndx' field. */
+
+static void
+i860_reloc_processing (arelent *cache_ptr, struct internal_reloc *dst,
+ asymbol **symbols, bfd *abfd, asection *asect)
+{
+ if (dst->r_type == COFF860_R_PAIR)
+ {
+ /* Handle the PAIR relocation specially. */
+ cache_ptr->howto = howto_table + dst->r_type;
+ cache_ptr->address = dst->r_vaddr;
+ cache_ptr->addend = dst->r_symndx;
+ cache_ptr->sym_ptr_ptr= bfd_abs_section_ptr->symbol_ptr_ptr;
+ }
+ else
+ {
+ /* For every other relocation, do exactly what coff_slurp_reloc_table
+ would do (which this code is taken directly from). */
+ asymbol *ptr = NULL;
+ cache_ptr->address = dst->r_vaddr;
+
+ if (dst->r_symndx != -1)
+ {
+ if (dst->r_symndx < 0 || dst->r_symndx >= obj_conv_table_size (abfd))
+ {
+ (*_bfd_error_handler)
+ (_("%s: warning: illegal symbol index %ld in relocs"),
+ bfd_archive_filename (abfd), dst->r_symndx);
+ cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+ ptr = NULL;
+ }
+ else
+ {
+ cache_ptr->sym_ptr_ptr = (symbols
+ + obj_convert (abfd)[dst->r_symndx]);
+ ptr = *(cache_ptr->sym_ptr_ptr);
+ }
+ }
+ else
+ {
+ cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+ ptr = NULL;
+ }
+
+ /* The symbols definitions that we have read in have been
+ relocated as if their sections started at 0. But the offsets
+ refering to the symbols in the raw data have not been
+ modified, so we have to have a negative addend to compensate.
+
+ Note that symbols which used to be common must be left alone. */
+
+ /* Calculate any reloc addend by looking at the symbol. */
+ CALC_ADDEND (abfd, ptr, (*dst), cache_ptr);
+
+ cache_ptr->address -= asect->vma;
+
+ /* Fill in the cache_ptr->howto field from dst->r_type. */
+ RTYPE2HOWTO (cache_ptr, dst);
+ }
+}
+
+#define coff_rtype_to_howto coff_i860_rtype_to_howto
+#define coff_bfd_reloc_type_lookup coff_i860_reloc_type_lookup
+
+#define RELOC_PROCESSING(relent, reloc, symbols, abfd, section) \
+ i860_reloc_processing (relent, reloc, symbols, abfd, section)
#include "coffcode.h"
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 59b32ed1f6f..c1eee1b2325 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -3,21 +3,21 @@
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
-This file is part of BFD, the Binary File Descriptor library.
+ 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 free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* This file contains the COFF backend linker code. */
@@ -28,22 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "coff/internal.h"
#include "libcoff.h"
-static bfd_boolean coff_link_add_object_symbols
- PARAMS ((bfd *, struct bfd_link_info *));
-static bfd_boolean coff_link_check_archive_element
- PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *));
-static bfd_boolean coff_link_check_ar_symbols
- PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *));
-static bfd_boolean coff_link_add_symbols
- PARAMS ((bfd *, struct bfd_link_info *));
-static char *dores_com
- PARAMS ((char *, bfd *, int));
-static char *get_name
- PARAMS ((char *, char **));
-static int process_embedded_commands
- PARAMS ((bfd *, struct bfd_link_info *, bfd *));
-static void mark_relocs
- PARAMS ((struct coff_final_link_info *, bfd *));
+static bfd_boolean coff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info);
+static bfd_boolean coff_link_check_archive_element (bfd *abfd, struct bfd_link_info *info, bfd_boolean *pneeded);
+static bfd_boolean coff_link_add_symbols (bfd *abfd, struct bfd_link_info *info);
/* Return TRUE if SYM is a weak, external symbol. */
#define IS_WEAK_EXTERNAL(abfd, sym) \
@@ -67,10 +54,9 @@ static void mark_relocs
/* Create an entry in a COFF linker hash table. */
struct bfd_hash_entry *
-_bfd_coff_link_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+_bfd_coff_link_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
struct coff_link_hash_entry *ret = (struct coff_link_hash_entry *) entry;
@@ -103,12 +89,11 @@ _bfd_coff_link_hash_newfunc (entry, table, string)
/* Initialize a COFF linker hash table. */
bfd_boolean
-_bfd_coff_link_hash_table_init (table, abfd, newfunc)
- struct coff_link_hash_table *table;
- bfd *abfd;
- struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *,
- struct bfd_hash_table *,
- const char *));
+_bfd_coff_link_hash_table_init (struct coff_link_hash_table *table,
+ bfd *abfd,
+ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
+ struct bfd_hash_table *,
+ const char *))
{
table->stab_info = NULL;
return _bfd_link_hash_table_init (&table->root, abfd, newfunc);
@@ -117,15 +102,15 @@ _bfd_coff_link_hash_table_init (table, abfd, newfunc)
/* Create a COFF linker hash table. */
struct bfd_link_hash_table *
-_bfd_coff_link_hash_table_create (abfd)
- bfd *abfd;
+_bfd_coff_link_hash_table_create (bfd *abfd)
{
struct coff_link_hash_table *ret;
bfd_size_type amt = sizeof (struct coff_link_hash_table);
- ret = (struct coff_link_hash_table *) bfd_malloc (amt);
+ ret = bfd_malloc (amt);
if (ret == NULL)
return NULL;
+
if (! _bfd_coff_link_hash_table_init (ret, abfd,
_bfd_coff_link_hash_newfunc))
{
@@ -138,10 +123,9 @@ _bfd_coff_link_hash_table_create (abfd)
/* Create an entry in a COFF debug merge hash table. */
struct bfd_hash_entry *
-_bfd_coff_debug_merge_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+_bfd_coff_debug_merge_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
struct coff_debug_merge_hash_entry *ret =
(struct coff_debug_merge_hash_entry *) entry;
@@ -171,17 +155,15 @@ _bfd_coff_debug_merge_hash_newfunc (entry, table, string)
appropriate. */
bfd_boolean
-_bfd_coff_link_add_symbols (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+_bfd_coff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
{
switch (bfd_get_format (abfd))
{
case bfd_object:
return coff_link_add_object_symbols (abfd, info);
case bfd_archive:
- return (_bfd_generic_link_add_archive_symbols
- (abfd, info, coff_link_check_archive_element));
+ return _bfd_generic_link_add_archive_symbols
+ (abfd, info, coff_link_check_archive_element);
default:
bfd_set_error (bfd_error_wrong_format);
return FALSE;
@@ -191,52 +173,17 @@ _bfd_coff_link_add_symbols (abfd, info)
/* Add symbols from a COFF object file. */
static bfd_boolean
-coff_link_add_object_symbols (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+coff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
{
if (! _bfd_coff_get_external_symbols (abfd))
return FALSE;
if (! coff_link_add_symbols (abfd, info))
return FALSE;
- if (! info->keep_memory)
- {
- if (! _bfd_coff_free_symbols (abfd))
- return FALSE;
- }
- return TRUE;
-}
-
-/* Check a single archive element to see if we need to include it in
- the link. *PNEEDED is set according to whether this element is
- needed in the link or not. This is called via
- _bfd_generic_link_add_archive_symbols. */
-
-static bfd_boolean
-coff_link_check_archive_element (abfd, info, pneeded)
- bfd *abfd;
- struct bfd_link_info *info;
- bfd_boolean *pneeded;
-{
- if (! _bfd_coff_get_external_symbols (abfd))
- return FALSE;
-
- if (! coff_link_check_ar_symbols (abfd, info, pneeded))
+ if (! info->keep_memory
+ && ! _bfd_coff_free_symbols (abfd))
return FALSE;
- if (*pneeded)
- {
- if (! coff_link_add_symbols (abfd, info))
- return FALSE;
- }
-
- if (! info->keep_memory || ! *pneeded)
- {
- if (! _bfd_coff_free_symbols (abfd))
- return FALSE;
- }
-
return TRUE;
}
@@ -244,10 +191,9 @@ coff_link_check_archive_element (abfd, info, pneeded)
included in the link. */
static bfd_boolean
-coff_link_check_ar_symbols (abfd, info, pneeded)
- bfd *abfd;
- struct bfd_link_info *info;
- bfd_boolean *pneeded;
+coff_link_check_ar_symbols (bfd *abfd,
+ struct bfd_link_info *info,
+ bfd_boolean *pneeded)
{
bfd_size_type symesz;
bfd_byte *esym;
@@ -263,7 +209,7 @@ coff_link_check_ar_symbols (abfd, info, pneeded)
struct internal_syment sym;
enum coff_symbol_classification classification;
- bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &sym);
+ bfd_coff_swap_sym_in (abfd, esym, &sym);
classification = bfd_coff_classify_symbol (abfd, &sym);
if (classification == COFF_SYMBOL_GLOBAL
@@ -275,22 +221,17 @@ coff_link_check_ar_symbols (abfd, info, pneeded)
/* This symbol is externally visible, and is defined by this
object file. */
-
name = _bfd_coff_internal_syment_name (abfd, &sym, buf);
if (name == NULL)
return FALSE;
h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE);
- /* auto import */
- if (!h && info->pei386_auto_import)
- {
- if (!strncmp (name,"__imp_", 6))
- {
- h =
- bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE,
- TRUE);
- }
- }
+ /* Auto import. */
+ if (!h
+ && info->pei386_auto_import
+ && !strncmp (name,"__imp_", 6))
+ h = bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE, TRUE);
+
/* We are only interested in symbols that are currently
undefined. If a symbol is currently known to be common,
COFF linkers do not bring in an object file which defines
@@ -312,12 +253,38 @@ coff_link_check_ar_symbols (abfd, info, pneeded)
return TRUE;
}
+/* Check a single archive element to see if we need to include it in
+ the link. *PNEEDED is set according to whether this element is
+ needed in the link or not. This is called via
+ _bfd_generic_link_add_archive_symbols. */
+
+static bfd_boolean
+coff_link_check_archive_element (bfd *abfd,
+ struct bfd_link_info *info,
+ bfd_boolean *pneeded)
+{
+ if (! _bfd_coff_get_external_symbols (abfd))
+ return FALSE;
+
+ if (! coff_link_check_ar_symbols (abfd, info, pneeded))
+ return FALSE;
+
+ if (*pneeded
+ && ! coff_link_add_symbols (abfd, info))
+ return FALSE;
+
+ if ((! info->keep_memory || ! *pneeded)
+ && ! _bfd_coff_free_symbols (abfd))
+ return FALSE;
+
+ return TRUE;
+}
+
/* Add all the symbols from an object file to the hash table. */
static bfd_boolean
-coff_link_add_symbols (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+coff_link_add_symbols (bfd *abfd,
+ struct bfd_link_info *info)
{
unsigned int n_tmask = coff_data (abfd)->local_n_tmask;
unsigned int n_btshft = coff_data (abfd)->local_n_btshft;
@@ -346,7 +313,7 @@ coff_link_add_symbols (abfd, info)
/* We keep a list of the linker hash table entries that correspond
to particular symbols. */
amt = symcount * sizeof (struct coff_link_hash_entry *);
- sym_hash = (struct coff_link_hash_entry **) bfd_zalloc (abfd, amt);
+ sym_hash = bfd_zalloc (abfd, amt);
if (sym_hash == NULL && symcount != 0)
goto error_return;
obj_coff_sym_hashes (abfd) = sym_hash;
@@ -361,7 +328,7 @@ coff_link_add_symbols (abfd, info)
enum coff_symbol_classification classification;
bfd_boolean copy;
- bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &sym);
+ bfd_coff_swap_sym_in (abfd, esym, &sym);
classification = bfd_coff_classify_symbol (abfd, &sym);
if (classification != COFF_SYMBOL_LOCAL)
@@ -564,9 +531,9 @@ coff_link_add_symbols (abfd, info)
for (i = 0, eaux = esym + symesz, iaux = alloc;
i < sym.n_numaux;
i++, eaux += symesz, iaux++)
- bfd_coff_swap_aux_in (abfd, (PTR) eaux, sym.n_type,
+ bfd_coff_swap_aux_in (abfd, eaux, sym.n_type,
sym.n_sclass, (int) i,
- sym.n_numaux, (PTR) iaux);
+ sym.n_numaux, iaux);
(*sym_hash)->aux = alloc;
}
}
@@ -582,7 +549,6 @@ coff_link_add_symbols (abfd, info)
FIXME: This is not at all the right place to do this.
For example, it won't help objdump. This needs to be
done when we swap in the section header. */
-
BFD_ASSERT ((*sym_hash)->numaux == 1);
if (section->_raw_size == 0)
section->_raw_size = (*sym_hash)->aux[0].x_scn.x_scnlen;
@@ -620,7 +586,7 @@ coff_link_add_symbols (abfd, info)
if (secdata == NULL)
{
amt = sizeof (struct coff_section_tdata);
- stab->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
+ stab->used_by_bfd = bfd_zalloc (abfd, amt);
if (stab->used_by_bfd == NULL)
goto error_return;
secdata = coff_section_data (abfd, stab);
@@ -648,9 +614,8 @@ coff_link_add_symbols (abfd, info)
/* Do the final link step. */
bfd_boolean
-_bfd_coff_final_link (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+_bfd_coff_final_link (bfd *abfd,
+ struct bfd_link_info *info)
{
bfd_size_type symesz;
struct coff_final_link_info finfo;
@@ -792,7 +757,7 @@ _bfd_coff_final_link (abfd, info)
the target_index fields are 1 based. */
amt = abfd->section_count + 1;
amt *= sizeof (struct coff_link_section_info);
- finfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt);
+ finfo.section_info = bfd_malloc (amt);
if (finfo.section_info == NULL)
goto error_return;
for (i = 0; i <= abfd->section_count; i++)
@@ -835,12 +800,10 @@ _bfd_coff_final_link (abfd, info)
BFD_ASSERT (info->relocatable);
amt = o->reloc_count;
amt *= sizeof (struct internal_reloc);
- finfo.section_info[o->target_index].relocs =
- (struct internal_reloc *) bfd_malloc (amt);
+ finfo.section_info[o->target_index].relocs = bfd_malloc (amt);
amt = o->reloc_count;
amt *= sizeof (struct coff_link_hash_entry *);
- finfo.section_info[o->target_index].rel_hashes =
- (struct coff_link_hash_entry **) bfd_malloc (amt);
+ finfo.section_info[o->target_index].rel_hashes = bfd_malloc (amt);
if (finfo.section_info[o->target_index].relocs == NULL
|| finfo.section_info[o->target_index].rel_hashes == NULL)
goto error_return;
@@ -873,21 +836,21 @@ _bfd_coff_final_link (abfd, info)
/* Allocate some buffers used while linking. */
amt = max_sym_count * sizeof (struct internal_syment);
- finfo.internal_syms = (struct internal_syment *) bfd_malloc (amt);
+ finfo.internal_syms = bfd_malloc (amt);
amt = max_sym_count * sizeof (asection *);
- finfo.sec_ptrs = (asection **) bfd_malloc (amt);
+ finfo.sec_ptrs = bfd_malloc (amt);
amt = max_sym_count * sizeof (long);
- finfo.sym_indices = (long *) bfd_malloc (amt);
- finfo.outsyms = (bfd_byte *) bfd_malloc ((max_sym_count + 1) * symesz);
+ finfo.sym_indices = bfd_malloc (amt);
+ finfo.outsyms = bfd_malloc ((max_sym_count + 1) * symesz);
amt = max_lineno_count * bfd_coff_linesz (abfd);
- finfo.linenos = (bfd_byte *) bfd_malloc (amt);
- finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size);
+ finfo.linenos = bfd_malloc (amt);
+ finfo.contents = bfd_malloc (max_contents_size);
amt = max_reloc_count * relsz;
- finfo.external_relocs = (bfd_byte *) bfd_malloc (amt);
+ finfo.external_relocs = bfd_malloc (amt);
if (! info->relocatable)
{
amt = max_reloc_count * sizeof (struct internal_reloc);
- finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt);
+ finfo.internal_relocs = bfd_malloc (amt);
}
if ((finfo.internal_syms == NULL && max_sym_count > 0)
|| (finfo.sec_ptrs == NULL && max_sym_count > 0)
@@ -996,8 +959,8 @@ _bfd_coff_final_link (abfd, info)
file_ptr pos;
finfo.last_file.n_value = obj_raw_syment_count (abfd);
- bfd_coff_swap_sym_out (abfd, (PTR) &finfo.last_file,
- (PTR) finfo.outsyms);
+ bfd_coff_swap_sym_out (abfd, &finfo.last_file,
+ finfo.outsyms);
pos = obj_sym_filepos (abfd) + finfo.last_file_index * symesz;
if (bfd_seek (abfd, pos, SEEK_SET) != 0
@@ -1012,8 +975,7 @@ _bfd_coff_final_link (abfd, info)
{
finfo.failed = FALSE;
coff_link_hash_traverse (coff_hash_table (info),
- _bfd_coff_write_task_globals,
- (PTR) &finfo);
+ _bfd_coff_write_task_globals, &finfo);
if (finfo.failed)
goto error_return;
}
@@ -1021,8 +983,7 @@ _bfd_coff_final_link (abfd, info)
/* Write out the global symbols. */
finfo.failed = FALSE;
coff_link_hash_traverse (coff_hash_table (info),
- _bfd_coff_write_global_sym,
- (PTR) &finfo);
+ _bfd_coff_write_global_sym, &finfo);
if (finfo.failed)
goto error_return;
@@ -1039,7 +1000,7 @@ _bfd_coff_final_link (abfd, info)
the symbol indices to use for relocs against them, and we can
finally write out the relocs. */
amt = max_output_reloc_count * relsz;
- external_relocs = (bfd_byte *) bfd_malloc (amt);
+ external_relocs = bfd_malloc (amt);
if (external_relocs == NULL)
goto error_return;
@@ -1064,11 +1025,11 @@ _bfd_coff_final_link (abfd, info)
BFD_ASSERT ((*rel_hash)->indx >= 0);
irel->r_symndx = (*rel_hash)->indx;
}
- bfd_coff_swap_reloc_out (abfd, (PTR) irel, (PTR) erel);
+ bfd_coff_swap_reloc_out (abfd, irel, erel);
}
if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0
- || (bfd_bwrite ((PTR) external_relocs,
+ || (bfd_bwrite (external_relocs,
(bfd_size_type) relsz * o->reloc_count, abfd)
!= (bfd_size_type) relsz * o->reloc_count))
goto error_return;
@@ -1175,17 +1136,15 @@ _bfd_coff_final_link (abfd, info)
return FALSE;
}
-/* parse out a -heap <reserved>,<commit> line */
+/* Parse out a -heap <reserved>,<commit> line. */
static char *
-dores_com (ptr, output_bfd, heap)
- char *ptr;
- bfd *output_bfd;
- int heap;
+dores_com (char *ptr, bfd *output_bfd, int heap)
{
if (coff_data(output_bfd)->pe)
{
int val = strtoul (ptr, &ptr, 0);
+
if (heap)
pe_data(output_bfd)->pe_opthdr.SizeOfHeapReserve = val;
else
@@ -1203,9 +1162,8 @@ dores_com (ptr, output_bfd, heap)
return ptr;
}
-static char *get_name(ptr, dst)
-char *ptr;
-char **dst;
+static char *
+get_name (char *ptr, char **dst)
{
while (*ptr == ' ')
ptr++;
@@ -1216,85 +1174,89 @@ char **dst;
return ptr+1;
}
-/* Process any magic embedded commands in a section called .drectve */
+/* Process any magic embedded commands in a section called .drectve. */
static int
-process_embedded_commands (output_bfd, info, abfd)
- bfd *output_bfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- bfd *abfd;
+process_embedded_commands (bfd *output_bfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ bfd *abfd)
{
asection *sec = bfd_get_section_by_name (abfd, ".drectve");
char *s;
char *e;
char *copy;
+
if (!sec)
return 1;
copy = bfd_malloc (sec->_raw_size);
if (!copy)
return 0;
- if (! bfd_get_section_contents(abfd, sec, copy, (bfd_vma) 0, sec->_raw_size))
+
+ if (! bfd_get_section_contents (abfd, sec, copy, (bfd_vma) 0, sec->_raw_size))
{
free (copy);
return 0;
}
e = copy + sec->_raw_size;
+
for (s = copy; s < e ; )
{
- if (s[0]!= '-') {
- s++;
- continue;
- }
+ if (s[0]!= '-')
+ {
+ s++;
+ continue;
+ }
if (strncmp (s,"-attr", 5) == 0)
{
char *name;
char *attribs;
asection *asec;
-
int loop = 1;
int had_write = 0;
int had_read = 0;
int had_exec= 0;
int had_shared= 0;
+
s += 5;
- s = get_name(s, &name);
- s = get_name(s, &attribs);
- while (loop) {
- switch (*attribs++)
- {
- case 'W':
- had_write = 1;
- break;
- case 'R':
- had_read = 1;
- break;
- case 'S':
- had_shared = 1;
- break;
- case 'X':
- had_exec = 1;
- break;
- default:
- loop = 0;
- }
- }
+ s = get_name (s, &name);
+ s = get_name (s, &attribs);
+
+ while (loop)
+ {
+ switch (*attribs++)
+ {
+ case 'W':
+ had_write = 1;
+ break;
+ case 'R':
+ had_read = 1;
+ break;
+ case 'S':
+ had_shared = 1;
+ break;
+ case 'X':
+ had_exec = 1;
+ break;
+ default:
+ loop = 0;
+ }
+ }
asec = bfd_get_section_by_name (abfd, name);
- if (asec) {
- if (had_exec)
- asec->flags |= SEC_CODE;
- if (!had_write)
- asec->flags |= SEC_READONLY;
- }
+ if (asec)
+ {
+ if (had_exec)
+ asec->flags |= SEC_CODE;
+ if (!had_write)
+ asec->flags |= SEC_READONLY;
+ }
}
else if (strncmp (s,"-heap", 5) == 0)
- {
- s = dores_com (s+5, output_bfd, 1);
- }
+ s = dores_com (s+5, output_bfd, 1);
+
else if (strncmp (s,"-stack", 6) == 0)
- {
- s = dores_com (s+6, output_bfd, 0);
- }
+ s = dores_com (s+6, output_bfd, 0);
+
else
s++;
}
@@ -1305,13 +1267,10 @@ process_embedded_commands (output_bfd, info, abfd)
/* Place a marker against all symbols which are used by relocations.
This marker can be picked up by the 'do we skip this symbol ?'
loop in _bfd_coff_link_input_bfd() and used to prevent skipping
- that symbol.
- */
+ that symbol. */
static void
-mark_relocs (finfo, input_bfd)
- struct coff_final_link_info * finfo;
- bfd * input_bfd;
+mark_relocs (struct coff_final_link_info *finfo, bfd *input_bfd)
{
asection * a;
@@ -1349,12 +1308,9 @@ mark_relocs (finfo, input_bfd)
/* Place a mark in the sym_indices array (whose entries have
been initialised to 0) for all of the symbols that are used
in the relocation table. This will then be picked up in the
- skip/don't pass */
-
+ skip/don't-skip pass. */
for (; irel < irelend; irel++)
- {
- finfo->sym_indices[ irel->r_symndx ] = -1;
- }
+ finfo->sym_indices[ irel->r_symndx ] = -1;
}
}
@@ -1362,9 +1318,7 @@ mark_relocs (finfo, input_bfd)
handles all the sections and relocations of the input file at once. */
bfd_boolean
-_bfd_coff_link_input_bfd (finfo, input_bfd)
- struct coff_final_link_info *finfo;
- bfd *input_bfd;
+_bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd)
{
unsigned int n_tmask = coff_data (input_bfd)->local_n_tmask;
unsigned int n_btshft = coff_data (input_bfd)->local_n_btshft;
@@ -1372,8 +1326,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
unsigned int n_btmask = coff_data (input_bfd)->local_n_btmask;
#endif
bfd_boolean (*adjust_symndx)
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
- struct internal_reloc *, bfd_boolean *));
+ (bfd *, struct bfd_link_info *, bfd *, asection *,
+ struct internal_reloc *, bfd_boolean *);
bfd *output_bfd;
const char *strings;
bfd_size_type syment_base;
@@ -1419,20 +1373,18 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
output_index = syment_base;
outsym = finfo->outsyms;
- if (coff_data (output_bfd)->pe)
- {
- if (! process_embedded_commands (output_bfd, finfo->info, input_bfd))
- return FALSE;
- }
+ if (coff_data (output_bfd)->pe
+ && ! process_embedded_commands (output_bfd, finfo->info, input_bfd))
+ return FALSE;
- /* If we are going to perform relocations and also strip/discard some symbols
- then we must make sure that we do not strip/discard those symbols that are
- going to be involved in the relocations */
+ /* If we are going to perform relocations and also strip/discard some
+ symbols then we must make sure that we do not strip/discard those
+ symbols that are going to be involved in the relocations. */
if (( finfo->info->strip != strip_none
|| finfo->info->discard != discard_none)
&& finfo->info->relocatable)
{
- /* mark the symbol array as 'not-used' */
+ /* Mark the symbol array as 'not-used'. */
memset (indexp, 0, obj_raw_syment_count (input_bfd) * sizeof * indexp);
mark_relocs (finfo, input_bfd);
@@ -1447,7 +1399,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
bfd_boolean dont_skip_symbol;
int add;
- bfd_coff_swap_sym_in (input_bfd, (PTR) esym, (PTR) isymp);
+ bfd_coff_swap_sym_in (input_bfd, esym, isymp);
/* Make a copy of *isymp so that the relocate_section function
always sees the original values. This is more reliable than
@@ -1529,13 +1481,12 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
/* Skip section symbols for sections which are not going to be
emitted. */
if (!skip
+ && dont_skip_symbol == 0
&& isym.n_sclass == C_STAT
&& isym.n_type == T_NULL
- && isym.n_numaux > 0)
- {
- if ((*secpp)->output_section == bfd_abs_section_ptr)
- skip = TRUE;
- }
+ && isym.n_numaux > 0
+ && (*secpp)->output_section == bfd_abs_section_ptr)
+ skip = TRUE;
#endif
/* If we stripping debugging symbols, and this is a debugging
@@ -1620,16 +1571,16 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
out to be a duplicate, we pass this address to
bfd_release. */
amt = sizeof (struct coff_debug_merge_type);
- mt = (struct coff_debug_merge_type *) bfd_alloc (input_bfd, amt);
+ mt = bfd_alloc (input_bfd, amt);
if (mt == NULL)
return FALSE;
mt->class = isym.n_sclass;
/* Pick up the aux entry, which points to the end of the tag
entries. */
- bfd_coff_swap_aux_in (input_bfd, (PTR) (esym + isymesz),
+ bfd_coff_swap_aux_in (input_bfd, (esym + isymesz),
isym.n_type, isym.n_sclass, 0, isym.n_numaux,
- (PTR) &aux);
+ &aux);
/* Gather the elements. */
epp = &mt->elements;
@@ -1644,11 +1595,10 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
char elebuf[SYMNMLEN + 1];
char *name_copy;
- bfd_coff_swap_sym_in (input_bfd, (PTR) esl, (PTR) islp);
+ bfd_coff_swap_sym_in (input_bfd, esl, islp);
amt = sizeof (struct coff_debug_merge_element);
- *epp = ((struct coff_debug_merge_element *)
- bfd_alloc (input_bfd, amt));
+ *epp = bfd_alloc (input_bfd, amt);
if (*epp == NULL)
return FALSE;
@@ -1658,7 +1608,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
return FALSE;
amt = strlen (elename) + 1;
- name_copy = (char *) bfd_alloc (input_bfd, amt);
+ name_copy = bfd_alloc (input_bfd, amt);
if (name_copy == NULL)
return FALSE;
strcpy (name_copy, elename);
@@ -1673,16 +1623,15 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
union internal_auxent eleaux;
long indx;
- bfd_coff_swap_aux_in (input_bfd, (PTR) (esl + isymesz),
+ bfd_coff_swap_aux_in (input_bfd, (esl + isymesz),
islp->n_type, islp->n_sclass, 0,
- islp->n_numaux, (PTR) &eleaux);
+ islp->n_numaux, &eleaux);
indx = eleaux.x_sym.x_tagndx.l;
/* FIXME: If this tagndx entry refers to a symbol
defined later in this file, we just ignore it.
Handling this correctly would be tedious, and may
not be required. */
-
if (indx > 0
&& (indx
< ((esym -
@@ -1705,7 +1654,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
type. We always output the type if it has no elements,
for simplicity. */
if (mt->elements == NULL)
- bfd_release (input_bfd, (PTR) mt);
+ bfd_release (input_bfd, mt);
else
{
struct coff_debug_merge_type *mtl;
@@ -1741,7 +1690,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
else
{
/* This is a redefinition which can be merged. */
- bfd_release (input_bfd, (PTR) mt);
+ bfd_release (input_bfd, mt);
*indexp = mtl->indx;
add = (eslend - esym) / isymesz;
skip = TRUE;
@@ -1765,8 +1714,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
bfd_coff_symname_in_debug. That is only true for
XCOFF, and XCOFF requires different linking code
anyhow. */
- name = _bfd_coff_internal_syment_name (input_bfd, &isym,
- (char *) NULL);
+ name = _bfd_coff_internal_syment_name (input_bfd, &isym, NULL);
if (name == NULL)
return FALSE;
indx = _bfd_stringtab_add (finfo->strtab, name, hash, copy);
@@ -1839,7 +1787,6 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
it). We try to get this right, below, just before we
write the symbols out, but in the general case we may
have to write the symbol out twice. */
-
if (finfo->last_file_index != -1
&& finfo->last_file.n_value != (bfd_vma) output_index)
{
@@ -1850,11 +1797,11 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
{
/* The last C_FILE symbol is in this input file. */
bfd_coff_swap_sym_out (output_bfd,
- (PTR) &finfo->last_file,
- (PTR) (finfo->outsyms
- + ((finfo->last_file_index
- - syment_base)
- * osymesz)));
+ &finfo->last_file,
+ (finfo->outsyms
+ + ((finfo->last_file_index
+ - syment_base)
+ * osymesz)));
}
else
{
@@ -1864,8 +1811,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
symbol. We need to write it out again. We
borrow *outsym temporarily. */
bfd_coff_swap_sym_out (output_bfd,
- (PTR) &finfo->last_file,
- (PTR) outsym);
+ &finfo->last_file, outsym);
pos = obj_sym_filepos (output_bfd);
pos += finfo->last_file_index * osymesz;
if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
@@ -1885,8 +1831,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
isym.n_sclass = C_STAT;
/* Output the symbol. */
-
- bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) outsym);
+ bfd_coff_swap_sym_out (output_bfd, &isym, outsym);
*indexp = output_index;
@@ -1926,13 +1871,13 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
/* Fix up the aux entries. This must be done in a separate pass,
because we don't know the correct symbol indices until we have
already decided which symbols we are going to keep. */
-
esym = (bfd_byte *) obj_coff_external_syms (input_bfd);
esym_end = esym + obj_raw_syment_count (input_bfd) * isymesz;
isymp = finfo->internal_syms;
indexp = finfo->sym_indices;
sym_hash = obj_coff_sym_hashes (input_bfd);
outsym = finfo->outsyms;
+
while (esym < esym_end)
{
int add;
@@ -1977,9 +1922,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
auxp = h->aux + i;
else
{
- bfd_coff_swap_aux_in (input_bfd, (PTR) esym, isymp->n_type,
- isymp->n_sclass, i, isymp->n_numaux,
- (PTR) &aux);
+ bfd_coff_swap_aux_in (input_bfd, esym, isymp->n_type,
+ isymp->n_sclass, i, isymp->n_numaux, &aux);
auxp = &aux;
}
@@ -2072,18 +2016,19 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
if ((bfd_size_type) finfo->last_bf_index
>= syment_base)
{
- PTR auxout;
+ void *auxout;
/* The last .bf symbol is in this input
file. This will only happen if the
assembler did not set up the .bf
endndx symbols correctly. */
- auxout = (PTR) (finfo->outsyms
- + ((finfo->last_bf_index
- - syment_base)
- * osymesz));
+ auxout = (finfo->outsyms
+ + ((finfo->last_bf_index
+ - syment_base)
+ * osymesz));
+
bfd_coff_swap_aux_out (output_bfd,
- (PTR) &finfo->last_bf,
+ &finfo->last_bf,
isymp->n_type,
isymp->n_sclass,
0, isymp->n_numaux,
@@ -2099,11 +2044,11 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
temporarily. FIXME: This case should
be made faster. */
bfd_coff_swap_aux_out (output_bfd,
- (PTR) &finfo->last_bf,
+ &finfo->last_bf,
isymp->n_type,
isymp->n_sclass,
0, isymp->n_numaux,
- (PTR) outsym);
+ outsym);
pos = obj_sym_filepos (output_bfd);
pos += finfo->last_bf_index * osymesz;
if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
@@ -2130,9 +2075,9 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
if (h == NULL)
{
- bfd_coff_swap_aux_out (output_bfd, (PTR) auxp, isymp->n_type,
+ bfd_coff_swap_aux_out (output_bfd, auxp, isymp->n_type,
isymp->n_sclass, i, isymp->n_numaux,
- (PTR) outsym);
+ outsym);
outsym += osymesz;
}
@@ -2186,7 +2131,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
{
struct internal_lineno iline;
- bfd_coff_swap_lineno_in (input_bfd, (PTR) eline, (PTR) &iline);
+ bfd_coff_swap_lineno_in (input_bfd, eline, &iline);
if (iline.l_lnno != 0)
iline.l_addr.l_paddr += offset;
@@ -2222,27 +2167,26 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
of the line numbers rather than an absolute
file index. */
bfd_coff_swap_sym_in (output_bfd,
- (PTR) (finfo->outsyms
- + ((indx - syment_base)
- * osymesz)),
- (PTR) &is);
+ (finfo->outsyms
+ + ((indx - syment_base)
+ * osymesz)), &is);
if ((ISFCN (is.n_type)
|| is.n_sclass == C_BLOCK)
&& is.n_numaux >= 1)
{
- PTR auxptr;
+ void *auxptr;
- auxptr = (PTR) (finfo->outsyms
- + ((indx - syment_base + 1)
- * osymesz));
+ auxptr = (finfo->outsyms
+ + ((indx - syment_base + 1)
+ * osymesz));
bfd_coff_swap_aux_in (output_bfd, auxptr,
is.n_type, is.n_sclass,
- 0, is.n_numaux, (PTR) &ia);
+ 0, is.n_numaux, &ia);
ia.x_sym.x_fcnary.x_fcn.x_lnnoptr =
(o->output_section->line_filepos
+ o->output_section->lineno_count * linesz
+ eline - finfo->linenos);
- bfd_coff_swap_aux_out (output_bfd, (PTR) &ia,
+ bfd_coff_swap_aux_out (output_bfd, &ia,
is.n_type, is.n_sclass, 0,
is.n_numaux, auxptr);
}
@@ -2255,8 +2199,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
if (!skipping)
{
- bfd_coff_swap_lineno_out (output_bfd, (PTR) &iline,
- (PTR) oeline);
+ bfd_coff_swap_lineno_out (output_bfd, &iline, oeline);
oeline += linesz;
}
}
@@ -2280,10 +2223,10 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
&& (bfd_size_type) finfo->last_file_index >= syment_base)
{
finfo->last_file.n_value = output_index;
- bfd_coff_swap_sym_out (output_bfd, (PTR) &finfo->last_file,
- (PTR) (finfo->outsyms
- + ((finfo->last_file_index - syment_base)
- * osymesz)));
+ bfd_coff_swap_sym_out (output_bfd, &finfo->last_file,
+ (finfo->outsyms
+ + ((finfo->last_file_index - syment_base)
+ * osymesz)));
}
/* Write the modified symbols to the output file. */
@@ -2313,10 +2256,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
struct coff_section_tdata *secdata;
if (! o->linker_mark)
- {
- /* This section was omitted from the link. */
- continue;
- }
+ /* This section was omitted from the link. */
+ continue;
if ((o->flags & SEC_HAS_CONTENTS) == 0
|| (o->_raw_size == 0 && (o->flags & SEC_RELOC) == 0))
@@ -2393,7 +2334,6 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
*rel_hash = NULL;
/* Adjust the reloc address and symbol index. */
-
irel->r_vaddr += offset;
if (irel->r_symndx == -1)
@@ -2444,7 +2384,6 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
stripping. This should have been handled
by the 'dont_skip_symbol' code in the while
loop at the top of this function. */
-
is = finfo->internal_syms + irel->r_symndx;
name = (_bfd_coff_internal_syment_name
@@ -2483,11 +2422,9 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
}
}
- if (! finfo->info->keep_memory)
- {
- if (! _bfd_coff_free_symbols (input_bfd))
- return FALSE;
- }
+ if (! finfo->info->keep_memory
+ && ! _bfd_coff_free_symbols (input_bfd))
+ return FALSE;
return TRUE;
}
@@ -2495,9 +2432,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
/* Write out a global symbol. Called via coff_link_hash_traverse. */
bfd_boolean
-_bfd_coff_write_global_sym (h, data)
- struct coff_link_hash_entry *h;
- PTR data;
+_bfd_coff_write_global_sym (struct coff_link_hash_entry *h, void *data)
{
struct coff_final_link_info *finfo = (struct coff_final_link_info *) data;
bfd *output_bfd;
@@ -2616,7 +2551,7 @@ _bfd_coff_write_global_sym (h, data)
isym.n_numaux = h->numaux;
- bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) finfo->outsyms);
+ bfd_coff_swap_sym_out (output_bfd, &isym, finfo->outsyms);
symesz = bfd_coff_symesz (output_bfd);
@@ -2663,7 +2598,6 @@ _bfd_coff_write_global_sym (h, data)
/* For PE, an overflow on the final link reportedly does
not matter. FIXME: Why not? */
-
if (sec->reloc_count > 0xffff
&& (! obj_pe (output_bfd)
|| finfo->info->relocatable))
@@ -2690,9 +2624,9 @@ _bfd_coff_write_global_sym (h, data)
}
}
- bfd_coff_swap_aux_out (output_bfd, (PTR) auxp, isym.n_type,
+ bfd_coff_swap_aux_out (output_bfd, auxp, isym.n_type,
isym.n_sclass, (int) i, isym.n_numaux,
- (PTR) finfo->outsyms);
+ finfo->outsyms);
if (bfd_bwrite (finfo->outsyms, symesz, output_bfd) != symesz)
{
finfo->failed = TRUE;
@@ -2709,9 +2643,7 @@ _bfd_coff_write_global_sym (h, data)
the dirty work, if the symbol we are processing needs conversion. */
bfd_boolean
-_bfd_coff_write_task_globals (h, data)
- struct coff_link_hash_entry *h;
- PTR data;
+_bfd_coff_write_task_globals (struct coff_link_hash_entry *h, void *data)
{
struct coff_final_link_info *finfo = (struct coff_final_link_info *) data;
bfd_boolean rtnval = TRUE;
@@ -2741,11 +2673,10 @@ _bfd_coff_write_task_globals (h, data)
/* Handle a link order which is supposed to generate a reloc. */
bfd_boolean
-_bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order)
- bfd *output_bfd;
- struct coff_final_link_info *finfo;
- asection *output_section;
- struct bfd_link_order *link_order;
+_bfd_coff_reloc_link_order (bfd *output_bfd,
+ struct coff_final_link_info *finfo,
+ asection *output_section,
+ struct bfd_link_order *link_order)
{
reloc_howto_type *howto;
struct internal_reloc *irel;
@@ -2767,7 +2698,7 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order)
file_ptr loc;
size = bfd_get_reloc_size (howto);
- buf = (bfd_byte *) bfd_zmalloc (size);
+ buf = bfd_zmalloc (size);
if (buf == NULL)
return FALSE;
@@ -2797,7 +2728,7 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order)
break;
}
loc = link_order->offset * bfd_octets_per_byte (output_bfd);
- ok = bfd_set_section_contents (output_bfd, output_section, (PTR) buf,
+ ok = bfd_set_section_contents (output_bfd, output_section, buf,
loc, size);
free (buf);
if (! ok)
@@ -2806,7 +2737,6 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order)
/* Store the reloc information in the right place. It will get
swapped and written out at the end of the final_link routine. */
-
irel = (finfo->section_info[output_section->target_index].relocs
+ output_section->reloc_count);
rel_hash_ptr = (finfo->section_info[output_section->target_index].rel_hashes
@@ -2865,7 +2795,6 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order)
routines anyhow. r_extern is only used for ECOFF. */
/* FIXME: What is the right value for r_offset? Is zero OK? */
-
++output_section->reloc_count;
return TRUE;
@@ -2875,17 +2804,14 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order)
simple relocs. */
bfd_boolean
-_bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
- input_section, contents, relocs, syms,
- sections)
- bfd *output_bfd;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- struct internal_reloc *relocs;
- struct internal_syment *syms;
- asection **sections;
+_bfd_coff_generic_relocate_section (bfd *output_bfd,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ struct internal_reloc *relocs,
+ struct internal_syment *syms,
+ asection **sections)
{
struct internal_reloc *rel;
struct internal_reloc *relend;
@@ -2927,7 +2853,6 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
size of the symbol is included in the section contents, or it
is not. We assume that the size is not included, and force
the rtype_to_howto function to adjust the addend as needed. */
-
if (sym != NULL && sym->n_scnum != 0)
addend = - sym->n_value;
else
diff --git a/bfd/config.bfd b/bfd/config.bfd
index a14967541d8..b047c646eab 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -100,7 +100,7 @@ case "${targ}" in
# START OF targmatch.h
#ifdef BFD64
- alpha*-*-freebsd*)
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_alpha_freebsd_vec
targ_selvecs=ecoffalpha_little_vec
# FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
@@ -131,7 +131,7 @@ case "${targ}" in
alpha*-*-*)
targ_defvec=ecoffalpha_little_vec
;;
- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*)
+ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_ia64_little_vec
targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
;;
@@ -139,7 +139,7 @@ case "${targ}" in
targ_defvec=bfd_elf32_ia64_hpux_big_vec
targ_selvecs="bfd_elf64_ia64_hpux_big_vec"
;;
- sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd*)
+ sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd* | sparc64-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_sparc_vec
targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
;;
@@ -222,7 +222,7 @@ case "${targ}" in
targ_defvec=bfd_elf32_littlearm_vec
targ_selvecs=bfd_elf32_bigarm_vec
;;
- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*)
+ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux* | arm-*-kfreebsd*-gnu)
targ_defvec=bfd_elf32_littlearm_vec
targ_selvecs=bfd_elf32_bigarm_vec
;;
@@ -452,7 +452,7 @@ case "${targ}" in
targ_selvecs=i386bsd_vec
targ_underscore=yes
;;
- i[3-7]86-*-freebsd*)
+ i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
targ_defvec=bfd_elf32_i386_freebsd_vec
targ_selvecs=i386coff_vec
# FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
@@ -494,7 +494,7 @@ case "${targ}" in
targ64_selvecs=bfd_elf64_x86_64_vec
;;
#ifdef BFD64
- x86_64-*-freebsd*)
+ x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_x86_64_vec
targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec"
;;
diff --git a/bfd/config.in b/bfd/config.in
index 9a73c730252..ab273c8be1e 100644
--- a/bfd/config.in
+++ b/bfd/config.in
@@ -103,6 +103,9 @@
/* Define if you have the strchr function. */
#undef HAVE_STRCHR
+/* Define if you have the strtoull function. */
+#undef HAVE_STRTOULL
+
/* Define if you have the sysconf function. */
#undef HAVE_SYSCONF
diff --git a/bfd/configure b/bfd/configure
index 80225237b71..0d62a863bd1 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -4497,6 +4497,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
BFD_HOST_64BIT_LONG=0
+BFD_HOST_LONG_LONG=0
BFD_HOST_64_BIT_DEFINED=0
BFD_HOST_64_BIT=
BFD_HOST_U_64_BIT=
@@ -4508,6 +4509,38 @@ elif test "x${HOST_64BIT_TYPE}" != "x"; then
BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE}
fi
+echo $ac_n "checking for long long""... $ac_c" 1>&6
+echo "configure:4514: checking for long long" >&5
+if eval "test \"`echo '$''{'bfd_cv_has_long_long'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4519 "configure"
+#include "confdefs.h"
+
+int main() {
+unsigned long long ll = 18446744073709551615ULL;
+; return 0; }
+EOF
+if { (eval echo configure:4526: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ bfd_cv_has_long_long=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ bfd_cv_has_long_long=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$bfd_cv_has_long_long" 1>&6
+if test $bfd_cv_has_long_long = yes; then
+ BFD_HOST_LONG_LONG=1
+fi
+
+
+
@@ -4526,7 +4559,7 @@ if test "x$cross_compiling" = "xno"; then
EXEEXT_FOR_BUILD='$(EXEEXT)'
else
echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:4530: checking for build system executable suffix" >&5
+echo "configure:4563: checking for build system executable suffix" >&5
if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4554,17 +4587,17 @@ for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4558: checking for $ac_hdr" >&5
+echo "configure:4591: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4563 "configure"
+#line 4596 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4594,17 +4627,17 @@ for ac_hdr in fcntl.h sys/file.h sys/time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4598: checking for $ac_hdr" >&5
+echo "configure:4631: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4603 "configure"
+#line 4636 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4631,12 +4664,12 @@ fi
done
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4635: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4668: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4640 "configure"
+#line 4673 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -4645,7 +4678,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:4649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -4670,12 +4703,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:4674: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4707: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4679 "configure"
+#line 4712 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -4683,7 +4716,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:4687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -4708,7 +4741,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:4712: checking for opendir in -ldir" >&5
+echo "configure:4745: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4716,7 +4749,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4720 "configure"
+#line 4753 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4727,7 +4760,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4749,7 +4782,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4753: checking for opendir in -lx" >&5
+echo "configure:4786: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4757,7 +4790,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4761 "configure"
+#line 4794 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4768,7 +4801,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4793,12 +4826,67 @@ fi
for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4797: checking for $ac_func" >&5
+echo "configure:4830: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4835 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in strtoull
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:4885: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4802 "configure"
+#line 4890 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4821,7 +4909,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -4856,12 +4944,12 @@ EOF
esac
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4860: checking whether strstr must be declared" >&5
+echo "configure:4948: checking whether strstr must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4865 "configure"
+#line 4953 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4882,7 +4970,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:4886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -4903,12 +4991,12 @@ EOF
fi
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:4907: checking whether malloc must be declared" >&5
+echo "configure:4995: checking whether malloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4912 "configure"
+#line 5000 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4929,7 +5017,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:4933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -4950,12 +5038,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:4954: checking whether realloc must be declared" >&5
+echo "configure:5042: checking whether realloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4959 "configure"
+#line 5047 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -4976,7 +5064,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:4980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -4997,12 +5085,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:5001: checking whether free must be declared" >&5
+echo "configure:5089: checking whether free must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5006 "configure"
+#line 5094 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -5023,7 +5111,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:5027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -5044,12 +5132,12 @@ EOF
fi
echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:5048: checking whether getenv must be declared" >&5
+echo "configure:5136: checking whether getenv must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5053 "configure"
+#line 5141 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -5070,7 +5158,7 @@ int main() {
char *(*pfn) = (char *(*)) getenv
; return 0; }
EOF
-if { (eval echo configure:5074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_getenv=no
else
@@ -5097,7 +5185,7 @@ COREFLAG=
TRAD_HEADER=
if test "${target}" = "${host}"; then
case "${host}" in
- alpha*-*-freebsd*)
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
COREFILE=''
;;
alpha*-*-linux-gnu*)
@@ -5108,7 +5196,8 @@ if test "${target}" = "${host}"; then
COREFILE=netbsd-core.lo
;;
alpha*-*-*) COREFILE=osf-core.lo ;;
- arm-*-freebsd*) COREFILE='' ;;
+ arm-*-freebsd* | arm-*-kfreebsd*-gnu)
+ COREFILE='' ;;
arm-*-netbsd*) COREFILE=netbsd-core.lo ;;
arm-*-riscix) COREFILE=trad-core.lo ;;
hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
@@ -5137,7 +5226,7 @@ if test "${target}" = "${host}"; then
COREFILE=trad-core.lo
TRAD_HEADER='"hosts/i386bsd.h"'
;;
- i[3-7]86-*-freebsd*)
+ i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
COREFILE=''
TRAD_HEADER='"hosts/i386bsd.h"'
;;
@@ -5257,16 +5346,16 @@ if test "${target}" = "${host}"; then
# Not all versions of AIX with -DAIX_CORE_DUMPX_CORE
# have c_impl as a member of struct core_dumpx
echo $ac_n "checking for c_impl in struct core_dumpx""... $ac_c" 1>&6
-echo "configure:5261: checking for c_impl in struct core_dumpx" >&5
+echo "configure:5350: checking for c_impl in struct core_dumpx" >&5
cat > conftest.$ac_ext <<EOF
-#line 5263 "configure"
+#line 5352 "configure"
#include "confdefs.h"
#include <core.h>
int main() {
struct core_dumpx c; c.c_impl = 0;
; return 0; }
EOF
-if { (eval echo configure:5270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_ST_C_IMPL 1
@@ -5286,7 +5375,8 @@ rm -f conftest*
powerpc-*-aix4*) COREFILE=rs6000-core.lo ;;
powerpc-*-aix*) COREFILE=rs6000-core.lo ;;
powerpc-*-beos*) ;;
- powerpc-*-freebsd*) COREFILE='' ;;
+ powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu)
+ COREFILE='' ;;
powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;;
powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;;
s390*-*-*) COREFILE=trad-core.lo ;;
@@ -5336,17 +5426,17 @@ rm -f conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5340: checking for $ac_hdr" >&5
+echo "configure:5430: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5345 "configure"
+#line 5435 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5350: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5374,12 +5464,12 @@ done
if test "$ac_cv_header_sys_procfs_h" = yes; then
echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5378: checking for prstatus_t in sys/procfs.h" >&5
+echo "configure:5468: checking for prstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5383 "configure"
+#line 5473 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5388,7 +5478,7 @@ int main() {
prstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prstatus_t=yes
else
@@ -5410,12 +5500,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6
echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5414: checking for prstatus32_t in sys/procfs.h" >&5
+echo "configure:5504: checking for prstatus32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5419 "configure"
+#line 5509 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5424,7 +5514,7 @@ int main() {
prstatus32_t avar
; return 0; }
EOF
-if { (eval echo configure:5428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prstatus32_t=yes
else
@@ -5446,12 +5536,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6
echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5450: checking for prstatus_t.pr_who in sys/procfs.h" >&5
+echo "configure:5540: checking for prstatus_t.pr_who in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5455 "configure"
+#line 5545 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5460,7 +5550,7 @@ int main() {
prstatus_t avar; void* aref = (void*) &avar.pr_who
; return 0; }
EOF
-if { (eval echo configure:5464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes
else
@@ -5482,12 +5572,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6
echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5486: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
+echo "configure:5576: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5491 "configure"
+#line 5581 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5496,7 +5586,7 @@ int main() {
prstatus32_t avar; void* aref = (void*) &avar.pr_who
; return 0; }
EOF
-if { (eval echo configure:5500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes
else
@@ -5518,12 +5608,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6
echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5522: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:5612: checking for pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5527 "configure"
+#line 5617 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5532,7 +5622,7 @@ int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@@ -5554,12 +5644,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5558: checking for pxstatus_t in sys/procfs.h" >&5
+echo "configure:5648: checking for pxstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5563 "configure"
+#line 5653 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5568,7 +5658,7 @@ int main() {
pxstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pxstatus_t=yes
else
@@ -5590,12 +5680,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6
echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5594: checking for pstatus32_t in sys/procfs.h" >&5
+echo "configure:5684: checking for pstatus32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5599 "configure"
+#line 5689 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5604,7 +5694,7 @@ int main() {
pstatus32_t avar
; return 0; }
EOF
-if { (eval echo configure:5608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus32_t=yes
else
@@ -5626,12 +5716,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6
echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5630: checking for prpsinfo_t in sys/procfs.h" >&5
+echo "configure:5720: checking for prpsinfo_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5635 "configure"
+#line 5725 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5640,7 +5730,7 @@ int main() {
prpsinfo_t avar
; return 0; }
EOF
-if { (eval echo configure:5644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prpsinfo_t=yes
else
@@ -5662,12 +5752,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6
echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5666: checking for prpsinfo32_t in sys/procfs.h" >&5
+echo "configure:5756: checking for prpsinfo32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5671 "configure"
+#line 5761 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5676,7 +5766,7 @@ int main() {
prpsinfo32_t avar
; return 0; }
EOF
-if { (eval echo configure:5680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes
else
@@ -5698,12 +5788,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6
echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5702: checking for psinfo_t in sys/procfs.h" >&5
+echo "configure:5792: checking for psinfo_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5707 "configure"
+#line 5797 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5712,7 +5802,7 @@ int main() {
psinfo_t avar
; return 0; }
EOF
-if { (eval echo configure:5716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psinfo_t=yes
else
@@ -5734,12 +5824,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6
echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5738: checking for psinfo32_t in sys/procfs.h" >&5
+echo "configure:5828: checking for psinfo32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5743 "configure"
+#line 5833 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5748,7 +5838,7 @@ int main() {
psinfo32_t avar
; return 0; }
EOF
-if { (eval echo configure:5752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psinfo32_t=yes
else
@@ -5770,12 +5860,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6
echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5774: checking for lwpstatus_t in sys/procfs.h" >&5
+echo "configure:5864: checking for lwpstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5779 "configure"
+#line 5869 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5784,7 +5874,7 @@ int main() {
lwpstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpstatus_t=yes
else
@@ -5806,12 +5896,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6
echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5810: checking for lwpxstatus_t in sys/procfs.h" >&5
+echo "configure:5900: checking for lwpxstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5815 "configure"
+#line 5905 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5820,7 +5910,7 @@ int main() {
lwpxstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes
else
@@ -5842,12 +5932,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6
echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5846: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
+echo "configure:5936: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5851 "configure"
+#line 5941 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5856,7 +5946,7 @@ int main() {
lwpstatus_t avar; void* aref = (void*) &avar.pr_context
; return 0; }
EOF
-if { (eval echo configure:5860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes
else
@@ -5878,12 +5968,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6
echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5882: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
+echo "configure:5972: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5887 "configure"
+#line 5977 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5892,7 +5982,7 @@ int main() {
lwpstatus_t avar; void* aref = (void*) &avar.pr_reg
; return 0; }
EOF
-if { (eval echo configure:5896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes
else
@@ -5914,12 +6004,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6
echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5918: checking for win32_pstatus_t in sys/procfs.h" >&5
+echo "configure:6008: checking for win32_pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5923 "configure"
+#line 6013 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -5928,7 +6018,7 @@ int main() {
win32_pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:5932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6022: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes
else
@@ -6397,10 +6487,10 @@ case ${host64}-${target64}-${want64} in
if test -n "$GCC" ; then
bad_64bit_gcc=no;
echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6
-echo "configure:6401: checking for gcc version with buggy 64-bit support" >&5
+echo "configure:6491: checking for gcc version with buggy 64-bit support" >&5
# Add more tests for gcc versions with non-working 64-bit support here.
cat > conftest.$ac_ext <<EOF
-#line 6404 "configure"
+#line 6494 "configure"
#include "confdefs.h"
:__GNUC__:__GNUC_MINOR__:__i386__:
EOF
@@ -6446,17 +6536,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6450: checking for $ac_hdr" >&5
+echo "configure:6540: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6455 "configure"
+#line 6545 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6485,12 +6575,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6489: checking for $ac_func" >&5
+echo "configure:6579: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6494 "configure"
+#line 6584 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6513,7 +6603,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6538,7 +6628,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6542: checking for working mmap" >&5
+echo "configure:6632: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6546,7 +6636,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 6550 "configure"
+#line 6640 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6686,7 +6776,7 @@ main()
}
EOF
-if { (eval echo configure:6690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -6711,12 +6801,12 @@ fi
for ac_func in madvise mprotect
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6715: checking for $ac_func" >&5
+echo "configure:6805: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6720 "configure"
+#line 6810 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6739,7 +6829,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6972,6 +7062,7 @@ s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
s%@l@%$l%g
s%@HDEFINES@%$HDEFINES%g
s%@BFD_HOST_64BIT_LONG@%$BFD_HOST_64BIT_LONG%g
+s%@BFD_HOST_LONG_LONG@%$BFD_HOST_LONG_LONG%g
s%@BFD_HOST_64_BIT_DEFINED@%$BFD_HOST_64_BIT_DEFINED%g
s%@BFD_HOST_64_BIT@%$BFD_HOST_64_BIT%g
s%@BFD_HOST_U_64_BIT@%$BFD_HOST_U_64_BIT%g
diff --git a/bfd/configure.in b/bfd/configure.in
index 04ccf0ae6e7..b3a6e68bbc2 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -113,6 +113,7 @@ AC_SUBST(HDEFINES)
AC_PROG_INSTALL
BFD_HOST_64BIT_LONG=0
+BFD_HOST_LONG_LONG=0
BFD_HOST_64_BIT_DEFINED=0
BFD_HOST_64_BIT=
BFD_HOST_U_64_BIT=
@@ -123,7 +124,19 @@ elif test "x${HOST_64BIT_TYPE}" != "x"; then
BFD_HOST_64_BIT=${HOST_64BIT_TYPE}
BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE}
fi
+
+AC_MSG_CHECKING([for long long])
+AC_CACHE_VAL(bfd_cv_has_long_long,
+[AC_TRY_COMPILE(,
+[unsigned long long ll = 18446744073709551615ULL;],
+bfd_cv_has_long_long=yes, bfd_cv_has_long_long=no)])
+AC_MSG_RESULT($bfd_cv_has_long_long)
+if test $bfd_cv_has_long_long = yes; then
+ BFD_HOST_LONG_LONG=1
+fi
+
AC_SUBST(BFD_HOST_64BIT_LONG)
+AC_SUBST(BFD_HOST_LONG_LONG)
AC_SUBST(BFD_HOST_64_BIT_DEFINED)
AC_SUBST(BFD_HOST_64_BIT)
AC_SUBST(BFD_HOST_U_64_BIT)
@@ -135,6 +148,7 @@ AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h)
AC_HEADER_TIME
AC_HEADER_DIRENT
AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
+AC_CHECK_FUNCS(strtoull)
BFD_BINARY_FOPEN
@@ -150,7 +164,7 @@ COREFLAG=
TRAD_HEADER=
if test "${target}" = "${host}"; then
case "${host}" in
- alpha*-*-freebsd*)
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
COREFILE=''
;;
alpha*-*-linux-gnu*)
@@ -161,7 +175,8 @@ if test "${target}" = "${host}"; then
COREFILE=netbsd-core.lo
;;
alpha*-*-*) COREFILE=osf-core.lo ;;
- arm-*-freebsd*) COREFILE='' ;;
+ arm-*-freebsd* | arm-*-kfreebsd*-gnu)
+ COREFILE='' ;;
arm-*-netbsd*) COREFILE=netbsd-core.lo ;;
arm-*-riscix) COREFILE=trad-core.lo ;;
hppa*-*-hpux*) COREFILE=hpux-core.lo ;;
@@ -199,7 +214,7 @@ changequote([,])dnl
TRAD_HEADER='"hosts/i386bsd.h"'
;;
changequote(,)dnl
- i[3-7]86-*-freebsd*)
+ i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
changequote([,])dnl
COREFILE=''
TRAD_HEADER='"hosts/i386bsd.h"'
@@ -347,7 +362,8 @@ changequote([,])dnl
powerpc-*-aix4*) COREFILE=rs6000-core.lo ;;
powerpc-*-aix*) COREFILE=rs6000-core.lo ;;
powerpc-*-beos*) ;;
- powerpc-*-freebsd*) COREFILE='' ;;
+ powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu)
+ COREFILE='' ;;
powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;;
powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;;
s390*-*-*) COREFILE=trad-core.lo ;;
diff --git a/bfd/cpu-frv.c b/bfd/cpu-frv.c
index e87289aec03..858914470b7 100644
--- a/bfd/cpu-frv.c
+++ b/bfd/cpu-frv.c
@@ -21,13 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
-enum {
- I_frv_generic,
- I_frv_simple,
- I_frv_500,
- I_frv_300,
-};
-
#define FRV_ARCH(MACHINE, NAME, DEFAULT, NEXT) \
{ \
32, /* 32 bits in a word */ \
diff --git a/bfd/cpu-hppa.c b/bfd/cpu-hppa.c
index 5757e49fe63..250c630cd1d 100644
--- a/bfd/cpu-hppa.c
+++ b/bfd/cpu-hppa.c
@@ -28,7 +28,7 @@ static const bfd_arch_info_type bfd_hppa10_arch =
32, /* 32 bits in an address */
8, /* 8 bits in a byte */
bfd_arch_hppa,
- 10, /* By convention PA1.0 = 10 */
+ bfd_mach_hppa10, /* By convention PA1.0 = 10 */
"hppa",
"hppa1.0",
3,
@@ -45,7 +45,7 @@ static const bfd_arch_info_type bfd_hppa20_arch =
32, /* 32 bits in an address */
8, /* 8 bits in a byte */
bfd_arch_hppa,
- 20, /* By convention PA1.0 = 10 */
+ bfd_mach_hppa20, /* By convention PA2.0 = 20 */
"hppa",
"hppa2.0",
3,
@@ -58,11 +58,11 @@ static const bfd_arch_info_type bfd_hppa20_arch =
/* PA2.0 in wide mode */
static const bfd_arch_info_type bfd_hppa20w_arch =
{
- 64, /* 32 bits in a word */
- 64, /* 32 bits in an address */
+ 64, /* 64 bits in a word */
+ 64, /* 64 bits in an address */
8, /* 8 bits in a byte */
bfd_arch_hppa,
- 25, /* ??? How best to describe wide mode here? */
+ bfd_mach_hppa20w, /* ??? How best to describe wide mode here? */
"hppa",
"hppa2.0w",
3,
@@ -78,7 +78,7 @@ const bfd_arch_info_type bfd_hppa_arch =
32, /* 32 bits in an address */
8, /* 8 bits in a byte */
bfd_arch_hppa,
- 11, /* By convention PA1.1 = 11 */
+ bfd_mach_hppa11, /* By convention PA1.1 = 11 */
"hppa",
"hppa1.1",
3,
diff --git a/bfd/cpu-msp430.c b/bfd/cpu-msp430.c
index c7d283b63bb..54ed649a34b 100644
--- a/bfd/cpu-msp430.c
+++ b/bfd/cpu-msp430.c
@@ -46,42 +46,44 @@ static const bfd_arch_info_type arch_info_struct[] =
/* msp430x11x. */
N (16, bfd_mach_msp11, "msp:11", FALSE, & arch_info_struct[1]),
+ /* msp430x11x1. */
+ N (16, bfd_mach_msp110, "msp:110", FALSE, & arch_info_struct[2]),
+
/* msp430x12x. */
- N (16, bfd_mach_msp12, "msp:12", FALSE, & arch_info_struct[2]),
+ N (16, bfd_mach_msp12, "msp:12", FALSE, & arch_info_struct[3]),
/* msp430x13x. */
- N (16, bfd_mach_msp13, "msp:13", FALSE, & arch_info_struct[3]),
+ N (16, bfd_mach_msp13, "msp:13", FALSE, & arch_info_struct[4]),
/* msp430x14x. */
- N (16, bfd_mach_msp14, "msp:14", FALSE, & arch_info_struct[4]),
+ N (16, bfd_mach_msp14, "msp:14", FALSE, & arch_info_struct[5]),
+
+ /* msp430x15x. */
+ N (16, bfd_mach_msp15, "msp:15", FALSE, & arch_info_struct[6]),
+
+ /* msp430x16x. */
+ N (16, bfd_mach_msp16, "msp:16", FALSE, & arch_info_struct[7]),
/* msp430x31x. */
- N (16, bfd_mach_msp31, "msp:31", FALSE, & arch_info_struct[5]),
+ N (16, bfd_mach_msp31, "msp:31", FALSE, & arch_info_struct[8]),
/* msp430x32x. */
- N (16, bfd_mach_msp32, "msp:32", FALSE, & arch_info_struct[6]),
+ N (16, bfd_mach_msp32, "msp:32", FALSE, & arch_info_struct[9]),
/* msp430x33x. */
- N (16, bfd_mach_msp33, "msp:33", FALSE, & arch_info_struct[7]),
+ N (16, bfd_mach_msp33, "msp:33", FALSE, & arch_info_struct[10]),
/* msp430x41x. */
- N (16, bfd_mach_msp41, "msp:41", FALSE, & arch_info_struct[8]),
+ N (16, bfd_mach_msp41, "msp:41", FALSE, & arch_info_struct[11]),
+
+ /* msp430x42x. */
+ N (16, bfd_mach_msp42, "msp:42", FALSE, & arch_info_struct[12]),
/* msp430x43x. */
- N (16, bfd_mach_msp43, "msp:43", FALSE, & arch_info_struct[9]),
+ N (16, bfd_mach_msp43, "msp:43", FALSE, & arch_info_struct[13]),
/* msp430x44x. */
- N (16, bfd_mach_msp43, "msp:44", FALSE, & arch_info_struct[10]),
-
- /* msp430x15x. */
- N (16, bfd_mach_msp15, "msp:15", FALSE, & arch_info_struct[11]),
-
- /* msp430x16x. */
- N (16, bfd_mach_msp16, "msp:16", FALSE, & arch_info_struct[12]),
-
- /* msp430x11x1. */
- N (16, bfd_mach_msp110, "msp:110", FALSE, NULL)
-
+ N (16, bfd_mach_msp43, "msp:44", FALSE, NULL)
};
const bfd_arch_info_type bfd_msp430_arch =
diff --git a/bfd/cpu-v850.c b/bfd/cpu-v850.c
index fe966567650..1ff1cb3af5c 100644
--- a/bfd/cpu-v850.c
+++ b/bfd/cpu-v850.c
@@ -1,5 +1,6 @@
/* BFD support for the NEC V850 processor
- Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -30,6 +31,7 @@
static const bfd_arch_info_type arch_info_struct[] =
{
+ N (bfd_mach_v850e1, "v850e1", FALSE, & arch_info_struct[1]),
N (bfd_mach_v850e, "v850e", FALSE, NULL)
};
diff --git a/bfd/dep-in.sed b/bfd/dep-in.sed
index ce8b79b0546..90a2e6a7f06 100644
--- a/bfd/dep-in.sed
+++ b/bfd/dep-in.sed
@@ -18,6 +18,7 @@ s! config.h!!g
s! \$(INCDIR)/fopen-[^ ]*\.h!!g
s! \$(INCDIR)/ansidecl\.h!!g
s! \$(INCDIR)/symcat\.h!!g
+s! \.\./intl/libintl\.h!!g
s/\\\n */ /g
diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in
index 667d6589dba..81db77e9b38 100644
--- a/bfd/doc/Makefile.in
+++ b/bfd/doc/Makefile.in
@@ -68,6 +68,7 @@ AS = @AS@
BFD_HOST_64BIT_LONG = @BFD_HOST_64BIT_LONG@
BFD_HOST_64_BIT = @BFD_HOST_64_BIT@
BFD_HOST_64_BIT_DEFINED = @BFD_HOST_64_BIT_DEFINED@
+BFD_HOST_LONG_LONG = @BFD_HOST_LONG_LONG@
BFD_HOST_U_64_BIT = @BFD_HOST_U_64_BIT@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index d297a77318f..abbe377e491 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -33,20 +33,17 @@
#define NUM_SHDR_ENTRIES(shdr) ((shdr)->sh_size / (shdr)->sh_entsize)
/* If size isn't specified as 64 or 32, NAME macro should fail. */
-/* Do not "beautify" the CONCAT* macro args. Traditional C will not
- remove whitespace added here, and thus will fail to concatenate
- the tokens. */
#ifndef NAME
-#if ARCH_SIZE==64
-#define NAME(x,y) CONCAT4 (x,64,_,y)
+#if ARCH_SIZE == 64
+#define NAME(x, y) x ## 64 ## _ ## y
#endif
-#if ARCH_SIZE==32
-#define NAME(x,y) CONCAT4 (x,32,_,y)
+#if ARCH_SIZE == 32
+#define NAME(x, y) x ## 32 ## _ ## y
#endif
#endif
#ifndef NAME
-#define NAME(x,y) CONCAT4 (x,NOSIZE,_,y)
+#define NAME(x, y) x ## NOSIZE ## _ ## y
#endif
#define ElfNAME(X) NAME(Elf,X)
@@ -67,8 +64,8 @@ typedef struct
union
{
unsigned int hppa_arg_reloc;
- PTR mips_extr;
- PTR any;
+ void *mips_extr;
+ void *any;
}
tc_data;
@@ -365,10 +362,10 @@ struct elf_link_hash_table
struct elf_link_hash_entry *hgot;
/* A pointer to information used to link stabs in sections. */
- PTR stab_info;
+ void *stab_info;
/* A pointer to information used to merge SEC_MERGE sections. */
- PTR merge_info;
+ void *merge_info;
/* Used by eh_frame code when editing .eh_frame. */
struct eh_frame_hdr_info eh_info;
@@ -399,7 +396,7 @@ struct elf_link_hash_table
#define elf_link_hash_traverse(table, func, info) \
(bfd_link_hash_traverse \
(&(table)->root, \
- (bfd_boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \
+ (bfd_boolean (*) (struct bfd_link_hash_entry *, void *)) (func), \
(info)))
/* Get the ELF linker hash table from a link_info structure. */
@@ -439,43 +436,43 @@ struct elf_size_info {
unsigned char arch_size, log_file_align;
unsigned char elfclass, ev_current;
int (*write_out_phdrs)
- PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int));
- bfd_boolean (*write_shdrs_and_ehdr)
- PARAMS ((bfd *));
+ (bfd *, const Elf_Internal_Phdr *, unsigned int);
+ bfd_boolean
+ (*write_shdrs_and_ehdr) (bfd *);
void (*write_relocs)
- PARAMS ((bfd *, asection *, PTR));
+ (bfd *, asection *, void *);
void (*swap_symbol_in)
- PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *));
+ (bfd *, const void *, const void *, Elf_Internal_Sym *);
void (*swap_symbol_out)
- PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
+ (bfd *, const Elf_Internal_Sym *, void *, void *);
bfd_boolean (*slurp_reloc_table)
- PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
+ (bfd *, asection *, asymbol **, bfd_boolean);
long (*slurp_symbol_table)
- PARAMS ((bfd *, asymbol **, bfd_boolean));
+ (bfd *, asymbol **, bfd_boolean);
void (*swap_dyn_in)
- PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
+ (bfd *, const void *, Elf_Internal_Dyn *);
void (*swap_dyn_out)
- PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
+ (bfd *, const Elf_Internal_Dyn *, void *);
/* This function is called to swap in a REL relocation. If an
external relocation corresponds to more than one internal
relocation, then all relocations are swapped in at once. */
void (*swap_reloc_in)
- PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+ (bfd *, const bfd_byte *, Elf_Internal_Rela *);
/* This function is called to swap out a REL relocation. */
void (*swap_reloc_out)
- PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
+ (bfd *, const Elf_Internal_Rela *, bfd_byte *);
/* This function is called to swap in a RELA relocation. If an
external relocation corresponds to more than one internal
relocation, then all relocations are swapped in at once. */
void (*swap_reloca_in)
- PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+ (bfd *, const bfd_byte *, Elf_Internal_Rela *);
/* This function is called to swap out a RELA relocation. */
void (*swap_reloca_out)
- PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
+ (bfd *, const Elf_Internal_Rela *, bfd_byte *);
};
#define elf_symbol_from(ABFD,S) \
@@ -535,12 +532,12 @@ struct elf_backend_data
/* A function to translate an ELF RELA relocation to a BFD arelent
structure. */
void (*elf_info_to_howto)
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
+ (bfd *, arelent *, Elf_Internal_Rela *);
/* A function to translate an ELF REL relocation to a BFD arelent
structure. */
void (*elf_info_to_howto_rel)
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
+ (bfd *, arelent *, Elf_Internal_Rela *);
/* A function to determine whether a symbol is global when
partitioning the symbol table into local and global symbols.
@@ -548,7 +545,7 @@ struct elf_backend_data
thing will be done. MIPS ELF, at least on the Irix 5, has
special requirements. */
bfd_boolean (*elf_backend_sym_is_global)
- PARAMS ((bfd *, asymbol *));
+ (bfd *, asymbol *);
/* The remaining functions are hooks which are called only if they
are not NULL. */
@@ -560,58 +557,58 @@ struct elf_backend_data
used with caution. If this returns FALSE, the check_format
routine will return a bfd_error_wrong_format error. */
bfd_boolean (*elf_backend_object_p)
- PARAMS ((bfd *));
+ (bfd *);
/* A function to do additional symbol processing when reading the
ELF symbol table. This is where any processor-specific special
section indices are handled. */
void (*elf_backend_symbol_processing)
- PARAMS ((bfd *, asymbol *));
+ (bfd *, asymbol *);
/* A function to do additional symbol processing after reading the
entire ELF symbol table. */
bfd_boolean (*elf_backend_symbol_table_processing)
- PARAMS ((bfd *, elf_symbol_type *, unsigned int));
+ (bfd *, elf_symbol_type *, unsigned int);
/* A function to set the type of the info field. Processor-specific
types should be handled here. */
int (*elf_backend_get_symbol_type)
- PARAMS (( Elf_Internal_Sym *, int));
+ (Elf_Internal_Sym *, int);
/* A function to do additional processing on the ELF section header
just before writing it out. This is used to set the flags and
type fields for some sections, or to actually write out data for
unusual sections. */
bfd_boolean (*elf_backend_section_processing)
- PARAMS ((bfd *, Elf_Internal_Shdr *));
+ (bfd *, Elf_Internal_Shdr *);
/* A function to handle unusual section types when creating BFD
sections from ELF sections. */
bfd_boolean (*elf_backend_section_from_shdr)
- PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
+ (bfd *, Elf_Internal_Shdr *, const char *);
/* A function to convert machine dependent section header flags to
BFD internal section header flags. */
bfd_boolean (*elf_backend_section_flags)
- PARAMS ((flagword *, Elf_Internal_Shdr *));
+ (flagword *, Elf_Internal_Shdr *);
/* A function to handle unusual program segment types when creating BFD
sections from ELF program segments. */
bfd_boolean (*elf_backend_section_from_phdr)
- PARAMS ((bfd *, Elf_Internal_Phdr *, int));
+ (bfd *, Elf_Internal_Phdr *, int);
/* A function to set up the ELF section header for a BFD section in
preparation for writing it out. This is where the flags and type
fields are set for unusual sections. */
bfd_boolean (*elf_backend_fake_sections)
- PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
+ (bfd *, Elf_Internal_Shdr *, asection *);
/* A function to get the ELF section index for a BFD section. If
this returns TRUE, the section was found. If it is a normal ELF
section, *RETVAL should be left unchanged. If it is not a normal
ELF section *RETVAL should be set to the SHN_xxxx index. */
bfd_boolean (*elf_backend_section_from_bfd_section)
- PARAMS ((bfd *, asection *, int *retval));
+ (bfd *, asection *, int *retval);
/* If this field is not NULL, it is called by the add_symbols phase
of a link just before adding a symbol to the global linker hash
@@ -622,15 +619,14 @@ struct elf_backend_data
indices, and must set at least *FLAGS and *SEC for each processor
dependent case; failure to do so will cause a link error. */
bfd_boolean (*elf_add_symbol_hook)
- PARAMS ((bfd *abfd, struct bfd_link_info *info,
- const Elf_Internal_Sym *, const char **name,
- flagword *flags, asection **sec, bfd_vma *value));
+ (bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *,
+ const char **name, flagword *flags, asection **sec, bfd_vma *value);
/* If this field is not NULL, it is called by the elf_link_output_sym
phase of a link for each symbol which will appear in the object file. */
bfd_boolean (*elf_backend_link_output_symbol_hook)
- PARAMS ((bfd *, struct bfd_link_info *info, const char *,
- Elf_Internal_Sym *, asection *));
+ (bfd *, struct bfd_link_info *info, const char *, Elf_Internal_Sym *,
+ asection *);
/* The CREATE_DYNAMIC_SECTIONS function is called by the ELF backend
linker the first time it encounters a dynamic object in the link.
@@ -641,7 +637,7 @@ struct elf_backend_data
desired. This function will normally create the .got and .plt
sections, but different backends have different requirements. */
bfd_boolean (*elf_backend_create_dynamic_sections)
- PARAMS ((bfd *abfd, struct bfd_link_info *info));
+ (bfd *abfd, struct bfd_link_info *info);
/* The CHECK_RELOCS function is called by the add_symbols phase of
the ELF backend linker. It is called once for each section with
@@ -654,8 +650,8 @@ struct elf_backend_data
actually uses Rel structures, the r_addend field will always be
zero. */
bfd_boolean (*check_relocs)
- PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
- const Elf_Internal_Rela *relocs));
+ (bfd *abfd, struct bfd_link_info *info, asection *o,
+ const Elf_Internal_Rela *relocs);
/* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend
linker for every symbol which is defined by a dynamic object and
@@ -670,14 +666,14 @@ struct elf_backend_data
entry to the .plt or .got or some such section, and setting the
symbol to point to that. */
bfd_boolean (*elf_backend_adjust_dynamic_symbol)
- PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h));
+ (struct bfd_link_info *info, struct elf_link_hash_entry *h);
/* The ALWAYS_SIZE_SECTIONS function is called by the backend linker
after all the linker input files have been seen but before the
section sizes have been set. This is called after
ADJUST_DYNAMIC_SYMBOL, but before SIZE_DYNAMIC_SECTIONS. */
bfd_boolean (*elf_backend_always_size_sections)
- PARAMS ((bfd *output_bfd, struct bfd_link_info *info));
+ (bfd *output_bfd, struct bfd_link_info *info);
/* The SIZE_DYNAMIC_SECTIONS function is called by the ELF backend
linker after all the linker input files have been seen but before
@@ -690,7 +686,7 @@ struct elf_backend_data
.interp section and any sections created by the
CREATE_DYNAMIC_SECTIONS entry point. */
bfd_boolean (*elf_backend_size_dynamic_sections)
- PARAMS ((bfd *output_bfd, struct bfd_link_info *info));
+ (bfd *output_bfd, struct bfd_link_info *info);
/* The RELOCATE_SECTION function is called by the ELF backend linker
to handle the relocations for a section.
@@ -721,10 +717,9 @@ struct elf_backend_data
section, which means that the addend must be adjusted
accordingly. */
bfd_boolean (*elf_backend_relocate_section)
- PARAMS ((bfd *output_bfd, struct bfd_link_info *info,
- bfd *input_bfd, asection *input_section, bfd_byte *contents,
- Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms,
- asection **local_sections));
+ (bfd *output_bfd, struct bfd_link_info *info, bfd *input_bfd,
+ asection *input_section, bfd_byte *contents, Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms, asection **local_sections);
/* The FINISH_DYNAMIC_SYMBOL function is called by the ELF backend
linker just before it writes a symbol out to the .dynsym section.
@@ -734,70 +729,70 @@ struct elf_backend_data
all .dynsym symbols, while ADJUST_DYNAMIC_SYMBOL is only called
on those symbols which are defined by a dynamic object. */
bfd_boolean (*elf_backend_finish_dynamic_symbol)
- PARAMS ((bfd *output_bfd, struct bfd_link_info *info,
- struct elf_link_hash_entry *h, Elf_Internal_Sym *sym));
+ (bfd *output_bfd, struct bfd_link_info *info,
+ struct elf_link_hash_entry *h, Elf_Internal_Sym *sym);
/* The FINISH_DYNAMIC_SECTIONS function is called by the ELF backend
linker just before it writes all the dynamic sections out to the
output file. The FINISH_DYNAMIC_SYMBOL will have been called on
all dynamic symbols. */
bfd_boolean (*elf_backend_finish_dynamic_sections)
- PARAMS ((bfd *output_bfd, struct bfd_link_info *info));
+ (bfd *output_bfd, struct bfd_link_info *info);
/* A function to do any beginning processing needed for the ELF file
before building the ELF headers and computing file positions. */
void (*elf_backend_begin_write_processing)
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
/* A function to do any final processing needed for the ELF file
before writing it out. The LINKER argument is TRUE if this BFD
was created by the ELF backend linker. */
void (*elf_backend_final_write_processing)
- PARAMS ((bfd *, bfd_boolean linker));
+ (bfd *, bfd_boolean linker);
/* This function is called by get_program_header_size. It should
return the number of additional program segments which this BFD
will need. It should return -1 on error. */
int (*elf_backend_additional_program_headers)
- PARAMS ((bfd *));
+ (bfd *);
/* This function is called to modify an existing segment map in a
backend specific fashion. */
bfd_boolean (*elf_backend_modify_segment_map)
- PARAMS ((bfd *));
+ (bfd *);
/* This function is called during section gc to discover the section a
particular relocation refers to. */
asection * (*gc_mark_hook)
- PARAMS ((asection *sec, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *h, Elf_Internal_Sym *));
+ (asection *sec, struct bfd_link_info *, Elf_Internal_Rela *,
+ struct elf_link_hash_entry *h, Elf_Internal_Sym *);
/* This function, if defined, is called during the sweep phase of gc
in order that a backend might update any data structures it might
be maintaining. */
bfd_boolean (*gc_sweep_hook)
- PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
- const Elf_Internal_Rela *relocs));
+ (bfd *abfd, struct bfd_link_info *info, asection *o,
+ const Elf_Internal_Rela *relocs);
/* This function, if defined, is called after the ELF headers have
been created. This allows for things like the OS and ABI versions
to be changed. */
void (*elf_backend_post_process_headers)
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
/* This function, if defined, prints a symbol to file and returns the
name of the symbol to be printed. It should return NULL to fall
back to default symbol printing. */
const char *(*elf_backend_print_symbol_all)
- PARAMS ((bfd *, PTR, asymbol *));
+ (bfd *, void *, asymbol *);
/* This function, if defined, is called after all local symbols and
global symbols converted to locals are emited into the symtab
section. It allows the backend to emit special global symbols
not handled in the hash table. */
bfd_boolean (*elf_backend_output_arch_syms)
- PARAMS ((bfd *, struct bfd_link_info *, PTR,
- bfd_boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *)));
+ (bfd *, struct bfd_link_info *, void *,
+ bfd_boolean (*) (void *, const char *, Elf_Internal_Sym *, asection *));
/* Copy any information related to dynamic linking from a pre-existing
symbol to a newly created symbol. Also called to copy flags and
@@ -805,66 +800,66 @@ struct elf_backend_data
newly created and plt/got refcounts and dynamic indices should not
be copied. */
void (*elf_backend_copy_indirect_symbol)
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
- struct elf_link_hash_entry *));
+ (const struct elf_backend_data *, struct elf_link_hash_entry *,
+ struct elf_link_hash_entry *);
/* Modify any information related to dynamic linking such that the
symbol is not exported. */
void (*elf_backend_hide_symbol)
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
+ (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean);
/* Emit relocations. Overrides default routine for emitting relocs,
except during a relocatable link, or if all relocs are being emitted. */
bfd_boolean (*elf_backend_emit_relocs)
- PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *));
+ (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *);
/* Count relocations. Not called for relocatable links
or if all relocs are being preserved in the output. */
unsigned int (*elf_backend_count_relocs)
- PARAMS ((asection *, Elf_Internal_Rela *));
+ (asection *, Elf_Internal_Rela *);
/* This function, if defined, is called when an NT_PRSTATUS note is found
in a core file. */
bfd_boolean (*elf_backend_grok_prstatus)
- PARAMS ((bfd *, Elf_Internal_Note *));
+ (bfd *, Elf_Internal_Note *);
/* This function, if defined, is called when an NT_PSINFO or NT_PRPSINFO
note is found in a core file. */
bfd_boolean (*elf_backend_grok_psinfo)
- PARAMS ((bfd *, Elf_Internal_Note *));
+ (bfd *, Elf_Internal_Note *);
/* Functions to print VMAs. Special code to handle 64 bit ELF files. */
void (* elf_backend_sprintf_vma)
- PARAMS ((bfd *, char *, bfd_vma));
+ (bfd *, char *, bfd_vma);
void (* elf_backend_fprintf_vma)
- PARAMS ((bfd *, PTR, bfd_vma));
+ (bfd *, void *, bfd_vma);
/* This function returns class of a reloc type. */
enum elf_reloc_type_class (*elf_backend_reloc_type_class)
- PARAMS ((const Elf_Internal_Rela *));
+ (const Elf_Internal_Rela *);
/* This function, if defined, removes information about discarded functions
from other sections which mention them. */
bfd_boolean (*elf_backend_discard_info)
- PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *));
+ (bfd *, struct elf_reloc_cookie *, struct bfd_link_info *);
/* This function, if defined, signals that the function above has removed
the discarded relocations for this section. */
bfd_boolean (*elf_backend_ignore_discarded_relocs)
- PARAMS ((asection *));
+ (asection *);
/* This function, if defined, may write out the given section.
Returns TRUE if it did so and FALSE if the caller should. */
bfd_boolean (*elf_backend_write_section)
- PARAMS ((bfd *, asection *, bfd_byte *));
+ (bfd *, asection *, bfd_byte *);
/* The level of IRIX compatibility we're striving for.
MIPS ELF specific function. */
irix_compat_t (*elf_backend_mips_irix_compat)
- PARAMS ((bfd *));
+ (bfd *);
reloc_howto_type *(*elf_backend_mips_rtype_to_howto)
- PARAMS ((unsigned int, bfd_boolean));
+ (unsigned int, bfd_boolean);
/* The swapping table to use when dealing with ECOFF information.
Used for the MIPS ELF .mdebug section. */
@@ -873,8 +868,8 @@ struct elf_backend_data
/* This function implements `bfd_elf_bfd_from_remote_memory';
see elf.c, elfcode.h. */
bfd *(*elf_backend_bfd_from_remote_memory)
- PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma vma, char *myaddr, int len)));
+ (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
+ int (*target_read_memory) (bfd_vma vma, char *myaddr, int len));
/* Alternate EM_xxxx machine codes for this backend. */
int elf_machine_alt1;
@@ -998,7 +993,7 @@ struct bfd_elf_section_data
/* A pointer to a linked list tracking dynamic relocs copied for
local symbols. */
- PTR local_dynrel;
+ void *local_dynrel;
/* A pointer to the bfd section used for dynamic relocs. */
asection *sreloc;
@@ -1016,7 +1011,7 @@ struct bfd_elf_section_data
asection *next_in_group;
/* A pointer used for various section optimizations. */
- PTR sec_info;
+ void *sec_info;
};
#define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd)
@@ -1034,7 +1029,7 @@ struct bfd_elf_section_data
&& sec->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
#define get_elf_backend_data(abfd) \
- ((struct elf_backend_data *) (abfd)->xvec->backend_data)
+ ((const struct elf_backend_data *) (abfd)->xvec->backend_data)
/* This struct is used to pass information to routines called via
elf_link_hash_traverse which must return failure. */
@@ -1166,7 +1161,7 @@ struct elf_obj_tdata
bfd_size_type program_header_size;
/* Used by find_nearest_line entry point. */
- PTR line_info;
+ void *line_info;
/* Used by MIPS ELF find_nearest_line entry point. The structure
could be included directly in this one, but there's no point to
@@ -1178,7 +1173,7 @@ struct elf_obj_tdata
struct dwarf1_debug *dwarf1_find_line_info;
/* A place to stash dwarf2 info for this bfd. */
- PTR dwarf2_find_line_info;
+ void *dwarf2_find_line_info;
/* An array of stub sections indexed by symbol number, used by the
MIPS ELF linker. FIXME: We should figure out some way to only
@@ -1244,377 +1239,375 @@ struct elf_obj_tdata
#define elf_flags_init(bfd) (elf_tdata(bfd) -> flags_init)
extern void _bfd_elf_swap_verdef_in
- PARAMS ((bfd *, const Elf_External_Verdef *, Elf_Internal_Verdef *));
+ (bfd *, const Elf_External_Verdef *, Elf_Internal_Verdef *);
extern void _bfd_elf_swap_verdef_out
- PARAMS ((bfd *, const Elf_Internal_Verdef *, Elf_External_Verdef *));
+ (bfd *, const Elf_Internal_Verdef *, Elf_External_Verdef *);
extern void _bfd_elf_swap_verdaux_in
- PARAMS ((bfd *, const Elf_External_Verdaux *, Elf_Internal_Verdaux *));
+ (bfd *, const Elf_External_Verdaux *, Elf_Internal_Verdaux *);
extern void _bfd_elf_swap_verdaux_out
- PARAMS ((bfd *, const Elf_Internal_Verdaux *, Elf_External_Verdaux *));
+ (bfd *, const Elf_Internal_Verdaux *, Elf_External_Verdaux *);
extern void _bfd_elf_swap_verneed_in
- PARAMS ((bfd *, const Elf_External_Verneed *, Elf_Internal_Verneed *));
+ (bfd *, const Elf_External_Verneed *, Elf_Internal_Verneed *);
extern void _bfd_elf_swap_verneed_out
- PARAMS ((bfd *, const Elf_Internal_Verneed *, Elf_External_Verneed *));
+ (bfd *, const Elf_Internal_Verneed *, Elf_External_Verneed *);
extern void _bfd_elf_swap_vernaux_in
- PARAMS ((bfd *, const Elf_External_Vernaux *, Elf_Internal_Vernaux *));
+ (bfd *, const Elf_External_Vernaux *, Elf_Internal_Vernaux *);
extern void _bfd_elf_swap_vernaux_out
- PARAMS ((bfd *, const Elf_Internal_Vernaux *, Elf_External_Vernaux *));
+ (bfd *, const Elf_Internal_Vernaux *, Elf_External_Vernaux *);
extern void _bfd_elf_swap_versym_in
- PARAMS ((bfd *, const Elf_External_Versym *, Elf_Internal_Versym *));
+ (bfd *, const Elf_External_Versym *, Elf_Internal_Versym *);
extern void _bfd_elf_swap_versym_out
- PARAMS ((bfd *, const Elf_Internal_Versym *, Elf_External_Versym *));
+ (bfd *, const Elf_Internal_Versym *, Elf_External_Versym *);
extern int _bfd_elf_section_from_bfd_section
- PARAMS ((bfd *, asection *));
+ (bfd *, asection *);
extern char *bfd_elf_string_from_elf_section
- PARAMS ((bfd *, unsigned, unsigned));
+ (bfd *, unsigned, unsigned);
extern char *bfd_elf_get_str_section
- PARAMS ((bfd *, unsigned));
+ (bfd *, unsigned);
extern Elf_Internal_Sym *bfd_elf_get_elf_syms
- PARAMS ((bfd *, Elf_Internal_Shdr *, size_t, size_t,
- Elf_Internal_Sym *, PTR, Elf_External_Sym_Shndx *));
+ (bfd *, Elf_Internal_Shdr *, size_t, size_t, Elf_Internal_Sym *, void *,
+ Elf_External_Sym_Shndx *);
extern const char *bfd_elf_local_sym_name
- PARAMS ((bfd *, Elf_Internal_Sym *));
+ (bfd *, Elf_Internal_Sym *);
extern bfd_boolean _bfd_elf_copy_private_bfd_data
- PARAMS ((bfd *, bfd *));
+ (bfd *, bfd *);
extern bfd_boolean _bfd_elf_print_private_bfd_data
- PARAMS ((bfd *, PTR));
+ (bfd *, void *);
extern void bfd_elf_print_symbol
- PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
+ (bfd *, void *, asymbol *, bfd_print_symbol_type);
#define elf_string_from_elf_strtab(abfd, strindex) \
- bfd_elf_string_from_elf_section(abfd, elf_elfheader(abfd)->e_shstrndx, \
- strindex)
+ bfd_elf_string_from_elf_section (abfd, elf_elfheader(abfd)->e_shstrndx, \
+ strindex)
#define bfd_elf32_print_symbol bfd_elf_print_symbol
#define bfd_elf64_print_symbol bfd_elf_print_symbol
extern void _bfd_elf_sprintf_vma
- PARAMS ((bfd *, char *, bfd_vma));
+ (bfd *, char *, bfd_vma);
extern void _bfd_elf_fprintf_vma
- PARAMS ((bfd *, PTR, bfd_vma));
+ (bfd *, void *, bfd_vma);
extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
- PARAMS ((const Elf_Internal_Rela *));
+ (const Elf_Internal_Rela *);
extern bfd_vma _bfd_elf_rela_local_sym
- PARAMS ((bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *));
+ (bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *);
extern bfd_vma _bfd_elf_rel_local_sym
- PARAMS ((bfd *, Elf_Internal_Sym *, asection **, bfd_vma));
+ (bfd *, Elf_Internal_Sym *, asection **, bfd_vma);
extern bfd_vma _bfd_elf_section_offset
- PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_vma));
+ (bfd *, struct bfd_link_info *, asection *, bfd_vma);
extern unsigned long bfd_elf_hash
- PARAMS ((const char *));
+ (const char *);
extern bfd_reloc_status_type bfd_elf_generic_reloc
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+ (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
extern bfd_boolean bfd_elf_mkobject
- PARAMS ((bfd *));
+ (bfd *);
extern bfd_boolean bfd_elf_mkcorefile
- PARAMS ((bfd *));
+ (bfd *);
extern Elf_Internal_Shdr *bfd_elf_find_section
- PARAMS ((bfd *, char *));
+ (bfd *, char *);
extern bfd_boolean _bfd_elf_make_section_from_shdr
- PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
+ (bfd *, Elf_Internal_Shdr *, const char *);
extern bfd_boolean _bfd_elf_make_section_from_phdr
- PARAMS ((bfd *, Elf_Internal_Phdr *, int, const char *));
+ (bfd *, Elf_Internal_Phdr *, int, const char *);
extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
+ (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create
- PARAMS ((bfd *));
+ (bfd *);
extern void _bfd_elf_link_hash_copy_indirect
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
- struct elf_link_hash_entry *));
+ (const struct elf_backend_data *, struct elf_link_hash_entry *,
+ struct elf_link_hash_entry *);
extern void _bfd_elf_link_hash_hide_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
+ (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean);
extern bfd_boolean _bfd_elf_link_hash_table_init
- PARAMS ((struct elf_link_hash_table *, bfd *,
- struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
- struct bfd_hash_table *,
- const char *)));
+ (struct elf_link_hash_table *, bfd *,
+ struct bfd_hash_entry *(*)
+ (struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
extern bfd_boolean _bfd_elf_slurp_version_tables
- PARAMS ((bfd *));
+ (bfd *);
extern bfd_boolean _bfd_elf_merge_sections
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf_discard_group
- PARAMS ((bfd *, struct sec *));
+ (bfd *, struct sec *);
extern void bfd_elf_set_group_contents
- PARAMS ((bfd *, asection *, PTR));
+ (bfd *, asection *, void *);
extern void _bfd_elf_link_just_syms
- PARAMS ((asection *, struct bfd_link_info *));
+ (asection *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf_copy_private_symbol_data
- PARAMS ((bfd *, asymbol *, bfd *, asymbol *));
+ (bfd *, asymbol *, bfd *, asymbol *);
extern bfd_boolean _bfd_elf_copy_private_section_data
- PARAMS ((bfd *, asection *, bfd *, asection *));
+ (bfd *, asection *, bfd *, asection *);
extern bfd_boolean _bfd_elf_write_object_contents
- PARAMS ((bfd *));
+ (bfd *);
extern bfd_boolean _bfd_elf_write_corefile_contents
- PARAMS ((bfd *));
+ (bfd *);
extern bfd_boolean _bfd_elf_set_section_contents
- PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
+ (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
extern long _bfd_elf_get_symtab_upper_bound
- PARAMS ((bfd *));
+ (bfd *);
extern long _bfd_elf_get_symtab
- PARAMS ((bfd *, asymbol **));
+ (bfd *, asymbol **);
extern long _bfd_elf_get_dynamic_symtab_upper_bound
- PARAMS ((bfd *));
+ (bfd *);
extern long _bfd_elf_canonicalize_dynamic_symtab
- PARAMS ((bfd *, asymbol **));
+ (bfd *, asymbol **);
extern long _bfd_elf_get_reloc_upper_bound
- PARAMS ((bfd *, sec_ptr));
+ (bfd *, sec_ptr);
extern long _bfd_elf_canonicalize_reloc
- PARAMS ((bfd *, sec_ptr, arelent **, asymbol **));
+ (bfd *, sec_ptr, arelent **, asymbol **);
extern long _bfd_elf_get_dynamic_reloc_upper_bound
- PARAMS ((bfd *));
+ (bfd *);
extern long _bfd_elf_canonicalize_dynamic_reloc
- PARAMS ((bfd *, arelent **, asymbol **));
+ (bfd *, arelent **, asymbol **);
extern asymbol *_bfd_elf_make_empty_symbol
- PARAMS ((bfd *));
+ (bfd *);
extern void _bfd_elf_get_symbol_info
- PARAMS ((bfd *, asymbol *, symbol_info *));
+ (bfd *, asymbol *, symbol_info *);
extern bfd_boolean _bfd_elf_is_local_label_name
- PARAMS ((bfd *, const char *));
+ (bfd *, const char *);
extern alent *_bfd_elf_get_lineno
- PARAMS ((bfd *, asymbol *));
+ (bfd *, asymbol *);
extern bfd_boolean _bfd_elf_set_arch_mach
- PARAMS ((bfd *, enum bfd_architecture, unsigned long));
+ (bfd *, enum bfd_architecture, unsigned long);
extern bfd_boolean _bfd_elf_find_nearest_line
- PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
- const char **, unsigned int *));
+ (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
+ unsigned int *);
#define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols
#define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
extern int _bfd_elf_sizeof_headers
- PARAMS ((bfd *, bfd_boolean));
+ (bfd *, bfd_boolean);
extern bfd_boolean _bfd_elf_new_section_hook
- PARAMS ((bfd *, asection *));
+ (bfd *, asection *);
extern bfd_boolean _bfd_elf_init_reloc_shdr
- PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, bfd_boolean));
-extern bfd_boolean _bfd_elf_get_sec_type_attr (bfd *, const char *,
- int *, int *);
+ (bfd *, Elf_Internal_Shdr *, asection *, bfd_boolean);
+extern bfd_boolean _bfd_elf_get_sec_type_attr
+ (bfd *, const char *, int *, int *);
/* If the target doesn't have reloc handling written yet: */
extern void _bfd_elf_no_info_to_howto
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
+ (bfd *, arelent *, Elf_Internal_Rela *);
extern bfd_boolean bfd_section_from_shdr
- PARAMS ((bfd *, unsigned int shindex));
+ (bfd *, unsigned int shindex);
extern bfd_boolean bfd_section_from_phdr
- PARAMS ((bfd *, Elf_Internal_Phdr *, int));
+ (bfd *, Elf_Internal_Phdr *, int);
extern int _bfd_elf_symbol_from_bfd_symbol
- PARAMS ((bfd *, asymbol **));
+ (bfd *, asymbol **);
extern asection *bfd_section_from_r_symndx
- PARAMS ((bfd *, struct sym_sec_cache *, asection *, unsigned long));
+ (bfd *, struct sym_sec_cache *, asection *, unsigned long);
extern asection *bfd_section_from_elf_index
- PARAMS ((bfd *, unsigned int));
+ (bfd *, unsigned int);
extern struct bfd_strtab_hash *_bfd_elf_stringtab_init
- PARAMS ((void));
+ (void);
extern struct elf_strtab_hash * _bfd_elf_strtab_init
- PARAMS ((void));
+ (void);
extern void _bfd_elf_strtab_free
- PARAMS ((struct elf_strtab_hash *));
+ (struct elf_strtab_hash *);
extern bfd_size_type _bfd_elf_strtab_add
- PARAMS ((struct elf_strtab_hash *, const char *, bfd_boolean));
+ (struct elf_strtab_hash *, const char *, bfd_boolean);
extern void _bfd_elf_strtab_addref
- PARAMS ((struct elf_strtab_hash *, bfd_size_type));
+ (struct elf_strtab_hash *, bfd_size_type);
extern void _bfd_elf_strtab_delref
- PARAMS ((struct elf_strtab_hash *, bfd_size_type));
+ (struct elf_strtab_hash *, bfd_size_type);
extern void _bfd_elf_strtab_clear_all_refs
- PARAMS ((struct elf_strtab_hash *));
+ (struct elf_strtab_hash *);
extern bfd_size_type _bfd_elf_strtab_size
- PARAMS ((struct elf_strtab_hash *));
+ (struct elf_strtab_hash *);
extern bfd_size_type _bfd_elf_strtab_offset
- PARAMS ((struct elf_strtab_hash *, bfd_size_type));
+ (struct elf_strtab_hash *, bfd_size_type);
extern bfd_boolean _bfd_elf_strtab_emit
- PARAMS ((bfd *, struct elf_strtab_hash *));
+ (bfd *, struct elf_strtab_hash *);
extern void _bfd_elf_strtab_finalize
- PARAMS ((struct elf_strtab_hash *));
+ (struct elf_strtab_hash *);
extern bfd_boolean _bfd_elf_discard_section_eh_frame
- PARAMS ((bfd *, struct bfd_link_info *, asection *,
- bfd_boolean (*) (bfd_vma, PTR), struct elf_reloc_cookie *));
+ (bfd *, struct bfd_link_info *, asection *,
+ bfd_boolean (*) (bfd_vma, void *), struct elf_reloc_cookie *);
extern bfd_boolean _bfd_elf_discard_section_eh_frame_hdr
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_vma _bfd_elf_eh_frame_section_offset
- PARAMS ((bfd *, asection *, bfd_vma));
+ (bfd *, asection *, bfd_vma);
extern bfd_boolean _bfd_elf_write_section_eh_frame
- PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_byte *));
+ (bfd *, struct bfd_link_info *, asection *, bfd_byte *);
extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr
- PARAMS ((struct bfd_link_info *));
+ (struct bfd_link_info *);
extern bfd_boolean _bfd_elf_merge_symbol
- PARAMS ((bfd *, struct bfd_link_info *, const char *,
- Elf_Internal_Sym *, asection **, bfd_vma *,
- struct elf_link_hash_entry **, bfd_boolean *, bfd_boolean *,
- bfd_boolean *, bfd_boolean *, bfd_boolean));
+ (bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *,
+ asection **, bfd_vma *, struct elf_link_hash_entry **, bfd_boolean *,
+ bfd_boolean *, bfd_boolean *, bfd_boolean *, bfd_boolean);
extern bfd_boolean _bfd_elf_add_default_symbol
- PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
- const char *, Elf_Internal_Sym *, asection **, bfd_vma *,
- bfd_boolean *, bfd_boolean, bfd_boolean));
+ (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
+ const char *, Elf_Internal_Sym *, asection **, bfd_vma *,
+ bfd_boolean *, bfd_boolean, bfd_boolean);
extern bfd_boolean _bfd_elf_export_symbol
- PARAMS ((struct elf_link_hash_entry *, PTR));
+ (struct elf_link_hash_entry *, void *);
extern bfd_boolean _bfd_elf_link_find_version_dependencies
- PARAMS ((struct elf_link_hash_entry *, PTR));
+ (struct elf_link_hash_entry *, void *);
extern bfd_boolean _bfd_elf_link_assign_sym_version
- PARAMS ((struct elf_link_hash_entry *, PTR));
+ (struct elf_link_hash_entry *, void *);
extern bfd_boolean _bfd_elf_link_record_dynamic_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+ (struct bfd_link_info *, struct elf_link_hash_entry *);
extern long _bfd_elf_link_lookup_local_dynindx
- PARAMS ((struct bfd_link_info *, bfd *, long));
+ (struct bfd_link_info *, bfd *, long);
extern bfd_boolean _bfd_elf_compute_section_file_positions
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern void _bfd_elf_assign_file_positions_for_relocs
- PARAMS ((bfd *));
+ (bfd *);
extern file_ptr _bfd_elf_assign_file_position_for_section
- PARAMS ((Elf_Internal_Shdr *, file_ptr, bfd_boolean));
+ (Elf_Internal_Shdr *, file_ptr, bfd_boolean);
extern bfd_boolean _bfd_elf_validate_reloc
- PARAMS ((bfd *, arelent *));
+ (bfd *, arelent *);
extern bfd_boolean _bfd_elf_link_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf_create_got_section
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern unsigned long _bfd_elf_link_renumber_dynsyms
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elfcore_make_pseudosection
- PARAMS ((bfd *, char *, size_t, ufile_ptr));
+ (bfd *, char *, size_t, ufile_ptr);
extern char *_bfd_elfcore_strndup
- PARAMS ((bfd *, char *, size_t));
+ (bfd *, char *, size_t);
extern Elf_Internal_Rela *_bfd_elf_link_read_relocs
- PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, bfd_boolean));
+ (bfd *, asection *, void *, Elf_Internal_Rela *, bfd_boolean);
extern bfd_boolean _bfd_elf_link_size_reloc_section
- PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
+ (bfd *, Elf_Internal_Shdr *, asection *);
extern bfd_boolean _bfd_elf_link_output_relocs
- PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *));
+ (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *);
extern bfd_boolean _bfd_elf_fix_symbol_flags
- PARAMS ((struct elf_link_hash_entry *, struct elf_info_failed *));
+ (struct elf_link_hash_entry *, struct elf_info_failed *);
extern bfd_boolean _bfd_elf_adjust_dynamic_symbol
- PARAMS ((struct elf_link_hash_entry *, PTR));
+ (struct elf_link_hash_entry *, void *);
extern bfd_boolean _bfd_elf_link_sec_merge_syms
- PARAMS ((struct elf_link_hash_entry *, PTR));
+ (struct elf_link_hash_entry *, void *);
extern bfd_boolean _bfd_elf_dynamic_symbol_p
- PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean));
+ (struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean);
extern bfd_boolean _bfd_elf_symbol_refs_local_p
- PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean));
+ (struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean);
extern const bfd_target *bfd_elf32_object_p
- PARAMS ((bfd *));
+ (bfd *);
extern const bfd_target *bfd_elf32_core_file_p
- PARAMS ((bfd *));
+ (bfd *);
extern char *bfd_elf32_core_file_failing_command
- PARAMS ((bfd *));
+ (bfd *);
extern int bfd_elf32_core_file_failing_signal
- PARAMS ((bfd *));
+ (bfd *);
extern bfd_boolean bfd_elf32_core_file_matches_executable_p
- PARAMS ((bfd *, bfd *));
+ (bfd *, bfd *);
extern bfd_boolean bfd_elf32_bfd_link_add_symbols
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf32_bfd_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern void bfd_elf32_swap_symbol_in
- PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *));
+ (bfd *, const void *, const void *, Elf_Internal_Sym *);
extern void bfd_elf32_swap_symbol_out
- PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
+ (bfd *, const Elf_Internal_Sym *, void *, void *);
extern void bfd_elf32_swap_reloc_in
- PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+ (bfd *, const bfd_byte *, Elf_Internal_Rela *);
extern void bfd_elf32_swap_reloc_out
- PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
+ (bfd *, const Elf_Internal_Rela *, bfd_byte *);
extern void bfd_elf32_swap_reloca_in
- PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+ (bfd *, const bfd_byte *, Elf_Internal_Rela *);
extern void bfd_elf32_swap_reloca_out
- PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
+ (bfd *, const Elf_Internal_Rela *, bfd_byte *);
extern void bfd_elf32_swap_phdr_in
- PARAMS ((bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *));
+ (bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *);
extern void bfd_elf32_swap_phdr_out
- PARAMS ((bfd *, const Elf_Internal_Phdr *, Elf32_External_Phdr *));
+ (bfd *, const Elf_Internal_Phdr *, Elf32_External_Phdr *);
extern void bfd_elf32_swap_dyn_in
- PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
+ (bfd *, const void *, Elf_Internal_Dyn *);
extern void bfd_elf32_swap_dyn_out
- PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
+ (bfd *, const Elf_Internal_Dyn *, void *);
extern long bfd_elf32_slurp_symbol_table
- PARAMS ((bfd *, asymbol **, bfd_boolean));
+ (bfd *, asymbol **, bfd_boolean);
extern bfd_boolean bfd_elf32_write_shdrs_and_ehdr
- PARAMS ((bfd *));
+ (bfd *);
extern int bfd_elf32_write_out_phdrs
- PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int));
+ (bfd *, const Elf_Internal_Phdr *, unsigned int);
extern void bfd_elf32_write_relocs
- PARAMS ((bfd *, asection *, PTR));
+ (bfd *, asection *, void *);
extern bfd_boolean bfd_elf32_slurp_reloc_table
- PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
+ (bfd *, asection *, asymbol **, bfd_boolean);
extern bfd_boolean bfd_elf32_add_dynamic_entry
- PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
+ (struct bfd_link_info *, bfd_vma, bfd_vma);
extern const bfd_target *bfd_elf64_object_p
- PARAMS ((bfd *));
+ (bfd *);
extern const bfd_target *bfd_elf64_core_file_p
- PARAMS ((bfd *));
+ (bfd *);
extern char *bfd_elf64_core_file_failing_command
- PARAMS ((bfd *));
+ (bfd *);
extern int bfd_elf64_core_file_failing_signal
- PARAMS ((bfd *));
+ (bfd *);
extern bfd_boolean bfd_elf64_core_file_matches_executable_p
- PARAMS ((bfd *, bfd *));
+ (bfd *, bfd *);
extern bfd_boolean bfd_elf64_bfd_link_add_symbols
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf64_bfd_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern void bfd_elf64_swap_symbol_in
- PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *));
+ (bfd *, const void *, const void *, Elf_Internal_Sym *);
extern void bfd_elf64_swap_symbol_out
- PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
+ (bfd *, const Elf_Internal_Sym *, void *, void *);
extern void bfd_elf64_swap_reloc_in
- PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+ (bfd *, const bfd_byte *, Elf_Internal_Rela *);
extern void bfd_elf64_swap_reloc_out
- PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
+ (bfd *, const Elf_Internal_Rela *, bfd_byte *);
extern void bfd_elf64_swap_reloca_in
- PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
+ (bfd *, const bfd_byte *, Elf_Internal_Rela *);
extern void bfd_elf64_swap_reloca_out
- PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
+ (bfd *, const Elf_Internal_Rela *, bfd_byte *);
extern void bfd_elf64_swap_phdr_in
- PARAMS ((bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *));
+ (bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *);
extern void bfd_elf64_swap_phdr_out
- PARAMS ((bfd *, const Elf_Internal_Phdr *, Elf64_External_Phdr *));
+ (bfd *, const Elf_Internal_Phdr *, Elf64_External_Phdr *);
extern void bfd_elf64_swap_dyn_in
- PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *));
+ (bfd *, const void *, Elf_Internal_Dyn *);
extern void bfd_elf64_swap_dyn_out
- PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
+ (bfd *, const Elf_Internal_Dyn *, void *);
extern long bfd_elf64_slurp_symbol_table
- PARAMS ((bfd *, asymbol **, bfd_boolean));
+ (bfd *, asymbol **, bfd_boolean);
extern bfd_boolean bfd_elf64_write_shdrs_and_ehdr
- PARAMS ((bfd *));
+ (bfd *);
extern int bfd_elf64_write_out_phdrs
- PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int));
+ (bfd *, const Elf_Internal_Phdr *, unsigned int);
extern void bfd_elf64_write_relocs
- PARAMS ((bfd *, asection *, PTR));
+ (bfd *, asection *, void *);
extern bfd_boolean bfd_elf64_slurp_reloc_table
- PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
+ (bfd *, asection *, asymbol **, bfd_boolean);
extern bfd_boolean bfd_elf64_add_dynamic_entry
- PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma));
+ (struct bfd_link_info *, bfd_vma, bfd_vma);
#define bfd_elf32_link_record_dynamic_symbol \
_bfd_elf_link_record_dynamic_symbol
@@ -1622,71 +1615,127 @@ extern bfd_boolean bfd_elf64_add_dynamic_entry
_bfd_elf_link_record_dynamic_symbol
extern int elf_link_record_local_dynamic_symbol
- PARAMS ((struct bfd_link_info *, bfd *, long));
+ (struct bfd_link_info *, bfd *, long);
#define _bfd_elf32_link_record_local_dynamic_symbol \
elf_link_record_local_dynamic_symbol
#define _bfd_elf64_link_record_local_dynamic_symbol \
elf_link_record_local_dynamic_symbol
extern bfd_boolean _bfd_elf_close_and_cleanup
- PARAMS ((bfd *));
+ (bfd *);
extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn
- PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR,
- asection *, bfd *, char **));
+ (bfd *, arelent *, struct symbol_cache_entry *, void *,
+ asection *, bfd *, char **);
extern bfd_boolean _bfd_elf32_gc_sections
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf32_gc_common_finalize_got_offsets
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf32_gc_common_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf32_gc_record_vtinherit
- PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
+ (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
extern bfd_boolean _bfd_elf32_gc_record_vtentry
- PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
+ (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
extern bfd_boolean _bfd_elf64_gc_sections
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf64_gc_common_finalize_got_offsets
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf64_gc_common_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_elf64_gc_record_vtinherit
- PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
+ (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
extern bfd_boolean _bfd_elf64_gc_record_vtentry
- PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma));
+ (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
extern bfd_boolean _bfd_elf32_reloc_symbol_deleted_p
- PARAMS ((bfd_vma, PTR));
+ (bfd_vma, void *);
extern bfd_boolean _bfd_elf64_reloc_symbol_deleted_p
- PARAMS ((bfd_vma, PTR));
+ (bfd_vma, void *);
/* Exported interface for writing elf corefile notes. */
extern char *elfcore_write_note
- PARAMS ((bfd *, char *, int *, const char *, int, const PTR, int));
+ (bfd *, char *, int *, const char *, int, const void *, int);
extern char *elfcore_write_prpsinfo
- PARAMS ((bfd *, char *, int *, const char *, const char *));
+ (bfd *, char *, int *, const char *, const char *);
extern char *elfcore_write_prstatus
- PARAMS ((bfd *, char *, int *, long, int, const PTR));
+ (bfd *, char *, int *, long, int, const void *);
extern char * elfcore_write_pstatus
- PARAMS ((bfd *, char *, int *, long, int, const PTR));
+ (bfd *, char *, int *, long, int, const void *);
extern char *elfcore_write_prfpreg
- PARAMS ((bfd *, char *, int *, const PTR, int));
+ (bfd *, char *, int *, const void *, int);
extern char *elfcore_write_prxfpreg
- PARAMS ((bfd *, char *, int *, const PTR, int));
+ (bfd *, char *, int *, const void *, int);
extern char *elfcore_write_lwpstatus
- PARAMS ((bfd *, char *, int *, long, int, const PTR));
+ (bfd *, char *, int *, long, int, const void *);
extern bfd *_bfd_elf32_bfd_from_remote_memory
- PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma, char *, int)));
+ (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
+ int (*target_read_memory) (bfd_vma, char *, int));
extern bfd *_bfd_elf64_bfd_from_remote_memory
- PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
- int (*target_read_memory) (bfd_vma, char *, int)));
+ (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
+ int (*target_read_memory) (bfd_vma, char *, int));
/* SH ELF specific routine. */
extern bfd_boolean _sh_elf_set_mach_from_flags
- PARAMS ((bfd *));
+ (bfd *);
+
+/* This macro is to avoid lots of duplicated code in the body
+ of xxx_relocate_section() in the various elfxx-xxxx.c files. */
+#define RELOC_FOR_GLOBAL_SYMBOL(h, sym_hashes, r_symndx, symtab_hdr, relocation, sec, unresolved_reloc, info, warned) \
+ do \
+ { \
+ /* It seems this can happen with erroneous or unsupported \
+ input (mixing a.out and elf in an archive, for example.) */ \
+ if (sym_hashes == NULL) \
+ return FALSE; \
+ \
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info]; \
+ \
+ while (h->root.type == bfd_link_hash_indirect \
+ || h->root.type == bfd_link_hash_warning) \
+ h = (struct elf_link_hash_entry *) h->root.u.i.link; \
+ \
+ warned = FALSE; \
+ unresolved_reloc = FALSE; \
+ relocation = 0; \
+ if (h->root.type == bfd_link_hash_defined \
+ || h->root.type == bfd_link_hash_defweak) \
+ { \
+ sec = h->root.u.def.section; \
+ if (sec == NULL \
+ || sec->output_section == NULL) \
+ /* Set a flag that will be cleared later if we find a \
+ relocation value for this symbol. output_section \
+ is typically NULL for symbols satisfied by a shared \
+ library. */ \
+ unresolved_reloc = TRUE; \
+ else \
+ relocation = (h->root.u.def.value \
+ + sec->output_section->vma \
+ + sec->output_offset); \
+ } \
+ else if (h->root.type == bfd_link_hash_undefweak) \
+ ; \
+ else if (!info->executable \
+ && info->unresolved_syms_in_objects == RM_IGNORE \
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) \
+ ; \
+ else \
+ { \
+ if (! info->callbacks->undefined_symbol \
+ (info, h->root.root.string, input_bfd, \
+ input_section, rel->r_offset, \
+ ((info->shared && info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR) \
+ || (!info->shared && info->unresolved_syms_in_objects == RM_GENERATE_ERROR) \
+ || ELF_ST_VISIBILITY (h->other)) \
+ )) \
+ return FALSE; \
+ warned = TRUE; \
+ } \
+ } \
+ while (0)
#endif /* _LIBELF_H_ */
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index e422aa96a55..c71129e694f 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -26,61 +26,44 @@
#define EH_FRAME_HDR_SIZE 8
-static bfd_vma read_unsigned_leb128
- PARAMS ((bfd *, char *, unsigned int *));
-static bfd_signed_vma read_signed_leb128
- PARAMS ((bfd *, char *, unsigned int *));
-static int get_DW_EH_PE_width
- PARAMS ((int, int));
-static bfd_vma read_value
- PARAMS ((bfd *, bfd_byte *, int, int));
-static void write_value
- PARAMS ((bfd *, bfd_byte *, bfd_vma, int));
-static int cie_compare
- PARAMS ((struct cie *, struct cie *));
-static int vma_compare
- PARAMS ((const PTR, const PTR));
-
/* Helper function for reading uleb128 encoded data. */
static bfd_vma
-read_unsigned_leb128 (abfd, buf, bytes_read_ptr)
- bfd *abfd ATTRIBUTE_UNUSED;
- char *buf;
- unsigned int *bytes_read_ptr;
+read_unsigned_leb128 (bfd *abfd ATTRIBUTE_UNUSED,
+ char *buf,
+ unsigned int *bytes_read_ptr)
{
- bfd_vma result;
- unsigned int num_read;
- int shift;
+ bfd_vma result;
+ unsigned int num_read;
+ int shift;
unsigned char byte;
- result = 0;
- shift = 0;
+ result = 0;
+ shift = 0;
num_read = 0;
do
{
byte = bfd_get_8 (abfd, (bfd_byte *) buf);
- buf ++;
- num_read ++;
+ buf++;
+ num_read++;
result |= (((bfd_vma) byte & 0x7f) << shift);
shift += 7;
}
while (byte & 0x80);
- * bytes_read_ptr = num_read;
+ *bytes_read_ptr = num_read;
return result;
}
/* Helper function for reading sleb128 encoded data. */
static bfd_signed_vma
-read_signed_leb128 (abfd, buf, bytes_read_ptr)
- bfd *abfd ATTRIBUTE_UNUSED;
- char *buf;
- unsigned int * bytes_read_ptr;
+read_signed_leb128 (bfd *abfd ATTRIBUTE_UNUSED,
+ char *buf,
+ unsigned int * bytes_read_ptr)
{
- bfd_vma result;
- int shift;
- int num_read;
+ bfd_vma result;
+ int shift;
+ int num_read;
unsigned char byte;
result = 0;
@@ -97,7 +80,7 @@ read_signed_leb128 (abfd, buf, bytes_read_ptr)
while (byte & 0x80);
if (byte & 0x40)
result |= (((bfd_vma) -1) << (shift - 7)) << 7;
- * bytes_read_ptr = num_read;
+ *bytes_read_ptr = num_read;
return result;
}
@@ -120,8 +103,7 @@ while (0)
/* Return 0 if either encoding is variable width, or not yet known to bfd. */
static
-int get_DW_EH_PE_width (encoding, ptr_size)
- int encoding, ptr_size;
+int get_DW_EH_PE_width (int encoding, int ptr_size)
{
/* DW_EH_PE_ values of 0x60 and 0x70 weren't defined at the time .eh_frame
was added to bfd. */
@@ -146,11 +128,7 @@ int get_DW_EH_PE_width (encoding, ptr_size)
/* Read a width sized value from memory. */
static bfd_vma
-read_value (abfd, buf, width, is_signed)
- bfd *abfd;
- bfd_byte *buf;
- int width;
- int is_signed;
+read_value (bfd *abfd, bfd_byte *buf, int width, int is_signed)
{
bfd_vma value;
@@ -185,11 +163,7 @@ read_value (abfd, buf, width, is_signed)
/* Store a width sized value to memory. */
static void
-write_value (abfd, buf, value, width)
- bfd *abfd;
- bfd_byte *buf;
- bfd_vma value;
- int width;
+write_value (bfd *abfd, bfd_byte *buf, bfd_vma value, int width)
{
switch (width)
{
@@ -203,8 +177,7 @@ write_value (abfd, buf, value, width)
/* Return zero if C1 and C2 CIEs can be merged. */
static
-int cie_compare (c1, c2)
- struct cie *c1, *c2;
+int cie_compare (struct cie *c1, struct cie *c2)
{
if (c1->hdr.length == c2->hdr.length
&& c1->version == c2->version
@@ -218,8 +191,7 @@ int cie_compare (c1, c2)
&& c1->per_encoding == c2->per_encoding
&& c1->lsda_encoding == c2->lsda_encoding
&& c1->fde_encoding == c2->fde_encoding
- && (c1->initial_insn_length
- == c2->initial_insn_length)
+ && c1->initial_insn_length == c2->initial_insn_length
&& memcmp (c1->initial_instructions,
c2->initial_instructions,
c1->initial_insn_length) == 0)
@@ -234,13 +206,10 @@ int cie_compare (c1, c2)
deleted. */
bfd_boolean
-_bfd_elf_discard_section_eh_frame (abfd, info, sec,
- reloc_symbol_deleted_p, cookie)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *sec;
- bfd_boolean (*reloc_symbol_deleted_p) PARAMS ((bfd_vma, PTR));
- struct elf_reloc_cookie *cookie;
+_bfd_elf_discard_section_eh_frame
+ (bfd *abfd, struct bfd_link_info *info, asection *sec,
+ bfd_boolean (*reloc_symbol_deleted_p) (bfd_vma, void *),
+ struct elf_reloc_cookie *cookie)
{
bfd_byte *ehbuf = NULL, *buf;
bfd_byte *last_cie, *last_fde;
@@ -274,12 +243,11 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec,
/* Read the frame unwind information from abfd. */
- ehbuf = (bfd_byte *) bfd_malloc (sec->_raw_size);
+ ehbuf = bfd_malloc (sec->_raw_size);
if (ehbuf == NULL)
goto free_no_table;
- if (! bfd_get_section_contents (abfd, sec, ehbuf, (bfd_vma) 0,
- sec->_raw_size))
+ if (! bfd_get_section_contents (abfd, sec, ehbuf, 0, sec->_raw_size))
goto free_no_table;
if (sec->_raw_size >= 4
@@ -693,9 +661,7 @@ free_no_table:
input sections. It finalizes the size of .eh_frame_hdr section. */
bfd_boolean
-_bfd_elf_discard_section_eh_frame_hdr (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+_bfd_elf_discard_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
{
struct elf_link_hash_table *htab;
struct eh_frame_hdr_info *hdr_info;
@@ -723,8 +689,7 @@ _bfd_elf_discard_section_eh_frame_hdr (abfd, info)
since dynamic symbol table has been sized. */
bfd_boolean
-_bfd_elf_maybe_strip_eh_frame_hdr (info)
- struct bfd_link_info *info;
+_bfd_elf_maybe_strip_eh_frame_hdr (struct bfd_link_info *info)
{
asection *o;
bfd *abfd;
@@ -770,18 +735,16 @@ _bfd_elf_maybe_strip_eh_frame_hdr (info)
or to offset with dynamic relocation which is no longer needed. */
bfd_vma
-_bfd_elf_eh_frame_section_offset (output_bfd, sec, offset)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- asection *sec;
- bfd_vma offset;
+_bfd_elf_eh_frame_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED,
+ asection *sec,
+ bfd_vma offset)
{
struct eh_frame_sec_info *sec_info;
unsigned int lo, hi, mid;
if (sec->sec_info_type != ELF_INFO_TYPE_EH_FRAME)
return offset;
- sec_info = (struct eh_frame_sec_info *)
- elf_section_data (sec)->sec_info;
+ sec_info = elf_section_data (sec)->sec_info;
if (offset >= sec->_raw_size)
return offset - (sec->_cooked_size - sec->_raw_size);
@@ -830,11 +793,10 @@ _bfd_elf_eh_frame_section_offset (output_bfd, sec, offset)
contents. */
bfd_boolean
-_bfd_elf_write_section_eh_frame (abfd, info, sec, contents)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *sec;
- bfd_byte *contents;
+_bfd_elf_write_section_eh_frame (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ bfd_byte *contents)
{
struct eh_frame_sec_info *sec_info;
struct elf_link_hash_table *htab;
@@ -849,12 +811,9 @@ _bfd_elf_write_section_eh_frame (abfd, info, sec, contents)
== ELFCLASS64) ? 8 : 4;
if (sec->sec_info_type != ELF_INFO_TYPE_EH_FRAME)
- return bfd_set_section_contents (abfd, sec->output_section,
- contents,
- (file_ptr) sec->output_offset,
- sec->_raw_size);
- sec_info = (struct eh_frame_sec_info *)
- elf_section_data (sec)->sec_info;
+ return bfd_set_section_contents (abfd, sec->output_section, contents,
+ sec->output_offset, sec->_raw_size);
+ sec_info = elf_section_data (sec)->sec_info;
htab = elf_hash_table (info);
hdr_info = &htab->eh_info;
if (hdr_info->table && hdr_info->array == NULL)
@@ -1079,12 +1038,10 @@ _bfd_elf_write_section_eh_frame (abfd, info, sec, contents)
VMA of FDE initial location. */
static int
-vma_compare (a, b)
- const PTR a;
- const PTR b;
+vma_compare (const void *a, const void *b)
{
- struct eh_frame_array_ent *p = (struct eh_frame_array_ent *) a;
- struct eh_frame_array_ent *q = (struct eh_frame_array_ent *) b;
+ const struct eh_frame_array_ent *p = a;
+ const struct eh_frame_array_ent *q = b;
if (p->initial_loc > q->initial_loc)
return 1;
if (p->initial_loc < q->initial_loc)
@@ -1115,9 +1072,7 @@ vma_compare (a, b)
sorted by increasing initial_loc). */
bfd_boolean
-_bfd_elf_write_section_eh_frame_hdr (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+_bfd_elf_write_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
{
struct elf_link_hash_table *htab;
struct eh_frame_hdr_info *hdr_info;
diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h
index 90f648289f6..bdd7a7471e6 100644
--- a/bfd/elf-hppa.h
+++ b/bfd/elf-hppa.h
@@ -44,62 +44,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define elf_hppa_final_link elf32_hppa_final_link
#endif
-static void elf_hppa_info_to_howto
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-
-static void elf_hppa_info_to_howto_rel
- PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
-
-static reloc_howto_type * elf_hppa_reloc_type_lookup
- PARAMS ((bfd *, bfd_reloc_code_real_type));
-
-static bfd_boolean elf_hppa_is_local_label_name
- PARAMS ((bfd *, const char *));
-
-static bfd_boolean elf_hppa_fake_sections
- PARAMS ((bfd *abfd, Elf_Internal_Shdr *, asection *));
-
-static void elf_hppa_final_write_processing
- PARAMS ((bfd *, bfd_boolean));
-
-static int hppa_unwind_entry_compare
- PARAMS ((const PTR, const PTR));
-
-static bfd_boolean elf_hppa_sort_unwind
- PARAMS ((bfd *));
-
#if ARCH_SIZE == 64
-static bfd_boolean elf_hppa_add_symbol_hook
- PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
- const char **, flagword *, asection **, bfd_vma *));
-
-static bfd_boolean elf_hppa_unmark_useless_dynamic_symbols
- PARAMS ((struct elf_link_hash_entry *, PTR));
-
-static bfd_boolean elf_hppa_remark_useless_dynamic_symbols
- PARAMS ((struct elf_link_hash_entry *, PTR));
-
-static bfd_boolean elf_hppa_is_dynamic_loader_symbol
- PARAMS ((const char *));
-
-static void elf_hppa_record_segment_addrs
- PARAMS ((bfd *, asection *, PTR));
-
-static bfd_boolean elf_hppa_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
-
-static bfd_boolean elf_hppa_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
- bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-
static bfd_reloc_status_type elf_hppa_final_link_relocate
- PARAMS ((Elf_Internal_Rela *, bfd *, bfd *, asection *,
- bfd_byte *, bfd_vma, struct bfd_link_info *,
- asection *, struct elf_link_hash_entry *,
- struct elf64_hppa_dyn_hash_entry *));
+ (Elf_Internal_Rela *, bfd *, bfd *, asection *, bfd_byte *, bfd_vma,
+ struct bfd_link_info *, asection *, struct elf_link_hash_entry *,
+ struct elf64_hppa_dyn_hash_entry *);
static int elf_hppa_relocate_insn
- PARAMS ((int, int, unsigned int));
+ (int, int, unsigned int);
#endif
/* ELF/PA relocation howto entries. */
@@ -615,11 +567,10 @@ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] =
format, and field selector. */
elf_hppa_reloc_type
-elf_hppa_reloc_final_type (abfd, base_type, format, field)
- bfd *abfd;
- elf_hppa_reloc_type base_type;
- int format;
- unsigned int field;
+elf_hppa_reloc_final_type (bfd *abfd,
+ elf_hppa_reloc_type base_type,
+ int format,
+ unsigned int field)
{
elf_hppa_reloc_type final_type = base_type;
@@ -884,26 +835,25 @@ elf_hppa_reloc_final_type (abfd, base_type, format, field)
relocation with modifications based on format and field. */
elf_hppa_reloc_type **
-_bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
- bfd *abfd;
- elf_hppa_reloc_type base_type;
- int format;
- unsigned int field;
- int ignore ATTRIBUTE_UNUSED;
- asymbol *sym ATTRIBUTE_UNUSED;
+_bfd_elf_hppa_gen_reloc_type (bfd *abfd,
+ elf_hppa_reloc_type base_type,
+ int format,
+ unsigned int field,
+ int ignore ATTRIBUTE_UNUSED,
+ asymbol *sym ATTRIBUTE_UNUSED)
{
elf_hppa_reloc_type *finaltype;
elf_hppa_reloc_type **final_types;
bfd_size_type amt = sizeof (elf_hppa_reloc_type *) * 2;
/* Allocate slots for the BFD relocation. */
- final_types = (elf_hppa_reloc_type **) bfd_alloc (abfd, amt);
+ final_types = bfd_alloc (abfd, amt);
if (final_types == NULL)
return NULL;
/* Allocate space for the relocation itself. */
amt = sizeof (elf_hppa_reloc_type);
- finaltype = (elf_hppa_reloc_type *) bfd_alloc (abfd, amt);
+ finaltype = bfd_alloc (abfd, amt);
if (finaltype == NULL)
return NULL;
@@ -919,12 +869,11 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym)
/* Translate from an elf into field into a howto relocation pointer. */
static void
-elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *bfd_reloc;
- Elf_Internal_Rela *elf_reloc;
+elf_hppa_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *bfd_reloc,
+ Elf_Internal_Rela *elf_reloc)
{
- BFD_ASSERT (ELF_R_TYPE(elf_reloc->r_info)
+ BFD_ASSERT (ELF_R_TYPE (elf_reloc->r_info)
< (unsigned int) R_PARISC_UNIMPLEMENTED);
bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)];
}
@@ -932,10 +881,9 @@ elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc)
/* Translate from an elf into field into a howto relocation pointer. */
static void
-elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
- bfd *abfd ATTRIBUTE_UNUSED;
- arelent *bfd_reloc;
- Elf_Internal_Rela *elf_reloc;
+elf_hppa_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *bfd_reloc,
+ Elf_Internal_Rela *elf_reloc)
{
BFD_ASSERT (ELF_R_TYPE(elf_reloc->r_info)
< (unsigned int) R_PARISC_UNIMPLEMENTED);
@@ -946,9 +894,8 @@ elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
relocation for an ARCH machine. */
static reloc_howto_type *
-elf_hppa_reloc_type_lookup (abfd, code)
- bfd *abfd ATTRIBUTE_UNUSED;
- bfd_reloc_code_real_type code;
+elf_hppa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+ bfd_reloc_code_real_type code)
{
if ((int) code < (int) R_PARISC_UNIMPLEMENTED)
{
@@ -961,9 +908,7 @@ elf_hppa_reloc_type_lookup (abfd, code)
/* Return TRUE if SYM represents a local label symbol. */
static bfd_boolean
-elf_hppa_is_local_label_name (abfd, name)
- bfd *abfd ATTRIBUTE_UNUSED;
- const char *name;
+elf_hppa_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, const char *name)
{
if (name[0] == 'L' && name[1] == '$')
return 1;
@@ -974,12 +919,9 @@ elf_hppa_is_local_label_name (abfd, name)
section name, which is a hack, but ought to work. */
static bfd_boolean
-elf_hppa_fake_sections (abfd, hdr, sec)
- bfd *abfd;
- Elf_Internal_Shdr *hdr;
- asection *sec;
+elf_hppa_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
{
- register const char *name;
+ const char *name;
name = bfd_get_section_name (abfd, sec);
@@ -1017,9 +959,8 @@ elf_hppa_fake_sections (abfd, hdr, sec)
}
static void
-elf_hppa_final_write_processing (abfd, linker)
- bfd *abfd;
- bfd_boolean linker ATTRIBUTE_UNUSED;
+elf_hppa_final_write_processing (bfd *abfd,
+ bfd_boolean linker ATTRIBUTE_UNUSED)
{
int mach = bfd_get_mach (abfd);
@@ -1048,20 +989,18 @@ elf_hppa_final_write_processing (abfd, linker)
final link. */
static int
-hppa_unwind_entry_compare (a, b)
- const PTR a;
- const PTR b;
+hppa_unwind_entry_compare (const void *a, const void *b)
{
const bfd_byte *ap, *bp;
unsigned long av, bv;
- ap = (const bfd_byte *) a;
+ ap = a;
av = (unsigned long) ap[0] << 24;
av |= (unsigned long) ap[1] << 16;
av |= (unsigned long) ap[2] << 8;
av |= (unsigned long) ap[3];
- bp = (const bfd_byte *) b;
+ bp = b;
bv = (unsigned long) bp[0] << 24;
bv |= (unsigned long) bp[1] << 16;
bv |= (unsigned long) bp[2] << 8;
@@ -1070,8 +1009,7 @@ hppa_unwind_entry_compare (a, b)
return av < bv ? -1 : av > bv ? 1 : 0;
}
-static bfd_boolean elf_hppa_sort_unwind (abfd)
- bfd *abfd;
+static bfd_boolean elf_hppa_sort_unwind (bfd *abfd)
{
asection *s;
@@ -1108,14 +1046,13 @@ static bfd_boolean elf_hppa_sort_unwind (abfd)
indices, which we have to handle. */
static bfd_boolean
-elf_hppa_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
- bfd *abfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- const Elf_Internal_Sym *sym;
- const char **namep ATTRIBUTE_UNUSED;
- flagword *flagsp ATTRIBUTE_UNUSED;
- asection **secp;
- bfd_vma *valp;
+elf_hppa_add_symbol_hook (bfd *abfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ const Elf_Internal_Sym *sym,
+ const char **namep ATTRIBUTE_UNUSED,
+ flagword *flagsp ATTRIBUTE_UNUSED,
+ asection **secp,
+ bfd_vma *valp)
{
int index = sym->st_shndx;
@@ -1138,11 +1075,10 @@ elf_hppa_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
}
static bfd_boolean
-elf_hppa_unmark_useless_dynamic_symbols (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
+elf_hppa_unmark_useless_dynamic_symbols (struct elf_link_hash_entry *h,
+ void *data)
{
- struct bfd_link_info *info = (struct bfd_link_info *)data;
+ struct bfd_link_info *info = data;
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
@@ -1161,7 +1097,7 @@ elf_hppa_unmark_useless_dynamic_symbols (h, data)
linker code. */
if (! info->relocatable
&& ! (info->shared
- && !info->no_undefined)
+ && info->unresolved_syms_in_shared_libs == RM_IGNORE)
&& h->root.type == bfd_link_hash_undefined
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
@@ -1174,11 +1110,10 @@ elf_hppa_unmark_useless_dynamic_symbols (h, data)
}
static bfd_boolean
-elf_hppa_remark_useless_dynamic_symbols (h, data)
- struct elf_link_hash_entry *h;
- PTR data;
+elf_hppa_remark_useless_dynamic_symbols (struct elf_link_hash_entry *h,
+ void *data)
{
- struct bfd_link_info *info = (struct bfd_link_info *)data;
+ struct bfd_link_info *info = data;
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
@@ -1197,7 +1132,7 @@ elf_hppa_remark_useless_dynamic_symbols (h, data)
linker code. */
if (! info->relocatable
&& ! (info->shared
- && !info->no_undefined)
+ && info->unresolved_syms_in_shared_libs == RM_IGNORE)
&& h->root.type == bfd_link_hash_undefined
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
@@ -1211,8 +1146,7 @@ elf_hppa_remark_useless_dynamic_symbols (h, data)
}
static bfd_boolean
-elf_hppa_is_dynamic_loader_symbol (name)
- const char * name;
+elf_hppa_is_dynamic_loader_symbol (const char *name)
{
return (! strcmp (name, "__CPU_REVISION")
|| ! strcmp (name, "__CPU_KEYBITS_1")
@@ -1229,15 +1163,14 @@ elf_hppa_is_dynamic_loader_symbol (name)
/* Record the lowest address for the data and text segments. */
static void
-elf_hppa_record_segment_addrs (abfd, section, data)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *section;
- PTR data;
+elf_hppa_record_segment_addrs (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *section,
+ void *data)
{
struct elf64_hppa_link_hash_table *hppa_info;
bfd_vma value;
- hppa_info = (struct elf64_hppa_link_hash_table *)data;
+ hppa_info = data;
value = section->vma - section->filepos;
@@ -1258,9 +1191,7 @@ elf_hppa_record_segment_addrs (abfd, section, data)
fall back to the generic ELF final link routine. */
static bfd_boolean
-elf_hppa_final_link (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+elf_hppa_final_link (bfd *abfd, struct bfd_link_info *info)
{
bfd_boolean retval;
struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info);
@@ -1360,16 +1291,14 @@ elf_hppa_final_link (abfd, info)
/* Relocate an HPPA ELF section. */
static bfd_boolean
-elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, local_syms, local_sections)
- bfd *output_bfd;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- Elf_Internal_Rela *relocs;
- Elf_Internal_Sym *local_syms;
- asection **local_sections;
+elf_hppa_relocate_section (bfd *output_bfd,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *rel;
@@ -1470,7 +1399,8 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
relocation = 0;
}
/* Allow undefined symbols in shared libraries. */
- else if (info->shared && !info->no_undefined
+ else if (info->shared
+ && info->unresolved_syms_in_shared_libs == RM_IGNORE
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
{
if (info->symbolic)
@@ -1578,19 +1508,16 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
function. */
static bfd_reloc_status_type
-elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
- input_section, contents, value,
- info, sym_sec, h, dyn_h)
- Elf_Internal_Rela *rel;
- bfd *input_bfd;
- bfd *output_bfd;
- asection *input_section;
- bfd_byte *contents;
- bfd_vma value;
- struct bfd_link_info *info;
- asection *sym_sec;
- struct elf_link_hash_entry *h ATTRIBUTE_UNUSED;
- struct elf64_hppa_dyn_hash_entry *dyn_h;
+elf_hppa_final_link_relocate (Elf_Internal_Rela *rel,
+ bfd *input_bfd,
+ bfd *output_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ bfd_vma value,
+ struct bfd_link_info *info,
+ asection *sym_sec,
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED,
+ struct elf64_hppa_dyn_hash_entry *dyn_h)
{
int insn;
bfd_vma offset = rel->r_offset;
@@ -2136,10 +2063,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
to insert the relocation into the given instruction. */
static int
-elf_hppa_relocate_insn (insn, sym_value, r_type)
- int insn;
- int sym_value;
- unsigned int r_type;
+elf_hppa_relocate_insn (int insn, int sym_value, unsigned int r_type)
{
switch (r_type)
{
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index 0d68fe5119b..dc25c38aff1 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -562,7 +562,7 @@ _bfd_mn10300_elf_create_got_section (abfd, info)
flagword pltflags;
asection * s;
struct elf_link_hash_entry * h;
- struct elf_backend_data * bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data * bed = get_elf_backend_data (abfd);
int ptralign;
/* This function may be called more than once. */
@@ -1158,9 +1158,8 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
}
bfd_elf32_swap_reloca_out (output_bfd, &outrel,
- (((Elf32_External_Rela *)
- sreloc->contents)
- + sreloc->reloc_count));
+ (bfd_byte *) (((Elf32_External_Rela *) sreloc->contents)
+ + sreloc->reloc_count));
++sreloc->reloc_count;
/* If this reloc is against an external symbol, we do
@@ -1295,9 +1294,9 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
}
bfd_elf32_swap_reloca_out (output_bfd, &outrel,
- (((Elf32_External_Rela *)
- sreloc->contents)
- + sreloc->reloc_count));
+ (bfd_byte *) (((Elf32_External_Rela *)
+ sreloc->contents)
+ + sreloc->reloc_count));
++sreloc->reloc_count;
return bfd_reloc_ok;
@@ -1480,9 +1479,9 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
outrel.r_info = ELF32_R_INFO (0, R_MN10300_RELATIVE);
outrel.r_addend = value;
bfd_elf32_swap_reloca_out (output_bfd, &outrel,
- (((Elf32_External_Rela *)
- srelgot->contents)
- + srelgot->reloc_count));
+ (bfd_byte *) (((Elf32_External_Rela *)
+ srelgot->contents)
+ + srelgot->reloc_count));
++ srelgot->reloc_count;
}
@@ -1579,15 +1578,20 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
- h = (struct elf32_mn10300_link_hash_entry *) h->root.root.u.i.link;
- if (h->root.root.type == bfd_link_hash_defined
+ bfd_boolean unresolved_reloc;
+ bfd_boolean warned;
+ struct elf_link_hash_entry *hh;
+
+ RELOC_FOR_GLOBAL_SYMBOL (hh, (struct elf_link_hash_entry *) sym_hashes,
+ r_symndx, symtab_hdr, relocation,
+ sec, unresolved_reloc, info,
+ warned);
+
+ h = (struct elf32_mn10300_link_hash_entry *) hh;
+
+ if ((h->root.root.type == bfd_link_hash_defined
|| h->root.root.type == bfd_link_hash_defweak)
- {
- sec = h->root.root.u.def.section;
- if ( r_type == R_MN10300_GOTPC32
+ && ( r_type == R_MN10300_GOTPC32
|| r_type == R_MN10300_GOTPC16
|| (( r_type == R_MN10300_PLT32
|| r_type == R_MN10300_PLT16)
@@ -1615,41 +1619,17 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section,
do anything with them here. */
|| ((input_section->flags & SEC_DEBUGGING) != 0
&& (h->root.elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
- {
- /* In these cases, we don't need the relocation
- value. We check specially because in some
- obscure cases sec->output_section will be NULL. */
- relocation = 0;
- }
- else if (sec->output_section == NULL)
- {
- (*_bfd_error_handler)
- (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
- bfd_get_filename (input_bfd), h->root.root.root.string,
- bfd_get_section_name (input_bfd, input_section));
- relocation = 0;
- }
- else
- relocation = (h->root.root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.root.type == bfd_link_hash_undefweak)
- relocation = 0;
- else if (info->shared && !info->symbolic && !info->no_undefined
- && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))))
+ /* In these cases, we don't need the relocation
+ value. We check specially because in some
+ obscure cases sec->output_section will be NULL. */
relocation = 0;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->root.other)))))
- return FALSE;
- relocation = 0;
- }
+
+ else if (unresolved_reloc)
+ (*_bfd_error_handler)
+ (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
+ bfd_get_filename (input_bfd), h->root.root.root.string,
+ bfd_get_section_name (input_bfd, input_section));
}
r = mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
@@ -4049,7 +4029,7 @@ _bfd_mn10300_elf_create_dynamic_sections (abfd, info)
{
flagword flags;
asection * s;
- struct elf_backend_data * bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data * bed = get_elf_backend_data (abfd);
int ptralign = 0;
switch (bed->s->arch_size)
@@ -4626,8 +4606,8 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_info = ELF32_R_INFO (h->dynindx, R_MN10300_JMP_SLOT);
rel.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &rel,
- ((Elf32_External_Rela *) srel->contents
- + plt_index));
+ (bfd_byte *) ((Elf32_External_Rela *) srel->contents
+ + plt_index));
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
/* Mark the symbol as undefined, rather than as defined in
@@ -4673,8 +4653,8 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
}
bfd_elf32_swap_reloca_out (output_bfd, &rel,
- ((Elf32_External_Rela *) srel->contents
- + srel->reloc_count));
+ (bfd_byte *) ((Elf32_External_Rela *) srel->contents
+ + srel->reloc_count));
++ srel->reloc_count;
}
@@ -4698,8 +4678,8 @@ _bfd_mn10300_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_info = ELF32_R_INFO (h->dynindx, R_MN10300_COPY);
rel.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &rel,
- ((Elf32_External_Rela *) s->contents
- + s->reloc_count));
+ (bfd_byte *) ((Elf32_External_Rela *) s->contents
+ + s->reloc_count));
++ s->reloc_count;
}
diff --git a/bfd/elf-strtab.c b/bfd/elf-strtab.c
index 3bd5531a81d..764ab544232 100644
--- a/bfd/elf-strtab.c
+++ b/bfd/elf-strtab.c
@@ -57,53 +57,46 @@ struct elf_strtab_hash
struct elf_strtab_hash_entry **array;
};
-static struct bfd_hash_entry *elf_strtab_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static int cmplengthentry PARAMS ((const PTR, const PTR));
-static int last4_eq PARAMS ((const PTR, const PTR));
-
/* Routine to create an entry in a section merge hashtab. */
static struct bfd_hash_entry *
-elf_strtab_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+elf_strtab_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
- struct elf_strtab_hash_entry *ret = (struct elf_strtab_hash_entry *) entry;
-
/* Allocate the structure if it has not already been allocated by a
subclass. */
- if (ret == (struct elf_strtab_hash_entry *) NULL)
- ret = ((struct elf_strtab_hash_entry *)
- bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry)));
- if (ret == (struct elf_strtab_hash_entry *) NULL)
+ if (entry == NULL)
+ entry = bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry));
+ if (entry == NULL)
return NULL;
/* Call the allocation method of the superclass. */
- ret = ((struct elf_strtab_hash_entry *)
- bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
+ entry = bfd_hash_newfunc (entry, table, string);
- if (ret)
+ if (entry)
{
/* Initialize the local fields. */
+ struct elf_strtab_hash_entry *ret;
+
+ ret = (struct elf_strtab_hash_entry *) entry;
ret->u.index = -1;
ret->refcount = 0;
ret->len = 0;
}
- return (struct bfd_hash_entry *)ret;
+ return entry;
}
/* Create a new hash table. */
struct elf_strtab_hash *
-_bfd_elf_strtab_init ()
+_bfd_elf_strtab_init (void)
{
struct elf_strtab_hash *table;
bfd_size_type amt = sizeof (struct elf_strtab_hash);
- table = (struct elf_strtab_hash *) bfd_malloc (amt);
+ table = bfd_malloc (amt);
if (table == NULL)
return NULL;
@@ -117,8 +110,7 @@ _bfd_elf_strtab_init ()
table->size = 1;
table->alloced = 64;
amt = sizeof (struct elf_strtab_hasn_entry *);
- table->array = (struct elf_strtab_hash_entry **)
- bfd_malloc (table->alloced * amt);
+ table->array = bfd_malloc (table->alloced * amt);
if (table->array == NULL)
{
free (table);
@@ -133,8 +125,7 @@ _bfd_elf_strtab_init ()
/* Free a strtab. */
void
-_bfd_elf_strtab_free (tab)
- struct elf_strtab_hash *tab;
+_bfd_elf_strtab_free (struct elf_strtab_hash *tab)
{
bfd_hash_table_free (&tab->table);
free (tab->array);
@@ -145,10 +136,9 @@ _bfd_elf_strtab_free (tab)
already present. */
bfd_size_type
-_bfd_elf_strtab_add (tab, str, copy)
- struct elf_strtab_hash *tab;
- const char *str;
- bfd_boolean copy;
+_bfd_elf_strtab_add (struct elf_strtab_hash *tab,
+ const char *str,
+ bfd_boolean copy)
{
register struct elf_strtab_hash_entry *entry;
@@ -172,8 +162,7 @@ _bfd_elf_strtab_add (tab, str, copy)
{
bfd_size_type amt = sizeof (struct elf_strtab_hash_entry *);
tab->alloced *= 2;
- tab->array = (struct elf_strtab_hash_entry **)
- bfd_realloc (tab->array, tab->alloced * amt);
+ tab->array = bfd_realloc (tab->array, tab->alloced * amt);
if (tab->array == NULL)
return (bfd_size_type) -1;
}
@@ -185,9 +174,7 @@ _bfd_elf_strtab_add (tab, str, copy)
}
void
-_bfd_elf_strtab_addref (tab, idx)
- struct elf_strtab_hash *tab;
- bfd_size_type idx;
+_bfd_elf_strtab_addref (struct elf_strtab_hash *tab, bfd_size_type idx)
{
if (idx == 0 || idx == (bfd_size_type) -1)
return;
@@ -197,9 +184,7 @@ _bfd_elf_strtab_addref (tab, idx)
}
void
-_bfd_elf_strtab_delref (tab, idx)
- struct elf_strtab_hash *tab;
- bfd_size_type idx;
+_bfd_elf_strtab_delref (struct elf_strtab_hash *tab, bfd_size_type idx)
{
if (idx == 0 || idx == (bfd_size_type) -1)
return;
@@ -210,8 +195,7 @@ _bfd_elf_strtab_delref (tab, idx)
}
void
-_bfd_elf_strtab_clear_all_refs (tab)
- struct elf_strtab_hash *tab;
+_bfd_elf_strtab_clear_all_refs (struct elf_strtab_hash *tab)
{
bfd_size_type idx;
@@ -220,16 +204,13 @@ _bfd_elf_strtab_clear_all_refs (tab)
}
bfd_size_type
-_bfd_elf_strtab_size (tab)
- struct elf_strtab_hash *tab;
+_bfd_elf_strtab_size (struct elf_strtab_hash *tab)
{
return tab->sec_size ? tab->sec_size : tab->size;
}
bfd_size_type
-_bfd_elf_strtab_offset (tab, idx)
- struct elf_strtab_hash *tab;
- bfd_size_type idx;
+_bfd_elf_strtab_offset (struct elf_strtab_hash *tab, bfd_size_type idx)
{
struct elf_strtab_hash_entry *entry;
@@ -244,9 +225,7 @@ _bfd_elf_strtab_offset (tab, idx)
}
bfd_boolean
-_bfd_elf_strtab_emit (abfd, tab)
- register bfd *abfd;
- struct elf_strtab_hash *tab;
+_bfd_elf_strtab_emit (register bfd *abfd, struct elf_strtab_hash *tab)
{
bfd_size_type off = 1, i;
@@ -264,7 +243,7 @@ _bfd_elf_strtab_emit (abfd, tab)
if (len == 0)
continue;
- if (bfd_bwrite ((PTR) str, (bfd_size_type) len, abfd) != len)
+ if (bfd_bwrite (str, len, abfd) != len)
return FALSE;
off += len;
@@ -277,12 +256,10 @@ _bfd_elf_strtab_emit (abfd, tab)
/* Compare two elf_strtab_hash_entry structures. This is called via qsort. */
static int
-cmplengthentry (a, b)
- const PTR a;
- const PTR b;
+cmplengthentry (const void *a, const void *b)
{
- struct elf_strtab_hash_entry * A = *(struct elf_strtab_hash_entry **) a;
- struct elf_strtab_hash_entry * B = *(struct elf_strtab_hash_entry **) b;
+ struct elf_strtab_hash_entry *A = *(struct elf_strtab_hash_entry **) a;
+ struct elf_strtab_hash_entry *B = *(struct elf_strtab_hash_entry **) b;
if (A->len < B->len)
return 1;
@@ -293,12 +270,10 @@ cmplengthentry (a, b)
}
static int
-last4_eq (a, b)
- const PTR a;
- const PTR b;
+last4_eq (const void *a, const void *b)
{
- struct elf_strtab_hash_entry * A = (struct elf_strtab_hash_entry *) a;
- struct elf_strtab_hash_entry * B = (struct elf_strtab_hash_entry *) b;
+ const struct elf_strtab_hash_entry *A = a;
+ const struct elf_strtab_hash_entry *B = b;
if (memcmp (A->root.string + A->len - 5, B->root.string + B->len - 5, 4)
!= 0)
@@ -318,8 +293,7 @@ last4_eq (a, b)
merging strings matching suffixes of longer strings if possible. */
void
-_bfd_elf_strtab_finalize (tab)
- struct elf_strtab_hash *tab;
+_bfd_elf_strtab_finalize (struct elf_strtab_hash *tab)
{
struct elf_strtab_hash_entry **array, **a, **end, *e;
htab_t last4tab = NULL;
@@ -335,7 +309,7 @@ _bfd_elf_strtab_finalize (tab)
/* Now sort the strings by length, longest first. */
array = NULL;
amt = tab->size * sizeof (struct elf_strtab_hash_entry *);
- array = (struct elf_strtab_hash_entry **) bfd_malloc (amt);
+ array = bfd_malloc (amt);
if (array == NULL)
goto alloc_failure;
@@ -365,7 +339,7 @@ _bfd_elf_strtab_finalize (tab)
unsigned int c;
unsigned int j;
const unsigned char *s;
- PTR *p;
+ void **p;
e = *a;
if (e->len > 4)
@@ -385,13 +359,13 @@ _bfd_elf_strtab_finalize (tab)
{
struct elf_strtab_hash_entry *ent;
- ent = (struct elf_strtab_hash_entry *) *p;
+ ent = *p;
e->u.suffix = ent;
e->len = 0;
continue;
}
else
- *p = (PTR) e;
+ *p = e;
}
else
{
diff --git a/bfd/elf.c b/bfd/elf.c
index 33848a2b4dc..3868cff6a1d 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -325,7 +325,7 @@ bfd_elf_get_elf_syms (bfd *ibfd,
Elf_External_Sym_Shndx *shndx;
Elf_Internal_Sym *isym;
Elf_Internal_Sym *isymend;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
size_t extsym_size;
bfd_size_type amt;
file_ptr pos;
@@ -638,7 +638,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
{
asection *newsect;
flagword flags;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
if (hdr->bfd_section != NULL)
{
@@ -1193,7 +1193,7 @@ bfd_elf_print_symbol (bfd *abfd,
{
const char *section_name;
const char *name = NULL;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
unsigned char st_other;
bfd_vma val;
@@ -1344,7 +1344,7 @@ _bfd_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
old indirect symbol. Also used for copying flags to a weakdef. */
void
-_bfd_elf_link_hash_copy_indirect (struct elf_backend_data *bed,
+_bfd_elf_link_hash_copy_indirect (const struct elf_backend_data *bed,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
@@ -1649,7 +1649,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
{
Elf_Internal_Shdr *hdr = elf_elfsections (abfd)[shindex];
Elf_Internal_Ehdr *ehdr = elf_elfheader (abfd);
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
const char *name;
name = elf_string_from_elf_strtab (abfd, hdr->sh_name);
@@ -2123,13 +2123,13 @@ bfd_boolean
_bfd_elf_get_sec_type_attr (bfd *abfd, const char *name, int *type, int *attr)
{
bfd_boolean found = FALSE;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
/* See if this is one of the special sections. */
if (name)
{
const struct bfd_elf_special_section *ssect = NULL;
- unsigned int rela = get_elf_backend_data (abfd)->default_use_rela_p;
+ unsigned int rela = bed->default_use_rela_p;
if (bed->special_sections)
ssect = get_special_section (name, bed->special_sections, rela);
@@ -2274,7 +2274,7 @@ _bfd_elf_make_section_from_phdr (bfd *abfd,
bfd_boolean
bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
switch (hdr->p_type)
{
@@ -2332,7 +2332,7 @@ _bfd_elf_init_reloc_shdr (bfd *abfd,
bfd_boolean use_rela_p)
{
char *name;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_size_type amt = sizeof ".rela" + strlen (asect->name);
name = bfd_alloc (abfd, amt);
@@ -2362,7 +2362,7 @@ _bfd_elf_init_reloc_shdr (bfd *abfd,
static void
elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_boolean *failedptr = failedptrarg;
Elf_Internal_Shdr *this_hdr;
@@ -2872,7 +2872,7 @@ static int
sym_is_global (bfd *abfd, asymbol *sym)
{
/* If the backend has a special mapping, use it. */
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (bed->elf_backend_sym_is_global)
return (*bed->elf_backend_sym_is_global) (abfd, sym);
@@ -3066,7 +3066,7 @@ bfd_boolean
_bfd_elf_compute_section_file_positions (bfd *abfd,
struct bfd_link_info *link_info)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_boolean failed;
struct bfd_strtab_hash *strtab;
Elf_Internal_Shdr *shstrtab_hdr;
@@ -4059,7 +4059,7 @@ get_program_header_size (bfd *abfd)
{
size_t segs;
asection *s;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
/* We can't return a different result each time we're called. */
if (elf_tdata (abfd)->program_header_size != 0)
@@ -4162,7 +4162,7 @@ assign_file_positions_except_relocs (bfd *abfd)
Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd);
unsigned int num_sec = elf_numsections (abfd);
file_ptr off;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0
&& bfd_get_format (abfd) != bfd_core)
@@ -4269,7 +4269,7 @@ prep_headers (bfd *abfd)
Elf_Internal_Phdr *i_phdrp = 0; /* Program header table, internal form */
Elf_Internal_Shdr **i_shdrp; /* Section header table, internal form */
struct elf_strtab_hash *shstrtab;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
i_ehdrp = elf_elfheader (abfd);
i_shdrp = elf_elfsections (abfd);
@@ -4314,11 +4314,8 @@ prep_headers (bfd *abfd)
Such need can generally be supplied by replacing the tests for
e_machine with the conditions used to determine it. */
default:
- if (get_elf_backend_data (abfd) != NULL)
- i_ehdrp->e_machine = get_elf_backend_data (abfd)->elf_machine_code;
- else
- i_ehdrp->e_machine = EM_NONE;
- }
+ i_ehdrp->e_machine = bed->elf_machine_code;
+ }
i_ehdrp->e_version = bed->s->ev_current;
i_ehdrp->e_ehsize = bed->s->sizeof_ehdr;
@@ -4396,7 +4393,7 @@ _bfd_elf_assign_file_positions_for_relocs (bfd *abfd)
bfd_boolean
_bfd_elf_write_object_contents (bfd *abfd)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
Elf_Internal_Ehdr *i_ehdrp;
Elf_Internal_Shdr **i_shdrp;
bfd_boolean failed;
@@ -4458,7 +4455,7 @@ _bfd_elf_write_corefile_contents (bfd *abfd)
int
_bfd_elf_section_from_bfd_section (bfd *abfd, struct sec *asect)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
int index;
if (elf_section_data (asect) != NULL
@@ -4574,7 +4571,7 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd)
bfd_vma maxpagesize;
struct elf_segment_map *phdr_adjust_seg = NULL;
unsigned int phdr_adjust_num = 0;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
|| bfd_get_flavour (obfd) != bfd_target_elf_flavour)
@@ -5269,7 +5266,7 @@ swap_out_syms (bfd *abfd,
struct bfd_strtab_hash **sttp,
int relocatable_p)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
int symcount;
asymbol **syms;
struct bfd_strtab_hash *stt;
@@ -5601,7 +5598,7 @@ _bfd_elf_canonicalize_reloc (bfd *abfd,
{
arelent *tblptr;
unsigned int i;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (! bed->s->slurp_reloc_table (abfd, section, symbols, FALSE))
return -1;
@@ -5618,7 +5615,7 @@ _bfd_elf_canonicalize_reloc (bfd *abfd,
long
_bfd_elf_get_symtab (bfd *abfd, asymbol **allocation)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
long symcount = bed->s->slurp_symbol_table (abfd, allocation, FALSE);
if (symcount >= 0)
@@ -5630,7 +5627,7 @@ long
_bfd_elf_canonicalize_dynamic_symtab (bfd *abfd,
asymbol **allocation)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
long symcount = bed->s->slurp_symbol_table (abfd, allocation, TRUE);
if (symcount >= 0)
@@ -6758,7 +6755,7 @@ elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note)
static bfd_boolean
elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
switch (note->type)
{
@@ -7062,7 +7059,7 @@ elfcore_write_note (bfd *abfd,
pad = 0;
if (name != NULL)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
namesz = strlen (name) + 1;
bed = get_elf_backend_data (abfd);
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index f073e7a1a63..a28c558f1db 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -1038,6 +1038,18 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section,
return TRUE;
}
+/* This is the condition under which elf32_arm_finish_dynamic_symbol
+ will be called from elflink.h. If elflink.h doesn't call our
+ finish_dynamic_symbol routine, we'll need to do something about
+ initializing any .plt and .got entries in elf32_arm_relocate_section
+ and elf32_arm_final_link_relocate. */
+#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
+ ((DYN) \
+ && ((SHARED) \
+ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \
+ && ((H)->dynindx != -1 \
+ || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
+
/* Perform a relocation as part of a final link. */
static bfd_reloc_status_type
@@ -1605,13 +1617,16 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
if (h != NULL)
{
bfd_vma off;
+ bfd_boolean dyn = elf_hash_table (info)->dynamic_sections_created;
off = h->got.offset;
BFD_ASSERT (off != (bfd_vma) -1);
- if (!elf_hash_table (info)->dynamic_sections_created ||
- (info->shared && (info->symbolic || h->dynindx == -1)
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
+ || (info->shared
+ && (info->symbolic || h->dynindx == -1
+ || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
{
/* This is actually a static link, or it is a -Bsymbolic link
and the symbol is defined locally. We must initialize this
@@ -1948,19 +1963,16 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-
- while ( h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- if ( h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
+ bfd_boolean warned;
+ bfd_boolean unresolved_reloc;
+
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation,
+ sec, unresolved_reloc, info,
+ warned);
+
+ if (unresolved_reloc || relocation != 0)
{
- int relocation_needed = 1;
-
- sec = h->root.u.def.section;
-
/* In these cases, we don't need the relocation value.
We check specially because in some obscure cases
sec->output_section will be NULL. */
@@ -1983,63 +1995,39 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
&& (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_DYNAMIC) != 0))
)
- relocation_needed = 0;
+ relocation = 0;
break;
case R_ARM_GOTPC:
- relocation_needed = 0;
+ relocation = 0;
break;
case R_ARM_GOT32:
- if (elf_hash_table(info)->dynamic_sections_created
- && (!info->shared
+ if ((WILL_CALL_FINISH_DYNAMIC_SYMBOL
+ (elf_hash_table (info)->dynamic_sections_created,
+ info->shared, h))
+ && (!info->shared
|| (!info->symbolic && h->dynindx != -1)
- || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
- )
- )
- relocation_needed = 0;
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0))
+ relocation = 0;
break;
case R_ARM_PLT32:
if (h->plt.offset != (bfd_vma)-1)
- relocation_needed = 0;
+ relocation = 0;
break;
default:
- if (sec->output_section == NULL)
- {
- (*_bfd_error_handler)
- (_("%s: warning: unresolvable relocation %d against symbol `%s' from %s section"),
- bfd_archive_filename (input_bfd),
- r_type,
- h->root.root.string,
- bfd_get_section_name (input_bfd, input_section));
- relocation_needed = 0;
- }
+ if (unresolved_reloc)
+ _bfd_error_handler
+ (_("%s: warning: unresolvable relocation %d against symbol `%s' from %s section"),
+ bfd_archive_filename (input_bfd),
+ r_type,
+ h->root.root.string,
+ bfd_get_section_name (input_bfd, input_section));
+ break;
}
-
- if (relocation_needed)
- relocation = h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset;
- else
- relocation = 0;
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- relocation = 0;
- else if (info->shared && !info->symbolic
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- relocation = 0;
- else
- {
- if (!((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- relocation = 0;
}
}
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 4618a8f2830..d630a2a84c9 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -856,24 +856,12 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- /* It seems this can happen with erroneous or unsupported input
- (mixing a.out and elf in an archive, for example.) */
- if (sym_hashes == NULL)
- return FALSE;
-
- h = sym_hashes [r_symndx - symtab_hdr->sh_info];
-
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ bfd_boolean warned;
+ bfd_boolean unresolved_reloc;
- symname = h->root.root.string;
-
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx, symtab_hdr, relocation, sec, unresolved_reloc, info, warned);
+ if (unresolved_reloc
/* Perhaps we should detect the cases that
sec->output_section is expected to be NULL like i386 and
m68k, but apparently (and according to elfxx-ia64.c) all
@@ -888,46 +876,45 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
is *not* dynamically linked against. Thus this will
automatically remind us so we can see if there are other
valid cases we need to revisit. */
- if ((sec->output_section == NULL
- && (sec->owner->flags & DYNAMIC) != 0)
-
- /* Here follow the cases where the relocation value must
- be zero (or when further handling is simplified when
- zero). I can't claim to understand the various
- conditions and they weren't described in the files
- where I copied them from (elf32-m68k.c and
- elf32-i386.c), but let's mention examples of where
- they happen. FIXME: Perhaps define and use a
- dynamic_symbol_p function like ia64.
-
- - When creating a shared library, we can have an
- ordinary relocation for a symbol defined in a shared
- library (perhaps the one we create). We then make
- the relocation value zero, as the value seen now will
- be added into the relocation addend in this shared
- library, but must be handled only at dynamic-link
- time. FIXME: Not sure this example covers the
- h->elf_link_hash_flags test, though it's there in
- other targets. */
- || (info->shared
- && ((! info->symbolic && h->dynindx != -1)
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0)
- && (input_section->flags & SEC_ALLOC) != 0
- && (r_type == R_CRIS_8
- || r_type == R_CRIS_16
- || r_type == R_CRIS_32
- || r_type == R_CRIS_8_PCREL
- || r_type == R_CRIS_16_PCREL
- || r_type == R_CRIS_32_PCREL)))
+ && (sec->owner->flags & DYNAMIC) != 0)
+ relocation = 0;
+
+ else if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ {
+ /* Here follow the cases where the relocation value must
+ be zero (or when further handling is simplified when
+ zero). I can't claim to understand the various
+ conditions and they weren't described in the files
+ where I copied them from (elf32-m68k.c and
+ elf32-i386.c), but let's mention examples of where
+ they happen. FIXME: Perhaps define and use a
+ dynamic_symbol_p function like ia64.
+
+ - When creating a shared library, we can have an
+ ordinary relocation for a symbol defined in a shared
+ library (perhaps the one we create). We then make
+ the relocation value zero, as the value seen now will
+ be added into the relocation addend in this shared
+ library, but must be handled only at dynamic-link
+ time. FIXME: Not sure this example covers the
+ h->elf_link_hash_flags test, though it's there in
+ other targets. */
+ if (info->shared
+ && ((! info->symbolic && h->dynindx != -1)
+ || (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0)
+ && (input_section->flags & SEC_ALLOC) != 0
+ && (r_type == R_CRIS_8
+ || r_type == R_CRIS_16
+ || r_type == R_CRIS_32
+ || r_type == R_CRIS_8_PCREL
+ || r_type == R_CRIS_16_PCREL
+ || r_type == R_CRIS_32_PCREL))
relocation = 0;
- else if (sec->output_section != NULL)
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- else
+ else if (unresolved_reloc)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("%s: unresolvable relocation %s against symbol `%s' from %s section"),
bfd_archive_filename (input_bfd),
cris_elf_howto_table[r_type].name,
@@ -937,22 +924,6 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
return FALSE;
}
}
- else if (h->root.type == bfd_link_hash_undefweak)
- relocation = 0;
- else if (info->shared
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- relocation = 0;
- else
- {
- if (!(info->callbacks->undefined_symbol
- (info, symname, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- relocation = 0;
- }
}
switch (r_type)
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index 19fb324576c..faa1401a537 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -724,9 +724,7 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section,
{
sym = local_syms + r_symndx;
sec = local_sections [r_symndx];
- relocation = (sec->output_section->vma
- + sec->output_offset
- + sym->st_value);
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index ca3e8e12c91..be0727f46bb 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -203,10 +203,6 @@ struct elf32_hppa_link_hash_entry {
#endif
} *dyn_relocs;
- /* Set if the only reason we need a .plt entry is for a non-PIC to
- PIC function call. */
- unsigned int pic_call:1;
-
/* Set if this symbol is used by a plabel reloc. */
unsigned int plabel:1;
};
@@ -223,8 +219,8 @@ struct elf32_hppa_link_hash_table {
bfd *stub_bfd;
/* Linker call-backs. */
- asection * (*add_stub_section) PARAMS ((const char *, asection *));
- void (*layout_sections_again) PARAMS ((void));
+ asection * (*add_stub_section) (const char *, asection *);
+ void (*layout_sections_again) (void);
/* Array to keep track of which stub sections have been created, and
information on stub grouping. */
@@ -279,139 +275,14 @@ struct elf32_hppa_link_hash_table {
((struct elf32_hppa_stub_hash_entry *) \
bfd_hash_lookup ((table), (string), (create), (copy)))
-static struct bfd_hash_entry *stub_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-
-static struct bfd_hash_entry *hppa_link_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-
-static struct bfd_link_hash_table *elf32_hppa_link_hash_table_create
- PARAMS ((bfd *));
-
-static void elf32_hppa_link_hash_table_free
- PARAMS ((struct bfd_link_hash_table *));
-
-/* Stub handling functions. */
-static char *hppa_stub_name
- PARAMS ((const asection *, const asection *,
- const struct elf32_hppa_link_hash_entry *,
- const Elf_Internal_Rela *));
-
-static struct elf32_hppa_stub_hash_entry *hppa_get_stub_entry
- PARAMS ((const asection *, const asection *,
- struct elf32_hppa_link_hash_entry *,
- const Elf_Internal_Rela *,
- struct elf32_hppa_link_hash_table *));
-
-static struct elf32_hppa_stub_hash_entry *hppa_add_stub
- PARAMS ((const char *, asection *, struct elf32_hppa_link_hash_table *));
-
-static enum elf32_hppa_stub_type hppa_type_of_stub
- PARAMS ((asection *, const Elf_Internal_Rela *,
- struct elf32_hppa_link_hash_entry *, bfd_vma));
-
-static bfd_boolean hppa_build_one_stub
- PARAMS ((struct bfd_hash_entry *, PTR));
-
-static bfd_boolean hppa_size_one_stub
- PARAMS ((struct bfd_hash_entry *, PTR));
-
-/* BFD and elf backend functions. */
-static bfd_boolean elf32_hppa_object_p PARAMS ((bfd *));
-
-static bfd_boolean elf32_hppa_add_symbol_hook
- PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
- const char **, flagword *, asection **, bfd_vma *));
-
-static bfd_boolean elf32_hppa_create_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-
-static void elf32_hppa_copy_indirect_symbol
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
- struct elf_link_hash_entry *));
-
-static bfd_boolean elf32_hppa_check_relocs
- PARAMS ((bfd *, struct bfd_link_info *,
- asection *, const Elf_Internal_Rela *));
-
-static asection *elf32_hppa_gc_mark_hook
- PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *));
-
-static bfd_boolean elf32_hppa_gc_sweep_hook
- PARAMS ((bfd *, struct bfd_link_info *,
- asection *, const Elf_Internal_Rela *));
-
-static void elf32_hppa_hide_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
-
-static bfd_boolean elf32_hppa_adjust_dynamic_symbol
- PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-
-static bfd_boolean mark_PIC_calls
- PARAMS ((struct elf_link_hash_entry *, PTR));
-
-static bfd_boolean allocate_plt_static
- PARAMS ((struct elf_link_hash_entry *, PTR));
-
-static bfd_boolean allocate_dynrelocs
- PARAMS ((struct elf_link_hash_entry *, PTR));
-
-static bfd_boolean readonly_dynrelocs
- PARAMS ((struct elf_link_hash_entry *, PTR));
-
-static bfd_boolean clobber_millicode_symbols
- PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *));
-
-static bfd_boolean elf32_hppa_size_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-
-static void group_sections
- PARAMS ((struct elf32_hppa_link_hash_table *, bfd_size_type, bfd_boolean));
-
-static int get_local_syms
- PARAMS ((bfd *, bfd *, struct bfd_link_info *));
-
-static bfd_boolean elf32_hppa_final_link
- PARAMS ((bfd *, struct bfd_link_info *));
-
-static void hppa_record_segment_addr
- PARAMS ((bfd *, asection *, PTR));
-
-static bfd_reloc_status_type final_link_relocate
- PARAMS ((asection *, bfd_byte *, const Elf_Internal_Rela *,
- bfd_vma, struct elf32_hppa_link_hash_table *, asection *,
- struct elf32_hppa_link_hash_entry *));
-
-static bfd_boolean elf32_hppa_relocate_section
- PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
- bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
-
-static bfd_boolean elf32_hppa_finish_dynamic_symbol
- PARAMS ((bfd *, struct bfd_link_info *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *));
-
-static enum elf_reloc_type_class elf32_hppa_reloc_type_class
- PARAMS ((const Elf_Internal_Rela *));
-
-static bfd_boolean elf32_hppa_finish_dynamic_sections
- PARAMS ((bfd *, struct bfd_link_info *));
-
-static void elf32_hppa_post_process_headers
- PARAMS ((bfd *, struct bfd_link_info *));
-
-static int elf32_hppa_elf_get_symbol_type
- PARAMS ((Elf_Internal_Sym *, int));
-
/* Assorted hash table functions. */
/* Initialize an entry in the stub hash table. */
static struct bfd_hash_entry *
-stub_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+stub_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
/* Allocate the structure if it has not already been allocated by a
subclass. */
@@ -446,10 +317,9 @@ stub_hash_newfunc (entry, table, string)
/* Initialize an entry in the link hash table. */
static struct bfd_hash_entry *
-hppa_link_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+hppa_link_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table,
+ const char *string)
{
/* Allocate the structure if it has not already been allocated by a
subclass. */
@@ -471,7 +341,6 @@ hppa_link_hash_newfunc (entry, table, string)
eh = (struct elf32_hppa_link_hash_entry *) entry;
eh->stub_cache = NULL;
eh->dyn_relocs = NULL;
- eh->pic_call = 0;
eh->plabel = 0;
}
@@ -483,13 +352,12 @@ hppa_link_hash_newfunc (entry, table, string)
using static variables). */
static struct bfd_link_hash_table *
-elf32_hppa_link_hash_table_create (abfd)
- bfd *abfd;
+elf32_hppa_link_hash_table_create (bfd *abfd)
{
struct elf32_hppa_link_hash_table *ret;
bfd_size_type amt = sizeof (*ret);
- ret = (struct elf32_hppa_link_hash_table *) bfd_malloc (amt);
+ ret = bfd_malloc (amt);
if (ret == NULL)
return NULL;
@@ -528,8 +396,7 @@ elf32_hppa_link_hash_table_create (abfd)
/* Free the derived linker hash table. */
static void
-elf32_hppa_link_hash_table_free (hash)
- struct bfd_link_hash_table *hash;
+elf32_hppa_link_hash_table_free (struct bfd_link_hash_table *hash)
{
struct elf32_hppa_link_hash_table *ret
= (struct elf32_hppa_link_hash_table *) hash;
@@ -541,11 +408,10 @@ elf32_hppa_link_hash_table_free (hash)
/* Build a name for an entry in the stub hash table. */
static char *
-hppa_stub_name (input_section, sym_sec, hash, rel)
- const asection *input_section;
- const asection *sym_sec;
- const struct elf32_hppa_link_hash_entry *hash;
- const Elf_Internal_Rela *rel;
+hppa_stub_name (const asection *input_section,
+ const asection *sym_sec,
+ const struct elf32_hppa_link_hash_entry *hash,
+ const Elf_Internal_Rela *rel)
{
char *stub_name;
bfd_size_type len;
@@ -582,12 +448,11 @@ hppa_stub_name (input_section, sym_sec, hash, rel)
creating the stub name takes a bit of time. */
static struct elf32_hppa_stub_hash_entry *
-hppa_get_stub_entry (input_section, sym_sec, hash, rel, htab)
- const asection *input_section;
- const asection *sym_sec;
- struct elf32_hppa_link_hash_entry *hash;
- const Elf_Internal_Rela *rel;
- struct elf32_hppa_link_hash_table *htab;
+hppa_get_stub_entry (const asection *input_section,
+ const asection *sym_sec,
+ struct elf32_hppa_link_hash_entry *hash,
+ const Elf_Internal_Rela *rel,
+ struct elf32_hppa_link_hash_table *htab)
{
struct elf32_hppa_stub_hash_entry *stub_entry;
const asection *id_sec;
@@ -628,10 +493,9 @@ hppa_get_stub_entry (input_section, sym_sec, hash, rel, htab)
stub entry are initialised. */
static struct elf32_hppa_stub_hash_entry *
-hppa_add_stub (stub_name, section, htab)
- const char *stub_name;
- asection *section;
- struct elf32_hppa_link_hash_table *htab;
+hppa_add_stub (const char *stub_name,
+ asection *section,
+ struct elf32_hppa_link_hash_table *htab)
{
asection *link_sec;
asection *stub_sec;
@@ -684,11 +548,11 @@ hppa_add_stub (stub_name, section, htab)
/* Determine the type of stub needed, if any, for a call. */
static enum elf32_hppa_stub_type
-hppa_type_of_stub (input_sec, rel, hash, destination)
- asection *input_sec;
- const Elf_Internal_Rela *rel;
- struct elf32_hppa_link_hash_entry *hash;
- bfd_vma destination;
+hppa_type_of_stub (asection *input_sec,
+ const Elf_Internal_Rela *rel,
+ struct elf32_hppa_link_hash_entry *hash,
+ bfd_vma destination,
+ struct bfd_link_info *info)
{
bfd_vma location;
bfd_vma branch_offset;
@@ -697,8 +561,11 @@ hppa_type_of_stub (input_sec, rel, hash, destination)
if (hash != NULL
&& hash->elf.plt.offset != (bfd_vma) -1
- && (hash->elf.dynindx != -1 || hash->pic_call)
- && !hash->plabel)
+ && hash->elf.dynindx != -1
+ && !hash->plabel
+ && (info->shared
+ || !(hash->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
+ || hash->elf.root.type == bfd_link_hash_defweak))
{
/* We need an import stub. Decide between hppa_stub_import
and hppa_stub_import_shared later. */
@@ -777,9 +644,7 @@ hppa_type_of_stub (input_sec, rel, hash, destination)
#endif
static bfd_boolean
-hppa_build_one_stub (gen_entry, in_arg)
- struct bfd_hash_entry *gen_entry;
- PTR in_arg;
+hppa_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
{
struct elf32_hppa_stub_hash_entry *stub_entry;
struct bfd_link_info *info;
@@ -795,7 +660,7 @@ hppa_build_one_stub (gen_entry, in_arg)
/* Massage our args to the form they really have. */
stub_entry = (struct elf32_hppa_stub_hash_entry *) gen_entry;
- info = (struct bfd_link_info *) in_arg;
+ info = in_arg;
htab = hppa_link_hash_table (info);
stub_sec = stub_entry->stub_sec;
@@ -817,11 +682,11 @@ hppa_build_one_stub (gen_entry, in_arg)
+ stub_entry->target_section->output_offset
+ stub_entry->target_section->output_section->vma);
- val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_lrsel);
+ val = hppa_field_adjust (sym_value, 0, e_lrsel);
insn = hppa_rebuild_insn ((int) LDIL_R1, val, 21);
bfd_put_32 (stub_bfd, insn, loc);
- val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_rrsel) >> 2;
+ val = hppa_field_adjust (sym_value, 0, e_rrsel) >> 2;
insn = hppa_rebuild_insn ((int) BE_SR4_R1, val, 17);
bfd_put_32 (stub_bfd, insn, loc + 4);
@@ -867,7 +732,7 @@ hppa_build_one_stub (gen_entry, in_arg)
if (stub_entry->stub_type == hppa_stub_import_shared)
insn = ADDIL_R19;
#endif
- val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_lrsel),
+ val = hppa_field_adjust (sym_value, 0, e_lrsel),
insn = hppa_rebuild_insn ((int) insn, val, 21);
bfd_put_32 (stub_bfd, insn, loc);
@@ -876,7 +741,7 @@ hppa_build_one_stub (gen_entry, in_arg)
lsel/rsel then with unfortunate sym_values we will round
sym_value+4 up to the next 2k block leading to a mis-match
between the lsel and rsel value. */
- val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_rrsel);
+ val = hppa_field_adjust (sym_value, 0, e_rrsel);
insn = hppa_rebuild_insn ((int) LDW_R1_R21, val, 14);
bfd_put_32 (stub_bfd, insn, loc + 4);
@@ -903,39 +768,6 @@ hppa_build_one_stub (gen_entry, in_arg)
size = 16;
}
- if (!info->shared
- && stub_entry->h != NULL
- && stub_entry->h->pic_call)
- {
- /* Build the .plt entry needed to call a PIC function from
- statically linked code. We don't need any relocs. */
- bfd *dynobj;
- struct elf32_hppa_link_hash_entry *eh;
- bfd_vma value;
-
- dynobj = htab->elf.dynobj;
- eh = (struct elf32_hppa_link_hash_entry *) stub_entry->h;
-
- if (eh->elf.root.type != bfd_link_hash_defined
- && eh->elf.root.type != bfd_link_hash_defweak)
- abort ();
-
- value = (eh->elf.root.u.def.value
- + eh->elf.root.u.def.section->output_offset
- + eh->elf.root.u.def.section->output_section->vma);
-
- /* Fill in the entry in the procedure linkage table.
-
- The format of a plt entry is
- <funcaddr>
- <__gp>. */
-
- bfd_put_32 (htab->splt->owner, value,
- htab->splt->contents + off);
- value = elf_gp (htab->splt->output_section->owner);
- bfd_put_32 (htab->splt->owner, value,
- htab->splt->contents + off + 4);
- }
break;
case hppa_stub_export:
@@ -997,7 +829,6 @@ hppa_build_one_stub (gen_entry, in_arg)
#undef BL_R1
#undef ADDIL_R1
#undef DEPI_R1
-#undef ADDIL_DP
#undef LDW_R1_R21
#undef LDW_R1_DLT
#undef LDW_R1_R19
@@ -1018,9 +849,7 @@ hppa_build_one_stub (gen_entry, in_arg)
we know stub section sizes. */
static bfd_boolean
-hppa_size_one_stub (gen_entry, in_arg)
- struct bfd_hash_entry *gen_entry;
- PTR in_arg;
+hppa_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
{
struct elf32_hppa_stub_hash_entry *stub_entry;
struct elf32_hppa_link_hash_table *htab;
@@ -1028,7 +857,7 @@ hppa_size_one_stub (gen_entry, in_arg)
/* Massage our args to the form they really have. */
stub_entry = (struct elf32_hppa_stub_hash_entry *) gen_entry;
- htab = (struct elf32_hppa_link_hash_table *) in_arg;
+ htab = in_arg;
if (stub_entry->stub_type == hppa_stub_long_branch)
size = 8;
@@ -1052,8 +881,7 @@ hppa_size_one_stub (gen_entry, in_arg)
Additionally we set the default architecture and machine. */
static bfd_boolean
-elf32_hppa_object_p (abfd)
- bfd *abfd;
+elf32_hppa_object_p (bfd *abfd)
{
Elf_Internal_Ehdr * i_ehdrp;
unsigned int flags;
@@ -1061,7 +889,10 @@ elf32_hppa_object_p (abfd)
i_ehdrp = elf_elfheader (abfd);
if (strcmp (bfd_get_target (abfd), "elf32-hppa-linux") == 0)
{
- if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX)
+ /* GCC on hppa-linux produces binaries with OSABI=Linux,
+ but the kernel produces corefiles with OSABI=SysV. */
+ if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX &&
+ i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
return FALSE;
}
else
@@ -1085,30 +916,11 @@ elf32_hppa_object_p (abfd)
return TRUE;
}
-/* Undo the generic ELF code's subtraction of section->vma from the
- value of each external symbol. */
-
-static bfd_boolean
-elf32_hppa_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
- bfd *abfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- const Elf_Internal_Sym *sym ATTRIBUTE_UNUSED;
- const char **namep ATTRIBUTE_UNUSED;
- flagword *flagsp ATTRIBUTE_UNUSED;
- asection **secp;
- bfd_vma *valp;
-{
- *valp += (*secp)->vma;
- return TRUE;
-}
-
/* Create the .plt and .got sections, and set up our hash table
short-cuts to various dynamic sections. */
static bfd_boolean
-elf32_hppa_create_dynamic_sections (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+elf32_hppa_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
{
struct elf32_hppa_link_hash_table *htab;
@@ -1146,9 +958,9 @@ elf32_hppa_create_dynamic_sections (abfd, info)
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-elf32_hppa_copy_indirect_symbol (bed, dir, ind)
- struct elf_backend_data *bed;
- struct elf_link_hash_entry *dir, *ind;
+elf32_hppa_copy_indirect_symbol (const struct elf_backend_data *bed,
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
struct elf32_hppa_link_hash_entry *edir, *eind;
@@ -1200,11 +1012,10 @@ elf32_hppa_copy_indirect_symbol (bed, dir, ind)
necessarily read all the input files. */
static bfd_boolean
-elf32_hppa_check_relocs (abfd, info, sec, relocs)
- bfd *abfd;
- struct bfd_link_info *info;
- asection *sec;
- const Elf_Internal_Rela *relocs;
+elf32_hppa_check_relocs (bfd *abfd,
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
@@ -1254,9 +1065,6 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs)
case R_PARISC_DLTIND21L:
/* This symbol requires a global offset table entry. */
need_entry = NEED_GOT;
-
- /* Mark this section as containing PIC code. */
- sec->flags |= SEC_HAS_GOT_REF;
break;
case R_PARISC_PLABEL14R: /* "Official" procedure labels. */
@@ -1422,8 +1230,7 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs)
pointer. */
size = symtab_hdr->sh_info;
size *= 2 * sizeof (bfd_signed_vma);
- local_got_refcounts = ((bfd_signed_vma *)
- bfd_zalloc (abfd, size));
+ local_got_refcounts = bfd_zalloc (abfd, size);
if (local_got_refcounts == NULL)
return FALSE;
elf_local_got_refcounts (abfd) = local_got_refcounts;
@@ -1469,8 +1276,7 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs)
plt offsets. */
size = symtab_hdr->sh_info;
size *= 2 * sizeof (bfd_signed_vma);
- local_got_refcounts = ((bfd_signed_vma *)
- bfd_zalloc (abfd, size));
+ local_got_refcounts = bfd_zalloc (abfd, size);
if (local_got_refcounts == NULL)
return FALSE;
elf_local_got_refcounts (abfd) = local_got_refcounts;
@@ -1604,9 +1410,7 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs)
p = *head;
if (p == NULL || p->sec != sec)
{
- p = ((struct elf32_hppa_dyn_reloc_entry *)
- bfd_alloc (htab->elf.dynobj,
- (bfd_size_type) sizeof *p));
+ p = bfd_alloc (htab->elf.dynobj, sizeof *p);
if (p == NULL)
return FALSE;
p->next = *head;
@@ -1634,12 +1438,11 @@ elf32_hppa_check_relocs (abfd, info, sec, relocs)
for a given relocation. */
static asection *
-elf32_hppa_gc_mark_hook (sec, info, rel, h, sym)
- asection *sec;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- Elf_Internal_Rela *rel;
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+elf32_hppa_gc_mark_hook (asection *sec,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ Elf_Internal_Rela *rel,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
if (h != NULL)
{
@@ -1674,11 +1477,10 @@ elf32_hppa_gc_mark_hook (sec, info, rel, h, sym)
removed. */
static bfd_boolean
-elf32_hppa_gc_sweep_hook (abfd, info, sec, relocs)
- bfd *abfd;
- struct bfd_link_info *info ATTRIBUTE_UNUSED;
- asection *sec;
- const Elf_Internal_Rela *relocs;
+elf32_hppa_gc_sweep_hook (bfd *abfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
@@ -1777,10 +1579,9 @@ elf32_hppa_gc_sweep_hook (abfd, info, sec, relocs)
plabels. */
static void
-elf32_hppa_hide_symbol (info, h, force_local)
- struct bfd_link_info *info;
- struct elf_link_hash_entry *h;
- bfd_boolean force_local;
+elf32_hppa_hide_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ bfd_boolean force_local)
{
if (force_local)
{
@@ -1818,9 +1619,8 @@ elf32_hppa_hide_symbol (info, h, force_local)
understand. */
static bfd_boolean
-elf32_hppa_adjust_dynamic_symbol (info, h)
- struct bfd_link_info *info;
- struct elf_link_hash_entry *h;
+elf32_hppa_adjust_dynamic_symbol (struct bfd_link_info *info,
+ struct elf_link_hash_entry *h)
{
struct elf32_hppa_link_hash_table *htab;
struct elf32_hppa_link_hash_entry *eh;
@@ -1847,18 +1647,8 @@ elf32_hppa_adjust_dynamic_symbol (info, h)
used by a plabel relocation. Either this object is the
application or we are doing a shared symbolic link. */
- /* As a special sop to the hppa ABI, we keep a .plt entry
- for functions in sections containing PIC code. */
- if (!info->shared
- && h->plt.refcount > 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
- && (h->root.u.def.section->flags & SEC_HAS_GOT_REF) != 0)
- ((struct elf32_hppa_link_hash_entry *) h)->pic_call = 1;
- else
- {
- h->plt.offset = (bfd_vma) -1;
- h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
- }
+ h->plt.offset = (bfd_vma) -1;
+ h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
}
return TRUE;
@@ -1958,41 +1748,11 @@ elf32_hppa_adjust_dynamic_symbol (info, h)
return TRUE;
}
-/* Called via elf_link_hash_traverse to create .plt entries for an
- application that uses statically linked PIC functions. Similar to
- the first part of elf32_hppa_adjust_dynamic_symbol. */
-
-static bfd_boolean
-mark_PIC_calls (h, inf)
- struct elf_link_hash_entry *h;
- PTR inf ATTRIBUTE_UNUSED;
-{
- if (h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- if (! (h->plt.refcount > 0
- && (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- && (h->root.u.def.section->flags & SEC_HAS_GOT_REF) != 0))
- {
- h->plt.offset = (bfd_vma) -1;
- h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT;
- return TRUE;
- }
-
- h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
- ((struct elf32_hppa_link_hash_entry *) h)->pic_call = 1;
-
- return TRUE;
-}
-
/* Allocate space in the .plt for entries that won't have relocations.
- ie. pic_call and plabel entries. */
+ ie. plabel entries. */
static bfd_boolean
-allocate_plt_static (h, inf)
- struct elf_link_hash_entry *h;
- PTR inf;
+allocate_plt_static (struct elf_link_hash_entry *h, void *inf)
{
struct bfd_link_info *info;
struct elf32_hppa_link_hash_table *htab;
@@ -2004,18 +1764,9 @@ allocate_plt_static (h, inf)
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
- info = (struct bfd_link_info *) inf;
+ info = inf;
htab = hppa_link_hash_table (info);
- if (((struct elf32_hppa_link_hash_entry *) h)->pic_call)
- {
- /* Make an entry in the .plt section for non-pic code that is
- calling pic code. */
- ((struct elf32_hppa_link_hash_entry *) h)->plabel = 0;
- s = htab->splt;
- h->plt.offset = s->_raw_size;
- s->_raw_size += PLT_ENTRY_SIZE;
- }
- else if (htab->elf.dynamic_sections_created
+ if (htab->elf.dynamic_sections_created
&& h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol.
@@ -2064,9 +1815,7 @@ allocate_plt_static (h, inf)
global syms. */
static bfd_boolean
-allocate_dynrelocs (h, inf)
- struct elf_link_hash_entry *h;
- PTR inf;
+allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
{
struct bfd_link_info *info;
struct elf32_hppa_link_hash_table *htab;
@@ -2080,11 +1829,10 @@ allocate_dynrelocs (h, inf)
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
- info = (struct bfd_link_info *) inf;
+ info = inf;
htab = hppa_link_hash_table (info);
if (htab->elf.dynamic_sections_created
&& h->plt.offset != (bfd_vma) -1
- && !((struct elf32_hppa_link_hash_entry *) h)->pic_call
&& !((struct elf32_hppa_link_hash_entry *) h)->plabel)
{
/* Make an entry in the .plt section. */
@@ -2205,9 +1953,8 @@ allocate_dynrelocs (h, inf)
elf_adjust_dynamic_symbol. */
static bfd_boolean
-clobber_millicode_symbols (h, info)
- struct elf_link_hash_entry *h;
- struct bfd_link_info *info;
+clobber_millicode_symbols (struct elf_link_hash_entry *h,
+ struct bfd_link_info *info)
{
if (h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
@@ -2223,9 +1970,7 @@ clobber_millicode_symbols (h, info)
/* Find any dynamic relocs that apply to read-only sections. */
static bfd_boolean
-readonly_dynrelocs (h, inf)
- struct elf_link_hash_entry *h;
- PTR inf;
+readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf)
{
struct elf32_hppa_link_hash_entry *eh;
struct elf32_hppa_dyn_reloc_entry *p;
@@ -2240,7 +1985,7 @@ readonly_dynrelocs (h, inf)
if (s != NULL && (s->flags & SEC_READONLY) != 0)
{
- struct bfd_link_info *info = (struct bfd_link_info *) inf;
+ struct bfd_link_info *info = inf;
info->flags |= DF_TEXTREL;
@@ -2254,9 +1999,8 @@ readonly_dynrelocs (h, inf)
/* Set the sizes of the dynamic sections. */
static bfd_boolean
-elf32_hppa_size_dynamic_sections (output_bfd, info)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- struct bfd_link_info *info;
+elf32_hppa_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
{
struct elf32_hppa_link_hash_table *htab;
bfd *dynobj;
@@ -2286,14 +2030,6 @@ elf32_hppa_size_dynamic_sections (output_bfd, info)
clobber_millicode_symbols,
info);
}
- else
- {
- /* Run through the function symbols, looking for any that are
- PIC, and mark them as needing .plt entries so that %r19 will
- be set up. */
- if (! info->shared)
- elf_link_hash_traverse (&htab->elf, mark_PIC_calls, (PTR) info);
- }
/* Set up .got and .plt offsets for local syms, and space for local
dynamic relocs. */
@@ -2389,11 +2125,11 @@ elf32_hppa_size_dynamic_sections (output_bfd, info)
/* Do all the .plt entries without relocs first. The dynamic linker
uses the last .plt reloc to find the end of the .plt (and hence
the start of the .got) for lazy linking. */
- elf_link_hash_traverse (&htab->elf, allocate_plt_static, (PTR) info);
+ elf_link_hash_traverse (&htab->elf, allocate_plt_static, info);
/* Allocate global sym .plt and .got entries, and space for global
sym dynamic relocs. */
- elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info);
+ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info);
/* The check_relocs and adjust_dynamic_symbol entry points have
determined the sizes of the various dynamic sections. Allocate
@@ -2460,7 +2196,7 @@ elf32_hppa_size_dynamic_sections (output_bfd, info)
/* Allocate memory for the section contents. Zero it, because
we may not fill in all the reloc sections. */
- s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
+ s->contents = bfd_zalloc (dynobj, s->_raw_size);
if (s->contents == NULL && s->_raw_size != 0)
return FALSE;
}
@@ -2506,8 +2242,7 @@ elf32_hppa_size_dynamic_sections (output_bfd, info)
/* If any dynamic relocs apply to a read-only section,
then we need a DT_TEXTREL entry. */
if ((info->flags & DF_TEXTREL) == 0)
- elf_link_hash_traverse (&htab->elf, readonly_dynrelocs,
- (PTR) info);
+ elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, info);
if ((info->flags & DF_TEXTREL) != 0)
{
@@ -2528,9 +2263,7 @@ elf32_hppa_size_dynamic_sections (output_bfd, info)
0 when no stubs will be needed, and 1 on success. */
int
-elf32_hppa_setup_section_lists (output_bfd, info)
- bfd *output_bfd;
- struct bfd_link_info *info;
+elf32_hppa_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
{
bfd *input_bfd;
unsigned int bfd_count;
@@ -2560,7 +2293,7 @@ elf32_hppa_setup_section_lists (output_bfd, info)
htab->bfd_count = bfd_count;
amt = sizeof (struct map_stub) * (top_id + 1);
- htab->stub_group = (struct map_stub *) bfd_zmalloc (amt);
+ htab->stub_group = bfd_zmalloc (amt);
if (htab->stub_group == NULL)
return -1;
@@ -2577,7 +2310,7 @@ elf32_hppa_setup_section_lists (output_bfd, info)
htab->top_index = top_index;
amt = sizeof (asection *) * (top_index + 1);
- input_list = (asection **) bfd_malloc (amt);
+ input_list = bfd_malloc (amt);
htab->input_list = input_list;
if (input_list == NULL)
return -1;
@@ -2606,9 +2339,7 @@ elf32_hppa_setup_section_lists (output_bfd, info)
we may insert linker stubs. */
void
-elf32_hppa_next_input_section (info, isec)
- struct bfd_link_info *info;
- asection *isec;
+elf32_hppa_next_input_section (struct bfd_link_info *info, asection *isec)
{
struct elf32_hppa_link_hash_table *htab = hppa_link_hash_table (info);
@@ -2635,10 +2366,9 @@ elf32_hppa_next_input_section (info, isec)
the middle of a function is not a good idea. */
static void
-group_sections (htab, stub_group_size, stubs_always_before_branch)
- struct elf32_hppa_link_hash_table *htab;
- bfd_size_type stub_group_size;
- bfd_boolean stubs_always_before_branch;
+group_sections (struct elf32_hppa_link_hash_table *htab,
+ bfd_size_type stub_group_size,
+ bfd_boolean stubs_always_before_branch)
{
asection **list = htab->input_list + htab->top_index;
do
@@ -2716,10 +2446,7 @@ group_sections (htab, stub_group_size, stubs_always_before_branch)
Returns -1 on error, 1 if export stubs created, 0 otherwise. */
static int
-get_local_syms (output_bfd, input_bfd, info)
- bfd *output_bfd;
- bfd *input_bfd;
- struct bfd_link_info *info;
+get_local_syms (bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *info)
{
unsigned int bfd_indx;
Elf_Internal_Sym *local_syms, **all_local_syms;
@@ -2730,7 +2457,7 @@ get_local_syms (output_bfd, input_bfd, info)
we need to read in the local symbols in parallel and save them for
later use; so hold pointers to the local symbols in an array. */
bfd_size_type amt = sizeof (Elf_Internal_Sym *) * htab->bfd_count;
- all_local_syms = (Elf_Internal_Sym **) bfd_zmalloc (amt);
+ all_local_syms = bfd_zmalloc (amt);
htab->all_local_syms = all_local_syms;
if (all_local_syms == NULL)
return -1;
@@ -2844,15 +2571,11 @@ get_local_syms (output_bfd, input_bfd, info)
instruction. */
bfd_boolean
-elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size,
- add_stub_section, layout_sections_again)
- bfd *output_bfd;
- bfd *stub_bfd;
- struct bfd_link_info *info;
- bfd_boolean multi_subspace;
- bfd_signed_vma group_size;
- asection * (*add_stub_section) PARAMS ((const char *, asection *));
- void (*layout_sections_again) PARAMS ((void));
+elf32_hppa_size_stubs
+ (bfd *output_bfd, bfd *stub_bfd, struct bfd_link_info *info,
+ bfd_boolean multi_subspace, bfd_signed_vma group_size,
+ asection * (*add_stub_section) (const char *, asection *),
+ void (*layout_sections_again) (void))
{
bfd_size_type stub_group_size;
bfd_boolean stubs_always_before_branch;
@@ -2950,8 +2673,7 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size,
/* Get the relocs. */
internal_relocs
- = _bfd_elf_link_read_relocs (input_bfd, section, NULL,
- (Elf_Internal_Rela *) NULL,
+ = _bfd_elf_link_read_relocs (input_bfd, section, NULL, NULL,
info->keep_memory);
if (internal_relocs == NULL)
goto error_ret_free_local;
@@ -3042,7 +2764,7 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size,
else if (hash->elf.root.type == bfd_link_hash_undefined)
{
if (! (info->shared
- && !info->no_undefined
+ && info->unresolved_syms_in_objects == RM_IGNORE
&& (ELF_ST_VISIBILITY (hash->elf.other)
== STV_DEFAULT)
&& hash->elf.type != STT_PARISC_MILLI))
@@ -3057,7 +2779,7 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size,
/* Determine what (if any) linker stub is needed. */
stub_type = hppa_type_of_stub (section, irela, hash,
- destination);
+ destination, info);
if (stub_type == hppa_stub_none)
continue;
@@ -3138,9 +2860,7 @@ elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size,
stubs to provide a value for __gp. */
bfd_boolean
-elf32_hppa_set_gp (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+elf32_hppa_set_gp (bfd *abfd, struct bfd_link_info *info)
{
struct bfd_link_hash_entry *h;
asection *sec = NULL;
@@ -3234,8 +2954,7 @@ elf32_hppa_set_gp (abfd, info)
linker. */
bfd_boolean
-elf32_hppa_build_stubs (info)
- struct bfd_link_info *info;
+elf32_hppa_build_stubs (struct bfd_link_info *info)
{
asection *stub_sec;
struct bfd_hash_table *table;
@@ -3251,7 +2970,7 @@ elf32_hppa_build_stubs (info)
/* Allocate memory to hold the linker stubs. */
size = stub_sec->_raw_size;
- stub_sec->contents = (unsigned char *) bfd_zalloc (htab->stub_bfd, size);
+ stub_sec->contents = bfd_zalloc (htab->stub_bfd, size);
if (stub_sec->contents == NULL && size != 0)
return FALSE;
stub_sec->_raw_size = 0;
@@ -3267,9 +2986,7 @@ elf32_hppa_build_stubs (info)
/* Perform a final link. */
static bfd_boolean
-elf32_hppa_final_link (abfd, info)
- bfd *abfd;
- struct bfd_link_info *info;
+elf32_hppa_final_link (bfd *abfd, struct bfd_link_info *info)
{
/* Invoke the regular ELF linker to do all the work. */
if (!bfd_elf32_bfd_final_link (abfd, info))
@@ -3283,10 +3000,9 @@ elf32_hppa_final_link (abfd, info)
/* Record the lowest address for the data and text segments. */
static void
-hppa_record_segment_addr (abfd, section, data)
- bfd *abfd ATTRIBUTE_UNUSED;
- asection *section;
- PTR data;
+hppa_record_segment_addr (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *section,
+ void *data)
{
struct elf32_hppa_link_hash_table *htab;
@@ -3312,17 +3028,18 @@ hppa_record_segment_addr (abfd, section, data)
/* Perform a relocation as part of a final link. */
static bfd_reloc_status_type
-final_link_relocate (input_section, contents, rel, value, htab, sym_sec, h)
- asection *input_section;
- bfd_byte *contents;
- const Elf_Internal_Rela *rel;
- bfd_vma value;
- struct elf32_hppa_link_hash_table *htab;
- asection *sym_sec;
- struct elf32_hppa_link_hash_entry *h;
+final_link_relocate (asection *input_section,
+ bfd_byte *contents,
+ const Elf_Internal_Rela *rel,
+ bfd_vma value,
+ struct elf32_hppa_link_hash_table *htab,
+ asection *sym_sec,
+ struct elf32_hppa_link_hash_entry *h,
+ struct bfd_link_info *info)
{
int insn;
unsigned int r_type = ELF32_R_TYPE (rel->r_info);
+ unsigned int orig_r_type = r_type;
reloc_howto_type *howto = elf_hppa_howto_table + r_type;
int r_format = howto->bitsize;
enum hppa_reloc_field_selector_type_alt r_field;
@@ -3345,6 +3062,26 @@ final_link_relocate (input_section, contents, rel, value, htab, sym_sec, h)
input_section->output_offset +
input_section->output_section->vma);
+ /* If we are not building a shared library, convert DLTIND relocs to
+ DPREL relocs. */
+ if (!info->shared)
+ {
+ switch (r_type)
+ {
+ case R_PARISC_DLTIND21L:
+ r_type = R_PARISC_DPREL21L;
+ break;
+
+ case R_PARISC_DLTIND14R:
+ r_type = R_PARISC_DPREL14R;
+ break;
+
+ case R_PARISC_DLTIND14F:
+ r_type = R_PARISC_DPREL14F;
+ break;
+ }
+ }
+
switch (r_type)
{
case R_PARISC_PCREL12F:
@@ -3356,8 +3093,11 @@ final_link_relocate (input_section, contents, rel, value, htab, sym_sec, h)
|| sym_sec->output_section == NULL
|| (h != NULL
&& h->elf.plt.offset != (bfd_vma) -1
- && (h->elf.dynindx != -1 || h->pic_call)
- && !h->plabel))
+ && h->elf.dynindx != -1
+ && !h->plabel
+ && (info->shared
+ || !(h->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
+ || h->elf.root.type == bfd_link_hash_defweak)))
{
stub_entry = hppa_get_stub_entry (input_section, sym_sec,
h, rel, htab);
@@ -3397,6 +3137,38 @@ final_link_relocate (input_section, contents, rel, value, htab, sym_sec, h)
case R_PARISC_DPREL21L:
case R_PARISC_DPREL14R:
case R_PARISC_DPREL14F:
+ /* Convert instructions that use the linkage table pointer (r19) to
+ instructions that use the global data pointer (dp). This is the
+ most efficient way of using PIC code in an incomplete executable,
+ but the user must follow the standard runtime conventions for
+ accessing data for this to work. */
+ if (orig_r_type == R_PARISC_DLTIND21L)
+ {
+ /* Convert addil instructions if the original reloc was a
+ DLTIND21L. GCC sometimes uses a register other than r19 for
+ the operation, so we must convert any addil instruction
+ that uses this relocation. */
+ if ((insn & 0xfc000000) == ((int) OP_ADDIL << 26))
+ insn = ADDIL_DP;
+ else
+ /* We must have a ldil instruction. It's too hard to find
+ and convert the associated add instruction, so issue an
+ error. */
+ (*_bfd_error_handler)
+ (_("%s(%s+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"),
+ bfd_archive_filename (input_bfd),
+ input_section->name,
+ (long) rel->r_offset,
+ howto->name,
+ insn);
+ }
+ else if (orig_r_type == R_PARISC_DLTIND14F)
+ {
+ /* This must be a format 1 load/store. Change the base
+ register to dp. */
+ insn = (insn & 0xfc1ffff) | (27 << 21);
+ }
+
/* For all the DP relative relocations, we need to examine the symbol's
section. If it has no section or if it's a code section, then
"data pointer relative" makes no sense. In that case we don't
@@ -3576,16 +3348,14 @@ final_link_relocate (input_section, contents, rel, value, htab, sym_sec, h)
/* Relocate an HPPA ELF section. */
static bfd_boolean
-elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
- contents, relocs, local_syms, local_sections)
- bfd *output_bfd;
- struct bfd_link_info *info;
- bfd *input_bfd;
- asection *input_section;
- bfd_byte *contents;
- Elf_Internal_Rela *relocs;
- Elf_Internal_Sym *local_syms;
- asection **local_sections;
+elf32_hppa_relocate_section (bfd *output_bfd,
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
bfd_vma *local_got_offsets;
struct elf32_hppa_link_hash_table *htab;
@@ -3642,43 +3412,33 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- int indx;
-
- /* It's a global; Find its entry in the link hash. */
- indx = r_symndx - symtab_hdr->sh_info;
- h = ((struct elf32_hppa_link_hash_entry *)
- elf_sym_hashes (input_bfd)[indx]);
- while (h->elf.root.type == bfd_link_hash_indirect
- || h->elf.root.type == bfd_link_hash_warning)
- h = (struct elf32_hppa_link_hash_entry *) h->elf.root.u.i.link;
-
- relocation = 0;
- if (h->elf.root.type == bfd_link_hash_defined
- || h->elf.root.type == bfd_link_hash_defweak)
- {
- sym_sec = h->elf.root.u.def.section;
- /* If sym_sec->output_section is NULL, then it's a
- symbol defined in a shared library. */
- if (sym_sec->output_section != NULL)
- relocation = (h->elf.root.u.def.value
- + sym_sec->output_offset
- + sym_sec->output_section->vma);
- }
- else if (h->elf.root.type == bfd_link_hash_undefweak)
- ;
- else if (info->shared
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->elf.other) == STV_DEFAULT
- && h->elf.type != STT_PARISC_MILLI)
- ;
- else
- {
- if (!((*info->callbacks->undefined_symbol)
- (info, h->elf.root.root.string, input_bfd,
- input_section, rel->r_offset, TRUE)))
- return FALSE;
- warned_undef = TRUE;
+ struct elf_link_hash_entry *hh;
+ bfd_boolean unresolved_reloc;
+
+ RELOC_FOR_GLOBAL_SYMBOL (hh, elf_sym_hashes (input_bfd), r_symndx, symtab_hdr,
+ relocation, sym_sec, unresolved_reloc, info,
+ warned_undef);
+
+ if (relocation == 0
+ && hh->root.type != bfd_link_hash_defined
+ && hh->root.type != bfd_link_hash_defweak
+ && hh->root.type != bfd_link_hash_undefweak)
+ {
+ if (!info->executable
+ && info->unresolved_syms_in_objects == RM_IGNORE
+ && ELF_ST_VISIBILITY (hh->other) == STV_DEFAULT
+ && hh->type == STT_PARISC_MILLI)
+ {
+ if (! info->callbacks->undefined_symbol
+ (info, hh->root.root.string, input_bfd,
+ input_section, rel->r_offset,
+ ((info->shared && info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR)
+ || (!info->shared && info->unresolved_syms_in_objects == RM_GENERATE_ERROR))))
+ return FALSE;
+ warned_undef = TRUE;
+ }
}
+ h = (struct elf32_hppa_link_hash_entry *) hh;
}
/* Do any required modifications to the relocation value, and
@@ -4011,7 +3771,7 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
}
r = final_link_relocate (input_section, contents, rel, relocation,
- htab, sym_sec, h);
+ htab, sym_sec, h, info);
if (r == bfd_reloc_ok)
continue;
@@ -4049,8 +3809,8 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
else
{
if (!((*info->callbacks->reloc_overflow)
- (info, sym_name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, sym_name, howto->name, 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
}
@@ -4062,13 +3822,14 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
dynamic sections here. */
static bfd_boolean
-elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
- bfd *output_bfd;
- struct bfd_link_info *info;
- struct elf_link_hash_entry *h;
- Elf_Internal_Sym *sym;
+elf32_hppa_finish_dynamic_symbol (bfd *output_bfd,
+ struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
struct elf32_hppa_link_hash_table *htab;
+ Elf_Internal_Rela rel;
+ bfd_byte *loc;
htab = hppa_link_hash_table (info);
@@ -4096,43 +3857,27 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_section->vma);
}
- if (! ((struct elf32_hppa_link_hash_entry *) h)->pic_call)
+ /* Create a dynamic IPLT relocation for this entry. */
+ rel.r_offset = (h->plt.offset
+ + htab->splt->output_offset
+ + htab->splt->output_section->vma);
+ if (h->dynindx != -1)
{
- Elf_Internal_Rela rel;
- bfd_byte *loc;
-
- /* Create a dynamic IPLT relocation for this entry. */
- rel.r_offset = (h->plt.offset
- + htab->splt->output_offset
- + htab->splt->output_section->vma);
- if (h->dynindx != -1)
- {
- rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_IPLT);
- rel.r_addend = 0;
- }
- else
- {
- /* This symbol has been marked to become local, and is
- used by a plabel so must be kept in the .plt. */
- rel.r_info = ELF32_R_INFO (0, R_PARISC_IPLT);
- rel.r_addend = value;
- }
-
- loc = htab->srelplt->contents;
- loc += htab->srelplt->reloc_count++ * sizeof (Elf32_External_Rela);
- bfd_elf32_swap_reloca_out (htab->splt->output_section->owner,
- &rel, loc);
+ rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_IPLT);
+ rel.r_addend = 0;
}
else
{
- bfd_put_32 (htab->splt->owner,
- value,
- htab->splt->contents + h->plt.offset);
- bfd_put_32 (htab->splt->owner,
- elf_gp (htab->splt->output_section->owner),
- htab->splt->contents + h->plt.offset + 4);
+ /* This symbol has been marked to become local, and is
+ used by a plabel so must be kept in the .plt. */
+ rel.r_info = ELF32_R_INFO (0, R_PARISC_IPLT);
+ rel.r_addend = value;
}
+ loc = htab->srelplt->contents;
+ loc += htab->srelplt->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (htab->splt->output_section->owner, &rel, loc);
+
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{
/* Mark the symbol as undefined, rather than as defined in
@@ -4143,9 +3888,6 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
if (h->got.offset != (bfd_vma) -1)
{
- Elf_Internal_Rela rel;
- bfd_byte *loc;
-
/* This symbol has an entry in the global offset table. Set it
up. */
@@ -4171,8 +3913,7 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
{
if ((h->got.offset & 1) != 0)
abort ();
- bfd_put_32 (output_bfd, (bfd_vma) 0,
- htab->sgot->contents + h->got.offset);
+ bfd_put_32 (output_bfd, 0, htab->sgot->contents + h->got.offset);
rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_DIR32);
rel.r_addend = 0;
}
@@ -4185,8 +3926,6 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{
asection *s;
- Elf_Internal_Rela rel;
- bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */
@@ -4221,8 +3960,7 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
dynamic linker, before writing them out. */
static enum elf_reloc_type_class
-elf32_hppa_reloc_type_class (rela)
- const Elf_Internal_Rela *rela;
+elf32_hppa_reloc_type_class (const Elf_Internal_Rela *rela)
{
if (ELF32_R_SYM (rela->r_info) == 0)
return reloc_class_relative;
@@ -4241,9 +3979,8 @@ elf32_hppa_reloc_type_class (rela)
/* Finish up the dynamic sections. */
static bfd_boolean
-elf32_hppa_finish_dynamic_sections (output_bfd, info)
- bfd *output_bfd;
- struct bfd_link_info *info;
+elf32_hppa_finish_dynamic_sections (bfd *output_bfd,
+ struct bfd_link_info *info)
{
bfd *dynobj;
struct elf32_hppa_link_hash_table *htab;
@@ -4321,9 +4058,7 @@ elf32_hppa_finish_dynamic_sections (output_bfd, info)
/* Fill in the first entry in the global offset table.
We use it to point to our dynamic section, if we have one. */
bfd_put_32 (output_bfd,
- (sdyn != NULL
- ? sdyn->output_section->vma + sdyn->output_offset
- : (bfd_vma) 0),
+ sdyn ? sdyn->output_section->vma + sdyn->output_offset : 0,
htab->sgot->contents);
/* The second entry is reserved for use by the dynamic linker. */
@@ -4366,9 +4101,8 @@ elf32_hppa_finish_dynamic_sections (output_bfd, info)
/* Tweak the OSABI field of the elf header. */
static void
-elf32_hppa_post_process_headers (abfd, link_info)
- bfd *abfd;
- struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
+elf32_hppa_post_process_headers (bfd *abfd,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
Elf_Internal_Ehdr * i_ehdrp;
@@ -4387,9 +4121,7 @@ elf32_hppa_post_process_headers (abfd, link_info)
/* Called when writing out an object file to decide the type of a
symbol. */
static int
-elf32_hppa_elf_get_symbol_type (elf_sym, type)
- Elf_Internal_Sym *elf_sym;
- int type;
+elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
{
if (ELF_ST_TYPE (elf_sym->st_info) == STT_PARISC_MILLI)
return STT_PARISC_MILLI;
@@ -4407,7 +4139,6 @@ elf32_hppa_elf_get_symbol_type (elf_sym, type)
#define bfd_elf32_bfd_final_link elf32_hppa_final_link
#define bfd_elf32_bfd_link_hash_table_create elf32_hppa_link_hash_table_create
#define bfd_elf32_bfd_link_hash_table_free elf32_hppa_link_hash_table_free
-#define elf_backend_add_symbol_hook elf32_hppa_add_symbol_hook
#define elf_backend_adjust_dynamic_symbol elf32_hppa_adjust_dynamic_symbol
#define elf_backend_copy_indirect_symbol elf32_hppa_copy_indirect_symbol
#define elf_backend_check_relocs elf32_hppa_check_relocs
diff --git a/bfd/elf32-hppa.h b/bfd/elf32-hppa.h
index 7c8c687c499..000602eb43b 100644
--- a/bfd/elf32-hppa.h
+++ b/bfd/elf32-hppa.h
@@ -5,7 +5,7 @@
February 1994.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
- 2002 Free Software Foundation, Inc.
+ 2002, 2003 Free Software Foundation, Inc.
Written by:
@@ -37,27 +37,26 @@
#include "elf/hppa.h"
int elf32_hppa_setup_section_lists
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
void elf32_hppa_next_input_section
- PARAMS ((struct bfd_link_info *, asection *));
+ (struct bfd_link_info *, asection *);
bfd_boolean elf32_hppa_size_stubs
- PARAMS ((bfd *, bfd *, struct bfd_link_info *, bfd_boolean, bfd_signed_vma,
- asection * (*) PARAMS ((const char *, asection *)),
- void (*) PARAMS ((void))));
+ (bfd *, bfd *, struct bfd_link_info *, bfd_boolean, bfd_signed_vma,
+ asection * (*) (const char *, asection *), void (*) (void));
bfd_boolean elf32_hppa_set_gp
- PARAMS ((bfd *, struct bfd_link_info *));
+ (bfd *, struct bfd_link_info *);
bfd_boolean elf32_hppa_build_stubs
- PARAMS ((struct bfd_link_info *));
+ (struct bfd_link_info *);
elf_hppa_reloc_type elf32_hppa_reloc_final_type
- PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int));
+ (bfd *, elf_hppa_reloc_type, int, unsigned int);
extern elf_hppa_reloc_type ** _bfd_elf32_hppa_gen_reloc_type
- PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *));
+ (bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *);
/* Define groups of basic relocations. FIXME: These should
be the only basic relocations created by GAS. The rest
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 60bccb8078b..11fadabc998 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -711,7 +711,7 @@ elf_i386_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-elf_i386_copy_indirect_symbol (struct elf_backend_data *bed,
+elf_i386_copy_indirect_symbol (const struct elf_backend_data *bed,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
@@ -2154,42 +2154,9 @@ elf_i386_relocate_section (bfd *output_bfd,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ bfd_boolean warned;
- relocation = 0;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- if (sec->output_section == NULL)
- /* Set a flag that will be cleared later if we find a
- relocation value for this symbol. output_section
- is typically NULL for symbols satisfied by a shared
- library. */
- unresolved_reloc = TRUE;
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- ;
- else if (!info->executable
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- ;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- }
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx, symtab_hdr, relocation, sec, unresolved_reloc, info, warned);
}
switch (r_type)
diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c
index fd68dc63362..209cbe6554b 100644
--- a/bfd/elf32-i860.c
+++ b/bfd/elf32-i860.c
@@ -26,6 +26,237 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "elf-bfd.h"
#include "elf/i860.h"
+/* special_function for R_860_PC26 relocation. */
+static bfd_reloc_status_type
+i860_howto_pc26_reloc (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void *data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
+{
+ bfd_vma insn;
+ bfd_vma relocation;
+ bfd_byte *addr;
+
+ if (output_bfd != NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0
+ && (! reloc_entry->howto->partial_inplace
+ || reloc_entry->addend == 0))
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ /* Used elf32-mips.c as an example. */
+ if (bfd_is_und_section (symbol->section)
+ && output_bfd == (bfd *) NULL)
+ return bfd_reloc_undefined;
+
+ if (bfd_is_com_section (symbol->section))
+ relocation = 0;
+ else
+ relocation = symbol->value;
+
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ relocation += reloc_entry->addend;
+
+ if (reloc_entry->address > input_section->_cooked_size)
+ return bfd_reloc_outofrange;
+
+ /* Adjust for PC-relative relocation. */
+ relocation -= (input_section->output_section->vma
+ + input_section->output_offset
+ + reloc_entry->address
+ + 4);
+
+ /* Check for target out of range. */
+ if ((bfd_signed_vma)relocation > (0x3ffffff << 2)
+ || (bfd_signed_vma)relocation < (-0x4000000 << 2))
+ return bfd_reloc_outofrange;
+
+ addr = (bfd_byte *) data + reloc_entry->address;
+ insn = bfd_get_32 (abfd, addr);
+
+ relocation >>= reloc_entry->howto->rightshift;
+ insn = (insn & ~reloc_entry->howto->dst_mask)
+ | (relocation & reloc_entry->howto->dst_mask);
+
+ bfd_put_32 (abfd, (bfd_vma) insn, addr);
+
+ return bfd_reloc_ok;
+}
+
+/* special_function for R_860_PC16 relocation. */
+static bfd_reloc_status_type
+i860_howto_pc16_reloc (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void *data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
+{
+ bfd_vma insn;
+ bfd_vma relocation;
+ bfd_byte *addr;
+
+ if (output_bfd != NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0
+ && (! reloc_entry->howto->partial_inplace
+ || reloc_entry->addend == 0))
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ /* Used elf32-mips.c as an example. */
+ if (bfd_is_und_section (symbol->section)
+ && output_bfd == (bfd *) NULL)
+ return bfd_reloc_undefined;
+
+ if (bfd_is_com_section (symbol->section))
+ relocation = 0;
+ else
+ relocation = symbol->value;
+
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ relocation += reloc_entry->addend;
+
+ if (reloc_entry->address > input_section->_cooked_size)
+ return bfd_reloc_outofrange;
+
+ /* Adjust for PC-relative relocation. */
+ relocation -= (input_section->output_section->vma
+ + input_section->output_offset
+ + reloc_entry->address
+ + 4);
+
+ /* Check for target out of range. */
+ if ((bfd_signed_vma)relocation > (0x7fff << 2)
+ || (bfd_signed_vma)relocation < (-0x8000 << 2))
+ return bfd_reloc_outofrange;
+
+ addr = (bfd_byte *) data + reloc_entry->address;
+ insn = bfd_get_32 (abfd, addr);
+
+ relocation >>= reloc_entry->howto->rightshift;
+ relocation = (((relocation & 0xf800) << 5) | (relocation & 0x7ff))
+ & reloc_entry->howto->dst_mask;
+ insn = (insn & ~reloc_entry->howto->dst_mask) | relocation;
+
+ bfd_put_32 (abfd, (bfd_vma) insn, addr);
+
+ return bfd_reloc_ok;
+}
+
+/* special_function for R_860_HIGHADJ relocation. */
+static bfd_reloc_status_type
+i860_howto_highadj_reloc (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void *data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
+{
+ bfd_vma insn;
+ bfd_vma relocation;
+ bfd_byte *addr;
+
+ if (output_bfd != NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0
+ && (! reloc_entry->howto->partial_inplace
+ || reloc_entry->addend == 0))
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ /* Used elf32-mips.c as an example. */
+ if (bfd_is_und_section (symbol->section)
+ && output_bfd == (bfd *) NULL)
+ return bfd_reloc_undefined;
+
+ if (bfd_is_com_section (symbol->section))
+ relocation = 0;
+ else
+ relocation = symbol->value;
+
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ relocation += reloc_entry->addend;
+ relocation += 0x8000;
+
+ if (reloc_entry->address > input_section->_cooked_size)
+ return bfd_reloc_outofrange;
+
+ addr = (bfd_byte *) data + reloc_entry->address;
+ insn = bfd_get_32 (abfd, addr);
+
+ relocation = ((relocation >> 16) & 0xffff);
+
+ insn = (insn & 0xffff0000) | relocation;
+
+ bfd_put_32 (abfd, (bfd_vma) insn, addr);
+
+ return bfd_reloc_ok;
+}
+
+/* special_function for R_860_SPLITn relocations. */
+static bfd_reloc_status_type
+i860_howto_splitn_reloc (bfd *abfd,
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void *data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
+{
+ bfd_vma insn;
+ bfd_vma relocation;
+ bfd_byte *addr;
+
+ if (output_bfd != NULL
+ && (symbol->flags & BSF_SECTION_SYM) == 0
+ && (! reloc_entry->howto->partial_inplace
+ || reloc_entry->addend == 0))
+ {
+ reloc_entry->address += input_section->output_offset;
+ return bfd_reloc_ok;
+ }
+
+ /* Used elf32-mips.c as an example. */
+ if (bfd_is_und_section (symbol->section)
+ && output_bfd == (bfd *) NULL)
+ return bfd_reloc_undefined;
+
+ if (bfd_is_com_section (symbol->section))
+ relocation = 0;
+ else
+ relocation = symbol->value;
+
+ relocation += symbol->section->output_section->vma;
+ relocation += symbol->section->output_offset;
+ relocation += reloc_entry->addend;
+
+ if (reloc_entry->address > input_section->_cooked_size)
+ return bfd_reloc_outofrange;
+
+ addr = (bfd_byte *) data + reloc_entry->address;
+ insn = bfd_get_32 (abfd, addr);
+
+ relocation = (((relocation & 0xf800) << 5) | (relocation & 0x7ff))
+ & reloc_entry->howto->dst_mask;
+ insn = (insn & ~reloc_entry->howto->dst_mask) | relocation;
+
+ bfd_put_32 (abfd, (bfd_vma) insn, addr);
+
+ return bfd_reloc_ok;
+}
/* This howto table is preliminary. */
static reloc_howto_type elf32_i860_howto_table [] =
@@ -124,7 +355,7 @@ static reloc_howto_type elf32_i860_howto_table [] =
TRUE, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ i860_howto_pc26_reloc, /* special_function */
"R_860_PC26", /* name */
FALSE, /* partial_inplace */
0x3ffffff, /* src_mask */
@@ -153,7 +384,7 @@ static reloc_howto_type elf32_i860_howto_table [] =
TRUE, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ i860_howto_pc16_reloc, /* special_function */
"R_860_PC16", /* name */
FALSE, /* partial_inplace */
0x1f07ff, /* src_mask */
@@ -181,7 +412,7 @@ static reloc_howto_type elf32_i860_howto_table [] =
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ i860_howto_splitn_reloc, /* special_function */
"R_860_SPLIT0", /* name */
FALSE, /* partial_inplace */
0x1f07ff, /* src_mask */
@@ -209,7 +440,7 @@ static reloc_howto_type elf32_i860_howto_table [] =
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ i860_howto_splitn_reloc, /* special_function */
"R_860_SPLIT1", /* name */
FALSE, /* partial_inplace */
0x1f07fe, /* src_mask */
@@ -237,7 +468,7 @@ static reloc_howto_type elf32_i860_howto_table [] =
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ i860_howto_splitn_reloc, /* special_function */
"R_860_SPLIT2", /* name */
FALSE, /* partial_inplace */
0x1f07fc, /* src_mask */
@@ -419,7 +650,7 @@ static reloc_howto_type elf32_i860_howto_table [] =
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ i860_howto_highadj_reloc, /* special_function */
"R_860_HIGHADJ", /* name */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
@@ -712,7 +943,8 @@ elf32_i860_relocate_pc16 (bfd *input_bfd,
/* Relocate. */
value += rello->r_addend;
- /* Separate the fields and insert. */
+ /* Adjust the value by 4, then separate the fields and insert. */
+ value = (value - 4) >> howto->rightshift;
value = (((value & 0xf800) << 5) | (value & 0x7ff)) & howto->dst_mask;
insn = (insn & ~howto->dst_mask) | value;
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index 4cb28bb31b8..e8cb1771887 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -1532,33 +1532,12 @@ ip2k_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+ bfd_boolean warned;
+ bfd_boolean unresolved_reloc;
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx, symtab_hdr, relocation, sec, unresolved_reloc, info, warned);
name = h->root.root.string;
-
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- relocation = h->root.u.def.value + BASEADDR (sec);
- }
-
- else if (h->root.type == bfd_link_hash_undefweak)
- relocation = 0;
-
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (! info->shared || info->no_undefined))))
- return FALSE;
- relocation = 0;
- }
}
/* Finally, the sole IP2K-specific part. */
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index e2a3b17aee5..f85ffac8431 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -618,48 +618,14 @@ iq2000_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes [r_symndx];
-
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ bfd_boolean unresolved_reloc;
+ bfd_boolean warned;
+
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation,
+ sec, unresolved_reloc, info, warned);
name = h->root.root.string;
-
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
-#ifdef DEBUG
- fprintf (stderr,
- "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n",
- sec->name, name, h->root.u.def.value,
- sec->output_section->vma, sec->output_offset, relocation);
-#endif
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- {
-#ifdef DEBUG
- fprintf (stderr, "undefined: sec: %s, name: %s\n",
- sec->name, name);
-#endif
- relocation = 0;
- }
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined))))
- return FALSE;
-#ifdef DEBUG
- fprintf (stderr, "unknown: name: %s\n", name);
-#endif
- relocation = 0;
- }
}
switch (r_type)
diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c
index b9d9bfc312f..2844b487a40 100644
--- a/bfd/elf32-m68hc11.c
+++ b/bfd/elf32-m68hc11.c
@@ -1285,7 +1285,7 @@ m68hc11_elf_relax_delete_bytes (abfd, sec, addr, count)
- The .page0 is a data section that is mapped in [0x0000..0x00FF].
Page0 accesses are faster on the M68HC11. Soft registers used by GCC-m6811
are located in .page0.
- - The .vectors is the data section that represents the interrupt
+ - The .vectors is the section that represents the interrupt
vectors. */
static struct bfd_elf_special_section const elf32_m68hc11_special_sections[]=
{
@@ -1296,7 +1296,7 @@ static struct bfd_elf_special_section const elf32_m68hc11_special_sections[]=
{ ".page0", 0, NULL, 0,
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ ".vectors", 0, NULL, 0,
- SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ SHT_PROGBITS, SHF_ALLOC },
{ NULL, 0, NULL, 0,
0, 0 }
};
diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c
index 54fdca28277..3074935cc83 100644
--- a/bfd/elf32-m68hc12.c
+++ b/bfd/elf32-m68hc12.c
@@ -538,6 +538,25 @@ m68hc12_elf_set_mach_from_flags (abfd)
return TRUE;
}
+/* Specific sections:
+ - The .page0 is a data section that is mapped in [0x0000..0x00FF].
+ Page0 accesses are faster on the M68HC12.
+ - The .vectors is the section that represents the interrupt
+ vectors. */
+static struct bfd_elf_special_section const elf32_m68hc12_special_sections[]=
+{
+ { ".eeprom", 0, NULL, 0,
+ SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { ".softregs", 0, NULL, 0,
+ SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
+ { ".page0", 0, NULL, 0,
+ SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { ".vectors", 0, NULL, 0,
+ SHT_PROGBITS, SHF_ALLOC },
+ { NULL, 0, NULL, 0,
+ 0, 0 }
+};
+
#define ELF_ARCH bfd_arch_m68hc12
#define ELF_MACHINE_CODE EM_68HC12
#define ELF_MAXPAGESIZE 0x1000
@@ -554,6 +573,7 @@ m68hc12_elf_set_mach_from_flags (abfd)
#define elf_backend_object_p m68hc12_elf_set_mach_from_flags
#define elf_backend_final_write_processing 0
#define elf_backend_can_gc_sections 1
+#define elf_backend_special_sections elf32_m68hc12_special_sections
#define elf_backend_post_process_headers elf32_m68hc11_post_process_headers
#define elf_backend_add_symbol_hook elf32_m68hc11_add_symbol_hook
diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c
index 7733f05f1fd..8d71cb659e6 100644
--- a/bfd/elf32-m68hc1x.c
+++ b/bfd/elf32-m68hc1x.c
@@ -367,76 +367,29 @@ elf32_m68hc11_size_stubs (output_bfd, stub_bfd, info, add_stub_section)
input_bfd = input_bfd->link_next, bfd_indx++)
{
Elf_Internal_Shdr *symtab_hdr;
- Elf_Internal_Shdr *shndx_hdr;
- Elf_Internal_Sym *isym;
- Elf32_External_Sym *extsyms, *esym, *end_sy;
- Elf_External_Sym_Shndx *shndx_buf, *shndx;
- bfd_size_type sec_size;
/* We'll need the symbol table in a second. */
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
if (symtab_hdr->sh_info == 0)
continue;
- /* We need an array of the local symbols attached to the input bfd.
- Unfortunately, we're going to have to read & swap them in. */
- sec_size = symtab_hdr->sh_info;
- sec_size *= sizeof (Elf_Internal_Sym);
- local_syms = (Elf_Internal_Sym *) bfd_malloc (sec_size);
+ /* We need an array of the local symbols attached to the input bfd. */
+ local_syms = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (local_syms == NULL)
+ {
+ local_syms = bfd_elf_get_elf_syms (input_bfd, symtab_hdr,
+ symtab_hdr->sh_info, 0,
+ NULL, NULL, NULL);
+ /* Cache them for elf_link_input_bfd. */
+ symtab_hdr->contents = (unsigned char *) local_syms;
+ }
if (local_syms == NULL)
- goto error_ret_free_local;
-
- all_local_syms[bfd_indx] = local_syms;
- sec_size = symtab_hdr->sh_info;
- sec_size *= sizeof (Elf32_External_Sym);
-
- /* Get the cached copy. */
- if (symtab_hdr->contents != NULL)
- extsyms = (Elf32_External_Sym *) symtab_hdr->contents;
- else
- {
- /* Go get them off disk. */
- bfd_size_type amt = symtab_hdr->sh_size;
- extsyms = (Elf32_External_Sym *) bfd_malloc (amt);
- if (extsyms == NULL)
- goto error_ret_free_local;
-
- if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0
- || bfd_bread ((PTR) extsyms, amt, input_bfd) != amt)
- {
- error_ret_free_ext_syms:
- free (extsyms);
- goto error_ret_free_local;
- }
- }
- shndx_buf = NULL;
- shndx_hdr = &elf_tdata (input_bfd)->symtab_shndx_hdr;
- if (shndx_hdr->sh_size != 0)
{
- bfd_size_type amt;
-
- amt = symtab_hdr->sh_info * sizeof (Elf_External_Sym_Shndx);
- shndx_buf = (Elf_External_Sym_Shndx *) bfd_malloc (amt);
- if (shndx_buf == NULL)
- goto error_ret_free_ext_syms;
- if (bfd_seek (input_bfd, shndx_hdr->sh_offset, SEEK_SET) != 0
- || bfd_bread ((PTR) shndx_buf, amt, input_bfd) != amt)
- {
- free (shndx_buf);
- goto error_ret_free_ext_syms;
- }
- shndx_hdr->contents = (PTR) shndx_buf;
+ free (all_local_syms);
+ return FALSE;
}
- /* Swap the local symbols in. */
- for (esym = extsyms, end_sy = esym + symtab_hdr->sh_info,
- isym = local_syms, shndx = shndx_buf;
- esym < end_sy;
- esym++, isym++, shndx = (shndx ? shndx + 1 : NULL))
- bfd_elf32_swap_symbol_in (input_bfd, esym, shndx, isym);
-
- /* Now we can free the external symbols. */
- free (shndx_buf);
+ all_local_syms[bfd_indx] = local_syms;
}
for (input_bfd = info->input_bfds, bfd_indx = 0;
@@ -608,11 +561,11 @@ elf32_m68hc11_size_stubs (output_bfd, stub_bfd, info, add_stub_section)
bfd_hash_traverse (htab->stub_hash_table, htab->size_one_stub, htab);
}
- free (htab->all_local_syms);
+ free (all_local_syms);
return TRUE;
error_ret_free_local:
- free (htab->all_local_syms);
+ free (all_local_syms);
return FALSE;
}
@@ -1119,7 +1072,7 @@ elf32_m68hc11_relocate_section (output_bfd, info, input_bfd, input_section,
Elf_Internal_Rela *rel, *relend;
const char *name;
struct m68hc11_page_info *pinfo;
- struct elf_backend_data * const ebd = get_elf_backend_data (input_bfd);
+ const struct elf_backend_data * const ebd = get_elf_backend_data (input_bfd);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
diff --git a/bfd/elf32-m68hc1x.h b/bfd/elf32-m68hc1x.h
index e70c172c37d..c5e937282b1 100644
--- a/bfd/elf32-m68hc1x.h
+++ b/bfd/elf32-m68hc1x.h
@@ -118,7 +118,6 @@ struct m68hc11_elf_link_hash_table
unsigned int bfd_count;
int top_index;
asection **input_list;
- Elf_Internal_Sym **all_local_syms;
/* Small local sym to section mapping cache. */
struct sym_sec_cache sym_sec;
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index 1320429cf1f..7688bfd9fc2 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -1398,6 +1398,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
sym = NULL;
sec = NULL;
unresolved_reloc = FALSE;
+
if (r_symndx < symtab_hdr->sh_info)
{
sym = local_syms + r_symndx;
@@ -1406,42 +1407,9 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ bfd_boolean warned;
- relocation = 0;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- if (sec->output_section == NULL)
- /* Set a flag that will be cleared later if we find a
- relocation value for this symbol. output_section
- is typically NULL for symbols satisfied by a shared
- library. */
- unresolved_reloc = TRUE;
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- ;
- else if (info->shared
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- ;
- else
- {
- if (!(info->callbacks->undefined_symbol
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- }
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx, symtab_hdr, relocation, sec, unresolved_reloc, info, warned);
}
switch (r_type)
diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c
index 23f5069cb19..b09ef873cb1 100644
--- a/bfd/elf32-msp430.c
+++ b/bfd/elf32-msp430.c
@@ -550,10 +550,6 @@ bfd_elf_msp430_final_write_processing (abfd, linker)
switch (bfd_get_mach (abfd))
{
default:
- case bfd_mach_msp12:
- val = E_MSP430_MACH_MSP430x12;
- break;
-
case bfd_mach_msp110:
val = E_MSP430_MACH_MSP430x11x1;
break;
@@ -562,6 +558,10 @@ bfd_elf_msp430_final_write_processing (abfd, linker)
val = E_MSP430_MACH_MSP430x11;
break;
+ case bfd_mach_msp12:
+ val = E_MSP430_MACH_MSP430x12;
+ break;
+
case bfd_mach_msp13:
val = E_MSP430_MACH_MSP430x13;
break;
@@ -570,16 +570,12 @@ bfd_elf_msp430_final_write_processing (abfd, linker)
val = E_MSP430_MACH_MSP430x14;
break;
- case bfd_mach_msp41:
- val = E_MSP430_MACH_MSP430x41;
- break;
-
- case bfd_mach_msp43:
- val = E_MSP430_MACH_MSP430x43;
+ case bfd_mach_msp15:
+ val = E_MSP430_MACH_MSP430x15;
break;
- case bfd_mach_msp44:
- val = E_MSP430_MACH_MSP430x44;
+ case bfd_mach_msp16:
+ val = E_MSP430_MACH_MSP430x16;
break;
case bfd_mach_msp31:
@@ -594,12 +590,20 @@ bfd_elf_msp430_final_write_processing (abfd, linker)
val = E_MSP430_MACH_MSP430x33;
break;
- case bfd_mach_msp15:
- val = E_MSP430_MACH_MSP430x15;
+ case bfd_mach_msp41:
+ val = E_MSP430_MACH_MSP430x41;
break;
- case bfd_mach_msp16:
- val = E_MSP430_MACH_MSP430x16;
+ case bfd_mach_msp42:
+ val = E_MSP430_MACH_MSP430x42;
+ break;
+
+ case bfd_mach_msp43:
+ val = E_MSP430_MACH_MSP430x43;
+ break;
+
+ case bfd_mach_msp44:
+ val = E_MSP430_MACH_MSP430x44;
break;
}
@@ -624,10 +628,6 @@ elf32_msp430_object_p (abfd)
switch (e_mach)
{
default:
- case E_MSP430_MACH_MSP430x12:
- e_set = bfd_mach_msp12;
- break;
-
case E_MSP430_MACH_MSP430x11:
e_set = bfd_mach_msp11;
break;
@@ -636,6 +636,10 @@ elf32_msp430_object_p (abfd)
e_set = bfd_mach_msp110;
break;
+ case E_MSP430_MACH_MSP430x12:
+ e_set = bfd_mach_msp12;
+ break;
+
case E_MSP430_MACH_MSP430x13:
e_set = bfd_mach_msp13;
break;
@@ -644,8 +648,12 @@ elf32_msp430_object_p (abfd)
e_set = bfd_mach_msp14;
break;
- case E_MSP430_MACH_MSP430x41:
- e_set = bfd_mach_msp41;
+ case E_MSP430_MACH_MSP430x15:
+ e_set = bfd_mach_msp15;
+ break;
+
+ case E_MSP430_MACH_MSP430x16:
+ e_set = bfd_mach_msp16;
break;
case E_MSP430_MACH_MSP430x31:
@@ -660,20 +668,20 @@ elf32_msp430_object_p (abfd)
e_set = bfd_mach_msp33;
break;
- case E_MSP430_MACH_MSP430x43:
- e_set = bfd_mach_msp43;
+ case E_MSP430_MACH_MSP430x41:
+ e_set = bfd_mach_msp41;
break;
- case E_MSP430_MACH_MSP430x44:
- e_set = bfd_mach_msp44;
+ case E_MSP430_MACH_MSP430x42:
+ e_set = bfd_mach_msp42;
break;
- case E_MSP430_MACH_MSP430x15:
- e_set = bfd_mach_msp15;
+ case E_MSP430_MACH_MSP430x43:
+ e_set = bfd_mach_msp43;
break;
- case E_MSP430_MACH_MSP430x16:
- e_set = bfd_mach_msp16;
+ case E_MSP430_MACH_MSP430x44:
+ e_set = bfd_mach_msp44;
break;
}
}
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index dff4126e155..3bffc70c786 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -285,7 +285,7 @@ ppc_elf_link_hash_table_create (bfd *abfd)
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-ppc_elf_copy_indirect_symbol (struct elf_backend_data *bed,
+ppc_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
@@ -2581,11 +2581,12 @@ elf_finish_pointer_linker_section (bfd *output_bfd,
asection *srel = lsect->rel_section;
Elf_Internal_Rela outrel[MAX_INT_RELS_PER_EXT_REL];
bfd_byte *erel;
- struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
+ const struct elf_backend_data *bed;
unsigned int i;
BFD_ASSERT (srel != NULL);
+ bed = get_elf_backend_data (output_bfd);
for (i = 0; i < bed->s->int_rels_per_ext_rel; i++)
{
outrel[i].r_offset = (lsect->section->output_section->vma
@@ -4717,6 +4718,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
unresolved_reloc = FALSE;
warned = FALSE;
r_symndx = ELF32_R_SYM (rel->r_info);
+
if (r_symndx < symtab_hdr->sh_info)
{
sym = local_syms + r_symndx;
@@ -4727,44 +4729,12 @@ ppc_elf_relocate_section (bfd *output_bfd,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation, sec,
+ unresolved_reloc, info,
+ warned);
+
sym_name = h->root.root.string;
-
- relocation = 0;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- /* Set a flag that will be cleared later if we find a
- relocation value for this symbol. output_section
- is typically NULL for symbols satisfied by a shared
- library. */
- if (sec->output_section == NULL)
- unresolved_reloc = TRUE;
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- ;
- else if (!info->executable
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- ;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd, input_section,
- rel->r_offset, (!info->shared
- || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- warned = TRUE;
- }
}
/* TLS optimizations. Replace instruction sequences and relocs
@@ -5499,49 +5469,16 @@ ppc_elf_relocate_section (bfd *output_bfd,
}
else
{
- long indx;
-
- indx = r_symndx - symtab_hdr->sh_info;
- h = elf_sym_hashes (input_bfd)[indx];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- value = 0;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sym_sec = h->root.u.def.section;
-
- /* Detect the cases that sym_sec->output_section is
- expected to be NULL -- all cases in which the symbol
- is defined in another shared module. This includes
- PLT relocs for which we've created a PLT entry and
- other relocs for which we're prepared to create
- dynamic relocations. */
- /* ??? Just accept it NULL and continue. */
-
- if (sym_sec->output_section != NULL)
- {
- value = (h->root.u.def.value
- + sym_sec->output_section->vma
- + sym_sec->output_offset);
- }
- }
- else if (info->shared
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- ;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- continue;
- }
+ bfd_boolean warned;
+ bfd_boolean unresolved_reloc;
+
+ RELOC_FOR_GLOBAL_SYMBOL (h, elf_sym_hashes (input_bfd),
+ r_symndx, symtab_hdr,
+ value, sym_sec,
+ unresolved_reloc, info,
+ warned);
+ if (warned)
+ continue;
}
hit_addr = contents + rel->r_offset;
value += rel->r_addend;
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 1ce327f96d8..5b07ab0db7b 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -40,7 +40,7 @@ static bfd_boolean create_got_section
static bfd_boolean elf_s390_create_dynamic_sections
PARAMS((bfd *, struct bfd_link_info *));
static void elf_s390_copy_indirect_symbol
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
static bfd_boolean elf_s390_check_relocs
PARAMS ((bfd *, struct bfd_link_info *, asection *,
@@ -856,7 +856,7 @@ elf_s390_create_dynamic_sections (dynobj, info)
static void
elf_s390_copy_indirect_symbol (bed, dir, ind)
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_link_hash_entry *dir, *ind;
{
struct elf_s390_link_hash_entry *edir, *eind;
@@ -2331,45 +2331,12 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ bfd_boolean warned ATTRIBUTE_UNUSED;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- if (sec->output_section == NULL)
- {
- /* Set a flag that will be cleared later if we find a
- relocation value for this symbol. output_section
- is typically NULL for symbols satisfied by a shared
- library. */
- unresolved_reloc = TRUE;
- relocation = 0;
- }
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- relocation = 0;
- else if (!info->executable
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- relocation = 0;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- relocation = 0;
- }
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation, sec,
+ unresolved_reloc, info,
+ warned);
}
switch (r_type)
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 541786581d6..368bbca37a1 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -57,7 +57,7 @@ static bfd_byte *sh_elf_get_relocated_section_contents
(bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
bfd_boolean, asymbol **);
static void sh_elf_copy_indirect_symbol
- (struct elf_backend_data *, struct elf_link_hash_entry *,
+ (const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *);
static int sh_elf_optimized_tls_reloc
(struct bfd_link_info *, int, int);
@@ -3692,7 +3692,7 @@ sh_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
struct elf_sh_link_hash_table *htab;
flagword flags, pltflags;
register asection *s;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
int ptralign = 0;
switch (bed->s->arch_size)
@@ -4663,6 +4663,8 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
}
else
{
+ /* FIXME: Ought to make use of the RELOC_FOR_GLOBAL_SYMBOL macro. */
+
/* Section symbol are never (?) placed in the hash table, so
we can just ignore hash relocations when creating a
relocatable object file. */
@@ -4764,17 +4766,18 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared
- && ! info->no_undefined
+ else if (! info->executable
+ && info->unresolved_syms_in_objects == RM_IGNORE
&& ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
+ if (! info->callbacks->undefined_symbol
+ (info, h->root.root.string, input_bfd,
+ input_section, rel->r_offset,
+ ((info->shared && info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR)
+ || (!info->shared && info->unresolved_syms_in_objects == RM_GENERATE_ERROR)
+ || ELF_ST_VISIBILITY (h->other))))
return FALSE;
relocation = 0;
}
@@ -6011,7 +6014,7 @@ sh_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info,
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-sh_elf_copy_indirect_symbol (struct elf_backend_data *bed,
+sh_elf_copy_indirect_symbol (const struct elf_backend_data *bed,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c
index 267854867a9..396fedfad43 100644
--- a/bfd/elf32-sh64.c
+++ b/bfd/elf32-sh64.c
@@ -410,7 +410,7 @@ sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
{
/* No previous datalabel symbol. Make one. */
struct bfd_link_hash_entry *bh = NULL;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name,
flags, *secp, *valp,
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index c18edda6633..50d968e6734 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -68,7 +68,7 @@ static bfd_boolean create_got_section
static bfd_boolean elf32_sparc_create_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
static void elf32_sparc_copy_indirect_symbol
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
static int elf32_sparc_tls_transition
PARAMS ((struct bfd_link_info *, bfd *, int, int));
@@ -750,7 +750,7 @@ elf32_sparc_create_dynamic_sections (dynobj, info)
static void
elf32_sparc_copy_indirect_symbol (bed, dir, ind)
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_link_hash_entry *dir, *ind;
{
struct elf32_sparc_link_hash_entry *edir, *eind;
@@ -2186,42 +2186,12 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ bfd_boolean warned ATTRIBUTE_UNUSED;
- relocation = 0;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- if (sec->output_section == NULL)
- /* Set a flag that will be cleared later if we find a
- relocation value for this symbol. output_section
- is typically NULL for symbols satisfied by a shared
- library. */
- unresolved_reloc = TRUE;
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- ;
- else if (!info->executable
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- ;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- }
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation, sec,
+ unresolved_reloc, info,
+ warned);
}
switch (r_type)
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 8437c3ddec9..0dc6542b2d6 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -1877,6 +1877,9 @@ v850_elf_object_p (abfd)
case E_V850E_ARCH:
bfd_default_set_arch_mach (abfd, bfd_arch_v850, bfd_mach_v850e);
break;
+ case E_V850E1_ARCH:
+ bfd_default_set_arch_mach (abfd, bfd_arch_v850, bfd_mach_v850e1);
+ break;
}
return TRUE;
}
@@ -1895,6 +1898,7 @@ v850_elf_final_write_processing (abfd, linker)
default:
case bfd_mach_v850: val = E_V850_ARCH; break;
case bfd_mach_v850e: val = E_V850E_ARCH; break;
+ case bfd_mach_v850e1: val = E_V850E1_ARCH; break;
}
elf_elfheader (abfd)->e_flags &=~ EF_V850_ARCH;
@@ -1960,8 +1964,24 @@ v850_elf_merge_private_bfd_data (ibfd, obfd)
if ((in_flags & EF_V850_ARCH) != (out_flags & EF_V850_ARCH)
&& (in_flags & EF_V850_ARCH) != E_V850_ARCH)
- _bfd_error_handler (_("%s: Architecture mismatch with previous modules"),
- bfd_archive_filename (ibfd));
+ {
+ /* Allow v850e1 binaries to be linked with v850e binaries.
+ Set the output binary to v850e. */
+ if ((in_flags & EF_V850_ARCH) == E_V850E1_ARCH
+ && (out_flags & EF_V850_ARCH) == E_V850E_ARCH)
+ return TRUE;
+
+ if ((in_flags & EF_V850_ARCH) == E_V850E_ARCH
+ && (out_flags & EF_V850_ARCH) == E_V850E1_ARCH)
+ {
+ elf_elfheader (obfd)->e_flags =
+ ((out_flags & ~ EF_V850_ARCH) | E_V850E_ARCH);
+ return TRUE;
+ }
+
+ _bfd_error_handler (_("%s: Architecture mismatch with previous modules"),
+ bfd_archive_filename (ibfd));
+ }
return TRUE;
}
@@ -1987,6 +2007,7 @@ v850_elf_print_private_bfd_data (abfd, ptr)
default:
case E_V850_ARCH: fprintf (file, _("v850 architecture")); break;
case E_V850E_ARCH: fprintf (file, _("v850e architecture")); break;
+ case E_V850E1_ARCH: fprintf (file, _("v850e1 architecture")); break;
}
fputc ('\n', file);
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index 3ad97478856..7d78e0ff3bd 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -1487,15 +1487,17 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- if (h->root.type == bfd_link_hash_defined
+ bfd_boolean unresolved_reloc;
+ bfd_boolean warned;
+
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation, sec,
+ unresolved_reloc, info,
+ warned);
+
+ if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- if ((r_type == R_VAX_PLT32
+ && ((r_type == R_VAX_PLT32
&& h->plt.offset != (bfd_vma) -1
&& elf_hash_table (info)->dynamic_sections_created)
|| (r_type == R_VAX_GOT32
@@ -1524,34 +1526,11 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
|| r_type == R_VAX_32
|| r_type == R_VAX_PC8
|| r_type == R_VAX_PC16
- || r_type == R_VAX_PC32)))
- {
- /* In these cases, we don't need the relocation
- value. We check specially because in some
- obscure cases sec->output_section will be NULL. */
- relocation = 0;
- }
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
+ || r_type == R_VAX_PC32))))
+ /* In these cases, we don't need the relocation
+ value. We check specially because in some
+ obscure cases sec->output_section will be NULL. */
relocation = 0;
- else if (info->shared
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- relocation = 0;
- else
- {
- if (!(info->callbacks->undefined_symbol
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- relocation = 0;
- }
}
switch (r_type)
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 3322c9efd68..251c3323959 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -48,7 +48,7 @@ static bfd_boolean elf_xtensa_check_relocs
static void elf_xtensa_hide_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
static void elf_xtensa_copy_indirect_symbol
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
static asection *elf_xtensa_gc_mark_hook
PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
@@ -799,7 +799,7 @@ elf_xtensa_hide_symbol (info, h, force_local)
static void
elf_xtensa_copy_indirect_symbol (bed, dir, ind)
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_link_hash_entry *dir, *ind;
{
_bfd_elf_link_hash_copy_indirect (bed, dir, ind);
@@ -2009,45 +2009,15 @@ elf_xtensa_relocate_section (output_bfd, info, input_bfd,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- relocation = 0;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
-
- if (sec->output_section == NULL)
- /* Set a flag that will be cleared later if we find a
- relocation value for this symbol. output_section
- is typically NULL for symbols satisfied by a shared
- library. */
- unresolved_reloc = TRUE;
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation, sec,
+ unresolved_reloc, info,
+ warned);
+
+ if (relocation == 0
+ && !unresolved_reloc
+ && h->root.type == bfd_link_hash_undefweak)
is_weak_undef = TRUE;
- else if (info->shared
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- ;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- warned = TRUE;
- }
}
if (relaxing_section)
@@ -3575,6 +3545,7 @@ hash_literal_value (src)
const literal_value *src;
{
unsigned hash_val;
+
if (r_reloc_is_const (&src->r_rel))
return hash_bfd_vma (src->value);
@@ -3583,9 +3554,9 @@ hash_literal_value (src)
/* Now check for the same section and the same elf_hash. */
if (r_reloc_is_defined (&src->r_rel))
- hash_val += hash_bfd_vma ((bfd_vma) r_reloc_get_section (&src->r_rel));
+ hash_val += hash_bfd_vma ((bfd_vma) (unsigned) r_reloc_get_section (&src->r_rel));
else
- hash_val += hash_bfd_vma ((bfd_vma) r_reloc_get_hash_entry (&src->r_rel));
+ hash_val += hash_bfd_vma ((bfd_vma) (unsigned) r_reloc_get_hash_entry (&src->r_rel));
return hash_val;
}
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 1d35a6d5d01..0b64bd310f8 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -3074,7 +3074,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
this may help reduce memory usage and processing time later. */
maybe_dynamic = FALSE;
if (h && ((info->shared
- && (!info->symbolic || info->allow_shlib_undefined))
+ && (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE))
|| ! (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|| h->root.root.type == bfd_link_hash_defweak))
maybe_dynamic = TRUE;
@@ -4445,48 +4445,25 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = alpha_elf_sym_hashes (input_bfd)[r_symndx - symtab_hdr->sh_info];
-
- while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
- h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
+ bfd_boolean warned;
+ bfd_boolean unresolved_reloc;
+ struct elf_link_hash_entry *hh;
+
+ RELOC_FOR_GLOBAL_SYMBOL (hh,
+ (struct elf_link_hash_entry *) alpha_elf_sym_hashes (input_bfd),
+ r_symndx, symtab_hdr, value,
+ sec, unresolved_reloc, info,
+ warned);
+
+ if (warned)
+ continue;
- value = 0;
- if (h->root.root.type == bfd_link_hash_defined
- || h->root.root.type == bfd_link_hash_defweak)
- {
- sec = h->root.root.u.def.section;
-
- /* Detect the cases that sym_sec->output_section is
- expected to be NULL -- all cases in which the symbol
- is defined in another shared module. This includes
- PLT relocs for which we've created a PLT entry and
- other relocs for which we're prepared to create
- dynamic relocations. */
- /* ??? Just accept it NULL and continue. */
-
- if (sec->output_section != NULL)
- value = (h->root.root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.root.type == bfd_link_hash_undefweak)
+ if (value == 0
+ && ! unresolved_reloc
+ && hh->root.type == bfd_link_hash_undefweak)
undef_weak_ref = TRUE;
- else if (!info->executable
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
- ;
- else
- {
- if (!((*info->callbacks->undefined_symbol)
- (info, h->root.root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->root.other)))))
- return FALSE;
- continue;
- }
+ h = (struct alpha_elf_link_hash_entry *) hh;
dynamic_symbol_p = alpha_elf_dynamic_symbol_p (&h->root, info);
gotent = h->got_entries;
}
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index f3398c15030..88403f5221c 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -380,7 +380,10 @@ elf64_hppa_object_p (abfd)
i_ehdrp = elf_elfheader (abfd);
if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0)
{
- if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX)
+ /* GCC on hppa-linux produces binaries with OSABI=Linux,
+ but the kernel produces corefiles with OSABI=SysV. */
+ if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX &&
+ i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
return FALSE;
}
else
@@ -710,13 +713,14 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
relend = relocs + sec->reloc_count;
for (rel = relocs; rel < relend; ++rel)
{
- enum {
- NEED_DLT = 1,
- NEED_PLT = 2,
- NEED_STUB = 4,
- NEED_OPD = 8,
- NEED_DYNREL = 16,
- };
+ enum
+ {
+ NEED_DLT = 1,
+ NEED_PLT = 2,
+ NEED_STUB = 4,
+ NEED_OPD = 8,
+ NEED_DYNREL = 16,
+ };
struct elf_link_hash_entry *h = NULL;
unsigned long r_symndx = ELF64_R_SYM (rel->r_info);
@@ -746,7 +750,7 @@ elf64_hppa_check_relocs (abfd, info, sec, relocs)
this may help reduce memory usage and processing time later. */
maybe_dynamic = FALSE;
if (h && ((info->shared
- && (!info->symbolic || info->allow_shlib_undefined) )
+ && (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE))
|| ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|| h->root.type == bfd_link_hash_defweak))
maybe_dynamic = TRUE;
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index bec1acaa1c3..3a874d898e8 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -2100,7 +2100,7 @@ mips_elf64_canonicalize_reloc (abfd, section, relptr, symbols)
{
arelent *tblptr;
unsigned int i;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (! bed->s->slurp_reloc_table (abfd, section, symbols, FALSE))
return -1;
@@ -2899,6 +2899,8 @@ const struct elf_size_info mips_elf64_size_info =
#define elf_backend_modify_segment_map _bfd_mips_elf_modify_segment_map
#define elf_backend_gc_mark_hook _bfd_mips_elf_gc_mark_hook
#define elf_backend_gc_sweep_hook _bfd_mips_elf_gc_sweep_hook
+#define elf_backend_copy_indirect_symbol \
+ _bfd_mips_elf_copy_indirect_symbol
#define elf_backend_hide_symbol _bfd_mips_elf_hide_symbol
#define elf_backend_ignore_discarded_relocs \
_bfd_mips_elf_ignore_discarded_relocs
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 50cb5d878a9..2042e6ae323 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -28,7 +28,6 @@
#include "bfdlink.h"
#include "libbfd.h"
#include "elf-bfd.h"
-#include "elf/ppc.h"
#include "elf/ppc64.h"
#include "elf64-ppc.h"
@@ -3036,7 +3035,7 @@ ppc_stub_name (const asection *input_section,
stub_name = bfd_malloc (len);
if (stub_name != NULL)
{
- sprintf (stub_name, "%08x_%s+%x",
+ sprintf (stub_name, "%08x.%s+%x",
input_section->id & 0xffffffff,
h->elf.root.root.string,
(int) rel->r_addend & 0xffffffff);
@@ -3048,7 +3047,7 @@ ppc_stub_name (const asection *input_section,
stub_name = bfd_malloc (len);
if (stub_name != NULL)
{
- sprintf (stub_name, "%08x_%x:%x+%x",
+ sprintf (stub_name, "%08x.%x:%x+%x",
input_section->id & 0xffffffff,
sym_sec->id & 0xffffffff,
(int) ELF64_R_SYM (rel->r_info) & 0xffffffff,
@@ -3277,9 +3276,10 @@ ppc64_elf_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-ppc64_elf_copy_indirect_symbol (struct elf_backend_data *bed ATTRIBUTE_UNUSED,
- struct elf_link_hash_entry *dir,
- struct elf_link_hash_entry *ind)
+ppc64_elf_copy_indirect_symbol
+ (const struct elf_backend_data *bed ATTRIBUTE_UNUSED,
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
struct ppc_link_hash_entry *edir, *eind;
flagword mask;
@@ -4583,7 +4583,17 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
}
if (h->plt.plist != NULL)
- return TRUE;
+ {
+ /* We should never get here, but unfortunately there are versions
+ of gcc out there that improperly (for this ABI) put initialized
+ function pointers, vtable refs and suchlike in read-only
+ sections. Allow them to proceed, but warn that this might
+ break at runtime. */
+ (*_bfd_error_handler)
+ (_("copy reloc against `%s' requires lazy plt linking; "
+ "avoid setting LD_BIND_NOW=1 or upgrade gcc"),
+ h->root.root.string);
+ }
/* This is a reference to a symbol defined by a dynamic object which
is not a function. */
@@ -6096,8 +6106,6 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
struct ppc_branch_hash_entry *br_entry;
struct bfd_link_info *info;
struct ppc_link_hash_table *htab;
- asection *stub_sec;
- bfd *stub_bfd;
bfd_byte *loc;
bfd_byte *p;
unsigned int indx;
@@ -6110,29 +6118,10 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
info = in_arg;
htab = ppc_hash_table (info);
- stub_sec = stub_entry->stub_sec;
/* Make a note of the offset within the stubs for this entry. */
- stub_entry->stub_offset = stub_sec->_cooked_size;
- loc = stub_sec->contents + stub_entry->stub_offset;
-
- if (htab->emit_stub_syms)
- {
- struct elf_link_hash_entry *h;
- h = elf_link_hash_lookup (&htab->elf, stub_entry->root.string,
- TRUE, FALSE, FALSE);
- if (h == NULL)
- return FALSE;
- h->root.type = bfd_link_hash_defined;
- h->root.u.def.section = stub_entry->stub_sec;
- h->root.u.def.value = stub_entry->stub_offset;
- h->elf_link_hash_flags = (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_DEF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK
- | ELF_LINK_FORCED_LOCAL);
- }
-
- stub_bfd = stub_sec->owner;
+ stub_entry->stub_offset = stub_entry->stub_sec->_cooked_size;
+ loc = stub_entry->stub_sec->contents + stub_entry->stub_offset;
htab->stub_count[stub_entry->stub_type - 1] += 1;
switch (stub_entry->stub_type)
@@ -6146,8 +6135,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
/* And this is where we are coming from. */
off -= (stub_entry->stub_offset
- + stub_sec->output_offset
- + stub_sec->output_section->vma);
+ + stub_entry->stub_sec->output_offset
+ + stub_entry->stub_sec->output_section->vma);
if (stub_entry->stub_type != ppc_stub_long_branch_r2off)
size = 4;
@@ -6157,16 +6146,16 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
r2off = (htab->stub_group[stub_entry->target_section->id].toc_off
- htab->stub_group[stub_entry->id_sec->id].toc_off);
- bfd_put_32 (stub_bfd, STD_R2_40R1, loc);
+ bfd_put_32 (htab->stub_bfd, STD_R2_40R1, loc);
loc += 4;
- bfd_put_32 (stub_bfd, ADDIS_R2_R2 | PPC_HA (r2off), loc);
+ bfd_put_32 (htab->stub_bfd, ADDIS_R2_R2 | PPC_HA (r2off), loc);
loc += 4;
- bfd_put_32 (stub_bfd, ADDI_R2_R2 | PPC_LO (r2off), loc);
+ bfd_put_32 (htab->stub_bfd, ADDI_R2_R2 | PPC_LO (r2off), loc);
loc += 4;
off -= 12;
size = 16;
}
- bfd_put_32 (stub_bfd, B_DOT | (off & 0x3fffffc), loc);
+ bfd_put_32 (htab->stub_bfd, B_DOT | (off & 0x3fffffc), loc);
BFD_ASSERT (off + (1 << 25) < (bfd_vma) (1 << 26));
break;
@@ -6227,9 +6216,9 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
indx = off;
if (stub_entry->stub_type != ppc_stub_plt_branch_r2off)
{
- bfd_put_32 (stub_bfd, ADDIS_R12_R2 | PPC_HA (indx), loc);
+ bfd_put_32 (htab->stub_bfd, ADDIS_R12_R2 | PPC_HA (indx), loc);
loc += 4;
- bfd_put_32 (stub_bfd, LD_R11_0R12 | PPC_LO (indx), loc);
+ bfd_put_32 (htab->stub_bfd, LD_R11_0R12 | PPC_LO (indx), loc);
size = 16;
}
else
@@ -6238,21 +6227,21 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
r2off = (htab->stub_group[stub_entry->target_section->id].toc_off
- htab->stub_group[stub_entry->id_sec->id].toc_off);
- bfd_put_32 (stub_bfd, STD_R2_40R1, loc);
+ bfd_put_32 (htab->stub_bfd, STD_R2_40R1, loc);
loc += 4;
- bfd_put_32 (stub_bfd, ADDIS_R12_R2 | PPC_HA (indx), loc);
+ bfd_put_32 (htab->stub_bfd, ADDIS_R12_R2 | PPC_HA (indx), loc);
loc += 4;
- bfd_put_32 (stub_bfd, LD_R11_0R12 | PPC_LO (indx), loc);
+ bfd_put_32 (htab->stub_bfd, LD_R11_0R12 | PPC_LO (indx), loc);
loc += 4;
- bfd_put_32 (stub_bfd, ADDIS_R2_R2 | PPC_HA (r2off), loc);
+ bfd_put_32 (htab->stub_bfd, ADDIS_R2_R2 | PPC_HA (r2off), loc);
loc += 4;
- bfd_put_32 (stub_bfd, ADDI_R2_R2 | PPC_LO (r2off), loc);
+ bfd_put_32 (htab->stub_bfd, ADDI_R2_R2 | PPC_LO (r2off), loc);
size = 28;
}
loc += 4;
- bfd_put_32 (stub_bfd, MTCTR_R11, loc);
+ bfd_put_32 (htab->stub_bfd, MTCTR_R11, loc);
loc += 4;
- bfd_put_32 (stub_bfd, BCTR, loc);
+ bfd_put_32 (htab->stub_bfd, BCTR, loc);
break;
case ppc_stub_plt_call:
@@ -6299,7 +6288,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
return FALSE;
}
- p = build_plt_stub (stub_bfd, loc, off);
+ p = build_plt_stub (htab->stub_bfd, loc, off);
size = p - loc;
break;
@@ -6308,7 +6297,31 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg)
return FALSE;
}
- stub_sec->_cooked_size += size;
+ stub_entry->stub_sec->_cooked_size += size;
+
+ if (htab->emit_stub_syms
+ && !(stub_entry->stub_type == ppc_stub_plt_call
+ && stub_entry->h->oh->root.type == bfd_link_hash_defined
+ && stub_entry->h->oh->root.u.def.section == stub_entry->stub_sec
+ && stub_entry->h->oh->root.u.def.value == stub_entry->stub_offset))
+ {
+ struct elf_link_hash_entry *h;
+ h = elf_link_hash_lookup (&htab->elf, stub_entry->root.string,
+ TRUE, FALSE, FALSE);
+ if (h == NULL)
+ return FALSE;
+ if (h->root.type == bfd_link_hash_new)
+ {
+ h->root.type = bfd_link_hash_defined;
+ h->root.u.def.section = stub_entry->stub_sec;
+ h->root.u.def.value = stub_entry->stub_offset;
+ h->elf_link_hash_flags = (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_DEF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK
+ | ELF_LINK_FORCED_LOCAL);
+ }
+ }
+
return TRUE;
}
@@ -6594,7 +6607,8 @@ ppc64_elf_next_input_section (struct bfd_link_info *info, asection *isec)
/* If a code section has a function that uses the TOC then we need
to use the right TOC (obviously). Also, make sure that .opd gets
- the correct TOC value. */
+ the correct TOC value for R_PPC64_TOC relocs that don't have or
+ can't find their function symbol (shouldn't ever happen now). */
if (isec->has_gp_reloc || (isec->flags & SEC_CODE) == 0)
{
if (elf_gp (isec->owner) != 0)
@@ -7094,6 +7108,23 @@ ppc64_elf_build_stubs (bfd_boolean emit_stub_syms,
return FALSE;
}
+ if (htab->emit_stub_syms)
+ {
+ struct elf_link_hash_entry *h;
+ h = elf_link_hash_lookup (&htab->elf, "__glink", TRUE, FALSE, FALSE);
+ if (h == NULL)
+ return FALSE;
+ if (h->root.type == bfd_link_hash_new)
+ {
+ h->root.type = bfd_link_hash_defined;
+ h->root.u.def.section = htab->glink;
+ h->root.u.def.value = 0;
+ h->elf_link_hash_flags = (ELF_LINK_HASH_REF_REGULAR
+ | ELF_LINK_HASH_DEF_REGULAR
+ | ELF_LINK_HASH_REF_REGULAR_NONWEAK
+ | ELF_LINK_FORCED_LOCAL);
+ }
+ }
p = htab->glink->contents;
bfd_put_32 (htab->glink->owner, MFCTR_R12, p);
p += 4;
@@ -7296,6 +7327,16 @@ ppc64_elf_relocate_section (bfd *output_bfd,
r_type = ELF64_R_TYPE (rel->r_info);
r_symndx = ELF64_R_SYM (rel->r_info);
+
+ /* For old style R_PPC64_TOC relocs with a zero symbol, use the
+ symbol of the previous ADDR64 reloc. The symbol gives us the
+ proper TOC base to use. */
+ if (rel->r_info == ELF64_R_INFO (0, R_PPC64_TOC)
+ && rel != relocs
+ && ELF64_R_TYPE (rel[-1].r_info) == R_PPC64_ADDR64
+ && is_opd)
+ r_symndx = ELF64_R_SYM (rel[-1].r_info);
+
sym = NULL;
sec = NULL;
h = NULL;
@@ -7321,44 +7362,11 @@ ppc64_elf_relocate_section (bfd *output_bfd,
}
else
{
- /* It's a global symbol. */
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation, sec,
+ unresolved_reloc, info,
+ warned);
sym_name = h->root.root.string;
- relocation = 0;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- if (sec->output_section == NULL)
- /* Set a flag that will be cleared later if we find a
- relocation value for this symbol. output_section
- is typically NULL for symbols satisfied by a shared
- library. */
- unresolved_reloc = TRUE;
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- ;
- else if (!info->executable
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- ;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd, input_section,
- rel->r_offset, (!info->shared
- || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- warned = TRUE;
- }
}
/* TLS optimizations. Replace instruction sequences and relocs
@@ -7757,6 +7765,13 @@ ppc64_elf_relocate_section (bfd *output_bfd,
if ((insn & 1) == 0)
can_plt_call = 1;
}
+ else if (h != NULL
+ && strcmp (h->root.root.string,
+ ".__libc_start_main") == 0)
+ {
+ /* Allow crt1 branch to go via a toc adjusting stub. */
+ can_plt_call = 1;
+ }
else
{
if (strcmp (input_section->output_section->name,
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 62ef221392c..de712f77e3b 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -40,7 +40,7 @@ static bfd_boolean create_got_section
static bfd_boolean elf_s390_create_dynamic_sections
PARAMS((bfd *, struct bfd_link_info *));
static void elf_s390_copy_indirect_symbol
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
static bfd_boolean elf_s390_check_relocs
PARAMS ((bfd *, struct bfd_link_info *, asection *,
@@ -809,7 +809,7 @@ elf_s390_create_dynamic_sections (dynobj, info)
static void
elf_s390_copy_indirect_symbol (bed, dir, ind)
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_link_hash_entry *dir, *ind;
{
struct elf_s390_link_hash_entry *edir, *eind;
@@ -2301,45 +2301,12 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ bfd_boolean warned ATTRIBUTE_UNUSED;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- if (sec->output_section == NULL)
- {
- /* Set a flag that will be cleared later if we find a
- relocation value for this symbol. output_section
- is typically NULL for symbols satisfied by a shared
- library. */
- unresolved_reloc = TRUE;
- relocation = 0;
- }
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- relocation = 0;
- else if (!info->executable
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- relocation = 0;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- relocation = 0;
- }
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation, sec,
+ unresolved_reloc, info,
+ warned);
}
switch (r_type)
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index 905caddb290..e0bc8df7e5d 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -1610,6 +1610,8 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
}
else
{
+ /* ??? Could we use the RELOC_FOR_GLOBAL_SYMBOL macro here ? */
+
/* Section symbols are never (?) placed in the hash table, so
we can just ignore hash relocations when creating a
relocatable object file. */
@@ -1699,7 +1701,9 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared
+ && !info->symbolic
+ && info->unresolved_syms_in_objects == RM_IGNORE)
relocation = 0;
else
{
@@ -2917,7 +2921,7 @@ sh64_elf64_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
{
/* No previous datalabel symbol. Make one. */
struct bfd_link_hash_entry *bh = NULL;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name,
flags, *secp, *valp,
@@ -3238,7 +3242,7 @@ sh64_elf64_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
{
flagword flags, pltflags;
register asection *s;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
int ptralign = 0;
switch (bed->s->arch_size)
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index 13f6a5501a4..a74a7f339c0 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -518,7 +518,7 @@ sparc64_elf_canonicalize_reloc (abfd, section, relptr, symbols)
{
arelent *tblptr;
unsigned int i;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (! bed->s->slurp_reloc_table (abfd, section, symbols, FALSE))
return -1;
@@ -2074,42 +2074,14 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ bfd_boolean warned;
- relocation = 0;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation, sec,
+ unresolved_reloc, info,
+ warned);
+ if (warned)
{
- sec = h->root.u.def.section;
- if (sec->output_section == NULL)
- /* Set a flag that will be cleared later if we find a
- relocation value for this symbol. output_section
- is typically NULL for symbols satisfied by a shared
- library. */
- unresolved_reloc = TRUE;
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- ;
- else if (!info->executable
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- ;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
-
/* To avoid generating warning messages about truncated
relocations, set the relocation's address to be the same as
the start of this section. */
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 09a072b5b8e..8aed4982337 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -501,7 +501,7 @@ elf64_x86_64_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
/* Copy the extra info we tack onto an elf_link_hash_entry. */
static void
-elf64_x86_64_copy_indirect_symbol (struct elf_backend_data *bed,
+elf64_x86_64_copy_indirect_symbol (const struct elf_backend_data *bed,
struct elf_link_hash_entry *dir,
struct elf_link_hash_entry *ind)
{
@@ -1827,45 +1827,12 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
}
else
{
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ bfd_boolean warned;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sec = h->root.u.def.section;
- if (sec->output_section == NULL)
- {
- /* Set a flag that will be cleared later if we find a
- relocation value for this symbol. output_section
- is typically NULL for symbols satisfied by a shared
- library. */
- unresolved_reloc = TRUE;
- relocation = 0;
- }
- else
- relocation = (h->root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- }
- else if (h->root.type == bfd_link_hash_undefweak)
- relocation = 0;
- else if (!info->executable
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- relocation = 0;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- relocation = 0;
- }
+ RELOC_FOR_GLOBAL_SYMBOL (h, sym_hashes, r_symndx,
+ symtab_hdr, relocation, sec,
+ unresolved_reloc, info,
+ warned);
}
/* When generating a shared object, the relocations handled here are
copied into the output file to be resolved at run time. */
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 601d208d9c7..a627e4854f2 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -492,7 +492,7 @@ elf_object_p (bfd *abfd)
Elf_Internal_Shdr *i_shdrp; /* Section header table, internal form */
unsigned int shindex;
char *shstrtab; /* Internal copy of section header stringtab */
- struct elf_backend_data *ebd;
+ const struct elf_backend_data *ebd;
struct bfd_preserve preserve;
asection *s;
bfd_size_type amt;
@@ -591,11 +591,11 @@ elf_object_p (bfd *abfd)
for which we do not have a specific backend. */
for (target_ptr = bfd_target_vector; *target_ptr != NULL; target_ptr++)
{
- struct elf_backend_data *back;
+ const struct elf_backend_data *back;
if ((*target_ptr)->flavour != bfd_target_elf_flavour)
continue;
- back = (struct elf_backend_data *) (*target_ptr)->backend_data;
+ back = (const struct elf_backend_data *) (*target_ptr)->backend_data;
if (back->elf_machine_code == i_ehdrp->e_machine
|| (back->elf_machine_alt1 != 0
&& back->elf_machine_alt1 == i_ehdrp->e_machine)
@@ -818,7 +818,7 @@ elf_write_relocs (bfd *abfd, asection *sec, void *data)
bfd_boolean *failedp = data;
Elf_Internal_Shdr *rela_hdr;
bfd_vma addr_offset;
- void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
+ void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
size_t extsize;
bfd_byte *dst_rela;
unsigned int idx;
@@ -1008,7 +1008,7 @@ elf_slurp_symbol_table (bfd *abfd, asymbol **symptrs, bfd_boolean dynamic)
Elf_Internal_Sym *isymbuf = NULL;
Elf_External_Versym *xver;
Elf_External_Versym *xverbuf = NULL;
- struct elf_backend_data *ebd;
+ const struct elf_backend_data *ebd;
bfd_size_type amt;
/* Read each raw ELF symbol, converting from external ELF form to
@@ -1238,7 +1238,7 @@ elf_slurp_reloc_table_from_section (bfd *abfd,
asymbol **symbols,
bfd_boolean dynamic)
{
- struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
+ const struct elf_backend_data * const ebd = get_elf_backend_data (abfd);
void *allocated = NULL;
bfd_byte *native_relocs;
arelent *relent;
diff --git a/bfd/elfcore.h b/bfd/elfcore.h
index 865edcd0650..81c4cff1139 100644
--- a/bfd/elfcore.h
+++ b/bfd/elfcore.h
@@ -76,7 +76,7 @@ elf_core_file_p (bfd *abfd)
Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form. */
Elf_Internal_Phdr *i_phdrp; /* Elf program header, internal form. */
unsigned int phindex;
- struct elf_backend_data *ebd;
+ const struct elf_backend_data *ebd;
struct bfd_preserve preserve;
bfd_size_type amt;
@@ -153,11 +153,11 @@ elf_core_file_p (bfd *abfd)
for (target_ptr = bfd_target_vector; *target_ptr != NULL; target_ptr++)
{
- struct elf_backend_data *back;
+ const struct elf_backend_data *back;
if ((*target_ptr)->flavour != bfd_target_elf_flavour)
continue;
- back = (struct elf_backend_data *) (*target_ptr)->backend_data;
+ back = (const struct elf_backend_data *) (*target_ptr)->backend_data;
if (back->elf_machine_code == i_ehdrp->e_machine
|| (back->elf_machine_alt1 != 0
&& i_ehdrp->e_machine == back->elf_machine_alt1)
diff --git a/bfd/elflink.c b/bfd/elflink.c
index cb6b0b2ba1f..d53571d448a 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -32,7 +32,7 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
asection *s;
struct elf_link_hash_entry *h;
struct bfd_link_hash_entry *bh;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
int ptralign;
/* This function may be called more than once. */
@@ -115,7 +115,7 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
register asection *s;
struct elf_link_hash_entry *h;
struct bfd_link_hash_entry *bh;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
if (! is_elf_hash_table (info))
return FALSE;
@@ -248,7 +248,7 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
{
flagword flags, pltflags;
asection *s;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
/* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
.rel[a].bss sections. */
@@ -309,7 +309,7 @@ _bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
section into the .bss section of the final image. */
s = bfd_make_section (abfd, ".dynbss");
if (s == NULL
- || ! bfd_set_section_flags (abfd, s, SEC_ALLOC))
+ || ! bfd_set_section_flags (abfd, s, SEC_ALLOC | SEC_LINKER_CREATED))
return FALSE;
/* The .rel[a].bss section holds copy relocs. This section is not
@@ -1164,7 +1164,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
/* Handle the case where we had a versioned symbol in a dynamic
library and now find a definition in a normal object. In this
case, we make the versioned symbol point to the normal one. */
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
flip->root.type = h->root.type;
h->root.type = bfd_link_hash_indirect;
h->root.u.i.link = (struct bfd_link_hash_entry *) flip;
@@ -1247,7 +1247,7 @@ _bfd_elf_add_default_symbol (bfd *abfd,
char *shortname;
struct elf_link_hash_entry *hi;
struct bfd_link_hash_entry *bh;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bfd_boolean collect;
bfd_boolean dynamic;
char *p;
@@ -1621,7 +1621,7 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data)
{
struct elf_assign_sym_version_info *sinfo;
struct bfd_link_info *info;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_info_failed eif;
char *p;
bfd_size_type amt;
@@ -1879,7 +1879,7 @@ elf_link_read_relocs_from_section (bfd *abfd,
void *external_relocs,
Elf_Internal_Rela *internal_relocs)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *);
const bfd_byte *erela;
const bfd_byte *erelaend;
@@ -1943,7 +1943,7 @@ _bfd_elf_link_read_relocs (bfd *abfd,
Elf_Internal_Shdr *rel_hdr;
void *alloc1 = NULL;
Elf_Internal_Rela *alloc2 = NULL;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
if (elf_section_data (o)->relocs != NULL)
return elf_section_data (o)->relocs;
@@ -2076,7 +2076,7 @@ _bfd_elf_link_output_relocs (bfd *output_bfd,
Elf_Internal_Shdr *output_rel_hdr;
asection *output_section;
unsigned int *rel_countp = NULL;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
output_section = input_section->output_section;
@@ -2223,7 +2223,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
|| ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bfd_boolean force_local;
bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
@@ -2238,7 +2238,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
&& h->root.type == bfd_link_hash_undefweak)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
(*bed->elf_backend_hide_symbol) (eif->info, h, TRUE);
}
@@ -2267,7 +2267,7 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h,
h->weakdef = NULL;
else
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
(*bed->elf_backend_copy_indirect_symbol) (bed, weakdef, h);
@@ -2286,7 +2286,7 @@ _bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data)
{
struct elf_info_failed *eif = data;
bfd *dynobj;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
if (! is_elf_hash_table (eif->info))
return FALSE;
diff --git a/bfd/elflink.h b/bfd/elflink.h
index c0b2468b7d8..48b86cf36f1 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -415,7 +415,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
Elf_Internal_Sym *isymbuf = NULL;
Elf_Internal_Sym *isym;
Elf_Internal_Sym *isymend;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bfd_boolean dt_needed;
struct elf_link_hash_table * hash_table;
bfd_size_type amt;
@@ -1186,7 +1186,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
bfd *common_bfd;
symbol_align = ffs (h->root.u.def.value) - 1;
- if ((h->root.u.def.section->owner->flags & DYNAMIC) == 0)
+ if (h->root.u.def.section->owner != NULL
+ && (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
{
normal_align = h->root.u.def.section->alignment_power;
if (normal_align > symbol_align)
@@ -1888,7 +1889,7 @@ NAME(bfd_elf,size_dynamic_sections) (bfd *output_bfd,
{
bfd_size_type soname_indx;
bfd *dynobj;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_assign_sym_version_info asvinfo;
*sinterpptr = NULL;
@@ -2859,7 +2860,7 @@ elf_link_adjust_relocs (bfd *abfd,
struct elf_link_hash_entry **rel_hash)
{
unsigned int i;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_byte *erela;
void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *);
void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
@@ -2964,7 +2965,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec)
size_t i, ret, sort_elt, ext_size;
bfd_byte *sort, *s_non_relative, *p;
struct elf_link_sort_rela *sq;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
int i2e = bed->s->int_rels_per_ext_rel;
void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *);
void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
@@ -3096,7 +3097,7 @@ elf_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Shdr *symtab_shndx_hdr;
Elf_Internal_Shdr *symstrtab_hdr;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
struct elf_outext_info eoinfo;
bfd_boolean merged;
size_t relativecount = 0;
@@ -4363,24 +4364,19 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
return TRUE;
}
- /* If we are not creating a shared library, and this symbol is
- referenced by a shared library but is not defined anywhere, then
- warn that it is undefined. If we do not do this, the runtime
- linker will complain that the symbol is undefined when the
- program is run. We don't have to worry about symbols that are
- referenced by regular files, because we will already have issued
- warnings for them. */
- if (! finfo->info->relocatable
- && (finfo->info->executable
- || ! finfo->info->allow_shlib_undefined)
- && h->root.type == bfd_link_hash_undefined
+ /* If we have an undefined symbol reference here then it must have
+ come from a shared library that is being linked in. (Undefined
+ references in regular files have already been handled). If we
+ are reporting errors for this situation then do so now. */
+ if (h->root.type == bfd_link_hash_undefined
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
&& (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
- && ! elf_link_check_versioned_symbol (finfo->info, h))
+ && ! elf_link_check_versioned_symbol (finfo->info, h)
+ && finfo->info->unresolved_syms_in_shared_libs != RM_IGNORE)
{
if (! ((*finfo->info->callbacks->undefined_symbol)
(finfo->info, h->root.root.string, h->root.u.undef.abfd,
- NULL, 0, TRUE)))
+ NULL, 0, finfo->info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR)))
{
eoinfo->failed = TRUE;
return FALSE;
@@ -4390,10 +4386,9 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
/* We should also warn if a forced local symbol is referenced from
shared libraries. */
if (! finfo->info->relocatable
- && (! finfo->info->shared || ! finfo->info->allow_shlib_undefined)
+ && (! finfo->info->shared)
&& (h->elf_link_hash_flags
- & (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC
- | ELF_LINK_DYNAMIC_DEF | ELF_LINK_DYNAMIC_WEAK))
+ & (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_DYNAMIC_DEF | ELF_LINK_DYNAMIC_WEAK))
== (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC)
&& ! elf_link_check_versioned_symbol (finfo->info, h))
{
@@ -4541,7 +4536,7 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
&& elf_hash_table (finfo->info)->dynamic_sections_created)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bed = get_elf_backend_data (finfo->output_bfd);
if (! ((*bed->elf_backend_finish_dynamic_symbol)
@@ -4687,7 +4682,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
long *pindex;
asection **ppsection;
asection *o;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bfd_boolean emit_relocs;
struct elf_link_hash_entry **sym_hashes;
@@ -5321,7 +5316,7 @@ elf_reloc_link_order (bfd *output_bfd,
bfd_vma addend;
struct elf_link_hash_entry **rel_hash_ptr;
Elf_Internal_Shdr *rel_hdr;
- struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
Elf_Internal_Rela irel[MAX_INT_RELS_PER_EXT_REL];
bfd_byte *erel;
unsigned int i;
@@ -5509,7 +5504,7 @@ elf_gc_mark (struct bfd_link_info *info,
size_t nlocsyms;
size_t extsymoff;
bfd *input_bfd = sec->owner;
- struct elf_backend_data *bed = get_elf_backend_data (input_bfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (input_bfd);
Elf_Internal_Sym *isym = NULL;
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
@@ -5727,10 +5722,11 @@ elf_gc_propagate_vtable_entries_used (struct elf_link_hash_entry *h, void *okp)
pu = h->vtable_parent->vtable_entries_used;
if (pu != NULL)
{
- asection *sec = h->root.u.def.section;
- struct elf_backend_data *bed = get_elf_backend_data (sec->owner);
- unsigned int log_file_align = bed->s->log_file_align;
+ const struct elf_backend_data *bed;
+ unsigned int log_file_align;
+ bed = get_elf_backend_data (h->root.u.def.section->owner);
+ log_file_align = bed->s->log_file_align;
n = h->vtable_parent->vtable_entries_size >> log_file_align;
while (n--)
{
@@ -5751,7 +5747,7 @@ elf_gc_smash_unused_vtentry_relocs (struct elf_link_hash_entry *h, void *okp)
asection *sec;
bfd_vma hstart, hend;
Elf_Internal_Rela *relstart, *relend, *rel;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
unsigned int log_file_align;
if (h->root.type == bfd_link_hash_warning)
@@ -5914,7 +5910,7 @@ elf_gc_record_vtentry (bfd *abfd ATTRIBUTE_UNUSED,
struct elf_link_hash_entry *h,
bfd_vma addend)
{
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
unsigned int log_file_align = bed->s->log_file_align;
if (addend >= h->vtable_entries_size)
@@ -5980,7 +5976,7 @@ elf_gc_common_finalize_got_offsets (bfd *abfd,
struct bfd_link_info *info)
{
bfd *i;
- struct elf_backend_data *bed = get_elf_backend_data (abfd);
+ const struct elf_backend_data *bed = get_elf_backend_data (abfd);
bfd_vma gotoff;
/* The GOT offset is relative to the .got section, but the GOT header is
@@ -6183,7 +6179,7 @@ elf_bfd_discard_info (bfd *output_bfd, struct bfd_link_info *info)
struct elf_reloc_cookie cookie;
asection *stab, *eh;
Elf_Internal_Shdr *symtab_hdr;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bfd *abfd;
unsigned int count;
bfd_boolean ret = FALSE;
@@ -6316,7 +6312,7 @@ elf_bfd_discard_info (bfd *output_bfd, struct bfd_link_info *info)
static bfd_boolean
elf_section_ignore_discarded_relocs (asection *sec)
{
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
switch (sec->sec_info_type)
{
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 27ffdddeaec..47f457594d5 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -211,7 +211,7 @@ static struct bfd_hash_entry *elfNN_ia64_new_elf_hash_entry
PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table,
const char *string));
static void elfNN_ia64_hash_copy_indirect
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
static void elfNN_ia64_hash_hide_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
@@ -1589,7 +1589,7 @@ elfNN_ia64_new_elf_hash_entry (entry, table, string)
static void
elfNN_ia64_hash_copy_indirect (bed, xdir, xind)
- struct elf_backend_data *bed ATTRIBUTE_UNUSED;
+ const struct elf_backend_data *bed ATTRIBUTE_UNUSED;
struct elf_link_hash_entry *xdir, *xind;
{
struct elfNN_ia64_link_hash_entry *dir, *ind;
@@ -1781,6 +1781,8 @@ elfNN_ia64_create_dynamic_sections (abfd, info)
{
flagword flags = bfd_get_section_flags (abfd, ia64_info->got_sec);
bfd_set_section_flags (abfd, ia64_info->got_sec, SEC_SMALL_DATA | flags);
+ /* The .got section is always aligned at 8 bytes. */
+ bfd_set_section_alignment (abfd, ia64_info->got_sec, 3);
}
if (!get_pltoff (abfd, info, ia64_info))
@@ -2162,7 +2164,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs)
this may help reduce memory usage and processing time later. */
maybe_dynamic = FALSE;
if (h && ((!info->executable
- && (!info->symbolic || info->allow_shlib_undefined))
+ && (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE))
|| ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
|| h->root.type == bfd_link_hash_defweak))
maybe_dynamic = TRUE;
@@ -3852,52 +3854,19 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section,
}
else
{
- long indx;
+ bfd_boolean unresolved_reloc;
+ bfd_boolean warned;
- /* Reloc against global symbol. */
- indx = r_symndx - symtab_hdr->sh_info;
- h = elf_sym_hashes (input_bfd)[indx];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
- value = 0;
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- {
- sym_sec = h->root.u.def.section;
-
- /* Detect the cases that sym_sec->output_section is
- expected to be NULL -- all cases in which the symbol
- is defined in another shared module. This includes
- PLT relocs for which we've created a PLT entry and
- other relocs for which we're prepared to create
- dynamic relocations. */
- /* ??? Just accept it NULL and continue. */
+ RELOC_FOR_GLOBAL_SYMBOL (h, elf_sym_hashes (input_bfd),
+ r_symndx,
+ symtab_hdr, value, sym_sec,
+ unresolved_reloc, info,
+ warned);
- if (sym_sec->output_section != NULL)
- {
- value = (h->root.u.def.value
- + sym_sec->output_section->vma
- + sym_sec->output_offset);
- }
- }
- else if (h->root.type == bfd_link_hash_undefweak)
+ if (h->root.type == bfd_link_hash_undefweak)
undef_weak_ref = TRUE;
- else if (! info->executable
- && !info->no_undefined
- && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
- ;
- else
- {
- if (! ((*info->callbacks->undefined_symbol)
- (info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
- || ELF_ST_VISIBILITY (h->other)))))
- return FALSE;
- continue;
- }
+ else if (warned)
+ continue;
}
hit_addr = contents + rel->r_offset;
@@ -4779,9 +4748,9 @@ elfNN_ia64_reloc_type_class (rela)
static struct bfd_elf_special_section const elfNN_ia64_special_sections[]=
{
- { ".sbss", 0, NULL, 0,
+ { ".sbss", 5, NULL, 0,
SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
- { ".sdata", 0, NULL, 0,
+ { ".sdata", 6, NULL, 0,
SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
{ NULL, 0, NULL, 0,
0, 0 }
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 4c5496516a8..919593d1873 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -3008,6 +3008,8 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
}
else
{
+ /* ??? Could we use RELOC_FOR_GLOBAL_SYMBOL here ? */
+
/* For global symbols we look up the symbol in the hash-table. */
h = ((struct mips_elf_link_hash_entry *)
elf_sym_hashes (input_bfd) [r_symndx - extsymoff]);
@@ -3021,7 +3023,7 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
/* See if this is the special _gp_disp symbol. Note that such a
symbol must always be a global symbol. */
- if (strcmp (h->root.root.root.string, "_gp_disp") == 0
+ if (strcmp (*namep, "_gp_disp") == 0
&& ! NEWABI_P (input_bfd))
{
/* Relocations against _gp_disp are permitted only with
@@ -3054,11 +3056,11 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
addresses. */
symbol = 0;
else if (info->shared
- && !info->no_undefined
+ && info->unresolved_syms_in_objects == RM_IGNORE
&& ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
symbol = 0;
- else if (strcmp (h->root.root.root.string, "_DYNAMIC_LINK") == 0 ||
- strcmp (h->root.root.root.string, "_DYNAMIC_LINKING") == 0)
+ else if (strcmp (*namep, "_DYNAMIC_LINK") == 0 ||
+ strcmp (*namep, "_DYNAMIC_LINKING") == 0)
{
/* If this is a dynamic link, we should have created a
_DYNAMIC_LINK symbol or _DYNAMIC_LINKING(for normal mips) symbol
@@ -3075,7 +3077,8 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
input_section, relocation->r_offset,
- (!info->shared || info->no_undefined
+ ((info->shared && info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR)
+ || (!info->shared && info->unresolved_syms_in_objects == RM_GENERATE_ERROR)
|| ELF_ST_VISIBILITY (h->root.other)))))
return bfd_reloc_undefined;
symbol = 0;
@@ -4985,7 +4988,7 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
const Elf_Internal_Rela *rel_end;
asection *sgot;
asection *sreloc;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
if (info->relocatable)
return TRUE;
@@ -6171,7 +6174,7 @@ _bfd_mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
const Elf_Internal_Rela *relend;
bfd_vma addend = 0;
bfd_boolean use_saved_addend_p = FALSE;
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
bed = get_elf_backend_data (output_bfd);
relend = relocs + input_section->reloc_count * bed->s->int_rels_per_ext_rel;
@@ -7474,7 +7477,7 @@ _bfd_mips_elf_modify_segment_map (abfd)
unsigned int i, c;
struct elf_segment_map *n;
- low = 0xffffffff;
+ low = ~(bfd_vma) 0;
high = 0;
for (i = 0; i < sizeof sec_names / sizeof sec_names[0]; i++)
{
@@ -7626,7 +7629,7 @@ _bfd_mips_elf_gc_sweep_hook (abfd, info, sec, relocs)
void
_bfd_mips_elf_copy_indirect_symbol (bed, dir, ind)
- struct elf_backend_data *bed;
+ const struct elf_backend_data *bed;
struct elf_link_hash_entry *dir, *ind;
{
struct mips_elf_link_hash_entry *dirmips, *indmips;
diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h
index f6459a5de2a..71cdc07e79a 100644
--- a/bfd/elfxx-mips.h
+++ b/bfd/elfxx-mips.h
@@ -70,7 +70,7 @@ extern bfd_boolean _bfd_mips_elf_gc_sweep_hook
PARAMS ((bfd *, struct bfd_link_info *, asection *,
const Elf_Internal_Rela *));
extern void _bfd_mips_elf_copy_indirect_symbol
- PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
+ PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *,
struct elf_link_hash_entry *));
extern void _bfd_mips_elf_hide_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean));
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 9329b2b960e..544f8f36478 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -621,7 +621,7 @@ const bfd_target TARGET_BIG_SYM =
#endif
/* backend_data: */
- (PTR) &elfNN_bed
+ &elfNN_bed
};
#endif
@@ -717,6 +717,6 @@ const bfd_target TARGET_LITTLE_SYM =
#endif
/* backend_data: */
- (PTR) &elfNN_bed
+ &elfNN_bed
};
#endif
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 61c8e65771d..a428c660c8a 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -854,6 +854,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_MIPS_REL16",
"BFD_RELOC_MIPS_RELGOT",
"BFD_RELOC_MIPS_JALR",
+
"BFD_RELOC_FRV_LABEL16",
"BFD_RELOC_FRV_LABEL24",
"BFD_RELOC_FRV_LO16",
@@ -863,6 +864,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_FRV_GPREL32",
"BFD_RELOC_FRV_GPRELHI",
"BFD_RELOC_FRV_GPRELLO",
+
"BFD_RELOC_MN10300_GOTOFF24",
"BFD_RELOC_MN10300_GOT32",
"BFD_RELOC_MN10300_GOT24",
diff --git a/bfd/libhppa.h b/bfd/libhppa.h
index 52ebf51f61a..f6aa23456d3 100644
--- a/bfd/libhppa.h
+++ b/bfd/libhppa.h
@@ -1,6 +1,6 @@
/* HP PA-RISC SOM object file format: definitions internal to BFD.
- Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
- Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+ 2003 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
@@ -27,14 +27,6 @@
#define BYTES_IN_WORD 4
#define PA_PAGESIZE 0x1000
-#ifndef INLINE
-#ifdef __GNUC__
-#define INLINE inline
-#else
-#define INLINE
-#endif /* GNU C? */
-#endif /* INLINE */
-
/* The PA instruction set variants. */
enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20, pa20w = 25};
@@ -164,40 +156,38 @@ enum hppa_reloc_expr_type_alt
/* Some functions to manipulate PA instructions. */
/* Declare the functions with the unused attribute to avoid warnings. */
-static INLINE int sign_extend PARAMS ((int, int)) ATTRIBUTE_UNUSED;
-static INLINE int low_sign_extend PARAMS ((int, int)) ATTRIBUTE_UNUSED;
-static INLINE int sign_unext PARAMS ((int, int)) ATTRIBUTE_UNUSED;
-static INLINE int low_sign_unext PARAMS ((int, int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_3 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_12 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_14 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_16 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_17 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_21 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE int re_assemble_22 PARAMS ((int)) ATTRIBUTE_UNUSED;
-static INLINE bfd_signed_vma hppa_field_adjust
- PARAMS ((bfd_vma, bfd_signed_vma,
- enum hppa_reloc_field_selector_type_alt)) ATTRIBUTE_UNUSED;
-static INLINE int bfd_hppa_insn2fmt PARAMS ((bfd *, int)) ATTRIBUTE_UNUSED;
-static INLINE int hppa_rebuild_insn PARAMS ((int, int, int)) ATTRIBUTE_UNUSED;
+static inline int sign_extend (int, int) ATTRIBUTE_UNUSED;
+static inline int low_sign_extend (int, int) ATTRIBUTE_UNUSED;
+static inline int sign_unext (int, int) ATTRIBUTE_UNUSED;
+static inline int low_sign_unext (int, int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_3 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_12 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_14 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_16 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_17 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_21 (int) ATTRIBUTE_UNUSED;
+static inline int re_assemble_22 (int) ATTRIBUTE_UNUSED;
+static inline bfd_signed_vma hppa_field_adjust
+ (bfd_vma, bfd_signed_vma, enum hppa_reloc_field_selector_type_alt)
+ ATTRIBUTE_UNUSED;
+static inline int bfd_hppa_insn2fmt (bfd *, int) ATTRIBUTE_UNUSED;
+static inline int hppa_rebuild_insn (int, int, int) ATTRIBUTE_UNUSED;
/* The *sign_extend functions are used to assemble various bitfields
taken from an instruction and return the resulting immediate
value. */
-static INLINE int
-sign_extend (x, len)
- int x, len;
+static inline int
+sign_extend (int x, int len)
{
int signbit = (1 << (len - 1));
int mask = (signbit << 1) - 1;
return ((x & mask) ^ signbit) - signbit;
}
-static INLINE int
-low_sign_extend (x, len)
- int x, len;
+static inline int
+low_sign_extend (int x, int len)
{
return (x >> 1) - ((x & 1) << (len - 1));
}
@@ -207,9 +197,8 @@ low_sign_extend (x, len)
insertion into an opcode. pa-risc uses all sorts of weird bitfields
in the instruction to hold the value. */
-static INLINE int
-sign_unext (x, len)
- int x, len;
+static inline int
+sign_unext (int x, int len)
{
int len_ones;
@@ -218,9 +207,8 @@ sign_unext (x, len)
return x & len_ones;
}
-static INLINE int
-low_sign_unext (x, len)
- int x, len;
+static inline int
+low_sign_unext (int x, int len)
{
int temp;
int sign;
@@ -232,34 +220,30 @@ low_sign_unext (x, len)
return (temp << 1) | sign;
}
-static INLINE int
-re_assemble_3 (as3)
- int as3;
+static inline int
+re_assemble_3 (int as3)
{
return (( (as3 & 4) << (13-2))
| ((as3 & 3) << (13+1)));
}
-static INLINE int
-re_assemble_12 (as12)
- int as12;
+static inline int
+re_assemble_12 (int as12)
{
return (( (as12 & 0x800) >> 11)
| ((as12 & 0x400) >> (10 - 2))
| ((as12 & 0x3ff) << (1 + 2)));
}
-static INLINE int
-re_assemble_14 (as14)
- int as14;
+static inline int
+re_assemble_14 (int as14)
{
return (( (as14 & 0x1fff) << 1)
| ((as14 & 0x2000) >> 13));
}
-static INLINE int
-re_assemble_16 (as16)
- int as16;
+static inline int
+re_assemble_16 (int as16)
{
int s, t;
@@ -269,9 +253,8 @@ re_assemble_16 (as16)
return (t ^ s ^ (s >> 1)) | (s >> 15);
}
-static INLINE int
-re_assemble_17 (as17)
- int as17;
+static inline int
+re_assemble_17 (int as17)
{
return (( (as17 & 0x10000) >> 16)
| ((as17 & 0x0f800) << (16 - 11))
@@ -279,9 +262,8 @@ re_assemble_17 (as17)
| ((as17 & 0x003ff) << (1 + 2)));
}
-static INLINE int
-re_assemble_21 (as21)
- int as21;
+static inline int
+re_assemble_21 (int as21)
{
return (( (as21 & 0x100000) >> 20)
| ((as21 & 0x0ffe00) >> 8)
@@ -290,9 +272,8 @@ re_assemble_21 (as21)
| ((as21 & 0x000003) << 12));
}
-static INLINE int
-re_assemble_22 (as22)
- int as22;
+static inline int
+re_assemble_22 (int as22)
{
return (( (as22 & 0x200000) >> 21)
| ((as22 & 0x1f0000) << (21 - 16))
@@ -312,11 +293,10 @@ re_assemble_22 (as22)
This function returns sign extended values in all cases.
*/
-static INLINE bfd_signed_vma
-hppa_field_adjust (sym_val, addend, r_field)
- bfd_vma sym_val;
- bfd_signed_vma addend;
- enum hppa_reloc_field_selector_type_alt r_field;
+static inline bfd_signed_vma
+hppa_field_adjust (bfd_vma sym_val,
+ bfd_signed_vma addend,
+ enum hppa_reloc_field_selector_type_alt r_field)
{
bfd_signed_vma value;
@@ -479,10 +459,8 @@ enum hppa_opcode_type
/* Given a machine instruction, return its format. */
-static INLINE int
-bfd_hppa_insn2fmt (abfd, insn)
- bfd *abfd;
- int insn;
+static inline int
+bfd_hppa_insn2fmt (bfd *abfd, int insn)
{
enum hppa_opcode_type op = get_opcode (insn);
@@ -563,11 +541,8 @@ bfd_hppa_insn2fmt (abfd, insn)
/* Insert VALUE into INSN using R_FORMAT to determine exactly what
bits to change. */
-static INLINE int
-hppa_rebuild_insn (insn, value, r_format)
- int insn;
- int value;
- int r_format;
+static inline int
+hppa_rebuild_insn (int insn, int value, int r_format)
{
switch (r_format)
{
diff --git a/bfd/libpei.h b/bfd/libpei.h
index 72fa7b5f728..9ed9c1224e7 100644
--- a/bfd/libpei.h
+++ b/bfd/libpei.h
@@ -332,4 +332,6 @@ bfd_boolean _bfd_XX_bfd_copy_private_section_data
PARAMS ((bfd *, asection *, bfd *, asection *));
/* Macro: Returns true if the bfd is a PE executable as opposed to a PE object file. */
-#define bfd_pe_executable_p(abfd) (strncmp ((abfd)->xvec->name, "pei-", 4) == 0)
+#define bfd_pe_executable_p(abfd) \
+ (strncmp ((abfd)->xvec->name, "pei-", 4) == 0 \
+ || strncmp ((abfd)->xvec->name, "efi-app-", 8) == 0)
diff --git a/bfd/merge.c b/bfd/merge.c
index ec75a7be7e9..aa8b334cf1b 100644
--- a/bfd/merge.c
+++ b/bfd/merge.c
@@ -1,5 +1,5 @@
/* SEC_MERGE support.
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Jakub Jelinek <jakub@redhat.com>.
This file is part of BFD, the Binary File Descriptor library.
@@ -88,7 +88,7 @@ struct sec_merge_sec_info
/* The corresponding section. */
asection *sec;
/* Pointer to merge_info pointing to us. */
- PTR *psecinfo;
+ void **psecinfo;
/* A hash table used to hold section content. */
struct sec_merge_hash *htab;
/* First string in this section. */
@@ -97,35 +97,12 @@ struct sec_merge_sec_info
unsigned char contents[1];
};
-static struct bfd_hash_entry *sec_merge_hash_newfunc
- PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-static struct sec_merge_hash_entry *sec_merge_hash_lookup
- PARAMS ((struct sec_merge_hash *, const char *, unsigned int, bfd_boolean));
-static struct sec_merge_hash *sec_merge_init
- PARAMS ((unsigned int, bfd_boolean));
-static struct sec_merge_hash_entry *sec_merge_add
- PARAMS ((struct sec_merge_hash *, const char *, unsigned int,
- struct sec_merge_sec_info *));
-static bfd_boolean sec_merge_emit
- PARAMS ((bfd *, struct sec_merge_hash_entry *));
-static int cmplengthentry
- PARAMS ((const PTR, const PTR));
-static int last4_eq
- PARAMS ((const PTR, const PTR));
-static int last_eq
- PARAMS ((const PTR, const PTR));
-static bfd_boolean record_section
- PARAMS ((struct sec_merge_info *, struct sec_merge_sec_info *));
-static void merge_strings
- PARAMS ((struct sec_merge_info *));
/* Routine to create an entry in a section merge hashtab. */
static struct bfd_hash_entry *
-sec_merge_hash_newfunc (entry, table, string)
- struct bfd_hash_entry *entry;
- struct bfd_hash_table *table;
- const char *string;
+sec_merge_hash_newfunc (struct bfd_hash_entry *entry,
+ struct bfd_hash_table *table, const char *string)
{
struct sec_merge_hash_entry *ret = (struct sec_merge_hash_entry *) entry;
@@ -156,11 +133,8 @@ sec_merge_hash_newfunc (entry, table, string)
/* Look up an entry in a section merge hash table. */
static struct sec_merge_hash_entry *
-sec_merge_hash_lookup (table, string, alignment, create)
- struct sec_merge_hash *table;
- const char *string;
- unsigned int alignment;
- bfd_boolean create;
+sec_merge_hash_lookup (struct sec_merge_hash *table, const char *string,
+ unsigned int alignment, bfd_boolean create)
{
register const unsigned char *s;
register unsigned long hash;
@@ -261,9 +235,7 @@ sec_merge_hash_lookup (table, string, alignment, create)
/* Create a new hash table. */
static struct sec_merge_hash *
-sec_merge_init (entsize, strings)
- unsigned int entsize;
- bfd_boolean strings;
+sec_merge_init (unsigned int entsize, bfd_boolean strings)
{
struct sec_merge_hash *table;
bfd_size_type amt = sizeof (struct sec_merge_hash);
@@ -291,11 +263,8 @@ sec_merge_init (entsize, strings)
already present. */
static struct sec_merge_hash_entry *
-sec_merge_add (tab, str, alignment, secinfo)
- struct sec_merge_hash *tab;
- const char *str;
- unsigned int alignment;
- struct sec_merge_sec_info *secinfo;
+sec_merge_add (struct sec_merge_hash *tab, const char *str,
+ unsigned int alignment, struct sec_merge_sec_info *secinfo)
{
register struct sec_merge_hash_entry *entry;
@@ -318,9 +287,7 @@ sec_merge_add (tab, str, alignment, secinfo)
}
static bfd_boolean
-sec_merge_emit (abfd, entry)
- register bfd *abfd;
- struct sec_merge_hash_entry *entry;
+sec_merge_emit (register bfd *abfd, struct sec_merge_hash_entry *entry)
{
struct sec_merge_sec_info *secinfo = entry->secinfo;
asection *sec = secinfo->sec;
@@ -340,7 +307,7 @@ sec_merge_emit (abfd, entry)
if (len)
{
len = entry->alignment - len;
- if (bfd_bwrite ((PTR) pad, (bfd_size_type) len, abfd) != len)
+ if (bfd_bwrite (pad, (bfd_size_type) len, abfd) != len)
break;
off += len;
}
@@ -348,7 +315,7 @@ sec_merge_emit (abfd, entry)
str = entry->root.string;
len = entry->len;
- if (bfd_bwrite ((PTR) str, (bfd_size_type) len, abfd) != len)
+ if (bfd_bwrite (str, (bfd_size_type) len, abfd) != len)
break;
off += len;
@@ -364,11 +331,7 @@ sec_merge_emit (abfd, entry)
pass of the linker. */
bfd_boolean
-_bfd_merge_section (abfd, psinfo, sec, psecinfo)
- bfd *abfd;
- PTR *psinfo;
- asection *sec;
- PTR *psecinfo;
+_bfd_merge_section (bfd *abfd, void **psinfo, asection *sec, void **psecinfo)
{
struct sec_merge_info *sinfo;
struct sec_merge_sec_info *secinfo;
@@ -419,7 +382,7 @@ _bfd_merge_section (abfd, psinfo, sec, psecinfo)
goto error_return;
sinfo->next = (struct sec_merge_info *) *psinfo;
sinfo->chain = NULL;
- *psinfo = (PTR) sinfo;
+ *psinfo = sinfo;
sinfo->htab = sec_merge_init (sec->entsize, (sec->flags & SEC_STRINGS));
if (sinfo->htab == NULL)
goto error_return;
@@ -460,9 +423,7 @@ _bfd_merge_section (abfd, psinfo, sec, psecinfo)
/* Compare two sec_merge_hash_entry structures. This is called via qsort. */
static int
-cmplengthentry (a, b)
- const PTR a;
- const PTR b;
+cmplengthentry (const void *a, const void *b)
{
struct sec_merge_hash_entry * A = *(struct sec_merge_hash_entry **) a;
struct sec_merge_hash_entry * B = *(struct sec_merge_hash_entry **) b;
@@ -476,9 +437,7 @@ cmplengthentry (a, b)
}
static int
-last4_eq (a, b)
- const PTR a;
- const PTR b;
+last4_eq (const void *a, const void *b)
{
struct sec_merge_hash_entry * A = (struct sec_merge_hash_entry *) a;
struct sec_merge_hash_entry * B = (struct sec_merge_hash_entry *) b;
@@ -504,9 +463,7 @@ last4_eq (a, b)
}
static int
-last_eq (a, b)
- const PTR a;
- const PTR b;
+last_eq (const void *a, const void *b)
{
struct sec_merge_hash_entry * A = (struct sec_merge_hash_entry *) a;
struct sec_merge_hash_entry * B = (struct sec_merge_hash_entry *) b;
@@ -538,9 +495,8 @@ last_eq (a, b)
/* Record one section into the hash table. */
static bfd_boolean
-record_section (sinfo, secinfo)
- struct sec_merge_info *sinfo;
- struct sec_merge_sec_info *secinfo;
+record_section (struct sec_merge_info *sinfo,
+ struct sec_merge_sec_info *secinfo)
{
asection *sec = secinfo->sec;
struct sec_merge_hash_entry *entry;
@@ -623,8 +579,7 @@ error_return:
/* This is a helper function for _bfd_merge_sections. It attempts to
merge strings matching suffixes of longer strings. */
static void
-merge_strings (sinfo)
- struct sec_merge_info *sinfo;
+merge_strings (struct sec_merge_info *sinfo)
{
struct sec_merge_hash_entry **array, **a, **end, *e;
struct sec_merge_sec_info *secinfo;
@@ -663,7 +618,7 @@ merge_strings (sinfo)
unsigned int c;
unsigned int i;
const unsigned char *s;
- PTR *p;
+ void **p;
e = *a;
e->u.entsize = sinfo->htab->entsize;
@@ -692,7 +647,7 @@ merge_strings (sinfo)
continue;
}
else
- *p = (PTR) e;
+ *p = e;
}
s = (const unsigned char *) (e->root.string + e->len - e->u.entsize);
hash = 0;
@@ -714,7 +669,7 @@ merge_strings (sinfo)
e->alignment = 0;
}
else
- *p = (PTR) e;
+ *p = e;
}
alloc_failure:
@@ -770,10 +725,8 @@ alloc_failure:
with _bfd_merge_section. */
bfd_boolean
-_bfd_merge_sections (abfd, xsinfo, remove_hook)
- bfd *abfd ATTRIBUTE_UNUSED;
- PTR xsinfo;
- void (*remove_hook) PARAMS((bfd *, asection *));
+_bfd_merge_sections (bfd *abfd ATTRIBUTE_UNUSED, void *xsinfo,
+ void (*remove_hook) (bfd *, asection *))
{
struct sec_merge_info *sinfo;
@@ -837,7 +790,7 @@ _bfd_merge_sections (abfd, xsinfo, remove_hook)
/* Finally shrink all input sections which have not made it into
the hash table at all. */
for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next)
- if (secinfo->first == NULL)
+ if (secinfo->first == NULL)
secinfo->sec->_cooked_size = 0;
}
@@ -847,10 +800,7 @@ _bfd_merge_sections (abfd, xsinfo, remove_hook)
/* Write out the merged section. */
bfd_boolean
-_bfd_write_merged_section (output_bfd, sec, psecinfo)
- bfd *output_bfd;
- asection *sec;
- PTR psecinfo;
+_bfd_write_merged_section (bfd *output_bfd, asection *sec, void *psecinfo)
{
struct sec_merge_sec_info *secinfo;
file_ptr pos;
@@ -875,11 +825,8 @@ _bfd_write_merged_section (output_bfd, sec, psecinfo)
section and writes the new section back into *PSEC. */
bfd_vma
-_bfd_merged_section_offset (output_bfd, psec, psecinfo, offset, addend)
- bfd *output_bfd ATTRIBUTE_UNUSED;
- asection **psec;
- PTR psecinfo;
- bfd_vma offset, addend;
+_bfd_merged_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, asection **psec,
+ void *psecinfo, bfd_vma offset, bfd_vma addend)
{
struct sec_merge_sec_info *secinfo;
struct sec_merge_hash_entry *entry;
diff --git a/bfd/po/fr.po b/bfd/po/fr.po
index 805904bce01..831daffae38 100644
--- a/bfd/po/fr.po
+++ b/bfd/po/fr.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: GNU bfd 2.14rel030712\n"
"POT-Creation-Date: 2003-07-11 13:53+0930\n"
-"PO-Revision-Date: 2003-07-22 08:00-0500\n"
+"PO-Revision-Date: 2003-08-05 08:00-0500\n"
"Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n"
"Language-Team: French <traduc@traduc.org>\n"
"MIME-Version: 1.0\n"
@@ -598,7 +598,7 @@ msgstr "%s: AVERTISSEMENT: relocalisation sans solution vers le symbole « %s » d
#: elf32-openrisc.c:436 elf32-v850.c:1777 elf32-xstormy16.c:976
#: elf64-mmix.c:1332
msgid "internal error: out of range error"
-msgstr "erreur interne: hors gamme"
+msgstr "erreur interne: hors limite"
#: elf-m10200.c:446 elf-m10300.c:1699 elf32-arm.h:2092 elf32-avr.c:816
#: elf32-cris.c:1394 elf32-d10v.c:574 elf32-fr30.c:638 elf32-frv.c:819
@@ -2059,7 +2059,7 @@ msgstr "%s: longuer erronée de section dans ihex_read_section"
#: ihex.c:872
#, c-format
msgid "%s: address 0x%s out of range for Intel Hex file"
-msgstr "%s: adresse 0x%s hors gamme pour le fichier Intel hexadécimal"
+msgstr "%s: adresse 0x%s hors limite pour le fichier Intel hexadécimal"
#: libbfd.c:861
#, c-format
diff --git a/bfd/po/sv.po b/bfd/po/sv.po
index f63790bd221..e0b667cb4b4 100644
--- a/bfd/po/sv.po
+++ b/bfd/po/sv.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: bfd 2.14rel030712\n"
"POT-Creation-Date: 2003-07-11 13:53+0930\n"
-"PO-Revision-Date: 2003-07-17 22:55+0200\n"
+"PO-Revision-Date: 2003-08-14 22:40+0200\n"
"Last-Translator: Christian Rose <menthos@menthos.com>\n"
"Language-Team: Swedish <sv@li.org>\n"
"MIME-Version: 1.0\n"
@@ -1750,7 +1750,7 @@ msgstr "%s: odefinierat symbolnamn med version %s"
#: elflink.c:2142
#, c-format
msgid "%s: relocation size mismatch in %s section %s"
-msgstr "%s: omlokaliseringsstorleken stämmer inte överens i sektionen %s %s"
+msgstr "%s: omlokaliseringsstorleken stämmer inte överens i %s, sektion %s"
#: elflink.c:2434
#, c-format
@@ -1851,7 +1851,7 @@ msgstr "%s: ogiltigt sektionsnamn \"%s\""
#: elfxx-mips.c:9025
#, c-format
msgid "%s: endianness incompatible with that of the selected emulation"
-msgstr "%s: endianess inkompatibel med den för den valda emuleringen"
+msgstr "%s: endianness inkompatibel med den för den valda emuleringen"
#: elfxx-mips.c:9037
#, c-format
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 58c9c517144..6318190cc3e 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -2116,7 +2116,10 @@ ENUMX
BFD_RELOC_MIPS_RELGOT
ENUMX
BFD_RELOC_MIPS_JALR
+ENUMDOC
+ MIPS ELF relocations.
COMMENT
+
ENUM
BFD_RELOC_FRV_LABEL16
ENUMX
@@ -2138,11 +2141,7 @@ ENUMX
ENUMDOC
Fujitsu Frv Relocations.
COMMENT
-COMMENT
-ENUMDOC
- MIPS ELF relocations.
-COMMENT
ENUM
BFD_RELOC_MN10300_GOTOFF24
ENUMDOC
diff --git a/bfd/simple.c b/bfd/simple.c
index 256fd913b85..c2a741c6f90 100644
--- a/bfd/simple.c
+++ b/bfd/simple.c
@@ -140,6 +140,28 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
bfd_byte *contents, *data;
int storage_needed;
void *saved_offsets;
+ bfd_boolean saved_reloc_done = sec->reloc_done;
+
+#undef RETURN
+#define RETURN(x) \
+ do \
+ { \
+ sec->reloc_done = saved_reloc_done; \
+ return (x); \
+ } \
+ while (0)
+
+ /* Foul hack to prevent bfd_section_size aborts. The reloc_done flag
+ only controls that macro (and the related size macros), selecting
+ between _raw_size and _cooked_size. We may be called with relocation
+ done or not, so we need to save the done-flag and mark the section as
+ not relocated.
+
+ Debug sections won't change size while we're only relocating. There
+ may be trouble here someday if it tries to run relaxation
+ unexpectedly, so make sure. */
+ BFD_ASSERT (sec->_raw_size == sec->_cooked_size);
+ sec->reloc_done = 0;
if (! (sec->flags & SEC_RELOC))
{
@@ -153,7 +175,7 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
if (contents)
bfd_get_section_contents (abfd, sec, contents, 0, size);
- return contents;
+ RETURN (contents);
}
/* In order to use bfd_get_relocated_section_contents, we need
@@ -183,7 +205,7 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
{
data = bfd_malloc (bfd_section_size (abfd, sec));
if (data == NULL)
- return NULL;
+ RETURN (NULL);
outbuf = data;
}
@@ -202,7 +224,7 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
{
if (data)
free (data);
- return NULL;
+ RETURN (NULL);
}
bfd_map_over_sections (abfd, simple_save_output_info, saved_offsets);
@@ -243,15 +265,7 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
bfd_map_over_sections (abfd, simple_restore_output_info, saved_offsets);
free (saved_offsets);
- /* Foul hack to prevent bfd_section_size aborts. This flag only controls
- that macro (and the related size macros), selecting between _raw_size
- and _cooked_size. Debug sections won't change size while we're only
- relocating. There may be trouble here someday if it tries to run
- relaxation unexpectedly, so make sure. */
- BFD_ASSERT (sec->_raw_size == sec->_cooked_size);
- sec->reloc_done = 0;
-
bfd_link_hash_table_free (abfd, link_info.hash);
- return contents;
+ RETURN (contents);
}
diff --git a/bfd/targets.c b/bfd/targets.c
index 0ce77a935bc..c3212a95642 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -477,7 +477,7 @@ to find an alternative output format that is suitable.
. {* Data for use by back-end routines, which isn't
. generic enough to belong in this structure. *}
-. void *backend_data;
+. const void *backend_data;
.
.} bfd_target;
.
diff --git a/bfd/version.h b/bfd/version.h
index 20f1686ec5a..445ac0fa99c 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20030805
+#define BFD_VERSION_DATE 20030917
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_string@
diff --git a/config-ml.in b/config-ml.in
index 0a2f103d3fb..865275ce3d8 100644
--- a/config-ml.in
+++ b/config-ml.in
@@ -1,6 +1,32 @@
# Configure fragment invoked in the post-target section for subdirs
# wanting multilib support.
#
+# Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+#
+# Please report bugs to <gcc-bugs@gnu.org>
+# and send patches to <gcc-patches@gnu.org>.
+
# It is advisable to support a few --enable/--disable options to let the
# user select which libraries s/he really wants.
#
@@ -740,7 +766,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
fi
# find compiler flag corresponding to ${ml_dir}
- for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
+ for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
dir=`echo $i | sed -e 's/;.*$//'`
if [ "${dir}" = "${ml_dir}" ]; then
flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`
diff --git a/config.sub b/config.sub
index 725707f709a..dfeed485c2b 100755
--- a/config.sub
+++ b/config.sub
@@ -234,7 +234,7 @@ case $basic_machine in
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
- | ip2k \
+ | iq2000 | ip2k \
| m32r | m68000 | m68k | m88k | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
@@ -304,7 +304,7 @@ case $basic_machine in
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* \
+ | iq2000-* | ip2k-* \
| m32r-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
diff --git a/config/no-executables.m4 b/config/no-executables.m4
new file mode 100644
index 00000000000..ca26b7112c6
--- /dev/null
+++ b/config/no-executables.m4
@@ -0,0 +1,61 @@
+# GCC_NO_EXECUTABLES
+# -----------------
+# FIXME: The GCC team has specific needs which the current Autoconf
+# framework cannot solve elegantly. This macro implements a dirty
+# hack until Autoconf is able to provide the services its users
+# need.
+#
+# Several of the support libraries that are often built with GCC can't
+# assume the tool-chain is already capable of linking a program: the
+# compiler often expects to be able to link with some of such
+# libraries.
+#
+# In several of these libraries, workarounds have been introduced to
+# avoid the AC_PROG_CC_WORKS test, that would just abort their
+# configuration. The introduction of AC_EXEEXT, enabled either by
+# libtool or by CVS autoconf, have just made matters worse.
+#
+# Unlike the previous AC_NO_EXECUTABLES, this test does not
+# disable link tests at autoconf time, but at configure time.
+# This allows AC_NO_EXECUTABLES to be invoked conditionally.
+AC_DEFUN_ONCE([GCC_NO_EXECUTABLES],
+[m4_divert_push([KILL])
+
+AC_BEFORE([$0], [_AC_COMPILER_EXEEXT])
+AC_BEFORE([$0], [AC_LINK_IFELSE])
+
+m4_define([_AC_COMPILER_EXEEXT],
+AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
+# FIXME: Cleanup?
+AS_IF([AC_TRY_EVAL(ac_link)], [gcc_no_link=no], [gcc_no_link=yes])
+if test x$gcc_no_link = xyes; then
+ # Setting cross_compile will disable run tests; it will
+ # also disable AC_CHECK_FILE but that's generally
+ # correct if we can't link.
+ cross_compiling=yes
+ EXEEXT=
+else
+ m4_defn([_AC_COMPILER_EXEEXT])dnl
+fi
+)
+
+m4_define([AC_LINK_IFELSE],
+if test x$gcc_no_link = xyes; then
+ AC_MSG_ERROR([Link tests are not allowed after [[$0]].])
+fi
+m4_defn([AC_LINK_IFELSE]))
+
+dnl This is a shame. We have to provide a default for some link tests,
+dnl similar to the default for run tests.
+m4_define([AC_FUNC_MMAP],
+if test x$gcc_no_link = xyes; then
+ if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
+ ac_cv_func_mmap_fixed_mapped=no
+ fi
+fi
+if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
+ m4_defn([AC_FUNC_MMAP])
+fi)
+
+m4_divert_pop()dnl
+])# GCC_NO_EXECUTABLES
diff --git a/configure b/configure
index 55d562a706f..b204110f118 100755
--- a/configure
+++ b/configure
@@ -794,8 +794,20 @@ progname=$0
# if PWD already has a value, it is probably wrong.
if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
-# Export original configure arguments for use by sub-configures.
-TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@"
+# Export original configure arguments for use by sub-configures. These
+# will be expanded once by make, and once by the shell, so they need to
+# have '$' quoted for make, and then each argument quoted for the shell.
+# What's more, the 'echo' below might expand backslashes.
+cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+tmp="'$progname'"
+for ac_arg
+do
+ tmp="$tmp '"`echo "$ac_arg" | sed -f conftestsed`
+done
+rm -f conftestsed
+TOPLEVEL_CONFIGURE_ARGUMENTS="$tmp"
moveifchange=${srcdir}/move-if-change
@@ -991,7 +1003,8 @@ esac
# If both --with-headers and --with-libs are specified, default to
# --without-newlib.
-if test x"${with_headers}" != x && test x"${with_libs}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers} != xno \
+ && test x"${with_libs}" != x && test x"${with_libs} != xno ; then
if test x"${with_newlib}" = x ; then
with_newlib=no
fi
@@ -1068,10 +1081,14 @@ case "${target}" in
*-*-chorusos)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
- *-*-darwin*)
+ powerpc-*-darwin*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
noconfigdirs="$noconfigdirs target-libobjc"
;;
+ *-*-darwin*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+ noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
+ ;;
*-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
@@ -1123,7 +1140,7 @@ case "${target}" in
# newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
- alpha*-*-freebsd*)
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
alpha*-*-*)
@@ -1244,7 +1261,7 @@ case "${target}" in
i[3456789]86-*-coff | i[3456789]86-*-elf)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
- i[3456789]86-*-freebsd*)
+ i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
i[3456789]86-*-linux*)
@@ -1671,7 +1688,7 @@ copy_dirs=
# Handle --with-headers=XXX. If the value is not "yes", the contents of
# the named directory are copied to $(tooldir)/sys-include.
-if test x"${with_headers}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
if test x${is_cross_compiler} = xno ; then
echo 1>&2 '***' --with-headers is only supported when cross compiling
exit 1
@@ -1688,7 +1705,7 @@ fi
# Handle --with-libs=XXX. If the value is not "yes", the contents of
# the name directories are copied to $(tooldir)/lib. Multiple directories
# are permitted.
-if test x"${with_libs}" != x ; then
+if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
if test x${is_cross_compiler} = xno ; then
echo 1>&2 '***' --with-libs is only supported when cross compiling
exit 1
@@ -2500,20 +2517,24 @@ serialization_dependencies=serdep.tmp
# Base args. Strip norecursion, cache-file, srcdir, host, build,
# target and nonopt. These are the ones we might not want to pass
# down to subconfigures.
-baseargs=`echo " ${ac_configure_args} " | \
- sed -e 's/ --no[^ ]* / /' \
- -e 's/ --c[a-z-]*[= ][^ ]* / /' \
- -e 's/ --sr[a-z-]*[= ][^ ]* / /' \
- -e 's/ --ho[a-z-]*[= ][^ ]* / /' \
- -e 's/ --bu[a-z-]*[= ][^ ]* / /' \
- -e 's/ --t[a-z-]*[= ][^ ]* / /' \
- -e 's/ -cache-file[= ][^ ]* / /' \
- -e 's/ -srcdir[= ][^ ]* / /' \
- -e 's/ -host[= ][^ ]* / /' \
- -e 's/ -build[= ][^ ]* / /' \
- -e 's/ -target[= ][^ ]* / /' \
- -e "s/ [^' -][^ ]* / /" \
- -e 's/^ *//;s/ *$//'`
+cat <<\EOF_SED > conftestsed
+s/ --no[^ ]* / /
+s/ --c[a-z-]*[= ][^ ]* / /
+s/ --sr[a-z-]*[= ][^ ]* / /
+s/ --ho[a-z-]*[= ][^ ]* / /
+s/ --bu[a-z-]*[= ][^ ]* / /
+s/ --t[a-z-]*[= ][^ ]* / /
+s/ -cache-file[= ][^ ]* / /
+s/ -srcdir[= ][^ ]* / /
+s/ -host[= ][^ ]* / /
+s/ -build[= ][^ ]* / /
+s/ -target[= ][^ ]* / /
+s/ [^' -][^ ]* / /
+s/^ *//;s/ *$//
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+baseargs=`echo " ${ac_configure_args} " | sed -f conftestsed`
+rm -f conftestsed
# For the build-side libraries, we just need to pretend we're native,
# and not use the same cache file. Multilibs are neither needed nor
@@ -2668,7 +2689,9 @@ libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_
raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
if test "x${CXX_FOR_TARGET+set}" = xset; then
- :
+ if test "x${RAW_CXX_FOR_TARGET+set}" != xset; then
+ RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
+ fi
elif test -d ${srcdir}/gcc; then
# We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead
# of g++ for linking C++ or Java, because g++ has -shared-libgcc by
@@ -2762,7 +2785,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
# Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2766: checking for $ac_word" >&5
+echo "configure:2789: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2795,7 +2818,7 @@ if test -z "$ac_cv_prog_AR" ; then
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2799: checking for $ac_word" >&5
+echo "configure:2822: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2834,7 +2857,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args.
set dummy ${ncn_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2838: checking for $ac_word" >&5
+echo "configure:2861: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2867,7 +2890,7 @@ if test -z "$ac_cv_prog_AS" ; then
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2871: checking for $ac_word" >&5
+echo "configure:2894: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2906,7 +2929,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ncn_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2910: checking for $ac_word" >&5
+echo "configure:2933: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2939,7 +2962,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2943: checking for $ac_word" >&5
+echo "configure:2966: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2978,7 +3001,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2982: checking for $ac_word" >&5
+echo "configure:3005: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3011,7 +3034,7 @@ if test -z "$ac_cv_prog_LD" ; then
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3015: checking for $ac_word" >&5
+echo "configure:3038: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3050,7 +3073,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args.
set dummy ${ncn_tool_prefix}nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3054: checking for $ac_word" >&5
+echo "configure:3077: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3083,7 +3106,7 @@ if test -z "$ac_cv_prog_NM" ; then
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3087: checking for $ac_word" >&5
+echo "configure:3110: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3122,7 +3145,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3126: checking for $ac_word" >&5
+echo "configure:3149: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3155,7 +3178,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3159: checking for $ac_word" >&5
+echo "configure:3182: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3194,7 +3217,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args.
set dummy ${ncn_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3198: checking for $ac_word" >&5
+echo "configure:3221: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3227,7 +3250,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3231: checking for $ac_word" >&5
+echo "configure:3254: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3266,7 +3289,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args.
set dummy ${ncn_tool_prefix}objcopy; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3270: checking for $ac_word" >&5
+echo "configure:3293: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3299,7 +3322,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then
# Extract the first word of "objcopy", so it can be a program name with args.
set dummy objcopy; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3303: checking for $ac_word" >&5
+echo "configure:3326: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3338,7 +3361,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ncn_tool_prefix}objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3342: checking for $ac_word" >&5
+echo "configure:3365: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3371,7 +3394,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then
# Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3375: checking for $ac_word" >&5
+echo "configure:3398: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3419,7 +3442,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3423: checking for $ac_word" >&5
+echo "configure:3446: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3452,7 +3475,7 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3456: checking for $ac_word" >&5
+echo "configure:3479: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3491,7 +3514,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3495: checking for $ac_word" >&5
+echo "configure:3518: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3524,7 +3547,7 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3528: checking for $ac_word" >&5
+echo "configure:3551: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3563,7 +3586,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3567: checking for $ac_word" >&5
+echo "configure:3590: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3596,7 +3619,7 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3600: checking for $ac_word" >&5
+echo "configure:3623: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3635,7 +3658,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3639: checking for $ac_word" >&5
+echo "configure:3662: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3668,7 +3691,7 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3672: checking for $ac_word" >&5
+echo "configure:3695: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3707,7 +3730,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3711: checking for $ac_word" >&5
+echo "configure:3734: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3740,7 +3763,7 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3744: checking for $ac_word" >&5
+echo "configure:3767: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3779,7 +3802,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3783: checking for $ac_word" >&5
+echo "configure:3806: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3812,7 +3835,7 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3816: checking for $ac_word" >&5
+echo "configure:3839: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3851,7 +3874,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3855: checking for $ac_word" >&5
+echo "configure:3878: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3884,7 +3907,7 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3888: checking for $ac_word" >&5
+echo "configure:3911: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3951,7 +3974,7 @@ RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:3955: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:3978: checking whether to enable maintainer-specific portions of Makefiles" >&5
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
diff --git a/configure.in b/configure.in
index d1a2e1ac021..ae3ff2ae8c8 100644
--- a/configure.in
+++ b/configure.in
@@ -66,8 +66,20 @@ progname=$0
# if PWD already has a value, it is probably wrong.
if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
-# Export original configure arguments for use by sub-configures.
-TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@"
+# Export original configure arguments for use by sub-configures. These
+# will be expanded once by make, and once by the shell, so they need to
+# have '$' quoted for make, and then each argument quoted for the shell.
+# What's more, the 'echo' below might expand backslashes.
+cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+tmp="'$progname'"
+for ac_arg
+do
+ tmp="$tmp '"`echo "$ac_arg" | sed -f conftestsed`
+done
+rm -f conftestsed
+TOPLEVEL_CONFIGURE_ARGUMENTS="$tmp"
AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)
moveifchange=${srcdir}/move-if-change
@@ -242,7 +254,8 @@ esac
# If both --with-headers and --with-libs are specified, default to
# --without-newlib.
-if test x"${with_headers}" != x && test x"${with_libs}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers} != xno \
+ && test x"${with_libs}" != x && test x"${with_libs} != xno ; then
if test x"${with_newlib}" = x ; then
with_newlib=no
fi
@@ -319,10 +332,14 @@ case "${target}" in
*-*-chorusos)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
- *-*-darwin*)
+ powerpc-*-darwin*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
noconfigdirs="$noconfigdirs target-libobjc"
;;
+ *-*-darwin*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+ noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
+ ;;
*-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
@@ -374,7 +391,7 @@ case "${target}" in
# newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
- alpha*-*-freebsd*)
+ alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
alpha*-*-*)
@@ -495,7 +512,7 @@ case "${target}" in
i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
- i[[3456789]]86-*-freebsd*)
+ i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
i[[3456789]]86-*-linux*)
@@ -922,7 +939,7 @@ copy_dirs=
# Handle --with-headers=XXX. If the value is not "yes", the contents of
# the named directory are copied to $(tooldir)/sys-include.
-if test x"${with_headers}" != x ; then
+if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
if test x${is_cross_compiler} = xno ; then
echo 1>&2 '***' --with-headers is only supported when cross compiling
exit 1
@@ -939,7 +956,7 @@ fi
# Handle --with-libs=XXX. If the value is not "yes", the contents of
# the name directories are copied to $(tooldir)/lib. Multiple directories
# are permitted.
-if test x"${with_libs}" != x ; then
+if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
if test x${is_cross_compiler} = xno ; then
echo 1>&2 '***' --with-libs is only supported when cross compiling
exit 1
@@ -1750,20 +1767,24 @@ AC_SUBST_FILE(serialization_dependencies)
# Base args. Strip norecursion, cache-file, srcdir, host, build,
# target and nonopt. These are the ones we might not want to pass
# down to subconfigures.
-baseargs=`echo " ${ac_configure_args} " | \
- sed -e 's/ --no[[^ ]]* / /' \
- -e 's/ --c[[a-z-]]*[[= ]][[^ ]]* / /' \
- -e 's/ --sr[[a-z-]]*[[= ]][[^ ]]* / /' \
- -e 's/ --ho[[a-z-]]*[[= ]][[^ ]]* / /' \
- -e 's/ --bu[[a-z-]]*[[= ]][[^ ]]* / /' \
- -e 's/ --t[[a-z-]]*[[= ]][[^ ]]* / /' \
- -e 's/ -cache-file[[= ]][[^ ]]* / /' \
- -e 's/ -srcdir[[= ]][[^ ]]* / /' \
- -e 's/ -host[[= ]][[^ ]]* / /' \
- -e 's/ -build[[= ]][[^ ]]* / /' \
- -e 's/ -target[[= ]][[^ ]]* / /' \
- -e "s/ [[^' -][^ ]*] / /" \
- -e 's/^ *//;s/ *$//'`
+cat <<\EOF_SED > conftestsed
+s/ --no[[^ ]]* / /
+s/ --c[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --sr[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --ho[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --bu[[a-z-]]*[[= ]][[^ ]]* / /
+s/ --t[[a-z-]]*[[= ]][[^ ]]* / /
+s/ -cache-file[[= ]][[^ ]]* / /
+s/ -srcdir[[= ]][[^ ]]* / /
+s/ -host[[= ]][[^ ]]* / /
+s/ -build[[= ]][[^ ]]* / /
+s/ -target[[= ]][[^ ]]* / /
+s/ [[^' -][^ ]*] / /
+s/^ *//;s/ *$//
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+baseargs=`echo " ${ac_configure_args} " | sed -f conftestsed`
+rm -f conftestsed
# For the build-side libraries, we just need to pretend we're native,
# and not use the same cache file. Multilibs are neither needed nor
@@ -1918,7 +1939,9 @@ libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_
raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
if test "x${CXX_FOR_TARGET+set}" = xset; then
- :
+ if test "x${RAW_CXX_FOR_TARGET+set}" != xset; then
+ RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
+ fi
elif test -d ${srcdir}/gcc; then
# We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead
# of g++ for linking C++ or Java, because g++ has -shared-libgcc by
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cc9550ec4e5..9c2c05197ce 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,1841 @@
+2003-09-17 David Carlton <carlton@kealia.com>
+
+ * Merge with mainline; tag is carlton_dictionary-20030917-merge.
+
+2003-09-17 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_NPC_REGNUM): Deprecate NPC_REGNUM.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * core-sol2.c, hppa-tdep.c, lynx-nat.c, procfs.c: Update.
+ * regcache.c, remote-vxsparc.c, sparc-linux-nat.c: Update.
+ * sparc-nat.c, sparc-tdep.c, sparc64-tdep.c: Update.
+ * sparcnbsd-tdep.c: Update.
+
+2003-09-17 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_REGISTER_BYTE): Rename REGISTER_BYTE.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * arm-linux-tdep.c, core-sol2.c, cris-tdep.c: Update.
+ * d10v-tdep.c, frame.c: Update.
+ * hppa-tdep.c, hppab-nat.c, hppah-nat.c, hppam3-nat.c: Update.
+ * hpux-thread.c, i386gnu-nat.c, ia64-aix-nat.c: Update.
+ * ia64-linux-nat.c, irix5-nat.c, lynx-nat.c, m68knbsd-nat.c: Update.
+ * mcore-tdep.c, mips-linux-tdep.c, mips-tdep.c: Update.
+ * mipsv4-nat.c, mn10300-tdep.c, ns32k-tdep.c: Update.
+ * ns32knbsd-nat.c, ppc-bdm.c, regcache.c, remote-sds.c: Update.
+ * remote-vx68.c, remote-vxmips.c, remote-vxsparc.c: Update.
+ * remote.c, rs6000-tdep.c, s390-tdep.c, sh64-tdep.c: Update.
+ * sparc-nat.c, sparc-tdep.c, sun3-nat.c, v850-tdep.c: Update.
+ * v850ice.c, vax-tdep.c, xstormy16-tdep.c: Update.
+ * config/m68k/tm-cisco.h, config/m68k/tm-delta68.h: Update.
+ * config/pa/nm-hppah.h: Update.
+
+2003-09-16 Andrew Cagney <cagney@redhat.com>
+
+ * ppc-linux-tdep.c (ppc_linux_init_abi): Set the 32 bit
+ "use_struct_convention" to "ppc_linux_use_struct_convention".
+ (ppc_linux_use_struct_convention): New function.
+ * rs6000-tdep.c (rs6000_use_struct_convention): New function.
+ (rs6000_gdbarch_init): For AIX, set "use_struct_convention" to
+ "rs6000_use_struct_convention".
+ * ppc-tdep.h (ppc_sysv_abi_broken_use_struct_convention): Delete
+ declaration.
+ * ppc-sysv-tdep.c (ppc_sysv_abi_broken_use_struct_convention):
+ Delete function.
+
+2003-09-16 Andrew Cagney <cagney@redhat.com>
+
+ * buildsym.c: Remove more occurances of "register".
+ * coffread.c, dbxread.c, dcache.c, dwarf2read.c: Ditto.
+ * environ.c, eval.c, f-valprint.c, findvar.c: Ditto.
+ * gdbtypes.c, gnu-v2-abi.c, h8300-tdep.c, hppa-tdep.c: Ditto.
+ * infcmd.c, mdebugread.c, minsyms.c, mips-tdep.c: Ditto.
+ * printcmd.c, remote-vx.c, sh-stub.c, sh-tdep.c: Ditto.
+ * sh64-tdep.c, source.c, stabsread.c, stack.c: Ditto.
+ * standalone.c, symfile.c, symmisc.c, symtab.c: Ditto.
+ * utils.c, valops.c, values.c, xcoffread.c: Ditto.
+
+2003-09-16 Corinna Vinschen <vinschen@redhat.com>
+
+ * sh-tdep.h (struct gdbarch_tdep): Remove. Change all register
+ numbers to enumeration values.
+ * sh-tdep.c: Accomodate above change.
+ (SH_NUM_REGS): Rename from SH_DEFAULT_NUM_REGS.
+ (NUM_PSEUDO_REGS_SH_MEDIA): Remove (sh5 only).
+ (NUM_PSEUDO_REGS_SH_COMPACT): Remove (sh5 only).
+ (IS_ADD_IMM_SP): Rename from IS_ADD_SP.
+ (IS_FPUSH): Rename from IS_FMOV.
+ (sh_extract_struct_value_address): Remove useless comment.
+ (sh_dsp_register_sim_regno): Use register values from sh-tdep.h
+ instead of own local values.
+ (sh_dump_tdep): Remove.
+ (_initialize_sh_tdep): Accomodate removing sh_dump_tdep.
+ * sh3-rom.c (sh3_supply_register): Accomodate sh-tdep.h changes.
+
+2003-09-15 Andrew Cagney <cagney@redhat.com>
+
+ * doublest.c (convert_floatformat_to_doublest): No longer need to
+ cast "exp_bias" to an int. Reverts 2002-12-04 change.
+
+2003-09-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * values.c (unpack_double): Call floatformat_is_valid.
+
+2003-09-15 Mark Kettenis <kettenis@gnu.org>
+
+ * amd64fbsd-nat.c (_initialize_amd64fbsd_nat): Change type of
+ ps_strings into a long.
+
+ * amd64fbsd-nat.c (_initialize_amd64fbsd_nat): Rename from
+ _initialize_am64fbsd_nat.
+
+2003-09-15 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2read.c (dwarf2_get_pc_bounds): Complain if offset
+ associated with DW_AT_ranges attribute is out of bounds.
+
+2003-09-15 David Lecomber <dsl@sources.redhat.com>
+
+ * f-valprint.c: Apply array element printing limits to multi-dimensional arrays
+
+2003-09-14 Michael Chastain <mec@shout.net>
+
+ * config/m68k/nm-apollo68v.h: Delete.
+ * config/m68k/xm-apollo68v.h: Delete.
+
+2003-09-14 Andrew Cagney <cagney@redhat.com>
+
+ * rs6000-tdep.c (rs6000_push_dummy_call): Fix typos.
+ * dcache.c: Update copyrights and descriptions.
+ * scm-exp.c, ia64-aix-nat.c, hppam3-nat.c: environ.c: Ditto.
+
+2003-09-14 Andrew Cagney <cagney@redhat.com>
+
+ * config/djgpp/fnchange.lst: Rename "amd64fbsd-tdep.c" and
+ "amd64fbsd-nat.c" to "a64fb-tdep.c" and "a64fb-nat.c".
+
+2003-09-14 Andrew Cagney <cagney@redhat.com>
+
+ * alpha-nat.c: Remove some occurances of "register".
+ * alpha-tdep.c, arm-tdep.c, blockframe.c, breakpoint.c: Ditto.
+ * buildsym.c, c-typeprint.c, c-valprint.c, coffread.c: Ditto.
+ * corefile.c, cp-support.c, cp-valprint.c, cris-tdep.c: Ditto.
+ * dbxread.c, dcache.c, dwarf2read.c, elfread.c: Ditto.
+ * environ.c, eval.c, event-top.c, f-typeprint.c: Ditto.
+ * f-valprint.c, findvar.c, frame.c, gdbtypes.c: Ditto.
+ * h8300-tdep.c, hppa-tdep.c, hppab-nat.c, hppah-nat.c: Ditto.
+ * hppam3-nat.c, hpread.c, ia64-aix-nat.c, ia64-linux-nat.c: Ditto.
+ * infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Ditto.
+ * infttrace.c, irix5-nat.c, jv-typeprint.c: Ditto.
+ * jv-valprint.c, m68k-tdep.c, m68klinux-nat.c, main.c: Ditto.
+ * mdebugread.c, minsyms.c, mips-linux-tdep.c: Ditto.
+ * mips-nat.c, mips-tdep.c, mipsread.c, mipsv4-nat.c: Ditto.
+ * ns32k-tdep.c, objfiles.c, p-typeprint.c: Ditto.
+ * p-valprint.c, ppc-linux-nat.c, printcmd.c: Ditto.
+ * remote-mips.c, remote-vx.c, rs6000-nat.c: Ditto.
+ * rs6000-tdep.c, scm-exp.c, sh-tdep.c, sh64-tdep.c: Ditto.
+ * solib.c, somread.c, source.c, sparc-tdep.c: Ditto.
+ * stabsread.c, stack.c, standalone.c, symfile.c: Ditto.
+ * symmisc.c, symtab.c, top.c, tracepoint.c: Ditto.
+ * typeprint.c, utils.c, valarith.c, valops.c: Ditto.
+ * values.c, vax-tdep.c, xcoffread.c: Ditto.
+
+2003-09-13 Andrew Cagney <cagney@redhat.com>
+
+ * config/pa/tm-hppa64.h (struct frame_info): Declare opaque.
+ * ppc-tdep.h (struct regcache): Declare opaque.
+ * objfiles.h (struct objfile_data): Declare opaque.
+ * cp-support.h (struct objfile): Declare opaque.
+ * linux-nat.h (target_waitstatus): Declare opaque.
+
+2003-09-14 Mark Kettenis <kettenis@gnu.org>
+
+ * gdbarch.sh (DEPRECATED_REG_STRUCT_HAS_ADDR): Add comment.
+ (stabs_argument_has_addr): New architecture method.
+ * arch-utils.h (default_stabs_argument_has_addr): New prototype.
+ * arch-utils.c: Include "buildsym.h".
+ (default_stabs_argument_has_addr): New function.
+ * stabsread.c (define_symbol): Use stabs_argument_has_addr
+ instead of DEPRECATED_REG_STRUCT_HAS_ADDR.
+
+ * cris-tdep.c (cris_gdbarch_init): Set
+ deprecated_reg_struct_has_addr instead of reg_struct_has_addr.
+ * hppa-tdep.c (hppa_gdbarch_init): Likewise.
+ * mcore-tdep.c (mcore_gdbarch_init): Likewise.
+ * mips-tdep.c (mips_gdbarch_init): Likewise.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Likewise.
+ * sparc-tdep.c (sparc_gdbarch_init): Likewise.
+
+2003-09-13 Andrew Cagney <cagney@redhat.com>
+
+ * values.c (using_struct_return): Delete "function" and "funcaddr"
+ parameters.
+ * value.h (using_struct_return): Update declaration.
+ * infcmd.c (finish_command_continuation): Update.
+ (finish_command): Update.
+ * infcall.c (call_function_by_hand): Update.
+ * eval.c (evaluate_subexp_standard): Update.
+
+2003-09-13 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c: Just rely on CONTEXT_EXTENDED_REGISTER being defined for
+ SSE registers since gdb will not operate correctly without this.
+ Restore include file ordering munged in previous change.
+ * config/i386/tm-cygwin.h: Remove HAVE_SSE_REGS define.
+
+2003-09-13 Mark Kettenis <kettenis@gnu.org>
+
+ * gdbarch.sh (DEPRECATED_REG_STRUCT_HAS_ADDR): Renamed from
+ REG_STRUCT_HAS_ADDR.
+ * gdbarch.c, gdbarch.h: Updated.
+ * infcall.c (call_function_by_hand): Update.
+ * stabsread.c (define_symbol): Updated.
+
+ * Makefile.in (xm-i386-sv32.h, tm-i386gas.h): Remove.
+
+2003-09-12 Christopher Faylor <cgf@redhat.com>
+
+ * win32-nat.c: Reorganize so that defines used by target headers are
+ actually defined by the system headers.
+ * config/i386/tm-cygwin.h: Check for CONTEXT_EXTENDED_REGISTERS rather
+ than HAVE_CONTEXT_EXTENDED_REGISTERS, since the latter actually exists.
+
+2003-09-12 Jim Blandy <jimb@redhat.com>
+
+ * dbxread.c (read_dbx_symtab): Don't report an internal error if
+ the file has no .data, .bss, or .rodata sections. Instead wait
+ until we see a variable alleged to live in one of those sections.
+
+ * dbxread.c (read_dbx_symtab): If we have no .data section and no
+ .bss section, presume that any variables we find live in the
+ .rodata section.
+
+ * dbxread.c (read_dbx_symtab): Add FIXME about finding section
+ offsets for global and static variables.
+
+ * dbxread.c (read_dbx_symtab): The N_DATA and N_DATA | N_EXT
+ symbol types are, by definition, in the .data section, so it is
+ correct to use SECT_OFF_DATA (objfile) here, not data_sect_index.
+ If there is no .data section, there should be no N_DATA or N_DATA
+ | N_EXT symbols.
+
+2003-09-12 Mark Kettenis <kettenis@gnu.org>
+
+ * amd64fbsd-tdep.c: Fix sigtramp recognition.
+ (amd64fbsd_sigcontext_addr): Rewrite.
+ (amd64fbsd_sigtramp_start, amd64fbsd_sigtramp_end): Initialize
+ with correct values.
+ (amd64fbsd_sc_reg_offset): Initialize with correct values.
+ (amd64fbsd_init_abi): Fix typo.
+
+2003-09-12 Andrew Cagney <cagney@redhat.com>
+
+ * ppc-sysv-tdep.c (align_up, align_down): Replace "round2" macro.
+ (ppc_sysv_abi_push_dummy_call): Rewrite, use a two pass loop.
+
+2003-09-12 Andrew Cagney <cagney@redhat.com>
+
+ * objfiles.h (struct entry_info): Deprecate "entry_file_lowpc" and
+ "entry_file_highpc". Update comments.
+ * defs.h (deprecated_inside_entry_file): Rename
+ "inside_entry_file".
+ * blockframe.c (deprecated_inside_entry_file): Rename
+ "inside_entry_file".
+ * frame.c (get_prev_frame): Update. Use if 0 instead of #if 0.
+ * vax-tdep.c (vax_frame_chain): Update.
+ * sh64-tdep.c (sh64_frame_chain): Update.
+ * sh-tdep.c (sh_frame_chain): Update.
+ * rs6000-tdep.c (rs6000_frame_chain): Update.
+ * ns32k-tdep.c (ns32k_frame_chain): Update.
+ * mips-tdep.c (mips_frame_chain): Update.
+ * m68hc11-tdep.c (m68hc11_frame_this_id): Update.
+ * m32r-tdep.c (m32r_frame_this_id): Update.
+ * i386-interix-tdep.c (i386_interix_frame_chain_valid): Update.
+ * frv-tdep.c (frv_frame_this_id): Update.
+ * d10v-tdep.c (d10v_frame_this_id): Update.
+ * cris-tdep.c (cris_frame_chain): Update.
+ * blockframe.c (legacy_frame_chain_valid): Update.
+ * avr-tdep.c (avr_frame_this_id): Update.
+ * arm-tdep.c (arm_prologue_this_id): Update.
+ * alpha-tdep.c (alpha_heuristic_frame_this_id): Update.
+ * objfiles.c (objfile_relocate): Update.
+ * mipsread.c (mipscoff_symfile_read): Update.
+ (mipscoff_symfile_read): Update.
+ * mdebugread.c (parse_partial_symbols): Update.
+ * dwarfread.c (read_file_scope): Update.
+ * dwarf2read.c (read_file_scope): Update.
+ * dbxread.c (read_dbx_symtab): Update.
+ (read_dbx_symtab): Update.
+ * coffread.c (complete_symtab): Update.
+
+2003-09-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ * top.c (quit_target): New static helper function.
+ (quit_force): Moved code to quit_target(). Call quit_target()
+ via catch_errors() to catch errors during quit.
+
+2003-09-11 David Carlton <carlton@kealia.com>
+
+ * buildsym.c (finish_block): Use allocate_block to allocate the
+ block.
+ * mdebugread.c (new_block): Add FIXME.
+
+2003-09-11 David Carlton <carlton@kealia.com>
+
+ * gdbtypes.h: Add TYPE_CODE_NAMESPACE.
+ * gdbtypes.c (init_type): Handle TYPE_CODE_NAMESPACE.
+ (recursive_dump_type): Ditto.
+ * printcmd.c (print_formatted): Ditto.
+ * typeprint.c (print_type_scalar): Ditto.
+ * c-typeprint.c (c_type_print_varspec_prefix): Ditto.
+ (c_type_print_varspec_suffix, c_type_print_base): Ditto.
+ * cp-support.h: Declare cp_check_possible_namespace_symbols,
+ maint_cplus_cmd_list.
+ * cp-support.c: Make maint_cplus_cmd_list extern.
+ * cp-namespace.c: Include objfiles.h, gdbtypes.h, dictionary.h,
+ command.h.
+ (lookup_symbol_file): Look in possible namespace blocks when
+ appropriate.
+ (initialize_namespace_symtab): New.
+ (get_possible_namespace_block, free_namespace_block)
+ (check_possible_namespace_symbols)
+ (check_possible_namespace_symbols_loop)
+ (check_one_possible_namespace_symbol)
+ (lookup_possible_namespace_symbol, maintenance_cplus_namespace)
+ (_initialize_cp_namespace): Ditto.
+ * block.h: Declare allocate_block.
+ * block.c (allocate_block): New.
+ * jv-lang.c (get_java_class_symtab): Allocate blocks via
+ allocate_block.
+ * symfile.h: Update declaration of add_psymbol_to_list.
+ * symfile.c (add_psymbol_to_list): Return the partial symbol in
+ question.
+ * dwarf2read.c (dwarf2_build_psymtabs_hard): Add argument to
+ scan_partial_symbols_call.
+ (scan_partial_symbols): Add NAMESPACE argument; update calls to
+ helper functions.
+ (add_partial_symbol): If necessary, scan mangled names for names
+ of namespaces.
+ (add_partial_namespace): Add NAMESPACE argument; generate partial
+ symbols associated to namespaces.
+ (add_partial_enumeration): Add NAMESPACE argument.
+ (new_symbol): Allow namespace syms.
+ (read_namespace): Generate namespace syms.
+ * objfiles.h: Add opaque declaration of struct symtab.
+ (struct objfile): Add cp_namespace_symtab member.
+ * objfiles.c (allocate_objfile): Set
+ objfile->cp_namespace_symtab.
+ * Makefile.in (cp-namespace.o): Depend on objfiles_h, gdbtypes_h,
+ dictionary_h, command_h.
+
+2003-09-11 Andrew Cagney <cagney@redhat.com>
+
+ * rs6000-tdep.c (rs6000_push_dummy_call): Use
+ regcache_raw_write_signed to set SP_REGNUM, move the operation to
+ near the function's end.
+ (rs6000_gdbarch_init): Do not set "deprecated_dummy_write_sp".
+ * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Use
+ regcache_raw_write_signed to set SP_REGNUM.
+
+2003-09-11 Elena Zannoni <ezannoni@redhat.com>
+
+ * symfile.c (symbol_file_add_with_addrs_or_offsets): Make sure
+ orig_addrs is set up properly.
+
+2003-09-11 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_STACK_ALIGN): Rename STACK_ALIGN.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * infcall.c (call_function_by_hand): Update.
+ * hppa-tdep.c (hppa_push_arguments): Update.
+ * ada-lang.c (place_on_stack): Update.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
+ * sparc-tdep.c (sparc_gdbarch_init): Update.
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
+ * hppa-tdep.c (hppa_gdbarch_init): Update.
+ * h8300-tdep.c (h8300_gdbarch_init): Delete comment refering to
+ stack_align.
+
+2003-09-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * dwarf2loc.c (dwarf2_loc_desc_needs_frame): Variables in a
+ register do need a frame.
+
+2003-09-11 Andrew Cagney <cagney@redhat.com>
+
+ Since the IRIX 4 configuration was forcing K&R mode it hasn't been
+ buildable since GDB 5.0.
+ * NEWS: Mention that IRIX 3 and IRIX 4 support were removed.
+ * configure.host: Delete "mips-sgi-irix3*" and "mips-sgi-irix4*".
+ * configure.tgt: Delete "mips*-sgi-*" a.k.a. irix3.
+ * irix4-nat.c: Delete file.
+ * config/mips/irix4.mh: Delete file.
+ * config/mips/irix3.mh: Delete file.
+ * config/mips/irix3.mt: Delete file.
+ * config/mips/tm-irix3.h: Delete file.
+ * config/mips/nm-irix3.h: Delete file.
+ * config/mips/xm-irix3.h: Delete file.
+ * config/mips/nm-irix4.h: Delete file.
+ * config/mips/xm-irix4.h: Delete file.
+ * config/mips/tm-irix5.h: Inline contents of "tm-irix3.h".
+
+2003-09-10 J. Brobecker <brobecker@gnat.com>
+
+ * hppa-tdep.c: Include "dis-asm.h". Fixes a build failure.
+ * Makefile.in (hppa-tdep.o): Update dependencies.
+
+2003-09-10 James E Wilson <wilson@specifixinc.com>
+
+ * MAINTAINERS: Change my e-mail address. Move to paper trail
+ section.
+
+2003-09-10 Kevin Buettner <kevinb@redhat.com>
+
+ * MAINTAINERS (frv): New ISA entry.
+
+2003-09-10 Kevin Buettner <kevinb@redhat.com>
+
+ * frv-tdep.c (dis-asm.h): Include.
+ * Makefile.in (frv-tdep.o): Update dependencies.
+
+2003-09-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ * ia64-tdep.c (ia64_sigtramp_frame_init_saved_regs):
+ Fix typo for high range of floating registers.
+
+2003-09-09 David Carlton <carlton@kealia.com>
+
+ * dwarf2read.c (dwarf2_build_psymtabs_hard): Move lowpc and
+ highpc initialization here out of scan_partial_symbols.
+ (scan_partial_symbols): Restructure into a recursive version,
+ calling add_partial_namespace and add_partial_enumeration when
+ appropriate.
+ (add_partial_namespace): New.
+ (add_partial_enumeration, locate_pdi_sibling): Ditto.
+
+2003-09-09 Andrew Cagney <cagney@redhat.com>
+
+ * rs6000-tdep.c (ppc_push_return_address): Delete function.
+ (rs6000_push_dummy_call): Set LR to BP_ADDR.
+ (rs6000_gdbarch_init): Do not set deprecated_push_return_address.
+ * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Ditto.
+
+ * rs6000-tdep.c (rs6000_fix_call_dummy): Delete function.
+ (rs6000_push_dummy_call): Set the "TOC" register.
+
+ * rs6000-tdep.c (rs6000_gdbarch_init): Do not set the deprecated
+ methods "max_register_raw_size", "max_register_virtual_size" or
+ "register_virtual_size".
+
+2003-09-09 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * MAINTAINERS: Update my e-mail address.
+
+2003-09-09 Andrew Cagney <cagney@redhat.com>
+
+ * rs6000-tdep.c (rs6000_store_struct_return): Delete function.
+ (rs6000_push_dummy_call): Store the struct return address.
+ * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Ditto.
+
+2003-09-09 Andrew Cagney <cagney@redhat.com>
+
+ * ppc-tdep.h (ppc_sysv_abi_push_dummy_call): Replace
+ "ppc_sysv_abi_push_arguments".
+ * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Replace
+ "ppc_sysv_abi_push_arguments".
+ * rs6000-tdep.c (rs6000_gdbarch_init): Set "push_dummy_call"
+ instead of "push_arguments".
+ (rs6000_push_dummy_call): Replace "rs6000_push_arguments".
+
+2003-09-09 Andrew Cagney <cagney@redhat.com>
+
+ * sh64-tdep.c (sh64_push_return_address): Use ENTRY_POINT_ADDRESS
+ instead of CALL_DUMMY_ADDRESS.
+
+2003-09-09 Paul N. Hilfinger <hilfingr@gnat.com>
+
+ * p-lang.c: Eliminate "register".
+ * c-lang.c: Ditto.
+ * expprint.c: Ditto.
+ * f-lang.c: Ditto.
+ * jv-lang.c: Ditto.
+ * language.c: Ditto.
+ * m2-lang.c: Ditto.
+ * parse.c: Ditto.
+ * scm-lang.c: Ditto.
+ * objc-lang.c: Ditto.
+
+2003-09-09 Nick Clifton <nickc@redhat.com>
+
+ * v850-tdep.c (v850_processor_type_table): Add bfd_mach_v850e1.
+
+2003-09-04 Andrew Cagney <cagney@redhat.com>
+
+ * avr-tdep.c: Include "dis-asm.h".
+ * cris-tdep.c: Include "dis-asm.h".
+ (cris_delayed_get_disassembler): Use "struct disassemble_info"
+ instead of corresponding typedef.
+ * h8300-tdep.c: Include "dis-asm.h".
+ * ia64-tdep.c: Include "dis-asm.h".
+ * i386-tdep.c: Include "dis-asm.h".
+ (i386_print_insn): Use "struct disassemble_info" instead of
+ corresponding typedef.
+ * m68k-tdep.c: Include "dis-asm.h".
+ * mcore-tdep.c: Include "dis-asm.h".
+ * mips-tdep.c: Include "dis-asm.h".
+ (gdb_print_insn_mips): Make static, use "struct disassemble_info"
+ instead of corresponding typedef.
+ * ns32k-tdep.c: Include "dis-asm.h".
+ * s390-tdep.c: Include "dis-asm.h".
+ * sparc-tdep.c: Include "dis-asm.h".
+ * vax-tdep.c: Include "dis-asm.h".
+ * v850-tdep.c: Include "dis-asm.h".
+ * mn10300-tdep.c: Include "dis-asm.h".
+ * rs6000-tdep.c: Include "dis-asm.h".
+ * xstormy16-tdep.c: Include "dis-asm.h".
+ (_initialize_xstormy16_tdep): Delete "extern" declaration of
+ print_insn_xstormy16.
+ * Makefile.in (v850-tdep.o): Update dependencies.
+ (vax-tdep.o, sparc-tdep.o, s390-tdep.o): Ditto.
+ (ns32k-tdep.o, mips-tdep.o, mcore-tdep.o): Ditto.
+ (m68k-tdep.o, ia64-tdep.o, i386-tdep.o): Ditto.
+ (h8300-tdep.o, cris-tdep.o, avr-tdep.o): Ditto.
+ (mn10300-tdep.o, xstormy16-tdep.o, disasm.o): Ditto.
+ (gdbarch_h): Remove $(dis_asm_h).
+ * disasm.c: Include "dis-asm.h".
+ (dis_asm_read_memory): Use "struct disassemble_info" instead of
+ corresponding typedef.
+ (dis_asm_memory_error, dump_insns, do_assembly_only): Ditto.
+ (gdb_disassemble_info, gdb_disassembly, gdb_print_insn): Ditto.
+ * gdbarch.sh: Do not include "dis-asm.h".
+ (struct disassemble_info): Declare opaque.
+ (TARGET_PRINT_INSN): Update declaration.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2003-09-08 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_CALL_DUMMY_ADDRESS): Rename
+ CALL_DUMMY_ADDRESS, change to a predicate.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * blockframe.c (deprecated_pc_in_call_dummy_at_entry_point):
+ Use either DEPRECATED_CALL_DUMMY_ADDRESS or entry_point_address.
+ * infcall.c (call_function_by_hand): Ditto.
+ * sparc-tdep.c (sparc_push_return_address): Ditto.
+ (sparc_gdbarch_init): Set deprecated_call_dummy_address.
+ * xstormy16-tdep.c (xstormy16_push_return_address): Replace
+ CALL_DUMMY_ADDRESS with entry_point_address.
+ * v850-tdep.c (v850_push_return_address): Ditto.
+ * s390-tdep.c (s390_push_return_address): Ditto.
+ * rs6000-tdep.c (ppc_push_return_address): Ditto.
+ * mn10300-tdep.c (mn10300_push_return_address): Ditto.
+ * mcore-tdep.c (mcore_push_return_address): Ditto.
+ * cris-tdep.c (cris_push_return_address): Ditto.
+ * arm-tdep.c (arm_push_return_address): Ditto.
+
+2003-09-08 Andrew Cagney <cagney@redhat.com>
+
+ * dwarf2-frame.c (enum dwarf2_reg_rule): New, replace anonymous
+ enum. Add REG_UNSPECIFIED, rename REG_UNSAVED to REG_UNDEFINED
+ and REG_UNMODIFIED to REG_SAME_VALUE.
+ (execute_cfa_program): Update.
+ (dwarf2_frame_cache): Update. Initialize table to
+ REG_UNSPECIFIED, complain if CFI fails to specify a register's
+ location.
+ (dwarf2_frame_prev_register): Update. Handle REG_UNSPECIFIED.
+
+2003-09-08 Andrew Cagney <cagney@redhat.com>
+
+ * gnu-nat.c: Remove "inline" function attribute.
+ * alpha-tdep.c, ppc-linux-tdep.c, macroexp.c: Ditto.
+
+2003-09-08 Kevin Buettner <kevinb@redhat.com>
+
+ * config/frv/frv.mt (SIM_OBS, SIM): Enable simulator for FR-V
+ target.
+
+2003-09-08 Kevin Buettner <kevinb@redhat.com>
+
+ * frv-tdep.c (frame-unwind.h, frame-base.h): Include.
+ (frame_extra_info): Rename this struct to frv_unwind_cache.
+ Delete fields ``fp_to_callers_sp_offset'' and ``lr_saved_on_stack''.
+ Add fields ``prev_sp'' and ``base''.
+ (frv_frame_chain, frv_frame_saved_pc, frv_frame_init_saved_regs)
+ (frv_saved_pc_after_call, frv_init_extra_frame_info)
+ (frv_push_return_address, frv_pop_frame, frv_pop_frame_regular):
+ Delete.
+ (frv_analyze_prologue): Add ``struct frv_unwind_cache *'' argument.
+ Revise all callers. Fill in the unwind cache argument and make
+ other adjustments to account for new frame mechanisms.
+ (frv_frame_unwind_cache, frv_frame_align, frv_unwind_pc)
+ (frv_frame_this_id, frv_frame_prev_register, frv_frame_sniffer)
+ (frv_frame_base_address, frv_unwind_dummy_id): New functions.
+ (frv_frame_unwind, frv_frame_base): New structs.
+ (frv_push_arguments): Change name to frv_push_dummy_call(). Add
+ additional arguments expected by this method and adjust function
+ body accordingly.
+ (frv_gdbarch_init): Remove calls to the following functions:
+ set_gdbarch_deprecated_init_frame_pc(),
+ set_gdbarch_deprecated_saved_pc_after_call(),
+ set_gdbarch_deprecated_frame_chain(),
+ set_gdbarch_deprecated_frame_saved_pc(),
+ set_gdbarch_deprecated_frame_init_saved_regs(),
+ set_gdbarch_deprecated_push_arguments(),
+ set_gdbarch_deprecated_push_return_address(),
+ set_gdbarch_deprecated_pop_frame(),
+ set_gdbarch_deprecated_call_dummy_words(),
+ set_gdbarch_deprecated_sizeof_call_dummy_words(),
+ set_gdbarch_deprecated_init_extra_frame_info(),
+ set_gdbarch_deprecated_dummy_write_sp(), and
+ set_gdbarch_deprecated_pc_in_call_dummy().
+ Add calls to the following functions:
+ set_gdbarch_unwind_pc(), set_gdbarch_unwind_sp(),
+ set_gdbarch_frame_align(), frame_unwind_append_sniffer(), and
+ frame_base_set_default().
+ * Makefile.in (frv-tdep.o): Update dependencies.
+
+2003-09-09 Mark Kettenis <kettenis@gnu.org>
+
+ * dwarf2-frame.c (read_encoded_value): Add support for
+ DW_EH_PE_aligned encoding.
+
+2003-09-08 Daniel Jacobowitz <drow@mvista.com>
+
+ * infrun.c (normal_stop): Don't print a message if the inferior
+ has exited.
+
+2003-09-08 Jim Blandy <jimb@redhat.com>
+
+ * Makefile.in (dbxread.o): Note new dependency on $(gdb_assert_h).
+ * dbxread.c: #include "gdb_assert.h".
+ (read_dbx_symtab): If the objfile has no .data section, use the
+ section index for the .bss section instead.
+
+2003-09-08 Daniel Jacobowitz <drow@mvista.com>
+
+ * frame.c (deprecated_safe_get_selected_frame): New function.
+ * frame.h (deprecated_safe_get_selected_frame): Add prototype.
+ * findvar.c (read_var_value): Call it.
+
+2003-09-08 Corinna Vinschen <vinschen@redhat.com>
+
+ * Makefile.in (ALLDEPFILES): Add sh64-tdep.c.
+ (sh64-tdep.o): Add dependencies.
+ * configure.tgt: Add FIXME to sh-*-linux*.
+ * sh-tdep.c: Move sh64 support to sh64-tdep.c.
+ (sh_gdbarch_init): Always set correct sh_show_regs function
+ pointer. Call sh64_gdbarch_init() if machine type is sh5.
+ * sh-tdep.h: Move sh64 support to sh64-tdep.c.
+ * sh64-tdep.c: New file, containing all sh64 related code from
+ sh-tdep.c.
+ * config/sh/embed.mt (TDEPFILES): Add sh64-tdep.o.
+ * config/sh/linux.mt (TDEPFILES): Ditto.
+ * config/sh/nbsd.mt (TDEPFILES): Ditto.
+ * config/sh/tm-sh.h: Drop REGISTER_TYPE definition.
+ * config/sh/wince.mt (TDEPFILES): Ditto.
+
+2003-09-07 Daniel Jacobowitz <drow@mvista.com>
+
+ * lin-lwp.c (detach_callback): Don't call stop_wait_callback.
+ (stop_wait_callback): Handle !lp->signalled also.
+ (lin_lwp_has_pending, flush_callback): New functions.
+ (lin_lwp_wait): Call flush_callback.
+ * linux-proc.c (linux_proc_add_line_to_sigset): New function.
+ (linux_proc_pending_signals): New function.
+ * linux-nat.h (linux_proc_pending_signals): Add prototype.
+
+2003-09-07 Daniel Jacobowitz <drow@mvista.com>
+
+ From Nick Kelsey <nickk@ubicom.com>:
+ * infrun.c (handle_inferior_event): Check IN_SOLIB_RETURN_TRAMPOLINE
+ when the stop PC is at the beginning of a function also.
+
+2003-09-06 Daniel Jacobowitz <drow@mvista.com>
+
+ * arm-linux-tdep.c (arm_linux_arm_be_breakpoint): New.
+ (arm_linux_init_abi): Use arm_linux_arm_be_breakpoint.
+
+2003-09-06 Mark Kettenis <kettenis@gnu.org>
+
+ * sol-thread.c: Include "gdb_string.h".
+
+2003-09-03 Mark Kettenis <m.kettenis@osp.nl>
+
+ * gcore.c: Reorder include files in alphabetical order. Include
+ "gdb_assert.h". Various coding style fixes.
+ (derive_stack_segment, derive_heap_segment): Replace check for
+ non-null BOTTOM and TOP with gdb_assert.
+ (derive_heap_segment): Replace check for successful creation of
+ ZERO with gdb_assert.
+ (make_mem_sec): Use bfd_section_lma to set OSEC->lma.
+
+2003-09-04 Andrew Cagney <cagney@redhat.com>
+
+ * thread-db.c (verbose_dlsym): New function.
+ (thread_db_load): Use verbose_dlsym
+ (thread_db_new_objfile): Print that libthread_db was loaded, and
+ that thread debugging was enabled.
+
+2003-09-04 Andrew Cagney <cagney@redhat.com>
+
+ * configure.tgt: Add "mips64*-*-*" target. Delete
+ mips64*el-*-ecoff*, mips64*el-*-elf*, mips*el-*-ecoff*,
+ mips*el-*-elf*, mips*-*-lnews*, mips*-*-sysv*, mips*-*-riscos*,
+ mips*-*-ecoff*, mips*-*-elf*, mips*-little-*, mips*-big-*,
+ mips*-dec-*, mips64*-big-*, mips64*vr*-*-elf*, mips64*-*-ecoff*,
+ mips*-sony-*, and mips64*-*-elf* targets.
+ * config/mips/embedl.mt: Delete file.
+ * config/mips/embedl64.mt: Delete file.
+ * config/mips/mips.mt: Delete file.
+ * config/mips/mips64.mt: Delete file.
+ * config/mips/tm-embed.h: Delete file.
+ * config/mips/embed.mt (TM_FILE): Set to "tm-mips.h".
+ * config/mips/embed64.mt: Delete out-of-date comment.
+
+2003-09-04 Andrew Cagney <cagney@redhat.com>
+
+ * hppa-tdep.c (hppa_gdbarch_init): Set
+ "have_nonsteppable_watchpoint".
+ * config/pa/nm-hppah.h (HAVE_NONSTEPPABLE_WATCHPOINT): Delete.
+ * mips-tdep.c (mips_dump_tdep): Do not print
+ HAVE_NONSTEPPABLE_WATCHPOINT.
+ (mips_gdbarch_init): Set "have_nonsteppable_watchpoint".
+ * config/mips/tm-embed.h (HAVE_NONSTEPPABLE_WATCHPOINT): Delete.
+ * config/mips/nm-irix5.h (HAVE_NONSTEPPABLE_WATCHPOINT): Delete.
+ * config/mips/nm-irix4.h (HAVE_NONSTEPPABLE_WATCHPOINT): Delete.
+
+2003-09-04 Corinna Vinschen <vinschen@redhat.com>
+
+ * breakpoint.c (watchpoint_check): Remove accidentally checked in
+ unused code. Add comment.
+
+2003-09-04 Corinna Vinschen <vinschen@redhat.com>
+
+ * breakpoint.c (watchpoint_check): Check for pc being in an
+ epilogue if watchpoint frame couldn't be found.
+
+2003-09-04 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in: Re-generate all dependencies.
+
+2003-09-03 Andrew Cagney <cagney@redhat.com>
+
+ * arch-utils.h (legacy_print_insn): Delete declaration.
+ * arch-utils.c (legacy_print_insn): Delete function.
+ * disasm.c (deprecated_tm_print_insn_info): Delete.
+ (_initialize_disasm): Delete function, contained code initializing
+ deprecated_tm_print_insn_info.
+ * gdbarch.sh (deprecated_tm_print_insn): Delete.
+ (deprecated_tm_print_insn_info): Delete.
+ (TARGET_PRINT_INSN): Do not provide a default.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2003-09-03 Andrew Cagney <cagney@redhat.com>
+
+ * disasm.c (fprintf_disasm): New function.
+ (gdb_disassemble_info): Call "init_disassemble_info", instead of
+ INIT_DISASSEMBLE_INFO_NO_ARCH. Do not initialize "insn_sets",
+ reverts 2003-08-14 change.
+ (_initialize_disasm): Call "init_disassemble_info", instead of
+ INIT_DISASSEMBLE_INFO_NO_ARCH.
+
+2003-09-03 Michael Snyder <msnyder@redhat.com>
+
+ * config/djgpp/fnchange.lst: Fix up sim/frv/profile-fr*.[ch].
+
+2003-09-03 Andrew Cagney <cagney@redhat.com>
+
+ * config/rs6000/tm-rs6000.h (IBM6000_TARGET): Delete definition.
+ * config/rs6000/nm-rs6000.h (DEPRECATED_IBM6000_TARGET): Define.
+ * symfile.c (syms_from_objfile): Update.
+ (reread_symbols): `Update
+ * exec.c (exec_file_attach): Update.
+ (exec_file_attach): Update.
+ * config/powerpc/tm-nbsd.h: Delete #undef IBM6000_TARGET, revert
+ 2003-08-29 change.
+ * config/powerpc/tm-linux.h: Delete #undef IBM6000_TARGET.
+
+2003-09-03 Daniel Jacobowitz <drow@mvista.com>
+
+ * arm-tdep.c: Include frame-unwind.h, frame-base.h, and
+ trad-frame.h.
+ (arm_get_cache): Delete macro.
+ (struct arm_prologue_cache): Update comments. Make saved_regs into
+ a trad_frame_saved_reg pointer. Remove unwound_pc; rename unwound_sp
+ to prev_sp.
+ (thumb_scan_prologue): Update for cache changes. Don't call
+ DEPRECATED_PC_IN_CALL_DUMMY.
+ (arm_scan_prologue): Update for cache changes. Take NEXT_FRAME
+ argument and use it in desperation search for our prologue. Do not
+ search past the specified PC.
+ (arm_make_prologue_cache): Simplify.
+
+ (arm_prologue_this_id, arm_prologue_prev_register)
+ (arm_prologue_unwind, arm_prologue_unwind_sniffer)
+ (arm_normal_frame_base, arm_normal_base, arm_make_sigtramp_cache)
+ (arm_sigtramp_this_id, arm_sigtramp_prev_register)
+ (arm_sigtramp_unwind, arm_sigtramp_unwind_sniffer)
+ (arm_unwind_dummy_id, arm_unwind_pc, arm_unwind_sp): New.
+
+ (arm_frame_chain_valid, arm_find_callers_reg)
+ (arm_frame_saved_pc, arm_read_fp, arm_frame_init_saved_regs)
+ (arm_pop_frame): Delete obsolete methods.
+ (arm_minimal_frame_chain, arm_minimal_frame_info): Delete.
+
+ (arm_gdbarch_init): Update for new frame methods. Register prologue
+ and sigtramp unwinders. Set the default frame base method.
+
+ * Makefile.in (arm-tdep.o): Update dependencies.
+ * varobj.c (find_frame_addr_in_frame_chain): Call
+ get_frame_base_address.
+ * std-regs.c (value_of_builtin_frame_fp_reg): Likewise.
+
+2003-09-03 Daniel Jacobowitz <drow@mvista.com>
+
+ * arm-tdep.c (arm_minimal_frame_chain): Renamed from
+ arm_frame_chain. Take NEXT_FRAME and CACHE arguments.
+ Use the cache instead of DEPRECATED_FRAME_SAVED_PC.
+ (arm_minimal_frame_info): Renamed from arm_init_extra_frame_info.
+ Take NEXT_FRAME and CACHE arguments. Call
+ FRAMELESS_FUNCTION_INVOCATION instead of checking FROMLEAF argument.
+ Set unwound_pc in CACHE instead of modifying the frame argument.
+ Don't bother checking the frame type when looking for sigtramp
+ frames.
+ (arm_make_prologue_cache, arm_frame_chain)
+ (arm_init_extra_frame_info): New functions.
+
+2003-09-03 Daniel Jacobowitz <drow@mvista.com>
+
+ * arm-tdep.c (arm_get_cache): Define.
+ (struct arm_prologue_cache): Renamed from frame_extra_info. Add
+ unwound_sp, unwound_pc, and saved_regs.
+ (thumb_scan_prologue): Take a cache instead of the frame.
+ (arm_scan_prologue): Likewise.
+ (arm_frame_chain): Create a temporary cache for arm_scan_prologue
+ instead of a temporary frame.
+ (arm_init_extra_frame_info): Allocate and use a cache.
+ (arm_frame_saved_pc, arm_pop_frame): Use the cache.
+
+2003-09-03 Andrew Cagney <cagney@redhat.com>
+
+ * config/arm/wince.mt (TM_CLIBS): Replace WIN32LIBS.
+ * config/mips/wince.mt (TM_CLIBS): Ditto.
+ * config/sh/wince.mt (TM_CLIBS): Ditto.
+ * config/pa/hppa64.mt (TM_CLIBS): Delete.
+ * config/sparc/sp64.mt (CC): Delete.
+
+2003-09-03 Andrew Cagney <cagney@redhat.com>
+
+ * defs.h: Do not include "arch-utils.h".
+ (GDB_MULTI_ARCH): If not defined, set to GDB_MULTI_ARCH_PARTIAL or
+ GDB_MULTI_ARCH_PURE.
+ * configure.in (GDB_MULTI_ARCH): Do not define.
+ * configure, config.in: Regenerate.
+ * configure.tgt: Do not set variable "gdb_multi_arch".
+ * config/s390/s390x.mt (GDB_MULTI_ARCH): Delete.
+ * config/s390/s390.mt (GDB_MULTI_ARCH): Delete.
+ * config/i386/x86-64linux.mt (GDB_MULTI_ARCH): Delete.
+ * config/v850/v850.mt (TM_FILE): Delete disabled definition.
+ * config/m68hc11/m68hc11.mt (TM_FILE): Delete definition.
+ * config/vax/tm-vax.h (GDB_MULTI_ARCH): Delete definition.
+ * config/sparc/tm-sparc.h (GDB_MULTI_ARCH): Delete definition.
+ * config/sparc/tm-sun4sol2.h (GDB_MULTI_ARCH): Delete definition.
+ * config/sparc/tm-nbsd.h (GDB_MULTI_ARCH): Delete definition.
+ * config/sparc/tm-linux.h (GDB_MULTI_ARCH): Delete definition.
+ * config/sparc/tm-sp64.h (GDB_MULTI_ARCH): Delete definition.
+ * config/pa/tm-hppa64.h (GDB_MULTI_ARCH): Delete definition.
+ * config/ns32k/tm-ns32k.h (GDB_MULTI_ARCH): Delete definition.
+ * config/m68k/tm-m68k.h (GDB_MULTI_ARCH): Delete definition.
+ * config/i386/tm-i386.h (GDB_MULTI_ARCH): Delete definition.
+ * config/h8300/tm-h8300.h (GDB_MULTI_ARCH): Delete definition.
+ * config/frv/tm-frv.h (GDB_MULTI_ARCH): Delete definition.
+ * config/alpha/tm-alpha.h (GDB_MULTI_ARCH): Delete definition.
+
+2003-08-30 Michael Chastain <mec@shout.net>
+
+ * Makefile.in: Remove tm-hp300bsd.h, tm-hp300hpux.h.
+ * config/m68k/nm-hp300hpux.h: Delete.
+ * config/m68k/tm-hp300hpux.h: Delete.
+ * config/m68k/xm-hp300hpux.h: Delete.
+ * config/m68k/xm-hp300bsd.h: Delete.
+ * config/djgpp/fnchange.lst: Remove nm-hp300hpux.h,
+ tm-hp300hpux.h, xm-hp300hpux.h.
+ * somsolib.c: Remove comment about hp300 shared libraries.
+
+2003-08-31 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-nat.c (ps_get_thread_area): Don't define as extern.
+ Only define PTRACE_GET_THREAD_AREA is not already defined.
+ Various style fixes in code and comments and some additional
+ spelling fixes in comments. Move after functions dealing with
+ debug registers.
+ * x86-64-linux-nat.c (ps_get_thread_area): Don't define as extern.
+ Fix coding-style.
+
+ * alphafbsd-tdep.c (alphafbsd_sigcontext_addr): Use
+ frame_unwind_register_unsigned instead of
+ frame_unwind_unsigned_register.
+
+2003-08-30 Mark Kettenis <kettenis@gnu.org>
+
+ * configure.in: Search for gethostbyname in libnsl.
+ * configure: Regenerated.
+
+2003-08-29 Mark Kettenis <kettenis@gnu.org>
+
+ * configure.in: Remove redundant AC_MSG_RESULT in check for
+ uintptr_t in stdint.h.
+ * configure: Regenerated.
+
+ * amd64-nat.h (struct regcache): Add opaque declaration.
+
+ * i386-linux-tdep.h (I386_LINUX_NUM_REGS): New define.
+ * x86-64-linux-nat.c: Include "i386-linux-tdep.h" and "amd64.h".
+ Change "register array" to "register cache" in comments.
+ (x86_64_linux_gregset64_reg_offset): New variable.
+ (GETREGS_SUPPLIES): Remove macro.
+ (supply_gregset): Call amd64_supply_native_gregset instead of
+ x86_64_linux_supply_gregset.
+ (fill_gregset): Rename `regno' to `regnum'. Call
+ amd64_collect_native_gregset instead of x86_64_linux_fill_gregset.
+ (store_regs): Rename `regno' to `regnum'.
+ (store_fpregs): Rename `regno' to `regnum'.
+ (fetch_inferior_registers): Rename `regno' to `regnum'. Use
+ amd64_native_gregset_supplies_p instead of GREGSET_SUPPLIES.
+ Reorganize function a bit.
+ (store_inferior_registers): Rename `regno' to `regnum'. Use
+ amd64_native_gregset_supplies_p instead of GREGSET_SUPPLIES.
+ Reorganize function a bit.
+ (_initialize_x86_64_linux_nat): New function.
+ * config/i386/x86-64linux.mh.
+
+2003-08-29 Andrew Cagney <cagney@redhat.com>
+
+ * config/mips/tm-embed.h (STOPPED_BY_WATCHPOINT): Delete macro.
+ (TARGET_CAN_USE_HARDWARE_WATCHPOINT): Delete macro.
+ (target_remove_watchpoint): Delete macro.
+ (target_insert_watchpoint): Delete macro.
+ (remote_mips_can_use_hardware_watchpoint): Delete declaration.
+ (remote_mips_stopped_by_watchpoint): Delete declaration.
+ (remote_mips_remove_watchpoint): Delete declaration.
+ (remote_mips_set_watchpoint): Delete declaration.
+ (TARGET_HAS_HARDWARE_WATCHPOINTS): Delete macro.
+ * remote-mips.c (_initialize_remote_mips): Set
+ "to_insert_watchpoint", "to_stopped_by_watchpoint",
+ "to_can_use_hardware_watchpoint", and "to_remove_watchpoint".
+ (mips_insert_watchpoint): Rename remote_mips_set_watchpoint.
+ (mips_remove_watchpoint): Rename remote_mips_remove_watchpoint.
+ (mips_stopped_by_watchpoint): Rename
+ remote_mips_stopped_by_watchpoint.
+ (mips_can_hardware_watchpoint): Rename
+ remote_mips_can_use_hardware_watchpoint, update function
+ signature.
+
+2003-08-29 Mark Kettenis <kettenis@gnu.org>
+
+ * x86-64-linux-tdep.c (user_to_gdb_regmap): Remove USER_CS and
+ USER_DS. We haven't given them a register number yet.
+
+ * amd64-nat.h: New file.
+ * amd64-nat.c: New file.
+ * amd64fbsd-nat.c: Include "amd64-nat.h".
+ (REG_ADDR, GETREGS_SUPPLIES): Remove macros.
+ (amd64fbsd32_r_reg_offset): New variable.
+ (supply_gregset): Simply call amd64_supply_native_gregset.
+ (fill_gregset): Rename `regno' to `regnum'. Simply call
+ amd64_collect_native_gregset.
+ (fill_fpregset): Rename `regno' to `regnum'.
+ (fetch_inferior_registers): Rename `regno' to `regnum'. Replace
+ usage of GETREGS_SUPPLIES with amd64_native_gregset_supplies_p.
+ Use `struct reg' and `struct fpreg' instead of `gregset_t' and
+ `fpregset_t'. Call amd64_supply_native_gregset instead of
+ supply_gregset. Call x86_64_supply_fxsave instead of
+ supply_fpregset.
+ (store_inferior_registers): Rename `regno' to `regnum'. Replace
+ usage of GETREGS_SUPPLIES with amd64_native_gregset_supplies_p.
+ Use `struct reg' and `struct fpreg' instead of `gregset_t' and
+ `fpregset_t'. Call amd64_collect_native_gregset instead of
+ fill_gregset. Call x86_64_collect_fxsave instead of
+ fill_fpregset.
+ (_initialize_am64fbsd_nat): Initialize
+ amd64_native_gregset32_reg_offset and
+ amd64_native_gregset64_reg_offset.
+ * config/i386/fbsd64.mh (NATDEPFILES): Add amd64-nat.o.
+
+ * regcache.c (regcache_raw_supply): Don't assert that BUF isn't a
+ null pointer. Fix typo in comment.
+
+ * regcache.c (supply_register): Reimplement to call
+ regcache_raw_supply.
+ (regcache_collect): Reimplement by calling regcache_raw_collect.
+
+2003-08-28 Mark Kettenis <kettenis@gnu.org>
+
+ * regcache.c (register_buffer): Consitify first argument.
+ (regcache_raw_supply, regcache_raw_collect): New
+ functions.
+
+2003-08-28 Daniel Jacobowitz <drow@mvista.com>
+
+ * config/powerpc/tm-nbsd.h: Undefine IBM6000_TARGET. Suggested
+ by Nathan J. Williams.
+
+2003-08-28 Daniel Jacobowitz <drow@mvista.com>
+
+ * lin-lwp.c (wait_lwp): New function, copied from
+ stop_wait_callback. Clean up.
+ (stop_wait_callback): Use wait_lwp.
+
+2003-08-28 Andrew Cagney <cagney@redhat.com>
+
+ * mips-tdep.c (gdb_print_insn_mips): Set the disassembler's
+ flavour and disassembler options.
+ (_initialize_mips_tdep): Do not set deprecated_tm_print_insn.
+ (mips_gdbarch_init): Set "print_insn". Delete initialization of
+ deprecated_tm_print_insn_info.
+
+2003-08-27 Andrew Cagney <cagney@redhat.com>
+
+ * s390-tdep.c (s390_readinstruction): Delete "info" parameter.
+ Use target_read_memory.
+ (s390_get_frame_info): Update. Do not reference
+ deprecated_tm_print_insn_info.
+ (s390_check_function_end, s390_is_sigreturn): Ditto.
+
+2003-08-27 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in (cris-tdep.o): Update dependencies.
+ * cris-tdep.c: Include "gdb_assert.h".
+ (cris_gdbarch_init): Set print_insn.
+ (_initialize_cris_tdep): Do not set deprecated_tm_print_insn.
+ (cris_delayed_get_disassembler): Simplify, directly call the
+ disassembler returned by cris_get_disassembler.
+ * hppa-tdep.c (hppa_gdbarch_init): Set print_insn.
+ (_initialize_hppa_tdep): Do not set deprecated_tm_print_insn.
+ * ns32k-tdep.c (ns32k_gdbarch_init): Set print_insn.
+ (_initialize_ns32k_tdep): Do not set deprecated_tm_print_insn.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Set print_insn.
+ (_initialize_mn10300_tdep): Do not set deprecated_tm_print_insn.
+ * mcore-tdep.c (mcore_gdbarch_init): Set print_insn.
+ (_initialize_mcore_tdep): Do not set deprecated_tm_print_insn.
+ * frv-tdep.c (frv_gdbarch_init): Set print_insn.
+ (_initialize_frv_tdep): Do not set deprecated_tm_print_insn.
+ * sparc-tdep.c (sparc_gdbarch_init): Set print_insn.
+ (gdb_print_insn_sparc): Delete function.
+ (_initialize_sparc_tdep): Do not set deprecated_tm_print_insn or
+ deprecated_tm_print_insn_info.
+ * v850-tdep.c (v850_gdbarch_init): Set print_insn.
+ (_initialize_v850_tdep): Do not set deprecated_tm_print_insn.
+ (v850_gdbarch_init): Do not set deprecated_tm_print_insn_info.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Set print_insn.
+ (_initialize_xstormy16_tdep): Do not set deprecated_tm_print_insn.
+ * s390-tdep.c (gdb_print_insn_s390): Delete function.
+ (_initialize_s390_tdep): Do not set deprecated_tm_print_insn.
+ (s390_gdbarch_init): Set print_insn.
+
+2003-08-27 Andrew Cagney <cagney@redhat.com>
+
+ * ppc-linux-tdep.c (ppc64_call_dummy_address): Delete function.
+ (ppc_linux_init_abi): For PPC64, do not set call_dummy_address.
+ * infcall.c (call_function_by_hand): Convert the entry point
+ address into a code address.
+
+2003-08-27 Andrew Cagney <cagney@redhat.com>
+
+ * dsrec.c: Include "gdb_string.h".
+ * Makefile.in (dsrec.o): Update dependencies.
+
+2003-08-27 Michael Chastain <mec@shout.net>
+
+ * config/djgpp/fnchange.lst: Add gdb/testsuite/gdb.mi/mi2-var-*.
+
+2003-08-27 Andrew Cagney <cagney@redhat.com>
+
+ * alpha-osf1-tdep.c (alpha_call_dummy_address): Delete function.
+ (alpha_osf1_init_abi): Do not set call_dummy_address.
+
+2003-08-27 David Carlton <carlton@kealia.com>
+
+ From Randolph Chung <tausq@debian.org>:
+ * linux-proc.c (linux_info_proc_cmd): rework the code so that it
+ compiles with -Wformat-nonliteral -Werror.
+
+2003-08-26 Jim Blandy <jimb@redhat.com>
+
+ * solib-svr4.c (bfd_lookup_symbol): New SECT_FLAGS argument.
+ (enable_break): Pass SEC_CODE as the SECT_FLAGS argument to
+ bfd_lookup_symbol, since we only want symbols in code sections.
+ (look_for_base): Pass zero as the SECT_FLAGS argument to
+ bfd_lookup_symbol, since we're not concerned about which section
+ the symbol is in.
+
+2003-08-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ * ia64-tdep.c (examine_prologue): Only stop at predicated insns if
+ we are frameless or the return address register is already known.
+
+2003-08-26 Andrew Cagney <cagney@redhat.com>
+
+ * i386-linux-nat.c (ps_get_thread_area): Make "desc" four "int"s
+ in size. Add comments.
+
+2003-08-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ * ia64-tdep.c (ia64_convert_from_func_addr): New function.
+ (ia64_gdbarch_init): Call set_gdbarch_convert_from_func_addr().
+
+2003-08-26 Jason Merrill <jason@redhat.com>
+
+ * dwarf2read.c (dwarf_attr_name): Move DW_AT_MIPS_linkage_name
+ case out of #ifdef MIPS block.
+
+2003-08-25 Daniel Jacobowitz <drow@mvista.com>
+
+ PR java/1322
+ * dwarf2-frame.c (dwarf2_frame_find_fde): Check whether any FDEs are
+ available before calling SECT_OFF_TEXT.
+ * PROBLEMS: Remove description of java/1322.
+
+2003-08-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ * ia64-tdep.c (pseudo_regs): New enum that lists gr32-gr127, p0-p63,
+ bof, and nat0-nat127 as pseudo-registers.
+ (ia64_frame_cache): New struct used to cache frame info.
+ (ia64_register_reggroup_p): New routine used to override default
+ register grouping so registers without names are still saved and
+ restored.
+ (ia64_dwarf_reg_to_regnum): New routine to map gr32-gr127 to their
+ pseudo values.
+ (ia64_pseudo_register_read): New routine to read pseudo-registers.
+ (ia64_pseudo_register_write): New routine to write pseudo-registers.
+ (ia64_alloc_frame_cache): New routine to create a new
+ ia64_frame_cache.
+ (examine_prologue): Change prototype to add next_frame pointer.
+ Assume frameless until otherwise proven. Verify that the cfm for
+ current frame matches the cfm that should occur for the prologues
+ alloc insn and if equal, mark as not frameless. At end of routine,
+ if not frameless, calculate registers for the previous frame and store
+ in the cache, if a cache is provided.
+ (ia64_skip_prologue): Use new prototype when calling examine_prologue
+ and pass 0 for next_frame.
+ (ia64_store_return_value): Change to use convert_typed_floating()
+ instead of calling ia64_convert_to_raw().
+ (ia64_extract_return_value): Change to use convert_typed_floating()
+ instead of calling ia64_convert_to_virtual().
+ (ia64_frame_cache): New routine to support new frame model.
+ (ia64_frame_this_id, ia64_frame_prev_register): Ditto.
+ (ia64_frame_sniffer): Ditto.
+ (ia64_sigtramp_frame_init_saved_regs): Ditto.
+ (ia64_sigtramp_frame_cache, ia64_sigtramp_frame_this_id): Ditto.
+ (ia64_sigtramp_frame_prev_register): Ditto.
+ (ia64_sigtramp_frame_sniffer): Ditto.
+ (ia64_frame_base_address): Ditto.
+ (ia64_extract_struct_value_address): Change to issue error message.
+ (ia64_frame_align): New routine to align sp.
+ (ia64_push_dummy_call): New routine based on ia64_push_arguments().
+ (ia64_push_arguments): Removed. Logic moved to
+ ia64_push_dummy_call().
+ (ia64_push_return_address): Ditto.
+ (ia64_unwind_dummy_id): New function.
+ (ia64_unwind_pc): Ditto.
+ (ia64_convert_register_p): Ditto.
+ (ia64_register_to_value): Ditto.
+ (ia64_value_to_register): Ditto.
+ (ia64_pop_frame, ia64_pop_frame_regular): Removed.
+ (ia64_register_byte, ia64_register_raw_size): Ditto.
+ (ia64_register_virtual_size, ia64_register_virtual_byte): Ditto.
+ (ia64_saved_pc_after_call): Ditto.
+ (ia64_frame_chain, ia64_frame_saved_pc): Ditto.
+ (ia64_frame_init_saved_regs, ia64_get_saved_register): Ditto.
+ (ia64_register_convertible, ia64_register_convert_to_virtual): Ditto.
+ (ia64_register_convert_to_raw): Ditto.
+ (ia64_store_struct_return, ia64_call_dummy_words): Ditto.
+ (ia64_init_extra_frame_info): Ditto.
+ (ia64_frame_args_address, ia64_frame_locals_address): Ditto.
+ (ia64_gdbarch_init): Remove registering of deprecated functions that
+ are no longer used. Add registration of new gdbarch functions.
+ Remove registering deprecated_write_sp. Replace
+ set_gdbarch_register_virtual_type() with set_gdbarch_register_type().
+ Delete set_gdbarch_deprecated_register_convertible(),
+ set_gdbarch_deprecated_register_convert_to_virtual(), and
+ set_gdbarch_deprecated_register_convert_to_raw() calls. Remove
+ set_gdbarch_deprecated_register_size(),
+ set_gdbarch_deprecated_register_bytes(),
+ set_gdbarch_pcregnum(),
+ set_gdbarch_deprecated_register_byte(),
+ set_gdbarch_deprecated_register_raw_size(),
+ set_gdbarch_deprecated_max_register_raw_size(),
+ set_gdbarch_deprecated_register_virtual_size(),
+ and set_gdbarch_deprecated_max_register_virtual_size() calls.
+ Replace set_gdbarch_deprecated_extract_return_value() with
+ set_gdbarch_extract_return_value(). Remove calls to:
+ set_gdbarch_deprecated_saved_pc_after_call();
+ set_gdbarch_deprecated_frame_chain(),
+ set_gdbarch_deprecated_frame_saved_pc(),
+ set_gdbarch_deprecated_frame_init_saved_regs(),
+ set_gdbarch_deprecated_get_saved_register(),
+ set_gdbarch_deprecated_call_dummy_words(),
+ set_gdbarch_deprecated_sizeof_call_dummy_words(),
+ set_gdbarch_deprecated_init_extra_frame_info(),
+ set_gdbarch_deprecated_frame_args_address(),
+ set_gdbarch_deprecated_frame_locals_address(),
+ and set_gdbarch_deprecated_dummy_write_sp().
+ Add set_gdbarch_convert_register_p(),
+ set_gdbarch_register_to_value(),
+ set_gdbarch_value_to_register(),
+ set_gdbarch_push_dummy_call(),
+ set_gdbarch_frame_align(),
+ set_gdbarch_unwind_dummy_id(),
+ set_gdbarch_unwind_pc(),
+ frame_unwind_append_sniffer(),
+ frame_unwind_append_sniffer(),
+ and frame_base_set_default().
+
+2003-08-25 Chris Demetriou <cgd@broadcom.com>
+
+ * configure.tgt: Document need for special "mipsisa64" handling.
+ (mipsisa64*-*-linux64): Handle as target linux64.
+ (mipsisa64*-*-*): Handle as target embed64.
+
+2003-08-18 Michael Chastain <mec@shout.net>
+
+ * PROBLEMS: Document pr gdb/1322, the Java anonymous
+ objfile bug.
+
+2003-08-24 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-tdep.h: Update copyright date.
+ (I387_SIZEOF_FSAVE, I387_SIZEOF_FXSAVE): New defines.
+
+ * linux-proc.c (linux_proc_xfer_memory): Remove comment about
+ CFLAGS games to reflect reality.
+
+2003-08-24 Andrew Cagney <cagney@redhat.com>
+
+ * arm-tdep.c (_initialize_arm_tdep): Simplify by assuming
+ GDB_MULTI_ARCH is always non-zero.
+ * osabi.c (_initialize_gdb_osabi): Ditto.
+ (gdbarch_init_osabi): Ditto.
+ * sparc-tdep.c: Ditto for #if code.
+
+2003-08-23 Mark Kettenis <kettenis@gnu.org>
+
+ * x86-64-tdep.c (x86_64_supply_fxsave): Add `regnum' argument.
+ Update comments.
+ * x86-64-tdep.h (x86_64_supply_fxsave): Adjust prototype. Update
+ comments.
+ * x86-64-linux-tdep.c (fetch_core_registers): Adjust call to
+ x86_64_supply_fxsave.
+ * x86-64-linux-nat.c (supply_fpregset): Adjust call to
+ x86_64_supply_fxsave.
+ * amd64fbsd-nat.c (supply_fpregset): Adjust call to
+ x86_64_supply_fxsave.
+
+2003-08-23 Andreas Jaeger <aj@suse.de>
+
+ * x86-64-tdep.c (x86_64_supply_fxsave): Adjust call to
+ i387_supply_fxsave.
+
+2003-08-23 Mark Kettenis <kettenis@gnu.org>
+
+ * go32-nat.c (fetch_register): Call i387_supply_fsave instead of
+ i387_supply_register.
+ (go32_fetch_registers): Adjust call to i387_supply_fsave.
+ * i386nbsd-tdep.c (fetch_core_registers): Adjust call to
+ i387_supply_fsave.
+ (fetch_elfcore_registers): Adjust call to i387_supply_fsave and
+ i387_supply_fxsave.
+ * i386obsd-tdep.c (fetch_core_registers): Adjust call to
+ i387_supply_fsave.
+ * i386bsd-nat.c (supply_fpregset): Adjust call to
+ i387_supply_fsave.
+ (fetch_inferior_registers): Remove extraneous whitespace. Adjust
+ call to i387_supply_fxsave. Call i387_supply_fsave instead of
+ supply_fpregset.
+ (store_inferior_registers): Remove extraneous whitespace. Call
+ i387_fill_fsave instead of fill_fpregset.
+ * i386gnu-nat.c (fetch_fpregs): Adjust call to i387_supply_fsave.
+ (supply_fpregset): Likewise.
+ * i386v4-nat.c (supply_fpregset): Adjust call to
+ i387_supply_fsave.
+ * i386-interix-nat.c (supply_fpregset): Adjust call to
+ i387_supply_fsave.
+ * i386-linux-nat.c (supply_fpregset): Adjust call to
+ i387_supply_fsave.
+ (supply_fpxregset): Adjust call to i387_adjust_fxsave.
+ * i386-nto-tdep.c (i386nto_supply_fpregset): Adjust calls to
+ i387supply_fsave and i387_supply_fxsave.
+ * i387-tdep.c (i387_supply_fsave): Add `regnum' argument.
+ Incorporate code from `i387_supply_register.
+ (i387_supply_register): Remove.
+ (i387_supply_fxsave): Add `regnum' argument.
+ Update comments.
+ * i387-tdep.h (i387_supply_fsave, i387_supply_fsxave): Adjust
+ prototype.
+ (i387_supply_register): remove prototype.
+ Update comments.
+
+2003-08-22 Michael Chastain <mec@shout.net>
+
+ * config/djgpp/fnchange.lst: Remove gdb/testsuite/gdb.c++/*.
+ Add lines for files in gdb/testsuite/gdb.cp/* that are
+ still not 8.3 unique.
+
+2003-08-22 Daniel Jacobowitz <drow@mvista.com>
+
+ * gnu-v3-abi.c (gnuv3_baseclass_offset): Check whether
+ TYPE_VPTR_FIELDNO is valid.
+
+2003-08-19 Mark Kettenis <kettenis@gnu.org>
+
+ * utils.c (set_width_command): Remove prototypes.
+ (set_screen_size): New prototype.
+ (init_page_info): Simplify by fetching the screen size from
+ Readline. Call set_screen_size.
+ (set_screen_size): New function.
+ (set_width): Add missing whitespace in comment.
+ (set_width_command): Call set_screen_size.
+ (set_height_command): New function.
+ (initialize_utils): Fix formatting. Make "set height" command
+ call set_height_command. Remove redundant code that turns off
+ pagination if output isn't a terminal. Remove redundant call to
+ set_width_command.
+
+2003-08-22 Mark Kettenis <kettenis@gnu.org>
+
+ * sparc64-tdep.h (sparc64_regnum): Fix comment.
+ (sparc64_supply_rwindow, sparc64_fill_rwindow): Remove prototypes.
+ (sparc_supply_rwindow, sparc_fill_rwindow): New prototypes.
+ * sparc64-tdep.c (sparc64_pseudo_register_read): Add missing
+ `case' keyword.
+ (sparc64_register_info): Give the reister with number
+ SPARC64_STATE_REGNUM a name.
+ (sparc64_pseudo_register_write): Add support for %cwp, %pstate,
+ %asi and %ccr.
+ (sparc64_push_dummy_call): Take BIAS into account when checking
+ stcak alignment.
+ (sparc_software_single_step): Remove assertions that check whether
+ NPC and NNPC were zero.
+ (sparc_supply_rwindow): Make public. Merge functionality with
+ sparc64_supply_rwindow.
+ (sparc_fill_rwindow): Make public. Merge functionality with
+ sparc64_fill_rwindow.
+ (sparc64_supply_rwindow, sparc64_fill_rwindow): Remove.
+ * sparc64fbsd-nat.c (_initialize_sparc64fbsd_nat): Set
+ SPARCBSD_FPREG_SUPPLIES_P to sparc64fbsd_fpreg_supplies_p.
+ * sparc64fbsd-tdep.c (sparc64fbsd_supply_reg): Call
+ sparc_supply_rwindow instead of sparc64_supply_rwindow.
+
+ * reggroups.c: Add whitespace after declarations of local
+ variables in functions.
+
+2003-08-21 Michael Chastain <mec@shout.net>
+
+ * gdbtypes.h: Change array bound type from an int to enum.
+
+2003-08-21 Andrew Cagney <cagney@redhat.com>
+
+ * config/sparc/tm-sp64.h: Delete #if !GDB_MULTI_ARCH and #if 0 code.
+ * config/sparc/tm-sparc.h: Ditto.
+ * config/arm/tm-arm.h (GDB_MULTI_ARCH): Define GDB_MULTI_ARCH
+ unconditionally.
+ * config/pa/tm-hppa.h (GDB_MULTI_ARCH): Ditto.
+
+2003-07-13 Mark Kettenis <kettenis@gnu.org>
+
+ * objfiles.h (struct objfile): Add memebers `data' and `num_data'.
+ (register_objfile_data, set_objfile_data, objfile_data): New
+ prototypes.
+ * objfiles.c (objfile_alloc_data, objfile_free_data): New
+ prototypes.
+ (allocate_objfile): Call objfile_alloc_data.
+ (free_objfile): Call objfile_free_data.
+ (struct objfile_data): New.
+ (struct objfile_data_registration): New.
+ (struct objfile_data_registry): New.
+ (objfile_data_registry): New variable.
+ (register_objfile_data): New function.
+ (objfile_alloc_data, objfile_free_data): New functions.
+ (set_objfile_data, objfile_data): New functions.
+ * dwarf2-frame.c (dwarf2_frame_data): New variable.
+ (dwarf2_frame_find_fde, add_fde): Use new per-objfile data mechanism.
+ (_initialize_dwarf2_frame): New function and prototype.
+
+2003-08-21 Andrew Cagney <cagney@redhat.com>
+
+ * sh3-rom.c (sh3_open, sh3e_open): Use gdbarch_update_p to select
+ a specific architecture.
+ * arch-utils.h (set_architecture_from_arch_mach): Delete
+ declaration.
+ (target_architecture_hook): Delete declaration.
+ * arch-utils.c: Delete non GDB_MULTI_ARCH includes.
+ (default_float_format): Assume GDB_MULTI_ARCH.
+ (default_double_format): Assume GDB_MULTI_ARCH.
+ (set_endian_from_file): Delete function.
+ (arch_ok): Delete function.
+ (set_arch): Delete function.
+ (set_architecture_from_arch_mach): Delete function.
+ (set_architecture_from_file): Delete function.
+ (set_architecture): Assume GDB_MULTI_ARCH.
+ (set_gdbarch_from_file): Assume GDB_MULTI_ARCH.
+
+2003-08-21 Mark Kettenis <kettenis@gnu.org>
+
+ Rewrite FreeBSD/sparc64 native configuration.
+ * sparcbsd-nat.c, sparcbsd-nat.h: New files.
+ * sparc64fbsd-nat.c: New file.
+ * sparc64fbsd-tdep.c: New file.
+ * sparc64-tdep.c sparc64-tdep.h: New files.
+ * Makefile.in (sparcbsd-nat.o, sparc64fbsd-nat.o, sparc64-tdep.o,
+ sparc64fbsd-tdep.o): New dependencies.
+ (SFILES): Add sparcbsd-nat.c, sparc64fbsd-nat.c, sparc64-tdep.c
+ and sparc64fbsd-tdep.c.
+ (sparc64_tdep_h, sparcbsd_nat_h): New variables.
+ * config/sparc/fbsd.mh: Remove copyright notice.
+ (NATDEPFILES): Remove sparc-nat.o, add sparc64fbsd-nat.o and
+ sparcbsd-nat.o.
+ * config/sparc/fbsd.mt: Remove copyright notice.
+ (TDEPFILES): Remove sparc-tdep.o, solib.o solib-svr4.o,
+ solib-legacy.o. Add sparc64-tdep.o and sparc64fbsd-tdep.o.
+ * config/sparc/nm-fbsd.h: Don't include "elf/common.h".
+ (SVR4_SHARED_LIBS, PTRACE_GETREGS, PTRACE_SETREGS,
+ PTRACE_GETFPREGS, PTRACE_SETFPREGS, GDB_GREGSET_T, GDB_FPREGSET_T,
+ regs, r_g1, r_ps, r_pc, r_npc, r_y, FPU_FSR_TYPE, fp_status, fpu,
+ fpu_regs, fp_fr, fpu_fsr, Fpu_fsr): Remove defines.
+ * config/sparc/tm-fbsd.h: Don't include "solib.h" and
+ "sparc/tm-sp64.h".
+ (SVR4_SHARED_LIBS, START_INFERIOR_TRAPS_EXPECTED): Remove defines.
+ (GDB_MULTI_ARCH): Define to GDB_MULTI_ARCH_TM.
+
+2003-08-21 Michael Chastain <mec@shout.net>
+
+ * symtab.h: Add doco on the space critical structures and
+ some measurements of space usage.
+
+2003-08-21 Michael Snyder <msnyder@redhat.com>
+
+ * tracepoint.c (trace_dump_command): Trace break address
+ is subject to DECR_PC_AFTER_BREAK.
+ (set_traceframe_context): Make "trace_line" an int.
+ Fixes suggested by Mark Newman <mark.newman@lmco.com>
+
+2003-08-20 Michael Snyder <msnyder@redhat.com>
+
+ * sh-tdep.h (struct gdbarch_tdep): New member FLOAT_ARGLAST_REG.
+ * sh-tdep.c (sh_gdbarch_init): For sh2e, sh3e, and sh4, set
+ FLOAT_ARG0_REGNUM and FLOAT_ARGLAST_REGNUM, to be used for
+ argument passing.
+ (sh_push_dummy_call_fpu, sh_push_dummy_call_nofpu): New
+ functions, replace sh_push_dummy_call.
+ (sh_gdbarch_init): Set push_dummy_call to one of new methods.
+
+2003-08-20 Michael Chastain <mec@shout.net>
+
+ * gdbtypes.h (struct main_type): Rearrange to save space.
+
+2003-08-20 Michael Snyder <msnyder@redhat.com>
+
+ * trad-frame.c: Comment typo fix.
+
+2003-08-20 Michael Snyder <msnyder@redhat.com>
+ Kevin Buettner <kevinb@redhat.com>
+
+ * frv-tdep.c (gdb_string.h, frame.h, trad-frame.h): Include.
+ (frv_frame_init_saved_regs): Add declaration.
+ (frame_extra_info): Add new field ``saved_regs''.
+ (frv_frame_chain, frv_frame_saved_pc, frv_analyze_prologue)
+ (frv_skip_prologue, frv_init_extra_frame_info, frv_pop_frame_regular):
+ Update frame related code.
+ (frv_extract_struct_value_address): Adjust formatting.
+ * Makefile.in (frv-tdep.o): Update dependencies.
+ * config/frv/tm-frv.h (target_insert_watchpoint)
+ (target_remove_watchpoint, target_insert_hw_breakpoint)
+ (target_remove_hw_breakpoint): Delete these macros.
+ (remote_insert_watchpoint, remote_remove_watchpoint)
+ (remote_insert_hw_watchpoint, remote_remove_hw_watchpoint): Remove
+ these declarations.
+
+2003-08-20 Michael Chastain <mec@shout.net>
+
+ * defs.h (ENUM_BITFIELD): New macro.
+ * symtab.h (ENUM_BITFIELD): Use it.
+ (BYTE_BITFIELD): Remove old macro, which was already disabled.
+
+2003-08-19 Shrinivas Atre <shrinivasa@kpitcummins.com>
+
+ * MAINTAINERS (write after approval): Add myself.
+
+2003-08-18 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh (FRAME_RED_ZONE_SIZE): New architecture method.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * infcall.c (call_function_by_hand): Adjust the SP by
+ frame_red_zone_size before allocating any stack space.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Set "frame_red_zone_size".
+ * x86-64-tdep.c (x86_64_frame_align): New function.
+ (x86_64_init_abi): Set "frame_red_zone_size" and "frame_align".
+
+ * x86-64-tdep.c (x86_64_push_arguments): Revert 2003-08-07 change.
+ Remove code adjusting SP so that it skips over the Red Zone.
+
+2003-08-18 Mark Kettenis <kettenis@gnu.org>
+
+ * NEWS (New native configurations): Mention FreeBSD/amd64.
+
+2003-08-18 Andrew Cagney <cagney@redhat.com>
+
+ * m68hc11-tdep.c (m68hc11_gdbarch_init): Do not set
+ "dwarf2_build_frame_info". Append "m68k_frame_sniffer" instead of
+ "m68k_frame_p".
+ (m68hc11_frame_sniffer): Replace "m68hc11_frame_p".
+
+2003-08-18 Mark Kettenis <kettenis@gnu.org>
+
+ * x86-64-tdep.c (x86_64_dwarf_regmap): Remove trailing whitespace.
+
+2003-08-18 Michal Ludvig <mludvig@suse.cz>
+
+ * config/i386/nm-x86-64linux.h (LINUX_CHILD_POST_STARTUP_INFERIOR):
+ Define.
+ * i386-linux-nat.c: Include "linux-nat.h".
+ (child_post_startup_inferior): New function.
+
+2003-08-18 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.c (i386_analyze_register_saves): Handle register saves
+ at the start of a frameless function. This probably fixes PR
+ backtrace/1338.
+
+2003-08-17 Michael Chastain <mec@shout.net>
+
+ * symfile.c (find_sym_fns): Remove special case for apollo target.
+
+2003-08-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * linux-nat.c (PTRACE_O_TRACEVFORKDONE, PTRACE_O_TRACEEXIT): Define.
+ (PTRACE_EVENT_VFORKDONE, PTRACE_EVENT_EXIT): Define.
+ (linux_parent_pid, linux_supports_tracevforkdone_flag): New variable.
+ (linux_test_for_tracefork): Set linux_supports_tracevforkdone_flag.
+ (linux_supports_tracevforkdone): New function.
+ (linux_enable_event_reporting): Enable TRACEVFORK, TRACEEXEC, and
+ TRACEVFORKDONE.
+ (child_follow_fork): Handle vfork.
+ (linux_handle_extended_wait): Likewise. Also handle exec.
+ (child_insert_vfork_catchpoint, child_insert_exec_catchpoint): Enable.
+ * NEWS: Mention fork tracing.
+
+2003-08-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * lin-lwp.c (child_wait): Call linux_record_stopped_pid.
+
+2003-08-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * Makefile.in (i386-linux-nat.o): Update dependencies.
+ * config/i386/nm-linux.h (LINUX_CHILD_POST_STARTUP_INFERIOR): Define.
+ * config/nm-linux.h (CHILD_POST_STARTUP_INFERIOR, CHILD_POST_ATTACH)
+ (CHILD_FOLLOW_FORK, KILL_INFERIOR): Define.
+ * i386-linux-nat.c: Include "linux-nat.h".
+ (child_post_startup_inferior): New function.
+ * i386-nat.c (child_post_startup_inferior): Wrap in #ifdef.
+ * infptrace.c (kill_inferior): Wrap in #ifdef.
+ * lin-lwp.c (lin_lwp_attach_lwp): Call child_post_attach after
+ attaching to each LWP.
+ (child_wait, lin_lwp_wait): Call linux_handle_extended_wait.
+ (init_lin_lwp_ops): Fill in some more operations.
+ * linux-nat.h (linux_enable_event_reporting)
+ (linux_handle_extended_wait, linux_child_post_startup_inferior): New
+ prototypes.
+ * linux-nat.c (linux_enable_event_reporting): New function.
+ (child_post_attach, linux_child_post_startup_inferior)
+ (child_post_startup_inferior, child_follow_fork)
+ (linux_handle_extended_wait, kill_inferior): New functions.
+
+2003-08-16 Andrew Cagney <cagney@redhat.com>
+
+ * gdbarch.sh: Delete all #if not GDB_MULTI_ARCH code.
+ * gdbarch.h, gdbarch.c: Re-generate.
+
+2003-08-16 Mark Kettenis <kettenis@gnu.org>
+
+ * config/alpha/nm-fbsd.h (SVR4_SHARED_LIBS): Remove define.
+
+2003-08-16 Andrew Cagney <cagney@redhat.com>
+
+ * NEWS: Mention that "set prompt-escape-char" was deleted.
+ * top.c (get_prompt_1): Delete function.
+ (gdb_prompt_escape):
+ (init_main): Do not clear "gdb_prompt_escape". Delete "set
+ prompt-escape-char" command.
+ (MAX_PROMPT_SIZE): Delete macro.
+ (get_prompt): Simplify, do not call get_prompt_1.
+
+2003-08-16 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in (printcmd.o, valprint.o): Do not try to build with
+ -Werror. -Wformat-nonliteral problems.
+
+2003-08-15 J. Brobecker <brobecker@gnat.com>
+
+ Further multiarching work mostly for hppa64-*-hpux11:
+ * hppa-tdep.h: New file.
+ * hppa-tdep.c: #include hppa-tdep.c.
+ (hppa32_num_regs): Renamed from hppa_num_regs.
+ (hppa64_num_regs): New constant.
+ (hppa64_call_dummy_breakpoint_offset): New constant.
+ (hppa32_call_dummy_length): New constant.
+ (hppa64_call_dummy_length): New constant.
+ (hppa32_stack_align): Make name 32bit explicit.
+ (hppa32_register_virtual_type): Likewise.
+ (hppa32_extract_return_value): Likewise.
+ (hppa32_use_struct_convention): Likewise.
+ (hppa32_store_return_value): Likewise.
+ (hppa64_register_virtual_type): New function.
+ (hppa64_extract_return_value): New function.
+ (hppa64_use_struct_convention): New function.
+ (hppa64_store_return_value): New function.
+ (hppa_frame_locals_address): Remove declaration, function does
+ not exist anymore.
+ (hppa_register_byte): Add support for PA64 ABI.
+ (hppa_gdbarch_init): Add support for PA64 ABI.
+ * hppa-hpux-tdep.c (hppa32_hpux_frame_saved_pc_in_sigtramp):
+ Make name 32bit explicit.
+ (hppa32_hpux_frame_base_before_sigtramp): Likewise.
+ (hppa32_hpux_frame_find_saved_regs_in_sigtramp): Likewise.
+ (hppa64_hpux_frame_saved_pc_in_sigtramp): New function.
+ (hppa64_hpux_frame_base_before_sigtramp): New function.
+ (hppa64_hpux_frame_find_saved_regs_in_sigtramp): New function.
+ * config/pa/tm-hppa64.h: Remove macros that are no longer
+ necessary now that the gdbarch vector is properly setup.
+ Transform some macros into function calls. Some minor cleanup.
+ * config/pa/tm-hppah.h: Update function calls in macros
+ following the function renaming in hppa-hpux-tdep.c.
+ * Makefile.in (hppa_tdep_h): New variable.
+ (hppa-tdep.o): Add dependency over hppa_tdep_h.
+
+2003-08-14 Michael Snyder <msnyder@redhat.com>
+
+ * disasm.c (gdb_disassemble_info): Set info->insn_sets to zero.
+
+2003-08-13 J. Brobecker <brobecker@gnat.com>
+
+ * hppa-hpux-tdep.c (_initialize_hppa_hpux_tdep): Use the correct
+ bfd arch_info when registering the GDB_OSABI_HPUX_ELF initialization
+ routine.
+
+2003-08-13 Michael Snyder <msnyder@redhat.com>
+
+ * frv-tdep.c (frv_push_arguments): Use deprecated ftype.
+ (frv_saved_pc_after_call): Use deprecated ftype.
+ (stupid_useless_init_extra_frame_info): Remove orphan prototype.
+ (frv_remote_translate_xfer_address): Remove.
+ (frv_gdbarch_init): Use generic_remote_translate_xfer_address.
+
+2003-08-13 J. Brobecker <brobecker@gnat.com>
+
+ * hppa-tdep.c (hppa_gdbarch_init): Perform the ABI-specific gdbarch
+ initialization after the common gdbarch initialization, not before.
+
+2003-08-13 J. Brobecker <brobecker@gnat.com>
+
+ * config/pa/tm-hppa64.h (HPUX_1100): Remove, not used.
+ (ADDR_BITS_REMOVE): Remove, redundant.
+
+2003-08-13 J. Brobecker <brobecker@gnat.com>
+
+ * hppa-tdep.c (hppa_gdbarch_init): Set the addr_bits_remove
+ gdbarch method to clear the 2 low bits of text addresses.
+
+2003-08-12 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in (dsrec.o): Update dependencies.
+ * dsrec.c: Include "gdb_assert.h".
+ (make_srec): Use snprintf instead of sprintf, use a literal format
+ string.
+
+2003-08-12 Andrew Cagney <cagney@redhat.com>
+
+ * frame.c (deprecated_frame_xmalloc): Use XMALLOC, instead of
+ FRAME_OBSTACK_ZALLOC.
+
+2003-08-12 Kevin Buettner <kevinb@redhat.com>
+
+ * i386-tdep.c (i386_gdbarch_init): Enable default support for
+ SSE registers.
+
+2003-08-10 Mark Kettenis <kettenis@gnu.org>
+
+ * x86-64-tdep.h (amd64fbsd_sigtramp_start, amd64fbsd_sigtramp_end,
+ amd64fbsd_sc_reg_offset): Add extern declarations.
+ * amd64fbsd-nat.c (_initialize_am64fbsd_nat): Remove extern
+ declarations.
+
+2003-08-11 Ben Elliston <bje@wasabisystems.com>
+
+ * MAINTAINERS (write after approval): Update my mail address.
+
+2003-08-10 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in (monitor.o): Do not build monitor.c with -Werror.
+
+2003-08-10 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-tdep.h (i386fbsd_sigtramp_start, i386fbsd_sigtramp_end,
+ i386obsd_sigtramp_start, i386obsd_sigtramp_end,
+ i386fbsd4_sc_reg_offset, i386fbsd_sc_reg_offset,
+ i386nbsd_sc_reg_offset, i386obsd_sc_reg_offset,
+ i386bsd_sc_reg_offset): Add extern declarations.
+ * i386obsd-nat.c: Include "i386-tdep.h"
+ (_initialize_i386obsd_nat): Remove extern declarations.
+ * i386fbsd-nat.c (_initialize_i386fbsd_nat): Remove extern
+ declarations.
+ * i386bsd-nat.c (_initialize_i386bsd_nat): Remove extern
+ declarations.
+
+ * i386-tdep.c (i386_register_to_value): Use get_frame_register
+ instead of frame_read_register.
+ (i386_fetch_pointer_argument): Use get_frame_register_unsigned
+ instead of frame_read_register. Use I386_ESP_REGNUM instead of
+ SP_REGNUM.
+ (i386_frame_prev_register): Use frame_unwind_register_unsigned
+ instead of frame_unwind_unsigned_register. Use
+ I386_EFLAGS_REGISTER instead of PS_REGNUM.
+ (i386_get_longjmp_target): Use regcache_read_unsigned_register
+ instead of read_register. Use builtin_type_void_data_ptr instead
+ of builtin_type_void_func_ptr when extracting the address of the
+ jmp_buf.
+ (i386_extract_return_value, i386_store_return_value,
+ i386_pseudo_register_read, i386_pseudo_register_write): Use
+ register_size instead REGISTER_RAW_SIZE.
+
+2003-08-10 Andrew Cagney <cagney@redhat.com>
+
+ * infcall.c (call_function_by_hand): Use xstrprintf instead of
+ sprintf. Make "name" constant.
+
+2003-08-10 Mark Kettenis <kettenis@gnu.org>
+
+ * i387-tdep.c (i387_register_to_value): Use get_frame_register
+ instead of frame_read_register.
+ (i387_print_float_info): Use get_frame_register and
+ get_frame_register_unsigned instead of frame_register_read.
+
+ * i386fbsd-nat.c: Include "i386-tdep.h".
+ (child_resume): Make `eflags' an ULONGEST. Use
+ regcache_cooked_read_unsigned and regcache_cooked_write_unsigned
+ instead of register_read and register_write.
+
+ * i386bsd-nat.c (fetch_inferior_registers,
+ store_inferior_registers): Don't use && at the end of a line.
+ (_initialize_i386bsd_nat): Fix typo.
+
+ * frame.c (_initialize_frame): Add missing backslash.
+
+ From Peter Schauer (Peter.Schauer@regent.e-technik.tu-muenchen.de):
+ * sol-thread.c (sol_thread_store_registers): Use regcache_collect
+ and supply_register instead of manipulating the register buffer
+ directly.
+
+ From Peter Schauer (Peter.Schauer@regent.e-technik.tu-muenchen.de):
+ * config/i386/nm-i386sol2.h
+ (TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT): Define to one.
+
+ Based on a patch from Michael Elizabeth Chastain (mec@shout.net):
+ * i386-tdep.c (i386_analyze_frame_setup): Recognize more
+ instructions that GCC likes to mingle into the prologue. Fixes
+ gdb/1253 and gdb/1255.
+
+2003-08-09 Andrew Cagney <cagney@redhat.com>
+
+ Fix GDB PR cli/926.
+ * cli/cli-decode.c (add_setshow_uinteger_cmd): New function.
+ * command.h (add_setshow_uinteger_cmd): Declare.
+ * frame.c (set_backtrace_cmd): New function.
+ (show_backtrace_cmd): New function.
+ * frame.c (_initialize_frame): Replace "set/show
+ backtrace-below-main" with "set/show backtrace past-main". Add
+ command "set/show backtrace limit".
+ (backtrace_past_main): Rename "backtrace_below_main".
+ (backtrace_limit): New variable.
+ (get_prev_frame): Update. Check the backtrace_limit.
+
+2003-08-09 Andrew Cagney <cagney@redhat.com>
+
+ * defs.h (xstrprintf): Declare.
+ * utils.c (xstrprintf): New function.
+ * breakpoint.c (insert_breakpoints): Replace sprintf and
+ non-literal format strings, with xstrprintf and cleanups.
+ (delete_breakpoint,breakpoint_re_set): Ditto.
+ (commands_command, insert_breakpoints): Ditto.
+ (bpstat_stop_status, break_at_finish_at_depth_command_1): Ditto.
+ (break_at_finish_command_1): Ditto.
+
+2003-08-09 Andrew Cagney <cagney@redhat.com>
+
+ * MAINTAINERS (language support): List Adam Fedor as Objective C
+ maintainer.
+
+2003-08-08 J. Brobecker <brobecker@gnat.com>
+
+ * NEWS (Multi-arched targets): Document that all hppa-hpux targets
+ are now multiarched.
+
+2003-08-08 J. Brobecker <brobecker@gnat.com>
+
+ * config/pa/tm-hppa64.h: Remove lots of macros that are no
+ longer necessary now that hppa64 is partially multiarch'ed.
+
+2003-08-08 Andrew Cagney <cagney@redhat.com>
+
+ * interps.c (interp_set): Check for a NULL "old_interp".
+
+2003-08-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Makefile.in (FLAGS_TO_PASS): Add DESTDIR.
+ (install-only): Support DESTDIR.
+ (uninstall): Likewise.
+ (install-gdbtk): Likewise.
+
+2003-08-08 Elena Zannoni <ezannoni@redhat.com>
+
+ * symtab.c (lookup_symbol_aux): Make sure that is_a_field_of_this
+ contains something meaningful at all times.
+
+Fri Aug 8 00:28:46 UTC 2003 Brendan Conoboy <blc@redhat.com>
+
+ * configure.host: Set gdb_host_cpu=arm when host_cpu=xscale.
+
+Fri Aug 8 00:28:38 UTC 2003 Brendan Conoboy <blc@redhat.com>
+
+ * MAINTAINERS (write after approval): Added self.
+
+2003-08-07 Andrew Cagney <cagney@redhat.com>
+
+ * inferior.h (AT_SYMBOL): Define.
+ * blockframe.c (inside_entry_file): Check for AT_SYMBOL.
+ * infcall.c (call_function_by_hand): Add code to handle AT_SYMBOL.
+ * mips-tdep.c (mips_call_dummy_address): Delete function.
+ (mips_gdbarch_init): Set call_dummy_location to AT_SYMBOL, do not
+ set call_dummy_address.
+
+2003-08-07 Andrew Cagney <cagney@redhat.com>
+
+ * language.c (op_error): Delete function.
+ (binop_type_check): Delete function.
+ * language.h (type_op_error, range_op_error): Delete macros.
+ (op_error): Delete declaration.
+
+2003-08-07 Andrew Cagney <cagney@redhat.com>
+
+ * interps.h (INTERP_MI2, INTERP_MI3): Define.
+
+2003-08-07 Michal Ludvig <mludvig@suse.cz>
+
+ * x86-64-tdep.c (x86_64_dwarf_regmap): Correct register numbers.
+ (x86_64_push_arguments): Skip the red zone.
+
+2003-08-05 Andrew Cagney <cagney@redhat.com>
+
+ * reggroups.c (reggroup_next): Check for the final entry.
+
2003-08-22 Michael Chastain <mec@shout.net>
* config/djgpp/fnchange.lst: Remove gdb/testsuite/gdb.c++/*.
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index 078038eb081..d47dbbcf10b 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -79,6 +79,9 @@ maintainer works with the native maintainer when resolving API issues.
fr30 Deleted.
+ frv --target=frv-elf ,-Werror
+ Maintenance only
+
h8300 --target=h8300hms ,-Werror
Maintenance only
@@ -236,7 +239,7 @@ language support (Blanket Write Privs Maintainers)
C++ Daniel Jacobowitz dan@debian.org
Java support (Global Maintainers)
Pascal support Pierre Muller muller@sources.redhat.com
-
+ Objective C support Adam Fedor fedor@gnu.org
shared libs (devolved) Kevin Buettner kevinb@redhat.com
xcoffsolib Peter Schauer Peter.Schauer@regent.e-technik.tu-muenchen.de
@@ -307,6 +310,7 @@ To get recommended for the Write After Approval list you need a valid
FSF assignment and have submitted one good patch.
David Anderson davea@sgi.com
+Shrinivas Atre shrinivasa@kpitcummins.com
Scott Bambrough scottb@netwinder.org
Jim Blandy jimb@redhat.com
Philip Blundell philb@gnu.org
@@ -320,13 +324,14 @@ Stephane Carrez stcarrez@nerim.fr
Michael Chastain mec@shout.net
Eric Christopher echristo@redhat.com
Nick Clifton nickc@redhat.com
+Brendan Conoboy blc@redhat.com
DJ Delorie dj@redhat.com
Chris G. Demetriou cgd@broadcom.com
Philippe De Muyter phdm@macqel.be
Klee Dienes kdienes@apple.com
Richard Earnshaw rearnsha@arm.com
Frank Ch. Eigler fche@redhat.com
-Ben Elliston bje@redhat.com
+Ben Elliston bje@wasabisystems.com
Raoul Gough RaoulGough@yahoo.co.uk
Anthony Green green@redhat.com
Matthew Green mrg@eterna.com.au
@@ -373,6 +378,7 @@ Bob Rossi bob_rossi@cox.net
Theodore A. Roth troth@openavr.org
Ian Roxborough irox@redhat.com
Grace Sainsbury graces@redhat.com
+Kei Sakamoto sakamoto.kei@renesas.com
Mark Salter msalter@redhat.com
Peter Schauer Peter.Schauer@regent
Andreas Schwab schwab@suse.de
@@ -385,7 +391,7 @@ Stephen P. Smith ischis2@cox.net
Jackie Smith Cashion jsmith@redhat.com
Michael Snyder msnyder@redhat.com
Petr Sorfa petrs@caldera.com
-Ian Lance Taylor ian@airs.com
+Ian Lance Taylor ian@wasabisystems.com
Gary Thomas gthomas@redhat.com
Jason Thorpe thorpej@wasabisystems.com
Tom Tromey tromey@redhat.com
@@ -393,7 +399,6 @@ D Venkatasubramanian dvenkat@noida.hcltech.com
Corinna Vinschen vinschen@redhat.com
Keith Walker keith.walker@arm.com
Kris Warkentin kewarken@qnx.com
-Jim Wilson wilson@tuliptree.org
Elena Zannoni ezannoni@redhat.com
Eli Zaretskii eliz@gnu.org
@@ -417,6 +422,7 @@ Anthony Green (Java) green at redhat dot com
Folks that have been caught up in a paper trail:
Jim Kingdon jkingdon@engr.sgi.com
+Jim Wilson wilson@specifixinc.com
--
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 04431e9e0f4..3bb61f754e0 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -430,6 +430,7 @@ FLAGS_TO_PASS = \
"datadir=$(datadir)" \
"includedir=$(includedir)" \
"against=$(against)" \
+ "DESTDIR=$(DESTDIR)" \
"AR=$(AR)" \
"AR_FLAGS=$(AR_FLAGS)" \
"CC=$(CC)" \
@@ -626,6 +627,7 @@ nm_h = @nm_h@
ada_lang_h = ada-lang.h $(value_h) $(gdbtypes_h)
alphabsd_tdep_h = alphabsd-tdep.h
alpha_tdep_h = alpha-tdep.h
+amd64_nat_h = amd64-nat.h
annotate_h = annotate.h $(symtab_h) $(gdbtypes_h)
arch_utils_h = arch-utils.h
arm_tdep_h = arm-tdep.h
@@ -649,7 +651,7 @@ cp_support_h = cp-support.h $(symtab_h)
dcache_h = dcache.h
defs_h = defs.h $(config_h) $(ansidecl_h) $(gdb_locale_h) $(gdb_signals_h) \
$(libiberty_h) $(progress_h) $(bfd_h) $(tui_h) $(ui_file_h) $(xm_h) \
- $(nm_h) $(tm_h) $(fopen_same_h) $(gdbarch_h) $(arch_utils_h)
+ $(nm_h) $(tm_h) $(fopen_same_h) $(gdbarch_h)
dictionary_h = dictionary.h
disasm_h = disasm.h
doublest_h = doublest.h $(floatformat_h)
@@ -665,7 +667,7 @@ f_lang_h = f-lang.h
frame_base_h = frame-base.h
frame_h = frame.h
frame_unwind_h = frame-unwind.h $(frame_h)
-gdbarch_h = gdbarch.h $(dis_asm_h) $(inferior_h) $(symfile_h)
+gdbarch_h = gdbarch.h
gdb_assert_h = gdb_assert.h
gdbcmd_h = gdbcmd.h $(command_h) $(ui_out_h)
gdbcore_h = gdbcore.h $(bfd_h)
@@ -686,6 +688,7 @@ gdb_vfork_h = gdb_vfork.h
gdb_wait_h = gdb_wait.h
gnu_nat_h = gnu-nat.h
gregset_h = gregset.h
+hppa_tdep_h = hppa-tdep.h
i386_linux_tdep_h = i386-linux-tdep.h
i386_tdep_h = i386-tdep.h
i387_tdep_h = i387-tdep.h
@@ -743,6 +746,8 @@ solib_svr4_h = solib-svr4.h
solist_h = solist.h
somsolib_h = somsolib.h
source_h = source.h
+sparc64_tdep_h = sparc64-tdep.h
+sparcbsd_nat_h = sparcbsd-nat.h
sparcnbsd_tdep_h = sparcnbsd-tdep.h
sparc_tdep_h = sparc-tdep.h
srec_h = srec.h
@@ -963,7 +968,7 @@ install-only: $(CONFIG_INSTALL)
else \
true ; \
fi ; \
- $(SHELL) $(srcdir)/../mkinstalldirs $(bindir) ; \
+ $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \
$(INSTALL_PROGRAM) gdb$(EXEEXT) \
$(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
$(SHELL) $(srcdir)/../mkinstalldirs \
@@ -980,7 +985,8 @@ uninstall: force $(CONFIG_UNINSTALL)
else \
true ; \
fi ; \
- rm -f $(bindir)/$$transformed_name$(EXEEXT) $(man1dir)/$$transformed_name.1
+ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
+ $(DESTDIR)$(man1dir)/$$transformed_name.1
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
# We do this by grepping through sources. If that turns out to be too slow,
@@ -1095,10 +1101,8 @@ gdb1$(EXEEXT): gdb$(EXEEXT)
# for some machines.
# But these rules don't do what we want; we want to hack the foo.o: tm.h
# dependency to do the right thing.
-tm-sun3.h tm-hp300bsd.h tm-altos.h: tm-m68k.h
-tm-hp300hpux.h tm-sun2.h tm-3b1.h: tm-m68k.h
-xm-i386-sv32.h: xm-i386.h
-tm-i386gas.h: tm-i386.h
+tm-sun3.h tm-altos.h: tm-m68k.h
+tm-sun2.h tm-3b1.h: tm-m68k.h
tm-sun4os4.h: tm-sparc.h
xm-vaxult.h: xm-vax.h
xm-vaxbsd.h: xm-vax.h
@@ -1289,7 +1293,7 @@ ALLDEPFILES = \
rs6000-nat.c rs6000-tdep.c \
s390-tdep.c s390-nat.c \
ser-go32.c ser-pipe.c ser-tcp.c \
- sh-tdep.c shnbsd-tdep.c shnbsd-nat.c \
+ sh-tdep.c sh64-tdep.c shnbsd-tdep.c shnbsd-nat.c \
solib.c solib-irix.c solib-svr4.c solib-sunos.c sparc-linux-nat.c \
sparc-nat.c \
sparc64nbsd-nat.c sparcnbsd-nat.c sparcnbsd-tdep.c \
@@ -1319,6 +1323,22 @@ main.o: main.c
$(CC) -c $(INTERNAL_CFLAGS) $(TARGET_SYSTEM_ROOT_DEFINE) \
-DBINDIR=\"$(bindir)\" $(srcdir)/main.c
+# FIXME: cagney/2003-08-10: "monitor.c" gets -Wformat-nonliteral
+# errors. It turns out that that is the least of monitor.c's
+# problems. The function print_vsprintf appears to be using
+# va_arg(long) to extract CORE_ADDR parameters - something that
+# definitly will not work. "monitor.c" needs to be rewritten so that
+# it doesn't use format strings and instead uses callbacks.
+monitor.o: $(srcdir)/monitor.c
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/monitor.c
+
+# FIXME: cagney/2003-08-10: Do not try to build "printcmd.c" with
+# -Wformat-nonliteral. It needs to be overhauled so that it doesn't
+# pass user input strings as the format parameter to host printf
+# function calls.
+printcmd.o: $(srcdir)/printcmd.c
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/printcmd.c
+
# FIXME: Procfs.o gets -Wformat errors because things like pid_t don't
# match output format strings.
procfs.o: $(srcdir)/procfs.c
@@ -1336,6 +1356,12 @@ v850ice.o: $(srcdir)/v850ice.c
$(GDBTK_CFLAGS) \
$(srcdir)/v850ice.c
+# FIXME: cagney/2003-08-10: Do not try to build "valprint.c" with
+# -Wformat-nonliteral. It relies on local_hex_format et.al. and
+# that's a mess. It needs a serious overhaul.
+valprint.o: $(srcdir)/valprint.c
+ $(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/valprint.c
+
# FIXME: z8k-tdep.c calls _initialize_gdbtypes(). Since that isn't
# declared -Wimplicit fails. It should be using the GDBARCH framework.
# cagney 1999-09-02.
@@ -1536,17 +1562,17 @@ alpha-tdep.o: alpha-tdep.c $(defs_h) $(doublest_h) $(frame_h) \
$(regcache_h) $(reggroups_h) $(arch_utils_h) $(osabi_h) $(block_h) \
$(elf_bfd_h) $(alpha_tdep_h)
amd64fbsd-nat.o: amd64fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
- $(gdb_assert_h) $(gregset_h) $(x86_64_tdep_h)
+ $(gdb_assert_h) $(gregset_h) $(x86_64_tdep_h) $(amd64_nat_h)
amd64fbsd-tdep.o: amd64fbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
$(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) \
$(x86_64_tdep_h)
+amd64-nat.o: amd64-nat.c $(defs_h) $(gdbarch_h) $(regcache_h) \
+ $(gdb_assert_h) $(i386_tdep_h) $(x86_64_tdep_h)
annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \
$(gdbtypes_h) $(breakpoint_h)
arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) \
- $(inferior_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \
- $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(annotate_h) \
- $(gdb_string_h) $(regcache_h) $(gdb_assert_h) $(sim_regno_h) \
- $(version_h) $(floatformat_h)
+ $(inferior_h) $(gdb_string_h) $(regcache_h) $(gdb_assert_h) \
+ $(sim_regno_h) $(version_h) $(floatformat_h)
arm-linux-nat.o: arm-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
$(gdb_string_h) $(regcache_h) $(arm_tdep_h) $(gregset_h)
arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \
@@ -1559,13 +1585,14 @@ armnbsd-tdep.o: armnbsd-tdep.c $(defs_h) $(osabi_h) $(arm_tdep_h) \
$(nbsd_tdep_h) $(solib_svr4_h)
arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \
$(gdbcore_h) $(symfile_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) \
- $(doublest_h) $(value_h) $(arch_utils_h) $(osabi_h) $(arm_tdep_h) \
+ $(doublest_h) $(value_h) $(arch_utils_h) $(osabi_h) \
+ $(frame_unwind_h) $(frame_base_h) $(trad_frame_h) $(arm_tdep_h) \
$(gdb_sim_arm_h) $(elf_bfd_h) $(coff_internal_h) $(elf_arm_h) \
$(gdb_assert_h) $(bfd_in2_h) $(libcoff_h)
avr-tdep.o: avr-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
$(frame_base_h) $(trad_frame_h) $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) $(symfile_h) $(arch_utils_h) $(regcache_h) \
- $(gdb_string_h)
+ $(gdb_string_h) $(dis_asm_h)
ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) $(symfile_h) $(gdbtypes_h) \
$(value_h) $(expression_h) $(command_h) $(gdbcmd_h) $(frame_h) \
$(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) $(block_h) \
@@ -1641,8 +1668,8 @@ cp-valprint.o: cp-valprint.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \
$(cp_abi_h) $(valprint_h)
cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \
$(gdbtypes_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(value_h) \
- $(opcode_cris_h) $(arch_utils_h) $(regcache_h) $(symfile_h) \
- $(solib_h) $(solib_svr4_h) $(gdb_string_h)
+ $(opcode_cris_h) $(arch_utils_h) $(regcache_h) $(gdb_assert_h) \
+ $(symfile_h) $(solib_h) $(solib_svr4_h) $(gdb_string_h) $(dis_asm_h)
c-typeprint.o: c-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
$(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
$(language_h) $(demangle_h) $(c_lang_h) $(typeprint_h) $(cp_abi_h) \
@@ -1662,7 +1689,7 @@ dbxread.o: dbxread.c $(defs_h) $(gdb_string_h) $(gdb_obstack_h) \
$(gdb_stat_h) $(symtab_h) $(breakpoint_h) $(target_h) $(gdbcore_h) \
$(libaout_h) $(symfile_h) $(objfiles_h) $(buildsym_h) $(stabsread_h) \
$(gdb_stabs_h) $(demangle_h) $(language_h) $(complaints_h) \
- $(cp_abi_h) $(aout_aout64_h) $(aout_stab_gnu_h)
+ $(cp_abi_h) $(aout_aout64_h) $(aout_stab_gnu_h) $(gdb_assert_h)
dcache.o: dcache.c $(defs_h) $(dcache_h) $(gdbcmd_h) $(gdb_string_h) \
$(gdbcore_h) $(target_h)
delta68-nat.o: delta68-nat.c $(defs_h)
@@ -1673,11 +1700,12 @@ dictionary.o: dictionary.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \
dink32-rom.o: dink32-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
$(serial_h) $(symfile_h) $(inferior_h) $(regcache_h)
disasm.o: disasm.c $(defs_h) $(target_h) $(value_h) $(ui_out_h) \
- $(gdb_string_h) $(disasm_h) $(gdbcore_h)
+ $(gdb_string_h) $(disasm_h) $(gdbcore_h) $(dis_asm_h)
doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) \
$(gdb_assert_h) $(gdb_string_h) $(gdbtypes_h)
dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h)
-dsrec.o: dsrec.c $(defs_h) $(serial_h) $(srec_h)
+dsrec.o: dsrec.c $(defs_h) $(serial_h) $(srec_h) $(gdb_assert_h) \
+ $(gdb_string_h)
dummy-frame.o: dummy-frame.c $(defs_h) $(dummy_frame_h) $(regcache_h) \
$(frame_h) $(inferior_h) $(gdb_assert_h) $(frame_unwind_h) \
$(command_h) $(gdbcmd_h)
@@ -1739,8 +1767,9 @@ frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \
$(command_h) $(gdbcmd_h)
frame-unwind.o: frame-unwind.c $(defs_h) $(frame_h) $(frame_unwind_h) \
$(gdb_assert_h) $(dummy_frame_h)
-frv-tdep.o: frv-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \
- $(arch_utils_h) $(regcache_h)
+frv-tdep.o: frv-tdep.c $(defs_h) $(gdb_string_h) $(inferior_h) $(symfile_h) \
+ $(gdbcore_h) $(arch_utils_h) $(regcache_h) $(frame_h) \
+ $(frame_unwind_h) $(frame_base_h) $(trad_frame_h) $(dis_asm_h)
f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
$(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
$(f_lang_h) $(gdb_string_h)
@@ -1750,11 +1779,9 @@ f-valprint.o: f-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \
gcore.o: gcore.c $(defs_h) $(cli_decode_h) $(inferior_h) $(gdbcore_h) \
$(elf_bfd_h) $(symfile_h) $(objfiles_h) $(infcall_h)
gdbarch.o: gdbarch.c $(defs_h) $(arch_utils_h) $(gdbcmd_h) $(inferior_h) \
- $(gdb_string_h) $(symtab_h) $(frame_h) $(inferior_h) $(breakpoint_h) \
- $(gdb_wait_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(gdbthread_h) \
- $(annotate_h) $(symfile_h) $(value_h) $(symcat_h) $(floatformat_h) \
- $(gdb_assert_h) $(gdb_string_h) $(gdb_events_h) $(reggroups_h) \
- $(osabi_h) $(symfile_h) $(gdb_obstack_h)
+ $(symcat_h) $(floatformat_h) $(gdb_assert_h) $(gdb_string_h) \
+ $(gdb_events_h) $(reggroups_h) $(osabi_h) $(symfile_h) \
+ $(gdb_obstack_h)
gdb.o: gdb.c $(defs_h) $(main_h) $(gdb_string_h) $(interps_h)
gdb-events.o: gdb-events.c $(defs_h) $(gdb_events_h) $(gdbcmd_h)
gdbtypes.o: gdbtypes.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \
@@ -1776,7 +1803,7 @@ go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) $(gdb_wait_h) $(gdbcore_h) \
$(gdb_string_h)
h8300-tdep.o: h8300-tdep.c $(defs_h) $(value_h) $(inferior_h) $(symfile_h) \
$(arch_utils_h) $(regcache_h) $(gdbcore_h) $(objfiles_h) $(gdbcmd_h) \
- $(gdb_assert_h)
+ $(gdb_assert_h) $(dis_asm_h)
# OBSOLETE h8500-tdep.o: h8500-tdep.c
hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \
$(gdbtypes_h) $(gdbcore_h) $(cp_abi_h)
@@ -1791,7 +1818,8 @@ hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \
$(value_h) $(regcache_h) $(completer_h) $(language_h) $(osabi_h) \
$(gdb_assert_h) $(infttrace_h) $(symtab_h) $(infcall_h) \
$(a_out_encap_h) $(gdb_stat_h) $(gdb_wait_h) $(gdbcore_h) \
- $(gdbcmd_h) $(target_h) $(symfile_h) $(objfiles_h)
+ $(gdbcmd_h) $(target_h) $(symfile_h) $(objfiles_h) $(hppa_tdep_h) \
+ $(dis_asm_h)
hpread.o: hpread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(hp_symtab_h) \
$(syms_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \
$(complaints_h) $(gdb_stabs_h) $(gdbtypes_h) $(demangle_h) \
@@ -1805,7 +1833,8 @@ i386bsd-tdep.o: i386bsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
$(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) $(i386_tdep_h)
i386-cygwin-tdep.o: i386-cygwin-tdep.c $(defs_h) $(osabi_h) $(gdb_string_h) \
$(i386_tdep_h)
-i386fbsd-nat.o: i386fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h)
+i386fbsd-nat.o: i386fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+ $(i386_tdep_h)
i386gnu-nat.o: i386gnu-nat.c $(defs_h) $(inferior_h) $(floatformat_h) \
$(regcache_h) $(gdb_assert_h) $(i386_tdep_h) $(gnu_nat_h) \
$(i387_tdep_h) $(gregset_h)
@@ -1817,8 +1846,8 @@ i386-interix-tdep.o: i386-interix-tdep.c $(defs_h) $(arch_utils_h) \
$(i386_tdep_h) $(inferior_h) $(libbfd_h) $(objfiles_h) $(osabi_h) \
$(regcache_h)
i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
- $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(gregset_h) \
- $(i387_tdep_h) $(i386_tdep_h) $(i386_linux_tdep_h) \
+ $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
+ $(gregset_h) $(i387_tdep_h) $(i386_tdep_h) $(i386_linux_tdep_h) \
$(gdb_proc_service_h)
i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
$(value_h) $(regcache_h) $(inferior_h) $(reggroups_h) $(symtab_h) \
@@ -1833,7 +1862,7 @@ i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(gdbtypes_h) $(gdbcore_h) \
i386-nto-tdep.o: i386-nto-tdep.c $(gdb_string_h) $(gdb_assert_h) $(defs_h) \
$(frame_h) $(target_h) $(regcache_h) $(solib_svr4_h) $(i386_tdep_h) \
$(nto_tdep_h) $(osabi_h) $(i387_tdep_h)
-i386obsd-nat.o: i386obsd-nat.c $(defs_h)
+i386obsd-nat.o: i386obsd-nat.c $(defs_h) $(i386_tdep_h)
i386obsd-tdep.o: i386obsd-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
$(regcache_h) $(osabi_h) $(i386_tdep_h) $(i387_tdep_h)
i386-sol2-tdep.o: i386-sol2-tdep.c $(defs_h) $(value_h) $(osabi_h) \
@@ -1844,7 +1873,8 @@ i386-tdep.o: i386-tdep.c $(defs_h) $(arch_utils_h) $(command_h) \
$(frame_h) $(frame_base_h) $(frame_unwind_h) $(inferior_h) \
$(gdbcmd_h) $(gdbcore_h) $(objfiles_h) $(osabi_h) $(regcache_h) \
$(reggroups_h) $(symfile_h) $(symtab_h) $(target_h) $(value_h) \
- $(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) $(i387_tdep_h)
+ $(dis_asm_h) $(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) \
+ $(i387_tdep_h)
i386v4-nat.o: i386v4-nat.c $(defs_h) $(value_h) $(inferior_h) $(regcache_h) \
$(i386_tdep_h) $(i387_tdep_h) $(gregset_h)
i386v-nat.o: i386v-nat.c $(defs_h) $(frame_h) $(inferior_h) $(language_h) \
@@ -1861,9 +1891,10 @@ ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(gdb_string_h) $(inferior_h) \
$(target_h) $(gdbcore_h) $(regcache_h) $(gdb_wait_h) $(gregset_h)
ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(arch_utils_h)
ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \
- $(arch_utils_h) $(floatformat_h) $(regcache_h) $(doublest_h) \
+ $(arch_utils_h) $(floatformat_h) $(regcache_h) $(reggroups_h) \
+ $(frame_h) $(frame_base_h) $(frame_unwind_h) $(doublest_h) \
$(value_h) $(gdb_assert_h) $(objfiles_h) $(elf_common_h) \
- $(elf_bfd_h)
+ $(elf_bfd_h) $(dis_asm_h)
infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \
$(inferior_h) $(gdb_assert_h) $(block_h) $(gdbcore_h) $(language_h) \
$(symfile_h) $(gdbcmd_h) $(command_h) $(gdb_string_h) $(infcall_h)
@@ -1965,7 +1996,7 @@ m68k-stub.o: m68k-stub.c
m68k-tdep.o: m68k-tdep.c $(defs_h) $(frame_h) $(frame_base_h) \
$(frame_unwind_h) $(symtab_h) $(gdbcore_h) $(value_h) \
$(gdb_string_h) $(gdb_assert_h) $(inferior_h) $(regcache_h) \
- $(arch_utils_h) $(osabi_h) $(m68k_tdep_h) $(gregset_h)
+ $(arch_utils_h) $(osabi_h) $(dis_asm_h) $(m68k_tdep_h) $(gregset_h)
macrocmd.o: macrocmd.c $(defs_h) $(macrotab_h) $(macroexp_h) $(macroscope_h) \
$(command_h) $(gdbcmd_h)
macroexp.o: macroexp.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(macrotab_h) \
@@ -1985,7 +2016,7 @@ mcore-rom.o: mcore-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
$(gdb_string_h) $(regcache_h) $(serial_h)
mcore-tdep.o: mcore-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(value_h) \
$(gdbcmd_h) $(regcache_h) $(symfile_h) $(gdbcore_h) $(inferior_h) \
- $(arch_utils_h) $(gdb_string_h) $(disasm_h)
+ $(arch_utils_h) $(gdb_string_h) $(disasm_h) $(dis_asm_h)
mdebugread.o: mdebugread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(gdbcore_h) \
$(symfile_h) $(objfiles_h) $(gdb_obstack_h) $(buildsym_h) \
$(stabsread_h) $(complaints_h) $(demangle_h) $(gdb_assert_h) \
@@ -2019,13 +2050,14 @@ mips-tdep.o: mips-tdep.c $(defs_h) $(gdb_string_h) $(gdb_assert_h) \
$(language_h) $(gdbcore_h) $(symfile_h) $(objfiles_h) $(gdbtypes_h) \
$(target_h) $(arch_utils_h) $(regcache_h) $(osabi_h) $(mips_tdep_h) \
$(block_h) $(reggroups_h) $(opcode_mips_h) $(elf_mips_h) \
- $(elf_bfd_h) $(symcat_h) $(sim_regno_h)
+ $(elf_bfd_h) $(symcat_h) $(sim_regno_h) $(dis_asm_h)
mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \
$(regcache_h) $(gregset_h)
# OBSOLETE mn10200-tdep.o: mn10200-tdep.c
mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) \
$(target_h) $(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) \
- $(symfile_h) $(regcache_h) $(arch_utils_h) $(gdb_assert_h)
+ $(symfile_h) $(regcache_h) $(arch_utils_h) $(gdb_assert_h) \
+ $(dis_asm_h)
monitor.o: monitor.c $(defs_h) $(gdbcore_h) $(target_h) $(gdb_string_h) \
$(command_h) $(serial_h) $(monitor_h) $(gdbcmd_h) $(inferior_h) \
$(gdb_regex_h) $(srec_h) $(regcache_h)
@@ -2038,7 +2070,7 @@ ns32knbsd-tdep.o: ns32knbsd-tdep.c $(defs_h) $(osabi_h) $(ns32k_tdep_h) \
$(gdb_string_h)
ns32k-tdep.o: ns32k-tdep.c $(defs_h) $(frame_h) $(gdbtypes_h) $(gdbcore_h) \
$(inferior_h) $(regcache_h) $(target_h) $(arch_utils_h) $(osabi_h) \
- $(ns32k_tdep_h) $(gdb_string_h)
+ $(dis_asm_h) $(ns32k_tdep_h) $(gdb_string_h)
nto-procfs.o: nto-procfs.c $(defs_h) $(gdb_dirent_h) $(gdb_string_h) \
$(gdbcore_h) $(inferior_h) $(target_h) $(objfiles_h) $(gdbthread_h) \
$(nto_tdep_h) $(command_h) $(regcache_h)
@@ -2052,9 +2084,9 @@ objc-lang.o: objc-lang.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
$(gdb_regex_h) $(regcache_h) $(block_h) $(infcall_h) $(valprint_h) \
$(gdb_assert_h)
objfiles.o: objfiles.c $(defs_h) $(bfd_h) $(symtab_h) $(symfile_h) \
- $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_stat_h) \
- $(gdb_obstack_h) $(gdb_string_h) $(hashtab_h) $(breakpoint_h) \
- $(block_h) $(dictionary_h) $(mmalloc_h)
+ $(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_assert_h) \
+ $(gdb_stat_h) $(gdb_obstack_h) $(gdb_string_h) $(hashtab_h) \
+ $(breakpoint_h) $(block_h) $(dictionary_h) $(mmalloc_h)
observer.o: observer.c $(defs_h) $(observer_h)
ocd.o: ocd.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \
$(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \
@@ -2192,12 +2224,12 @@ rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \
$(arch_utils_h) $(regcache_h) $(doublest_h) $(value_h) \
$(parser_defs_h) $(osabi_h) $(libbfd_h) $(coff_internal_h) \
$(libcoff_h) $(coff_xcoff_h) $(libxcoff_h) $(elf_bfd_h) \
- $(solib_svr4_h) $(ppc_tdep_h) $(gdb_assert_h)
+ $(solib_svr4_h) $(ppc_tdep_h) $(gdb_assert_h) $(dis_asm_h)
s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h)
s390-tdep.o: s390-tdep.c $(arch_utils_h) $(frame_h) $(inferior_h) \
$(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \
$(objfiles_h) $(tm_h) $(__bfd_bfd_h) $(floatformat_h) $(regcache_h) \
- $(value_h) $(gdb_assert_h)
+ $(value_h) $(gdb_assert_h) $(dis_asm_h)
scm-exp.o: scm-exp.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
$(parser_defs_h) $(language_h) $(value_h) $(c_lang_h) $(scm_lang_h) \
$(scm_tags_h)
@@ -2231,6 +2263,11 @@ sh-tdep.o: sh-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(symfile_h) \
$(inferior_h) $(gdb_string_h) $(arch_utils_h) $(floatformat_h) \
$(regcache_h) $(doublest_h) $(osabi_h) $(sh_tdep_h) $(elf_bfd_h) \
$(solib_svr4_h) $(elf_sh_h) $(gdb_sim_sh_h)
+sh64-tdep.o: sh64-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(symfile_h) \
+ $(gdbtypes_h) $(gdbcmd_h) $(gdbcore_h) $(value_h) $(dis_asm_h) \
+ $(inferior_h) $(gdb_string_h) $(arch_utils_h) $(floatformat_h) \
+ $(regcache_h) $(doublest_h) $(osabi_h) $(elf_bfd_h) \
+ $(solib_svr4_h) $(elf_sh_h) $(gdb_sim_sh_h)
solib-aix5.o: solib-aix5.c $(defs_h) $(gdb_string_h) $(elf_external_h) \
$(symtab_h) $(bfd_h) $(symfile_h) $(objfiles_h) $(gdbcore_h) \
$(command_h) $(target_h) $(frame_h) $(gdb_regex_h) $(inferior_h) \
@@ -2265,8 +2302,18 @@ source.o: source.c $(defs_h) $(symtab_h) $(expression_h) $(language_h) \
$(gdb_string_h) $(gdb_stat_h) $(gdbcore_h) $(gdb_regex_h) \
$(symfile_h) $(objfiles_h) $(annotate_h) $(gdbtypes_h) $(linespec_h) \
$(filenames_h) $(completer_h) $(ui_out_h)
+sparc64fbsd-nat.o: sparc64fbsd-nat.c $(defs_h) $(sparc64_tdep_h) \
+ $(sparcbsd_nat_h)
+sparc64fbsd-tdep.o: sparc64fbsd-tdep.c $(defs_h) $(gdbcore_h) $(osabi_h) \
+ $(regcache_h) $(target_h) $(gdb_string_h) $(sparc64_tdep_h)
sparc64nbsd-nat.o: sparc64nbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
$(sparc_tdep_h) $(sparcnbsd_tdep_h)
+sparc64-tdep.o: sparc64-tdep.c $(defs_h) $(arch_utils_h) $(floatformat_h) \
+ $(frame_h) $(frame_base_h) $(frame_unwind_h) $(gdbcore_h) \
+ $(gdbtypes_h) $(osabi_h) $(regcache_h) $(target_h) $(value_h) \
+ $(gdb_assert_h) $(gdb_string_h) $(sparc64_tdep_h)
+sparcbsd-nat.o: sparcbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+ $(sparc64_tdep_h) $(sparcbsd_nat_h)
# OBSOLETE sparclet-rom.o: sparclet-rom.c
# OBSOLETE sparclet-stub.o: sparclet-stub.c
sparc-linux-nat.o: sparc-linux-nat.c $(defs_h) $(regcache_h) $(sparc_tdep_h) \
@@ -2283,8 +2330,8 @@ sparcnbsd-tdep.o: sparcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
sparc-stub.o: sparc-stub.c
sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
$(inferior_h) $(target_h) $(value_h) $(bfd_h) $(gdb_string_h) \
- $(regcache_h) $(osabi_h) $(sparc_tdep_h) $(gregset_h) $(gdbcore_h) \
- $(gdb_assert_h) $(symfile_h)
+ $(regcache_h) $(osabi_h) $(dis_asm_h) $(sparc_tdep_h) $(gregset_h) \
+ $(gdbcore_h) $(gdb_assert_h) $(symfile_h)
stabsread.o: stabsread.c $(defs_h) $(gdb_string_h) $(bfd_h) $(gdb_obstack_h) \
$(symtab_h) $(gdbtypes_h) $(expression_h) $(symfile_h) $(objfiles_h) \
$(aout_stab_gnu_h) $(libaout_h) $(aout_aout64_h) $(gdb_stabs_h) \
@@ -2364,7 +2411,7 @@ v850ice.o: v850ice.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \
$(gdbcore_h) $(value_h) $(command_h) $(regcache_h)
v850-tdep.o: v850-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
$(value_h) $(bfd_h) $(gdb_string_h) $(gdbcore_h) $(symfile_h) \
- $(arch_utils_h) $(regcache_h) $(symtab_h)
+ $(arch_utils_h) $(regcache_h) $(symtab_h) $(dis_asm_h)
valarith.o: valarith.c $(defs_h) $(value_h) $(symtab_h) $(gdbtypes_h) \
$(expression_h) $(target_h) $(language_h) $(gdb_string_h) \
$(doublest_h) $(infcall_h)
@@ -2383,7 +2430,7 @@ varobj.o: varobj.c $(defs_h) $(value_h) $(expression_h) $(frame_h) \
$(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_string_h) $(varobj_h)
vax-tdep.o: vax-tdep.c $(defs_h) $(symtab_h) $(opcode_vax_h) $(gdbcore_h) \
$(inferior_h) $(regcache_h) $(frame_h) $(value_h) $(arch_utils_h) \
- $(gdb_string_h) $(osabi_h) $(vax_tdep_h)
+ $(gdb_string_h) $(osabi_h) $(dis_asm_h) $(vax_tdep_h)
w89k-rom.o: w89k-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
$(serial_h) $(xmodem_h) $(regcache_h)
win32-nat.o: win32-nat.c $(defs_h) $(tm_h) $(frame_h) $(inferior_h) \
@@ -2397,8 +2444,9 @@ wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) \
wince-stub.o: wince-stub.c $(wince_stub_h)
wrapper.o: wrapper.c $(defs_h) $(value_h) $(wrapper_h)
x86-64-linux-nat.o: x86-64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
- $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(gdb_proc_service_h) \
- $(gregset_h) $(x86_64_tdep_h) $(x86_64_linux_tdep_h)
+ $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
+ $(gdb_proc_service_h) $(gregset_h) $(x86_64_tdep_h) \
+ $(x86_64_linux_tdep_h) $(i386_linux_tdep_h) $(amd64_nat_h)
x86-64-linux-tdep.o: x86-64-linux-tdep.c $(defs_h) $(inferior_h) \
$(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) \
$(x86_64_tdep_h) $(x86_64_linux_tdep_h)
@@ -2416,7 +2464,7 @@ xcoffsolib.o: xcoffsolib.c $(defs_h) $(bfd_h) $(xcoffsolib_h) $(inferior_h) \
xmodem.o: xmodem.c $(defs_h) $(serial_h) $(target_h) $(xmodem_h)
xstormy16-tdep.o: xstormy16-tdep.c $(defs_h) $(value_h) $(inferior_h) \
$(symfile_h) $(arch_utils_h) $(regcache_h) $(gdbcore_h) \
- $(objfiles_h)
+ $(objfiles_h) $(dis_asm_h)
# OBSOLETE z8k-tdep.o: z8k-tdep.c
#
@@ -2473,7 +2521,7 @@ install-gdbtk:
else \
true ; \
fi ; \
- $(SHELL) $(srcdir)/../mkinstalldirs $(bindir); \
+ $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir); \
$(INSTALL_PROGRAM) insight$(EXEEXT) \
$(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
$(SHELL) $(srcdir)/../mkinstalldirs \
@@ -2762,8 +2810,9 @@ tui-hooks.o: $(srcdir)/tui/tui-hooks.c $(defs_h) $(symtab_h) $(inferior_h) \
$(tuiStack_h) $(tuiDataWin_h) $(tuiSourceWin_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-hooks.c
tui-interp.o: $(srcdir)/tui/tui-interp.c $(defs_h) $(interps_h) $(top_h) \
- $(event_top_h) $(event_loop_h) $(ui_out_h) $(tui_tuiData_h) \
- $(readline_h) $(tui_tuiWin_h) $(tui_h) $(tui_tuiIO_h) $(cli_out_h)
+ $(event_top_h) $(event_loop_h) $(ui_out_h) $(cli_out_h) \
+ $(tui_tuiData_h) $(readline_h) $(tui_tuiWin_h) $(tui_h) \
+ $(tui_tuiIO_h)
$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-interp.c
tui-out.o: $(srcdir)/tui/tui-out.c $(defs_h) $(ui_out_h) $(tui_h) \
$(gdb_string_h) $(gdb_assert_h)
diff --git a/gdb/NEWS b/gdb/NEWS
index 77e6931e340..1a2784abccd 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,8 +3,25 @@
*** Changes since GDB 6.0:
+* "set prompt-escape-char" command deleted.
+
+The command "set prompt-escape-char" has been deleted. This command,
+and its very obscure effet on GDB's prompt, was never documented,
+tested, nor mentioned in the NEWS file.
+
+* REMOVED configurations and files
+
+SGI Irix-4.x mips-sgi-irix4 or iris4
+SGI Iris (MIPS) running Irix V3: mips-sgi-irix or iris
+
*** Changes in GDB 6.0:
+* GNU/Linux support for fork, vfork, and exec.
+
+The "catch fork", "catch exec", "catch vfork", and "set follow-fork-mode"
+commands are now implemented for GNU/Linux. They require a 2.5.x or later
+kernel.
+
* GDB supports logging output to a file
There are two new commands, "set logging" and "show logging", which can be
@@ -43,9 +60,13 @@ Fix for gdb/672: update changelist is now output in mi list format.
Fix for gdb/702: a -var-assign that updates the value now shows up
in a subsequent -var-update.
+* New native configurations.
+
+FreeBSD/amd64 x86_64-*-freebsd*
+
* Multi-arched targets.
-HP/PA HPUX11, 32bit ABI (partial) hppa*-*-hpux* except hppa*64*-*-hpux11*
+HP/PA HPUX11 hppa*-*-hpux*
Mitsubishi M32R/D w/simulator m32r-*-elf*
* OBSOLETE configurations and files
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index e691b2cafee..fdeea165baf 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -3027,9 +3027,9 @@ place_on_stack (struct value *val, CORE_ADDR *sp)
{
CORE_ADDR old_sp = *sp;
-#ifdef STACK_ALIGN
+#ifdef DEPRECATED_STACK_ALIGN
*sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val),
- STACK_ALIGN (TYPE_LENGTH
+ DEPRECATED_STACK_ALIGN (TYPE_LENGTH
(check_typedef (VALUE_TYPE (val)))));
#else
*sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val),
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c
index 342deff22b4..0a78d949170 100644
--- a/gdb/alpha-nat.c
+++ b/gdb/alpha-nat.c
@@ -59,8 +59,8 @@ static void
fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
- register int regno;
- register int addr;
+ int regno;
+ int addr;
int bad_reg = -1;
/* Table to map a gdb regnum to an index in the core register
@@ -200,7 +200,7 @@ kernel_u_size (void)
void
supply_gregset (gdb_gregset_t *gregsetp)
{
- register long *regp = ALPHA_REGSET_BASE (gregsetp);
+ long *regp = ALPHA_REGSET_BASE (gregsetp);
void *unique = ALPHA_REGSET_UNIQUE (gregsetp);
/* PC is in slot 32. */
@@ -210,7 +210,7 @@ supply_gregset (gdb_gregset_t *gregsetp)
void
fill_gregset (gdb_gregset_t *gregsetp, int regno)
{
- register long *regp = ALPHA_REGSET_BASE (gregsetp);
+ long *regp = ALPHA_REGSET_BASE (gregsetp);
void *unique = ALPHA_REGSET_UNIQUE (gregsetp);
/* PC is in slot 32. */
@@ -225,7 +225,7 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
void
supply_fpregset (gdb_fpregset_t *fpregsetp)
{
- register long *regp = ALPHA_REGSET_BASE (fpregsetp);
+ long *regp = ALPHA_REGSET_BASE (fpregsetp);
/* FPCR is in slot 32. */
alpha_supply_fp_regs (-1, regp, regp + 31);
@@ -234,7 +234,7 @@ supply_fpregset (gdb_fpregset_t *fpregsetp)
void
fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
{
- register long *regp = ALPHA_REGSET_BASE (fpregsetp);
+ long *regp = ALPHA_REGSET_BASE (fpregsetp);
/* FPCR is in slot 32. */
alpha_fill_fp_regs (regno, regp, regp + 31);
diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c
index ca757de660f..c1011c5109f 100644
--- a/gdb/alpha-osf1-tdep.c
+++ b/gdb/alpha-osf1-tdep.c
@@ -45,30 +45,6 @@ alpha_osf1_sigcontext_addr (struct frame_info *frame)
return (read_memory_integer (get_frame_base (frame), 8));
}
-/* This is the definition of CALL_DUMMY_ADDRESS. It's a heuristic that is used
- to find a convenient place in the text segment to stick a breakpoint to
- detect the completion of a target function call (ala call_function_by_hand).
- */
-
-static CORE_ADDR
-alpha_call_dummy_address (void)
-{
- CORE_ADDR entry;
- struct minimal_symbol *sym;
-
- entry = entry_point_address ();
-
- if (entry != 0)
- return entry;
-
- sym = lookup_minimal_symbol ("_Prelude", NULL, symfile_objfile);
-
- if (!sym || MSYMBOL_TYPE (sym) != mst_text)
- return 0;
- else
- return SYMBOL_VALUE_ADDRESS (sym) + 4;
-}
-
static void
alpha_osf1_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
@@ -84,11 +60,6 @@ alpha_osf1_init_abi (struct gdbarch_info info,
instead. */
set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
- /* Alpha OSF/1 inhibits execution of code on the stack. But there is
- no need for a dummy on the Alpha. PUSH_ARGUMENTS takes care of all
- argument handling and bp_call_dummy takes care of stopping the dummy. */
- set_gdbarch_call_dummy_address (gdbarch, alpha_call_dummy_address);
-
tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
tdep->jb_pc = 2;
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index d6e95ca6b86..ddf27448380 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -189,7 +189,7 @@ alpha_lds (void *out, const void *in)
/* Similarly, this represents exactly the conversion performed by
the STS instruction. */
-static inline void
+static void
alpha_sts (void *out, const void *in)
{
ULONGEST reg, mem;
@@ -278,7 +278,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
};
struct alpha_arg *alpha_args
= (struct alpha_arg *) alloca (nargs * sizeof (struct alpha_arg));
- register struct alpha_arg *m_arg;
+ struct alpha_arg *m_arg;
char arg_reg_buffer[ALPHA_REGISTER_SIZE * ALPHA_NUM_ARG_REGS];
int required_arg_regs;
@@ -1138,7 +1138,7 @@ alpha_heuristic_frame_this_id (struct frame_info *next_frame,
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (inside_entry_file (info->start_pc))
+ if (deprecated_inside_entry_file (info->start_pc))
return;
*this_id = frame_id_build (info->vfp, info->start_pc);
diff --git a/gdb/alphafbsd-tdep.c b/gdb/alphafbsd-tdep.c
index d8f4fa039c3..cc5f0e00e55 100644
--- a/gdb/alphafbsd-tdep.c
+++ b/gdb/alphafbsd-tdep.c
@@ -81,10 +81,7 @@ alphafbsd_sigtramp_offset (CORE_ADDR pc)
static CORE_ADDR
alphafbsd_sigcontext_addr (struct frame_info *next_frame)
{
- ULONGEST sp;
-
- frame_unwind_unsigned_register (next_frame, ALPHA_SP_REGNUM, &sp);
- return sp + 24;
+ return frame_unwind_register_unsigned (next_frame, ALPHA_SP_REGNUM) + 24;
}
/* FreeBSD 5.0-RELEASE or later. */
diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c
new file mode 100644
index 00000000000..fb0efcf8dea
--- /dev/null
+++ b/gdb/amd64-nat.c
@@ -0,0 +1,144 @@
+/* Native-dependent code for AMD64.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "gdbarch.h"
+#include "regcache.h"
+
+#include "gdb_assert.h"
+
+#include "i386-tdep.h"
+#include "x86-64-tdep.h"
+
+/* The following bits of code help with implementing debugging 32-bit
+ code natively on AMD64. The idea is to define two mappings between
+ the register number as used by GDB and the register set used by the
+ host to represent the general-purpose registers; one for 32-bit
+ code and one for 64-bit code. The mappings are specified by the
+ follwing variables and consist of an array of offsets within the
+ register set indexed by register number, and the number of
+ registers supported by the mapping. We don't need mappings for the
+ floating-point and SSE registers, since the difference between
+ 64-bit and 32-bit variants are negligable. The difference in the
+ number of SSE registers is already handled by the target code. */
+
+/* General-purpose register mapping for native 32-bit code. */
+int *amd64_native_gregset32_reg_offset;
+int amd64_native_gregset32_num_regs = I386_NUM_GREGS;
+
+/* General-purpose register mapping for native 64-bit code. */
+int *amd64_native_gregset64_reg_offset;
+int amd64_native_gregset64_num_regs = X86_64_NUM_GREGS;
+
+/* Return the offset of REGNUM within the appropriate native
+ general-purpose register set. */
+
+static int
+amd64_native_gregset_reg_offset (int regnum)
+{
+ int *reg_offset = amd64_native_gregset64_reg_offset;
+ int num_regs = amd64_native_gregset64_num_regs;
+
+ gdb_assert (regnum >= 0);
+
+ if (gdbarch_ptr_bit (current_gdbarch) == 32)
+ {
+ reg_offset = amd64_native_gregset32_reg_offset;
+ num_regs = amd64_native_gregset32_num_regs;
+ }
+
+ if (num_regs > NUM_REGS)
+ num_regs = NUM_REGS;
+
+ if (regnum < num_regs && regnum < NUM_REGS)
+ return reg_offset[regnum];
+
+ return -1;
+}
+
+/* Return whether the native general-purpose register set supplies
+ register REGNUM. */
+
+int
+amd64_native_gregset_supplies_p (int regnum)
+{
+ return (amd64_native_gregset_reg_offset (regnum) != -1);
+}
+
+
+/* Supply register REGNUM, whose contents are store in BUF, to
+ REGCACHE. If REGNUM is -1, supply all appropriate registers. */
+
+void
+amd64_supply_native_gregset (struct regcache *regcache,
+ const void *gregs, int regnum)
+{
+ const char *regs = gregs;
+ int num_regs = amd64_native_gregset64_num_regs;
+ int i;
+
+ if (gdbarch_ptr_bit (current_gdbarch) == 32)
+ num_regs = amd64_native_gregset32_num_regs;
+
+ if (num_regs > NUM_REGS)
+ num_regs = NUM_REGS;
+
+ for (i = 0; i < num_regs; i++)
+ {
+ if (regnum == -1 || regnum == i)
+ {
+ int offset = amd64_native_gregset_reg_offset (i);
+
+ if (offset != -1)
+ regcache_raw_supply (current_regcache, i, regs + offset);
+ }
+ }
+}
+
+/* Collect register REGNUM from REGCACHE and store its contents in
+ GREGS. If REGNUM is -1, collect and store all appropriate
+ registers. */
+
+void
+amd64_collect_native_gregset (const struct regcache *regcache,
+ void *gregs, int regnum)
+{
+ char *regs = gregs;
+ int num_regs = amd64_native_gregset64_num_regs;
+ int i;
+
+ if (gdbarch_ptr_bit (current_gdbarch) == 32)
+ num_regs = amd64_native_gregset32_num_regs;
+
+ if (num_regs > NUM_REGS)
+ num_regs = NUM_REGS;
+
+ for (i = 0; i < num_regs; i++)
+ {
+ if (regnum == -1 || regnum == i)
+ {
+ int offset = amd64_native_gregset_reg_offset (i);
+
+ if (offset != -1)
+ regcache_raw_collect (current_regcache, i, regs + offset);
+ }
+ }
+}
diff --git a/gdb/amd64-nat.h b/gdb/amd64-nat.h
new file mode 100644
index 00000000000..edf6df8de87
--- /dev/null
+++ b/gdb/amd64-nat.h
@@ -0,0 +1,53 @@
+/* Native-dependent code for AMD64.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef AMD64_NAT_H
+#define AMD64_NAT_H 1
+
+struct regcache;
+
+/* General-purpose register set description for native 32-bit code. */
+extern int *amd64_native_gregset32_reg_offset;
+extern int amd64_native_gregset32_num_regs;
+
+/* General-purpose register set description for native 64-bit code. */
+extern int *amd64_native_gregset64_reg_offset;
+extern int amd64_native_gregset64_num_regs;
+
+/* Return whether the native general-purpose register set supplies
+ register REGNUM. */
+
+extern int amd64_native_gregset_supplies_p (int regnum);
+
+/* Supply register REGNUM, whose contents are store in BUF, to
+ REGCACHE. If REGNUM is -1, supply all appropriate registers. */
+
+extern void amd64_supply_native_gregset (struct regcache *regcache,
+ const void *gregs, int regnum);
+
+/* Collect register REGNUM from REGCACHE and store its contents in
+ GREGS. If REGNUM is -1, collect and store all appropriate
+ registers. */
+
+extern void amd64_collect_native_gregset (const struct regcache *regcache,
+ void *gregs, int regnum);
+
+#endif /* amd64-nat.h */
diff --git a/gdb/amd64fbsd-nat.c b/gdb/amd64fbsd-nat.c
index 7880e58c48c..ed2d39bb742 100644
--- a/gdb/amd64fbsd-nat.c
+++ b/gdb/amd64fbsd-nat.c
@@ -1,4 +1,5 @@
/* Native-dependent code for FreeBSD/amd64.
+
Copyright 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -44,13 +45,14 @@ typedef struct fpreg fpregset_t;
#include "gregset.h"
#include "x86-64-tdep.h"
+#include "amd64-nat.h"
/* Offset to the gregset_t location where REG is stored. */
#define REG_OFFSET(reg) offsetof (gregset_t, reg)
-/* At reg_offset[REGNO] you'll find the offset to the gregset_t
- location where the GDB register REGNO is stored. Unsupported
+/* At reg_offset[REGNUM] you'll find the offset to the gregset_t
+ location where the GDB register REGNUM is stored. Unsupported
registers are marked with `-1'. */
static int reg_offset[] =
{
@@ -77,12 +79,27 @@ static int reg_offset[] =
-1,
-1
};
+
+
+/* Mapping between the general-purpose registers in FreeBSD/amd64
+ `struct reg' format and GDB's register cache layout for
+ FreeBSD/i386.
-#define REG_ADDR(regset, regno) ((char *) (regset) + reg_offset[regno])
+ Note that most FreeBSD/amd64 registers are 64-bit, while the
+ FreeBSD/i386 registers are all 32-bit, but since we're
+ little-endian we get away with that. */
-/* Macro to determine if a register is fetched with PT_GETREGS. */
-#define GETREGS_SUPPLIES(regno) \
- ((0 <= (regno) && (regno) < X86_64_NUM_GREGS))
+/* From <machine/reg.h>. */
+static int amd64fbsd32_r_reg_offset[I386_NUM_GREGS] =
+{
+ 14 * 8, 13 * 8, /* %eax, %ecx */
+ 12 * 8, 11 * 8, /* %edx, %ebx */
+ 20 * 8, 10 * 8, /* %esp, %ebp */
+ 9 * 8, 8 * 8, /* %esi, %edi */
+ 17 * 8, 19 * 8, /* %eip, %eflags */
+ 18 * 8, 21 * 8, /* %cs, %ss */
+ -1, -1, -1, -1 /* %ds, %es, %fs, %gs */
+};
/* Transfering the registers between GDB, inferiors and core files. */
@@ -93,29 +110,17 @@ static int reg_offset[] =
void
supply_gregset (gregset_t *gregsetp)
{
- int i;
-
- for (i = 0; i < X86_64_NUM_GREGS; i++)
- {
- if (reg_offset[i] == -1)
- supply_register (i, NULL);
- else
- supply_register (i, REG_ADDR (gregsetp, i));
- }
+ amd64_supply_native_gregset (current_regcache, gregsetp, -1);
}
-/* Fill register REGNO (if it is a general-purpose register) in
- *GREGSETPS with the value in GDB's register array. If REGNO is -1,
+/* Fill register REGNUM (if it is a general-purpose register) in
+ *GREGSETPS with the value in GDB's register array. If REGNUM is -1,
do this for all registers. */
void
-fill_gregset (gregset_t *gregsetp, int regno)
+fill_gregset (gregset_t *gregsetp, int regnum)
{
- int i;
-
- for (i = 0; i < X86_64_NUM_GREGS; i++)
- if ((regno == -1 || regno == i) && reg_offset[i] != -1)
- regcache_collect (i, REG_ADDR (gregsetp, i));
+ amd64_collect_native_gregset (current_regcache, gregsetp, regnum);
}
/* Fill GDB's register array with the floating-point register values
@@ -124,84 +129,84 @@ fill_gregset (gregset_t *gregsetp, int regno)
void
supply_fpregset (fpregset_t *fpregsetp)
{
- x86_64_supply_fxsave ((char *) fpregsetp);
+ x86_64_supply_fxsave ((const char *) fpregsetp, -1);
}
-/* Fill register REGNO (if it is a floating-point register) in
- *FPREGSETP with the value in GDB's register array. If REGNO is -1,
+/* Fill register REGNUM (if it is a floating-point register) in
+ *FPREGSETP with the value in GDB's register array. If REGNUM is -1,
do this for all registers. */
void
-fill_fpregset (fpregset_t *fpregsetp, int regno)
+fill_fpregset (fpregset_t *fpregsetp, int regnum)
{
- x86_64_fill_fxsave ((char *) fpregsetp, regno);
+ x86_64_fill_fxsave ((char *) fpregsetp, regnum);
}
-/* Fetch register REGNO from the inferior. If REGNO is -1, do this
+/* Fetch register REGNUM from the inferior. If REGNUM is -1, do this
for all registers (including the floating point registers). */
void
-fetch_inferior_registers (int regno)
+fetch_inferior_registers (int regnum)
{
- if (regno == -1 || GETREGS_SUPPLIES (regno))
+ if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
{
- gregset_t gregs;
+ struct reg regs;
if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+ (PTRACE_ARG3_TYPE) &regs, 0) == -1)
perror_with_name ("Couldn't get registers");
- supply_gregset (&gregs);
- if (regno != -1)
+ amd64_supply_native_gregset (current_regcache, &regs, -1);
+ if (regnum != -1)
return;
}
- if (regno == -1 || regno >= FP0_REGNUM)
+ if (regnum == -1 || regnum >= FP0_REGNUM)
{
- fpregset_t fpregs;
+ struct fpreg fpregs;
if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't get floating point status");
- supply_fpregset (&fpregs);
+ x86_64_supply_fxsave ((const char *) &fpregs, -1);
}
}
-/* Store register REGNO back into the inferior. If REGNO is -1, do
+/* Store register REGNUM back into the inferior. If REGNUM is -1, do
this for all registers (including the floating point registers). */
void
-store_inferior_registers (int regno)
+store_inferior_registers (int regnum)
{
- if (regno == -1 || GETREGS_SUPPLIES (regno))
+ if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
{
- gregset_t gregs;
+ struct reg regs;
if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+ (PTRACE_ARG3_TYPE) &regs, 0) == -1)
perror_with_name ("Couldn't get registers");
- fill_gregset (&gregs, regno);
+ amd64_collect_native_gregset (current_regcache, &regs, regnum);
if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+ (PTRACE_ARG3_TYPE) &regs, 0) == -1)
perror_with_name ("Couldn't write registers");
- if (regno != -1)
+ if (regnum != -1)
return;
}
- if (regno == -1 || regno >= FP0_REGNUM)
+ if (regnum == -1 || regnum >= FP0_REGNUM)
{
- fpregset_t fpregs;
+ struct fpreg fpregs;
if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't get floating point status");
- fill_fpregset (&fpregs, regno);
-
+ x86_64_fill_fxsave ((char *) &fpregs, regnum);
+
if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't write floating point status");
@@ -213,17 +218,19 @@ store_inferior_registers (int regno)
void _initialize_amd64fbsd_nat (void);
void
-_initialize_am64fbsd_nat (void)
+_initialize_amd64fbsd_nat (void)
{
int offset;
+ amd64_native_gregset32_reg_offset = amd64fbsd32_r_reg_offset;
+ amd64_native_gregset64_reg_offset = reg_offset;
+
/* To support the recognition of signal handlers, i386bsd-tdep.c
hardcodes some constants. Inclusion of this file means that we
are compiling a native debugger, which means that we can use the
system header files and sysctl(3) to get at the relevant
information. */
- extern int amd64fbsd_sc_reg_offset[];
#define SC_REG_OFFSET amd64fbsd_sc_reg_offset
/* We only check the program counter, stack pointer and frame
@@ -282,12 +289,9 @@ Please report this to <bug-gdb@gnu.org>.",
environment can be found. */
{
int mib[2];
- int ps_strings;
+ long ps_strings;
size_t len;
- extern CORE_ADDR amd64fbsd_sigtramp_start;
- extern CORE_ADDR amd64fbsd_sigtramp_end;
-
mib[0] = CTL_KERN;
mib[1] = KERN_PS_STRINGS;
len = sizeof (ps_strings);
diff --git a/gdb/amd64fbsd-tdep.c b/gdb/amd64fbsd-tdep.c
index e72c14039eb..9f6c2172328 100644
--- a/gdb/amd64fbsd-tdep.c
+++ b/gdb/amd64fbsd-tdep.c
@@ -37,42 +37,42 @@
static CORE_ADDR
amd64fbsd_sigcontext_addr (struct frame_info *next_frame)
{
- char buf[8];
CORE_ADDR sp;
- frame_unwind_register (next_frame, X86_64_RSP_REGNUM, buf);
- sp = extract_unsigned_integer (buf, 8);
-
- return read_memory_unsigned_integer (sp + 16, 8);
+ /* The `struct sigcontext' (which really is an `ucontext_t' on
+ FreeBSD/amd64) lives at a fixed offset in the signal frame. See
+ <machine/sigframe.h>. */
+ sp = frame_unwind_register_unsigned (next_frame, X86_64_RSP_REGNUM);
+ return sp + 16;
}
/* FreeBSD 5.1-RELEASE or later. */
/* Location of the signal trampoline. */
-CORE_ADDR amd64fbsd_sigtramp_start = 0x7fffffffc0;
-CORE_ADDR amd64fbsd_sigtramp_end = 0x7fffffffe0;
+CORE_ADDR amd64fbsd_sigtramp_start = 0x7fffffffffc0;
+CORE_ADDR amd64fbsd_sigtramp_end = 0x7fffffffffe0;
/* From <machine/signal.h>. */
int amd64fbsd_sc_reg_offset[X86_64_NUM_GREGS] =
{
- 24 + 14 * 8, /* %rax */
- 24 + 11 * 8, /* %rbx */
- 24 + 13 * 8, /* %rcx */
- 24 + 12 * 8, /* %rdx */
- 24 + 9 * 8, /* %rsi */
- 24 + 8 * 8, /* %rdi */
- 24 + 10 * 8, /* %rbp */
- 24 + 20 * 8, /* %rsp */
- 24 + 7 * 8, /* %r8 */
- 24 + 6 * 8, /* %r9 */
- 24 + 5 * 8, /* %r10 */
- 24 + 4 * 8, /* %r11 */
- 24 + 3 * 8, /* %r12 */
- 24 + 2 * 8, /* %r13 */
- 24 + 1 * 8, /* %r14 */
- 24 + 0 * 8, /* %r15 */
- 24 + 17 * 8, /* %rip */
- 24 + 19 * 8, /* %eflags */
+ 24 + 6 * 8, /* %rax */
+ 24 + 7 * 8, /* %rbx */
+ 24 + 3 * 8, /* %rcx */
+ 24 + 2 * 8, /* %rdx */
+ 24 + 1 * 8, /* %rsi */
+ 24 + 0 * 8, /* %rdi */
+ 24 + 8 * 8, /* %rbp */
+ 24 + 21 * 8, /* %rsp */
+ 24 + 4 * 8, /* %r8 */
+ 24 + 5 * 8, /* %r9 */
+ 24 + 9 * 8, /* %r10 */
+ 24 + 10 * 8, /* %r11 */
+ 24 + 11 * 8, /* %r12 */
+ 24 + 12 * 8, /* %r13 */
+ 24 + 13 * 8, /* %r14 */
+ 24 + 14 * 8, /* %r15 */
+ 24 + 18 * 8, /* %rip */
+ 24 + 20 * 8, /* %eflags */
-1, /* %ds */
-1, /* %es */
-1, /* %fs */
@@ -90,7 +90,7 @@ amd64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
x86_64_init_abi (info, gdbarch);
tdep->sigtramp_start = amd64fbsd_sigtramp_start;
- tdep->sigtramp_end = amd64fbsd_sigtramp_start;
+ tdep->sigtramp_end = amd64fbsd_sigtramp_end;
tdep->sigcontext_addr = amd64fbsd_sigcontext_addr;
tdep->sc_reg_offset = amd64fbsd_sc_reg_offset;
tdep->sc_num_regs = X86_64_NUM_GREGS;
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 40a863b26f8..e344ec05470 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -22,23 +22,9 @@
#include "defs.h"
-#if GDB_MULTI_ARCH
#include "arch-utils.h"
#include "gdbcmd.h"
#include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
-#else
-/* Just include everything in sight so that the every old definition
- of macro is visible. */
-#include "symtab.h"
-#include "frame.h"
-#include "inferior.h"
-#include "breakpoint.h"
-#include "gdb_wait.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-#include "target.h"
-#include "annotate.h"
-#endif
#include "gdb_string.h"
#include "regcache.h"
#include "gdb_assert.h"
@@ -154,14 +140,6 @@ generic_prologue_frameless_p (CORE_ADDR ip)
return ip == SKIP_PROLOGUE (ip);
}
-/* New/multi-arched targets should use the correct gdbarch field
- instead of using this global pointer. */
-int
-legacy_print_insn (bfd_vma vma, disassemble_info *info)
-{
- return (*deprecated_tm_print_insn) (vma, info);
-}
-
/* Helper functions for INNER_THAN */
int
@@ -182,11 +160,7 @@ core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs)
const struct floatformat *
default_float_format (struct gdbarch *gdbarch)
{
-#if GDB_MULTI_ARCH
int byte_order = gdbarch_byte_order (gdbarch);
-#else
- int byte_order = TARGET_BYTE_ORDER;
-#endif
switch (byte_order)
{
case BFD_ENDIAN_BIG:
@@ -203,11 +177,7 @@ default_float_format (struct gdbarch *gdbarch)
const struct floatformat *
default_double_format (struct gdbarch *gdbarch)
{
-#if GDB_MULTI_ARCH
int byte_order = gdbarch_byte_order (gdbarch);
-#else
- int byte_order = TARGET_BYTE_ORDER;
-#endif
switch (byte_order)
{
case BFD_ENDIAN_BIG:
@@ -436,39 +406,21 @@ set_endian (char *ignore_args, int from_tty, struct cmd_list_element *c)
}
else if (set_endian_string == endian_little)
{
+ struct gdbarch_info info;
target_byte_order_auto = 0;
- if (GDB_MULTI_ARCH)
- {
- struct gdbarch_info info;
- gdbarch_info_init (&info);
- info.byte_order = BFD_ENDIAN_LITTLE;
- if (! gdbarch_update_p (info))
- {
- printf_unfiltered ("Little endian target not supported by GDB\n");
- }
- }
- else
- {
- target_byte_order = BFD_ENDIAN_LITTLE;
- }
+ gdbarch_info_init (&info);
+ info.byte_order = BFD_ENDIAN_LITTLE;
+ if (! gdbarch_update_p (info))
+ printf_unfiltered ("Little endian target not supported by GDB\n");
}
else if (set_endian_string == endian_big)
{
+ struct gdbarch_info info;
target_byte_order_auto = 0;
- if (GDB_MULTI_ARCH)
- {
- struct gdbarch_info info;
- gdbarch_info_init (&info);
- info.byte_order = BFD_ENDIAN_BIG;
- if (! gdbarch_update_p (info))
- {
- printf_unfiltered ("Big endian target not supported by GDB\n");
- }
- }
- else
- {
- target_byte_order = BFD_ENDIAN_BIG;
- }
+ gdbarch_info_init (&info);
+ info.byte_order = BFD_ENDIAN_BIG;
+ if (! gdbarch_update_p (info))
+ printf_unfiltered ("Big endian target not supported by GDB\n");
}
else
internal_error (__FILE__, __LINE__,
@@ -476,28 +428,6 @@ set_endian (char *ignore_args, int from_tty, struct cmd_list_element *c)
show_endian (NULL, from_tty);
}
-/* Set the endianness from a BFD. */
-
-static void
-set_endian_from_file (bfd *abfd)
-{
- int want;
- if (GDB_MULTI_ARCH)
- internal_error (__FILE__, __LINE__,
- "set_endian_from_file: not for multi-arch");
- if (bfd_big_endian (abfd))
- want = BFD_ENDIAN_BIG;
- else
- want = BFD_ENDIAN_LITTLE;
- if (TARGET_BYTE_ORDER_AUTO)
- target_byte_order = want;
- else if (TARGET_BYTE_ORDER != want)
- warning ("%s endian file does not match %s endian target.",
- want == BFD_ENDIAN_BIG ? "big" : "little",
- TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "big" : "little");
-}
-
-
/* Functions to manipulate the architecture of the target */
enum set_arch { set_arch_auto, set_arch_manual };
@@ -506,96 +436,6 @@ int target_architecture_auto = 1;
const char *set_architecture_string;
-/* Old way of changing the current architecture. */
-
-extern const struct bfd_arch_info bfd_default_arch_struct;
-const struct bfd_arch_info *target_architecture = &bfd_default_arch_struct;
-int (*target_architecture_hook) (const struct bfd_arch_info *ap);
-
-static int
-arch_ok (const struct bfd_arch_info *arch)
-{
- if (GDB_MULTI_ARCH)
- internal_error (__FILE__, __LINE__,
- "arch_ok: not multi-arched");
- /* Should be performing the more basic check that the binary is
- compatible with GDB. */
- /* Check with the target that the architecture is valid. */
- return (target_architecture_hook == NULL
- || target_architecture_hook (arch));
-}
-
-static void
-set_arch (const struct bfd_arch_info *arch,
- enum set_arch type)
-{
- if (GDB_MULTI_ARCH)
- internal_error (__FILE__, __LINE__,
- "set_arch: not multi-arched");
- switch (type)
- {
- case set_arch_auto:
- if (!arch_ok (arch))
- warning ("Target may not support %s architecture",
- arch->printable_name);
- target_architecture = arch;
- break;
- case set_arch_manual:
- if (!arch_ok (arch))
- {
- printf_unfiltered ("Target does not support `%s' architecture.\n",
- arch->printable_name);
- }
- else
- {
- target_architecture_auto = 0;
- target_architecture = arch;
- }
- break;
- }
- if (gdbarch_debug)
- gdbarch_dump (current_gdbarch, gdb_stdlog);
-}
-
-/* Set the architecture from arch/machine (deprecated) */
-
-void
-set_architecture_from_arch_mach (enum bfd_architecture arch,
- unsigned long mach)
-{
- const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach);
- if (GDB_MULTI_ARCH)
- internal_error (__FILE__, __LINE__,
- "set_architecture_from_arch_mach: not multi-arched");
- if (wanted != NULL)
- set_arch (wanted, set_arch_manual);
- else
- internal_error (__FILE__, __LINE__,
- "gdbarch: hardwired architecture/machine not recognized");
-}
-
-/* Set the architecture from a BFD (deprecated) */
-
-static void
-set_architecture_from_file (bfd *abfd)
-{
- const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd);
- if (GDB_MULTI_ARCH)
- internal_error (__FILE__, __LINE__,
- "set_architecture_from_file: not multi-arched");
- if (target_architecture_auto)
- {
- set_arch (wanted, set_arch_auto);
- }
- else if (wanted != target_architecture)
- {
- warning ("%s architecture file may be incompatible with %s target.",
- wanted->printable_name,
- target_architecture->printable_name);
- }
-}
-
-
/* Called if the user enters ``show architecture'' without an
argument. */
@@ -621,7 +461,7 @@ set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c)
{
target_architecture_auto = 1;
}
- else if (GDB_MULTI_ARCH)
+ else
{
struct gdbarch_info info;
gdbarch_info_init (&info);
@@ -635,15 +475,6 @@ set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c)
printf_unfiltered ("Architecture `%s' not recognized.\n",
set_architecture_string);
}
- else
- {
- const struct bfd_arch_info *arch
- = bfd_scan_arch (set_architecture_string);
- if (arch == NULL)
- internal_error (__FILE__, __LINE__,
- "set_architecture: bfd_scan_arch failed");
- set_arch (arch, set_arch_manual);
- }
show_architecture (NULL, from_tty);
}
@@ -653,19 +484,11 @@ set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c)
void
set_gdbarch_from_file (bfd *abfd)
{
- if (GDB_MULTI_ARCH)
- {
- struct gdbarch_info info;
- gdbarch_info_init (&info);
- info.abfd = abfd;
- if (! gdbarch_update_p (info))
- error ("Architecture of file not recognized.\n");
- }
- else
- {
- set_architecture_from_file (abfd);
- set_endian_from_file (abfd);
- }
+ struct gdbarch_info info;
+ gdbarch_info_init (&info);
+ info.abfd = abfd;
+ if (! gdbarch_update_p (info))
+ error ("Architecture of file not recognized.\n");
}
/* Initialize the current architecture. Update the ``set
@@ -752,22 +575,9 @@ initialize_current_architecture (void)
info.byte_order = BFD_ENDIAN_BIG;
}
- if (GDB_MULTI_ARCH)
- {
- if (! gdbarch_update_p (info))
- {
- internal_error (__FILE__, __LINE__,
- "initialize_current_architecture: Selection of initial architecture failed");
- }
- }
- else
- {
- /* If the multi-arch logic comes up with a byte-order (from BFD)
- use it for the non-multi-arch case. */
- if (info.byte_order != BFD_ENDIAN_UNKNOWN)
- target_byte_order = info.byte_order;
- initialize_non_multiarch ();
- }
+ if (! gdbarch_update_p (info))
+ internal_error (__FILE__, __LINE__,
+ "initialize_current_architecture: Selection of initial architecture failed");
/* Create the ``set architecture'' command appending ``auto'' to the
list of architectures. */
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index fcea5310b25..d2e682987b9 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -55,9 +55,6 @@ extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_in
language family, so that case is irrelevant for C. */
extern gdbarch_return_value_on_stack_ftype generic_return_value_on_stack_not;
-/* Accessor for old global function pointer for disassembly. */
-extern int legacy_print_insn (bfd_vma vma, disassemble_info *info);
-
/* Backward compatible call_dummy_words. */
extern LONGEST legacy_call_dummy_words[];
extern int legacy_sizeof_call_dummy_words;
@@ -78,22 +75,6 @@ extern int core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs);
extern const struct floatformat *default_float_format (struct gdbarch *gdbarch);
extern const struct floatformat *default_double_format (struct gdbarch *gdbarch);
-/* The following DEPRECATED interfaces are for pre- multi-arch legacy
- targets. */
-
-/* DEPRECATED pre- multi-arch interface. Explicitly set the dynamic
- target-system-dependent parameters based on bfd_architecture and
- machine. This function is deprecated, use
- set_gdbarch_from_arch_machine(). */
-
-extern void set_architecture_from_arch_mach (enum bfd_architecture, unsigned long);
-
-/* DEPRECATED pre- multi-arch interface. Notify the target dependent
- backend of a change to the selected architecture. A zero return
- status indicates that the target did not like the change. */
-
-extern int (*target_architecture_hook) (const struct bfd_arch_info *);
-
/* Identity function on a CORE_ADDR. Just returns its parameter. */
extern CORE_ADDR core_addr_identity (CORE_ADDR addr);
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 5ea3ef2f982..b5fb496deb4 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -41,11 +41,12 @@
is to execute a particular software interrupt, rather than use a
particular undefined instruction to provoke a trap. Upon exection
of the software interrupt the kernel stops the inferior with a
- SIGTRAP, and wakes the debugger. Since ARM GNU/Linux is little
- endian, and doesn't support Thumb at the moment we only override
- the ARM little-endian breakpoint. */
+ SIGTRAP, and wakes the debugger. Since ARM GNU/Linux doesn't support
+ Thumb at the moment we only override the ARM breakpoints. */
-static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
+static const char arm_linux_arm_le_breakpoint[] = { 0x01, 0x00, 0x9f, 0xef };
+
+static const char arm_linux_arm_be_breakpoint[] = { 0xef, 0x9f, 0x00, 0x01 };
/* DEPRECATED_CALL_DUMMY_WORDS:
This sequence of words is the instructions
@@ -85,7 +86,7 @@ arm_linux_extract_return_value (struct type *type,
int regnum = ((TYPE_CODE_FLT == TYPE_CODE (type))
? ARM_F0_REGNUM : ARM_A1_REGNUM);
- memcpy (valbuf, &regbuf[REGISTER_BYTE (regnum)], TYPE_LENGTH (type));
+ memcpy (valbuf, &regbuf[DEPRECATED_REGISTER_BYTE (regnum)], TYPE_LENGTH (type));
}
/* Note: ScottB
@@ -566,7 +567,10 @@ arm_linux_init_abi (struct gdbarch_info info,
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
tdep->lowest_pc = 0x8000;
- tdep->arm_breakpoint = arm_linux_arm_le_breakpoint;
+ if (info.byte_order == BFD_ENDIAN_BIG)
+ tdep->arm_breakpoint = arm_linux_arm_be_breakpoint;
+ else
+ tdep->arm_breakpoint = arm_linux_arm_le_breakpoint;
tdep->arm_breakpoint_size = sizeof (arm_linux_arm_le_breakpoint);
tdep->fp_model = ARM_FLOAT_FPA;
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 3f2f13c3bb6..3ba072d1ff8 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -34,6 +34,9 @@
#include "value.h"
#include "arch-utils.h"
#include "osabi.h"
+#include "frame-unwind.h"
+#include "frame-base.h"
+#include "trad-frame.h"
#include "arm-tdep.h"
#include "gdb/sim-arm.h"
@@ -155,17 +158,26 @@ static void convert_from_extended (const struct floatformat *, const void *,
static void convert_to_extended (const struct floatformat *, void *,
const void *);
-/* Define other aspects of the stack frame. We keep the offsets of
- all saved registers, 'cause we need 'em a lot! We also keep the
- current size of the stack frame, and the offset of the frame
- pointer from the stack pointer (for frameless functions, and when
- we're still in the prologue of a function with a frame). */
-
-struct frame_extra_info
+struct arm_prologue_cache
{
+ /* The stack pointer at the time this frame was created; i.e. the
+ caller's stack pointer when this function was called. It is used
+ to identify this frame. */
+ CORE_ADDR prev_sp;
+
+ /* The frame base for this frame is just prev_sp + frame offset -
+ frame size. FRAMESIZE is the size of this stack frame, and
+ FRAMEOFFSET if the initial offset from the stack pointer (this
+ frame's stack pointer, not PREV_SP) to the frame base. */
+
int framesize;
int frameoffset;
+
+ /* The register used to hold the frame pointer for this frame. */
int framereg;
+
+ /* Saved register offsets. */
+ struct trad_frame_saved_reg *saved_regs;
};
/* Addresses for calling Thumb functions have the bit 0 set.
@@ -174,12 +186,6 @@ struct frame_extra_info
#define MAKE_THUMB_ADDR(addr) ((addr) | 1)
#define UNMAKE_THUMB_ADDR(addr) ((addr) & ~1)
-static int
-arm_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
-{
- return (DEPRECATED_FRAME_SAVED_PC (thisframe) >= LOWEST_PC);
-}
-
/* Set to true if the 32-bit mode is in use. */
int arm_apcs_32 = 1;
@@ -502,7 +508,6 @@ arm_skip_prologue (CORE_ADDR pc)
2) which registers are saved on it
3) the offsets of saved regs
4) the offset from the stack pointer to the frame pointer
- This information is stored in the "extra" fields of the frame_info.
A typical Thumb function prologue would create this stack frame
(offsets relative to FP)
@@ -519,7 +524,7 @@ arm_skip_prologue (CORE_ADDR pc)
/* *INDENT-ON* */
static void
-thumb_scan_prologue (struct frame_info *fi)
+thumb_scan_prologue (CORE_ADDR prev_pc, struct arm_prologue_cache *cache)
{
CORE_ADDR prologue_start;
CORE_ADDR prologue_end;
@@ -534,17 +539,12 @@ thumb_scan_prologue (struct frame_info *fi)
int findmask = 0;
int i;
- /* Don't try to scan dummy frames. */
- if (fi != NULL
- && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
- return;
-
- if (find_pc_partial_function (get_frame_pc (fi), NULL, &prologue_start, &prologue_end))
+ if (find_pc_partial_function (prev_pc, NULL, &prologue_start, &prologue_end))
{
struct symtab_and_line sal = find_pc_line (prologue_start, 0);
if (sal.line == 0) /* no line info, use current PC */
- prologue_end = get_frame_pc (fi);
+ prologue_end = prev_pc;
else if (sal.end < prologue_end) /* next line begins after fn end */
prologue_end = sal.end; /* (probably means no prologue) */
}
@@ -553,7 +553,7 @@ thumb_scan_prologue (struct frame_info *fi)
16 pushes, an add, and "mv fp,sp". */
prologue_end = prologue_start + 40;
- prologue_end = min (prologue_end, get_frame_pc (fi));
+ prologue_end = min (prologue_end, prev_pc);
/* Initialize the saved register map. When register H is copied to
register L, we will put H in saved_reg[L]. */
@@ -564,7 +564,7 @@ thumb_scan_prologue (struct frame_info *fi)
frame pointer, adjust the stack pointer, and save registers.
Do this until all basic prolog instructions are found. */
- get_frame_extra_info (fi)->framesize = 0;
+ cache->framesize = 0;
for (current_pc = prologue_start;
(current_pc < prologue_end) && ((findmask & 7) != 7);
current_pc += 2)
@@ -587,9 +587,8 @@ thumb_scan_prologue (struct frame_info *fi)
for (regno = ARM_LR_REGNUM; regno >= 0; regno--)
if (mask & (1 << regno))
{
- get_frame_extra_info (fi)->framesize += 4;
- get_frame_saved_regs (fi)[saved_reg[regno]] =
- -(get_frame_extra_info (fi)->framesize);
+ cache->framesize += 4;
+ cache->saved_regs[saved_reg[regno]].addr = -cache->framesize;
/* Reset saved register map. */
saved_reg[regno] = regno;
}
@@ -605,23 +604,23 @@ thumb_scan_prologue (struct frame_info *fi)
offset = (insn & 0x7f) << 2; /* get scaled offset */
if (insn & 0x80) /* is it signed? (==subtracting) */
{
- get_frame_extra_info (fi)->frameoffset += offset;
+ cache->frameoffset += offset;
offset = -offset;
}
- get_frame_extra_info (fi)->framesize -= offset;
+ cache->framesize -= offset;
}
else if ((insn & 0xff00) == 0xaf00) /* add r7, sp, #imm */
{
findmask |= 2; /* setting of r7 found */
- get_frame_extra_info (fi)->framereg = THUMB_FP_REGNUM;
+ cache->framereg = THUMB_FP_REGNUM;
/* get scaled offset */
- get_frame_extra_info (fi)->frameoffset = (insn & 0xff) << 2;
+ cache->frameoffset = (insn & 0xff) << 2;
}
else if (insn == 0x466f) /* mov r7, sp */
{
findmask |= 2; /* setting of r7 found */
- get_frame_extra_info (fi)->framereg = THUMB_FP_REGNUM;
- get_frame_extra_info (fi)->frameoffset = 0;
+ cache->framereg = THUMB_FP_REGNUM;
+ cache->frameoffset = 0;
saved_reg[THUMB_FP_REGNUM] = ARM_SP_REGNUM;
}
else if ((insn & 0xffc0) == 0x4640) /* mov r0-r7, r8-r15 */
@@ -706,27 +705,27 @@ thumb_scan_prologue (struct frame_info *fi)
*/
static void
-arm_scan_prologue (struct frame_info *fi)
+arm_scan_prologue (struct frame_info *next_frame, struct arm_prologue_cache *cache)
{
int regno, sp_offset, fp_offset;
- LONGEST return_value;
CORE_ADDR prologue_start, prologue_end, current_pc;
+ CORE_ADDR prev_pc = frame_pc_unwind (next_frame);
/* Assume there is no frame until proven otherwise. */
- get_frame_extra_info (fi)->framereg = ARM_SP_REGNUM;
- get_frame_extra_info (fi)->framesize = 0;
- get_frame_extra_info (fi)->frameoffset = 0;
+ cache->framereg = ARM_SP_REGNUM;
+ cache->framesize = 0;
+ cache->frameoffset = 0;
/* Check for Thumb prologue. */
- if (arm_pc_is_thumb (get_frame_pc (fi)))
+ if (arm_pc_is_thumb (prev_pc))
{
- thumb_scan_prologue (fi);
+ thumb_scan_prologue (prev_pc, cache);
return;
}
/* Find the function prologue. If we can't find the function in
the symbol table, peek in the stack frame to find the PC. */
- if (find_pc_partial_function (get_frame_pc (fi), NULL, &prologue_start, &prologue_end))
+ if (find_pc_partial_function (prev_pc, NULL, &prologue_start, &prologue_end))
{
/* One way to find the end of the prologue (which works well
for unoptimized code) is to do the following:
@@ -734,7 +733,7 @@ arm_scan_prologue (struct frame_info *fi)
struct symtab_and_line sal = find_pc_line (prologue_start, 0);
if (sal.line == 0)
- prologue_end = get_frame_pc (fi);
+ prologue_end = prev_pc;
else if (sal.end < prologue_end)
prologue_end = sal.end;
@@ -767,9 +766,16 @@ arm_scan_prologue (struct frame_info *fi)
}
else
{
- /* Get address of the stmfd in the prologue of the callee;
- the saved PC is the address of the stmfd + 8. */
- if (!safe_read_memory_integer (get_frame_base (fi), 4, &return_value))
+ /* We have no symbol information. Our only option is to assume this
+ function has a standard stack frame and the normal frame register.
+ Then, we can find the value of our frame pointer on entrance to
+ the callee (or at the present moment if this is the innermost frame).
+ The value stored there should be the address of the stmfd + 8. */
+ CORE_ADDR frame_loc;
+ LONGEST return_value;
+
+ frame_loc = frame_unwind_register_unsigned (next_frame, ARM_FP_REGNUM);
+ if (!safe_read_memory_integer (frame_loc, 4, &return_value))
return;
else
{
@@ -778,6 +784,9 @@ arm_scan_prologue (struct frame_info *fi)
}
}
+ if (prev_pc < prologue_end)
+ prologue_end = prev_pc;
+
/* Now search the prologue looking for instructions that set up the
frame pointer, adjust the stack pointer, and save registers.
@@ -828,7 +837,7 @@ arm_scan_prologue (struct frame_info *fi)
if (mask & (1 << regno))
{
sp_offset -= 4;
- get_frame_saved_regs (fi)[regno] = sp_offset;
+ cache->saved_regs[regno].addr = sp_offset;
}
}
else if ((insn & 0xffffc000) == 0xe54b0000 || /* strb rx,[r11,#-n] */
@@ -851,7 +860,7 @@ arm_scan_prologue (struct frame_info *fi)
unsigned rot = (insn & 0xf00) >> 7; /* rotate amount */
imm = (imm >> rot) | (imm << (32 - rot));
fp_offset = -imm;
- get_frame_extra_info (fi)->framereg = ARM_FP_REGNUM;
+ cache->framereg = ARM_FP_REGNUM;
}
else if ((insn & 0xfffff000) == 0xe24dd000) /* sub sp, sp #n */
{
@@ -864,7 +873,7 @@ arm_scan_prologue (struct frame_info *fi)
{
sp_offset -= 12;
regno = ARM_F0_REGNUM + ((insn >> 12) & 0x07);
- get_frame_saved_regs (fi)[regno] = sp_offset;
+ cache->saved_regs[regno].addr = sp_offset;
}
else if ((insn & 0xffbf0fff) == 0xec2d0200) /* sfmfd f0, 4, [sp!] */
{
@@ -891,7 +900,7 @@ arm_scan_prologue (struct frame_info *fi)
for (; fp_start_reg < fp_bound_reg; fp_start_reg++)
{
sp_offset -= 12;
- get_frame_saved_regs (fi)[fp_start_reg++] = sp_offset;
+ cache->saved_regs[fp_start_reg++].addr = sp_offset;
}
}
else if ((insn & 0xf0000000) != 0xe0000000)
@@ -907,266 +916,260 @@ arm_scan_prologue (struct frame_info *fi)
/* The frame size is just the negative of the offset (from the
original SP) of the last thing thing we pushed on the stack.
The frame offset is [new FP] - [new SP]. */
- get_frame_extra_info (fi)->framesize = -sp_offset;
- if (get_frame_extra_info (fi)->framereg == ARM_FP_REGNUM)
- get_frame_extra_info (fi)->frameoffset = fp_offset - sp_offset;
+ cache->framesize = -sp_offset;
+ if (cache->framereg == ARM_FP_REGNUM)
+ cache->frameoffset = fp_offset - sp_offset;
else
- get_frame_extra_info (fi)->frameoffset = 0;
+ cache->frameoffset = 0;
}
-/* Find REGNUM on the stack. Otherwise, it's in an active register.
- One thing we might want to do here is to check REGNUM against the
- clobber mask, and somehow flag it as invalid if it isn't saved on
- the stack somewhere. This would provide a graceful failure mode
- when trying to get the value of caller-saves registers for an inner
- frame. */
-
-static CORE_ADDR
-arm_find_callers_reg (struct frame_info *fi, int regnum)
+static struct arm_prologue_cache *
+arm_make_prologue_cache (struct frame_info *next_frame)
{
- /* NOTE: cagney/2002-05-03: This function really shouldn't be
- needed. Instead the (still being written) register unwind
- function could be called directly. */
- for (; fi; fi = get_next_frame (fi))
- {
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
- {
- return deprecated_read_register_dummy (get_frame_pc (fi),
- get_frame_base (fi), regnum);
- }
- else if (get_frame_saved_regs (fi)[regnum] != 0)
- {
- /* NOTE: cagney/2002-05-03: This would normally need to
- handle ARM_SP_REGNUM as a special case as, according to
- the frame.h comments, saved_regs[SP_REGNUM] contains the
- SP value not its address. It appears that the ARM isn't
- doing this though. */
- return read_memory_integer (get_frame_saved_regs (fi)[regnum],
- REGISTER_RAW_SIZE (regnum));
- }
- }
- return read_register (regnum);
+ int reg;
+ struct arm_prologue_cache *cache;
+ CORE_ADDR unwound_fp;
+
+ cache = frame_obstack_zalloc (sizeof (struct arm_prologue_cache));
+ cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
+
+ arm_scan_prologue (next_frame, cache);
+
+ unwound_fp = frame_unwind_register_unsigned (next_frame, cache->framereg);
+ if (unwound_fp == 0)
+ return cache;
+
+ cache->prev_sp = unwound_fp + cache->framesize - cache->frameoffset;
+
+ /* Calculate actual addresses of saved registers using offsets
+ determined by arm_scan_prologue. */
+ for (reg = 0; reg < NUM_REGS; reg++)
+ if (cache->saved_regs[reg].addr != 0)
+ cache->saved_regs[reg].addr += cache->prev_sp;
+
+ return cache;
}
-/* Function: frame_chain Given a GDB frame, determine the address of
- the calling function's frame. This will be used to create a new
- GDB frame struct, and then DEPRECATED_INIT_EXTRA_FRAME_INFO and
- DEPRECATED_INIT_FRAME_PC will be called for the new frame. For
- ARM, we save the frame size when we initialize the frame_info. */
-static CORE_ADDR
-arm_frame_chain (struct frame_info *fi)
+/* Our frame ID for a normal frame is the current function's starting PC
+ and the caller's SP when we were called. */
+
+static void
+arm_prologue_this_id (struct frame_info *next_frame,
+ void **this_cache,
+ struct frame_id *this_id)
{
- CORE_ADDR caller_pc;
- int framereg = get_frame_extra_info (fi)->framereg;
+ struct arm_prologue_cache *cache;
+ struct frame_id id;
+ CORE_ADDR func;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
- /* A generic call dummy's frame is the same as caller's. */
- return get_frame_base (fi);
+ if (*this_cache == NULL)
+ *this_cache = arm_make_prologue_cache (next_frame);
+ cache = *this_cache;
- if (get_frame_pc (fi) < LOWEST_PC)
- return 0;
+ func = frame_func_unwind (next_frame);
+
+ /* This is meant to halt the backtrace at "_start". Make sure we
+ don't halt it at a generic dummy frame. */
+ if (func <= LOWEST_PC || deprecated_inside_entry_file (func))
+ return;
- /* If the caller is the startup code, we're at the end of the chain. */
- caller_pc = DEPRECATED_FRAME_SAVED_PC (fi);
+ /* If we've hit a wall, stop. */
+ if (cache->prev_sp == 0)
+ return;
+
+ id = frame_id_build (cache->prev_sp, func);
+
+ /* Check that we're not going round in circles with the same frame
+ ID (but avoid applying the test to sentinel frames which do go
+ round in circles). */
+ if (frame_relative_level (next_frame) >= 0
+ && get_frame_type (next_frame) == NORMAL_FRAME
+ && frame_id_eq (get_frame_id (next_frame), id))
+ return;
- /* If the caller is Thumb and the caller is ARM, or vice versa,
- the frame register of the caller is different from ours.
- So we must scan the prologue of the caller to determine its
- frame register number. */
- /* XXX Fixme, we should try to do this without creating a temporary
- caller_fi. */
- if (arm_pc_is_thumb (caller_pc) != arm_pc_is_thumb (get_frame_pc (fi)))
+ *this_id = id;
+}
+
+static void
+arm_prologue_prev_register (struct frame_info *next_frame,
+ void **this_cache,
+ int prev_regnum,
+ int *optimized,
+ enum lval_type *lvalp,
+ CORE_ADDR *addrp,
+ int *realnump,
+ void *valuep)
+{
+ struct arm_prologue_cache *cache;
+
+ if (*this_cache == NULL)
+ *this_cache = arm_make_prologue_cache (next_frame);
+ cache = *this_cache;
+
+ /* If we are asked to unwind the PC, then we need to return the LR
+ instead. The saved value of PC points into this frame's
+ prologue, not the next frame's resume location. */
+ if (prev_regnum == ARM_PC_REGNUM)
+ prev_regnum = ARM_LR_REGNUM;
+
+ /* SP is generally not saved to the stack, but this frame is
+ identified by NEXT_FRAME's stack pointer at the time of the call.
+ The value was already reconstructed into PREV_SP. */
+ if (prev_regnum == ARM_SP_REGNUM)
{
- struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
- struct frame_info *caller_fi =
- deprecated_frame_xmalloc_with_cleanup (SIZEOF_FRAME_SAVED_REGS,
- sizeof (struct frame_extra_info));
-
- /* Now, scan the prologue and obtain the frame register. */
- deprecated_update_frame_pc_hack (caller_fi, caller_pc);
- arm_scan_prologue (caller_fi);
- framereg = get_frame_extra_info (caller_fi)->framereg;
-
- /* Deallocate the storage associated with the temporary frame
- created above. */
- do_cleanups (old_chain);
+ *lvalp = not_lval;
+ if (valuep)
+ store_unsigned_integer (valuep, 4, cache->prev_sp);
+ return;
}
- /* If the caller used a frame register, return its value.
- Otherwise, return the caller's stack pointer. */
- if (framereg == ARM_FP_REGNUM || framereg == THUMB_FP_REGNUM)
- return arm_find_callers_reg (fi, framereg);
- else
- return get_frame_base (fi) + get_frame_extra_info (fi)->framesize;
+ trad_frame_prev_register (next_frame, cache->saved_regs, prev_regnum,
+ optimized, lvalp, addrp, realnump, valuep);
}
-/* This function actually figures out the frame address for a given pc
- and sp. This is tricky because we sometimes don't use an explicit
- frame pointer, and the previous stack pointer isn't necessarily
- recorded on the stack. The only reliable way to get this info is
- to examine the prologue. FROMLEAF is a little confusing, it means
- this is the next frame up the chain AFTER a frameless function. If
- this is true, then the frame value for this frame is still in the
- fp register. */
+struct frame_unwind arm_prologue_unwind = {
+ NORMAL_FRAME,
+ arm_prologue_this_id,
+ arm_prologue_prev_register
+};
-static void
-arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
+static const struct frame_unwind *
+arm_prologue_unwind_sniffer (struct frame_info *next_frame)
{
- int reg;
- CORE_ADDR sp;
+ return &arm_prologue_unwind;
+}
- if (get_frame_saved_regs (fi) == NULL)
- frame_saved_regs_zalloc (fi);
+static CORE_ADDR
+arm_normal_frame_base (struct frame_info *next_frame, void **this_cache)
+{
+ struct arm_prologue_cache *cache;
- frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
+ if (*this_cache == NULL)
+ *this_cache = arm_make_prologue_cache (next_frame);
+ cache = *this_cache;
- get_frame_extra_info (fi)->framesize = 0;
- get_frame_extra_info (fi)->frameoffset = 0;
- get_frame_extra_info (fi)->framereg = 0;
+ return cache->prev_sp + cache->frameoffset - cache->framesize;
+}
- if (get_next_frame (fi))
- deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
+struct frame_base arm_normal_base = {
+ &arm_prologue_unwind,
+ arm_normal_frame_base,
+ arm_normal_frame_base,
+ arm_normal_frame_base
+};
- memset (get_frame_saved_regs (fi), '\000', sizeof get_frame_saved_regs (fi));
+static struct arm_prologue_cache *
+arm_make_sigtramp_cache (struct frame_info *next_frame)
+{
+ struct arm_prologue_cache *cache;
+ int reg;
- /* Compute stack pointer for this frame. We use this value for both
- the sigtramp and call dummy cases. */
- if (!get_next_frame (fi))
- sp = read_sp();
- else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (fi)), 0, 0))
- /* For generic dummy frames, pull the value direct from the frame.
- Having an unwind function to do this would be nice. */
- sp = deprecated_read_register_dummy (get_frame_pc (get_next_frame (fi)),
- get_frame_base (get_next_frame (fi)),
- ARM_SP_REGNUM);
- else
- sp = (get_frame_base (get_next_frame (fi))
- - get_frame_extra_info (get_next_frame (fi))->frameoffset
- + get_frame_extra_info (get_next_frame (fi))->framesize);
-
- /* Determine whether or not we're in a sigtramp frame.
- Unfortunately, it isn't sufficient to test (get_frame_type (fi)
- == SIGTRAMP_FRAME) because this value is sometimes set after
- invoking DEPRECATED_INIT_EXTRA_FRAME_INFO. So we test *both*
- (get_frame_type (fi) == SIGTRAMP_FRAME) and PC_IN_SIGTRAMP to
- determine if we need to use the sigcontext addresses for the
- saved registers.
-
- Note: If an ARM PC_IN_SIGTRAMP method ever needs to compare
- against the name of the function, the code below will have to be
- changed to first fetch the name of the function and then pass
- this name to PC_IN_SIGTRAMP. */
+ cache = frame_obstack_zalloc (sizeof (struct arm_prologue_cache));
- /* FIXME: cagney/2002-11-18: This problem will go away once
- frame.c:get_prev_frame() is modified to set the frame's type
- before calling functions like this. */
+ cache->prev_sp = frame_unwind_register_unsigned (next_frame, ARM_SP_REGNUM);
- if (SIGCONTEXT_REGISTER_ADDRESS_P ()
- && ((get_frame_type (fi) == SIGTRAMP_FRAME) || PC_IN_SIGTRAMP (get_frame_pc (fi), (char *)0)))
- {
- for (reg = 0; reg < NUM_REGS; reg++)
- get_frame_saved_regs (fi)[reg] = SIGCONTEXT_REGISTER_ADDRESS (sp, get_frame_pc (fi), reg);
+ cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
- /* FIXME: What about thumb mode? */
- get_frame_extra_info (fi)->framereg = ARM_SP_REGNUM;
- deprecated_update_frame_base_hack (fi, read_memory_integer (get_frame_saved_regs (fi)[get_frame_extra_info (fi)->framereg], REGISTER_RAW_SIZE (get_frame_extra_info (fi)->framereg)));
- get_frame_extra_info (fi)->framesize = 0;
- get_frame_extra_info (fi)->frameoffset = 0;
+ for (reg = 0; reg < NUM_REGS; reg++)
+ cache->saved_regs[reg].addr
+ = SIGCONTEXT_REGISTER_ADDRESS (cache->prev_sp,
+ frame_pc_unwind (next_frame), reg);
- }
- else
- {
- arm_scan_prologue (fi);
-
- if (!get_next_frame (fi))
- /* This is the innermost frame? */
- deprecated_update_frame_base_hack (fi, read_register (get_frame_extra_info (fi)->framereg));
- else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (fi)), 0, 0))
- /* Next inner most frame is a dummy, just grab its frame.
- Dummy frames always have the same FP as their caller. */
- deprecated_update_frame_base_hack (fi, get_frame_base (get_next_frame (fi)));
- else if (get_frame_extra_info (fi)->framereg == ARM_FP_REGNUM
- || get_frame_extra_info (fi)->framereg == THUMB_FP_REGNUM)
- {
- /* not the innermost frame */
- /* If we have an FP, the callee saved it. */
- if (get_frame_saved_regs (get_next_frame (fi))[get_frame_extra_info (fi)->framereg] != 0)
- deprecated_update_frame_base_hack (fi, read_memory_integer (get_frame_saved_regs (get_next_frame (fi))[get_frame_extra_info (fi)->framereg], 4));
- else if (fromleaf)
- /* If we were called by a frameless fn. then our frame is
- still in the frame pointer register on the board... */
- deprecated_update_frame_base_hack (fi, deprecated_read_fp ());
- }
+ /* FIXME: What about thumb mode? */
+ cache->framereg = ARM_SP_REGNUM;
+ cache->prev_sp
+ = read_memory_integer (cache->saved_regs[cache->framereg].addr,
+ REGISTER_RAW_SIZE (cache->framereg));
- /* Calculate actual addresses of saved registers using offsets
- determined by arm_scan_prologue. */
- for (reg = 0; reg < NUM_REGS; reg++)
- if (get_frame_saved_regs (fi)[reg] != 0)
- get_frame_saved_regs (fi)[reg]
- += (get_frame_base (fi)
- + get_frame_extra_info (fi)->framesize
- - get_frame_extra_info (fi)->frameoffset);
- }
+ return cache;
}
+static void
+arm_sigtramp_this_id (struct frame_info *next_frame,
+ void **this_cache,
+ struct frame_id *this_id)
+{
+ struct arm_prologue_cache *cache;
-/* Find the caller of this frame. We do this by seeing if ARM_LR_REGNUM
- is saved in the stack anywhere, otherwise we get it from the
- registers.
+ if (*this_cache == NULL)
+ *this_cache = arm_make_sigtramp_cache (next_frame);
+ cache = *this_cache;
- The old definition of this function was a macro:
- #define FRAME_SAVED_PC(FRAME) \
- ADDR_BITS_REMOVE (read_memory_integer ((FRAME)->frame - 4, 4)) */
+ /* FIXME drow/2003-07-07: This isn't right if we single-step within
+ the sigtramp frame; the PC should be the beginning of the trampoline. */
+ *this_id = frame_id_build (cache->prev_sp, frame_pc_unwind (next_frame));
+}
-static CORE_ADDR
-arm_frame_saved_pc (struct frame_info *fi)
+static void
+arm_sigtramp_prev_register (struct frame_info *next_frame,
+ void **this_cache,
+ int prev_regnum,
+ int *optimized,
+ enum lval_type *lvalp,
+ CORE_ADDR *addrp,
+ int *realnump,
+ void *valuep)
{
- /* If a dummy frame, pull the PC out of the frame's register buffer. */
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
- return deprecated_read_register_dummy (get_frame_pc (fi),
- get_frame_base (fi), ARM_PC_REGNUM);
+ struct arm_prologue_cache *cache;
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
- (get_frame_base (fi)
- - get_frame_extra_info (fi)->frameoffset),
- get_frame_base (fi)))
- {
- return read_memory_integer (get_frame_saved_regs (fi)[ARM_PC_REGNUM],
- REGISTER_RAW_SIZE (ARM_PC_REGNUM));
- }
- else
- {
- CORE_ADDR pc = arm_find_callers_reg (fi, ARM_LR_REGNUM);
- return IS_THUMB_ADDR (pc) ? UNMAKE_THUMB_ADDR (pc) : pc;
- }
+ if (*this_cache == NULL)
+ *this_cache = arm_make_sigtramp_cache (next_frame);
+ cache = *this_cache;
+
+ trad_frame_prev_register (next_frame, cache->saved_regs, prev_regnum,
+ optimized, lvalp, addrp, realnump, valuep);
}
-/* Return the frame address. On ARM, it is R11; on Thumb it is R7.
- Examine the Program Status Register to decide which state we're in. */
+struct frame_unwind arm_sigtramp_unwind = {
+ SIGTRAMP_FRAME,
+ arm_sigtramp_this_id,
+ arm_sigtramp_prev_register
+};
-static CORE_ADDR
-arm_read_fp (void)
+static const struct frame_unwind *
+arm_sigtramp_unwind_sniffer (struct frame_info *next_frame)
{
- if (read_register (ARM_PS_REGNUM) & 0x20) /* Bit 5 is Thumb state bit */
- return read_register (THUMB_FP_REGNUM); /* R7 if Thumb */
- else
- return read_register (ARM_FP_REGNUM); /* R11 if ARM */
+ /* Note: If an ARM PC_IN_SIGTRAMP method ever needs to compare
+ against the name of the function, the code below will have to be
+ changed to first fetch the name of the function and then pass
+ this name to PC_IN_SIGTRAMP. */
+
+ if (SIGCONTEXT_REGISTER_ADDRESS_P ()
+ && PC_IN_SIGTRAMP (frame_pc_unwind (next_frame), (char *) 0))
+ return &arm_sigtramp_unwind;
+
+ return NULL;
}
-/* Store into a struct frame_saved_regs the addresses of the saved
- registers of frame described by FRAME_INFO. This includes special
- registers such as PC and FP saved in special ways in the stack
- frame. SP is even more special: the address we return for it IS
- the sp for the next frame. */
+/* Assuming NEXT_FRAME->prev is a dummy, return the frame ID of that
+ dummy frame. The frame ID's base needs to match the TOS value
+ saved by save_dummy_frame_tos() and returned from
+ arm_push_dummy_call, and the PC needs to match the dummy frame's
+ breakpoint. */
-static void
-arm_frame_init_saved_regs (struct frame_info *fip)
+static struct frame_id
+arm_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
+ return frame_id_build (frame_unwind_register_unsigned (next_frame, ARM_SP_REGNUM),
+ frame_pc_unwind (next_frame));
+}
- if (get_frame_saved_regs (fip))
- return;
+/* Given THIS_FRAME, find the previous frame's resume PC (which will
+ be used to construct the previous frame's ID, after looking up the
+ containing function). */
- arm_init_extra_frame_info (0, fip);
+static CORE_ADDR
+arm_unwind_pc (struct gdbarch *gdbarch, struct frame_info *this_frame)
+{
+ CORE_ADDR pc;
+ pc = frame_unwind_register_unsigned (this_frame, ARM_PC_REGNUM);
+ return IS_THUMB_ADDR (pc) ? UNMAKE_THUMB_ADDR (pc) : pc;
+}
+
+static CORE_ADDR
+arm_unwind_sp (struct gdbarch *gdbarch, struct frame_info *this_frame)
+{
+ return frame_unwind_register_unsigned (this_frame, ARM_SP_REGNUM);
}
/* Set the return address for a generic dummy frame. ARM uses the
@@ -1175,7 +1178,7 @@ arm_frame_init_saved_regs (struct frame_info *fip)
static CORE_ADDR
arm_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
- write_register (ARM_LR_REGNUM, CALL_DUMMY_ADDRESS ());
+ write_register (ARM_LR_REGNUM, entry_point_address ());
return sp;
}
@@ -1311,40 +1314,6 @@ arm_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
write_register (4, fun);
}
-/* Pop the current frame. So long as the frame info has been
- initialized properly (see arm_init_extra_frame_info), this code
- works for dummy frames as well as regular frames. I.e, there's no
- need to have a special case for dummy frames. */
-static void
-arm_pop_frame (void)
-{
- int regnum;
- struct frame_info *frame = get_current_frame ();
- CORE_ADDR old_SP = (get_frame_base (frame)
- - get_frame_extra_info (frame)->frameoffset
- + get_frame_extra_info (frame)->framesize);
-
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
- {
- generic_pop_dummy_frame ();
- flush_cached_frames ();
- return;
- }
-
- for (regnum = 0; regnum < NUM_REGS; regnum++)
- if (get_frame_saved_regs (frame)[regnum] != 0)
- write_register (regnum,
- read_memory_integer (get_frame_saved_regs (frame)[regnum],
- REGISTER_RAW_SIZE (regnum)));
-
- write_register (ARM_PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame));
- write_register (ARM_SP_REGNUM, old_SP);
-
- flush_cached_frames ();
-}
-
/* When arguments must be pushed onto the stack, they go on in reverse
order. The code below implements a FILO (stack) to do this. */
@@ -1523,7 +1492,7 @@ static void
arm_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, const char *args)
{
- register unsigned long status = read_register (ARM_FPS_REGNUM);
+ unsigned long status = read_register (ARM_FPS_REGNUM);
int type;
type = (status >> 24) & 127;
@@ -2283,7 +2252,7 @@ static int
arm_use_struct_convention (int gcc_p, struct type *type)
{
int nRc;
- register enum type_code code;
+ enum type_code code;
/* In the ARM ABI, "integer" like aggregate types are returned in
registers. For an aggregate type to be integer like, its size
@@ -2825,10 +2794,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep = xmalloc (sizeof (struct gdbarch_tdep));
gdbarch = gdbarch_alloc (&info, tdep);
- /* NOTE: cagney/2002-12-06: This can be deleted when this arch is
- ready to unwind the PC first (see frame.c:get_prev_frame()). */
- set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default);
-
/* We used to default to FPA for generic ARM, but almost nobody uses that
now, and we now provide a way for the user to force the model. So
default to the most useful variant. */
@@ -2871,16 +2836,15 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call);
/* Frame handling. */
- set_gdbarch_deprecated_frame_chain_valid (gdbarch, arm_frame_chain_valid);
- set_gdbarch_deprecated_init_extra_frame_info (gdbarch, arm_init_extra_frame_info);
- set_gdbarch_deprecated_target_read_fp (gdbarch, arm_read_fp);
- set_gdbarch_deprecated_frame_chain (gdbarch, arm_frame_chain);
+ set_gdbarch_unwind_dummy_id (gdbarch, arm_unwind_dummy_id);
+ set_gdbarch_unwind_pc (gdbarch, arm_unwind_pc);
+ set_gdbarch_unwind_sp (gdbarch, arm_unwind_sp);
+
set_gdbarch_frameless_function_invocation
(gdbarch, arm_frameless_function_invocation);
- set_gdbarch_deprecated_frame_saved_pc (gdbarch, arm_frame_saved_pc);
set_gdbarch_frame_args_skip (gdbarch, 0);
- set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, arm_frame_init_saved_regs);
- set_gdbarch_deprecated_pop_frame (gdbarch, arm_pop_frame);
+
+ frame_base_set_default (gdbarch, &arm_normal_base);
/* Address manipulation. */
set_gdbarch_smash_text_address (gdbarch, arm_smash_text_address);
@@ -2948,6 +2912,10 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Hook in the ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
+ /* Add some default predicates. */
+ frame_unwind_append_sniffer (gdbarch, arm_sigtramp_unwind_sniffer);
+ frame_unwind_append_sniffer (gdbarch, arm_prologue_unwind_sniffer);
+
/* Now we have tuned the configuration, set a few final things,
based on what the OS ABI has told us. */
@@ -3024,8 +2992,7 @@ _initialize_arm_tdep (void)
int numregs, i, j;
static char *helptext;
- if (GDB_MULTI_ARCH)
- gdbarch_register (bfd_arch_arm, arm_gdbarch_init, arm_dump_tdep);
+ gdbarch_register (bfd_arch_arm, arm_gdbarch_init, arm_dump_tdep);
/* Register an ELF OS ABI sniffer for ARM binaries. */
gdbarch_register_osabi_sniffer (bfd_arch_arm,
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 477aa82cb83..90bf9102ebe 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -36,6 +36,7 @@
#include "arch-utils.h"
#include "regcache.h"
#include "gdb_string.h"
+#include "dis-asm.h"
/* AVR Background:
@@ -971,7 +972,7 @@ avr_frame_this_id (struct frame_info *next_frame,
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (inside_entry_file (func))
+ if (deprecated_inside_entry_file (func))
return;
/* Hopefully the prologue analysis either correctly determined the
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 9eb5b7e00d7..9da0086ccbb 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -53,13 +53,14 @@ void _initialize_blockframe (void);
A PC of zero is always considered to be the bottom of the stack. */
int
-inside_entry_file (CORE_ADDR addr)
+deprecated_inside_entry_file (CORE_ADDR addr)
{
if (addr == 0)
return 1;
if (symfile_objfile == 0)
return 0;
- if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
+ if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT
+ || CALL_DUMMY_LOCATION == AT_SYMBOL)
{
/* Do not stop backtracing if the pc is in the call dummy
at the entry point. */
@@ -67,8 +68,8 @@ inside_entry_file (CORE_ADDR addr)
if (DEPRECATED_PC_IN_CALL_DUMMY (addr, 0, 0))
return 0;
}
- return (addr >= symfile_objfile->ei.entry_file_lowpc &&
- addr < symfile_objfile->ei.entry_file_highpc);
+ return (addr >= symfile_objfile->ei.deprecated_entry_file_lowpc &&
+ addr < symfile_objfile->ei.deprecated_entry_file_highpc);
}
/* Test a specified PC value to see if it is in the range of addresses
@@ -271,7 +272,7 @@ get_pc_function_start (CORE_ADDR pc)
struct symbol *
get_frame_function (struct frame_info *frame)
{
- register struct block *bl = get_frame_block (frame, 0);
+ struct block *bl = get_frame_block (frame, 0);
if (bl == 0)
return 0;
return block_function (bl);
@@ -284,7 +285,7 @@ get_frame_function (struct frame_info *frame)
struct symbol *
find_pc_sect_function (CORE_ADDR pc, struct sec *section)
{
- register struct block *b = block_for_pc_sect (pc, section);
+ struct block *b = block_for_pc_sect (pc, section);
if (b == 0)
return 0;
return block_function (b);
@@ -512,8 +513,8 @@ struct frame_info *
block_innermost_frame (const struct block *block)
{
struct frame_info *frame;
- register CORE_ADDR start;
- register CORE_ADDR end;
+ CORE_ADDR start;
+ CORE_ADDR end;
CORE_ADDR calling_pc;
if (block == NULL)
@@ -569,8 +570,10 @@ int
deprecated_pc_in_call_dummy_at_entry_point (CORE_ADDR pc, CORE_ADDR sp,
CORE_ADDR frame_address)
{
- return ((pc) >= CALL_DUMMY_ADDRESS ()
- && (pc) <= (CALL_DUMMY_ADDRESS () + DECR_PC_AFTER_BREAK));
+ CORE_ADDR addr = entry_point_address ();
+ if (DEPRECATED_CALL_DUMMY_ADDRESS_P ())
+ addr = DEPRECATED_CALL_DUMMY_ADDRESS ();
+ return ((pc) >= addr && (pc) <= (addr + DECR_PC_AFTER_BREAK));
}
/* Returns true for a user frame or a call_function_by_hand dummy
@@ -608,7 +611,7 @@ legacy_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
/* NOTE/drow 2002-12-25: should there be a way to disable this check? It
assumes a single small entry file, and the way some debug readers (e.g.
dbxread) figure out which object is the entry file is somewhat hokey. */
- if (inside_entry_file (frame_pc_unwind (fi)))
+ if (deprecated_inside_entry_file (frame_pc_unwind (fi)))
return 0;
return 1;
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index c75da6cbf66..152aa3c4988 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -512,9 +512,9 @@ get_number_or_range (char **pp)
static void
condition_command (char *arg, int from_tty)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
char *p;
- register int bnum;
+ int bnum;
if (arg == 0)
error_no_arg ("breakpoint number");
@@ -564,9 +564,9 @@ condition_command (char *arg, int from_tty)
static void
commands_command (char *arg, int from_tty)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
char *p;
- register int bnum;
+ int bnum;
struct command_line *l;
/* If we allowed this, we would have problems with when to
@@ -584,17 +584,17 @@ commands_command (char *arg, int from_tty)
ALL_BREAKPOINTS (b)
if (b->number == bnum)
- {
- char tmpbuf[128];
- sprintf (tmpbuf,
- "Type commands for when breakpoint %d is hit, one per line.",
- bnum);
- l = read_command_lines (tmpbuf, from_tty);
- free_command_lines (&b->commands);
- b->commands = l;
- breakpoints_changed ();
- breakpoint_modify_event (b->number);
- return;
+ {
+ char *tmpbuf = xstrprintf ("Type commands for when breakpoint %d is hit, one per line.",
+ bnum);
+ struct cleanup *cleanups = make_cleanup (xfree, tmpbuf);
+ l = read_command_lines (tmpbuf, from_tty);
+ do_cleanups (cleanups);
+ free_command_lines (&b->commands);
+ b->commands = l;
+ breakpoints_changed ();
+ breakpoint_modify_event (b->number);
+ return;
}
error ("No breakpoint number %d.", bnum);
}
@@ -740,7 +740,7 @@ insert_catchpoint (struct ui_out *uo, void *args)
int
insert_breakpoints (void)
{
- register struct breakpoint *b, *temp;
+ struct breakpoint *b, *temp;
int return_val = 0; /* return success code. */
int val = 0;
int disabled_breaks = 0;
@@ -749,9 +749,6 @@ insert_breakpoints (void)
int process_warning = 0;
#endif
- static char message1[] = "Error inserting catchpoint %d:\n";
- static char message[sizeof (message1) + 30];
-
struct ui_file *tmp_error_stream = mem_fileopen ();
make_cleanup_ui_file_delete (tmp_error_stream);
@@ -912,9 +909,6 @@ insert_breakpoints (void)
/* If we get here, we must have a callback mechanism for exception
events -- with g++ style embedded label support, we insert
ordinary breakpoints and not catchpoints. */
- /* Format possible error message */
- sprintf (message, message1, b->number);
-
val = target_insert_breakpoint (b->address, b->shadow_contents);
if (val)
{
@@ -932,14 +926,18 @@ insert_breakpoints (void)
else
{
/* Bp set, now make sure callbacks are enabled */
+ /* Format possible error msg */
+ char *message = xstrprintf ("Error inserting catchpoint %d:\n",
+ b->number);
+ struct cleanup *cleanups = make_cleanup (xfree, message);
int val;
args_for_catchpoint_enable args;
args.kind = b->type == bp_catch_catch ?
EX_EVENT_CATCH : EX_EVENT_THROW;
args.enable_p = 1;
val = catch_errors (cover_target_enable_exception_callback,
- &args,
- message, RETURN_MASK_ALL);
+ &args, message, RETURN_MASK_ALL);
+ do_cleanups (cleanups);
if (val != 0 && val != -1)
{
b->inserted = 1;
@@ -1083,11 +1081,12 @@ insert_breakpoints (void)
&& !b->inserted
&& !b->duplicate)
{
- char prefix[64];
-
- sprintf (prefix, "warning: inserting catchpoint %d: ", b->number);
+ char *prefix = xstrprintf ("warning: inserting catchpoint %d: ",
+ b->number);
+ struct cleanup *cleanups = make_cleanup (xfree, prefix);
val = catch_exceptions (uiout, insert_catchpoint, b, prefix,
RETURN_MASK_ERROR);
+ do_cleanups (cleanups);
if (val < 0)
b->enable_state = bp_disabled;
else
@@ -1119,7 +1118,7 @@ You may have requested too many hardware breakpoints/watchpoints.\n");
int
remove_breakpoints (void)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
int val;
ALL_BREAKPOINTS (b)
@@ -1137,7 +1136,7 @@ remove_breakpoints (void)
int
remove_hw_watchpoints (void)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
int val;
ALL_BREAKPOINTS (b)
@@ -1158,7 +1157,7 @@ remove_hw_watchpoints (void)
int
reattach_breakpoints (int pid)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
int val;
struct cleanup *old_chain = save_inferior_ptid ();
@@ -1321,7 +1320,7 @@ update_breakpoints_after_exec (void)
int
detach_breakpoints (int pid)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
int val;
struct cleanup *old_chain = save_inferior_ptid ();
@@ -1543,7 +1542,7 @@ remove_breakpoint (struct breakpoint *b, insertion_state_t is)
void
mark_breakpoints_out (void)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
ALL_BREAKPOINTS (b)
b->inserted = 0;
@@ -1564,7 +1563,7 @@ mark_breakpoints_out (void)
void
breakpoint_init_inferior (enum inf_context context)
{
- register struct breakpoint *b, *temp;
+ struct breakpoint *b, *temp;
static int warning_needed = 0;
ALL_BREAKPOINTS_SAFE (b, temp)
@@ -1639,7 +1638,7 @@ breakpoint_init_inferior (enum inf_context context)
enum breakpoint_here
breakpoint_here_p (CORE_ADDR pc)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
int any_breakpoint_here = 0;
ALL_BREAKPOINTS (b)
@@ -1668,7 +1667,7 @@ breakpoint_here_p (CORE_ADDR pc)
int
breakpoint_inserted_here_p (CORE_ADDR pc)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
ALL_BREAKPOINTS (b)
if (b->inserted
@@ -2394,6 +2393,9 @@ watchpoint_check (void *p)
struct breakpoint *b;
struct frame_info *fr;
int within_current_scope;
+#if 0
+ struct frame_id current_frame_id;
+#endif
b = bs->breakpoint_at;
@@ -2411,11 +2413,16 @@ watchpoint_check (void *p)
in the function but the stack frame has already been invalidated.
Since we can't rely on the values of local variables after the
stack has been destroyed, we are treating the watchpoint in that
- state as `not changed' without further checking. */
- if (within_current_scope && fr == get_current_frame ()
+ state as `not changed' without further checking.
+
+ vinschen/2003-09-04: The former implementation left out the case
+ that the watchpoint frame couldn't be found by frame_find_by_id()
+ because the current PC is currently in an epilogue. Calling
+ gdbarch_in_function_epilogue_p() also when fr == NULL fixes that. */
+ if ((!within_current_scope || fr == get_current_frame ())
&& gdbarch_in_function_epilogue_p (current_gdbarch, read_pc ()))
return WP_VALUE_NOT_CHANGED;
- if (within_current_scope)
+ if (fr && within_current_scope)
/* If we end up stopping, the current frame will get selected
in normal_stop. So this call to select_frame won't affect
the user. */
@@ -2500,7 +2507,7 @@ which its expression is valid.\n");
bpstat
bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
{
- register struct breakpoint *b, *temp;
+ struct breakpoint *b, *temp;
CORE_ADDR bp_addr;
/* True if we've hit a breakpoint (as opposed to a watchpoint). */
int real_breakpoint = 0;
@@ -2508,9 +2515,6 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
struct bpstats root_bs[1];
/* Pointer to the last thing in the chain currently. */
bpstat bs = root_bs;
- static char message1[] =
- "Error evaluating expression for watchpoint %d\n";
- char message[sizeof (message1) + 30 /* slop */ ];
/* Get the address where the breakpoint would have been. The
"not_a_sw_breakpoint" argument is meant to distinguish between a
@@ -2609,12 +2613,16 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
bs->stop = 1;
bs->print = 1;
- sprintf (message, message1, b->number);
if (b->type == bp_watchpoint ||
b->type == bp_hardware_watchpoint)
{
- switch (catch_errors (watchpoint_check, bs, message,
- RETURN_MASK_ALL))
+ char *message = xstrprintf ("Error evaluating expression for watchpoint %d\n",
+ b->number);
+ struct cleanup *cleanups = make_cleanup (xfree, message);
+ int e = catch_errors (watchpoint_check, bs, message,
+ RETURN_MASK_ALL);
+ do_cleanups (cleanups);
+ switch (e)
{
case WP_DELETED:
/* We've already printed what needs to be printed. */
@@ -2682,42 +2690,49 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
}
}
if (found)
- switch (catch_errors (watchpoint_check, bs, message,
- RETURN_MASK_ALL))
- {
- case WP_DELETED:
- /* We've already printed what needs to be printed. */
- bs->print_it = print_it_done;
- /* Stop. */
- break;
- case WP_VALUE_CHANGED:
- if (b->type == bp_read_watchpoint)
- {
- /* Don't stop: read watchpoints shouldn't fire if
- the value has changed. This is for targets which
- cannot set read-only watchpoints. */
- bs->print_it = print_it_noop;
- bs->stop = 0;
- continue;
- }
- ++(b->hit_count);
- break;
- case WP_VALUE_NOT_CHANGED:
- /* Stop. */
- ++(b->hit_count);
- break;
- default:
- /* Can't happen. */
- case 0:
- /* Error from catch_errors. */
- printf_filtered ("Watchpoint %d deleted.\n", b->number);
- if (b->related_breakpoint)
- b->related_breakpoint->disposition = disp_del_at_next_stop;
- b->disposition = disp_del_at_next_stop;
- /* We've already printed what needs to be printed. */
- bs->print_it = print_it_done;
- break;
- }
+ {
+ char *message = xstrprintf ("Error evaluating expression for watchpoint %d\n",
+ b->number);
+ struct cleanup *cleanups = make_cleanup (xfree, message);
+ int e = catch_errors (watchpoint_check, bs, message,
+ RETURN_MASK_ALL);
+ do_cleanups (cleanups);
+ switch (e)
+ {
+ case WP_DELETED:
+ /* We've already printed what needs to be printed. */
+ bs->print_it = print_it_done;
+ /* Stop. */
+ break;
+ case WP_VALUE_CHANGED:
+ if (b->type == bp_read_watchpoint)
+ {
+ /* Don't stop: read watchpoints shouldn't fire if
+ the value has changed. This is for targets
+ which cannot set read-only watchpoints. */
+ bs->print_it = print_it_noop;
+ bs->stop = 0;
+ continue;
+ }
+ ++(b->hit_count);
+ break;
+ case WP_VALUE_NOT_CHANGED:
+ /* Stop. */
+ ++(b->hit_count);
+ break;
+ default:
+ /* Can't happen. */
+ case 0:
+ /* Error from catch_errors. */
+ printf_filtered ("Watchpoint %d deleted.\n", b->number);
+ if (b->related_breakpoint)
+ b->related_breakpoint->disposition = disp_del_at_next_stop;
+ b->disposition = disp_del_at_next_stop;
+ /* We've already printed what needs to be printed. */
+ bs->print_it = print_it_done;
+ break;
+ }
+ }
else /* found == 0 */
{
/* This is a case where some watchpoint(s) triggered,
@@ -3205,8 +3220,8 @@ static void
print_one_breakpoint (struct breakpoint *b,
CORE_ADDR *last_addr)
{
- register struct command_line *l;
- register struct symbol *sym;
+ struct command_line *l;
+ struct symbol *sym;
struct ep_type_description
{
enum bptype type;
@@ -3512,7 +3527,7 @@ static int
do_captured_breakpoint_query (struct ui_out *uiout, void *data)
{
struct captured_breakpoint_query_args *args = data;
- register struct breakpoint *b;
+ struct breakpoint *b;
CORE_ADDR dummy_addr = 0;
ALL_BREAKPOINTS (b)
{
@@ -3564,7 +3579,7 @@ user_settable_breakpoint (const struct breakpoint *b)
static void
breakpoint_1 (int bnum, int allflag)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
CORE_ADDR last_addr = (CORE_ADDR) -1;
int nr_printable_breakpoints;
struct cleanup *bkpttbl_chain;
@@ -3680,8 +3695,8 @@ maintenance_info_breakpoints (char *bnum_exp, int from_tty)
static void
describe_other_breakpoints (CORE_ADDR pc, asection *section)
{
- register int others = 0;
- register struct breakpoint *b;
+ int others = 0;
+ struct breakpoint *b;
ALL_BREAKPOINTS (b)
if (b->address == pc) /* address match / overlay match */
@@ -3769,8 +3784,8 @@ breakpoint_address_is_meaningful (struct breakpoint *bpt)
static void
check_duplicates (struct breakpoint *bpt)
{
- register struct breakpoint *b;
- register int count = 0;
+ struct breakpoint *b;
+ int count = 0;
struct breakpoint *perm_bp = 0;
CORE_ADDR address = bpt->address;
asection *section = bpt->section;
@@ -3847,7 +3862,7 @@ check_duplicates (struct breakpoint *bpt)
struct breakpoint *
set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype)
{
- register struct breakpoint *b, *b1;
+ struct breakpoint *b, *b1;
b = (struct breakpoint *) xmalloc (sizeof (struct breakpoint));
memset (b, 0, sizeof (*b));
@@ -3956,7 +3971,7 @@ create_longjmp_breakpoint (char *func_name)
void
enable_longjmp_breakpoint (void)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
ALL_BREAKPOINTS (b)
if (b->type == bp_longjmp)
@@ -3969,7 +3984,7 @@ enable_longjmp_breakpoint (void)
void
disable_longjmp_breakpoint (void)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
ALL_BREAKPOINTS (b)
if (b->type == bp_longjmp
@@ -4008,7 +4023,7 @@ create_overlay_event_breakpoint (char *func_name)
void
enable_overlay_breakpoints (void)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
ALL_BREAKPOINTS (b)
if (b->type == bp_overlay_event)
@@ -4022,7 +4037,7 @@ enable_overlay_breakpoints (void)
void
disable_overlay_breakpoints (void)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
ALL_BREAKPOINTS (b)
if (b->type == bp_overlay_event)
@@ -4061,7 +4076,7 @@ remove_thread_event_breakpoints (void)
void
remove_solib_event_breakpoints (void)
{
- register struct breakpoint *b, *temp;
+ struct breakpoint *b, *temp;
ALL_BREAKPOINTS_SAFE (b, temp)
if (b->type == bp_shlib_event)
@@ -4293,7 +4308,7 @@ create_exec_event_catchpoint (int tempflag, char *cond_string)
static int
hw_breakpoint_used_count (void)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
int i = 0;
ALL_BREAKPOINTS (b)
@@ -4308,7 +4323,7 @@ hw_breakpoint_used_count (void)
static int
hw_watchpoint_used_count (enum bptype type, int *other_type_used)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
int i = 0;
*other_type_used = 0;
@@ -4337,7 +4352,7 @@ hw_watchpoint_used_count (enum bptype type, int *other_type_used)
void
set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_id frame_id)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
ALL_BREAKPOINTS (b)
if (b->type == bp_longjmp_resume)
@@ -4399,7 +4414,7 @@ struct breakpoint *
set_momentary_breakpoint (struct symtab_and_line sal, struct frame_id frame_id,
enum bptype type)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
b = set_raw_breakpoint (sal, type);
b->enable_state = bp_enabled;
b->disposition = disp_donttouch;
@@ -4728,7 +4743,7 @@ break_command_1 (char *arg, int flag, int from_tty)
{
int tempflag, hardwareflag;
struct symtabs_and_lines sals;
- register struct expression **cond = 0;
+ struct expression **cond = 0;
/* Pointers in arg to the start, and one past the end, of the
condition. */
char **cond_string = (char **) NULL;
@@ -4871,7 +4886,7 @@ do_captured_breakpoint (void *data)
{
struct captured_breakpoint_args *args = data;
struct symtabs_and_lines sals;
- register struct expression **cond;
+ struct expression **cond;
struct cleanup *old_chain;
struct cleanup *breakpoint_chain = NULL;
int i;
@@ -4985,7 +5000,6 @@ break_at_finish_at_depth_command_1 (char *arg, int flag, int from_tty)
CORE_ADDR low, high, selected_pc = 0;
char *extra_args = NULL;
char *level_arg;
- char *addr_string;
int extra_args_len = 0, if_arg = 0;
if (!arg ||
@@ -5039,11 +5053,11 @@ break_at_finish_at_depth_command_1 (char *arg, int flag, int from_tty)
{
if (find_pc_partial_function (selected_pc, NULL, &low, &high))
{
- addr_string = (char *) xmalloc (26 + extra_args_len);
+ char *addr_string;
if (extra_args_len)
- sprintf (addr_string, "*0x%s %s", paddr_nz (high), extra_args);
+ addr_string = xstrprintf ("*0x%s %s", paddr_nz (high), extra_args);
else
- sprintf (addr_string, "*0x%s", paddr_nz (high));
+ addr_string = xstrprintf ("*0x%s", paddr_nz (high));
break_command_1 (addr_string, flag, from_tty);
xfree (addr_string);
}
@@ -5074,9 +5088,8 @@ break_at_finish_command_1 (char *arg, int flag, int from_tty)
{
if (deprecated_selected_frame)
{
- addr_string = (char *) xmalloc (15);
- sprintf (addr_string, "*0x%s",
- paddr_nz (get_frame_pc (deprecated_selected_frame)));
+ addr_string = xstrprintf ("*0x%s",
+ paddr_nz (get_frame_pc (deprecated_selected_frame)));
if (arg)
if_arg = 1;
}
@@ -5122,11 +5135,12 @@ break_at_finish_command_1 (char *arg, int flag, int from_tty)
sal = sals.sals[i];
if (find_pc_partial_function (sal.pc, NULL, &low, &high))
{
- break_string = (char *) xmalloc (extra_args_len + 26);
+ break_string;
if (extra_args_len)
- sprintf (break_string, "*0x%s %s", paddr_nz (high), extra_args);
+ break_string = xstrprintf ("*0x%s %s", paddr_nz (high),
+ extra_args);
else
- sprintf (break_string, "*0x%s", paddr_nz (high));
+ break_string = xstrprintf ("*0x%s", paddr_nz (high));
break_command_1 (break_string, flag, from_tty);
xfree (break_string);
}
@@ -6496,8 +6510,8 @@ breakpoint_auto_delete (bpstat bs)
void
delete_breakpoint (struct breakpoint *bpt)
{
- register struct breakpoint *b;
- register bpstat bs;
+ struct breakpoint *b;
+ bpstat bs;
if (bpt == NULL)
error ("Internal error (attempted to delete a NULL breakpoint)");
@@ -6537,17 +6551,17 @@ delete_breakpoint (struct breakpoint *bpt)
exceptions are supported in this way, it's OK for now. FIXME */
if (ep_is_exception_catchpoint (bpt) && target_has_execution)
{
- static char message1[] = "Error in deleting catchpoint %d:\n";
- static char message[sizeof (message1) + 30];
- args_for_catchpoint_enable args;
-
/* Format possible error msg */
- sprintf (message, message1, bpt->number);
+ char *message = xstrprintf ("Error in deleting catchpoint %d:\n",
+ bpt->number);
+ struct cleanup *cleanups = make_cleanup (xfree, message);
+ args_for_catchpoint_enable args;
args.kind = bpt->type == bp_catch_catch ?
EX_EVENT_CATCH : EX_EVENT_THROW;
args.enable_p = 0;
catch_errors (cover_target_enable_exception_callback, &args,
message, RETURN_MASK_ALL);
+ do_cleanups (cleanups);
}
@@ -6937,16 +6951,17 @@ breakpoint_re_set (void)
struct breakpoint *b, *temp;
enum language save_language;
int save_input_radix;
- static char message1[] = "Error in re-setting breakpoint %d:\n";
- char message[sizeof (message1) + 30 /* slop */ ];
save_language = current_language->la_language;
save_input_radix = input_radix;
ALL_BREAKPOINTS_SAFE (b, temp)
{
/* Format possible error msg */
- sprintf (message, message1, b->number);
+ char *message = xstrprintf ("Error in re-setting breakpoint %d:\n",
+ b->number);
+ struct cleanup *cleanups = make_cleanup (xfree, message);
catch_errors (breakpoint_re_set_one, b, message, RETURN_MASK_ALL);
+ do_cleanups (cleanups);
}
set_language (save_language);
input_radix = save_input_radix;
@@ -6984,7 +6999,7 @@ breakpoint_re_set_thread (struct breakpoint *b)
void
set_ignore_count (int bptnum, int count, int from_tty)
{
- register struct breakpoint *b;
+ struct breakpoint *b;
if (count < 0)
count = 0;
@@ -7029,7 +7044,7 @@ static void
ignore_command (char *args, int from_tty)
{
char *p = args;
- register int num;
+ int num;
if (p == 0)
error_no_arg ("a breakpoint number");
@@ -7053,10 +7068,10 @@ ignore_command (char *args, int from_tty)
static void
map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *))
{
- register char *p = args;
+ char *p = args;
char *p1;
- register int num;
- register struct breakpoint *b, *tmp;
+ int num;
+ struct breakpoint *b, *tmp;
int match;
if (p == 0)
@@ -7121,7 +7136,7 @@ disable_breakpoint (struct breakpoint *bpt)
static void
disable_command (char *args, int from_tty)
{
- register struct breakpoint *bpt;
+ struct breakpoint *bpt;
if (args == 0)
ALL_BREAKPOINTS (bpt)
switch (bpt->type)
@@ -7255,7 +7270,7 @@ enable_breakpoint (struct breakpoint *bpt)
static void
enable_command (char *args, int from_tty)
{
- register struct breakpoint *bpt;
+ struct breakpoint *bpt;
if (args == 0)
ALL_BREAKPOINTS (bpt)
switch (bpt->type)
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 63f60546056..ff892187c06 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -84,7 +84,7 @@ static int compare_line_numbers (const void *ln1p, const void *ln2p);
void
add_free_pendings (struct pending *list)
{
- register struct pending *link = list;
+ struct pending *link = list;
if (list)
{
@@ -102,7 +102,7 @@ add_free_pendings (struct pending *list)
void
add_symbol_to_list (struct symbol *symbol, struct pending **listhead)
{
- register struct pending *link;
+ struct pending *link;
/* If this is an alias for another symbol, don't add it. */
if (symbol->ginfo.name && symbol->ginfo.name[0] == '#')
@@ -226,24 +226,20 @@ finish_block (struct symbol *symbol, struct pending **listhead,
CORE_ADDR start, CORE_ADDR end,
struct objfile *objfile)
{
- register struct pending *next, *next1;
- register struct block *block;
- register struct pending_block *pblock;
+ struct pending *next, *next1;
+ struct block *block;
+ struct pending_block *pblock;
struct pending_block *opblock;
- /* Initialize the block's dictionary. */
+ block = allocate_block (&objfile->symbol_obstack);
if (symbol)
{
- block = (struct block *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct block));
BLOCK_DICT (block) = dict_create_linear (&objfile->symbol_obstack,
*listhead);
}
else
{
- block = (struct block *)
- obstack_alloc (&objfile->symbol_obstack, sizeof (struct block));
BLOCK_DICT (block) = dict_create_hashed (&objfile->symbol_obstack,
*listhead);
}
@@ -451,7 +447,7 @@ void
record_pending_block (struct objfile *objfile, struct block *block,
struct pending_block *opblock)
{
- register struct pending_block *pblock;
+ struct pending_block *pblock;
pblock = (struct pending_block *)
obstack_alloc (&objfile->symbol_obstack, sizeof (struct pending_block));
@@ -471,9 +467,9 @@ record_pending_block (struct objfile *objfile, struct block *block,
static struct blockvector *
make_blockvector (struct objfile *objfile)
{
- register struct pending_block *next;
- register struct blockvector *blockvector;
- register int i;
+ struct pending_block *next;
+ struct blockvector *blockvector;
+ int i;
/* Count the length of the list of blocks. */
@@ -543,7 +539,7 @@ make_blockvector (struct objfile *objfile)
void
start_subfile (const char *name, char *dirname)
{
- register struct subfile *subfile;
+ struct subfile *subfile;
/* See if this subfile is already known as a subfile of the current
main source file. */
@@ -681,7 +677,7 @@ patch_subfile_names (struct subfile *subfile, char *name)
void
push_subfile (void)
{
- register struct subfile_stack *tem
+ struct subfile_stack *tem
= (struct subfile_stack *) xmalloc (sizeof (struct subfile_stack));
tem->next = subfile_stack;
@@ -696,8 +692,8 @@ push_subfile (void)
char *
pop_subfile (void)
{
- register char *name;
- register struct subfile_stack *link = subfile_stack;
+ char *name;
+ struct subfile_stack *link = subfile_stack;
if (link == NULL)
{
@@ -713,7 +709,7 @@ pop_subfile (void)
line vector for SUBFILE. */
void
-record_line (register struct subfile *subfile, int line, CORE_ADDR pc)
+record_line (struct subfile *subfile, int line, CORE_ADDR pc)
{
struct linetable_entry *e;
/* Ignore the dummy line number in libg.o */
@@ -828,10 +824,10 @@ start_symtab (const char *name, char *dirname, CORE_ADDR start_addr)
struct symtab *
end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
{
- register struct symtab *symtab = NULL;
- register struct blockvector *blockvector;
- register struct subfile *subfile;
- register struct context_stack *cstk;
+ struct symtab *symtab = NULL;
+ struct blockvector *blockvector;
+ struct subfile *subfile;
+ struct context_stack *cstk;
struct subfile *nextsub;
/* Finish the lexical context of the last function in the file; pop
@@ -1060,7 +1056,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
struct context_stack *
push_context (int desc, CORE_ADDR valu)
{
- register struct context_stack *new;
+ struct context_stack *new;
if (context_stack_depth == context_stack_size)
{
@@ -1122,7 +1118,7 @@ record_debugformat (char *format)
void
merge_symbol_lists (struct pending **srclist, struct pending **targetlist)
{
- register int i;
+ int i;
if (!srclist || !*srclist)
return;
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index bdbbb54172c..4a5a3628ef0 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -42,7 +42,7 @@ static void c_emit_char (int c, struct ui_file * stream, int quoter);
characters and strings is language specific. */
static void
-c_emit_char (register int c, struct ui_file *stream, int quoter)
+c_emit_char (int c, struct ui_file *stream, int quoter)
{
const char *escape;
int host_char;
@@ -88,7 +88,7 @@ void
c_printstr (struct ui_file *stream, char *string, unsigned int length,
int width, int force_ellipses)
{
- register unsigned int i;
+ unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
@@ -207,7 +207,7 @@ c_printstr (struct ui_file *stream, char *string, unsigned int length,
struct type *
c_create_fundamental_type (struct objfile *objfile, int typeid)
{
- register struct type *type = NULL;
+ struct type *type = NULL;
switch (typeid)
{
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index cc2e7dae894..ac4673578ef 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -65,7 +65,7 @@ void
c_print_type (struct type *type, const char *varstring, struct ui_file *stream,
int show, int level)
{
- register enum type_code code;
+ enum type_code code;
int demangled_args;
int need_post_space;
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index d8b9a264293..3e8cf743a0a 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -70,7 +70,7 @@ c_val_print (struct type *type, char *valaddr, int embedded_offset,
CORE_ADDR address, struct ui_file *stream, int format,
int deref_ref, int recurse, enum val_prettyprint pretty)
{
- register unsigned int i = 0; /* Number of characters printed */
+ unsigned int i = 0; /* Number of characters printed */
unsigned len;
struct type *elttype;
unsigned eltlen;
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index be516c9a6f3..8a0d057257f 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -448,6 +448,26 @@ add_setshow_boolean_cmd (char *name,
c->enums = boolean_enums;
}
+/* Add element named NAME to both the set and show command LISTs (the
+ list for set/show or some sublist thereof). CLASS is as in
+ add_cmd. VAR is address of the variable which will contain the
+ value. SET_DOC and SHOW_DOR are the documentation strings. */
+void
+add_setshow_uinteger_cmd (char *name,
+ enum command_class class,
+ unsigned int *var, char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list)
+{
+ add_setshow_cmd_full (name, class, var_uinteger, var,
+ set_doc, show_doc,
+ set_func, show_func,
+ set_list, show_list,
+ NULL, NULL);
+}
+
/* Where SETCMD has already been added, add the corresponding show
command to LIST and return a pointer to the added command (not
necessarily the head of LIST). */
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 00b6b7f14f5..50c5e0243df 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -202,7 +202,7 @@ static void coff_symtab_read (long, unsigned int, struct objfile *);
static void
coff_locate_sections (bfd *abfd, asection *sectp, void *csip)
{
- register struct coff_symfile_info *csi;
+ struct coff_symfile_info *csi;
const char *name;
csi = (struct coff_symfile_info *) csip;
@@ -318,7 +318,7 @@ cs_section_address (struct coff_symbol *cs, bfd *abfd)
or for associating a new type with the index. */
static struct type **
-coff_lookup_type (register int index)
+coff_lookup_type (int index)
{
if (index >= type_vector_length)
{
@@ -344,8 +344,8 @@ coff_lookup_type (register int index)
static struct type *
coff_alloc_type (int index)
{
- register struct type **type_addr = coff_lookup_type (index);
- register struct type *type = *type_addr;
+ struct type **type_addr = coff_lookup_type (index);
+ struct type *type = *type_addr;
/* If we are referring to a type not known at all yet,
allocate an empty type for it.
@@ -398,8 +398,8 @@ complete_symtab (char *name, CORE_ADDR start_addr, unsigned int size)
if (current_objfile->ei.entry_point >= current_source_start_addr &&
current_objfile->ei.entry_point < current_source_end_addr)
{
- current_objfile->ei.entry_file_lowpc = current_source_start_addr;
- current_objfile->ei.entry_file_highpc = current_source_end_addr;
+ current_objfile->ei.deprecated_entry_file_lowpc = current_source_start_addr;
+ current_objfile->ei.deprecated_entry_file_highpc = current_source_end_addr;
}
}
@@ -523,7 +523,7 @@ coff_symfile_read (struct objfile *objfile, int mainline)
bfd *abfd = objfile->obfd;
coff_data_type *cdata = coff_data (abfd);
char *name = bfd_get_filename (abfd);
- register int val;
+ int val;
unsigned int num_symbols;
int symtab_offset;
int stringtab_offset;
@@ -687,9 +687,9 @@ static void
coff_symtab_read (long symtab_offset, unsigned int nsyms,
struct objfile *objfile)
{
- register struct context_stack *new;
+ struct context_stack *new;
struct coff_symbol coff_symbol;
- register struct coff_symbol *cs = &coff_symbol;
+ struct coff_symbol *cs = &coff_symbol;
static struct internal_syment main_sym;
static union internal_auxent main_aux;
struct coff_symbol fcn_cs_saved;
@@ -1128,9 +1128,9 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
in internal_auxent form, and skip any other auxents. */
static void
-read_one_sym (register struct coff_symbol *cs,
- register struct internal_syment *sym,
- register union internal_auxent *aux)
+read_one_sym (struct coff_symbol *cs,
+ struct internal_syment *sym,
+ union internal_auxent *aux)
{
int i;
@@ -1279,7 +1279,7 @@ static char *
coff_getfilename (union internal_auxent *aux_entry)
{
static char buffer[BUFSIZ];
- register char *temp;
+ char *temp;
char *result;
if (aux_entry->x_file.x_n.x_zeroes == 0)
@@ -1357,10 +1357,10 @@ free_linetab_cleanup (void *ignore)
#endif
static void
-enter_linenos (long file_offset, register int first_line,
- register int last_line, struct objfile *objfile)
+enter_linenos (long file_offset, int first_line,
+ int last_line, struct objfile *objfile)
{
- register char *rawptr;
+ char *rawptr;
struct internal_lineno lptr;
if (!linetab)
@@ -1399,8 +1399,8 @@ enter_linenos (long file_offset, register int first_line,
static void
patch_type (struct type *type, struct type *real_type)
{
- register struct type *target = TYPE_TARGET_TYPE (type);
- register struct type *real_target = TYPE_TARGET_TYPE (real_type);
+ struct type *target = TYPE_TARGET_TYPE (type);
+ struct type *real_target = TYPE_TARGET_TYPE (real_type);
int field_size = TYPE_NFIELDS (real_target) * sizeof (struct field);
TYPE_LENGTH (target) = TYPE_LENGTH (real_target);
@@ -1423,9 +1423,9 @@ patch_type (struct type *type, struct type *real_type)
static void
patch_opaque_types (struct symtab *s)
{
- register struct block *b;
+ struct block *b;
struct dict_iterator iter;
- register struct symbol *real_sym;
+ struct symbol *real_sym;
/* Go through the per-file symbols only */
b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
@@ -1440,9 +1440,9 @@ patch_opaque_types (struct symtab *s)
TYPE_CODE (SYMBOL_TYPE (real_sym)) == TYPE_CODE_PTR &&
TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
{
- register char *name = DEPRECATED_SYMBOL_NAME (real_sym);
- register int hash = hashname (name);
- register struct symbol *sym, *prev;
+ char *name = DEPRECATED_SYMBOL_NAME (real_sym);
+ int hash = hashname (name);
+ struct symbol *sym, *prev;
prev = 0;
for (sym = opaque_type_chain[hash]; sym;)
@@ -1481,11 +1481,11 @@ patch_opaque_types (struct symtab *s)
}
static struct symbol *
-process_coff_symbol (register struct coff_symbol *cs,
- register union internal_auxent *aux,
+process_coff_symbol (struct coff_symbol *cs,
+ union internal_auxent *aux,
struct objfile *objfile)
{
- register struct symbol *sym
+ struct symbol *sym
= (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
sizeof (struct symbol));
char *name;
@@ -1668,7 +1668,7 @@ process_coff_symbol (register struct coff_symbol *cs,
TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) !=
TYPE_CODE_UNDEF)
{
- register int i = hashname (DEPRECATED_SYMBOL_NAME (sym));
+ int i = hashname (DEPRECATED_SYMBOL_NAME (sym));
SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i];
opaque_type_chain[i] = sym;
@@ -1705,10 +1705,10 @@ process_coff_symbol (register struct coff_symbol *cs,
/* Decode a coff type specifier; return the type that is meant. */
static struct type *
-decode_type (register struct coff_symbol *cs, unsigned int c_type,
- register union internal_auxent *aux)
+decode_type (struct coff_symbol *cs, unsigned int c_type,
+ union internal_auxent *aux)
{
- register struct type *type = 0;
+ struct type *type = 0;
unsigned int new_c_type;
if (c_type & ~N_BTMASK)
@@ -1727,7 +1727,7 @@ decode_type (register struct coff_symbol *cs, unsigned int c_type,
else if (ISARY (c_type))
{
int i, n;
- register unsigned short *dim;
+ unsigned short *dim;
struct type *base_type, *index_type, *range_type;
/* Define an array type. */
@@ -1786,8 +1786,8 @@ decode_type (register struct coff_symbol *cs, unsigned int c_type,
return the type that the function returns. */
static struct type *
-decode_function_type (register struct coff_symbol *cs, unsigned int c_type,
- register union internal_auxent *aux)
+decode_function_type (struct coff_symbol *cs, unsigned int c_type,
+ union internal_auxent *aux)
{
if (aux->x_sym.x_tagndx.l == 0)
cs->c_naux = 0; /* auxent refers to function, not base type */
@@ -1798,8 +1798,8 @@ decode_function_type (register struct coff_symbol *cs, unsigned int c_type,
/* basic C types */
static struct type *
-decode_base_type (register struct coff_symbol *cs, unsigned int c_type,
- register union internal_auxent *aux)
+decode_base_type (struct coff_symbol *cs, unsigned int c_type,
+ union internal_auxent *aux)
{
struct type *type;
@@ -1958,14 +1958,14 @@ coff_read_struct_type (int index, int length, int lastsym)
struct field field;
};
- register struct type *type;
- register struct nextfield *list = 0;
+ struct type *type;
+ struct nextfield *list = 0;
struct nextfield *new;
int nfields = 0;
- register int n;
+ int n;
char *name;
struct coff_symbol member_sym;
- register struct coff_symbol *ms = &member_sym;
+ struct coff_symbol *ms = &member_sym;
struct internal_syment sub_sym;
union internal_auxent sub_aux;
int done = 0;
@@ -2049,18 +2049,18 @@ coff_read_struct_type (int index, int length, int lastsym)
static struct type *
coff_read_enum_type (int index, int length, int lastsym)
{
- register struct symbol *sym;
- register struct type *type;
+ struct symbol *sym;
+ struct type *type;
int nsyms = 0;
int done = 0;
struct pending **symlist;
struct coff_symbol member_sym;
- register struct coff_symbol *ms = &member_sym;
+ struct coff_symbol *ms = &member_sym;
struct internal_syment sub_sym;
union internal_auxent sub_aux;
struct pending *osyms, *syms;
int o_nsyms;
- register int n;
+ int n;
char *name;
int unsigned_enum = 1;
diff --git a/gdb/command.h b/gdb/command.h
index 96c99abcaba..9cadd63d24b 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -262,6 +262,16 @@ extern void add_setshow_boolean_cmd (char *name,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list);
+extern void add_setshow_uinteger_cmd (char *name,
+ enum command_class class,
+ unsigned int *var,
+ char *set_doc,
+ char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list);
+
extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
struct cmd_list_element
**);
diff --git a/gdb/config.in b/gdb/config.in
index 787afb26ce4..4acf3e7bc65 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -167,9 +167,6 @@
/* Define if <sys/ptrace.h> defines the PT_GETXMMREGS request. */
#undef HAVE_PT_GETXMMREGS
-/* Multi-arch enabled. */
-#undef GDB_MULTI_ARCH
-
/* hostfile */
#undef GDB_XM_FILE
diff --git a/gdb/config/alpha/nm-fbsd.h b/gdb/config/alpha/nm-fbsd.h
index 9e727091869..2b3975a76f8 100644
--- a/gdb/config/alpha/nm-fbsd.h
+++ b/gdb/config/alpha/nm-fbsd.h
@@ -37,8 +37,6 @@
/* Shared library support. */
-#define SVR4_SHARED_LIBS
-
#include "solib.h" /* Support for shared libraries. */
#include "elf/common.h" /* Additional ELF shared library info. */
diff --git a/gdb/config/alpha/tm-alpha.h b/gdb/config/alpha/tm-alpha.h
index 9ced4f238ed..1b93e76b799 100644
--- a/gdb/config/alpha/tm-alpha.h
+++ b/gdb/config/alpha/tm-alpha.h
@@ -24,8 +24,6 @@
#ifndef TM_ALPHA_H
#define TM_ALPHA_H
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
#include "bfd.h"
#include "coff/sym.h" /* Needed for PDR below. */
#include "coff/symconst.h"
diff --git a/gdb/config/arm/tm-arm.h b/gdb/config/arm/tm-arm.h
index 369917524d4..c62a75d6c39 100644
--- a/gdb/config/arm/tm-arm.h
+++ b/gdb/config/arm/tm-arm.h
@@ -22,9 +22,7 @@
#ifndef TM_ARM_H
#define TM_ARM_H
-#ifndef GDB_MULTI_ARCH
#define GDB_MULTI_ARCH 1
-#endif
/* Specify that for the native compiler variables for a particular
lexical context are listed after the beginning LBRAC instead of
diff --git a/gdb/config/arm/wince.mt b/gdb/config/arm/wince.mt
index 10fe0eb3f38..92a77ae0ad0 100644
--- a/gdb/config/arm/wince.mt
+++ b/gdb/config/arm/wince.mt
@@ -2,4 +2,4 @@
TDEPFILES= arm-tdep.o wince.o
TM_FILE= tm-wince.h
MT_CFLAGS=-DARM -U_X86_ -U_M_IX86 -U__i386__ -U__i486__ -U__i586__ -U__i686__ -DUNICODE -D_WIN32_WCE -DWINCE_STUB='"${target_alias}-stub.exe"'
-WIN32LIBS=-lrapi
+TM_CLIBS=-lrapi
diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst
index ef55182f900..9c2fac78cc5 100644
--- a/gdb/config/djgpp/fnchange.lst
+++ b/gdb/config/djgpp/fnchange.lst
@@ -70,8 +70,8 @@
@V@/gdb/ChangeLog-2002 @V@/gdb/ChangeLog.002
@V@/gdb/ChangeLog-3.x @V@/gdb/ChangeLog.3-x
@V@/gdb/ada-exp.tab.c @V@/gdb/ada-exp_tab.c
-@V@/gdb/amd64fbsd-tdep.c @V@/gdb/x86fb-tdep.c
-@V@/gdb/amd64fbsd-nat.c @V@/gdb/x86fb-nat.c
+@V@/gdb/amd64fbsd-tdep.c @V@/gdb/a64fb-tdep.c
+@V@/gdb/amd64fbsd-nat.c @V@/gdb/a64fb-nat.c
@V@/gdb/alphabsd-nat.c @V@/gdb/alphb-nat.c
@V@/gdb/alphabsd-tdep.c @V@/gdb/alphb-tdep.c
@V@/gdb/alphanbsd-nat.c @V@/gdb/alphnb-nat.c
@@ -100,10 +100,7 @@
@V@/gdb/config/i386/xm-i386v4.h @V@/gdb/config/i386/xm-v4.h
@V@/gdb/config/m68k/apollo68v.mh @V@/gdb/config/m68k/apollo-v.mh
@V@/gdb/config/m68k/nm-apollo68v.h @V@/gdb/config/m68k/nm-apolv.h
-@V@/gdb/config/m68k/nm-hp300hpux.h @V@/gdb/config/m68k/nm-300ux.h
-@V@/gdb/config/m68k/tm-hp300hpux.h @V@/gdb/config/m68k/tm-300ux.h
@V@/gdb/config/m68k/xm-apollo68v.h @V@/gdb/config/m68k/xm-apolv.h
-@V@/gdb/config/m68k/xm-hp300hpux.h @V@/gdb/config/m68k/xm-300ux.h
@V@/gdb/config/m88k/tm-delta88v4.h @V@/gdb/config/m88k/tm-d88v4.h
@V@/gdb/config/m88k/xm-delta88v4.h @V@/gdb/config/m88k/xm-d88v4.h
@V@/gdb/config/mips/tm-bigmips64.h @V@/gdb/config/mips/tm-bigm64.h
@@ -209,6 +206,10 @@
@V@/gdb/testsuite/gdb.mi/mi1-var-child.exp @V@/gdb/testsuite/gdb.mi/mi1varchild.exp
@V@/gdb/testsuite/gdb.mi/mi1-var-cmd.exp @V@/gdb/testsuite/gdb.mi/mi1varcmd.exp
@V@/gdb/testsuite/gdb.mi/mi1-var-display.exp @V@/gdb/testsuite/gdb.mi/mi1vardisplay.exp
+@V@/gdb/testsuite/gdb.mi/mi2-var-block.exp @V@/gdb/testsuite/gdb.mi/mi2varblock.exp
+@V@/gdb/testsuite/gdb.mi/mi2-var-child.exp @V@/gdb/testsuite/gdb.mi/mi2varchild.exp
+@V@/gdb/testsuite/gdb.mi/mi2-var-cmd.exp @V@/gdb/testsuite/gdb.mi/mi2varcmd.exp
+@V@/gdb/testsuite/gdb.mi/mi2-var-display.exp @V@/gdb/testsuite/gdb.mi/mi2vardisplay.exp
@V@/gdb/tui/tuiSourceWin.c @V@/gdb/tui/tuiWinSource.c
@V@/gdb/tui/tuiSourceWin.h @V@/gdb/tui/tuiWinSource.h
@V@/gdb/x86-64-linux-tdep.c @V@/gdb/x8664-ltdep.c
@@ -340,6 +341,10 @@
@V@/opcodes/po/.cvsignore @V@/opcodes/po/_cvsignore
@V@/readline/config.h.bot @V@/readline/config.h-bot
@V@/readline/config.h.in @V@/readline/config.h-in
+@V@/sim/frv/profile-fr400.c @V@/sim/frv/fr400-profile.c
+@V@/sim/frv/profile-fr400.h @V@/sim/frv/fr400-profile.h
+@V@/sim/frv/profile-fr500.c @V@/sim/frv/fr500-profile.c
+@V@/sim/frv/profile-fr500.h @V@/sim/frv/fr500-profile.h
@V@/sim/m68hc11/dv-m68hc11eepr.c @V@/sim/m68hc11/dv-eepr.c
@V@/sim/m68hc11/dv-m68hc11sio.c @V@/sim/m68hc11/dv-sio.c
@V@/sim/m68hc11/dv-m68hc11spi.c @V@/sim/m68hc11/dv-spi.c
diff --git a/gdb/config/frv/frv.mt b/gdb/config/frv/frv.mt
index 07fc4e7dd65..ae5521eb409 100644
--- a/gdb/config/frv/frv.mt
+++ b/gdb/config/frv/frv.mt
@@ -1,5 +1,5 @@
# Target: Fujitsu FRV processor
TDEPFILES= frv-tdep.o
TM_FILE= tm-frv.h
-#SIM_OBS = remote-sim.o
-#SIM = ../sim/frv/libsim.a
+SIM_OBS = remote-sim.o
+SIM = ../sim/frv/libsim.a
diff --git a/gdb/config/frv/tm-frv.h b/gdb/config/frv/tm-frv.h
index 40a2480325f..a08f2d3d4bc 100644
--- a/gdb/config/frv/tm-frv.h
+++ b/gdb/config/frv/tm-frv.h
@@ -20,9 +20,6 @@
/* This target uses an architecture vector for most architecture methods. */
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
-
#define TARGET_HW_BREAK_LIMIT 4
#define TARGET_HW_WATCH_LIMIT 4
@@ -45,18 +42,4 @@ extern int frv_check_watch_resources (int type, int cnt, int ot);
extern CORE_ADDR frv_stopped_data_address(void);
/* Use these macros for watchpoint insertion/deletion. */
-#define target_insert_watchpoint(addr, len, type) \
- remote_insert_watchpoint (addr, len, type)
-#define target_remove_watchpoint(addr, len, type) \
- remote_remove_watchpoint (addr, len, type)
-#define target_insert_hw_breakpoint(addr, shadow) \
- remote_insert_hw_breakpoint (addr, 1)
-#define target_remove_hw_breakpoint(addr, shadow) \
- remote_remove_hw_breakpoint (addr, 1)
#define target_stopped_data_address() frv_stopped_data_address()
-
-/* These declarations should be in remote.h, no? */
-extern int remote_insert_watchpoint (CORE_ADDR addr, int len, int type);
-extern int remote_remove_watchpoint (CORE_ADDR addr, int len, int type);
-extern int remote_insert_hw_breakpoint (CORE_ADDR addr, int len);
-extern int remote_remove_hw_breakpoint (CORE_ADDR addr, int len);
diff --git a/gdb/config/h8300/tm-h8300.h b/gdb/config/h8300/tm-h8300.h
index e560c644c8d..5d1aaa723b9 100644
--- a/gdb/config/h8300/tm-h8300.h
+++ b/gdb/config/h8300/tm-h8300.h
@@ -20,8 +20,6 @@
Boston, MA 02111-1307, USA. */
/* Contributed by Steve Chamberlain sac@cygnus.com */
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
/* NOTE: ezannoni 2000-07-18: these variables are part of sim, defined
in sim/h8300/compile.c. They really should not be used this
way. Because of this we cannot get rid of the macro
diff --git a/gdb/config/i386/fbsd64.mh b/gdb/config/i386/fbsd64.mh
index a1a79a33499..7e42aaa2cd6 100644
--- a/gdb/config/i386/fbsd64.mh
+++ b/gdb/config/i386/fbsd64.mh
@@ -4,4 +4,4 @@ XM_FILE= xm-i386.h
NAT_FILE= nm-fbsd64.h
# NOTE: Do not spread NATDEPFILES over several lines - it hurts BSD make.
-NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-svr4.o solib-legacy.o corelow.o core-regset.o amd64fbsd-nat.o gcore.o fbsd-proc.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o solib.o solib-svr4.o solib-legacy.o corelow.o core-regset.o amd64-nat.o amd64fbsd-nat.o gcore.o fbsd-proc.o
diff --git a/gdb/config/i386/nm-i386sol2.h b/gdb/config/i386/nm-i386sol2.h
index aeb89a26f6f..18afa04af1e 100644
--- a/gdb/config/i386/nm-i386sol2.h
+++ b/gdb/config/i386/nm-i386sol2.h
@@ -28,6 +28,7 @@
can support "thousands" of hardware watchpoints, but gives no
method for finding out how many. So just tell GDB 'yes'. */
#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(TYPE, CNT, OT) 1
+#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(SIZE) 1
/* When a hardware watchpoint fires off the PC will be left at the
instruction following the one which caused the watchpoint.
diff --git a/gdb/config/i386/nm-linux.h b/gdb/config/i386/nm-linux.h
index ad57124e88c..1df875fd57b 100644
--- a/gdb/config/i386/nm-linux.h
+++ b/gdb/config/i386/nm-linux.h
@@ -82,4 +82,13 @@ extern int cannot_store_register (int regno);
/* Override child_resume in `infptrace.c'. */
#define CHILD_RESUME
+/* `linux-nat.c' and `i386-nat.c' have their own versions of
+ child_post_startup_inferior. Define this to use the copy in
+ `i386-linux-nat.c' instead, which calls both.
+
+ NOTE drow/2003-08-17: This is ugly beyond words, but properly
+ fixing it will require some serious surgery. Ideally the target
+ stack could be used for this. */
+#define LINUX_CHILD_POST_STARTUP_INFERIOR
+
#endif /* nm-linux.h */
diff --git a/gdb/config/i386/nm-x86-64linux.h b/gdb/config/i386/nm-x86-64linux.h
index 8ff80957d57..d1ac9104a15 100644
--- a/gdb/config/i386/nm-x86-64linux.h
+++ b/gdb/config/i386/nm-x86-64linux.h
@@ -61,4 +61,9 @@ extern unsigned long x86_64_linux_dr_get_status (void);
/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
#define FETCH_INFERIOR_REGISTERS
+/* `linux-nat.c' and `i386-nat.c' have their own versions of
+ child_post_startup_inferior. Define this to use the copy in
+ `x86-86-linux-nat.c' instead, which calls both. */
+#define LINUX_CHILD_POST_STARTUP_INFERIOR
+
#endif /* NM_X86_64_LINUX_H */
diff --git a/gdb/config/i386/tm-cygwin.h b/gdb/config/i386/tm-cygwin.h
index f30c4329144..4b926f96cd4 100644
--- a/gdb/config/i386/tm-cygwin.h
+++ b/gdb/config/i386/tm-cygwin.h
@@ -19,13 +19,6 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Use SSE registers if winnt.h contains information about them. */
-#ifdef HAVE_CONTEXT_EXTENDED_REGISTERS
-#define HAVE_SSE_REGS
-#else
-#undef HAVE_SSE_REGS
-#endif /* CONTEXT_EXTENDED_REGISTERS */
-
#include "i386/tm-i386.h"
#define ATTACH_NO_WAIT
diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h
index 395c9b259b1..e2bd81fdaa8 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/config/i386/tm-i386.h
@@ -22,6 +22,4 @@
#ifndef TM_I386_H
#define TM_I386_H 1
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
#endif /* ifndef TM_I386_H */
diff --git a/gdb/config/i386/x86-64linux.mh b/gdb/config/i386/x86-64linux.mh
index 32e7a8e0a85..ed563cb0cf4 100644
--- a/gdb/config/i386/x86-64linux.mh
+++ b/gdb/config/i386/x86-64linux.mh
@@ -4,7 +4,7 @@ XM_FILE= xm-i386.h
NAT_FILE= nm-x86-64linux.h
NATDEPFILES= infptrace.o inftarg.o fork-child.o \
- i386-nat.o x86-64-linux-nat.o \
+ i386-nat.o amd64-nat.o x86-64-linux-nat.o \
linux-nat.o \
proc-service.o thread-db.o lin-lwp.o linux-proc.o gcore.o
diff --git a/gdb/config/i386/x86-64linux.mt b/gdb/config/i386/x86-64linux.mt
index bb33978de3f..9ef593844e2 100644
--- a/gdb/config/i386/x86-64linux.mt
+++ b/gdb/config/i386/x86-64linux.mt
@@ -3,6 +3,4 @@ TDEPFILES= x86-64-tdep.o x86-64-linux-tdep.o \
i386-tdep.o i387-tdep.o i386-linux-tdep.o \
solib.o solib-svr4.o solib-legacy.o corelow.o
-GDB_MULTI_ARCH=GDB_MULTI_ARCH_TM
-
TM_FILE=tm-x86-64linux.h
diff --git a/gdb/config/m68hc11/m68hc11.mt b/gdb/config/m68hc11/m68hc11.mt
index 5e25eeec673..0f1f0019eaa 100644
--- a/gdb/config/m68hc11/m68hc11.mt
+++ b/gdb/config/m68hc11/m68hc11.mt
@@ -1,6 +1,5 @@
# Target: Motorola 68HC11 processor
TDEPFILES= m68hc11-tdep.o
-TM_FILE= tm-m68hc11.h
SIM_OBS= remote-sim.o
SIM= ../sim/m68hc11/libsim.a -lm
diff --git a/gdb/config/m68k/nm-apollo68v.h b/gdb/config/m68k/nm-apollo68v.h
deleted file mode 100644
index 496e105d303..00000000000
--- a/gdb/config/m68k/nm-apollo68v.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Macro defintions for an Apollo.
- Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#define FETCH_INFERIOR_REGISTERS
diff --git a/gdb/config/m68k/nm-hp300hpux.h b/gdb/config/m68k/nm-hp300hpux.h
deleted file mode 100644
index b9547581ae8..00000000000
--- a/gdb/config/m68k/nm-hp300hpux.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Parameters for native support on HP 9000 model 320, for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1992, 1993, 1996
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Do implement the attach and detach commands. */
-
-#define ATTACH_DETACH
-
-/* fetch_inferior_registers is in nat-hp300hpux.c. */
-#define FETCH_INFERIOR_REGISTERS
-
-/* Get registers from a core file. The floating point stuff is just
- guesses. */
-#define NEED_SYS_CORE_H
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ \
- if (regno < PS_REGNUM) \
- addr = (int) (&((struct proc_regs *)(blockend))->d0 + regno); \
- else if (regno == PS_REGNUM) \
- addr = (int) ((char *) (&((struct proc_regs *)(blockend))->ps) - 2); \
- else if (regno == PC_REGNUM) \
- addr = (int) &((struct proc_regs *)(blockend))->pc; \
- else if (regno < FPC_REGNUM) \
- addr = (int) (((struct proc_regs *)(blockend))->mc68881 \
- + ((regno) - FP0_REGNUM) / 2); \
- else \
- addr = (int) (((struct proc_regs *)(blockend))->p_float \
- + (regno) - FPC_REGNUM); \
-}
-
-/* HPUX 8.0, in its infinite wisdom, has chosen to prototype ptrace
- with five arguments, so programs written for normal ptrace lose.
-
- Idiots.
-
- (They should have just made it varadic). */
-
-#define FIVE_ARG_PTRACE
diff --git a/gdb/config/m68k/tm-cisco.h b/gdb/config/m68k/tm-cisco.h
index 24db025bccf..51e2cdc39a2 100644
--- a/gdb/config/m68k/tm-cisco.h
+++ b/gdb/config/m68k/tm-cisco.h
@@ -51,5 +51,5 @@
/* BFD handles finding the registers in the core file, so they are at
the start of the BFD .reg section. */
-#define REGISTER_U_ADDR(addr,blockend,regno) (addr = REGISTER_BYTE (regno))
+#define REGISTER_U_ADDR(addr,blockend,regno) (addr = DEPRECATED_REGISTER_BYTE (regno))
#define KERNEL_U_ADDR 0
diff --git a/gdb/config/m68k/tm-delta68.h b/gdb/config/m68k/tm-delta68.h
index 25b747ec8eb..97112a83f46 100644
--- a/gdb/config/m68k/tm-delta68.h
+++ b/gdb/config/m68k/tm-delta68.h
@@ -50,7 +50,7 @@ struct frame_info;
#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE, \
- &REGBUF[REGISTER_BYTE (FP0_REGNUM)], \
+ &REGBUF[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], \
VALBUF); \
else \
memcpy ((VALBUF), \
@@ -70,7 +70,7 @@ struct frame_info;
{ \
char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
DEPRECATED_REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf); \
- deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM), \
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP0_REGNUM), \
raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
} \
else \
diff --git a/gdb/config/m68k/tm-hp300hpux.h b/gdb/config/m68k/tm-hp300hpux.h
deleted file mode 100644
index 860653208f2..00000000000
--- a/gdb/config/m68k/tm-hp300hpux.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Parameters for execution on an HP 9000 model 320, for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* GCC is the only compiler used for stabs on this OS. So get this
- right even if the code which detects gcc2_compiled. is still
- broken. */
-
-#define BELIEVE_PCC_PROMOTION 1
-
-/* Define BPT_VECTOR if it is different than the default.
- This is the vector number used by traps to indicate a breakpoint. */
-
-#define BPT_VECTOR 0x1
-
-#include "m68k/tm-m68k.h"
diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h
index f773428a2f0..17b31981f19 100644
--- a/gdb/config/m68k/tm-m68k.h
+++ b/gdb/config/m68k/tm-m68k.h
@@ -19,6 +19,4 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
extern int m68k_get_longjmp_target (CORE_ADDR *);
diff --git a/gdb/config/m68k/xm-apollo68v.h b/gdb/config/m68k/xm-apollo68v.h
deleted file mode 100644
index 8919088b4f2..00000000000
--- a/gdb/config/m68k/xm-apollo68v.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Macro defintions for an Apollo.
- Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/*
- * Changes for 80386 by Pace Willisson (pace@prep.ai.mit.edu)
- * July 1988
- */
-
-/* I'm running gdb 3.4 under 386/ix 2.0.2, which is a derivative of AT&T's
- Sys V/386 3.2.
-
- On some machines, gdb crashes when it's starting up while calling the
- vendor's termio tgetent() routine. It always works when run under
- itself (actually, under 3.2, it's not an infinitely recursive bug.)
- After some poking around, it appears that depending on the environment
- size, or whether you're running YP, or the phase of the moon or something,
- the stack is not always long-aligned when main() is called, and tgetent()
- takes strong offense at that. On some machines this bug never appears, but
- on those where it does, it occurs quite reliably. */
-#define ALIGN_STACK_ON_STARTUP
-
-/* define USG if you are using sys5 /usr/include's */
-#define USG
-
-#define HAVE_TERMIO
diff --git a/gdb/config/m68k/xm-hp300bsd.h b/gdb/config/m68k/xm-hp300bsd.h
deleted file mode 100644
index b938353b5f7..00000000000
--- a/gdb/config/m68k/xm-hp300bsd.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Parameters for hosting on a Hewlett-Packard 9000/300, running bsd.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1995, 1996, 2000, 2001
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/*
- * Configuration file for HP9000/300 series machine running
- * University of Utah's 4.3bsd (or 4.4BSD) port. This is NOT for HP-UX.
- * Problems to hpbsd-bugs@cs.utah.edu
- */
-
-#include <sys/param.h> /* For INT_MIN */
-
-/* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */
-#define ONE_PROCESS_WRITETEXT
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movel #end, sp"); \
- asm ("movel #0,a6"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("movel a6,sp@-");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl sp@,a6");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea sp@(10)"); \
- asm ("movem #0xfffe,sp@-"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subil #8,sp@(28)"); \
- asm ("movem sp@,#0xffff"); \
- asm ("rte"); }
diff --git a/gdb/config/m68k/xm-hp300hpux.h b/gdb/config/m68k/xm-hp300hpux.h
deleted file mode 100644
index f5982b4491a..00000000000
--- a/gdb/config/m68k/xm-hp300hpux.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/* Parameters for HP 9000 model 320 hosting, for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Define this to indicate problems with traps after continuing. */
-#define HP_OS_BUG
-
-/* Set flag to indicate whether HP's assembler is in use. */
-#ifdef __GNUC__
-#ifdef __HPUX_ASM__
-#define HPUX_ASM
-#endif
-#else /* not GNU C. */
-#define HPUX_ASM
-#endif /* not GNU C. */
-
-/* Define this for versions of hp-ux older than 6.0 */
-/* #define HPUX_VERSION_5 */
-
-/* define USG if you are using sys5 /usr/include's */
-#undef USG /* In case it was defined in the Makefile for cplus-dem.c */
-#define USG
-
-#define HAVE_TERMIOS
-
-#define REGISTER_ADDR(u_ar0, regno) \
- (unsigned int) \
- (((regno) < PS_REGNUM) \
- ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \
- : (((regno) == PS_REGNUM) \
- ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS)) \
- : (&((struct exception_stack *) (u_ar0))->e_PC)))
-
-#define FP_REGISTER_ADDR(u, regno) \
- (((char *) \
- (((regno) < FPC_REGNUM) \
- ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \
- : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \
- - ((char *) (& u)))
-
-/* Interface definitions for kernel debugger KDB. */
-
-/* Map machine fault codes into signal numbers.
- First subtract 0, divide by 4, then index in a table.
- Faults for which the entry in this table is 0
- are not handled by KDB; the program's own trap handler
- gets to handle then. */
-
-#define FAULT_CODE_ORIGIN 0
-#define FAULT_CODE_UNITS 4
-#define FAULT_TABLE \
-{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
- 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
- 0, 0, 0, 0, 0, 0, 0, 0, \
- SIGILL }
-
-#ifndef HPUX_ASM
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm (".globl end"); \
- asm ("movel $ end, sp"); \
- asm ("clrl fp"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("movel fp, -(sp)");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("movl (sp), fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clrw -(sp)"); \
- asm ("pea 10(sp)"); \
- asm ("movem $ 0xfffe,-(sp)"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subil $8,28(sp)"); \
- asm ("movem (sp),$ 0xffff"); \
- asm ("rte"); }
-
-#else /* HPUX_ASM */
-
-/* Start running with a stack stretching from BEG to END.
- BEG and END should be symbols meaningful to the assembler.
- This is used only for kdb. */
-
-#define INIT_STACK(beg, end) \
-{ asm ("global end"); \
- asm ("mov.l &end,%sp"); \
- asm ("clr.l %a6"); }
-
-/* Push the frame pointer register on the stack. */
-#define PUSH_FRAME_PTR \
- asm ("mov.l %fp,-(%sp)");
-
-/* Copy the top-of-stack to the frame pointer register. */
-#define POP_FRAME_PTR \
- asm ("mov.l (%sp),%fp");
-
-/* After KDB is entered by a fault, push all registers
- that GDB thinks about (all NUM_REGS of them),
- so that they appear in order of ascending GDB register number.
- The fault code will be on the stack beyond the last register. */
-
-#define PUSH_REGISTERS \
-{ asm ("clr.w -(%sp)"); \
- asm ("pea 10(%sp)"); \
- asm ("movm.l &0xfffe,-(%sp)"); }
-
-/* Assuming the registers (including processor status) have been
- pushed on the stack in order of ascending GDB register number,
- restore them and return to the address in the saved PC register. */
-
-#define POP_REGISTERS \
-{ asm ("subi.l &8,28(%sp)"); \
- asm ("mov.m (%sp),&0xffff"); \
- asm ("rte"); }
-
-#endif /* HPUX_ASM */
diff --git a/gdb/config/mips/embed.mt b/gdb/config/mips/embed.mt
index e17c5c2d4ff..3dad52bd920 100644
--- a/gdb/config/mips/embed.mt
+++ b/gdb/config/mips/embed.mt
@@ -1,5 +1,4 @@
-# Target: Big-endian mips board, typically an IDT.
TDEPFILES= mips-tdep.o remote-mips.o
-TM_FILE= tm-embed.h
+TM_FILE= tm-mips.h
SIM_OBS = remote-sim.o
SIM = ../sim/mips/libsim.a
diff --git a/gdb/config/mips/embed64.mt b/gdb/config/mips/embed64.mt
index aee68aeb335..2944be10e45 100644
--- a/gdb/config/mips/embed64.mt
+++ b/gdb/config/mips/embed64.mt
@@ -1,4 +1,3 @@
-# Target: Big-endian mips board, typically an IDT.
TDEPFILES= mips-tdep.o remote-mips.o
TM_FILE= tm-mips64.h
SIM_OBS = remote-sim.o
diff --git a/gdb/config/mips/embedl.mt b/gdb/config/mips/embedl.mt
deleted file mode 100644
index bbc9b7d1b95..00000000000
--- a/gdb/config/mips/embedl.mt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Target: Big-endian mips board, typically an IDT.
-TDEPFILES= mips-tdep.o remote-mips.o
-TM_FILE= tm-mips.h
-SIM_OBS = remote-sim.o
-SIM = ../sim/mips/libsim.a
diff --git a/gdb/config/mips/embedl64.mt b/gdb/config/mips/embedl64.mt
deleted file mode 100644
index aee68aeb335..00000000000
--- a/gdb/config/mips/embedl64.mt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Target: Big-endian mips board, typically an IDT.
-TDEPFILES= mips-tdep.o remote-mips.o
-TM_FILE= tm-mips64.h
-SIM_OBS = remote-sim.o
-SIM = ../sim/mips/libsim.a
diff --git a/gdb/config/mips/irix3.mh b/gdb/config/mips/irix3.mh
deleted file mode 100644
index fcb30ed3dcb..00000000000
--- a/gdb/config/mips/irix3.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Host: SGI Iris running irix 3.x
-XM_FILE= xm-irix3.h
-NAT_FILE= nm-irix3.h
-NATDEPFILES= fork-child.o corelow.o infptrace.o inftarg.o mips-nat.o
-XM_CLIBS=-lbsd
diff --git a/gdb/config/mips/irix3.mt b/gdb/config/mips/irix3.mt
deleted file mode 100644
index b3fa4dda384..00000000000
--- a/gdb/config/mips/irix3.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: MIPS SGI running Irix 3
-TDEPFILES= mips-tdep.o
-TM_FILE= tm-irix3.h
diff --git a/gdb/config/mips/irix4.mh b/gdb/config/mips/irix4.mh
deleted file mode 100644
index 4153a0ec2ac..00000000000
--- a/gdb/config/mips/irix4.mh
+++ /dev/null
@@ -1,10 +0,0 @@
-# Host: SGI Iris running irix 4.x
-XM_FILE= xm-irix4.h
-NAT_FILE= nm-irix4.h
-NATDEPFILES= fork-child.o irix4-nat.o corelow.o procfs.o \
- proc-api.o proc-events.o proc-flags.o proc-why.o
-
-
-XM_CLIBS=-lbsd -lsun
-# use cc in K&R mode, bump up some static compiler tables.
-CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh1100
diff --git a/gdb/config/mips/mips.mt b/gdb/config/mips/mips.mt
deleted file mode 100644
index 2d08bcb6eff..00000000000
--- a/gdb/config/mips/mips.mt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Target: Big-endian SIM monitor board.
-TDEPFILES= mips-tdep.o remote-mips.o
-TM_FILE= tm-mips.h
-SIM_OBS = remote-sim.o
-SIM = ../sim/mips/libsim.a
diff --git a/gdb/config/mips/mips64.mt b/gdb/config/mips/mips64.mt
deleted file mode 100644
index e6a19d8d974..00000000000
--- a/gdb/config/mips/mips64.mt
+++ /dev/null
@@ -1,5 +0,0 @@
-# Target: Big-endian SIM monitor board.
-TDEPFILES= mips-tdep.o remote-mips.o
-TM_FILE= tm-mips64.h
-SIM_OBS = remote-sim.o
-SIM = ../sim/mips/libsim.a
diff --git a/gdb/config/mips/nm-irix3.h b/gdb/config/mips/nm-irix3.h
deleted file mode 100644
index 5cd2da35b6e..00000000000
--- a/gdb/config/mips/nm-irix3.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Definitions for SGI irix3 native support.
- Copyright 1991, 1992, 1993, 1996, 2000 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* Don't need special routines for Irix v3 -- we can use infptrace.c */
-#undef FETCH_INFERIOR_REGISTERS
-
-#define U_REGS_OFFSET 0
-
-/* Figure out where the longjmp will land. We expect that we have just entered
- longjmp and haven't yet setup the stack frame, so the args are still in the
- argument regs. a0 (CALL_ARG0) points at the jmp_buf structure from which we
- extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
- This routine returns true on success */
-
-#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-extern int get_longjmp_target (CORE_ADDR *);
-
-/* Is this really true or is this just a leftover from a DECstation
- config file? */
-
-#define ONE_PROCESS_WRITETEXT
diff --git a/gdb/config/mips/nm-irix4.h b/gdb/config/mips/nm-irix4.h
deleted file mode 100644
index bf4a02c2fc4..00000000000
--- a/gdb/config/mips/nm-irix4.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Definitions for native support of irix4.
-
- Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/*
- * Let's use /debug instead of all this dangerous mucking about
- * with ptrace(), which seems *extremely* fragile, anyway.
- */
-#define USE_PROC_FS
-#define CTL_PROC_NAME_FMT "/debug/%d"
-#define AS_PROC_NAME_FMT "/debug/%d"
-#define MAP_PROC_NAME_FMT "/debug/%d"
-#define STATUS_PROC_NAME_FMT "/debug/%d"
-
-/* Don't need special routines for the SGI -- we can use infptrace.c */
-#undef FETCH_INFERIOR_REGISTERS
-
-#define U_REGS_OFFSET 0
-
-/* Is this really true or is this just a leftover from a DECstation
- config file? */
-
-#define ONE_PROCESS_WRITETEXT
-
-#define TARGET_HAS_HARDWARE_WATCHPOINTS
-
-/* Temporary new watchpoint stuff */
-#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \
- ((type) == bp_hardware_watchpoint)
-
-/* When a hardware watchpoint fires off the PC will be left at the
- instruction which caused the watchpoint. It will be necessary for
- GDB to step over the watchpoint. */
-
-#define STOPPED_BY_WATCHPOINT(W) \
- procfs_stopped_by_watchpoint(inferior_ptid)
-extern int procfs_stopped_by_watchpoint (ptid_t);
-
-#define HAVE_NONSTEPPABLE_WATCHPOINT 1
-
-/* Use these macros for watchpoint insertion/deletion. */
-/* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */
-#define target_insert_watchpoint(ADDR, LEN, TYPE) \
- procfs_set_watchpoint (inferior_ptid, ADDR, LEN, TYPE, 0)
-#define target_remove_watchpoint(ADDR, LEN, TYPE) \
- procfs_set_watchpoint (inferior_ptid, ADDR, 0, 0, 0)
-extern int procfs_set_watchpoint (ptid_t, CORE_ADDR, int, int, int);
-
-#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(SIZE) 1
diff --git a/gdb/config/mips/nm-irix5.h b/gdb/config/mips/nm-irix5.h
index 4507ad1d7fb..6bdab300b19 100644
--- a/gdb/config/mips/nm-irix5.h
+++ b/gdb/config/mips/nm-irix5.h
@@ -36,8 +36,6 @@
procfs_stopped_by_watchpoint(inferior_ptid)
extern int procfs_stopped_by_watchpoint (ptid_t);
-#define HAVE_NONSTEPPABLE_WATCHPOINT 1
-
/* Use these macros for watchpoint insertion/deletion. */
/* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */
#define target_insert_watchpoint(ADDR, LEN, TYPE) \
diff --git a/gdb/config/mips/tm-embed.h b/gdb/config/mips/tm-embed.h
deleted file mode 100644
index a7a794807f0..00000000000
--- a/gdb/config/mips/tm-embed.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright 1993, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "mips/tm-mips.h"
-
-/* Watchpoint support */
-
-#define TARGET_HAS_HARDWARE_WATCHPOINTS
-
-/* Use these macros for watchpoint insertion/deletion. */
-/* type can be 0: write watch, 1: read watch, 2: access watch (read/write) */
-
-#define target_insert_watchpoint(addr, len, type) \
- remote_mips_set_watchpoint (addr, len, type)
-int remote_mips_set_watchpoint (CORE_ADDR addr, int len, int type);
-
-#define target_remove_watchpoint(addr, len, type) \
- remote_mips_remove_watchpoint (addr, len, type)
-int remote_mips_remove_watchpoint (CORE_ADDR addr, int len, int type);
-
-/* We need to remove watchpoints when stepping, else we hit them again! */
-
-#define HAVE_NONSTEPPABLE_WATCHPOINT 1
-
-int remote_mips_stopped_by_watchpoint (void);
-#define STOPPED_BY_WATCHPOINT(w) remote_mips_stopped_by_watchpoint ()
-
-#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) \
- remote_mips_can_use_hardware_watchpoint(cnt)
-int remote_mips_can_use_hardware_watchpoint (int cnt);
diff --git a/gdb/config/mips/tm-irix3.h b/gdb/config/mips/tm-irix3.h
deleted file mode 100644
index 05ab07d89a2..00000000000
--- a/gdb/config/mips/tm-irix3.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Target machine description for SGI Iris under Irix, for GDB.
- Copyright 1990, 1991, 1992, 1993, 1995, 1999
- Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "mips/tm-mips.h"
-
-/* Redefine register numbers for SGI. */
-
-#undef MIPS_REGISTER_NAMES
-#undef FP0_REGNUM
-#undef PC_REGNUM
-#undef HI_REGNUM
-#undef LO_REGNUM
-#undef CAUSE_REGNUM
-#undef BADVADDR_REGNUM
-#undef FCRCS_REGNUM
-#undef FCRIR_REGNUM
-
-/* Initializer for an array of names for registers 32 and above.
- There should be NUM_REGS-32 strings in this initializer. */
-
-#define MIPS_REGISTER_NAMES \
- { "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\
- "pc", "cause", "bad", "hi", "lo", "fsr", "fir" \
- }
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#define FP0_REGNUM 32 /* Floating point register 0 (single float) */
-#define PC_REGNUM 64 /* Contains program counter */
-#define CAUSE_REGNUM 65 /* describes last exception */
-#define BADVADDR_REGNUM 66 /* bad vaddr for addressing exception */
-#define HI_REGNUM 67 /* Multiple/divide temp */
-#define LO_REGNUM 68 /* ... */
-#define FCRCS_REGNUM 69 /* FP control/status */
-#define FCRIR_REGNUM 70 /* FP implementation/revision */
-
-/* Offsets for register values in _sigtramp frame.
- sigcontext is immediately above the _sigtramp frame on Irix. */
-#define SIGFRAME_BASE 0x0
-#define SIGFRAME_PC_OFF (SIGFRAME_BASE + 2 * 4)
-#define SIGFRAME_REGSAVE_OFF (SIGFRAME_BASE + 3 * 4)
-#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 3 * 4 + 32 * 4 + 4)
diff --git a/gdb/config/mips/tm-irix5.h b/gdb/config/mips/tm-irix5.h
index 932852ea487..61e809debd1 100644
--- a/gdb/config/mips/tm-irix5.h
+++ b/gdb/config/mips/tm-irix5.h
@@ -19,7 +19,53 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "mips/tm-irix3.h"
+#include "mips/tm-mips.h"
+
+/* Redefine register numbers for SGI. */
+
+#undef MIPS_REGISTER_NAMES
+#undef FP0_REGNUM
+#undef PC_REGNUM
+#undef HI_REGNUM
+#undef LO_REGNUM
+#undef CAUSE_REGNUM
+#undef BADVADDR_REGNUM
+#undef FCRCS_REGNUM
+#undef FCRIR_REGNUM
+
+/* Initializer for an array of names for registers 32 and above.
+ There should be NUM_REGS-32 strings in this initializer. */
+
+#define MIPS_REGISTER_NAMES \
+ { "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
+ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\
+ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",\
+ "pc", "cause", "bad", "hi", "lo", "fsr", "fir" \
+ }
+
+/* Register numbers of various important registers.
+ Note that some of these values are "real" register numbers,
+ and correspond to the general registers of the machine,
+ and some are "phony" register numbers which are too large
+ to be actual register numbers as far as the user is concerned
+ but do serve to get the desired values when passed to read_register. */
+
+#define FP0_REGNUM 32 /* Floating point register 0 (single float) */
+#define PC_REGNUM 64 /* Contains program counter */
+#define CAUSE_REGNUM 65 /* describes last exception */
+#define BADVADDR_REGNUM 66 /* bad vaddr for addressing exception */
+#define HI_REGNUM 67 /* Multiple/divide temp */
+#define LO_REGNUM 68 /* ... */
+#define FCRCS_REGNUM 69 /* FP control/status */
+#define FCRIR_REGNUM 70 /* FP implementation/revision */
+
+/* Offsets for register values in _sigtramp frame.
+ sigcontext is immediately above the _sigtramp frame on Irix. */
+#define SIGFRAME_BASE 0x0
+#define SIGFRAME_PC_OFF (SIGFRAME_BASE + 2 * 4)
+#define SIGFRAME_REGSAVE_OFF (SIGFRAME_BASE + 3 * 4)
+#define SIGFRAME_FPREGSAVE_OFF (SIGFRAME_BASE + 3 * 4 + 32 * 4 + 4)
/* FIXME: cagney/2000-04-04: Testing the _MIPS_SIM_NABI32 and
_MIPS_SIM in a tm-*.h file is simply wrong! Those are
diff --git a/gdb/config/mips/wince.mt b/gdb/config/mips/wince.mt
index a404b1cec8b..6aa5733808a 100644
--- a/gdb/config/mips/wince.mt
+++ b/gdb/config/mips/wince.mt
@@ -2,4 +2,4 @@
TDEPFILES= mips-tdep.o wince.o
TM_FILE= tm-wince.h
MT_CFLAGS=-DMIPS -U_X86_ -U_M_IX86 -U__i386__ -U__i486__ -U__i586__ -U__i686__ -DUNICODE -D_WIN32_WCE -DWINCE_STUB='"${target_alias}-stub.exe"'
-WIN32LIBS=-lrapi
+TM_CLIBS=-lrapi
diff --git a/gdb/config/nm-linux.h b/gdb/config/nm-linux.h
index 9a04cf71cf1..5d4175cfd8f 100644
--- a/gdb/config/nm-linux.h
+++ b/gdb/config/nm-linux.h
@@ -73,3 +73,7 @@ extern void lin_thread_get_thread_signals (sigset_t *mask);
#define CHILD_INSERT_FORK_CATCHPOINT
#define CHILD_INSERT_VFORK_CATCHPOINT
#define CHILD_INSERT_EXEC_CATCHPOINT
+#define CHILD_POST_STARTUP_INFERIOR
+#define CHILD_POST_ATTACH
+#define CHILD_FOLLOW_FORK
+#define KILL_INFERIOR
diff --git a/gdb/config/ns32k/tm-ns32k.h b/gdb/config/ns32k/tm-ns32k.h
index cd1594294fc..96dd2cb26bf 100644
--- a/gdb/config/ns32k/tm-ns32k.h
+++ b/gdb/config/ns32k/tm-ns32k.h
@@ -22,8 +22,6 @@
#ifndef TM_NS32K_H
#define TM_NS32K_H
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
/* Need to get function ends by adding this to epilogue address from .bf
record, not using x_fsize field. */
#define FUNCTION_EPILOGUE_SIZE 4
diff --git a/gdb/config/pa/hppa64.mt b/gdb/config/pa/hppa64.mt
index 9e3e6863a33..10d9fc67129 100644
--- a/gdb/config/pa/hppa64.mt
+++ b/gdb/config/pa/hppa64.mt
@@ -1,4 +1,3 @@
# Target: HP PA-RISC 2.0 running HPUX 11.00 in wide mode
TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o
TM_FILE= tm-hppa64.h
-TM_CLIBS=
diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h
index 05e7db2b91f..29a52dfcf72 100644
--- a/gdb/config/pa/nm-hppah.h
+++ b/gdb/config/pa/nm-hppah.h
@@ -25,7 +25,7 @@
/* What a coincidence! */
#define REGISTER_U_ADDR(addr, blockend, regno) \
-{ addr = (int)(blockend) + REGISTER_BYTE (regno);}
+{ addr = (int)(blockend) + DEPRECATED_REGISTER_BYTE (regno);}
/* This isn't really correct, because ptrace is actually a 32-bit
interface. However, the modern HP-UX targets all really use
@@ -169,12 +169,6 @@ extern int hppa_can_use_hw_watchpoint (int type, int cnt, int ot);
! stepped_after_stopped_by_watchpoint && \
bpstat_have_active_hw_watchpoints ())
-/* When a hardware watchpoint triggers, we'll move the inferior past it
- by removing all eventpoints; stepping past the instruction that caused
- the trigger; reinserting eventpoints; and checking whether any watched
- location changed. */
-#define HAVE_NONSTEPPABLE_WATCHPOINT 1
-
/* Our implementation of "hardware" watchpoints uses memory page-protection
faults. However, HP-UX has unfortunate interactions between these and
system calls; basically, it's unsafe to have page protections on when a
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index 7729518cc6e..d1b35551546 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -27,9 +27,7 @@
/* Wonder if this is correct? Should be using push_dummy_call(). */
#define DEPRECATED_DUMMY_WRITE_SP(SP) deprecated_write_sp (SP)
-#ifndef GDB_MULTI_ARCH
#define GDB_MULTI_ARCH 1
-#endif
/* NOTE: cagney/2002-11-24: This is a guess. */
#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES 0
diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h
index 8d19a45cb6f..62bcebc7423 100644
--- a/gdb/config/pa/tm-hppa64.h
+++ b/gdb/config/pa/tm-hppa64.h
@@ -21,13 +21,11 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-struct type;
-struct value;
-struct frame_info;
-
/* PA 64-bit specific definitions. Override those which are in
tm-hppa.h */
+struct frame_info;
+
/* jimb: this must go. I'm just using it to disable code I haven't
gotten working yet. */
#define GDB_TARGET_IS_HPPA_20W
@@ -36,406 +34,19 @@ struct frame_info;
hppa64-hp-hpux11.00; GDB managed to build / start / break main /
run with multi-arch enabled. Not sure about much else as there
appears to be an unrelated problem in the SOM symbol table reader
- causing GDB to loose line number information. Since prior to this
+ causing GDB to lose line number information. Since prior to this
switch and a other recent tweaks, 64 bit PA hadn't been building
for some months, this is probably the lesser of several evils. */
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
-/* FIXME: brobecker 2003-05-22: All the definition from this point until
- the include of pa/tm-hppah.h are extracted from tm-hppa.h and tm-hppah.h.
- They have been temporarily moved here, until hppa64 is multiarched too. */
-
-#if !GDB_MULTI_ARCH
-extern int hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name);
-#define PC_IN_SIGTRAMP(pc, name) hppa_hpux_pc_in_sigtramp (pc, name)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern int hppa_reg_struct_has_addr (int gcc_p, struct type *type);
-#define REG_STRUCT_HAS_ADDR(gcc_p,type) hppa_reg_struct_has_addr (gcc_p,type)
-#endif
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#if !GDB_MULTI_ARCH
-#define FUNCTION_START_OFFSET 0
-#endif
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_skip_prologue (CORE_ADDR);
-#define SKIP_PROLOGUE(pc) (hppa_skip_prologue (pc))
-#endif
-
-/* If PC is in some function-call trampoline code, return the PC
- where the function itself actually starts. If not, return NULL. */
-
-#if !GDB_MULTI_ARCH
-#define SKIP_TRAMPOLINE_CODE(pc) hppa_skip_trampoline_code (pc)
-extern CORE_ADDR hppa_skip_trampoline_code (CORE_ADDR);
-#endif
-
-/* Return non-zero if we are in an appropriate trampoline. */
-
-#if !GDB_MULTI_ARCH
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
- hppa_in_solib_call_trampoline (pc, name)
-extern int hppa_in_solib_call_trampoline (CORE_ADDR, char *);
-#endif
-
-#if !GDB_MULTI_ARCH
-#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) \
- hppa_in_solib_return_trampoline (pc, name)
-extern int hppa_in_solib_return_trampoline (CORE_ADDR, char *);
-#endif
-
-#if !GDB_MULTI_ARCH
-#undef DEPRECATED_SAVED_PC_AFTER_CALL
-#define DEPRECATED_SAVED_PC_AFTER_CALL(frame) hppa_saved_pc_after_call (frame)
-extern CORE_ADDR hppa_saved_pc_after_call (struct frame_info *);
-#endif
-
-#if !GDB_MULTI_ARCH
-extern int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
-#define INNER_THAN(lhs,rhs) hppa_inner_than(lhs,rhs)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_stack_align (CORE_ADDR sp);
-#define STACK_ALIGN(sp) hppa_stack_align (sp)
-#endif
-
-/* Amount PC must be decremented by after a breakpoint. This is often
- the number of bytes returned by BREAKPOINT_FROM_PC but not always.
-
- Not on the PA-RISC */
-
-#if !GDB_MULTI_ARCH
-#define DECR_PC_AFTER_BREAK 0
-#endif
-
-/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places; REGISTER_RAW_SIZE is the
- real way to know how big a register is. */
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_REGISTER_SIZE 4
-#endif
-
-/* Number of machine registers */
-
-#if !GDB_MULTI_ARCH
-#define NUM_REGS 128
-#endif
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_FP_REGNUM 3 /* Contains address of executing stack */
- /* frame */
-#endif
-#if !GDB_MULTI_ARCH
-#define SP_REGNUM 30 /* Contains address of top of stack */
-#endif
-
-#if !GDB_MULTI_ARCH
-#define FP0_REGNUM 64 /* floating point reg. 0 (fspr) */
-#endif
-
-/* compatibility with the rest of gdb. */
-#if !GDB_MULTI_ARCH
-#define PC_REGNUM PCOQ_HEAD_REGNUM
-#endif
-#if !GDB_MULTI_ARCH
-#define NPC_REGNUM PCOQ_TAIL_REGNUM
-#endif
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the PA-RISC, all regs are 4 bytes, including
- the FP registers (they're accessed as two 4 byte halves). */
-
-#if !GDB_MULTI_ARCH
-extern int hppa_register_raw_size (int reg_nr);
-#define REGISTER_RAW_SIZE(N) hppa_register_raw_size (N)
-#endif
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_REGISTER_BYTES (NUM_REGS * 4)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern int hppa_register_byte (int reg_nr);
-#define REGISTER_BYTE(N) hppa_register_byte (N)
-#endif
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-#if !GDB_MULTI_ARCH
-#define REGISTER_VIRTUAL_SIZE(N) REGISTER_RAW_SIZE(N)
-#endif
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_MAX_REGISTER_RAW_SIZE 4
-#endif
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8
-#endif
-
-#if !GDB_MULTI_ARCH
-extern struct type * hppa_register_virtual_type (int reg_nr);
-#define REGISTER_VIRTUAL_TYPE(N) hppa_register_virtual_type (N)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
-#define STORE_STRUCT_RETURN(ADDR, SP) hppa_store_struct_return (ADDR, SP)
-#endif
-
-/* Extract from an array REGBUF containing the (raw) register state
- a function return value of type TYPE, and copy that, in virtual format,
- into VALBUF. */
-
-#if !GDB_MULTI_ARCH
-void hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf);
-#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- hppa_extract_return_value (TYPE, REGBUF, VALBUF);
-#endif
-
- /* elz: decide whether the function returning a value of type type
- will put it on the stack or in the registers.
- The pa calling convention says that:
- register 28 (called ret0 by gdb) contains any ASCII char,
- and any non_floating point value up to 32-bits.
- reg 28 and 29 contain non-floating point up tp 64 bits and larger
- than 32 bits. (higer order word in reg 28).
- fr4: floating point up to 64 bits
- sr1: space identifier (32-bit)
- stack: any lager than 64-bit, with the address in r28
- */
-#if !GDB_MULTI_ARCH
-extern use_struct_convention_fn hppa_use_struct_convention;
-#define USE_STRUCT_CONVENTION(gcc_p,type) hppa_use_struct_convention (gcc_p,type)
-#endif
-
-/* Write into appropriate registers a function return value
- of type TYPE, given in virtual format. */
-
-#if !GDB_MULTI_ARCH
-extern void hppa_store_return_value (struct type *type, char *valbuf);
-#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
- hppa_store_return_value (TYPE, VALBUF);
-#endif
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_extract_struct_value_address (char *regbuf);
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
- hppa_extract_struct_value_address (REGBUF)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern int hppa_cannot_store_register (int regnum);
-#define CANNOT_STORE_REGISTER(regno) hppa_cannot_store_register (regno)
-#endif
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) hppa_init_extra_frame_info (fromleaf, frame)
-extern void hppa_init_extra_frame_info (int, struct frame_info *);
-#endif
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces
- the frame's chain-pointer. */
-
-/* In the case of the PA-RISC, the frame's nominal address
- is the address of a 4-byte word containing the calling frame's
- address (previous FP). */
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_FRAME_CHAIN(thisframe) hppa_frame_chain (thisframe)
-extern CORE_ADDR hppa_frame_chain (struct frame_info *);
-#endif
-
-#if !GDB_MULTI_ARCH
-extern int hppa_frame_chain_valid (CORE_ADDR, struct frame_info *);
-#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) hppa_frame_chain_valid (chain, thisframe)
-#endif
-
-/* Define other aspects of the stack frame. */
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-#if !GDB_MULTI_ARCH
-#define FRAMELESS_FUNCTION_INVOCATION(FI) \
- (hppa_frameless_function_invocation (FI))
-extern int hppa_frameless_function_invocation (struct frame_info *);
-#endif
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame);
-#define DEPRECATED_FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME)
-#endif
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_frame_locals_address (struct frame_info *fi);
-#define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi)
-#endif
-
-#if !GDB_MULTI_ARCH
-#define FRAME_ARGS_SKIP 0
-#endif
-
-/* Things needed for making the inferior call functions. */
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_PUSH_DUMMY_FRAME hppa_push_dummy_frame ()
-extern void hppa_push_dummy_frame (void);
-#endif
-
-/* Discard from the stack the innermost frame,
- restoring all saved registers. */
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_POP_FRAME hppa_pop_frame ()
-extern void hppa_pop_frame (void);
-#endif
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 28)
-#endif
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_CALL_DUMMY_START_OFFSET 0
-#endif
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
- (hppa_push_arguments((nargs), (args), (sp), (struct_return), (struct_addr)))
-extern CORE_ADDR hppa_push_arguments (int, struct value **, CORE_ADDR, int,
- CORE_ADDR);
-#endif
-
-#if !GDB_MULTI_ARCH
-extern CORE_ADDR hppa_smash_text_address (CORE_ADDR addr);
-#define SMASH_TEXT_ADDRESS(addr) hppa_smash_text_address (addr)
-#endif
-
-#if !GDB_MULTI_ARCH
-#define BELIEVE_PCC_PROMOTION 1
-#endif
-
-#if !GDB_MULTI_ARCH
-#define TARGET_READ_PC(pid) hppa_target_read_pc (pid)
-extern CORE_ADDR hppa_target_read_pc (ptid_t);
-#endif
-
-#if !GDB_MULTI_ARCH
-#define TARGET_WRITE_PC(v,pid) hppa_target_write_pc (v,pid)
-extern void hppa_target_write_pc (CORE_ADDR, ptid_t);
-#endif
-
-#if !GDB_MULTI_ARCH
-#define DEPRECATED_TARGET_READ_FP() hppa_target_read_fp ()
-extern CORE_ADDR hppa_target_read_fp (void);
-#endif
#include "pa/tm-hppah.h"
-#define HPUX_1100 1
-
-/* The low two bits of the IA are the privilege level of the instruction. */
-#define ADDR_BITS_REMOVE(addr) ((CORE_ADDR)addr & (CORE_ADDR)~3)
-
-/* Say how long (ordinary) registers are. This is used in
- push_word and a few other places, but REGISTER_RAW_SIZE is
- the real way to know how big a register is. */
-
-#undef DEPRECATED_REGISTER_SIZE
-#define DEPRECATED_REGISTER_SIZE 8
-
-/* Number of bytes of storage in the actual machine representation
- for register N. On the PA-RISC 2.0, all regs are 8 bytes, including
- the FP registers (they're accessed as two 4 byte halves). */
-
-#undef REGISTER_RAW_SIZE
-#define REGISTER_RAW_SIZE(N) 8
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#undef DEPRECATED_MAX_REGISTER_RAW_SIZE
-#define DEPRECATED_MAX_REGISTER_RAW_SIZE 8
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. */
-
-#undef DEPRECATED_REGISTER_BYTES
-#define DEPRECATED_REGISTER_BYTES (NUM_REGS * 8)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#undef REGISTER_BYTE
-#define REGISTER_BYTE(N) ((N) * 8)
-
-#undef REGISTER_VIRTUAL_TYPE
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((N) < FP4_REGNUM ? builtin_type_unsigned_long_long : builtin_type_double)
-
-
-/* Number of machine registers */
-#undef NUM_REGS
-#define NUM_REGS 96
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer.
- They are in rows of eight entries */
-extern const char *hppa64_register_name (int i);
-#define REGISTER_NAME hppa64_register_name
-
-#undef FP0_REGNUM
#undef FP4_REGNUM
-#define FP0_REGNUM 64 /* floating point reg. 0 (fspr)*/
#define FP4_REGNUM 68
-
-/* Redefine some target bit sizes from the default. */
-
-/* Number of bits in a long or unsigned long for the target machine. */
-
-#define TARGET_LONG_BIT 64
-
-/* Number of bits in a long long or unsigned long long for the
- target machine. */
-
-#define TARGET_LONG_LONG_BIT 64
-
-/* Number of bits in a pointer for the target machine */
-
-#define TARGET_PTR_BIT 64
-
-/* Argument Pointer Register */
-#define AP_REGNUM 29
-
+#define AP_REGNUM 29 /* Argument Pointer Register */
#define DP_REGNUM 27
-
#define FP5_REGNUM 70
-
#define SR5_REGNUM 48
-/* We access locals from SP. This may not work for frames which call
- alloca; for those, we may need to consult unwind tables.
- jimb: FIXME. */
-#undef DEPRECATED_FRAME_LOCALS_ADDRESS
-#define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi))
/* For a number of horrible reasons we may have to adjust the location
of variables on the stack. Ugh. jimb: why? */
@@ -492,19 +103,6 @@ call_dummy
0xe820f0000fb110d3LL, 0x0001000400151820LL,\
0xe6c0000008000240LL}
-#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET 22 * 4
-
-/* DEPRECATED_CALL_DUMMY_LENGTH is computed based on the size of a
- word on the target machine, not the size of an instruction. Since
- a word on this target holds two instructions we have to divide the
- instruction size by two to get the word size of the dummy. */
-#undef DEPRECATED_CALL_DUMMY_LENGTH
-#define DEPRECATED_CALL_DUMMY_LENGTH (INSTRUCTION_SIZE * 26 / 2)
-
-/* The PA64 ABI mandates a 16 byte stack alignment. */
-#undef STACK_ALIGN
-#define STACK_ALIGN(arg) ( ((arg)%16) ? (((arg)+15)&-16) : (arg))
-
/* The PA64 ABI reserves 64 bytes of stack space for outgoing register
parameters. */
#undef REG_PARM_STACK_SPACE
@@ -518,115 +116,22 @@ call_dummy
#undef SR4EXPORT_LDIL_OFFSET
#undef SR4EXPORT_LDO_OFFSET
-#undef REG_STRUCT_HAS_ADDR
-
-#undef DEPRECATED_EXTRACT_RETURN_VALUE
-/* RM: floats are returned in FR4R, doubles in FR4
- * integral values are in r28, padded on the left
- * aggregates less that 65 bits are in r28, right padded
- * aggregates upto 128 bits are in r28 and r29, right padded
- */
-#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- { \
- if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
- memcpy ((VALBUF), \
- ((char *)(REGBUF)) + REGISTER_BYTE (FP4_REGNUM) + \
- (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
- TYPE_LENGTH (TYPE)); \
- else if (is_integral_type(TYPE)) \
- memcpy ((VALBUF), \
- (char *)(REGBUF) + REGISTER_BYTE (28) + \
- (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
- TYPE_LENGTH (TYPE)); \
- else if (TYPE_LENGTH (TYPE) <= 8) \
- memcpy ((VALBUF), \
- (char *)(REGBUF) + REGISTER_BYTE (28), \
- TYPE_LENGTH (TYPE)); \
- else if (TYPE_LENGTH (TYPE) <= 16) \
- { \
- memcpy ((VALBUF), \
- (char *)(REGBUF) + REGISTER_BYTE (28), \
- 8); \
- memcpy (((char *) VALBUF + 8), \
- (char *)(REGBUF) + REGISTER_BYTE (29), \
- TYPE_LENGTH (TYPE) - 8); \
- } \
- }
-
-/* RM: struct upto 128 bits are returned in registers */
-#undef USE_STRUCT_CONVENTION
-#define USE_STRUCT_CONVENTION(gcc_p, value_type)\
- (TYPE_LENGTH (value_type) > 16)
-
-/* RM: for return command */
-#undef DEPRECATED_STORE_RETURN_VALUE
-#define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
- { \
- if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
- deprecated_write_register_bytes \
- (REGISTER_BYTE (FP4_REGNUM) + \
- (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
- (VALBUF), \
- TYPE_LENGTH (TYPE)); \
- else if (is_integral_type(TYPE)) \
- deprecated_write_register_bytes \
- (REGISTER_BYTE (28) + \
- (DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (TYPE)), \
- (VALBUF), \
- TYPE_LENGTH (TYPE)); \
- else if (TYPE_LENGTH (TYPE) <= 8) \
- deprecated_write_register_bytes \
- ( REGISTER_BYTE (28), \
- (VALBUF), \
- TYPE_LENGTH (TYPE)); \
- else if (TYPE_LENGTH (TYPE) <= 16) \
- { \
- deprecated_write_register_bytes \
- (REGISTER_BYTE (28), \
- (VALBUF), \
- 8); \
- deprecated_write_register_bytes \
- (REGISTER_BYTE (29), \
- ((char *) VALBUF + 8), \
- TYPE_LENGTH (TYPE) - 8); \
- } \
- }
-
-/* RM: these are the PA64 equivalents of the macros in tm-hppah.h --
- * see comments there. For PA64, the save_state structure is at an
- * offset of 24 32-bit words from the sigcontext structure. The 64 bit
- * general registers are at an offset of 640 bytes from the beginning of the
- * save_state structure, and the floating pointer register are at an offset
- * of 256 bytes from the beginning of the save_state structure.
- */
#undef FRAME_SAVED_PC_IN_SIGTRAMP
+extern void hppa64_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
+ CORE_ADDR *tmp);
#define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \
-{ \
- *(TMP) = read_memory_integer (get_frame_base (FRAME) + (24 * 4) + 640 + (33 * 8), 8); \
-}
+ hppa64_hpux_frame_saved_pc_in_sigtramp (FRAME, TMP)
#undef FRAME_BASE_BEFORE_SIGTRAMP
+extern void hppa64_hpux_frame_base_before_sigtramp (struct frame_info *fi,
+ CORE_ADDR *tmp);
#define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \
-{ \
- *(TMP) = read_memory_integer (get_frame_base (FRAME) + (24 * 4) + 640 + (30 * 8), 8); \
-}
+ hppa64_hpux_frame_base_before_sigtramp (FRAME, TMP)
#undef FRAME_FIND_SAVED_REGS_IN_SIGTRAMP
+extern void hppa64_hpux_frame_find_saved_regs_in_sigtramp
+ (struct frame_info *fi, CORE_ADDR *fsr);
#define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \
-{ \
- int i; \
- CORE_ADDR TMP1, TMP2; \
- TMP1 = get_frame_base (FRAME) + (24 * 4) + 640; \
- TMP2 = get_frame_base (FRAME) + (24 * 4) + 256; \
- for (i = 0; i < NUM_REGS; i++) \
- { \
- if (i == SP_REGNUM) \
- (FSR)[SP_REGNUM] = read_memory_integer (TMP1 + SP_REGNUM * 8, 8); \
- else if (i >= FP0_REGNUM) \
- (FSR)[i] = TMP2 + (i - FP0_REGNUM) * 8; \
- else \
- (FSR)[i] = TMP1 + i * 8; \
- } \
-}
+ hppa64_hpux_frame_find_saved_regs_in_sigtramp (FRAME, FSR)
/* jimb: omitted purify call support */
diff --git a/gdb/config/pa/tm-hppah.h b/gdb/config/pa/tm-hppah.h
index 345baafb4dc..325af819536 100644
--- a/gdb/config/pa/tm-hppah.h
+++ b/gdb/config/pa/tm-hppah.h
@@ -38,17 +38,17 @@ struct frame_info;
extern void hppa_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
CORE_ADDR *tmp);
#define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \
- hppa_hpux_frame_saved_pc_in_sigtramp (FRAME, TMP)
+ hppa32_hpux_frame_saved_pc_in_sigtramp (FRAME, TMP)
extern void hppa_hpux_frame_base_before_sigtramp (struct frame_info *fi,
CORE_ADDR *tmp);
#define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \
- hppa_hpux_frame_base_before_sigtramp (FRAME, TMP)
+ hppa32_hpux_frame_base_before_sigtramp (FRAME, TMP)
extern void hppa_hpux_frame_find_saved_regs_in_sigtramp
(struct frame_info *fi, CORE_ADDR *fsr);
#define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \
- hppa_hpux_frame_find_saved_regs_in_sigtramp (FRAME, FSR)
+ hppa32_hpux_frame_find_saved_regs_in_sigtramp (FRAME, FSR)
/* For HP-UX on PA-RISC we have an implementation
for the exception handling target op (in hppa-tdep.c) */
diff --git a/gdb/config/powerpc/tm-linux.h b/gdb/config/powerpc/tm-linux.h
index 34d95cadca4..e5383900ad6 100644
--- a/gdb/config/powerpc/tm-linux.h
+++ b/gdb/config/powerpc/tm-linux.h
@@ -44,10 +44,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
at_subroutine_call_instruction_target(prevpc,stoppc)
extern int at_subroutine_call_instruction_target();
-/* We _want_ the SVR4 section offset calculations (see syms_from_objfile()
- in symfile.c) */
-#undef IBM6000_TARGET
-
extern int ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name);
#undef IN_SIGTRAMP
#define IN_SIGTRAMP(pc,func_name) ppc_linux_in_sigtramp (pc,func_name)
diff --git a/gdb/config/powerpc/tm-nbsd.h b/gdb/config/powerpc/tm-nbsd.h
index 2b7acb8b4b8..d167830523c 100644
--- a/gdb/config/powerpc/tm-nbsd.h
+++ b/gdb/config/powerpc/tm-nbsd.h
@@ -1,5 +1,5 @@
/* Macro definitions for PowerPC running under NetBSD.
- Copyright 2000 Free Software Foundation, Inc.
+ Copyright 2000, 2003 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/config/rs6000/nm-rs6000.h b/gdb/config/rs6000/nm-rs6000.h
index 728497e7871..34bc0feebcd 100644
--- a/gdb/config/rs6000/nm-rs6000.h
+++ b/gdb/config/rs6000/nm-rs6000.h
@@ -64,3 +64,6 @@ extern char *xcoff_solib_address (CORE_ADDR);
#define KERNEL_U_SIZE kernel_u_size()
extern int kernel_u_size (void);
+
+/* Flag for machine-specific stuff in shared files. FIXME */
+#define DEPRECATED_IBM6000_TARGET
diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h
index c73658922bd..66b2f28d4e1 100644
--- a/gdb/config/rs6000/tm-rs6000.h
+++ b/gdb/config/rs6000/tm-rs6000.h
@@ -90,9 +90,6 @@ extern void aix_process_linenos (void);
extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
#define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev))
-/* Flag for machine-specific stuff in shared files. FIXME */
-#define IBM6000_TARGET
-
/* RS6000/AIX does not support PT_STEP. Has to be simulated. */
#define SOFTWARE_SINGLE_STEP_P() 1
diff --git a/gdb/config/s390/s390.mt b/gdb/config/s390/s390.mt
index 6b8d91fc83f..86b6a3371cc 100644
--- a/gdb/config/s390/s390.mt
+++ b/gdb/config/s390/s390.mt
@@ -3,4 +3,3 @@ TM_FILE= tm-linux.h
TDEPFILES=s390-tdep.o solib.o
# Post 5.0 tdep-files
TDEPFILES+=solib-svr4.o solib-legacy.o
-GDB_MULTI_ARCH=GDB_MULTI_ARCH_PARTIAL
diff --git a/gdb/config/s390/s390x.mt b/gdb/config/s390/s390x.mt
index 7b23cad60cb..d0c8262f72d 100644
--- a/gdb/config/s390/s390x.mt
+++ b/gdb/config/s390/s390x.mt
@@ -3,7 +3,6 @@ TM_FILE= tm-linux.h
TDEPFILES=s390-tdep.o solib.o
# Post 5.0 tdep-files
TDEPFILES+=solib-svr4.o solib-legacy.o
-GDB_MULTI_ARCH=GDB_MULTI_ARCH_PARTIAL
# needed for gdbserver.
MT_CFLAGS= -DCONFIG_ARCH_S390X
diff --git a/gdb/config/sh/embed.mt b/gdb/config/sh/embed.mt
index 0f37e43d915..4c821347188 100644
--- a/gdb/config/sh/embed.mt
+++ b/gdb/config/sh/embed.mt
@@ -1,5 +1,5 @@
# Target: Embedded Hitachi Super-H with ICE and simulator
-TDEPFILES= sh-tdep.o monitor.o sh3-rom.o remote-e7000.o ser-e7kpc.o dsrec.o
+TDEPFILES= sh-tdep.o sh64-tdep.o monitor.o sh3-rom.o remote-e7000.o ser-e7kpc.o dsrec.o
TM_FILE= tm-sh.h
SIM_OBS = remote-sim.o
diff --git a/gdb/config/sh/linux.mt b/gdb/config/sh/linux.mt
index 8f217cccb21..92ab4c4daf1 100644
--- a/gdb/config/sh/linux.mt
+++ b/gdb/config/sh/linux.mt
@@ -1,5 +1,5 @@
# Target: Hitachi Super-H running GNU/Linux
-TDEPFILES= sh-tdep.o monitor.o sh3-rom.o remote-e7000.o ser-e7kpc.o dsrec.o solib.o solib-svr4.o solib-legacy.o
+TDEPFILES= sh-tdep.o sh64-tdep.o monitor.o sh3-rom.o remote-e7000.o ser-e7kpc.o dsrec.o solib.o solib-svr4.o solib-legacy.o
TM_FILE= tm-linux.h
SIM_OBS = remote-sim.o
diff --git a/gdb/config/sh/nbsd.mt b/gdb/config/sh/nbsd.mt
index 62d0c5ce3e8..85d9bb04398 100644
--- a/gdb/config/sh/nbsd.mt
+++ b/gdb/config/sh/nbsd.mt
@@ -1,5 +1,5 @@
# Target: SuperH running NetBSD
-TDEPFILES= sh-tdep.o shnbsd-tdep.o corelow.o nbsd-tdep.o solib.o solib-svr4.o
+TDEPFILES= sh-tdep.o sh64-tdep.o shnbsd-tdep.o corelow.o nbsd-tdep.o solib.o solib-svr4.o
TM_FILE= tm-nbsd.h
SIM_OBS = remote-sim.o
diff --git a/gdb/config/sh/tm-sh.h b/gdb/config/sh/tm-sh.h
index dfd96c139dd..966c8cd95c6 100644
--- a/gdb/config/sh/tm-sh.h
+++ b/gdb/config/sh/tm-sh.h
@@ -25,8 +25,6 @@
#define NUM_REALREGS 59 /* used in remote-e7000.c which is not multiarched. */
-#define REGISTER_TYPE long /* used in standalone.c */
-
#define DEPRECATED_BIG_REMOTE_BREAKPOINT { 0xc3, 0x20 } /* Used in remote.c */
#define DEPRECATED_LITTLE_REMOTE_BREAKPOINT { 0x20, 0xc3 } /* Used in remote.c */
diff --git a/gdb/config/sh/wince.mt b/gdb/config/sh/wince.mt
index 237a0bc3428..342c2d6b4d2 100644
--- a/gdb/config/sh/wince.mt
+++ b/gdb/config/sh/wince.mt
@@ -1,5 +1,5 @@
# Target: Hitachi Super-H running on Windows CE
-TDEPFILES= sh-tdep.o wince.o
+TDEPFILES= sh-tdep.o sh64-tdep.o wince.o
TM_FILE= tm-wince.h
MT_CFLAGS=-DSHx -U_X86_ -U_M_IX86 -U__i386__ -U__i486__ -U__i586__ -U__i686__ -DUNICODE -D_WIN32_WCE -DWINCE_STUB='"${target_alias}-stub.exe"'
-WIN32LIBS=-lrapi
+TM_CLIBS=-lrapi
diff --git a/gdb/config/sparc/fbsd.mh b/gdb/config/sparc/fbsd.mh
index 33c6dc7d7a1..27942f86e6a 100644
--- a/gdb/config/sparc/fbsd.mh
+++ b/gdb/config/sparc/fbsd.mh
@@ -1,25 +1,5 @@
-# Host-dependent settings for FreeBSD/sparc64.
-# Copyright 2002 Free Software Foundation, Inc.
-# Contributed by David E. O'Brien <obrien@FreeBSD.org>.
-#
-# This file is part of GDB.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
# Host: FreeBSD/sparc64
-NATDEPFILES= sparc-nat.o \
+NATDEPFILES= sparc64fbsd-nat.o sparcbsd-nat.o \
corelow.o fork-child.o infptrace.o inftarg.o \
solib.o solib-svr4.o solib-legacy.o
NAT_FILE= nm-fbsd.h
diff --git a/gdb/config/sparc/fbsd.mt b/gdb/config/sparc/fbsd.mt
index 317c290f9c4..20c7f1ce27a 100644
--- a/gdb/config/sparc/fbsd.mt
+++ b/gdb/config/sparc/fbsd.mt
@@ -1,23 +1,3 @@
-# Target-dependent settings for FreeBSD/sparc64.
-# Copyright 2002 Free Software Foundation, Inc.
-# Contributed by David E. O'Brien <obrien@FreeBSD.org>.
-#
-# This file is part of GDB.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
# Target: FreeBSD/sparc64
-TDEPFILES= sparc-tdep.o solib.o solib-svr4.o solib-legacy.o
+TDEPFILES= sparc64-tdep.o sparc64fbsd-tdep.o
TM_FILE= tm-fbsd.h
diff --git a/gdb/config/sparc/nm-fbsd.h b/gdb/config/sparc/nm-fbsd.h
index 87b9622348c..917cc49bf07 100644
--- a/gdb/config/sparc/nm-fbsd.h
+++ b/gdb/config/sparc/nm-fbsd.h
@@ -1,6 +1,6 @@
/* Native-dependent definitions for FreeBSD/sparc64.
- Copyright 2002
- Free Software Foundation, Inc.
+
+ Copyright 2002, 2003 Free Software Foundation, Inc.
Contributed by David E. O'Brien <obrien@FreeBSD.org>.
This file is part of GDB.
@@ -34,34 +34,6 @@
/* Shared library support. */
-#define SVR4_SHARED_LIBS
-
-#include "solib.h" /* Support for shared libraries. */
-#include "elf/common.h" /* Additional ELF shared library info. */
-
-/* Make things match up with what is expected in sparc-nat.c. */
-
-#define PTRACE_GETREGS PT_GETREGS
-#define PTRACE_SETREGS PT_SETREGS
-#define PTRACE_GETFPREGS PT_GETFPREGS
-#define PTRACE_SETFPREGS PT_SETFPREGS
-
-#define GDB_GREGSET_T struct reg
-#define GDB_FPREGSET_T struct fpreg
-
-#define regs trapframe
-#define r_g1 tf_global[1]
-#define r_ps tf_tstate
-#define r_pc tf_tpc
-#define r_npc tf_tnpc
-#define r_y tf_y
-
-#define FPU_FSR_TYPE unsigned long
-#define fp_status fpreg /* our reg.h */
-#define fpu fpreg /* our reg.h */
-#define fpu_regs fr_regs /* one field of fpu_fr on Solaris */
-#define fpu_fr fr_regs /* a union w/in struct fpu on Solaris */
-#define fpu_fsr fr_fsr
-#define Fpu_fsr fr_fsr
+#include "solib.h"
-#endif /* NM_FBSD_H */
+#endif /* nm-fbsd.h */
diff --git a/gdb/config/sparc/sp64.mt b/gdb/config/sparc/sp64.mt
index 8bb1e07ed1c..943abfc240e 100644
--- a/gdb/config/sparc/sp64.mt
+++ b/gdb/config/sparc/sp64.mt
@@ -4,6 +4,3 @@
# Then again, having procfs.o in a target makefile fragment seems wrong.
TDEPFILES = sparc-tdep.o
TM_FILE= tm-sp64.h
-
-# Need gcc for long long support.
-CC = gcc
diff --git a/gdb/config/sparc/tm-fbsd.h b/gdb/config/sparc/tm-fbsd.h
index c84dfc4075b..f441937668a 100644
--- a/gdb/config/sparc/tm-fbsd.h
+++ b/gdb/config/sparc/tm-fbsd.h
@@ -1,5 +1,6 @@
/* Target-dependent definitions for FreeBSD/sparc64.
- Copyright 2002 Free Software Foundation, Inc.
+
+ Copyright 2002, 2003 Free Software Foundation, Inc.
Contributed by David E. O'Brien <obrien@FreeBSD.org>.
This file is part of GDB.
@@ -21,14 +22,6 @@
#ifndef TM_FBSD_H
#define TM_FBSD_H
-#define SVR4_SHARED_LIBS
-#include "solib.h" /* Support for shared libraries. */
-#include "sparc/tm-sp64.h"
-
-/* Number of traps that happen between exec'ing the shell to run an
- inferior, and when we finally get to the inferior code. The
- default is right for FreeBSD. */
-
-#undef START_INFERIOR_TRAPS_EXPECTED
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_TM
-#endif /* TM_FBSD_H */
+#endif /* tm-fbsd.h */
diff --git a/gdb/config/sparc/tm-linux.h b/gdb/config/sparc/tm-linux.h
index 31eeff9e206..63be2b885a5 100644
--- a/gdb/config/sparc/tm-linux.h
+++ b/gdb/config/sparc/tm-linux.h
@@ -23,8 +23,6 @@
#ifndef TM_SPARCLINUX_H
#define TM_SPARCLINUX_H
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
#include "sparc/tm-sparc.h"
#define SIGCONTEXT_PC_OFFSET 12
diff --git a/gdb/config/sparc/tm-nbsd.h b/gdb/config/sparc/tm-nbsd.h
index bd9845029b5..c82c3154088 100644
--- a/gdb/config/sparc/tm-nbsd.h
+++ b/gdb/config/sparc/tm-nbsd.h
@@ -21,8 +21,6 @@
#ifndef TM_NBSD_H
#define TM_NBSD_H
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
#include "sparc/tm-sparc.h"
#include "solib.h"
diff --git a/gdb/config/sparc/tm-sp64.h b/gdb/config/sparc/tm-sp64.h
index f2507d2bf75..960cc0b9d97 100644
--- a/gdb/config/sparc/tm-sp64.h
+++ b/gdb/config/sparc/tm-sp64.h
@@ -25,8 +25,6 @@
struct type;
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
#ifndef GDB_TARGET_IS_SPARC64
#define GDB_TARGET_IS_SPARC64 1
#endif
@@ -77,365 +75,6 @@ struct type;
nop
*/
-#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
-/*
- * The following defines must go away for MULTI_ARCH.
- */
-
-#ifndef DO_CALL_DUMMY_ON_STACK
-
-/*
- * These defines will suffice for the AT_ENTRY_POINT call dummy method.
- */
-
-#undef CALL_DUMMY
-#define CALL_DUMMY {0}
-#undef DEPRECATED_CALL_DUMMY_LENGTH
-#define DEPRECATED_CALL_DUMMY_LENGTH 0
-#undef CALL_DUMMY_CALL_OFFSET
-#define CALL_DUMMY_CALL_OFFSET 0
-#undef DEPRECATED_CALL_DUMMY_START_OFFSET
-#define DEPRECATED_CALL_DUMMY_START_OFFSET 0
-#undef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
-#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET 0
-#undef CALL_DUMMY_LOCATION
-#define CALL_DUMMY_LOCATION AT_ENTRY_POINT
-#undef DEPRECATED_PC_IN_CALL_DUMMY
-#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_at_entry_point (pc, sp, frame_address)
-#undef DEPRECATED_CALL_DUMMY_STACK_ADJUST
-#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 128
-#undef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
-#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS 0
-#undef CALL_DUMMY_ADDRESS
-#define CALL_DUMMY_ADDRESS() entry_point_address()
-#undef DEPRECATED_FIX_CALL_DUMMY
-#define DEPRECATED_FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P)
-#undef DEPRECATED_PUSH_RETURN_ADDRESS
-#define DEPRECATED_PUSH_RETURN_ADDRESS(PC, SP) sparc_at_entry_push_return_address (PC, SP)
-extern CORE_ADDR sparc_at_entry_push_return_address (CORE_ADDR pc,
- CORE_ADDR sp);
-
-#undef STORE_STRUCT_RETURN
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- sparc_at_entry_store_struct_return (ADDR, SP)
-extern void sparc_at_entry_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
-
-
-#else
-/*
- * Old call dummy method, with CALL_DUMMY on the stack.
- */
-
-#undef CALL_DUMMY
-#define CALL_DUMMY { 0x9de3bec0fd3fa7f7LL, 0xf93fa7eff53fa7e7LL,\
- 0xf13fa7dfed3fa7d7LL, 0xe93fa7cfe53fa7c7LL,\
- 0xe13fa7bfdd3fa7b7LL, 0xd93fa7afd53fa7a7LL,\
- 0xd13fa79fcd3fa797LL, 0xc93fa78fc53fa787LL,\
- 0xc13fa77fcc3fa777LL, 0xc83fa76fc43fa767LL,\
- 0xc03fa75ffc3fa757LL, 0xf83fa74ff43fa747LL,\
- 0xf03fa73f01000000LL, 0x0100000001000000LL,\
- 0x0100000091580000LL, 0xd027a72b93500000LL,\
- 0xd027a72791480000LL, 0xd027a72391400000LL,\
- 0xd027a71fda5ba8a7LL, 0xd85ba89fd65ba897LL,\
- 0xd45ba88fd25ba887LL, 0x9fc02000d05ba87fLL,\
- 0x0100000091d02001LL, 0x0100000001000000LL }
-
-
-/* 128 is to reserve space to write the %i/%l registers that will be restored
- when we resume. */
-#undef DEPRECATED_CALL_DUMMY_STACK_ADJUST
-#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 128
-
-/* Size of the call dummy in bytes. */
-#undef DEPRECATED_CALL_DUMMY_LENGTH
-#define DEPRECATED_CALL_DUMMY_LENGTH 192
-
-/* Offset within CALL_DUMMY of the 'call' instruction. */
-#undef DEPRECATED_CALL_DUMMY_START_OFFSET
-#define DEPRECATED_CALL_DUMMY_START_OFFSET 148
-
-/* Offset within CALL_DUMMY of the 'call' instruction. */
-#undef CALL_DUMMY_CALL_OFFSET
-#define CALL_DUMMY_CALL_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + (5 * 4))
-
-/* Offset within CALL_DUMMY of the 'ta 1' instruction. */
-#undef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
-#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + (8 * 4))
-
-/* Call dummy will be located on the stack. */
-#undef CALL_DUMMY_LOCATION
-#define CALL_DUMMY_LOCATION ON_STACK
-#undef DEPRECATED_PC_IN_CALL_DUMMY
-#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) deprecated_pc_in_call_dummy_on_stack (pc, sp, frame_address)
-
-/* Insert the function address into the call dummy. */
-#undef DEPRECATED_FIX_CALL_DUMMY
-#define DEPRECATED_FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
- sparc_fix_call_dummy (dummyname, pc, fun, type, gcc_p)
-void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
- struct type *value_type, int using_gcc);
-
-
-/* The remainder of these will accept the default definition. */
-#undef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
-#undef DEPRECATED_PUSH_RETURN_ADDRESS
-#undef CALL_DUMMY_ADDRESS
-#undef STORE_STRUCT_RETURN
-
-#endif
-
-/* Does the specified function use the "struct returning" convention
- or the "value returning" convention? The "value returning" convention
- almost invariably returns the entire value in registers. The
- "struct returning" convention often returns the entire value in
- memory, and passes a pointer (out of or into the function) saying
- where the value (is or should go).
-
- Since this sometimes depends on whether it was compiled with GCC,
- this is also an argument. This is used in call_function to build a
- stack, and in value_being_returned to print return values.
-
- On Sparc64, we only pass pointers to structs if they're larger than
- 32 bytes. Otherwise they're stored in %o0-%o3 (floating-point
- values go into %fp0-%fp3). */
-
-#undef USE_STRUCT_CONVENTION
-#define USE_STRUCT_CONVENTION(gcc_p, type) (TYPE_LENGTH (type) > 32)
-
-CORE_ADDR sparc64_push_arguments (int,
- struct value **, CORE_ADDR, int, CORE_ADDR);
-#undef DEPRECATED_PUSH_ARGUMENTS
-#define DEPRECATED_PUSH_ARGUMENTS(A,B,C,D,E) \
- (sparc64_push_arguments ((A), (B), (C), (D), (E)))
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function. */
-/* FIXME: V9 uses %o0 for this. */
-
-#undef STORE_STRUCT_RETURN
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { target_write_memory ((SP)+(16*8), (char *)&(ADDR), 8); }
-
-/* Stack must be aligned on 128-bit boundaries when synthesizing
- function calls. */
-
-#undef STACK_ALIGN
-#define STACK_ALIGN(ADDR) (((ADDR) + 15 ) & -16)
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-/* Some of these registers are only accessible from priviledged mode.
- They are here for kernel debuggers, etc. */
-/* FIXME: icc and xcc are currently considered separate registers.
- This may have to change and consider them as just one (ccr).
- Let's postpone this as long as we can. It's nice to be able to set
- them individually. */
-/* FIXME: fcc0-3 are currently separate, even though they are also part of
- fsr. May have to remove them but let's postpone this as long as
- possible. It's nice to be able to set them individually. */
-/* FIXME: Whether to include f33, f35, etc. here is not clear.
- There are advantages and disadvantages. */
-
-#undef REGISTER_NAMES
-#define REGISTER_NAMES \
-{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
- "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", \
- "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
- "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7", \
- \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
- "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46", \
- "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", \
- \
- "pc", "npc", "ccr", "fsr", "fprs", "y", "asi", \
- "ver", "tick", "pil", "pstate", \
- "tstate", "tba", "tl", "tt", "tpc", "tnpc", "wstate", \
- "cwp", "cansave", "canrestore", "cleanwin", "otherwin", \
- "asr16", "asr17", "asr18", "asr19", "asr20", "asr21", \
- "asr22", "asr23", "asr24", "asr25", "asr26", "asr27", \
- "asr28", "asr29", "asr30", "asr31", \
- /* These are here at the end to simplify removing them if we have to. */ \
- "icc", "xcc", "fcc0", "fcc1", "fcc2", "fcc3" \
-}
-extern const char *legacy_register_name (int i);
-#define REGISTER_NAME legacy_register_name
-
-#undef REG_STRUCT_HAS_ADDR
-#define REG_STRUCT_HAS_ADDR(gcc_p,type) (TYPE_LENGTH (type) > 32)
-
-extern CORE_ADDR sparc64_read_sp ();
-extern CORE_ADDR sparc64_read_fp ();
-extern void sparc64_write_sp (CORE_ADDR);
-
-#define TARGET_READ_SP() (sparc64_read_sp ())
-#define DEPRECATED_TARGET_READ_FP() (sparc64_read_fp ())
-#define DEPRECATED_DUMMY_WRITE_SP(X) (sparc64_write_sp (X))
-
-#undef DEPRECATED_EXTRACT_RETURN_VALUE
-#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
- sp64_extract_return_value(TYPE, REGBUF, VALBUF, 0)
-extern void sp64_extract_return_value (struct type *, char[], char *, int);
-
-/* Register numbers of various important registers.
- Note that some of these values are "real" register numbers,
- and correspond to the general registers of the machine,
- and some are "phony" register numbers which are too large
- to be actual register numbers as far as the user is concerned
- but do serve to get the desired values when passed to read_register. */
-
-#if 0 /* defined in tm-sparc.h, replicated
- for doc purposes */
-#define G0_REGNUM 0 /* %g0 */
-#define G1_REGNUM 1 /* %g1 */
-#define O0_REGNUM 8 /* %o0 */
-#define SP_REGNUM 14 /* Contains address of top of stack, \
- which is also the bottom of the frame. */
-#define RP_REGNUM 15 /* Contains return address value, *before* \
- any windows get switched. */
-#define O7_REGNUM 15 /* Last local reg not saved on stack frame */
-#define L0_REGNUM 16 /* First local reg that's saved on stack frame
- rather than in machine registers */
-#define I0_REGNUM 24 /* %i0 */
-#define DEPRECATED_FP_REGNUM 30 /* Contains address of executing stack frame */
-#define I7_REGNUM 31 /* Last local reg saved on stack frame */
-#define FP0_REGNUM 32 /* Floating point register 0 */
-#endif
-
-/*#define FP_MAX_REGNUM 80*/ /* 1 + last fp reg number */
-
-/* #undef v8 misc. regs */
-
-#undef Y_REGNUM
-#undef PS_REGNUM
-#undef WIM_REGNUM
-#undef TBR_REGNUM
-#undef PC_REGNUM
-#undef NPC_REGNUM
-#undef FPS_REGNUM
-#undef CPS_REGNUM
-
-/* v9 misc. and priv. regs */
-
-#define C0_REGNUM 80 /* Start of control registers */
-
-#define PC_REGNUM (C0_REGNUM + 0) /* Current PC */
-#define NPC_REGNUM (C0_REGNUM + 1) /* Next PC */
-#define CCR_REGNUM (C0_REGNUM + 2) /* Condition Code Register (%xcc,%icc) */
-#define FSR_REGNUM (C0_REGNUM + 3) /* Floating Point State */
-#define FPRS_REGNUM (C0_REGNUM + 4) /* Floating Point Registers State */
-#define Y_REGNUM (C0_REGNUM + 5) /* Temp register for multiplication, etc. */
-#define ASI_REGNUM (C0_REGNUM + 6) /* Alternate Space Identifier */
-#define VER_REGNUM (C0_REGNUM + 7) /* Version register */
-#define TICK_REGNUM (C0_REGNUM + 8) /* Tick register */
-#define PIL_REGNUM (C0_REGNUM + 9) /* Processor Interrupt Level */
-#define PSTATE_REGNUM (C0_REGNUM + 10) /* Processor State */
-#define TSTATE_REGNUM (C0_REGNUM + 11) /* Trap State */
-#define TBA_REGNUM (C0_REGNUM + 12) /* Trap Base Address */
-#define TL_REGNUM (C0_REGNUM + 13) /* Trap Level */
-#define TT_REGNUM (C0_REGNUM + 14) /* Trap Type */
-#define TPC_REGNUM (C0_REGNUM + 15) /* Trap pc */
-#define TNPC_REGNUM (C0_REGNUM + 16) /* Trap npc */
-#define WSTATE_REGNUM (C0_REGNUM + 17) /* Window State */
-#define CWP_REGNUM (C0_REGNUM + 18) /* Current Window Pointer */
-#define CANSAVE_REGNUM (C0_REGNUM + 19) /* Savable Windows */
-#define CANRESTORE_REGNUM (C0_REGNUM + 20) /* Restorable Windows */
-#define CLEANWIN_REGNUM (C0_REGNUM + 21) /* Clean Windows */
-#define OTHERWIN_REGNUM (C0_REGNUM + 22) /* Other Windows */
-#define ASR_REGNUM(n) (C0_REGNUM+(23-16)+(n)) /* Ancillary State Register
- (n = 16...31) */
-#define ICC_REGNUM (C0_REGNUM + 39) /* 32 bit condition codes */
-#define XCC_REGNUM (C0_REGNUM + 40) /* 64 bit condition codes */
-#define FCC0_REGNUM (C0_REGNUM + 41) /* fp cc reg 0 */
-#define FCC1_REGNUM (C0_REGNUM + 42) /* fp cc reg 1 */
-#define FCC2_REGNUM (C0_REGNUM + 43) /* fp cc reg 2 */
-#define FCC3_REGNUM (C0_REGNUM + 44) /* fp cc reg 3 */
-
-/* Number of machine registers. */
-
-#undef NUM_REGS
-#define NUM_REGS 125
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'.
- Some of the registers aren't 64 bits, but it's a lot simpler just to assume
- they all are (since most of them are). */
-#undef DEPRECATED_REGISTER_BYTES
-#define DEPRECATED_REGISTER_BYTES (32*8+32*8+45*8)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-#undef REGISTER_BYTE
-#define REGISTER_BYTE(N) \
- ((N) < 32 ? (N)*8 \
- : (N) < 64 ? 32*8 + ((N)-32)*4 \
- : (N) < C0_REGNUM ? 32*8 + 32*4 + ((N)-64)*8 \
- : 64*8 + ((N)-C0_REGNUM)*8)
-
-/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places; REGISTER_RAW_SIZE is the
- real way to know how big a register is. */
-
-#undef DEPRECATED_REGISTER_SIZE
-#define DEPRECATED_REGISTER_SIZE 8
-
-/* Number of bytes of storage in the actual machine representation
- for register N. */
-
-#undef REGISTER_RAW_SIZE
-#define REGISTER_RAW_SIZE(N) \
- ((N) < 32 ? 8 : (N) < 64 ? 4 : 8)
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-#undef REGISTER_VIRTUAL_SIZE
-#define REGISTER_VIRTUAL_SIZE(N) \
- ((N) < 32 ? 8 : (N) < 64 ? 4 : 8)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-/* tm-sparc.h defines this as 8, but play it safe. */
-
-#undef DEPRECATED_MAX_REGISTER_RAW_SIZE
-#define DEPRECATED_MAX_REGISTER_RAW_SIZE 8
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-/* tm-sparc.h defines this as 8, but play it safe. */
-
-#undef DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE
-#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#undef REGISTER_VIRTUAL_TYPE
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((N) < 32 ? builtin_type_long_long \
- : (N) < 64 ? builtin_type_float \
- : (N) < 80 ? builtin_type_double \
- : builtin_type_long_long)
-
-/* We use to support both 32 bit and 64 bit pointers.
- We can't anymore because TARGET_PTR_BIT must now be a constant. */
-#undef TARGET_PTR_BIT
-#define TARGET_PTR_BIT 64
-
-/* Longs are 64 bits. */
-#undef TARGET_LONG_BIT
-#define TARGET_LONG_BIT 64
-
-#undef TARGET_LONG_LONG_BIT
-#define TARGET_LONG_LONG_BIT 64
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#undef FRAME_ARGS_SKIP
-#define FRAME_ARGS_SKIP 136
-
-#endif /* GDB_MULTI_ARCH */
-
/* Offsets into jmp_buf.
FIXME: This was borrowed from the v8 stuff and will probably have to change
for v9. */
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index 29267ed665e..a18e20317d5 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -22,8 +22,6 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
#include "regcache.h"
struct type;
@@ -118,8 +116,6 @@ enum { /* Sparc64 control registers, excluding Y, PC, and NPC. */
* Make sparc target multi-archable: April 2000
*/
-#if defined (GDB_MULTI_ARCH) && (GDB_MULTI_ARCH > 0)
-
/* Multi-arch definition of TARGET_IS_SPARC64, TARGET_ELF64 */
#undef GDB_TARGET_IS_SPARC64
#define GDB_TARGET_IS_SPARC64 \
@@ -128,190 +124,7 @@ enum { /* Sparc64 control registers, excluding Y, PC, and NPC. */
#define TARGET_ELF64 \
(sparc_intreg_size () == 8)
extern int sparc_intreg_size (void);
-#else
-
-/* Non-multi-arch: if it isn't defined, define it to zero. */
-#ifndef GDB_TARGET_IS_SPARC64
-#define GDB_TARGET_IS_SPARC64 0
-#endif
-#ifndef TARGET_ELF64
-#define TARGET_ELF64 0
-#endif
-#endif
-
-#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
-/*
- * The following defines must go away for MULTI_ARCH
- */
-
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES \
-{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
- "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", \
- "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
- "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7", \
- \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
- \
- "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr" \
-}
-extern const char *legacy_register_name (int i);
-#define REGISTER_NAME legacy_register_name
-
-/* Offset from address of function to start of its code.
- Zero on most machines. */
-
-#define FUNCTION_START_OFFSET 0
-
-/* Amount PC must be decremented by after a breakpoint. This is often
- the number of bytes returned by BREAKPOINT_FROM_PC but not always. */
-
-#define DECR_PC_AFTER_BREAK 0
-
-/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places; REGISTER_RAW_SIZE is the
- real way to know how big a register is. */
-
-#define DEPRECATED_REGISTER_SIZE 4
-
-/* Number of machine registers */
-
-#define NUM_REGS 72
-
-#define SP_REGNUM 14 /* Contains address of top of stack, \
- which is also the bottom of the frame. */
-#define DEPRECATED_FP_REGNUM 30 /* Contains address of executing stack frame */
-
-#define FP0_REGNUM 32 /* Floating point register 0 */
-
-#define Y_REGNUM 64 /* Temp register for multiplication, etc. */
-
-#define PC_REGNUM 68 /* Contains program counter */
-
-#define NPC_REGNUM 69 /* Contains next PC */
-
-
-/* Total amount of space needed to store our copies of the machine's
- register state, the array `registers'. On the sparc, `registers'
- contains the ins and locals, even though they are saved on the
- stack rather than with the other registers, and this causes hair
- and confusion in places like pop_frame. It might be better to
- remove the ins and locals from `registers', make sure that
- frame_register() can get them from the stack (even in the innermost
- frame), and make this the way to access them. For the frame
- pointer we would do that via DEPRECATED_TARGET_READ_FP. On the
- other hand, that is likely to be confusing or worse for flat
- frames. */
-
-#define DEPRECATED_REGISTER_BYTES (32*4+32*4+8*4)
-
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-#define REGISTER_BYTE(N) ((N)*4)
-
-/* Number of bytes of storage in the actual machine representation for
- register N. */
-
-/* On the SPARC, all regs are 4 bytes (except Sparc64, where they're 8). */
-
-#define REGISTER_RAW_SIZE(N) (4)
-
-/* Number of bytes of storage in the program's representation
- for register N. */
-
-/* On the SPARC, all regs are 4 bytes (except Sparc64, where they're 8). */
-#define REGISTER_VIRTUAL_SIZE(N) (4)
-
-/* Largest value REGISTER_RAW_SIZE can have. */
-
-#define DEPRECATED_MAX_REGISTER_RAW_SIZE 8
-
-/* Largest value REGISTER_VIRTUAL_SIZE can have. */
-
-#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE 8
-
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- ((N) < 32 ? builtin_type_int : (N) < 64 ? builtin_type_float : \
- builtin_type_int)
-
-/* Sun /bin/cc gets this right as of SunOS 4.1.x. We need to define
- BELIEVE_PCC_PROMOTION to get this right now that the code which
- detects gcc2_compiled. is broken. This loses for SunOS 4.0.x and
- earlier. */
-
-#define BELIEVE_PCC_PROMOTION 1
-
-/* Advance PC across any function entry prologue instructions
- to reach some "real" code. */
-
-extern CORE_ADDR sparc_skip_prologue (CORE_ADDR);
-#define SKIP_PROLOGUE(PC) sparc_skip_prologue (PC)
-
-/* Immediately after a function call, return the saved pc.
- Can't go through the frames for this because on some machines
- the new frame is not set up until the new function executes
- some instructions. */
-
-#define DEPRECATED_SAVED_PC_AFTER_CALL(FRAME) PC_ADJUST (read_register (RP_REGNUM))
-
-/* Stack grows downward. */
-
-#define INNER_THAN(LHS,RHS) ((LHS) < (RHS))
-
-/* Write into appropriate registers a function return value of type
- TYPE, given in virtual format. */
-
-#define STORE_RETURN_VALUE(TYPE, REGCACHE, VALBUF) \
- sparc32_store_return_value (TYPE, REGCACHE, VALBUF)
-extern void sparc32_store_return_value (struct type *, struct regcache *,
- const void *);
-
-/* Extract from REGCACHE the address in which a function should return
- its structure value. */
-
-#define EXTRACT_STRUCT_VALUE_ADDRESS(REGCACHE) \
- sparc_extract_struct_value_address (REGCACHE)
-extern CORE_ADDR sparc_extract_struct_value_address (struct regcache *);
-
-/* Stack must be aligned on 64-bit boundaries when synthesizing
- function calls (128-bit for sparc64). */
-
-#define STACK_ALIGN(ADDR) sparc32_stack_align (ADDR)
-extern CORE_ADDR sparc32_stack_align (CORE_ADDR addr);
-
-/* The Sparc returns long doubles on the stack. */
-
-#define RETURN_VALUE_ON_STACK(TYPE) \
- (TYPE_CODE(TYPE) == TYPE_CODE_FLT \
- && TYPE_LENGTH(TYPE) > 8)
-
-/* When passing a structure to a function, Sun cc passes the address
- not the structure itself. It (under SunOS4) creates two symbols,
- which we need to combine to a LOC_REGPARM. Gcc version two (as of
- 1.92) behaves like sun cc. REG_STRUCT_HAS_ADDR is smart enough to
- distinguish between Sun cc, gcc version 1 and gcc version 2. */
-
-#define REG_STRUCT_HAS_ADDR(GCC_P, TYPE) \
- sparc_reg_struct_has_addr (GCC_P, TYPE)
-extern int sparc_reg_struct_has_addr (int, struct type *);
-
-/* Is the prologue at PC frameless? */
-#define PROLOGUE_FRAMELESS_P(PC) sparc_prologue_frameless_p (PC)
-extern int sparc_prologue_frameless_p (CORE_ADDR);
-
-#endif /* GDB_MULTI_ARCH */
-
-#if defined (GDB_MULTI_ARCH) && (GDB_MULTI_ARCH > 0)
/*
* The following defines should ONLY appear for MULTI_ARCH.
*/
@@ -319,8 +132,6 @@ extern int sparc_prologue_frameless_p (CORE_ADDR);
/* Multi-arch the nPC and Y registers. */
#define Y_REGNUM (sparc_y_regnum ())
-#endif /* GDB_MULTI_ARCH */
-
/* On the Sun 4 under SunOS, the compile will leave a fake insn which
encodes the structure size being returned. If we detect such
a fake insn, step past it. */
@@ -393,69 +204,6 @@ extern const unsigned char *sparc_breakpoint_from_pc (CORE_ADDR *pc, int *len);
#define CANNOT_STORE_REGISTER(regno) ((regno) == G0_REGNUM)
-/*
- * DEPRECATED_FRAME_CHAIN and FRAME_INFO definitions, collected here
- * for convenience. */
-
-#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
-/*
- * The following defines must go away for MULTI_ARCH.
- */
-
-/* Describe the pointer in each stack frame to the previous stack frame
- (its caller). */
-
-/* DEPRECATED_FRAME_CHAIN takes a frame's nominal address and produces
- the frame's chain-pointer. */
-
-/* We need to override DEPRECATED_GET_SAVED_REGISTER so that we can
- deal with the way outs change into ins in different frames. */
-
-void sparc_get_saved_register (char *raw_buffer,
- int *optimized,
- CORE_ADDR * addrp,
- struct frame_info *frame,
- int regnum, enum lval_type *lvalp);
-
-#define DEPRECATED_GET_SAVED_REGISTER(RAW_BUFFER, OPTIMIZED, ADDRP, FRAME, REGNUM, LVAL) \
- sparc_get_saved_register (RAW_BUFFER, OPTIMIZED, ADDRP, \
- FRAME, REGNUM, LVAL)
-
-#define DEPRECATED_FRAME_INIT_SAVED_REGS(FP) /*no-op */
-
-#define DEPRECATED_INIT_EXTRA_FRAME_INFO(FROMLEAF, FCI) \
- sparc_init_extra_frame_info (FROMLEAF, FCI)
-extern void sparc_init_extra_frame_info (int, struct frame_info *);
-
-#define DEPRECATED_FRAME_CHAIN(THISFRAME) (sparc_frame_chain (THISFRAME))
-extern CORE_ADDR sparc_frame_chain (struct frame_info *);
-
-/* A macro that tells us whether the function invocation represented
- by FI does not have a frame on the stack associated with it. If it
- does not, FRAMELESS is set to 1, else 0. */
-
-#define FRAMELESS_FUNCTION_INVOCATION(FI) \
- frameless_look_for_prologue (FI)
-
-/* Where is the PC for a specific frame */
-
-#define DEPRECATED_FRAME_SAVED_PC(FRAME) sparc_frame_saved_pc (FRAME)
-extern CORE_ADDR sparc_frame_saved_pc (struct frame_info *);
-
-/* If the argument is on the stack, it will be here. */
-#define DEPRECATED_FRAME_ARGS_ADDRESS(FI) (get_frame_base (FI))
-
-#define DEPRECATED_FRAME_LOCALS_ADDRESS(FI) (get_frame_base (FI))
-
-/* Set VAL to the number of args passed to frame described by FI.
- Can set VAL to -1, meaning no way to tell. */
-
-/* Return number of bytes at start of arglist that are not really args. */
-
-#define FRAME_ARGS_SKIP 68
-
-#endif /* GDB_MULTI_ARCH */
-
#define PRINT_EXTRA_FRAME_INFO(FI) \
sparc_print_extra_frame_info (FI)
extern void sparc_print_extra_frame_info (struct frame_info *);
@@ -573,106 +321,8 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
clobbering things (if NPC pointed to garbage instead).
*/
-#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
-/*
- * The following defines must go away for MULTI_ARCH.
- */
-
-#define CALL_DUMMY { 0xbc100001, 0x9de38000, 0xbc100002, 0xbe100003, \
- 0xda03a058, 0xd803a054, 0xd603a050, 0xd403a04c, \
- 0xd203a048, 0x40000000, 0xd003a044, 0x01000000, \
- 0x91d02001, 0x01000000 }
-
-
-/* Size of the call dummy in bytes. */
-
-#define DEPRECATED_CALL_DUMMY_LENGTH 0x38
-
-/* Offset within call dummy of first instruction to execute. */
-
-#define DEPRECATED_CALL_DUMMY_START_OFFSET 0
-
-/* Offset within CALL_DUMMY of the 'call' instruction. */
-
-#define CALL_DUMMY_CALL_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + 0x24)
-
-/* Offset within CALL_DUMMY of the 'ta 1' trap instruction. */
-
-#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (DEPRECATED_CALL_DUMMY_START_OFFSET + 0x30)
-
-#define DEPRECATED_CALL_DUMMY_STACK_ADJUST 68
-
-/* Call dummy method (eg. on stack, at entry point, etc.) */
-
-#define CALL_DUMMY_LOCATION ON_STACK
-
-/* Method for detecting dummy frames. */
-
-#define DEPRECATED_PC_IN_CALL_DUMMY(PC, SP, FRAME_ADDRESS) \
- deprecated_pc_in_call_dummy_on_stack (PC, SP, FRAME_ADDRESS)
-
-#endif /* GDB_MULTI_ARCH */
-
#endif /* CALL_DUMMY */
-#if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
-/*
- * The following defines must go away for MULTI_ARCH.
- */
-
-/* Insert the specified number of args and function address
- into a call sequence of the above form stored at DUMMYNAME. */
-
-#define DEPRECATED_FIX_CALL_DUMMY(DUMMYNAME, PC, FUN, NARGS, ARGS, TYPE, GCC_P) \
- sparc_fix_call_dummy (DUMMYNAME, PC, FUN, TYPE, GCC_P)
-void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
- struct type *value_type, int using_gcc);
-
-/* Arguments smaller than an int must be promoted to ints when
- synthesizing function calls. */
-
-/* Push an empty stack frame, to record the current PC, etc. */
-
-#define DEPRECATED_PUSH_DUMMY_FRAME sparc_push_dummy_frame ()
-#define DEPRECATED_POP_FRAME sparc_pop_frame ()
-
-void sparc_push_dummy_frame (void);
-void sparc_pop_frame (void);
-
-#define DEPRECATED_PUSH_ARGUMENTS(NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR) \
- sparc32_push_arguments (NARGS, ARGS, SP, STRUCT_RETURN, STRUCT_ADDR)
-
-extern CORE_ADDR sparc32_push_arguments (int, struct value **, CORE_ADDR, int,
- CORE_ADDR);
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function_by_hand.
- The ultimate mystery is, tho, what is the value "16"? */
-
-#define STORE_STRUCT_RETURN(ADDR, SP) \
- { char val[4]; \
- store_unsigned_integer (val, 4, (ADDR)); \
- write_memory ((SP)+(16*4), val, 4); }
-
-/* Default definition of USE_STRUCT_CONVENTION. */
-
-#ifndef USE_STRUCT_CONVENTION
-#define USE_STRUCT_CONVENTION(GCC_P, TYPE) \
- generic_use_struct_convention (GCC_P, TYPE)
-#endif
-
-/* Extract from an array REGBUF containing the (raw) register state a
- function return value of type TYPE, and copy that, in virtual
- format, into VALBUF. */
-
-#define EXTRACT_RETURN_VALUE(TYPE, REGCACHE, VALBUF) \
- sparc32_extract_return_value (TYPE, REGCACHE, VALBUF)
-extern void sparc32_extract_return_value (struct type *, struct regcache *,
- void *valbuf);
-
-#endif /* GDB_MULTI_ARCH */
-
-
/* Sparc has no reliable single step ptrace call */
#define SOFTWARE_SINGLE_STEP_P() 1
diff --git a/gdb/config/sparc/tm-sun4sol2.h b/gdb/config/sparc/tm-sun4sol2.h
index eb253b1c29f..506e9370de6 100644
--- a/gdb/config/sparc/tm-sun4sol2.h
+++ b/gdb/config/sparc/tm-sun4sol2.h
@@ -19,8 +19,6 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
#include "sparc/tm-sparc.h"
#include "config/tm-sysv4.h"
diff --git a/gdb/config/v850/v850.mt b/gdb/config/v850/v850.mt
index 867f8e68429..701a24098b0 100644
--- a/gdb/config/v850/v850.mt
+++ b/gdb/config/v850/v850.mt
@@ -1,5 +1,4 @@
# Target: NEC V850 processor
TDEPFILES= v850-tdep.o
-# TM_FILE= tm-v850.h
SIM_OBS = remote-sim.o
SIM = ../sim/v850/libsim.a
diff --git a/gdb/config/vax/tm-vax.h b/gdb/config/vax/tm-vax.h
index f1ed146fe8e..b5e1ac22a1d 100644
--- a/gdb/config/vax/tm-vax.h
+++ b/gdb/config/vax/tm-vax.h
@@ -22,6 +22,4 @@
#ifndef TM_VAX_H
#define TM_VAX_H
-#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
-
#endif /* TM_VAX_H */
diff --git a/gdb/configure b/gdb/configure
index e27294cf577..cb1d915f9f4 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -3710,17 +3710,81 @@ fi
fi
+# Some systems (e.g. Solaris) have `gethostbyname' in libnsl.
+
+echo $ac_n "checking for library containing gethostbyname""... $ac_c" 1>&6
+echo "configure:3717: checking for library containing gethostbyname" >&5
+if eval "test \"`echo '$''{'ac_cv_search_gethostbyname'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_gethostbyname="no"
+cat > conftest.$ac_ext <<EOF
+#line 3724 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname();
+
+int main() {
+gethostbyname()
+; return 0; }
+EOF
+if { (eval echo configure:3735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_search_gethostbyname="none required"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+test "$ac_cv_search_gethostbyname" = "no" && for i in nsl; do
+LIBS="-l$i $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3746 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname();
+
+int main() {
+gethostbyname()
+; return 0; }
+EOF
+if { (eval echo configure:3757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_search_gethostbyname="-l$i"
+break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+LIBS="$ac_func_search_save_LIBS"
+fi
+
+echo "$ac_t""$ac_cv_search_gethostbyname" 1>&6
+if test "$ac_cv_search_gethostbyname" != "no"; then
+ test "$ac_cv_search_gethostbyname" = "none required" || LIBS="$ac_cv_search_gethostbyname $LIBS"
+
+else :
+
+fi
+
# Some systems (e.g. Solaris) have `socketpair' in libsocket.
echo $ac_n "checking for library containing socketpair""... $ac_c" 1>&6
-echo "configure:3717: checking for library containing socketpair" >&5
+echo "configure:3781: checking for library containing socketpair" >&5
if eval "test \"`echo '$''{'ac_cv_search_socketpair'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_socketpair="no"
cat > conftest.$ac_ext <<EOF
-#line 3724 "configure"
+#line 3788 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3731,7 +3795,7 @@ int main() {
socketpair()
; return 0; }
EOF
-if { (eval echo configure:3735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_socketpair="none required"
else
@@ -3742,7 +3806,7 @@ rm -f conftest*
test "$ac_cv_search_socketpair" = "no" && for i in socket; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3746 "configure"
+#line 3810 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3753,7 +3817,7 @@ int main() {
socketpair()
; return 0; }
EOF
-if { (eval echo configure:3757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_socketpair="-l$i"
break
@@ -3789,14 +3853,14 @@ fi
if test "$need_curses" = yes; then
echo $ac_n "checking for library containing initscr""... $ac_c" 1>&6
-echo "configure:3793: checking for library containing initscr" >&5
+echo "configure:3857: checking for library containing initscr" >&5
if eval "test \"`echo '$''{'ac_cv_search_initscr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_initscr="no"
cat > conftest.$ac_ext <<EOF
-#line 3800 "configure"
+#line 3864 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3807,7 +3871,7 @@ int main() {
initscr()
; return 0; }
EOF
-if { (eval echo configure:3811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_initscr="none required"
else
@@ -3818,7 +3882,7 @@ rm -f conftest*
test "$ac_cv_search_initscr" = "no" && for i in ncurses Hcurses curses; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3822 "configure"
+#line 3886 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3829,7 +3893,7 @@ int main() {
initscr()
; return 0; }
EOF
-if { (eval echo configure:3833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_initscr="-l$i"
break
@@ -3866,14 +3930,14 @@ case $host_os in
# ??? Why?
echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6
-echo "configure:3870: checking for library containing tgetent" >&5
+echo "configure:3934: checking for library containing tgetent" >&5
if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_tgetent="no"
cat > conftest.$ac_ext <<EOF
-#line 3877 "configure"
+#line 3941 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3884,7 +3948,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:3888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_tgetent="none required"
else
@@ -3895,7 +3959,7 @@ rm -f conftest*
test "$ac_cv_search_tgetent" = "no" && for i in tinfo ncurses curses termcap; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3899 "configure"
+#line 3963 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3906,7 +3970,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:3910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_tgetent="-l$i"
break
@@ -3933,14 +3997,14 @@ esac
# Readline doesn't, so I think we're safe with leaving them out.
echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6
-echo "configure:3937: checking for library containing tgetent" >&5
+echo "configure:4001: checking for library containing tgetent" >&5
if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_tgetent="no"
cat > conftest.$ac_ext <<EOF
-#line 3944 "configure"
+#line 4008 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3951,7 +4015,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:3955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_tgetent="none required"
else
@@ -3962,7 +4026,7 @@ rm -f conftest*
test "$ac_cv_search_tgetent" = "no" && for i in termcap tinfo ncurses Hcurses curses; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3966 "configure"
+#line 4030 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3973,7 +4037,7 @@ int main() {
tgetent()
; return 0; }
EOF
-if { (eval echo configure:3977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_tgetent="-l$i"
break
@@ -4007,12 +4071,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:4011: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4075: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4016 "configure"
+#line 4080 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -4020,7 +4084,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:4024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -4045,7 +4109,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:4049: checking for opendir in -ldir" >&5
+echo "configure:4113: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4053,7 +4117,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4057 "configure"
+#line 4121 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4064,7 +4128,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4086,7 +4150,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4090: checking for opendir in -lx" >&5
+echo "configure:4154: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4094,7 +4158,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4098 "configure"
+#line 4162 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4105,7 +4169,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:4109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4128,12 +4192,12 @@ fi
fi
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:4132: checking whether stat file-mode macros are broken" >&5
+echo "configure:4196: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4137 "configure"
+#line 4201 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -4184,12 +4248,12 @@ EOF
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4188: checking for ANSI C header files" >&5
+echo "configure:4252: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4193 "configure"
+#line 4257 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -4197,7 +4261,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4214,7 +4278,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 4218 "configure"
+#line 4282 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -4232,7 +4296,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 4236 "configure"
+#line 4300 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -4253,7 +4317,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 4257 "configure"
+#line 4321 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -4264,7 +4328,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:4268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -4291,17 +4355,17 @@ for ac_hdr in link.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4295: checking for $ac_hdr" >&5
+echo "configure:4359: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4300 "configure"
+#line 4364 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4331,17 +4395,17 @@ for ac_hdr in nlist.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4335: checking for $ac_hdr" >&5
+echo "configure:4399: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4340 "configure"
+#line 4404 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4371,17 +4435,17 @@ for ac_hdr in poll.h sys/poll.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4375: checking for $ac_hdr" >&5
+echo "configure:4439: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4380 "configure"
+#line 4444 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4449: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4411,17 +4475,17 @@ for ac_hdr in proc_service.h thread_db.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4415: checking for $ac_hdr" >&5
+echo "configure:4479: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4420 "configure"
+#line 4484 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4489: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4451,17 +4515,17 @@ for ac_hdr in stddef.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4455: checking for $ac_hdr" >&5
+echo "configure:4519: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4460 "configure"
+#line 4524 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4491,17 +4555,17 @@ for ac_hdr in stdlib.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4495: checking for $ac_hdr" >&5
+echo "configure:4559: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4500 "configure"
+#line 4564 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4531,17 +4595,17 @@ for ac_hdr in stdint.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4535: checking for $ac_hdr" >&5
+echo "configure:4599: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4540 "configure"
+#line 4604 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4545: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4571,17 +4635,17 @@ for ac_hdr in string.h memory.h strings.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4575: checking for $ac_hdr" >&5
+echo "configure:4639: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4580 "configure"
+#line 4644 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4585: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4611,17 +4675,17 @@ for ac_hdr in sys/fault.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4615: checking for $ac_hdr" >&5
+echo "configure:4679: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4620 "configure"
+#line 4684 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4651,17 +4715,17 @@ for ac_hdr in sys/file.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4655: checking for $ac_hdr" >&5
+echo "configure:4719: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4660 "configure"
+#line 4724 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4691,17 +4755,17 @@ for ac_hdr in sys/filio.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4695: checking for $ac_hdr" >&5
+echo "configure:4759: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4700 "configure"
+#line 4764 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4731,17 +4795,17 @@ for ac_hdr in sys/ioctl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4735: checking for $ac_hdr" >&5
+echo "configure:4799: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4740 "configure"
+#line 4804 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4771,17 +4835,17 @@ for ac_hdr in sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4775: checking for $ac_hdr" >&5
+echo "configure:4839: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4780 "configure"
+#line 4844 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4849: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4811,17 +4875,17 @@ for ac_hdr in sys/proc.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4815: checking for $ac_hdr" >&5
+echo "configure:4879: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4820 "configure"
+#line 4884 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4851,17 +4915,17 @@ for ac_hdr in sys/procfs.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4855: checking for $ac_hdr" >&5
+echo "configure:4919: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4860 "configure"
+#line 4924 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4891,17 +4955,17 @@ for ac_hdr in sys/ptrace.h ptrace.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4895: checking for $ac_hdr" >&5
+echo "configure:4959: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4900 "configure"
+#line 4964 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4931,17 +4995,17 @@ for ac_hdr in sys/reg.h sys/debugreg.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4935: checking for $ac_hdr" >&5
+echo "configure:4999: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4940 "configure"
+#line 5004 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4971,17 +5035,17 @@ for ac_hdr in sys/select.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4975: checking for $ac_hdr" >&5
+echo "configure:5039: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4980 "configure"
+#line 5044 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5011,17 +5075,17 @@ for ac_hdr in sys/syscall.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5015: checking for $ac_hdr" >&5
+echo "configure:5079: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5020 "configure"
+#line 5084 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5051,17 +5115,17 @@ for ac_hdr in sys/user.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5055: checking for $ac_hdr" >&5
+echo "configure:5119: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5060 "configure"
+#line 5124 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5065: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5129: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5091,17 +5155,17 @@ for ac_hdr in sys/wait.h wait.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5095: checking for $ac_hdr" >&5
+echo "configure:5159: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5100 "configure"
+#line 5164 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5131,17 +5195,17 @@ for ac_hdr in termios.h termio.h sgtty.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5135: checking for $ac_hdr" >&5
+echo "configure:5199: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5140 "configure"
+#line 5204 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5171,17 +5235,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5175: checking for $ac_hdr" >&5
+echo "configure:5239: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5180 "configure"
+#line 5244 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5224,17 +5288,17 @@ for ac_hdr in curses.h ncurses.h term.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5228: checking for $ac_hdr" >&5
+echo "configure:5292: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5233 "configure"
+#line 5297 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5267,17 +5331,17 @@ for ac_hdr in ctype.h time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5271: checking for $ac_hdr" >&5
+echo "configure:5335: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5276 "configure"
+#line 5340 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5312,12 +5376,12 @@ for ac_func in getopt
do
ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
-echo "configure:5316: checking whether $ac_func is declared" >&5
+echo "configure:5380: checking whether $ac_func is declared" >&5
if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5321 "configure"
+#line 5385 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -5329,7 +5393,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:5333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -5366,12 +5430,12 @@ fi
# ------------------ #
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:5370: checking return type of signal handlers" >&5
+echo "configure:5434: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5375 "configure"
+#line 5439 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -5388,7 +5452,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:5392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -5412,12 +5476,12 @@ EOF
# ------------------------------------- #
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5416: checking for working const" >&5
+echo "configure:5480: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5421 "configure"
+#line 5485 "configure"
#include "confdefs.h"
int main() {
@@ -5466,7 +5530,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:5470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -5487,21 +5551,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:5491: checking for inline" >&5
+echo "configure:5555: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 5498 "configure"
+#line 5562 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:5505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -5534,19 +5598,19 @@ esac
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:5538: checking for working alloca.h" >&5
+echo "configure:5602: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5543 "configure"
+#line 5607 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:5550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -5567,12 +5631,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:5571: checking for alloca" >&5
+echo "configure:5635: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5576 "configure"
+#line 5640 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -5600,7 +5664,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:5604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -5632,12 +5696,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:5636: checking whether alloca needs Cray hooks" >&5
+echo "configure:5700: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5641 "configure"
+#line 5705 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -5662,12 +5726,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5666: checking for $ac_func" >&5
+echo "configure:5730: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5671 "configure"
+#line 5735 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5690,7 +5754,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5717,7 +5781,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:5721: checking stack direction for C alloca" >&5
+echo "configure:5785: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5725,7 +5789,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 5729 "configure"
+#line 5793 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -5744,7 +5808,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:5748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -5769,17 +5833,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5773: checking for $ac_hdr" >&5
+echo "configure:5837: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5778 "configure"
+#line 5842 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5783: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5808,12 +5872,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5812: checking for $ac_func" >&5
+echo "configure:5876: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5817 "configure"
+#line 5881 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5836,7 +5900,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5861,7 +5925,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:5865: checking for working mmap" >&5
+echo "configure:5929: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5869,7 +5933,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 5873 "configure"
+#line 5937 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6009,7 +6073,7 @@ main()
}
EOF
-if { (eval echo configure:6013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -6032,12 +6096,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:6036: checking for pid_t" >&5
+echo "configure:6100: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6041 "configure"
+#line 6105 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -6066,17 +6130,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:6070: checking for vfork.h" >&5
+echo "configure:6134: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6075 "configure"
+#line 6139 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -6101,18 +6165,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:6105: checking for working vfork" >&5
+echo "configure:6169: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:6111: checking for vfork" >&5
+echo "configure:6175: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6116 "configure"
+#line 6180 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -6135,7 +6199,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:6139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -6157,7 +6221,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 6161 "configure"
+#line 6225 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -6252,7 +6316,7 @@ main() {
}
}
EOF
-if { (eval echo configure:6256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -6277,12 +6341,12 @@ fi
for ac_func in canonicalize_file_name realpath
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6281: checking for $ac_func" >&5
+echo "configure:6345: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6286 "configure"
+#line 6350 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6305,7 +6369,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6332,12 +6396,12 @@ done
for ac_func in poll
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6336: checking for $ac_func" >&5
+echo "configure:6400: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6341 "configure"
+#line 6405 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6360,7 +6424,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6387,12 +6451,12 @@ done
for ac_func in pread64
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6391: checking for $ac_func" >&5
+echo "configure:6455: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6396 "configure"
+#line 6460 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6415,7 +6479,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6442,12 +6506,12 @@ done
for ac_func in sbrk
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6446: checking for $ac_func" >&5
+echo "configure:6510: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6451 "configure"
+#line 6515 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6470,7 +6534,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6497,12 +6561,12 @@ done
for ac_func in setpgid setpgrp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6501: checking for $ac_func" >&5
+echo "configure:6565: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6506 "configure"
+#line 6570 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6525,7 +6589,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6552,12 +6616,12 @@ done
for ac_func in sigaction sigprocmask sigsetmask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6556: checking for $ac_func" >&5
+echo "configure:6620: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6561 "configure"
+#line 6625 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6580,7 +6644,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6607,12 +6671,12 @@ done
for ac_func in socketpair
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6611: checking for $ac_func" >&5
+echo "configure:6675: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6616 "configure"
+#line 6680 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6635,7 +6699,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6662,12 +6726,12 @@ done
for ac_func in syscall
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6666: checking for $ac_func" >&5
+echo "configure:6730: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6671 "configure"
+#line 6735 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6690,7 +6754,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -6717,7 +6781,7 @@ done
if test "$cross_compiling" = no; then
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:6721: checking whether setpgrp takes no argument" >&5
+echo "configure:6785: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6725,7 +6789,7 @@ else
{ echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 6729 "configure"
+#line 6793 "configure"
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
@@ -6745,7 +6809,7 @@ main()
}
EOF
-if { (eval echo configure:6749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_setpgrp_void=no
else
@@ -6770,12 +6834,12 @@ fi
else
echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:6774: checking whether setpgrp takes no argument" >&5
+echo "configure:6838: checking whether setpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6779 "configure"
+#line 6843 "configure"
#include "confdefs.h"
#include <unistd.h>
@@ -6789,7 +6853,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:6793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_func_setpgrp_void=no
else
@@ -6813,12 +6877,12 @@ fi
# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
# since sigsetjmp might only be defined as a macro.
echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:6817: checking for sigsetjmp" >&5
+echo "configure:6881: checking for sigsetjmp" >&5
if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6822 "configure"
+#line 6886 "configure"
#include "confdefs.h"
#include <setjmp.h>
@@ -6827,7 +6891,7 @@ int main() {
sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
; return 0; }
EOF
-if { (eval echo configure:6831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_func_sigsetjmp=yes
else
@@ -6853,12 +6917,12 @@ gdb_use_included_regex=yes
# However, if the system regex is GNU regex, then default to *not*
# using the included regex.
echo $ac_n "checking for GNU regex""... $ac_c" 1>&6
-echo "configure:6857: checking for GNU regex" >&5
+echo "configure:6921: checking for GNU regex" >&5
if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6862 "configure"
+#line 6926 "configure"
#include "confdefs.h"
#include <gnu-versions.h>
int main() {
@@ -6868,7 +6932,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:6872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_gnu_regex=yes
else
@@ -6903,19 +6967,19 @@ fi
# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6
-echo "configure:6907: checking for r_fs in struct reg" >&5
+echo "configure:6971: checking for r_fs in struct reg" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6912 "configure"
+#line 6976 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_fs;
; return 0; }
EOF
-if { (eval echo configure:6919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg_r_fs=yes
else
@@ -6935,19 +6999,19 @@ EOF
fi
echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6
-echo "configure:6939: checking for r_gs in struct reg" >&5
+echo "configure:7003: checking for r_gs in struct reg" >&5
if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6944 "configure"
+#line 7008 "configure"
#include "confdefs.h"
#include <machine/reg.h>
int main() {
struct reg r; r.r_gs;
; return 0; }
EOF
-if { (eval echo configure:6951: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_struct_reg_r_gs=yes
else
@@ -6969,19 +7033,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
-echo "configure:6973: checking for PTRACE_GETREGS" >&5
+echo "configure:7037: checking for PTRACE_GETREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6978 "configure"
+#line 7042 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETREGS;
; return 0; }
EOF
-if { (eval echo configure:6985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_ptrace_getregs=yes
else
@@ -7003,19 +7067,19 @@ fi
# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
-echo "configure:7007: checking for PTRACE_GETFPXREGS" >&5
+echo "configure:7071: checking for PTRACE_GETFPXREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7012 "configure"
+#line 7076 "configure"
#include "confdefs.h"
#include <sys/ptrace.h>
int main() {
PTRACE_GETFPXREGS;
; return 0; }
EOF
-if { (eval echo configure:7019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_ptrace_getfpxregs=yes
else
@@ -7037,12 +7101,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6
-echo "configure:7041: checking for PT_GETDBREGS" >&5
+echo "configure:7105: checking for PT_GETDBREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7046 "configure"
+#line 7110 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -7050,7 +7114,7 @@ int main() {
PT_GETDBREGS;
; return 0; }
EOF
-if { (eval echo configure:7054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_pt_getdbregs=yes
else
@@ -7072,12 +7136,12 @@ fi
# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6
-echo "configure:7076: checking for PT_GETXMMREGS" >&5
+echo "configure:7140: checking for PT_GETXMMREGS" >&5
if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7081 "configure"
+#line 7145 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -7085,7 +7149,7 @@ int main() {
PT_GETXMMREGS;
; return 0; }
EOF
-if { (eval echo configure:7089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_pt_getxmmregs=yes
else
@@ -7108,19 +7172,19 @@ fi
# See if stdint.h provides the uintptr_t type.
# Autoconf 2.5X has an improved AC_CHECK_TYPE which will simplify this.
echo $ac_n "checking for uintptr_t in stdint.h""... $ac_c" 1>&6
-echo "configure:7112: checking for uintptr_t in stdint.h" >&5
+echo "configure:7176: checking for uintptr_t in stdint.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_uintptr_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7117 "configure"
+#line 7181 "configure"
#include "confdefs.h"
#include <stdint.h>
int main() {
uintptr_t foo = 0;
; return 0; }
EOF
-if { (eval echo configure:7124: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_uintptr_t=yes
else
@@ -7133,7 +7197,6 @@ rm -f conftest*
fi
echo "$ac_t""$gdb_cv_have_uintptr_t" 1>&6
-echo "$ac_t""$gdb_cv_have_uintptr_t" 1>&6
if test $gdb_cv_have_uintptr_t = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_UINTPTR_T 1
@@ -7142,12 +7205,12 @@ EOF
fi
echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:7146: checking whether malloc must be declared" >&5
+echo "configure:7209: checking whether malloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7151 "configure"
+#line 7214 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7168,7 +7231,7 @@ int main() {
char *(*pfn) = (char *(*)) malloc
; return 0; }
EOF
-if { (eval echo configure:7172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_malloc=no
else
@@ -7189,12 +7252,12 @@ EOF
fi
echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:7193: checking whether realloc must be declared" >&5
+echo "configure:7256: checking whether realloc must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7198 "configure"
+#line 7261 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7215,7 +7278,7 @@ int main() {
char *(*pfn) = (char *(*)) realloc
; return 0; }
EOF
-if { (eval echo configure:7219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_realloc=no
else
@@ -7236,12 +7299,12 @@ EOF
fi
echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:7240: checking whether free must be declared" >&5
+echo "configure:7303: checking whether free must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7245 "configure"
+#line 7308 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7262,7 +7325,7 @@ int main() {
char *(*pfn) = (char *(*)) free
; return 0; }
EOF
-if { (eval echo configure:7266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_free=no
else
@@ -7283,12 +7346,12 @@ EOF
fi
echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
-echo "configure:7287: checking whether strerror must be declared" >&5
+echo "configure:7350: checking whether strerror must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7292 "configure"
+#line 7355 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7309,7 +7372,7 @@ int main() {
char *(*pfn) = (char *(*)) strerror
; return 0; }
EOF
-if { (eval echo configure:7313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strerror=no
else
@@ -7330,12 +7393,12 @@ EOF
fi
echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
-echo "configure:7334: checking whether strdup must be declared" >&5
+echo "configure:7397: checking whether strdup must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7339 "configure"
+#line 7402 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7356,7 +7419,7 @@ int main() {
char *(*pfn) = (char *(*)) strdup
; return 0; }
EOF
-if { (eval echo configure:7360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strdup=no
else
@@ -7377,12 +7440,12 @@ EOF
fi
echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:7381: checking whether strstr must be declared" >&5
+echo "configure:7444: checking whether strstr must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7386 "configure"
+#line 7449 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7403,7 +7466,7 @@ int main() {
char *(*pfn) = (char *(*)) strstr
; return 0; }
EOF
-if { (eval echo configure:7407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_strstr=no
else
@@ -7424,12 +7487,12 @@ EOF
fi
echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
-echo "configure:7428: checking whether canonicalize_file_name must be declared" >&5
+echo "configure:7491: checking whether canonicalize_file_name must be declared" >&5
if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7433 "configure"
+#line 7496 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7450,7 +7513,7 @@ int main() {
char *(*pfn) = (char *(*)) canonicalize_file_name
; return 0; }
EOF
-if { (eval echo configure:7454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7517: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_decl_needed_canonicalize_file_name=no
else
@@ -7476,9 +7539,9 @@ fi
# could be expunged. --jsm 1999-03-22
echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6
-echo "configure:7480: checking for HPUX save_state structure" >&5
+echo "configure:7543: checking for HPUX save_state structure" >&5
cat > conftest.$ac_ext <<EOF
-#line 7482 "configure"
+#line 7545 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -7493,7 +7556,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 7497 "configure"
+#line 7560 "configure"
#include "confdefs.h"
#include <machine/save_state.h>
EOF
@@ -7563,12 +7626,12 @@ fi
if test "$ac_cv_header_sys_procfs_h" = yes; then
echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7567: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:7630: checking for pstatus_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7572 "configure"
+#line 7635 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7577,7 +7640,7 @@ int main() {
pstatus_t avar
; return 0; }
EOF
-if { (eval echo configure:7581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pstatus_t=yes
else
@@ -7599,12 +7662,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7603: checking for prrun_t in sys/procfs.h" >&5
+echo "configure:7666: checking for prrun_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7608 "configure"
+#line 7671 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7613,7 +7676,7 @@ int main() {
prrun_t avar
; return 0; }
EOF
-if { (eval echo configure:7617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prrun_t=yes
else
@@ -7635,12 +7698,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6
echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7639: checking for gregset_t in sys/procfs.h" >&5
+echo "configure:7702: checking for gregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7644 "configure"
+#line 7707 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7649,7 +7712,7 @@ int main() {
gregset_t avar
; return 0; }
EOF
-if { (eval echo configure:7653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_gregset_t=yes
else
@@ -7671,12 +7734,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6
echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7675: checking for fpregset_t in sys/procfs.h" >&5
+echo "configure:7738: checking for fpregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7680 "configure"
+#line 7743 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7685,7 +7748,7 @@ int main() {
fpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:7689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_fpregset_t=yes
else
@@ -7707,12 +7770,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6
echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7711: checking for prgregset_t in sys/procfs.h" >&5
+echo "configure:7774: checking for prgregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7716 "configure"
+#line 7779 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7721,7 +7784,7 @@ int main() {
prgregset_t avar
; return 0; }
EOF
-if { (eval echo configure:7725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prgregset_t=yes
else
@@ -7743,12 +7806,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6
echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7747: checking for prfpregset_t in sys/procfs.h" >&5
+echo "configure:7810: checking for prfpregset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7752 "configure"
+#line 7815 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7757,7 +7820,7 @@ int main() {
prfpregset_t avar
; return 0; }
EOF
-if { (eval echo configure:7761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prfpregset_t=yes
else
@@ -7779,12 +7842,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6
echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7783: checking for prgregset32_t in sys/procfs.h" >&5
+echo "configure:7846: checking for prgregset32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7788 "configure"
+#line 7851 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7793,7 +7856,7 @@ int main() {
prgregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:7797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prgregset32_t=yes
else
@@ -7815,12 +7878,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6
echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7819: checking for prfpregset32_t in sys/procfs.h" >&5
+echo "configure:7882: checking for prfpregset32_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7824 "configure"
+#line 7887 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7829,7 +7892,7 @@ int main() {
prfpregset32_t avar
; return 0; }
EOF
-if { (eval echo configure:7833: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prfpregset32_t=yes
else
@@ -7851,12 +7914,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6
echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7855: checking for lwpid_t in sys/procfs.h" >&5
+echo "configure:7918: checking for lwpid_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7860 "configure"
+#line 7923 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7865,7 +7928,7 @@ int main() {
lwpid_t avar
; return 0; }
EOF
-if { (eval echo configure:7869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_lwpid_t=yes
else
@@ -7887,12 +7950,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6
echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7891: checking for psaddr_t in sys/procfs.h" >&5
+echo "configure:7954: checking for psaddr_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7896 "configure"
+#line 7959 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7901,7 +7964,7 @@ int main() {
psaddr_t avar
; return 0; }
EOF
-if { (eval echo configure:7905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_psaddr_t=yes
else
@@ -7923,12 +7986,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6
echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7927: checking for prsysent_t in sys/procfs.h" >&5
+echo "configure:7990: checking for prsysent_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7932 "configure"
+#line 7995 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7937,7 +8000,7 @@ int main() {
prsysent_t avar
; return 0; }
EOF
-if { (eval echo configure:7941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_prsysent_t=yes
else
@@ -7959,12 +8022,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6
echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7963: checking for pr_sigset_t in sys/procfs.h" >&5
+echo "configure:8026: checking for pr_sigset_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7968 "configure"
+#line 8031 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -7973,7 +8036,7 @@ int main() {
pr_sigset_t avar
; return 0; }
EOF
-if { (eval echo configure:7977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_sigset_t=yes
else
@@ -7995,12 +8058,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6
echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7999: checking for pr_sigaction64_t in sys/procfs.h" >&5
+echo "configure:8062: checking for pr_sigaction64_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8004 "configure"
+#line 8067 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8009,7 +8072,7 @@ int main() {
pr_sigaction64_t avar
; return 0; }
EOF
-if { (eval echo configure:8013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes
else
@@ -8031,12 +8094,12 @@ EOF
echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6
echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8035: checking for pr_siginfo64_t in sys/procfs.h" >&5
+echo "configure:8098: checking for pr_siginfo64_t in sys/procfs.h" >&5
if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8040 "configure"
+#line 8103 "configure"
#include "confdefs.h"
#define _SYSCALL32
@@ -8045,7 +8108,7 @@ int main() {
pr_siginfo64_t avar
; return 0; }
EOF
-if { (eval echo configure:8049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes
else
@@ -8072,7 +8135,7 @@ EOF
if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6
-echo "configure:8076: checking whether prfpregset_t type is broken" >&5
+echo "configure:8139: checking whether prfpregset_t type is broken" >&5
if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8080,7 +8143,7 @@ else
gdb_cv_prfpregset_t_broken=yes
else
cat > conftest.$ac_ext <<EOF
-#line 8084 "configure"
+#line 8147 "configure"
#include "confdefs.h"
#include <sys/procfs.h>
int main ()
@@ -8090,7 +8153,7 @@ else
return 0;
}
EOF
-if { (eval echo configure:8094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_prfpregset_t_broken=no
else
@@ -8115,12 +8178,12 @@ EOF
echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8119: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
+echo "configure:8182: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8124 "configure"
+#line 8187 "configure"
#include "confdefs.h"
#include <unistd.h>
#include <sys/types.h>
@@ -8133,7 +8196,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:8137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_procfs_piocset=yes
else
@@ -8157,19 +8220,19 @@ fi
if test ${host} = ${target} ; then
echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:8161: checking for member l_addr in struct link_map" >&5
+echo "configure:8224: checking for member l_addr in struct link_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8166 "configure"
+#line 8229 "configure"
#include "confdefs.h"
#include <link.h>
int main() {
struct link_map lm; (void) lm.l_addr;
; return 0; }
EOF
-if { (eval echo configure:8173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map_with_l_members=yes
else
@@ -8191,12 +8254,12 @@ EOF
echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:8195: checking for member lm_addr in struct link_map" >&5
+echo "configure:8258: checking for member lm_addr in struct link_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8200 "configure"
+#line 8263 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <link.h>
@@ -8204,7 +8267,7 @@ int main() {
struct link_map lm; (void) lm.lm_addr;
; return 0; }
EOF
-if { (eval echo configure:8208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map_with_lm_members=yes
else
@@ -8226,12 +8289,12 @@ EOF
echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6
-echo "configure:8230: checking for member som_addr in struct so_map" >&5
+echo "configure:8293: checking for member som_addr in struct so_map" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8235 "configure"
+#line 8298 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_NLIST_H
@@ -8242,7 +8305,7 @@ int main() {
struct so_map lm; (void) lm.som_addr;
; return 0; }
EOF
-if { (eval echo configure:8246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_so_map_with_som_members=yes
else
@@ -8264,12 +8327,12 @@ EOF
echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6
-echo "configure:8268: checking for struct link_map32 in sys/link.h" >&5
+echo "configure:8331: checking for struct link_map32 in sys/link.h" >&5
if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8273 "configure"
+#line 8336 "configure"
#include "confdefs.h"
#define _SYSCALL32
#include <sys/link.h>
@@ -8277,7 +8340,7 @@ int main() {
struct link_map32 l;
; return 0; }
EOF
-if { (eval echo configure:8281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_struct_link_map32=yes
else
@@ -8304,12 +8367,12 @@ fi
echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
-echo "configure:8308: checking for long long support in compiler" >&5
+echo "configure:8371: checking for long long support in compiler" >&5
if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8313 "configure"
+#line 8376 "configure"
#include "confdefs.h"
int main() {
@@ -8319,7 +8382,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:8323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_c_long_long=yes
else
@@ -8341,7 +8404,7 @@ fi
echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
-echo "configure:8345: checking for long long support in printf" >&5
+echo "configure:8408: checking for long long support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8349,7 +8412,7 @@ else
gdb_cv_printf_has_long_long=no
else
cat > conftest.$ac_ext <<EOF
-#line 8353 "configure"
+#line 8416 "configure"
#include "confdefs.h"
int main () {
@@ -8363,7 +8426,7 @@ int main () {
return (strcmp ("0x0123456789abcdef", buf));
}
EOF
-if { (eval echo configure:8367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_long=yes
else
@@ -8387,19 +8450,19 @@ echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6
echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6
-echo "configure:8391: checking for long double support in compiler" >&5
+echo "configure:8454: checking for long double support in compiler" >&5
if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8396 "configure"
+#line 8459 "configure"
#include "confdefs.h"
int main() {
long double foo;
; return 0; }
EOF
-if { (eval echo configure:8403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_long_double=yes
else
@@ -8421,7 +8484,7 @@ fi
echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
-echo "configure:8425: checking for long double support in printf" >&5
+echo "configure:8488: checking for long double support in printf" >&5
if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8429,7 +8492,7 @@ else
gdb_cv_printf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 8433 "configure"
+#line 8496 "configure"
#include "confdefs.h"
int main () {
@@ -8439,7 +8502,7 @@ int main () {
return (strncmp ("3.14159", buf, 7));
}
EOF
-if { (eval echo configure:8443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_printf_has_long_double=yes
else
@@ -8463,7 +8526,7 @@ echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6
echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6
-echo "configure:8467: checking for long double support in scanf" >&5
+echo "configure:8530: checking for long double support in scanf" >&5
if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8471,7 +8534,7 @@ else
gdb_cv_scanf_has_long_double=no
else
cat > conftest.$ac_ext <<EOF
-#line 8475 "configure"
+#line 8538 "configure"
#include "confdefs.h"
int main () {
@@ -8481,7 +8544,7 @@ int main () {
return !(f > 3.14159 && f < 3.14160);
}
EOF
-if { (eval echo configure:8485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gdb_cv_scanf_has_long_double=yes
else
@@ -8506,7 +8569,7 @@ echo "$ac_t""$gdb_cv_scanf_has_long_double" 1>&6
case ${host_os} in
aix*)
echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6
-echo "configure:8510: checking for -bbigtoc option" >&5
+echo "configure:8573: checking for -bbigtoc option" >&5
if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -8520,14 +8583,14 @@ else
LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
cat > conftest.$ac_ext <<EOF
-#line 8524 "configure"
+#line 8587 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:8531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
:
else
echo "configure: failed program was:" >&5
@@ -8550,7 +8613,7 @@ if test ${build} = ${host} -a ${host} = ${target} ; then
case ${host_os} in
hpux*)
echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6
-echo "configure:8554: checking for HPUX/OSF thread support" >&5
+echo "configure:8617: checking for HPUX/OSF thread support" >&5
if test -f /usr/include/dce/cma_config.h ; then
if test "$GCC" = "yes" ; then
echo "$ac_t""yes" 1>&6
@@ -8573,7 +8636,7 @@ EOF
# because version 0 (present on Solaris 2.4 or earlier) doesn't have
# the same API.
echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
-echo "configure:8577: checking for Solaris thread debugging library" >&5
+echo "configure:8640: checking for Solaris thread debugging library" >&5
if test -f /usr/lib/libthread_db.so.1 ; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
@@ -8583,7 +8646,7 @@ EOF
CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o"
CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:8587: checking for dlopen in -ldl" >&5
+echo "configure:8650: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -8591,7 +8654,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 8595 "configure"
+#line 8658 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -8602,7 +8665,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:8606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -8634,17 +8697,17 @@ fi
# all symbols visible in the dynamic symbol table.
hold_ldflags=$LDFLAGS
echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
-echo "configure:8638: checking for the ld -export-dynamic flag" >&5
+echo "configure:8701: checking for the ld -export-dynamic flag" >&5
LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
cat > conftest.$ac_ext <<EOF
-#line 8641 "configure"
+#line 8704 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:8648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
found=yes
else
@@ -8663,13 +8726,13 @@ rm -f conftest*
# Sun randomly tweaked the prototypes in <proc_service.h>
# at one point.
echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6
-echo "configure:8667: checking if <proc_service.h> is old" >&5
+echo "configure:8730: checking if <proc_service.h> is old" >&5
if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8673 "configure"
+#line 8736 "configure"
#include "confdefs.h"
#include <proc_service.h>
@@ -8680,7 +8743,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:8684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_proc_service_is_old=no
else
@@ -8706,12 +8769,12 @@ EOF
;;
aix*)
echo $ac_n "checking for AiX thread debugging library""... $ac_c" 1>&6
-echo "configure:8710: checking for AiX thread debugging library" >&5
+echo "configure:8773: checking for AiX thread debugging library" >&5
if eval "test \"`echo '$''{'gdb_cv_have_aix_thread_debug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8715 "configure"
+#line 8778 "configure"
#include "confdefs.h"
#include <sys/pthdebug.h>
int main() {
@@ -8720,7 +8783,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:8724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_have_aix_thread_debug=yes
else
@@ -8745,19 +8808,19 @@ fi
if test "x$ac_cv_header_thread_db_h" = "xyes"; then
echo $ac_n "checking whether <thread_db.h> has TD_NOTALLOC""... $ac_c" 1>&6
-echo "configure:8749: checking whether <thread_db.h> has TD_NOTALLOC" >&5
+echo "configure:8812: checking whether <thread_db.h> has TD_NOTALLOC" >&5
if eval "test \"`echo '$''{'gdb_cv_thread_db_h_has_td_notalloc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8754 "configure"
+#line 8817 "configure"
#include "confdefs.h"
#include <thread_db.h>
int main() {
int i = TD_NOTALLOC;
; return 0; }
EOF
-if { (eval echo configure:8761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_thread_db_h_has_td_notalloc=yes
else
@@ -8782,19 +8845,19 @@ fi
if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then
echo $ac_n "checking whether <sys/syscall.h> has __NR_tkill""... $ac_c" 1>&6
-echo "configure:8786: checking whether <sys/syscall.h> has __NR_tkill" >&5
+echo "configure:8849: checking whether <sys/syscall.h> has __NR_tkill" >&5
if eval "test \"`echo '$''{'gdb_cv_sys_syscall_h_has_tkill'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8791 "configure"
+#line 8854 "configure"
#include "confdefs.h"
#include <sys/syscall.h>
int main() {
int i = __NR_tkill;
; return 0; }
EOF
-if { (eval echo configure:8798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gdb_cv_sys_syscall_h_has_tkill=yes
else
@@ -8905,7 +8968,7 @@ WERROR_CFLAGS=""
if test "x${build_warnings}" != x -a "x$GCC" = xyes
then
echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6
-echo "configure:8909: checking compiler warning flags" >&5
+echo "configure:8972: checking compiler warning flags" >&5
# Separate out the -Werror flag as some files just cannot be
# compiled with it enabled.
for w in ${build_warnings}; do
@@ -8915,14 +8978,14 @@ echo "configure:8909: checking compiler warning flags" >&5
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $w"
cat > conftest.$ac_ext <<EOF
-#line 8919 "configure"
+#line 8982 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:8926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
WARN_CFLAGS="${WARN_CFLAGS} $w"
else
@@ -8970,12 +9033,12 @@ fi
# In the Cygwin environment, we need some additional flags.
echo $ac_n "checking for cygwin""... $ac_c" 1>&6
-echo "configure:8974: checking for cygwin" >&5
+echo "configure:9037: checking for cygwin" >&5
if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 8979 "configure"
+#line 9042 "configure"
#include "confdefs.h"
#if defined (__CYGWIN__) || defined (__CYGWIN32__)
@@ -9053,7 +9116,7 @@ if test "${with_tclconfig+set}" = set; then
fi
echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:9057: checking for Tcl configuration" >&5
+echo "configure:9120: checking for Tcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -9162,7 +9225,7 @@ if test "${with_tkconfig+set}" = set; then
fi
echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
-echo "configure:9166: checking for Tk configuration" >&5
+echo "configure:9229: checking for Tk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -9271,7 +9334,7 @@ fi
no_tcl=true
echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
-echo "configure:9275: checking for Tcl private headers. dir=${configdir}" >&5
+echo "configure:9338: checking for Tcl private headers. dir=${configdir}" >&5
# Check whether --with-tclinclude or --without-tclinclude was given.
if test "${with_tclinclude+set}" = set; then
withval="$with_tclinclude"
@@ -9337,17 +9400,17 @@ fi
if test x"${ac_cv_c_tclh}" = x ; then
ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
-echo "configure:9341: checking for tclInt.h" >&5
+echo "configure:9404: checking for tclInt.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9346 "configure"
+#line 9409 "configure"
#include "confdefs.h"
#include <tclInt.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -9407,7 +9470,7 @@ fi
#
no_tk=true
echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
-echo "configure:9411: checking for Tk private headers" >&5
+echo "configure:9474: checking for Tk private headers" >&5
# Check whether --with-tkinclude or --without-tkinclude was given.
if test "${with_tkinclude+set}" = set; then
withval="$with_tkinclude"
@@ -9473,17 +9536,17 @@ fi
if test x"${ac_cv_c_tkh}" = x ; then
ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tk.h""... $ac_c" 1>&6
-echo "configure:9477: checking for tk.h" >&5
+echo "configure:9540: checking for tk.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 9482 "configure"
+#line 9545 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -9529,7 +9592,7 @@ fi
echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:9533: checking for Itcl private headers. srcdir=${srcdir}" >&5
+echo "configure:9596: checking for Itcl private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itclh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
if test -f $i/generic/itcl.h ; then
@@ -9552,7 +9615,7 @@ fi
echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:9556: checking for Itk private headers. srcdir=${srcdir}" >&5
+echo "configure:9619: checking for Itk private headers. srcdir=${srcdir}" >&5
if test x"${ac_cv_c_itkh}" = x ; then
for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
if test -f $i/generic/itk.h ; then
@@ -9607,7 +9670,7 @@ if test "${with_itclconfig+set}" = set; then
fi
echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6
-echo "configure:9611: checking for Itcl configuration" >&5
+echo "configure:9674: checking for Itcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -9710,7 +9773,7 @@ if test "${with_itkconfig+set}" = set; then
fi
echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6
-echo "configure:9714: checking for Itk configuration" >&5
+echo "configure:9777: checking for Itk configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -9853,7 +9916,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:9857: checking for X" >&5
+echo "configure:9920: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -9915,12 +9978,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 9919 "configure"
+#line 9982 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9987: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -9989,14 +10052,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 9993 "configure"
+#line 10056 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:10000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -10176,10 +10239,6 @@ targetfile=`sed -n '
s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
' ${target_makefile_frag}`
-GDB_MULTI_ARCH=`sed -n '
-s/GDB_MULTI_ARCH[ ]*=[ ]*\([^ ]*\)[ ]*/\1/p
-' ${target_makefile_frag}`
-
if test "${target}" = "${host}"; then
# We pick this up from the host configuration file (.mh) because we
# do not have a native configuration Makefile fragment.
@@ -10189,36 +10248,6 @@ s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
fi
-# New targets should just set gdb_multi_arch=yes in configure.tgt.
-# Old targets being converted can either do that or set GDB_MULTI_ARCH
-# in the target specific makefile frag. Eventually gdb_multi_arch=yes
-# will be the default.
-if test x"${GDB_MULTI_ARCH}" = x ; then
- case "${gdb_multi_arch}" in
- yes ) GDB_MULTI_ARCH=GDB_MULTI_ARCH_PURE ;;
- no ) GDB_MULTI_ARCH=0 ;;
- 0|1|2 ) GDB_MULTI_ARCH=${gdb_multi_arch} ;;
- esac
-fi
-if test x"${GDB_MULTI_ARCH}" != x ; then
- cat >> confdefs.h <<EOF
-#define GDB_MULTI_ARCH ${GDB_MULTI_ARCH}
-EOF
-
-fi
-# Warn the user when they use an old practice
-case "${GDB_MULTI_ARCH}" in
- "" ) ;;
- 0 | GDB_MULTI_ARCH_PARTIAL | 1 | GDB_MULTI_ARCH_TM | 2 )
- echo "configure: warning: "GDB: Target is not pure multi-arch"" 1>&2 ;;
- GDB_MULTI_ARCH_PURE )
- if test x"${targetfile}" != x ; then
- echo "configure: warning: "GDB: Ignoring TM_FILE in ${target_makefile_frag}"" 1>&2
- targetfile=""
- fi ;;
- *) { echo "configure: error: "GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}"" 1>&2; exit 1; };;
-esac
-
if test x"${gdb_osabi}" != x ; then
cat >> confdefs.h <<EOF
#define GDB_OSABI_DEFAULT $gdb_osabi
@@ -10244,7 +10273,7 @@ fi
# We only build gdbserver automatically if host and target are the same.
if test "x$target" = "x$host"; then
echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6
-echo "configure:10248: checking whether gdbserver is supported on this host" >&5
+echo "configure:10277: checking whether gdbserver is supported on this host" >&5
if test "x$build_gdbserver" = xyes; then
configdirs="$configdirs gdbserver"
echo "$ac_t""yes" 1>&6
@@ -10308,12 +10337,12 @@ fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:10312: checking for Cygwin environment" >&5
+echo "configure:10341: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10317 "configure"
+#line 10346 "configure"
#include "confdefs.h"
int main() {
@@ -10324,7 +10353,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:10328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -10341,19 +10370,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:10345: checking for mingw32 environment" >&5
+echo "configure:10374: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10350 "configure"
+#line 10379 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:10357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -10372,7 +10401,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:10376: checking for executable suffix" >&5
+echo "configure:10405: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10382,7 +10411,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:10386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:10415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -10424,7 +10453,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:10428: checking for iconv" >&5
+echo "configure:10457: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -10432,7 +10461,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 10436 "configure"
+#line 10465 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -10442,7 +10471,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:10446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -10454,7 +10483,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
cat > conftest.$ac_ext <<EOF
-#line 10458 "configure"
+#line 10487 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -10464,7 +10493,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:10468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_lib_iconv=yes
am_cv_func_iconv=yes
@@ -10485,13 +10514,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:10489: checking for iconv declaration" >&5
+echo "configure:10518: checking for iconv declaration" >&5
if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 10495 "configure"
+#line 10524 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -10510,7 +10539,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:10514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
diff --git a/gdb/configure.host b/gdb/configure.host
index b801589a7da..1830fb80e01 100644
--- a/gdb/configure.host
+++ b/gdb/configure.host
@@ -21,6 +21,7 @@ sparcv9 | sparc64) gdb_host_cpu=sparc ;;
s390*) gdb_host_cpu=s390 ;;
sh*) gdb_host_cpu=sh ;;
x86_64*) gdb_host_cpu=i386 ;;
+xscale*) gdb_host_cpu=arm ;;
*) gdb_host_cpu=$host_cpu ;;
esac
@@ -98,8 +99,6 @@ m68*-sun-*) gdb_host=sun3os4 ;;
# OBSOLETE mips-dec-mach3*) gdb_host=mipsm3 ;;
mips-dec-*) gdb_host=decstation ;;
mips-little-*) gdb_host=littlemips ;;
-mips-sgi-irix3*) gdb_host=irix3 ;;
-mips-sgi-irix4*) gdb_host=irix4 ;;
mips-sgi-irix5*) gdb_host=irix5 ;;
mips-sgi-irix6*) gdb_host=irix6 ;;
mips-sony-*) gdb_host=news-mips ;;
diff --git a/gdb/configure.in b/gdb/configure.in
index 38792e03396..e5bccdf64be 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -264,6 +264,9 @@ AC_CHECK_LIB(m, main)
AC_CHECK_FUNC(wctype, [],
[AC_CHECK_LIB(w, wctype)])
+# Some systems (e.g. Solaris) have `gethostbyname' in libnsl.
+AC_SEARCH_LIBS(gethostbyname, nsl)
+
# Some systems (e.g. Solaris) have `socketpair' in libsocket.
AC_SEARCH_LIBS(socketpair, socket)
@@ -526,7 +529,6 @@ AC_CACHE_CHECK([for uintptr_t in stdint.h], gdb_cv_have_uintptr_t,
[uintptr_t foo = 0;],
gdb_cv_have_uintptr_t=yes,
gdb_cv_have_uintptr_t=no)])
-AC_MSG_RESULT($gdb_cv_have_uintptr_t)
if test $gdb_cv_have_uintptr_t = yes; then
AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if <stdint.h> provides the uintptr_t type.])
fi
@@ -1304,10 +1306,6 @@ targetfile=`sed -n '
s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
' ${target_makefile_frag}`
-GDB_MULTI_ARCH=`sed -n '
-s/GDB_MULTI_ARCH[ ]*=[ ]*\([^ ]*\)[ ]*/\1/p
-' ${target_makefile_frag}`
-
if test "${target}" = "${host}"; then
# We pick this up from the host configuration file (.mh) because we
# do not have a native configuration Makefile fragment.
@@ -1317,33 +1315,6 @@ s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
fi
changequote([,])
-# New targets should just set gdb_multi_arch=yes in configure.tgt.
-# Old targets being converted can either do that or set GDB_MULTI_ARCH
-# in the target specific makefile frag. Eventually gdb_multi_arch=yes
-# will be the default.
-if test x"${GDB_MULTI_ARCH}" = x ; then
- case "${gdb_multi_arch}" in
- yes ) GDB_MULTI_ARCH=GDB_MULTI_ARCH_PURE ;;
- no ) GDB_MULTI_ARCH=0 ;;
- 0|1|2 ) GDB_MULTI_ARCH=${gdb_multi_arch} ;;
- esac
-fi
-if test x"${GDB_MULTI_ARCH}" != x ; then
- AC_DEFINE_UNQUOTED(GDB_MULTI_ARCH, ${GDB_MULTI_ARCH})
-fi
-# Warn the user when they use an old practice
-case "${GDB_MULTI_ARCH}" in
- "" ) ;;
- 0 | GDB_MULTI_ARCH_PARTIAL | 1 | GDB_MULTI_ARCH_TM | 2 )
- AC_MSG_WARN("GDB: Target is not pure multi-arch") ;;
- GDB_MULTI_ARCH_PURE )
- if test x"${targetfile}" != x ; then
- AC_MSG_WARN("GDB: Ignoring TM_FILE in ${target_makefile_frag}")
- targetfile=""
- fi ;;
- *) AC_MSG_ERROR("GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}");;
-esac
-
if test x"${gdb_osabi}" != x ; then
AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
[Define to the default OS ABI for this configuration.])
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index f11f0eeb667..e18d46cad29 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -50,8 +50,7 @@ arm*-wince-pe) gdb_target=wince ;;
arm*-*-linux*) gdb_target=linux
build_gdbserver=yes
;;
-arm*-*-netbsd*) gdb_target=nbsd
- gdb_multi_arch=yes ;;
+arm*-*-netbsd*) gdb_target=nbsd ;;
arm-*-nto*) gdb_target=nto ;;
arm*-*-* | thumb*-*-* | strongarm*-*-*)
gdb_target=embed
@@ -61,9 +60,7 @@ xscale-*-*) gdb_target=embed
configdirs="$configdirs rdi-share"
;;
-avr-*-*) gdb_target=avr
- gdb_multi_arch=yes
- ;;
+avr-*-*) gdb_target=avr ;;
cris*) gdb_target=cris ;;
@@ -131,7 +128,6 @@ m68*-*-aout*) gdb_target=monitor ;;
m68*-*-coff*) gdb_target=monitor ;;
m68*-*-elf*) gdb_target=monitor ;;
m68*-*-linux*) gdb_target=linux
- gdb_multi_arch=1
build_gdbserver=yes
;;
m68*-*-lynxos*) gdb_target=m68klynx ;;
@@ -143,36 +139,25 @@ m68*-*-sysv4*) gdb_target=m68kv4 ;;
m68*-*-vxworks*) gdb_target=vxworks68 ;;
mcore*-*-*) gdb_target=mcore ;;
-mips64*-big-*) gdb_target=mips64 ;;
-mips*-big-*) gdb_target=mips ;;
-mips*-dec-*) gdb_target=mips ;;
+
+# "mipsisa64" targets are 64-bit MIPS, MIPS64 ISA. They need these
+# special cases because otherwise they (obviously) are not matched by
+# the "mips64" target cases, and would therefore be treated as 32-bit.
+mipsisa64*-*-linux*) gdb_target=linux64 ;;
+mipsisa64*-*-*) gdb_target=embed64 ;;
mips*-*-pe) gdb_target=wince ;;
-mips64*el-*-ecoff*) gdb_target=embedl64 ;;
-mips64*-*-ecoff*) gdb_target=embed64 ;;
-mips64*vr*-*-elf*) gdb_target=mips64 ;;
mips*tx39*-elf*) gdb_target=tx39 ;;
-mips64*el-*-elf*) gdb_target=embedl64 ;;
-mips64*-*-elf*) gdb_target=embed64 ;;
mips64*-*-linux*) gdb_target=linux64 ;;
-mips*el-*-ecoff*) gdb_target=embedl ;;
-mips*-*-ecoff*) gdb_target=embed ;;
-mips*el-*-elf*) gdb_target=embedl ;;
-mips*-*-elf*) gdb_target=embed ;;
-mips*-little-*) gdb_target=mips ;;
-mips*-*-lnews*) gdb_target=embedl ;;
mips*-sgi-irix5*) gdb_target=irix5 ;;
mips*-sgi-irix6*) gdb_target=irix6 ;;
-mips*-sgi-*) gdb_target=irix3 ;;
-mips*-sony-*) gdb_target=mips64 ;;
mips*-*-linux*) gdb_target=linux
build_gdbserver=yes
;;
mips*-*-netbsd*) gdb_target=nbsd ;;
# OBSOLETE mips*-*-mach3*) gdb_target=mipsm3 ;;
mips*-*-sysv4*) gdb_target=mipsv4 ;;
-mips*-*-sysv*) gdb_target=mips ;;
-mips*-*-riscos*) gdb_target=mips ;;
mips*-*-vxworks*) gdb_target=vxmips ;;
+mips64*-*-*) gdb_target=embed64 ;;
mips*-*-*) gdb_target=embed ;;
# OBSOLETE mn10200-*-*) gdb_target=mn10200 ;;
@@ -209,6 +194,7 @@ s390x-*-*) gdb_target=s390x
sh*-*-pe) gdb_target=wince ;;
sh-*-coff*) gdb_target=embed ;;
sh-*-elf*) gdb_target=embed ;;
+# FIXME should that be sh*-*-linux*, perhaps?
sh-*-linux*) gdb_target=linux
build_gdbserver=yes
;;
@@ -260,21 +246,6 @@ x86_64-*-linux*) gdb_target=x86-64linux
esac
-
-# map GDB target onto multi-arch support
-
-case "${gdb_target}" in
-d10v) gdb_multi_arch=yes ;;
-fbsd64) gdb_multi_arch=yes ;;
-m32r) gdb_multi_arch=yes ;;
-m68hc11) gdb_multi_arch=yes ;;
-mn10300) gdb_multi_arch=yes ;;
-x86-64linux) gdb_multi_arch=yes ;;
-v850) gdb_multi_arch=yes ;;
-xstormy16) gdb_multi_arch=yes ;;
-mcore) gdb_multi_arch=yes ;;
-esac
-
# map target onto default OS ABI
case "${target}" in
diff --git a/gdb/core-sol2.c b/gdb/core-sol2.c
index f978b68e784..a3652333a16 100644
--- a/gdb/core-sol2.c
+++ b/gdb/core-sol2.c
@@ -94,18 +94,18 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
struct regs *gregs = (struct regs *) core_reg_sect;
/* G0 *always* holds 0. */
- *(int *) &deprecated_registers[REGISTER_BYTE (0)] = 0;
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (0)] = 0;
/* The globals and output registers. */
- memcpy (&deprecated_registers[REGISTER_BYTE (G1_REGNUM)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (G1_REGNUM)],
&gregs->r_g1, 15 * REGISTER_RAW_SIZE (G1_REGNUM));
- *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)]
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)]
= gregs->r_ps;
- *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)]
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)]
= gregs->r_pc;
- *(int *) &deprecated_registers[REGISTER_BYTE (NPC_REGNUM)]
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (DEPRECATED_NPC_REGNUM)]
= gregs->r_npc;
- *(int *) &deprecated_registers[REGISTER_BYTE (Y_REGNUM)]
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (Y_REGNUM)]
= gregs->r_y;
/* My best guess at where to get the locals and input
@@ -116,9 +116,9 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
{
int sp;
- sp = *(int *) &deprecated_registers[REGISTER_BYTE (SP_REGNUM)];
+ sp = *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (SP_REGNUM)];
if (0 != target_read_memory (sp,
- &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM)))
{
warning ("couldn't read input and local registers from core file\n");
@@ -167,9 +167,9 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
{
struct fpu *fpuregs = (struct fpu *) core_reg_sect;
- memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
&fpuregs->fpu_fr, sizeof (fpuregs->fpu_fr));
- memcpy (&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPS_REGNUM)],
&fpuregs->fpu_fsr, sizeof (FPU_FSR_TYPE));
}
else
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 094a3eff0c1..572b4486cd4 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -310,8 +310,8 @@ read_memory_unsigned_integer (CORE_ADDR memaddr, int len)
void
read_memory_string (CORE_ADDR memaddr, char *buffer, int max_len)
{
- register char *cp;
- register int i;
+ char *cp;
+ int i;
int cnt;
cp = buffer;
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 72b901fd1bf..226dab571d6 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -500,8 +500,8 @@ lookup_symbol_file (const char *name,
classes, then we should have found a match for them above. So if
we find them now, they should be genuine. */
- /* FIXME: carlton/2002-12-18: This is a hack and should eventually
- be deleted: see cp-support.c. */
+ /* FIXME: carlton/2003-06-12: This is a hack and should eventually
+ be deleted: see comments below. */
/* FIXME: carlton/2003-01-06: Searching this seems a bit fishy if
anonymous_namespace is nonzero, since we might return a namespace
@@ -623,7 +623,16 @@ initialize_namespace_symtab (struct objfile *objfile)
/* Allocate the possible namespace block; we put it where the first
local block will live, though I don't think there's any need to
pretend that it's actually a local block (e.g. by setting
- BLOCK_SUPERBLOCK appropriately). */
+ BLOCK_SUPERBLOCK appropriately). We don't use the global or
+ static block because we don't want it searched during the normal
+ search of all global/static blocks in lookup_symbol: we only want
+ it used as a last resort. */
+
+ /* NOTE: carlton/2003-09-11: I considered not associating the fake
+ symbols to a block/symtab at all. But that would cause problems
+ with lookup_symbol's SYMTAB argument and with block_found, so
+ having a symtab/block for this purpose seems like the best
+ solution for now. */
bl = allocate_block (&objfile->symbol_obstack);
BLOCK_DICT (bl) = dict_create_hashed_expandable ();
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index 4d987e43f14..08c1e23e7cb 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -33,6 +33,7 @@
struct symbol;
struct obstack;
struct block;
+struct objfile;
/* This struct is designed to store data from using directives. It
says that names from namespace INNER should be visible within
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index d00fe148ce3..c92c5c1f82e 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -686,7 +686,7 @@ cp_print_class_member (char *valaddr, struct type *domain,
print it. */
int extra = 0;
int bits = 0;
- register unsigned int i;
+ unsigned int i;
unsigned len = TYPE_NFIELDS (domain);
/* @@ Make VAL into bit offset */
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 3c7bf60a96a..89f54cf2ea3 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "opcode/cris.h"
#include "arch-utils.h"
#include "regcache.h"
+#include "gdb_assert.h"
/* To get entry_point_address. */
#include "symfile.h"
@@ -38,6 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "solib.h" /* Support for shared libraries. */
#include "solib-svr4.h" /* For struct link_map_offsets. */
#include "gdb_string.h"
+#include "dis-asm.h"
enum cris_num_regs
@@ -373,8 +375,6 @@ static CORE_ADDR cris_skip_prologue_main (CORE_ADDR pc, int frameless_p);
static struct gdbarch *cris_gdbarch_init (struct gdbarch_info,
struct gdbarch_list *);
-static int cris_delayed_get_disassembler (bfd_vma, disassemble_info *);
-
static void cris_dump_tdep (struct gdbarch *, struct ui_file *);
static void cris_version_update (char *ignore_args, int from_tty,
@@ -972,7 +972,7 @@ cris_abi_original_store_return_value (struct type *type, char *valbuf)
int len = TYPE_LENGTH (type);
if (len <= DEPRECATED_REGISTER_SIZE)
- deprecated_write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf, len);
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (RET_REGNUM), valbuf, len);
else
internal_error (__FILE__, __LINE__, "cris_abi_original_store_return_value: type length too large.");
}
@@ -987,8 +987,8 @@ cris_abi_v2_store_return_value (struct type *type, char *valbuf)
if (len <= 2 * DEPRECATED_REGISTER_SIZE)
{
/* Note that this works since R10 and R11 are consecutive registers. */
- deprecated_write_register_bytes (REGISTER_BYTE (RET_REGNUM), valbuf,
- len);
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (RET_REGNUM),
+ valbuf, len);
}
else
internal_error (__FILE__, __LINE__, "cris_abi_v2_store_return_value: type length too large.");
@@ -1058,7 +1058,7 @@ cris_abi_original_extract_return_value (struct type *type, char *regbuf,
int len = TYPE_LENGTH (type);
if (len <= DEPRECATED_REGISTER_SIZE)
- memcpy (valbuf, regbuf + REGISTER_BYTE (RET_REGNUM), len);
+ memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (RET_REGNUM), len);
else
internal_error (__FILE__, __LINE__, "cris_abi_original_extract_return_value: type length too large");
}
@@ -1072,7 +1072,7 @@ cris_abi_v2_extract_return_value (struct type *type, char *regbuf,
int len = TYPE_LENGTH (type);
if (len <= 2 * DEPRECATED_REGISTER_SIZE)
- memcpy (valbuf, regbuf + REGISTER_BYTE (RET_REGNUM), len);
+ memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (RET_REGNUM), len);
else
internal_error (__FILE__, __LINE__, "cris_abi_v2_extract_return_value: type length too large");
}
@@ -1148,7 +1148,7 @@ cris_frame_init_saved_regs (struct frame_info *fi)
get_frame_base (fi));
/* Examine the entire prologue. */
- register int frameless_p = 0;
+ int frameless_p = 0;
/* Has this frame's registers already been initialized? */
if (get_frame_saved_regs (fi))
@@ -1248,7 +1248,7 @@ cris_frame_chain (struct frame_info *fi)
{
return get_frame_base (fi);
}
- else if (!inside_entry_file (get_frame_pc (fi)))
+ else if (!deprecated_inside_entry_file (get_frame_pc (fi)))
{
return read_memory_unsigned_integer (get_frame_base (fi), 4);
}
@@ -1489,7 +1489,7 @@ cris_abi_v2_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
static CORE_ADDR
cris_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
- write_register (SRP_REGNUM, CALL_DUMMY_ADDRESS ());
+ write_register (SRP_REGNUM, entry_point_address ());
return sp;
}
@@ -1500,9 +1500,9 @@ cris_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
static void
cris_pop_frame (void)
{
- register struct frame_info *fi = get_current_frame ();
- register int regno;
- register int stack_offset = 0;
+ struct frame_info *fi = get_current_frame ();
+ int regno;
+ int stack_offset = 0;
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
get_frame_base (fi),
@@ -3538,10 +3538,16 @@ cris_gdb_func (enum cris_op_type op_type, unsigned short inst,
exec_bfd has been set. */
static int
-cris_delayed_get_disassembler (bfd_vma addr, disassemble_info *info)
+cris_delayed_get_disassembler (bfd_vma addr, struct disassemble_info *info)
{
- deprecated_tm_print_insn = cris_get_disassembler (exec_bfd);
- return TARGET_PRINT_INSN (addr, info);
+ int (*print_insn) (bfd_vma addr, struct disassemble_info *info);
+ /* FIXME: cagney/2003-08-27: It should be possible to select a CRIS
+ disassembler, even when there is no BFD. Does something like
+ "gdb; target remote; disassmeble *0x123" work? */
+ gdb_assert (exec_bfd != NULL);
+ print_insn = cris_get_disassembler (exec_bfd);
+ gdb_assert (print_insn != NULL);
+ return print_insn (addr, info);
}
/* Copied from <asm/elf.h>. */
@@ -3854,9 +3860,6 @@ _initialize_cris_tdep (void)
gdbarch_register (bfd_arch_cris, cris_gdbarch_init, cris_dump_tdep);
- /* Used in disassembly. */
- deprecated_tm_print_insn = cris_delayed_get_disassembler;
-
/* CRIS-specific user-commands. */
c = add_set_cmd ("cris-version", class_support, var_integer,
(char *) &usr_cmd_cris_version,
@@ -4153,7 +4156,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
cris_abi_original_store_return_value);
set_gdbarch_deprecated_extract_return_value
(gdbarch, cris_abi_original_extract_return_value);
- set_gdbarch_reg_struct_has_addr
+ set_gdbarch_deprecated_reg_struct_has_addr
(gdbarch, cris_abi_original_reg_struct_has_addr);
}
else if (tdep->cris_abi == CRIS_ABI_V2)
@@ -4163,8 +4166,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_store_return_value (gdbarch, cris_abi_v2_store_return_value);
set_gdbarch_deprecated_extract_return_value
(gdbarch, cris_abi_v2_extract_return_value);
- set_gdbarch_reg_struct_has_addr (gdbarch,
- cris_abi_v2_reg_struct_has_addr);
+ set_gdbarch_deprecated_reg_struct_has_addr
+ (gdbarch, cris_abi_v2_reg_struct_has_addr);
}
else
internal_error (__FILE__, __LINE__, "cris_gdbarch_init: unknown CRIS ABI");
@@ -4304,5 +4307,10 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_solib_svr4_fetch_link_map_offsets
(gdbarch, cris_linux_svr4_fetch_link_map_offsets);
+ /* FIXME: cagney/2003-08-27: It should be possible to select a CRIS
+ disassembler, even when there is no BFD. Does something like
+ "gdb; target remote; disassmeble *0x123" work? */
+ set_gdbarch_print_insn (gdbarch, cris_delayed_get_disassembler);
+
return gdbarch;
}
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index ac52ab615f9..129f56355c3 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -277,9 +277,9 @@ d10v_ts3_imap_register (void *regcache, int reg_nr)
return reg;
}
-/* MAP GDB's internal register numbering (determined by the layout fo
- the REGISTER_BYTE array) onto the simulator's register
- numbering. */
+/* MAP GDB's internal register numbering (determined by the layout
+ from the DEPRECATED_REGISTER_BYTE array) onto the simulator's
+ register numbering. */
static int
d10v_ts2_register_sim_regno (int nr)
@@ -1405,7 +1405,7 @@ d10v_frame_this_id (struct frame_info *next_frame,
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (func <= IMEM_START || inside_entry_file (func))
+ if (func <= IMEM_START || deprecated_inside_entry_file (func))
return;
/* Hopefully the prologue analysis either correctly determined the
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 7acc01d079d..6ed23c6e21d 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -58,6 +58,7 @@
#include "language.h" /* Needed for local_hex_string */
#include "complaints.h"
#include "cp-abi.h"
+#include "gdb_assert.h"
#include "aout/aout64.h"
#include "aout/stab_gnu.h" /* We always use GNU stabs, not native, now */
@@ -351,8 +352,8 @@ add_this_object_header_file (int i)
static void
add_old_header_file (char *name, int instance)
{
- register struct header_file *p = HEADER_FILES (current_objfile);
- register int i;
+ struct header_file *p = HEADER_FILES (current_objfile);
+ int i;
for (i = 0; i < N_HEADER_FILES (current_objfile); i++)
if (STREQ (p[i].name, name) && instance == p[i].instance)
@@ -377,8 +378,8 @@ add_old_header_file (char *name, int instance)
static void
add_new_header_file (char *name, int instance)
{
- register int i;
- register struct header_file *hfile;
+ int i;
+ struct header_file *hfile;
/* Make sure there is room for one more header file. */
@@ -420,7 +421,7 @@ add_new_header_file (char *name, int instance)
static struct type **
explicit_lookup_type (int real_filenum, int index)
{
- register struct header_file *f = &HEADER_FILES (current_objfile)[real_filenum];
+ struct header_file *f = &HEADER_FILES (current_objfile)[real_filenum];
if (index >= f->length)
{
@@ -751,8 +752,8 @@ dbx_symfile_finish (struct objfile *objfile)
{
if (HEADER_FILES (objfile) != NULL)
{
- register int i = N_HEADER_FILES (objfile);
- register struct header_file *hfiles = HEADER_FILES (objfile);
+ int i = N_HEADER_FILES (objfile);
+ struct header_file *hfiles = HEADER_FILES (objfile);
while (--i >= 0)
{
@@ -1291,12 +1292,12 @@ function_outside_compilation_unit_complaint (const char *arg1)
static void
read_dbx_symtab (struct objfile *objfile)
{
- register struct external_nlist *bufp = 0; /* =0 avoids gcc -Wall glitch */
+ struct external_nlist *bufp = 0; /* =0 avoids gcc -Wall glitch */
struct internal_nlist nlist;
CORE_ADDR text_addr;
int text_size;
- register char *namestring;
+ char *namestring;
int nsl;
int past_first_source_file = 0;
CORE_ADDR last_o_file_start = 0;
@@ -1304,6 +1305,7 @@ read_dbx_symtab (struct objfile *objfile)
struct cleanup *back_to;
bfd *abfd;
int textlow_not_set;
+ int data_sect_index;
/* Current partial symtab */
struct partial_symtab *pst;
@@ -1355,6 +1357,38 @@ read_dbx_symtab (struct objfile *objfile)
textlow_not_set = 1;
has_line_numbers = 0;
+ /* FIXME: jimb/2003-09-12: We don't apply the right section's offset
+ to global and static variables. The stab for a global or static
+ variable doesn't give us any indication of which section it's in,
+ so we can't tell immediately which offset in
+ objfile->section_offsets we should apply to the variable's
+ address.
+
+ We could certainly find out which section contains the variable
+ by looking up the variable's unrelocated address with
+ find_pc_section, but that would be expensive; this is the
+ function that constructs the partial symbol tables by examining
+ every symbol in the entire executable, and it's
+ performance-critical. So that expense would not be welcome. I'm
+ not sure what to do about this at the moment.
+
+ What we have done for years is to simply assume that the .data
+ section's offset is appropriate for all global and static
+ variables. Recently, this was expanded to fall back to the .bss
+ section's offset if there is no .data section, and then to the
+ .rodata section's offset. */
+ data_sect_index = objfile->sect_index_data;
+ if (data_sect_index == -1)
+ data_sect_index = SECT_OFF_BSS (objfile);
+ if (data_sect_index == -1)
+ data_sect_index = SECT_OFF_RODATA (objfile);
+
+ /* If data_sect_index is still -1, that's okay. It's perfectly fine
+ for the file to have no .data, no .bss, and no .text at all, if
+ it also has no global or static variables. If it does, we will
+ get an internal error from an ANOFFSET macro below when we try to
+ use data_sect_index. */
+
for (symnum = 0; symnum < DBX_SYMCOUNT (objfile); symnum++)
{
/* Get the symbol for this run and pull out some info */
@@ -1442,8 +1476,8 @@ read_dbx_symtab (struct objfile *objfile)
if (objfile->ei.entry_point < nlist.n_value &&
objfile->ei.entry_point >= last_o_file_start)
{
- objfile->ei.entry_file_lowpc = last_o_file_start;
- objfile->ei.entry_file_highpc = nlist.n_value;
+ objfile->ei.deprecated_entry_file_lowpc = last_o_file_start;
+ objfile->ei.deprecated_entry_file_highpc = nlist.n_value;
}
if (past_first_source_file && pst
/* The gould NP1 uses low values for .o and -l symbols
@@ -1681,7 +1715,7 @@ read_dbx_symtab (struct objfile *objfile)
if (pst && STREQ (namestring, pst->filename))
continue;
{
- register int i;
+ int i;
for (i = 0; i < includes_used; i++)
if (STREQ (namestring, psymtab_include_list[i]))
{
@@ -1757,7 +1791,7 @@ read_dbx_symtab (struct objfile *objfile)
switch (p[1])
{
case 'S':
- nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
+ nlist.n_value += ANOFFSET (objfile->section_offsets, data_sect_index);
#ifdef STATIC_TRANSFORM_NAME
namestring = STATIC_TRANSFORM_NAME (namestring);
#endif
@@ -1768,7 +1802,7 @@ read_dbx_symtab (struct objfile *objfile)
psymtab_language, objfile);
continue;
case 'G':
- nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
+ nlist.n_value += ANOFFSET (objfile->section_offsets, data_sect_index);
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
add_psymbol_to_list (namestring, p - namestring,
@@ -2206,8 +2240,8 @@ read_dbx_symtab (struct objfile *objfile)
&& objfile->ei.entry_point < nlist.n_value
&& objfile->ei.entry_point >= last_o_file_start)
{
- objfile->ei.entry_file_lowpc = last_o_file_start;
- objfile->ei.entry_file_highpc = nlist.n_value;
+ objfile->ei.deprecated_entry_file_lowpc = last_o_file_start;
+ objfile->ei.deprecated_entry_file_highpc = nlist.n_value;
}
if (pst)
@@ -2554,12 +2588,12 @@ dbx_psymtab_to_symtab (struct partial_symtab *pst)
static void
read_ofile_symtab (struct partial_symtab *pst)
{
- register char *namestring;
- register struct external_nlist *bufp;
+ char *namestring;
+ struct external_nlist *bufp;
struct internal_nlist nlist;
unsigned char type;
unsigned max_symnum;
- register bfd *abfd;
+ bfd *abfd;
struct objfile *objfile;
int sym_offset; /* Offset to start of symbols to read */
int sym_size; /* Size of symbols to read */
@@ -2771,7 +2805,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
static CORE_ADDR last_pc_address;
#endif
- register struct context_stack *new;
+ struct context_stack *new;
/* This remembers the address of the start of a function. It is used
because in Solaris 2, N_LBRAC, N_RBRAC, and N_SLINE entries are
relative to the current function's start address. On systems
diff --git a/gdb/dcache.c b/gdb/dcache.c
index 6e742746363..ee690948fdc 100644
--- a/gdb/dcache.c
+++ b/gdb/dcache.c
@@ -1,6 +1,7 @@
-/* Caching code.
- Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+/* Caching code for GDB, the GNU debugger.
+
+ Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2003 Free
+ Software Foundation, Inc.
This file is part of GDB.
@@ -217,7 +218,7 @@ dcache_invalidate (DCACHE *dcache)
static struct dcache_block *
dcache_hit (DCACHE *dcache, CORE_ADDR addr)
{
- register struct dcache_block *db;
+ struct dcache_block *db;
/* Search all cache blocks for one that is at this address. */
db = dcache->valid_head;
@@ -239,7 +240,7 @@ dcache_hit (DCACHE *dcache, CORE_ADDR addr)
be written is. */
static int
-dcache_write_line (DCACHE *dcache, register struct dcache_block *db)
+dcache_write_line (DCACHE *dcache, struct dcache_block *db)
{
CORE_ADDR memaddr;
char *myaddr;
@@ -383,7 +384,7 @@ dcache_read_line (DCACHE *dcache, struct dcache_block *db)
static struct dcache_block *
dcache_alloc (DCACHE *dcache, CORE_ADDR addr)
{
- register struct dcache_block *db;
+ struct dcache_block *db;
/* Take something from the free list */
db = dcache->free_head;
@@ -444,7 +445,7 @@ dcache_writeback (DCACHE *dcache)
static int
dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
{
- register struct dcache_block *db = dcache_hit (dcache, addr);
+ struct dcache_block *db = dcache_hit (dcache, addr);
if (!db)
{
@@ -471,7 +472,7 @@ dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
static int
dcache_poke_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
{
- register struct dcache_block *db = dcache_hit (dcache, addr);
+ struct dcache_block *db = dcache_hit (dcache, addr);
if (!db)
{
diff --git a/gdb/defs.h b/gdb/defs.h
index 0f8650d7711..642ecc9b479 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -285,6 +285,15 @@ struct cleanup
#endif
#endif
+/* Be conservative and use enum bitfields only with GCC.
+ This is copied from gcc 3.3.1, system.h. */
+
+#if defined(__GNUC__) && (__GNUC__ >= 2)
+#define ENUM_BITFIELD(TYPE) enum TYPE
+#else
+#define ENUM_BITFIELD(TYPE) unsigned int
+#endif
+
/* Needed for various prototypes */
struct symtab;
@@ -294,7 +303,7 @@ struct breakpoint;
extern int inside_entry_func (CORE_ADDR);
-extern int inside_entry_file (CORE_ADDR addr);
+extern int deprecated_inside_entry_file (CORE_ADDR addr);
extern int inside_main_func (CORE_ADDR pc);
@@ -855,6 +864,9 @@ extern void xfree (void *);
extern void xasprintf (char **ret, const char *format, ...) ATTR_FORMAT (printf, 2, 3);
extern void xvasprintf (char **ret, const char *format, va_list ap);
+/* Like asprintf, but return the string, throw an error if no memory. */
+extern char *xstrprintf (const char *format, ...) ATTR_FORMAT (printf, 1, 2);
+
extern int parse_escape (char **);
/* Message to be printed before the error message, when an error occurs. */
@@ -1074,14 +1086,17 @@ extern void *alloca ();
#endif /* Not GNU C */
#endif /* alloca not defined */
+/* Is GDB multi-arch? If there's a "tm.h" file, it is not. */
+#ifndef GDB_MULTI_ARCH
+#ifdef GDB_TM_FILE
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PARTIAL
+#else
+#define GDB_MULTI_ARCH GDB_MULTI_ARCH_PURE
+#endif
+#endif
+
/* Dynamic target-system-dependent parameters for GDB. */
#include "gdbarch.h"
-#if (GDB_MULTI_ARCH == 0)
-/* Multi-arch targets _should_ be including "arch-utils.h" directly
- into their *-tdep.c file. This is a prop to help old non-
- multi-arch targets to continue to compile. */
-#include "arch-utils.h"
-#endif
/* Maximum size of a register. Something small, but large enough for
all known ISAs. If it turns out to be too small, make it bigger. */
diff --git a/gdb/disasm.c b/gdb/disasm.c
index f86ec3f5058..5f4d07a0aea 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -26,6 +26,7 @@
#include "gdb_string.h"
#include "disasm.h"
#include "gdbcore.h"
+#include "dis-asm.h"
/* Disassemble functions.
FIXME: We should get rid of all the duplicate code in gdb that does
@@ -46,14 +47,15 @@ struct dis_line_entry
/* Like target_read_memory, but slightly different parameters. */
static int
dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int len,
- disassemble_info *info)
+ struct disassemble_info *info)
{
return target_read_memory (memaddr, (char *) myaddr, len);
}
/* Like memory_error with slightly different parameters. */
static void
-dis_asm_memory_error (int status, bfd_vma memaddr, disassemble_info *info)
+dis_asm_memory_error (int status, bfd_vma memaddr,
+ struct disassemble_info *info)
{
memory_error (status, memaddr);
}
@@ -83,7 +85,7 @@ compare_lines (const void *mle1p, const void *mle2p)
}
static int
-dump_insns (struct ui_out *uiout, disassemble_info * di,
+dump_insns (struct ui_out *uiout, struct disassemble_info * di,
CORE_ADDR low, CORE_ADDR high,
int how_many, struct ui_stream *stb)
{
@@ -296,7 +298,7 @@ do_mixed_source_and_assembly (struct ui_out *uiout,
static void
-do_assembly_only (struct ui_out *uiout, disassemble_info * di,
+do_assembly_only (struct ui_out *uiout, struct disassemble_info * di,
CORE_ADDR low, CORE_ADDR high,
int how_many, struct ui_stream *stb)
{
@@ -313,12 +315,22 @@ do_assembly_only (struct ui_out *uiout, disassemble_info * di,
/* Initialize the disassemble info struct ready for the specified
stream. */
-static disassemble_info
+static int
+fprintf_disasm (void *stream, const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ vfprintf_filtered (stream, format, args);
+ va_end (args);
+ /* Something non -ve. */
+ return 0;
+}
+
+static struct disassemble_info
gdb_disassemble_info (struct gdbarch *gdbarch, struct ui_file *file)
{
- disassemble_info di;
- INIT_DISASSEMBLE_INFO_NO_ARCH (di, file,
- (fprintf_ftype) fprintf_filtered);
+ struct disassemble_info di;
+ init_disassemble_info (&di, file, fprintf_disasm);
di.flavour = bfd_target_unknown_flavour;
di.memory_error_func = dis_asm_memory_error;
di.print_address_func = dis_asm_print_address;
@@ -346,7 +358,7 @@ gdb_disassembly (struct ui_out *uiout,
{
struct ui_stream *stb = ui_out_stream_new (uiout);
struct cleanup *cleanups = make_cleanup_ui_out_stream_delete (stb);
- disassemble_info di = gdb_disassemble_info (current_gdbarch, stb->stream);
+ struct disassemble_info di = gdb_disassemble_info (current_gdbarch, stb->stream);
/* To collect the instruction outputted from opcodes. */
struct symtab *symtab = NULL;
struct linetable_entry *le = NULL;
@@ -380,25 +392,6 @@ gdb_disassembly (struct ui_out *uiout,
int
gdb_print_insn (CORE_ADDR memaddr, struct ui_file *stream)
{
- disassemble_info di = gdb_disassemble_info (current_gdbarch, stream);
+ struct disassemble_info di = gdb_disassemble_info (current_gdbarch, stream);
return TARGET_PRINT_INSN (memaddr, &di);
}
-
-
-/* FIXME: cagney/2003-04-28: This global deprecated_tm_print_insn_info
- is going away. */
-disassemble_info deprecated_tm_print_insn_info;
-
-extern void _initialize_disasm (void);
-
-void
-_initialize_disasm (void)
-{
-
- INIT_DISASSEMBLE_INFO_NO_ARCH (deprecated_tm_print_insn_info, gdb_stdout,
- (fprintf_ftype)fprintf_filtered);
- deprecated_tm_print_insn_info.flavour = bfd_target_unknown_flavour;
- deprecated_tm_print_insn_info.read_memory_func = dis_asm_read_memory;
- deprecated_tm_print_insn_info.memory_error_func = dis_asm_memory_error;
- deprecated_tm_print_insn_info.print_address_func = dis_asm_print_address;
-}
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 3de06db8bf0..ce378b425b7 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,49 @@
+2003-09-13 Mark Kettenis <kettenis@gnu.org>
+
+ * gdbint.texinfo (Target Architecture Definition): Replace
+ REG_STRUCT_HAS_ADDR with DEPRECATED_REG_STRUCT_HAS_ADDR.
+
+2003-09-11 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Replace
+ STACK_ALIGN with DEPRECATED_STACK_ALIGN.
+
+2003-08-18 Andrew Cagney <cagney@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Document
+ "frame_red_zone_size".
+
+2003-08-09 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.texinfo (Backtrace): Replace "set/show backtrace-below-main"
+ with "set/show backtrace past-main" and "set/show backtrace
+ limit".
+
+2003-08-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Makefile.in (install-info): Support DESTDIR.
+ (install-html): Likewise.
+
+2003-08-07 Andrew Cagney <cagney@redhat.com>
+
+ Patch from Nick Roberts.
+ * gdb.texinfo (Using GDB under GNU Emacs): Fix/update key
+ bindings. Remove description of send-gdb-command.
+
+2003-08-07 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.texinfo (Mode Options): Mention that "mi2" was included in
+ GDB 6.0.
+
+2003-08-06 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.texinfo (Mode Options): Mention that level three is the
+ highest available and that level 2 is deprecated.
+ (Annotations Overview): Mention annotation levels. Cross reference
+ to "Limitations of the Annotation Interface" in annotate.texi.
+ (TODO, Value Annotations, Frame Annotations): Delete section.
+ (Displays, Breakpoint Info): Delete.
+
2003-08-04 Andrew Cagney <cagney@redhat.com>
* agentexpr.texi: Delete @bye.
diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
index 4e8c64ea817..a06cc4ac711 100644
--- a/gdb/doc/Makefile.in
+++ b/gdb/doc/Makefile.in
@@ -156,14 +156,14 @@ all-doc: info dvi ps # pdf
diststuff: info
install-info: $(INFO_DEPS)
- $(SHELL) $(srcdir)/../../mkinstalldirs $(infodir)
+ $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(infodir)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \
- echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
- $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
+ echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
+ $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
else : ; fi; \
done; \
done
@@ -171,8 +171,8 @@ install-info: $(INFO_DEPS)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
- echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
- install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+ echo " install-info --info-dir=$(infodir) $(DESTDIR)$(infodir)/$$file";\
+ install-info --info-dir=$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
done; \
else : ; fi
@@ -194,7 +194,7 @@ uninstall-info:
install-html: html
for i in *.html ; do \
- $(INSTALL_DATA) $$i $(htmldir)/$$i ; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(htmldir)/$$i ; \
done
STAGESTUFF = *.info* gdb-all.texi GDBvn.texi *.ps *.dvi *.pdf
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 022b34dcd0f..cf69fd3e741 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -1054,12 +1054,15 @@ separate window.
@cindex @code{--annotate}
This option sets the @dfn{annotation level} inside @value{GDBN}. Its
effect is identical to using @samp{set annotate @var{level}}
-(@pxref{Annotations}).
-Annotation level controls how much information does @value{GDBN} print
-together with its prompt, values of expressions, source lines, and other
-types of output. Level 0 is the normal, level 1 is for use when
-@value{GDBN} is run as a subprocess of @sc{gnu} Emacs, level 2 is the
-maximum annotation suitable for programs that control @value{GDBN}.
+(@pxref{Annotations}). The annotation @var{level} controls how much
+information @value{GDBN} prints together with its prompt, values of
+expressions, source lines, and other types of output. Level 0 is the
+normal, level 1 is for use when @value{GDBN} is run as a subprocess of
+@sc{gnu} Emacs, level 3 is the maximum annotation suitable for programs
+that control @value{GDBN}, and level 2 has been deprecated.
+
+The annotation mechanism has largely been superseeded by @sc{gdb/mi}
+(@pxref{GDB/MI}).
@item -async
@cindex @code{--async}
@@ -1130,11 +1133,11 @@ communicate with @value{GDBN} using it as a back end.
@xref{Interpreters, , Command Interpreters}.
@samp{--interpreter=mi} (or @samp{--interpreter=mi2}) causes
-@value{GDBN} to use the current @dfn{@sc{gdb/mi} interface}
-(@pxref{GDB/MI, , The @sc{gdb/mi} Interface}). The previous @sc{gdb/mi}
-interface, included in @value{GDBN} version 5.3, can be selected with
-@samp{--interpreter=mi1}. Earlier @sc{gdb/mi} interfaces
-are not supported.
+@value{GDBN} to use the @dfn{@sc{gdb/mi} interface} (@pxref{GDB/MI, ,
+The @sc{gdb/mi} Interface}) included in @var{GDBN} version 6.0. The
+previous @sc{gdb/mi} interface, included in @value{GDBN} version 5.3,
+can be selected with @samp{--interpreter=mi1}. Earlier @sc{gdb/mi}
+interfaces are not supported.
@item -write
@cindex @code{--write}
@@ -3919,27 +3922,40 @@ The display for frame zero does not begin with a program counter
value, indicating that your program has stopped at the beginning of the
code for line @code{993} of @code{builtin.c}.
-@kindex set backtrace-below-main
-@kindex show backtrace-below-main
+@kindex set backtrace past-main
+@kindex show backtrace past-main
+@kindex set backtrace limit
+@kindex show backtrace limit
+
+Most programs have a standard user entry point---a place where system
+libraries and startup code transition into user code. For C this is
+@code{main}. When @value{GDBN} finds the entry function in a backtrace
+it will terminate the backtrace, to avoid tracing into highly
+system-specific (and generally uninteresting) code.
-Most programs have a standard entry point---a place where system libraries
-and startup code transition into user code. For C this is @code{main}.
-When @value{GDBN} finds the entry function in a backtrace it will terminate
-the backtrace, to avoid tracing into highly system-specific (and generally
-uninteresting) code. If you need to examine the startup code, then you can
-change this behavior.
+If you need to examine the startup code, or limit the number of levels
+in a backtrace, you can change this behavior:
@table @code
-@item set backtrace-below-main off
+@item set backtrace past-main
+@itemx set backtrace past-main on
+Backtraces will continue past the user entry point.
+
+@item set backtrace past-main off
Backtraces will stop when they encounter the user entry point. This is the
default.
-@item set backtrace-below-main
-@itemx set backtrace-below-main on
-Backtraces will continue past the user entry point to the top of the stack.
+@item show backtrace past-main
+Display the current user entry point backtrace policy.
+
+@item set backtrace limit @var{n}
+@itemx set backtrace limit 0
+@cindex backtrace limit
+Limit the backtrace to @var{n} levels. A value of zero means
+unlimited.
-@item show backtrace-below-main
-Display the current backtrace policy.
+@item show backtrace limit
+Display the current limit on backtrace levels.
@end table
@node Selection
@@ -14142,36 +14158,26 @@ and the source.
Explicit @value{GDBN} @code{list} or search commands still produce output as
usual, but you probably have no reason to use them from Emacs.
-@quotation
-@emph{Warning:} If the directory where your program resides is not your
-current directory, it can be easy to confuse Emacs about the location of
-the source files, in which case the auxiliary display buffer does not
-appear to show your source. @value{GDBN} can find programs by searching your
-environment's @code{PATH} variable, so the @value{GDBN} input and output
-session proceeds normally; but Emacs does not get enough information
-back from @value{GDBN} to locate the source files in this situation. To
-avoid this problem, either start @value{GDBN} mode from the directory where
-your program resides, or specify an absolute file name when prompted for the
-@kbd{M-x gdb} argument.
-
-A similar confusion can result if you use the @value{GDBN} @code{file} command to
-switch to debugging a program in some other location, from an existing
-@value{GDBN} buffer in Emacs.
-@end quotation
-
-By default, @kbd{M-x gdb} calls the program called @file{gdb}. If
-you need to call @value{GDBN} by a different name (for example, if you keep
-several configurations around, with different names) you can set the
-Emacs variable @code{gdb-command-name}; for example,
-
-@smallexample
-(setq gdb-command-name "mygdb")
-@end smallexample
-
-@noindent
-(preceded by @kbd{M-:} or @kbd{ESC :}, or typed in the @code{*scratch*} buffer, or
-in your @file{.emacs} file) makes Emacs call the program named
-``@code{mygdb}'' instead.
+If you specify an absolute file name when prompted for the @kbd{M-x
+gdb} argument, then Emacs sets your current working directory to where
+your program resides. If you only specify the file name, then Emacs
+sets your current working directory to to the directory associated
+with the previous buffer. In this case, @value{GDBN} may find your
+program by searching your environment's @code{PATH} variable, but on
+some operating systems it might not find the source. So, although the
+@value{GDBN} input and output session proceeds normally, the auxiliary
+buffer does not display the current source and line of execution.
+
+The initial working directory of @value{GDBN} is printed on the top
+line of the @value{GDBN} I/O buffer and this serves as a default for
+the commands that specify files for @value{GDBN} to operate
+on. @xref{Files, ,Commands to specify files}.
+
+By default, @kbd{M-x gdb} calls the program called @file{gdb}. If you
+need to call @value{GDBN} by a different name (for example, if you
+keep several configurations around, with different names) you can
+customize the Emacs variable @code{gud-gdb-command-name} to run the
+one you want.
In the @value{GDBN} I/O buffer, you can use these special Emacs commands in
addition to the standard Shell mode commands:
@@ -14180,66 +14186,47 @@ addition to the standard Shell mode commands:
@item C-h m
Describe the features of Emacs' @value{GDBN} Mode.
-@item M-s
+@item C-c C-s
Execute to another source line, like the @value{GDBN} @code{step} command; also
update the display window to show the current file and location.
-@item M-n
+@item C-c C-n
Execute to next source line in this function, skipping all function
calls, like the @value{GDBN} @code{next} command. Then update the display window
to show the current file and location.
-@item M-i
+@item C-c C-i
Execute one instruction, like the @value{GDBN} @code{stepi} command; update
display window accordingly.
-@item M-x gdb-nexti
-Execute to next instruction, using the @value{GDBN} @code{nexti} command; update
-display window accordingly.
-
@item C-c C-f
Execute until exit from the selected stack frame, like the @value{GDBN}
@code{finish} command.
-@item M-c
+@item C-c C-r
Continue execution of your program, like the @value{GDBN} @code{continue}
command.
-@emph{Warning:} In Emacs v19, this command is @kbd{C-c C-p}.
-
-@item M-u
+@item C-c <
Go up the number of frames indicated by the numeric argument
(@pxref{Arguments, , Numeric Arguments, Emacs, The @sc{gnu} Emacs Manual}),
like the @value{GDBN} @code{up} command.
-@emph{Warning:} In Emacs v19, this command is @kbd{C-c C-u}.
-
-@item M-d
+@item C-c >
Go down the number of frames indicated by the numeric argument, like the
@value{GDBN} @code{down} command.
-
-@emph{Warning:} In Emacs v19, this command is @kbd{C-c C-d}.
-
-@item C-x &
-Read the number where the cursor is positioned, and insert it at the end
-of the @value{GDBN} I/O buffer. For example, if you wish to disassemble code
-around an address that was displayed earlier, type @kbd{disassemble};
-then move the cursor to the address display, and pick up the
-argument for @code{disassemble} by typing @kbd{C-x &}.
-
-You can customize this further by defining elements of the list
-@code{gdb-print-command}; once it is defined, you can format or
-otherwise process numbers picked up by @kbd{C-x &} before they are
-inserted. A numeric argument to @kbd{C-x &} indicates that you
-wish special formatting, and also acts as an index to pick an element of the
-list. If the list element is a string, the number to be inserted is
-formatted using the Emacs function @code{format}; otherwise the number
-is passed as an argument to the corresponding list element.
@end table
-In any source file, the Emacs command @kbd{C-x SPC} (@code{gdb-break})
+In any source file, the Emacs command @kbd{C-x SPC} (@code{gud-break})
tells @value{GDBN} to set a breakpoint on the source line point is on.
+If you type @kbd{M-x speedbar}, then Emacs displays a separate frame which
+shows a backtrace when the @value{GDBN} I/O buffer is current. Move
+point to any frame in the stack and type @key{RET} to make it become the
+current frame and display the associated source in the source buffer.
+Alternatively, click @kbd{Mouse-2} to make the selected frame become the
+current one.
+
If you accidentally delete the source-display buffer, an easy way to get
it back is to type the command @code{f} in the @value{GDBN} buffer, to
request a frame display; when you run under Emacs, this recreates
@@ -14252,6 +14239,10 @@ the files with these buffers if you wish; but keep in mind that @value{GDBN}
communicates with Emacs in terms of line numbers. If you add or
delete lines from the text, the line numbers that @value{GDBN} knows cease
to correspond properly with the code.
+
+The description given here is for GNU Emacs version 21.3 and a more
+detailed description of its interaction with @value{GDBN} is given in
+the Emacs manual (@pxref{Debuggers,,, Emacs, The @sc{gnu} Emacs Manual}).
@c The following dropped because Epoch is nonstandard. Reactivate
@c if/when v19 does something similar. ---doc@cygnus.com 19dec1990
@@ -18200,11 +18191,14 @@ A @samp{*} causes all existing variable objects to be updated.
@node Annotations
@chapter @value{GDBN} Annotations
-This chapter describes annotations in @value{GDBN}. Annotations are
-designed to interface @value{GDBN} to graphical user interfaces or
-other similar programs which want to interact with @value{GDBN} at a
+This chapter describes annotations in @value{GDBN}. Annotations were
+designed to interface @value{GDBN} to graphical user interfaces or other
+similar programs which want to interact with @value{GDBN} at a
relatively high level.
+The annotation mechanism has largely been superseeded by @sc{gdb/mi}
+(@pxref{GDB/MI}).
+
@ignore
This is Edition @value{EDITION}, @value{DATE}.
@end ignore
@@ -18212,25 +18206,18 @@ This is Edition @value{EDITION}, @value{DATE}.
@menu
* Annotations Overview:: What annotations are; the general syntax.
* Server Prefix:: Issuing a command without affecting user state.
-* Value Annotations:: Values are marked as such.
-* Frame Annotations:: Stack frames are annotated.
-* Displays:: @value{GDBN} can be told to display something periodically.
* Prompting:: Annotations marking @value{GDBN}'s need for input.
* Errors:: Annotations for error messages.
-* Breakpoint Info:: Information on breakpoints.
* Invalidation:: Some annotations describe things now invalid.
* Annotations for Running::
Whether the program is running, how it stopped, etc.
* Source Annotations:: Annotations describing source code.
-* TODO:: Annotations which might be added in the future.
@end menu
@node Annotations Overview
@section What is an Annotation?
@cindex annotations
-To produce annotations, start @value{GDBN} with the @code{--annotate=2} option.
-
Annotations start with a newline character, two @samp{control-z}
characters, and the name of the annotation. If there is no additional
information associated with this annotation, the name of the annotation
@@ -18246,24 +18233,35 @@ no need for @value{GDBN} to output a newline followed by two
annotations could be extended with an @samp{escape} annotation which
means those three characters as output.
+The annotation @var{level}, which is specified using the
+@option{--annotate} command line option (@pxref{Mode Options}), controls
+how much information @value{GDBN} prints together with its prompt,
+values of expressions, source lines, and other types of output. Level 0
+is for no anntations, level 1 is for use when @value{GDBN} is run as a
+subprocess of @sc{gnu} Emacs, level 3 is the maximum annotation suitable
+for programs that control @value{GDBN}, and level 2 annotations have
+been made obsolete (@pxref{Limitations, , Limitations of the Annotation
+Interface, annotate, GDB's Obsolete Annotations}). This chapter
+describes level 3 annotations.
+
A simple example of starting up @value{GDBN} with annotations is:
@smallexample
-$ gdb --annotate=2
-GNU GDB 5.0
-Copyright 2000 Free Software Foundation, Inc.
+$ @kbd{gdb --annotate=3}
+GNU gdb 6.0
+Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License,
and you are welcome to change it and/or distribute copies of it
under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty"
for details.
-This GDB was configured as "sparc-sun-sunos4.1.3"
+This GDB was configured as "i386-pc-linux-gnu"
^Z^Zpre-prompt
(gdb)
^Z^Zprompt
-quit
+@kbd{quit}
^Z^Zpost-prompt
$
@@ -18288,311 +18286,6 @@ The server prefix does not affect the recording of values into the value
history; to print a value without recording it into the value history,
use the @code{output} command instead of the @code{print} command.
-@node Value Annotations
-@section Values
-
-@cindex annotations for values
-When a value is printed in various contexts, @value{GDBN} uses
-annotations to delimit the value from the surrounding text.
-
-@findex value-history-begin
-@findex value-history-value
-@findex value-history-end
-If a value is printed using @code{print} and added to the value history,
-the annotation looks like
-
-@smallexample
-^Z^Zvalue-history-begin @var{history-number} @var{value-flags}
-@var{history-string}
-^Z^Zvalue-history-value
-@var{the-value}
-^Z^Zvalue-history-end
-@end smallexample
-
-@noindent
-where @var{history-number} is the number it is getting in the value
-history, @var{history-string} is a string, such as @samp{$5 = }, which
-introduces the value to the user, @var{the-value} is the output
-corresponding to the value itself, and @var{value-flags} is @samp{*} for
-a value which can be dereferenced and @samp{-} for a value which cannot.
-
-@findex value-begin
-@findex value-end
-If the value is not added to the value history (it is an invalid float
-or it is printed with the @code{output} command), the annotation is similar:
-
-@smallexample
-^Z^Zvalue-begin @var{value-flags}
-@var{the-value}
-^Z^Zvalue-end
-@end smallexample
-
-@findex arg-begin
-@findex arg-name-end
-@findex arg-value
-@findex arg-end
-When @value{GDBN} prints an argument to a function (for example, in the output
-from the @code{backtrace} command), it annotates it as follows:
-
-@smallexample
-^Z^Zarg-begin
-@var{argument-name}
-^Z^Zarg-name-end
-@var{separator-string}
-^Z^Zarg-value @var{value-flags}
-@var{the-value}
-^Z^Zarg-end
-@end smallexample
-
-@noindent
-where @var{argument-name} is the name of the argument,
-@var{separator-string} is text which separates the name from the value
-for the user's benefit (such as @samp{=}), and @var{value-flags} and
-@var{the-value} have the same meanings as in a
-@code{value-history-begin} annotation.
-
-@findex field-begin
-@findex field-name-end
-@findex field-value
-@findex field-end
-When printing a structure, @value{GDBN} annotates it as follows:
-
-@smallexample
-^Z^Zfield-begin @var{value-flags}
-@var{field-name}
-^Z^Zfield-name-end
-@var{separator-string}
-^Z^Zfield-value
-@var{the-value}
-^Z^Zfield-end
-@end smallexample
-
-@noindent
-where @var{field-name} is the name of the field, @var{separator-string}
-is text which separates the name from the value for the user's benefit
-(such as @samp{=}), and @var{value-flags} and @var{the-value} have the
-same meanings as in a @code{value-history-begin} annotation.
-
-When printing an array, @value{GDBN} annotates it as follows:
-
-@smallexample
-^Z^Zarray-section-begin @var{array-index} @var{value-flags}
-@end smallexample
-
-@noindent
-where @var{array-index} is the index of the first element being
-annotated and @var{value-flags} has the same meaning as in a
-@code{value-history-begin} annotation. This is followed by any number
-of elements, where is element can be either a single element:
-
-@findex elt
-@smallexample
-@samp{,} @var{whitespace} ; @r{omitted for the first element}
-@var{the-value}
-^Z^Zelt
-@end smallexample
-
-or a repeated element
-
-@findex elt-rep
-@findex elt-rep-end
-@smallexample
-@samp{,} @var{whitespace} ; @r{omitted for the first element}
-@var{the-value}
-^Z^Zelt-rep @var{number-of-repetitions}
-@var{repetition-string}
-^Z^Zelt-rep-end
-@end smallexample
-
-In both cases, @var{the-value} is the output for the value of the
-element and @var{whitespace} can contain spaces, tabs, and newlines. In
-the repeated case, @var{number-of-repetitions} is the number of
-consecutive array elements which contain that value, and
-@var{repetition-string} is a string which is designed to convey to the
-user that repetition is being depicted.
-
-@findex array-section-end
-Once all the array elements have been output, the array annotation is
-ended with
-
-@smallexample
-^Z^Zarray-section-end
-@end smallexample
-
-@node Frame Annotations
-@section Frames
-
-@cindex annotations for frames
-Whenever @value{GDBN} prints a frame, it annotates it. For example, this applies
-to frames printed when @value{GDBN} stops, output from commands such as
-@code{backtrace} or @code{up}, etc.
-
-@findex frame-begin
-The frame annotation begins with
-
-@smallexample
-^Z^Zframe-begin @var{level} @var{address}
-@var{level-string}
-@end smallexample
-
-@noindent
-where @var{level} is the number of the frame (0 is the innermost frame,
-and other frames have positive numbers), @var{address} is the address of
-the code executing in that frame, and @var{level-string} is a string
-designed to convey the level to the user. @var{address} is in the form
-@samp{0x} followed by one or more lowercase hex digits (note that this
-does not depend on the language). The frame ends with
-
-@findex frame-end
-@smallexample
-^Z^Zframe-end
-@end smallexample
-
-Between these annotations is the main body of the frame, which can
-consist of
-
-@itemize @bullet
-@item
-@findex function-call
-@smallexample
-^Z^Zfunction-call
-@var{function-call-string}
-@end smallexample
-
-where @var{function-call-string} is text designed to convey to the user
-that this frame is associated with a function call made by @value{GDBN} to a
-function in the program being debugged.
-
-@item
-@findex signal-handler-caller
-@smallexample
-^Z^Zsignal-handler-caller
-@var{signal-handler-caller-string}
-@end smallexample
-
-where @var{signal-handler-caller-string} is text designed to convey to
-the user that this frame is associated with whatever mechanism is used
-by this operating system to call a signal handler (it is the frame which
-calls the signal handler, not the frame for the signal handler itself).
-
-@item
-A normal frame.
-
-@findex frame-address
-@findex frame-address-end
-This can optionally (depending on whether this is thought of as
-interesting information for the user to see) begin with
-
-@smallexample
-^Z^Zframe-address
-@var{address}
-^Z^Zframe-address-end
-@var{separator-string}
-@end smallexample
-
-where @var{address} is the address executing in the frame (the same
-address as in the @code{frame-begin} annotation, but printed in a form
-which is intended for user consumption---in particular, the syntax varies
-depending on the language), and @var{separator-string} is a string
-intended to separate this address from what follows for the user's
-benefit.
-
-@findex frame-function-name
-@findex frame-args
-Then comes
-
-@smallexample
-^Z^Zframe-function-name
-@var{function-name}
-^Z^Zframe-args
-@var{arguments}
-@end smallexample
-
-where @var{function-name} is the name of the function executing in the
-frame, or @samp{??} if not known, and @var{arguments} are the arguments
-to the frame, with parentheses around them (each argument is annotated
-individually as well, @pxref{Value Annotations}).
-
-@findex frame-source-begin
-@findex frame-source-file
-@findex frame-source-file-end
-@findex frame-source-line
-@findex frame-source-end
-If source information is available, a reference to it is then printed:
-
-@smallexample
-^Z^Zframe-source-begin
-@var{source-intro-string}
-^Z^Zframe-source-file
-@var{filename}
-^Z^Zframe-source-file-end
-:
-^Z^Zframe-source-line
-@var{line-number}
-^Z^Zframe-source-end
-@end smallexample
-
-where @var{source-intro-string} separates for the user's benefit the
-reference from the text which precedes it, @var{filename} is the name of
-the source file, and @var{line-number} is the line number within that
-file (the first line is line 1).
-
-@findex frame-where
-If @value{GDBN} prints some information about where the frame is from (which
-library, which load segment, etc.; currently only done on the RS/6000),
-it is annotated with
-
-@smallexample
-^Z^Zframe-where
-@var{information}
-@end smallexample
-
-Then, if source is to actually be displayed for this frame (for example,
-this is not true for output from the @code{backtrace} command), then a
-@code{source} annotation (@pxref{Source Annotations}) is displayed. Unlike
-most annotations, this is output instead of the normal text which would be
-output, not in addition.
-@end itemize
-
-@node Displays
-@section Displays
-
-@findex display-begin
-@findex display-number-end
-@findex display-format
-@findex display-expression
-@findex display-expression-end
-@findex display-value
-@findex display-end
-@cindex annotations for display
-When @value{GDBN} is told to display something using the @code{display} command,
-the results of the display are annotated:
-
-@smallexample
-^Z^Zdisplay-begin
-@var{number}
-^Z^Zdisplay-number-end
-@var{number-separator}
-^Z^Zdisplay-format
-@var{format}
-^Z^Zdisplay-expression
-@var{expression}
-^Z^Zdisplay-expression-end
-@var{expression-separator}
-^Z^Zdisplay-value
-@var{value}
-^Z^Zdisplay-end
-@end smallexample
-
-@noindent
-where @var{number} is the number of the display, @var{number-separator}
-is intended to separate the number from what follows for the user,
-@var{format} includes information such as the size, format, or other
-information about how the value is being displayed, @var{expression} is
-the expression being displayed, @var{expression-separator} is intended
-to separate the expression from the text that follows for the user,
-and @var{value} is the actual value being displayed.
-
@node Prompting
@section Annotation for @value{GDBN} Input
@@ -18693,64 +18386,6 @@ Warning messages are not yet annotated.
@c If we want to change that, need to fix warning(), type_error(),
@c range_error(), and possibly other places.
-@node Breakpoint Info
-@section Information on Breakpoints
-
-@cindex annotations for breakpoints
-The output from the @code{info breakpoints} command is annotated as follows:
-
-@findex breakpoints-headers
-@findex breakpoints-table
-@smallexample
-^Z^Zbreakpoints-headers
-@var{header-entry}
-^Z^Zbreakpoints-table
-@end smallexample
-
-@noindent
-where @var{header-entry} has the same syntax as an entry (see below) but
-instead of containing data, it contains strings which are intended to
-convey the meaning of each field to the user. This is followed by any
-number of entries. If a field does not apply for this entry, it is
-omitted. Fields may contain trailing whitespace. Each entry consists
-of:
-
-@findex record
-@findex field
-@smallexample
-^Z^Zrecord
-^Z^Zfield 0
-@var{number}
-^Z^Zfield 1
-@var{type}
-^Z^Zfield 2
-@var{disposition}
-^Z^Zfield 3
-@var{enable}
-^Z^Zfield 4
-@var{address}
-^Z^Zfield 5
-@var{what}
-^Z^Zfield 6
-@var{frame}
-^Z^Zfield 7
-@var{condition}
-^Z^Zfield 8
-@var{ignore-count}
-^Z^Zfield 9
-@var{commands}
-@end smallexample
-
-Note that @var{address} is intended for user consumption---the syntax
-varies depending on the language.
-
-The output ends with
-
-@findex breakpoints-table-end
-@smallexample
-^Z^Zbreakpoints-table-end
-@end smallexample
-
@node Invalidation
@section Invalidation Notices
@@ -18866,23 +18501,6 @@ source which is being displayed. @var{addr} is in the form @samp{0x}
followed by one or more lowercase hex digits (note that this does not
depend on the language).
-@node TODO
-@section Annotations We Might Want in the Future
-
-@format
- - target-invalid
- the target might have changed (registers, heap contents, or
- execution status). For performance, we might eventually want
- to hit `registers-invalid' and `all-registers-invalid' with
- greater precision
-
- - systematic annotation for set/show parameters (including
- invalidation notices).
-
- - similarly, `info' returns a list of candidates for invalidation
- notices.
-@end format
-
@node GDB Bugs
@chapter Reporting Bugs in @value{GDBN}
@cindex bugs in @value{GDBN}
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index c8b342ed122..c5ad133dc70 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -38,7 +38,7 @@ Free Documentation License''.
@page
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.102.2.11 $} % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.102.2.12 $} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Solutions\par
\hfill \manvers\par
@@ -3218,17 +3218,35 @@ Otherwise return 0.
Define this to adjust @var{address} so that it meets the alignment
requirements for the start of a new stack frame. A stack frame's
alignment requirements are typically stronger than a target processors
-stack alignment requirements (@pxref{STACK_ALIGN}).
+stack alignment requirements (@pxref{DEPRECATED_STACK_ALIGN}).
This function is used to ensure that, when creating a dummy frame, both
the initial stack pointer and (if needed) the address of the return
value are correctly aligned.
-Unlike @code{STACK_ALIGN}, this function always adjusts the address in
-the direction of stack growth.
+Unlike @code{DEPRECATED_STACK_ALIGN}, this function always adjusts the
+address in the direction of stack growth.
By default, no frame based stack alignment is performed.
+@item int frame_red_zone_size
+
+The number of bytes, beyond the innermost-stack-address, reserved by the
+@sc{abi}. A function is permitted to use this scratch area (instead of
+allocating extra stack space).
+
+When performing an inferior function call, to ensure that it does not
+modify this area, @value{GDBN} adjusts the innermost-stack-address by
+@var{frame_red_zone_size} bytes before pushing parameters onto the
+stack.
+
+By default, zero bytes are allocated. The value must be aligned
+(@pxref{frame_align}).
+
+The @sc{amd64} (nee x86-64) @sc{abi} documentation refers to the
+@emph{red zone} when describing this scratch area.
+@cindex red zone
+
@item DEPRECATED_FRAME_CHAIN(@var{frame})
@findex DEPRECATED_FRAME_CHAIN
Given @var{frame}, return a pointer to the calling frame.
@@ -3742,8 +3760,8 @@ or @code{NUL} to indicate that register @var{i} is not valid.
@findex REGISTER_NAMES
Deprecated in favor of @code{REGISTER_NAME}.
-@item REG_STRUCT_HAS_ADDR (@var{gcc_p}, @var{type})
-@findex REG_STRUCT_HAS_ADDR
+@item DEPRECATED_REG_STRUCT_HAS_ADDR (@var{gcc_p}, @var{type})
+@findex DEPRECATED_REG_STRUCT_HAS_ADDR
Define this to return 1 if the given type will be passed by pointer
rather than directly.
@@ -3794,9 +3812,9 @@ Define this to convert stab register numbers (as gotten from `r'
declarations) into @value{GDBN} regnums. If not defined, no conversion will be
done.
-@item STACK_ALIGN (@var{addr})
-@anchor{STACK_ALIGN}
-@findex STACK_ALIGN
+@item DEPRECATED_STACK_ALIGN (@var{addr})
+@anchor{DEPRECATED_STACK_ALIGN}
+@findex DEPRECATED_STACK_ALIGN
Define this to increase @var{addr} so that it meets the alignment
requirements for the processor's stack.
diff --git a/gdb/doublest.c b/gdb/doublest.c
index 09bb15502ba..3f283e13ffa 100644
--- a/gdb/doublest.c
+++ b/gdb/doublest.c
@@ -180,7 +180,7 @@ convert_floatformat_to_doublest (const struct floatformat *fmt,
if (!special_exponent)
exponent -= fmt->exp_bias;
else if (exponent == 0)
- exponent = 1 - (int) fmt->exp_bias;
+ exponent = 1 - fmt->exp_bias;
/* Build the result algebraically. Might go infinite, underflow, etc;
who cares. */
diff --git a/gdb/dsrec.c b/gdb/dsrec.c
index 5f2c2d703ce..142260002ff 100644
--- a/gdb/dsrec.c
+++ b/gdb/dsrec.c
@@ -23,6 +23,8 @@
#include "serial.h"
#include "srec.h"
#include <time.h>
+#include "gdb_assert.h"
+#include "gdb_string.h"
extern void report_transfer_performance (unsigned long, time_t, time_t);
@@ -223,10 +225,6 @@ make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect,
const static char data_code_table[] = "123";
const static char term_code_table[] = "987";
const static char header_code_table[] = "000";
- const static char *formats[] =
- {"S%c%02X%04X",
- "S%c%02X%06X",
- "S%c%02X%08X"};
char const *code_table;
int addr_size;
int payload_size;
@@ -271,9 +269,10 @@ make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect,
payload_size = 0; /* Term or header packets have no payload */
/* Output the header. */
-
- sprintf (srec, formats[addr_size - 2], code_table[addr_size - 2],
- addr_size + payload_size + 1, (int) targ_addr);
+ snprintf (srec, (*maxrecsize) + 1, "S%c%02X%0*X",
+ code_table[addr_size - 2],
+ addr_size + payload_size + 1,
+ addr_size * 2, (int) targ_addr);
/* Note that the checksum is calculated on the raw data, not the
hexified data. It includes the length, address and the data
@@ -287,6 +286,9 @@ make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect,
+ ((targ_addr >> 16) & 0xff)
+ ((targ_addr >> 24) & 0xff));
+ /* NOTE: cagney/2003-08-10: The equation is old. Check that the
+ recent snprintf changes match that equation. */
+ gdb_assert (strlen (srec) == 1 + 1 + 2 + addr_size * 2);
p = srec + 1 + 1 + 2 + addr_size * 2;
/* Build the Srecord. */
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 6a40df5e325..d6b8f2652e4 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -97,6 +97,28 @@ static struct dwarf2_fde *dwarf2_frame_find_fde (CORE_ADDR *pc);
/* Structure describing a frame state. */
+enum dwarf2_reg_rule
+{
+ /* Make certain that 0 maps onto the correct enum value - the
+ corresponding structure is being initialized using memset zero.
+ This indicates that CFI didn't provide any information at all
+ about a register - leaving how to obtain it's value totally
+ unspecified. */
+ REG_UNSPECIFIED = 0,
+ /* The term "undefined" comes from the DWARF2 CFI spec which this
+ code is moddeling - it indicates that the register's value is
+ "undefined". */
+ /* NOTE: cagney/2003-09-08: GCC uses the less formal term "unsaved"
+ - it's definition is a combination of REG_UNDEFINED and
+ REG_UNSPECIFIED - the failure to differentiate the two helps
+ explain a few problems with the CFI GCC outputs. */
+ REG_UNDEFINED,
+ REG_SAVED_OFFSET,
+ REG_SAVED_REG,
+ REG_SAVED_EXP,
+ REG_SAME_VALUE
+};
+
struct dwarf2_frame_state
{
/* Each register save state can be described in terms of a CFA slot,
@@ -111,13 +133,7 @@ struct dwarf2_frame_state
unsigned char *exp;
} loc;
ULONGEST exp_len;
- enum {
- REG_UNSAVED,
- REG_SAVED_OFFSET,
- REG_SAVED_REG,
- REG_SAVED_EXP,
- REG_UNMODIFIED
- } how;
+ enum dwarf2_reg_rule how;
} *reg;
int num_regs;
@@ -354,13 +370,13 @@ execute_cfa_program (unsigned char *insn_ptr, unsigned char *insn_end,
case DW_CFA_undefined:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
- fs->regs.reg[reg].how = REG_UNSAVED;
+ fs->regs.reg[reg].how = REG_UNDEFINED;
break;
case DW_CFA_same_value:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
- fs->regs.reg[reg].how = REG_UNMODIFIED;
+ fs->regs.reg[reg].how = REG_SAME_VALUE;
break;
case DW_CFA_register:
@@ -460,11 +476,10 @@ static struct dwarf2_frame_cache *
dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
{
struct cleanup *old_chain;
- int num_regs = NUM_REGS + NUM_PSEUDO_REGS;
+ const int num_regs = NUM_REGS + NUM_PSEUDO_REGS;
struct dwarf2_frame_cache *cache;
struct dwarf2_frame_state *fs;
struct dwarf2_fde *fde;
- int reg;
if (*this_cache)
return *this_cache;
@@ -535,34 +550,65 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
internal_error (__FILE__, __LINE__, "Unknown CFA rule.");
}
- /* Save the register info in the cache. */
- for (reg = 0; reg < fs->regs.num_regs; reg++)
- {
- int regnum;
-
- /* Skip the return address column. */
- if (reg == fs->retaddr_column)
- /* NOTE: cagney/2003-06-07: Is this right? What if the
- RETADDR_COLUM corresponds to a real register (and, worse,
- that isn't the PC_REGNUM)? I'm guessing that the PC_REGNUM
- further down is trying to handle this. That can't be right
- though - PC_REGNUM may not be valid (it can be -ve). I
- think, instead when RETADDR_COLUM isn't a real register, it
- should map itself onto frame_pc_unwind. */
- continue;
+ /* Initialize things so that all registers are marked as
+ unspecified. */
+ {
+ int regnum;
+ for (regnum = 0; regnum < num_regs; regnum++)
+ cache->reg[regnum].how = REG_UNSPECIFIED;
+ }
- /* Use the GDB register number as index. */
- regnum = DWARF2_REG_TO_REGNUM (reg);
+ /* Go through the DWARF2 CFI generated table and save its register
+ location information in the cache. */
+ {
+ int column; /* CFI speak for "register number". */
+ for (column = 0; column < fs->regs.num_regs; column++)
+ {
+ int regnum;
+
+ /* Skip the return address column. */
+ if (column == fs->retaddr_column)
+ /* NOTE: cagney/2003-06-07: Is this right? What if
+ RETADDR_COLUMN corresponds to a real register (and,
+ worse, that isn't the PC_REGNUM)? I'm guessing that the
+ PC_REGNUM further down is trying to handle this. That
+ can't be right though - PC_REGNUM may not be valid (it
+ can be -ve). I think, instead when RETADDR_COLUM isn't a
+ real register, it should map itself onto frame_pc_unwind. */
+ continue;
- if (regnum >= 0 && regnum < num_regs)
- cache->reg[regnum] = fs->regs.reg[reg];
- }
+ /* Use the GDB register number as the destination index. */
+ regnum = DWARF2_REG_TO_REGNUM (column);
+
+ /* If there's no corresponding GDB register, ignore it. */
+ if (regnum < 0 || regnum >= num_regs)
+ continue;
+
+ /* NOTE: cagney/2003-09-05: CFI should specify the disposition
+ of all debug info registers. If it doesn't complain (but
+ not too loudly). It turns out that GCC, assumes that an
+ unspecified register implies "same value" when CFI (draft
+ 7) specifies nothing at all. Such a register could equally
+ be interpreted as "undefined". Also note that this check
+ isn't sufficient - it only checks that all registers in the
+ range [0 .. max column] are specified - and won't detect
+ problems when a debug info register falls outside of the
+ table. Need a way of iterating through all the valid
+ DWARF2 register numbers. */
+ if (fs->regs.reg[column].how == REG_UNSPECIFIED)
+ complaint (&symfile_complaints,
+ "Incomplete CFI data; unspecified registers at 0x%s",
+ paddr (fs->pc));
+
+ cache->reg[regnum] = fs->regs.reg[column];
+ }
+ }
/* Store the location of the return addess. If the return address
column (adjusted) is not the same as gdb's PC_REGNUM, then this
implies a copy from the ra column register. */
if (fs->retaddr_column < fs->regs.num_regs
- && fs->regs.reg[fs->retaddr_column].how != REG_UNSAVED)
+ && fs->regs.reg[fs->retaddr_column].how != REG_UNDEFINED)
{
/* See comment above about a possibly -ve PC_REGNUM. If this
assertion fails, it's a problem with this code and not the
@@ -572,7 +618,7 @@ dwarf2_frame_cache (struct frame_info *next_frame, void **this_cache)
}
else
{
- reg = DWARF2_REG_TO_REGNUM (fs->retaddr_column);
+ int reg = DWARF2_REG_TO_REGNUM (fs->retaddr_column);
if (reg != PC_REGNUM)
{
/* See comment above about PC_REGNUM being -ve. If this
@@ -611,7 +657,9 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
switch (cache->reg[regnum].how)
{
- case REG_UNSAVED:
+ case REG_UNDEFINED:
+ /* If CFI explicitly specified that the value isn't defined,
+ mark it as optimized away - the value isn't available. */
*optimizedp = 1;
*lvalp = not_lval;
*addrp = 0;
@@ -636,6 +684,13 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
very real posibility that CFA is an offset from some
other register, having nothing to do with the unwound SP
value. */
+ /* FIXME: cagney/2003-09-05: I think I understand. GDB was
+ lumping the two states "unspecified" and "undefined"
+ together. Here SP_REGNUM was "unspecified", GCC assuming
+ that in such a case CFA would be used. This branch of
+ the if statement should be deleted - the problem of
+ SP_REGNUM is now handed by the case REG_UNSPECIFIED
+ below. */
*optimizedp = 0;
if (valuep)
{
@@ -687,7 +742,59 @@ dwarf2_frame_prev_register (struct frame_info *next_frame, void **this_cache,
}
break;
- case REG_UNMODIFIED:
+ case REG_UNSPECIFIED:
+ /* GCC, in its infinite wisdom decided to not provide unwind
+ information for registers that are "same value". Since
+ DWARF2 (3 draft 7) doesn't define such behavior, said
+ registers are actually undefined (which is different to CFI
+ "undefined"). Code above issues a complaint about this.
+ Here just fudge the books, assume GCC, and that the value is
+ more inner on the stack. */
+ if (SP_REGNUM >= 0 && regnum == SP_REGNUM)
+ {
+ /* Can things get worse? Yep! One of the registers GCC
+ forgot to provide unwind information for was the stack
+ pointer. Outch! GCC appears to assumes that the CFA
+ address can be used - after all it points to the inner
+ most address of the previous frame before the function
+ call and that's always the same as the stack pointer on
+ return, right? Wrong. See GCC's i386 STDCALL option for
+ an ABI that has a different entry and return stack
+ pointer. */
+ /* DWARF V3 Draft 7 p102: Typically, the CFA is defined to
+ be the value of the stack pointer at the call site in the
+ previous frame (which may be different from its value on
+ entry to the current frame). */
+ /* DWARF V3 Draft 7 p103: The first column of the rules
+ defines the rule which computes the CFA value; it may be
+ either a register and a signed offset that are added
+ together or a DWARF expression that is evaluated. */
+ /* NOTE: cagney/2003-09-05: Should issue a complain.
+ Unfortunatly it turns out that DWARF2 CFI has a problem.
+ Since CFI specifies the location at which a register was
+ saved (not its value) it isn't possible to specify
+ something like "unwound(REG) == REG + constant" using CFI
+ as will almost always occure with the stack pointer. I
+ guess CFI should be point SP at CFA. Ref: danielj,
+ "Describing unsaved stack pointers", posted to dwarf2
+ list 2003-08-15. */
+ *optimizedp = 0;
+ *lvalp = not_lval;
+ *addrp = 0;
+ *realnump = -1;
+ if (valuep)
+ /* Store the value. */
+ store_typed_address (valuep, builtin_type_void_data_ptr,
+ cache->cfa);
+ }
+ else
+ /* Assume that the register can be found in the next inner
+ most frame. */
+ frame_register_unwind (next_frame, regnum,
+ optimizedp, lvalp, addrp, realnump, valuep);
+ break;
+
+ case REG_SAME_VALUE:
frame_register_unwind (next_frame, regnum,
optimizedp, lvalp, addrp, realnump, valuep);
break;
@@ -780,6 +887,8 @@ struct comp_unit
bfd_vma dbase;
};
+const struct objfile_data *dwarf2_frame_data;
+
static unsigned int
read_1_byte (bfd *bfd, char *buf)
{
@@ -930,6 +1039,8 @@ static CORE_ADDR
read_encoded_value (struct comp_unit *unit, unsigned char encoding,
char *buf, unsigned int *bytes_read_ptr)
{
+ int ptr_len = size_of_encoded_value (DW_EH_PE_absptr);
+ ptrdiff_t offset;
CORE_ADDR base;
/* GCC currently doesn't generate DW_EH_PE_indirect encodings for
@@ -938,6 +1049,8 @@ read_encoded_value (struct comp_unit *unit, unsigned char encoding,
internal_error (__FILE__, __LINE__,
"Unsupported encoding: DW_EH_PE_indirect");
+ *bytes_read_ptr = 0;
+
switch (encoding & 0x70)
{
case DW_EH_PE_absptr:
@@ -950,32 +1063,41 @@ read_encoded_value (struct comp_unit *unit, unsigned char encoding,
case DW_EH_PE_datarel:
base = unit->dbase;
break;
+ case DW_EH_PE_aligned:
+ base = 0;
+ offset = buf - unit->dwarf_frame_buffer;
+ if ((offset % ptr_len) != 0)
+ {
+ *bytes_read_ptr = ptr_len - (offset % ptr_len);
+ buf += *bytes_read_ptr;
+ }
+ break;
default:
internal_error (__FILE__, __LINE__, "Invalid or unsupported encoding");
}
if ((encoding & 0x0f) == 0x00)
- encoding |= encoding_for_size (TYPE_LENGTH(builtin_type_void_data_ptr));
+ encoding |= encoding_for_size (ptr_len);
switch (encoding & 0x0f)
{
case DW_EH_PE_udata2:
- *bytes_read_ptr = 2;
+ *bytes_read_ptr += 2;
return (base + bfd_get_16 (unit->abfd, (bfd_byte *) buf));
case DW_EH_PE_udata4:
- *bytes_read_ptr = 4;
+ *bytes_read_ptr += 4;
return (base + bfd_get_32 (unit->abfd, (bfd_byte *) buf));
case DW_EH_PE_udata8:
- *bytes_read_ptr = 8;
+ *bytes_read_ptr += 8;
return (base + bfd_get_64 (unit->abfd, (bfd_byte *) buf));
case DW_EH_PE_sdata2:
- *bytes_read_ptr = 2;
+ *bytes_read_ptr += 2;
return (base + bfd_get_signed_16 (unit->abfd, (bfd_byte *) buf));
case DW_EH_PE_sdata4:
- *bytes_read_ptr = 4;
+ *bytes_read_ptr += 4;
return (base + bfd_get_signed_32 (unit->abfd, (bfd_byte *) buf));
case DW_EH_PE_sdata8:
- *bytes_read_ptr = 8;
+ *bytes_read_ptr += 8;
return (base + bfd_get_signed_64 (unit->abfd, (bfd_byte *) buf));
default:
internal_error (__FILE__, __LINE__, "Invalid or unsupported encoding");
@@ -1022,9 +1144,13 @@ dwarf2_frame_find_fde (CORE_ADDR *pc)
struct dwarf2_fde *fde;
CORE_ADDR offset;
+ fde = objfile_data (objfile, dwarf2_frame_data);
+ if (fde == NULL)
+ continue;
+
+ gdb_assert (objfile->section_offsets);
offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
-
- fde = objfile->sym_private;
+
while (fde)
{
if (*pc >= fde->initial_location + offset
@@ -1044,8 +1170,8 @@ dwarf2_frame_find_fde (CORE_ADDR *pc)
static void
add_fde (struct comp_unit *unit, struct dwarf2_fde *fde)
{
- fde->next = unit->objfile->sym_private;
- unit->objfile->sym_private = fde;
+ fde->next = objfile_data (unit->objfile, dwarf2_frame_data);
+ set_objfile_data (unit->objfile, dwarf2_frame_data, fde);
}
#ifdef CC_HAS_LONG_LONG
@@ -1441,3 +1567,12 @@ dwarf2_build_frame_info (struct objfile *objfile)
frame_ptr = decode_frame_entry (&unit, frame_ptr, 0);
}
}
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+void _initialize_dwarf2_frame (void);
+
+void
+_initialize_dwarf2_frame (void)
+{
+ dwarf2_frame_data = register_objfile_data ();
+}
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 782e6283c80..6ecd04f5a29 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -304,6 +304,7 @@ dwarf2_loc_desc_needs_frame (unsigned char *data, unsigned short size)
{
struct needs_frame_baton baton;
struct dwarf_expr_context *ctx;
+ int in_reg;
baton.needs_frame = 0;
@@ -316,9 +317,11 @@ dwarf2_loc_desc_needs_frame (unsigned char *data, unsigned short size)
dwarf_expr_eval (ctx, data, size);
+ in_reg = ctx->in_reg;
+
free_dwarf_expr_context (ctx);
- return baton.needs_frame;
+ return baton.needs_frame || in_reg;
}
static void
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index ac94ebc91fe..e62fd907672 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1518,7 +1518,7 @@ scan_partial_symbols (char *info_ptr, struct objfile *objfile,
/* If the die has a sibling, skip to the sibling, unless another
function has already updated info_ptr for us. */
- /* NOTE: carlton/2003-01-07: This is a bit hackish, but whether
+ /* NOTE: carlton/2003-06-16: This is a bit hackish, but whether
or not we want to update this depends on enough stuff (not
only pdi.tag but also whether or not pdi.name is NULL) that
this seems like the easiest way to handle the issue. */
@@ -1812,15 +1812,16 @@ add_partial_enumeration (struct partial_die_info *enum_pdi, char *info_ptr,
info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu_header);
if (pdi.tag == 0)
break;
- gdb_assert (pdi.tag == DW_TAG_enumerator);
- gdb_assert (pdi.name != NULL);
- add_partial_symbol (&pdi, objfile, cu_header, namespace);
+ if (pdi.tag != DW_TAG_enumerator || pdi.name == NULL)
+ complaint (&symfile_complaints, "malformed enumerator DIE ignored");
+ else
+ add_partial_symbol (&pdi, objfile, cu_header, namespace);
}
return info_ptr;
}
-/* Locate ORIG_PDI's sibling; INFO_PTR should point to the next PDI
+/* Locate ORIG_PDI's sibling; INFO_PTR should point to the next DIE
after ORIG_PDI. */
static char *
@@ -2164,8 +2165,8 @@ read_file_scope (struct die_info *die, struct objfile *objfile,
if (objfile->ei.entry_point >= lowpc &&
objfile->ei.entry_point < highpc)
{
- objfile->ei.entry_file_lowpc = lowpc;
- objfile->ei.entry_file_highpc = highpc;
+ objfile->ei.deprecated_entry_file_lowpc = lowpc;
+ objfile->ei.deprecated_entry_file_highpc = highpc;
}
attr = dwarf_attr (die, DW_AT_language);
@@ -2258,7 +2259,7 @@ static void
read_func_scope (struct die_info *die, struct objfile *objfile,
const struct comp_unit_head *cu_header)
{
- register struct context_stack *new;
+ struct context_stack *new;
CORE_ADDR lowpc;
CORE_ADDR highpc;
struct die_info *child_die;
@@ -2369,7 +2370,7 @@ static void
read_lexical_block_scope (struct die_info *die, struct objfile *objfile,
const struct comp_unit_head *cu_header)
{
- register struct context_stack *new;
+ struct context_stack *new;
CORE_ADDR lowpc, highpc;
struct die_info *child_die;
@@ -2439,7 +2440,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
unsigned int addr_size = cu_header->addr_size;
CORE_ADDR mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
/* Value of the DW_AT_ranges attribute is the offset in the
- .debug_renges section. */
+ .debug_ranges section. */
unsigned int offset = DW_UNSND (attr);
/* Base address selection entry. */
CORE_ADDR base;
@@ -2452,6 +2453,14 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc,
found_base = cu_header->base_known;
base = cu_header->base_address;
+
+ if (offset >= dwarf_ranges_size)
+ {
+ complaint (&symfile_complaints,
+ "Offset %d out of bounds for DW_AT_ranges attribute",
+ offset);
+ return 0;
+ }
buffer = dwarf_ranges_buffer + offset;
/* Read in the largest possible address. */
@@ -3565,16 +3574,9 @@ read_namespace (struct die_info *die, struct objfile *objfile,
processing_current_prefix = temp_name;
}
- /* If it's an anonymous namespace that we're seeing for the first
- time, add a using directive. */
-
- if (is_anonymous && dwarf_attr (die, DW_AT_extension) == NULL)
- cp_add_using_directive (processing_current_prefix,
- strlen (previous_prefix),
- strlen (processing_current_prefix));
-
/* Add a symbol associated to this if we haven't seen the namespace
- before. */
+ before. Also, add a using directive if it's an anonymous
+ namespace. */
if (dwarf2_extension (die) == NULL)
{
@@ -3588,6 +3590,11 @@ read_namespace (struct die_info *die, struct objfile *objfile,
TYPE_TAG_NAME (type) = TYPE_NAME (type);
new_symbol (die, type, objfile, cu_header);
+
+ if (is_anonymous)
+ cp_add_using_directive (processing_current_prefix,
+ strlen (previous_prefix),
+ strlen (processing_current_prefix));
}
if (die->child != NULL)
@@ -6319,7 +6326,7 @@ dwarf2_extension (struct die_info *die)
/* Convert a DIE tag into its string name. */
static char *
-dwarf_tag_name (register unsigned tag)
+dwarf_tag_name (unsigned tag)
{
switch (tag)
{
@@ -6451,7 +6458,7 @@ dwarf_tag_name (register unsigned tag)
/* Convert a DWARF attribute code into its string name. */
static char *
-dwarf_attr_name (register unsigned attr)
+dwarf_attr_name (unsigned attr)
{
switch (attr)
{
@@ -6616,9 +6623,9 @@ dwarf_attr_name (register unsigned attr)
return "DW_AT_MIPS_loop_unroll_factor";
case DW_AT_MIPS_software_pipeline_depth:
return "DW_AT_MIPS_software_pipeline_depth";
+#endif
case DW_AT_MIPS_linkage_name:
return "DW_AT_MIPS_linkage_name";
-#endif
case DW_AT_sf_names:
return "DW_AT_sf_names";
@@ -6642,7 +6649,7 @@ dwarf_attr_name (register unsigned attr)
/* Convert a DWARF value form code into its string name. */
static char *
-dwarf_form_name (register unsigned form)
+dwarf_form_name (unsigned form)
{
switch (form)
{
@@ -6696,7 +6703,7 @@ dwarf_form_name (register unsigned form)
/* Convert a DWARF stack opcode into its string name. */
static char *
-dwarf_stack_op_name (register unsigned op)
+dwarf_stack_op_name (unsigned op)
{
switch (op)
{
@@ -7019,7 +7026,7 @@ dwarf_bool_name (unsigned mybool)
/* Convert a DWARF type code into its string name. */
static char *
-dwarf_type_encoding_name (register unsigned enc)
+dwarf_type_encoding_name (unsigned enc)
{
switch (enc)
{
@@ -7050,7 +7057,7 @@ dwarf_type_encoding_name (register unsigned enc)
#if 0
static char *
-dwarf_cfi_name (register unsigned cfi_opc)
+dwarf_cfi_name (unsigned cfi_opc)
{
switch (cfi_opc)
{
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index e6f2a2e6b7e..6f1c76ae96f 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -1868,8 +1868,8 @@ read_file_scope (struct dieinfo *dip, char *thisdie, char *enddie,
if (objfile->ei.entry_point >= dip->at_low_pc &&
objfile->ei.entry_point < dip->at_high_pc)
{
- objfile->ei.entry_file_lowpc = dip->at_low_pc;
- objfile->ei.entry_file_highpc = dip->at_high_pc;
+ objfile->ei.deprecated_entry_file_lowpc = dip->at_low_pc;
+ objfile->ei.deprecated_entry_file_highpc = dip->at_high_pc;
}
set_cu_language (dip);
if (dip->at_producer != NULL)
diff --git a/gdb/elfread.c b/gdb/elfread.c
index a655797484f..8c278107d37 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -77,7 +77,7 @@ static void free_elfinfo (void *);
static void
elf_locate_sections (bfd *ignore_abfd, asection *sectp, void *eip)
{
- register struct elfinfo *ei;
+ struct elfinfo *ei;
ei = (struct elfinfo *) eip;
if (STREQ (sectp->name, ".debug"))
diff --git a/gdb/environ.c b/gdb/environ.c
index 1f9a9d67e9f..8612b0afb6c 100644
--- a/gdb/environ.c
+++ b/gdb/environ.c
@@ -1,6 +1,7 @@
/* environ.c -- library for manipulating environments for GNU.
- Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 2000
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 2000,
+ 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,7 +31,7 @@
struct environ *
make_environ (void)
{
- register struct environ *e;
+ struct environ *e;
e = (struct environ *) xmalloc (sizeof (struct environ));
@@ -43,9 +44,9 @@ make_environ (void)
/* Free an environment and all the strings in it. */
void
-free_environ (register struct environ *e)
+free_environ (struct environ *e)
{
- register char **vector = e->vector;
+ char **vector = e->vector;
while (*vector)
xfree (*vector++);
@@ -58,10 +59,10 @@ free_environ (register struct environ *e)
that all strings in these environments are safe to free. */
void
-init_environ (register struct environ *e)
+init_environ (struct environ *e)
{
extern char **environ;
- register int i;
+ int i;
if (environ == NULL)
return;
@@ -79,8 +80,8 @@ init_environ (register struct environ *e)
while (--i >= 0)
{
- register int len = strlen (e->vector[i]);
- register char *new = (char *) xmalloc (len + 1);
+ int len = strlen (e->vector[i]);
+ char *new = (char *) xmalloc (len + 1);
memcpy (new, e->vector[i], len + 1);
e->vector[i] = new;
}
@@ -100,9 +101,9 @@ environ_vector (struct environ *e)
char *
get_in_environ (const struct environ *e, const char *var)
{
- register int len = strlen (var);
- register char **vector = e->vector;
- register char *s;
+ int len = strlen (var);
+ char **vector = e->vector;
+ char *s;
for (; (s = *vector) != NULL; vector++)
if (STREQN (s, var, len) && s[len] == '=')
@@ -116,10 +117,10 @@ get_in_environ (const struct environ *e, const char *var)
void
set_in_environ (struct environ *e, const char *var, const char *value)
{
- register int i;
- register int len = strlen (var);
- register char **vector = e->vector;
- register char *s;
+ int i;
+ int len = strlen (var);
+ char **vector = e->vector;
+ char *s;
for (i = 0; (s = vector[i]) != NULL; i++)
if (STREQN (s, var, len) && s[len] == '=')
@@ -163,9 +164,9 @@ set_in_environ (struct environ *e, const char *var, const char *value)
void
unset_in_environ (struct environ *e, char *var)
{
- register int len = strlen (var);
- register char **vector = e->vector;
- register char *s;
+ int len = strlen (var);
+ char **vector = e->vector;
+ char *s;
for (; (s = *vector) != NULL; vector++)
{
diff --git a/gdb/eval.c b/gdb/eval.c
index 29610fbb591..d3ebb3e0d63 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -67,8 +67,8 @@ static LONGEST init_array_element (struct value *, struct value *,
LONGEST, LONGEST);
static struct value *
-evaluate_subexp (struct type *expect_type, register struct expression *exp,
- register int *pos, enum noside noside)
+evaluate_subexp (struct type *expect_type, struct expression *exp,
+ int *pos, enum noside noside)
{
return (*exp->language_defn->evaluate_exp) (expect_type, exp, pos, noside);
}
@@ -80,8 +80,8 @@ CORE_ADDR
parse_and_eval_address (char *exp)
{
struct expression *expr = parse_expression (exp);
- register CORE_ADDR addr;
- register struct cleanup *old_chain =
+ CORE_ADDR addr;
+ struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
addr = value_as_address (evaluate_expression (expr));
@@ -96,8 +96,8 @@ CORE_ADDR
parse_and_eval_address_1 (char **expptr)
{
struct expression *expr = parse_exp_1 (expptr, (struct block *) 0, 0);
- register CORE_ADDR addr;
- register struct cleanup *old_chain =
+ CORE_ADDR addr;
+ struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
addr = value_as_address (evaluate_expression (expr));
@@ -111,8 +111,8 @@ LONGEST
parse_and_eval_long (char *exp)
{
struct expression *expr = parse_expression (exp);
- register LONGEST retval;
- register struct cleanup *old_chain =
+ LONGEST retval;
+ struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
retval = value_as_long (evaluate_expression (expr));
@@ -125,7 +125,7 @@ parse_and_eval (char *exp)
{
struct expression *expr = parse_expression (exp);
struct value *val;
- register struct cleanup *old_chain =
+ struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
@@ -142,7 +142,7 @@ parse_to_comma_and_eval (char **expp)
{
struct expression *expr = parse_exp_1 (expp, (struct block *) 0, 1);
struct value *val;
- register struct cleanup *old_chain =
+ struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
@@ -176,7 +176,7 @@ evaluate_type (struct expression *exp)
returning the label. Otherwise, does nothing and returns NULL. */
static char *
-get_label (register struct expression *exp, int *pos)
+get_label (struct expression *exp, int *pos)
{
if (exp->elts[*pos].opcode == OP_LABELED)
{
@@ -195,8 +195,8 @@ get_label (register struct expression *exp, int *pos)
static struct value *
evaluate_struct_tuple (struct value *struct_val,
- register struct expression *exp,
- register int *pos, enum noside noside, int nargs)
+ struct expression *exp,
+ int *pos, enum noside noside, int nargs)
{
struct type *struct_type = check_typedef (VALUE_TYPE (struct_val));
struct type *substruct_type = struct_type;
@@ -338,7 +338,7 @@ evaluate_struct_tuple (struct value *struct_val,
static LONGEST
init_array_element (struct value *array, struct value *element,
- register struct expression *exp, register int *pos,
+ struct expression *exp, int *pos,
enum noside noside, LONGEST low_bound, LONGEST high_bound)
{
LONGEST index;
@@ -379,12 +379,12 @@ init_array_element (struct value *array, struct value *element,
struct value *
evaluate_subexp_standard (struct type *expect_type,
- register struct expression *exp, register int *pos,
+ struct expression *exp, int *pos,
enum noside noside)
{
enum exp_opcode op;
int tem, tem2, tem3;
- register int pc, pc2 = 0, oldpos;
+ int pc, pc2 = 0, oldpos;
struct value *arg1 = NULL;
struct value *arg2 = NULL;
struct value *arg3;
@@ -855,11 +855,11 @@ evaluate_subexp_standard (struct type *expect_type,
value_type = expect_type;
}
- struct_return = using_struct_return (method, funaddr, value_type, using_gcc);
+ struct_return = using_struct_return (value_type, using_gcc);
}
else if (expect_type != NULL)
{
- struct_return = using_struct_return (NULL, addr, check_typedef (expect_type), using_gcc);
+ struct_return = using_struct_return (check_typedef (expect_type), using_gcc);
}
/* Found a function symbol. Now we will substitute its
@@ -2071,11 +2071,11 @@ nosideret:
then only the type of the result need be correct. */
static struct value *
-evaluate_subexp_for_address (register struct expression *exp, register int *pos,
+evaluate_subexp_for_address (struct expression *exp, int *pos,
enum noside noside)
{
enum exp_opcode op;
- register int pc;
+ int pc;
struct symbol *var;
pc = (*pos);
@@ -2151,11 +2151,11 @@ evaluate_subexp_for_address (register struct expression *exp, register int *pos,
*/
struct value *
-evaluate_subexp_with_coercion (register struct expression *exp,
- register int *pos, enum noside noside)
+evaluate_subexp_with_coercion (struct expression *exp,
+ int *pos, enum noside noside)
{
- register enum exp_opcode op;
- register int pc;
+ enum exp_opcode op;
+ int pc;
struct value *val;
struct symbol *var;
@@ -2188,10 +2188,10 @@ evaluate_subexp_with_coercion (register struct expression *exp,
Advance *POS over the subexpression. */
static struct value *
-evaluate_subexp_for_sizeof (register struct expression *exp, register int *pos)
+evaluate_subexp_for_sizeof (struct expression *exp, int *pos)
{
enum exp_opcode op;
- register int pc;
+ int pc;
struct type *type;
struct value *val;
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 9db28fb38be..21f8a7aa366 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -599,7 +599,7 @@ command_line_handler (char *rl)
{
static char *linebuffer = 0;
static unsigned linelength = 0;
- register char *p;
+ char *p;
char *p1;
extern char *line;
extern int linesize;
diff --git a/gdb/exec.c b/gdb/exec.c
index 0bde096c7c2..468b0ea299b 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -242,7 +242,7 @@ exec_file_attach (char *filename, int from_tty)
/* FIXME - This should only be run for RS6000, but the ifdef is a poor
way to accomplish. */
-#ifdef IBM6000_TARGET
+#ifdef DEPRECATED_IBM6000_TARGET
/* Setup initial vmap. */
map_vmap (exec_bfd, 0);
@@ -254,7 +254,7 @@ exec_file_attach (char *filename, int from_tty)
error ("\"%s\": can't find the file sections: %s",
scratch_pathname, bfd_errmsg (bfd_get_error ()));
}
-#endif /* IBM6000_TARGET */
+#endif /* DEPRECATED_IBM6000_TARGET */
if (build_section_table (exec_bfd, &exec_ops.to_sections,
&exec_ops.to_sections_end))
diff --git a/gdb/expprint.c b/gdb/expprint.c
index a5e8dccee55..1eb4ec6919d 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -54,14 +54,14 @@ print_expression (struct expression *exp, struct ui_file *stream)
parentheses are needed here. */
static void
-print_subexp (register struct expression *exp, register int *pos,
+print_subexp (struct expression *exp, int *pos,
struct ui_file *stream, enum precedence prec)
{
- register unsigned tem;
- register const struct op_print *op_print_tab;
- register int pc;
+ unsigned tem;
+ const struct op_print *op_print_tab;
+ int pc;
unsigned nargs;
- register char *op_str;
+ char *op_str;
int assign_modify = 0;
enum exp_opcode opcode;
enum precedence myprec = PREC_NULL;
@@ -535,7 +535,7 @@ char *
op_string (enum exp_opcode op)
{
int tem;
- register const struct op_print *op_print_tab;
+ const struct op_print *op_print_tab;
op_print_tab = current_language->la_op_print_tab;
for (tem = 0; op_print_tab[tem].opcode != OP_NULL; tem++)
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 9ed2d6f1505..52f56b36074 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -100,7 +100,7 @@ static void f_emit_char (int c, struct ui_file * stream, int quoter);
be replaced with a true F77 version. */
static void
-f_emit_char (register int c, struct ui_file *stream, int quoter)
+f_emit_char (int c, struct ui_file *stream, int quoter)
{
c &= 0xFF; /* Avoid sign bit follies */
@@ -164,7 +164,7 @@ static void
f_printstr (struct ui_file *stream, char *string, unsigned int length,
int width, int force_ellipses)
{
- register unsigned int i;
+ unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
@@ -250,7 +250,7 @@ f_printstr (struct ui_file *stream, char *string, unsigned int length,
static struct type *
f_create_fundamental_type (struct objfile *objfile, int typeid)
{
- register struct type *type = NULL;
+ struct type *type = NULL;
switch (typeid)
{
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index 28a96ebcb1a..f6b4263b5a2 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -60,7 +60,7 @@ f_print_type (struct type *type, const char *varstring,
struct ui_file *stream,
int show, int level)
{
- register enum type_code code;
+ enum type_code code;
int demangled_args;
f_type_print_base (type, stream, show, level);
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index f67a260d24c..cc337e9481e 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -47,7 +47,8 @@ static void f77_print_array (struct type *, char *, CORE_ADDR,
enum val_prettyprint);
static void f77_print_array_1 (int, int, struct type *, char *,
CORE_ADDR, struct ui_file *, int, int, int,
- enum val_prettyprint);
+ enum val_prettyprint,
+ int *elts);
static void f77_create_arrayprint_offset_tbl (struct type *,
struct ui_file *);
static void f77_get_dynamic_length_of_aggregate (struct type *);
@@ -271,31 +272,36 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream)
}
}
+
+
/* Actual function which prints out F77 arrays, Valaddr == address in
the superior. Address == the address in the inferior. */
-
static void
f77_print_array_1 (int nss, int ndimensions, struct type *type, char *valaddr,
CORE_ADDR address, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
+ int deref_ref, int recurse, enum val_prettyprint pretty,
+ int *elts)
{
int i;
if (nss != ndimensions)
{
- for (i = 0; i < F77_DIM_SIZE (nss); i++)
+ for (i = 0; (i < F77_DIM_SIZE (nss) && (*elts) < print_max); i++)
{
fprintf_filtered (stream, "( ");
f77_print_array_1 (nss + 1, ndimensions, TYPE_TARGET_TYPE (type),
valaddr + i * F77_DIM_OFFSET (nss),
address + i * F77_DIM_OFFSET (nss),
- stream, format, deref_ref, recurse, pretty);
+ stream, format, deref_ref, recurse, pretty, elts);
fprintf_filtered (stream, ") ");
}
+ if (*elts >= print_max && i < F77_DIM_SIZE (nss)) {
+ fprintf_filtered (stream, "...");
+ }
}
else
{
- for (i = 0; (i < F77_DIM_SIZE (nss) && i < print_max); i++)
+ for (i = 0; (i < F77_DIM_SIZE (nss) && (*elts) < print_max); i++, (*elts)++)
{
val_print (TYPE_TARGET_TYPE (type),
valaddr + i * F77_DIM_OFFSET (ndimensions),
@@ -306,7 +312,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, char *valaddr,
if (i != (F77_DIM_SIZE (nss) - 1))
fprintf_filtered (stream, ", ");
- if (i == print_max - 1)
+ if ((( *elts) == print_max - 1) && (i != (F77_DIM_SIZE (nss) - 1)))
fprintf_filtered (stream, "...");
}
}
@@ -321,6 +327,7 @@ f77_print_array (struct type *type, char *valaddr, CORE_ADDR address,
enum val_prettyprint pretty)
{
int ndimensions;
+ int elts = 0;
ndimensions = calc_f77_array_dims (type);
@@ -335,7 +342,7 @@ f77_print_array (struct type *type, char *valaddr, CORE_ADDR address,
f77_create_arrayprint_offset_tbl (type, stream);
f77_print_array_1 (1, ndimensions, type, valaddr, address, stream, format,
- deref_ref, recurse, pretty);
+ deref_ref, recurse, pretty, &elts);
}
@@ -357,7 +364,7 @@ f_val_print (struct type *type, char *valaddr, int embedded_offset,
CORE_ADDR address, struct ui_file *stream, int format,
int deref_ref, int recurse, enum val_prettyprint pretty)
{
- register unsigned int i = 0; /* Number of characters printed */
+ unsigned int i = 0; /* Number of characters printed */
struct type *elttype;
LONGEST val;
CORE_ADDR addr;
@@ -580,7 +587,7 @@ info_common_command (char *comname, int from_tty)
SAVED_F77_COMMON_PTR the_common;
COMMON_ENTRY_PTR entry;
struct frame_info *fi;
- register char *funname = 0;
+ char *funname = 0;
struct symbol *func;
/* We have been told to display the contents of F77 COMMON
@@ -624,7 +631,7 @@ info_common_command (char *comname, int from_tty)
}
else
{
- register struct minimal_symbol *msymbol =
+ struct minimal_symbol *msymbol =
lookup_minimal_symbol_by_pc (get_frame_pc (fi));
if (msymbol != NULL)
@@ -674,7 +681,7 @@ there_is_a_visible_common_named (char *comname)
{
SAVED_F77_COMMON_PTR the_common;
struct frame_info *fi;
- register char *funname = 0;
+ char *funname = 0;
struct symbol *func;
if (comname == NULL)
@@ -716,7 +723,7 @@ there_is_a_visible_common_named (char *comname)
}
else
{
- register struct minimal_symbol *msymbol =
+ struct minimal_symbol *msymbol =
lookup_minimal_symbol_by_pc (fi->pc);
if (msymbol != NULL)
diff --git a/gdb/findvar.c b/gdb/findvar.c
index d776bfe4e58..1489978886c 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -393,10 +393,10 @@ symbol_read_needs_frame (const struct symbol *sym)
struct value *
read_var_value (const struct symbol *var, struct frame_info *frame)
{
- register struct value *v;
+ struct value *v;
struct type *type = SYMBOL_TYPE (var);
CORE_ADDR addr;
- register int len;
+ int len;
v = allocate_value (type);
VALUE_LVAL (v) = lval_memory; /* The most likely possibility. */
@@ -404,8 +404,11 @@ read_var_value (const struct symbol *var, struct frame_info *frame)
len = TYPE_LENGTH (type);
+
+ /* FIXME drow/2003-09-06: this call to the selected frame should be
+ pushed upwards to the callers. */
if (frame == NULL)
- frame = deprecated_selected_frame;
+ frame = deprecated_safe_get_selected_frame ();
switch (SYMBOL_CLASS (var))
{
@@ -727,7 +730,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
address. */
struct value *
-locate_var_value (register struct symbol *var, struct frame_info *frame)
+locate_var_value (struct symbol *var, struct frame_info *frame)
{
CORE_ADDR addr = 0;
struct type *type = SYMBOL_TYPE (var);
diff --git a/gdb/frame.c b/gdb/frame.c
index 2b54ed78d5a..4e88018247f 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -135,9 +135,11 @@ struct frame_info
static int frame_debug;
-/* Flag to indicate whether backtraces should stop at main. */
+/* Flag to indicate whether backtraces should stop at main et.al. */
+
+static int backtrace_past_main;
+static unsigned int backtrace_limit = UINT_MAX;
-static int backtrace_below_main;
void
fprint_frame_id (struct ui_file *file, struct frame_id id)
@@ -915,12 +917,24 @@ get_selected_frame (void)
return deprecated_selected_frame;
}
+/* This is a variant of get_selected_frame which can be called when
+ the inferior does not have a frame; in that case it will return
+ NULL instead of calling error (). */
+
+struct frame_info *
+deprecated_safe_get_selected_frame (void)
+{
+ if (!target_has_registers || !target_has_stack || !target_has_memory)
+ return NULL;
+ return get_selected_frame ();
+}
+
/* Select frame FI (or NULL - to invalidate the current frame). */
void
select_frame (struct frame_info *fi)
{
- register struct symtab *s;
+ struct symtab *s;
deprecated_selected_frame = fi;
/* NOTE: cagney/2002-05-04: FI can be NULL. This occures when the
@@ -1075,9 +1089,9 @@ const struct frame_unwind *legacy_saved_regs_unwind = &legacy_saved_regs_unwinde
calculated rather than fetched). We will use not_lval for values
fetched from generic dummy frames.
- Set *ADDRP to the address, either in memory or as a REGISTER_BYTE
- offset into the registers array. If the value is stored in a dummy
- frame, set *ADDRP to zero.
+ Set *ADDRP to the address, either in memory or as a
+ DEPRECATED_REGISTER_BYTE offset into the registers array. If the
+ value is stored in a dummy frame, set *ADDRP to zero.
The argument RAW_BUFFER must point to aligned memory. */
@@ -1158,7 +1172,7 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized,
if (lval) /* found it in a live register */
*lval = lval_register;
if (addrp)
- *addrp = REGISTER_BYTE (regnum);
+ *addrp = DEPRECATED_REGISTER_BYTE (regnum);
if (raw_buffer)
deprecated_read_register_gen (regnum, raw_buffer);
}
@@ -1802,7 +1816,7 @@ get_prev_frame (struct frame_info *this_frame)
gdb_assert (this_frame != NULL);
if (this_frame->level >= 0
- && !backtrace_below_main
+ && !backtrace_past_main
&& inside_main_func (get_frame_pc (this_frame)))
/* Don't unwind past main(), bug always unwind the sentinel frame.
Note, this is done _before_ the frame has been marked as
@@ -1814,6 +1828,11 @@ get_prev_frame (struct frame_info *this_frame)
return NULL;
}
+ if (this_frame->level > backtrace_limit)
+ {
+ error ("Backtrace limit of %d exceeded", backtrace_limit);
+ }
+
/* If we're already inside the entry function for the main objfile,
then it isn't valid. Don't apply this test to a dummy frame -
dummy frame PC's typically land in the entry func. Don't apply
@@ -1825,8 +1844,9 @@ get_prev_frame (struct frame_info *this_frame)
checking for "main" in the minimal symbols. With that fixed
asm-source tests now stop in "main" instead of halting the
backtrace in wierd and wonderful ways somewhere inside the entry
- file. Suspect that inside_entry_file and inside_entry_func tests
- were added to work around that (now fixed) case. */
+ file. Suspect that deprecated_inside_entry_file and
+ inside_entry_func tests were added to work around that (now
+ fixed) case. */
/* NOTE: cagney/2003-07-15: danielj (if I'm reading it right)
suggested having the inside_entry_func test use the
inside_main_func msymbol trick (along with entry_point_address I
@@ -1865,7 +1885,6 @@ get_prev_frame (struct frame_info *this_frame)
}
this_frame->prev_p = 1;
-#if 0
/* If we're inside the entry file, it isn't valid. Don't apply this
test to a dummy frame - dummy frame PC's typically land in the
entry file. Don't apply this test to the sentinel frame.
@@ -1877,17 +1896,19 @@ get_prev_frame (struct frame_info *this_frame)
/* NOTE: cagney/2003-01-10: If there is a way of disabling this test
then it should probably be moved to before the ->prev_p test,
above. */
- /* NOTE: vinschen/2003-04-01: Disabled. It turns out that the call to
- inside_entry_file destroys a meaningful backtrace under some
- conditions. E. g. the backtrace tests in the asm-source testcase
- are broken for some targets. In this test the functions are all
- implemented as part of one file and the testcase is not necessarily
- linked with a start file (depending on the target). What happens is,
- that the first frame is printed normaly and following frames are
- treated as being inside the enttry file then. This way, only the
- #0 frame is printed in the backtrace output. */
- if (this_frame->type != DUMMY_FRAME && this_frame->level >= 0
- && inside_entry_file (get_frame_pc (this_frame)))
+ /* NOTE: vinschen/2003-04-01: Disabled. It turns out that the call
+ to deprecated_inside_entry_file destroys a meaningful backtrace
+ under some conditions. E. g. the backtrace tests in the
+ asm-source testcase are broken for some targets. In this test
+ the functions are all implemented as part of one file and the
+ testcase is not necessarily linked with a start file (depending
+ on the target). What happens is, that the first frame is printed
+ normaly and following frames are treated as being inside the
+ enttry file then. This way, only the #0 frame is printed in the
+ backtrace output. */
+ if (0
+ && this_frame->type != DUMMY_FRAME && this_frame->level >= 0
+ && deprecated_inside_entry_file (get_frame_pc (this_frame)))
{
if (frame_debug)
{
@@ -1897,7 +1918,6 @@ get_prev_frame (struct frame_info *this_frame)
}
return NULL;
}
-#endif
/* If any of the old frame initialization methods are around, use
the legacy get_prev_frame method. */
@@ -2272,7 +2292,8 @@ deprecated_set_frame_context (struct frame_info *fi,
struct frame_info *
deprecated_frame_xmalloc (void)
{
- struct frame_info *frame = FRAME_OBSTACK_ZALLOC (struct frame_info);
+ struct frame_info *frame = XMALLOC (struct frame_info);
+ memset (frame, 0, sizeof (*frame));
frame->this_id.p = 1;
return frame;
}
@@ -2370,18 +2391,39 @@ legacy_frame_p (struct gdbarch *current_gdbarch)
extern initialize_file_ftype _initialize_frame; /* -Wmissing-prototypes */
+static struct cmd_list_element *set_backtrace_cmdlist;
+static struct cmd_list_element *show_backtrace_cmdlist;
+
+static void
+set_backtrace_cmd (char *args, int from_tty)
+{
+ help_list (set_backtrace_cmdlist, "set backtrace ", -1, gdb_stdout);
+}
+
+static void
+show_backtrace_cmd (char *args, int from_tty)
+{
+ cmd_show_list (show_backtrace_cmdlist, from_tty, "");
+}
+
void
_initialize_frame (void)
{
obstack_init (&frame_cache_obstack);
- /* FIXME: cagney/2003-01-19: This command needs a rename. Suggest
- `set backtrace {past,beyond,...}-main'. Also suggest adding `set
- backtrace ...-start' to control backtraces past start. The
- problem with `below' is that it stops the `up' command. */
-
- add_setshow_boolean_cmd ("backtrace-below-main", class_obscure,
- &backtrace_below_main, "\
+ add_prefix_cmd ("backtrace", class_maintenance, set_backtrace_cmd, "\
+Set backtrace specific variables.\n\
+Configure backtrace variables such as the backtrace limit",
+ &set_backtrace_cmdlist, "set backtrace ",
+ 0/*allow-unknown*/, &setlist);
+ add_prefix_cmd ("backtrace", class_maintenance, show_backtrace_cmd, "\
+Show backtrace specific variables\n\
+Show backtrace variables such as the backtrace limit",
+ &show_backtrace_cmdlist, "show backtrace ",
+ 0/*allow-unknown*/, &showlist);
+
+ add_setshow_boolean_cmd ("past-main", class_obscure,
+ &backtrace_past_main, "\
Set whether backtraces should continue past \"main\".\n\
Normally the caller of \"main\" is not of interest, so GDB will terminate\n\
the backtrace at \"main\". Set this variable if you need to see the rest\n\
@@ -2390,8 +2432,17 @@ Show whether backtraces should continue past \"main\".\n\
Normally the caller of \"main\" is not of interest, so GDB will terminate\n\
the backtrace at \"main\". Set this variable if you need to see the rest\n\
of the stack trace.",
- NULL, NULL, &setlist, &showlist);
-
+ NULL, NULL, &set_backtrace_cmdlist,
+ &show_backtrace_cmdlist);
+
+ add_setshow_uinteger_cmd ("limit", class_obscure,
+ &backtrace_limit, "\
+Set an upper bound on the number of backtrace levels.\n\
+No more than the specified number of frames can be displayed or examined.\n\
+Zero is unlimited.", "\
+Show the upper bound on the number of backtrace levels.",
+ NULL, NULL, &set_backtrace_cmdlist,
+ &show_backtrace_cmdlist);
/* Debug this files internals. */
add_show_from_set (add_set_cmd ("frame", class_maintenance, var_zinteger,
diff --git a/gdb/frame.h b/gdb/frame.h
index 27a13dc6e01..7ce81d0a913 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -639,6 +639,19 @@ extern void return_command (char *, int);
extern struct frame_info *deprecated_selected_frame;
+/* NOTE: drow/2003-09-06:
+
+ This function is "a step sideways" for uses of deprecated_selected_frame.
+ They should be fixed as above, but meanwhile, we needed a solution for
+ cases where functions are called with a NULL frame meaning either "the
+ program is not running" or "use the selected frame". Lazy building of
+ deprecated_selected_frame confuses the situation, because now
+ deprecated_selected_frame can be NULL even when the inferior is running.
+
+ This function calls get_selected_frame if the inferior should have a
+ frame, or returns NULL otherwise. */
+
+extern struct frame_info *deprecated_safe_get_selected_frame (void);
/* Create a frame using the specified BASE and PC. */
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index e4dc885276e..fe53e56f830 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -19,11 +19,17 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "gdb_string.h"
#include "inferior.h"
#include "symfile.h" /* for entry_point_address */
#include "gdbcore.h"
#include "arch-utils.h"
#include "regcache.h"
+#include "frame.h"
+#include "frame-unwind.h"
+#include "frame-base.h"
+#include "trad-frame.h"
+#include "dis-asm.h"
extern void _initialize_frv_tdep (void);
@@ -35,11 +41,8 @@ static gdbarch_skip_prologue_ftype frv_skip_prologue;
static gdbarch_deprecated_extract_return_value_ftype frv_extract_return_value;
static gdbarch_deprecated_extract_struct_value_address_ftype frv_extract_struct_value_address;
static gdbarch_frameless_function_invocation_ftype frv_frameless_function_invocation;
-static gdbarch_init_extra_frame_info_ftype stupid_useless_init_extra_frame_info;
-static gdbarch_push_arguments_ftype frv_push_arguments;
-static gdbarch_saved_pc_after_call_ftype frv_saved_pc_after_call;
-
-static void frv_pop_frame_regular (struct frame_info *frame);
+static gdbarch_deprecated_push_arguments_ftype frv_push_arguments;
+static gdbarch_deprecated_saved_pc_after_call_ftype frv_saved_pc_after_call;
/* Register numbers. You can change these as needed, but don't forget
to update the simulator accordingly. */
@@ -82,17 +85,17 @@ static LONGEST frv_call_dummy_words[] =
{0};
-/* The contents of this structure can only be trusted after we've
- frv_frame_init_saved_regs on the frame. */
-struct frame_extra_info
+struct frv_unwind_cache /* was struct frame_extra_info */
{
- /* The offset from our frame pointer to our caller's stack
- pointer. */
- int fp_to_callers_sp_offset;
+ /* The previous frame's inner-most stack address. Used as this
+ frame ID's stack_addr. */
+ CORE_ADDR prev_sp;
+
+ /* The frame's base, optionally used by the high-level debug info. */
+ CORE_ADDR base;
- /* Non-zero if we've saved our return address on the stack yet.
- Zero if it's still sitting in the link register. */
- int lr_saved_on_stack;
+ /* Table indicating the location of each and every register. */
+ struct trad_frame_saved_reg *saved_regs;
};
@@ -268,47 +271,6 @@ frv_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenp)
return breakpoint;
}
-static CORE_ADDR
-frv_frame_chain (struct frame_info *frame)
-{
- CORE_ADDR saved_fp_addr;
-
- if (frame->saved_regs && frame->saved_regs[fp_regnum] != 0)
- saved_fp_addr = frame->saved_regs[fp_regnum];
- else
- /* Just assume it was saved in the usual place. */
- saved_fp_addr = frame->frame;
-
- return read_memory_integer (saved_fp_addr, 4);
-}
-
-static CORE_ADDR
-frv_frame_saved_pc (struct frame_info *frame)
-{
- frv_frame_init_saved_regs (frame);
-
- /* Perhaps the prologue analyzer recorded where it was stored.
- (As of 14 Oct 2001, it never does.) */
- if (frame->saved_regs && frame->saved_regs[pc_regnum] != 0)
- return read_memory_integer (frame->saved_regs[pc_regnum], 4);
-
- /* If the prologue analyzer tells us the link register was saved on
- the stack, get it from there. */
- if (frame->extra_info->lr_saved_on_stack)
- return read_memory_integer (frame->frame + 8, 4);
-
- /* Otherwise, it's still in LR.
- However, if FRAME isn't the youngest frame, this is kind of
- suspicious --- if this frame called somebody else, then its LR
- has certainly been overwritten. */
- if (! frame->next)
- return read_register (lr_regnum);
-
- /* By default, assume it's saved in the standard place, relative to
- the frame pointer. */
- return read_memory_integer (frame->frame + 8, 4);
-}
-
/* Return true if REG is a caller-saves ("scratch") register,
false otherwise. */
@@ -351,7 +313,8 @@ is_argument_reg (int reg)
arguments in any frame but the top, you'll need to do this serious
prologue analysis. */
static CORE_ADDR
-frv_analyze_prologue (CORE_ADDR pc, struct frame_info *frame)
+frv_analyze_prologue (CORE_ADDR pc, struct frame_info *next_frame,
+ struct frv_unwind_cache *info)
{
/* When writing out instruction bitpatterns, we use the following
letters to label instruction fields:
@@ -376,12 +339,16 @@ frv_analyze_prologue (CORE_ADDR pc, struct frame_info *frame)
/* Total size of frame prior to any alloca operations. */
int framesize = 0;
+ /* Flag indicating if lr has been saved on the stack. */
+ int lr_saved_on_stack = 0;
+
/* The number of the general-purpose register we saved the return
address ("link register") in, or -1 if we haven't moved it yet. */
int lr_save_reg = -1;
- /* Non-zero iff we've saved the LR onto the stack. */
- int lr_saved_on_stack = 0;
+ /* Offset (from sp) at which lr has been saved on the stack. */
+
+ int lr_sp_offset = 0;
/* If gr_saved[i] is non-zero, then we've noticed that general
register i has been saved at gr_sp_offset[i] from the stack
@@ -391,7 +358,7 @@ frv_analyze_prologue (CORE_ADDR pc, struct frame_info *frame)
memset (gr_saved, 0, sizeof (gr_saved));
- while (! frame || pc < frame->pc)
+ while (! next_frame || pc < frame_pc_unwind (next_frame))
{
LONGEST op = read_memory_integer (pc, 4);
@@ -623,7 +590,10 @@ frv_analyze_prologue (CORE_ADDR pc, struct frame_info *frame)
/* Saving the old FP in the new frame (relative to the SP). */
if (gr_k == fp_regnum && gr_i == sp_regnum)
- ;
+ {
+ gr_saved[fp_regnum] = 1;
+ gr_sp_offset[fp_regnum] = offset;
+ }
/* Saving callee-saves register(s) on the stack, relative to
the SP. */
@@ -631,13 +601,22 @@ frv_analyze_prologue (CORE_ADDR pc, struct frame_info *frame)
&& is_callee_saves_reg (gr_k))
{
gr_saved[gr_k] = 1;
- gr_sp_offset[gr_k] = offset;
+ if (gr_i == sp_regnum)
+ gr_sp_offset[gr_k] = offset;
+ else
+ gr_sp_offset[gr_k] = offset + fp_offset;
}
/* Saving the scratch register holding the return address. */
else if (lr_save_reg != -1
&& gr_k == lr_save_reg)
- lr_saved_on_stack = 1;
+ {
+ lr_saved_on_stack = 1;
+ if (gr_i == sp_regnum)
+ lr_sp_offset = offset;
+ else
+ lr_sp_offset = offset + fp_offset;
+ }
/* Spilling int-sized arguments to the stack. */
else if (is_argument_reg (gr_k))
@@ -657,9 +636,10 @@ frv_analyze_prologue (CORE_ADDR pc, struct frame_info *frame)
pc += 4;
}
- if (frame)
+ if (next_frame && info)
{
- frame->extra_info->lr_saved_on_stack = lr_saved_on_stack;
+ int i;
+ ULONGEST this_base;
/* If we know the relationship between the stack and frame
pointers, record the addresses of the registers we noticed.
@@ -667,16 +647,29 @@ frv_analyze_prologue (CORE_ADDR pc, struct frame_info *frame)
because instructions may save relative to the SP, but we need
their addresses relative to the FP. */
if (fp_set)
- {
- int i;
+ frame_unwind_unsigned_register (next_frame, fp_regnum, &this_base);
+ else
+ frame_unwind_unsigned_register (next_frame, sp_regnum, &this_base);
- for (i = 0; i < 64; i++)
- if (gr_saved[i])
- frame->saved_regs[i] = (frame->frame
- - fp_offset + gr_sp_offset[i]);
+ for (i = 0; i < 64; i++)
+ if (gr_saved[i])
+ info->saved_regs[i].addr = this_base - fp_offset + gr_sp_offset[i];
- frame->extra_info->fp_to_callers_sp_offset = framesize - fp_offset;
- }
+ info->prev_sp = this_base - fp_offset + framesize;
+ info->base = this_base;
+
+ /* If LR was saved on the stack, record its location. */
+ if (lr_saved_on_stack)
+ info->saved_regs[lr_regnum].addr = this_base - fp_offset + lr_sp_offset;
+
+ /* The call instruction moves the caller's PC in the callee's LR.
+ Since this is an unwind, do the reverse. Copy the location of LR
+ into PC (the address / regnum) so that a request for PC will be
+ converted into a request for the LR. */
+ info->saved_regs[pc_regnum] = info->saved_regs[lr_regnum];
+
+ /* Save the previous frame's computed SP value. */
+ trad_frame_set_value (info->saved_regs, sp_regnum, info->prev_sp);
}
return pc;
@@ -709,28 +702,33 @@ frv_skip_prologue (CORE_ADDR pc)
If we didn't find a real source location past that, then
do a full analysis of the prologue. */
if (new_pc < pc + 20)
- new_pc = frv_analyze_prologue (pc, 0);
+ new_pc = frv_analyze_prologue (pc, 0, 0);
return new_pc;
}
-static void
-frv_frame_init_saved_regs (struct frame_info *frame)
+
+static struct frv_unwind_cache *
+frv_frame_unwind_cache (struct frame_info *next_frame,
+ void **this_prologue_cache)
{
- if (frame->saved_regs)
- return;
+ struct gdbarch *gdbarch = get_frame_arch (next_frame);
+ CORE_ADDR pc;
+ ULONGEST prev_sp;
+ ULONGEST this_base;
+ struct frv_unwind_cache *info;
- frame_saved_regs_zalloc (frame);
- frame->saved_regs[fp_regnum] = frame->frame;
+ if ((*this_prologue_cache))
+ return (*this_prologue_cache);
- /* Find the beginning of this function, so we can analyze its
- prologue. */
- {
- CORE_ADDR func_addr, func_end;
+ info = FRAME_OBSTACK_ZALLOC (struct frv_unwind_cache);
+ (*this_prologue_cache) = info;
+ info->saved_regs = trad_frame_alloc_saved_regs (next_frame);
+
+ /* Prologue analysis does the rest... */
+ frv_analyze_prologue (frame_func_unwind (next_frame), next_frame, info);
- if (find_pc_partial_function (frame->pc, NULL, &func_addr, &func_end))
- frv_analyze_prologue (func_addr, frame);
- }
+ return info;
}
static void
@@ -745,7 +743,8 @@ frv_extract_return_value (struct type *type, char *regbuf, char *valbuf)
static CORE_ADDR
frv_extract_struct_value_address (char *regbuf)
{
- return extract_unsigned_integer (regbuf + frv_register_byte (struct_return_regnum),
+ return extract_unsigned_integer (regbuf +
+ frv_register_byte (struct_return_regnum),
4);
}
@@ -761,26 +760,21 @@ frv_frameless_function_invocation (struct frame_info *frame)
return frameless_look_for_prologue (frame);
}
-static CORE_ADDR
-frv_saved_pc_after_call (struct frame_info *frame)
-{
- return read_register (lr_regnum);
-}
+#define ROUND_UP(n,a) (((n)+(a)-1) & ~((a)-1))
+#define ROUND_DOWN(n,a) ((n) & ~((a)-1))
-static void
-frv_init_extra_frame_info (int fromleaf, struct frame_info *frame)
+static CORE_ADDR
+frv_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
{
- frame_extra_info_zalloc (frame, sizeof (struct frame_extra_info));
- frame->extra_info->fp_to_callers_sp_offset = 0;
- frame->extra_info->lr_saved_on_stack = 0;
+ /* Require dword alignment. */
+ return ROUND_DOWN (sp, 8);
}
-#define ROUND_UP(n,a) (((n)+(a)-1) & ~((a)-1))
-#define ROUND_DOWN(n,a) ((n) & ~((a)-1))
-
static CORE_ADDR
-frv_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
- int struct_return, CORE_ADDR struct_addr)
+frv_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+ struct regcache *regcache, CORE_ADDR bp_addr,
+ int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
{
int argreg;
int argnum;
@@ -815,7 +809,8 @@ frv_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
argreg = 8;
if (struct_return)
- write_register (struct_return_regnum, struct_addr);
+ regcache_cooked_write_unsigned (regcache, struct_return_regnum,
+ struct_addr);
for (argnum = 0; argnum < nargs; ++argnum)
{
@@ -847,7 +842,7 @@ frv_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
printf(" Argnum %d data %x -> reg %d\n",
argnum, (int) regval, argreg);
#endif
- write_register (argreg, regval);
+ regcache_cooked_write_unsigned (regcache, argreg, regval);
++argreg;
}
else
@@ -863,13 +858,14 @@ frv_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
val += partial_len;
}
}
- return sp;
-}
-static CORE_ADDR
-frv_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
-{
- write_register (lr_regnum, CALL_DUMMY_ADDRESS ());
+ /* Set the return address. For the frv, the return breakpoint is
+ always at BP_ADDR. */
+ regcache_cooked_write_unsigned (regcache, lr_regnum, bp_addr);
+
+ /* Finally, update the SP register. */
+ regcache_cooked_write_unsigned (regcache, sp_regnum, sp);
+
return sp;
}
@@ -889,46 +885,6 @@ frv_store_return_value (struct type *type, char *valbuf)
"Don't know how to return a %d-byte value.", length);
}
-static void
-frv_pop_frame (void)
-{
- generic_pop_current_frame (frv_pop_frame_regular);
-}
-
-static void
-frv_pop_frame_regular (struct frame_info *frame)
-{
- CORE_ADDR fp;
- int regno;
-
- fp = frame->frame;
-
- frv_frame_init_saved_regs (frame);
-
- write_register (pc_regnum, frv_frame_saved_pc (frame));
- for (regno = 0; regno < frv_num_regs; ++regno)
- {
- if (frame->saved_regs[regno]
- && regno != pc_regnum
- && regno != sp_regnum)
- {
- write_register (regno,
- read_memory_integer (frame->saved_regs[regno], 4));
- }
- }
- write_register (sp_regnum, fp + frame->extra_info->fp_to_callers_sp_offset);
- flush_cached_frames ();
-}
-
-
-static void
-frv_remote_translate_xfer_address (CORE_ADDR memaddr, int nr_bytes,
- CORE_ADDR *targ_addr, int *targ_len)
-{
- *targ_addr = memaddr;
- *targ_len = nr_bytes;
-}
-
/* Hardware watchpoint / breakpoint support for the FR500
and FR400. */
@@ -985,6 +941,120 @@ frv_stopped_data_address (void)
return 0;
}
+static CORE_ADDR
+frv_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+ return frame_unwind_register_unsigned (next_frame, pc_regnum);
+}
+
+/* Given a GDB frame, determine the address of the calling function's
+ frame. This will be used to create a new GDB frame struct. */
+
+static void
+frv_frame_this_id (struct frame_info *next_frame,
+ void **this_prologue_cache, struct frame_id *this_id)
+{
+ struct frv_unwind_cache *info
+ = frv_frame_unwind_cache (next_frame, this_prologue_cache);
+ CORE_ADDR base;
+ CORE_ADDR func;
+ struct minimal_symbol *msym_stack;
+ struct frame_id id;
+
+ /* The FUNC is easy. */
+ func = frame_func_unwind (next_frame);
+
+ /* This is meant to halt the backtrace at "_start". Make sure we
+ don't halt it at a generic dummy frame. */
+ if (deprecated_inside_entry_file (func))
+ return;
+
+ /* Check if the stack is empty. */
+ msym_stack = lookup_minimal_symbol ("_stack", NULL, NULL);
+ if (msym_stack && info->base == SYMBOL_VALUE_ADDRESS (msym_stack))
+ return;
+
+ /* Hopefully the prologue analysis either correctly determined the
+ frame's base (which is the SP from the previous frame), or set
+ that base to "NULL". */
+ base = info->prev_sp;
+ if (base == 0)
+ return;
+
+ id = frame_id_build (base, func);
+
+ /* Check that we're not going round in circles with the same frame
+ ID (but avoid applying the test to sentinel frames which do go
+ round in circles). Can't use frame_id_eq() as that doesn't yet
+ compare the frame's PC value. */
+ if (frame_relative_level (next_frame) >= 0
+ && get_frame_type (next_frame) != DUMMY_FRAME
+ && frame_id_eq (get_frame_id (next_frame), id))
+ return;
+
+ (*this_id) = id;
+}
+
+static void
+frv_frame_prev_register (struct frame_info *next_frame,
+ void **this_prologue_cache,
+ int regnum, int *optimizedp,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnump, void *bufferp)
+{
+ struct frv_unwind_cache *info
+ = frv_frame_unwind_cache (next_frame, this_prologue_cache);
+ trad_frame_prev_register (next_frame, info->saved_regs, regnum,
+ optimizedp, lvalp, addrp, realnump, bufferp);
+}
+
+static const struct frame_unwind frv_frame_unwind = {
+ NORMAL_FRAME,
+ frv_frame_this_id,
+ frv_frame_prev_register
+};
+
+static const struct frame_unwind *
+frv_frame_sniffer (struct frame_info *next_frame)
+{
+ return &frv_frame_unwind;
+}
+
+static CORE_ADDR
+frv_frame_base_address (struct frame_info *next_frame, void **this_cache)
+{
+ struct frv_unwind_cache *info
+ = frv_frame_unwind_cache (next_frame, this_cache);
+ return info->base;
+}
+
+static const struct frame_base frv_frame_base = {
+ &frv_frame_unwind,
+ frv_frame_base_address,
+ frv_frame_base_address,
+ frv_frame_base_address
+};
+
+static CORE_ADDR
+frv_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+ return frame_unwind_register_unsigned (next_frame, sp_regnum);
+}
+
+
+/* Assuming NEXT_FRAME->prev is a dummy, return the frame ID of that
+ dummy frame. The frame ID's base needs to match the TOS value
+ saved by save_dummy_frame_tos(), and the PC match the dummy frame's
+ breakpoint. */
+
+static struct frame_id
+frv_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+ return frame_id_build (frv_unwind_sp (gdbarch, next_frame),
+ frame_pc_unwind (next_frame));
+}
+
+
static struct gdbarch *
frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
@@ -1021,10 +1091,6 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
gdbarch = gdbarch_alloc (&info, var);
- /* NOTE: cagney/2002-12-06: This can be deleted when this arch is
- ready to unwind the PC first (see frame.c:get_prev_frame()). */
- set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default);
-
set_gdbarch_short_bit (gdbarch, 16);
set_gdbarch_int_bit (gdbarch, 32);
set_gdbarch_long_bit (gdbarch, 32);
@@ -1055,13 +1121,6 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_frameless_function_invocation (gdbarch, frv_frameless_function_invocation);
- set_gdbarch_deprecated_saved_pc_after_call (gdbarch, frv_saved_pc_after_call);
-
- set_gdbarch_deprecated_frame_chain (gdbarch, frv_frame_chain);
- set_gdbarch_deprecated_frame_saved_pc (gdbarch, frv_frame_saved_pc);
-
- set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, frv_frame_init_saved_regs);
-
set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
set_gdbarch_deprecated_extract_return_value (gdbarch, frv_extract_return_value);
@@ -1069,28 +1128,27 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_store_return_value (gdbarch, frv_store_return_value);
set_gdbarch_deprecated_extract_struct_value_address (gdbarch, frv_extract_struct_value_address);
- /* Settings for calling functions in the inferior. */
- set_gdbarch_deprecated_push_arguments (gdbarch, frv_push_arguments);
- set_gdbarch_deprecated_push_return_address (gdbarch, frv_push_return_address);
- set_gdbarch_deprecated_pop_frame (gdbarch, frv_pop_frame);
+ /* Frame stuff. */
+ set_gdbarch_unwind_pc (gdbarch, frv_unwind_pc);
+ set_gdbarch_unwind_sp (gdbarch, frv_unwind_sp);
+ set_gdbarch_frame_align (gdbarch, frv_frame_align);
+ frame_unwind_append_sniffer (gdbarch, frv_frame_sniffer);
+ frame_base_set_default (gdbarch, &frv_frame_base);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, frv_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (frv_call_dummy_words));
- set_gdbarch_deprecated_init_extra_frame_info (gdbarch, frv_init_extra_frame_info);
+ /* Settings for calling functions in the inferior. */
+ set_gdbarch_push_dummy_call (gdbarch, frv_push_dummy_call);
+ set_gdbarch_unwind_dummy_id (gdbarch, frv_unwind_dummy_id);
/* Settings that should be unnecessary. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
- set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
-
- set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_remote_translate_xfer_address
- (gdbarch, frv_remote_translate_xfer_address);
+ (gdbarch, generic_remote_translate_xfer_address);
/* Hardware watchpoint / breakpoint support. */
switch (info.bfd_arch_info->mach)
@@ -1117,6 +1175,8 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
break;
}
+ set_gdbarch_print_insn (gdbarch, print_insn_frv);
+
return gdbarch;
}
@@ -1124,8 +1184,4 @@ void
_initialize_frv_tdep (void)
{
register_gdbarch_init (bfd_arch_frv, frv_gdbarch_init);
-
- deprecated_tm_print_insn = print_insn_frv;
}
-
-
diff --git a/gdb/gcore.c b/gdb/gcore.c
index 6a0edbf51e1..5bf09fdbe60 100644
--- a/gdb/gcore.c
+++ b/gdb/gcore.c
@@ -20,21 +20,23 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
-#include "cli/cli-decode.h"
+#include "elf-bfd.h"
+#include "infcall.h"
#include "inferior.h"
#include "gdbcore.h"
-#include "elf-bfd.h"
-#include "symfile.h"
#include "objfiles.h"
-#include "infcall.h"
+#include "symfile.h"
+
+#include "cli/cli-decode.h"
-static char *default_gcore_target (void);
-static enum bfd_architecture default_gcore_arch (void);
-static unsigned long default_gcore_mach (void);
-static int gcore_memory_sections (bfd *);
+#include "gdb_assert.h"
-/* Function: gcore_command
- Generate a core file from the inferior process. */
+static char *default_gcore_target (void);
+static enum bfd_architecture default_gcore_arch (void);
+static unsigned long default_gcore_mach (void);
+static int gcore_memory_sections (bfd *);
+
+/* Generate a core file from the inferior process. */
static void
gcore_command (char *args, int from_tty)
@@ -47,7 +49,7 @@ gcore_command (char *args, int from_tty)
int note_size = 0;
/* No use generating a corefile without a target process. */
- if (!(target_has_execution))
+ if (!target_has_execution)
noprocess ();
if (args && *args)
@@ -63,25 +65,25 @@ gcore_command (char *args, int from_tty)
fprintf_filtered (gdb_stdout,
"Opening corefile '%s' for output.\n", corefilename);
- /* Open the output file. */
- if (!(obfd = bfd_openw (corefilename, default_gcore_target ())))
- {
- error ("Failed to open '%s' for output.", corefilename);
- }
+ /* Open the output file. */
+ obfd = bfd_openw (corefilename, default_gcore_target ());
+ if (!obfd)
+ error ("Failed to open '%s' for output.", corefilename);
- /* Need a cleanup that will close the file (FIXME: delete it?). */
+ /* Need a cleanup that will close the file (FIXME: delete it?). */
old_chain = make_cleanup_bfd_close (obfd);
bfd_set_format (obfd, bfd_core);
bfd_set_arch_mach (obfd, default_gcore_arch (), default_gcore_mach ());
- /* An external target method must build the notes section. */
- note_data = (char *) target_make_corefile_notes (obfd, &note_size);
+ /* An external target method must build the notes section. */
+ note_data = target_make_corefile_notes (obfd, &note_size);
- /* Create the note section. */
+ /* Create the note section. */
if (note_data != NULL && note_size != 0)
{
- if ((note_sec = bfd_make_section_anyway (obfd, "note0")) == NULL)
+ note_sec = bfd_make_section_anyway (obfd, "note0");
+ if (note_sec == NULL)
error ("Failed to create 'note' section for corefile: %s",
bfd_errmsg (bfd_get_error ()));
@@ -92,25 +94,21 @@ gcore_command (char *args, int from_tty)
bfd_set_section_size (obfd, note_sec, note_size);
}
- /* Now create the memory/load sections. */
+ /* Now create the memory/load sections. */
if (gcore_memory_sections (obfd) == 0)
error ("gcore: failed to get corefile memory sections from target.");
- /* Write out the contents of the note section. */
+ /* Write out the contents of the note section. */
if (note_data != NULL && note_size != 0)
{
if (!bfd_set_section_contents (obfd, note_sec, note_data, 0, note_size))
- {
- warning ("writing note section (%s)",
- bfd_errmsg (bfd_get_error ()));
- }
+ warning ("writing note section (%s)", bfd_errmsg (bfd_get_error ()));
}
- /* Succeeded. */
- fprintf_filtered (gdb_stdout,
- "Saved corefile %s\n", corefilename);
+ /* Succeeded. */
+ fprintf_filtered (gdb_stdout, "Saved corefile %s\n", corefilename);
- /* Clean-ups will close the output file and free malloc memory. */
+ /* Clean-ups will close the output file and free malloc memory. */
do_cleanups (old_chain);
return;
}
@@ -118,11 +116,11 @@ gcore_command (char *args, int from_tty)
static unsigned long
default_gcore_mach (void)
{
-#if 1 /* See if this even matters... */
+#if 1 /* See if this even matters... */
return 0;
#else
#ifdef TARGET_ARCHITECTURE
- const struct bfd_arch_info * bfdarch = TARGET_ARCHITECTURE;
+ const struct bfd_arch_info *bfdarch = TARGET_ARCHITECTURE;
if (bfdarch != NULL)
return bfdarch->mach;
@@ -152,65 +150,64 @@ default_gcore_arch (void)
static char *
default_gcore_target (void)
{
- /* FIXME -- this may only work for ELF targets. */
+ /* FIXME: This may only work for ELF targets. */
if (exec_bfd == NULL)
return NULL;
else
return bfd_get_target (exec_bfd);
}
-/* Function: derive_stack_segment
-
- Derive a reasonable stack segment by unwinding the target stack.
-
- Returns 0 for failure, 1 for success. */
+/* Derive a reasonable stack segment by unwinding the target stack,
+ and store its limits in *BOTTOM and *TOP. Return non-zero if
+ successful. */
static int
derive_stack_segment (bfd_vma *bottom, bfd_vma *top)
{
- bfd_vma tmp_vma;
struct frame_info *fi, *tmp_fi;
- if (bottom == NULL || top == NULL)
- return 0; /* Paranoia. */
+ gdb_assert (bottom);
+ gdb_assert (top);
+ /* Can't succeed without stack and registers. */
if (!target_has_stack || !target_has_registers)
- return 0; /* Can't succeed without stack and registers. */
+ return 0;
- if ((fi = get_current_frame ()) == NULL)
- return 0; /* Can't succeed without current frame. */
+ /* Can't succeed without current frame. */
+ fi = get_current_frame ();
+ if (fi == NULL)
+ return 0;
- /* Save frame pointer of TOS frame. */
+ /* Save frame pointer of TOS frame. */
*top = get_frame_base (fi);
- /* If current stack pointer is more "inner", use that instead. */
+ /* If current stack pointer is more "inner", use that instead. */
if (INNER_THAN (read_sp (), *top))
*top = read_sp ();
- /* Find prev-most frame. */
+ /* Find prev-most frame. */
while ((tmp_fi = get_prev_frame (fi)) != NULL)
fi = tmp_fi;
- /* Save frame pointer of prev-most frame. */
+ /* Save frame pointer of prev-most frame. */
*bottom = get_frame_base (fi);
- /* Now canonicalize their order, so that 'bottom' is a lower address
- (as opposed to a lower stack frame). */
+ /* Now canonicalize their order, so that BOTTOM is a lower address
+ (as opposed to a lower stack frame). */
if (*bottom > *top)
{
+ bfd_vma tmp_vma;
+
tmp_vma = *top;
*top = *bottom;
*bottom = tmp_vma;
}
- return 1; /* success */
+ return 1;
}
-/* Function: derive_heap_segment
-
- Derive a reasonable heap segment by looking at sbrk and
- the static data sections.
-
- Returns 0 for failure, 1 for success. */
+/* Derive a reasonable heap segment for ABFD by looking at sbrk and
+ the static data sections. Store its limits in *BOTTOM and *TOP.
+ Return non-zero if successful. */
static int
derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
@@ -222,23 +219,29 @@ derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
bfd_vma sec_vaddr;
asection *sec;
- if (bottom == NULL || top == NULL)
- return 0; /* Paranoia. */
+ gdb_assert (bottom);
+ gdb_assert (top);
+ /* This function depends on being able to call a function in the
+ inferior. */
if (!target_has_execution)
- return 0; /* This function depends on being able
- to call a function in the inferior. */
+ return 0;
+
+ /* The following code assumes that the link map is arranged as
+ follows (low to high addresses):
- /* Assumption: link map is arranged as follows (low to high addresses):
- text sections
- data sections (including bss)
- heap
- */
+ ---------------------------------
+ | text sections |
+ ---------------------------------
+ | data sections (including bss) |
+ ---------------------------------
+ | heap |
+ --------------------------------- */
for (sec = abfd->sections; sec; sec = sec->next)
{
- if (bfd_get_section_flags (abfd, sec) & SEC_DATA ||
- strcmp (".bss", bfd_section_name (abfd, sec)) == 0)
+ if (bfd_get_section_flags (abfd, sec) & SEC_DATA
+ || strcmp (".bss", bfd_section_name (abfd, sec)) == 0)
{
sec_vaddr = bfd_get_section_vma (abfd, sec);
sec_size = bfd_get_section_size_before_reloc (sec);
@@ -246,35 +249,40 @@ derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
top_of_data_memory = sec_vaddr + sec_size;
}
}
+
/* Now get the top-of-heap by calling sbrk in the inferior. */
if (lookup_minimal_symbol ("sbrk", NULL, NULL) != NULL)
{
- if ((sbrk = find_function_in_inferior ("sbrk")) == NULL)
+ sbrk = find_function_in_inferior ("sbrk");
+ if (sbrk == NULL)
return 0;
}
else if (lookup_minimal_symbol ("_sbrk", NULL, NULL) != NULL)
{
- if ((sbrk = find_function_in_inferior ("_sbrk")) == NULL)
+ sbrk = find_function_in_inferior ("_sbrk");
+ if (sbrk == NULL)
return 0;
}
else
return 0;
- if ((zero = value_from_longest (builtin_type_int, (LONGEST) 0)) == NULL)
- return 0;
- if ((sbrk = call_function_by_hand (sbrk, 1, &zero)) == NULL)
+ zero = value_from_longest (builtin_type_int, 0);
+ gdb_assert (zero);
+ sbrk = call_function_by_hand (sbrk, 1, &zero);
+ if (sbrk == NULL)
return 0;
top_of_heap = value_as_long (sbrk);
- /* Return results. */
+ /* Return results. */
if (top_of_heap > top_of_data_memory)
{
*bottom = top_of_data_memory;
*top = top_of_heap;
- return 1; /* success */
+ return 1;
}
- else
- return 0; /* No additional heap space needs to be saved. */
+
+ /* No additional heap space needs to be saved. */
+ return 0;
}
/* ARGSUSED */
@@ -296,20 +304,17 @@ make_output_phdrs (bfd *obfd, asection *osec, void *ignored)
if (bfd_get_section_flags (obfd, osec) & SEC_CODE)
p_flags |= PF_X; /* Segment is executable. */
- bfd_record_phdr (obfd, p_type, 1, p_flags, 0, 0,
- 0, 0, 1, &osec);
+ bfd_record_phdr (obfd, p_type, 1, p_flags, 0, 0, 0, 0, 1, &osec);
}
static asection *
-make_mem_sec (bfd *obfd,
- bfd_vma addr,
- bfd_size_type size,
- unsigned int flags,
- unsigned int alignment)
+make_mem_sec (bfd *obfd, bfd_vma addr, bfd_size_type size,
+ unsigned int flags, unsigned int alignment)
{
asection *osec;
- if ((osec = bfd_make_section_anyway (obfd, "load")) == NULL)
+ osec = bfd_make_section_anyway (obfd, "load");
+ if (osec == NULL)
{
warning ("Couldn't make gcore segment: %s",
bfd_errmsg (bfd_get_error ()));
@@ -318,59 +323,52 @@ make_mem_sec (bfd *obfd,
if (info_verbose)
{
- fprintf_filtered (gdb_stdout,
- "Save segment, %lld bytes at 0x%s\n",
+ fprintf_filtered (gdb_stdout, "Save segment, %lld bytes at 0x%s\n",
(long long) size, paddr_nz (addr));
}
bfd_set_section_size (obfd, osec, size);
bfd_set_section_vma (obfd, osec, addr);
- osec->lma = 0; /* FIXME: there should be a macro for this! */
+ bfd_section_lma (obfd, osec) = 0; /* ??? bfd_set_section_lma? */
bfd_set_section_alignment (obfd, osec, alignment);
- bfd_set_section_flags (obfd, osec,
+ bfd_set_section_flags (obfd, osec,
flags | SEC_LOAD | SEC_ALLOC | SEC_HAS_CONTENTS);
return osec;
}
static int
-gcore_create_callback (CORE_ADDR vaddr,
- unsigned long size,
- int read, int write, int exec,
- void *data)
+gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
+ int read, int write, int exec, void *data)
{
flagword flags = 0;
if (write == 0)
{
flags |= SEC_READONLY;
- /* Set size == zero for readonly sections. */
+ /* Mark readonly sections as zero-sized, such that we can avoid
+ copying their contents. */
size = 0;
}
+
if (exec)
- {
- flags |= SEC_CODE;
- }
+ flags |= SEC_CODE;
else
- {
- flags |= SEC_DATA;
- }
+ flags |= SEC_DATA;
- return ((make_mem_sec ((bfd *) data, vaddr, size, flags, 0)) == NULL);
+ return ((make_mem_sec (data, vaddr, size, flags, 0)) == NULL);
}
static int
-objfile_find_memory_regions (int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
+objfile_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
+ int, int, int, void *),
void *obfd)
{
- /* Use objfile data to create memory sections. */
+ /* Use objfile data to create memory sections. */
struct objfile *objfile;
struct obj_section *objsec;
bfd_vma temp_bottom, temp_top;
- /* Call callback function for each objfile section. */
+ /* Call callback function for each objfile section. */
ALL_OBJSECTIONS (objfile, objsec)
{
bfd *ibfd = objfile->obfd;
@@ -383,33 +381,32 @@ objfile_find_memory_regions (int (*func) (CORE_ADDR,
int size = bfd_section_size (ibfd, isec);
int ret;
- if ((ret = (*func) (objsec->addr,
- bfd_section_size (ibfd, isec),
- 1, /* All sections will be readable. */
- (flags & SEC_READONLY) == 0, /* writable */
- (flags & SEC_CODE) != 0, /* executable */
- obfd)) != 0)
+ ret = (*func) (objsec->addr, bfd_section_size (ibfd, isec),
+ 1, /* All sections will be readable. */
+ (flags & SEC_READONLY) == 0, /* Writable. */
+ (flags & SEC_CODE) != 0, /* Executable. */
+ obfd);
+ if (ret != 0)
return ret;
}
}
- /* Make a stack segment. */
+ /* Make a stack segment. */
if (derive_stack_segment (&temp_bottom, &temp_top))
- (*func) (temp_bottom,
- temp_top - temp_bottom,
- 1, /* Stack section will be readable */
- 1, /* Stack section will be writable */
- 0, /* Stack section will not be executable */
+ (*func) (temp_bottom, temp_top - temp_bottom,
+ 1, /* Stack section will be readable. */
+ 1, /* Stack section will be writable. */
+ 0, /* Stack section will not be executable. */
obfd);
/* Make a heap segment. */
if (derive_heap_segment (exec_bfd, &temp_bottom, &temp_top))
- (*func) (temp_bottom,
- temp_top - temp_bottom,
- 1, /* Heap section will be readable */
- 1, /* Heap section will be writable */
- 0, /* Heap section will not be executable */
+ (*func) (temp_bottom, temp_top - temp_bottom,
+ 1, /* Heap section will be readable. */
+ 1, /* Heap section will be writable. */
+ 0, /* Heap section will not be executable. */
obfd);
+
return 0;
}
@@ -420,13 +417,18 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
struct cleanup *old_chain = NULL;
void *memhunk;
+ /* Read-only sections are marked as zero-size. We don't have to
+ copy their contents. */
if (size == 0)
- return; /* Read-only sections are marked as zero-size.
- We don't have to copy their contents. */
+ return;
+
+ /* Only interested in "load" sections. */
if (strncmp ("load", bfd_section_name (obfd, osec), 4) != 0)
- return; /* Only interested in "load" sections. */
+ return;
- if ((memhunk = xmalloc (size)) == NULL)
+ memhunk = xmalloc (size);
+ /* ??? This is crap since xmalloc should never return NULL. */
+ if (memhunk == NULL)
error ("Not enough memory to create corefile.");
old_chain = make_cleanup (xfree, memhunk);
@@ -438,29 +440,30 @@ gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
warning ("Failed to write corefile contents (%s).",
bfd_errmsg (bfd_get_error ()));
- do_cleanups (old_chain); /* frees the xmalloc buffer */
+ do_cleanups (old_chain); /* Frees MEMHUNK. */
}
static int
gcore_memory_sections (bfd *obfd)
{
if (target_find_memory_regions (gcore_create_callback, obfd) != 0)
- return 0; /* FIXME error return/msg? */
+ return 0; /* FIXME: error return/msg? */
- /* Record phdrs for section-to-segment mapping. */
+ /* Record phdrs for section-to-segment mapping. */
bfd_map_over_sections (obfd, make_output_phdrs, NULL);
- /* Copy memory region contents. */
+ /* Copy memory region contents. */
bfd_map_over_sections (obfd, gcore_copy_callback, NULL);
- return 1; /* success */
+ return 1;
}
void
_initialize_gcore (void)
{
add_com ("generate-core-file", class_files, gcore_command,
- "Save a core file with the current state of the debugged process.\n\
+ "\
+Save a core file with the current state of the debugged process.\n\
Argument is optional filename. Default filename is 'core.<process_id>'.");
add_com_alias ("gcore", "generate-core-file", class_files, 1);
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index b9aea09b847..974a3c03b5f 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -36,27 +36,8 @@
#include "defs.h"
#include "arch-utils.h"
-#if GDB_MULTI_ARCH
#include "gdbcmd.h"
#include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
-#else
-/* Just include everything in sight so that the every old definition
- of macro is visible. */
-#include "gdb_string.h"
-#include <ctype.h>
-#include "symtab.h"
-#include "frame.h"
-#include "inferior.h"
-#include "breakpoint.h"
-#include "gdb_wait.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-#include "target.h"
-#include "gdbthread.h"
-#include "annotate.h"
-#include "symfile.h" /* for overlay functions */
-#include "value.h" /* For old tm.h/nm.h macros. */
-#endif
#include "symcat.h"
#include "floatformat.h"
@@ -161,7 +142,7 @@ struct gdbarch
int pc_regnum;
int ps_regnum;
int fp0_regnum;
- int npc_regnum;
+ int deprecated_npc_regnum;
gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
@@ -187,7 +168,7 @@ struct gdbarch
gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp;
int deprecated_register_size;
int call_dummy_location;
- gdbarch_call_dummy_address_ftype *call_dummy_address;
+ gdbarch_deprecated_call_dummy_address_ftype *deprecated_call_dummy_address;
CORE_ADDR deprecated_call_dummy_start_offset;
CORE_ADDR deprecated_call_dummy_breakpoint_offset;
int deprecated_call_dummy_length;
@@ -254,9 +235,10 @@ struct gdbarch
gdbarch_deprecated_frame_locals_address_ftype *deprecated_frame_locals_address;
gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call;
gdbarch_frame_num_args_ftype *frame_num_args;
- gdbarch_stack_align_ftype *stack_align;
+ gdbarch_deprecated_stack_align_ftype *deprecated_stack_align;
gdbarch_frame_align_ftype *frame_align;
- gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
+ gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
+ int frame_red_zone_size;
int parm_boundary;
const struct floatformat * float_format;
const struct floatformat * double_format;
@@ -328,7 +310,7 @@ struct gdbarch startup_gdbarch =
-1, /* pc_regnum */
-1, /* ps_regnum */
0, /* fp0_regnum */
- 0, /* npc_regnum */
+ 0, /* deprecated_npc_regnum */
0, /* stab_reg_to_regnum */
0, /* ecoff_reg_to_regnum */
0, /* dwarf_reg_to_regnum */
@@ -354,7 +336,7 @@ struct gdbarch startup_gdbarch =
0, /* deprecated_dummy_write_sp */
0, /* deprecated_register_size */
0, /* call_dummy_location */
- 0, /* call_dummy_address */
+ 0, /* deprecated_call_dummy_address */
0, /* deprecated_call_dummy_start_offset */
0, /* deprecated_call_dummy_breakpoint_offset */
0, /* deprecated_call_dummy_length */
@@ -421,9 +403,10 @@ struct gdbarch startup_gdbarch =
get_frame_base, /* deprecated_frame_locals_address */
0, /* deprecated_saved_pc_after_call */
0, /* frame_num_args */
- 0, /* stack_align */
+ 0, /* deprecated_stack_align */
0, /* frame_align */
- 0, /* reg_struct_has_addr */
+ 0, /* deprecated_reg_struct_has_addr */
+ 0, /* frame_red_zone_size */
0, /* parm_boundary */
0, /* float_format */
0, /* double_format */
@@ -518,7 +501,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->pc_regnum = -1;
current_gdbarch->ps_regnum = -1;
current_gdbarch->fp0_regnum = -1;
- current_gdbarch->npc_regnum = -1;
+ current_gdbarch->deprecated_npc_regnum = -1;
current_gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
current_gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
@@ -530,7 +513,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->deprecated_fp_regnum = -1;
current_gdbarch->deprecated_use_generic_dummy_frames = 1;
current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
- current_gdbarch->call_dummy_address = entry_point_address;
current_gdbarch->deprecated_call_dummy_words = legacy_call_dummy_words;
current_gdbarch->deprecated_sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
current_gdbarch->print_registers_info = default_print_registers_info;
@@ -561,7 +543,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->convert_from_func_ptr_addr = core_addr_identity;
current_gdbarch->addr_bits_remove = core_addr_identity;
current_gdbarch->smash_text_address = core_addr_identity;
- current_gdbarch->print_insn = legacy_print_insn;
current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
@@ -616,9 +597,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
struct cleanup *cleanups;
long dummy;
char *buf;
- /* Only perform sanity checks on a multi-arch target. */
- if (!GDB_MULTI_ARCH)
- return;
log = mem_fileopen ();
cleanups = make_cleanup_ui_file_delete (log);
/* fundamental */
@@ -654,7 +632,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of pc_regnum, invalid_p == 0 */
/* Skip verify of ps_regnum, invalid_p == 0 */
/* Skip verify of fp0_regnum, invalid_p == 0 */
- /* Skip verify of npc_regnum, invalid_p == 0 */
+ /* Skip verify of deprecated_npc_regnum, invalid_p == 0 */
/* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
/* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
/* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
@@ -677,7 +655,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of deprecated_push_return_address, has predicate */
/* Skip verify of deprecated_dummy_write_sp, has predicate */
/* Skip verify of call_dummy_location, invalid_p == 0 */
- /* Skip verify of call_dummy_address, invalid_p == 0 */
+ /* Skip verify of deprecated_call_dummy_address, has predicate */
/* Skip verify of deprecated_call_dummy_words, invalid_p == 0 */
/* Skip verify of deprecated_sizeof_call_dummy_words, invalid_p == 0 */
/* Skip verify of deprecated_call_dummy_stack_adjust, has predicate */
@@ -749,9 +727,9 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of deprecated_frame_locals_address, has predicate */
/* Skip verify of deprecated_saved_pc_after_call, has predicate */
/* Skip verify of frame_num_args, has predicate */
- /* Skip verify of stack_align, has predicate */
+ /* Skip verify of deprecated_stack_align, has predicate */
/* Skip verify of frame_align, has predicate */
- /* Skip verify of reg_struct_has_addr, has predicate */
+ /* Skip verify of deprecated_reg_struct_has_addr, has predicate */
if (gdbarch->float_format == 0)
gdbarch->float_format = default_float_format (gdbarch);
if (gdbarch->double_format == 0)
@@ -762,7 +740,9 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of addr_bits_remove, invalid_p == 0 */
/* Skip verify of smash_text_address, invalid_p == 0 */
/* Skip verify of software_single_step, has predicate */
- /* Skip verify of print_insn, invalid_p == 0 */
+ if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
+ && (gdbarch->print_insn == 0))
+ fprintf_unfiltered (log, "\n\tprint_insn");
/* Skip verify of skip_trampoline_code, invalid_p == 0 */
/* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
/* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
@@ -805,46 +785,36 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"gdbarch_dump: GDB_MULTI_ARCH = %d\n",
GDB_MULTI_ARCH);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
- gdbarch_frame_align_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: frame_align = 0x%08lx\n",
- (long) current_gdbarch->frame_align);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
- (long) current_gdbarch->in_function_epilogue_p);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: register_reggroup_p = 0x%08lx\n",
- (long) current_gdbarch->register_reggroup_p);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
- gdbarch_pseudo_register_read_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: pseudo_register_read = 0x%08lx\n",
- (long) current_gdbarch->pseudo_register_read);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
- gdbarch_pseudo_register_write_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: pseudo_register_write = 0x%08lx\n",
- (long) current_gdbarch->pseudo_register_write);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
- gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: address_class_name_to_type_flags = 0x%08lx\n",
- (long) current_gdbarch->address_class_name_to_type_flags);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
+ gdbarch_frame_align_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: frame_align = 0x%08lx\n",
+ (long) current_gdbarch->frame_align);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
+ (long) current_gdbarch->in_function_epilogue_p);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: register_reggroup_p = 0x%08lx\n",
+ (long) current_gdbarch->register_reggroup_p);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
+ gdbarch_pseudo_register_read_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: pseudo_register_read = 0x%08lx\n",
+ (long) current_gdbarch->pseudo_register_read);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
+ gdbarch_pseudo_register_write_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: pseudo_register_write = 0x%08lx\n",
+ (long) current_gdbarch->pseudo_register_write);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
+ gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: address_class_name_to_type_flags = 0x%08lx\n",
+ (long) current_gdbarch->address_class_name_to_type_flags);
#ifdef ADDRESS_CLASS_TYPE_FLAGS_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -859,44 +829,36 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = <0x%08lx>\n",
- (long) current_gdbarch->address_class_type_flags
- /*ADDRESS_CLASS_TYPE_FLAGS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = <0x%08lx>\n",
+ (long) current_gdbarch->address_class_type_flags
+ /*ADDRESS_CLASS_TYPE_FLAGS ()*/);
#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
- gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: address_class_type_flags_to_name = 0x%08lx\n",
- (long) current_gdbarch->address_class_type_flags_to_name);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
+ gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: address_class_type_flags_to_name = 0x%08lx\n",
+ (long) current_gdbarch->address_class_type_flags_to_name);
#ifdef ADDRESS_TO_POINTER
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"ADDRESS_TO_POINTER(type, buf, addr)",
XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: ADDRESS_TO_POINTER = <0x%08lx>\n",
- (long) current_gdbarch->address_to_pointer
- /*ADDRESS_TO_POINTER ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ADDRESS_TO_POINTER = <0x%08lx>\n",
+ (long) current_gdbarch->address_to_pointer
+ /*ADDRESS_TO_POINTER ()*/);
#endif
#ifdef ADDR_BITS_REMOVE
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"ADDR_BITS_REMOVE(addr)",
XSTRING (ADDR_BITS_REMOVE (addr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: ADDR_BITS_REMOVE = <0x%08lx>\n",
- (long) current_gdbarch->addr_bits_remove
- /*ADDR_BITS_REMOVE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ADDR_BITS_REMOVE = <0x%08lx>\n",
+ (long) current_gdbarch->addr_bits_remove
+ /*ADDR_BITS_REMOVE ()*/);
#endif
#ifdef BELIEVE_PCC_PROMOTION
fprintf_unfiltered (file,
@@ -919,22 +881,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"BREAKPOINT_FROM_PC(pcptr, lenptr)",
XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: BREAKPOINT_FROM_PC = <0x%08lx>\n",
- (long) current_gdbarch->breakpoint_from_pc
- /*BREAKPOINT_FROM_PC ()*/);
-#endif
-#ifdef CALL_DUMMY_ADDRESS
fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "CALL_DUMMY_ADDRESS()",
- XSTRING (CALL_DUMMY_ADDRESS ()));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: CALL_DUMMY_ADDRESS = <0x%08lx>\n",
- (long) current_gdbarch->call_dummy_address
- /*CALL_DUMMY_ADDRESS ()*/);
+ "gdbarch_dump: BREAKPOINT_FROM_PC = <0x%08lx>\n",
+ (long) current_gdbarch->breakpoint_from_pc
+ /*BREAKPOINT_FROM_PC ()*/);
#endif
#ifdef CALL_DUMMY_LOCATION
fprintf_unfiltered (file,
@@ -949,11 +899,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"CANNOT_FETCH_REGISTER(regnum)",
XSTRING (CANNOT_FETCH_REGISTER (regnum)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: CANNOT_FETCH_REGISTER = <0x%08lx>\n",
- (long) current_gdbarch->cannot_fetch_register
- /*CANNOT_FETCH_REGISTER ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CANNOT_FETCH_REGISTER = <0x%08lx>\n",
+ (long) current_gdbarch->cannot_fetch_register
+ /*CANNOT_FETCH_REGISTER ()*/);
#endif
#ifdef CANNOT_STEP_BREAKPOINT
fprintf_unfiltered (file,
@@ -968,51 +917,43 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"CANNOT_STORE_REGISTER(regnum)",
XSTRING (CANNOT_STORE_REGISTER (regnum)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: CANNOT_STORE_REGISTER = <0x%08lx>\n",
- (long) current_gdbarch->cannot_store_register
- /*CANNOT_STORE_REGISTER ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CANNOT_STORE_REGISTER = <0x%08lx>\n",
+ (long) current_gdbarch->cannot_store_register
+ /*CANNOT_STORE_REGISTER ()*/);
#endif
#ifdef COFF_MAKE_MSYMBOL_SPECIAL
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
+ (long) current_gdbarch->coff_make_msymbol_special
+ /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
- (long) current_gdbarch->coff_make_msymbol_special
- /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
- (long) current_gdbarch->construct_inferior_arguments);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
+ (long) current_gdbarch->construct_inferior_arguments);
#ifdef CONVERT_FROM_FUNC_PTR_ADDR
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"CONVERT_FROM_FUNC_PTR_ADDR(addr)",
XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = <0x%08lx>\n",
- (long) current_gdbarch->convert_from_func_ptr_addr
- /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = <0x%08lx>\n",
+ (long) current_gdbarch->convert_from_func_ptr_addr
+ /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
#endif
#ifdef CONVERT_REGISTER_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"CONVERT_REGISTER_P(regnum, type)",
XSTRING (CONVERT_REGISTER_P (regnum, type)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: CONVERT_REGISTER_P = <0x%08lx>\n",
- (long) current_gdbarch->convert_register_p
- /*CONVERT_REGISTER_P ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CONVERT_REGISTER_P = <0x%08lx>\n",
+ (long) current_gdbarch->convert_register_p
+ /*CONVERT_REGISTER_P ()*/);
#endif
#ifdef DECR_PC_AFTER_BREAK
fprintf_unfiltered (file,
@@ -1022,6 +963,25 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
(long) DECR_PC_AFTER_BREAK);
#endif
+#ifdef DEPRECATED_CALL_DUMMY_ADDRESS_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_CALL_DUMMY_ADDRESS_P()",
+ XSTRING (DEPRECATED_CALL_DUMMY_ADDRESS_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_CALL_DUMMY_ADDRESS_P() = %d\n",
+ DEPRECATED_CALL_DUMMY_ADDRESS_P ());
+#endif
+#ifdef DEPRECATED_CALL_DUMMY_ADDRESS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_CALL_DUMMY_ADDRESS()",
+ XSTRING (DEPRECATED_CALL_DUMMY_ADDRESS ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_CALL_DUMMY_ADDRESS = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_call_dummy_address
+ /*DEPRECATED_CALL_DUMMY_ADDRESS ()*/);
+#endif
#ifdef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
fprintf_unfiltered (file,
"gdbarch_dump: DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
@@ -1081,18 +1041,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
DEPRECATED_DO_REGISTERS_INFO_P ());
#endif
#ifdef DEPRECATED_DO_REGISTERS_INFO
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs)",
XSTRING (DEPRECATED_DO_REGISTERS_INFO (reg_nr, fpregs)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_do_registers_info
- /*DEPRECATED_DO_REGISTERS_INFO ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_do_registers_info
+ /*DEPRECATED_DO_REGISTERS_INFO ()*/);
#endif
#ifdef DEPRECATED_DUMMY_WRITE_SP_P
fprintf_unfiltered (file,
@@ -1104,32 +1060,24 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
DEPRECATED_DUMMY_WRITE_SP_P ());
#endif
#ifdef DEPRECATED_DUMMY_WRITE_SP
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_DUMMY_WRITE_SP(val)",
XSTRING (DEPRECATED_DUMMY_WRITE_SP (val)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_dummy_write_sp
- /*DEPRECATED_DUMMY_WRITE_SP ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_dummy_write_sp
+ /*DEPRECATED_DUMMY_WRITE_SP ()*/);
#endif
#ifdef DEPRECATED_EXTRACT_RETURN_VALUE
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_extract_return_value
- /*DEPRECATED_EXTRACT_RETURN_VALUE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_extract_return_value
+ /*DEPRECATED_EXTRACT_RETURN_VALUE ()*/);
#endif
#ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
fprintf_unfiltered (file,
@@ -1145,11 +1093,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_extract_struct_value_address
- /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_extract_struct_value_address
+ /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
#endif
#ifdef DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED
fprintf_unfiltered (file,
@@ -1169,18 +1116,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
DEPRECATED_FIX_CALL_DUMMY_P ());
#endif
#ifdef DEPRECATED_FIX_CALL_DUMMY
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
XSTRING (DEPRECATED_FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_FIX_CALL_DUMMY = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_fix_call_dummy
- /*DEPRECATED_FIX_CALL_DUMMY ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FIX_CALL_DUMMY = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_fix_call_dummy
+ /*DEPRECATED_FIX_CALL_DUMMY ()*/);
#endif
#ifdef DEPRECATED_FP_REGNUM
fprintf_unfiltered (file,
@@ -1204,11 +1147,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_FRAME_ARGS_ADDRESS(fi)",
XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS (fi)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_frame_args_address
- /*DEPRECATED_FRAME_ARGS_ADDRESS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_frame_args_address
+ /*DEPRECATED_FRAME_ARGS_ADDRESS ()*/);
#endif
#ifdef DEPRECATED_FRAME_CHAIN_P
fprintf_unfiltered (file,
@@ -1224,11 +1166,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_FRAME_CHAIN(frame)",
XSTRING (DEPRECATED_FRAME_CHAIN (frame)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_FRAME_CHAIN = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_frame_chain
- /*DEPRECATED_FRAME_CHAIN ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FRAME_CHAIN = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_frame_chain
+ /*DEPRECATED_FRAME_CHAIN ()*/);
#endif
#ifdef DEPRECATED_FRAME_CHAIN_VALID_P
fprintf_unfiltered (file,
@@ -1244,11 +1185,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe)",
XSTRING (DEPRECATED_FRAME_CHAIN_VALID (chain, thisframe)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_frame_chain_valid
- /*DEPRECATED_FRAME_CHAIN_VALID ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_frame_chain_valid
+ /*DEPRECATED_FRAME_CHAIN_VALID ()*/);
#endif
#ifdef DEPRECATED_FRAME_INIT_SAVED_REGS_P
fprintf_unfiltered (file,
@@ -1260,18 +1200,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
DEPRECATED_FRAME_INIT_SAVED_REGS_P ());
#endif
#ifdef DEPRECATED_FRAME_INIT_SAVED_REGS
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_FRAME_INIT_SAVED_REGS(frame)",
XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS (frame)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_frame_init_saved_regs
- /*DEPRECATED_FRAME_INIT_SAVED_REGS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_frame_init_saved_regs
+ /*DEPRECATED_FRAME_INIT_SAVED_REGS ()*/);
#endif
#ifdef DEPRECATED_FRAME_LOCALS_ADDRESS_P
fprintf_unfiltered (file,
@@ -1287,11 +1223,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_FRAME_LOCALS_ADDRESS(fi)",
XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS (fi)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_frame_locals_address
- /*DEPRECATED_FRAME_LOCALS_ADDRESS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_frame_locals_address
+ /*DEPRECATED_FRAME_LOCALS_ADDRESS ()*/);
#endif
#ifdef DEPRECATED_FRAME_SAVED_PC_P
fprintf_unfiltered (file,
@@ -1307,11 +1242,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_FRAME_SAVED_PC(fi)",
XSTRING (DEPRECATED_FRAME_SAVED_PC (fi)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_frame_saved_pc
- /*DEPRECATED_FRAME_SAVED_PC ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_frame_saved_pc
+ /*DEPRECATED_FRAME_SAVED_PC ()*/);
#endif
#ifdef DEPRECATED_GET_SAVED_REGISTER_P
fprintf_unfiltered (file,
@@ -1323,18 +1257,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
DEPRECATED_GET_SAVED_REGISTER_P ());
#endif
#ifdef DEPRECATED_GET_SAVED_REGISTER
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
XSTRING (DEPRECATED_GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_get_saved_register
- /*DEPRECATED_GET_SAVED_REGISTER ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_get_saved_register
+ /*DEPRECATED_GET_SAVED_REGISTER ()*/);
#endif
#ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO_P
fprintf_unfiltered (file,
@@ -1346,18 +1276,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
DEPRECATED_INIT_EXTRA_FRAME_INFO_P ());
#endif
#ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_init_extra_frame_info
- /*DEPRECATED_INIT_EXTRA_FRAME_INFO ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_init_extra_frame_info
+ /*DEPRECATED_INIT_EXTRA_FRAME_INFO ()*/);
#endif
#ifdef DEPRECATED_INIT_FRAME_PC_P
fprintf_unfiltered (file,
@@ -1373,11 +1299,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_INIT_FRAME_PC(fromleaf, prev)",
XSTRING (DEPRECATED_INIT_FRAME_PC (fromleaf, prev)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_INIT_FRAME_PC = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_init_frame_pc
- /*DEPRECATED_INIT_FRAME_PC ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_INIT_FRAME_PC = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_init_frame_pc
+ /*DEPRECATED_INIT_FRAME_PC ()*/);
#endif
#ifdef DEPRECATED_INIT_FRAME_PC_FIRST_P
fprintf_unfiltered (file,
@@ -1393,11 +1318,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev)",
XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_init_frame_pc_first
- /*DEPRECATED_INIT_FRAME_PC_FIRST ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_init_frame_pc_first
+ /*DEPRECATED_INIT_FRAME_PC_FIRST ()*/);
#endif
#ifdef DEPRECATED_MAX_REGISTER_RAW_SIZE_P
fprintf_unfiltered (file,
@@ -1433,6 +1357,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE = %d\n",
DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE);
#endif
+#ifdef DEPRECATED_NPC_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_NPC_REGNUM # %s\n",
+ XSTRING (DEPRECATED_NPC_REGNUM));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_NPC_REGNUM = %d\n",
+ DEPRECATED_NPC_REGNUM);
+#endif
#ifdef DEPRECATED_PC_IN_CALL_DUMMY_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1447,11 +1379,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address)",
XSTRING (DEPRECATED_PC_IN_CALL_DUMMY (pc, sp, frame_address)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_pc_in_call_dummy
- /*DEPRECATED_PC_IN_CALL_DUMMY ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_pc_in_call_dummy
+ /*DEPRECATED_PC_IN_CALL_DUMMY ()*/);
#endif
#ifdef DEPRECATED_POP_FRAME_P
fprintf_unfiltered (file,
@@ -1463,18 +1394,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
DEPRECATED_POP_FRAME_P ());
#endif
#ifdef DEPRECATED_POP_FRAME
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_POP_FRAME(-)",
XSTRING (DEPRECATED_POP_FRAME (-)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_POP_FRAME = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_pop_frame
- /*DEPRECATED_POP_FRAME ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_POP_FRAME = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_pop_frame
+ /*DEPRECATED_POP_FRAME ()*/);
#endif
#ifdef DEPRECATED_PUSH_ARGUMENTS_P
fprintf_unfiltered (file,
@@ -1490,11 +1417,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_push_arguments
- /*DEPRECATED_PUSH_ARGUMENTS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_push_arguments
+ /*DEPRECATED_PUSH_ARGUMENTS ()*/);
#endif
#ifdef DEPRECATED_PUSH_DUMMY_FRAME_P
fprintf_unfiltered (file,
@@ -1506,18 +1432,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
DEPRECATED_PUSH_DUMMY_FRAME_P ());
#endif
#ifdef DEPRECATED_PUSH_DUMMY_FRAME
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_PUSH_DUMMY_FRAME(-)",
XSTRING (DEPRECATED_PUSH_DUMMY_FRAME (-)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_PUSH_DUMMY_FRAME = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_push_dummy_frame
- /*DEPRECATED_PUSH_DUMMY_FRAME ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_PUSH_DUMMY_FRAME = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_push_dummy_frame
+ /*DEPRECATED_PUSH_DUMMY_FRAME ()*/);
#endif
#ifdef DEPRECATED_PUSH_RETURN_ADDRESS_P
fprintf_unfiltered (file,
@@ -1533,11 +1455,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp)",
XSTRING (DEPRECATED_PUSH_RETURN_ADDRESS (pc, sp)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_push_return_address
- /*DEPRECATED_PUSH_RETURN_ADDRESS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_push_return_address
+ /*DEPRECATED_PUSH_RETURN_ADDRESS ()*/);
+#endif
+#ifdef DEPRECATED_REGISTER_BYTE_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_REGISTER_BYTE_P()",
+ XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_REGISTER_BYTE_P() = %d\n",
+ DEPRECATED_REGISTER_BYTE_P ());
+#endif
+#ifdef DEPRECATED_REGISTER_BYTE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_REGISTER_BYTE(reg_nr)",
+ XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr)));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_REGISTER_BYTE = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_register_byte
+ /*DEPRECATED_REGISTER_BYTE ()*/);
#endif
#ifdef DEPRECATED_REGISTER_BYTES
fprintf_unfiltered (file,
@@ -1552,39 +1492,30 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_REGISTER_CONVERTIBLE(nr)",
XSTRING (DEPRECATED_REGISTER_CONVERTIBLE (nr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_REGISTER_CONVERTIBLE = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_register_convertible
- /*DEPRECATED_REGISTER_CONVERTIBLE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_REGISTER_CONVERTIBLE = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_register_convertible
+ /*DEPRECATED_REGISTER_CONVERTIBLE ()*/);
#endif
#ifdef DEPRECATED_REGISTER_CONVERT_TO_RAW
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
XSTRING (DEPRECATED_REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_REGISTER_CONVERT_TO_RAW = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_register_convert_to_raw
- /*DEPRECATED_REGISTER_CONVERT_TO_RAW ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_REGISTER_CONVERT_TO_RAW = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_register_convert_to_raw
+ /*DEPRECATED_REGISTER_CONVERT_TO_RAW ()*/);
#endif
#ifdef DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
XSTRING (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_register_convert_to_virtual
- /*DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_register_convert_to_virtual
+ /*DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL ()*/);
#endif
#ifdef DEPRECATED_REGISTER_SIZE
fprintf_unfiltered (file,
@@ -1594,6 +1525,25 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: DEPRECATED_REGISTER_SIZE = %d\n",
DEPRECATED_REGISTER_SIZE);
#endif
+#ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
+ XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_REG_STRUCT_HAS_ADDR_P() = %d\n",
+ DEPRECATED_REG_STRUCT_HAS_ADDR_P ());
+#endif
+#ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
+ XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_REG_STRUCT_HAS_ADDR = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_reg_struct_has_addr
+ /*DEPRECATED_REG_STRUCT_HAS_ADDR ()*/);
+#endif
#ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1608,11 +1558,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_SAVED_PC_AFTER_CALL = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_saved_pc_after_call
- /*DEPRECATED_SAVED_PC_AFTER_CALL ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_SAVED_PC_AFTER_CALL = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_saved_pc_after_call
+ /*DEPRECATED_SAVED_PC_AFTER_CALL ()*/);
#endif
#ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS_P
fprintf_unfiltered (file,
@@ -1624,18 +1573,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ());
#endif
#ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_SAVE_DUMMY_FRAME_TOS(sp)",
XSTRING (DEPRECATED_SAVE_DUMMY_FRAME_TOS (sp)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_save_dummy_frame_tos
- /*DEPRECATED_SAVE_DUMMY_FRAME_TOS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_save_dummy_frame_tos
+ /*DEPRECATED_SAVE_DUMMY_FRAME_TOS ()*/);
#endif
#ifdef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
fprintf_unfiltered (file,
@@ -1645,19 +1590,34 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: DEPRECATED_SIZEOF_CALL_DUMMY_WORDS = %d\n",
DEPRECATED_SIZEOF_CALL_DUMMY_WORDS);
#endif
+#ifdef DEPRECATED_STACK_ALIGN_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_STACK_ALIGN_P()",
+ XSTRING (DEPRECATED_STACK_ALIGN_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_STACK_ALIGN_P() = %d\n",
+ DEPRECATED_STACK_ALIGN_P ());
+#endif
+#ifdef DEPRECATED_STACK_ALIGN
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_STACK_ALIGN(sp)",
+ XSTRING (DEPRECATED_STACK_ALIGN (sp)));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_STACK_ALIGN = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_stack_align
+ /*DEPRECATED_STACK_ALIGN ()*/);
+#endif
#ifdef DEPRECATED_STORE_RETURN_VALUE
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_store_return_value
- /*DEPRECATED_STORE_RETURN_VALUE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_store_return_value
+ /*DEPRECATED_STORE_RETURN_VALUE ()*/);
#endif
#ifdef DEPRECATED_STORE_STRUCT_RETURN_P
fprintf_unfiltered (file,
@@ -1669,18 +1629,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
DEPRECATED_STORE_STRUCT_RETURN_P ());
#endif
#ifdef DEPRECATED_STORE_STRUCT_RETURN
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_store_struct_return
- /*DEPRECATED_STORE_STRUCT_RETURN ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_store_struct_return
+ /*DEPRECATED_STORE_STRUCT_RETURN ()*/);
#endif
#ifdef DEPRECATED_TARGET_READ_FP_P
fprintf_unfiltered (file,
@@ -1696,11 +1652,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DEPRECATED_TARGET_READ_FP()",
XSTRING (DEPRECATED_TARGET_READ_FP ()));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_TARGET_READ_FP = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_target_read_fp
- /*DEPRECATED_TARGET_READ_FP ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_TARGET_READ_FP = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_target_read_fp
+ /*DEPRECATED_TARGET_READ_FP ()*/);
#endif
#ifdef DEPRECATED_USE_GENERIC_DUMMY_FRAMES
fprintf_unfiltered (file,
@@ -1715,61 +1670,50 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DWARF2_REG_TO_REGNUM = <0x%08lx>\n",
- (long) current_gdbarch->dwarf2_reg_to_regnum
- /*DWARF2_REG_TO_REGNUM ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DWARF2_REG_TO_REGNUM = <0x%08lx>\n",
+ (long) current_gdbarch->dwarf2_reg_to_regnum
+ /*DWARF2_REG_TO_REGNUM ()*/);
#endif
#ifdef DWARF_REG_TO_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"DWARF_REG_TO_REGNUM(dwarf_regnr)",
XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: DWARF_REG_TO_REGNUM = <0x%08lx>\n",
- (long) current_gdbarch->dwarf_reg_to_regnum
- /*DWARF_REG_TO_REGNUM ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DWARF_REG_TO_REGNUM = <0x%08lx>\n",
+ (long) current_gdbarch->dwarf_reg_to_regnum
+ /*DWARF_REG_TO_REGNUM ()*/);
#endif
#ifdef ECOFF_REG_TO_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"ECOFF_REG_TO_REGNUM(ecoff_regnr)",
XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: ECOFF_REG_TO_REGNUM = <0x%08lx>\n",
- (long) current_gdbarch->ecoff_reg_to_regnum
- /*ECOFF_REG_TO_REGNUM ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ECOFF_REG_TO_REGNUM = <0x%08lx>\n",
+ (long) current_gdbarch->ecoff_reg_to_regnum
+ /*ECOFF_REG_TO_REGNUM ()*/);
#endif
#ifdef ELF_MAKE_MSYMBOL_SPECIAL
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
- (long) current_gdbarch->elf_make_msymbol_special
- /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
+ (long) current_gdbarch->elf_make_msymbol_special
+ /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
#endif
#ifdef EXTRACT_RETURN_VALUE
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: EXTRACT_RETURN_VALUE = <0x%08lx>\n",
- (long) current_gdbarch->extract_return_value
- /*EXTRACT_RETURN_VALUE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: EXTRACT_RETURN_VALUE = <0x%08lx>\n",
+ (long) current_gdbarch->extract_return_value
+ /*EXTRACT_RETURN_VALUE ()*/);
#endif
#ifdef EXTRACT_STRUCT_VALUE_ADDRESS_P
fprintf_unfiltered (file,
@@ -1785,11 +1729,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
- (long) current_gdbarch->extract_struct_value_address
- /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
+ (long) current_gdbarch->extract_struct_value_address
+ /*EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
#endif
#ifdef FETCH_POINTER_ARGUMENT_P
fprintf_unfiltered (file,
@@ -1805,11 +1748,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"FETCH_POINTER_ARGUMENT(frame, argi, type)",
XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: FETCH_POINTER_ARGUMENT = <0x%08lx>\n",
- (long) current_gdbarch->fetch_pointer_argument
- /*FETCH_POINTER_ARGUMENT ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FETCH_POINTER_ARGUMENT = <0x%08lx>\n",
+ (long) current_gdbarch->fetch_pointer_argument
+ /*FETCH_POINTER_ARGUMENT ()*/);
#endif
#ifdef FP0_REGNUM
fprintf_unfiltered (file,
@@ -1824,11 +1766,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"FRAMELESS_FUNCTION_INVOCATION(fi)",
XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = <0x%08lx>\n",
- (long) current_gdbarch->frameless_function_invocation
- /*FRAMELESS_FUNCTION_INVOCATION ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = <0x%08lx>\n",
+ (long) current_gdbarch->frameless_function_invocation
+ /*FRAMELESS_FUNCTION_INVOCATION ()*/);
#endif
#ifdef FRAME_ARGS_SKIP
fprintf_unfiltered (file,
@@ -1852,11 +1793,18 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"FRAME_NUM_ARGS(frame)",
XSTRING (FRAME_NUM_ARGS (frame)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: FRAME_NUM_ARGS = <0x%08lx>\n",
- (long) current_gdbarch->frame_num_args
- /*FRAME_NUM_ARGS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_NUM_ARGS = <0x%08lx>\n",
+ (long) current_gdbarch->frame_num_args
+ /*FRAME_NUM_ARGS ()*/);
+#endif
+#ifdef FRAME_RED_ZONE_SIZE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
+ XSTRING (FRAME_RED_ZONE_SIZE));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAME_RED_ZONE_SIZE = %d\n",
+ FRAME_RED_ZONE_SIZE);
#endif
#ifdef FUNCTION_START_OFFSET
fprintf_unfiltered (file,
@@ -1880,11 +1828,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"GET_LONGJMP_TARGET(pc)",
XSTRING (GET_LONGJMP_TARGET (pc)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: GET_LONGJMP_TARGET = <0x%08lx>\n",
- (long) current_gdbarch->get_longjmp_target
- /*GET_LONGJMP_TARGET ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: GET_LONGJMP_TARGET = <0x%08lx>\n",
+ (long) current_gdbarch->get_longjmp_target
+ /*GET_LONGJMP_TARGET ()*/);
#endif
#ifdef HAVE_NONSTEPPABLE_WATCHPOINT
fprintf_unfiltered (file,
@@ -1899,11 +1846,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"INNER_THAN(lhs, rhs)",
XSTRING (INNER_THAN (lhs, rhs)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: INNER_THAN = <0x%08lx>\n",
- (long) current_gdbarch->inner_than
- /*INNER_THAN ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: INNER_THAN = <0x%08lx>\n",
+ (long) current_gdbarch->inner_than
+ /*INNER_THAN ()*/);
#endif
#ifdef INTEGER_TO_ADDRESS_P
fprintf_unfiltered (file,
@@ -1919,55 +1865,50 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"INTEGER_TO_ADDRESS(type, buf)",
XSTRING (INTEGER_TO_ADDRESS (type, buf)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: INTEGER_TO_ADDRESS = <0x%08lx>\n",
- (long) current_gdbarch->integer_to_address
- /*INTEGER_TO_ADDRESS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: INTEGER_TO_ADDRESS = <0x%08lx>\n",
+ (long) current_gdbarch->integer_to_address
+ /*INTEGER_TO_ADDRESS ()*/);
#endif
#ifdef IN_SOLIB_CALL_TRAMPOLINE
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = <0x%08lx>\n",
- (long) current_gdbarch->in_solib_call_trampoline
- /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = <0x%08lx>\n",
+ (long) current_gdbarch->in_solib_call_trampoline
+ /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
#endif
#ifdef IN_SOLIB_RETURN_TRAMPOLINE
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = <0x%08lx>\n",
- (long) current_gdbarch->in_solib_return_trampoline
- /*IN_SOLIB_RETURN_TRAMPOLINE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = <0x%08lx>\n",
+ (long) current_gdbarch->in_solib_return_trampoline
+ /*IN_SOLIB_RETURN_TRAMPOLINE ()*/);
#endif
#ifdef MEMORY_INSERT_BREAKPOINT
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = <0x%08lx>\n",
- (long) current_gdbarch->memory_insert_breakpoint
- /*MEMORY_INSERT_BREAKPOINT ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = <0x%08lx>\n",
+ (long) current_gdbarch->memory_insert_breakpoint
+ /*MEMORY_INSERT_BREAKPOINT ()*/);
#endif
#ifdef MEMORY_REMOVE_BREAKPOINT
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = <0x%08lx>\n",
- (long) current_gdbarch->memory_remove_breakpoint
- /*MEMORY_REMOVE_BREAKPOINT ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = <0x%08lx>\n",
+ (long) current_gdbarch->memory_remove_breakpoint
+ /*MEMORY_REMOVE_BREAKPOINT ()*/);
#endif
#ifdef NAME_OF_MALLOC
fprintf_unfiltered (file,
@@ -1977,14 +1918,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: NAME_OF_MALLOC = %s\n",
NAME_OF_MALLOC);
#endif
-#ifdef NPC_REGNUM
- fprintf_unfiltered (file,
- "gdbarch_dump: NPC_REGNUM # %s\n",
- XSTRING (NPC_REGNUM));
- fprintf_unfiltered (file,
- "gdbarch_dump: NPC_REGNUM = %d\n",
- NPC_REGNUM);
-#endif
#ifdef NUM_PSEUDO_REGS
fprintf_unfiltered (file,
"gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
@@ -2014,11 +1947,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"PC_IN_SIGTRAMP(pc, name)",
XSTRING (PC_IN_SIGTRAMP (pc, name)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: PC_IN_SIGTRAMP = <0x%08lx>\n",
- (long) current_gdbarch->pc_in_sigtramp
- /*PC_IN_SIGTRAMP ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PC_IN_SIGTRAMP = <0x%08lx>\n",
+ (long) current_gdbarch->pc_in_sigtramp
+ /*PC_IN_SIGTRAMP ()*/);
#endif
#ifdef PC_REGNUM
fprintf_unfiltered (file,
@@ -2033,42 +1965,35 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"POINTER_TO_ADDRESS(type, buf)",
XSTRING (POINTER_TO_ADDRESS (type, buf)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: POINTER_TO_ADDRESS = <0x%08lx>\n",
- (long) current_gdbarch->pointer_to_address
- /*POINTER_TO_ADDRESS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: POINTER_TO_ADDRESS = <0x%08lx>\n",
+ (long) current_gdbarch->pointer_to_address
+ /*POINTER_TO_ADDRESS ()*/);
#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
- gdbarch_print_float_info_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: print_float_info = 0x%08lx\n",
- (long) current_gdbarch->print_float_info);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: print_registers_info = 0x%08lx\n",
- (long) current_gdbarch->print_registers_info);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
- gdbarch_print_vector_info_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: print_vector_info = 0x%08lx\n",
- (long) current_gdbarch->print_vector_info);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
+ gdbarch_print_float_info_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: print_float_info = 0x%08lx\n",
+ (long) current_gdbarch->print_float_info);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: print_registers_info = 0x%08lx\n",
+ (long) current_gdbarch->print_registers_info);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
+ gdbarch_print_vector_info_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: print_vector_info = 0x%08lx\n",
+ (long) current_gdbarch->print_vector_info);
#ifdef PROLOGUE_FRAMELESS_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"PROLOGUE_FRAMELESS_P(ip)",
XSTRING (PROLOGUE_FRAMELESS_P (ip)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: PROLOGUE_FRAMELESS_P = <0x%08lx>\n",
- (long) current_gdbarch->prologue_frameless_p
- /*PROLOGUE_FRAMELESS_P ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: PROLOGUE_FRAMELESS_P = <0x%08lx>\n",
+ (long) current_gdbarch->prologue_frameless_p
+ /*PROLOGUE_FRAMELESS_P ()*/);
#endif
#ifdef PS_REGNUM
fprintf_unfiltered (file,
@@ -2078,42 +2003,18 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: PS_REGNUM = %d\n",
PS_REGNUM);
#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
- gdbarch_push_dummy_call_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: push_dummy_call = 0x%08lx\n",
- (long) current_gdbarch->push_dummy_call);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
- gdbarch_push_dummy_code_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: push_dummy_code = 0x%08lx\n",
- (long) current_gdbarch->push_dummy_code);
-#ifdef REGISTER_BYTE_P
fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "REGISTER_BYTE_P()",
- XSTRING (REGISTER_BYTE_P ()));
+ "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
+ gdbarch_push_dummy_call_p (current_gdbarch));
fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_BYTE_P() = %d\n",
- REGISTER_BYTE_P ());
-#endif
-#ifdef REGISTER_BYTE
+ "gdbarch_dump: push_dummy_call = 0x%08lx\n",
+ (long) current_gdbarch->push_dummy_call);
fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "REGISTER_BYTE(reg_nr)",
- XSTRING (REGISTER_BYTE (reg_nr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_BYTE = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_register_byte
- /*REGISTER_BYTE ()*/);
-#endif
+ "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
+ gdbarch_push_dummy_code_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: push_dummy_code = 0x%08lx\n",
+ (long) current_gdbarch->push_dummy_code);
#ifdef REGISTER_BYTES_OK_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2128,22 +2029,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"REGISTER_BYTES_OK(nr_bytes)",
XSTRING (REGISTER_BYTES_OK (nr_bytes)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_BYTES_OK = <0x%08lx>\n",
- (long) current_gdbarch->register_bytes_ok
- /*REGISTER_BYTES_OK ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_BYTES_OK = <0x%08lx>\n",
+ (long) current_gdbarch->register_bytes_ok
+ /*REGISTER_BYTES_OK ()*/);
#endif
#ifdef REGISTER_NAME
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"REGISTER_NAME(regnr)",
XSTRING (REGISTER_NAME (regnr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_NAME = <0x%08lx>\n",
- (long) current_gdbarch->register_name
- /*REGISTER_NAME ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_NAME = <0x%08lx>\n",
+ (long) current_gdbarch->register_name
+ /*REGISTER_NAME ()*/);
#endif
#ifdef REGISTER_RAW_SIZE_P
fprintf_unfiltered (file,
@@ -2159,45 +2058,37 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"REGISTER_RAW_SIZE(reg_nr)",
XSTRING (REGISTER_RAW_SIZE (reg_nr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_RAW_SIZE = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_register_raw_size
- /*REGISTER_RAW_SIZE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_RAW_SIZE = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_register_raw_size
+ /*REGISTER_RAW_SIZE ()*/);
#endif
#ifdef REGISTER_SIM_REGNO
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"REGISTER_SIM_REGNO(reg_nr)",
XSTRING (REGISTER_SIM_REGNO (reg_nr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_SIM_REGNO = <0x%08lx>\n",
- (long) current_gdbarch->register_sim_regno
- /*REGISTER_SIM_REGNO ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_SIM_REGNO = <0x%08lx>\n",
+ (long) current_gdbarch->register_sim_regno
+ /*REGISTER_SIM_REGNO ()*/);
#endif
#ifdef REGISTER_TO_VALUE
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"REGISTER_TO_VALUE(frame, regnum, type, buf)",
XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf)));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_TO_VALUE = <0x%08lx>\n",
+ (long) current_gdbarch->register_to_value
+ /*REGISTER_TO_VALUE ()*/);
#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_TO_VALUE = <0x%08lx>\n",
- (long) current_gdbarch->register_to_value
- /*REGISTER_TO_VALUE ()*/);
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_register_type_p() = %d\n",
- gdbarch_register_type_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: register_type = 0x%08lx\n",
- (long) current_gdbarch->register_type);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_register_type_p() = %d\n",
+ gdbarch_register_type_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: register_type = 0x%08lx\n",
+ (long) current_gdbarch->register_type);
#ifdef REGISTER_VIRTUAL_SIZE_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2212,11 +2103,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"REGISTER_VIRTUAL_SIZE(reg_nr)",
XSTRING (REGISTER_VIRTUAL_SIZE (reg_nr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_VIRTUAL_SIZE = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_register_virtual_size
- /*REGISTER_VIRTUAL_SIZE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: REGISTER_VIRTUAL_SIZE = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_register_virtual_size
+ /*REGISTER_VIRTUAL_SIZE ()*/);
#endif
#ifdef REGISTER_VIRTUAL_TYPE_P
fprintf_unfiltered (file,
@@ -2232,57 +2122,33 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"REGISTER_VIRTUAL_TYPE(reg_nr)",
XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: REGISTER_VIRTUAL_TYPE = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_register_virtual_type
- /*REGISTER_VIRTUAL_TYPE ()*/);
-#endif
-#ifdef REG_STRUCT_HAS_ADDR_P
fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "REG_STRUCT_HAS_ADDR_P()",
- XSTRING (REG_STRUCT_HAS_ADDR_P ()));
- fprintf_unfiltered (file,
- "gdbarch_dump: REG_STRUCT_HAS_ADDR_P() = %d\n",
- REG_STRUCT_HAS_ADDR_P ());
+ "gdbarch_dump: REGISTER_VIRTUAL_TYPE = <0x%08lx>\n",
+ (long) current_gdbarch->deprecated_register_virtual_type
+ /*REGISTER_VIRTUAL_TYPE ()*/);
#endif
-#ifdef REG_STRUCT_HAS_ADDR
fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "REG_STRUCT_HAS_ADDR(gcc_p, type)",
- XSTRING (REG_STRUCT_HAS_ADDR (gcc_p, type)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: REG_STRUCT_HAS_ADDR = <0x%08lx>\n",
- (long) current_gdbarch->reg_struct_has_addr
- /*REG_STRUCT_HAS_ADDR ()*/);
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: remote_translate_xfer_address = 0x%08lx\n",
- (long) current_gdbarch->remote_translate_xfer_address);
+ "gdbarch_dump: remote_translate_xfer_address = 0x%08lx\n",
+ (long) current_gdbarch->remote_translate_xfer_address);
#ifdef RETURN_VALUE_ON_STACK
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"RETURN_VALUE_ON_STACK(type)",
XSTRING (RETURN_VALUE_ON_STACK (type)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: RETURN_VALUE_ON_STACK = <0x%08lx>\n",
- (long) current_gdbarch->return_value_on_stack
- /*RETURN_VALUE_ON_STACK ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: RETURN_VALUE_ON_STACK = <0x%08lx>\n",
+ (long) current_gdbarch->return_value_on_stack
+ /*RETURN_VALUE_ON_STACK ()*/);
#endif
#ifdef SDB_REG_TO_REGNUM
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"SDB_REG_TO_REGNUM(sdb_regnr)",
XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: SDB_REG_TO_REGNUM = <0x%08lx>\n",
- (long) current_gdbarch->sdb_reg_to_regnum
- /*SDB_REG_TO_REGNUM ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SDB_REG_TO_REGNUM = <0x%08lx>\n",
+ (long) current_gdbarch->sdb_reg_to_regnum
+ /*SDB_REG_TO_REGNUM ()*/);
#endif
#ifdef SIGTRAMP_END_P
fprintf_unfiltered (file,
@@ -2298,11 +2164,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"SIGTRAMP_END(pc)",
XSTRING (SIGTRAMP_END (pc)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: SIGTRAMP_END = <0x%08lx>\n",
- (long) current_gdbarch->sigtramp_end
- /*SIGTRAMP_END ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SIGTRAMP_END = <0x%08lx>\n",
+ (long) current_gdbarch->sigtramp_end
+ /*SIGTRAMP_END ()*/);
#endif
#ifdef SIGTRAMP_START_P
fprintf_unfiltered (file,
@@ -2318,44 +2183,40 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"SIGTRAMP_START(pc)",
XSTRING (SIGTRAMP_START (pc)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: SIGTRAMP_START = <0x%08lx>\n",
- (long) current_gdbarch->sigtramp_start
- /*SIGTRAMP_START ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SIGTRAMP_START = <0x%08lx>\n",
+ (long) current_gdbarch->sigtramp_start
+ /*SIGTRAMP_START ()*/);
#endif
#ifdef SKIP_PROLOGUE
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"SKIP_PROLOGUE(ip)",
XSTRING (SKIP_PROLOGUE (ip)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: SKIP_PROLOGUE = <0x%08lx>\n",
- (long) current_gdbarch->skip_prologue
- /*SKIP_PROLOGUE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SKIP_PROLOGUE = <0x%08lx>\n",
+ (long) current_gdbarch->skip_prologue
+ /*SKIP_PROLOGUE ()*/);
#endif
#ifdef SKIP_TRAMPOLINE_CODE
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"SKIP_TRAMPOLINE_CODE(pc)",
XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: SKIP_TRAMPOLINE_CODE = <0x%08lx>\n",
- (long) current_gdbarch->skip_trampoline_code
- /*SKIP_TRAMPOLINE_CODE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SKIP_TRAMPOLINE_CODE = <0x%08lx>\n",
+ (long) current_gdbarch->skip_trampoline_code
+ /*SKIP_TRAMPOLINE_CODE ()*/);
#endif
#ifdef SMASH_TEXT_ADDRESS
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"SMASH_TEXT_ADDRESS(addr)",
XSTRING (SMASH_TEXT_ADDRESS (addr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: SMASH_TEXT_ADDRESS = <0x%08lx>\n",
- (long) current_gdbarch->smash_text_address
- /*SMASH_TEXT_ADDRESS ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SMASH_TEXT_ADDRESS = <0x%08lx>\n",
+ (long) current_gdbarch->smash_text_address
+ /*SMASH_TEXT_ADDRESS ()*/);
#endif
#ifdef SOFTWARE_SINGLE_STEP_P
fprintf_unfiltered (file,
@@ -2367,18 +2228,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
SOFTWARE_SINGLE_STEP_P ());
#endif
#ifdef SOFTWARE_SINGLE_STEP
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: SOFTWARE_SINGLE_STEP = <0x%08lx>\n",
- (long) current_gdbarch->software_single_step
- /*SOFTWARE_SINGLE_STEP ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SOFTWARE_SINGLE_STEP = <0x%08lx>\n",
+ (long) current_gdbarch->software_single_step
+ /*SOFTWARE_SINGLE_STEP ()*/);
#endif
#ifdef SP_REGNUM
fprintf_unfiltered (file,
@@ -2393,45 +2250,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"STAB_REG_TO_REGNUM(stab_regnr)",
XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: STAB_REG_TO_REGNUM = <0x%08lx>\n",
- (long) current_gdbarch->stab_reg_to_regnum
- /*STAB_REG_TO_REGNUM ()*/);
-#endif
-#ifdef STACK_ALIGN_P
fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "STACK_ALIGN_P()",
- XSTRING (STACK_ALIGN_P ()));
- fprintf_unfiltered (file,
- "gdbarch_dump: STACK_ALIGN_P() = %d\n",
- STACK_ALIGN_P ());
-#endif
-#ifdef STACK_ALIGN
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "STACK_ALIGN(sp)",
- XSTRING (STACK_ALIGN (sp)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: STACK_ALIGN = <0x%08lx>\n",
- (long) current_gdbarch->stack_align
- /*STACK_ALIGN ()*/);
+ "gdbarch_dump: STAB_REG_TO_REGNUM = <0x%08lx>\n",
+ (long) current_gdbarch->stab_reg_to_regnum
+ /*STAB_REG_TO_REGNUM ()*/);
#endif
#ifdef STORE_RETURN_VALUE
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"STORE_RETURN_VALUE(type, regcache, valbuf)",
XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: STORE_RETURN_VALUE = <0x%08lx>\n",
- (long) current_gdbarch->store_return_value
- /*STORE_RETURN_VALUE ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: STORE_RETURN_VALUE = <0x%08lx>\n",
+ (long) current_gdbarch->store_return_value
+ /*STORE_RETURN_VALUE ()*/);
#endif
#ifdef TARGET_ADDR_BIT
fprintf_unfiltered (file,
@@ -2559,11 +2391,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"TARGET_PRINT_INSN(vma, info)",
XSTRING (TARGET_PRINT_INSN (vma, info)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_PRINT_INSN = <0x%08lx>\n",
- (long) current_gdbarch->print_insn
- /*TARGET_PRINT_INSN ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_PRINT_INSN = <0x%08lx>\n",
+ (long) current_gdbarch->print_insn
+ /*TARGET_PRINT_INSN ()*/);
#endif
#ifdef TARGET_PTR_BIT
fprintf_unfiltered (file,
@@ -2587,11 +2418,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"TARGET_READ_PC(ptid)",
XSTRING (TARGET_READ_PC (ptid)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_READ_PC = <0x%08lx>\n",
- (long) current_gdbarch->read_pc
- /*TARGET_READ_PC ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_READ_PC = <0x%08lx>\n",
+ (long) current_gdbarch->read_pc
+ /*TARGET_READ_PC ()*/);
#endif
#ifdef TARGET_READ_SP_P
fprintf_unfiltered (file,
@@ -2607,11 +2437,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: %s # %s\n",
"TARGET_READ_SP()",
XSTRING (TARGET_READ_SP ()));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_READ_SP = <0x%08lx>\n",
- (long) current_gdbarch->read_sp
- /*TARGET_READ_SP ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_READ_SP = <0x%08lx>\n",
+ (long) current_gdbarch->read_sp
+ /*TARGET_READ_SP ()*/);
#endif
#ifdef TARGET_SHORT_BIT
fprintf_unfiltered (file,
@@ -2622,81 +2451,62 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
TARGET_SHORT_BIT);
#endif
#ifdef TARGET_VIRTUAL_FRAME_POINTER
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = <0x%08lx>\n",
- (long) current_gdbarch->virtual_frame_pointer
- /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = <0x%08lx>\n",
+ (long) current_gdbarch->virtual_frame_pointer
+ /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
#endif
#ifdef TARGET_WRITE_PC
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"TARGET_WRITE_PC(val, ptid)",
XSTRING (TARGET_WRITE_PC (val, ptid)));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_WRITE_PC = <0x%08lx>\n",
+ (long) current_gdbarch->write_pc
+ /*TARGET_WRITE_PC ()*/);
#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_WRITE_PC = <0x%08lx>\n",
- (long) current_gdbarch->write_pc
- /*TARGET_WRITE_PC ()*/);
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
- gdbarch_unwind_dummy_id_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: unwind_dummy_id = 0x%08lx\n",
- (long) current_gdbarch->unwind_dummy_id);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
- gdbarch_unwind_pc_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: unwind_pc = 0x%08lx\n",
- (long) current_gdbarch->unwind_pc);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
- gdbarch_unwind_sp_p (current_gdbarch));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: unwind_sp = 0x%08lx\n",
- (long) current_gdbarch->unwind_sp);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
+ gdbarch_unwind_dummy_id_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: unwind_dummy_id = 0x%08lx\n",
+ (long) current_gdbarch->unwind_dummy_id);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
+ gdbarch_unwind_pc_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: unwind_pc = 0x%08lx\n",
+ (long) current_gdbarch->unwind_pc);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
+ gdbarch_unwind_sp_p (current_gdbarch));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: unwind_sp = 0x%08lx\n",
+ (long) current_gdbarch->unwind_sp);
#ifdef USE_STRUCT_CONVENTION
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"USE_STRUCT_CONVENTION(gcc_p, value_type)",
XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: USE_STRUCT_CONVENTION = <0x%08lx>\n",
- (long) current_gdbarch->use_struct_convention
- /*USE_STRUCT_CONVENTION ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: USE_STRUCT_CONVENTION = <0x%08lx>\n",
+ (long) current_gdbarch->use_struct_convention
+ /*USE_STRUCT_CONVENTION ()*/);
#endif
#ifdef VALUE_TO_REGISTER
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"VALUE_TO_REGISTER(frame, regnum, type, buf)",
XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: VALUE_TO_REGISTER = <0x%08lx>\n",
- (long) current_gdbarch->value_to_register
- /*VALUE_TO_REGISTER ()*/);
+ fprintf_unfiltered (file,
+ "gdbarch_dump: VALUE_TO_REGISTER = <0x%08lx>\n",
+ (long) current_gdbarch->value_to_register
+ /*VALUE_TO_REGISTER ()*/);
#endif
if (current_gdbarch->dump_tdep != NULL)
current_gdbarch->dump_tdep (current_gdbarch, file);
@@ -3161,20 +2971,20 @@ set_gdbarch_fp0_regnum (struct gdbarch *gdbarch,
}
int
-gdbarch_npc_regnum (struct gdbarch *gdbarch)
+gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Skip verify of npc_regnum, invalid_p == 0 */
+ /* Skip verify of deprecated_npc_regnum, invalid_p == 0 */
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_npc_regnum called\n");
- return gdbarch->npc_regnum;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_npc_regnum called\n");
+ return gdbarch->deprecated_npc_regnum;
}
void
-set_gdbarch_npc_regnum (struct gdbarch *gdbarch,
- int npc_regnum)
+set_gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch,
+ int deprecated_npc_regnum)
{
- gdbarch->npc_regnum = npc_regnum;
+ gdbarch->deprecated_npc_regnum = deprecated_npc_regnum;
}
int
@@ -3699,21 +3509,28 @@ set_gdbarch_call_dummy_location (struct gdbarch *gdbarch,
gdbarch->call_dummy_location = call_dummy_location;
}
+int
+gdbarch_deprecated_call_dummy_address_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->deprecated_call_dummy_address != NULL;
+}
+
CORE_ADDR
-gdbarch_call_dummy_address (struct gdbarch *gdbarch)
+gdbarch_deprecated_call_dummy_address (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->call_dummy_address != NULL);
+ gdb_assert (gdbarch->deprecated_call_dummy_address != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n");
- return gdbarch->call_dummy_address ();
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_address called\n");
+ return gdbarch->deprecated_call_dummy_address ();
}
void
-set_gdbarch_call_dummy_address (struct gdbarch *gdbarch,
- gdbarch_call_dummy_address_ftype call_dummy_address)
+set_gdbarch_deprecated_call_dummy_address (struct gdbarch *gdbarch,
+ gdbarch_deprecated_call_dummy_address_ftype deprecated_call_dummy_address)
{
- gdbarch->call_dummy_address = call_dummy_address;
+ gdbarch->deprecated_call_dummy_address = deprecated_call_dummy_address;
}
CORE_ADDR
@@ -5042,27 +4859,27 @@ set_gdbarch_frame_num_args (struct gdbarch *gdbarch,
}
int
-gdbarch_stack_align_p (struct gdbarch *gdbarch)
+gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->stack_align != NULL;
+ return gdbarch->deprecated_stack_align != NULL;
}
CORE_ADDR
-gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
+gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp)
{
gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->stack_align != NULL);
+ gdb_assert (gdbarch->deprecated_stack_align != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n");
- return gdbarch->stack_align (sp);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_stack_align called\n");
+ return gdbarch->deprecated_stack_align (sp);
}
void
-set_gdbarch_stack_align (struct gdbarch *gdbarch,
- gdbarch_stack_align_ftype stack_align)
+set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch,
+ gdbarch_deprecated_stack_align_ftype deprecated_stack_align)
{
- gdbarch->stack_align = stack_align;
+ gdbarch->deprecated_stack_align = deprecated_stack_align;
}
int
@@ -5090,27 +4907,43 @@ set_gdbarch_frame_align (struct gdbarch *gdbarch,
}
int
-gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
+gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->deprecated_reg_struct_has_addr != NULL;
+}
+
+int
+gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
{
gdb_assert (gdbarch != NULL);
- return gdbarch->reg_struct_has_addr != NULL;
+ gdb_assert (gdbarch->deprecated_reg_struct_has_addr != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_reg_struct_has_addr called\n");
+ return gdbarch->deprecated_reg_struct_has_addr (gcc_p, type);
+}
+
+void
+set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch,
+ gdbarch_deprecated_reg_struct_has_addr_ftype deprecated_reg_struct_has_addr)
+{
+ gdbarch->deprecated_reg_struct_has_addr = deprecated_reg_struct_has_addr;
}
int
-gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type)
+gdbarch_frame_red_zone_size (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->reg_struct_has_addr != NULL);
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n");
- return gdbarch->reg_struct_has_addr (gcc_p, type);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_red_zone_size called\n");
+ return gdbarch->frame_red_zone_size;
}
void
-set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch,
- gdbarch_reg_struct_has_addr_ftype reg_struct_has_addr)
+set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch,
+ int frame_red_zone_size)
{
- gdbarch->reg_struct_has_addr = reg_struct_has_addr;
+ gdbarch->frame_red_zone_size = frame_red_zone_size;
}
int
@@ -5253,7 +5086,7 @@ set_gdbarch_software_single_step (struct gdbarch *gdbarch,
}
int
-gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info)
+gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->print_insn != NULL);
@@ -5835,37 +5668,30 @@ append_name (const char ***buf, int *nr, const char *name)
const char **
gdbarch_printable_names (void)
{
- if (GDB_MULTI_ARCH)
+ /* Accumulate a list of names based on the registed list of
+ architectures. */
+ enum bfd_architecture a;
+ int nr_arches = 0;
+ const char **arches = NULL;
+ struct gdbarch_registration *rego;
+ for (rego = gdbarch_registry;
+ rego != NULL;
+ rego = rego->next)
{
- /* Accumulate a list of names based on the registed list of
- architectures. */
- enum bfd_architecture a;
- int nr_arches = 0;
- const char **arches = NULL;
- struct gdbarch_registration *rego;
- for (rego = gdbarch_registry;
- rego != NULL;
- rego = rego->next)
- {
- const struct bfd_arch_info *ap;
- ap = bfd_lookup_arch (rego->bfd_architecture, 0);
- if (ap == NULL)
- internal_error (__FILE__, __LINE__,
- "gdbarch_architecture_names: multi-arch unknown");
- do
- {
- append_name (&arches, &nr_arches, ap->printable_name);
- ap = ap->next;
- }
- while (ap != NULL);
- }
- append_name (&arches, &nr_arches, NULL);
- return arches;
+ const struct bfd_arch_info *ap;
+ ap = bfd_lookup_arch (rego->bfd_architecture, 0);
+ if (ap == NULL)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch_architecture_names: multi-arch unknown");
+ do
+ {
+ append_name (&arches, &nr_arches, ap->printable_name);
+ ap = ap->next;
+ }
+ while (ap != NULL);
}
- else
- /* Just return all the architectures that BFD knows. Assume that
- the legacy architecture framework supports them. */
- return bfd_arch_list ();
+ append_name (&arches, &nr_arches, NULL);
+ return arches;
}
@@ -5906,12 +5732,6 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
(*curr)->dump_tdep = dump_tdep;
(*curr)->arches = NULL;
(*curr)->next = NULL;
- /* When non- multi-arch, install whatever target dump routine we've
- been provided - hopefully that routine has been written correctly
- and works regardless of multi-arch. */
- if (!GDB_MULTI_ARCH && dump_tdep != NULL
- && startup_gdbarch.dump_tdep == NULL)
- startup_gdbarch.dump_tdep = dump_tdep;
}
void
@@ -6143,11 +5963,6 @@ gdbarch_update_p (struct gdbarch_info info)
}
-/* Disassembler */
-
-/* Pointer to the target-dependent disassembly function. */
-int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info *);
-
extern void _initialize_gdbarch (void);
void
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 3850c4b0455..65006ca6f5f 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -35,13 +35,6 @@
#ifndef GDBARCH_H
#define GDBARCH_H
-#include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
-#if !GDB_MULTI_ARCH
-/* Pull in function declarations refered to, indirectly, via macros. */
-#include "inferior.h" /* For unsigned_address_to_pointer(). */
-#include "symfile.h" /* For entry_point_address(). */
-#endif
-
struct floatformat;
struct ui_file;
struct frame_info;
@@ -50,6 +43,7 @@ struct objfile;
struct minimal_symbol;
struct regcache;
struct reggroup;
+struct disassemble_info;
extern struct gdbarch *current_gdbarch;
@@ -100,11 +94,6 @@ extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
Number of bits in a short or unsigned short for the target machine. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_SHORT_BIT)
-#define TARGET_SHORT_BIT (2*TARGET_CHAR_BIT)
-#endif
-
extern int gdbarch_short_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_SHORT_BIT)
@@ -116,11 +105,6 @@ extern void set_gdbarch_short_bit (struct gdbarch *gdbarch, int short_bit);
/* Number of bits in an int or unsigned int for the target machine. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_INT_BIT)
-#define TARGET_INT_BIT (4*TARGET_CHAR_BIT)
-#endif
-
extern int gdbarch_int_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_INT_BIT)
@@ -132,11 +116,6 @@ extern void set_gdbarch_int_bit (struct gdbarch *gdbarch, int int_bit);
/* Number of bits in a long or unsigned long for the target machine. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_BIT)
-#define TARGET_LONG_BIT (4*TARGET_CHAR_BIT)
-#endif
-
extern int gdbarch_long_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_BIT)
@@ -149,11 +128,6 @@ extern void set_gdbarch_long_bit (struct gdbarch *gdbarch, int long_bit);
/* Number of bits in a long long or unsigned long long for the target
machine. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_LONG_BIT)
-#define TARGET_LONG_LONG_BIT (2*TARGET_LONG_BIT)
-#endif
-
extern int gdbarch_long_long_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bit);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_LONG_BIT)
@@ -165,11 +139,6 @@ extern void set_gdbarch_long_long_bit (struct gdbarch *gdbarch, int long_long_bi
/* Number of bits in a float for the target machine. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_BIT)
-#define TARGET_FLOAT_BIT (4*TARGET_CHAR_BIT)
-#endif
-
extern int gdbarch_float_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_BIT)
@@ -181,11 +150,6 @@ extern void set_gdbarch_float_bit (struct gdbarch *gdbarch, int float_bit);
/* Number of bits in a double for the target machine. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_BIT)
-#define TARGET_DOUBLE_BIT (8*TARGET_CHAR_BIT)
-#endif
-
extern int gdbarch_double_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_BIT)
@@ -197,11 +161,6 @@ extern void set_gdbarch_double_bit (struct gdbarch *gdbarch, int double_bit);
/* Number of bits in a long double for the target machine. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_BIT)
-#define TARGET_LONG_DOUBLE_BIT (8*TARGET_CHAR_BIT)
-#endif
-
extern int gdbarch_long_double_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_double_bit);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_BIT)
@@ -221,11 +180,6 @@ extern void set_gdbarch_long_double_bit (struct gdbarch *gdbarch, int long_doubl
ptr_bit is the size of a pointer on the target */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_PTR_BIT)
-#define TARGET_PTR_BIT (TARGET_INT_BIT)
-#endif
-
extern int gdbarch_ptr_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PTR_BIT)
@@ -237,11 +191,6 @@ extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
/* addr_bit is the size of a target address as represented in gdb */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_ADDR_BIT)
-#define TARGET_ADDR_BIT (TARGET_PTR_BIT)
-#endif
-
extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_ADDR_BIT)
@@ -253,11 +202,6 @@ extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
/* Number of bits in a BFD_VMA for the target object file format. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_BFD_VMA_BIT)
-#define TARGET_BFD_VMA_BIT (TARGET_ARCHITECTURE->bits_per_address)
-#endif
-
extern int gdbarch_bfd_vma_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_BFD_VMA_BIT)
@@ -269,11 +213,6 @@ extern void set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch, int bfd_vma_bit);
/* One if `char' acts like `signed char', zero if `unsigned char'. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_CHAR_SIGNED)
-#define TARGET_CHAR_SIGNED (1)
-#endif
-
extern int gdbarch_char_signed (struct gdbarch *gdbarch);
extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_CHAR_SIGNED)
@@ -290,11 +229,6 @@ extern void set_gdbarch_char_signed (struct gdbarch *gdbarch, int char_signed);
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC_P)
-#define TARGET_READ_PC_P() (0)
-#endif
-
extern int gdbarch_read_pc_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC_P)
#error "Non multi-arch definition of TARGET_READ_PC"
@@ -303,11 +237,6 @@ extern int gdbarch_read_pc_p (struct gdbarch *gdbarch);
#define TARGET_READ_PC_P() (gdbarch_read_pc_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_PC)
-#define TARGET_READ_PC(ptid) (internal_error (__FILE__, __LINE__, "TARGET_READ_PC"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_read_pc_ftype) (ptid_t ptid);
extern CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, ptid_t ptid);
extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype *read_pc);
@@ -318,11 +247,6 @@ extern void set_gdbarch_read_pc (struct gdbarch *gdbarch, gdbarch_read_pc_ftype
#define TARGET_READ_PC(ptid) (gdbarch_read_pc (current_gdbarch, ptid))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_WRITE_PC)
-#define TARGET_WRITE_PC(val, ptid) (generic_target_write_pc (val, ptid))
-#endif
-
typedef void (gdbarch_write_pc_ftype) (CORE_ADDR val, ptid_t ptid);
extern void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, ptid_t ptid);
extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftype *write_pc);
@@ -342,11 +266,6 @@ extern void set_gdbarch_write_pc (struct gdbarch *gdbarch, gdbarch_write_pc_ftyp
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP_P)
-#define TARGET_READ_SP_P() (0)
-#endif
-
extern int gdbarch_read_sp_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP_P)
#error "Non multi-arch definition of TARGET_READ_SP"
@@ -355,11 +274,6 @@ extern int gdbarch_read_sp_p (struct gdbarch *gdbarch);
#define TARGET_READ_SP_P() (gdbarch_read_sp_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_READ_SP)
-#define TARGET_READ_SP() (internal_error (__FILE__, __LINE__, "TARGET_READ_SP"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_read_sp_ftype) (void);
extern CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch);
extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype *read_sp);
@@ -374,11 +288,6 @@ extern void set_gdbarch_read_sp (struct gdbarch *gdbarch, gdbarch_read_sp_ftype
whole scheme for dealing with "frames" and "frame pointers" needs a
serious shakedown. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_VIRTUAL_FRAME_POINTER)
-#define TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset) (legacy_virtual_frame_pointer (pc, frame_regnum, frame_offset))
-#endif
-
typedef void (gdbarch_virtual_frame_pointer_ftype) (CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
extern void gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset);
extern void set_gdbarch_virtual_frame_pointer (struct gdbarch *gdbarch, gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer);
@@ -415,11 +324,6 @@ extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs);
These pseudo-registers may be aliases for other registers,
combinations of other registers, or they may be computed by GDB. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (NUM_PSEUDO_REGS)
-#define NUM_PSEUDO_REGS (0)
-#endif
-
extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch);
extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NUM_PSEUDO_REGS)
@@ -434,11 +338,6 @@ extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo
all (-1).
SP_REGNUM will hopefully be replaced by UNWIND_SP. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (SP_REGNUM)
-#define SP_REGNUM (-1)
-#endif
-
extern int gdbarch_sp_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SP_REGNUM)
@@ -448,11 +347,6 @@ extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum);
#define SP_REGNUM (gdbarch_sp_regnum (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (PC_REGNUM)
-#define PC_REGNUM (-1)
-#endif
-
extern int gdbarch_pc_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PC_REGNUM)
@@ -462,11 +356,6 @@ extern void set_gdbarch_pc_regnum (struct gdbarch *gdbarch, int pc_regnum);
#define PC_REGNUM (gdbarch_pc_regnum (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (PS_REGNUM)
-#define PS_REGNUM (-1)
-#endif
-
extern int gdbarch_ps_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PS_REGNUM)
@@ -476,11 +365,6 @@ extern void set_gdbarch_ps_regnum (struct gdbarch *gdbarch, int ps_regnum);
#define PS_REGNUM (gdbarch_ps_regnum (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (FP0_REGNUM)
-#define FP0_REGNUM (-1)
-#endif
-
extern int gdbarch_fp0_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FP0_REGNUM)
@@ -490,27 +374,20 @@ extern void set_gdbarch_fp0_regnum (struct gdbarch *gdbarch, int fp0_regnum);
#define FP0_REGNUM (gdbarch_fp0_regnum (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (NPC_REGNUM)
-#define NPC_REGNUM (-1)
-#endif
+/* Replace DEPRECATED_NPC_REGNUM with an implementation of WRITE_PC
+ that updates PC, NPC and even NNPC. */
-extern int gdbarch_npc_regnum (struct gdbarch *gdbarch);
-extern void set_gdbarch_npc_regnum (struct gdbarch *gdbarch, int npc_regnum);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NPC_REGNUM)
-#error "Non multi-arch definition of NPC_REGNUM"
+extern int gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_npc_regnum (struct gdbarch *gdbarch, int deprecated_npc_regnum);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_NPC_REGNUM)
+#error "Non multi-arch definition of DEPRECATED_NPC_REGNUM"
#endif
-#if !defined (NPC_REGNUM)
-#define NPC_REGNUM (gdbarch_npc_regnum (current_gdbarch))
+#if !defined (DEPRECATED_NPC_REGNUM)
+#define DEPRECATED_NPC_REGNUM (gdbarch_deprecated_npc_regnum (current_gdbarch))
#endif
/* Convert stab register number (from `r' declaration) to a gdb REGNUM. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (STAB_REG_TO_REGNUM)
-#define STAB_REG_TO_REGNUM(stab_regnr) (no_op_reg_to_regnum (stab_regnr))
-#endif
-
typedef int (gdbarch_stab_reg_to_regnum_ftype) (int stab_regnr);
extern int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr);
extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum);
@@ -523,11 +400,6 @@ extern void set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sta
/* Provide a default mapping from a ecoff register number to a gdb REGNUM. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (ECOFF_REG_TO_REGNUM)
-#define ECOFF_REG_TO_REGNUM(ecoff_regnr) (no_op_reg_to_regnum (ecoff_regnr))
-#endif
-
typedef int (gdbarch_ecoff_reg_to_regnum_ftype) (int ecoff_regnr);
extern int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr);
extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum);
@@ -540,11 +412,6 @@ extern void set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_ec
/* Provide a default mapping from a DWARF register number to a gdb REGNUM. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DWARF_REG_TO_REGNUM)
-#define DWARF_REG_TO_REGNUM(dwarf_regnr) (no_op_reg_to_regnum (dwarf_regnr))
-#endif
-
typedef int (gdbarch_dwarf_reg_to_regnum_ftype) (int dwarf_regnr);
extern int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr);
extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum);
@@ -559,11 +426,6 @@ extern void set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dw
This should be defined in tm.h, if REGISTER_NAMES is not set up
to map one to one onto the sdb register numbers. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (SDB_REG_TO_REGNUM)
-#define SDB_REG_TO_REGNUM(sdb_regnr) (no_op_reg_to_regnum (sdb_regnr))
-#endif
-
typedef int (gdbarch_sdb_reg_to_regnum_ftype) (int sdb_regnr);
extern int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr);
extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum);
@@ -574,11 +436,6 @@ extern void set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_sdb_
#define SDB_REG_TO_REGNUM(sdb_regnr) (gdbarch_sdb_reg_to_regnum (current_gdbarch, sdb_regnr))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DWARF2_REG_TO_REGNUM)
-#define DWARF2_REG_TO_REGNUM(dwarf2_regnr) (no_op_reg_to_regnum (dwarf2_regnr))
-#endif
-
typedef int (gdbarch_dwarf2_reg_to_regnum_ftype) (int dwarf2_regnr);
extern int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr);
extern void set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum);
@@ -616,11 +473,6 @@ extern void set_gdbarch_register_type (struct gdbarch *gdbarch, gdbarch_register
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_TYPE_P)
-#define REGISTER_VIRTUAL_TYPE_P() (0)
-#endif
-
extern int gdbarch_deprecated_register_virtual_type_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_TYPE_P)
#error "Non multi-arch definition of REGISTER_VIRTUAL_TYPE"
@@ -629,11 +481,6 @@ extern int gdbarch_deprecated_register_virtual_type_p (struct gdbarch *gdbarch);
#define REGISTER_VIRTUAL_TYPE_P() (gdbarch_deprecated_register_virtual_type_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_TYPE)
-#define REGISTER_VIRTUAL_TYPE(reg_nr) (internal_error (__FILE__, __LINE__, "REGISTER_VIRTUAL_TYPE"), 0)
-#endif
-
typedef struct type * (gdbarch_deprecated_register_virtual_type_ftype) (int reg_nr);
extern struct type * gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch, int reg_nr);
extern void set_gdbarch_deprecated_register_virtual_type (struct gdbarch *gdbarch, gdbarch_deprecated_register_virtual_type_ftype *deprecated_register_virtual_type);
@@ -664,39 +511,29 @@ extern void set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch, int
function works. This simplifies the migration process - old code,
calling DEPRECATED_REGISTER_BYTE, doesn't need to be modified. */
-#if defined (REGISTER_BYTE)
-/* Legacy for systems yet to multi-arch REGISTER_BYTE */
-#if !defined (REGISTER_BYTE_P)
-#define REGISTER_BYTE_P() (1)
-#endif
+#if defined (DEPRECATED_REGISTER_BYTE)
+/* Legacy for systems yet to multi-arch DEPRECATED_REGISTER_BYTE */
+#if !defined (DEPRECATED_REGISTER_BYTE_P)
+#define DEPRECATED_REGISTER_BYTE_P() (1)
#endif
-
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE_P)
-#define REGISTER_BYTE_P() (0)
#endif
extern int gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE_P)
-#error "Non multi-arch definition of REGISTER_BYTE"
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_BYTE_P)
+#error "Non multi-arch definition of DEPRECATED_REGISTER_BYTE"
#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTE_P)
-#define REGISTER_BYTE_P() (gdbarch_deprecated_register_byte_p (current_gdbarch))
-#endif
-
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTE)
-#define REGISTER_BYTE(reg_nr) (generic_register_byte (reg_nr))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_BYTE_P)
+#define DEPRECATED_REGISTER_BYTE_P() (gdbarch_deprecated_register_byte_p (current_gdbarch))
#endif
typedef int (gdbarch_deprecated_register_byte_ftype) (int reg_nr);
extern int gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, int reg_nr);
extern void set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, gdbarch_deprecated_register_byte_ftype *deprecated_register_byte);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTE)
-#error "Non multi-arch definition of REGISTER_BYTE"
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_BYTE)
+#error "Non multi-arch definition of DEPRECATED_REGISTER_BYTE"
#endif
-#if !defined (REGISTER_BYTE)
-#define REGISTER_BYTE(reg_nr) (gdbarch_deprecated_register_byte (current_gdbarch, reg_nr))
+#if !defined (DEPRECATED_REGISTER_BYTE)
+#define DEPRECATED_REGISTER_BYTE(reg_nr) (gdbarch_deprecated_register_byte (current_gdbarch, reg_nr))
#endif
/* If all registers have identical raw and virtual sizes and those
@@ -711,11 +548,6 @@ extern void set_gdbarch_deprecated_register_byte (struct gdbarch *gdbarch, gdbar
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_RAW_SIZE_P)
-#define REGISTER_RAW_SIZE_P() (0)
-#endif
-
extern int gdbarch_deprecated_register_raw_size_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_RAW_SIZE_P)
#error "Non multi-arch definition of REGISTER_RAW_SIZE"
@@ -724,11 +556,6 @@ extern int gdbarch_deprecated_register_raw_size_p (struct gdbarch *gdbarch);
#define REGISTER_RAW_SIZE_P() (gdbarch_deprecated_register_raw_size_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_RAW_SIZE)
-#define REGISTER_RAW_SIZE(reg_nr) (generic_register_size (reg_nr))
-#endif
-
typedef int (gdbarch_deprecated_register_raw_size_ftype) (int reg_nr);
extern int gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch, int reg_nr);
extern void set_gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch, gdbarch_deprecated_register_raw_size_ftype *deprecated_register_raw_size);
@@ -751,11 +578,6 @@ extern void set_gdbarch_deprecated_register_raw_size (struct gdbarch *gdbarch, g
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_SIZE_P)
-#define REGISTER_VIRTUAL_SIZE_P() (0)
-#endif
-
extern int gdbarch_deprecated_register_virtual_size_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_VIRTUAL_SIZE_P)
#error "Non multi-arch definition of REGISTER_VIRTUAL_SIZE"
@@ -764,11 +586,6 @@ extern int gdbarch_deprecated_register_virtual_size_p (struct gdbarch *gdbarch);
#define REGISTER_VIRTUAL_SIZE_P() (gdbarch_deprecated_register_virtual_size_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_VIRTUAL_SIZE)
-#define REGISTER_VIRTUAL_SIZE(reg_nr) (generic_register_size (reg_nr))
-#endif
-
typedef int (gdbarch_deprecated_register_virtual_size_ftype) (int reg_nr);
extern int gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarch, int reg_nr);
extern void set_gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarch, gdbarch_deprecated_register_virtual_size_ftype *deprecated_register_virtual_size);
@@ -789,11 +606,6 @@ extern void set_gdbarch_deprecated_register_virtual_size (struct gdbarch *gdbarc
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
-#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (0)
-#endif
-
extern int gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE"
@@ -802,11 +614,6 @@ extern int gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch);
#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (gdbarch_deprecated_max_register_raw_size_p (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
-#define DEPRECATED_MAX_REGISTER_RAW_SIZE (0)
-#endif
-
extern int gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch, int deprecated_max_register_raw_size);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
@@ -826,11 +633,6 @@ extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarc
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
-#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (0)
-#endif
-
extern int gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE"
@@ -839,11 +641,6 @@ extern int gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbar
#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (gdbarch_deprecated_max_register_virtual_size_p (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
-#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE (0)
-#endif
-
extern int gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch, int deprecated_max_register_virtual_size);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
@@ -871,11 +668,6 @@ extern void set_gdbarch_unwind_dummy_id (struct gdbarch *gdbarch, gdbarch_unwind
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P)
-#define DEPRECATED_SAVE_DUMMY_FRAME_TOS_P() (0)
-#endif
-
extern int gdbarch_deprecated_save_dummy_frame_tos_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P)
#error "Non multi-arch definition of DEPRECATED_SAVE_DUMMY_FRAME_TOS"
@@ -884,11 +676,6 @@ extern int gdbarch_deprecated_save_dummy_frame_tos_p (struct gdbarch *gdbarch);
#define DEPRECATED_SAVE_DUMMY_FRAME_TOS_P() (gdbarch_deprecated_save_dummy_frame_tos_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS)
-#define DEPRECATED_SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_SAVE_DUMMY_FRAME_TOS"), 0)
-#endif
-
typedef void (gdbarch_deprecated_save_dummy_frame_tos_ftype) (CORE_ADDR sp);
extern void gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp);
extern void set_gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch, gdbarch_deprecated_save_dummy_frame_tos_ftype *deprecated_save_dummy_frame_tos);
@@ -902,11 +689,6 @@ extern void set_gdbarch_deprecated_save_dummy_frame_tos (struct gdbarch *gdbarch
/* Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete
DEPRECATED_FP_REGNUM. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FP_REGNUM)
-#define DEPRECATED_FP_REGNUM (-1)
-#endif
-
extern int gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int deprecated_fp_regnum);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FP_REGNUM)
@@ -926,11 +708,6 @@ extern void set_gdbarch_deprecated_fp_regnum (struct gdbarch *gdbarch, int depre
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_TARGET_READ_FP_P)
-#define DEPRECATED_TARGET_READ_FP_P() (0)
-#endif
-
extern int gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP_P)
#error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP"
@@ -939,11 +716,6 @@ extern int gdbarch_deprecated_target_read_fp_p (struct gdbarch *gdbarch);
#define DEPRECATED_TARGET_READ_FP_P() (gdbarch_deprecated_target_read_fp_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_TARGET_READ_FP)
-#define DEPRECATED_TARGET_READ_FP() (internal_error (__FILE__, __LINE__, "DEPRECATED_TARGET_READ_FP"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_deprecated_target_read_fp_ftype) (void);
extern CORE_ADDR gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_target_read_fp (struct gdbarch *gdbarch, gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp);
@@ -972,11 +744,6 @@ extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_d
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS_P)
-#define DEPRECATED_PUSH_ARGUMENTS_P() (0)
-#endif
-
extern int gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS_P)
#error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS"
@@ -985,11 +752,6 @@ extern int gdbarch_deprecated_push_arguments_p (struct gdbarch *gdbarch);
#define DEPRECATED_PUSH_ARGUMENTS_P() (gdbarch_deprecated_push_arguments_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_ARGUMENTS)
-#define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_ARGUMENTS"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_deprecated_push_arguments_ftype) (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
extern CORE_ADDR gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
extern void set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments);
@@ -1002,11 +764,6 @@ extern void set_gdbarch_deprecated_push_arguments (struct gdbarch *gdbarch, gdba
/* DEPRECATED_USE_GENERIC_DUMMY_FRAMES can be deleted. Always true. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
-#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (1)
-#endif
-
extern int gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch, int deprecated_use_generic_dummy_frames);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
@@ -1026,11 +783,6 @@ extern void set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdb
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
-#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (0)
-#endif
-
extern int gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
#error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS"
@@ -1039,11 +791,6 @@ extern int gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch);
#define DEPRECATED_PUSH_RETURN_ADDRESS_P() (gdbarch_deprecated_push_return_address_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_RETURN_ADDRESS)
-#define DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_RETURN_ADDRESS"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_deprecated_push_return_address_ftype) (CORE_ADDR pc, CORE_ADDR sp);
extern CORE_ADDR gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp);
extern void set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch, gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address);
@@ -1063,11 +810,6 @@ extern void set_gdbarch_deprecated_push_return_address (struct gdbarch *gdbarch,
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP_P)
-#define DEPRECATED_DUMMY_WRITE_SP_P() (0)
-#endif
-
extern int gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP_P)
#error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP"
@@ -1076,11 +818,6 @@ extern int gdbarch_deprecated_dummy_write_sp_p (struct gdbarch *gdbarch);
#define DEPRECATED_DUMMY_WRITE_SP_P() (gdbarch_deprecated_dummy_write_sp_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DUMMY_WRITE_SP)
-#define DEPRECATED_DUMMY_WRITE_SP(val) (internal_error (__FILE__, __LINE__, "DEPRECATED_DUMMY_WRITE_SP"), 0)
-#endif
-
typedef void (gdbarch_deprecated_dummy_write_sp_ftype) (CORE_ADDR val);
extern void gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, CORE_ADDR val);
extern void set_gdbarch_deprecated_dummy_write_sp (struct gdbarch *gdbarch, gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp);
@@ -1102,11 +839,6 @@ extern void set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, int d
#define DEPRECATED_REGISTER_SIZE (gdbarch_deprecated_register_size (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_LOCATION)
-#define CALL_DUMMY_LOCATION (AT_ENTRY_POINT)
-#endif
-
extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch);
extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_LOCATION)
@@ -1116,19 +848,29 @@ extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_d
#define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (CALL_DUMMY_ADDRESS)
-#define CALL_DUMMY_ADDRESS() (entry_point_address ())
+#if defined (DEPRECATED_CALL_DUMMY_ADDRESS)
+/* Legacy for systems yet to multi-arch DEPRECATED_CALL_DUMMY_ADDRESS */
+#if !defined (DEPRECATED_CALL_DUMMY_ADDRESS_P)
+#define DEPRECATED_CALL_DUMMY_ADDRESS_P() (1)
+#endif
#endif
-typedef CORE_ADDR (gdbarch_call_dummy_address_ftype) (void);
-extern CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch);
-extern void set_gdbarch_call_dummy_address (struct gdbarch *gdbarch, gdbarch_call_dummy_address_ftype *call_dummy_address);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CALL_DUMMY_ADDRESS)
-#error "Non multi-arch definition of CALL_DUMMY_ADDRESS"
+extern int gdbarch_deprecated_call_dummy_address_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_ADDRESS_P)
+#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_ADDRESS"
#endif
-#if !defined (CALL_DUMMY_ADDRESS)
-#define CALL_DUMMY_ADDRESS() (gdbarch_call_dummy_address (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_CALL_DUMMY_ADDRESS_P)
+#define DEPRECATED_CALL_DUMMY_ADDRESS_P() (gdbarch_deprecated_call_dummy_address_p (current_gdbarch))
+#endif
+
+typedef CORE_ADDR (gdbarch_deprecated_call_dummy_address_ftype) (void);
+extern CORE_ADDR gdbarch_deprecated_call_dummy_address (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_call_dummy_address (struct gdbarch *gdbarch, gdbarch_deprecated_call_dummy_address_ftype *deprecated_call_dummy_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_ADDRESS)
+#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_ADDRESS"
+#endif
+#if !defined (DEPRECATED_CALL_DUMMY_ADDRESS)
+#define DEPRECATED_CALL_DUMMY_ADDRESS() (gdbarch_deprecated_call_dummy_address (current_gdbarch))
#endif
/* DEPRECATED_CALL_DUMMY_START_OFFSET can be deleted. */
@@ -1166,11 +908,6 @@ extern void set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch, i
/* DEPRECATED_CALL_DUMMY_WORDS can be deleted. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_WORDS)
-#define DEPRECATED_CALL_DUMMY_WORDS (legacy_call_dummy_words)
-#endif
-
extern LONGEST * gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch, LONGEST * deprecated_call_dummy_words);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_WORDS)
@@ -1182,11 +919,6 @@ extern void set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch, LO
/* Implement PUSH_DUMMY_CALL, then delete DEPRECATED_SIZEOF_CALL_DUMMY_WORDS. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
-#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (legacy_sizeof_call_dummy_words)
-#endif
-
extern int gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch, int deprecated_sizeof_call_dummy_words);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
@@ -1205,11 +937,6 @@ extern void set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdba
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P)
-#define DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() (0)
-#endif
-
extern int gdbarch_deprecated_call_dummy_stack_adjust_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P)
#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_STACK_ADJUST"
@@ -1218,11 +945,6 @@ extern int gdbarch_deprecated_call_dummy_stack_adjust_p (struct gdbarch *gdbarch
#define DEPRECATED_CALL_DUMMY_STACK_ADJUST_P() (gdbarch_deprecated_call_dummy_stack_adjust_p (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST)
-#define DEPRECATED_CALL_DUMMY_STACK_ADJUST (0)
-#endif
-
extern int gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdbarch, int deprecated_call_dummy_stack_adjust);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_STACK_ADJUST)
@@ -1242,11 +964,6 @@ extern void set_gdbarch_deprecated_call_dummy_stack_adjust (struct gdbarch *gdba
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FIX_CALL_DUMMY_P)
-#define DEPRECATED_FIX_CALL_DUMMY_P() (0)
-#endif
-
extern int gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY_P)
#error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY"
@@ -1255,11 +972,6 @@ extern int gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch);
#define DEPRECATED_FIX_CALL_DUMMY_P() (gdbarch_deprecated_fix_call_dummy_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FIX_CALL_DUMMY)
-#define DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (internal_error (__FILE__, __LINE__, "DEPRECATED_FIX_CALL_DUMMY"), 0)
-#endif
-
typedef void (gdbarch_deprecated_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
extern void gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
extern void set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy);
@@ -1287,11 +999,6 @@ extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_d
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
-#define DEPRECATED_PUSH_DUMMY_FRAME_P() (0)
-#endif
-
extern int gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
#error "Non multi-arch definition of DEPRECATED_PUSH_DUMMY_FRAME"
@@ -1300,11 +1007,6 @@ extern int gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch);
#define DEPRECATED_PUSH_DUMMY_FRAME_P() (gdbarch_deprecated_push_dummy_frame_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PUSH_DUMMY_FRAME)
-#define DEPRECATED_PUSH_DUMMY_FRAME (internal_error (__FILE__, __LINE__, "DEPRECATED_PUSH_DUMMY_FRAME"), 0)
-#endif
-
typedef void (gdbarch_deprecated_push_dummy_frame_ftype) (void);
extern void gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame);
@@ -1318,11 +1020,6 @@ extern void set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, gd
/* Implement PUSH_DUMMY_CALL, then delete
DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED. */
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
-#define DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED (0)
-#endif
-
extern int gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch *gdbarch, int deprecated_extra_stack_alignment_needed);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRA_STACK_ALIGNMENT_NEEDED)
@@ -1339,11 +1036,6 @@ extern void set_gdbarch_deprecated_extra_stack_alignment_needed (struct gdbarch
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO_P)
-#define DEPRECATED_DO_REGISTERS_INFO_P() (0)
-#endif
-
extern int gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO_P)
#error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO"
@@ -1352,11 +1044,6 @@ extern int gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch);
#define DEPRECATED_DO_REGISTERS_INFO_P() (gdbarch_deprecated_do_registers_info_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_DO_REGISTERS_INFO)
-#define DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs) (internal_error (__FILE__, __LINE__, "DEPRECATED_DO_REGISTERS_INFO"), 0)
-#endif
-
typedef void (gdbarch_deprecated_do_registers_info_ftype) (int reg_nr, int fpregs);
extern void gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs);
extern void set_gdbarch_deprecated_do_registers_info (struct gdbarch *gdbarch, gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info);
@@ -1386,11 +1073,6 @@ extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_prin
/* MAP a GDB RAW register number onto a simulator register number. See
also include/...-sim.h. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_SIM_REGNO)
-#define REGISTER_SIM_REGNO(reg_nr) (legacy_register_sim_regno (reg_nr))
-#endif
-
typedef int (gdbarch_register_sim_regno_ftype) (int reg_nr);
extern int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr);
extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype *register_sim_regno);
@@ -1408,11 +1090,6 @@ extern void set_gdbarch_register_sim_regno (struct gdbarch *gdbarch, gdbarch_reg
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK_P)
-#define REGISTER_BYTES_OK_P() (0)
-#endif
-
extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P)
#error "Non multi-arch definition of REGISTER_BYTES_OK"
@@ -1421,11 +1098,6 @@ extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch);
#define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK)
-#define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0)
-#endif
-
typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes);
extern int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes);
extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_register_bytes_ok_ftype *register_bytes_ok);
@@ -1436,11 +1108,6 @@ extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_regi
#define REGISTER_BYTES_OK(nr_bytes) (gdbarch_register_bytes_ok (current_gdbarch, nr_bytes))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER)
-#define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum))
-#endif
-
typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum);
extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
@@ -1451,11 +1118,6 @@ extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_
#define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER)
-#define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum))
-#endif
-
typedef int (gdbarch_cannot_store_register_ftype) (int regnum);
extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum);
extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
@@ -1475,11 +1137,6 @@ extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET_P)
-#define GET_LONGJMP_TARGET_P() (0)
-#endif
-
extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET_P)
#error "Non multi-arch definition of GET_LONGJMP_TARGET"
@@ -1488,11 +1145,6 @@ extern int gdbarch_get_longjmp_target_p (struct gdbarch *gdbarch);
#define GET_LONGJMP_TARGET_P() (gdbarch_get_longjmp_target_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (GET_LONGJMP_TARGET)
-#define GET_LONGJMP_TARGET(pc) (internal_error (__FILE__, __LINE__, "GET_LONGJMP_TARGET"), 0)
-#endif
-
typedef int (gdbarch_get_longjmp_target_ftype) (CORE_ADDR *pc);
extern int gdbarch_get_longjmp_target (struct gdbarch *gdbarch, CORE_ADDR *pc);
extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get_longjmp_target_ftype *get_longjmp_target);
@@ -1516,11 +1168,6 @@ extern void set_gdbarch_get_longjmp_target (struct gdbarch *gdbarch, gdbarch_get
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
-#define DEPRECATED_PC_IN_CALL_DUMMY_P() (0)
-#endif
-
extern int gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY"
@@ -1529,11 +1176,6 @@ extern int gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch);
#define DEPRECATED_PC_IN_CALL_DUMMY_P() (gdbarch_deprecated_pc_in_call_dummy_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_PC_IN_CALL_DUMMY)
-#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (generic_pc_in_call_dummy (pc, sp, frame_address))
-#endif
-
typedef int (gdbarch_deprecated_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
extern int gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy);
@@ -1551,11 +1193,6 @@ extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gd
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
-#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (0)
-#endif
-
extern int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST"
@@ -1564,11 +1201,6 @@ extern int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch);
#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (gdbarch_deprecated_init_frame_pc_first_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST)
-#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC_FIRST"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev);
extern CORE_ADDR gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first);
@@ -1586,11 +1218,6 @@ extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch,
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_P)
-#define DEPRECATED_INIT_FRAME_PC_P() (0)
-#endif
-
extern int gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_P)
#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC"
@@ -1599,11 +1226,6 @@ extern int gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch);
#define DEPRECATED_INIT_FRAME_PC_P() (gdbarch_deprecated_init_frame_pc_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC)
-#define DEPRECATED_INIT_FRAME_PC(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_ftype) (int fromleaf, struct frame_info *prev);
extern CORE_ADDR gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
extern void set_gdbarch_deprecated_init_frame_pc (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc);
@@ -1639,11 +1261,6 @@ extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER_P)
-#define DEPRECATED_GET_SAVED_REGISTER_P() (0)
-#endif
-
extern int gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER_P)
#error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER"
@@ -1652,11 +1269,6 @@ extern int gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch);
#define DEPRECATED_GET_SAVED_REGISTER_P() (gdbarch_deprecated_get_saved_register_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER)
-#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (internal_error (__FILE__, __LINE__, "DEPRECATED_GET_SAVED_REGISTER"), 0)
-#endif
-
typedef void (gdbarch_deprecated_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
extern void gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
extern void set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register);
@@ -1670,11 +1282,6 @@ extern void set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch,
/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
For raw <-> cooked register conversions, replaced by pseudo registers. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_REGISTER_CONVERTIBLE)
-#define DEPRECATED_REGISTER_CONVERTIBLE(nr) (deprecated_register_convertible_not (nr))
-#endif
-
typedef int (gdbarch_deprecated_register_convertible_ftype) (int nr);
extern int gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, int nr);
extern void set_gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, gdbarch_deprecated_register_convertible_ftype *deprecated_register_convertible);
@@ -1688,11 +1295,6 @@ extern void set_gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch
/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
For raw <-> cooked register conversions, replaced by pseudo registers. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL)
-#define DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL"), 0)
-#endif
-
typedef void (gdbarch_deprecated_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to);
extern void gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to);
extern void set_gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_deprecated_register_convert_to_virtual_ftype *deprecated_register_convert_to_virtual);
@@ -1706,11 +1308,6 @@ extern void set_gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *
/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
For raw <-> cooked register conversions, replaced by pseudo registers. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_REGISTER_CONVERT_TO_RAW)
-#define DEPRECATED_REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "DEPRECATED_REGISTER_CONVERT_TO_RAW"), 0)
-#endif
-
typedef void (gdbarch_deprecated_register_convert_to_raw_ftype) (struct type *type, int regnum, const char *from, char *to);
extern void gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, const char *from, char *to);
extern void set_gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_deprecated_register_convert_to_raw_ftype *deprecated_register_convert_to_raw);
@@ -1721,11 +1318,6 @@ extern void set_gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdba
#define DEPRECATED_REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_deprecated_register_convert_to_raw (current_gdbarch, type, regnum, from, to))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (CONVERT_REGISTER_P)
-#define CONVERT_REGISTER_P(regnum, type) (legacy_convert_register_p (regnum, type))
-#endif
-
typedef int (gdbarch_convert_register_p_ftype) (int regnum, struct type *type);
extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type);
extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p);
@@ -1736,11 +1328,6 @@ extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_con
#define CONVERT_REGISTER_P(regnum, type) (gdbarch_convert_register_p (current_gdbarch, regnum, type))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (REGISTER_TO_VALUE)
-#define REGISTER_TO_VALUE(frame, regnum, type, buf) (legacy_register_to_value (frame, regnum, type, buf))
-#endif
-
typedef void (gdbarch_register_to_value_ftype) (struct frame_info *frame, int regnum, struct type *type, void *buf);
extern void gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf);
extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value);
@@ -1751,11 +1338,6 @@ extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_regi
#define REGISTER_TO_VALUE(frame, regnum, type, buf) (gdbarch_register_to_value (current_gdbarch, frame, regnum, type, buf))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (VALUE_TO_REGISTER)
-#define VALUE_TO_REGISTER(frame, regnum, type, buf) (legacy_value_to_register (frame, regnum, type, buf))
-#endif
-
typedef void (gdbarch_value_to_register_ftype) (struct frame_info *frame, int regnum, struct type *type, const void *buf);
extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf);
extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register);
@@ -1766,11 +1348,6 @@ extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_valu
#define VALUE_TO_REGISTER(frame, regnum, type, buf) (gdbarch_value_to_register (current_gdbarch, frame, regnum, type, buf))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (POINTER_TO_ADDRESS)
-#define POINTER_TO_ADDRESS(type, buf) (unsigned_pointer_to_address (type, buf))
-#endif
-
typedef CORE_ADDR (gdbarch_pointer_to_address_ftype) (struct type *type, const void *buf);
extern CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, const void *buf);
extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_pointer_to_address_ftype *pointer_to_address);
@@ -1781,11 +1358,6 @@ extern void set_gdbarch_pointer_to_address (struct gdbarch *gdbarch, gdbarch_poi
#define POINTER_TO_ADDRESS(type, buf) (gdbarch_pointer_to_address (current_gdbarch, type, buf))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_TO_POINTER)
-#define ADDRESS_TO_POINTER(type, buf, addr) (unsigned_address_to_pointer (type, buf, addr))
-#endif
-
typedef void (gdbarch_address_to_pointer_ftype) (struct type *type, void *buf, CORE_ADDR addr);
extern void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr);
extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_address_to_pointer_ftype *address_to_pointer);
@@ -1803,11 +1375,6 @@ extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_add
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS_P)
-#define INTEGER_TO_ADDRESS_P() (0)
-#endif
-
extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS_P)
#error "Non multi-arch definition of INTEGER_TO_ADDRESS"
@@ -1816,11 +1383,6 @@ extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch);
#define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (INTEGER_TO_ADDRESS)
-#define INTEGER_TO_ADDRESS(type, buf) (internal_error (__FILE__, __LINE__, "INTEGER_TO_ADDRESS"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct type *type, void *buf);
extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf);
extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address);
@@ -1831,11 +1393,6 @@ extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_int
#define INTEGER_TO_ADDRESS(type, buf) (gdbarch_integer_to_address (current_gdbarch, type, buf))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (RETURN_VALUE_ON_STACK)
-#define RETURN_VALUE_ON_STACK(type) (generic_return_value_on_stack_not (type))
-#endif
-
typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type);
extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type);
extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack);
@@ -1853,11 +1410,6 @@ extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_POP_FRAME_P)
-#define DEPRECATED_POP_FRAME_P() (0)
-#endif
-
extern int gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME_P)
#error "Non multi-arch definition of DEPRECATED_POP_FRAME"
@@ -1866,11 +1418,6 @@ extern int gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch);
#define DEPRECATED_POP_FRAME_P() (gdbarch_deprecated_pop_frame_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_POP_FRAME)
-#define DEPRECATED_POP_FRAME (internal_error (__FILE__, __LINE__, "DEPRECATED_POP_FRAME"), 0)
-#endif
-
typedef void (gdbarch_deprecated_pop_frame_ftype) (void);
extern void gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch, gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame);
@@ -1890,11 +1437,6 @@ extern void set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch, gdbarch_d
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_STORE_STRUCT_RETURN_P)
-#define DEPRECATED_STORE_STRUCT_RETURN_P() (0)
-#endif
-
extern int gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_STRUCT_RETURN_P)
#error "Non multi-arch definition of DEPRECATED_STORE_STRUCT_RETURN"
@@ -1903,11 +1445,6 @@ extern int gdbarch_deprecated_store_struct_return_p (struct gdbarch *gdbarch);
#define DEPRECATED_STORE_STRUCT_RETURN_P() (gdbarch_deprecated_store_struct_return_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_STORE_STRUCT_RETURN)
-#define DEPRECATED_STORE_STRUCT_RETURN(addr, sp) (internal_error (__FILE__, __LINE__, "DEPRECATED_STORE_STRUCT_RETURN"), 0)
-#endif
-
typedef void (gdbarch_deprecated_store_struct_return_ftype) (CORE_ADDR addr, CORE_ADDR sp);
extern void gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp);
extern void set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch, gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return);
@@ -1918,11 +1455,6 @@ extern void set_gdbarch_deprecated_store_struct_return (struct gdbarch *gdbarch,
#define DEPRECATED_STORE_STRUCT_RETURN(addr, sp) (gdbarch_deprecated_store_struct_return (current_gdbarch, addr, sp))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_RETURN_VALUE)
-#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (legacy_extract_return_value (type, regcache, valbuf))
-#endif
-
typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, void *valbuf);
extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf);
extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
@@ -1933,11 +1465,6 @@ extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_e
#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (STORE_RETURN_VALUE)
-#define STORE_RETURN_VALUE(type, regcache, valbuf) (legacy_store_return_value (type, regcache, valbuf))
-#endif
-
typedef void (gdbarch_store_return_value_ftype) (struct type *type, struct regcache *regcache, const void *valbuf);
extern void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf);
extern void set_gdbarch_store_return_value (struct gdbarch *gdbarch, gdbarch_store_return_value_ftype *store_return_value);
@@ -1975,11 +1502,6 @@ extern void set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch,
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
-#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (0)
-#endif
-
extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS_P)
#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
@@ -1988,11 +1510,6 @@ extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
#define EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_extract_struct_value_address_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
-#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (struct regcache *regcache);
extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache);
extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
@@ -2010,11 +1527,6 @@ extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, g
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (0)
-#endif
-
extern int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
#error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
@@ -2023,11 +1535,6 @@ extern int gdbarch_deprecated_extract_struct_value_address_p (struct gdbarch *gd
#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
-#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_deprecated_extract_struct_value_address_ftype) (char *regbuf);
extern CORE_ADDR gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf);
extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address);
@@ -2038,11 +1545,6 @@ extern void set_gdbarch_deprecated_extract_struct_value_address (struct gdbarch
#define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_deprecated_extract_struct_value_address (current_gdbarch, regbuf))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (USE_STRUCT_CONVENTION)
-#define USE_STRUCT_CONVENTION(gcc_p, value_type) (generic_use_struct_convention (gcc_p, value_type))
-#endif
-
typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type);
extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type);
extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention);
@@ -2060,11 +1562,6 @@ extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
-#define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (0)
-#endif
-
extern int gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
#error "Non multi-arch definition of DEPRECATED_FRAME_INIT_SAVED_REGS"
@@ -2073,11 +1570,6 @@ extern int gdbarch_deprecated_frame_init_saved_regs_p (struct gdbarch *gdbarch);
#define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (gdbarch_deprecated_frame_init_saved_regs_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_INIT_SAVED_REGS)
-#define DEPRECATED_FRAME_INIT_SAVED_REGS(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_INIT_SAVED_REGS"), 0)
-#endif
-
typedef void (gdbarch_deprecated_frame_init_saved_regs_ftype) (struct frame_info *frame);
extern void gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame);
extern void set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarch, gdbarch_deprecated_frame_init_saved_regs_ftype *deprecated_frame_init_saved_regs);
@@ -2095,11 +1587,6 @@ extern void set_gdbarch_deprecated_frame_init_saved_regs (struct gdbarch *gdbarc
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
-#define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (0)
-#endif
-
extern int gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
#error "Non multi-arch definition of DEPRECATED_INIT_EXTRA_FRAME_INFO"
@@ -2108,11 +1595,6 @@ extern int gdbarch_deprecated_init_extra_frame_info_p (struct gdbarch *gdbarch);
#define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (gdbarch_deprecated_init_extra_frame_info_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO)
-#define DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_EXTRA_FRAME_INFO"), 0)
-#endif
-
typedef void (gdbarch_deprecated_init_extra_frame_info_ftype) (int fromleaf, struct frame_info *frame);
extern void gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame);
extern void set_gdbarch_deprecated_init_extra_frame_info (struct gdbarch *gdbarch, gdbarch_deprecated_init_extra_frame_info_ftype *deprecated_init_extra_frame_info);
@@ -2133,11 +1615,6 @@ extern void set_gdbarch_skip_prologue (struct gdbarch *gdbarch, gdbarch_skip_pro
#define SKIP_PROLOGUE(ip) (gdbarch_skip_prologue (current_gdbarch, ip))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (PROLOGUE_FRAMELESS_P)
-#define PROLOGUE_FRAMELESS_P(ip) (generic_prologue_frameless_p (ip))
-#endif
-
typedef int (gdbarch_prologue_frameless_p_ftype) (CORE_ADDR ip);
extern int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip);
extern void set_gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, gdbarch_prologue_frameless_p_ftype *prologue_frameless_p);
@@ -2168,11 +1645,6 @@ extern void set_gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, gdbarch_bre
#define BREAKPOINT_FROM_PC(pcptr, lenptr) (gdbarch_breakpoint_from_pc (current_gdbarch, pcptr, lenptr))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (MEMORY_INSERT_BREAKPOINT)
-#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (default_memory_insert_breakpoint (addr, contents_cache))
-#endif
-
typedef int (gdbarch_memory_insert_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
extern int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint);
@@ -2183,11 +1655,6 @@ extern void set_gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, gdbar
#define MEMORY_INSERT_BREAKPOINT(addr, contents_cache) (gdbarch_memory_insert_breakpoint (current_gdbarch, addr, contents_cache))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (MEMORY_REMOVE_BREAKPOINT)
-#define MEMORY_REMOVE_BREAKPOINT(addr, contents_cache) (default_memory_remove_breakpoint (addr, contents_cache))
-#endif
-
typedef int (gdbarch_memory_remove_breakpoint_ftype) (CORE_ADDR addr, char *contents_cache);
extern int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache);
extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint);
@@ -2229,11 +1696,6 @@ extern void set_gdbarch_frame_args_skip (struct gdbarch *gdbarch, CORE_ADDR fram
#define FRAME_ARGS_SKIP (gdbarch_frame_args_skip (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (FRAMELESS_FUNCTION_INVOCATION)
-#define FRAMELESS_FUNCTION_INVOCATION(fi) (generic_frameless_function_invocation_not (fi))
-#endif
-
typedef int (gdbarch_frameless_function_invocation_ftype) (struct frame_info *fi);
extern int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi);
extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, gdbarch_frameless_function_invocation_ftype *frameless_function_invocation);
@@ -2251,11 +1713,6 @@ extern void set_gdbarch_frameless_function_invocation (struct gdbarch *gdbarch,
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_P)
-#define DEPRECATED_FRAME_CHAIN_P() (0)
-#endif
-
extern int gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_P)
#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN"
@@ -2264,11 +1721,6 @@ extern int gdbarch_deprecated_frame_chain_p (struct gdbarch *gdbarch);
#define DEPRECATED_FRAME_CHAIN_P() (gdbarch_deprecated_frame_chain_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN)
-#define DEPRECATED_FRAME_CHAIN(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_CHAIN"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_deprecated_frame_chain_ftype) (struct frame_info *frame);
extern CORE_ADDR gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame);
extern void set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_ftype *deprecated_frame_chain);
@@ -2286,11 +1738,6 @@ extern void set_gdbarch_deprecated_frame_chain (struct gdbarch *gdbarch, gdbarch
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_VALID_P)
-#define DEPRECATED_FRAME_CHAIN_VALID_P() (0)
-#endif
-
extern int gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID_P)
#error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID"
@@ -2299,11 +1746,6 @@ extern int gdbarch_deprecated_frame_chain_valid_p (struct gdbarch *gdbarch);
#define DEPRECATED_FRAME_CHAIN_VALID_P() (gdbarch_deprecated_frame_chain_valid_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_CHAIN_VALID)
-#define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_CHAIN_VALID"), 0)
-#endif
-
typedef int (gdbarch_deprecated_frame_chain_valid_ftype) (CORE_ADDR chain, struct frame_info *thisframe);
extern int gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe);
extern void set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_deprecated_frame_chain_valid_ftype *deprecated_frame_chain_valid);
@@ -2325,11 +1767,6 @@ extern void set_gdbarch_deprecated_frame_chain_valid (struct gdbarch *gdbarch, g
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_SAVED_PC_P)
-#define DEPRECATED_FRAME_SAVED_PC_P() (0)
-#endif
-
extern int gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC_P)
#error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC"
@@ -2338,11 +1775,6 @@ extern int gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch);
#define DEPRECATED_FRAME_SAVED_PC_P() (gdbarch_deprecated_frame_saved_pc_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_SAVED_PC)
-#define DEPRECATED_FRAME_SAVED_PC(fi) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_SAVED_PC"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_deprecated_frame_saved_pc_ftype) (struct frame_info *fi);
extern CORE_ADDR gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi);
extern void set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc);
@@ -2375,11 +1807,6 @@ extern void set_gdbarch_unwind_sp (struct gdbarch *gdbarch, gdbarch_unwind_sp_ft
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_ARGS_ADDRESS_P)
-#define DEPRECATED_FRAME_ARGS_ADDRESS_P() (0)
-#endif
-
extern int gdbarch_deprecated_frame_args_address_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_ARGS_ADDRESS_P)
#error "Non multi-arch definition of DEPRECATED_FRAME_ARGS_ADDRESS"
@@ -2388,11 +1815,6 @@ extern int gdbarch_deprecated_frame_args_address_p (struct gdbarch *gdbarch);
#define DEPRECATED_FRAME_ARGS_ADDRESS_P() (gdbarch_deprecated_frame_args_address_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_ARGS_ADDRESS)
-#define DEPRECATED_FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi))
-#endif
-
typedef CORE_ADDR (gdbarch_deprecated_frame_args_address_ftype) (struct frame_info *fi);
extern CORE_ADDR gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi);
extern void set_gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch, gdbarch_deprecated_frame_args_address_ftype *deprecated_frame_args_address);
@@ -2413,11 +1835,6 @@ extern void set_gdbarch_deprecated_frame_args_address (struct gdbarch *gdbarch,
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P)
-#define DEPRECATED_FRAME_LOCALS_ADDRESS_P() (0)
-#endif
-
extern int gdbarch_deprecated_frame_locals_address_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P)
#error "Non multi-arch definition of DEPRECATED_FRAME_LOCALS_ADDRESS"
@@ -2426,11 +1843,6 @@ extern int gdbarch_deprecated_frame_locals_address_p (struct gdbarch *gdbarch);
#define DEPRECATED_FRAME_LOCALS_ADDRESS_P() (gdbarch_deprecated_frame_locals_address_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_LOCALS_ADDRESS)
-#define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) (get_frame_base (fi))
-#endif
-
typedef CORE_ADDR (gdbarch_deprecated_frame_locals_address_ftype) (struct frame_info *fi);
extern CORE_ADDR gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi);
extern void set_gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch, gdbarch_deprecated_frame_locals_address_ftype *deprecated_frame_locals_address);
@@ -2448,11 +1860,6 @@ extern void set_gdbarch_deprecated_frame_locals_address (struct gdbarch *gdbarch
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
-#define DEPRECATED_SAVED_PC_AFTER_CALL_P() (0)
-#endif
-
extern int gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
#error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL"
@@ -2461,11 +1868,6 @@ extern int gdbarch_deprecated_saved_pc_after_call_p (struct gdbarch *gdbarch);
#define DEPRECATED_SAVED_PC_AFTER_CALL_P() (gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_SAVED_PC_AFTER_CALL)
-#define DEPRECATED_SAVED_PC_AFTER_CALL(frame) (internal_error (__FILE__, __LINE__, "DEPRECATED_SAVED_PC_AFTER_CALL"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_deprecated_saved_pc_after_call_ftype) (struct frame_info *frame);
extern CORE_ADDR gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame);
extern void set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch, gdbarch_deprecated_saved_pc_after_call_ftype *deprecated_saved_pc_after_call);
@@ -2483,11 +1885,6 @@ extern void set_gdbarch_deprecated_saved_pc_after_call (struct gdbarch *gdbarch,
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (FRAME_NUM_ARGS_P)
-#define FRAME_NUM_ARGS_P() (0)
-#endif
-
extern int gdbarch_frame_num_args_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS_P)
#error "Non multi-arch definition of FRAME_NUM_ARGS"
@@ -2496,11 +1893,6 @@ extern int gdbarch_frame_num_args_p (struct gdbarch *gdbarch);
#define FRAME_NUM_ARGS_P() (gdbarch_frame_num_args_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (FRAME_NUM_ARGS)
-#define FRAME_NUM_ARGS(frame) (internal_error (__FILE__, __LINE__, "FRAME_NUM_ARGS"), 0)
-#endif
-
typedef int (gdbarch_frame_num_args_ftype) (struct frame_info *frame);
extern int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame);
extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_num_args_ftype *frame_num_args);
@@ -2511,39 +1903,34 @@ extern void set_gdbarch_frame_num_args (struct gdbarch *gdbarch, gdbarch_frame_n
#define FRAME_NUM_ARGS(frame) (gdbarch_frame_num_args (current_gdbarch, frame))
#endif
-#if defined (STACK_ALIGN)
-/* Legacy for systems yet to multi-arch STACK_ALIGN */
-#if !defined (STACK_ALIGN_P)
-#define STACK_ALIGN_P() (1)
-#endif
-#endif
-
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN_P)
-#define STACK_ALIGN_P() (0)
-#endif
+/* DEPRECATED_STACK_ALIGN has been replaced by an initial aligning call
+ to frame_align and the requirement that methods such as
+ push_dummy_call and frame_red_zone_size maintain correct stack/frame
+ alignment. */
-extern int gdbarch_stack_align_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN_P)
-#error "Non multi-arch definition of STACK_ALIGN"
+#if defined (DEPRECATED_STACK_ALIGN)
+/* Legacy for systems yet to multi-arch DEPRECATED_STACK_ALIGN */
+#if !defined (DEPRECATED_STACK_ALIGN_P)
+#define DEPRECATED_STACK_ALIGN_P() (1)
#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (STACK_ALIGN_P)
-#define STACK_ALIGN_P() (gdbarch_stack_align_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN)
-#define STACK_ALIGN(sp) (internal_error (__FILE__, __LINE__, "STACK_ALIGN"), 0)
+extern int gdbarch_deprecated_stack_align_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STACK_ALIGN_P)
+#error "Non multi-arch definition of DEPRECATED_STACK_ALIGN"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STACK_ALIGN_P)
+#define DEPRECATED_STACK_ALIGN_P() (gdbarch_deprecated_stack_align_p (current_gdbarch))
#endif
-typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp);
-extern CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp);
-extern void set_gdbarch_stack_align (struct gdbarch *gdbarch, gdbarch_stack_align_ftype *stack_align);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (STACK_ALIGN)
-#error "Non multi-arch definition of STACK_ALIGN"
+typedef CORE_ADDR (gdbarch_deprecated_stack_align_ftype) (CORE_ADDR sp);
+extern CORE_ADDR gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp);
+extern void set_gdbarch_deprecated_stack_align (struct gdbarch *gdbarch, gdbarch_deprecated_stack_align_ftype *deprecated_stack_align);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STACK_ALIGN)
+#error "Non multi-arch definition of DEPRECATED_STACK_ALIGN"
#endif
-#if !defined (STACK_ALIGN)
-#define STACK_ALIGN(sp) (gdbarch_stack_align (current_gdbarch, sp))
+#if !defined (DEPRECATED_STACK_ALIGN)
+#define DEPRECATED_STACK_ALIGN(sp) (gdbarch_deprecated_stack_align (current_gdbarch, sp))
#endif
extern int gdbarch_frame_align_p (struct gdbarch *gdbarch);
@@ -2552,39 +1939,38 @@ typedef CORE_ADDR (gdbarch_frame_align_ftype) (struct gdbarch *gdbarch, CORE_ADD
extern CORE_ADDR gdbarch_frame_align (struct gdbarch *gdbarch, CORE_ADDR address);
extern void set_gdbarch_frame_align (struct gdbarch *gdbarch, gdbarch_frame_align_ftype *frame_align);
-#if defined (REG_STRUCT_HAS_ADDR)
-/* Legacy for systems yet to multi-arch REG_STRUCT_HAS_ADDR */
-#if !defined (REG_STRUCT_HAS_ADDR_P)
-#define REG_STRUCT_HAS_ADDR_P() (1)
-#endif
+#if defined (DEPRECATED_REG_STRUCT_HAS_ADDR)
+/* Legacy for systems yet to multi-arch DEPRECATED_REG_STRUCT_HAS_ADDR */
+#if !defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P)
+#define DEPRECATED_REG_STRUCT_HAS_ADDR_P() (1)
#endif
-
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR_P)
-#define REG_STRUCT_HAS_ADDR_P() (0)
#endif
-extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR_P)
-#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
+extern int gdbarch_deprecated_reg_struct_has_addr_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P)
+#error "Non multi-arch definition of DEPRECATED_REG_STRUCT_HAS_ADDR"
#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REG_STRUCT_HAS_ADDR_P)
-#define REG_STRUCT_HAS_ADDR_P() (gdbarch_reg_struct_has_addr_p (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P)
+#define DEPRECATED_REG_STRUCT_HAS_ADDR_P() (gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR)
-#define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error (__FILE__, __LINE__, "REG_STRUCT_HAS_ADDR"), 0)
+typedef int (gdbarch_deprecated_reg_struct_has_addr_ftype) (int gcc_p, struct type *type);
+extern int gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type);
+extern void set_gdbarch_deprecated_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REG_STRUCT_HAS_ADDR)
+#error "Non multi-arch definition of DEPRECATED_REG_STRUCT_HAS_ADDR"
+#endif
+#if !defined (DEPRECATED_REG_STRUCT_HAS_ADDR)
+#define DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_deprecated_reg_struct_has_addr (current_gdbarch, gcc_p, type))
#endif
-typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type);
-extern int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type);
-extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REG_STRUCT_HAS_ADDR)
-#error "Non multi-arch definition of REG_STRUCT_HAS_ADDR"
+extern int gdbarch_frame_red_zone_size (struct gdbarch *gdbarch);
+extern void set_gdbarch_frame_red_zone_size (struct gdbarch *gdbarch, int frame_red_zone_size);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_RED_ZONE_SIZE)
+#error "Non multi-arch definition of FRAME_RED_ZONE_SIZE"
#endif
-#if !defined (REG_STRUCT_HAS_ADDR)
-#define REG_STRUCT_HAS_ADDR(gcc_p, type) (gdbarch_reg_struct_has_addr (current_gdbarch, gcc_p, type))
+#if !defined (FRAME_RED_ZONE_SIZE)
+#define FRAME_RED_ZONE_SIZE (gdbarch_frame_red_zone_size (current_gdbarch))
#endif
extern int gdbarch_parm_boundary (struct gdbarch *gdbarch);
@@ -2596,11 +1982,6 @@ extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundar
#define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_FLOAT_FORMAT)
-#define TARGET_FLOAT_FORMAT (default_float_format (current_gdbarch))
-#endif
-
extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch);
extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT)
@@ -2610,11 +1991,6 @@ extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floa
#define TARGET_FLOAT_FORMAT (gdbarch_float_format (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_DOUBLE_FORMAT)
-#define TARGET_DOUBLE_FORMAT (default_double_format (current_gdbarch))
-#endif
-
extern const struct floatformat * gdbarch_double_format (struct gdbarch *gdbarch);
extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct floatformat * double_format);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_DOUBLE_FORMAT)
@@ -2624,11 +2000,6 @@ extern void set_gdbarch_double_format (struct gdbarch *gdbarch, const struct flo
#define TARGET_DOUBLE_FORMAT (gdbarch_double_format (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_LONG_DOUBLE_FORMAT)
-#define TARGET_LONG_DOUBLE_FORMAT (default_double_format (current_gdbarch))
-#endif
-
extern const struct floatformat * gdbarch_long_double_format (struct gdbarch *gdbarch);
extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struct floatformat * long_double_format);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_LONG_DOUBLE_FORMAT)
@@ -2638,11 +2009,6 @@ extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struc
#define TARGET_LONG_DOUBLE_FORMAT (gdbarch_long_double_format (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (CONVERT_FROM_FUNC_PTR_ADDR)
-#define CONVERT_FROM_FUNC_PTR_ADDR(addr) (core_addr_identity (addr))
-#endif
-
typedef CORE_ADDR (gdbarch_convert_from_func_ptr_addr_ftype) (CORE_ADDR addr);
extern CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr);
extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr);
@@ -2663,11 +2029,6 @@ extern void set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, gdb
sort of generic thing to handle alignment or segmentation (it's
possible it should be in TARGET_READ_PC instead). */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (ADDR_BITS_REMOVE)
-#define ADDR_BITS_REMOVE(addr) (core_addr_identity (addr))
-#endif
-
typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr);
extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr);
extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove);
@@ -2681,11 +2042,6 @@ extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_
/* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
ADDR_BITS_REMOVE. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (SMASH_TEXT_ADDRESS)
-#define SMASH_TEXT_ADDRESS(addr) (core_addr_identity (addr))
-#endif
-
typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr);
extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr);
extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_smash_text_address_ftype *smash_text_address);
@@ -2712,11 +2068,6 @@ extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_sma
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP_P)
-#define SOFTWARE_SINGLE_STEP_P() (0)
-#endif
-
extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P)
#error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
@@ -2725,11 +2076,6 @@ extern int gdbarch_software_single_step_p (struct gdbarch *gdbarch);
#define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (SOFTWARE_SINGLE_STEP)
-#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0)
-#endif
-
typedef void (gdbarch_software_single_step_ftype) (enum target_signal sig, int insert_breakpoints_p);
extern void gdbarch_software_single_step (struct gdbarch *gdbarch, enum target_signal sig, int insert_breakpoints_p);
extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step);
@@ -2740,13 +2086,11 @@ extern void set_gdbarch_software_single_step (struct gdbarch *gdbarch, gdbarch_s
#define SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p) (gdbarch_software_single_step (current_gdbarch, sig, insert_breakpoints_p))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (TARGET_PRINT_INSN)
-#define TARGET_PRINT_INSN(vma, info) (legacy_print_insn (vma, info))
-#endif
+/* FIXME: cagney/2003-08-28: Need to find a better way of selecting the
+ disassembler. Perhaphs objdump can handle it? */
-typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, disassemble_info *info);
-extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info);
+typedef int (gdbarch_print_insn_ftype) (bfd_vma vma, struct disassemble_info *info);
+extern int gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, struct disassemble_info *info);
extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_ftype *print_insn);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_PRINT_INSN)
#error "Non multi-arch definition of TARGET_PRINT_INSN"
@@ -2755,11 +2099,6 @@ extern void set_gdbarch_print_insn (struct gdbarch *gdbarch, gdbarch_print_insn_
#define TARGET_PRINT_INSN(vma, info) (gdbarch_print_insn (current_gdbarch, vma, info))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (SKIP_TRAMPOLINE_CODE)
-#define SKIP_TRAMPOLINE_CODE(pc) (generic_skip_trampoline_code (pc))
-#endif
-
typedef CORE_ADDR (gdbarch_skip_trampoline_code_ftype) (CORE_ADDR pc);
extern CORE_ADDR gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc);
extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code);
@@ -2774,11 +2113,6 @@ extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_s
trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
to nonzero if we are currently stopped in one of these. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE)
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (generic_in_solib_call_trampoline (pc, name))
-#endif
-
typedef int (gdbarch_in_solib_call_trampoline_ftype) (CORE_ADDR pc, char *name);
extern int gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline);
@@ -2791,11 +2125,6 @@ extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbar
/* Some systems also have trampoline code for returning from shared libs. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_RETURN_TRAMPOLINE)
-#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (generic_in_solib_return_trampoline (pc, name))
-#endif
-
typedef int (gdbarch_in_solib_return_trampoline_ftype) (CORE_ADDR pc, char *name);
extern int gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline);
@@ -2827,11 +2156,6 @@ extern void set_gdbarch_in_solib_return_trampoline (struct gdbarch *gdbarch, gdb
Some code also depends on SIGTRAMP_START and SIGTRAMP_END but other
does not. */
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (PC_IN_SIGTRAMP)
-#define PC_IN_SIGTRAMP(pc, name) (legacy_pc_in_sigtramp (pc, name))
-#endif
-
typedef int (gdbarch_pc_in_sigtramp_ftype) (CORE_ADDR pc, char *name);
extern int gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
extern void set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp);
@@ -2849,11 +2173,6 @@ extern void set_gdbarch_pc_in_sigtramp (struct gdbarch *gdbarch, gdbarch_pc_in_s
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_START_P)
-#define SIGTRAMP_START_P() (0)
-#endif
-
extern int gdbarch_sigtramp_start_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_START_P)
#error "Non multi-arch definition of SIGTRAMP_START"
@@ -2862,11 +2181,6 @@ extern int gdbarch_sigtramp_start_p (struct gdbarch *gdbarch);
#define SIGTRAMP_START_P() (gdbarch_sigtramp_start_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_START)
-#define SIGTRAMP_START(pc) (internal_error (__FILE__, __LINE__, "SIGTRAMP_START"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_sigtramp_start_ftype) (CORE_ADDR pc);
extern CORE_ADDR gdbarch_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc);
extern void set_gdbarch_sigtramp_start (struct gdbarch *gdbarch, gdbarch_sigtramp_start_ftype *sigtramp_start);
@@ -2884,11 +2198,6 @@ extern void set_gdbarch_sigtramp_start (struct gdbarch *gdbarch, gdbarch_sigtram
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_END_P)
-#define SIGTRAMP_END_P() (0)
-#endif
-
extern int gdbarch_sigtramp_end_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SIGTRAMP_END_P)
#error "Non multi-arch definition of SIGTRAMP_END"
@@ -2897,11 +2206,6 @@ extern int gdbarch_sigtramp_end_p (struct gdbarch *gdbarch);
#define SIGTRAMP_END_P() (gdbarch_sigtramp_end_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (SIGTRAMP_END)
-#define SIGTRAMP_END(pc) (internal_error (__FILE__, __LINE__, "SIGTRAMP_END"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_sigtramp_end_ftype) (CORE_ADDR pc);
extern CORE_ADDR gdbarch_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc);
extern void set_gdbarch_sigtramp_end (struct gdbarch *gdbarch, gdbarch_sigtramp_end_ftype *sigtramp_end);
@@ -2939,11 +2243,6 @@ typedef char * (gdbarch_construct_inferior_arguments_ftype) (struct gdbarch *gdb
extern char * gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv);
extern void set_gdbarch_construct_inferior_arguments (struct gdbarch *gdbarch, gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments);
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (ELF_MAKE_MSYMBOL_SPECIAL)
-#define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (default_elf_make_msymbol_special (sym, msym))
-#endif
-
typedef void (gdbarch_elf_make_msymbol_special_ftype) (asymbol *sym, struct minimal_symbol *msym);
extern void gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym);
extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special);
@@ -2954,11 +2253,6 @@ extern void set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, gdbar
#define ELF_MAKE_MSYMBOL_SPECIAL(sym, msym) (gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (COFF_MAKE_MSYMBOL_SPECIAL)
-#define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (default_coff_make_msymbol_special (val, msym))
-#endif
-
typedef void (gdbarch_coff_make_msymbol_special_ftype) (int val, struct minimal_symbol *msym);
extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym);
extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special);
@@ -2969,11 +2263,6 @@ extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdba
#define COFF_MAKE_MSYMBOL_SPECIAL(val, msym) (gdbarch_coff_make_msymbol_special (current_gdbarch, val, msym))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (NAME_OF_MALLOC)
-#define NAME_OF_MALLOC ("malloc")
-#endif
-
extern const char * gdbarch_name_of_malloc (struct gdbarch *gdbarch);
extern void set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, const char * name_of_malloc);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (NAME_OF_MALLOC)
@@ -2983,11 +2272,6 @@ extern void set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, const char * na
#define NAME_OF_MALLOC (gdbarch_name_of_malloc (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STEP_BREAKPOINT)
-#define CANNOT_STEP_BREAKPOINT (0)
-#endif
-
extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch);
extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STEP_BREAKPOINT)
@@ -2997,11 +2281,6 @@ extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int can
#define CANNOT_STEP_BREAKPOINT (gdbarch_cannot_step_breakpoint (current_gdbarch))
#endif
-/* Default (value) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
-#define HAVE_NONSTEPPABLE_WATCHPOINT (0)
-#endif
-
extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (HAVE_NONSTEPPABLE_WATCHPOINT)
@@ -3018,11 +2297,6 @@ extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, i
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
-#define ADDRESS_CLASS_TYPE_FLAGS_P() (0)
-#endif
-
extern int gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS_P)
#error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS"
@@ -3031,11 +2305,6 @@ extern int gdbarch_address_class_type_flags_p (struct gdbarch *gdbarch);
#define ADDRESS_CLASS_TYPE_FLAGS_P() (gdbarch_address_class_type_flags_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (ADDRESS_CLASS_TYPE_FLAGS)
-#define ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class) (internal_error (__FILE__, __LINE__, "ADDRESS_CLASS_TYPE_FLAGS"), 0)
-#endif
-
typedef int (gdbarch_address_class_type_flags_ftype) (int byte_size, int dwarf2_addr_class);
extern int gdbarch_address_class_type_flags (struct gdbarch *gdbarch, int byte_size, int dwarf2_addr_class);
extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_ftype *address_class_type_flags);
@@ -3073,11 +2342,6 @@ extern void set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdbarch_re
#endif
#endif
-/* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (FETCH_POINTER_ARGUMENT_P)
-#define FETCH_POINTER_ARGUMENT_P() (0)
-#endif
-
extern int gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_POINTER_ARGUMENT_P)
#error "Non multi-arch definition of FETCH_POINTER_ARGUMENT"
@@ -3086,11 +2350,6 @@ extern int gdbarch_fetch_pointer_argument_p (struct gdbarch *gdbarch);
#define FETCH_POINTER_ARGUMENT_P() (gdbarch_fetch_pointer_argument_p (current_gdbarch))
#endif
-/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (FETCH_POINTER_ARGUMENT)
-#define FETCH_POINTER_ARGUMENT(frame, argi, type) (internal_error (__FILE__, __LINE__, "FETCH_POINTER_ARGUMENT"), 0)
-#endif
-
typedef CORE_ADDR (gdbarch_fetch_pointer_argument_ftype) (struct frame_info *frame, int argi, struct type *type);
extern CORE_ADDR gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, struct frame_info *frame, int argi, struct type *type);
extern void set_gdbarch_fetch_pointer_argument (struct gdbarch *gdbarch, gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument);
@@ -3326,14 +2585,6 @@ extern const struct bfd_arch_info *target_architecture;
#endif
-/* The target-system-dependent disassembler is semi-dynamic */
-
-/* Use gdb_disassemble, and gdbarch_print_insn instead. */
-extern int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info*);
-
-/* Use set_gdbarch_print_insn instead. */
-extern disassemble_info deprecated_tm_print_insn_info;
-
/* Set the dynamic target-system-dependent parameters (architecture,
byte-order, ...) using information found in the BFD */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 9a633482a08..0884c3cb6fe 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -453,7 +453,9 @@ v:2:SP_REGNUM:int:sp_regnum::::-1:-1::0
v:2:PC_REGNUM:int:pc_regnum::::-1:-1::0
v:2:PS_REGNUM:int:ps_regnum::::-1:-1::0
v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0
-v:2:NPC_REGNUM:int:npc_regnum::::0:-1::0
+# Replace DEPRECATED_NPC_REGNUM with an implementation of WRITE_PC
+# that updates PC, NPC and even NNPC.
+v:2:DEPRECATED_NPC_REGNUM:int:deprecated_npc_regnum::::0:-1::0
# Convert stab register number (from \`r\' declaration) to a gdb REGNUM.
f:2:STAB_REG_TO_REGNUM:int:stab_reg_to_regnum:int stab_regnr:stab_regnr:::no_op_reg_to_regnum::0
# Provide a default mapping from a ecoff register number to a gdb REGNUM.
@@ -481,7 +483,7 @@ v::DEPRECATED_REGISTER_BYTES:int:deprecated_register_bytes
# consequence, even when the predicate is false, the corresponding
# function works. This simplifies the migration process - old code,
# calling DEPRECATED_REGISTER_BYTE, doesn't need to be modified.
-F::REGISTER_BYTE:int:deprecated_register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte
+F::DEPRECATED_REGISTER_BYTE:int:deprecated_register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte
# If all registers have identical raw and virtual sizes and those
# sizes agree with the value computed from REGISTER_TYPE,
# DEPRECATED_REGISTER_RAW_SIZE can be deleted. See: maint print
@@ -526,7 +528,7 @@ F:2:DEPRECATED_DUMMY_WRITE_SP:void:deprecated_dummy_write_sp:CORE_ADDR val:val
# DEPRECATED_REGISTER_SIZE can be deleted.
v::DEPRECATED_REGISTER_SIZE:int:deprecated_register_size
v::CALL_DUMMY_LOCATION:int:call_dummy_location:::::AT_ENTRY_POINT::0
-f::CALL_DUMMY_ADDRESS:CORE_ADDR:call_dummy_address:void::::entry_point_address::0
+F::DEPRECATED_CALL_DUMMY_ADDRESS:CORE_ADDR:deprecated_call_dummy_address:void
# DEPRECATED_CALL_DUMMY_START_OFFSET can be deleted.
v::DEPRECATED_CALL_DUMMY_START_OFFSET:CORE_ADDR:deprecated_call_dummy_start_offset
# DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET can be deleted.
@@ -640,9 +642,14 @@ F::DEPRECATED_FRAME_LOCALS_ADDRESS:CORE_ADDR:deprecated_frame_locals_address:str
F::DEPRECATED_SAVED_PC_AFTER_CALL:CORE_ADDR:deprecated_saved_pc_after_call:struct frame_info *frame:frame
F:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame
#
-F:2:STACK_ALIGN:CORE_ADDR:stack_align:CORE_ADDR sp:sp
+# DEPRECATED_STACK_ALIGN has been replaced by an initial aligning call
+# to frame_align and the requirement that methods such as
+# push_dummy_call and frame_red_zone_size maintain correct stack/frame
+# alignment.
+F:2:DEPRECATED_STACK_ALIGN:CORE_ADDR:deprecated_stack_align:CORE_ADDR sp:sp
M:::CORE_ADDR:frame_align:CORE_ADDR address:address
-F:2:REG_STRUCT_HAS_ADDR:int:reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type
+F:2:DEPRECATED_REG_STRUCT_HAS_ADDR:int:deprecated_reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type
+v::FRAME_RED_ZONE_SIZE:int:frame_red_zone_size
v:2:PARM_BOUNDARY:int:parm_boundary
#
v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (gdbarch)::%s:(TARGET_FLOAT_FORMAT)->name
@@ -671,7 +678,9 @@ f:2:SMASH_TEXT_ADDRESS:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr:::core_a
# FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
# single step. If not, then implement single step using breakpoints.
F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p
-f:2:TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, disassemble_info *info:vma, info:::legacy_print_insn::0
+# FIXME: cagney/2003-08-28: Need to find a better way of selecting the
+# disassembler. Perhaphs objdump can handle it?
+f::TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, struct disassemble_info *info:vma, info:::0:
f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::0
@@ -833,13 +842,6 @@ cat <<EOF
#ifndef GDBARCH_H
#define GDBARCH_H
-#include "dis-asm.h" /* Get defs for disassemble_info, which unfortunately is a typedef. */
-#if !GDB_MULTI_ARCH
-/* Pull in function declarations refered to, indirectly, via macros. */
-#include "inferior.h" /* For unsigned_address_to_pointer(). */
-#include "symfile.h" /* For entry_point_address(). */
-#endif
-
struct floatformat;
struct ui_file;
struct frame_info;
@@ -848,6 +850,7 @@ struct objfile;
struct minimal_symbol;
struct regcache;
struct reggroup;
+struct disassemble_info;
extern struct gdbarch *current_gdbarch;
@@ -912,11 +915,6 @@ do
printf "#endif\n"
printf "#endif\n"
printf "\n"
- printf "/* Default predicate for non- multi-arch targets. */\n"
- printf "#if (!GDB_MULTI_ARCH) && !defined (${macro}_P)\n"
- printf "#define ${macro}_P() (0)\n"
- printf "#endif\n"
- printf "\n"
printf "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);\n"
printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro}_P)\n"
printf "#error \"Non multi-arch definition of ${macro}\"\n"
@@ -928,15 +926,6 @@ do
fi
if class_is_variable_p
then
- if fallback_default_p || class_is_predicate_p
- then
- printf "\n"
- printf "/* Default (value) for non- multi-arch platforms. */\n"
- printf "#if (!GDB_MULTI_ARCH) && !defined (${macro})\n"
- echo "#define ${macro} (${fallbackdefault})" \
- | sed -e 's/\([^a-z_]\)\(gdbarch[^a-z_]\)/\1current_\2/g'
- printf "#endif\n"
- fi
printf "\n"
printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
printf "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});\n"
@@ -949,27 +938,6 @@ do
fi
if class_is_function_p
then
- if class_is_multiarch_p ; then :
- elif fallback_default_p || class_is_predicate_p
- then
- printf "\n"
- printf "/* Default (function) for non- multi-arch platforms. */\n"
- printf "#if (!GDB_MULTI_ARCH) && !defined (${macro})\n"
- if [ "x${fallbackdefault}" = "x0" ]
- then
- if [ "x${actual}" = "x-" ]
- then
- printf "#define ${macro} (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n"
- else
- printf "#define ${macro}(${actual}) (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n"
- fi
- else
- # FIXME: Should be passing current_gdbarch through!
- echo "#define ${macro}(${actual}) (${fallbackdefault} (${actual}))" \
- | sed -e 's/\([^a-z_]\)\(gdbarch[^a-z_]\)/\1current_\2/g'
- fi
- printf "#endif\n"
- fi
printf "\n"
if [ "x${formal}" = "xvoid" ] && class_is_multiarch_p
then
@@ -1244,14 +1212,6 @@ extern const struct bfd_arch_info *target_architecture;
#endif
-/* The target-system-dependent disassembler is semi-dynamic */
-
-/* Use gdb_disassemble, and gdbarch_print_insn instead. */
-extern int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info*);
-
-/* Use set_gdbarch_print_insn instead. */
-extern disassemble_info deprecated_tm_print_insn_info;
-
/* Set the dynamic target-system-dependent parameters (architecture,
byte-order, ...) using information found in the BFD */
@@ -1291,27 +1251,8 @@ cat <<EOF
#include "defs.h"
#include "arch-utils.h"
-#if GDB_MULTI_ARCH
#include "gdbcmd.h"
#include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
-#else
-/* Just include everything in sight so that the every old definition
- of macro is visible. */
-#include "gdb_string.h"
-#include <ctype.h>
-#include "symtab.h"
-#include "frame.h"
-#include "inferior.h"
-#include "breakpoint.h"
-#include "gdb_wait.h"
-#include "gdbcore.h"
-#include "gdbcmd.h"
-#include "target.h"
-#include "gdbthread.h"
-#include "annotate.h"
-#include "symfile.h" /* for overlay functions */
-#include "value.h" /* For old tm.h/nm.h macros. */
-#endif
#include "symcat.h"
#include "floatformat.h"
@@ -1575,9 +1516,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
struct cleanup *cleanups;
long dummy;
char *buf;
- /* Only perform sanity checks on a multi-arch target. */
- if (!GDB_MULTI_ARCH)
- return;
log = mem_fileopen ();
cleanups = make_cleanup_ui_file_delete (log);
/* fundamental */
@@ -1660,10 +1598,9 @@ do
then
if class_is_multiarch_p
then
- printf " if (GDB_MULTI_ARCH)\n"
- printf " fprintf_unfiltered (file,\n"
- printf " \"gdbarch_dump: gdbarch_${function}_p() = %%d\\\\n\",\n"
- printf " gdbarch_${function}_p (current_gdbarch));\n"
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: gdbarch_${function}_p() = %%d\\\\n\",\n"
+ printf " gdbarch_${function}_p (current_gdbarch));\n"
else
printf "#ifdef ${macro}_P\n"
printf " fprintf_unfiltered (file,\n"
@@ -1679,19 +1616,13 @@ do
# multiarch functions don't have macros.
if class_is_multiarch_p
then
- printf " if (GDB_MULTI_ARCH)\n"
- printf " fprintf_unfiltered (file,\n"
- printf " \"gdbarch_dump: ${function} = 0x%%08lx\\\\n\",\n"
- printf " (long) current_gdbarch->${function});\n"
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: ${function} = 0x%%08lx\\\\n\",\n"
+ printf " (long) current_gdbarch->${function});\n"
continue
fi
# Print the macro definition.
printf "#ifdef ${macro}\n"
- if [ "x${returntype}" = "xvoid" ]
- then
- printf "#if GDB_MULTI_ARCH\n"
- printf " /* Macro might contain \`[{}]' when not multi-arch */\n"
- fi
if class_is_function_p
then
printf " fprintf_unfiltered (file,\n"
@@ -1703,11 +1634,6 @@ do
printf " \"gdbarch_dump: ${macro} # %%s\\\\n\",\n"
printf " XSTRING (${macro}));\n"
fi
- # Print the architecture vector value
- if [ "x${returntype}" = "xvoid" ]
- then
- printf "#endif\n"
- fi
if [ "x${print_p}" = "x()" ]
then
printf " gdbarch_dump_${function} (current_gdbarch);\n"
@@ -1722,11 +1648,10 @@ do
printf " ${print});\n"
elif class_is_function_p
then
- printf " if (GDB_MULTI_ARCH)\n"
- printf " fprintf_unfiltered (file,\n"
- printf " \"gdbarch_dump: ${macro} = <0x%%08lx>\\\\n\",\n"
- printf " (long) current_gdbarch->${function}\n"
- printf " /*${macro} ()*/);\n"
+ printf " fprintf_unfiltered (file,\n"
+ printf " \"gdbarch_dump: ${macro} = <0x%%08lx>\\\\n\",\n"
+ printf " (long) current_gdbarch->${function}\n"
+ printf " /*${macro} ()*/);\n"
else
printf " fprintf_unfiltered (file,\n"
printf " \"gdbarch_dump: ${macro} = %s\\\\n\",\n" "${fmt}"
@@ -2080,37 +2005,30 @@ append_name (const char ***buf, int *nr, const char *name)
const char **
gdbarch_printable_names (void)
{
- if (GDB_MULTI_ARCH)
+ /* Accumulate a list of names based on the registed list of
+ architectures. */
+ enum bfd_architecture a;
+ int nr_arches = 0;
+ const char **arches = NULL;
+ struct gdbarch_registration *rego;
+ for (rego = gdbarch_registry;
+ rego != NULL;
+ rego = rego->next)
{
- /* Accumulate a list of names based on the registed list of
- architectures. */
- enum bfd_architecture a;
- int nr_arches = 0;
- const char **arches = NULL;
- struct gdbarch_registration *rego;
- for (rego = gdbarch_registry;
- rego != NULL;
- rego = rego->next)
- {
- const struct bfd_arch_info *ap;
- ap = bfd_lookup_arch (rego->bfd_architecture, 0);
- if (ap == NULL)
- internal_error (__FILE__, __LINE__,
- "gdbarch_architecture_names: multi-arch unknown");
- do
- {
- append_name (&arches, &nr_arches, ap->printable_name);
- ap = ap->next;
- }
- while (ap != NULL);
- }
- append_name (&arches, &nr_arches, NULL);
- return arches;
+ const struct bfd_arch_info *ap;
+ ap = bfd_lookup_arch (rego->bfd_architecture, 0);
+ if (ap == NULL)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch_architecture_names: multi-arch unknown");
+ do
+ {
+ append_name (&arches, &nr_arches, ap->printable_name);
+ ap = ap->next;
+ }
+ while (ap != NULL);
}
- else
- /* Just return all the architectures that BFD knows. Assume that
- the legacy architecture framework supports them. */
- return bfd_arch_list ();
+ append_name (&arches, &nr_arches, NULL);
+ return arches;
}
@@ -2151,12 +2069,6 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
(*curr)->dump_tdep = dump_tdep;
(*curr)->arches = NULL;
(*curr)->next = NULL;
- /* When non- multi-arch, install whatever target dump routine we've
- been provided - hopefully that routine has been written correctly
- and works regardless of multi-arch. */
- if (!GDB_MULTI_ARCH && dump_tdep != NULL
- && startup_gdbarch.dump_tdep == NULL)
- startup_gdbarch.dump_tdep = dump_tdep;
}
void
@@ -2388,11 +2300,6 @@ gdbarch_update_p (struct gdbarch_info info)
}
-/* Disassembler */
-
-/* Pointer to the target-dependent disassembly function. */
-int (*deprecated_tm_print_insn) (bfd_vma, disassemble_info *);
-
extern void _initialize_gdbarch (void);
void
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 1a3a7dc27fc..42dab168db6 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,12 @@
+2003-08-08 H.J. Lu <hongjiu.lu@intel.com>
+
+ * Makefile.in (install-only): Create dest dir. Support DESTDIR.
+ (uninstall): Support DESTDIR.
+
+Mon Jul 21 20:09:34 UTC 2003 Brendan Conoboy <blc@redhat.com>
+
+ * configure.srv: Add xscale*linux copy of arm*linux entry.
+
2003-07-24 Daniel Jacobowitz <drow@mvista.com>
* linux-arm-low.c (arm_reinsert_addr): New function.
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 80667f9c6ce..8554dae9afb 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -151,13 +151,15 @@ install: all install-only
install-only:
n=`echo gdbserver | sed '$(program_transform_name)'`; \
if [ x$$n = x ]; then n=gdbserver; else true; fi; \
- $(INSTALL_PROGRAM) gdbserver $(bindir)/$$n; \
- $(INSTALL_DATA) $(srcdir)/gdbserver.1 $(man1dir)/$$n.1
+ $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \
+ $(INSTALL_PROGRAM) gdbserver $(DESTDIR)$(bindir)/$$n; \
+ $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(man1dir); \
+ $(INSTALL_DATA) $(srcdir)/gdbserver.1 $(DESTDIR)$(man1dir)/$$n.1
uninstall: force
n=`echo gdbserver | sed '$(program_transform_name)'`; \
if [ x$$n = x ]; then n=gdbserver; else true; fi; \
- rm -f $(bindir)/$$n $(man1dir)/$$n.1
+ rm -f $(bindir)/$$n $(DESTDIR)$(man1dir)/$$n.1
installcheck:
check:
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 6ab60e93549..251dd6b5dd4 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -64,6 +64,11 @@ case "${target}" in
srv_tgtobj="linux-low.o linux-x86-64-low.o i387-fp.o"
srv_linux_regsets=yes
;;
+ xscale*-*-linux*) srv_regobj=reg-arm.o
+ srv_tgtobj="linux-low.o linux-arm-low.o"
+ srv_linux_usrregs=yes
+ srv_linux_thread_db=yes
+ ;;
*) echo "Error: target not supported by gdbserver."
exit 1
;;
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index fcefcd4c41a..9953e891071 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -147,7 +147,7 @@ static void virtual_base_list_aux (struct type *dclass);
struct type *
alloc_type (struct objfile *objfile)
{
- register struct type *type;
+ struct type *type;
/* Alloc the structure and start off with all fields zeroed. */
@@ -228,7 +228,7 @@ smash_type (struct type *type)
struct type *
make_pointer_type (struct type *type, struct type **typeptr)
{
- register struct type *ntype; /* New type */
+ struct type *ntype; /* New type */
struct objfile *objfile;
ntype = TYPE_POINTER_TYPE (type);
@@ -295,7 +295,7 @@ lookup_pointer_type (struct type *type)
struct type *
make_reference_type (struct type *type, struct type **typeptr)
{
- register struct type *ntype; /* New type */
+ struct type *ntype; /* New type */
struct objfile *objfile;
ntype = TYPE_REFERENCE_TYPE (type);
@@ -357,7 +357,7 @@ lookup_reference_type (struct type *type)
struct type *
make_function_type (struct type *type, struct type **typeptr)
{
- register struct type *ntype; /* New type */
+ struct type *ntype; /* New type */
struct objfile *objfile;
if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */
@@ -509,8 +509,8 @@ make_type_with_address_space (struct type *type, int space_flag)
struct type *
make_cv_type (int cnst, int voltl, struct type *type, struct type **typeptr)
{
- register struct type *ntype; /* New type */
- register struct type *tmp_type = type; /* tmp type */
+ struct type *ntype; /* New type */
+ struct type *tmp_type = type; /* tmp type */
struct objfile *objfile;
int new_flags = (TYPE_INSTANCE_FLAGS (type)
@@ -593,7 +593,7 @@ replace_type (struct type *ntype, struct type *type)
struct type *
lookup_member_type (struct type *type, struct type *domain)
{
- register struct type *mtype;
+ struct type *mtype;
mtype = alloc_type (TYPE_OBJFILE (type));
smash_to_member_type (mtype, domain, type);
@@ -1020,7 +1020,7 @@ smash_to_method_type (struct type *type, struct type *domain,
"union ", or "enum ". If the type has a NULL name, return NULL. */
char *
-type_name_no_tag (register const struct type *type)
+type_name_no_tag (const struct type *type)
{
if (TYPE_TAG_NAME (type) != NULL)
return TYPE_TAG_NAME (type);
@@ -1056,8 +1056,8 @@ lookup_primitive_typename (const char *name)
struct type *
lookup_typename (const char *name, struct block *block, int noerr)
{
- register struct symbol *sym;
- register struct type *tmp;
+ struct symbol *sym;
+ struct type *tmp;
sym = lookup_symbol (name, block, VAR_DOMAIN, 0, (struct symtab **) NULL);
if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF)
@@ -1110,7 +1110,7 @@ lookup_signed_typename (const char *name)
struct type *
lookup_struct (char *name, struct block *block)
{
- register struct symbol *sym;
+ struct symbol *sym;
sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0,
(struct symtab **) NULL);
@@ -1132,7 +1132,7 @@ lookup_struct (char *name, struct block *block)
struct type *
lookup_union (char *name, struct block *block)
{
- register struct symbol *sym;
+ struct symbol *sym;
struct type *t;
sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0,
@@ -1164,7 +1164,7 @@ lookup_union (char *name, struct block *block)
struct type *
lookup_enum (char *name, struct block *block)
{
- register struct symbol *sym;
+ struct symbol *sym;
sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0,
(struct symtab **) NULL);
@@ -1876,7 +1876,7 @@ struct type *
init_type (enum type_code code, int length, int flags, char *name,
struct objfile *objfile)
{
- register struct type *type;
+ struct type *type;
type = alloc_type (objfile);
TYPE_CODE (type) = code;
@@ -1971,8 +1971,8 @@ append_composite_type_field (struct type *t, char *name, struct type *field)
struct type *
lookup_fundamental_type (struct objfile *objfile, int typeid)
{
- register struct type **typep;
- register int nbytes;
+ struct type **typep;
+ int nbytes;
if (typeid < 0 || typeid >= FT_NUM_MEMBERS)
{
@@ -2066,7 +2066,7 @@ has_vtable (struct type *dclass)
/* In the HP ANSI C++ runtime model, a class has a vtable only if it
has virtual functions or virtual bases. */
- register int i;
+ int i;
if (TYPE_CODE (dclass) != TYPE_CODE_CLASS)
return 0;
@@ -2109,7 +2109,7 @@ primary_base_class (struct type *dclass)
is the first directly inherited, non-virtual base class that
requires a virtual table */
- register int i;
+ int i;
if (TYPE_CODE (dclass) != TYPE_CODE_CLASS)
return NULL;
@@ -2138,7 +2138,7 @@ static void
virtual_base_list_aux (struct type *dclass)
{
struct vbase *tmp_vbase;
- register int i;
+ int i;
if (TYPE_CODE (dclass) != TYPE_CODE_CLASS)
return;
@@ -2195,9 +2195,9 @@ virtual_base_list_aux (struct type *dclass)
struct type **
virtual_base_list (struct type *dclass)
{
- register struct vbase *tmp_vbase;
- register struct vbase *tmp_vbase_2;
- register int i;
+ struct vbase *tmp_vbase;
+ struct vbase *tmp_vbase_2;
+ int i;
int count;
struct type **vbase_array;
@@ -2232,8 +2232,8 @@ virtual_base_list (struct type *dclass)
int
virtual_base_list_length (struct type *dclass)
{
- register int i;
- register struct vbase *tmp_vbase;
+ int i;
+ struct vbase *tmp_vbase;
current_vbase_list = NULL;
virtual_base_list_aux (dclass);
@@ -2250,8 +2250,8 @@ virtual_base_list_length (struct type *dclass)
int
virtual_base_list_length_skip_primaries (struct type *dclass)
{
- register int i;
- register struct vbase *tmp_vbase;
+ int i;
+ struct vbase *tmp_vbase;
struct type *primary;
primary = TYPE_RUNTIME_PTR (dclass) ? TYPE_PRIMARY_BASE (dclass) : NULL;
@@ -2279,8 +2279,8 @@ virtual_base_list_length_skip_primaries (struct type *dclass)
int
virtual_base_index (struct type *base, struct type *dclass)
{
- register struct type *vbase;
- register int i;
+ struct type *vbase;
+ int i;
if ((TYPE_CODE (dclass) != TYPE_CODE_CLASS) ||
(TYPE_CODE (base) != TYPE_CODE_CLASS))
@@ -2309,8 +2309,8 @@ virtual_base_index (struct type *base, struct type *dclass)
int
virtual_base_index_skip_primaries (struct type *base, struct type *dclass)
{
- register struct type *vbase;
- register int i, j;
+ struct type *vbase;
+ int i, j;
struct type *primary;
if ((TYPE_CODE (dclass) != TYPE_CODE_CLASS) ||
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index caeab83688f..a7e541cde6b 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -273,11 +273,31 @@ enum type_code
#define TYPE_ADDRESS_CLASS_ALL(t) (TYPE_INSTANCE_FLAGS(t) \
& TYPE_FLAG_ADDRESS_CLASS_ALL)
+/* Array bound type. */
+enum array_bound_type
+{
+ BOUND_SIMPLE = 0,
+ BOUND_BY_VALUE_IN_REG,
+ BOUND_BY_REF_IN_REG,
+ BOUND_BY_VALUE_ON_STACK,
+ BOUND_BY_REF_ON_STACK,
+ BOUND_CANNOT_BE_DETERMINED
+};
+
+/* This structure is space-critical.
+ Its layout has been tweaked to reduce the space used. */
+
struct main_type
{
/* Code for kind of type */
- enum type_code code;
+ ENUM_BITFIELD(type_code) code : 8;
+
+ /* Array bounds. These fields appear at this location because
+ they pack nicely here. */
+
+ ENUM_BITFIELD(array_bound_type) upper_bound_type : 4;
+ ENUM_BITFIELD(array_bound_type) lower_bound_type : 4;
/* Name of this type, or NULL if none.
@@ -299,17 +319,6 @@ struct main_type
char *tag_name;
- /* FIXME, these should probably be restricted to a Fortran-specific
- field in some fashion. */
-#define BOUND_CANNOT_BE_DETERMINED 5
-#define BOUND_BY_REF_ON_STACK 4
-#define BOUND_BY_VALUE_ON_STACK 3
-#define BOUND_BY_REF_IN_REG 2
-#define BOUND_BY_VALUE_IN_REG 1
-#define BOUND_SIMPLE 0
- int upper_bound_type;
- int lower_bound_type;
-
/* Every type is now associated with a particular objfile, and the
type is allocated on the type_obstack for that objfile. One problem
however, is that there are times when gdb allocates new types while
@@ -341,6 +350,15 @@ struct main_type
short nfields;
+ /* Field number of the virtual function table pointer in
+ VPTR_BASETYPE. If -1, we were unable to find the virtual
+ function table pointer in initial symbol reading, and
+ fill_in_vptr_fieldno should be called to find it if possible.
+
+ Unused if this type does not have virtual functions. */
+
+ short vptr_fieldno;
+
/* For structure and union types, a description of each field.
For set and pascal array types, there is one "field",
whose type is the domain type of the set or array.
@@ -422,15 +440,6 @@ struct main_type
struct type *vptr_basetype;
- /* Field number of the virtual function table pointer in
- VPTR_BASETYPE. If -1, we were unable to find the virtual
- function table pointer in initial symbol reading, and
- fill_in_vptr_fieldno should be called to find it if possible.
-
- Unused if this type does not have virtual functions. */
-
- int vptr_fieldno;
-
/* Slot to point to additional language-specific fields of this type. */
union type_specific
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 9b63616488c..a75b16921da 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -98,12 +98,12 @@ void inf_validate_procs (struct inf *inf);
void inf_steal_exc_ports (struct inf *inf);
void inf_restore_exc_ports (struct inf *inf);
struct proc *inf_tid_to_proc (struct inf *inf, int tid);
-inline void inf_set_threads_resume_sc (struct inf *inf,
- struct proc *run_thread,
- int run_others);
-inline int inf_set_threads_resume_sc_for_signal_thread (struct inf *inf);
-inline void inf_suspend (struct inf *inf);
-inline void inf_resume (struct inf *inf);
+void inf_set_threads_resume_sc (struct inf *inf,
+ struct proc *run_thread,
+ int run_others);
+int inf_set_threads_resume_sc_for_signal_thread (struct inf *inf);
+void inf_suspend (struct inf *inf);
+void inf_resume (struct inf *inf);
void inf_set_step_thread (struct inf *inf, struct proc *proc);
void inf_detach (struct inf *inf);
void inf_attach (struct inf *inf, int pid);
@@ -1077,7 +1077,7 @@ inf_validate_procs (struct inf *inf)
/* Makes sure that INF's thread list is synced with the actual process. */
-inline int
+int
inf_update_procs (struct inf *inf)
{
if (!inf->task)
@@ -1090,7 +1090,7 @@ inf_update_procs (struct inf *inf)
/* Sets the resume_sc of each thread in inf. That of RUN_THREAD is set to 0,
and others are set to their run_sc if RUN_OTHERS is true, and otherwise
their pause_sc. */
-inline void
+void
inf_set_threads_resume_sc (struct inf *inf,
struct proc *run_thread, int run_others)
{
@@ -1108,7 +1108,7 @@ inf_set_threads_resume_sc (struct inf *inf,
/* Cause INF to continue execution immediately; individual threads may still
be suspended (but their suspend counts will be updated). */
-inline void
+void
inf_resume (struct inf *inf)
{
struct proc *thread;
@@ -1133,7 +1133,7 @@ inf_resume (struct inf *inf)
/* Cause INF to stop execution immediately; individual threads may still
be running. */
-inline void
+void
inf_suspend (struct inf *inf)
{
struct proc *thread;
@@ -1179,7 +1179,7 @@ inf_set_step_thread (struct inf *inf, struct proc *thread)
/* Set up the thread resume_sc's so that only the signal thread is running
(plus whatever other thread are set to always run). Returns true if we
did so, or false if we can't find a signal thread. */
-inline int
+int
inf_set_threads_resume_sc_for_signal_thread (struct inf *inf)
{
if (inf->signal_thread)
diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
index da04c7416c0..2234d3bf8ef 100644
--- a/gdb/gnu-v2-abi.c
+++ b/gdb/gnu-v2-abi.c
@@ -354,8 +354,8 @@ gnuv2_baseclass_offset (struct type *type, int index, char *valaddr,
if (BASETYPE_VIA_VIRTUAL (type, index))
{
/* Must hunt for the pointer to this virtual baseclass. */
- register int i, len = TYPE_NFIELDS (type);
- register int n_baseclasses = TYPE_N_BASECLASSES (type);
+ int i, len = TYPE_NFIELDS (type);
+ int n_baseclasses = TYPE_N_BASECLASSES (type);
/* First look for the virtual baseclass pointer
in the fields. */
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index d9947f9f87d..b18e644796e 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -412,10 +412,15 @@ gnuv3_baseclass_offset (struct type *type, int index, char *valaddr,
v3 C++ ABI Section 2.4.I.2.b. Fortunately the ABI guarantees that the
vtable pointer will be located at the beginning of the object, so we can
bypass the casting. Verify that the TYPE_VPTR_FIELDNO is in fact at the
- start of whichever baseclass it resides in, as a sanity measure. */
+ start of whichever baseclass it resides in, as a sanity measure - iff
+ we have debugging information for that baseclass. */
vbasetype = TYPE_VPTR_BASETYPE (type);
- if (TYPE_FIELD_BITPOS (vbasetype, TYPE_VPTR_FIELDNO (vbasetype)) != 0)
+ if (TYPE_VPTR_FIELDNO (vbasetype) < 0)
+ fill_in_vptr_fieldno (vbasetype);
+
+ if (TYPE_VPTR_FIELDNO (vbasetype) >= 0
+ && TYPE_FIELD_BITPOS (vbasetype, TYPE_VPTR_FIELDNO (vbasetype)) != 0)
error ("Illegal vptr offset in class %s",
TYPE_NAME (vbasetype) ? TYPE_NAME (vbasetype) : "<unknown>");
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 6ff2710c22d..998927987b3 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -468,7 +468,7 @@ fetch_register (int regno)
if (regno < FP0_REGNUM)
supply_register (regno, (char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
- i387_supply_register (regno, (char *) &npx);
+ i387_supply_fsave ((const char *) &npx, regno);
else
internal_error (__FILE__, __LINE__,
"Invalid register no. %d in fetch_register.", regno);
@@ -483,7 +483,7 @@ go32_fetch_registers (int regno)
{
for (regno = 0; regno < FP0_REGNUM; regno++)
fetch_register (regno);
- i387_supply_fsave ((char *) &npx);
+ i387_supply_fsave ((const char *) &npx, -1);
}
}
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index c60c299f20d..a2fab9a3217 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -35,6 +35,7 @@
#include "objfiles.h"
#include "gdbcmd.h"
#include "gdb_assert.h"
+#include "dis-asm.h"
/* Extra info which is saved in each frame_info. */
struct frame_extra_info
@@ -320,11 +321,11 @@ h8300_next_prologue_insn (CORE_ADDR addr,
*/
static CORE_ADDR
-h8300_examine_prologue (register CORE_ADDR ip, register CORE_ADDR limit,
+h8300_examine_prologue (CORE_ADDR ip, CORE_ADDR limit,
CORE_ADDR after_prolog_fp, CORE_ADDR *fsr,
struct frame_info *fi)
{
- register CORE_ADDR next_ip;
+ CORE_ADDR next_ip;
int r;
int have_fp = 0;
unsigned short insn_word;
@@ -1330,7 +1331,6 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_long_double_bit (gdbarch, 4 * TARGET_CHAR_BIT);
- /* set_gdbarch_stack_align (gdbarch, SOME_stack_align); */
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
/* Char is unsigned. */
diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c
index 5d26c7c5442..62271ffbc14 100644
--- a/gdb/hppa-hpux-tdep.c
+++ b/gdb/hppa-hpux-tdep.c
@@ -32,12 +32,18 @@ extern initialize_file_ftype _initialize_hppa_hpux_tdep;
/* FIXME: brobecker 2002-12-25. The following functions will eventually
become static, after the multiarching conversion is done. */
int hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name);
-void hppa_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
- CORE_ADDR *tmp);
-void hppa_hpux_frame_base_before_sigtramp (struct frame_info *fi,
- CORE_ADDR *tmp);
-void hppa_hpux_frame_find_saved_regs_in_sigtramp
- (struct frame_info *fi, CORE_ADDR *fsr);
+void hppa32_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
+ CORE_ADDR *tmp);
+void hppa32_hpux_frame_base_before_sigtramp (struct frame_info *fi,
+ CORE_ADDR *tmp);
+void hppa32_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
+ CORE_ADDR *fsr);
+void hppa64_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
+ CORE_ADDR *tmp);
+void hppa64_hpux_frame_base_before_sigtramp (struct frame_info *fi,
+ CORE_ADDR *tmp);
+void hppa64_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
+ CORE_ADDR *fsr);
int
hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name)
@@ -48,9 +54,9 @@ hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name)
return (name && (strcmp ("_sigreturn", name) == 0));
}
-/* For hppa_hpux_frame_saved_pc_in_sigtramp,
- hppa_hpux_frame_base_before_sigtramp and
- hppa_hpux_frame_find_saved_regs_in_sigtramp:
+/* For hppa32_hpux_frame_saved_pc_in_sigtramp,
+ hppa32_hpux_frame_base_before_sigtramp and
+ hppa32_hpux_frame_find_saved_regs_in_sigtramp:
The signal context structure pointer is always saved at the base
of the frame which "calls" the signal handler. We only want to find
@@ -67,21 +73,21 @@ hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name)
written. */
void
-hppa_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi, CORE_ADDR *tmp)
+hppa32_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi, CORE_ADDR *tmp)
{
*tmp = read_memory_integer (get_frame_base (fi) + (43 * 4), 4);
}
void
-hppa_hpux_frame_base_before_sigtramp (struct frame_info *fi,
- CORE_ADDR *tmp)
+hppa32_hpux_frame_base_before_sigtramp (struct frame_info *fi,
+ CORE_ADDR *tmp)
{
*tmp = read_memory_integer (get_frame_base (fi) + (40 * 4), 4);
}
void
-hppa_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
- CORE_ADDR *fsr)
+hppa32_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
+ CORE_ADDR *fsr)
{
int i;
const CORE_ADDR tmp = get_frame_base (fi) + (10 * 4);
@@ -95,6 +101,53 @@ hppa_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
}
}
+/* For hppa64_hpux_frame_saved_pc_in_sigtramp,
+ hppa64_hpux_frame_base_before_sigtramp and
+ hppa64_hpux_frame_find_saved_regs_in_sigtramp:
+
+ These functions are the PA64 ABI equivalents of the 32bits counterparts
+ above. See the comments there.
+
+ For PA64, the save_state structure is at an offset of 24 32-bit words
+ from the sigcontext structure. The 64 bit general registers are at an
+ offset of 640 bytes from the beginning of the save_state structure,
+ and the floating pointer register are at an offset of 256 bytes from
+ the beginning of the save_state structure. */
+
+void
+hppa64_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi, CORE_ADDR *tmp)
+{
+ *tmp = read_memory_integer
+ (get_frame_base (fi) + (24 * 4) + 640 + (33 * 8), 8);
+}
+
+void
+hppa64_hpux_frame_base_before_sigtramp (struct frame_info *fi,
+ CORE_ADDR *tmp)
+{
+ *tmp = read_memory_integer
+ (get_frame_base (fi) + (24 * 4) + 640 + (30 * 8), 8);
+}
+
+void
+hppa64_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
+ CORE_ADDR *fsr)
+{
+ int i;
+ const CORE_ADDR tmp1 = get_frame_base (fi) + (24 * 4) + 640;
+ const CORE_ADDR tmp2 = get_frame_base (fi) + (24 * 4) + 256;
+
+ for (i = 0; i < NUM_REGS; i++)
+ {
+ if (i == SP_REGNUM)
+ fsr[SP_REGNUM] = read_memory_integer (tmp1 + SP_REGNUM * 8, 8);
+ else if (i >= FP0_REGNUM)
+ fsr[i] = tmp2 + (i - FP0_REGNUM) * 8;
+ else
+ fsr[i] = tmp1 + i * 8;
+ }
+}
+
static void
hppa_hpux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -118,6 +171,9 @@ _initialize_hppa_hpux_tdep (void)
{
gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_HPUX_SOM,
hppa_hpux_som_init_abi);
- gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_HPUX_ELF,
+ /* FIXME brobecker 2003-08-13: The machine number 25 corresponds to
+ the hppa2.0w bfd arch_info. A #define should probably be defined
+ in bfd, instead of using this hard-coded number. */
+ gdbarch_register_osabi (bfd_arch_hppa, 25, GDB_OSABI_HPUX_ELF,
hppa_hpux_elf_init_abi);
}
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index a20a3c677e2..cc1bb5e0bc4 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -37,6 +37,7 @@
/* For argument passing to the inferior */
#include "symtab.h"
#include "infcall.h"
+#include "dis-asm.h"
#ifdef USG
#include <sys/types.h>
@@ -64,9 +65,20 @@
#include "target.h"
#include "symfile.h"
#include "objfiles.h"
+#include "hppa-tdep.h"
/* Some local constants. */
-static const int hppa_num_regs = 128;
+static const int hppa32_num_regs = 128;
+static const int hppa64_num_regs = 96;
+
+static const int hppa64_call_dummy_breakpoint_offset = 22 * 4;
+
+/* DEPRECATED_CALL_DUMMY_LENGTH is computed based on the size of a
+ word on the target machine, not the size of an instruction. Since
+ a word on this target holds two instructions we have to divide the
+ instruction size by two to get the word size of the dummy. */
+static const int hppa32_call_dummy_length = INSTRUCTION_SIZE * 28;
+static const int hppa64_call_dummy_length = INSTRUCTION_SIZE * 26 / 2;
/* Get at various relevent fields of an instruction word. */
#define MASK_5 0x1f
@@ -164,16 +176,23 @@ int hppa_in_solib_call_trampoline (CORE_ADDR pc, char *name);
int hppa_in_solib_return_trampoline (CORE_ADDR pc, char *name);
CORE_ADDR hppa_saved_pc_after_call (struct frame_info *frame);
int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
-CORE_ADDR hppa_stack_align (CORE_ADDR sp);
+CORE_ADDR hppa32_stack_align (CORE_ADDR sp);
+CORE_ADDR hppa64_stack_align (CORE_ADDR sp);
int hppa_pc_requires_run_before_use (CORE_ADDR pc);
int hppa_instruction_nullified (void);
int hppa_register_raw_size (int reg_nr);
int hppa_register_byte (int reg_nr);
-struct type * hppa_register_virtual_type (int reg_nr);
+struct type * hppa32_register_virtual_type (int reg_nr);
+struct type * hppa64_register_virtual_type (int reg_nr);
void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp);
-void hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf);
-int hppa_use_struct_convention (int gcc_p, struct type *type);
-void hppa_store_return_value (struct type *type, char *valbuf);
+void hppa32_extract_return_value (struct type *type, char *regbuf,
+ char *valbuf);
+void hppa64_extract_return_value (struct type *type, char *regbuf,
+ char *valbuf);
+int hppa32_use_struct_convention (int gcc_p, struct type *type);
+int hppa64_use_struct_convention (int gcc_p, struct type *type);
+void hppa32_store_return_value (struct type *type, char *valbuf);
+void hppa64_store_return_value (struct type *type, char *valbuf);
CORE_ADDR hppa_extract_struct_value_address (char *regbuf);
int hppa_cannot_store_register (int regnum);
void hppa_init_extra_frame_info (int fromleaf, struct frame_info *frame);
@@ -182,7 +201,6 @@ int hppa_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe);
int hppa_frameless_function_invocation (struct frame_info *frame);
CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame);
CORE_ADDR hppa_frame_args_address (struct frame_info *fi);
-CORE_ADDR hppa_frame_locals_address (struct frame_info *fi);
int hppa_frame_num_args (struct frame_info *frame);
void hppa_push_dummy_frame (void);
void hppa_pop_frame (void);
@@ -217,11 +235,19 @@ extern int exception_catchpoints_are_fragile;
/* Should call_function allocate stack space for a struct return? */
int
-hppa_use_struct_convention (int gcc_p, struct type *type)
+hppa32_use_struct_convention (int gcc_p, struct type *type)
{
return (TYPE_LENGTH (type) > 2 * DEPRECATED_REGISTER_SIZE);
}
-
+
+/* Same as hppa32_use_struct_convention() for the PA64 ABI. */
+
+int
+hppa64_use_struct_convention (int gcc_p, struct type *type)
+{
+ /* RM: struct upto 128 bits are returned in registers */
+ return TYPE_LENGTH (type) > 16;
+}
/* Routines to extract various sized constants out of hppa
instructions. */
@@ -681,7 +707,7 @@ hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len)
/* Return the name of a register. */
const char *
-hppa_register_name (int i)
+hppa32_register_name (int i)
{
static char *names[] = {
"flags", "r1", "rp", "r3",
@@ -1562,7 +1588,7 @@ void
hppa_push_dummy_frame (void)
{
CORE_ADDR sp, pc, pcspace;
- register int regnum;
+ int regnum;
CORE_ADDR int_buffer;
double freg_buffer;
@@ -1607,7 +1633,7 @@ hppa_push_dummy_frame (void)
for (regnum = FP0_REGNUM; regnum < NUM_REGS; regnum++)
{
- deprecated_read_register_bytes (REGISTER_BYTE (regnum),
+ deprecated_read_register_bytes (DEPRECATED_REGISTER_BYTE (regnum),
(char *) &freg_buffer, 8);
sp = push_bytes (sp, (char *) &freg_buffer, 8);
}
@@ -1664,9 +1690,9 @@ find_dummy_frame_regs (struct frame_info *frame,
void
hppa_pop_frame (void)
{
- register struct frame_info *frame = get_current_frame ();
- register CORE_ADDR fp, npc, target_pc;
- register int regnum;
+ struct frame_info *frame = get_current_frame ();
+ CORE_ADDR fp, npc, target_pc;
+ int regnum;
CORE_ADDR *fsr;
double freg_buffer;
@@ -1688,7 +1714,7 @@ hppa_pop_frame (void)
if (fsr[regnum])
{
read_memory (fsr[regnum], (char *) &freg_buffer, 8);
- deprecated_write_register_bytes (REGISTER_BYTE (regnum),
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (regnum),
(char *) &freg_buffer, 8);
}
@@ -1844,7 +1870,7 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* The value of SP as it was passed into this function after
aligning. */
- CORE_ADDR orig_sp = STACK_ALIGN (sp);
+ CORE_ADDR orig_sp = DEPRECATED_STACK_ALIGN (sp);
/* The number of stack bytes occupied by the current argument. */
int bytes_reserved;
@@ -1907,7 +1933,7 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
The ABIs also mandate minimum stack alignments which we must
preserve. */
- cum_bytes_aligned = STACK_ALIGN (cum_bytes_reserved);
+ cum_bytes_aligned = DEPRECATED_STACK_ALIGN (cum_bytes_reserved);
sp += max (cum_bytes_aligned, REG_PARM_STACK_SPACE);
/* Now write each of the args at the proper offset down the stack. */
@@ -2014,7 +2040,7 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
The ABI also mandates minimum stack alignments which we must
preserve. */
- cum_bytes_aligned = STACK_ALIGN (cum_bytes_reserved);
+ cum_bytes_aligned = DEPRECATED_STACK_ALIGN (cum_bytes_reserved);
sp += max (cum_bytes_aligned, REG_PARM_STACK_SPACE);
/* Now write each of the args at the proper offset down the stack.
@@ -2042,9 +2068,9 @@ hppa_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
gets the value from the stack rather than from the buffer where all the
registers were saved when the function called completed. */
struct value *
-hppa_value_returned_from_stack (register struct type *valtype, CORE_ADDR addr)
+hppa_value_returned_from_stack (struct type *valtype, CORE_ADDR addr)
{
- register struct value *val;
+ struct value *val;
val = allocate_value (valtype);
CHECK_TYPEDEF (valtype);
@@ -2603,7 +2629,7 @@ hppa_target_write_pc (CORE_ADDR v, ptid_t ptid)
write_register_pid (31, v | 0x3, ptid);
write_register_pid (PC_REGNUM, v, ptid);
- write_register_pid (NPC_REGNUM, v + 4, ptid);
+ write_register_pid (DEPRECATED_NPC_REGNUM, v + 4, ptid);
}
/* return the alignment of a type in bytes. Structures have the maximum
@@ -2652,7 +2678,8 @@ pa_do_registers_info (int regnum, int fpregs)
/* Make a copy of gdb's save area (may cause actual
reads from the target). */
for (i = 0; i < NUM_REGS; i++)
- frame_register_read (deprecated_selected_frame, i, raw_regs + REGISTER_BYTE (i));
+ frame_register_read (deprecated_selected_frame, i,
+ raw_regs + DEPRECATED_REGISTER_BYTE (i));
if (regnum == -1)
pa_print_registers (raw_regs, regnum, fpregs);
@@ -2696,7 +2723,8 @@ pa_do_strcat_registers_info (int regnum, int fpregs, struct ui_file *stream,
/* Make a copy of gdb's save area (may cause actual
reads from the target). */
for (i = 0; i < NUM_REGS; i++)
- frame_register_read (deprecated_selected_frame, i, raw_regs + REGISTER_BYTE (i));
+ frame_register_read (deprecated_selected_frame, i,
+ raw_regs + DEPRECATED_REGISTER_BYTE (i));
if (regnum == -1)
pa_strcat_registers (raw_regs, regnum, fpregs, stream);
@@ -2743,7 +2771,7 @@ pa_register_look_aside (char *raw_regs, int regnum, long *raw_val)
int regaddr;
unsigned int offset;
- register int i;
+ int i;
int start;
@@ -2765,7 +2793,7 @@ pa_register_look_aside (char *raw_regs, int regnum, long *raw_val)
if (!is_pa_2)
{
- raw_val[1] = *(long *) (raw_regs + REGISTER_BYTE (regnum));
+ raw_val[1] = *(long *) (raw_regs + DEPRECATED_REGISTER_BYTE (regnum));
return;
}
@@ -4779,7 +4807,7 @@ hppa_skip_permanent_breakpoint (void)
Called only in the context of the "return" command. */
void
-hppa_store_return_value (struct type *type, char *valbuf)
+hppa32_store_return_value (struct type *type, char *valbuf)
{
/* For software floating point, the return value goes into the
integer registers. But we do not have any flag to key this on,
@@ -4787,16 +4815,42 @@ hppa_store_return_value (struct type *type, char *valbuf)
If its a float value, then we also store it into the floating
point registers. */
- deprecated_write_register_bytes (REGISTER_BYTE (28)
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (28)
+ (TYPE_LENGTH (type) > 4
? (8 - TYPE_LENGTH (type))
: (4 - TYPE_LENGTH (type))),
valbuf, TYPE_LENGTH (type));
if (TYPE_CODE (type) == TYPE_CODE_FLT)
- deprecated_write_register_bytes (REGISTER_BYTE (FP4_REGNUM),
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP4_REGNUM),
valbuf, TYPE_LENGTH (type));
}
+/* Same as hppa32_store_return_value(), but for the PA64 ABI. */
+
+void
+hppa64_store_return_value (struct type *type, char *valbuf)
+{
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ deprecated_write_register_bytes
+ (DEPRECATED_REGISTER_BYTE (FP4_REGNUM)
+ + DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (type),
+ valbuf, TYPE_LENGTH (type));
+ else if (is_integral_type(type))
+ deprecated_write_register_bytes
+ (DEPRECATED_REGISTER_BYTE (28)
+ + DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (type),
+ valbuf, TYPE_LENGTH (type));
+ else if (TYPE_LENGTH (type) <= 8)
+ deprecated_write_register_bytes
+ (DEPRECATED_REGISTER_BYTE (28),valbuf, TYPE_LENGTH (type));
+ else if (TYPE_LENGTH (type) <= 16)
+ {
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (28),valbuf, 8);
+ deprecated_write_register_bytes
+ (DEPRECATED_REGISTER_BYTE (29), valbuf + 8, TYPE_LENGTH (type) - 8);
+ }
+}
+
/* Copy the function's return value into VALBUF.
This function is called only in the context of "target function calls",
@@ -4805,22 +4859,50 @@ hppa_store_return_value (struct type *type, char *valbuf)
"return" command. */
void
-hppa_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+hppa32_extract_return_value (struct type *type, char *regbuf, char *valbuf)
{
if (TYPE_CODE (type) == TYPE_CODE_FLT)
- memcpy (valbuf,
- (char *)regbuf + REGISTER_BYTE (FP4_REGNUM),
- TYPE_LENGTH (type));
+ memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (FP4_REGNUM), TYPE_LENGTH (type));
else
memcpy (valbuf,
- ((char *)regbuf
- + REGISTER_BYTE (28)
+ (regbuf
+ + DEPRECATED_REGISTER_BYTE (28)
+ (TYPE_LENGTH (type) > 4
? (8 - TYPE_LENGTH (type))
: (4 - TYPE_LENGTH (type)))),
TYPE_LENGTH (type));
}
+/* Same as hppa32_extract_return_value but for the PA64 ABI case. */
+
+void
+hppa64_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+{
+ /* RM: Floats are returned in FR4R, doubles in FR4.
+ Integral values are in r28, padded on the left.
+ Aggregates less that 65 bits are in r28, right padded.
+ Aggregates upto 128 bits are in r28 and r29, right padded. */
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ memcpy (valbuf,
+ regbuf + DEPRECATED_REGISTER_BYTE (FP4_REGNUM)
+ + DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (type),
+ TYPE_LENGTH (type));
+ else if (is_integral_type(type))
+ memcpy (valbuf,
+ regbuf + DEPRECATED_REGISTER_BYTE (28)
+ + DEPRECATED_REGISTER_SIZE - TYPE_LENGTH (type),
+ TYPE_LENGTH (type));
+ else if (TYPE_LENGTH (type) <= 8)
+ memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (28),
+ TYPE_LENGTH (type));
+ else if (TYPE_LENGTH (type) <= 16)
+ {
+ memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (28), 8);
+ memcpy (valbuf + 8, regbuf + DEPRECATED_REGISTER_BYTE (29),
+ TYPE_LENGTH (type) - 8);
+ }
+}
+
int
hppa_reg_struct_has_addr (int gcc_p, struct type *type)
{
@@ -4837,7 +4919,7 @@ hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs)
}
CORE_ADDR
-hppa_stack_align (CORE_ADDR sp)
+hppa32_stack_align (CORE_ADDR sp)
{
/* elz: adjust the quantity to the next highest value which is
64-bit aligned. This is used in valops.c, when the sp is adjusted.
@@ -4845,6 +4927,13 @@ hppa_stack_align (CORE_ADDR sp)
return ((sp % 8) ? (sp + 7) & -8 : sp);
}
+CORE_ADDR
+hppa64_stack_align (CORE_ADDR sp)
+{
+ /* The PA64 ABI mandates a 16 byte stack alignment. */
+ return ((sp % 16) ? (sp + 15) & -16 : sp);
+}
+
int
hppa_pc_requires_run_before_use (CORE_ADDR pc)
{
@@ -4898,14 +4987,16 @@ hppa_register_raw_size (int reg_nr)
int
hppa_register_byte (int reg_nr)
{
- return reg_nr * 4;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ return reg_nr * tdep->bytes_per_address;
}
/* Return the GDB type object for the "standard" data type of data
in register N. */
struct type *
-hppa_register_virtual_type (int reg_nr)
+hppa32_register_virtual_type (int reg_nr)
{
if (reg_nr < FP4_REGNUM)
return builtin_type_int;
@@ -4913,6 +5004,18 @@ hppa_register_virtual_type (int reg_nr)
return builtin_type_float;
}
+/* Return the GDB type object for the "standard" data type of data
+ in register N. hppa64 version. */
+
+struct type *
+hppa64_register_virtual_type (int reg_nr)
+{
+ if (reg_nr < FP4_REGNUM)
+ return builtin_type_unsigned_long_long;
+ else
+ return builtin_type_double;
+}
+
/* Store the address of the place in which to copy the structure the
subroutine will return. This is called from call_function. */
@@ -4934,7 +5037,7 @@ hppa_extract_struct_value_address (char *regbuf)
the address size is equal to the size of an int* _on the host_...
One possible implementation that crossed my mind is to use
extract_address. */
- return (*(int *)(regbuf + REGISTER_BYTE (28)));
+ return (*(int *)(regbuf + DEPRECATED_REGISTER_BYTE (28)));
}
/* Return True if REGNUM is not a register available to the user
@@ -4976,6 +5079,7 @@ hppa_fetch_pointer_argument (struct frame_info *frame, int argi,
static struct gdbarch *
hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
+ struct gdbarch_tdep *tdep;
struct gdbarch *gdbarch;
/* Try to determine the ABI of the object we are loading. */
@@ -4992,12 +5096,71 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return (arches->gdbarch);
/* If none found, then allocate and initialize one. */
- gdbarch = gdbarch_alloc (&info, NULL);
+ tdep = XMALLOC (struct gdbarch_tdep);
+ gdbarch = gdbarch_alloc (&info, tdep);
+
+ /* Determine from the bfd_arch_info structure if we are dealing with
+ a 32 or 64 bits architecture. If the bfd_arch_info is not available,
+ then default to a 32bit machine. */
+ if (info.bfd_arch_info != NULL)
+ tdep->bytes_per_address =
+ info.bfd_arch_info->bits_per_address / info.bfd_arch_info->bits_per_byte;
+ else
+ tdep->bytes_per_address = 4;
- /* Hook in ABI-specific overrides, if they have been registered. */
- gdbarch_init_osabi (info, gdbarch);
+ /* Some parts of the gdbarch vector depend on whether we are running
+ on a 32 bits or 64 bits target. */
+ switch (tdep->bytes_per_address)
+ {
+ case 4:
+ set_gdbarch_num_regs (gdbarch, hppa32_num_regs);
+ set_gdbarch_register_name (gdbarch, hppa32_register_name);
+ set_gdbarch_deprecated_register_virtual_type
+ (gdbarch, hppa32_register_virtual_type);
+ set_gdbarch_deprecated_call_dummy_length
+ (gdbarch, hppa32_call_dummy_length);
+ set_gdbarch_deprecated_stack_align (gdbarch, hppa32_stack_align);
+ set_gdbarch_deprecated_reg_struct_has_addr
+ (gdbarch, hppa_reg_struct_has_addr);
+ set_gdbarch_deprecated_extract_return_value
+ (gdbarch, hppa32_extract_return_value);
+ set_gdbarch_use_struct_convention
+ (gdbarch, hppa32_use_struct_convention);
+ set_gdbarch_deprecated_store_return_value
+ (gdbarch, hppa32_store_return_value);
+ break;
+ case 8:
+ set_gdbarch_num_regs (gdbarch, hppa64_num_regs);
+ set_gdbarch_register_name (gdbarch, hppa64_register_name);
+ set_gdbarch_deprecated_register_virtual_type
+ (gdbarch, hppa64_register_virtual_type);
+ set_gdbarch_deprecated_call_dummy_breakpoint_offset
+ (gdbarch, hppa64_call_dummy_breakpoint_offset);
+ set_gdbarch_deprecated_call_dummy_length
+ (gdbarch, hppa64_call_dummy_length);
+ set_gdbarch_deprecated_stack_align (gdbarch, hppa64_stack_align);
+ set_gdbarch_deprecated_extract_return_value
+ (gdbarch, hppa64_extract_return_value);
+ set_gdbarch_use_struct_convention
+ (gdbarch, hppa64_use_struct_convention);
+ set_gdbarch_deprecated_store_return_value
+ (gdbarch, hppa64_store_return_value);
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "Unsupported address size: %d",
+ tdep->bytes_per_address);
+ }
- set_gdbarch_reg_struct_has_addr (gdbarch, hppa_reg_struct_has_addr);
+ /* The following gdbarch vector elements depend on other parts of this
+ vector which have been set above, depending on the ABI. */
+ set_gdbarch_deprecated_register_bytes
+ (gdbarch, gdbarch_num_regs (gdbarch) * tdep->bytes_per_address);
+ set_gdbarch_long_bit (gdbarch, tdep->bytes_per_address * TARGET_CHAR_BIT);
+ set_gdbarch_long_long_bit (gdbarch, 64);
+ set_gdbarch_ptr_bit (gdbarch, tdep->bytes_per_address * TARGET_CHAR_BIT);
+
+ /* The following gdbarch vector elements do not depend on the address
+ size, or in any other gdbarch element previously set. */
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_skip_prologue (gdbarch, hppa_skip_prologue);
set_gdbarch_skip_trampoline_code (gdbarch, hppa_skip_trampoline_code);
@@ -5006,28 +5169,19 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
hppa_in_solib_return_trampoline);
set_gdbarch_deprecated_saved_pc_after_call (gdbarch, hppa_saved_pc_after_call);
set_gdbarch_inner_than (gdbarch, hppa_inner_than);
- set_gdbarch_stack_align (gdbarch, hppa_stack_align);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
- set_gdbarch_deprecated_register_size (gdbarch, 4);
- set_gdbarch_num_regs (gdbarch, hppa_num_regs);
+ set_gdbarch_deprecated_register_size (gdbarch, tdep->bytes_per_address);
set_gdbarch_deprecated_fp_regnum (gdbarch, 3);
set_gdbarch_sp_regnum (gdbarch, 30);
set_gdbarch_fp0_regnum (gdbarch, 64);
set_gdbarch_pc_regnum (gdbarch, PCOQ_HEAD_REGNUM);
- set_gdbarch_npc_regnum (gdbarch, PCOQ_TAIL_REGNUM);
+ set_gdbarch_deprecated_npc_regnum (gdbarch, PCOQ_TAIL_REGNUM);
set_gdbarch_deprecated_register_raw_size (gdbarch, hppa_register_raw_size);
- set_gdbarch_deprecated_register_bytes (gdbarch, hppa_num_regs * 4);
set_gdbarch_deprecated_register_byte (gdbarch, hppa_register_byte);
set_gdbarch_deprecated_register_virtual_size (gdbarch, hppa_register_raw_size);
- set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, tdep->bytes_per_address);
set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
- set_gdbarch_deprecated_register_virtual_type (gdbarch, hppa_register_virtual_type);
- set_gdbarch_register_name (gdbarch, hppa_register_name);
set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return);
- set_gdbarch_deprecated_extract_return_value (gdbarch,
- hppa_extract_return_value);
- set_gdbarch_use_struct_convention (gdbarch, hppa_use_struct_convention);
- set_gdbarch_deprecated_store_return_value (gdbarch, hppa_store_return_value);
set_gdbarch_deprecated_extract_struct_value_address
(gdbarch, hppa_extract_struct_value_address);
set_gdbarch_cannot_store_register (gdbarch, hppa_cannot_store_register);
@@ -5040,9 +5194,9 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_args_skip (gdbarch, 0);
set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame);
set_gdbarch_deprecated_pop_frame (gdbarch, hppa_pop_frame);
- set_gdbarch_deprecated_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28);
/* set_gdbarch_deprecated_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments);
+ set_gdbarch_addr_bits_remove (gdbarch, hppa_smash_text_address);
set_gdbarch_smash_text_address (gdbarch, hppa_smash_text_address);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_read_pc (gdbarch, hppa_target_read_pc);
@@ -5052,6 +5206,17 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Helper for function argument information. */
set_gdbarch_fetch_pointer_argument (gdbarch, hppa_fetch_pointer_argument);
+ set_gdbarch_print_insn (gdbarch, print_insn_hppa);
+
+ /* When a hardware watchpoint triggers, we'll move the inferior past
+ it by removing all eventpoints; stepping past the instruction
+ that caused the trigger; reinserting eventpoints; and checking
+ whether any watched location changed. */
+ set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch);
+
return gdbarch;
}
@@ -5070,7 +5235,6 @@ _initialize_hppa_tdep (void)
void break_at_finish_at_depth_command (char *arg, int from_tty);
gdbarch_register (bfd_arch_hppa, hppa_gdbarch_init, hppa_dump_tdep);
- deprecated_tm_print_insn = print_insn_hppa;
add_cmd ("unwind", class_maintenance, unwind_command,
"Print unwind table entry at given address.",
diff --git a/gdb/config/mips/xm-irix3.h b/gdb/hppa-tdep.h
index 27da9a53880..05a4e8965ad 100644
--- a/gdb/config/mips/xm-irix3.h
+++ b/gdb/hppa-tdep.h
@@ -1,4 +1,5 @@
-/* Copyright 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Common target dependent code for GDB on HPPA systems.
+ Copyright 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -17,14 +18,15 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* This is for the iris. */
+#ifndef HPPA_TDEP_H
+#define HPPA_TDEP_H
-#define HAVE_TERMIO
+/* Target-dependent structure in gdbarch. */
+struct gdbarch_tdep
+{
+ /* The number of bytes in an address. For now, this field is designed
+ to allow us to differentiate hppa32 from hppa64 targets. */
+ int bytes_per_address;
+};
-/* Override register locations in upage for SGI machines */
-#undef REGISTER_U_ADDR
-#define REGISTER_U_ADDR(addr, blockend, regno) \
- if (regno < PC_REGNUM) \
- addr = regno; \
- else \
- addr = regno + NSIG_HNDLRS; /* Skip over signal handlers */
+#endif /* HPPA_TDEP_H */
diff --git a/gdb/hppab-nat.c b/gdb/hppab-nat.c
index dc3e6b6fb9c..cbb481e82a3 100644
--- a/gdb/hppab-nat.c
+++ b/gdb/hppab-nat.c
@@ -54,9 +54,9 @@
static void
fetch_register (int regno)
{
- register unsigned int regaddr;
+ unsigned int regaddr;
char buf[MAX_REGISTER_SIZE];
- register int i;
+ int i;
/* Offset of registers within the u area. */
unsigned int offset;
@@ -104,9 +104,9 @@ fetch_inferior_registers (int regno)
void
store_inferior_registers (int regno)
{
- register unsigned int regaddr;
+ unsigned int regaddr;
char buf[80];
- register int i;
+ int i;
unsigned int offset = U_REGS_OFFSET;
int scratch;
@@ -118,7 +118,7 @@ store_inferior_registers (int regno)
errno = 0;
if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM)
{
- scratch = *(int *) &deprecated_registers[REGISTER_BYTE (regno)] | 0x3;
+ scratch = *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)] | 0x3;
ptrace (PT_WUREGS, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) regaddr,
scratch);
if (errno != 0)
@@ -135,7 +135,7 @@ store_inferior_registers (int regno)
errno = 0;
ptrace (PT_WUREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) regaddr,
- *(int *) &deprecated_registers[REGISTER_BYTE (regno) + i]);
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno) + i]);
if (errno != 0)
{
/* Warning, not error, in case we are attached; sometimes the
diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c
index 380a901e982..53599499c25 100644
--- a/gdb/hppah-nat.c
+++ b/gdb/hppah-nat.c
@@ -64,9 +64,9 @@ fetch_inferior_registers (int regno)
void
store_inferior_registers (int regno)
{
- register unsigned int regaddr;
+ unsigned int regaddr;
char buf[80];
- register int i;
+ int i;
unsigned int offset = U_REGS_OFFSET;
int scratch;
@@ -98,7 +98,7 @@ store_inferior_registers (int regno)
/* Floating-point registers come from the ss_fpblock area. */
else if (regno >= FP0_REGNUM)
addr = (HPPAH_OFFSETOF (save_state_t, ss_fpblock)
- + (REGISTER_BYTE (regno) - REGISTER_BYTE (FP0_REGNUM)));
+ + (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (FP0_REGNUM)));
/* Wide registers come from the ss_wide area.
I think it's more PC to test (ss_flags & SS_WIDEREGS) to select
@@ -107,13 +107,13 @@ store_inferior_registers (int regno)
every register reference. Bleah. */
else if (len == 8)
addr = (HPPAH_OFFSETOF (save_state_t, ss_wide)
- + REGISTER_BYTE (regno));
+ + DEPRECATED_REGISTER_BYTE (regno));
/* Narrow registers come from the ss_narrow area. Note that
ss_narrow starts with gr1, not gr0. */
else if (len == 4)
addr = (HPPAH_OFFSETOF (save_state_t, ss_narrow)
- + (REGISTER_BYTE (regno) - REGISTER_BYTE (1)));
+ + (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (1)));
else
internal_error (__FILE__, __LINE__,
"hppah-nat.c (write_register): unexpected register size");
@@ -128,7 +128,7 @@ store_inferior_registers (int regno)
{
CORE_ADDR temp;
- temp = *(CORE_ADDR *)&deprecated_registers[REGISTER_BYTE (regno)];
+ temp = *(CORE_ADDR *)&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)];
/* Set the priv level (stored in the low two bits of the PC. */
temp |= 0x3;
@@ -153,7 +153,7 @@ store_inferior_registers (int regno)
the high part of IPSW. What will it take for HP to catch a
clue about building sensible interfaces? */
if (regno == IPSW_REGNUM && len == 8)
- *(int *)&deprecated_registers[REGISTER_BYTE (regno)] = 0;
+ *(int *)&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)] = 0;
#endif
for (i = 0; i < len; i += sizeof (int))
@@ -161,7 +161,7 @@ store_inferior_registers (int regno)
errno = 0;
call_ptrace (PT_WUREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) addr + i,
- *(int *) &deprecated_registers[REGISTER_BYTE (regno) + i]);
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno) + i]);
if (errno != 0)
{
/* Warning, not error, in case we are attached; sometimes
@@ -216,7 +216,7 @@ fetch_register (int regno)
/* Floating-point registers come from the ss_fpblock area. */
else if (regno >= FP0_REGNUM)
addr = (HPPAH_OFFSETOF (save_state_t, ss_fpblock)
- + (REGISTER_BYTE (regno) - REGISTER_BYTE (FP0_REGNUM)));
+ + (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (FP0_REGNUM)));
/* Wide registers come from the ss_wide area.
I think it's more PC to test (ss_flags & SS_WIDEREGS) to select
@@ -225,13 +225,13 @@ fetch_register (int regno)
every register reference. Bleah. */
else if (len == 8)
addr = (HPPAH_OFFSETOF (save_state_t, ss_wide)
- + REGISTER_BYTE (regno));
+ + DEPRECATED_REGISTER_BYTE (regno));
/* Narrow registers come from the ss_narrow area. Note that
ss_narrow starts with gr1, not gr0. */
else if (len == 4)
addr = (HPPAH_OFFSETOF (save_state_t, ss_narrow)
- + (REGISTER_BYTE (regno) - REGISTER_BYTE (1)));
+ + (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (1)));
else
internal_error (__FILE__, __LINE__,
@@ -282,11 +282,11 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct mem_attrib *mem,
struct target_ops *target)
{
- register int i;
+ int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & - (CORE_ADDR)(sizeof (int));
+ CORE_ADDR addr = memaddr & - (CORE_ADDR)(sizeof (int));
/* Round ending address up; get number of longwords that makes. */
- register int count
+ int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
/* Allocate buffer of that many longwords.
@@ -297,7 +297,7 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
this (in effect) would pile up all those alloca requests until a call
to alloca was made from a point higher than this routine in the
call chain. */
- register int *buffer = (int *) xmalloc (count * sizeof (int));
+ int *buffer = (int *) xmalloc (count * sizeof (int));
if (write)
{
diff --git a/gdb/hppam3-nat.c b/gdb/hppam3-nat.c
index 349df39dfb3..a89fae99c8a 100644
--- a/gdb/hppam3-nat.c
+++ b/gdb/hppam3-nat.c
@@ -1,5 +1,7 @@
-/* Low level interface to HP800 running mach 4.0.
- Copyright 1995, 2000, 2001 Free Software Foundation, Inc.
+/* Low level interface to HP800 running mach 4.0 for GDB, the GNU
+ debugger.
+
+ Copyright 1995, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -81,7 +83,7 @@ store_inferior_registers (int regno)
kern_return_t ret;
thread_state_data_t state;
unsigned int stateCnt = TRACE_FLAVOR_SIZE;
- register int index;
+ int index;
if (!MACH_PORT_VALID (current_thread))
error ("store inferior registers: Invalid thread");
@@ -113,15 +115,15 @@ store_inferior_registers (int regno)
*/
if (regno > 0 && regno < NUM_REGS)
{
- memcpy (&state[regno], &deprecated_registers[REGISTER_BYTE (regno)],
+ memcpy (&state[regno], &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
}
else
{
for (index = 0; index < NUM_REGS; index++)
- memcpy (&state[index], &deprecated_registers[REGISTER_BYTE (index)],
+ memcpy (&state[index], &deprecated_registers[DEPRECATED_REGISTER_BYTE (index)],
REGISTER_RAW_SIZE (index));
-/* state[index] = deprecated_registers[REGISTER_BYTE (index)]; */
+/* state[index] = deprecated_registers[DEPRECATED_REGISTER_BYTE (index)]; */
}
diff --git a/gdb/hpread.c b/gdb/hpread.c
index 3e2179aac3d..daa5d5e45e2 100644
--- a/gdb/hpread.c
+++ b/gdb/hpread.c
@@ -6203,9 +6203,9 @@ static int
hpread_get_scope_depth (union dnttentry *dn_bufp, struct objfile *objfile,
int report_nested)
{
- register int index;
- register union dnttentry *dn_tmp;
- register short depth = 0;
+ int index;
+ union dnttentry *dn_tmp;
+ short depth = 0;
/****************************/
return 0;
/****************************/
@@ -6248,7 +6248,7 @@ hpread_get_scope_depth (union dnttentry *dn_bufp, struct objfile *objfile,
static void
hpread_adjust_bitoffsets (struct type *type, int bits)
{
- register int i;
+ int i;
/* This is done only for unions; caller had better check that
it is an anonymous one. */
@@ -6285,7 +6285,7 @@ hpread_get_next_skip_over_anon_unions (int skip_fields, dnttpointer field,
struct objfile *objfile)
{
struct type *anon_type;
- register int i;
+ int i;
int bitoffset;
char *name;
diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c
index ed55c341596..d66874bb5c9 100644
--- a/gdb/hpux-thread.c
+++ b/gdb/hpux-thread.c
@@ -357,19 +357,19 @@ hpux_thread_store_registers (int regno)
else if (regno == SP_REGNUM)
{
write_memory ((CORE_ADDR) & tcb_ptr->static_ctx.sp,
- &deprecated_registers[REGISTER_BYTE (regno)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
tcb_ptr->static_ctx.sp = (cma__t_hppa_regs *)
- (extract_unsigned_integer (&deprecated_registers[REGISTER_BYTE (regno)],
+ (extract_unsigned_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno)) + 160);
}
else if (regno == PC_REGNUM)
write_memory (sp - 20,
- &deprecated_registers[REGISTER_BYTE (regno)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
else
write_memory (sp + regmap[regno],
- &deprecated_registers[REGISTER_BYTE (regno)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
}
}
diff --git a/gdb/i386-interix-nat.c b/gdb/i386-interix-nat.c
index 9c4daeda422..10e4d91c94c 100644
--- a/gdb/i386-interix-nat.c
+++ b/gdb/i386-interix-nat.c
@@ -80,7 +80,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
void
supply_fpregset (fpregset_t *fpregsetp)
{
- i387_supply_fsave ((char *) fpregsetp);
+ i387_supply_fsave ((const char *) fpregsetp, -1);
}
/* Given a pointer to a floating point register set in (fpregset_t *)
diff --git a/gdb/i386-interix-tdep.c b/gdb/i386-interix-tdep.c
index 2fced7202cd..69024045aec 100644
--- a/gdb/i386-interix-tdep.c
+++ b/gdb/i386-interix-tdep.c
@@ -128,8 +128,8 @@ i386_interix_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
it'll make the correct test. */
return ((get_frame_type (thisframe) == SIGTRAMP_FRAME)
|| (chain != 0
- && !inside_entry_file (read_memory_integer
- (thisframe->frame + 4, 4))));
+ && !deprecated_inside_entry_file (read_memory_integer
+ (thisframe->frame + 4, 4))));
}
/* We want to find the previous frame, which on Interix is tricky when
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 81be404a0f4..e7a85fa70c7 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -23,6 +23,7 @@
#include "inferior.h"
#include "gdbcore.h"
#include "regcache.h"
+#include "linux-nat.h"
#include "gdb_assert.h"
#include "gdb_string.h"
@@ -319,7 +320,7 @@ static void store_regs (int tid, int regno) {}
void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
- i387_supply_fsave ((char *) fpregsetp);
+ i387_supply_fsave ((const char *) fpregsetp, -1);
dummy_sse_values ();
}
@@ -384,7 +385,7 @@ static void store_fpregs (int tid, int regno) {}
void
supply_fpxregset (elf_fpxregset_t *fpxregsetp)
{
- i387_supply_fxsave ((char *) fpxregsetp);
+ i387_supply_fxsave ((const char *) fpxregsetp, -1);
}
/* Fill register REGNO (if it is a floating-point or SSE register) in
@@ -686,21 +687,6 @@ i386_linux_dr_set (int regnum, unsigned long value)
perror_with_name ("Couldn't write debug register");
}
-extern ps_err_e
-ps_get_thread_area(const struct ps_prochandle *ph,
- lwpid_t lwpid, int idx, void **base)
-{
- unsigned long int desc[3];
-#define PTRACE_GET_THREAD_AREA 25
-
- if (ptrace (PTRACE_GET_THREAD_AREA,
- lwpid, (void *) idx, (unsigned long) &desc) < 0)
- return PS_ERR;
-
- *(int *)base = desc[1];
- return PS_OK;
-}
-
void
i386_linux_dr_set_control (unsigned long control)
{
@@ -730,6 +716,46 @@ i386_linux_dr_get_status (void)
}
+/* Called by libthread_db. Returns a pointer to the thread local
+ storage (or its descriptor). */
+
+ps_err_e
+ps_get_thread_area (const struct ps_prochandle *ph,
+ lwpid_t lwpid, int idx, void **base)
+{
+ /* NOTE: cagney/2003-08-26: The definition of this buffer is found
+ in the kernel header <asm-i386/ldt.h>. It, after padding, is 4 x
+ 4 byte integers in size: `entry_number', `base_addr', `limit',
+ and a bunch of status bits.
+
+ The values returned by this ptrace call should be part of the
+ regcache buffer, and ps_get_thread_area should channel its
+ request through the regcache. That way remote targets could
+ provide the value using the remote protocol and not this direct
+ call.
+
+ Is this function needed? I'm guessing that the `base' is the
+ address of a a descriptor that libthread_db uses to find the
+ thread local address base that GDB needs. Perhaphs that
+ descriptor is defined by the ABI. Anyway, given that
+ libthread_db calls this function without prompting (gdb
+ requesting tls base) I guess it needs info in there anyway. */
+ unsigned int desc[4];
+ gdb_assert (sizeof (int) == 4);
+
+#ifndef PTRACE_GET_THREAD_AREA
+#define PTRACE_GET_THREAD_AREA 25
+#endif
+
+ if (ptrace (PTRACE_GET_THREAD_AREA, lwpid,
+ (void *) idx, (unsigned long) &desc) < 0)
+ return PS_ERR;
+
+ *(int *)base = desc[1];
+ return PS_OK;
+}
+
+
/* Interpreting register set info found in core files. */
/* Provide registers to GDB from a core file.
@@ -890,6 +916,13 @@ child_resume (ptid_t ptid, int step, enum target_signal signal)
if (ptrace (request, pid, 0, target_signal_to_host (signal)) == -1)
perror_with_name ("ptrace");
}
+
+void
+child_post_startup_inferior (ptid_t ptid)
+{
+ i386_cleanup_dregs ();
+ linux_child_post_startup_inferior (ptid);
+}
/* Register that we are able to handle GNU/Linux ELF core file
diff --git a/gdb/i386-linux-tdep.h b/gdb/i386-linux-tdep.h
index 95b168ac88e..089268ac091 100644
--- a/gdb/i386-linux-tdep.h
+++ b/gdb/i386-linux-tdep.h
@@ -1,6 +1,6 @@
/* Target-dependent code for GNU/Linux x86.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -33,4 +33,7 @@
system call number that the kernel is supposed to restart. */
#define I386_LINUX_ORIG_EAX_REGNUM I386_SSE_NUM_REGS
+/* Total number of registers for GNU/Linux. */
+#define I386_LINUX_NUM_REGS (I386_LINUX_ORIG_EAX_REGNUM + 1)
+
#endif /* i386-linux-tdep.h */
diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c
index 53a81a463eb..73794bc2fb5 100644
--- a/gdb/i386-nat.c
+++ b/gdb/i386-nat.c
@@ -230,6 +230,7 @@ i386_cleanup_dregs (void)
dr_status_mirror = 0;
}
+#ifndef LINUX_CHILD_POST_STARTUP_INFERIOR
/* Reset all debug registers at each new startup
to avoid missing watchpoints after restart. */
void
@@ -237,6 +238,7 @@ child_post_startup_inferior (ptid_t ptid)
{
i386_cleanup_dregs ();
}
+#endif /* LINUX_CHILD_POST_STARTUP_INFERIOR */
/* Print the values of the mirrored debug registers.
This is called when maint_show_dr is non-zero. To set that
diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c
index f9a2887e044..2a912a1a6d1 100644
--- a/gdb/i386-nto-tdep.c
+++ b/gdb/i386-nto-tdep.c
@@ -87,9 +87,9 @@ static void
i386nto_supply_fpregset (char *fpregs)
{
if (nto_cpuinfo_valid && nto_cpuinfo_flags | X86_CPU_FXSR)
- i387_supply_fxsave (fpregs);
+ i387_supply_fxsave (fpregs, -1);
else
- i387_supply_fsave (fpregs);
+ i387_supply_fsave (fpregs, -1);
}
static void
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 328dff29f3a..dd19e2499d0 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -41,6 +41,7 @@
#include "symtab.h"
#include "target.h"
#include "value.h"
+#include "dis-asm.h"
#include "gdb_assert.h"
#include "gdb_string.h"
@@ -439,6 +440,7 @@ i386_analyze_frame_setup (CORE_ADDR pc, CORE_ADDR current_pc,
struct i386_frame_cache *cache)
{
unsigned char op;
+ int skip = 0;
if (current_pc <= pc)
return current_pc;
@@ -456,25 +458,61 @@ i386_analyze_frame_setup (CORE_ADDR pc, CORE_ADDR current_pc,
if (current_pc <= pc + 1)
return current_pc;
- /* Check for `movl %esp, %ebp' -- can be written in two ways. */
op = read_memory_unsigned_integer (pc + 1, 1);
+
+ /* Check for some special instructions that might be migrated
+ by GCC into the prologue. We check for
+
+ xorl %ebx, %ebx
+ xorl %ecx, %ecx
+ xorl %edx, %edx
+
+ and the equivalent
+
+ subl %ebx, %ebx
+ subl %ecx, %ecx
+ subl %edx, %edx
+
+ Make sure we only skip these instructions if we later see the
+ `movl %esp, %ebp' that actually sets up the frame. */
+ while (op == 0x29 || op == 0x31)
+ {
+ op = read_memory_unsigned_integer (pc + skip + 2, 1);
+ switch (op)
+ {
+ case 0xdb: /* %ebx */
+ case 0xc9: /* %ecx */
+ case 0xd2: /* %edx */
+ skip += 2;
+ break;
+ default:
+ return pc + 1;
+ }
+
+ op = read_memory_unsigned_integer (pc + skip + 1, 1);
+ }
+
+ /* Check for `movl %esp, %ebp' -- can be written in two ways. */
switch (op)
{
case 0x8b:
- if (read_memory_unsigned_integer (pc + 2, 1) != 0xec)
+ if (read_memory_unsigned_integer (pc + skip + 2, 1) != 0xec)
return pc + 1;
break;
case 0x89:
- if (read_memory_unsigned_integer (pc + 2, 1) != 0xe5)
+ if (read_memory_unsigned_integer (pc + skip + 2, 1) != 0xe5)
return pc + 1;
break;
default:
return pc + 1;
}
- /* OK, we actually have a frame. We just don't know how large it is
- yet. Set its size to zero. We'll adjust it if necessary. */
+ /* OK, we actually have a frame. We just don't know how large
+ it is yet. Set its size to zero. We'll adjust it if
+ necessary. We also now commit to skipping the special
+ instructions mentioned before. */
cache->locals = 0;
+ pc += skip;
/* If that's all, return now. */
if (current_pc <= pc + 3)
@@ -534,23 +572,22 @@ static CORE_ADDR
i386_analyze_register_saves (CORE_ADDR pc, CORE_ADDR current_pc,
struct i386_frame_cache *cache)
{
- if (cache->locals >= 0)
- {
- CORE_ADDR offset;
- unsigned char op;
- int i;
+ CORE_ADDR offset = 0;
+ unsigned char op;
+ int i;
- offset = - 4 - cache->locals;
- for (i = 0; i < 8 && pc < current_pc; i++)
- {
- op = read_memory_unsigned_integer (pc, 1);
- if (op < 0x50 || op > 0x57)
- break;
+ if (cache->locals > 0)
+ offset -= cache->locals;
+ for (i = 0; i < 8 && pc < current_pc; i++)
+ {
+ op = read_memory_unsigned_integer (pc, 1);
+ if (op < 0x50 || op > 0x57)
+ break;
- cache->saved_regs[op - 0x50] = offset;
- offset -= 4;
- pc++;
- }
+ offset -= 4;
+ cache->saved_regs[op - 0x50] = offset;
+ cache->sp_offset += 4;
+ pc++;
}
return pc;
@@ -795,7 +832,8 @@ i386_frame_prev_register (struct frame_info *next_frame, void **this_cache,
ULONGEST val;
/* Clear the direction flag. */
- frame_unwind_unsigned_register (next_frame, PS_REGNUM, &val);
+ val = frame_unwind_register_unsigned (next_frame,
+ I386_EFLAGS_REGNUM);
val &= ~(1 << 10);
store_unsigned_integer (valuep, 4, val);
}
@@ -998,11 +1036,14 @@ i386_get_longjmp_target (CORE_ADDR *pc)
if (jb_pc_offset == -1)
return 0;
- sp = read_register (SP_REGNUM);
+ /* Don't use I386_ESP_REGNUM here, since this function is also used
+ for AMD64. */
+ regcache_cooked_read (current_regcache, SP_REGNUM, buf);
+ sp = extract_typed_address (buf, builtin_type_void_data_ptr);
if (target_read_memory (sp + len, buf, len))
return 0;
- jb_addr = extract_typed_address (buf, builtin_type_void_func_ptr);
+ jb_addr = extract_typed_address (buf, builtin_type_void_data_ptr);
if (target_read_memory (jb_addr + jb_pc_offset, buf, len))
return 0;
@@ -1111,8 +1152,8 @@ i386_extract_return_value (struct type *type, struct regcache *regcache,
}
else
{
- int low_size = REGISTER_RAW_SIZE (LOW_RETURN_REGNUM);
- int high_size = REGISTER_RAW_SIZE (HIGH_RETURN_REGNUM);
+ int low_size = register_size (current_gdbarch, LOW_RETURN_REGNUM);
+ int high_size = register_size (current_gdbarch, HIGH_RETURN_REGNUM);
if (len <= low_size)
{
@@ -1185,8 +1226,8 @@ i386_store_return_value (struct type *type, struct regcache *regcache,
}
else
{
- int low_size = REGISTER_RAW_SIZE (LOW_RETURN_REGNUM);
- int high_size = REGISTER_RAW_SIZE (HIGH_RETURN_REGNUM);
+ int low_size = register_size (current_gdbarch, LOW_RETURN_REGNUM);
+ int high_size = register_size (current_gdbarch, HIGH_RETURN_REGNUM);
if (len <= low_size)
regcache_raw_write_part (regcache, LOW_RETURN_REGNUM, 0, len, valbuf);
@@ -1300,7 +1341,7 @@ i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
/* Extract (always little endian). */
regcache_raw_read (regcache, fpnum, mmx_buf);
- memcpy (buf, mmx_buf, REGISTER_RAW_SIZE (regnum));
+ memcpy (buf, mmx_buf, register_size (gdbarch, regnum));
}
else
regcache_raw_read (regcache, regnum, buf);
@@ -1318,7 +1359,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
/* Read ... */
regcache_raw_read (regcache, fpnum, mmx_buf);
/* ... Modify ... (always little endian). */
- memcpy (mmx_buf, buf, REGISTER_RAW_SIZE (regnum));
+ memcpy (mmx_buf, buf, register_size (gdbarch, regnum));
/* ... Write. */
regcache_raw_write (regcache, fpnum, mmx_buf);
}
@@ -1422,7 +1463,7 @@ i386_register_to_value (struct frame_info *frame, int regnum,
gdb_assert (regnum != -1);
gdb_assert (register_size (current_gdbarch, regnum) == 4);
- frame_read_register (frame, regnum, buf);
+ get_frame_register (frame, regnum, buf);
regnum = i386_next_regnum (regnum);
len -= 4;
buf += 4;
@@ -1526,7 +1567,7 @@ i386_pc_in_sigtramp (CORE_ADDR pc, char *name)
deals with switching between those. */
static int
-i386_print_insn (bfd_vma pc, disassemble_info *info)
+i386_print_insn (bfd_vma pc, struct disassemble_info *info)
{
gdb_assert (disassembly_flavor == att_flavor
|| disassembly_flavor == intel_flavor);
@@ -1690,14 +1731,14 @@ i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
}
-/* Get the ith function argument for the current function. */
+/* Get the ARGIth function argument for the current function. */
+
static CORE_ADDR
i386_fetch_pointer_argument (struct frame_info *frame, int argi,
struct type *type)
{
- CORE_ADDR stack;
- frame_read_register (frame, SP_REGNUM, &stack);
- return read_memory_unsigned_integer (stack + (4 * (argi + 1)), 4);
+ CORE_ADDR sp = get_frame_register_unsigned (frame, I386_ESP_REGNUM);
+ return read_memory_unsigned_integer (sp + (4 * (argi + 1)), 4);
}
@@ -1716,10 +1757,23 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep = XMALLOC (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
- /* The i386 default settings don't include the SSE registers.
+ /* The i386 default settings now include the SSE registers.
+ I386_NUM_XREGS includes mxcsr, and we don't want to count
+ this as one of the xmm regs -- which is why we subtract one.
+
+ Note: kevinb/2003-07-14: Whatever Mark's concerns are about the
+ FPU registers in the FIXME below apply to the SSE registers as well.
+ The only problem that I see is that these registers will show up
+ in "info all-registers" even on CPUs where they don't exist. IMO,
+ however, if it's a choice between printing them always (even when
+ they don't exist) or never showing them to the user (even when they
+ do exist), I prefer the former over the latter. Ideally, of course,
+ we'd somehow autodetect that we have them (or not) and display them
+ when we have them and suppress them when we don't.
+
FIXME: kettenis/20020614: They do include the FPU registers for
now, which probably is not quite right. */
- tdep->num_xmm_regs = 0;
+ tdep->num_xmm_regs = I386_NUM_XREGS - 1;
tdep->jb_pc_offset = -1;
tdep->struct_return = pcc_struct_return;
@@ -1741,9 +1795,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
alignment. */
set_gdbarch_long_double_bit (gdbarch, 96);
- /* The default ABI includes general-purpose registers and
- floating-point registers. */
- set_gdbarch_num_regs (gdbarch, I386_NUM_GREGS + I386_NUM_FREGS);
+ /* The default ABI includes general-purpose registers,
+ floating-point registers, and the SSE registers. */
+ set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS);
set_gdbarch_register_name (gdbarch, i386_register_name);
set_gdbarch_register_type (gdbarch, i386_register_type);
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
index 38eac2004e8..7412b8ea867 100644
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -178,9 +178,20 @@ extern void i386_elf_init_abi (struct gdbarch_info, struct gdbarch *);
/* Initialize a SVR4 architecture variant. */
extern void i386_svr4_init_abi (struct gdbarch_info, struct gdbarch *);
+
-/* Functions exported from i386bsd-tdep.c. */
+/* Functions and variables exported from i386bsd-tdep.c. */
extern void i386bsd_init_abi (struct gdbarch_info, struct gdbarch *);
+extern CORE_ADDR i386fbsd_sigtramp_start;
+extern CORE_ADDR i386fbsd_sigtramp_end;
+extern CORE_ADDR i386obsd_sigtramp_start;
+extern CORE_ADDR i386obsd_sigtramp_end;
+extern int i386fbsd4_sc_reg_offset[];
+extern int i386fbsd_sc_reg_offset[];
+extern int i386nbsd_sc_reg_offset[];
+extern int i386obsd_sc_reg_offset[];
+extern int i386bsd_sc_reg_offset[];
#endif /* i386-tdep.h */
+
diff --git a/gdb/i386bsd-nat.c b/gdb/i386bsd-nat.c
index 60524de148e..d81dc66005c 100644
--- a/gdb/i386bsd-nat.c
+++ b/gdb/i386bsd-nat.c
@@ -1,5 +1,5 @@
/* Native-dependent code for modern i386 BSD's.
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -157,7 +157,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
void
supply_fpregset (fpregset_t *fpregsetp)
{
- i387_supply_fsave ((char *) fpregsetp);
+ i387_supply_fsave ((const char *) fpregsetp, -1);
}
/* Fill register REGNO (if it is a floating-point register) in
@@ -176,7 +176,6 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
void
fetch_inferior_registers (int regno)
{
-
if (regno == -1 || GETREGS_SUPPLIES (regno))
{
gregset_t gregs;
@@ -196,12 +195,12 @@ fetch_inferior_registers (int regno)
#ifdef HAVE_PT_GETXMMREGS
char xmmregs[512];
- if (have_ptrace_xmmregs != 0 &&
- ptrace(PT_GETXMMREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) xmmregs, 0) == 0)
+ if (have_ptrace_xmmregs != 0
+ && ptrace(PT_GETXMMREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) xmmregs, 0) == 0)
{
have_ptrace_xmmregs = 1;
- i387_supply_fxsave (xmmregs);
+ i387_supply_fxsave (xmmregs, -1);
}
else
{
@@ -209,14 +208,14 @@ fetch_inferior_registers (int regno)
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't get floating point status");
- supply_fpregset (&fpregs);
+ i387_supply_fsave ((const char *) &fpregs, -1);
}
#else
if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't get floating point status");
- supply_fpregset (&fpregs);
+ i387_supply_fsave ((const char *) &fpregs, -1);
#endif
}
}
@@ -227,7 +226,6 @@ fetch_inferior_registers (int regno)
void
store_inferior_registers (int regno)
{
-
if (regno == -1 || GETREGS_SUPPLIES (regno))
{
gregset_t gregs;
@@ -252,9 +250,9 @@ store_inferior_registers (int regno)
#ifdef HAVE_PT_GETXMMREGS
char xmmregs[512];
- if (have_ptrace_xmmregs != 0 &&
- ptrace(PT_GETXMMREGS, PIDGET (inferior_ptid),
- (PTRACE_ARG3_TYPE) xmmregs, 0) == 0)
+ if (have_ptrace_xmmregs != 0
+ && ptrace(PT_GETXMMREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) xmmregs, 0) == 0)
{
have_ptrace_xmmregs = 1;
@@ -272,7 +270,7 @@ store_inferior_registers (int regno)
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
perror_with_name ("Couldn't get floating point status");
- fill_fpregset (&fpregs, regno);
+ i387_fill_fsave ((char *) &fpregs, regno);
if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
@@ -395,20 +393,15 @@ _initialize_i386bsd_nat (void)
information. */
#if defined (__FreeBSD_version) && __FreeBSD_version >= 400011
- extern int i386fbsd4_sc_reg_offset[];
#define SC_REG_OFFSET i386fbsd4_sc_reg_offset
#elif defined (__FreeBSD_version) && __FreeBSD_version >= 300005
- extern int i386fbsd_sc_reg_offset[];
#define SC_REG_OFFSET i386fbsd_sc_reg_offset
#elif defined (NetBSD) || defined (__NetBSD_Version__)
- extern int i386nbsd_sc_reg_offset[];
#define SC_REG_OFFSET i386nbsd_sc_reg_offset
#elif defined (OpenBSD)
- extern int i386obsd_sc_reg_offset[];
#define SC_REG_OFFSET i386obsd_sc_reg_offset
#else
- extern int i386bsd_sc_reg_offset[];
-#define SC_PC_OFFSET i386bsd_sc_reg_offset
+#define SC_REG_OFFSET i386bsd_sc_reg_offset
#endif
/* We only check the program counter, stack pointer and frame
diff --git a/gdb/i386fbsd-nat.c b/gdb/i386fbsd-nat.c
index a80d0a0af89..7feb7b053e6 100644
--- a/gdb/i386fbsd-nat.c
+++ b/gdb/i386fbsd-nat.c
@@ -1,5 +1,5 @@
/* Native-dependent code for FreeBSD/i386.
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -26,6 +26,8 @@
#include <sys/ptrace.h>
#include <sys/sysctl.h>
+#include "i386-tdep.h"
+
/* Prevent warning from -Wmissing-prototypes. */
void _initialize_i386fbsd_nat (void);
@@ -47,7 +49,7 @@ child_resume (ptid_t ptid, int step, enum target_signal signal)
if (!step)
{
- unsigned int eflags;
+ ULONGEST eflags;
/* Workaround for a bug in FreeBSD. Make sure that the trace
flag is off when doing a continue. There is a code path
@@ -59,9 +61,11 @@ child_resume (ptid_t ptid, int step, enum target_signal signal)
never goes through the kernel's trap() function which would
normally clear it. */
- eflags = read_register (PS_REGNUM);
+ regcache_cooked_read_unsigned (current_regcache, I386_EFLAGS_REGNUM,
+ &eflags);
if (eflags & 0x0100)
- write_register (PS_REGNUM, eflags & ~0x0100);
+ regcache_cooked_write_unsigned (current_regcache, I386_EFLAGS_REGNUM,
+ eflags & ~0x0100);
request = PT_CONTINUE;
}
@@ -89,9 +93,6 @@ _initialize_i386fbsd_nat (void)
int ps_strings;
size_t len;
- extern CORE_ADDR i386fbsd_sigtramp_start;
- extern CORE_ADDR i386fbsd_sigtramp_end;
-
mib[0] = CTL_KERN;
mib[1] = KERN_PS_STRINGS;
len = sizeof (ps_strings);
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index 4623e116cfc..3a6c7978162 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -89,7 +89,7 @@ fetch_fpregs (struct proc *thread)
}
/* Supply the floating-point registers. */
- i387_supply_fsave (state.hw_state);
+ i387_supply_fsave (state.hw_state, -1);
}
#ifdef HAVE_SYS_PROCFS_H
@@ -106,7 +106,7 @@ supply_gregset (gdb_gregset_t *gregs)
void
supply_fpregset (gdb_fpregset_t *fpregs)
{
- i387_supply_fsave ((char *) fpregs);
+ i387_supply_fsave ((const char *) fpregs, -1);
}
#endif
@@ -256,7 +256,7 @@ gnu_store_registers (int regno)
}
#define fill(state, regno) \
- memcpy (REG_ADDR(state, regno), &deprecated_registers[REGISTER_BYTE (regno)], \
+ memcpy (REG_ADDR(state, regno), &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)], \
REGISTER_RAW_SIZE (regno))
if (regno == -1)
diff --git a/gdb/i386nbsd-tdep.c b/gdb/i386nbsd-tdep.c
index 601530bce25..9e8d973d831 100644
--- a/gdb/i386nbsd-tdep.c
+++ b/gdb/i386nbsd-tdep.c
@@ -1,4 +1,5 @@
-/* Target-dependent code for NetBSD/i386, for GDB.
+/* Target-dependent code for NetBSD/i386.
+
Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
@@ -88,7 +89,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
i386nbsd_supply_reg (regs, -1);
/* Floating point registers. */
- i387_supply_fsave (fsave);
+ i387_supply_fsave (fsave, -1);
}
static void
@@ -106,9 +107,9 @@ fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size,
case 2: /* Floating point registers. */
if (core_reg_size != 108)
- warning ("Wrong size FP register set in core file.");
+ warning ("Wrong size FP register set in core file.");
else
- i387_supply_fsave (core_reg_sect);
+ i387_supply_fsave (core_reg_sect, -1);
break;
case 3: /* "Extended" floating point registers. This is gdb-speak
@@ -116,7 +117,7 @@ fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size,
if (core_reg_size != 512)
warning ("Wrong size XMM register set in core file.");
else
- i387_supply_fxsave (core_reg_sect);
+ i387_supply_fxsave (core_reg_sect, -1);
break;
default:
diff --git a/gdb/i386obsd-nat.c b/gdb/i386obsd-nat.c
index b2cdc2a7e58..b0d4e033b8d 100644
--- a/gdb/i386obsd-nat.c
+++ b/gdb/i386obsd-nat.c
@@ -1,5 +1,5 @@
/* Native-dependent code for OpenBSD/i386.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -23,6 +23,8 @@
#include <sys/param.h>
#include <sys/sysctl.h>
+#include "i386-tdep.h"
+
/* Prevent warning from -Wmissing-prototypes. */
void _initialize_i386obsd_nat (void);
@@ -44,9 +46,6 @@ _initialize_i386obsd_nat (void)
int mib[2];
size_t len;
- extern CORE_ADDR i386obsd_sigtramp_start;
- extern CORE_ADDR i386obsd_sigtramp_end;
-
mib[0] = CTL_VM;
mib[1] = VM_PSSTRINGS;
len = sizeof (_ps);
diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c
index 7db076d3a3e..8cfaa244407 100644
--- a/gdb/i386obsd-tdep.c
+++ b/gdb/i386obsd-tdep.c
@@ -66,7 +66,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
i386obsd_supply_reg (regs, -1);
/* Floating point registers. */
- i387_supply_fsave (fsave);
+ i387_supply_fsave (fsave, -1);
}
static struct core_fns i386obsd_core_fns =
diff --git a/gdb/i386v4-nat.c b/gdb/i386v4-nat.c
index 7de8c148034..c680dac6b52 100644
--- a/gdb/i386v4-nat.c
+++ b/gdb/i386v4-nat.c
@@ -139,7 +139,7 @@ supply_fpregset (fpregset_t *fpregsetp)
if (FP0_REGNUM == 0)
return;
- i387_supply_fsave ((char *) fpregsetp);
+ i387_supply_fsave ((const char *) fpregsetp, -1);
}
/* Fill register REGNO (if it is a floating-point register) in
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index f7800af6415..6feb39285f5 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -217,22 +217,14 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
int fpreg;
int top;
- frame_register_read (frame, FCTRL_REGNUM, buf);
- fctrl = extract_unsigned_integer (buf, 4);
- frame_register_read (frame, FSTAT_REGNUM, buf);
- fstat = extract_unsigned_integer (buf, 4);
- frame_register_read (frame, FTAG_REGNUM, buf);
- ftag = extract_unsigned_integer (buf, 4);
- frame_register_read (frame, FISEG_REGNUM, buf);
- fiseg = extract_unsigned_integer (buf, 4);
- frame_register_read (frame, FIOFF_REGNUM, buf);
- fioff = extract_unsigned_integer (buf, 4);
- frame_register_read (frame, FOSEG_REGNUM, buf);
- foseg = extract_unsigned_integer (buf, 4);
- frame_register_read (frame, FOOFF_REGNUM, buf);
- fooff = extract_unsigned_integer (buf, 4);
- frame_register_read (frame, FOP_REGNUM, buf);
- fop = extract_unsigned_integer (buf, 4);
+ fctrl = get_frame_register_unsigned (frame, FCTRL_REGNUM);
+ fstat = get_frame_register_unsigned (frame, FSTAT_REGNUM);
+ ftag = get_frame_register_unsigned (frame, FTAG_REGNUM);
+ fiseg = get_frame_register_unsigned (frame, FISEG_REGNUM);
+ fioff = get_frame_register_unsigned (frame, FIOFF_REGNUM);
+ foseg = get_frame_register_unsigned (frame, FOSEG_REGNUM);
+ fooff = get_frame_register_unsigned (frame, FOOFF_REGNUM);
+ fop = get_frame_register_unsigned (frame, FOP_REGNUM);
top = ((fstat >> 11) & 7);
@@ -260,7 +252,7 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
break;
}
- frame_register_read (frame, (fpreg + 8 - top) % 8 + FP0_REGNUM, raw);
+ get_frame_register (frame, (fpreg + 8 - top) % 8 + FP0_REGNUM, raw);
fputs_filtered ("0x", file);
for (i = 9; i >= 0; i--)
@@ -310,7 +302,7 @@ i387_register_to_value (struct frame_info *frame, int regnum,
/* Convert to TYPE. This should be a no-op if TYPE is equivalent to
the extended floating-point format used by the FPU. */
- frame_read_register (frame, regnum, from);
+ get_frame_register (frame, regnum, from);
convert_typed_floating (from, builtin_type_i387_ext, to, type);
}
@@ -369,51 +361,44 @@ static int fsave_offset[] =
#define FSAVE_ADDR(fsave, regnum) (fsave + fsave_offset[regnum - FP0_REGNUM])
-/* Fill register REGNUM in GDB's register array with the appropriate
+/* Fill register REGNUM in GDB's register cache with the appropriate
value from *FSAVE. This function masks off any of the reserved
bits in *FSAVE. */
void
-i387_supply_register (int regnum, char *fsave)
-{
- if (fsave == NULL)
- {
- supply_register (regnum, NULL);
- return;
- }
-
- /* Most of the FPU control registers occupy only 16 bits in
- the fsave area. Give those a special treatment. */
- if (regnum >= FPC_REGNUM
- && regnum != FIOFF_REGNUM && regnum != FOOFF_REGNUM)
- {
- unsigned char val[4];
-
- memcpy (val, FSAVE_ADDR (fsave, regnum), 2);
- val[2] = val[3] = 0;
- if (regnum == FOP_REGNUM)
- val[1] &= ((1 << 3) - 1);
- supply_register (regnum, val);
- }
- else
- supply_register (regnum, FSAVE_ADDR (fsave, regnum));
-}
-
-/* Fill GDB's register array with the floating-point register values
- in *FSAVE. This function masks off any of the reserved
- bits in *FSAVE. */
-
-void
-i387_supply_fsave (char *fsave)
+i387_supply_fsave (const char *fsave, int regnum)
{
int i;
for (i = FP0_REGNUM; i < XMM0_REGNUM; i++)
- i387_supply_register (i, fsave);
+ if (regnum == -1 || regnum == i)
+ {
+ if (fsave == NULL)
+ {
+ supply_register (i, NULL);
+ return;
+ }
+
+ /* Most of the FPU control registers occupy only 16 bits in the
+ fsave area. Give those a special treatment. */
+ if (i >= FPC_REGNUM
+ && i != FIOFF_REGNUM && i != FOOFF_REGNUM)
+ {
+ unsigned char val[4];
+
+ memcpy (val, FSAVE_ADDR (fsave, i), 2);
+ val[2] = val[3] = 0;
+ if (i == FOP_REGNUM)
+ val[1] &= ((1 << 3) - 1);
+ supply_register (i, val);
+ }
+ else
+ supply_register (i, FSAVE_ADDR (fsave, i));
+ }
}
/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
- with the value in GDB's register array. If REGNUM is -1, do this
+ with the value in GDB's register cache. If REGNUM is -1, do this
for all registers. This function doesn't touch any of the reserved
bits in *FSAVE. */
@@ -500,15 +485,15 @@ static int fxsave_offset[] =
((regnum == MXCSR_REGNUM) ? (fxsave + 24) : \
(fxsave + fxsave_offset[regnum - FP0_REGNUM]))
-static int i387_tag (unsigned char *raw);
+static int i387_tag (const unsigned char *raw);
-/* Fill GDB's register array with the floating-point and SSE register
- values in *FXSAVE. This function masks off any of the reserved
- bits in *FXSAVE. */
+/* Fill register REGNUM in GDB's register cache with the appropriate
+ floating-point or SSE register value from *FXSAVE. This function
+ masks off any of the reserved bits in *FXSAVE. */
void
-i387_supply_fxsave (char *fxsave)
+i387_supply_fxsave (const char *fxsave, int regnum)
{
int i, last_regnum = MXCSR_REGNUM;
@@ -516,62 +501,63 @@ i387_supply_fxsave (char *fxsave)
last_regnum = FOP_REGNUM;
for (i = FP0_REGNUM; i <= last_regnum; i++)
- {
- if (fxsave == NULL)
- {
- supply_register (i, NULL);
- continue;
- }
+ if (regnum == -1 || regnum == i)
+ {
+ if (fxsave == NULL)
+ {
+ supply_register (i, NULL);
+ continue;
+ }
- /* Most of the FPU control registers occupy only 16 bits in
- the fxsave area. Give those a special treatment. */
- if (i >= FPC_REGNUM && i < XMM0_REGNUM
- && i != FIOFF_REGNUM && i != FOOFF_REGNUM)
- {
- unsigned char val[4];
-
- memcpy (val, FXSAVE_ADDR (fxsave, i), 2);
- val[2] = val[3] = 0;
- if (i == FOP_REGNUM)
- val[1] &= ((1 << 3) - 1);
- else if (i== FTAG_REGNUM)
- {
- /* The fxsave area contains a simplified version of the
- tag word. We have to look at the actual 80-bit FP
- data to recreate the traditional i387 tag word. */
-
- unsigned long ftag = 0;
- int fpreg;
- int top;
-
- top = (((FXSAVE_ADDR (fxsave, FSTAT_REGNUM))[1] >> 3) & 0x7);
-
- for (fpreg = 7; fpreg >= 0; fpreg--)
- {
- int tag;
-
- if (val[0] & (1 << fpreg))
- {
- int regnum = (fpreg + 8 - top) % 8 + FP0_REGNUM;
- tag = i387_tag (FXSAVE_ADDR (fxsave, regnum));
- }
- else
- tag = 3; /* Empty */
-
- ftag |= tag << (2 * fpreg);
- }
- val[0] = ftag & 0xff;
- val[1] = (ftag >> 8) & 0xff;
- }
- supply_register (i, val);
- }
- else
- supply_register (i, FXSAVE_ADDR (fxsave, i));
- }
+ /* Most of the FPU control registers occupy only 16 bits in
+ the fxsave area. Give those a special treatment. */
+ if (i >= FPC_REGNUM && i < XMM0_REGNUM
+ && i != FIOFF_REGNUM && i != FOOFF_REGNUM)
+ {
+ unsigned char val[4];
+
+ memcpy (val, FXSAVE_ADDR (fxsave, i), 2);
+ val[2] = val[3] = 0;
+ if (i == FOP_REGNUM)
+ val[1] &= ((1 << 3) - 1);
+ else if (i== FTAG_REGNUM)
+ {
+ /* The fxsave area contains a simplified version of
+ the tag word. We have to look at the actual 80-bit
+ FP data to recreate the traditional i387 tag word. */
+
+ unsigned long ftag = 0;
+ int fpreg;
+ int top;
+
+ top = (((FXSAVE_ADDR (fxsave, FSTAT_REGNUM))[1] >> 3) & 0x7);
+
+ for (fpreg = 7; fpreg >= 0; fpreg--)
+ {
+ int tag;
+
+ if (val[0] & (1 << fpreg))
+ {
+ int regnum = (fpreg + 8 - top) % 8 + FP0_REGNUM;
+ tag = i387_tag (FXSAVE_ADDR (fxsave, regnum));
+ }
+ else
+ tag = 3; /* Empty */
+
+ ftag |= tag << (2 * fpreg);
+ }
+ val[0] = ftag & 0xff;
+ val[1] = (ftag >> 8) & 0xff;
+ }
+ supply_register (i, val);
+ }
+ else
+ supply_register (i, FXSAVE_ADDR (fxsave, i));
+ }
}
/* Fill register REGNUM (if it is a floating-point or SSE register) in
- *FXSAVE with the value in GDB's register array. If REGNUM is -1, do
+ *FXSAVE with the value in GDB's register cache. If REGNUM is -1, do
this for all registers. This function doesn't touch any of the
reserved bits in *FXSAVE. */
@@ -632,7 +618,7 @@ i387_fill_fxsave (char *fxsave, int regnum)
*RAW. */
static int
-i387_tag (unsigned char *raw)
+i387_tag (const unsigned char *raw)
{
int integer;
unsigned int exponent;
diff --git a/gdb/i387-tdep.h b/gdb/i387-tdep.h
index df5c77bdaec..654b4a5a2a7 100644
--- a/gdb/i387-tdep.h
+++ b/gdb/i387-tdep.h
@@ -1,5 +1,6 @@
/* Target-dependent code for the i387.
- Copyright 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -44,34 +45,34 @@ extern void i387_register_to_value (struct frame_info *frame, int regnum,
extern void i387_value_to_register (struct frame_info *frame, int regnum,
struct type *type, const void *from);
+
-/* Fill register REGNUM in GDB's register array with the appropriate
- value from *FSAVE. This function masks off any of the reserved
- bits in *FSAVE. */
+/* Size of the memory area use by the 'fsave' and 'fxsave'
+ instructions. */
+#define I387_SIZEOF_FSAVE 108
+#define I387_SIZEOF_FXSAVE 512
-extern void i387_supply_register (int regnum, char *fsave);
-
-/* Fill GDB's register array with the floating-point register values
- in *FSAVE. This function masks off any of the reserved
+/* Fill register REGNUM in GDB's register cache with the appropriate
+ value from *FSAVE. This function masks off any of the reserved
bits in *FSAVE. */
-extern void i387_supply_fsave (char *fsave);
+extern void i387_supply_fsave (const char *fsave, int regnum);
/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
- with the value in GDB's register array. If REGNUM is -1, do this
+ with the value in GDB's register cache. If REGNUM is -1, do this
for all registers. This function doesn't touch any of the reserved
bits in *FSAVE. */
extern void i387_fill_fsave (char *fsave, int regnum);
-/* Fill GDB's register array with the floating-point and SSE register
- values in *FXSAVE. This function masks off any of the reserved
- bits in *FXSAVE. */
+/* Fill register REGNUM in GDB's register cache with the appropriate
+ floating-point or SSE register value from *FXSAVE. This function
+ masks off any of the reserved bits in *FXSAVE. */
-extern void i387_supply_fxsave (char *fxsave);
+extern void i387_supply_fxsave (const char *fxsave, int regnum);
/* Fill register REGNUM (if it is a floating-point or SSE register) in
- *FXSAVE with the value in GDB's register array. If REGNUM is -1, do
+ *FXSAVE with the value in GDB's register cache. If REGNUM is -1, do
this for all registers. This function doesn't touch any of the
reserved bits in *FXSAVE. */
diff --git a/gdb/ia64-aix-nat.c b/gdb/ia64-aix-nat.c
index c94144c402f..ee3dc16811b 100644
--- a/gdb/ia64-aix-nat.c
+++ b/gdb/ia64-aix-nat.c
@@ -1,5 +1,6 @@
-/* Functions specific to running gdb native on IA-64 running AIX.
- Copyright 2000, 2001 Free Software Foundation, Inc.
+/* Low level interface to IA-64 running AIX for GDB, the GNU debugger.
+
+ Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -85,7 +86,7 @@ fill_gregset (prgregset_t *gregsetp, int regno)
#define COPY_REG(_fld_,_regi_) \
if ((regno == -1) || regno == _regi_) \
- memcpy (&(gregsetp->_fld_), &deprecated_registers[REGISTER_BYTE (_regi_)], \
+ memcpy (&(gregsetp->_fld_), &deprecated_registers[DEPRECATED_REGISTER_BYTE (_regi_)], \
REGISTER_RAW_SIZE (_regi_))
for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
@@ -108,10 +109,10 @@ fill_gregset (prgregset_t *gregsetp, int regno)
if (regno == IA64_BSP_REGNUM || regno == -1)
{
memcpy (&(gregsetp->__bspstore),
- &deprecated_registers[REGISTER_BYTE (IA64_BSP_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (IA64_BSP_REGNUM)],
REGISTER_RAW_SIZE (IA64_BSP_REGNUM));
- memcpy (&deprecated_registers[REGISTER_BYTE (IA64_BSPSTORE_REGNUM)],
- &deprecated_registers[REGISTER_BYTE (IA64_BSP_REGNUM)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (IA64_BSPSTORE_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (IA64_BSP_REGNUM)],
REGISTER_RAW_SIZE (IA64_BSP_REGNUM));
}
@@ -135,7 +136,7 @@ fill_gregset (prgregset_t *gregsetp, int regno)
void
supply_fpregset (prfpregset_t *fpregsetp)
{
- register int regi;
+ int regi;
for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
supply_register (regi,
@@ -153,7 +154,7 @@ fill_fpregset (prfpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->__fpr[regi - IA64_FR0_REGNUM]);
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index dacb6720bd4..ebaad7cacbb 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -402,7 +402,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
#define COPY_REG(_idx_,_regi_) \
if ((regno == -1) || regno == _regi_) \
- memcpy (regp + _idx_, &deprecated_registers[REGISTER_BYTE (_regi_)], \
+ memcpy (regp + _idx_, &deprecated_registers[DEPRECATED_REGISTER_BYTE (_regi_)], \
REGISTER_RAW_SIZE (_regi_))
for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
@@ -441,7 +441,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
void
supply_fpregset (fpregset_t *fpregsetp)
{
- register int regi;
+ int regi;
char *from;
for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
@@ -467,7 +467,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
to = (char *) &((*fpregsetp)[regi - IA64_FR0_REGNUM]);
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index b6992d90f53..79c645d2ced 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -26,12 +26,17 @@
#include "arch-utils.h"
#include "floatformat.h"
#include "regcache.h"
+#include "reggroups.h"
+#include "frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
#include "doublest.h"
#include "value.h"
#include "gdb_assert.h"
#include "objfiles.h"
#include "elf/common.h" /* for DT_PLTGOT value */
#include "elf-bfd.h"
+#include "dis-asm.h"
/* Hook for determining the global pointer when calling functions in
the inferior under AIX. The initialization code in ia64-aix-nat.c
@@ -86,24 +91,27 @@ extern CORE_ADDR ia64_aix_sigcontext_register_address (CORE_ADDR, int);
static gdbarch_init_ftype ia64_gdbarch_init;
static gdbarch_register_name_ftype ia64_register_name;
+static gdbarch_register_type_ftype ia64_register_type;
static gdbarch_breakpoint_from_pc_ftype ia64_breakpoint_from_pc;
static gdbarch_skip_prologue_ftype ia64_skip_prologue;
-static gdbarch_deprecated_extract_return_value_ftype ia64_extract_return_value;
-static gdbarch_deprecated_extract_struct_value_address_ftype ia64_extract_struct_value_address;
+static gdbarch_extract_return_value_ftype ia64_extract_return_value;
+static gdbarch_extract_struct_value_address_ftype ia64_extract_struct_value_address;
static gdbarch_use_struct_convention_ftype ia64_use_struct_convention;
-static gdbarch_frameless_function_invocation_ftype ia64_frameless_function_invocation;
-static gdbarch_deprecated_saved_pc_after_call_ftype ia64_saved_pc_after_call;
-static void ia64_pop_frame_regular (struct frame_info *frame);
static struct type *is_float_or_hfa_type (struct type *t);
-static int ia64_num_regs = 590;
+static struct type *builtin_type_ia64_ext;
+
+#define NUM_IA64_RAW_REGS 462
-static int pc_regnum = IA64_IP_REGNUM;
static int sp_regnum = IA64_GR12_REGNUM;
static int fp_regnum = IA64_VFP_REGNUM;
static int lr_regnum = IA64_VRAP_REGNUM;
-static LONGEST ia64_call_dummy_words[] = {0};
+/* NOTE: we treat the register stack registers r32-r127 as pseudo-registers because
+ they are in memory and must be calculated via the bsp register. */
+enum pseudo_regs { FIRST_PSEUDO_REGNUM = NUM_IA64_RAW_REGS, VBOF_REGNUM = IA64_NAT127_REGNUM + 1, V32_REGNUM,
+ V127_REGNUM = V32_REGNUM + 95,
+ VP0_REGNUM, VP16_REGNUM = VP0_REGNUM + 16, VP63_REGNUM = VP0_REGNUM + 63, LAST_PSEUDO_REGNUM };
/* Array of register names; There should be ia64_num_regs strings in
the initializer. */
@@ -113,18 +121,18 @@ static char *ia64_register_names[] =
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
- "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39",
- "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47",
- "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55",
- "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63",
- "r64", "r65", "r66", "r67", "r68", "r69", "r70", "r71",
- "r72", "r73", "r74", "r75", "r76", "r77", "r78", "r79",
- "r80", "r81", "r82", "r83", "r84", "r85", "r86", "r87",
- "r88", "r89", "r90", "r91", "r92", "r93", "r94", "r95",
- "r96", "r97", "r98", "r99", "r100", "r101", "r102", "r103",
- "r104", "r105", "r106", "r107", "r108", "r109", "r110", "r111",
- "r112", "r113", "r114", "r115", "r116", "r117", "r118", "r119",
- "r120", "r121", "r122", "r123", "r124", "r125", "r126", "r127",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
@@ -143,14 +151,14 @@ static char *ia64_register_names[] =
"f112", "f113", "f114", "f115", "f116", "f117", "f118", "f119",
"f120", "f121", "f122", "f123", "f124", "f125", "f126", "f127",
- "p0", "p1", "p2", "p3", "p4", "p5", "p6", "p7",
- "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15",
- "p16", "p17", "p18", "p19", "p20", "p21", "p22", "p23",
- "p24", "p25", "p26", "p27", "p28", "p29", "p30", "p31",
- "p32", "p33", "p34", "p35", "p36", "p37", "p38", "p39",
- "p40", "p41", "p42", "p43", "p44", "p45", "p46", "p47",
- "p48", "p49", "p50", "p51", "p52", "p53", "p54", "p55",
- "p56", "p57", "p58", "p59", "p60", "p61", "p62", "p63",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
+ "", "", "", "", "", "", "", "",
"b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7",
@@ -191,26 +199,59 @@ static char *ia64_register_names[] =
"nat104","nat105","nat106","nat107","nat108","nat109","nat110","nat111",
"nat112","nat113","nat114","nat115","nat116","nat117","nat118","nat119",
"nat120","nat121","nat122","nat123","nat124","nat125","nat126","nat127",
+
+ "bof",
+
+ "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39",
+ "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47",
+ "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55",
+ "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63",
+ "r64", "r65", "r66", "r67", "r68", "r69", "r70", "r71",
+ "r72", "r73", "r74", "r75", "r76", "r77", "r78", "r79",
+ "r80", "r81", "r82", "r83", "r84", "r85", "r86", "r87",
+ "r88", "r89", "r90", "r91", "r92", "r93", "r94", "r95",
+ "r96", "r97", "r98", "r99", "r100", "r101", "r102", "r103",
+ "r104", "r105", "r106", "r107", "r108", "r109", "r110", "r111",
+ "r112", "r113", "r114", "r115", "r116", "r117", "r118", "r119",
+ "r120", "r121", "r122", "r123", "r124", "r125", "r126", "r127",
+
+ "p0", "p1", "p2", "p3", "p4", "p5", "p6", "p7",
+ "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15",
+ "p16", "p17", "p18", "p19", "p20", "p21", "p22", "p23",
+ "p24", "p25", "p26", "p27", "p28", "p29", "p30", "p31",
+ "p32", "p33", "p34", "p35", "p36", "p37", "p38", "p39",
+ "p40", "p41", "p42", "p43", "p44", "p45", "p46", "p47",
+ "p48", "p49", "p50", "p51", "p52", "p53", "p54", "p55",
+ "p56", "p57", "p58", "p59", "p60", "p61", "p62", "p63",
};
-struct frame_extra_info
- {
- CORE_ADDR bsp; /* points at r32 for the current frame */
- CORE_ADDR cfm; /* cfm value for current frame */
- int sof; /* Size of frame (decoded from cfm value) */
- int sol; /* Size of locals (decoded from cfm value) */
- CORE_ADDR after_prologue;
- /* Address of first instruction after the last
- prologue instruction; Note that there may
- be instructions from the function's body
- intermingled with the prologue. */
- int mem_stack_frame_size;
- /* Size of the memory stack frame (may be zero),
- or -1 if it has not been determined yet. */
- int fp_reg; /* Register number (if any) used a frame pointer
+struct ia64_frame_cache
+{
+ CORE_ADDR base; /* frame pointer base for frame */
+ CORE_ADDR pc; /* function start pc for frame */
+ CORE_ADDR saved_sp; /* stack pointer for frame */
+ CORE_ADDR bsp; /* points at r32 for the current frame */
+ CORE_ADDR cfm; /* cfm value for current frame */
+ int frameless;
+ int sof; /* Size of frame (decoded from cfm value) */
+ int sol; /* Size of locals (decoded from cfm value) */
+ int sor; /* Number of rotating registers. (decoded from cfm value) */
+ CORE_ADDR after_prologue;
+ /* Address of first instruction after the last
+ prologue instruction; Note that there may
+ be instructions from the function's body
+ intermingled with the prologue. */
+ int mem_stack_frame_size;
+ /* Size of the memory stack frame (may be zero),
+ or -1 if it has not been determined yet. */
+ int fp_reg; /* Register number (if any) used a frame pointer
for this frame. 0 if no register is being used
as the frame pointer. */
- };
+
+ /* Saved registers. */
+ CORE_ADDR saved_regs[NUM_IA64_RAW_REGS];
+
+};
struct gdbarch_tdep
{
@@ -229,30 +270,50 @@ struct gdbarch_tdep
#define FIND_GLOBAL_POINTER \
(gdbarch_tdep (current_gdbarch)->find_global_pointer)
-static const char *
-ia64_register_name (int reg)
+int
+ia64_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
+ struct reggroup *group)
{
- return ia64_register_names[reg];
+ int vector_p;
+ int float_p;
+ int raw_p;
+ if (group == all_reggroup)
+ return 1;
+ vector_p = TYPE_VECTOR (register_type (gdbarch, regnum));
+ float_p = TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT;
+ raw_p = regnum < NUM_IA64_RAW_REGS;
+ if (group == float_reggroup)
+ return float_p;
+ if (group == vector_reggroup)
+ return vector_p;
+ if (group == general_reggroup)
+ return (!vector_p && !float_p);
+ if (group == save_reggroup || group == restore_reggroup)
+ return raw_p;
+ return 0;
}
-static int
-ia64_register_raw_size (int reg)
+static const char *
+ia64_register_name (int reg)
{
- return (IA64_FR0_REGNUM <= reg && reg <= IA64_FR127_REGNUM) ? 16 : 8;
+ return ia64_register_names[reg];
}
-static int
-ia64_register_virtual_size (int reg)
+struct type *
+ia64_register_type (struct gdbarch *arch, int reg)
{
- return (IA64_FR0_REGNUM <= reg && reg <= IA64_FR127_REGNUM) ? 16 : 8;
+ if (reg >= IA64_FR0_REGNUM && reg <= IA64_FR127_REGNUM)
+ return builtin_type_ia64_ext;
+ else
+ return builtin_type_long;
}
-/* Return true iff register N's virtual format is different from
- its raw format. */
static int
-ia64_register_convertible (int nr)
+ia64_dwarf_reg_to_regnum (int reg)
{
- return (IA64_FR0_REGNUM <= nr && nr <= IA64_FR127_REGNUM);
+ if (reg >= IA64_GR32_REGNUM && reg <= IA64_GR127_REGNUM)
+ return V32_REGNUM + (reg - IA64_GR32_REGNUM);
+ return reg;
}
const struct floatformat floatformat_ia64_ext =
@@ -261,48 +322,6 @@ const struct floatformat floatformat_ia64_ext =
floatformat_intbit_yes
};
-static void
-ia64_register_convert_to_virtual (int regnum, struct type *type,
- char *from, char *to)
-{
- if (regnum >= IA64_FR0_REGNUM && regnum <= IA64_FR127_REGNUM)
- {
- DOUBLEST val;
- floatformat_to_doublest (&floatformat_ia64_ext, from, &val);
- deprecated_store_floating (to, TYPE_LENGTH(type), val);
- }
- else
- error("ia64_register_convert_to_virtual called with non floating point register number");
-}
-
-static void
-ia64_register_convert_to_raw (struct type *type, int regnum,
- const char *from, char *to)
-{
- if (regnum >= IA64_FR0_REGNUM && regnum <= IA64_FR127_REGNUM)
- {
- DOUBLEST val = deprecated_extract_floating (from, TYPE_LENGTH(type));
- floatformat_from_doublest (&floatformat_ia64_ext, &val, to);
- }
- else
- error("ia64_register_convert_to_raw called with non floating point register number");
-}
-
-struct type *
-ia64_register_virtual_type (int reg)
-{
- if (reg >= IA64_FR0_REGNUM && reg <= IA64_FR127_REGNUM)
- return builtin_type_long_double;
- else
- return builtin_type_long;
-}
-
-static int
-ia64_register_byte (int reg)
-{
- return (8 * reg) +
- (reg <= IA64_FR0_REGNUM ? 0 : 8 * ((reg > IA64_FR127_REGNUM) ? 128 : reg - IA64_FR0_REGNUM));
-}
/* Read the given register from a sigcontext structure in the
specified frame. */
@@ -677,72 +696,255 @@ rse_address_add(CORE_ADDR addr, int nslots)
return new_addr;
}
-/* The IA-64 frame chain is a bit odd. We won't always have a frame
- pointer, so we use the SP value as the FP for the purpose of
- creating a frame. There is sometimes a register (not fixed) which
- is used as a frame pointer. When this register exists, it is not
- especially hard to determine which one is being used. It isn't
- even really hard to compute the frame chain, but it can be
- computationally expensive. So, instead of making life difficult
- (and slow), we pick a more convenient representation of the frame
- chain, knowing that we'll have to make some small adjustments in
- other places. (E.g, note that deprecated_read_fp() is actually
- read_sp() in ia64_gdbarch_init() below.)
-
- Okay, so what is the frame chain exactly? It'll be the SP value
- at the time that the function in question was entered.
-
- Note that this *should* actually the frame pointer for the current
- function! But as I note above, if we were to attempt to find the
- address of the beginning of the previous frame, we'd waste a lot
- of cycles for no good reason. So instead, we simply choose to
- represent the frame chain as the end of the previous frame instead
- of the beginning. */
-
-static CORE_ADDR
-ia64_frame_chain (struct frame_info *frame)
+static void
+ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+ int regnum, void *buf)
{
- if ((get_frame_type (frame) == SIGTRAMP_FRAME))
- return read_sigcontext_register (frame, sp_regnum);
- else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
- return get_frame_base (frame);
- else
+ if (regnum >= V32_REGNUM && regnum <= V127_REGNUM)
{
- DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
- if (get_frame_saved_regs (frame)[IA64_VFP_REGNUM])
- return read_memory_integer (get_frame_saved_regs (frame)[IA64_VFP_REGNUM], 8);
+ ULONGEST bsp;
+ ULONGEST cfm;
+ CORE_ADDR reg;
+ regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp);
+ regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
+
+ /* The bsp points at the end of the register frame so we
+ subtract the size of frame from it to get start of register frame. */
+ bsp = rse_address_add (bsp, -(cfm & 0x7f));
+
+ if ((cfm & 0x7f) > regnum - V32_REGNUM)
+ {
+ ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
+ reg = read_memory_integer ((CORE_ADDR)reg_addr, 8);
+ store_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum), reg);
+ }
else
- return (get_frame_base (frame)
- + get_frame_extra_info (frame)->mem_stack_frame_size);
+ store_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum), 0);
+ }
+ else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM)
+ {
+ ULONGEST unatN_val;
+ ULONGEST unat;
+ regcache_cooked_read_unsigned (regcache, IA64_UNAT_REGNUM, &unat);
+ unatN_val = (unat & (1LL << (regnum - IA64_NAT0_REGNUM))) != 0;
+ store_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum), unatN_val);
+ }
+ else if (IA64_NAT32_REGNUM <= regnum && regnum <= IA64_NAT127_REGNUM)
+ {
+ ULONGEST natN_val = 0;
+ ULONGEST bsp;
+ ULONGEST cfm;
+ CORE_ADDR gr_addr = 0;
+ regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp);
+ regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
+
+ /* The bsp points at the end of the register frame so we
+ subtract the size of frame from it to get start of register frame. */
+ bsp = rse_address_add (bsp, -(cfm & 0x7f));
+
+ if ((cfm & 0x7f) > regnum - V32_REGNUM)
+ gr_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
+
+ if (gr_addr != 0)
+ {
+ /* Compute address of nat collection bits. */
+ CORE_ADDR nat_addr = gr_addr | 0x1f8;
+ CORE_ADDR nat_collection;
+ int nat_bit;
+ /* If our nat collection address is bigger than bsp, we have to get
+ the nat collection from rnat. Otherwise, we fetch the nat
+ collection from the computed address. */
+ if (nat_addr >= bsp)
+ regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM, &nat_collection);
+ else
+ nat_collection = read_memory_integer (nat_addr, 8);
+ nat_bit = (gr_addr >> 3) & 0x3f;
+ natN_val = (nat_collection >> nat_bit) & 1;
+ }
+
+ store_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum), natN_val);
}
+ else if (regnum == VBOF_REGNUM)
+ {
+ /* A virtual register frame start is provided for user convenience.
+ It can be calculated as the bsp - sof (sizeof frame). */
+ ULONGEST bsp, vbsp;
+ ULONGEST cfm;
+ CORE_ADDR reg;
+ regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp);
+ regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
+
+ /* The bsp points at the end of the register frame so we
+ subtract the size of frame from it to get beginning of frame. */
+ vbsp = rse_address_add (bsp, -(cfm & 0x7f));
+ store_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum), vbsp);
+ }
+ else if (VP0_REGNUM <= regnum && regnum <= VP63_REGNUM)
+ {
+ ULONGEST pr;
+ ULONGEST cfm;
+ ULONGEST prN_val;
+ CORE_ADDR reg;
+ regcache_cooked_read_unsigned (regcache, IA64_PR_REGNUM, &pr);
+ regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
+
+ if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM)
+ {
+ /* Fetch predicate register rename base from current frame
+ marker for this frame. */
+ int rrb_pr = (cfm >> 32) & 0x3f;
+
+ /* Adjust the register number to account for register rotation. */
+ regnum = VP16_REGNUM
+ + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
+ }
+ prN_val = (pr & (1LL << (regnum - VP0_REGNUM))) != 0;
+ store_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum), prN_val);
+ }
+ else
+ memset (buf, 0, REGISTER_RAW_SIZE (regnum));
}
-static CORE_ADDR
-ia64_frame_saved_pc (struct frame_info *frame)
+static void
+ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
+ int regnum, const void *buf)
{
- if ((get_frame_type (frame) == SIGTRAMP_FRAME))
- return read_sigcontext_register (frame, pc_regnum);
- else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
- return deprecated_read_register_dummy (get_frame_pc (frame),
- get_frame_base (frame), pc_regnum);
- else
+ if (regnum >= V32_REGNUM && regnum <= V127_REGNUM)
+ {
+ ULONGEST bsp;
+ ULONGEST cfm;
+ CORE_ADDR reg;
+ regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp);
+ regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
+
+ bsp = rse_address_add (bsp, -(cfm & 0x7f));
+
+ if ((cfm & 0x7f) > regnum - V32_REGNUM)
+ {
+ ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
+ write_memory (reg_addr, (void *)buf, 8);
+ }
+ }
+ else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM)
+ {
+ ULONGEST unatN_val, unat, unatN_mask;
+ regcache_cooked_read_unsigned (regcache, IA64_UNAT_REGNUM, &unat);
+ unatN_val = extract_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum));
+ unatN_mask = (1LL << (regnum - IA64_NAT0_REGNUM));
+ if (unatN_val == 0)
+ unat &= ~unatN_mask;
+ else if (unatN_val == 1)
+ unat |= unatN_mask;
+ regcache_cooked_write_unsigned (regcache, IA64_UNAT_REGNUM, unat);
+ }
+ else if (IA64_NAT32_REGNUM <= regnum && regnum <= IA64_NAT127_REGNUM)
+ {
+ ULONGEST natN_val;
+ ULONGEST bsp;
+ ULONGEST cfm;
+ CORE_ADDR gr_addr = 0;
+ regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp);
+ regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
+
+ /* The bsp points at the end of the register frame so we
+ subtract the size of frame from it to get start of register frame. */
+ bsp = rse_address_add (bsp, -(cfm & 0x7f));
+
+ if ((cfm & 0x7f) > regnum - V32_REGNUM)
+ gr_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
+
+ natN_val = extract_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum));
+
+ if (gr_addr != 0 && (natN_val == 0 || natN_val == 1))
+ {
+ /* Compute address of nat collection bits. */
+ CORE_ADDR nat_addr = gr_addr | 0x1f8;
+ CORE_ADDR nat_collection;
+ int natN_bit = (gr_addr >> 3) & 0x3f;
+ ULONGEST natN_mask = (1LL << natN_bit);
+ /* If our nat collection address is bigger than bsp, we have to get
+ the nat collection from rnat. Otherwise, we fetch the nat
+ collection from the computed address. */
+ if (nat_addr >= bsp)
+ {
+ regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM, &nat_collection);
+ if (natN_val)
+ nat_collection |= natN_mask;
+ else
+ nat_collection &= ~natN_mask;
+ regcache_cooked_write_unsigned (regcache, IA64_RNAT_REGNUM, nat_collection);
+ }
+ else
+ {
+ char nat_buf[8];
+ nat_collection = read_memory_integer (nat_addr, 8);
+ if (natN_val)
+ nat_collection |= natN_mask;
+ else
+ nat_collection &= ~natN_mask;
+ store_unsigned_integer (nat_buf, REGISTER_RAW_SIZE (regnum), nat_collection);
+ write_memory (nat_addr, nat_buf, 8);
+ }
+ }
+ }
+ else if (VP0_REGNUM <= regnum && regnum <= VP63_REGNUM)
{
- DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
-
- if (get_frame_saved_regs (frame)[IA64_VRAP_REGNUM])
- return read_memory_integer (get_frame_saved_regs (frame)[IA64_VRAP_REGNUM], 8);
- else if (get_next_frame (frame)
- && (get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME))
- return read_sigcontext_register (get_next_frame (frame), IA64_BR0_REGNUM);
- else /* either frameless, or not far enough along in the prologue... */
- return ia64_saved_pc_after_call (frame);
+ ULONGEST pr;
+ ULONGEST cfm;
+ ULONGEST prN_val;
+ ULONGEST prN_mask;
+
+ regcache_cooked_read_unsigned (regcache, IA64_PR_REGNUM, &pr);
+ regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
+
+ if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM)
+ {
+ /* Fetch predicate register rename base from current frame
+ marker for this frame. */
+ int rrb_pr = (cfm >> 32) & 0x3f;
+
+ /* Adjust the register number to account for register rotation. */
+ regnum = VP16_REGNUM
+ + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
+ }
+ prN_val = extract_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum));
+ prN_mask = (1LL << (regnum - VP0_REGNUM));
+ if (prN_val == 0)
+ pr &= ~prN_mask;
+ else if (prN_val == 1)
+ pr |= prN_mask;
+ regcache_cooked_write_unsigned (regcache, IA64_PR_REGNUM, pr);
}
}
+/* The ia64 needs to convert between various ieee floating-point formats
+ and the special ia64 floating point register format. */
+
+static int
+ia64_convert_register_p (int regno, struct type *type)
+{
+ return (regno >= IA64_FR0_REGNUM && regno <= IA64_FR127_REGNUM);
+}
+
+static void
+ia64_register_to_value (struct frame_info *frame, int regnum,
+ struct type *valtype, void *out)
+{
+ char in[MAX_REGISTER_SIZE];
+ frame_register_read (frame, regnum, in);
+ convert_typed_floating (in, builtin_type_ia64_ext, out, valtype);
+}
+
+static void
+ia64_value_to_register (struct frame_info *frame, int regnum,
+ struct type *valtype, const void *in)
+{
+ char out[MAX_REGISTER_SIZE];
+ convert_typed_floating (in, valtype, out, builtin_type_ia64_ext);
+ put_frame_register (frame, regnum, out);
+}
+
+
/* Limit the number of skipped non-prologue instructions since examining
of the prologue is expensive. */
static int max_skip_non_prologue_insns = 40;
@@ -814,15 +1016,40 @@ refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc, int *trust_limit)
| (((_instr_) & 0x00008000000LL) >> 20) \
| (((_instr_) & 0x00000001fc0LL) >> 6))
+/* Allocate and initialize a frame cache. */
+
+static struct ia64_frame_cache *
+ia64_alloc_frame_cache (void)
+{
+ struct ia64_frame_cache *cache;
+ int i;
+
+ cache = FRAME_OBSTACK_ZALLOC (struct ia64_frame_cache);
+
+ /* Base address. */
+ cache->base = 0;
+ cache->pc = 0;
+ cache->cfm = 0;
+ cache->sof = 0;
+ cache->sol = 0;
+ cache->sor = 0;
+ cache->bsp = 0;
+ cache->fp_reg = 0;
+ cache->frameless = 1;
+
+ for (i = 0; i < NUM_IA64_RAW_REGS; i++)
+ cache->saved_regs[i] = 0;
+
+ return cache;
+}
+
static CORE_ADDR
-examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
+examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *next_frame, struct ia64_frame_cache *cache)
{
CORE_ADDR next_pc;
CORE_ADDR last_prologue_pc = pc;
instruction_type it;
long long instr;
- int do_fsr_stuff = 0;
-
int cfm_reg = 0;
int ret_reg = 0;
int fp_reg = 0;
@@ -835,23 +1062,19 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
char infpstores[8];
char reg_contents[256];
int trust_limit;
- int frameless = 0;
+ int frameless = 1;
+ int i;
+ CORE_ADDR addr;
+ char buf[8];
+ CORE_ADDR bof, sor, sol, sof, cfm, rrb_gr;
memset (instores, 0, sizeof instores);
memset (infpstores, 0, sizeof infpstores);
memset (reg_contents, 0, sizeof reg_contents);
- if (frame && !get_frame_saved_regs (frame))
- {
- frame_saved_regs_zalloc (frame);
- do_fsr_stuff = 1;
- }
-
- if (frame
- && !do_fsr_stuff
- && get_frame_extra_info (frame)->after_prologue != 0
- && get_frame_extra_info (frame)->after_prologue <= lim_pc)
- return get_frame_extra_info (frame)->after_prologue;
+ if (cache->after_prologue != 0
+ && cache->after_prologue <= lim_pc)
+ return cache->after_prologue;
lim_pc = refine_prologue_limit (pc, lim_pc, &trust_limit);
next_pc = fetch_instruction (pc, &it, &instr);
@@ -865,11 +1088,18 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
int sor = (int) ((instr & 0x00078000000LL) >> 27);
int sol = (int) ((instr & 0x00007f00000LL) >> 20);
int sof = (int) ((instr & 0x000000fe000LL) >> 13);
- /* Okay, so sor, sol, and sof aren't used right now; but perhaps
- we could compare against the size given to us via the cfm as
- either a sanity check or possibly to see if the frame has been
- changed by a later alloc instruction... */
int rN = (int) ((instr & 0x00000001fc0LL) >> 6);
+
+ /* Verify that the current cfm matches what we think is the
+ function start. If we have somehow jumped within a function,
+ we do not want to interpret the prologue and calculate the
+ addresses of various registers such as the return address.
+ We will instead treat the frame as frameless. */
+ if (!next_frame ||
+ (sof == (cache->cfm & 0x7f) &&
+ sol == ((cache->cfm >> 7) & 0x7f)))
+ frameless = 0;
+
cfm_reg = rN;
last_prologue_pc = next_pc;
pc = next_pc;
@@ -892,7 +1122,6 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
{
/* mov r2, r12 - beginning of leaf routine */
fp_reg = rN;
- frameless = 1;
last_prologue_pc = next_pc;
}
}
@@ -915,11 +1144,18 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
if (next_pc == 0)
break;
- if ((it == B && ((instr & 0x1e1f800003f) != 0x04000000000))
- || ((instr & 0x3fLL) != 0LL))
+ if (it == B && ((instr & 0x1e1f800003f) != 0x04000000000))
+ {
+ /* Exit loop upon hitting a non-nop branch instruction. */
+ if (trust_limit)
+ lim_pc = pc;
+ break;
+ }
+ else if (((instr & 0x3fLL) != 0LL) &&
+ (frameless || ret_reg != 0))
{
- /* Exit loop upon hitting a non-nop branch instruction
- or a predicated instruction. */
+ /* Exit loop upon hitting a predicated instruction if
+ we already have the return register or if we are frameless. */
if (trust_limit)
lim_pc = pc;
break;
@@ -963,6 +1199,8 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
else if (qp == 0 && rN == 2
&& ((rM == fp_reg && fp_reg != 0) || rM == 12))
{
+ char buf[MAX_REGISTER_SIZE];
+ CORE_ADDR saved_sp = 0;
/* adds r2, spilloffset, rFramePointer
or
adds r2, spilloffset, r12
@@ -975,7 +1213,12 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
/* Hmm... whether or not this will work will depend on
where the pc is. If it's still early in the prologue
this'll be wrong. FIXME */
- spill_addr = (frame ? get_frame_base (frame) : 0)
+ if (next_frame)
+ {
+ frame_unwind_register (next_frame, sp_regnum, buf);
+ saved_sp = extract_unsigned_integer (buf, 8);
+ }
+ spill_addr = saved_sp
+ (rM == 12 ? 0 : mem_stack_frame_size)
+ imm;
spill_reg = rN;
@@ -1011,8 +1254,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
if (qp == 0 && rN == spill_reg && spill_addr != 0
&& ((2 <= fM && fM <= 5) || (16 <= fM && fM <= 31)))
{
- if (do_fsr_stuff)
- get_frame_saved_regs (frame)[IA64_FR0_REGNUM + fM] = spill_addr;
+ cache->saved_regs[IA64_FR0_REGNUM + fM] = spill_addr;
if ((instr & 0x1efc0000000) == 0x0eec0000000)
spill_addr += imm;
@@ -1071,15 +1313,13 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
if (rM == unat_save_reg)
{
/* Track UNAT register */
- if (do_fsr_stuff)
- get_frame_saved_regs (frame)[IA64_UNAT_REGNUM] = spill_addr;
+ cache->saved_regs[IA64_UNAT_REGNUM] = spill_addr;
unat_save_reg = 0;
}
else
{
/* Track PR register */
- if (do_fsr_stuff)
- get_frame_saved_regs (frame)[IA64_PR_REGNUM] = spill_addr;
+ cache->saved_regs[IA64_PR_REGNUM] = spill_addr;
pr_save_reg = 0;
}
if ((instr & 0x1efc0000000LL) == 0x0acc0000000LL)
@@ -1162,8 +1402,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
/* We've found a spill of one of the preserved general purpose
regs. Record the spill address and advance the spill
register if appropriate. */
- if (do_fsr_stuff)
- get_frame_saved_regs (frame)[IA64_GR0_REGNUM + rM] = spill_addr;
+ cache->saved_regs[IA64_GR0_REGNUM + rM] = spill_addr;
if ((instr & 0x1efc0000000LL) == 0x0aec0000000LL)
/* st8.spill [rN] = rM, imm9 */
spill_addr += imm9(instr);
@@ -1176,50 +1415,79 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
pc = next_pc;
}
- if (do_fsr_stuff) {
- int i;
- CORE_ADDR addr;
- int sor, rrb_gr;
-
- /* Extract the size of the rotating portion of the stack
- frame and the register rename base from the current
- frame marker. */
- sor = ((get_frame_extra_info (frame)->cfm >> 14) & 0xf) * 8;
- rrb_gr = (get_frame_extra_info (frame)->cfm >> 18) & 0x7f;
-
- for (i = 0, addr = get_frame_extra_info (frame)->bsp;
- i < get_frame_extra_info (frame)->sof;
- i++, addr += 8)
- {
- if (IS_NaT_COLLECTION_ADDR (addr))
- {
- addr += 8;
- }
- if (i < sor)
- get_frame_saved_regs (frame)[IA64_GR32_REGNUM + ((i + (sor - rrb_gr)) % sor)]
- = addr;
- else
- get_frame_saved_regs (frame)[IA64_GR32_REGNUM + i] = addr;
-
- if (i+32 == cfm_reg)
- get_frame_saved_regs (frame)[IA64_CFM_REGNUM] = addr;
- if (i+32 == ret_reg)
- get_frame_saved_regs (frame)[IA64_VRAP_REGNUM] = addr;
- if (i+32 == fp_reg)
- get_frame_saved_regs (frame)[IA64_VFP_REGNUM] = addr;
- }
- }
+ /* If not frameless and we aren't called by skip_prologue, then we need to calculate
+ registers for the previous frame which will be needed later. */
- if (frame && get_frame_extra_info (frame))
+ if (!frameless && next_frame)
{
- get_frame_extra_info (frame)->after_prologue = last_prologue_pc;
- get_frame_extra_info (frame)->mem_stack_frame_size = mem_stack_frame_size;
- get_frame_extra_info (frame)->fp_reg = fp_reg;
- }
+ /* Extract the size of the rotating portion of the stack
+ frame and the register rename base from the current
+ frame marker. */
+ cfm = cache->cfm;
+ sor = cache->sor;
+ sof = cache->sof;
+ sol = cache->sol;
+ rrb_gr = (cfm >> 18) & 0x7f;
+
+ /* Find the bof (beginning of frame). */
+ bof = rse_address_add (cache->bsp, -sof);
+
+ for (i = 0, addr = bof;
+ i < sof;
+ i++, addr += 8)
+ {
+ if (IS_NaT_COLLECTION_ADDR (addr))
+ {
+ addr += 8;
+ }
+ if (i+32 == cfm_reg)
+ cache->saved_regs[IA64_CFM_REGNUM] = addr;
+ if (i+32 == ret_reg)
+ cache->saved_regs[IA64_VRAP_REGNUM] = addr;
+ if (i+32 == fp_reg)
+ cache->saved_regs[IA64_VFP_REGNUM] = addr;
+ }
+ /* For the previous argument registers we require the previous bof.
+ If we can't find the previous cfm, then we can do nothing. */
+ if (cache->saved_regs[IA64_CFM_REGNUM] != 0)
+ {
+ cfm = read_memory_integer (cache->saved_regs[IA64_CFM_REGNUM], 8);
+ sor = ((cfm >> 14) & 0xf) * 8;
+ sof = (cfm & 0x7f);
+ sol = (cfm >> 7) & 0x7f;
+ rrb_gr = (cfm >> 18) & 0x7f;
+
+ /* The previous bof only requires subtraction of the sol (size of locals)
+ due to the overlap between output and input of subsequent frames. */
+ bof = rse_address_add (bof, -sol);
+
+ for (i = 0, addr = bof;
+ i < sof;
+ i++, addr += 8)
+ {
+ if (IS_NaT_COLLECTION_ADDR (addr))
+ {
+ addr += 8;
+ }
+ if (i < sor)
+ cache->saved_regs[IA64_GR32_REGNUM + ((i + (sor - rrb_gr)) % sor)]
+ = addr;
+ else
+ cache->saved_regs[IA64_GR32_REGNUM + i] = addr;
+ }
+
+ }
+ }
+
/* Try and trust the lim_pc value whenever possible. */
if (trust_limit && lim_pc >= last_prologue_pc)
- return lim_pc;
+ last_prologue_pc = lim_pc;
+
+ cache->frameless = frameless;
+ cache->after_prologue = last_prologue_pc;
+ cache->mem_stack_frame_size = mem_stack_frame_size;
+ cache->fp_reg = fp_reg;
return last_prologue_pc;
}
@@ -1227,236 +1495,493 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct frame_info *frame)
CORE_ADDR
ia64_skip_prologue (CORE_ADDR pc)
{
- return examine_prologue (pc, pc+1024, 0);
+ struct ia64_frame_cache cache;
+ cache.base = 0;
+ cache.after_prologue = 0;
+ cache.cfm = 0;
+ cache.bsp = 0;
+
+ /* Call examine_prologue with - as third argument since we don't have a next frame pointer to send. */
+ return examine_prologue (pc, pc+1024, 0, &cache);
}
-static void
-ia64_frame_init_saved_regs (struct frame_info *frame)
+
+/* Normal frames. */
+
+static struct ia64_frame_cache *
+ia64_frame_cache (struct frame_info *next_frame, void **this_cache)
{
- if (get_frame_saved_regs (frame))
- return;
+ struct ia64_frame_cache *cache;
+ char buf[8];
+ CORE_ADDR cfm, sof, sol, bsp, psr;
+ int i;
- if ((get_frame_type (frame) == SIGTRAMP_FRAME) && SIGCONTEXT_REGISTER_ADDRESS)
- {
- int regno;
+ if (*this_cache)
+ return *this_cache;
- frame_saved_regs_zalloc (frame);
+ cache = ia64_alloc_frame_cache ();
+ *this_cache = cache;
- get_frame_saved_regs (frame)[IA64_VRAP_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_IP_REGNUM);
- get_frame_saved_regs (frame)[IA64_CFM_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_CFM_REGNUM);
- get_frame_saved_regs (frame)[IA64_PSR_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_PSR_REGNUM);
-#if 0
- get_frame_saved_regs (frame)[IA64_BSP_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_BSP_REGNUM);
-#endif
- get_frame_saved_regs (frame)[IA64_RNAT_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_RNAT_REGNUM);
- get_frame_saved_regs (frame)[IA64_CCV_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_CCV_REGNUM);
- get_frame_saved_regs (frame)[IA64_UNAT_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_UNAT_REGNUM);
- get_frame_saved_regs (frame)[IA64_FPSR_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_FPSR_REGNUM);
- get_frame_saved_regs (frame)[IA64_PFS_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_PFS_REGNUM);
- get_frame_saved_regs (frame)[IA64_LC_REGNUM] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), IA64_LC_REGNUM);
- for (regno = IA64_GR1_REGNUM; regno <= IA64_GR31_REGNUM; regno++)
- if (regno != sp_regnum)
- get_frame_saved_regs (frame)[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regno);
- for (regno = IA64_BR0_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
- get_frame_saved_regs (frame)[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regno);
- for (regno = IA64_FR2_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
- get_frame_saved_regs (frame)[regno] =
- SIGCONTEXT_REGISTER_ADDRESS (get_frame_base (frame), regno);
- }
- else
- {
- CORE_ADDR func_start;
+ frame_unwind_register (next_frame, sp_regnum, buf);
+ cache->saved_sp = extract_unsigned_integer (buf, 8);
- func_start = get_frame_func (frame);
- examine_prologue (func_start, get_frame_pc (frame), frame);
- }
+ /* We always want the bsp to point to the end of frame.
+ This way, we can always get the beginning of frame (bof)
+ by subtracting frame size. */
+ frame_unwind_register (next_frame, IA64_BSP_REGNUM, buf);
+ cache->bsp = extract_unsigned_integer (buf, 8);
+
+ frame_unwind_register (next_frame, IA64_PSR_REGNUM, buf);
+ psr = extract_unsigned_integer (buf, 8);
+
+ frame_unwind_register (next_frame, IA64_CFM_REGNUM, buf);
+ cfm = extract_unsigned_integer (buf, 8);
+
+ cache->sof = (cfm & 0x7f);
+ cache->sol = (cfm >> 7) & 0x7f;
+ cache->sor = ((cfm >> 14) & 0xf) * 8;
+
+ cache->cfm = cfm;
+
+ cache->pc = frame_func_unwind (next_frame);
+
+ if (cache->pc != 0)
+ examine_prologue (cache->pc, frame_pc_unwind (next_frame), next_frame, cache);
+
+ cache->base = cache->saved_sp + cache->mem_stack_frame_size;
+
+ return cache;
}
static void
-ia64_get_saved_register (char *raw_buffer,
- int *optimized,
- CORE_ADDR *addrp,
- struct frame_info *frame,
- int regnum,
- enum lval_type *lval)
+ia64_frame_this_id (struct frame_info *next_frame, void **this_cache,
+ struct frame_id *this_id)
{
- int is_dummy_frame;
+ struct ia64_frame_cache *cache =
+ ia64_frame_cache (next_frame, this_cache);
- if (!target_has_registers)
- error ("No registers.");
+ /* This marks the outermost frame. */
+ if (cache->base == 0)
+ return;
- if (optimized != NULL)
- *optimized = 0;
+ (*this_id) = frame_id_build (cache->base, cache->pc);
+}
- if (addrp != NULL)
- *addrp = 0;
+static void
+ia64_frame_prev_register (struct frame_info *next_frame, void **this_cache,
+ int regnum, int *optimizedp,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnump, void *valuep)
+{
+ struct ia64_frame_cache *cache =
+ ia64_frame_cache (next_frame, this_cache);
+ char dummy_valp[MAX_REGISTER_SIZE];
+ char buf[8];
- if (lval != NULL)
- *lval = not_lval;
+ gdb_assert (regnum >= 0);
- is_dummy_frame = DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame));
+ if (!target_has_registers)
+ error ("No registers.");
+
+ *optimizedp = 0;
+ *addrp = 0;
+ *lvalp = not_lval;
+ *realnump = -1;
- if (regnum == SP_REGNUM && get_next_frame (frame))
+ /* Rather than check each time if valuep is non-null, supply a dummy buffer
+ when valuep is not supplied. */
+ if (!valuep)
+ valuep = dummy_valp;
+
+ memset (valuep, 0, REGISTER_RAW_SIZE (regnum));
+
+ if (regnum == SP_REGNUM)
{
/* Handle SP values for all frames but the topmost. */
- store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum),
- get_frame_base (frame));
+ store_unsigned_integer (valuep, REGISTER_RAW_SIZE (regnum),
+ cache->base);
}
else if (regnum == IA64_BSP_REGNUM)
{
- store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum),
- get_frame_extra_info (frame)->bsp);
+ char cfm_valuep[MAX_REGISTER_SIZE];
+ int cfm_optim;
+ int cfm_realnum;
+ enum lval_type cfm_lval;
+ CORE_ADDR cfm_addr;
+ CORE_ADDR bsp, prev_cfm, prev_bsp;
+
+ /* We want to calculate the previous bsp as the end of the previous register stack frame.
+ This corresponds to what the hardware bsp register will be if we pop the frame
+ back which is why we might have been called. We know the beginning of the current
+ frame is cache->bsp - cache->sof. This value in the previous frame points to
+ the start of the output registers. We can calculate the end of that frame by adding
+ the size of output (sof (size of frame) - sol (size of locals)). */
+ ia64_frame_prev_register (next_frame, this_cache, IA64_CFM_REGNUM,
+ &cfm_optim, &cfm_lval, &cfm_addr, &cfm_realnum, cfm_valuep);
+ prev_cfm = extract_unsigned_integer (cfm_valuep, 8);
+
+ bsp = rse_address_add (cache->bsp, -(cache->sof));
+ prev_bsp = rse_address_add (bsp, (prev_cfm & 0x7f) - ((prev_cfm >> 7) & 0x7f));
+
+ store_unsigned_integer (valuep, REGISTER_RAW_SIZE (regnum),
+ prev_bsp);
+ }
+ else if (regnum == IA64_CFM_REGNUM)
+ {
+ CORE_ADDR addr = 0;
+
+ if (cache->frameless)
+ {
+ CORE_ADDR cfm = 0;
+ frame_unwind_register (next_frame, IA64_PFS_REGNUM, valuep);
+ }
+ else
+ {
+ addr = cache->saved_regs[IA64_CFM_REGNUM];
+ if (addr != 0)
+ read_memory (addr, valuep, REGISTER_RAW_SIZE (regnum));
+ }
}
else if (regnum == IA64_VFP_REGNUM)
{
/* If the function in question uses an automatic register (r32-r127)
for the frame pointer, it'll be found by ia64_find_saved_register()
above. If the function lacks one of these frame pointers, we can
- still provide a value since we know the size of the frame */
- CORE_ADDR vfp = (get_frame_base (frame)
- + get_frame_extra_info (frame)->mem_stack_frame_size);
- store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp);
+ still provide a value since we know the size of the frame. */
+ CORE_ADDR vfp = cache->base;
+ store_unsigned_integer (valuep, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp);
}
- else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM)
+ else if (VP0_REGNUM <= regnum && regnum <= VP63_REGNUM)
{
- char pr_raw_buffer[MAX_REGISTER_SIZE];
+ char pr_valuep[MAX_REGISTER_SIZE];
int pr_optim;
+ int pr_realnum;
enum lval_type pr_lval;
CORE_ADDR pr_addr;
- int prN_val;
- ia64_get_saved_register (pr_raw_buffer, &pr_optim, &pr_addr,
- frame, IA64_PR_REGNUM, &pr_lval);
- if (IA64_PR16_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM)
+ ULONGEST prN_val;
+ ia64_frame_prev_register (next_frame, this_cache, IA64_PR_REGNUM,
+ &pr_optim, &pr_lval, &pr_addr, &pr_realnum, pr_valuep);
+ if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM)
{
/* Fetch predicate register rename base from current frame
- marker for this frame. */
- int rrb_pr = (get_frame_extra_info (frame)->cfm >> 32) & 0x3f;
+ marker for this frame. */
+ int rrb_pr = (cache->cfm >> 32) & 0x3f;
- /* Adjust the register number to account for register rotation. */
- regnum = IA64_PR16_REGNUM
- + ((regnum - IA64_PR16_REGNUM) + rrb_pr) % 48;
+ /* Adjust the register number to account for register rotation. */
+ regnum = VP16_REGNUM
+ + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
}
- prN_val = extract_bit_field ((unsigned char *) pr_raw_buffer,
- regnum - IA64_PR0_REGNUM, 1);
- store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), prN_val);
+ prN_val = extract_bit_field ((unsigned char *) pr_valuep,
+ regnum - VP0_REGNUM, 1);
+ store_unsigned_integer (valuep, REGISTER_RAW_SIZE (regnum), prN_val);
}
else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM)
{
- char unat_raw_buffer[MAX_REGISTER_SIZE];
+ char unat_valuep[MAX_REGISTER_SIZE];
int unat_optim;
+ int unat_realnum;
enum lval_type unat_lval;
CORE_ADDR unat_addr;
- int unatN_val;
- ia64_get_saved_register (unat_raw_buffer, &unat_optim, &unat_addr,
- frame, IA64_UNAT_REGNUM, &unat_lval);
- unatN_val = extract_bit_field ((unsigned char *) unat_raw_buffer,
+ ULONGEST unatN_val;
+ ia64_frame_prev_register (next_frame, this_cache, IA64_UNAT_REGNUM,
+ &unat_optim, &unat_lval, &unat_addr, &unat_realnum, unat_valuep);
+ unatN_val = extract_bit_field ((unsigned char *) unat_valuep,
regnum - IA64_NAT0_REGNUM, 1);
- store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ store_unsigned_integer (valuep, REGISTER_RAW_SIZE (regnum),
unatN_val);
}
else if (IA64_NAT32_REGNUM <= regnum && regnum <= IA64_NAT127_REGNUM)
{
int natval = 0;
/* Find address of general register corresponding to nat bit we're
- interested in. */
- CORE_ADDR gr_addr = 0;
+ interested in. */
+ CORE_ADDR gr_addr;
- if (!is_dummy_frame)
- {
- DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
- gr_addr = get_frame_saved_regs (frame)[ regnum - IA64_NAT0_REGNUM
- + IA64_GR0_REGNUM];
- }
- if (gr_addr)
+ gr_addr = cache->saved_regs[regnum - IA64_NAT0_REGNUM
+ + IA64_GR0_REGNUM];
+ if (gr_addr != 0)
{
- /* Compute address of nat collection bits */
+ /* Compute address of nat collection bits. */
CORE_ADDR nat_addr = gr_addr | 0x1f8;
- CORE_ADDR bsp = read_register (IA64_BSP_REGNUM);
+ CORE_ADDR bsp;
CORE_ADDR nat_collection;
int nat_bit;
/* If our nat collection address is bigger than bsp, we have to get
the nat collection from rnat. Otherwise, we fetch the nat
- collection from the computed address. */
+ collection from the computed address. */
+ frame_unwind_register (next_frame, IA64_BSP_REGNUM, buf);
+ bsp = extract_unsigned_integer (buf, 8);
if (nat_addr >= bsp)
- nat_collection = read_register (IA64_RNAT_REGNUM);
+ {
+ frame_unwind_register (next_frame, IA64_RNAT_REGNUM, buf);
+ nat_collection = extract_unsigned_integer (buf, 8);
+ }
else
nat_collection = read_memory_integer (nat_addr, 8);
nat_bit = (gr_addr >> 3) & 0x3f;
natval = (nat_collection >> nat_bit) & 1;
}
- store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), natval);
+
+ store_unsigned_integer (valuep, REGISTER_RAW_SIZE (regnum), natval);
}
else if (regnum == IA64_IP_REGNUM)
{
- CORE_ADDR pc;
- if (get_next_frame (frame))
- {
- /* FIXME: Set *addrp, *lval when possible. */
- pc = ia64_frame_saved_pc (get_next_frame (frame));
- }
+ CORE_ADDR pc = 0;
+
+ if (cache->frameless)
+ {
+ frame_unwind_register (next_frame, IA64_BR0_REGNUM, buf);
+ pc = extract_unsigned_integer (buf, 8);
+ }
else
- {
- pc = read_pc ();
+ {
+ CORE_ADDR addr = cache->saved_regs[IA64_VRAP_REGNUM];
+ if (addr != 0)
+ {
+ read_memory (addr, buf, REGISTER_RAW_SIZE (IA64_IP_REGNUM));
+ pc = extract_unsigned_integer (buf, 8);
+ }
}
- store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (IA64_IP_REGNUM), pc);
+ pc &= ~0xf;
+ store_unsigned_integer (valuep, 8, pc);
}
- else if (IA64_GR32_REGNUM <= regnum && regnum <= IA64_GR127_REGNUM)
+ else if (regnum == IA64_PSR_REGNUM)
{
- CORE_ADDR addr = 0;
- if (!is_dummy_frame)
+ ULONGEST slot_num = 0;
+ CORE_ADDR pc= 0;
+ CORE_ADDR psr = 0;
+
+ frame_unwind_register (next_frame, IA64_PSR_REGNUM, buf);
+ psr = extract_unsigned_integer (buf, 8);
+
+ if (cache->frameless)
{
- DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
- addr = get_frame_saved_regs (frame)[regnum];
+ CORE_ADDR pc;
+ frame_unwind_register (next_frame, IA64_BR0_REGNUM, buf);
+ pc = extract_unsigned_integer (buf, 8);
}
-
+ else
+ {
+ CORE_ADDR addr = cache->saved_regs[IA64_VRAP_REGNUM];
+ if (addr != 0)
+ {
+ read_memory (addr, buf, REGISTER_RAW_SIZE (IA64_IP_REGNUM));
+ pc = extract_unsigned_integer (buf, 8);
+ }
+ }
+ psr &= ~(3LL << 41);
+ slot_num = pc & 0x3LL;
+ psr |= (CORE_ADDR)slot_num << 41;
+ store_unsigned_integer (valuep, 8, psr);
+ }
+ else if ((regnum >= IA64_GR32_REGNUM && regnum <= IA64_GR127_REGNUM) ||
+ (regnum >= V32_REGNUM && regnum <= V127_REGNUM))
+ {
+ CORE_ADDR addr = 0;
+ if (regnum >= V32_REGNUM)
+ regnum = IA64_GR32_REGNUM + (regnum - V32_REGNUM);
+ addr = cache->saved_regs[regnum];
if (addr != 0)
{
- if (lval != NULL)
- *lval = lval_memory;
- if (addrp != NULL)
- *addrp = addr;
- read_memory (addr, raw_buffer, REGISTER_RAW_SIZE (regnum));
+ *lvalp = lval_memory;
+ *addrp = addr;
+ read_memory (addr, valuep, REGISTER_RAW_SIZE (regnum));
}
- else
+ else if (cache->frameless)
{
- /* r32 - r127 must be fetchable via memory. If they aren't,
- then the register is unavailable */
- memset (raw_buffer, 0, REGISTER_RAW_SIZE (regnum));
+ char r_valuep[MAX_REGISTER_SIZE];
+ int r_optim;
+ int r_realnum;
+ enum lval_type r_lval;
+ CORE_ADDR r_addr;
+ CORE_ADDR prev_cfm, prev_bsp, prev_bof;
+ CORE_ADDR addr = 0;
+ if (regnum >= V32_REGNUM)
+ regnum = IA64_GR32_REGNUM + (regnum - V32_REGNUM);
+ ia64_frame_prev_register (next_frame, this_cache, IA64_CFM_REGNUM,
+ &r_optim, &r_lval, &r_addr, &r_realnum, r_valuep);
+ prev_cfm = extract_unsigned_integer (r_valuep, 8);
+ ia64_frame_prev_register (next_frame, this_cache, IA64_BSP_REGNUM,
+ &r_optim, &r_lval, &r_addr, &r_realnum, r_valuep);
+ prev_bsp = extract_unsigned_integer (r_valuep, 8);
+ prev_bof = rse_address_add (prev_bsp, -(prev_cfm & 0x7f));
+
+ addr = rse_address_add (prev_bof, (regnum - IA64_GR32_REGNUM));
+ *lvalp = lval_memory;
+ *addrp = addr;
+ read_memory (addr, valuep, REGISTER_RAW_SIZE (regnum));
}
}
else
{
+ CORE_ADDR addr = 0;
if (IA64_FR32_REGNUM <= regnum && regnum <= IA64_FR127_REGNUM)
{
/* Fetch floating point register rename base from current
- frame marker for this frame. */
- int rrb_fr = (get_frame_extra_info (frame)->cfm >> 25) & 0x7f;
+ frame marker for this frame. */
+ int rrb_fr = (cache->cfm >> 25) & 0x7f;
/* Adjust the floating point register number to account for
- register rotation. */
+ register rotation. */
regnum = IA64_FR32_REGNUM
+ ((regnum - IA64_FR32_REGNUM) + rrb_fr) % 96;
}
- deprecated_generic_get_saved_register (raw_buffer, optimized, addrp,
- frame, regnum, lval);
+ /* If we have stored a memory address, access the register. */
+ addr = cache->saved_regs[regnum];
+ if (addr != 0)
+ {
+ *lvalp = lval_memory;
+ *addrp = addr;
+ read_memory (addr, valuep, REGISTER_RAW_SIZE (regnum));
+ }
+ /* Otherwise, punt and get the current value of the register. */
+ else
+ frame_unwind_register (next_frame, regnum, valuep);
+ }
+}
+
+static const struct frame_unwind ia64_frame_unwind =
+{
+ NORMAL_FRAME,
+ &ia64_frame_this_id,
+ &ia64_frame_prev_register
+};
+
+static const struct frame_unwind *
+ia64_frame_sniffer (struct frame_info *next_frame)
+{
+ return &ia64_frame_unwind;
+}
+
+/* Signal trampolines. */
+
+static void
+ia64_sigtramp_frame_init_saved_regs (struct ia64_frame_cache *cache)
+{
+ if (SIGCONTEXT_REGISTER_ADDRESS)
+ {
+ int regno;
+
+ cache->saved_regs[IA64_VRAP_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_IP_REGNUM);
+ cache->saved_regs[IA64_CFM_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_CFM_REGNUM);
+ cache->saved_regs[IA64_PSR_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_PSR_REGNUM);
+#if 0
+ cache->saved_regs[IA64_BSP_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (frame->frame, IA64_BSP_REGNUM);
+#endif
+ cache->saved_regs[IA64_RNAT_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_RNAT_REGNUM);
+ cache->saved_regs[IA64_CCV_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_CCV_REGNUM);
+ cache->saved_regs[IA64_UNAT_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_UNAT_REGNUM);
+ cache->saved_regs[IA64_FPSR_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_FPSR_REGNUM);
+ cache->saved_regs[IA64_PFS_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_PFS_REGNUM);
+ cache->saved_regs[IA64_LC_REGNUM] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, IA64_LC_REGNUM);
+ for (regno = IA64_GR1_REGNUM; regno <= IA64_GR31_REGNUM; regno++)
+ if (regno != sp_regnum)
+ cache->saved_regs[regno] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, regno);
+ for (regno = IA64_BR0_REGNUM; regno <= IA64_BR7_REGNUM; regno++)
+ cache->saved_regs[regno] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, regno);
+ for (regno = IA64_FR2_REGNUM; regno <= IA64_FR31_REGNUM; regno++)
+ cache->saved_regs[regno] =
+ SIGCONTEXT_REGISTER_ADDRESS (cache->base, regno);
}
}
+static struct ia64_frame_cache *
+ia64_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache)
+{
+ struct ia64_frame_cache *cache;
+ CORE_ADDR addr;
+ char buf[8];
+ int i;
+
+ if (*this_cache)
+ return *this_cache;
+
+ cache = ia64_alloc_frame_cache ();
+
+ frame_unwind_register (next_frame, sp_regnum, buf);
+ cache->base = extract_unsigned_integer (buf, 8) + cache->mem_stack_frame_size;
+
+ ia64_sigtramp_frame_init_saved_regs (cache);
+
+ *this_cache = cache;
+ return cache;
+}
+
+static void
+ia64_sigtramp_frame_this_id (struct frame_info *next_frame,
+ void **this_cache, struct frame_id *this_id)
+{
+ struct ia64_frame_cache *cache =
+ ia64_sigtramp_frame_cache (next_frame, this_cache);
+
+ (*this_id) = frame_id_build (cache->base, frame_pc_unwind (next_frame));
+}
+
+static void
+ia64_sigtramp_frame_prev_register (struct frame_info *next_frame,
+ void **this_cache,
+ int regnum, int *optimizedp,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnump, void *valuep)
+{
+ /* Make sure we've initialized the cache. */
+ ia64_sigtramp_frame_cache (next_frame, this_cache);
+
+ ia64_frame_prev_register (next_frame, this_cache, regnum,
+ optimizedp, lvalp, addrp, realnump, valuep);
+}
+
+static const struct frame_unwind ia64_sigtramp_frame_unwind =
+{
+ SIGTRAMP_FRAME,
+ ia64_sigtramp_frame_this_id,
+ ia64_sigtramp_frame_prev_register
+};
+
+static const struct frame_unwind *
+ia64_sigtramp_frame_sniffer (struct frame_info *next_frame)
+{
+ char *name;
+ CORE_ADDR pc = frame_pc_unwind (next_frame);
+
+ find_pc_partial_function (pc, &name, NULL, NULL);
+ if (PC_IN_SIGTRAMP (pc, name))
+ return &ia64_sigtramp_frame_unwind;
+
+ return NULL;
+}
+
+
+static CORE_ADDR
+ia64_frame_base_address (struct frame_info *next_frame, void **this_cache)
+{
+ struct ia64_frame_cache *cache =
+ ia64_frame_cache (next_frame, this_cache);
+
+ return cache->base;
+}
+
+static const struct frame_base ia64_frame_base =
+{
+ &ia64_frame_unwind,
+ ia64_frame_base_address,
+ ia64_frame_base_address,
+ ia64_frame_base_address
+};
+
/* Should we use EXTRACT_STRUCT_VALUE_ADDRESS instead of
EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc
and TYPE is the type (which is known to be struct, union or array). */
@@ -1468,160 +1993,72 @@ ia64_use_struct_convention (int gcc_p, struct type *type)
/* HFAs are structures (or arrays) consisting entirely of floating
point values of the same length. Up to 8 of these are returned
in registers. Don't use the struct convention when this is the
- case. */
+ case. */
float_elt_type = is_float_or_hfa_type (type);
if (float_elt_type != NULL
&& TYPE_LENGTH (type) / TYPE_LENGTH (float_elt_type) <= 8)
return 0;
/* Other structs of length 32 or less are returned in r8-r11.
- Don't use the struct convention for those either. */
+ Don't use the struct convention for those either. */
return TYPE_LENGTH (type) > 32;
}
void
-ia64_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+ia64_extract_return_value (struct type *type, struct regcache *regcache, void *valbuf)
{
struct type *float_elt_type;
float_elt_type = is_float_or_hfa_type (type);
if (float_elt_type != NULL)
{
+ char from[MAX_REGISTER_SIZE];
int offset = 0;
int regnum = IA64_FR8_REGNUM;
int n = TYPE_LENGTH (type) / TYPE_LENGTH (float_elt_type);
while (n-- > 0)
{
- ia64_register_convert_to_virtual (regnum, float_elt_type,
- &regbuf[REGISTER_BYTE (regnum)], valbuf + offset);
+ regcache_cooked_read (regcache, regnum, from);
+ convert_typed_floating (from, builtin_type_ia64_ext,
+ (char *)valbuf + offset, float_elt_type);
offset += TYPE_LENGTH (float_elt_type);
regnum++;
}
}
else
- memcpy (valbuf, &regbuf[REGISTER_BYTE (IA64_GR8_REGNUM)],
- TYPE_LENGTH (type));
-}
-
-/* FIXME: Turn this into a stack of some sort. Unfortunately, something
- like this is necessary though since the IA-64 calling conventions specify
- that r8 is not preserved. */
-static CORE_ADDR struct_return_address;
-
-CORE_ADDR
-ia64_extract_struct_value_address (char *regbuf)
-{
- /* FIXME: See above. */
- return struct_return_address;
-}
+ {
+ ULONGEST val;
+ int offset = 0;
+ int regnum = IA64_GR8_REGNUM;
+ int reglen = TYPE_LENGTH (ia64_register_type (NULL, IA64_GR8_REGNUM));
+ int n = TYPE_LENGTH (type) / reglen;
+ int m = TYPE_LENGTH (type) % reglen;
-static void
-ia64_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
-{
- /* FIXME: See above. */
- /* Note that most of the work was done in ia64_push_dummy_call() */
- struct_return_address = addr;
-}
+ while (n-- > 0)
+ {
+ ULONGEST val;
+ regcache_cooked_read_unsigned (regcache, regnum, &val);
+ memcpy ((char *)valbuf + offset, &val, reglen);
+ offset += reglen;
+ regnum++;
+ }
-int
-ia64_frameless_function_invocation (struct frame_info *frame)
-{
- DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
- return (get_frame_extra_info (frame)->mem_stack_frame_size == 0);
+ if (m)
+ {
+ regcache_cooked_read_unsigned (regcache, regnum, &val);
+ memcpy ((char *)valbuf + offset, &val, m);
+ }
+ }
}
CORE_ADDR
-ia64_saved_pc_after_call (struct frame_info *frame)
-{
- return read_register (IA64_BR0_REGNUM);
-}
-
-static CORE_ADDR
-ia64_frame_args_address (struct frame_info *frame)
-{
- /* frame->frame points at the SP for this frame; But we want the start
- of the frame, not the end. Calling frame chain will get his for us. */
- return ia64_frame_chain (frame);
-}
-
-static CORE_ADDR
-ia64_frame_locals_address (struct frame_info *frame)
+ia64_extract_struct_value_address (struct regcache *regcache)
{
- /* frame->frame points at the SP for this frame; But we want the start
- of the frame, not the end. Calling frame chain will get his for us. */
- return ia64_frame_chain (frame);
+ error ("ia64_extract_struct_value_address called and cannot get struct value address");
+ return 0;
}
-static void
-ia64_init_extra_frame_info (int fromleaf, struct frame_info *frame)
-{
- CORE_ADDR bsp, cfm;
- int next_frame_is_call_dummy = ((get_next_frame (frame) != NULL)
- && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (frame)),
- get_frame_base (get_next_frame (frame)),
- get_frame_base (get_next_frame (frame))));
-
- frame_extra_info_zalloc (frame, sizeof (struct frame_extra_info));
-
- if (get_next_frame (frame) == 0)
- {
- bsp = read_register (IA64_BSP_REGNUM);
- cfm = read_register (IA64_CFM_REGNUM);
-
- }
- else if ((get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME))
- {
- bsp = read_sigcontext_register (get_next_frame (frame), IA64_BSP_REGNUM);
- cfm = read_sigcontext_register (get_next_frame (frame), IA64_CFM_REGNUM);
- }
- else if (next_frame_is_call_dummy)
- {
- bsp = deprecated_read_register_dummy (get_frame_pc (get_next_frame (frame)),
- get_frame_base (get_next_frame (frame)),
- IA64_BSP_REGNUM);
- cfm = deprecated_read_register_dummy (get_frame_pc (get_next_frame (frame)),
- get_frame_base (get_next_frame (frame)),
- IA64_CFM_REGNUM);
- }
- else
- {
- struct frame_info *frn = get_next_frame (frame);
-
- DEPRECATED_FRAME_INIT_SAVED_REGS (frn);
-
- if (get_frame_saved_regs (frn)[IA64_CFM_REGNUM] != 0)
- cfm = read_memory_integer (get_frame_saved_regs (frn)[IA64_CFM_REGNUM], 8);
- else if (get_next_frame (frn) && (get_frame_type (get_next_frame (frn)) == SIGTRAMP_FRAME))
- cfm = read_sigcontext_register (get_next_frame (frn), IA64_PFS_REGNUM);
- else if (get_next_frame (frn)
- && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (frn)),
- get_frame_base (get_next_frame (frn)),
- get_frame_base (get_next_frame (frn))))
- cfm = deprecated_read_register_dummy (get_frame_pc (get_next_frame (frn)),
- get_frame_base (get_next_frame (frn)),
- IA64_PFS_REGNUM);
- else
- cfm = read_register (IA64_PFS_REGNUM);
-
- bsp = get_frame_extra_info (frn)->bsp;
- }
- get_frame_extra_info (frame)->cfm = cfm;
- get_frame_extra_info (frame)->sof = cfm & 0x7f;
- get_frame_extra_info (frame)->sol = (cfm >> 7) & 0x7f;
- if (get_next_frame (frame) == 0
- || (get_frame_type (get_next_frame (frame)) == SIGTRAMP_FRAME)
- || next_frame_is_call_dummy)
- get_frame_extra_info (frame)->bsp =
- rse_address_add (bsp, -get_frame_extra_info (frame)->sof);
- else
- get_frame_extra_info (frame)->bsp =
- rse_address_add (bsp, -get_frame_extra_info (frame)->sol);
-
- get_frame_extra_info (frame)->after_prologue = 0;
- get_frame_extra_info (frame)->mem_stack_frame_size = -1; /* Not yet determined */
- get_frame_extra_info (frame)->fp_reg = 0;
-}
static int
is_float_or_hfa_type_recurse (struct type *t, struct type **etp)
@@ -1661,7 +2098,7 @@ is_float_or_hfa_type_recurse (struct type *t, struct type **etp)
/* Determine if the given type is one of the floating point types or
and HFA (which is a struct, array, or combination thereof whose
- bottom-most elements are all of the same floating point type.) */
+ bottom-most elements are all of the same floating point type). */
static struct type *
is_float_or_hfa_type (struct type *t)
@@ -1675,7 +2112,7 @@ is_float_or_hfa_type (struct type *t)
/* Return 1 if the alignment of T is such that the next even slot
should be used. Return 0, if the next available slot should
be used. (See section 8.5.1 of the IA-64 Software Conventions
- and Runtime manual.) */
+ and Runtime manual). */
static int
slot_alignment_is_next_even (struct type *t)
@@ -1773,13 +2210,13 @@ generic_elf_find_global_pointer (CORE_ADDR faddr)
/* Given a function's address, attempt to find (and return) the
corresponding (canonical) function descriptor. Return 0 if
- not found. */
+ not found. */
static CORE_ADDR
find_extant_func_descr (CORE_ADDR faddr)
{
struct obj_section *faddr_sect;
- /* Return early if faddr is already a function descriptor */
+ /* Return early if faddr is already a function descriptor. */
faddr_sect = find_pc_section (faddr);
if (faddr_sect && strcmp (faddr_sect->the_bfd_section->name, ".opd") == 0)
return faddr;
@@ -1821,7 +2258,7 @@ find_extant_func_descr (CORE_ADDR faddr)
/* Attempt to find a function descriptor corresponding to the
given address. If none is found, construct one on the
- stack using the address at fdaptr */
+ stack using the address at fdaptr. */
static CORE_ADDR
find_func_descr (CORE_ADDR faddr, CORE_ADDR *fdaptr)
@@ -1852,8 +2289,31 @@ find_func_descr (CORE_ADDR faddr, CORE_ADDR *fdaptr)
return fdesc;
}
+/* Use the following routine when printing out function pointers
+ so the user can see the function address rather than just the
+ function descriptor. */
+static CORE_ADDR
+ia64_convert_from_func_ptr_addr (CORE_ADDR addr)
+{
+ struct obj_section *s;
+
+ s = find_pc_section (addr);
+
+ /* check if ADDR points to a function descriptor. */
+ if (s && strcmp (s->the_bfd_section->name, ".opd") == 0)
+ return read_memory_unsigned_integer (addr, 8);
+
+ return addr;
+}
+
static CORE_ADDR
-ia64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+ia64_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
+{
+ return sp & ~0xfLL;
+}
+
+static CORE_ADDR
+ia64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
struct regcache *regcache, CORE_ADDR bp_addr,
int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
@@ -1864,13 +2324,11 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
int len, argoffset;
int nslots, rseslots, memslots, slotnum, nfuncargs;
int floatreg;
- ULONGEST bsp, cfm, pfs, new_bsp;
- CORE_ADDR funcdescaddr;
- ULONGEST global_pointer = FIND_GLOBAL_POINTER (func_addr);
+ CORE_ADDR bsp, cfm, pfs, new_bsp, funcdescaddr, pc, global_pointer;
nslots = 0;
nfuncargs = 0;
- /* Count the number of slots needed for the arguments */
+ /* Count the number of slots needed for the arguments. */
for (argno = 0; argno < nargs; argno++)
{
arg = args[argno];
@@ -1886,43 +2344,42 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
nslots += (len + 7) / 8;
}
- /* Divvy up the slots between the RSE and the memory stack */
+ /* Divvy up the slots between the RSE and the memory stack. */
rseslots = (nslots > 8) ? 8 : nslots;
memslots = nslots - rseslots;
- /* Allocate a new RSE frame */
- regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
+ /* Allocate a new RSE frame. */
+ cfm = read_register (IA64_CFM_REGNUM);
- regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp);
- bsp = rse_address_add (bsp, cfm & 0x7f);
+ bsp = read_register (IA64_BSP_REGNUM);
new_bsp = rse_address_add (bsp, rseslots);
- regcache_cooked_write_unsigned (regcache, IA64_BSP_REGNUM, new_bsp);
+ write_register (IA64_BSP_REGNUM, new_bsp);
- regcache_cooked_read_unsigned (regcache, IA64_PFS_REGNUM, &pfs);
+ pfs = read_register (IA64_PFS_REGNUM);
pfs &= 0xc000000000000000LL;
pfs |= (cfm & 0xffffffffffffLL);
- regcache_cooked_write_unsigned (regcache, IA64_PFS_REGNUM, pfs);
+ write_register (IA64_PFS_REGNUM, pfs);
cfm &= 0xc000000000000000LL;
cfm |= rseslots;
- regcache_cooked_write_unsigned (regcache, IA64_CFM_REGNUM, cfm);
+ write_register (IA64_CFM_REGNUM, cfm);
/* We will attempt to find function descriptors in the .opd segment,
but if we can't we'll construct them ourselves. That being the
- case, we'll need to reserve space on the stack for them. */
+ case, we'll need to reserve space on the stack for them. */
funcdescaddr = sp - nfuncargs * 16;
funcdescaddr &= ~0xfLL;
/* Adjust the stack pointer to it's new value. The calling conventions
require us to have 16 bytes of scratch, plus whatever space is
- necessary for the memory slots and our function descriptors */
+ necessary for the memory slots and our function descriptors. */
sp = sp - 16 - (memslots + nfuncargs) * 8;
- sp &= ~0xfLL; /* Maintain 16 byte alignment */
+ sp &= ~0xfLL; /* Maintain 16 byte alignment. */
/* Place the arguments where they belong. The arguments will be
either placed in the RSE backing store or on the memory stack.
In addition, floating point arguments or HFAs are placed in
- floating point registers. */
+ floating point registers. */
slotnum = 0;
floatreg = IA64_FR8_REGNUM;
for (argno = 0; argno < nargs; argno++)
@@ -1933,7 +2390,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
type = check_typedef (VALUE_TYPE (arg));
len = TYPE_LENGTH (type);
- /* Special handling for function parameters */
+ /* Special handling for function parameters. */
if (len == 8
&& TYPE_CODE (type) == TYPE_CODE_PTR
&& TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC)
@@ -1951,7 +2408,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
continue;
}
- /* Normal slots */
+ /* Normal slots. */
/* Skip odd slot if necessary... */
if ((slotnum & 1) && slot_alignment_is_next_even (type))
@@ -1975,7 +2432,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
slotnum++;
}
- /* Handle floating point types (including HFAs) */
+ /* Handle floating point types (including HFAs). */
float_elt_type = is_float_or_hfa_type (type);
if (float_elt_type != NULL)
{
@@ -1983,12 +2440,10 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
len = TYPE_LENGTH (type);
while (len > 0 && floatreg < IA64_FR16_REGNUM)
{
- char buf[MAX_REGISTER_SIZE];
- ia64_register_convert_to_raw (float_elt_type,
- floatreg,
- VALUE_CONTENTS (arg) + argoffset,
- buf);
- regcache_raw_write (regcache, floatreg, buf);
+ char to[MAX_REGISTER_SIZE];
+ convert_typed_floating (VALUE_CONTENTS (arg) + argoffset, float_elt_type,
+ to, builtin_type_ia64_ext);
+ regcache_cooked_write (regcache, floatreg, (void *)to);
floatreg++;
argoffset += TYPE_LENGTH (float_elt_type);
len -= TYPE_LENGTH (float_elt_type);
@@ -1996,111 +2451,63 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
}
}
- /* Store the struct return value in r8 if necessary. */
+ /* Store the struct return value in r8 if necessary. */
if (struct_return)
{
- regcache_cooked_write_unsigned (regcache, IA64_GR8_REGNUM, struct_addr);
+ regcache_cooked_write_unsigned (regcache, IA64_GR8_REGNUM, (ULONGEST)struct_addr);
}
- if (global_pointer != 0)
- regcache_cooked_write_unsigned (regcache, IA64_GR1_REGNUM, global_pointer);
-
- regcache_cooked_write_unsigned (regcache, IA64_BR0_REGNUM, bp_addr);
+ global_pointer = FIND_GLOBAL_POINTER (func_addr);
- /* Sync gdb's idea of what the registers are with the target. */
- target_store_registers (-1);
-
- /* FIXME: This doesn't belong here! Instead,
- DEPRECATED_SAVE_DUMMY_FRAME_TOS needs to be defined to call
- generic_save_dummy_frame_tos(). But at the time of this writing,
- DEPRECATED_SAVE_DUMMY_FRAME_TOS wasn't gdbarch'd, so I chose to
- put this call here instead of using the old mechanisms. Once
- DEPRECATED_SAVE_DUMMY_FRAME_TOS is gdbarch'd, all we need to do
- is add the line
+ if (global_pointer != 0)
+ write_register (IA64_GR1_REGNUM, global_pointer);
- set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
+ write_register (IA64_BR0_REGNUM, bp_addr);
- to ia64_gdbarch_init() and remove the line below. */
- generic_save_dummy_frame_tos (sp);
+ write_register (sp_regnum, sp);
return sp;
}
-static void
-ia64_store_return_value (struct type *type, char *valbuf)
+static struct frame_id
+ia64_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- if (TYPE_CODE (type) == TYPE_CODE_FLT)
- {
- ia64_register_convert_to_raw (type, IA64_FR8_REGNUM, valbuf,
- &deprecated_registers[REGISTER_BYTE (IA64_FR8_REGNUM)]);
- target_store_registers (IA64_FR8_REGNUM);
- }
- else
- deprecated_write_register_bytes (REGISTER_BYTE (IA64_GR8_REGNUM),
- valbuf, TYPE_LENGTH (type));
+ char buf[8];
+ CORE_ADDR sp;
+
+ frame_unwind_register (next_frame, sp_regnum, buf);
+ sp = extract_unsigned_integer (buf, 8);
+
+ return frame_id_build (sp, frame_pc_unwind (next_frame));
}
-static void
-ia64_pop_frame (void)
+static CORE_ADDR
+ia64_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
{
- generic_pop_current_frame (ia64_pop_frame_regular);
+ char buf[8];
+ CORE_ADDR ip, psr, pc;
+
+ frame_unwind_register (next_frame, IA64_IP_REGNUM, buf);
+ ip = extract_unsigned_integer (buf, 8);
+ frame_unwind_register (next_frame, IA64_PSR_REGNUM, buf);
+ psr = extract_unsigned_integer (buf, 8);
+
+ pc = (ip & ~0xf) | ((psr >> 41) & 3);
+ return pc;
}
static void
-ia64_pop_frame_regular (struct frame_info *frame)
+ia64_store_return_value (struct type *type, struct regcache *regcache, const void *valbuf)
{
- int regno;
- CORE_ADDR bsp, cfm, pfs;
-
- DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
-
- for (regno = 0; regno < ia64_num_regs; regno++)
- {
- if (get_frame_saved_regs (frame)[regno]
- && (!(IA64_GR32_REGNUM <= regno && regno <= IA64_GR127_REGNUM))
- && regno != pc_regnum
- && regno != sp_regnum
- && regno != IA64_PFS_REGNUM
- && regno != IA64_CFM_REGNUM
- && regno != IA64_BSP_REGNUM
- && regno != IA64_BSPSTORE_REGNUM)
- {
- write_register (regno,
- read_memory_integer (get_frame_saved_regs (frame)[regno],
- REGISTER_RAW_SIZE (regno)));
- }
- }
-
- write_register (sp_regnum, DEPRECATED_FRAME_CHAIN (frame));
- write_pc (DEPRECATED_FRAME_SAVED_PC (frame));
-
- cfm = read_register (IA64_CFM_REGNUM);
-
- if (get_frame_saved_regs (frame)[IA64_PFS_REGNUM])
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
{
- pfs = read_memory_integer (get_frame_saved_regs (frame)[IA64_PFS_REGNUM],
- REGISTER_RAW_SIZE (IA64_PFS_REGNUM));
+ char to[MAX_REGISTER_SIZE];
+ convert_typed_floating (valbuf, type, to, builtin_type_ia64_ext);
+ regcache_cooked_write (regcache, IA64_FR8_REGNUM, (void *)to);
+ target_store_registers (IA64_FR8_REGNUM);
}
else
- pfs = read_register (IA64_PFS_REGNUM);
-
- /* Compute the new bsp by *adding* the difference between the
- size of the frame and the size of the locals (both wrt the
- frame that we're going back to). This seems kind of strange,
- especially since it seems like we ought to be subtracting the
- size of the locals... and we should; but the Linux kernel
- wants bsp to be set at the end of all used registers. It's
- likely that this code will need to be revised to accomodate
- other operating systems. */
- bsp = rse_address_add (get_frame_extra_info (frame)->bsp,
- (pfs & 0x7f) - ((pfs >> 7) & 0x7f));
- write_register (IA64_BSP_REGNUM, bsp);
-
- /* FIXME: What becomes of the epilog count in the PFS? */
- cfm = (cfm & ~0xffffffffffffLL) | (pfs & 0xffffffffffffLL);
- write_register (IA64_CFM_REGNUM, cfm);
-
- flush_cached_frames ();
+ regcache_cooked_write (regcache, IA64_GR8_REGNUM, valbuf);
}
static void
@@ -2139,7 +2546,7 @@ process_note_abi_tag_sections (bfd *abfd, asection *sect, void *obj)
{
int os_number = bfd_h_get_32 (abfd, note + 16);
- /* The case numbers are from abi-tags in glibc */
+ /* The case numbers are from abi-tags in glibc. */
switch (os_number)
{
case 0 :
@@ -2183,7 +2590,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
on a SYSV system. (ELFOSABI_NONE is defined to be 0.)
GNU/Linux uses a note section to record OS/ABI info, but
leaves e_ident[EI_OSABI] zero. So we have to check for note
- sections too. */
+ sections too. */
if (os_ident == 0)
{
bfd_map_over_sections (info.abfd,
@@ -2207,10 +2614,6 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
gdbarch = gdbarch_alloc (&info, tdep);
tdep->os_ident = os_ident;
- /* NOTE: cagney/2002-12-06: This can be deleted when this arch is
- ready to unwind the PC first (see frame.c:get_prev_frame()). */
- set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default);
-
/* Set the method of obtaining the sigcontext addresses at which
registers are saved. The method of checking to see if
native_find_global_pointer is nonzero to indicate that we're
@@ -2237,6 +2640,12 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
else
tdep->find_global_pointer = generic_elf_find_global_pointer;
+ /* Define the ia64 floating-point format to gdb. */
+ builtin_type_ia64_ext =
+ init_type (TYPE_CODE_FLT, 128 / 8,
+ 0, "builtin_type_ia64_ext", NULL);
+ TYPE_FLOATFORMAT (builtin_type_ia64_ext) = &floatformat_ia64_ext;
+
set_gdbarch_short_bit (gdbarch, 16);
set_gdbarch_int_bit (gdbarch, 32);
set_gdbarch_long_bit (gdbarch, 64);
@@ -2246,44 +2655,32 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_long_double_bit (gdbarch, 128);
set_gdbarch_ptr_bit (gdbarch, 64);
- set_gdbarch_num_regs (gdbarch, ia64_num_regs);
+ set_gdbarch_num_regs (gdbarch, NUM_IA64_RAW_REGS);
+ set_gdbarch_num_pseudo_regs (gdbarch, LAST_PSEUDO_REGNUM - FIRST_PSEUDO_REGNUM);
set_gdbarch_sp_regnum (gdbarch, sp_regnum);
- set_gdbarch_deprecated_fp_regnum (gdbarch, fp_regnum);
- set_gdbarch_pc_regnum (gdbarch, pc_regnum);
set_gdbarch_fp0_regnum (gdbarch, IA64_FR0_REGNUM);
set_gdbarch_register_name (gdbarch, ia64_register_name);
+ /* FIXME: Following interface should not be needed, however, without it recurse.exp
+ gets a number of extra failures. */
set_gdbarch_deprecated_register_size (gdbarch, 8);
- set_gdbarch_deprecated_register_bytes (gdbarch, ia64_num_regs * 8 + 128*8);
- set_gdbarch_deprecated_register_byte (gdbarch, ia64_register_byte);
- set_gdbarch_deprecated_register_raw_size (gdbarch, ia64_register_raw_size);
- set_gdbarch_deprecated_max_register_raw_size (gdbarch, 16);
- set_gdbarch_deprecated_register_virtual_size (gdbarch, ia64_register_virtual_size);
- set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 16);
- set_gdbarch_deprecated_register_virtual_type (gdbarch, ia64_register_virtual_type);
-
- set_gdbarch_skip_prologue (gdbarch, ia64_skip_prologue);
-
- set_gdbarch_frameless_function_invocation (gdbarch, ia64_frameless_function_invocation);
+ set_gdbarch_register_type (gdbarch, ia64_register_type);
- set_gdbarch_deprecated_saved_pc_after_call (gdbarch, ia64_saved_pc_after_call);
+ set_gdbarch_pseudo_register_read (gdbarch, ia64_pseudo_register_read);
+ set_gdbarch_pseudo_register_write (gdbarch, ia64_pseudo_register_write);
+ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, ia64_dwarf_reg_to_regnum);
+ set_gdbarch_register_reggroup_p (gdbarch, ia64_register_reggroup_p);
+ set_gdbarch_convert_register_p (gdbarch, ia64_convert_register_p);
+ set_gdbarch_register_to_value (gdbarch, ia64_register_to_value);
+ set_gdbarch_value_to_register (gdbarch, ia64_value_to_register);
- set_gdbarch_deprecated_frame_chain (gdbarch, ia64_frame_chain);
- set_gdbarch_deprecated_frame_saved_pc (gdbarch, ia64_frame_saved_pc);
-
- set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, ia64_frame_init_saved_regs);
- set_gdbarch_deprecated_get_saved_register (gdbarch, ia64_get_saved_register);
-
- set_gdbarch_deprecated_register_convertible (gdbarch, ia64_register_convertible);
- set_gdbarch_deprecated_register_convert_to_virtual (gdbarch, ia64_register_convert_to_virtual);
- set_gdbarch_deprecated_register_convert_to_raw (gdbarch, ia64_register_convert_to_raw);
+ set_gdbarch_skip_prologue (gdbarch, ia64_skip_prologue);
set_gdbarch_use_struct_convention (gdbarch, ia64_use_struct_convention);
- set_gdbarch_deprecated_extract_return_value (gdbarch, ia64_extract_return_value);
+ set_gdbarch_extract_return_value (gdbarch, ia64_extract_return_value);
- set_gdbarch_deprecated_store_struct_return (gdbarch, ia64_store_struct_return);
- set_gdbarch_deprecated_store_return_value (gdbarch, ia64_store_return_value);
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch, ia64_extract_struct_value_address);
+ set_gdbarch_store_return_value (gdbarch, ia64_store_return_value);
+ set_gdbarch_extract_struct_value_address (gdbarch, ia64_extract_struct_value_address);
set_gdbarch_memory_insert_breakpoint (gdbarch, ia64_memory_insert_breakpoint);
set_gdbarch_memory_remove_breakpoint (gdbarch, ia64_memory_remove_breakpoint);
@@ -2293,26 +2690,17 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Settings for calling functions in the inferior. */
set_gdbarch_push_dummy_call (gdbarch, ia64_push_dummy_call);
- set_gdbarch_deprecated_pop_frame (gdbarch, ia64_pop_frame);
+ set_gdbarch_frame_align (gdbarch, ia64_frame_align);
+ set_gdbarch_unwind_dummy_id (gdbarch, ia64_unwind_dummy_id);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, ia64_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (ia64_call_dummy_words));
- set_gdbarch_deprecated_init_extra_frame_info (gdbarch, ia64_init_extra_frame_info);
- set_gdbarch_deprecated_frame_args_address (gdbarch, ia64_frame_args_address);
- set_gdbarch_deprecated_frame_locals_address (gdbarch, ia64_frame_locals_address);
-
- /* We won't necessarily have a frame pointer and even if we do, it
- winds up being extraordinarly messy when attempting to find the
- frame chain. So for the purposes of creating frames (which is
- all deprecated_read_fp() is used for), simply use the stack
- pointer value instead. */
- set_gdbarch_deprecated_target_read_fp (gdbarch, ia64_read_fp);
+ set_gdbarch_unwind_pc (gdbarch, ia64_unwind_pc);
+ frame_unwind_append_sniffer (gdbarch, ia64_sigtramp_frame_sniffer);
+ frame_unwind_append_sniffer (gdbarch, ia64_frame_sniffer);
+ frame_base_set_default (gdbarch, &ia64_frame_base);
/* Settings that should be unnecessary. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
-
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_frame_args_skip (gdbarch, 0);
@@ -2321,6 +2709,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
gdbarch, ia64_remote_translate_xfer_address);
set_gdbarch_print_insn (gdbarch, ia64_print_insn);
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch, ia64_convert_from_func_ptr_addr);
return gdbarch;
}
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 4fd97ae5652..926eaf324c9 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -84,8 +84,8 @@ static struct value *
value_arg_coerce (struct value *arg, struct type *param_type,
int is_prototyped)
{
- register struct type *arg_type = check_typedef (VALUE_TYPE (arg));
- register struct type *type
+ struct type *arg_type = check_typedef (VALUE_TYPE (arg));
+ struct type *type
= param_type ? check_typedef (param_type) : arg_type;
switch (TYPE_CODE (type))
@@ -161,8 +161,8 @@ value_arg_coerce (struct value *arg, struct type *param_type,
CORE_ADDR
find_function_addr (struct value *function, struct type **retval_type)
{
- register struct type *ftype = check_typedef (VALUE_TYPE (function));
- register enum type_code code = TYPE_CODE (ftype);
+ struct type *ftype = check_typedef (VALUE_TYPE (function));
+ enum type_code code = TYPE_CODE (ftype);
struct type *value_type;
CORE_ADDR funaddr;
@@ -375,7 +375,7 @@ push_dummy_code (struct gdbarch *gdbarch,
struct value *
call_function_by_hand (struct value *function, int nargs, struct value **args)
{
- register CORE_ADDR sp;
+ CORE_ADDR sp;
CORE_ADDR dummy_addr;
struct type *value_type;
unsigned char struct_return;
@@ -440,6 +440,18 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
CORE_ADDR old_sp = read_sp ();
if (gdbarch_frame_align_p (current_gdbarch))
{
+ sp = gdbarch_frame_align (current_gdbarch, old_sp);
+ /* NOTE: cagney/2003-08-13: Skip the "red zone". For some
+ ABIs, a function can use memory beyond the inner most stack
+ address. AMD64 called that region the "red zone". Skip at
+ least the "red zone" size before allocating any space on
+ the stack. */
+ if (INNER_THAN (1, 2))
+ sp -= gdbarch_frame_red_zone_size (current_gdbarch);
+ else
+ sp += gdbarch_frame_red_zone_size (current_gdbarch);
+ /* Still aligned? */
+ gdb_assert (sp == gdbarch_frame_align (current_gdbarch, sp));
/* NOTE: cagney/2002-09-18:
On a RISC architecture, a void parameterless generic dummy
@@ -460,7 +472,6 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
stack. That way, two dummy frames can never be identical.
It does burn a few bytes of stack but that is a small price
to pay :-). */
- sp = gdbarch_frame_align (current_gdbarch, old_sp);
if (sp == old_sp)
{
if (INNER_THAN (1, 2))
@@ -476,12 +487,16 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
else
/* FIXME: cagney/2002-09-18: Hey, you loose!
- Who knows how badly aligned the SP is! Further, per comment
- above, if the generic dummy frame ends up empty (because
- nothing is pushed) GDB won't be able to correctly perform
- back traces. If a target is having trouble with backtraces,
- first thing to do is add FRAME_ALIGN() to the architecture
- vector. If that fails, try unwind_dummy_id(). */
+ Who knows how badly aligned the SP is!
+
+ If the generic dummy frame ends up empty (because nothing is
+ pushed) GDB won't be able to correctly perform back traces.
+ If a target is having trouble with backtraces, first thing to
+ do is add FRAME_ALIGN() to the architecture vector. If that
+ fails, try unwind_dummy_id().
+
+ If the ABI specifies a "Red Zone" (see the doco) the code
+ below will quietly trash it. */
sp = old_sp;
}
@@ -497,8 +512,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
/* Are we returning a value using a structure return or a normal
value return? */
- struct_return = using_struct_return (function, funaddr, value_type,
- using_gcc);
+ struct_return = using_struct_return (value_type, using_gcc);
/* Determine the location of the breakpoint (and possibly other
stuff) that the called function will return to. The SPARC, for a
@@ -542,11 +556,39 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
value_type, using_gcc);
}
real_pc = funaddr;
- dummy_addr = CALL_DUMMY_ADDRESS ();
+ dummy_addr = entry_point_address ();
+ if (DEPRECATED_CALL_DUMMY_ADDRESS_P ())
+ /* Override it. */
+ dummy_addr = DEPRECATED_CALL_DUMMY_ADDRESS ();
+ /* Make certain that the address points at real code, and not a
+ function descriptor. */
+ dummy_addr = CONVERT_FROM_FUNC_PTR_ADDR (dummy_addr);
/* A call dummy always consists of just a single breakpoint, so
it's address is the same as the address of the dummy. */
bp_addr = dummy_addr;
break;
+ case AT_SYMBOL:
+ /* Some executables define a symbol __CALL_DUMMY_ADDRESS whose
+ address is the location where the breakpoint should be
+ placed. Once all targets are using the overhauled frame code
+ this can be deleted - ON_STACK is a better option. */
+ {
+ struct minimal_symbol *sym;
+
+ sym = lookup_minimal_symbol ("__CALL_DUMMY_ADDRESS", NULL, NULL);
+ real_pc = funaddr;
+ if (sym)
+ dummy_addr = SYMBOL_VALUE_ADDRESS (sym);
+ else
+ dummy_addr = entry_point_address ();
+ /* Make certain that the address points at real code, and not
+ a function descriptor. */
+ dummy_addr = CONVERT_FROM_FUNC_PTR_ADDR (dummy_addr);
+ /* A call dummy always consists of just a single breakpoint,
+ so it's address is the same as the address of the dummy. */
+ bp_addr = dummy_addr;
+ break;
+ }
default:
internal_error (__FILE__, __LINE__, "bad switch");
}
@@ -621,7 +663,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
}
}
- if (REG_STRUCT_HAS_ADDR_P ())
+ if (DEPRECATED_REG_STRUCT_HAS_ADDR_P ())
{
int i;
/* This is a machine like the sparc, where we may need to pass a
@@ -638,7 +680,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
|| (TYPE_CODE (arg_type) == TYPE_CODE_FLT
&& TYPE_LENGTH (arg_type) > 8)
)
- && REG_STRUCT_HAS_ADDR (using_gcc, arg_type))
+ && DEPRECATED_REG_STRUCT_HAS_ADDR (using_gcc, arg_type))
{
CORE_ADDR addr;
int len; /* = TYPE_LENGTH (arg_type); */
@@ -646,12 +688,12 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
arg_type = check_typedef (VALUE_ENCLOSING_TYPE (args[i]));
len = TYPE_LENGTH (arg_type);
- if (STACK_ALIGN_P ())
+ if (DEPRECATED_STACK_ALIGN_P ())
/* MVS 11/22/96: I think at least some of this
stack_align code is really broken. Better to let
PUSH_ARGUMENTS adjust the stack in a target-defined
manner. */
- aligned_len = STACK_ALIGN (len);
+ aligned_len = DEPRECATED_STACK_ALIGN (len);
else
aligned_len = len;
if (INNER_THAN (1, 2))
@@ -689,10 +731,10 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
if (struct_return)
{
int len = TYPE_LENGTH (value_type);
- if (STACK_ALIGN_P ())
+ if (DEPRECATED_STACK_ALIGN_P ())
/* NOTE: cagney/2003-03-22: Should rely on frame align, rather
than stack align to force the alignment of the stack. */
- len = STACK_ALIGN (len);
+ len = DEPRECATED_STACK_ALIGN (len);
if (INNER_THAN (1, 2))
{
/* Stack grows downward. Align STRUCT_ADDR and SP after
@@ -717,8 +759,8 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
/* elz: on HPPA no need for this extra alignment, maybe it is needed
on other architectures. This is because all the alignment is
- taken care of in the above code (ifdef REG_STRUCT_HAS_ADDR) and
- in hppa_push_arguments */
+ taken care of in the above code (ifdef DEPRECATED_REG_STRUCT_HAS_ADDR)
+ and in hppa_push_arguments */
/* NOTE: cagney/2003-03-24: The below code is very broken. Given an
odd sized parameter the below will mis-align the stack. As was
suggested back in '96, better to let PUSH_ARGUMENTS handle it. */
@@ -727,7 +769,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
/* MVS 11/22/96: I think at least some of this stack_align code
is really broken. Better to let push_dummy_call() adjust the
stack in a target-defined manner. */
- if (STACK_ALIGN_P () && INNER_THAN (1, 2))
+ if (DEPRECATED_STACK_ALIGN_P () && INNER_THAN (1, 2))
{
/* If stack grows down, we must leave a hole at the top. */
int len = 0;
@@ -736,7 +778,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
len += TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i]));
if (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ())
len += DEPRECATED_CALL_DUMMY_STACK_ADJUST;
- sp -= STACK_ALIGN (len) - len;
+ sp -= DEPRECATED_STACK_ALIGN (len) - len;
}
}
@@ -781,13 +823,13 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
handled any alignment issues, the code below is entirely
redundant. */
if (!gdbarch_push_dummy_call_p (current_gdbarch)
- && STACK_ALIGN_P () && !INNER_THAN (1, 2))
+ && DEPRECATED_STACK_ALIGN_P () && !INNER_THAN (1, 2))
{
/* If stack grows up, we must leave a hole at the bottom, note
that sp already has been advanced for the arguments! */
if (DEPRECATED_CALL_DUMMY_STACK_ADJUST_P ())
sp += DEPRECATED_CALL_DUMMY_STACK_ADJUST;
- sp = STACK_ALIGN (sp);
+ sp = DEPRECATED_STACK_ALIGN (sp);
}
/* XXX This seems wrong. For stacks that grow down we shouldn't do
@@ -920,7 +962,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
if (stopped_by_random_signal || !stop_stack_dummy)
{
/* Find the name of the function we're about to complain about. */
- char *name = NULL;
+ const char *name = NULL;
{
struct symbol *symbol = find_pc_function (funaddr);
if (symbol)
@@ -932,17 +974,17 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
if (msymbol)
name = SYMBOL_PRINT_NAME (msymbol);
}
+ if (name == NULL)
+ {
+ /* Can't use a cleanup here. It is discarded, instead use
+ an alloca. */
+ char *tmp = xstrprintf ("at %s", local_hex_string (funaddr));
+ char *a = alloca (strlen (tmp) + 1);
+ strcpy (a, tmp);
+ xfree (tmp);
+ name = a;
+ }
}
- if (name == NULL)
- {
- /* NOTE: cagney/2003-04-23: Don't blame me. This code dates
- back to 1993-07-08, I simply moved it. */
- char format[80];
- sprintf (format, "at %s", local_hex_format ());
- name = alloca (80);
- /* FIXME-32x64: assumes funaddr fits in a long. */
- sprintf (name, format, (unsigned long) funaddr);
- }
if (stopped_by_random_signal)
{
/* We stopped inside the FUNCTION because of a random
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 6831d6be8f9..eee0b7368c6 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -584,7 +584,7 @@ disable_longjmp_breakpoint_cleanup (void *ignore)
static void
step_1 (int skip_subroutines, int single_inst, char *count_string)
{
- register int count = 1;
+ int count = 1;
struct frame_info *frame;
struct cleanup *cleanups = 0;
int async_exec = 0;
@@ -806,7 +806,7 @@ which has no line number information.\n", name);
static void
jump_command (char *arg, int from_tty)
{
- register CORE_ADDR addr;
+ CORE_ADDR addr;
struct symtabs_and_lines sals;
struct symtab_and_line sal;
struct symbol *fn;
@@ -1121,7 +1121,7 @@ print_return_value (int structure_return, struct type *value_type)
void
finish_command_continuation (struct continuation_arg *arg)
{
- register struct symbol *function;
+ struct symbol *function;
struct breakpoint *breakpoint;
struct cleanup *cleanups;
@@ -1149,9 +1149,7 @@ finish_command_continuation (struct continuation_arg *arg)
funcaddr = BLOCK_START (SYMBOL_BLOCK_VALUE (function));
- struct_return = using_struct_return (value_of_variable (function, NULL),
- funcaddr,
- check_typedef (value_type),
+ struct_return = using_struct_return (check_typedef (value_type),
BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function)));
print_return_value (struct_return, value_type);
@@ -1166,8 +1164,8 @@ static void
finish_command (char *arg, int from_tty)
{
struct symtab_and_line sal;
- register struct frame_info *frame;
- register struct symbol *function;
+ struct frame_info *frame;
+ struct symbol *function;
struct breakpoint *breakpoint;
struct cleanup *old_chain;
struct continuation_arg *arg1, *arg2, *arg3;
@@ -1277,9 +1275,7 @@ finish_command (char *arg, int from_tty)
funcaddr = BLOCK_START (SYMBOL_BLOCK_VALUE (function));
struct_return =
- using_struct_return (value_of_variable (function, NULL),
- funcaddr,
- check_typedef (value_type),
+ using_struct_return (check_typedef (value_type),
BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function)));
print_return_value (struct_return, value_type);
@@ -1341,7 +1337,7 @@ environment_info (char *var, int from_tty)
{
if (var)
{
- register char *val = get_in_environ (inferior_environ, var);
+ char *val = get_in_environ (inferior_environ, var);
if (val)
{
puts_filtered (var);
@@ -1358,7 +1354,7 @@ environment_info (char *var, int from_tty)
}
else
{
- register char **vector = environ_vector (inferior_environ);
+ char **vector = environ_vector (inferior_environ);
while (*vector)
{
puts_filtered (*vector++);
@@ -1370,7 +1366,7 @@ environment_info (char *var, int from_tty)
static void
set_environment_command (char *arg, int from_tty)
{
- register char *p, *val, *var;
+ char *p, *val, *var;
int nullset = 0;
if (arg == 0)
@@ -1608,7 +1604,7 @@ void
registers_info (char *addr_exp, int fpregs)
{
int regnum, numregs;
- register char *end;
+ char *end;
if (!target_has_registers)
error ("The program has no registers now.");
diff --git a/gdb/inferior.h b/gdb/inferior.h
index ed49d2315d9..60191f2b98f 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -438,6 +438,7 @@ extern int attach_flag;
/* Possible values for CALL_DUMMY_LOCATION. */
#define ON_STACK 1
#define AT_ENTRY_POINT 4
+#define AT_SYMBOL 5
/* FIXME: cagney/2000-04-17: gdbarch should manage this. The default
shouldn't be necessary. */
diff --git a/gdb/inflow.c b/gdb/inflow.c
index 2a41f57982f..b860af70a83 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -515,7 +515,7 @@ new_tty_prefork (char *ttyname)
void
new_tty (void)
{
- register int tty;
+ int tty;
if (inferior_thisrun_terminal == 0)
return;
diff --git a/gdb/infptrace.c b/gdb/infptrace.c
index 6147cbe8964..1286b752fc9 100644
--- a/gdb/infptrace.c
+++ b/gdb/infptrace.c
@@ -208,6 +208,7 @@ ptrace_wait (ptid_t ptid, int *status)
return wstate;
}
+#ifndef KILL_INFERIOR
void
kill_inferior (void)
{
@@ -229,6 +230,7 @@ kill_inferior (void)
ptrace_wait (null_ptid, &status);
target_mourn_inferior ();
}
+#endif /* KILL_INFERIOR */
#ifndef CHILD_RESUME
@@ -357,7 +359,7 @@ fetch_register (int regno)
/* This isn't really an address. But ptrace thinks of it as one. */
CORE_ADDR regaddr;
char mess[128]; /* For messages */
- register int i;
+ int i;
unsigned int offset; /* Offset of registers within the u area. */
char buf[MAX_REGISTER_SIZE];
int tid;
@@ -421,7 +423,7 @@ store_register (int regno)
/* This isn't really an address. But ptrace thinks of it as one. */
CORE_ADDR regaddr;
char mess[128]; /* For messages */
- register int i;
+ int i;
unsigned int offset; /* Offset of registers within the u area. */
int tid;
char buf[MAX_REGISTER_SIZE];
diff --git a/gdb/infrun.c b/gdb/infrun.c
index b2e371eebb0..f4ab6320841 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2446,9 +2446,9 @@ process_event_stop_test:
return;
}
- if (stop_pc == ecs->stop_func_start /* Quick test */
- || (in_prologue (stop_pc, ecs->stop_func_start) &&
- !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
+ if (((stop_pc == ecs->stop_func_start /* Quick test */
+ || in_prologue (stop_pc, ecs->stop_func_start))
+ && !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
|| IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name)
|| ecs->stop_func_name == 0)
{
@@ -3054,14 +3054,22 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
void
normal_stop (void)
{
+ struct target_waitstatus last;
+ ptid_t last_ptid;
+
+ get_last_target_status (&last_ptid, &last);
+
/* As with the notification of thread events, we want to delay
notifying the user that we've switched thread context until
the inferior actually stops.
- (Note that there's no point in saying anything if the inferior
- has exited!) */
+ There's no point in saying anything if the inferior has exited.
+ Note that SIGNALLED here means "exited with a signal", not
+ "received a signal". */
if (!ptid_equal (previous_inferior_ptid, inferior_ptid)
- && target_has_execution)
+ && target_has_execution
+ && last.kind != TARGET_WAITKIND_SIGNALLED
+ && last.kind != TARGET_WAITKIND_EXITED)
{
target_terminal_ours_for_output ();
printf_filtered ("[Switching to %s]\n",
@@ -3907,8 +3915,8 @@ build_infrun (void)
void
_initialize_infrun (void)
{
- register int i;
- register int numsigs;
+ int i;
+ int numsigs;
struct cmd_list_element *c;
register_gdbarch_swap (&stop_registers, sizeof (stop_registers), NULL);
diff --git a/gdb/infttrace.c b/gdb/infttrace.c
index e0238e8bc55..3f76edbbd1a 100644
--- a/gdb/infttrace.c
+++ b/gdb/infttrace.c
@@ -4836,18 +4836,18 @@ child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct mem_attrib *attrib,
struct target_ops *target)
{
- register int i;
+ int i;
/* Round starting address down to longword boundary. */
- register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (TTRACE_XFER_TYPE);
+ CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (TTRACE_XFER_TYPE);
/* Round ending address up; get number of longwords that makes. */
- register int count
+ int count
= (((memaddr + len) - addr) + sizeof (TTRACE_XFER_TYPE) - 1)
/ sizeof (TTRACE_XFER_TYPE);
/* Allocate buffer of that many longwords. */
/* FIXME (alloca): This code, cloned from infptrace.c, is unsafe
because it uses alloca to allocate a buffer of arbitrary size.
For very large xfers, this could crash GDB's stack. */
- register TTRACE_XFER_TYPE *buffer
+ TTRACE_XFER_TYPE *buffer
= (TTRACE_XFER_TYPE *) alloca (count * sizeof (TTRACE_XFER_TYPE));
if (write)
diff --git a/gdb/interps.c b/gdb/interps.c
index 6df1d4bf17f..82e9af690b1 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -183,7 +183,7 @@ interp_set (struct interp *interp)
if (interp->procs->resume_proc != NULL
&& (!interp->procs->resume_proc (interp->data)))
{
- if (!interp_set (old_interp))
+ if (old_interp == NULL || !interp_set (old_interp))
internal_error (__FILE__, __LINE__,
"Failed to initialize new interp \"%s\" %s",
interp->name, "and could not restore old interp!\n");
diff --git a/gdb/interps.h b/gdb/interps.h
index 74008d6c21a..d24cf6a46d7 100644
--- a/gdb/interps.h
+++ b/gdb/interps.h
@@ -68,6 +68,8 @@ extern void clear_interpreter_hooks (void);
/* well-known interpreters */
#define INTERP_CONSOLE "console"
#define INTERP_MI1 "mi1"
+#define INTERP_MI2 "mi2"
+#define INTERP_MI3 "mi3"
#define INTERP_MI "mi"
#endif
diff --git a/gdb/irix4-nat.c b/gdb/irix4-nat.c
deleted file mode 100644
index 90229bbe014..00000000000
--- a/gdb/irix4-nat.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* Native support for the SGI Iris running IRIX version 4, for GDB.
- Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1996, 1999, 2000,
- 2001 Free Software Foundation, Inc.
- Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
- and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
- Implemented for Irix 4.x by Garrett A. Wollman.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include "defs.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "regcache.h"
-
-#include <sys/time.h>
-#include <sys/procfs.h>
-#include <setjmp.h> /* For JB_XXX. */
-
-/* Prototypes for supply_gregset etc. */
-#include "gregset.h"
-
-/* Size of elements in jmpbuf */
-
-#define JB_ELEMENT_SIZE 4
-
-typedef unsigned int greg_t; /* why isn't this defined? */
-
-static void fetch_core_registers (char *, unsigned int, int, CORE_ADDR);
-
-/*
- * See the comment in m68k-tdep.c regarding the utility of these functions.
- */
-
-void
-supply_gregset (gregset_t *gregsetp)
-{
- register int regi;
- register greg_t *regp = (greg_t *) (gregsetp->gp_regs);
- char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
-
- /* FIXME: somewhere, there should be a #define for the meaning
- of this magic number 32; we should use that. */
- for (regi = 0; regi < 32; regi++)
- supply_register (regi, (char *) (regp + regi));
-
- supply_register (PC_REGNUM, (char *) &(gregsetp->gp_pc));
- supply_register (HI_REGNUM, (char *) &(gregsetp->gp_mdhi));
- supply_register (LO_REGNUM, (char *) &(gregsetp->gp_mdlo));
- supply_register (CAUSE_REGNUM, (char *) &(gregsetp->gp_cause));
-
- /* Fill inaccessible registers with zero. */
- supply_register (BADVADDR_REGNUM, zerobuf);
-}
-
-void
-fill_gregset (gregset_t *gregsetp, int regno)
-{
- int regi;
- register greg_t *regp = (greg_t *) (gregsetp->gp_regs);
-
- /* same FIXME as above wrt 32 */
- for (regi = 0; regi < 32; regi++)
- if ((regno == -1) || (regno == regi))
- *(regp + regi) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (regi)];
-
- if ((regno == -1) || (regno == PC_REGNUM))
- gregsetp->gp_pc = *(greg_t *) & deprecated_registers[REGISTER_BYTE (PC_REGNUM)];
-
- if ((regno == -1) || (regno == CAUSE_REGNUM))
- gregsetp->gp_cause = *(greg_t *) & deprecated_registers[REGISTER_BYTE (CAUSE_REGNUM)];
-
- if ((regno == -1) || (regno == HI_REGNUM))
- gregsetp->gp_mdhi = *(greg_t *) & deprecated_registers[REGISTER_BYTE (HI_REGNUM)];
-
- if ((regno == -1) || (regno == LO_REGNUM))
- gregsetp->gp_mdlo = *(greg_t *) & deprecated_registers[REGISTER_BYTE (LO_REGNUM)];
-}
-
-/*
- * Now we do the same thing for floating-point registers.
- * We don't bother to condition on FP0_REGNUM since any
- * reasonable MIPS configuration has an R3010 in it.
- *
- * Again, see the comments in m68k-tdep.c.
- */
-
-void
-supply_fpregset (fpregset_t *fpregsetp)
-{
- register int regi;
- char zerobuf[MAX_REGISTER_SIZE];
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
-
- for (regi = 0; regi < 32; regi++)
- supply_register (FP0_REGNUM + regi,
- (char *) &fpregsetp->fp_r.fp_regs[regi]);
-
- supply_register (FCRCS_REGNUM, (char *) &fpregsetp->fp_csr);
-
- /* FIXME: how can we supply FCRIR_REGNUM? SGI doesn't tell us. */
- supply_register (FCRIR_REGNUM, zerobuf);
-}
-
-void
-fill_fpregset (fpregset_t *fpregsetp, int regno)
-{
- int regi;
- char *from, *to;
-
- for (regi = FP0_REGNUM; regi < FP0_REGNUM + 32; regi++)
- {
- if ((regno == -1) || (regno == regi))
- {
- from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
- to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
- memcpy (to, from, REGISTER_RAW_SIZE (regi));
- }
- }
-
- if ((regno == -1) || (regno == FCRCS_REGNUM))
- fpregsetp->fp_csr = *(unsigned *) &deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)];
-}
-
-
-/* Figure out where the longjmp will land.
- We expect the first arg to be a pointer to the jmp_buf structure from which
- we extract the pc (JB_PC) that we will land at. The pc is copied into PC.
- This routine returns true on success. */
-
-int
-get_longjmp_target (CORE_ADDR *pc)
-{
- char *buf;
- CORE_ADDR jb_addr;
-
- buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
- jb_addr = read_register (A0_REGNUM);
-
- if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
- TARGET_PTR_BIT / TARGET_CHAR_BIT))
- return 0;
-
- *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
-
- return 1;
-}
-
-/* Provide registers to GDB from a core file.
-
- CORE_REG_SECT points to an array of bytes, which were obtained from
- a core file which BFD thinks might contain register contents.
- CORE_REG_SIZE is its size.
-
- Normally, WHICH says which register set corelow suspects this is:
- 0 --- the general-purpose register set
- 2 --- the floating-point register set
- However, for Irix 4, WHICH isn't used.
-
- REG_ADDR is also unused. */
-
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
- int which, CORE_ADDR reg_addr)
-{
- if (core_reg_size != DEPRECATED_REGISTER_BYTES)
- {
- warning ("wrong size gregset struct in core file");
- return;
- }
-
- memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size);
-}
-
-
-/* Register that we are able to handle irix4 core file formats.
- FIXME: is this really bfd_target_unknown_flavour? */
-
-static struct core_fns irix4_core_fns =
-{
- bfd_target_unknown_flavour, /* core_flavour */
- default_check_format, /* check_format */
- default_core_sniffer, /* core_sniffer */
- fetch_core_registers, /* core_read_registers */
- NULL /* next */
-};
-
-void
-_initialize_core_irix4 (void)
-{
- add_core_fns (&irix4_core_fns);
-}
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c
index bb90da51f88..f7c20343f0c 100644
--- a/gdb/irix5-nat.c
+++ b/gdb/irix5-nat.c
@@ -53,8 +53,8 @@ static void fetch_core_registers (char *, unsigned int, int, CORE_ADDR);
void
supply_gregset (gregset_t *gregsetp)
{
- register int regi;
- register greg_t *regp = &(*gregsetp)[0];
+ int regi;
+ greg_t *regp = &(*gregsetp)[0];
int gregoff = sizeof (greg_t) - MIPS_REGSIZE;
static char zerobuf[32] = {0};
@@ -74,7 +74,7 @@ void
fill_gregset (gregset_t *gregsetp, int regno)
{
int regi;
- register greg_t *regp = &(*gregsetp)[0];
+ greg_t *regp = &(*gregsetp)[0];
/* Under Irix6, if GDB is built with N32 ABI and is debugging an O32
executable, we have to sign extend the registers to 64 bits before
@@ -83,27 +83,27 @@ fill_gregset (gregset_t *gregsetp, int regno)
for (regi = 0; regi <= CTX_RA; regi++)
if ((regno == -1) || (regno == regi))
*(regp + regi) =
- extract_signed_integer (&deprecated_registers[REGISTER_BYTE (regi)],
+ extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)],
REGISTER_RAW_SIZE (regi));
if ((regno == -1) || (regno == PC_REGNUM))
*(regp + CTX_EPC) =
- extract_signed_integer (&deprecated_registers[REGISTER_BYTE (PC_REGNUM)],
+ extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)],
REGISTER_RAW_SIZE (PC_REGNUM));
if ((regno == -1) || (regno == CAUSE_REGNUM))
*(regp + CTX_CAUSE) =
- extract_signed_integer (&deprecated_registers[REGISTER_BYTE (CAUSE_REGNUM)],
+ extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (CAUSE_REGNUM)],
REGISTER_RAW_SIZE (CAUSE_REGNUM));
if ((regno == -1) || (regno == HI_REGNUM))
*(regp + CTX_MDHI) =
- extract_signed_integer (&deprecated_registers[REGISTER_BYTE (HI_REGNUM)],
+ extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (HI_REGNUM)],
REGISTER_RAW_SIZE (HI_REGNUM));
if ((regno == -1) || (regno == LO_REGNUM))
*(regp + CTX_MDLO) =
- extract_signed_integer (&deprecated_registers[REGISTER_BYTE (LO_REGNUM)],
+ extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (LO_REGNUM)],
REGISTER_RAW_SIZE (LO_REGNUM));
}
@@ -118,7 +118,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
void
supply_fpregset (fpregset_t *fpregsetp)
{
- register int regi;
+ int regi;
static char zerobuf[32] = {0};
/* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
@@ -145,14 +145,14 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
}
if ((regno == -1) || (regno == FCRCS_REGNUM))
- fpregsetp->fp_csr = *(unsigned *) &deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)];
+ fpregsetp->fp_csr = *(unsigned *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (FCRCS_REGNUM)];
}
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index 82ebadcb3cd..207051e9419 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -851,8 +851,8 @@ java_emit_char (int c, struct ui_file *stream, int quoter)
}
static struct value *
-evaluate_subexp_java (struct type *expect_type, register struct expression *exp,
- register int *pos, enum noside noside)
+evaluate_subexp_java (struct type *expect_type, struct expression *exp,
+ int *pos, enum noside noside)
{
int pc = *pos;
int i;
diff --git a/gdb/jv-typeprint.c b/gdb/jv-typeprint.c
index 4aded1f7bfd..d982c8f7e69 100644
--- a/gdb/jv-typeprint.c
+++ b/gdb/jv-typeprint.c
@@ -86,8 +86,8 @@ static void
java_type_print_base (struct type *type, struct ui_file *stream, int show,
int level)
{
- register int i;
- register int len;
+ int i;
+ int len;
char *mangled_name;
char *demangled_name;
QUIT;
diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c
index 656e33bcbb3..f7869cb4ef3 100644
--- a/gdb/jv-valprint.c
+++ b/gdb/jv-valprint.c
@@ -457,7 +457,7 @@ java_val_print (struct type *type, char *valaddr, int embedded_offset,
CORE_ADDR address, struct ui_file *stream, int format,
int deref_ref, int recurse, enum val_prettyprint pretty)
{
- register unsigned int i = 0; /* Number of characters printed */
+ unsigned int i = 0; /* Number of characters printed */
struct type *target_type;
CORE_ADDR addr;
diff --git a/gdb/language.c b/gdb/language.c
index 62711304110..bba7ebe60e8 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -151,7 +151,6 @@ static char *case_sensitive;
char lang_frame_mismatch_warn[] =
"Warning: the current language does not match this frame.";
-
/* This page contains the functions corresponding to GDB commands
and their helpers. */
@@ -987,210 +986,10 @@ value_true (struct value *val)
return !value_logical_not (val);
}
-/* Returns non-zero if the operator OP is defined on
- the values ARG1 and ARG2. */
-
-#if 0 /* Currently unused */
-
-void
-binop_type_check (struct value *arg1, struct value *arg2, int op)
-{
- struct type *t1, *t2;
-
- /* If we're not checking types, always return success. */
- if (!STRICT_TYPE)
- return;
-
- t1 = VALUE_TYPE (arg1);
- if (arg2 != NULL)
- t2 = VALUE_TYPE (arg2);
- else
- t2 = NULL;
-
- switch (op)
- {
- case BINOP_ADD:
- case BINOP_SUB:
- if ((numeric_type (t1) && pointer_type (t2)) ||
- (pointer_type (t1) && numeric_type (t2)))
- {
- warning ("combining pointer and integer.\n");
- break;
- }
- case BINOP_MUL:
- case BINOP_LSH:
- case BINOP_RSH:
- if (!numeric_type (t1) || !numeric_type (t2))
- type_op_error ("Arguments to %s must be numbers.", op);
- else if (!same_type (t1, t2))
- type_op_error ("Arguments to %s must be of the same type.", op);
- break;
-
- case BINOP_LOGICAL_AND:
- case BINOP_LOGICAL_OR:
- if (!boolean_type (t1) || !boolean_type (t2))
- type_op_error ("Arguments to %s must be of boolean type.", op);
- break;
-
- case BINOP_EQUAL:
- if ((pointer_type (t1) && !(pointer_type (t2) || integral_type (t2))) ||
- (pointer_type (t2) && !(pointer_type (t1) || integral_type (t1))))
- type_op_error ("A pointer can only be compared to an integer or pointer.", op);
- else if ((pointer_type (t1) && integral_type (t2)) ||
- (integral_type (t1) && pointer_type (t2)))
- {
- warning ("combining integer and pointer.\n");
- break;
- }
- else if (!simple_type (t1) || !simple_type (t2))
- type_op_error ("Arguments to %s must be of simple type.", op);
- else if (!same_type (t1, t2))
- type_op_error ("Arguments to %s must be of the same type.", op);
- break;
-
- case BINOP_REM:
- case BINOP_MOD:
- if (!integral_type (t1) || !integral_type (t2))
- type_op_error ("Arguments to %s must be of integral type.", op);
- break;
-
- case BINOP_LESS:
- case BINOP_GTR:
- case BINOP_LEQ:
- case BINOP_GEQ:
- if (!ordered_type (t1) || !ordered_type (t2))
- type_op_error ("Arguments to %s must be of ordered type.", op);
- else if (!same_type (t1, t2))
- type_op_error ("Arguments to %s must be of the same type.", op);
- break;
-
- case BINOP_ASSIGN:
- if (pointer_type (t1) && !integral_type (t2))
- type_op_error ("A pointer can only be assigned an integer.", op);
- else if (pointer_type (t1) && integral_type (t2))
- {
- warning ("combining integer and pointer.");
- break;
- }
- else if (!simple_type (t1) || !simple_type (t2))
- type_op_error ("Arguments to %s must be of simple type.", op);
- else if (!same_type (t1, t2))
- type_op_error ("Arguments to %s must be of the same type.", op);
- break;
-
- case BINOP_CONCAT:
- /* FIXME: Needs to handle bitstrings as well. */
- if (!(string_type (t1) || character_type (t1) || integral_type (t1))
- || !(string_type (t2) || character_type (t2) || integral_type (t2)))
- type_op_error ("Arguments to %s must be strings or characters.", op);
- break;
-
- /* Unary checks -- arg2 is null */
-
- case UNOP_LOGICAL_NOT:
- if (!boolean_type (t1))
- type_op_error ("Argument to %s must be of boolean type.", op);
- break;
-
- case UNOP_PLUS:
- case UNOP_NEG:
- if (!numeric_type (t1))
- type_op_error ("Argument to %s must be of numeric type.", op);
- break;
-
- case UNOP_IND:
- if (integral_type (t1))
- {
- warning ("combining pointer and integer.\n");
- break;
- }
- else if (!pointer_type (t1))
- type_op_error ("Argument to %s must be a pointer.", op);
- break;
-
- case UNOP_PREINCREMENT:
- case UNOP_POSTINCREMENT:
- case UNOP_PREDECREMENT:
- case UNOP_POSTDECREMENT:
- if (!ordered_type (t1))
- type_op_error ("Argument to %s must be of an ordered type.", op);
- break;
-
- default:
- /* Ok. The following operators have different meanings in
- different languages. */
- switch (current_language->la_language)
- {
-#ifdef _LANG_c
- case language_c:
- case language_cplus:
- case language_objc:
- switch (op)
- {
- case BINOP_DIV:
- if (!numeric_type (t1) || !numeric_type (t2))
- type_op_error ("Arguments to %s must be numbers.", op);
- break;
- }
- break;
-#endif
-
-#ifdef _LANG_m2
- case language_m2:
- switch (op)
- {
- case BINOP_DIV:
- if (!float_type (t1) || !float_type (t2))
- type_op_error ("Arguments to %s must be floating point numbers.", op);
- break;
- case BINOP_INTDIV:
- if (!integral_type (t1) || !integral_type (t2))
- type_op_error ("Arguments to %s must be of integral type.", op);
- break;
- }
-#endif
-
-#ifdef _LANG_pascal
- case language_pascal:
- switch(op)
- {
- case BINOP_DIV:
- if (!float_type(t1) && !float_type(t2))
- type_op_error ("Arguments to %s must be floating point numbers.",op);
- break;
- case BINOP_INTDIV:
- if (!integral_type(t1) || !integral_type(t2))
- type_op_error ("Arguments to %s must be of integral type.",op);
- break;
- }
-#endif
-
- }
- }
-}
-
-#endif /* 0 */
-
-
/* This page contains functions for the printing out of
error messages that occur during type- and range-
checking. */
-/* Prints the format string FMT with the operator as a string
- corresponding to the opcode OP. If FATAL is non-zero, then
- this is an error and error () is called. Otherwise, it is
- a warning and printf() is called. */
-void
-op_error (char *fmt, enum exp_opcode op, int fatal)
-{
- if (fatal)
- error (fmt, op_string (op));
- else
- {
- warning (fmt, op_string (op));
- }
-}
-
/* These are called when a language fails a type- or range-check. The
first argument should be a printf()-style format string, and the
rest of the arguments should be its arguments. If
@@ -1394,13 +1193,13 @@ unk_lang_error (char *msg)
}
static void
-unk_lang_emit_char (register int c, struct ui_file *stream, int quoter)
+unk_lang_emit_char (int c, struct ui_file *stream, int quoter)
{
error ("internal error - unimplemented function unk_lang_emit_char called.");
}
static void
-unk_lang_printchar (register int c, struct ui_file *stream)
+unk_lang_printchar (int c, struct ui_file *stream)
{
error ("internal error - unimplemented function unk_lang_printchar called.");
}
diff --git a/gdb/language.h b/gdb/language.h
index 49c2cc84059..b3c31221ffe 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -463,12 +463,8 @@ extern void binop_type_check (struct value *, struct value *, int);
/* Error messages */
-extern void op_error (char *fmt, enum exp_opcode, int);
-
-#define type_op_error(f,o) \
- op_error((f),(o),type_check==type_check_on ? 1 : 0)
-#define range_op_error(f,o) \
- op_error((f),(o),range_check==range_check_on ? 1 : 0)
+extern void op_error (const char *lhs, enum exp_opcode,
+ const char *rhs);
extern void type_error (const char *, ...) ATTR_FORMAT (printf, 1, 2);
diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c
index a82adb7ea2a..fbf9a09f675 100644
--- a/gdb/lin-lwp.c
+++ b/gdb/lin-lwp.c
@@ -324,6 +324,8 @@ lin_lwp_attach_lwp (ptid_t ptid, int verbose)
gdb_assert (pid == GET_LWP (ptid)
&& WIFSTOPPED (status) && WSTOPSIG (status));
+ child_post_attach (pid);
+
lp->stopped = 1;
if (debug_lin_lwp)
@@ -415,7 +417,12 @@ detach_callback (struct lwp_info *lp, void *data)
lp->stopped = 0;
lp->signalled = 0;
lp->status = 0;
- stop_wait_callback (lp, NULL);
+ /* FIXME drow/2003-08-26: There was a call to stop_wait_callback
+ here. But since lp->signalled was cleared above,
+ stop_wait_callback didn't do anything; the process was left
+ running. Shouldn't we be waiting for it to stop?
+ I've removed the call, since stop_wait_callback now does do
+ something when called with lp->signalled == 0. */
gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status));
}
@@ -583,6 +590,77 @@ kill_lwp (int lwpid, int signo)
return kill (lwpid, signo);
}
+/* Wait for LP to stop. Returns the wait status, or 0 if the LWP has
+ exited. */
+
+static int
+wait_lwp (struct lwp_info *lp)
+{
+ pid_t pid;
+ int status;
+ int thread_dead = 0;
+
+ gdb_assert (!lp->stopped);
+ gdb_assert (lp->status == 0);
+
+ pid = waitpid (GET_LWP (lp->ptid), &status, 0);
+ if (pid == -1 && errno == ECHILD)
+ {
+ pid = waitpid (GET_LWP (lp->ptid), &status, __WCLONE);
+ if (pid == -1 && errno == ECHILD)
+ {
+ /* The thread has previously exited. We need to delete it now
+ because in the case of NPTL threads, there won't be an
+ exit event unless it is the main thread. */
+ thread_dead = 1;
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stdlog, "WL: %s vanished.\n",
+ target_pid_to_str (lp->ptid));
+ }
+ }
+
+ if (!thread_dead)
+ {
+ gdb_assert (pid == GET_LWP (lp->ptid));
+
+ if (debug_lin_lwp)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "WL: waitpid %s received %s\n",
+ target_pid_to_str (lp->ptid),
+ status_to_str (status));
+ }
+ }
+
+ /* Check if the thread has exited. */
+ if (WIFEXITED (status) || WIFSIGNALED (status))
+ {
+ thread_dead = 1;
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stdlog, "WL: %s exited.\n",
+ target_pid_to_str (lp->ptid));
+ }
+
+ if (thread_dead)
+ {
+ if (in_thread_list (lp->ptid))
+ {
+ /* Core GDB cannot deal with us deleting the current thread. */
+ if (!ptid_equal (lp->ptid, inferior_ptid))
+ delete_thread (lp->ptid);
+ printf_unfiltered ("[%s exited]\n",
+ target_pid_to_str (lp->ptid));
+ }
+
+ delete_lwp (lp->ptid);
+ return 0;
+ }
+
+ gdb_assert (WIFSTOPPED (status));
+
+ return status;
+}
+
/* Send a SIGSTOP to LP. */
static int
@@ -623,92 +701,23 @@ stop_wait_callback (struct lwp_info *lp, void *data)
{
sigset_t *flush_mask = data;
- if (!lp->stopped && lp->signalled)
+ if (!lp->stopped)
{
- pid_t pid;
int status;
- gdb_assert (lp->status == 0);
+ status = wait_lwp (lp);
+ if (status == 0)
+ return 0;
- pid = waitpid (GET_LWP (lp->ptid), &status, 0);
- if (pid == -1 && errno == ECHILD)
+ /* Ignore any signals in FLUSH_MASK. */
+ if (flush_mask && sigismember (flush_mask, WSTOPSIG (status)))
{
- pid = waitpid (GET_LWP (lp->ptid), &status, __WCLONE);
- if (pid == -1 && errno == ECHILD)
+ if (!lp->signalled)
{
- /* The thread has previously exited. We need to delete it now
- because in the case of nptl threads, there won't be an
- exit event unless it is the main thread. */
- if (debug_lin_lwp)
- fprintf_unfiltered (gdb_stdlog,
- "SWC: %s exited.\n",
- target_pid_to_str (lp->ptid));
- delete_lwp (lp->ptid);
+ lp->stopped = 1;
return 0;
}
- }
-
- gdb_assert (pid == GET_LWP (lp->ptid));
-
- if (debug_lin_lwp)
- {
- fprintf_unfiltered (gdb_stdlog,
- "SWC: waitpid %s received %s\n",
- target_pid_to_str (lp->ptid),
- status_to_str (status));
- }
-
- /* Check if the thread has exited. */
- if (WIFEXITED (status) || WIFSIGNALED (status))
- {
- gdb_assert (num_lwps > 1);
-
- if (in_thread_list (lp->ptid))
- {
- /* Core GDB cannot deal with us deleting the current
- thread. */
- if (!ptid_equal (lp->ptid, inferior_ptid))
- delete_thread (lp->ptid);
- printf_unfiltered ("[%s exited]\n",
- target_pid_to_str (lp->ptid));
- }
- if (debug_lin_lwp)
- fprintf_unfiltered (gdb_stdlog,
- "SWC: %s exited.\n",
- target_pid_to_str (lp->ptid));
-
- delete_lwp (lp->ptid);
- return 0;
- }
- /* Check if the current LWP has previously exited. For nptl threads,
- there is no exit signal issued for LWPs that are not the
- main thread so we should check whenever the thread is stopped. */
- if (!lin_lwp_thread_alive (lp->ptid))
- {
- if (in_thread_list (lp->ptid))
- {
- /* Core GDB cannot deal with us deleting the current
- thread. */
- if (!ptid_equal (lp->ptid, inferior_ptid))
- delete_thread (lp->ptid);
- printf_unfiltered ("[%s exited]\n",
- target_pid_to_str (lp->ptid));
- }
- if (debug_lin_lwp)
- fprintf_unfiltered (gdb_stdlog,
- "SWC: %s already exited.\n",
- target_pid_to_str (lp->ptid));
-
- delete_lwp (lp->ptid);
- return 0;
- }
-
- gdb_assert (WIFSTOPPED (status));
-
- /* Ignore any signals in FLUSH_MASK. */
- if (flush_mask && sigismember (flush_mask, WSTOPSIG (status)))
- {
errno = 0;
ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
if (debug_lin_lwp)
@@ -824,6 +833,88 @@ stop_wait_callback (struct lwp_info *lp, void *data)
return 0;
}
+/* Check whether PID has any pending signals in FLUSH_MASK. If so set
+ the appropriate bits in PENDING, and return 1 - otherwise return 0. */
+
+static int
+lin_lwp_has_pending (int pid, sigset_t *pending, sigset_t *flush_mask)
+{
+ sigset_t blocked, ignored;
+ int i;
+
+ linux_proc_pending_signals (pid, pending, &blocked, &ignored);
+
+ if (!flush_mask)
+ return 0;
+
+ for (i = 1; i < NSIG; i++)
+ if (sigismember (pending, i))
+ if (!sigismember (flush_mask, i)
+ || sigismember (&blocked, i)
+ || sigismember (&ignored, i))
+ sigdelset (pending, i);
+
+ if (sigisemptyset (pending))
+ return 0;
+
+ return 1;
+}
+
+/* DATA is interpreted as a mask of signals to flush. If LP has
+ signals pending, and they are all in the flush mask, then arrange
+ to flush them. LP should be stopped, as should all other threads
+ it might share a signal queue with. */
+
+static int
+flush_callback (struct lwp_info *lp, void *data)
+{
+ sigset_t *flush_mask = data;
+ sigset_t pending, intersection, blocked, ignored;
+ int pid, status;
+
+ /* Normally, when an LWP exits, it is removed from the LWP list. The
+ last LWP isn't removed till later, however. So if there is only
+ one LWP on the list, make sure it's alive. */
+ if (lwp_list == lp && lp->next == NULL)
+ if (!lin_lwp_thread_alive (lp->ptid))
+ return 0;
+
+ /* Just because the LWP is stopped doesn't mean that new signals
+ can't arrive from outside, so this function must be careful of
+ race conditions. However, because all threads are stopped, we
+ can assume that the pending mask will not shrink unless we resume
+ the LWP, and that it will then get another signal. We can't
+ control which one, however. */
+
+ if (lp->status)
+ {
+ if (debug_lin_lwp)
+ printf_unfiltered ("FC: LP has pending status %06x\n", lp->status);
+ if (WIFSTOPPED (lp->status) && sigismember (flush_mask, WSTOPSIG (lp->status)))
+ lp->status = 0;
+ }
+
+ while (lin_lwp_has_pending (GET_LWP (lp->ptid), &pending, flush_mask))
+ {
+ int ret;
+
+ errno = 0;
+ ret = ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stderr,
+ "FC: Sent PTRACE_CONT, ret %d %d\n", ret, errno);
+
+ lp->stopped = 0;
+ stop_wait_callback (lp, flush_mask);
+ if (debug_lin_lwp)
+ fprintf_unfiltered (gdb_stderr,
+ "FC: Wait finished; saved status is %d\n",
+ lp->status);
+ }
+
+ return 0;
+}
+
/* Return non-zero if LP has a wait status pending. */
static int
@@ -1047,6 +1138,7 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
if (pid != -1 && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP
&& pid != GET_PID (inferior_ptid))
{
+ linux_record_stopped_pid (pid);
pid = -1;
save_errno = EINTR;
}
@@ -1067,6 +1159,10 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
return minus_one_ptid;
}
+ /* Handle GNU/Linux's extended waitstatus for trace events. */
+ if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0)
+ return linux_handle_extended_wait (pid, status, ourstatus);
+
store_waitstatus (ourstatus, status);
return pid_to_ptid (pid);
}
@@ -1462,6 +1558,7 @@ retry:
/* ... and wait until all of them have reported back that they're no
longer running. */
iterate_over_lwps (stop_wait_callback, &flush_mask);
+ iterate_over_lwps (flush_callback, &flush_mask);
/* If we're not waiting for a specific LWP, choose an event LWP from
among those that have had events. Giving equal priority to all
@@ -1488,6 +1585,14 @@ retry:
else
trap_ptid = null_ptid;
+ /* Handle GNU/Linux's extended waitstatus for trace events. */
+ if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0)
+ {
+ linux_handle_extended_wait (ptid_get_pid (trap_ptid),
+ status, ourstatus);
+ return trap_ptid;
+ }
+
store_waitstatus (ourstatus, status);
return (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid)));
}
@@ -1657,6 +1762,12 @@ init_lin_lwp_ops (void)
lin_lwp_ops.to_mourn_inferior = lin_lwp_mourn_inferior;
lin_lwp_ops.to_thread_alive = lin_lwp_thread_alive;
lin_lwp_ops.to_pid_to_str = lin_lwp_pid_to_str;
+ lin_lwp_ops.to_post_startup_inferior = child_post_startup_inferior;
+ lin_lwp_ops.to_post_attach = child_post_attach;
+ lin_lwp_ops.to_insert_fork_catchpoint = child_insert_fork_catchpoint;
+ lin_lwp_ops.to_insert_vfork_catchpoint = child_insert_vfork_catchpoint;
+ lin_lwp_ops.to_insert_exec_catchpoint = child_insert_exec_catchpoint;
+
lin_lwp_ops.to_stratum = thread_stratum;
lin_lwp_ops.to_has_thread_control = tc_schedlock;
lin_lwp_ops.to_magic = OPS_MAGIC;
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 61931c6d58f..2680422cd50 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -40,12 +40,16 @@
#define PTRACE_O_TRACEVFORK 0x00000004
#define PTRACE_O_TRACECLONE 0x00000008
#define PTRACE_O_TRACEEXEC 0x00000010
+#define PTRACE_O_TRACEVFORKDONE 0x00000020
+#define PTRACE_O_TRACEEXIT 0x00000040
/* Wait extended result codes for the above trace options. */
#define PTRACE_EVENT_FORK 1
#define PTRACE_EVENT_VFORK 2
#define PTRACE_EVENT_CLONE 3
#define PTRACE_EVENT_EXEC 4
+#define PTRACE_EVENT_VFORKDONE 5
+#define PTRACE_EVENT_EXIT 6
#endif /* PTRACE_EVENT_FORK */
@@ -56,6 +60,10 @@
#define __WALL 0x40000000 /* Wait for any child. */
#endif
+extern struct target_ops child_ops;
+
+static int linux_parent_pid;
+
struct simple_pid_list
{
int pid;
@@ -68,6 +76,11 @@ struct simple_pid_list *stopped_pids;
static int linux_supports_tracefork_flag = -1;
+/* If we have PTRACE_O_TRACEFORK, this flag indicates whether we also have
+ PTRACE_O_TRACEVFORKDONE. */
+
+static int linux_supports_tracevforkdone_flag = -1;
+
/* Trivial list manipulation functions to keep track of a list of
new stopped processes. */
@@ -153,6 +166,11 @@ linux_test_for_tracefork (void)
return;
}
+ /* Check whether PTRACE_O_TRACEVFORKDONE is available. */
+ ret = ptrace (PTRACE_SETOPTIONS, child_pid, 0,
+ PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORKDONE);
+ linux_supports_tracevforkdone_flag = (ret == 0);
+
ptrace (PTRACE_CONT, child_pid, 0, 0);
ret = waitpid (child_pid, &status, 0);
if (ret == child_pid && WIFSTOPPED (status)
@@ -188,32 +206,315 @@ linux_supports_tracefork (void)
return linux_supports_tracefork_flag;
}
+static int
+linux_supports_tracevforkdone (void)
+{
+ if (linux_supports_tracefork_flag == -1)
+ linux_test_for_tracefork ();
+ return linux_supports_tracevforkdone_flag;
+}
+
+void
+linux_enable_event_reporting (ptid_t ptid)
+{
+ int pid = ptid_get_pid (ptid);
+ int options;
+
+ if (! linux_supports_tracefork ())
+ return;
+
+ options = PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK | PTRACE_O_TRACEEXEC;
+ if (linux_supports_tracevforkdone ())
+ options |= PTRACE_O_TRACEVFORKDONE;
+
+ /* Do not enable PTRACE_O_TRACEEXIT until GDB is more prepared to support
+ read-only process state. */
+
+ ptrace (PTRACE_SETOPTIONS, pid, 0, options);
+}
+
+void
+child_post_attach (int pid)
+{
+ linux_enable_event_reporting (pid_to_ptid (pid));
+}
+
+void
+linux_child_post_startup_inferior (ptid_t ptid)
+{
+ linux_enable_event_reporting (ptid);
+}
+
+#ifndef LINUX_CHILD_POST_STARTUP_INFERIOR
+void
+child_post_startup_inferior (ptid_t ptid)
+{
+ linux_child_post_startup_inferior (ptid);
+}
+#endif
+
int
-child_insert_fork_catchpoint (int pid)
+child_follow_fork (int follow_child)
{
- if (linux_supports_tracefork ())
- error ("Fork catchpoints have not been implemented yet.");
+ ptid_t last_ptid;
+ struct target_waitstatus last_status;
+ int has_vforked;
+ int parent_pid, child_pid;
+
+ get_last_target_status (&last_ptid, &last_status);
+ has_vforked = (last_status.kind == TARGET_WAITKIND_VFORKED);
+ parent_pid = ptid_get_pid (last_ptid);
+ child_pid = last_status.value.related_pid;
+
+ if (! follow_child)
+ {
+ /* We're already attached to the parent, by default. */
+
+ /* Before detaching from the child, remove all breakpoints from
+ it. (This won't actually modify the breakpoint list, but will
+ physically remove the breakpoints from the child.) */
+ /* If we vforked this will remove the breakpoints from the parent
+ also, but they'll be reinserted below. */
+ detach_breakpoints (child_pid);
+
+ fprintf_filtered (gdb_stdout,
+ "Detaching after fork from child process %d.\n",
+ child_pid);
+
+ ptrace (PTRACE_DETACH, child_pid, 0, 0);
+
+ if (has_vforked)
+ {
+ if (linux_supports_tracevforkdone ())
+ {
+ int status;
+
+ ptrace (PTRACE_CONT, parent_pid, 0, 0);
+ waitpid (parent_pid, &status, __WALL);
+ if ((status >> 16) != PTRACE_EVENT_VFORKDONE)
+ warning ("Unexpected waitpid result %06x when waiting for "
+ "vfork-done", status);
+ }
+ else
+ {
+ /* We can't insert breakpoints until the child has
+ finished with the shared memory region. We need to
+ wait until that happens. Ideal would be to just
+ call:
+ - ptrace (PTRACE_SYSCALL, parent_pid, 0, 0);
+ - waitpid (parent_pid, &status, __WALL);
+ However, most architectures can't handle a syscall
+ being traced on the way out if it wasn't traced on
+ the way in.
+
+ We might also think to loop, continuing the child
+ until it exits or gets a SIGTRAP. One problem is
+ that the child might call ptrace with PTRACE_TRACEME.
+
+ There's no simple and reliable way to figure out when
+ the vforked child will be done with its copy of the
+ shared memory. We could step it out of the syscall,
+ two instructions, let it go, and then single-step the
+ parent once. When we have hardware single-step, this
+ would work; with software single-step it could still
+ be made to work but we'd have to be able to insert
+ single-step breakpoints in the child, and we'd have
+ to insert -just- the single-step breakpoint in the
+ parent. Very awkward.
+
+ In the end, the best we can do is to make sure it
+ runs for a little while. Hopefully it will be out of
+ range of any breakpoints we reinsert. Usually this
+ is only the single-step breakpoint at vfork's return
+ point. */
+
+ usleep (10000);
+ }
+
+ /* Since we vforked, breakpoints were removed in the parent
+ too. Put them back. */
+ reattach_breakpoints (parent_pid);
+ }
+ }
else
+ {
+ char child_pid_spelling[40];
+
+ /* Needed to keep the breakpoint lists in sync. */
+ if (! has_vforked)
+ detach_breakpoints (child_pid);
+
+ /* Before detaching from the parent, remove all breakpoints from it. */
+ remove_breakpoints ();
+
+ fprintf_filtered (gdb_stdout,
+ "Attaching after fork to child process %d.\n",
+ child_pid);
+
+ /* If we're vforking, we may want to hold on to the parent until
+ the child exits or execs. At exec time we can remove the old
+ breakpoints from the parent and detach it; at exit time we
+ could do the same (or even, sneakily, resume debugging it - the
+ child's exec has failed, or something similar).
+
+ This doesn't clean up "properly", because we can't call
+ target_detach, but that's OK; if the current target is "child",
+ then it doesn't need any further cleanups, and lin_lwp will
+ generally not encounter vfork (vfork is defined to fork
+ in libpthread.so).
+
+ The holding part is very easy if we have VFORKDONE events;
+ but keeping track of both processes is beyond GDB at the
+ moment. So we don't expose the parent to the rest of GDB.
+ Instead we quietly hold onto it until such time as we can
+ safely resume it. */
+
+ if (has_vforked)
+ linux_parent_pid = parent_pid;
+ else
+ target_detach (NULL, 0);
+
+ inferior_ptid = pid_to_ptid (child_pid);
+ push_target (&child_ops);
+
+ /* Reset breakpoints in the child as appropriate. */
+ follow_inferior_reset_breakpoints ();
+ }
+
+ return 0;
+}
+
+ptid_t
+linux_handle_extended_wait (int pid, int status,
+ struct target_waitstatus *ourstatus)
+{
+ int event = status >> 16;
+
+ if (event == PTRACE_EVENT_CLONE)
+ internal_error (__FILE__, __LINE__,
+ "unexpected clone event");
+
+ if (event == PTRACE_EVENT_FORK || event == PTRACE_EVENT_VFORK)
+ {
+ unsigned long new_pid;
+ int ret;
+
+ ptrace (PTRACE_GETEVENTMSG, pid, 0, &new_pid);
+
+ /* If we haven't already seen the new PID stop, wait for it now. */
+ if (! pull_pid_from_list (&stopped_pids, new_pid))
+ {
+ /* The new child has a pending SIGSTOP. We can't affect it until it
+ hits the SIGSTOP, but we're already attached.
+
+ It won't be a clone (we didn't ask for clones in the event mask)
+ so we can just call waitpid and wait for the SIGSTOP. */
+ do {
+ ret = waitpid (new_pid, &status, 0);
+ } while (ret == -1 && errno == EINTR);
+ if (ret == -1)
+ perror_with_name ("waiting for new child");
+ else if (ret != new_pid)
+ internal_error (__FILE__, __LINE__,
+ "wait returned unexpected PID %d", ret);
+ else if (!WIFSTOPPED (status) || WSTOPSIG (status) != SIGSTOP)
+ internal_error (__FILE__, __LINE__,
+ "wait returned unexpected status 0x%x", status);
+ }
+
+ ourstatus->kind = (event == PTRACE_EVENT_FORK)
+ ? TARGET_WAITKIND_FORKED : TARGET_WAITKIND_VFORKED;
+ ourstatus->value.related_pid = new_pid;
+ return inferior_ptid;
+ }
+
+ if (event == PTRACE_EVENT_EXEC)
+ {
+ ourstatus->kind = TARGET_WAITKIND_EXECD;
+ ourstatus->value.execd_pathname
+ = xstrdup (child_pid_to_exec_file (pid));
+
+ if (linux_parent_pid)
+ {
+ detach_breakpoints (linux_parent_pid);
+ ptrace (PTRACE_DETACH, linux_parent_pid, 0, 0);
+
+ linux_parent_pid = 0;
+ }
+
+ return inferior_ptid;
+ }
+
+ internal_error (__FILE__, __LINE__,
+ "unknown ptrace event %d", event);
+}
+
+
+int
+child_insert_fork_catchpoint (int pid)
+{
+ if (! linux_supports_tracefork ())
error ("Your system does not support fork catchpoints.");
+
+ return 0;
}
int
child_insert_vfork_catchpoint (int pid)
{
- if (linux_supports_tracefork ())
- error ("Vfork catchpoints have not been implemented yet.");
- else
+ if (!linux_supports_tracefork ())
error ("Your system does not support vfork catchpoints.");
+
+ return 0;
}
int
child_insert_exec_catchpoint (int pid)
{
- if (linux_supports_tracefork ())
- error ("Exec catchpoints have not been implemented yet.");
- else
+ if (!linux_supports_tracefork ())
error ("Your system does not support exec catchpoints.");
+
+ return 0;
}
+void
+kill_inferior (void)
+{
+ int status;
+ int pid = PIDGET (inferior_ptid);
+ struct target_waitstatus last;
+ ptid_t last_ptid;
+ int ret;
+
+ if (pid == 0)
+ return;
+
+ /* If we're stopped while forking and we haven't followed yet, kill the
+ other task. We need to do this first because the parent will be
+ sleeping if this is a vfork. */
+
+ get_last_target_status (&last_ptid, &last);
+
+ if (last.kind == TARGET_WAITKIND_FORKED
+ || last.kind == TARGET_WAITKIND_VFORKED)
+ {
+ ptrace (PT_KILL, last.value.related_pid);
+ ptrace_wait (null_ptid, &status);
+ }
+
+ /* Kill the current process. */
+ ptrace (PT_KILL, pid, (PTRACE_ARG3_TYPE) 0, 0);
+ ret = ptrace_wait (null_ptid, &status);
+
+ /* We might get a SIGCHLD instead of an exit status. This is
+ aggravated by the first kill above - a child has just died. */
+
+ while (ret == pid && WIFSTOPPED (status))
+ {
+ ptrace (PT_KILL, pid, (PTRACE_ARG3_TYPE) 0, 0);
+ ret = ptrace_wait (null_ptid, &status);
+ }
+ target_mourn_inferior ();
+}
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index b0d96002b55..23730bb9492 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -60,12 +60,21 @@ struct lwp_info
system". */
struct mem_attrib;
struct target_ops;
+struct target_waitstatus;
extern int linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len,
int write, struct mem_attrib *attrib,
struct target_ops *target);
+/* Find process PID's pending signal set from /proc/pid/status. */
+void linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigset_t *ignored);
+
+/* linux-nat functions for handling fork events. */
extern void linux_record_stopped_pid (int pid);
+extern void linux_enable_event_reporting (ptid_t ptid);
+extern ptid_t linux_handle_extended_wait (int pid, int status,
+ struct target_waitstatus *ourstatus);
+extern void linux_child_post_startup_inferior (ptid_t ptid);
/* Iterator function for lin-lwp's lwp list. */
struct lwp_info *iterate_over_lwps (int (*callback) (struct lwp_info *,
diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c
index 282a3ec33fb..2f290c49acb 100644
--- a/gdb/linux-proc.c
+++ b/gdb/linux-proc.c
@@ -35,6 +35,8 @@
#include "cli/cli-decode.h" /* for add_info */
#include "gdb_string.h"
+#include <signal.h>
+
#include "linux-nat.h"
#ifndef O_LARGEFILE
@@ -404,35 +406,52 @@ linux_info_proc_cmd (char *args, int from_tty)
{
long long addr, endaddr, size, offset, inode;
char permissions[8], device[8], filename[MAXPATHLEN];
- char *header_fmt_string, *data_fmt_string;
+ printf_filtered ("Mapped address spaces:\n\n");
if (TARGET_ADDR_BIT == 32)
{
- header_fmt_string = "\t%10s %10s %10s %10s %7s\n";
- data_fmt_string = "\t%#10lx %#10lx %#10x %#10x %7s\n";
- }
+ printf_filtered ("\t%10s %10s %10s %10s %7s\n",
+ "Start Addr",
+ " End Addr",
+ " Size", " Offset", "objfile");
+ }
else
- {
- header_fmt_string = " %18s %18s %10s %10s %7s\n";
- data_fmt_string = " %#18lx %#18lx %#10x %#10x %7s\n";
- }
-
- printf_filtered ("Mapped address spaces:\n\n");
- printf_filtered (header_fmt_string,
+ {
+ printf_filtered (" %18s %18s %10s %10s %7s\n",
"Start Addr",
" End Addr",
" Size", " Offset", "objfile");
+ }
while (read_mapping (procfile, &addr, &endaddr, &permissions[0],
&offset, &device[0], &inode, &filename[0]))
{
size = endaddr - addr;
- printf_filtered (data_fmt_string, (unsigned long) addr, /* FIXME: pr_addr */
+
+ /* FIXME: carlton/2003-08-27: Maybe the printf_filtered
+ calls here (and possibly above) should be abstracted
+ out into their own functions? Andrew suggests using
+ a generic local_address_string instead to print out
+ the addresses; that makes sense to me, too. */
+
+ if (TARGET_ADDR_BIT == 32)
+ {
+ printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n",
+ (unsigned long) addr, /* FIXME: pr_addr */
(unsigned long) endaddr,
(int) size,
(unsigned int) offset,
filename[0] ? filename : "");
-
+ }
+ else
+ {
+ printf_filtered (" %#18lx %#18lx %#10x %#10x %7s\n",
+ (unsigned long) addr, /* FIXME: pr_addr */
+ (unsigned long) endaddr,
+ (int) size,
+ (unsigned int) offset,
+ filename[0] ? filename : "");
+ }
}
fclose (procfile);
@@ -592,11 +611,7 @@ linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write,
/* If pread64 is available, use it. It's faster if the kernel
supports it (only one syscall), and it's 64-bit safe even
on 32-bit platforms (for instance, SPARC debugging a SPARC64
- application).
-
- We play some autoconf and CFLAGS games to get this declaration
- exposed: -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE. And then
- a -D_BSD_SOURCE to counteract the defaults for _XOPEN_SOURCE. */
+ application). */
#ifdef HAVE_PREAD64
if (pread64 (fd, myaddr, len, addr) != len)
#else
@@ -609,3 +624,84 @@ linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write,
close (fd);
return ret;
}
+
+/* Parse LINE as a signal set and add its set bits to SIGS. */
+
+static void
+linux_proc_add_line_to_sigset (const char *line, sigset_t *sigs)
+{
+ int len = strlen (line) - 1;
+ const char *p;
+ int signum;
+
+ if (line[len] != '\n')
+ error ("Could not parse signal set: %s", line);
+
+ p = line;
+ signum = len * 4;
+ while (len-- > 0)
+ {
+ int digit;
+
+ if (*p >= '0' && *p <= '9')
+ digit = *p - '0';
+ else if (*p >= 'a' && *p <= 'f')
+ digit = *p - 'a' + 10;
+ else
+ error ("Could not parse signal set: %s", line);
+
+ signum -= 4;
+
+ if (digit & 1)
+ sigaddset (sigs, signum + 1);
+ if (digit & 2)
+ sigaddset (sigs, signum + 2);
+ if (digit & 4)
+ sigaddset (sigs, signum + 3);
+ if (digit & 8)
+ sigaddset (sigs, signum + 4);
+
+ p++;
+ }
+}
+
+/* Find process PID's pending signals from /proc/pid/status and set SIGS
+ to match. */
+
+void
+linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigset_t *ignored)
+{
+ FILE *procfile;
+ char buffer[MAXPATHLEN], fname[MAXPATHLEN];
+ int signum;
+
+ sigemptyset (pending);
+ sigemptyset (blocked);
+ sigemptyset (ignored);
+ sprintf (fname, "/proc/%d/status", pid);
+ procfile = fopen (fname, "r");
+ if (procfile == NULL)
+ error ("Could not open %s", fname);
+
+ while (fgets (buffer, MAXPATHLEN, procfile) != NULL)
+ {
+ /* Normal queued signals are on the SigPnd line in the status
+ file. However, 2.6 kernels also have a "shared" pending queue
+ for delivering signals to a thread group, so check for a ShdPnd
+ line also.
+
+ Unfortunately some Red Hat kernels include the shared pending queue
+ but not the ShdPnd status field. */
+
+ if (strncmp (buffer, "SigPnd:\t", 8) == 0)
+ linux_proc_add_line_to_sigset (buffer + 8, pending);
+ else if (strncmp (buffer, "ShdPnd:\t", 8) == 0)
+ linux_proc_add_line_to_sigset (buffer + 8, pending);
+ else if (strncmp (buffer, "SigBlk:\t", 8) == 0)
+ linux_proc_add_line_to_sigset (buffer + 8, blocked);
+ else if (strncmp (buffer, "SigIgn:\t", 8) == 0)
+ linux_proc_add_line_to_sigset (buffer + 8, ignored);
+ }
+
+ fclose (procfile);
+}
diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c
index f425cb9c37a..bbd88b60906 100644
--- a/gdb/lynx-nat.c
+++ b/gdb/lynx-nat.c
@@ -297,7 +297,7 @@ fetch_inferior_registers (int regno)
supply_register (G0_REGNUM, buf);
supply_register (TBR_REGNUM, (char *) &ec.tbr);
- memcpy (&deprecated_registers[REGISTER_BYTE (G1_REGNUM)], &ec.g1,
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (G1_REGNUM)], &ec.g1,
4 * REGISTER_RAW_SIZE (G1_REGNUM));
for (i = G1_REGNUM; i <= G1_REGNUM + 3; i++)
deprecated_register_valid[i] = 1;
@@ -305,10 +305,10 @@ fetch_inferior_registers (int regno)
supply_register (PS_REGNUM, (char *) &ec.psr);
supply_register (Y_REGNUM, (char *) &ec.y);
supply_register (PC_REGNUM, (char *) &ec.pc);
- supply_register (NPC_REGNUM, (char *) &ec.npc);
+ supply_register (DEPRECATED_NPC_REGNUM, (char *) &ec.npc);
supply_register (WIM_REGNUM, (char *) &ec.wim);
- memcpy (&deprecated_registers[REGISTER_BYTE (O0_REGNUM)], ec.o,
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (O0_REGNUM)], ec.o,
8 * REGISTER_RAW_SIZE (O0_REGNUM));
for (i = O0_REGNUM; i <= O0_REGNUM + 7; i++)
deprecated_register_valid[i] = 1;
@@ -322,13 +322,13 @@ fetch_inferior_registers (int regno)
sp = read_register (SP_REGNUM);
target_read_memory (sp + FRAME_SAVED_I0,
- &deprecated_registers[REGISTER_BYTE (I0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (I0_REGNUM)],
8 * REGISTER_RAW_SIZE (I0_REGNUM));
for (i = I0_REGNUM; i <= I7_REGNUM; i++)
deprecated_register_valid[i] = 1;
target_read_memory (sp + FRAME_SAVED_L0,
- &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (L0_REGNUM)],
8 * REGISTER_RAW_SIZE (L0_REGNUM));
for (i = L0_REGNUM; i <= L0_REGNUM + 7; i++)
deprecated_register_valid[i] = 1;
@@ -346,7 +346,7 @@ fetch_inferior_registers (int regno)
if (errno)
perror_with_name ("ptrace(PTRACE_GETFPREGS)");
- memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)], fc.f.fregs,
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], fc.f.fregs,
32 * REGISTER_RAW_SIZE (FP0_REGNUM));
for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
deprecated_register_valid[i] = 1;
@@ -384,16 +384,16 @@ store_inferior_registers (int regno)
int retval;
ec.tbr = read_register (TBR_REGNUM);
- memcpy (&ec.g1, &deprecated_registers[REGISTER_BYTE (G1_REGNUM)],
+ memcpy (&ec.g1, &deprecated_registers[DEPRECATED_REGISTER_BYTE (G1_REGNUM)],
4 * REGISTER_RAW_SIZE (G1_REGNUM));
ec.psr = read_register (PS_REGNUM);
ec.y = read_register (Y_REGNUM);
ec.pc = read_register (PC_REGNUM);
- ec.npc = read_register (NPC_REGNUM);
+ ec.npc = read_register (DEPRECATED_NPC_REGNUM);
ec.wim = read_register (WIM_REGNUM);
- memcpy (ec.o, &deprecated_registers[REGISTER_BYTE (O0_REGNUM)],
+ memcpy (ec.o, &deprecated_registers[DEPRECATED_REGISTER_BYTE (O0_REGNUM)],
8 * REGISTER_RAW_SIZE (O0_REGNUM));
errno = 0;
@@ -415,11 +415,11 @@ store_inferior_registers (int regno)
if (!deprecated_register_valid[L0_REGNUM + 5])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
target_write_memory (sp + FRAME_SAVED_I0,
- &deprecated_registers[REGISTER_BYTE (I0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (I0_REGNUM)],
8 * REGISTER_RAW_SIZE (I0_REGNUM));
target_write_memory (sp + FRAME_SAVED_L0,
- &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (L0_REGNUM)],
8 * REGISTER_RAW_SIZE (L0_REGNUM));
}
else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
@@ -427,13 +427,13 @@ store_inferior_registers (int regno)
if (!deprecated_register_valid[regno])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (regno >= L0_REGNUM && regno <= L0_REGNUM + 7)
- regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM)
+ regoffset = DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (L0_REGNUM)
+ FRAME_SAVED_L0;
else
- regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (I0_REGNUM)
+ regoffset = DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (I0_REGNUM)
+ FRAME_SAVED_I0;
target_write_memory (sp + regoffset,
- &deprecated_registers[REGISTER_BYTE (regno)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
}
}
@@ -450,7 +450,7 @@ store_inferior_registers (int regno)
if (errno)
perror_with_name ("ptrace(PTRACE_GETFPREGS)");
- memcpy (fc.f.fregs, &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (fc.f.fregs, &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
32 * REGISTER_RAW_SIZE (FP0_REGNUM));
fc.fsr = read_register (FPS_REGNUM);
@@ -574,7 +574,7 @@ store_inferior_registers (int regno)
{
unsigned int reg;
- reg = *(unsigned int *) &deprecated_registers[REGISTER_BYTE (regno) + i];
+ reg = *(unsigned int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno) + i];
errno = 0;
ptrace (ptrace_fun, PIDGET (inferior_ptid),
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index 528484f0f27..a54d188d0ad 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -45,7 +45,7 @@ static void m2_emit_char (int, struct ui_file *, int);
*/
static void
-m2_emit_char (register int c, struct ui_file *stream, int quoter)
+m2_emit_char (int c, struct ui_file *stream, int quoter)
{
c &= 0xFF; /* Avoid sign bit follies */
@@ -112,7 +112,7 @@ static void
m2_printstr (struct ui_file *stream, char *string, unsigned int length,
int width, int force_ellipses)
{
- register unsigned int i;
+ unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
@@ -198,7 +198,7 @@ m2_printstr (struct ui_file *stream, char *string, unsigned int length,
static struct type *
m2_create_fundamental_type (struct objfile *objfile, int typeid)
{
- register struct type *type = NULL;
+ struct type *type = NULL;
switch (typeid)
{
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index dc51699ff8e..12a91c223f9 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -832,7 +832,7 @@ m32r_frame_this_id (struct frame_info *next_frame,
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (inside_entry_file (func))
+ if (deprecated_inside_entry_file (func))
return;
/* Check if the stack is empty. */
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 223eb0991a6..0f3ed0e5e1d 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -896,7 +896,7 @@ m68hc11_frame_this_id (struct frame_info *next_frame,
/* This is meant to halt the backtrace at "_start". Make sure we
don't halt it at a generic dummy frame. */
- if (inside_entry_file (func))
+ if (deprecated_inside_entry_file (func))
return;
/* Hopefully the prologue analysis either correctly determined the
@@ -961,7 +961,7 @@ static const struct frame_unwind m68hc11_frame_unwind = {
};
const struct frame_unwind *
-m68hc11_frame_p (CORE_ADDR pc)
+m68hc11_frame_sniffer (struct frame_info *next_frame)
{
return &m68hc11_frame_unwind;
}
@@ -1572,7 +1572,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
set_gdbarch_decr_pc_after_break (gdbarch, 0);
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_breakpoint_from_pc (gdbarch, m68hc11_breakpoint_from_pc);
- set_gdbarch_stack_align (gdbarch, m68hc11_stack_align);
+ set_gdbarch_deprecated_stack_align (gdbarch, m68hc11_stack_align);
set_gdbarch_print_insn (gdbarch, gdb_print_insn_m68hc11);
m68hc11_add_reggroups (gdbarch);
@@ -1581,9 +1581,8 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
/* Hook in the DWARF CFI frame unwinder. */
frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
- set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info);
- frame_unwind_append_predicate (gdbarch, m68hc11_frame_p);
+ frame_unwind_append_sniffer (gdbarch, m68hc11_frame_sniffer);
frame_base_set_default (gdbarch, &m68hc11_frame_base);
/* Methods for saving / extracting a dummy frame's ID. The ID's
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index bbc14d3410e..72c3b86334e 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -33,6 +33,7 @@
#include "regcache.h"
#include "arch-utils.h"
#include "osabi.h"
+#include "dis-asm.h"
#include "m68k-tdep.h"
@@ -947,8 +948,8 @@ m68k_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
void
supply_gregset (gregset_t *gregsetp)
{
- register int regi;
- register greg_t *regp = (greg_t *) gregsetp;
+ int regi;
+ greg_t *regp = (greg_t *) gregsetp;
for (regi = 0; regi < R_PC; regi++)
{
@@ -961,8 +962,8 @@ supply_gregset (gregset_t *gregsetp)
void
fill_gregset (gregset_t *gregsetp, int regno)
{
- register int regi;
- register greg_t *regp = (greg_t *) gregsetp;
+ int regi;
+ greg_t *regp = (greg_t *) gregsetp;
for (regi = 0; regi < R_PC; regi++)
{
@@ -984,7 +985,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
void
supply_fpregset (fpregset_t *fpregsetp)
{
- register int regi;
+ int regi;
char *from;
for (regi = FP0_REGNUM; regi < M68K_FPC_REGNUM; regi++)
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index cfe9dab59a1..e51d20fa462 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -133,7 +133,7 @@ fetch_register (int regno)
/* This isn't really an address. But ptrace thinks of it as one. */
CORE_ADDR regaddr;
char mess[128]; /* For messages */
- register int i;
+ int i;
unsigned int offset; /* Offset of registers within the u area. */
char buf[MAX_REGISTER_SIZE];
int tid;
@@ -198,7 +198,7 @@ store_register (int regno)
/* This isn't really an address. But ptrace thinks of it as one. */
CORE_ADDR regaddr;
char mess[128]; /* For messages */
- register int i;
+ int i;
unsigned int offset; /* Offset of registers within the u area. */
int tid;
char buf[MAX_REGISTER_SIZE];
diff --git a/gdb/m68knbsd-nat.c b/gdb/m68knbsd-nat.c
index 191327a0f7b..46172439a2f 100644
--- a/gdb/m68knbsd-nat.c
+++ b/gdb/m68knbsd-nat.c
@@ -36,12 +36,12 @@ fetch_inferior_registers (int regno)
ptrace (PT_GETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_registers, 0);
- memcpy (&deprecated_registers[REGISTER_BYTE (0)], &inferior_registers,
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (0)], &inferior_registers,
sizeof (inferior_registers));
ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
- memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
sizeof (inferior_fp_registers));
deprecated_registers_fetched ();
@@ -53,12 +53,12 @@ store_inferior_registers (int regno)
struct reg inferior_registers;
struct fpreg inferior_fp_registers;
- memcpy (&inferior_registers, &deprecated_registers[REGISTER_BYTE (0)],
+ memcpy (&inferior_registers, &deprecated_registers[DEPRECATED_REGISTER_BYTE (0)],
sizeof (inferior_registers));
ptrace (PT_SETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_registers, 0);
- memcpy (&inferior_fp_registers, &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&inferior_fp_registers, &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
sizeof (inferior_fp_registers));
ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
@@ -77,10 +77,10 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
struct md_core *core_reg = (struct md_core *) core_reg_sect;
/* Integer registers */
- memcpy (&deprecated_registers[REGISTER_BYTE (0)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (0)],
&core_reg->intreg, sizeof (struct reg));
/* Floating point registers */
- memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
&core_reg->freg, sizeof (struct fpreg));
}
diff --git a/gdb/macroexp.c b/gdb/macroexp.c
index 992c4669002..e39f81ac0bd 100644
--- a/gdb/macroexp.c
+++ b/gdb/macroexp.c
@@ -145,7 +145,7 @@ resize_buffer (struct macro_buffer *b, int n)
/* Append the character C to the buffer B. */
-static inline void
+static void
appendc (struct macro_buffer *b, int c)
{
int new_len = b->len + 1;
@@ -159,7 +159,7 @@ appendc (struct macro_buffer *b, int c)
/* Append the LEN bytes at ADDR to the buffer B. */
-static inline void
+static void
appendmem (struct macro_buffer *b, char *addr, int len)
{
int new_len = b->len + len;
diff --git a/gdb/main.c b/gdb/main.c
index 5a06017ac88..2d552c09b12 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -150,7 +150,7 @@ captured_main (void *data)
struct stat homebuf, cwdbuf;
char *homedir, *homeinit;
- register int i;
+ int i;
long time_at_startup = get_run_time ();
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index 3c4e7e7d97c..342d5a3dd4a 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -29,6 +29,7 @@
#include "arch-utils.h"
#include "gdb_string.h"
#include "disasm.h"
+#include "dis-asm.h"
static CORE_ADDR mcore_analyze_prologue (struct frame_info *fi, CORE_ADDR pc,
int skip_prologue);
@@ -908,14 +909,14 @@ mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
return sp;
}
-/* Store the return address for the call dummy. For MCore, we've
- opted to use generic call dummies, so we simply store the
- CALL_DUMMY_ADDRESS into the PR register (r15). */
+/* Store the return address for the call dummy. For MCore, we've opted
+ to use generic call dummies, so we simply store the entry-point
+ address into the PR register (r15). */
static CORE_ADDR
mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
- write_register (PR_REGNUM, CALL_DUMMY_ADDRESS ());
+ write_register (PR_REGNUM, entry_point_address ());
return sp;
}
@@ -951,7 +952,7 @@ mcore_use_struct_convention (int gcc_p, struct type *type)
static CORE_ADDR
mcore_extract_struct_value_address (char *regbuf)
{
- return extract_unsigned_integer (regbuf + REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE);
+ return extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE);
}
/* Given a function which returns a value of type TYPE, extract the
@@ -964,7 +965,7 @@ mcore_extract_return_value (struct type *type, char *regbuf, char *valbuf)
/* Copy the return value (starting) in RETVAL_REGNUM to VALBUF. */
/* Only getting the first byte! if len = 1, we need the last byte of
the register, not the first. */
- memcpy (valbuf, regbuf + REGISTER_BYTE (RETVAL_REGNUM) +
+ memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (RETVAL_REGNUM) +
(TYPE_LENGTH (type) < 4 ? 4 - TYPE_LENGTH (type) : 0), TYPE_LENGTH (type));
}
@@ -990,11 +991,11 @@ mcore_store_return_value (struct type *type, char *valbuf)
/* Return value fits into registers. */
return_size = (value_size + DEPRECATED_REGISTER_SIZE - 1) & ~(DEPRECATED_REGISTER_SIZE - 1);
- offset = REGISTER_BYTE (RETVAL_REGNUM) + (return_size - value_size);
+ offset = DEPRECATED_REGISTER_BYTE (RETVAL_REGNUM) + (return_size - value_size);
zeros = alloca (return_size);
memset (zeros, 0, return_size);
- deprecated_write_register_bytes (REGISTER_BYTE (RETVAL_REGNUM), zeros,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (RETVAL_REGNUM), zeros,
return_size);
deprecated_write_register_bytes (offset, valbuf, value_size);
}
@@ -1114,11 +1115,14 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
/* MCore will never pass a sturcture by reference. It will always be split
between registers and stack. */
- set_gdbarch_reg_struct_has_addr (gdbarch, mcore_reg_struct_has_addr);
+ set_gdbarch_deprecated_reg_struct_has_addr
+ (gdbarch, mcore_reg_struct_has_addr);
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_mcore);
+
return gdbarch;
}
@@ -1133,9 +1137,7 @@ extern initialize_file_ftype _initialize_mcore_tdep; /* -Wmissing-prototypes */
void
_initialize_mcore_tdep (void)
{
- extern int print_insn_mcore (bfd_vma, disassemble_info *);
gdbarch_register (bfd_arch_mcore, mcore_gdbarch_init, mcore_dump_tdep);
- deprecated_tm_print_insn = print_insn_mcore;
#ifdef MCORE_DEBUG
add_show_from_set (add_set_cmd ("mcoredebug", no_class,
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index bc96b24a121..438c0f01362 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -373,7 +373,7 @@ static FDR *
get_rfd (int cf, int rf)
{
FDR *fdrs;
- register FDR *f;
+ FDR *f;
RFDT rfd;
fdrs = debug_info->fdr;
@@ -508,7 +508,7 @@ push_parse_stack (void)
/* Initialize new frame with previous content */
if (top_stack)
{
- register struct parse_stack *prev = new->prev;
+ struct parse_stack *prev = new->prev;
*new = *top_stack;
top_stack->prev = new;
@@ -558,7 +558,7 @@ static struct mdebug_pending *
is_pending_symbol (FDR *fh, char *sh)
{
int f_idx = fh - debug_info->fdr;
- register struct mdebug_pending *p;
+ struct mdebug_pending *p;
/* Linear search is ok, list is typically no more than 10 deep */
for (p = pending_list[f_idx]; p; p = p->next)
@@ -2228,7 +2228,7 @@ parse_partial_symbols (struct objfile *objfile)
char *ext_out;
char *ext_out_end;
EXTR *ext_block;
- register EXTR *ext_in;
+ EXTR *ext_in;
EXTR *ext_in_end;
SYMR sh;
struct partial_symtab *pst;
@@ -2936,7 +2936,7 @@ parse_partial_symbols (struct objfile *objfile)
if (pst && STREQ (namestring, pst->filename))
continue;
{
- register int i;
+ int i;
for (i = 0; i < includes_used; i++)
if (STREQ (namestring, psymtab_include_list[i]))
{
@@ -3627,8 +3627,8 @@ parse_partial_symbols (struct objfile *objfile)
if (objfile->ei.entry_point >= save_pst->textlow &&
objfile->ei.entry_point < save_pst->texthigh)
{
- objfile->ei.entry_file_lowpc = save_pst->textlow;
- objfile->ei.entry_file_highpc = save_pst->texthigh;
+ objfile->ei.deprecated_entry_file_lowpc = save_pst->textlow;
+ objfile->ei.deprecated_entry_file_highpc = save_pst->texthigh;
}
/* The objfile has its functions reordered if this partial symbol
@@ -4438,7 +4438,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, enum type_code type_cod
keeping the symtab sorted */
static struct symbol *
-mylookup_symbol (char *name, register struct block *block,
+mylookup_symbol (char *name, struct block *block,
domain_enum domain, enum address_class class)
{
struct dict_iterator iter;
@@ -4527,7 +4527,7 @@ add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last)
static int
compare_blocks (const void *arg1, const void *arg2)
{
- register int addr_diff;
+ int addr_diff;
struct block **b1 = (struct block **) arg1;
struct block **b2 = (struct block **) arg2;
@@ -4568,8 +4568,8 @@ sort_blocks (struct symtab *s)
compare_blocks);
{
- register CORE_ADDR high = 0;
- register int i, j = BLOCKVECTOR_NBLOCKS (bv);
+ CORE_ADDR high = 0;
+ int i, j = BLOCKVECTOR_NBLOCKS (bv);
for (i = FIRST_LOCAL_BLOCK; i < j; i++)
if (high < BLOCK_END (BLOCKVECTOR_BLOCK (bv, i)))
@@ -4700,6 +4700,9 @@ new_bvect (int nblocks)
static struct block *
new_block (enum block_type type)
{
+ /* FIXME: carlton/2003-09-11: This should use allocate_block to
+ allocate the block. Which, in turn, suggests that the block
+ should be allocated on an obstack. */
struct block *retval = xzalloc (sizeof (struct block));
if (type == FUNCTION_BLOCK)
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 24c17149000..24974c57055 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,32 @@
+2003-09-17 Andrew Cagney <cagney@redhat.com>
+
+ * mi/mi-main.c: Rename REGISTER_BYTE to DEPRECATED_REGISTER_BYTE.
+
+2003-09-10 Elena Zannoni <ezannoni@redhat.com>
+
+ * mi-main.c (mi_setup_architecture_data): Don't use
+ DEPRECATED_REGISTER_BYTES because some architecture don't set it
+ and its default is 0.
+
+2003-08-08 Andrew Cagney <cagney@redhat.com>
+
+ * mi-main.c (captured_mi_execute_command): Add "mi2" and "mi3" to
+ interpreters that hack around CLI.
+ * mi-interp.c (mi3_command_loop): New function.
+ (mi_interpreter_resume): Check for "mi3", default to "mi2".
+
+2003-08-07 Andrew Cagney <cagney@redhat.com>
+
+ * mi-interp.c (_initialize_mi_interp): Register "mi2" and "mi3".
+ Make "mi" select "mi2".
+
+2003-08-05 Andrew Cagney <cagney@redhat.com>
+
+ * mi-cmd-env.c (env_execute_cli_command): Use an explicit "%s %s"
+ when constructing the run command.
+ (mi_cmd_env_cd, mi_cmd_env_path, mi_cmd_env_dir): Simplify command
+ string removing the "%s".
+
2003-08-04 Andrew Cagney <cagney@redhat.com>
* mi-cmds.h (struct mi_cli): Define.
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index 55fcba10c9d..ec0fa350c84 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -37,23 +37,27 @@
#include "gdb_string.h"
#include "gdb_stat.h"
-static void env_cli_command (const char *cli, char *args);
+static void env_cli_command (const char *cli, const char *args);
static void env_mod_path (char *dirname, char **which_path);
extern void _initialize_mi_cmd_env (void);
static const char path_var_name[] = "PATH";
static char *orig_path = NULL;
-/* The following is copied from mi-main.c so for m1 and below we
- can perform old behavior and use cli commands. */
+/* The following is copied from mi-main.c so for m1 and below we can
+ perform old behavior and use cli commands. If ARGS is non-null,
+ append it to the CMD. */
static void
-env_execute_cli_command (const char *cli, char *args)
+env_execute_cli_command (const char *cmd, const char *args)
{
- if (cli != 0)
+ if (cmd != 0)
{
struct cleanup *old_cleanups;
char *run;
- xasprintf (&run, cli, args);
+ if (args != NULL)
+ xasprintf (&run, "%s %s", cmd, args);
+ else
+ run = xstrdup (cmd);
old_cleanups = make_cleanup (xfree, run);
execute_command ( /*ui */ run, 0 /*from_tty */ );
do_cleanups (old_cleanups);
@@ -90,7 +94,7 @@ mi_cmd_env_cd (char *command, char **argv, int argc)
if (argc == 0 || argc > 1)
error ("mi_cmd_env_cd: Usage DIRECTORY");
- env_execute_cli_command ("cd %s", argv[0]);
+ env_execute_cli_command ("cd", argv[0]);
return MI_CMD_DONE;
}
@@ -131,7 +135,7 @@ mi_cmd_env_path (char *command, char **argv, int argc)
if (mi_version (uiout) < 2)
{
for (i = argc - 1; i >= 0; --i)
- env_execute_cli_command ("path %s", argv[i]);
+ env_execute_cli_command ("path", argv[i]);
return MI_CMD_DONE;
}
@@ -203,7 +207,7 @@ mi_cmd_env_dir (char *command, char **argv, int argc)
if (mi_version (uiout) < 2)
{
for (i = argc - 1; i >= 0; --i)
- env_execute_cli_command ("dir %s", argv[i]);
+ env_execute_cli_command ("dir", argv[i]);
return MI_CMD_DONE;
}
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 696ae06e24c..b72d7ef0bc2 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -60,6 +60,7 @@ static int mi_interp_query_hook (const char *ctlstr, va_list ap);
static char *mi_interp_read_one_line_hook (char *prompt, int repeat,
char *anno);
+static void mi3_command_loop (void);
static void mi2_command_loop (void);
static void mi1_command_loop (void);
@@ -133,10 +134,12 @@ mi_interpreter_resume (void *data)
/* If we're _the_ interpreter, take control. */
if (current_interp_named_p (INTERP_MI1))
command_loop_hook = mi1_command_loop;
- else if (current_interp_named_p (INTERP_MI))
+ else if (current_interp_named_p (INTERP_MI2))
command_loop_hook = mi2_command_loop;
+ else if (current_interp_named_p (INTERP_MI3))
+ command_loop_hook = mi3_command_loop;
else
- return 0;
+ command_loop_hook = mi2_command_loop;
return 1;
}
@@ -334,6 +337,12 @@ mi2_command_loop (void)
}
static void
+mi3_command_loop (void)
+{
+ mi_command_loop (3);
+}
+
+static void
mi_command_loop (int mi_version)
{
#if 0
@@ -407,8 +416,12 @@ _initialize_mi_interp (void)
mi_interpreter_prompt_p /* prompt_proc_p */
};
- /* Create MI1 interpreter */
+ /* The various interpreter levels. */
interp_add (interp_new (INTERP_MI1, NULL, mi_out_new (1), &procs));
+ interp_add (interp_new (INTERP_MI2, NULL, mi_out_new (2), &procs));
+ interp_add (interp_new (INTERP_MI3, NULL, mi_out_new (3), &procs));
- interp_add (interp_new (INTERP_MI, NULL, mi_out_new (3), &procs));
+ /* "mi" selects the most recent released version. "mi2" was
+ released as part of GDB 6.0. */
+ interp_add (interp_new (INTERP_MI, NULL, mi_out_new (2), &procs));
}
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 29eccaca5f4..a4d0ab23e2a 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -405,13 +405,13 @@ register_changed_p (int regnum)
if (! frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
return -1;
- if (memcmp (&old_regs[REGISTER_BYTE (regnum)], raw_buffer,
+ if (memcmp (&old_regs[DEPRECATED_REGISTER_BYTE (regnum)], raw_buffer,
REGISTER_RAW_SIZE (regnum)) == 0)
return 0;
/* Found a changed register. Return 1. */
- memcpy (&old_regs[REGISTER_BYTE (regnum)], raw_buffer,
+ memcpy (&old_regs[DEPRECATED_REGISTER_BYTE (regnum)], raw_buffer,
REGISTER_RAW_SIZE (regnum));
return 1;
@@ -642,7 +642,7 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc)
old_chain = make_cleanup (xfree, buffer);
store_signed_integer (buffer, DEPRECATED_REGISTER_SIZE, value);
/* Write it down */
- deprecated_write_register_bytes (REGISTER_BYTE (regnum), buffer, REGISTER_RAW_SIZE (regnum));
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (regnum), buffer, REGISTER_RAW_SIZE (regnum));
/* Free the buffer. */
do_cleanups (old_chain);
}
@@ -1161,7 +1161,9 @@ captured_mi_execute_command (struct ui_out *uiout, void *data)
/* If we changed interpreters, DON'T print out anything. */
if (current_interp_named_p (INTERP_MI)
- || current_interp_named_p (INTERP_MI1))
+ || current_interp_named_p (INTERP_MI1)
+ || current_interp_named_p (INTERP_MI2)
+ || current_interp_named_p (INTERP_MI3))
{
/* print the result */
/* FIXME: Check for errors here. */
@@ -1476,9 +1478,8 @@ mi_load_progress (const char *section_name,
void
mi_setup_architecture_data (void)
{
- /* don't trust DEPRECATED_REGISTER_BYTES to be zero. */
- old_regs = xmalloc (DEPRECATED_REGISTER_BYTES + 1);
- memset (old_regs, 0, DEPRECATED_REGISTER_BYTES + 1);
+ old_regs = xmalloc ((NUM_REGS + NUM_PSEUDO_REGS) * MAX_REGISTER_SIZE + 1);
+ memset (old_regs, 0, (NUM_REGS + NUM_PSEUDO_REGS) * MAX_REGISTER_SIZE + 1);
}
void
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 49586d9cc99..85b010464ca 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -160,7 +160,7 @@ add_minsym_to_demangled_hash_table (struct minimal_symbol *sym,
lookup_minimal_symbol_linkage_or_natural. */
struct minimal_symbol *
-lookup_minimal_symbol (register const char *linkage_name, const char *sfile,
+lookup_minimal_symbol (const char *linkage_name, const char *sfile,
struct objfile *objf)
{
return lookup_minimal_symbol_aux (linkage_name, 1, sfile, objf);
@@ -316,7 +316,7 @@ lookup_minimal_symbol_aux (const char *name, int linkage,
This function only searches the mangled (linkage) names. */
struct minimal_symbol *
-lookup_minimal_symbol_text (register const char *name, const char *sfile,
+lookup_minimal_symbol_text (const char *name, const char *sfile,
struct objfile *objf)
{
struct objfile *objfile;
@@ -393,8 +393,9 @@ lookup_minimal_symbol_text (register const char *name, const char *sfile,
This function only searches the mangled (linkage) names. */
struct minimal_symbol *
-lookup_minimal_symbol_solib_trampoline (register const char *name,
- const char *sfile, struct objfile *objf)
+lookup_minimal_symbol_solib_trampoline (const char *name,
+ const char *sfile,
+ struct objfile *objf)
{
struct objfile *objfile;
struct minimal_symbol *msymbol;
@@ -647,8 +648,8 @@ prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address,
asection *bfd_section,
struct objfile *objfile)
{
- register struct msym_bunch *new;
- register struct minimal_symbol *msymbol;
+ struct msym_bunch *new;
+ struct minimal_symbol *msymbol;
if (ms_type == mst_file_text)
{
@@ -709,8 +710,8 @@ prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address,
static int
compare_minimal_symbols (const void *fn1p, const void *fn2p)
{
- register const struct minimal_symbol *fn1;
- register const struct minimal_symbol *fn2;
+ const struct minimal_symbol *fn1;
+ const struct minimal_symbol *fn2;
fn1 = (const struct minimal_symbol *) fn1p;
fn2 = (const struct minimal_symbol *) fn2p;
@@ -751,7 +752,7 @@ compare_minimal_symbols (const void *fn1p, const void *fn2p)
static void
do_discard_minimal_symbols_cleanup (void *arg)
{
- register struct msym_bunch *next;
+ struct msym_bunch *next;
while (msym_bunch != NULL)
{
@@ -895,12 +896,12 @@ build_minimal_symbol_hash_tables (struct objfile *objfile)
void
install_minimal_symbols (struct objfile *objfile)
{
- register int bindex;
- register int mcount;
- register struct msym_bunch *bunch;
- register struct minimal_symbol *msymbols;
+ int bindex;
+ int mcount;
+ struct msym_bunch *bunch;
+ struct minimal_symbol *msymbols;
int alloc_count;
- register char leading_char;
+ char leading_char;
if (msym_count > 0)
{
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 93a15e54717..8f31cf2ad5d 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -191,7 +191,7 @@ fill_gregset (elf_gregset_t *gregsetp, int regno)
void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
- register int regi;
+ int regi;
char zerobuf[MAX_REGISTER_SIZE];
memset (zerobuf, 0, MAX_REGISTER_SIZE);
@@ -216,13 +216,13 @@ fill_fpregset (elf_fpregset_t *fpregsetp, int regno)
if ((regno >= FP0_REGNUM) && (regno < FP0_REGNUM + 32))
{
- from = (char *) &deprecated_registers[REGISTER_BYTE (regno)];
+ from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)];
to = (char *) (*fpregsetp + regno - FP0_REGNUM);
memcpy (to, from, REGISTER_RAW_SIZE (regno - FP0_REGNUM));
}
else if (regno == FCRCS_REGNUM)
{
- from = (char *) &deprecated_registers[REGISTER_BYTE (regno)];
+ from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)];
to = (char *) (*fpregsetp + 32);
memcpy (to, from, REGISTER_RAW_SIZE (regno));
}
@@ -466,7 +466,7 @@ mips64_fill_gregset (mips64_elf_gregset_t *gregsetp, int regno)
static void
mips64_supply_fpregset (mips64_elf_fpregset_t *fpregsetp)
{
- register int regi;
+ int regi;
char zerobuf[MAX_REGISTER_SIZE];
memset (zerobuf, 0, MAX_REGISTER_SIZE);
@@ -491,13 +491,13 @@ mips64_fill_fpregset (mips64_elf_fpregset_t *fpregsetp, int regno)
if ((regno >= FP0_REGNUM) && (regno < FP0_REGNUM + 32))
{
- from = (char *) &deprecated_registers[REGISTER_BYTE (regno)];
+ from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)];
to = (char *) (*fpregsetp + regno - FP0_REGNUM);
memcpy (to, from, REGISTER_RAW_SIZE (regno - FP0_REGNUM));
}
else if (regno == FCRCS_REGNUM)
{
- from = (char *) &deprecated_registers[REGISTER_BYTE (regno)];
+ from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)];
to = (char *) (*fpregsetp + 32);
memcpy (to, from, REGISTER_RAW_SIZE (regno));
}
diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c
index fbd18c0b43f..0ab3fb1dd6b 100644
--- a/gdb/mips-nat.c
+++ b/gdb/mips-nat.c
@@ -72,9 +72,9 @@ static void fetch_core_registers (char *, unsigned, int, CORE_ADDR);
void
fetch_inferior_registers (int regno)
{
- register unsigned int regaddr;
+ unsigned int regaddr;
char buf[MAX_REGISTER_SIZE];
- register int i;
+ int i;
char zerobuf[MAX_REGISTER_SIZE];
memset (zerobuf, 0, MAX_REGISTER_SIZE);
@@ -104,7 +104,7 @@ fetch_inferior_registers (int regno)
void
store_inferior_registers (int regno)
{
- register unsigned int regaddr;
+ unsigned int regaddr;
char buf[80];
if (regno > 0)
@@ -172,10 +172,10 @@ static void
fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
CORE_ADDR reg_addr)
{
- register int regno;
- register unsigned int addr;
+ int regno;
+ unsigned int addr;
int bad_reg = -1;
- register reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */
+ reg_ptr = -reg_addr; /* Original u.u_ar0 is -reg_addr. */
char zerobuf[MAX_REGISTER_SIZE];
memset (zerobuf, 0, MAX_REGISTER_SIZE);
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index d1d2e38b869..1d120d7edb9 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -48,6 +48,7 @@
#include "elf-bfd.h"
#include "symcat.h"
#include "sim-regno.h"
+#include "dis-asm.h"
static void set_reg_offset (CORE_ADDR *saved_regs, int regnum, CORE_ADDR off);
static struct type *mips_register_type (struct gdbarch *gdbarch, int regnum);
@@ -374,8 +375,6 @@ mips_stack_argsize (void)
#define VM_MIN_ADDRESS (CORE_ADDR)0x400000
-int gdb_print_insn_mips (bfd_vma, disassemble_info *);
-
static mips_extra_func_info_t heuristic_proc_desc (CORE_ADDR, CORE_ADDR,
struct frame_info *, int);
@@ -655,7 +654,7 @@ mips_register_raw_size (int regnum)
NOTE: cagney/2003-06-15: This is so bogus. The register's
raw size is changing according to the ABI
(FP_REGISTER_DOUBLE). Also, GDB's protocol is defined by a
- combination of REGISTER_RAW_SIZE and REGISTER_BYTE. */
+ combination of REGISTER_RAW_SIZE and DEPRECATED_REGISTER_BYTE. */
if (mips64_transfers_32bit_regs_p)
return REGISTER_VIRTUAL_SIZE (regnum);
else if (regnum >= FP0_REGNUM && regnum < FP0_REGNUM + 32
@@ -2590,7 +2589,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame)
to have their own proc_descs, and even if they don't,
heuristic_proc_desc knows how to create them! */
- register struct linked_proc_info *link;
+ struct linked_proc_info *link;
for (link = linked_proc_desc_table; link; link = link->next)
if (PROC_LOW_ADDR (&link->info) <= pc
@@ -2624,7 +2623,7 @@ mips_frame_chain (struct frame_info *frame)
CORE_ADDR tmp;
CORE_ADDR saved_pc = DEPRECATED_FRAME_SAVED_PC (frame);
- if (saved_pc == 0 || inside_entry_file (saved_pc))
+ if (saved_pc == 0 || deprecated_inside_entry_file (saved_pc))
return 0;
/* Check if the PC is inside a call stub. If it is, fetch the
@@ -3947,7 +3946,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
static void
mips_pop_frame (void)
{
- register int regnum;
+ int regnum;
struct frame_info *frame = get_current_frame ();
CORE_ADDR new_sp = get_frame_base (frame);
mips_extra_func_info_t proc_desc;
@@ -4743,12 +4742,12 @@ mips_eabi_extract_return_value (struct type *valtype,
return_value_location (valtype, &hi, &lo);
memcpy (valbuf + lo.buf_offset,
- regbuf + REGISTER_BYTE (lo.reg) + lo.reg_offset,
+ regbuf + DEPRECATED_REGISTER_BYTE (lo.reg) + lo.reg_offset,
lo.len);
if (hi.len > 0)
memcpy (valbuf + hi.buf_offset,
- regbuf + REGISTER_BYTE (hi.reg) + hi.reg_offset,
+ regbuf + DEPRECATED_REGISTER_BYTE (hi.reg) + hi.reg_offset,
hi.len);
}
@@ -4762,12 +4761,12 @@ mips_o64_extract_return_value (struct type *valtype,
return_value_location (valtype, &hi, &lo);
memcpy (valbuf + lo.buf_offset,
- regbuf + REGISTER_BYTE (lo.reg) + lo.reg_offset,
+ regbuf + DEPRECATED_REGISTER_BYTE (lo.reg) + lo.reg_offset,
lo.len);
if (hi.len > 0)
memcpy (valbuf + hi.buf_offset,
- regbuf + REGISTER_BYTE (hi.reg) + hi.reg_offset,
+ regbuf + DEPRECATED_REGISTER_BYTE (hi.reg) + hi.reg_offset,
hi.len);
}
@@ -4784,14 +4783,14 @@ mips_eabi_store_return_value (struct type *valtype, char *valbuf)
memset (raw_buffer, 0, sizeof (raw_buffer));
memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
- deprecated_write_register_bytes (REGISTER_BYTE (lo.reg), raw_buffer,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (lo.reg), raw_buffer,
REGISTER_RAW_SIZE (lo.reg));
if (hi.len > 0)
{
memset (raw_buffer, 0, sizeof (raw_buffer));
memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len);
- deprecated_write_register_bytes (REGISTER_BYTE (hi.reg), raw_buffer,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (hi.reg), raw_buffer,
REGISTER_RAW_SIZE (hi.reg));
}
}
@@ -4806,14 +4805,14 @@ mips_o64_store_return_value (struct type *valtype, char *valbuf)
memset (raw_buffer, 0, sizeof (raw_buffer));
memcpy (raw_buffer + lo.reg_offset, valbuf + lo.buf_offset, lo.len);
- deprecated_write_register_bytes (REGISTER_BYTE (lo.reg), raw_buffer,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (lo.reg), raw_buffer,
REGISTER_RAW_SIZE (lo.reg));
if (hi.len > 0)
{
memset (raw_buffer, 0, sizeof (raw_buffer));
memcpy (raw_buffer + hi.reg_offset, valbuf + hi.buf_offset, hi.len);
- deprecated_write_register_bytes (REGISTER_BYTE (hi.reg), raw_buffer,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (hi.reg), raw_buffer,
REGISTER_RAW_SIZE (hi.reg));
}
}
@@ -5255,9 +5254,10 @@ reinit_frame_cache_sfunc (char *args, int from_tty,
reinit_frame_cache ();
}
-int
-gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info)
+static int
+gdb_print_insn_mips (bfd_vma memaddr, struct disassemble_info *info)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
mips_extra_func_info_t proc_desc;
/* Search for the function containing this address. Set the low bit
@@ -5290,6 +5290,26 @@ gdb_print_insn_mips (bfd_vma memaddr, disassemble_info *info)
/* Round down the instruction address to the appropriate boundary. */
memaddr &= (info->mach == bfd_mach_mips16 ? ~1 : ~3);
+ /* Set the disassembler options. */
+ if (tdep->mips_abi == MIPS_ABI_N32
+ || tdep->mips_abi == MIPS_ABI_N64)
+ {
+ /* Set up the disassembler info, so that we get the right
+ register names from libopcodes. */
+ if (tdep->mips_abi == MIPS_ABI_N32)
+ info->disassembler_options = "gpr-names=n32";
+ else
+ info->disassembler_options = "gpr-names=64";
+ info->flavour = bfd_target_elf_flavour;
+ }
+ else
+ /* This string is not recognized explicitly by the disassembler,
+ but it tells the disassembler to not try to guess the ABI from
+ the bfd elf headers, such that, if the user overrides the ABI
+ of a program linked as NewABI, the disassembly will follow the
+ register naming conventions specified by the user. */
+ info->disassembler_options = "gpr-names=32";
+
/* Call the appropriate disassembler based on the target endian-ness. */
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
return print_insn_big_mips (memaddr, info);
@@ -5540,25 +5560,6 @@ mips_ignore_helper (CORE_ADDR pc)
}
-/* Return a location where we can set a breakpoint that will be hit
- when an inferior function call returns. This is normally the
- program's entry point. Executables that don't have an entry
- point (e.g. programs in ROM) should define a symbol __CALL_DUMMY_ADDRESS
- whose address is the location where the breakpoint should be placed. */
-
-static CORE_ADDR
-mips_call_dummy_address (void)
-{
- struct minimal_symbol *sym;
-
- sym = lookup_minimal_symbol ("__CALL_DUMMY_ADDRESS", NULL, NULL);
- if (sym)
- return SYMBOL_VALUE_ADDRESS (sym);
- else
- return entry_point_address ();
-}
-
-
/* When debugging a 64 MIPS target running a 32 bit ABI, the size of
the register stored on the stack (32) is different to its real raw
size (64). The below ensures that registers are fetched from the
@@ -5745,12 +5746,6 @@ mips_gdbarch_init (struct gdbarch_info info,
enum mips_abi mips_abi, found_abi, wanted_abi;
int num_regs;
- /* Reset the disassembly info, in case it was set to something
- non-default. */
- deprecated_tm_print_insn_info.flavour = bfd_target_unknown_flavour;
- deprecated_tm_print_insn_info.arch = bfd_arch_unknown;
- deprecated_tm_print_insn_info.mach = 0;
-
elf_flags = 0;
if (info.abfd)
@@ -5830,34 +5825,6 @@ mips_gdbarch_init (struct gdbarch_info info,
if (wanted_abi != MIPS_ABI_UNKNOWN)
mips_abi = wanted_abi;
- /* We have to set deprecated_tm_print_insn_info before looking for a
- pre-existing architecture, otherwise we may return before we get
- a chance to set it up. */
- if (mips_abi == MIPS_ABI_N32 || mips_abi == MIPS_ABI_N64)
- {
- /* Set up the disassembler info, so that we get the right
- register names from libopcodes. */
- if (mips_abi == MIPS_ABI_N32)
- deprecated_tm_print_insn_info.disassembler_options = "gpr-names=n32";
- else
- deprecated_tm_print_insn_info.disassembler_options = "gpr-names=64";
- deprecated_tm_print_insn_info.flavour = bfd_target_elf_flavour;
- deprecated_tm_print_insn_info.arch = bfd_arch_mips;
- if (info.bfd_arch_info != NULL
- && info.bfd_arch_info->arch == bfd_arch_mips
- && info.bfd_arch_info->mach)
- deprecated_tm_print_insn_info.mach = info.bfd_arch_info->mach;
- else
- deprecated_tm_print_insn_info.mach = bfd_mach_mips8000;
- }
- else
- /* This string is not recognized explicitly by the disassembler,
- but it tells the disassembler to not try to guess the ABI from
- the bfd elf headers, such that, if the user overrides the ABI
- of a program linked as NewABI, the disassembly will follow the
- register naming conventions specified by the user. */
- deprecated_tm_print_insn_info.disassembler_options = "gpr-names=32";
-
if (gdbarch_debug)
{
fprintf_unfiltered (gdb_stdlog,
@@ -5931,8 +5898,8 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 32);
set_gdbarch_long_long_bit (gdbarch, 64);
- set_gdbarch_reg_struct_has_addr (gdbarch,
- mips_o32_reg_struct_has_addr);
+ set_gdbarch_deprecated_reg_struct_has_addr
+ (gdbarch, mips_o32_reg_struct_has_addr);
set_gdbarch_use_struct_convention (gdbarch,
always_use_struct_convention);
break;
@@ -5950,8 +5917,8 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 32);
set_gdbarch_long_long_bit (gdbarch, 64);
- set_gdbarch_reg_struct_has_addr (gdbarch,
- mips_o32_reg_struct_has_addr);
+ set_gdbarch_deprecated_reg_struct_has_addr
+ (gdbarch, mips_o32_reg_struct_has_addr);
set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
break;
case MIPS_ABI_EABI32:
@@ -5968,8 +5935,8 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 32);
set_gdbarch_long_long_bit (gdbarch, 64);
- set_gdbarch_reg_struct_has_addr (gdbarch,
- mips_eabi_reg_struct_has_addr);
+ set_gdbarch_deprecated_reg_struct_has_addr
+ (gdbarch, mips_eabi_reg_struct_has_addr);
set_gdbarch_use_struct_convention (gdbarch,
mips_eabi_use_struct_convention);
break;
@@ -5987,8 +5954,8 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_bit (gdbarch, 64);
set_gdbarch_ptr_bit (gdbarch, 64);
set_gdbarch_long_long_bit (gdbarch, 64);
- set_gdbarch_reg_struct_has_addr (gdbarch,
- mips_eabi_reg_struct_has_addr);
+ set_gdbarch_deprecated_reg_struct_has_addr
+ (gdbarch, mips_eabi_reg_struct_has_addr);
set_gdbarch_use_struct_convention (gdbarch,
mips_eabi_use_struct_convention);
break;
@@ -6008,8 +5975,8 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_long_bit (gdbarch, 64);
set_gdbarch_use_struct_convention (gdbarch,
mips_n32n64_use_struct_convention);
- set_gdbarch_reg_struct_has_addr (gdbarch,
- mips_n32n64_reg_struct_has_addr);
+ set_gdbarch_deprecated_reg_struct_has_addr
+ (gdbarch, mips_n32n64_reg_struct_has_addr);
break;
case MIPS_ABI_N64:
set_gdbarch_push_dummy_call (gdbarch, mips_n32n64_push_dummy_call);
@@ -6027,8 +5994,8 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_long_bit (gdbarch, 64);
set_gdbarch_use_struct_convention (gdbarch,
mips_n32n64_use_struct_convention);
- set_gdbarch_reg_struct_has_addr (gdbarch,
- mips_n32n64_reg_struct_has_addr);
+ set_gdbarch_deprecated_reg_struct_has_addr
+ (gdbarch, mips_n32n64_reg_struct_has_addr);
break;
default:
internal_error (__FILE__, __LINE__,
@@ -6113,7 +6080,10 @@ mips_gdbarch_init (struct gdbarch_info info,
/* MIPS version of CALL_DUMMY */
- set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address);
+ /* NOTE: cagney/2003-08-05: Eventually call dummy location will be
+ replaced by a command, and all targets will default to on stack
+ (regardless of the stack's execute status). */
+ set_gdbarch_call_dummy_location (gdbarch, AT_SYMBOL);
set_gdbarch_deprecated_pop_frame (gdbarch, mips_pop_frame);
set_gdbarch_frame_align (gdbarch, mips_frame_align);
set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
@@ -6147,6 +6117,16 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_print_registers_info (gdbarch, mips_print_registers_info);
set_gdbarch_pc_in_sigtramp (gdbarch, mips_pc_in_sigtramp);
+ set_gdbarch_print_insn (gdbarch, gdb_print_insn_mips);
+
+ /* FIXME: cagney/2003-08-29: The macros HAVE_STEPPABLE_WATCHPOINT,
+ HAVE_NONSTEPPABLE_WATCHPOINT, and HAVE_CONTINUABLE_WATCHPOINT
+ need to all be folded into the target vector. Since they are
+ being used as guards for STOPPED_BY_WATCHPOINT, why not have
+ STOPPED_BY_WATCHPOINT return the type of watchpoint that the code
+ is sitting on? */
+ set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
+
/* Hook in OS ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
@@ -6328,9 +6308,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
"mips_dump_tdep: GDB_TARGET_IS_MIPS64 = %d\n",
GDB_TARGET_IS_MIPS64);
fprintf_unfiltered (file,
- "mips_dump_tdep: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
- XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
- fprintf_unfiltered (file,
"mips_dump_tdep: HI_REGNUM = %d\n",
HI_REGNUM);
fprintf_unfiltered (file,
@@ -6561,8 +6538,6 @@ _initialize_mips_tdep (void)
internal_error (__FILE__, __LINE__, "mips_abi_strings out of sync");
gdbarch_register (bfd_arch_mips, mips_gdbarch_init, mips_dump_tdep);
- if (!deprecated_tm_print_insn) /* Someone may have already set it */
- deprecated_tm_print_insn = gdb_print_insn_mips;
/* Add root prefix command for all "set mips"/"show mips" commands */
add_prefix_cmd ("mips", no_class, set_mips_command,
diff --git a/gdb/mipsread.c b/gdb/mipsread.c
index 293eaed58f2..2ea18d712d5 100644
--- a/gdb/mipsread.c
+++ b/gdb/mipsread.c
@@ -113,15 +113,15 @@ mipscoff_symfile_read (struct objfile *objfile, int mainline)
if (mainline
&& objfile->ei.entry_point != INVALID_ENTRY_POINT
- && objfile->ei.entry_file_lowpc == INVALID_ENTRY_LOWPC)
+ && objfile->ei.deprecated_entry_file_lowpc == INVALID_ENTRY_LOWPC)
{
struct minimal_symbol *m;
m = lookup_minimal_symbol_by_pc (objfile->ei.entry_point);
if (m && DEPRECATED_SYMBOL_NAME (m + 1))
{
- objfile->ei.entry_file_lowpc = SYMBOL_VALUE_ADDRESS (m);
- objfile->ei.entry_file_highpc = SYMBOL_VALUE_ADDRESS (m + 1);
+ objfile->ei.deprecated_entry_file_lowpc = SYMBOL_VALUE_ADDRESS (m);
+ objfile->ei.deprecated_entry_file_highpc = SYMBOL_VALUE_ADDRESS (m + 1);
}
}
@@ -193,7 +193,7 @@ struct alphacoff_dynsecinfo
static void
alphacoff_locate_sections (bfd *ignore_abfd, asection *sectp, void *sip)
{
- register struct alphacoff_dynsecinfo *si;
+ struct alphacoff_dynsecinfo *si;
si = (struct alphacoff_dynsecinfo *) sip;
diff --git a/gdb/mipsv4-nat.c b/gdb/mipsv4-nat.c
index d29bc995d9a..1c753890a85 100644
--- a/gdb/mipsv4-nat.c
+++ b/gdb/mipsv4-nat.c
@@ -45,8 +45,8 @@
void
supply_gregset (gregset_t *gregsetp)
{
- register int regi;
- register greg_t *regp = &(*gregsetp)[0];
+ int regi;
+ greg_t *regp = &(*gregsetp)[0];
char zerobuf[MAX_REGISTER_SIZE];
memset (zerobuf, 0, MAX_REGISTER_SIZE);
@@ -71,23 +71,23 @@ void
fill_gregset (gregset_t *gregsetp, int regno)
{
int regi;
- register greg_t *regp = &(*gregsetp)[0];
+ greg_t *regp = &(*gregsetp)[0];
for (regi = 0; regi <= 32; regi++)
if ((regno == -1) || (regno == regi))
- *(regp + regi) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (regi)];
+ *(regp + regi) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
if ((regno == -1) || (regno == PC_REGNUM))
- *(regp + CXT_EPC) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (PC_REGNUM)];
+ *(regp + CXT_EPC) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)];
if ((regno == -1) || (regno == CAUSE_REGNUM))
- *(regp + CXT_CAUSE) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (CAUSE_REGNUM)];
+ *(regp + CXT_CAUSE) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (CAUSE_REGNUM)];
if ((regno == -1) || (regno == HI_REGNUM))
- *(regp + CXT_MDHI) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (HI_REGNUM)];
+ *(regp + CXT_MDHI) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (HI_REGNUM)];
if ((regno == -1) || (regno == LO_REGNUM))
- *(regp + CXT_MDLO) = *(greg_t *) & deprecated_registers[REGISTER_BYTE (LO_REGNUM)];
+ *(regp + CXT_MDLO) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (LO_REGNUM)];
}
/*
@@ -101,7 +101,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
void
supply_fpregset (fpregset_t *fpregsetp)
{
- register int regi;
+ int regi;
char zerobuf[MAX_REGISTER_SIZE];
memset (zerobuf, 0, MAX_REGISTER_SIZE);
@@ -125,14 +125,14 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
}
if ((regno == -1) || (regno == FCRCS_REGNUM))
- fpregsetp->fp_csr = *(unsigned *) &deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)];
+ fpregsetp->fp_csr = *(unsigned *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (FCRCS_REGNUM)];
}
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 7e84eb9e22d..2385d376294 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -32,6 +32,7 @@
#include "regcache.h"
#include "arch-utils.h"
#include "gdb_assert.h"
+#include "dis-asm.h"
#define D0_REGNUM 0
#define D2_REGNUM 2
@@ -124,15 +125,15 @@ static void
mn10300_extract_return_value (struct type *type, char *regbuf, char *valbuf)
{
if (TYPE_CODE (type) == TYPE_CODE_PTR)
- memcpy (valbuf, regbuf + REGISTER_BYTE (4), TYPE_LENGTH (type));
+ memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (4), TYPE_LENGTH (type));
else
- memcpy (valbuf, regbuf + REGISTER_BYTE (0), TYPE_LENGTH (type));
+ memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (0), TYPE_LENGTH (type));
}
static CORE_ADDR
mn10300_extract_struct_value_address (char *regbuf)
{
- return extract_unsigned_integer (regbuf + REGISTER_BYTE (4),
+ return extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (4),
REGISTER_RAW_SIZE (4));
}
@@ -140,10 +141,10 @@ static void
mn10300_store_return_value (struct type *type, char *valbuf)
{
if (TYPE_CODE (type) == TYPE_CODE_PTR)
- deprecated_write_register_bytes (REGISTER_BYTE (4), valbuf,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (4), valbuf,
TYPE_LENGTH (type));
else
- deprecated_write_register_bytes (REGISTER_BYTE (0), valbuf,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (0), valbuf,
TYPE_LENGTH (type));
}
@@ -862,7 +863,7 @@ mn10300_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
unsigned char buf[4];
- store_unsigned_integer (buf, 4, CALL_DUMMY_ADDRESS ());
+ store_unsigned_integer (buf, 4, entry_point_address ());
write_memory (sp - 4, buf, 4);
return sp - 4;
}
@@ -1208,7 +1209,8 @@ mn10300_gdbarch_init (struct gdbarch_info info,
set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (mn10300_call_dummy_words));
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
set_gdbarch_deprecated_push_arguments (gdbarch, mn10300_push_arguments);
- set_gdbarch_reg_struct_has_addr (gdbarch, mn10300_reg_struct_has_addr);
+ set_gdbarch_deprecated_reg_struct_has_addr
+ (gdbarch, mn10300_reg_struct_has_addr);
set_gdbarch_deprecated_push_return_address (gdbarch, mn10300_push_return_address);
set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
set_gdbarch_use_struct_convention (gdbarch, mn10300_use_struct_convention);
@@ -1218,6 +1220,8 @@ mn10300_gdbarch_init (struct gdbarch_info info,
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_mn10300);
+
return gdbarch;
}
@@ -1226,7 +1230,5 @@ _initialize_mn10300_tdep (void)
{
/* printf("_initialize_mn10300_tdep\n"); */
- deprecated_tm_print_insn = print_insn_mn10300;
-
register_gdbarch_init (bfd_arch_mn10300, mn10300_gdbarch_init);
}
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index 7bad91dc3b0..2485276c578 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -28,6 +28,7 @@
#include "target.h"
#include "arch-utils.h"
#include "osabi.h"
+#include "dis-asm.h"
#include "ns32k-tdep.h"
#include "gdb_string.h"
@@ -146,7 +147,7 @@ ns32k_saved_pc_after_call (struct frame_info *frame)
static CORE_ADDR
umax_skip_prologue (CORE_ADDR pc)
{
- register unsigned char op = read_memory_integer (pc, 1);
+ unsigned char op = read_memory_integer (pc, 1);
if (op == 0x82)
{
op = read_memory_integer (pc + 2, 1);
@@ -308,7 +309,7 @@ ns32k_frame_chain (struct frame_info *frame)
FP value, and that address is saved at the previous FP value as a
4-byte word. */
- if (inside_entry_file (get_frame_pc (frame)))
+ if (deprecated_inside_entry_file (get_frame_pc (frame)))
return 0;
return (read_memory_integer (get_frame_base (frame), 4));
@@ -482,7 +483,7 @@ static void
ns32k_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
{
memcpy (valbuf,
- regbuf + REGISTER_BYTE (TYPE_CODE (valtype) == TYPE_CODE_FLT ?
+ regbuf + DEPRECATED_REGISTER_BYTE (TYPE_CODE (valtype) == TYPE_CODE_FLT ?
FP0_REGNUM : 0), TYPE_LENGTH (valtype));
}
@@ -497,7 +498,7 @@ ns32k_store_return_value (struct type *valtype, char *valbuf)
static CORE_ADDR
ns32k_extract_struct_value_address (char *regbuf)
{
- return (extract_unsigned_integer (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
+ return (extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
}
void
@@ -606,6 +607,8 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_ns32k);
+
/* Hook in OS ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
@@ -619,5 +622,4 @@ _initialize_ns32k_tdep (void)
{
gdbarch_register (bfd_arch_ns32k, ns32k_gdbarch_init, NULL);
- deprecated_tm_print_insn = print_insn_ns32k;
}
diff --git a/gdb/ns32knbsd-nat.c b/gdb/ns32knbsd-nat.c
index 2fe6d10bb47..2dc7771f345 100644
--- a/gdb/ns32knbsd-nat.c
+++ b/gdb/ns32knbsd-nat.c
@@ -32,10 +32,10 @@
#include "regcache.h"
#define RF(dst, src) \
- memcpy(&deprecated_registers[REGISTER_BYTE(dst)], &src, sizeof(src))
+ memcpy(&deprecated_registers[DEPRECATED_REGISTER_BYTE(dst)], &src, sizeof(src))
#define RS(src, dst) \
- memcpy(&dst, &deprecated_registers[REGISTER_BYTE(src)], sizeof(dst))
+ memcpy(&dst, &deprecated_registers[DEPRECATED_REGISTER_BYTE(src)], sizeof(dst))
void
fetch_inferior_registers (int regno)
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 5f2822c4fe0..d4e070d4a9c 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -83,7 +83,7 @@ struct objc_method {
struct symbol *
lookup_struct_typedef (char *name, struct block *block, int noerr)
{
- register struct symbol *sym;
+ struct symbol *sym;
sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0,
(struct symtab **) NULL);
@@ -274,7 +274,7 @@ objc_demangle (const char *mangled, int options)
for printing characters and strings is language specific. */
static void
-objc_emit_char (register int c, struct ui_file *stream, int quoter)
+objc_emit_char (int c, struct ui_file *stream, int quoter)
{
c &= 0xFF; /* Avoid sign bit follies. */
@@ -337,7 +337,7 @@ static void
objc_printstr (struct ui_file *stream, char *string,
unsigned int length, int width, int force_ellipses)
{
- register unsigned int i;
+ unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
@@ -449,7 +449,7 @@ objc_printstr (struct ui_file *stream, char *string,
static struct type *
objc_create_fundamental_type (struct objfile *objfile, int typeid)
{
- register struct type *type = NULL;
+ struct type *type = NULL;
switch (typeid)
{
@@ -703,7 +703,7 @@ static char *msglist_sel;
void
start_msglist(void)
{
- register struct selname *new =
+ struct selname *new =
(struct selname *) xmalloc (sizeof (struct selname));
new->next = selname_chain;
@@ -749,9 +749,9 @@ add_msglist(struct stoken *str, int addcolon)
int
end_msglist(void)
{
- register int val = msglist_len;
- register struct selname *sel = selname_chain;
- register char *p = msglist_sel;
+ int val = msglist_len;
+ struct selname *sel = selname_chain;
+ char *p = msglist_sel;
int selid;
selname_chain = sel->next;
@@ -1536,7 +1536,7 @@ print_object_command (char *args, int from_tty)
{
struct expression *expr = parse_expression (args);
- register struct cleanup *old_chain =
+ struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
int pc = 0;
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 1d32512242c..ce927fc8746 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -34,6 +34,7 @@
#include "target.h"
#include "bcache.h"
+#include "gdb_assert.h"
#include <sys/types.h>
#include "gdb_stat.h"
#include <fcntl.h>
@@ -61,6 +62,9 @@ static void *map_to_file (int);
static void add_to_objfile_sections (bfd *, sec_ptr, void *);
+static void objfile_alloc_data (struct objfile *objfile);
+static void objfile_free_data (struct objfile *objfile);
+
/* Externally visible variables that are owned by this module.
See declarations in objfile.h for more info. */
@@ -302,6 +306,8 @@ allocate_objfile (bfd *abfd, int flags)
terminate_minimal_symbol_table (objfile);
}
+ objfile_alloc_data (objfile);
+
/* Update the per-objfile information that comes from the bfd, ensuring
that any data that is reference is saved in the per-objfile data
region. */
@@ -565,6 +571,7 @@ free_objfile (struct objfile *objfile)
if (objfile != NULL)
{
+ objfile_free_data (objfile);
if (objfile->name != NULL)
{
xmfree (objfile->md, objfile->name);
@@ -780,10 +787,10 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets)
objfile->ei.entry_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
}
- if (objfile->ei.entry_file_lowpc != INVALID_ENTRY_LOWPC)
+ if (objfile->ei.deprecated_entry_file_lowpc != INVALID_ENTRY_LOWPC)
{
- objfile->ei.entry_file_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
- objfile->ei.entry_file_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
+ objfile->ei.deprecated_entry_file_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
+ objfile->ei.deprecated_entry_file_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
}
if (objfile->ei.main_func_lowpc != INVALID_ENTRY_LOWPC)
@@ -1091,7 +1098,7 @@ in_plt_section (CORE_ADDR pc, char *name)
int
is_in_import_list (char *name, struct objfile *objfile)
{
- register int i;
+ int i;
if (!objfile || !name || !*name)
return 0;
@@ -1101,4 +1108,74 @@ is_in_import_list (char *name, struct objfile *objfile)
return 1;
return 0;
}
+
+
+/* Keep a registry of per-objfile data-pointers required by other GDB
+ modules. */
+
+struct objfile_data
+{
+ unsigned index;
+};
+
+struct objfile_data_registration
+{
+ struct objfile_data *data;
+ struct objfile_data_registration *next;
+};
+
+struct objfile_data_registry
+{
+ struct objfile_data_registration *registrations;
+ unsigned num_registrations;
+};
+
+static struct objfile_data_registry objfile_data_registry = { NULL, 0 };
+
+const struct objfile_data *
+register_objfile_data (void)
+{
+ struct objfile_data_registration **curr;
+
+ /* Append new registration. */
+ for (curr = &objfile_data_registry.registrations;
+ *curr != NULL; curr = &(*curr)->next);
+ *curr = XMALLOC (struct objfile_data_registration);
+ (*curr)->next = NULL;
+ (*curr)->data = XMALLOC (struct objfile_data);
+ (*curr)->data->index = objfile_data_registry.num_registrations++;
+
+ return (*curr)->data;
+}
+
+static void
+objfile_alloc_data (struct objfile *objfile)
+{
+ gdb_assert (objfile->data == NULL);
+ objfile->num_data = objfile_data_registry.num_registrations;
+ objfile->data = XCALLOC (objfile->num_data, void *);
+}
+
+static void
+objfile_free_data (struct objfile *objfile)
+{
+ gdb_assert (objfile->data != NULL);
+ xfree (objfile->data);
+ objfile->data = NULL;
+}
+
+void
+set_objfile_data (struct objfile *objfile, const struct objfile_data *data,
+ void *value)
+{
+ gdb_assert (data->index < objfile->num_data);
+ objfile->data[data->index] = value;
+}
+
+void *
+objfile_data (struct objfile *objfile, const struct objfile_data *data)
+{
+ gdb_assert (data->index < objfile->num_data);
+ return objfile->data[data->index];
+}
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 22827f69180..fe54f6d10ed 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -29,6 +29,7 @@
struct bcache;
struct htab;
struct symtab;
+struct objfile_data;
/* This structure maintains information on a per-objfile basis about the
"entry point" of the objfile, and the scope within which the entry point
@@ -43,14 +44,28 @@ struct symtab;
to the user executable's recorded entry point, as if the call had been made
directly by the kernel.
- The traditional gdb method of using this info is to use the recorded entry
- point to set the variables entry_file_lowpc and entry_file_highpc from
- the debugging information, where these values are the starting address
- (inclusive) and ending address (exclusive) of the instruction space in the
- executable which correspond to the "startup file", I.E. crt0.o in most
- cases. This file is assumed to be a startup file and frames with pc's
- inside it are treated as nonexistent. Setting these variables is necessary
- so that backtraces do not fly off the bottom of the stack.
+ The traditional gdb method of using this info is to use the
+ recorded entry point to set the variables
+ deprecated_entry_file_lowpc and deprecated_entry_file_highpc from
+ the debugging information, where these values are the starting
+ address (inclusive) and ending address (exclusive) of the
+ instruction space in the executable which correspond to the
+ "startup file", I.E. crt0.o in most cases. This file is assumed to
+ be a startup file and frames with pc's inside it are treated as
+ nonexistent. Setting these variables is necessary so that
+ backtraces do not fly off the bottom of the stack.
+
+ NOTE: cagney/2003-09-09: It turns out that this "traditional"
+ method doesn't work. Corinna writes: ``It turns out that the call
+ to deprecated_inside_entry_file destroys a meaningful backtrace
+ under some conditions. E. g. the backtrace tests in the asm-source
+ testcase are broken for some targets. In this test the functions
+ are all implemented as part of one file and the testcase is not
+ necessarily linked with a start file (depending on the target).
+ What happens is, that the first frame is printed normaly and
+ following frames are treated as being inside the enttry file then.
+ This way, only the #0 frame is printed in the backtrace output.''
+ Ref "frame.c" "NOTE: vinschen/2003-04-01".
Gdb also supports an alternate method to avoid running off the bottom
of the stack.
@@ -116,8 +131,8 @@ struct entry_info
/* Start (inclusive) and end (exclusive) of object file containing the
entry point. */
- CORE_ADDR entry_file_lowpc;
- CORE_ADDR entry_file_highpc;
+ CORE_ADDR deprecated_entry_file_lowpc;
+ CORE_ADDR deprecated_entry_file_highpc;
/* Start (inclusive) and end (exclusive) of the user code main() function. */
@@ -380,6 +395,13 @@ struct objfile
void *obj_private;
+ /* Per objfile data-pointers required by other GDB modules. */
+ /* FIXME: kettenis/20030711: This mechanism could replace
+ sym_stab_info, sym_private and obj_private entirely. */
+
+ void **data;
+ unsigned num_data;
+
/* Set of relocation offsets to apply to each section.
Currently on the psymbol_obstack (which makes no sense, but I'm
not sure it's harming anything).
@@ -573,6 +595,16 @@ extern int in_plt_section (CORE_ADDR, char *);
extern int is_in_import_list (char *, struct objfile *);
+/* Keep a registry of per-objfile data-pointers required by other GDB
+ modules. */
+
+extern const struct objfile_data *register_objfile_data (void);
+extern void set_objfile_data (struct objfile *objfile,
+ const struct objfile_data *data, void *value);
+extern void *objfile_data (struct objfile *objfile,
+ const struct objfile_data *data);
+
+
/* Traverse all object files. ALL_OBJFILES_SAFE works even if you delete
the objfile during the traversal. */
diff --git a/gdb/osabi.c b/gdb/osabi.c
index 252129ba7f2..dbba578429d 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -319,17 +319,13 @@ gdbarch_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
}
}
- /* We assume that if GDB_MULTI_ARCH is less than GDB_MULTI_ARCH_TM
- that an ABI variant can be supported by overriding definitions in
- the tm-file. */
- if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- fprintf_filtered
- (gdb_stderr,
- "A handler for the OS ABI \"%s\" is not built into this "
- "configuration of GDB. "
- "Attempting to continue with the default %s settings",
- gdbarch_osabi_name (info.osabi),
- bfd_printable_arch_mach (arch_info->arch, arch_info->mach));
+ fprintf_filtered
+ (gdb_stderr,
+ "A handler for the OS ABI \"%s\" is not built into this "
+ "configuration of GDB. "
+ "Attempting to continue with the default %s settings",
+ gdbarch_osabi_name (info.osabi),
+ bfd_printable_arch_mach (arch_info->arch, arch_info->mach));
}
@@ -571,8 +567,7 @@ _initialize_gdb_osabi (void)
bfd_target_elf_flavour,
generic_elf_osabi_sniffer);
- if (!GDB_MULTI_ARCH)
- return;
+ return;
/* Register the "set osabi" command. */
c = add_set_enum_cmd ("osabi", class_support, gdb_osabi_available_names,
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 59e196aa4b3..836f5f32b71 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -99,7 +99,7 @@ static void pascal_one_char (int, struct ui_file *, int *);
In_quotes is reset to 0 if a char is written with #4 notation */
static void
-pascal_one_char (register int c, struct ui_file *stream, int *in_quotes)
+pascal_one_char (int c, struct ui_file *stream, int *in_quotes)
{
c &= 0xFF; /* Avoid sign bit follies */
@@ -132,7 +132,7 @@ static void pascal_emit_char (int c, struct ui_file *stream, int quoter);
characters and strings is language specific. */
static void
-pascal_emit_char (register int c, struct ui_file *stream, int quoter)
+pascal_emit_char (int c, struct ui_file *stream, int quoter)
{
int in_quotes = 0;
pascal_one_char (c, stream, &in_quotes);
@@ -158,7 +158,7 @@ void
pascal_printstr (struct ui_file *stream, char *string, unsigned int length,
int width, int force_ellipses)
{
- register unsigned int i;
+ unsigned int i;
unsigned int things_printed = 0;
int in_quotes = 0;
int need_comma = 0;
@@ -274,7 +274,7 @@ pascal_printstr (struct ui_file *stream, char *string, unsigned int length,
struct type *
pascal_create_fundamental_type (struct objfile *objfile, int typeid)
{
- register struct type *type = NULL;
+ struct type *type = NULL;
switch (typeid)
{
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index 17a3be552bb..085a6cfcedc 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -51,7 +51,7 @@ pascal_print_type (struct type *type, const char *varstring,
struct ui_file *stream,
int show, int level)
{
- register enum type_code code;
+ enum type_code code;
int demangled_args;
code = TYPE_CODE (type);
@@ -441,9 +441,9 @@ void
pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
int level)
{
- register int i;
- register int len;
- register int lastval;
+ int i;
+ int len;
+ int lastval;
enum
{
s_none, s_public, s_private, s_protected
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index b28b62a00cb..d1b6b3638c2 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -60,7 +60,7 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset,
CORE_ADDR address, struct ui_file *stream, int format,
int deref_ref, int recurse, enum val_prettyprint pretty)
{
- register unsigned int i = 0; /* Number of characters printed */
+ unsigned int i = 0; /* Number of characters printed */
unsigned len;
struct type *elttype;
unsigned eltlen;
@@ -1055,7 +1055,7 @@ pascal_object_print_class_member (char *valaddr, struct type *domain,
print it. */
int extra = 0;
int bits = 0;
- register unsigned int i;
+ unsigned int i;
unsigned len = TYPE_NFIELDS (domain);
/* @@ Make VAL into bit offset */
LONGEST val = unpack_long (builtin_type_int, valaddr) << 3;
diff --git a/gdb/parse.c b/gdb/parse.c
index e807e13b711..8589f643e9c 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -112,7 +112,7 @@ static struct funcall *funcall_chain;
void
start_arglist (void)
{
- register struct funcall *new;
+ struct funcall *new;
new = (struct funcall *) xmalloc (sizeof (struct funcall));
new->next = funcall_chain;
@@ -127,8 +127,8 @@ start_arglist (void)
int
end_arglist (void)
{
- register int val = arglist_len;
- register struct funcall *call = funcall_chain;
+ int val = arglist_len;
+ struct funcall *call = funcall_chain;
funcall_chain = call->next;
arglist_len = call->arglist_len;
xfree (call);
@@ -141,7 +141,7 @@ end_arglist (void)
static void
free_funcalls (void *ignore)
{
- register struct funcall *call, *next;
+ struct funcall *call, *next;
for (call = funcall_chain; call; call = next)
{
@@ -263,9 +263,9 @@ write_exp_elt_intern (struct internalvar *expelt)
void
write_exp_string (struct stoken str)
{
- register int len = str.length;
- register int lenelt;
- register char *strdata;
+ int len = str.length;
+ int lenelt;
+ char *strdata;
/* Compute the number of expression elements required to hold the string
(including a null byte terminator), along with one expression element
@@ -312,10 +312,10 @@ write_exp_string (struct stoken str)
void
write_exp_bitstring (struct stoken str)
{
- register int bits = str.length; /* length in bits */
- register int len = (bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
- register int lenelt;
- register char *strdata;
+ int bits = str.length; /* length in bits */
+ int len = (bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
+ int lenelt;
+ char *strdata;
/* Compute the number of expression elements required to hold the bitstring,
along with one expression element at each end to record the actual
@@ -563,7 +563,7 @@ parse_nested_classes_for_hpacc (char *name, int len, char **token,
consider *prefixes* of the string; there is no need to look up
"B::C" separately as a symbol in the previous example. */
- register char *p;
+ char *p;
char *start, *end;
char *prefix = NULL;
char *tmp;
@@ -768,12 +768,12 @@ copy_name (struct stoken token)
to prefix form (in which we can conveniently print or execute it). */
static void
-prefixify_expression (register struct expression *expr)
+prefixify_expression (struct expression *expr)
{
- register int len =
+ int len =
sizeof (struct expression) + EXP_ELEM_TO_BYTES (expr->nelts);
- register struct expression *temp;
- register int inpos = expr->nelts, outpos = 0;
+ struct expression *temp;
+ int inpos = expr->nelts, outpos = 0;
temp = (struct expression *) alloca (len);
@@ -787,11 +787,11 @@ prefixify_expression (register struct expression *expr)
whose last exp_element is at index ENDPOS - 1 in EXPR. */
int
-length_of_subexp (register struct expression *expr, register int endpos)
+length_of_subexp (struct expression *expr, int endpos)
{
- register int oplen = 1;
- register int args = 0;
- register int i;
+ int oplen = 1;
+ int args = 0;
+ int i;
if (endpos < 1)
error ("?error in length_of_subexp");
@@ -933,12 +933,12 @@ length_of_subexp (register struct expression *expr, register int endpos)
In the process, convert it from suffix to prefix form. */
static void
-prefixify_subexp (register struct expression *inexpr,
- struct expression *outexpr, register int inend, int outbeg)
+prefixify_subexp (struct expression *inexpr,
+ struct expression *outexpr, int inend, int outbeg)
{
- register int oplen = 1;
- register int args = 0;
- register int i;
+ int oplen = 1;
+ int args = 0;
+ int i;
int *arglens;
enum exp_opcode opcode;
@@ -1182,7 +1182,7 @@ parse_exp_1 (char **stringptr, struct block *block, int comma)
struct expression *
parse_expression (char *string)
{
- register struct expression *exp;
+ struct expression *exp;
exp = parse_exp_1 (&string, 0, 0);
if (*string)
error ("Junk after end of expression.");
diff --git a/gdb/ppc-bdm.c b/gdb/ppc-bdm.c
index f1898187cf6..2355b2c74eb 100644
--- a/gdb/ppc-bdm.c
+++ b/gdb/ppc-bdm.c
@@ -295,7 +295,7 @@ bdm_ppc_store_registers (int regno)
&& ((i < FP0_REGNUM) || (i > FPLAST_REGNUM)))
{
/* printf("write valid reg %d\n", bdm_regno); */
- ocd_write_bdm_registers (bdm_regno, deprecated_registers + REGISTER_BYTE (i), 4);
+ ocd_write_bdm_registers (bdm_regno, deprecated_registers + DEPRECATED_REGISTER_BYTE (i), 4);
}
/*
else if (i == gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index d0bff2ef7bd..be278f91d66 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -207,7 +207,7 @@ fetch_register (int tid, int regno)
{
/* This isn't really an address. But ptrace thinks of it as one. */
char mess[128]; /* For messages */
- register int i;
+ int i;
unsigned int offset; /* Offset of registers within the u area. */
char buf[MAX_REGISTER_SIZE];
CORE_ADDR regaddr = ppc_register_u_addr (regno);
@@ -367,7 +367,7 @@ store_register (int tid, int regno)
/* This isn't really an address. But ptrace thinks of it as one. */
CORE_ADDR regaddr = ppc_register_u_addr (regno);
char mess[128]; /* For messages */
- register int i;
+ int i;
unsigned int offset; /* Offset of registers within the u area. */
char buf[MAX_REGISTER_SIZE];
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 05b051045bf..22ebfd2bb2f 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -188,7 +188,7 @@ ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
return (pc == handler || pc == handler + 4);
}
-static inline int
+static int
insn_is_sigreturn (unsigned long pcinsn)
{
switch(pcinsn)
@@ -591,6 +591,20 @@ ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
return val;
}
+/* For historic reasons, PPC 32 GNU/Linux follows PowerOpen rather
+ than the 32 bit SYSV R4 ABI structure return convention - all
+ structures, no matter their size, are put in memory. Vectors,
+ which were added later, do get returned in a register though. */
+
+static int
+ppc_linux_use_struct_convention (int gcc_p, struct type *value_type)
+{
+ if ((TYPE_LENGTH (value_type) == 16 || TYPE_LENGTH (value_type) == 8)
+ && TYPE_VECTOR (value_type))
+ return 0;
+ return 1;
+}
+
/* Fetch (and possibly build) an appropriate link_map_offsets
structure for GNU/Linux PPC targets using the struct offsets
defined in link.h (but without actual reference to that file).
@@ -929,18 +943,6 @@ ppc64_linux_convert_from_func_ptr_addr (CORE_ADDR addr)
}
-/* On 64-bit PowerPC GNU/Linux, the ELF header's e_entry field is the
- address of a function descriptor for the entry point function, not
- the actual entry point itself. So to find the actual address at
- which execution should begin, we need to fetch the function's entry
- point from that descriptor. */
-static CORE_ADDR
-ppc64_call_dummy_address (void)
-{
- return ppc64_desc_entry_point (entry_point_address ());
-}
-
-
enum {
ELF_NGREG = 48,
ELF_NFPREG = 33,
@@ -1029,15 +1031,17 @@ ppc_linux_init_abi (struct gdbarch_info info,
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- /* Until November 2001, gcc was not complying to the SYSV ABI for
- returning structures less than or equal to 8 bytes in size. It was
- returning everything in memory. When this was corrected, it wasn't
- fixed for native platforms. */
- set_gdbarch_use_struct_convention (gdbarch,
- ppc_sysv_abi_broken_use_struct_convention);
-
if (tdep->wordsize == 4)
{
+ /* Until November 2001, gcc did not comply with the 32 bit SysV
+ R4 ABI requirement that structures less than or equal to 8
+ bytes should be returned in registers. Instead GCC was using
+ the the AIX/PowerOpen ABI - everything returned in memory
+ (well ignoring vectors that is). When this was corrected, it
+ wasn't fixed for GNU/Linux native platform. Use the
+ PowerOpen struct convention. */
+ set_gdbarch_use_struct_convention (gdbarch, ppc_linux_use_struct_convention);
+
/* Note: kevinb/2002-04-12: See note in rs6000_gdbarch_init regarding
*_push_arguments(). The same remarks hold for the methods below. */
set_gdbarch_frameless_function_invocation (gdbarch,
@@ -1067,8 +1071,6 @@ ppc_linux_init_abi (struct gdbarch_info info,
set_gdbarch_convert_from_func_ptr_addr
(gdbarch, ppc64_linux_convert_from_func_ptr_addr);
- set_gdbarch_call_dummy_address (gdbarch, ppc64_call_dummy_address);
-
set_gdbarch_in_solib_call_trampoline
(gdbarch, ppc64_in_solib_call_trampoline);
set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code);
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index 6e8216cdc22..622bc651f2b 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -29,11 +29,20 @@
#include "ppc-tdep.h"
-/* round2 rounds x up to the nearest multiple of s assuming that s is a
- power of 2 */
+/* Ensure that X is aligned to an S byte boundary (assuming that S is
+ a power of 2) rounding up/down where necessary. */
-#undef round2
-#define round2(x,s) ((((long) (x) - 1) & ~(long)((s)-1)) + (s))
+static ULONGEST
+align_up (ULONGEST x, int s)
+{
+ return (x + s - 1) & -s;
+}
+
+static ULONGEST
+align_down (ULONGEST x, int s)
+{
+ return (x & -s);
+}
/* Pass the arguments in either registers, or in the stack. Using the
ppc sysv ABI, the first eight words of the argument list (that might
@@ -47,301 +56,277 @@
starting from r4. */
CORE_ADDR
-ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
- int struct_return, CORE_ADDR struct_addr)
+ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+ struct regcache *regcache, CORE_ADDR bp_addr,
+ int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
{
- int argno;
- /* Next available general register for non-float, non-vector arguments. */
- int greg;
- /* Next available floating point register for float arguments. */
- int freg;
- /* Next available vector register for vector arguments. */
- int vreg;
- int argstkspace;
- int structstkspace;
- int argoffset;
- int structoffset;
- struct type *type;
- int len;
- char old_sp_buf[4];
- CORE_ADDR saved_sp;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ const CORE_ADDR saved_sp = read_sp ();
+ int argspace = 0; /* 0 is an initial wrong guess. */
+ int write_pass;
+
+ /* Go through the argument list twice.
+
+ Pass 1: Figure out how much new stack space is required for
+ arguments and pushed values. Unlike the PowerOpen ABI, the SysV
+ ABI doesn't reserve any extra space for parameters which are put
+ in registers, but does always push structures and then pass their
+ address.
- greg = struct_return ? 4 : 3;
- freg = 1;
- vreg = 2;
- argstkspace = 0;
- structstkspace = 0;
+ Pass 2: Replay the same computation but this time also write the
+ values out to the target. */
- /* Figure out how much new stack space is required for arguments
- which don't fit in registers. Unlike the PowerOpen ABI, the
- SysV ABI doesn't reserve any extra space for parameters which
- are put in registers. */
- for (argno = 0; argno < nargs; argno++)
+ for (write_pass = 0; write_pass < 2; write_pass++)
{
- struct value *arg = args[argno];
- type = check_typedef (VALUE_TYPE (arg));
- len = TYPE_LENGTH (type);
+ int argno;
+ /* Next available floating point register for float and double
+ arguments. */
+ int freg = 1;
+ /* Next available general register for non-float, non-vector
+ arguments. */
+ int greg = 3;
+ /* Next available vector register for vector arguments. */
+ int vreg = 2;
+ /* Arguments start above the "LR save word" and "Back chain". */
+ int argoffset = 2 * tdep->wordsize;
+ /* Structures start after the arguments. */
+ int structoffset = argoffset + argspace;
- if (TYPE_CODE (type) == TYPE_CODE_FLT
- && ppc_floating_point_unit_p (current_gdbarch))
+ /* If the function is returning a `struct', then the first word
+ (which will be passed in r3) is used for struct return
+ address. In that case we should advance one word and start
+ from r4 register to copy parameters. */
+ if (struct_return)
{
- if (freg <= 8)
- freg++;
- else
- {
- /* SysV ABI converts floats to doubles when placed in
- memory and requires 8 byte alignment */
- if (argstkspace & 0x4)
- argstkspace += 4;
- argstkspace += 8;
- }
+ if (write_pass)
+ regcache_cooked_write_signed (regcache,
+ tdep->ppc_gp0_regnum + greg,
+ struct_addr);
+ greg++;
}
- else if (len == 8
- && (TYPE_CODE (type) == TYPE_CODE_INT /* long long */
- || (!ppc_floating_point_unit_p (current_gdbarch)
- && TYPE_CODE (type) == TYPE_CODE_FLT))) /* double */
+
+ for (argno = 0; argno < nargs; argno++)
{
- if (greg > 9)
- {
- greg = 11;
- if (argstkspace & 0x4)
- argstkspace += 4;
- argstkspace += 8;
- }
- else
- {
- if ((greg & 1) == 0)
- greg++;
- greg += 2;
- }
- }
- else if (!TYPE_VECTOR (type))
- {
- if (len > 4
- || TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_UNION)
- {
- /* Rounding to the nearest multiple of 8 may not be necessary,
- but it is safe. Particularly since we don't know the
- field types of the structure */
- structstkspace += round2 (len, 8);
- }
- if (greg <= 10)
- greg++;
- else
- argstkspace += 4;
- }
- else
- {
- if (len == 16
- && TYPE_CODE (type) == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type))
+ struct value *arg = args[argno];
+ struct type *type = check_typedef (VALUE_TYPE (arg));
+ int len = TYPE_LENGTH (type);
+ char *val = VALUE_CONTENTS (arg);
+
+ if (TYPE_CODE (type) == TYPE_CODE_FLT
+ && ppc_floating_point_unit_p (current_gdbarch)
+ && len <= 8)
{
- if (vreg <= 13)
- vreg++;
+ /* Floating point value converted to "double" then
+ passed in an FP register, when the registers run out,
+ 8 byte aligned stack is used. */
+ if (freg <= 8)
+ {
+ if (write_pass)
+ {
+ /* Always store the floating point value using
+ the register's floating-point format. */
+ char regval[MAX_REGISTER_SIZE];
+ struct type *regtype
+ = register_type (gdbarch, FP0_REGNUM + freg);
+ convert_typed_floating (val, type, regval, regtype);
+ regcache_cooked_write (regcache, FP0_REGNUM + freg,
+ regval);
+ }
+ freg++;
+ }
else
{
- /* Vector arguments must be aligned to 16 bytes on
- the stack. */
- argstkspace += round2 (argstkspace, 16);
- argstkspace += 16;
+ /* SysV ABI converts floats to doubles before
+ writing them to an 8 byte aligned stack location. */
+ argoffset = align_up (argoffset, 8);
+ if (write_pass)
+ {
+ char memval[8];
+ struct type *memtype;
+ switch (TARGET_BYTE_ORDER)
+ {
+ case BFD_ENDIAN_BIG:
+ memtype = builtin_type_ieee_double_big;
+ break;
+ case BFD_ENDIAN_LITTLE:
+ memtype = builtin_type_ieee_double_little;
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "bad switch");
+ }
+ convert_typed_floating (val, type, memval, memtype);
+ write_memory (sp + argoffset, val, len);
+ }
+ argoffset += 8;
}
}
- else if (len == 8
- && TYPE_CODE (type) == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type))
- {
- if (greg <= 10)
- greg++;
- else
- {
- /* Vector arguments must be aligned to 8 bytes on
- the stack. */
- argstkspace += round2 (argstkspace, 8);
- argstkspace += 8;
- }
- }
- }
- }
-
- /* Get current SP location */
- saved_sp = read_sp ();
-
- sp -= argstkspace + structstkspace;
-
- /* Allocate space for backchain and callee's saved lr */
- sp -= 8;
-
- /* Make sure that we maintain 16 byte alignment */
- sp &= ~0x0f;
-
- /* Update %sp before proceeding any further */
- write_register (SP_REGNUM, sp);
-
- /* write the backchain */
- store_unsigned_integer (old_sp_buf, 4, saved_sp);
- write_memory (sp, old_sp_buf, 4);
-
- argoffset = 8;
- structoffset = argoffset + argstkspace;
- freg = 1;
- greg = 3;
- vreg = 2;
-
- /* Fill in r3 with the return structure, if any */
- if (struct_return)
- {
- write_register (tdep->ppc_gp0_regnum + greg, struct_addr);
- greg++;
- }
-
- /* Now fill in the registers and stack... */
- for (argno = 0; argno < nargs; argno++)
- {
- struct value *arg = args[argno];
- char *val = VALUE_CONTENTS (arg);
- type = check_typedef (VALUE_TYPE (arg));
- len = TYPE_LENGTH (type);
-
- if (TYPE_CODE (type) == TYPE_CODE_FLT
- && ppc_floating_point_unit_p (current_gdbarch))
- {
- if (freg <= 8)
- {
- ULONGEST regval;
- if (len > 8)
- printf_unfiltered (
- "Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
- regval = extract_unsigned_integer (val, len);
- write_register (FP0_REGNUM + freg, regval);
- freg++;
- }
- else
- {
- /* SysV ABI converts floats to doubles when placed in
- memory and requires 8 byte alignment */
- /* FIXME: Convert floats to doubles */
- if (argoffset & 0x4)
- argoffset += 4;
- write_memory (sp + argoffset, val, len);
- argoffset += 8;
- }
- }
- else if (len == 8
- && (TYPE_CODE (type) == TYPE_CODE_INT /* long long */
- || (!ppc_floating_point_unit_p (current_gdbarch)
- && TYPE_CODE (type) == TYPE_CODE_FLT))) /* double */
- {
- if (greg > 9)
- {
- greg = 11;
- if (argoffset & 0x4)
- argoffset += 4;
- write_memory (sp + argoffset, val, len);
- argoffset += 8;
- }
- else
+ else if (len == 8
+ && (TYPE_CODE (type) == TYPE_CODE_INT /* long long */
+ || (!ppc_floating_point_unit_p (current_gdbarch)
+ && TYPE_CODE (type) == TYPE_CODE_FLT))) /* double */
{
- ULONGEST regval;
- if ((greg & 1) == 0)
- greg++;
- regval = extract_unsigned_integer (val, 4);
- write_register (tdep->ppc_gp0_regnum + greg, regval);
- regval = extract_unsigned_integer (val + 4, 4);
- write_register (tdep->ppc_gp0_regnum + greg + 1, regval);
- greg += 2;
- }
- }
- else if (!TYPE_VECTOR (type))
- {
- char val_buf[4];
- if (len > 4
- || TYPE_CODE (type) == TYPE_CODE_STRUCT
- || TYPE_CODE (type) == TYPE_CODE_UNION)
- {
- write_memory (sp + structoffset, val, len);
- store_unsigned_integer (val_buf, 4, sp + structoffset);
- structoffset += round2 (len, 8);
- }
- else
- {
- memset (val_buf, 0, 4);
- memcpy (val_buf, val, len);
- }
- if (greg <= 10)
- {
- ULONGEST regval = extract_unsigned_integer (val_buf, 4);
- write_register (tdep->ppc_gp0_regnum + greg, regval);
- greg++;
- }
- else
- {
- write_memory (sp + argoffset, val_buf, 4);
- argoffset += 4;
+ /* "long long" or "double" passed in an odd/even
+ register pair with the low addressed word in the odd
+ register and the high addressed word in the even
+ register, or when the registers run out an 8 byte
+ aligned stack location. */
+ if (greg > 9)
+ {
+ /* Just in case GREG was 10. */
+ greg = 11;
+ argoffset = align_up (argoffset, 8);
+ if (write_pass)
+ write_memory (sp + argoffset, val, len);
+ argoffset += 8;
+ }
+ else if (tdep->wordsize == 8)
+ {
+ if (write_pass)
+ regcache_cooked_write (regcache,
+ tdep->ppc_gp0_regnum + greg,
+ val);
+ greg += 1;
+ }
+ else
+ {
+ /* Must start on an odd register - r3/r4 etc. */
+ if ((greg & 1) == 0)
+ greg++;
+ if (write_pass)
+ {
+ regcache_cooked_write (regcache,
+ tdep->ppc_gp0_regnum + greg + 0,
+ val + 0);
+ regcache_cooked_write (regcache,
+ tdep->ppc_gp0_regnum + greg + 1,
+ val + 4);
+ }
+ greg += 2;
+ }
}
- }
- else
- {
- if (len == 16
- && TYPE_CODE (type) == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type))
+ else if (len == 16
+ && TYPE_CODE (type) == TYPE_CODE_ARRAY
+ && TYPE_VECTOR (type)
+ && tdep->ppc_vr0_regnum >= 0)
{
- char *v_val_buf = alloca (16);
- memset (v_val_buf, 0, 16);
- memcpy (v_val_buf, val, len);
+ /* Vector parameter passed in an Altivec register, or
+ when that runs out, 16 byte aligned stack location. */
if (vreg <= 13)
{
- regcache_cooked_write (current_regcache,
- tdep->ppc_vr0_regnum + vreg,
- v_val_buf);
+ if (write_pass)
+ regcache_cooked_write (current_regcache,
+ tdep->ppc_vr0_regnum + vreg,
+ val);
vreg++;
}
else
{
- write_memory (sp + argoffset, v_val_buf, 16);
+ argoffset = align_up (argoffset, 16);
+ if (write_pass)
+ write_memory (sp + argoffset, val, 16);
argoffset += 16;
}
}
else if (len == 8
&& TYPE_CODE (type) == TYPE_CODE_ARRAY
- && TYPE_VECTOR (type))
+ && TYPE_VECTOR (type)
+ && tdep->ppc_ev0_regnum >= 0)
{
- char *v_val_buf = alloca (8);
- memset (v_val_buf, 0, 8);
- memcpy (v_val_buf, val, len);
+ /* Vector parameter passed in an e500 register, or when
+ that runs out, 8 byte aligned stack location. Note
+ that since e500 vector and general purpose registers
+ both map onto the same underlying register set, a
+ "greg" and not a "vreg" is consumed here. A cooked
+ write stores the value in the correct locations
+ within the raw register cache. */
if (greg <= 10)
{
- regcache_cooked_write (current_regcache,
- tdep->ppc_ev0_regnum + greg,
- v_val_buf);
+ if (write_pass)
+ regcache_cooked_write (current_regcache,
+ tdep->ppc_ev0_regnum + greg,
+ val);
greg++;
}
else
{
- write_memory (sp + argoffset, v_val_buf, 8);
+ argoffset = align_up (argoffset, 8);
+ if (write_pass)
+ write_memory (sp + argoffset, val, 8);
argoffset += 8;
}
}
- }
+ else
+ {
+ /* Reduce the parameter down to something that fits in a
+ "word". */
+ char word[MAX_REGISTER_SIZE];
+ memset (word, 0, MAX_REGISTER_SIZE);
+ if (len > tdep->wordsize
+ || TYPE_CODE (type) == TYPE_CODE_STRUCT
+ || TYPE_CODE (type) == TYPE_CODE_UNION)
+ {
+ /* Structs and large values are put on an 8 byte
+ aligned stack ... */
+ structoffset = align_up (structoffset, 8);
+ if (write_pass)
+ write_memory (sp + structoffset, val, len);
+ /* ... and then a "word" pointing to that address is
+ passed as the parameter. */
+ store_unsigned_integer (word, tdep->wordsize,
+ sp + structoffset);
+ structoffset += len;
+ }
+ else if (TYPE_CODE (type) == TYPE_CODE_INT)
+ /* Sign or zero extend the "int" into a "word". */
+ store_unsigned_integer (word, tdep->wordsize,
+ unpack_long (type, val));
+ else
+ /* Always goes in the low address. */
+ memcpy (word, val, len);
+ /* Store that "word" in a register, or on the stack.
+ The words have "4" byte alignment. */
+ if (greg <= 10)
+ {
+ if (write_pass)
+ regcache_cooked_write (regcache,
+ tdep->ppc_gp0_regnum + greg,
+ word);
+ greg++;
+ }
+ else
+ {
+ argoffset = align_up (argoffset, tdep->wordsize);
+ if (write_pass)
+ write_memory (sp + argoffset, word, tdep->wordsize);
+ argoffset += tdep->wordsize;
+ }
+ }
+ }
+
+ /* Compute the actual stack space requirements. */
+ if (!write_pass)
+ {
+ /* Remember the amount of space needed by the arguments. */
+ argspace = argoffset;
+ /* Allocate space for both the arguments and the structures. */
+ sp -= (argoffset + structoffset);
+ /* Ensure that the stack is still 16 byte aligned. */
+ sp = align_down (sp, 16);
+ }
}
- target_store_registers (-1);
- return sp;
-}
+ /* Update %sp. */
+ regcache_cooked_write_signed (regcache, SP_REGNUM, sp);
-/* Until November 2001, gcc was not complying to the SYSV ABI for
- returning structures less than or equal to 8 bytes in size. It was
- returning everything in memory. When this was corrected, it wasn't
- fixed for native platforms. */
-int
-ppc_sysv_abi_broken_use_struct_convention (int gcc_p, struct type *value_type)
-{
- if ((TYPE_LENGTH (value_type) == 16 || TYPE_LENGTH (value_type) == 8)
- && TYPE_VECTOR (value_type))
- return 0;
+ /* Write the backchain (it occupies WORDSIZED bytes). */
+ write_memory_signed_integer (sp, tdep->wordsize, saved_sp);
+
+ /* Point the inferior function call's return address at the dummy's
+ breakpoint. */
+ regcache_cooked_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr);
- return generic_use_struct_convention (gcc_p, value_type);
+ return sp;
}
/* Structures 8 bytes or less long are returned in the r3 & r4
diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h
index 066cd99af45..dd84fd13078 100644
--- a/gdb/ppc-tdep.h
+++ b/gdb/ppc-tdep.h
@@ -25,6 +25,7 @@
struct gdbarch;
struct frame_info;
struct value;
+struct regcache;
/* From ppc-linux-tdep.c... */
CORE_ADDR ppc_linux_frame_saved_pc (struct frame_info *fi);
@@ -34,8 +35,13 @@ void ppc_linux_frame_init_saved_regs (struct frame_info *);
CORE_ADDR ppc_linux_frame_chain (struct frame_info *);
int ppc_sysv_abi_use_struct_convention (int, struct type *);
int ppc_sysv_abi_broken_use_struct_convention (int, struct type *);
-CORE_ADDR ppc_sysv_abi_push_arguments (int, struct value **, CORE_ADDR, int,
- CORE_ADDR);
+CORE_ADDR ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
+ CORE_ADDR func_addr,
+ struct regcache *regcache,
+ CORE_ADDR bp_addr, int nargs,
+ struct value **args, CORE_ADDR sp,
+ int struct_return,
+ CORE_ADDR struct_addr);
int ppc_linux_memory_remove_breakpoint (CORE_ADDR addr, char *contents_cache);
struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void);
void ppc_linux_supply_gregset (char *buf);
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 80b72d346dc..6e4765a9f31 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -191,7 +191,7 @@ static struct format_data
decode_format (char **string_ptr, int oformat, int osize)
{
struct format_data val;
- register char *p = *string_ptr;
+ char *p = *string_ptr;
val.format = '?';
val.size = '?';
@@ -276,7 +276,7 @@ decode_format (char **string_ptr, int oformat, int osize)
This is used to pad hex numbers so they line up. */
static void
-print_formatted (struct value *val, register int format, int size,
+print_formatted (struct value *val, int format, int size,
struct ui_file *stream)
{
struct type *type = check_typedef (VALUE_TYPE (val));
@@ -774,12 +774,12 @@ static struct type *examine_g_type;
static void
do_examine (struct format_data fmt, CORE_ADDR addr, asection *sect)
{
- register char format = 0;
- register char size;
- register int count = 1;
+ char format = 0;
+ char size;
+ int count = 1;
struct type *val_type = NULL;
- register int i;
- register int maxelts;
+ int i;
+ int maxelts;
format = fmt.format;
size = fmt.size;
@@ -874,8 +874,8 @@ static void
print_command_1 (char *exp, int inspect, int voidprint)
{
struct expression *expr;
- register struct cleanup *old_chain = 0;
- register char format = 0;
+ struct cleanup *old_chain = 0;
+ char format = 0;
struct value *val;
struct format_data fmt;
int cleanup = 0;
@@ -973,8 +973,8 @@ void
output_command (char *exp, int from_tty)
{
struct expression *expr;
- register struct cleanup *old_chain;
- register char format = 0;
+ struct cleanup *old_chain;
+ char format = 0;
struct value *val;
struct format_data fmt;
@@ -1008,7 +1008,7 @@ static void
set_command (char *exp, int from_tty)
{
struct expression *expr = parse_expression (exp);
- register struct cleanup *old_chain =
+ struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
evaluate_expression (expr);
do_cleanups (old_chain);
@@ -1063,10 +1063,10 @@ sym_info (char *arg, int from_tty)
static void
address_info (char *exp, int from_tty)
{
- register struct symbol *sym;
- register struct minimal_symbol *msymbol;
- register long val;
- register long basereg;
+ struct symbol *sym;
+ struct minimal_symbol *msymbol;
+ long val;
+ long basereg;
asection *section;
CORE_ADDR load_addr;
int is_a_field_of_this; /* C++: lookup_symbol sets this to nonzero
@@ -1356,8 +1356,8 @@ static void
display_command (char *exp, int from_tty)
{
struct format_data fmt;
- register struct expression *expr;
- register struct display *new;
+ struct expression *expr;
+ struct display *new;
int display_it = 1;
#if defined(TUI)
@@ -1425,7 +1425,7 @@ free_display (struct display *d)
void
clear_displays (void)
{
- register struct display *d;
+ struct display *d;
while ((d = display_chain) != NULL)
{
@@ -1440,7 +1440,7 @@ clear_displays (void)
static void
delete_display (int num)
{
- register struct display *d1, *d;
+ struct display *d1, *d;
if (!display_chain)
error ("No display number %d.", num);
@@ -1472,9 +1472,9 @@ delete_display (int num)
static void
undisplay_command (char *args, int from_tty)
{
- register char *p = args;
- register char *p1;
- register int num;
+ char *p = args;
+ char *p1;
+ int num;
if (args == 0)
{
@@ -1595,7 +1595,7 @@ do_one_display (struct display *d)
void
do_displays (void)
{
- register struct display *d;
+ struct display *d;
for (d = display_chain; d; d = d->next)
do_one_display (d);
@@ -1607,7 +1607,7 @@ do_displays (void)
void
disable_display (int num)
{
- register struct display *d;
+ struct display *d;
for (d = display_chain; d; d = d->next)
if (d->number == num)
@@ -1633,7 +1633,7 @@ disable_current_display (void)
static void
display_info (char *ignore, int from_tty)
{
- register struct display *d;
+ struct display *d;
if (!display_chain)
printf_unfiltered ("There are no auto-display expressions now.\n");
@@ -1660,10 +1660,10 @@ Num Enb Expression\n");
static void
enable_display (char *args, int from_tty)
{
- register char *p = args;
- register char *p1;
- register int num;
- register struct display *d;
+ char *p = args;
+ char *p1;
+ int num;
+ struct display *d;
if (p == 0)
{
@@ -1699,9 +1699,9 @@ enable_display (char *args, int from_tty)
static void
disable_display_command (char *args, int from_tty)
{
- register char *p = args;
- register char *p1;
- register struct display *d;
+ char *p = args;
+ char *p1;
+ struct display *d;
if (p == 0)
{
@@ -1742,8 +1742,8 @@ print_variable_value (struct symbol *var, struct frame_info *frame,
static void
printf_command (char *arg, int from_tty)
{
- register char *f = NULL;
- register char *s = arg;
+ char *f = NULL;
+ char *s = arg;
char *string = NULL;
struct value **val_args;
char *substrings;
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 96cdaa9a37d..11fa6f3f109 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -3705,7 +3705,7 @@ procfs_fetch_registers (int regno)
{
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
- (NPC_REGNUM >= 0 && regno == NPC_REGNUM) ||
+ (DEPRECATED_NPC_REGNUM >= 0 && regno == DEPRECATED_NPC_REGNUM) ||
regno == DEPRECATED_FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */
@@ -3779,7 +3779,7 @@ procfs_store_registers (int regno)
{
if ((regno >= 0 && regno < FP0_REGNUM) ||
regno == PC_REGNUM ||
- (NPC_REGNUM >= 0 && regno == NPC_REGNUM) ||
+ (DEPRECATED_NPC_REGNUM >= 0 && regno == DEPRECATED_NPC_REGNUM) ||
regno == DEPRECATED_FP_REGNUM ||
regno == SP_REGNUM)
return; /* not a floating point register */
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 5c7f0ca9169..3561d7c0d81 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -93,12 +93,13 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch,
gdb_assert (gdbarch != NULL);
/* Compute the offset of each register. Legacy architectures define
- REGISTER_BYTE() so use that. */
- /* FIXME: cagney/2002-11-07: Instead of using REGISTER_BYTE() this
- code should, as is done in init_regcache_descr(), compute the
- offets at runtime. This currently isn't possible as some ISAs
- define overlapping register regions - see the mess in
- read_register_bytes() and write_register_bytes() registers. */
+ DEPRECATED_REGISTER_BYTE() so use that. */
+ /* FIXME: cagney/2002-11-07: Instead of using
+ DEPRECATED_REGISTER_BYTE() this code should, as is done in
+ init_regcache_descr(), compute the offets at runtime. This
+ currently isn't possible as some ISAs define overlapping register
+ regions - see the mess in read_register_bytes() and
+ write_register_bytes() registers. */
descr->sizeof_register
= GDBARCH_OBSTACK_CALLOC (gdbarch, descr->nr_cooked_registers, long);
descr->register_offset
@@ -106,11 +107,11 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch,
for (i = 0; i < descr->nr_cooked_registers; i++)
{
/* FIXME: cagney/2001-12-04: This code shouldn't need to use
- REGISTER_BYTE(). Unfortunatly, legacy code likes to lay the
- buffer out so that certain registers just happen to overlap.
- Ulgh! New targets use gdbarch's register read/write and
- entirely avoid this uglyness. */
- descr->register_offset[i] = REGISTER_BYTE (i);
+ DEPRECATED_REGISTER_BYTE(). Unfortunatly, legacy code likes
+ to lay the buffer out so that certain registers just happen
+ to overlap. Ulgh! New targets use gdbarch's register
+ read/write and entirely avoid this uglyness. */
+ descr->register_offset[i] = DEPRECATED_REGISTER_BYTE (i);
descr->sizeof_register[i] = REGISTER_RAW_SIZE (i);
gdb_assert (MAX_REGISTER_SIZE >= REGISTER_RAW_SIZE (i));
gdb_assert (MAX_REGISTER_SIZE >= REGISTER_VIRTUAL_SIZE (i));
@@ -130,8 +131,8 @@ init_legacy_regcache_descr (struct gdbarch *gdbarch,
/* Keep extending the buffer so that there is always enough
space for all registers. The comparison is necessary since
legacy code is free to put registers in random places in the
- buffer separated by holes. Once REGISTER_BYTE() is killed
- this can be greatly simplified. */
+ buffer separated by holes. Once DEPRECATED_REGISTER_BYTE()
+ is killed this can be greatly simplified. */
regend = descr->register_offset[i] + descr->sizeof_register[i];
if (descr->sizeof_cooked_registers < regend)
descr->sizeof_cooked_registers = regend;
@@ -185,16 +186,17 @@ init_regcache_descr (struct gdbarch *gdbarch)
/* If an old style architecture, fill in the remainder of the
register cache descriptor using the register macros. */
- /* NOTE: cagney/2003-06-29: If either of REGISTER_BYTE or
+ /* NOTE: cagney/2003-06-29: If either of DEPRECATED_REGISTER_BYTE or
REGISTER_RAW_SIZE are still present, things are most likely
totally screwed. Ex: an architecture with raw register sizes
- smaller than what REGISTER_BYTE indicates; non monotonic
- REGISTER_BYTE values. For GDB 6 check for these nasty methods
- and fall back to legacy code when present. Sigh! */
+ smaller than what DEPRECATED_REGISTER_BYTE indicates; non
+ monotonic DEPRECATED_REGISTER_BYTE values. For GDB 6 check for
+ these nasty methods and fall back to legacy code when present.
+ Sigh! */
if ((!gdbarch_pseudo_register_read_p (gdbarch)
&& !gdbarch_pseudo_register_write_p (gdbarch)
&& !gdbarch_register_type_p (gdbarch))
- || REGISTER_BYTE_P () || REGISTER_RAW_SIZE_P ())
+ || DEPRECATED_REGISTER_BYTE_P () || REGISTER_RAW_SIZE_P ())
{
descr->legacy_p = 1;
init_legacy_regcache_descr (gdbarch, descr);
@@ -233,12 +235,12 @@ init_regcache_descr (struct gdbarch *gdbarch)
descr->sizeof_raw_registers = descr->sizeof_cooked_registers;
/* Sanity check. Confirm that there is agreement between the
- regcache and the target's redundant REGISTER_BYTE (new targets
- should not even be defining it). */
+ regcache and the target's redundant DEPRECATED_REGISTER_BYTE (new
+ targets should not even be defining it). */
for (i = 0; i < descr->nr_cooked_registers; i++)
{
- if (REGISTER_BYTE_P ())
- gdb_assert (descr->register_offset[i] == REGISTER_BYTE (i));
+ if (DEPRECATED_REGISTER_BYTE_P ())
+ gdb_assert (descr->register_offset[i] == DEPRECATED_REGISTER_BYTE (i));
#if 0
gdb_assert (descr->sizeof_register[i] == REGISTER_RAW_SIZE (i));
gdb_assert (descr->sizeof_register[i] == REGISTER_VIRTUAL_SIZE (i));
@@ -345,7 +347,7 @@ make_cleanup_regcache_xfree (struct regcache *regcache)
/* Return a pointer to register REGNUM's buffer cache. */
static char *
-register_buffer (struct regcache *regcache, int regnum)
+register_buffer (const struct regcache *regcache, int regnum)
{
return regcache->registers + regcache->descr->register_offset[regnum];
}
@@ -650,7 +652,7 @@ deprecated_read_register_bytes (int in_start, char *in_buf, int in_len)
int end;
int byte;
- reg_start = REGISTER_BYTE (regnum);
+ reg_start = DEPRECATED_REGISTER_BYTE (regnum);
reg_len = REGISTER_RAW_SIZE (regnum);
reg_end = reg_start + reg_len;
@@ -1012,7 +1014,7 @@ deprecated_write_register_bytes (int myregstart, char *myaddr, int inlen)
{
int regstart, regend;
- regstart = REGISTER_BYTE (regnum);
+ regstart = DEPRECATED_REGISTER_BYTE (regnum);
regend = regstart + REGISTER_RAW_SIZE (regnum);
/* Is this register completely outside the range the user is writing? */
@@ -1201,6 +1203,10 @@ write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid)
inferior_ptid = save_ptid;
}
+/* FIXME: kettenis/20030828: We should get rid of supply_register and
+ regcache_collect in favour of regcache_raw_supply and
+ regcache_raw_collect. */
+
/* SUPPLY_REGISTER()
Record that register REGNUM contains VAL. This is used when the
@@ -1214,21 +1220,7 @@ write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid)
void
supply_register (int regnum, const void *val)
{
-#if 1
- if (! ptid_equal (registers_ptid, inferior_ptid))
- {
- registers_changed ();
- registers_ptid = inferior_ptid;
- }
-#endif
-
- set_register_cached (regnum, 1);
- if (val)
- memcpy (register_buffer (current_regcache, regnum), val,
- REGISTER_RAW_SIZE (regnum));
- else
- memset (register_buffer (current_regcache, regnum), '\000',
- REGISTER_RAW_SIZE (regnum));
+ regcache_raw_supply (current_regcache, regnum, val);
/* On some architectures, e.g. HPPA, there are a few stray bits in
some registers, that the rest of the code would like to ignore. */
@@ -1248,8 +1240,56 @@ supply_register (int regnum, const void *val)
void
regcache_collect (int regnum, void *buf)
{
- memcpy (buf, register_buffer (current_regcache, regnum),
- REGISTER_RAW_SIZE (regnum));
+ regcache_raw_collect (current_regcache, regnum, buf);
+}
+
+/* Supply register REGNUM, whose contents are stored in BUF, to REGCACHE. */
+
+void
+regcache_raw_supply (struct regcache *regcache, int regnum, const void *buf)
+{
+ void *regbuf;
+ size_t size;
+
+ gdb_assert (regcache != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+ gdb_assert (!regcache->readonly_p);
+
+ /* FIXME: kettenis/20030828: It shouldn't be necessary to handle
+ CURRENT_REGCACHE specially here. */
+ if (regcache == current_regcache
+ && !ptid_equal (registers_ptid, inferior_ptid))
+ {
+ registers_changed ();
+ registers_ptid = inferior_ptid;
+ }
+
+ regbuf = register_buffer (regcache, regnum);
+ size = regcache->descr->sizeof_register[regnum];
+
+ if (buf)
+ memcpy (regbuf, buf, size);
+ else
+ memset (regbuf, 0, size);
+
+ /* Mark the register as cached. */
+ regcache->register_valid_p[regnum] = 1;
+}
+
+/* Collect register REGNUM from REGCACHE and store its contents in BUF. */
+
+void
+regcache_raw_collect (const struct regcache *regcache, int regnum, void *buf)
+{
+ const void *regbuf;
+ size_t size;
+
+ gdb_assert (regcache != NULL && buf != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+
+ regbuf = register_buffer (regcache, regnum);
+ size = regcache->descr->sizeof_register[regnum];
+ memcpy (buf, regbuf, size);
}
@@ -1305,8 +1345,8 @@ generic_target_write_pc (CORE_ADDR pc, ptid_t ptid)
#ifdef PC_REGNUM
if (PC_REGNUM >= 0)
write_register_pid (PC_REGNUM, pc, ptid);
- if (NPC_REGNUM >= 0)
- write_register_pid (NPC_REGNUM, pc + 4, ptid);
+ if (DEPRECATED_NPC_REGNUM >= 0)
+ write_register_pid (DEPRECATED_NPC_REGNUM, pc + 4, ptid);
#else
internal_error (__FILE__, __LINE__,
"generic_target_write_pc");
@@ -1479,7 +1519,7 @@ regcache_dump (struct regcache *regcache, struct ui_file *file,
fprintf_unfiltered (file, " %6ld",
regcache->descr->register_offset[regnum]);
if (register_offset != regcache->descr->register_offset[regnum]
- || register_offset != REGISTER_BYTE (regnum)
+ || register_offset != DEPRECATED_REGISTER_BYTE (regnum)
|| (regnum > 0
&& (regcache->descr->register_offset[regnum]
!= (regcache->descr->register_offset[regnum - 1]
diff --git a/gdb/regcache.h b/gdb/regcache.h
index f84820519af..b8ac182fa56 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -94,6 +94,10 @@ void regcache_cooked_write_part (struct regcache *regcache, int regnum,
extern void supply_register (int regnum, const void *val);
extern void regcache_collect (int regnum, void *buf);
+extern void regcache_raw_supply (struct regcache *regcache,
+ int regnum, const void *buf);
+extern void regcache_raw_collect (const struct regcache *regcache,
+ int regnum, void *buf);
/* The register's ``offset''.
diff --git a/gdb/reggroups.c b/gdb/reggroups.c
index 791ec0abd52..7dd05628519 100644
--- a/gdb/reggroups.c
+++ b/gdb/reggroups.c
@@ -1,6 +1,6 @@
/* Register groupings for GDB, the GNU debugger.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
Contributed by Red Hat.
@@ -103,6 +103,7 @@ void
reggroup_add (struct gdbarch *gdbarch, struct reggroup *group)
{
struct reggroups *groups = gdbarch_data (gdbarch, reggroups_data);
+
if (groups == NULL)
{
/* ULGH, called during architecture initialization. Patch
@@ -125,6 +126,7 @@ reggroup_next (struct gdbarch *gdbarch, struct reggroup *last)
{
struct reggroups *groups;
struct reggroup_el *el;
+
/* Don't allow this function to be called during architecture
creation. If there are no groups, use the default groups list. */
groups = gdbarch_data (gdbarch, reggroups_data);
@@ -132,13 +134,18 @@ reggroup_next (struct gdbarch *gdbarch, struct reggroup *last)
if (groups->first == NULL)
groups = &default_groups;
- /* Retun the first/next reggroup. */
+ /* Return the first/next reggroup. */
if (last == NULL)
return groups->first->group;
for (el = groups->first; el != NULL; el = el->next)
{
if (el->group == last)
- return el->next->group;
+ {
+ if (el->next != NULL)
+ return el->next->group;
+ else
+ return NULL;
+ }
}
return NULL;
}
@@ -151,6 +158,7 @@ default_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
int vector_p;
int float_p;
int raw_p;
+
if (REGISTER_NAME (regnum) == NULL
|| *REGISTER_NAME (regnum) == '\0')
return 0;
@@ -178,6 +186,7 @@ static void
reggroups_dump (struct gdbarch *gdbarch, struct ui_file *file)
{
struct reggroup *group = NULL;
+
do
{
/* Group name. */
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index c50c5044387..3dc3601443b 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -816,9 +816,9 @@ mips_receive_trailer (unsigned char *trlr, int *pgarbage, int *pch, int timeout)
static int
mips_cksum (const unsigned char *hdr, const unsigned char *data, int len)
{
- register const unsigned char *p;
- register int c;
- register int cksum;
+ const unsigned char *p;
+ int c;
+ int cksum;
cksum = 0;
@@ -843,7 +843,7 @@ mips_send_packet (const char *s, int get_ack)
{
/* unsigned */ int len;
unsigned char *packet;
- register int cksum;
+ int cksum;
int try;
len = strlen (s);
@@ -2405,7 +2405,7 @@ pmon_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
implements the TARGET_CAN_USE_HARDWARE_WATCHPOINT macro. */
int
-remote_mips_can_use_hardware_watchpoint (int cnt)
+mips_can_use_watchpoint (int type, int cnt, int othertype)
{
return cnt < MAX_LSI_BREAKPOINTS && strcmp (target_shortname, "lsi") == 0;
}
@@ -2464,7 +2464,7 @@ remote_mips_remove_hw_breakpoint (CORE_ADDR addr, char *contents_cache)
watchpoint. */
int
-remote_mips_set_watchpoint (CORE_ADDR addr, int len, int type)
+mips_insert_watchpoint (CORE_ADDR addr, int len, int type)
{
if (set_breakpoint (addr, len, type))
return -1;
@@ -2473,7 +2473,7 @@ remote_mips_set_watchpoint (CORE_ADDR addr, int len, int type)
}
int
-remote_mips_remove_watchpoint (CORE_ADDR addr, int len, int type)
+mips_remove_watchpoint (CORE_ADDR addr, int len, int type)
{
if (clear_breakpoint (addr, len, type))
return -1;
@@ -2482,7 +2482,7 @@ remote_mips_remove_watchpoint (CORE_ADDR addr, int len, int type)
}
int
-remote_mips_stopped_by_watchpoint (void)
+mips_stopped_by_watchpoint (void)
{
return hit_watchpoint;
}
@@ -3494,6 +3494,10 @@ _initialize_remote_mips (void)
mips_ops.to_files_info = mips_files_info;
mips_ops.to_insert_breakpoint = mips_insert_breakpoint;
mips_ops.to_remove_breakpoint = mips_remove_breakpoint;
+ mips_ops.to_insert_watchpoint = mips_insert_watchpoint;
+ mips_ops.to_remove_watchpoint = mips_remove_watchpoint;
+ mips_ops.to_stopped_by_watchpoint = mips_stopped_by_watchpoint;
+ mips_ops.to_can_use_hw_breakpoint = mips_can_use_watchpoint;
mips_ops.to_kill = mips_kill;
mips_ops.to_load = mips_load;
mips_ops.to_create_inferior = mips_create_inferior;
diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c
index ae397e617d9..a07827c1192 100644
--- a/gdb/remote-sds.c
+++ b/gdb/remote-sds.c
@@ -499,7 +499,7 @@ sds_fetch_registers (int regno)
/* (should warn about reply too short) */
for (i = 0; i < NUM_REGS; i++)
- supply_register (i, &regs[REGISTER_BYTE (i)]);
+ supply_register (i, &regs[DEPRECATED_REGISTER_BYTE (i)]);
}
/* Prepare to store registers. Since we may send them all, we have to
diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c
index d21025c78a9..74665e8d20e 100644
--- a/gdb/remote-vx.c
+++ b/gdb/remote-vx.c
@@ -255,11 +255,11 @@ vx_create_inferior (char *exec_file, char *args, char **env)
argument string ARGSTRING. */
static void
-parse_args (register char *arg_string, arg_array *arg_struct)
+parse_args (char *arg_string, arg_array *arg_struct)
{
- register int arg_count = 0; /* number of arguments */
- register int arg_index = 0;
- register char *p0;
+ int arg_count = 0; /* number of arguments */
+ int arg_index = 0;
+ char *p0;
memset ((char *) arg_struct, '\0', sizeof (arg_array));
@@ -295,7 +295,7 @@ parse_args (register char *arg_string, arg_array *arg_struct)
to the first non-white character. */
static char *
-skip_white_space (register char *p)
+skip_white_space (char *p)
{
while (*p == ' ' || *p == '\t')
p++;
@@ -307,9 +307,9 @@ skip_white_space (register char *p)
if no whitespace is found. */
static char *
-find_white_space (register char *p)
+find_white_space (char *p)
{
- register int c;
+ int c;
while ((c = *p) != ' ' && c != '\t' && c)
{
@@ -934,7 +934,7 @@ sleep_ms (long ms)
static ptid_t
vx_wait (ptid_t ptid_to_wait_for, struct target_waitstatus *status)
{
- register int pid;
+ int pid;
RDB_EVENT rdbEvent;
int quit_failed;
@@ -1139,7 +1139,7 @@ vx_open (char *args, int from_tty)
pLoadFile = &loadTable.tbl_ent[i];
#ifdef WRS_ORIG
{
- register int desc;
+ int desc;
struct cleanup *old_chain;
char *fullname = NULL;
diff --git a/gdb/remote-vx68.c b/gdb/remote-vx68.c
index e7f138d1d35..3e21fe6b602 100644
--- a/gdb/remote-vx68.c
+++ b/gdb/remote-vx68.c
@@ -88,10 +88,10 @@ vx_read_register (int regno)
bcopy (&mc68k_greg_packet[MC68K_R_D0], deprecated_registers,
16 * MC68K_GREG_SIZE);
bcopy (&mc68k_greg_packet[MC68K_R_SR],
- &deprecated_registers[REGISTER_BYTE (PS_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
MC68K_GREG_SIZE);
bcopy (&mc68k_greg_packet[MC68K_R_PC],
- &deprecated_registers[REGISTER_BYTE (PC_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)],
MC68K_GREG_SIZE);
/* Get floating-point registers, if the target system has them.
@@ -103,17 +103,17 @@ vx_read_register (int regno)
PTRACE_GETFPREGS);
bcopy (&mc68k_fpreg_packet[MC68K_R_FP0],
- &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
MC68K_FPREG_SIZE * 8);
bcopy (&mc68k_fpreg_packet[MC68K_R_FPCR],
- &deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
}
else
{
- bzero (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ bzero (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
MC68K_FPREG_SIZE * 8);
- bzero (&deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
+ bzero (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
}
@@ -136,9 +136,9 @@ vx_write_register (int regno)
bcopy (deprecated_registers, &mc68k_greg_packet[MC68K_R_D0],
16 * MC68K_GREG_SIZE);
- bcopy (&deprecated_registers[REGISTER_BYTE (PS_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
&mc68k_greg_packet[MC68K_R_SR], MC68K_GREG_SIZE);
- bcopy (&deprecated_registers[REGISTER_BYTE (PC_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)],
&mc68k_greg_packet[MC68K_R_PC], MC68K_GREG_SIZE);
net_write_registers (mc68k_greg_packet, MC68K_GREG_PLEN, PTRACE_SETREGS);
@@ -147,10 +147,10 @@ vx_write_register (int regno)
if (target_has_fp)
{
- bcopy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
&mc68k_fpreg_packet[MC68K_R_FP0],
MC68K_FPREG_SIZE * 8);
- bcopy (&deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
&mc68k_fpreg_packet[MC68K_R_FPCR],
MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
diff --git a/gdb/remote-vxmips.c b/gdb/remote-vxmips.c
index 441bd9bb2da..28a4070b751 100644
--- a/gdb/remote-vxmips.c
+++ b/gdb/remote-vxmips.c
@@ -109,13 +109,13 @@ vx_read_register (int regno)
/* Copy SR, LO, HI, and PC. */
bcopy (&mips_greg_packet[MIPS_R_SR],
- &deprecated_registers[REGISTER_BYTE (PS_REGNUM)], MIPS_GREG_SIZE);
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], MIPS_GREG_SIZE);
bcopy (&mips_greg_packet[MIPS_R_LO],
- &deprecated_registers[REGISTER_BYTE (LO_REGNUM)], MIPS_GREG_SIZE);
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (LO_REGNUM)], MIPS_GREG_SIZE);
bcopy (&mips_greg_packet[MIPS_R_HI],
- &deprecated_registers[REGISTER_BYTE (HI_REGNUM)], MIPS_GREG_SIZE);
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (HI_REGNUM)], MIPS_GREG_SIZE);
bcopy (&mips_greg_packet[MIPS_R_PC],
- &deprecated_registers[REGISTER_BYTE (PC_REGNUM)], MIPS_GREG_SIZE);
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)], MIPS_GREG_SIZE);
/* If the target has floating point registers, fetch them.
Otherwise, zero the floating point register values in
@@ -130,20 +130,20 @@ vx_read_register (int regno)
/* Copy the floating point registers. */
bcopy (&mips_fpreg_packet[MIPS_R_FP0],
- &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
/* Copy the floating point control/status register (fpcsr). */
bcopy (&mips_fpreg_packet[MIPS_R_FPCSR],
- &deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (FCRCS_REGNUM)],
REGISTER_RAW_SIZE (FCRCS_REGNUM));
}
else
{
- bzero ((char *) &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ bzero ((char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
- bzero ((char *) &deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)],
+ bzero ((char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (FCRCS_REGNUM)],
REGISTER_RAW_SIZE (FCRCS_REGNUM));
}
@@ -168,13 +168,13 @@ vx_write_register (int regno)
/* Copy SR, LO, HI, and PC. */
- bcopy (&deprecated_registers[REGISTER_BYTE (PS_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
&mips_greg_packet[MIPS_R_SR], MIPS_GREG_SIZE);
- bcopy (&deprecated_registers[REGISTER_BYTE (LO_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (LO_REGNUM)],
&mips_greg_packet[MIPS_R_LO], MIPS_GREG_SIZE);
- bcopy (&deprecated_registers[REGISTER_BYTE (HI_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (HI_REGNUM)],
&mips_greg_packet[MIPS_R_HI], MIPS_GREG_SIZE);
- bcopy (&deprecated_registers[REGISTER_BYTE (PC_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)],
&mips_greg_packet[MIPS_R_PC], MIPS_GREG_SIZE);
net_write_registers (mips_greg_packet, MIPS_GREG_PLEN, PTRACE_SETREGS);
@@ -185,13 +185,13 @@ vx_write_register (int regno)
{
/* Copy the floating point data registers. */
- bcopy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
&mips_fpreg_packet[MIPS_R_FP0],
REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
/* Copy the floating point control/status register (fpcsr). */
- bcopy (&deprecated_registers[REGISTER_BYTE (FCRCS_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FCRCS_REGNUM)],
&mips_fpreg_packet[MIPS_R_FPCSR],
REGISTER_RAW_SIZE (FCRCS_REGNUM));
diff --git a/gdb/remote-vxsparc.c b/gdb/remote-vxsparc.c
index 8b554282194..339b99ff298 100644
--- a/gdb/remote-vxsparc.c
+++ b/gdb/remote-vxsparc.c
@@ -92,18 +92,18 @@ vx_read_register (int regno)
as defined in "tm-sparc.h". */
bcopy (&sparc_greg_packet[SPARC_R_G0],
- &deprecated_registers[REGISTER_BYTE (G0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (G0_REGNUM)],
32 * SPARC_GREG_SIZE);
bcopy (&sparc_greg_packet[SPARC_R_Y],
- &deprecated_registers[REGISTER_BYTE (Y_REGNUM)], 6 * SPARC_GREG_SIZE);
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (Y_REGNUM)], 6 * SPARC_GREG_SIZE);
/* Now write the local and in registers to the register window spill
area in the frame. VxWorks does not do this for the active frame
automatically; it greatly simplifies debugging. */
- sp = extract_unsigned_integer (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)],
+ sp = extract_unsigned_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (SP_REGNUM)],
REGISTER_RAW_SIZE (SP_REGNUM));
- write_memory (sp, &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
+ write_memory (sp, &deprecated_registers[DEPRECATED_REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
/* If the target has floating point registers, fetch them.
@@ -116,17 +116,17 @@ vx_read_register (int regno)
net_read_registers (sparc_fpreg_packet, SPARC_FPREG_PLEN,
PTRACE_GETFPREGS);
bcopy (&sparc_fpreg_packet[SPARC_R_FP0],
- &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
32 * SPARC_FPREG_SIZE);
bcopy (&sparc_fpreg_packet[SPARC_R_FSR],
- &deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (FPS_REGNUM)],
1 * SPARC_FPREG_SIZE);
}
else
{
- bzero (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ bzero (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
32 * SPARC_FPREG_SIZE);
- bzero (&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ bzero (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPS_REGNUM)],
1 * SPARC_FPREG_SIZE);
}
@@ -157,16 +157,16 @@ vx_write_register (int regno)
if (regno >= 0)
{
if ((G0_REGNUM <= regno && regno <= I7_REGNUM)
- || (Y_REGNUM <= regno && regno <= NPC_REGNUM))
+ || (Y_REGNUM <= regno && regno <= DEPRECATED_NPC_REGNUM))
in_fp_regs = 0;
else
in_gp_regs = 0;
}
if (in_gp_regs)
{
- bcopy (&deprecated_registers[REGISTER_BYTE (G0_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (G0_REGNUM)],
&sparc_greg_packet[SPARC_R_G0], 32 * SPARC_GREG_SIZE);
- bcopy (&deprecated_registers[REGISTER_BYTE (Y_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (Y_REGNUM)],
&sparc_greg_packet[SPARC_R_Y], 6 * SPARC_GREG_SIZE);
net_write_registers (sparc_greg_packet, SPARC_GREG_PLEN, PTRACE_SETREGS);
@@ -176,9 +176,9 @@ vx_write_register (int regno)
if (regno < 0 || (L0_REGNUM <= regno && regno <= I7_REGNUM))
{
- sp = extract_unsigned_integer (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)],
+ sp = extract_unsigned_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (SP_REGNUM)],
REGISTER_RAW_SIZE (SP_REGNUM));
- write_memory (sp, &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
+ write_memory (sp, &deprecated_registers[DEPRECATED_REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
}
}
@@ -187,9 +187,9 @@ vx_write_register (int regno)
if (in_fp_regs && target_has_fp)
{
- bcopy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
&sparc_fpreg_packet[SPARC_R_FP0], 32 * SPARC_FPREG_SIZE);
- bcopy (&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPS_REGNUM)],
&sparc_fpreg_packet[SPARC_R_FSR], 1 * SPARC_FPREG_SIZE);
net_write_registers (sparc_fpreg_packet, SPARC_FPREG_PLEN,
diff --git a/gdb/remote.c b/gdb/remote.c
index c024d08dee9..ae17b53c8e8 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -271,7 +271,7 @@ init_remote_state (struct gdbarch *gdbarch)
struct packet_reg *r = &rs->regs[regnum];
r->pnum = regnum;
r->regnum = regnum;
- r->offset = REGISTER_BYTE (regnum);
+ r->offset = DEPRECATED_REGISTER_BYTE (regnum);
r->in_g_packet = (regnum < NUM_REGS);
/* ...name = REGISTER_NAME (regnum); */
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index ea2457040aa..0c7c122f58b 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -646,7 +646,7 @@ vmap_secs (struct vmap *vp, LdInfo *ldi, int arch64)
static void
vmap_symtab (struct vmap *vp)
{
- register struct objfile *objfile;
+ struct objfile *objfile;
struct section_offsets *new_offsets;
int i;
@@ -720,7 +720,7 @@ static struct vmap *
add_vmap (LdInfo *ldi)
{
bfd *abfd, *last;
- register char *mem, *objname, *filename;
+ char *mem, *objname, *filename;
struct objfile *obj;
struct vmap *vp;
int fd;
@@ -803,7 +803,7 @@ static void
vmap_ldinfo (LdInfo *ldi)
{
struct stat ii, vi;
- register struct vmap *vp;
+ struct vmap *vp;
int got_one, retried;
int got_exec_file = 0;
uint next;
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 9f3e9ea66b3..0d663b753c6 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -48,6 +48,7 @@
#include "ppc-tdep.h"
#include "gdb_assert.h"
+#include "dis-asm.h"
/* If the kernel has to deliver a signal, it pushes a sigcontext
structure on the stack and then calls the signal handler, passing
@@ -1053,7 +1054,7 @@ rs6000_pop_frame (void)
addr = prev_sp + fdata.gpr_offset;
for (ii = fdata.saved_gpr; ii <= 31; ++ii)
{
- read_memory (addr, &deprecated_registers[REGISTER_BYTE (ii)],
+ read_memory (addr, &deprecated_registers[DEPRECATED_REGISTER_BYTE (ii)],
wordsize);
addr += wordsize;
}
@@ -1064,7 +1065,7 @@ rs6000_pop_frame (void)
addr = prev_sp + fdata.fpr_offset;
for (ii = fdata.saved_fpr; ii <= 31; ++ii)
{
- read_memory (addr, &deprecated_registers[REGISTER_BYTE (ii + FP0_REGNUM)], 8);
+ read_memory (addr, &deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + FP0_REGNUM)], 8);
addr += 8;
}
}
@@ -1074,25 +1075,6 @@ rs6000_pop_frame (void)
flush_cached_frames ();
}
-/* Fixup the call sequence of a dummy function, with the real function
- address. Its arguments will be passed by gdb. */
-
-static void
-rs6000_fix_call_dummy (char *dummyname, CORE_ADDR pc, CORE_ADDR fun,
- int nargs, struct value **args, struct type *type,
- int gcc_p)
-{
- int ii;
- CORE_ADDR target_addr;
-
- if (rs6000_find_toc_address_hook != NULL)
- {
- CORE_ADDR tocvalue = (*rs6000_find_toc_address_hook) (fun);
- write_register (gdbarch_tdep (current_gdbarch)->ppc_toc_regnum,
- tocvalue);
- }
-}
-
/* All the ABI's require 16 byte alignment. */
static CORE_ADDR
rs6000_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
@@ -1117,9 +1099,12 @@ rs6000_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
starting from r4. */
static CORE_ADDR
-rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
- int struct_return, CORE_ADDR struct_addr)
+rs6000_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+ struct regcache *regcache, CORE_ADDR bp_addr,
+ int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
int ii;
int len = 0;
int argno; /* current argument number */
@@ -1134,14 +1119,19 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
CORE_ADDR saved_sp;
/* The first eight words of ther arguments are passed in registers.
- Copy them appropriately.
-
- If the function is returning a `struct', then the first word (which
- will be passed in r3) is used for struct return address. In that
- case we should advance one word and start from r4 register to copy
- parameters. */
-
- ii = struct_return ? 1 : 0;
+ Copy them appropriately. */
+ ii = 0;
+
+ /* If the function is returning a `struct', then the first word
+ (which will be passed in r3) is used for struct return address.
+ In that case we should advance one word and start from r4
+ register to copy parameters. */
+ if (struct_return)
+ {
+ regcache_raw_write_unsigned (regcache, tdep->ppc_gp0_regnum + 3,
+ struct_addr);
+ ii++;
+ }
/*
effectively indirect call... gcc does...
@@ -1181,7 +1171,7 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
printf_unfiltered (
"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
- memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
VALUE_CONTENTS (arg),
len);
++f_argno;
@@ -1193,9 +1183,9 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
/* Argument takes more than one register. */
while (argbytes < len)
{
- memset (&deprecated_registers[REGISTER_BYTE (ii + 3)], 0,
+ memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0,
reg_size);
- memcpy (&deprecated_registers[REGISTER_BYTE (ii + 3)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)],
((char *) VALUE_CONTENTS (arg)) + argbytes,
(len - argbytes) > reg_size
? reg_size : len - argbytes);
@@ -1211,8 +1201,8 @@ rs6000_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
/* Argument can fit in one register. No problem. */
int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0;
- memset (&deprecated_registers[REGISTER_BYTE (ii + 3)], 0, reg_size);
- memcpy ((char *)&deprecated_registers[REGISTER_BYTE (ii + 3)] + adj,
+ memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0, reg_size);
+ memcpy ((char *)&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)] + adj,
VALUE_CONTENTS (arg), len);
}
++argno;
@@ -1256,14 +1246,6 @@ ran_out_of_registers_for_arguments:
space = (space + 15) & -16;
sp -= space;
- /* This is another instance we need to be concerned about
- securing our stack space. If we write anything underneath %sp
- (r1), we might conflict with the kernel who thinks he is free
- to use this area. So, update %sp first before doing anything
- else. */
-
- write_register (SP_REGNUM, sp);
-
/* If the last argument copied into the registers didn't fit there
completely, push the rest of it into stack. */
@@ -1294,7 +1276,7 @@ ran_out_of_registers_for_arguments:
printf_unfiltered (
"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
- memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
VALUE_CONTENTS (arg),
len);
++f_argno;
@@ -1304,26 +1286,30 @@ ran_out_of_registers_for_arguments:
ii += ((len + 3) & -4) / 4;
}
}
- else
- /* Secure stack areas first, before doing anything else. */
- write_register (SP_REGNUM, sp);
/* set back chain properly */
store_unsigned_integer (tmp_buffer, 4, saved_sp);
write_memory (sp, tmp_buffer, 4);
- target_store_registers (-1);
- return sp;
-}
+ /* Set the stack pointer. According to the ABI, the SP is meant to
+ be set _before_ the corresponding stack space is used. No need
+ for that here though - the target has been completely stopped -
+ it isn't possible for an exception handler to stomp on the stack. */
+ regcache_raw_write_signed (regcache, SP_REGNUM, sp);
-/* Function: ppc_push_return_address (pc, sp)
- Set up the return address for the inferior function call. */
+ /* Point the inferior function call's return address at the dummy's
+ breakpoint. */
+ regcache_raw_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr);
-static CORE_ADDR
-ppc_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
-{
- write_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum,
- CALL_DUMMY_ADDRESS ());
+ /* Set the TOC register, get the value from the objfile reader
+ which, in turn, gets it from the VMAP table. */
+ if (rs6000_find_toc_address_hook != NULL)
+ {
+ CORE_ADDR tocvalue = (*rs6000_find_toc_address_hook) (func_addr);
+ regcache_raw_write_signed (regcache, tdep->ppc_toc_regnum, tocvalue);
+ }
+
+ target_store_registers (-1);
return sp;
}
@@ -1386,6 +1372,18 @@ e500_extract_return_value (struct type *valtype, struct regcache *regbuf, void *
}
}
+/* PowerOpen always puts structures in memory. Vectors, which were
+ added later, do get returned in a register though. */
+
+static int
+rs6000_use_struct_convention (int gcc_p, struct type *value_type)
+{
+ if ((TYPE_LENGTH (value_type) == 16 || TYPE_LENGTH (value_type) == 8)
+ && TYPE_VECTOR (value_type))
+ return 0;
+ return 1;
+}
+
static void
rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
{
@@ -1403,11 +1401,11 @@ rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
if (TYPE_LENGTH (valtype) > 4) /* this is a double */
memcpy (valbuf,
- &regbuf[REGISTER_BYTE (FP0_REGNUM + 1)],
+ &regbuf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)],
TYPE_LENGTH (valtype));
else
{ /* float */
- memcpy (&dd, &regbuf[REGISTER_BYTE (FP0_REGNUM + 1)], 8);
+ memcpy (&dd, &regbuf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], 8);
ff = (float) dd;
memcpy (valbuf, &ff, sizeof (float));
}
@@ -1416,7 +1414,7 @@ rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
&& TYPE_LENGTH (valtype) == 16
&& TYPE_VECTOR (valtype))
{
- memcpy (valbuf, regbuf + REGISTER_BYTE (tdep->ppc_vr0_regnum + 2),
+ memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (tdep->ppc_vr0_regnum + 2),
TYPE_LENGTH (valtype));
}
else
@@ -1427,7 +1425,7 @@ rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
offset = REGISTER_RAW_SIZE (3) - TYPE_LENGTH (valtype);
memcpy (valbuf,
- regbuf + REGISTER_BYTE (3) + offset,
+ regbuf + DEPRECATED_REGISTER_BYTE (3) + offset,
TYPE_LENGTH (valtype));
}
}
@@ -1477,7 +1475,7 @@ rs6000_in_solib_return_trampoline (CORE_ADDR pc, char *name)
CORE_ADDR
rs6000_skip_trampoline_code (CORE_ADDR pc)
{
- register unsigned int ii, op;
+ unsigned int ii, op;
int rel;
CORE_ADDR solib_target_pc;
struct minimal_symbol *msymbol;
@@ -1817,7 +1815,7 @@ rs6000_frame_chain (struct frame_info *thisframe)
frame. */
return read_memory_addr (get_frame_base (thisframe), wordsize);
- if (inside_entry_file (get_frame_pc (thisframe))
+ if (deprecated_inside_entry_file (get_frame_pc (thisframe))
|| get_frame_pc (thisframe) == entry_point_address ())
return 0;
@@ -2048,16 +2046,6 @@ rs6000_stab_reg_to_regnum (int num)
return regnum;
}
-/* Store the address of the place in which to copy the structure the
- subroutine will return. */
-
-static void
-rs6000_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- write_register (tdep->ppc_gp0_regnum + 3, addr);
-}
-
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format. */
static void
@@ -2093,18 +2081,18 @@ rs6000_store_return_value (struct type *type, char *valbuf)
Say a double_double_double type could be returned in
FPR1/FPR2/FPR3 triple. */
- deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM + 1), valbuf,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1), valbuf,
TYPE_LENGTH (type));
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
if (TYPE_LENGTH (type) == 16
&& TYPE_VECTOR (type))
- deprecated_write_register_bytes (REGISTER_BYTE (tdep->ppc_vr0_regnum + 2),
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (tdep->ppc_vr0_regnum + 2),
valbuf, TYPE_LENGTH (type));
}
else
/* Everything else is returned in GPR3 and up. */
- deprecated_write_register_bytes (REGISTER_BYTE (gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + 3),
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + 3),
valbuf, TYPE_LENGTH (type));
}
@@ -2915,7 +2903,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_print_insn (gdbarch, gdb_print_insn_powerpc);
set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
- set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
set_gdbarch_num_regs (gdbarch, v->nregs);
set_gdbarch_num_pseudo_regs (gdbarch, v->npregs);
@@ -2924,9 +2911,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_register_bytes (gdbarch, off);
set_gdbarch_deprecated_register_byte (gdbarch, rs6000_register_byte);
set_gdbarch_deprecated_register_raw_size (gdbarch, rs6000_register_raw_size);
- set_gdbarch_deprecated_max_register_raw_size (gdbarch, 16);
- set_gdbarch_deprecated_register_virtual_size (gdbarch, generic_register_size);
- set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 16);
set_gdbarch_deprecated_register_virtual_type (gdbarch, rs6000_register_virtual_type);
set_gdbarch_ptr_bit (gdbarch, wordsize * TARGET_CHAR_BIT);
@@ -2942,10 +2926,14 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_char_signed (gdbarch, 0);
- set_gdbarch_deprecated_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
set_gdbarch_frame_align (gdbarch, rs6000_frame_align);
+ if (sysv_abi && wordsize == 8)
+ /* PPC64 SYSV. */
+ set_gdbarch_frame_red_zone_size (gdbarch, 288);
+ else if (!sysv_abi && wordsize == 4)
+ /* PowerOpen / AIX 32 bit. */
+ set_gdbarch_frame_red_zone_size (gdbarch, 220);
set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
- set_gdbarch_deprecated_push_return_address (gdbarch, ppc_push_return_address);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_deprecated_register_convertible (gdbarch, rs6000_register_convertible);
@@ -2960,11 +2948,10 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
64-bit code. At some point in the future, this matter needs to be
revisited. */
if (sysv_abi && wordsize == 4)
- set_gdbarch_deprecated_push_arguments (gdbarch, ppc_sysv_abi_push_arguments);
+ set_gdbarch_push_dummy_call (gdbarch, ppc_sysv_abi_push_dummy_call);
else
- set_gdbarch_deprecated_push_arguments (gdbarch, rs6000_push_arguments);
+ set_gdbarch_push_dummy_call (gdbarch, rs6000_push_dummy_call);
- set_gdbarch_deprecated_store_struct_return (gdbarch, rs6000_store_struct_return);
set_gdbarch_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
set_gdbarch_deprecated_pop_frame (gdbarch, rs6000_pop_frame);
@@ -2982,7 +2969,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
ppc_sysv_abi_use_struct_convention);
else
set_gdbarch_use_struct_convention (gdbarch,
- generic_use_struct_convention);
+ rs6000_use_struct_convention);
set_gdbarch_frameless_function_invocation (gdbarch,
rs6000_frameless_function_invocation);
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 0f3bd41f764..ee6574d9557 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -39,7 +39,7 @@
#include "regcache.h"
#include "value.h"
#include "gdb_assert.h"
-
+#include "dis-asm.h"
@@ -122,8 +122,7 @@ struct frame_extra_info
static CORE_ADDR s390_frame_saved_pc_nofix (struct frame_info *fi);
static int
-s390_readinstruction (bfd_byte instr[], CORE_ADDR at,
- struct disassemble_info *info)
+s390_readinstruction (bfd_byte instr[], CORE_ADDR at)
{
int instrlen;
@@ -133,12 +132,12 @@ s390_readinstruction (bfd_byte instr[], CORE_ADDR at,
4,
6
};
- if ((*info->read_memory_func) (at, &instr[0], 2, info))
+ if (target_read_memory (at, &instr[0], 2))
return -1;
instrlen = s390_instrlen[instr[0] >> 6];
if (instrlen > 2)
{
- if ((*info->read_memory_func) (at + 2, &instr[2], instrlen - 2, info))
+ if (target_read_memory (at + 2, &instr[2], instrlen - 2))
return -1;
}
return instrlen;
@@ -904,7 +903,7 @@ s390_get_signal_frame_info (struct frame_info *fi)
/* We're definitely backtracing from a signal handler. */
CORE_ADDR *saved_regs = get_frame_saved_regs (fi);
CORE_ADDR save_reg_addr = (get_frame_extra_info (next_frame)->sigcontext
- + REGISTER_BYTE (S390_GP0_REGNUM));
+ + DEPRECATED_REGISTER_BYTE (S390_GP0_REGNUM));
int reg;
for (reg = 0; reg < S390_NUM_GPRS; reg++)
@@ -936,9 +935,6 @@ s390_get_frame_info (CORE_ADDR start_pc,
-1 if we got an error trying to read memory. */
int result = 0;
- /* We just use this for reading instructions. */
- disassemble_info info;
-
/* The current PC for our abstract interpretation. */
CORE_ADDR pc;
@@ -966,8 +962,6 @@ s390_get_frame_info (CORE_ADDR start_pc,
the SP, FP, or back chain. */
CORE_ADDR after_last_frame_setup_insn = start_pc;
- info.read_memory_func = deprecated_tm_print_insn_info.read_memory_func;
-
/* Set up everything's initial value. */
{
int i;
@@ -991,7 +985,7 @@ s390_get_frame_info (CORE_ADDR start_pc,
for (pc = start_pc; ; pc = next_pc)
{
bfd_byte insn[S390_MAX_INSTR_SIZE];
- int insn_len = s390_readinstruction (insn, pc, &info);
+ int insn_len = s390_readinstruction (insn, pc);
/* Fields for various kinds of instructions. */
unsigned int b2, r1, r2, d2, x2, r3;
@@ -1487,11 +1481,9 @@ static int
s390_check_function_end (CORE_ADDR pc)
{
bfd_byte instr[S390_MAX_INSTR_SIZE];
- disassemble_info info;
int regidx, instrlen;
- info.read_memory_func = deprecated_tm_print_insn_info.read_memory_func;
- instrlen = s390_readinstruction (instr, pc, &info);
+ instrlen = s390_readinstruction (instr, pc);
if (instrlen < 0)
return -1;
/* check for BR */
@@ -1500,7 +1492,7 @@ s390_check_function_end (CORE_ADDR pc)
regidx = instr[1] & 0xf;
/* Check for LMG or LG */
instrlen =
- s390_readinstruction (instr, pc - (GDB_TARGET_IS_ESAME ? 6 : 4), &info);
+ s390_readinstruction (instr, pc - (GDB_TARGET_IS_ESAME ? 6 : 4));
if (instrlen < 0)
return -1;
if (GDB_TARGET_IS_ESAME)
@@ -1517,8 +1509,7 @@ s390_check_function_end (CORE_ADDR pc)
return 0;
if (regidx == 14)
return 1;
- instrlen = s390_readinstruction (instr, pc - (GDB_TARGET_IS_ESAME ? 12 : 8),
- &info);
+ instrlen = s390_readinstruction (instr, pc - (GDB_TARGET_IS_ESAME ? 12 : 8));
if (instrlen < 0)
return -1;
if (GDB_TARGET_IS_ESAME)
@@ -1619,7 +1610,6 @@ s390_is_sigreturn (CORE_ADDR pc, struct frame_info *sighandler_fi,
CORE_ADDR *sregs, CORE_ADDR *sigcaller_pc)
{
bfd_byte instr[S390_MAX_INSTR_SIZE];
- disassemble_info info;
int instrlen;
CORE_ADDR scontext;
int retval = 0;
@@ -1628,8 +1618,7 @@ s390_is_sigreturn (CORE_ADDR pc, struct frame_info *sighandler_fi,
scontext = temp_sregs = 0;
- info.read_memory_func = deprecated_tm_print_insn_info.read_memory_func;
- instrlen = s390_readinstruction (instr, pc, &info);
+ instrlen = s390_readinstruction (instr, pc);
if (sigcaller_pc)
*sigcaller_pc = 0;
if (((instrlen == S390_SYSCALL_SIZE) &&
@@ -1673,8 +1662,7 @@ s390_is_sigreturn (CORE_ADDR pc, struct frame_info *sighandler_fi,
*sigcaller_pc =
ADDR_BITS_REMOVE ((CORE_ADDR)
read_memory_integer (temp_sregs +
- REGISTER_BYTE
- (S390_PC_REGNUM),
+ DEPRECATED_REGISTER_BYTE (S390_PC_REGNUM),
S390_PSW_ADDR_SIZE));
}
}
@@ -1844,7 +1832,7 @@ s390_frame_chain (struct frame_info *thisframe)
{
/* read sigregs,regs.gprs[11 or 15] */
prev_fp = read_memory_integer (sregs +
- REGISTER_BYTE (S390_GP0_REGNUM +
+ DEPRECATED_REGISTER_BYTE (S390_GP0_REGNUM +
(prev_fextra_info.
frame_pointer_saved_pc
? 11 : 15)),
@@ -1897,7 +1885,7 @@ s390_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
int len = TYPE_LENGTH (valtype);
if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
- memcpy (valbuf, &regbuf[REGISTER_BYTE (S390_FP0_REGNUM)], len);
+ memcpy (valbuf, &regbuf[DEPRECATED_REGISTER_BYTE (S390_FP0_REGNUM)], len);
else
{
int offset = 0;
@@ -1905,7 +1893,7 @@ s390_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
if (TYPE_LENGTH (valtype) < S390_GPR_SIZE)
offset = S390_GPR_SIZE - TYPE_LENGTH (valtype);
memcpy (valbuf,
- regbuf + REGISTER_BYTE (S390_GP0_REGNUM + 2) + offset,
+ regbuf + DEPRECATED_REGISTER_BYTE (S390_GP0_REGNUM + 2) + offset,
TYPE_LENGTH (valtype));
}
}
@@ -1956,7 +1944,7 @@ s390_store_return_value (struct type *valtype, char *valbuf)
{
if (TYPE_LENGTH (valtype) == 4
|| TYPE_LENGTH (valtype) == 8)
- deprecated_write_register_bytes (REGISTER_BYTE (S390_FP0_REGNUM),
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (S390_FP0_REGNUM),
valbuf, TYPE_LENGTH (valtype));
else
error ("GDB is unable to return `long double' values "
@@ -1967,30 +1955,10 @@ s390_store_return_value (struct type *valtype, char *valbuf)
value =
s390_promote_integer_argument (valtype, valbuf, reg_buff, &arglen);
/* Everything else is returned in GPR2 and up. */
- deprecated_write_register_bytes (REGISTER_BYTE (S390_GP0_REGNUM + 2),
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (S390_GP0_REGNUM + 2),
value, arglen);
}
}
-static int
-gdb_print_insn_s390 (bfd_vma memaddr, disassemble_info * info)
-{
- bfd_byte instrbuff[S390_MAX_INSTR_SIZE];
- int instrlen, cnt;
-
- instrlen = s390_readinstruction (instrbuff, (CORE_ADDR) memaddr, info);
- if (instrlen < 0)
- {
- (*info->memory_error_func) (instrlen, memaddr, info);
- return -1;
- }
- for (cnt = 0; cnt < instrlen; cnt++)
- info->fprintf_func (info->stream, "%02X ", instrbuff[cnt]);
- for (cnt = instrlen; cnt < S390_MAX_INSTR_SIZE; cnt++)
- info->fprintf_func (info->stream, " ");
- instrlen = print_insn_s390 (memaddr, info);
- return instrlen;
-}
-
/* Not the most efficent code in the world */
@@ -2394,7 +2362,7 @@ s390_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
{
/* When we store a single-precision value in an FP register,
it occupies the leftmost bits. */
- deprecated_write_register_bytes (REGISTER_BYTE (S390_FP0_REGNUM + fr),
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (S390_FP0_REGNUM + fr),
VALUE_CONTENTS (arg),
TYPE_LENGTH (type));
fr += 2;
@@ -2567,7 +2535,7 @@ s390_addr_bits_remove (CORE_ADDR addr)
static CORE_ADDR
s390_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
- write_register (S390_RETADDR_REGNUM, CALL_DUMMY_ADDRESS ());
+ write_register (S390_RETADDR_REGNUM, entry_point_address ());
return sp;
}
@@ -2722,6 +2690,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_s390);
+
return gdbarch;
}
@@ -2735,6 +2705,4 @@ _initialize_s390_tdep (void)
/* Hook us into the gdbarch mechanism. */
register_gdbarch_init (bfd_arch_s390, s390_gdbarch_init);
- if (!deprecated_tm_print_insn) /* Someone may have already set it */
- deprecated_tm_print_insn = gdb_print_insn_s390;
}
diff --git a/gdb/scm-exp.c b/gdb/scm-exp.c
index 7464ecfc6bf..41d78afad71 100644
--- a/gdb/scm-exp.c
+++ b/gdb/scm-exp.c
@@ -1,5 +1,6 @@
/* Scheme/Guile language support routines for GDB, the GNU debugger.
- Copyright 1995, 1996, 2000 Free Software Foundation, Inc.
+
+ Copyright 1995, 1996, 2000, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -237,7 +238,7 @@ scm_read_token (int c, int weird)
static int
scm_skip_ws (void)
{
- register int c;
+ int c;
while (1)
switch ((c = *lexptr++))
{
diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c
index 0a59ea94aeb..83d88ccd632 100644
--- a/gdb/scm-lang.c
+++ b/gdb/scm-lang.c
@@ -202,8 +202,8 @@ scm_evaluate_string (char *str, int len)
}
static struct value *
-evaluate_subexp_scm (struct type *expect_type, register struct expression *exp,
- register int *pos, enum noside noside)
+evaluate_subexp_scm (struct type *expect_type, struct expression *exp,
+ int *pos, enum noside noside)
{
enum exp_opcode op = exp->elts[*pos].opcode;
int len, pc;
diff --git a/gdb/sh-stub.c b/gdb/sh-stub.c
index b6be51f2ab2..73357b4a94e 100644
--- a/gdb/sh-stub.c
+++ b/gdb/sh-stub.c
@@ -450,10 +450,10 @@ retry:
/* send the packet in buffer. */
static void
-putpacket (register char *buffer)
+putpacket (char *buffer)
{
- register int checksum;
- register int count;
+ int checksum;
+ int count;
/* $<packet info>#<checksum>. */
do
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index dc3e99228d2..529c187b706 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -46,15 +46,14 @@
#include "elf-bfd.h"
#include "solib-svr4.h"
-/* sh64 flags */
+/* sh flags */
#include "elf/sh.h"
/* registers numbers shared with the simulator */
#include "gdb/sim-sh.h"
-void (*sh_show_regs) (void);
-CORE_ADDR (*skip_prologue_hard_way) (CORE_ADDR);
+static void (*sh_show_regs) (void);
-#define SH_DEFAULT_NUM_REGS 59
+#define SH_NUM_REGS 59
/* Define other aspects of the stack frame.
we keep a copy of the worked out return pc lying around, since it
@@ -257,83 +256,6 @@ sh_sh4_register_name (int reg_nr)
return register_names[reg_nr];
}
-static const char *
-sh_sh64_register_name (int reg_nr)
-{
- static char *register_names[] =
- {
- /* SH MEDIA MODE (ISA 32) */
- /* general registers (64-bit) 0-63 */
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
- "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
- "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
- "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39",
- "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47",
- "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55",
- "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63",
-
- /* pc (64-bit) 64 */
- "pc",
-
- /* status reg., saved status reg., saved pc reg. (64-bit) 65-67 */
- "sr", "ssr", "spc",
-
- /* target registers (64-bit) 68-75*/
- "tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7",
-
- /* floating point state control register (32-bit) 76 */
- "fpscr",
-
- /* single precision floating point registers (32-bit) 77-140*/
- "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7",
- "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
- "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23",
- "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31",
- "fr32", "fr33", "fr34", "fr35", "fr36", "fr37", "fr38", "fr39",
- "fr40", "fr41", "fr42", "fr43", "fr44", "fr45", "fr46", "fr47",
- "fr48", "fr49", "fr50", "fr51", "fr52", "fr53", "fr54", "fr55",
- "fr56", "fr57", "fr58", "fr59", "fr60", "fr61", "fr62", "fr63",
-
- /* double precision registers (pseudo) 141-172 */
- "dr0", "dr2", "dr4", "dr6", "dr8", "dr10", "dr12", "dr14",
- "dr16", "dr18", "dr20", "dr22", "dr24", "dr26", "dr28", "dr30",
- "dr32", "dr34", "dr36", "dr38", "dr40", "dr42", "dr44", "dr46",
- "dr48", "dr50", "dr52", "dr54", "dr56", "dr58", "dr60", "dr62",
-
- /* floating point pairs (pseudo) 173-204*/
- "fp0", "fp2", "fp4", "fp6", "fp8", "fp10", "fp12", "fp14",
- "fp16", "fp18", "fp20", "fp22", "fp24", "fp26", "fp28", "fp30",
- "fp32", "fp34", "fp36", "fp38", "fp40", "fp42", "fp44", "fp46",
- "fp48", "fp50", "fp52", "fp54", "fp56", "fp58", "fp60", "fp62",
-
- /* floating point vectors (4 floating point regs) (pseudo) 205-220*/
- "fv0", "fv4", "fv8", "fv12", "fv16", "fv20", "fv24", "fv28",
- "fv32", "fv36", "fv40", "fv44", "fv48", "fv52", "fv56", "fv60",
-
- /* SH COMPACT MODE (ISA 16) (all pseudo) 221-272*/
- "r0_c", "r1_c", "r2_c", "r3_c", "r4_c", "r5_c", "r6_c", "r7_c",
- "r8_c", "r9_c", "r10_c", "r11_c", "r12_c", "r13_c", "r14_c", "r15_c",
- "pc_c",
- "gbr_c", "mach_c", "macl_c", "pr_c", "t_c",
- "fpscr_c", "fpul_c",
- "fr0_c", "fr1_c", "fr2_c", "fr3_c", "fr4_c", "fr5_c", "fr6_c", "fr7_c",
- "fr8_c", "fr9_c", "fr10_c", "fr11_c", "fr12_c", "fr13_c", "fr14_c", "fr15_c",
- "dr0_c", "dr2_c", "dr4_c", "dr6_c", "dr8_c", "dr10_c", "dr12_c", "dr14_c",
- "fv0_c", "fv4_c", "fv8_c", "fv12_c",
- /* FIXME!!!! XF0 XF15, XD0 XD14 ?????*/
- };
-
- if (reg_nr < 0)
- return NULL;
- if (reg_nr >= (sizeof (register_names) / sizeof (*register_names)))
- return NULL;
- return register_names[reg_nr];
-}
-
-#define NUM_PSEUDO_REGS_SH_MEDIA 80
-#define NUM_PSEUDO_REGS_SH_COMPACT 51
-
static const unsigned char *
sh_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
{
@@ -360,109 +282,6 @@ sh_push_dummy_code (struct gdbarch *gdbarch,
return sp;
}
-/* Macros and functions for setting and testing a bit in a minimal
- symbol that marks it as 32-bit function. The MSB of the minimal
- symbol's "info" field is used for this purpose. This field is
- already being used to store the symbol size, so the assumption is
- that the symbol size cannot exceed 2^31.
-
- ELF_MAKE_MSYMBOL_SPECIAL
- tests whether an ELF symbol is "special", i.e. refers
- to a 32-bit function, and sets a "special" bit in a
- minimal symbol to mark it as a 32-bit function
- MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol
- MSYMBOL_SIZE returns the size of the minimal symbol, i.e.
- the "info" field with the "special" bit masked out */
-
-#define MSYMBOL_IS_SPECIAL(msym) \
- (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
-
-static void
-sh64_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
-{
- if (msym == NULL)
- return;
-
- if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_SH5_ISA32)
- {
- MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) | 0x80000000);
- SYMBOL_VALUE_ADDRESS (msym) |= 1;
- }
-}
-
-/* ISA32 (shmedia) function addresses are odd (bit 0 is set). Here
- are some macros to test, set, or clear bit 0 of addresses. */
-#define IS_ISA32_ADDR(addr) ((addr) & 1)
-#define MAKE_ISA32_ADDR(addr) ((addr) | 1)
-#define UNMAKE_ISA32_ADDR(addr) ((addr) & ~1)
-
-static int
-pc_is_isa32 (bfd_vma memaddr)
-{
- struct minimal_symbol *sym;
-
- /* If bit 0 of the address is set, assume this is a
- ISA32 (shmedia) address. */
- if (IS_ISA32_ADDR (memaddr))
- return 1;
-
- /* A flag indicating that this is a ISA32 function is stored by elfread.c in
- the high bit of the info field. Use this to decide if the function is
- ISA16 or ISA32. */
- sym = lookup_minimal_symbol_by_pc (memaddr);
- if (sym)
- return MSYMBOL_IS_SPECIAL (sym);
- else
- return 0;
-}
-
-static const unsigned char *
-sh_sh64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
-{
- /* The BRK instruction for shmedia is
- 01101111 11110101 11111111 11110000
- which translates in big endian mode to 0x6f, 0xf5, 0xff, 0xf0
- and in little endian mode to 0xf0, 0xff, 0xf5, 0x6f */
-
- /* The BRK instruction for shcompact is
- 00000000 00111011
- which translates in big endian mode to 0x0, 0x3b
- and in little endian mode to 0x3b, 0x0*/
-
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- {
- if (pc_is_isa32 (*pcptr))
- {
- static unsigned char big_breakpoint_media[] = {0x6f, 0xf5, 0xff, 0xf0};
- *pcptr = UNMAKE_ISA32_ADDR (*pcptr);
- *lenptr = sizeof (big_breakpoint_media);
- return big_breakpoint_media;
- }
- else
- {
- static unsigned char big_breakpoint_compact[] = {0x0, 0x3b};
- *lenptr = sizeof (big_breakpoint_compact);
- return big_breakpoint_compact;
- }
- }
- else
- {
- if (pc_is_isa32 (*pcptr))
- {
- static unsigned char little_breakpoint_media[] = {0xf0, 0xff, 0xf5, 0x6f};
- *pcptr = UNMAKE_ISA32_ADDR (*pcptr);
- *lenptr = sizeof (little_breakpoint_media);
- return little_breakpoint_media;
- }
- else
- {
- static unsigned char little_breakpoint_compact[] = {0x3b, 0x0};
- *lenptr = sizeof (little_breakpoint_compact);
- return little_breakpoint_compact;
- }
- }
-}
-
/* Prologue looks like
[mov.l <regs>,@-r15]...
[sts.l pr,@-r15]
@@ -487,123 +306,6 @@ sh_sh64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
*/
-/* PTABS/L Rn, TRa 0110101111110001nnnnnnl00aaa0000
- with l=1 and n = 18 0110101111110001010010100aaa0000 */
-#define IS_PTABSL_R18(x) (((x) & 0xffffff8f) == 0x6bf14a00)
-
-/* STS.L PR,@-r0 0100000000100010
- r0-4-->r0, PR-->(r0) */
-#define IS_STS_R0(x) ((x) == 0x4022)
-
-/* STS PR, Rm 0000mmmm00101010
- PR-->Rm */
-#define IS_STS_PR(x) (((x) & 0xf0ff) == 0x2a)
-
-/* MOV.L Rm,@(disp,r15) 00011111mmmmdddd
- Rm-->(dispx4+r15) */
-#define IS_MOV_TO_R15(x) (((x) & 0xff00) == 0x1f00)
-
-/* MOV.L R14,@(disp,r15) 000111111110dddd
- R14-->(dispx4+r15) */
-#define IS_MOV_R14(x) (((x) & 0xfff0) == 0x1fe0)
-
-/* ST.Q R14, disp, R18 101011001110dddddddddd0100100000
- R18-->(dispx8+R14) */
-#define IS_STQ_R18_R14(x) (((x) & 0xfff003ff) == 0xace00120)
-
-/* ST.Q R15, disp, R18 101011001111dddddddddd0100100000
- R18-->(dispx8+R15) */
-#define IS_STQ_R18_R15(x) (((x) & 0xfff003ff) == 0xacf00120)
-
-/* ST.L R15, disp, R18 101010001111dddddddddd0100100000
- R18-->(dispx4+R15) */
-#define IS_STL_R18_R15(x) (((x) & 0xfff003ff) == 0xa8f00120)
-
-/* ST.Q R15, disp, R14 1010 1100 1111 dddd dddd dd00 1110 0000
- R14-->(dispx8+R15) */
-#define IS_STQ_R14_R15(x) (((x) & 0xfff003ff) == 0xacf000e0)
-
-/* ST.L R15, disp, R14 1010 1000 1111 dddd dddd dd00 1110 0000
- R14-->(dispx4+R15) */
-#define IS_STL_R14_R15(x) (((x) & 0xfff003ff) == 0xa8f000e0)
-
-/* ADDI.L R15,imm,R15 1101 0100 1111 ssss ssss ss00 1111 0000
- R15 + imm --> R15 */
-#define IS_ADDIL_SP_MEDIA(x) (((x) & 0xfff003ff) == 0xd4f000f0)
-
-/* ADDI R15,imm,R15 1101 0000 1111 ssss ssss ss00 1111 0000
- R15 + imm --> R15 */
-#define IS_ADDI_SP_MEDIA(x) (((x) & 0xfff003ff) == 0xd0f000f0)
-
-/* ADD.L R15,R63,R14 0000 0000 1111 1000 1111 1100 1110 0000
- R15 + R63 --> R14 */
-#define IS_ADDL_SP_FP_MEDIA(x) ((x) == 0x00f8fce0)
-
-/* ADD R15,R63,R14 0000 0000 1111 1001 1111 1100 1110 0000
- R15 + R63 --> R14 */
-#define IS_ADD_SP_FP_MEDIA(x) ((x) == 0x00f9fce0)
-
-#define IS_MOV_SP_FP_MEDIA(x) (IS_ADDL_SP_FP_MEDIA(x) || IS_ADD_SP_FP_MEDIA(x))
-
-/* MOV #imm, R0 1110 0000 ssss ssss
- #imm-->R0 */
-#define IS_MOV_R0(x) (((x) & 0xff00) == 0xe000)
-
-/* MOV.L @(disp,PC), R0 1101 0000 iiii iiii */
-#define IS_MOVL_R0(x) (((x) & 0xff00) == 0xd000)
-
-/* ADD r15,r0 0011 0000 1111 1100
- r15+r0-->r0 */
-#define IS_ADD_SP_R0(x) ((x) == 0x30fc)
-
-/* MOV.L R14 @-R0 0010 0000 1110 0110
- R14-->(R0-4), R0-4-->R0 */
-#define IS_MOV_R14_R0(x) ((x) == 0x20e6)
-
-/* ADD Rm,R63,Rn Rm+R63-->Rn 0000 00mm mmmm 1001 1111 11nn nnnn 0000
- where Rm is one of r2-r9 which are the argument registers. */
-/* FIXME: Recognize the float and double register moves too! */
-#define IS_MEDIA_IND_ARG_MOV(x) \
-((((x) & 0xfc0ffc0f) == 0x0009fc00) && (((x) & 0x03f00000) >= 0x00200000 && ((x) & 0x03f00000) <= 0x00900000))
-
-/* ST.Q Rn,0,Rm Rm-->Rn+0 1010 11nn nnnn 0000 0000 00mm mmmm 0000
- or ST.L Rn,0,Rm Rm-->Rn+0 1010 10nn nnnn 0000 0000 00mm mmmm 0000
- where Rm is one of r2-r9 which are the argument registers. */
-#define IS_MEDIA_ARG_MOV(x) \
-(((((x) & 0xfc0ffc0f) == 0xac000000) || (((x) & 0xfc0ffc0f) == 0xa8000000)) \
- && (((x) & 0x000003f0) >= 0x00000020 && ((x) & 0x000003f0) <= 0x00000090))
-
-/* ST.B R14,0,Rn Rn-->(R14+0) 1010 0000 1110 0000 0000 00nn nnnn 0000*/
-/* ST.W R14,0,Rn Rn-->(R14+0) 1010 0100 1110 0000 0000 00nn nnnn 0000*/
-/* ST.L R14,0,Rn Rn-->(R14+0) 1010 1000 1110 0000 0000 00nn nnnn 0000*/
-/* FST.S R14,0,FRn Rn-->(R14+0) 1011 0100 1110 0000 0000 00nn nnnn 0000*/
-/* FST.D R14,0,DRn Rn-->(R14+0) 1011 1100 1110 0000 0000 00nn nnnn 0000*/
-#define IS_MEDIA_MOV_TO_R14(x) \
-((((x) & 0xfffffc0f) == 0xa0e00000) \
-|| (((x) & 0xfffffc0f) == 0xa4e00000) \
-|| (((x) & 0xfffffc0f) == 0xa8e00000) \
-|| (((x) & 0xfffffc0f) == 0xb4e00000) \
-|| (((x) & 0xfffffc0f) == 0xbce00000))
-
-/* MOV Rm, Rn Rm-->Rn 0110 nnnn mmmm 0011
- where Rm is r2-r9 */
-#define IS_COMPACT_IND_ARG_MOV(x) \
-((((x) & 0xf00f) == 0x6003) && (((x) & 0x00f0) >= 0x0020) && (((x) & 0x00f0) <= 0x0090))
-
-/* compact direct arg move!
- MOV.L Rn, @r14 0010 1110 mmmm 0010 */
-#define IS_COMPACT_ARG_MOV(x) \
-(((((x) & 0xff0f) == 0x2e02) && (((x) & 0x00f0) >= 0x0020) && ((x) & 0x00f0) <= 0x0090))
-
-/* MOV.B Rm, @R14 0010 1110 mmmm 0000
- MOV.W Rm, @R14 0010 1110 mmmm 0001 */
-#define IS_COMPACT_MOV_TO_R14(x) \
-((((x) & 0xff0f) == 0x2e00) || (((x) & 0xff0f) == 0x2e01))
-
-#define IS_JSR_R0(x) ((x) == 0x400b)
-#define IS_NOP(x) ((x) == 0x0009)
-
-
/* STS.L PR,@-r15 0100111100100010
r15-4-->r15, PR-->(r15) */
#define IS_STS(x) ((x) == 0x4f22)
@@ -620,7 +322,7 @@ sh_sh64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
/* ADD #imm,r15 01111111iiiiiiii
r15+imm-->r15 */
-#define IS_ADD_SP(x) (((x) & 0xff00) == 0x7f00)
+#define IS_ADD_IMM_SP(x) (((x) & 0xff00) == 0x7f00)
#define IS_MOV_R3(x) (((x) & 0xff00) == 0x1a00)
#define IS_SHLL_R3(x) ((x) == 0x4300)
@@ -632,7 +334,9 @@ sh_sh64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
/* FMOV.S FRm,@-Rn Rn-4-->Rn, FRm-->(Rn) 1111nnnnmmmm1011
FMOV DRm,@-Rn Rn-8-->Rn, DRm-->(Rn) 1111nnnnmmm01011
FMOV XDm,@-Rn Rn-8-->Rn, XDm-->(Rn) 1111nnnnmmm11011 */
-#define IS_FMOV(x) (((x) & 0xf00f) == 0xf00b)
+/* CV, 2003-08-28: Only suitable with Rn == SP, therefore name changed to
+ make this entirely clear. */
+#define IS_FPUSH(x) (((x) & 0xf00f) == 0xf00b)
/* MOV Rm,Rn Rm-->Rn 0110nnnnmmmm0011
MOV.L Rm,@(disp,Rn) Rm-->(dispx4+Rn) 0001nnnnmmmmdddd
@@ -696,8 +400,8 @@ sh_skip_prologue_hard_way (CORE_ADDR start_pc)
{
int w = read_memory_integer (here, 2);
here += 2;
- if (IS_FMOV (w) || IS_PUSH (w) || IS_STS (w) || IS_MOV_R3 (w)
- || IS_ADD_R3SP (w) || IS_ADD_SP (w) || IS_SHLL_R3 (w)
+ if (IS_FPUSH (w) || IS_PUSH (w) || IS_STS (w) || IS_MOV_R3 (w)
+ || IS_ADD_R3SP (w) || IS_ADD_IMM_SP (w) || IS_SHLL_R3 (w)
|| IS_ARG_MOV (w) || IS_MOV_TO_R14 (w))
{
start_pc = here;
@@ -716,178 +420,6 @@ sh_skip_prologue_hard_way (CORE_ADDR start_pc)
return start_pc;
}
-static CORE_ADDR
-look_for_args_moves (CORE_ADDR start_pc, int media_mode)
-{
- CORE_ADDR here, end;
- int w;
- int insn_size = (media_mode ? 4 : 2);
-
- for (here = start_pc, end = start_pc + (insn_size * 28); here < end;)
- {
- if (media_mode)
- {
- w = read_memory_integer (UNMAKE_ISA32_ADDR (here), insn_size);
- here += insn_size;
- if (IS_MEDIA_IND_ARG_MOV (w))
- {
- /* This must be followed by a store to r14, so the argument
- is where the debug info says it is. This can happen after
- the SP has been saved, unfortunately. */
-
- int next_insn = read_memory_integer (UNMAKE_ISA32_ADDR (here),
- insn_size);
- here += insn_size;
- if (IS_MEDIA_MOV_TO_R14 (next_insn))
- start_pc = here;
- }
- else if (IS_MEDIA_ARG_MOV (w))
- {
- /* These instructions store directly the argument in r14. */
- start_pc = here;
- }
- else
- break;
- }
- else
- {
- w = read_memory_integer (here, insn_size);
- w = w & 0xffff;
- here += insn_size;
- if (IS_COMPACT_IND_ARG_MOV (w))
- {
- /* This must be followed by a store to r14, so the argument
- is where the debug info says it is. This can happen after
- the SP has been saved, unfortunately. */
-
- int next_insn = 0xffff & read_memory_integer (here, insn_size);
- here += insn_size;
- if (IS_COMPACT_MOV_TO_R14 (next_insn))
- start_pc = here;
- }
- else if (IS_COMPACT_ARG_MOV (w))
- {
- /* These instructions store directly the argument in r14. */
- start_pc = here;
- }
- else if (IS_MOVL_R0 (w))
- {
- /* There is a function that gcc calls to get the arguments
- passed correctly to the function. Only after this
- function call the arguments will be found at the place
- where they are supposed to be. This happens in case the
- argument has to be stored into a 64-bit register (for
- instance doubles, long longs). SHcompact doesn't have
- access to the full 64-bits, so we store the register in
- stack slot and store the address of the stack slot in
- the register, then do a call through a wrapper that
- loads the memory value into the register. A SHcompact
- callee calls an argument decoder
- (GCC_shcompact_incoming_args) that stores the 64-bit
- value in a stack slot and stores the address of the
- stack slot in the register. GCC thinks the argument is
- just passed by transparent reference, but this is only
- true after the argument decoder is called. Such a call
- needs to be considered part of the prologue. */
-
- /* This must be followed by a JSR @r0 instruction and by
- a NOP instruction. After these, the prologue is over! */
-
- int next_insn = 0xffff & read_memory_integer (here, insn_size);
- here += insn_size;
- if (IS_JSR_R0 (next_insn))
- {
- next_insn = 0xffff & read_memory_integer (here, insn_size);
- here += insn_size;
-
- if (IS_NOP (next_insn))
- start_pc = here;
- }
- }
- else
- break;
- }
- }
-
- return start_pc;
-}
-
-static CORE_ADDR
-sh64_skip_prologue_hard_way (CORE_ADDR start_pc)
-{
- CORE_ADDR here, end;
- int updated_fp = 0;
- int insn_size = 4;
- int media_mode = 1;
-
- if (!start_pc)
- return 0;
-
- if (pc_is_isa32 (start_pc) == 0)
- {
- insn_size = 2;
- media_mode = 0;
- }
-
- for (here = start_pc, end = start_pc + (insn_size * 28); here < end;)
- {
-
- if (media_mode)
- {
- int w = read_memory_integer (UNMAKE_ISA32_ADDR (here), insn_size);
- here += insn_size;
- if (IS_STQ_R18_R14 (w) || IS_STQ_R18_R15 (w) || IS_STQ_R14_R15 (w)
- || IS_STL_R14_R15 (w) || IS_STL_R18_R15 (w)
- || IS_ADDIL_SP_MEDIA (w) || IS_ADDI_SP_MEDIA (w) || IS_PTABSL_R18 (w))
- {
- start_pc = here;
- }
- else if (IS_MOV_SP_FP (w) || IS_MOV_SP_FP_MEDIA(w))
- {
- start_pc = here;
- updated_fp = 1;
- }
- else
- if (updated_fp)
- {
- /* Don't bail out yet, we may have arguments stored in
- registers here, according to the debug info, so that
- gdb can print the frames correctly. */
- start_pc = look_for_args_moves (here - insn_size, media_mode);
- break;
- }
- }
- else
- {
- int w = 0xffff & read_memory_integer (here, insn_size);
- here += insn_size;
-
- if (IS_STS_R0 (w) || IS_STS_PR (w)
- || IS_MOV_TO_R15 (w) || IS_MOV_R14 (w)
- || IS_MOV_R0 (w) || IS_ADD_SP_R0 (w) || IS_MOV_R14_R0 (w))
- {
- start_pc = here;
- }
- else if (IS_MOV_SP_FP (w))
- {
- start_pc = here;
- updated_fp = 1;
- }
- else
- if (updated_fp)
- {
- /* Don't bail out yet, we may have arguments stored in
- registers here, according to the debug info, so that
- gdb can print the frames correctly. */
- start_pc = look_for_args_moves (here - insn_size, media_mode);
- break;
- }
- }
- }
-
- return start_pc;
-}
-
static CORE_ADDR
sh_skip_prologue (CORE_ADDR pc)
{
@@ -903,7 +435,7 @@ sh_skip_prologue (CORE_ADDR pc)
if (post_prologue_pc != 0)
return max (pc, post_prologue_pc);
else
- return (skip_prologue_hard_way (pc));
+ return sh_skip_prologue_hard_way (pc);
}
/* Immediately after a function call, return the saved pc.
@@ -915,7 +447,7 @@ sh_skip_prologue (CORE_ADDR pc)
static CORE_ADDR
sh_saved_pc_after_call (struct frame_info *frame)
{
- return (ADDR_BITS_REMOVE (read_register (gdbarch_tdep (current_gdbarch)->PR_REGNUM)));
+ return (ADDR_BITS_REMOVE (read_register (PR_REGNUM)));
}
/* Should call_function allocate stack space for a struct return? */
@@ -932,22 +464,6 @@ sh_use_struct_convention (int gcc_p, struct type *type)
#endif
}
-static int
-sh64_use_struct_convention (int gcc_p, struct type *type)
-{
- return (TYPE_LENGTH (type) > 8);
-}
-
-/* Store the address of the place in which to copy the structure the
- subroutine will return. This is called from call_function.
-
- We store structs through a pointer passed in R2 */
-static void
-sh64_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
-{
- write_register (STRUCT_RETURN_REGNUM, (addr));
-}
-
/* Disassemble an instruction. */
static int
gdb_print_insn_sh (bfd_vma memaddr, disassemble_info *info)
@@ -970,63 +486,14 @@ sh_frame_chain (struct frame_info *frame)
get_frame_base (frame),
get_frame_base (frame)))
return get_frame_base (frame); /* dummy frame same as caller's frame */
- if (get_frame_pc (frame) && !inside_entry_file (get_frame_pc (frame)))
+ if (get_frame_pc (frame)
+ && !deprecated_inside_entry_file (get_frame_pc (frame)))
return read_memory_integer (get_frame_base (frame)
+ get_frame_extra_info (frame)->f_offset, 4);
else
return 0;
}
-/* Given a register number RN as it appears in an assembly
- instruction, find the corresponding register number in the GDB
- scheme. */
-static int
-translate_insn_rn (int rn, int media_mode)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- /* FIXME: this assumes that the number rn is for a not pseudo
- register only. */
- if (media_mode)
- return rn;
- else
- {
- /* These registers don't have a corresponding compact one. */
- /* FIXME: This is probably not enough. */
-#if 0
- if ((rn >= 16 && rn <= 63) || (rn >= 93 && rn <= 140))
- return rn;
-#endif
- if (rn >= 0 && rn <= tdep->R0_C_REGNUM)
- return tdep->R0_C_REGNUM + rn;
- else
- return rn;
- }
-}
-
-static CORE_ADDR
-sh64_frame_chain (struct frame_info *frame)
-{
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
- return get_frame_base (frame); /* dummy frame same as caller's frame */
- if (get_frame_pc (frame) && !inside_entry_file (get_frame_pc (frame)))
- {
- int media_mode = pc_is_isa32 (get_frame_pc (frame));
- int size;
- if (gdbarch_tdep (current_gdbarch)->sh_abi == SH_ABI_32)
- size = 4;
- else
- size = REGISTER_RAW_SIZE (translate_insn_rn (DEPRECATED_FP_REGNUM, media_mode));
- return read_memory_integer (get_frame_base (frame)
- + get_frame_extra_info (frame)->f_offset,
- size);
- }
- else
- return 0;
-}
-
/* Find REGNUM on the stack. Otherwise, it's in an active register. One thing
we might want to do here is to check REGNUM against the clobber mask, and
somehow flag it as invalid if it isn't saved on the stack somewhere. This
@@ -1054,38 +521,6 @@ sh_find_callers_reg (struct frame_info *fi, int regnum)
return read_register (regnum);
}
-static CORE_ADDR
-sh64_get_saved_pr (struct frame_info *fi, int pr_regnum)
-{
- int media_mode = 0;
-
- for (; fi; fi = get_next_frame (fi))
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
- /* When the caller requests PR from the dummy frame, we return PC because
- that's where the previous routine appears to have done a call from. */
- return deprecated_read_register_dummy (get_frame_pc (fi),
- get_frame_base (fi), pr_regnum);
- else
- {
- DEPRECATED_FRAME_INIT_SAVED_REGS (fi);
- if (!get_frame_pc (fi))
- return 0;
-
- media_mode = pc_is_isa32 (get_frame_pc (fi));
-
- if (get_frame_saved_regs (fi)[pr_regnum] != 0)
- {
- int gdb_reg_num = translate_insn_rn (pr_regnum, media_mode);
- int size = ((gdbarch_tdep (current_gdbarch)->sh_abi == SH_ABI_32)
- ? 4
- : REGISTER_RAW_SIZE (gdb_reg_num));
- return read_memory_integer (get_frame_saved_regs (fi)[pr_regnum], size);
- }
- }
- return read_register (pr_regnum);
-}
-
/* Put here the code to store, into a struct frame_saved_regs, the
addresses of the saved registers of frame described by FRAME_INFO.
This includes special registers such as pc and fp saved in special
@@ -1100,7 +535,7 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi)
int depth;
int pc;
int opc;
- int insn;
+ int inst;
int r3_val = 0;
char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi),
get_frame_base (fi));
@@ -1127,7 +562,7 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi)
depth = 0;
- /* Loop around examining the prologue insns until we find something
+ /* Loop around examining the prologue inst until we find something
that does not appear to be part of the prologue. But give up
after 20 of them, since we're getting silly then. */
@@ -1140,38 +575,38 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi)
for (opc = pc + (2 * 28); pc < opc; pc += 2)
{
- insn = read_memory_integer (pc, 2);
+ inst = read_memory_integer (pc, 2);
/* See where the registers will be saved to */
- if (IS_PUSH (insn))
+ if (IS_PUSH (inst))
{
- rn = GET_PUSHED_REG (insn);
+ rn = GET_PUSHED_REG (inst);
where[rn] = depth;
depth += 4;
}
- else if (IS_STS (insn))
+ else if (IS_STS (inst))
{
- where[gdbarch_tdep (current_gdbarch)->PR_REGNUM] = depth;
+ where[PR_REGNUM] = depth;
/* If we're storing the pr then this isn't a leaf */
get_frame_extra_info (fi)->leaf_function = 0;
depth += 4;
}
- else if (IS_MOV_R3 (insn))
+ else if (IS_MOV_R3 (inst))
{
- r3_val = ((insn & 0xff) ^ 0x80) - 0x80;
+ r3_val = ((inst & 0xff) ^ 0x80) - 0x80;
}
- else if (IS_SHLL_R3 (insn))
+ else if (IS_SHLL_R3 (inst))
{
r3_val <<= 1;
}
- else if (IS_ADD_R3SP (insn))
+ else if (IS_ADD_R3SP (inst))
{
depth += -r3_val;
}
- else if (IS_ADD_SP (insn))
+ else if (IS_ADD_IMM_SP (inst))
{
- depth -= ((insn & 0xff) ^ 0x80) - 0x80;
+ depth -= ((inst & 0xff) ^ 0x80) - 0x80;
}
- else if (IS_MOV_SP_FP (insn))
+ else if (IS_MOV_SP_FP (inst))
break;
#if 0 /* This used to just stop when it found an instruction that
was not considered part of the prologue. Now, we just
@@ -1219,7 +654,7 @@ fv_reg_base_num (int fv_regnum)
int fp_regnum;
fp_regnum = FP0_REGNUM +
- (fv_regnum - gdbarch_tdep (current_gdbarch)->FV0_REGNUM) * 4;
+ (fv_regnum - FV0_REGNUM) * 4;
return fp_regnum;
}
@@ -1230,408 +665,10 @@ dr_reg_base_num (int dr_regnum)
int fp_regnum;
fp_regnum = FP0_REGNUM +
- (dr_regnum - gdbarch_tdep (current_gdbarch)->DR0_REGNUM) * 2;
- return fp_regnum;
-}
-
-/* For pairs of floating point registers */
-static int
-fpp_reg_base_num (int fpp_regnum)
-{
- int fp_regnum;
-
- fp_regnum = FP0_REGNUM +
- (fpp_regnum - gdbarch_tdep (current_gdbarch)->FPP0_REGNUM) * 2;
+ (dr_regnum - DR0_REGNUM) * 2;
return fp_regnum;
}
-static int
-is_media_pseudo (int rn)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- return (rn >= tdep->DR0_REGNUM
- && rn <= tdep->FV_LAST_REGNUM);
-}
-
-static int
-sh64_get_gdb_regnum (int gcc_regnum, CORE_ADDR pc)
-{
- return translate_insn_rn (gcc_regnum, pc_is_isa32 (pc));
-}
-
-static int
-sh64_media_reg_base_num (int reg_nr)
-{
- int base_regnum = -1;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (reg_nr >= tdep->DR0_REGNUM
- && reg_nr <= tdep->DR_LAST_REGNUM)
- base_regnum = dr_reg_base_num (reg_nr);
-
- else if (reg_nr >= tdep->FPP0_REGNUM
- && reg_nr <= tdep->FPP_LAST_REGNUM)
- base_regnum = fpp_reg_base_num (reg_nr);
-
- else if (reg_nr >= tdep->FV0_REGNUM
- && reg_nr <= tdep->FV_LAST_REGNUM)
- base_regnum = fv_reg_base_num (reg_nr);
-
- return base_regnum;
-}
-
-/* *INDENT-OFF* */
-/*
- SH COMPACT MODE (ISA 16) (all pseudo) 221-272
- GDB_REGNUM BASE_REGNUM
- r0_c 221 0
- r1_c 222 1
- r2_c 223 2
- r3_c 224 3
- r4_c 225 4
- r5_c 226 5
- r6_c 227 6
- r7_c 228 7
- r8_c 229 8
- r9_c 230 9
- r10_c 231 10
- r11_c 232 11
- r12_c 233 12
- r13_c 234 13
- r14_c 235 14
- r15_c 236 15
-
- pc_c 237 64
- gbr_c 238 16
- mach_c 239 17
- macl_c 240 17
- pr_c 241 18
- t_c 242 19
- fpscr_c 243 76
- fpul_c 244 109
-
- fr0_c 245 77
- fr1_c 246 78
- fr2_c 247 79
- fr3_c 248 80
- fr4_c 249 81
- fr5_c 250 82
- fr6_c 251 83
- fr7_c 252 84
- fr8_c 253 85
- fr9_c 254 86
- fr10_c 255 87
- fr11_c 256 88
- fr12_c 257 89
- fr13_c 258 90
- fr14_c 259 91
- fr15_c 260 92
-
- dr0_c 261 77
- dr2_c 262 79
- dr4_c 263 81
- dr6_c 264 83
- dr8_c 265 85
- dr10_c 266 87
- dr12_c 267 89
- dr14_c 268 91
-
- fv0_c 269 77
- fv4_c 270 81
- fv8_c 271 85
- fv12_c 272 91
-*/
-/* *INDENT-ON* */
-static int
-sh64_compact_reg_base_num (int reg_nr)
-{
- int base_regnum = -1;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- /* general register N maps to general register N */
- if (reg_nr >= tdep->R0_C_REGNUM
- && reg_nr <= tdep->R_LAST_C_REGNUM)
- base_regnum = reg_nr - tdep->R0_C_REGNUM;
-
- /* floating point register N maps to floating point register N */
- else if (reg_nr >= tdep->FP0_C_REGNUM
- && reg_nr <= tdep->FP_LAST_C_REGNUM)
- base_regnum = reg_nr - tdep->FP0_C_REGNUM + FP0_REGNUM;
-
- /* double prec register N maps to base regnum for double prec register N */
- else if (reg_nr >= tdep->DR0_C_REGNUM
- && reg_nr <= tdep->DR_LAST_C_REGNUM)
- base_regnum = dr_reg_base_num (tdep->DR0_REGNUM
- + reg_nr - tdep->DR0_C_REGNUM);
-
- /* vector N maps to base regnum for vector register N */
- else if (reg_nr >= tdep->FV0_C_REGNUM
- && reg_nr <= tdep->FV_LAST_C_REGNUM)
- base_regnum = fv_reg_base_num (tdep->FV0_REGNUM
- + reg_nr - tdep->FV0_C_REGNUM);
-
- else if (reg_nr == tdep->PC_C_REGNUM)
- base_regnum = PC_REGNUM;
-
- else if (reg_nr == tdep->GBR_C_REGNUM)
- base_regnum = 16;
-
- else if (reg_nr == tdep->MACH_C_REGNUM
- || reg_nr == tdep->MACL_C_REGNUM)
- base_regnum = 17;
-
- else if (reg_nr == tdep->PR_C_REGNUM)
- base_regnum = 18;
-
- else if (reg_nr == tdep->T_C_REGNUM)
- base_regnum = 19;
-
- else if (reg_nr == tdep->FPSCR_C_REGNUM)
- base_regnum = tdep->FPSCR_REGNUM; /*???? this register is a mess. */
-
- else if (reg_nr == tdep->FPUL_C_REGNUM)
- base_regnum = FP0_REGNUM + 32;
-
- return base_regnum;
-}
-
-/* Given a register number RN (according to the gdb scheme) , return
- its corresponding architectural register. In media mode, only a
- subset of the registers is pseudo registers. For compact mode, all
- the registers are pseudo. */
-static int
-translate_rn_to_arch_reg_num (int rn, int media_mode)
-{
-
- if (media_mode)
- {
- if (!is_media_pseudo (rn))
- return rn;
- else
- return sh64_media_reg_base_num (rn);
- }
- else
- /* All compact registers are pseudo. */
- return sh64_compact_reg_base_num (rn);
-}
-
-static int
-sign_extend (int value, int bits)
-{
- value = value & ((1 << bits) - 1);
- return (value & (1 << (bits - 1))
- ? value | (~((1 << bits) - 1))
- : value);
-}
-
-static void
-sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
-{
- int *where = (int *) alloca ((NUM_REGS + NUM_PSEUDO_REGS) * sizeof (int));
- int rn;
- int have_fp = 0;
- int fp_regnum;
- int sp_regnum;
- int depth;
- int pc;
- int opc;
- int insn;
- int r0_val = 0;
- int media_mode = 0;
- int insn_size;
- int gdb_register_number;
- int register_number;
- char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), get_frame_base (fi));
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (get_frame_saved_regs (fi) == NULL)
- frame_saved_regs_zalloc (fi);
- else
- memset (get_frame_saved_regs (fi), 0, SIZEOF_FRAME_SAVED_REGS);
-
- if (dummy_regs)
- {
- /* DANGER! This is ONLY going to work if the char buffer format of
- the saved registers is byte-for-byte identical to the
- CORE_ADDR regs[NUM_REGS] format used by struct frame_saved_regs! */
- memcpy (get_frame_saved_regs (fi), dummy_regs, SIZEOF_FRAME_SAVED_REGS);
- return;
- }
-
- get_frame_extra_info (fi)->leaf_function = 1;
- get_frame_extra_info (fi)->f_offset = 0;
-
- for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++)
- where[rn] = -1;
-
- depth = 0;
-
- /* Loop around examining the prologue insns until we find something
- that does not appear to be part of the prologue. But give up
- after 20 of them, since we're getting silly then. */
-
- pc = get_frame_func (fi);
- if (!pc)
- {
- deprecated_update_frame_pc_hack (fi, 0);
- return;
- }
-
- if (pc_is_isa32 (pc))
- {
- media_mode = 1;
- insn_size = 4;
- }
- else
- {
- media_mode = 0;
- insn_size = 2;
- }
-
- /* The frame pointer register is general register 14 in shmedia and
- shcompact modes. In sh compact it is a pseudo register. Same goes
- for the stack pointer register, which is register 15. */
- fp_regnum = translate_insn_rn (DEPRECATED_FP_REGNUM, media_mode);
- sp_regnum = translate_insn_rn (SP_REGNUM, media_mode);
-
- for (opc = pc + (insn_size * 28); pc < opc; pc += insn_size)
- {
- insn = read_memory_integer (media_mode ? UNMAKE_ISA32_ADDR (pc) : pc,
- insn_size);
-
- if (media_mode == 0)
- {
- if (IS_STS_PR (insn))
- {
- int next_insn = read_memory_integer (pc + insn_size, insn_size);
- if (IS_MOV_TO_R15 (next_insn))
- {
- int reg_nr = tdep->PR_C_REGNUM;
-
- where[reg_nr] = depth - ((((next_insn & 0xf) ^ 0x8) - 0x8) << 2);
- get_frame_extra_info (fi)->leaf_function = 0;
- pc += insn_size;
- }
- }
- else if (IS_MOV_R14 (insn))
- {
- where[fp_regnum] = depth - ((((insn & 0xf) ^ 0x8) - 0x8) << 2);
- }
-
- else if (IS_MOV_R0 (insn))
- {
- /* Put in R0 the offset from SP at which to store some
- registers. We are interested in this value, because it
- will tell us where the given registers are stored within
- the frame. */
- r0_val = ((insn & 0xff) ^ 0x80) - 0x80;
- }
- else if (IS_ADD_SP_R0 (insn))
- {
- /* This instruction still prepares r0, but we don't care.
- We already have the offset in r0_val. */
- }
- else if (IS_STS_R0 (insn))
- {
- /* Store PR at r0_val-4 from SP. Decrement r0 by 4*/
- int reg_nr = tdep->PR_C_REGNUM;
- where[reg_nr] = depth - (r0_val - 4);
- r0_val -= 4;
- get_frame_extra_info (fi)->leaf_function = 0;
- }
- else if (IS_MOV_R14_R0 (insn))
- {
- /* Store R14 at r0_val-4 from SP. Decrement r0 by 4 */
- where[fp_regnum] = depth - (r0_val - 4);
- r0_val -= 4;
- }
-
- else if (IS_ADD_SP (insn))
- {
- depth -= ((insn & 0xff) ^ 0x80) - 0x80;
- }
- else if (IS_MOV_SP_FP (insn))
- break;
- }
- else
- {
- if (IS_ADDIL_SP_MEDIA (insn)
- || IS_ADDI_SP_MEDIA (insn))
- {
- depth -= sign_extend ((((insn & 0xffc00) ^ 0x80000) - 0x80000) >> 10, 9);
- }
-
- else if (IS_STQ_R18_R15 (insn))
- {
- where[tdep->PR_REGNUM] =
- depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 3);
- get_frame_extra_info (fi)->leaf_function = 0;
- }
-
- else if (IS_STL_R18_R15 (insn))
- {
- where[tdep->PR_REGNUM] =
- depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 2);
- get_frame_extra_info (fi)->leaf_function = 0;
- }
-
- else if (IS_STQ_R14_R15 (insn))
- {
- where[fp_regnum] = depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 3);
- }
-
- else if (IS_STL_R14_R15 (insn))
- {
- where[fp_regnum] = depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 2);
- }
-
- else if (IS_MOV_SP_FP_MEDIA (insn))
- break;
- }
- }
-
- /* Now we know how deep things are, we can work out their addresses. */
- for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++)
- {
- register_number = translate_rn_to_arch_reg_num (rn, media_mode);
-
- if (where[rn] >= 0)
- {
- if (rn == fp_regnum)
- have_fp = 1;
-
- /* Watch out! saved_regs is only for the real registers, and
- doesn't include space for the pseudo registers. */
- get_frame_saved_regs (fi)[register_number]= get_frame_base (fi) - where[rn] + depth;
-
- }
- else
- get_frame_saved_regs (fi)[register_number] = 0;
- }
-
- if (have_fp)
- {
- /* SP_REGNUM is 15. For shmedia 15 is the real register. For
- shcompact 15 is the arch register corresponding to the pseudo
- register r15 which still is the SP register. */
- /* The place on the stack where fp is stored contains the sp of
- the caller. */
- /* Again, saved_registers contains only space for the real
- registers, so we store in DEPRECATED_FP_REGNUM position. */
- int size;
- if (tdep->sh_abi == SH_ABI_32)
- size = 4;
- else
- size = REGISTER_RAW_SIZE (fp_regnum);
- get_frame_saved_regs (fi)[sp_regnum] = read_memory_integer (get_frame_saved_regs (fi)[fp_regnum], size);
- }
- else
- get_frame_saved_regs (fi)[sp_regnum] = get_frame_base (fi);
-
- get_frame_extra_info (fi)->f_offset = depth - where[fp_regnum];
-}
-
static void
sh_fp_frame_init_saved_regs (struct frame_info *fi)
{
@@ -1641,10 +678,9 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
int depth;
int pc;
int opc;
- int insn;
+ int inst;
int r3_val = 0;
char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), get_frame_base (fi));
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (get_frame_saved_regs (fi) == NULL)
frame_saved_regs_zalloc (fi);
@@ -1668,7 +704,7 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
depth = 0;
- /* Loop around examining the prologue insns until we find something
+ /* Loop around examining the prologue inst until we find something
that does not appear to be part of the prologue. But give up
after 20 of them, since we're getting silly then. */
@@ -1681,40 +717,40 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
for (opc = pc + (2 * 28); pc < opc; pc += 2)
{
- insn = read_memory_integer (pc, 2);
+ inst = read_memory_integer (pc, 2);
/* See where the registers will be saved to */
- if (IS_PUSH (insn))
+ if (IS_PUSH (inst))
{
- rn = GET_PUSHED_REG (insn);
+ rn = GET_PUSHED_REG (inst);
where[rn] = depth;
depth += 4;
}
- else if (IS_STS (insn))
+ else if (IS_STS (inst))
{
- where[tdep->PR_REGNUM] = depth;
+ where[PR_REGNUM] = depth;
/* If we're storing the pr then this isn't a leaf */
get_frame_extra_info (fi)->leaf_function = 0;
depth += 4;
}
- else if (IS_MOV_R3 (insn))
+ else if (IS_MOV_R3 (inst))
{
- r3_val = ((insn & 0xff) ^ 0x80) - 0x80;
+ r3_val = ((inst & 0xff) ^ 0x80) - 0x80;
}
- else if (IS_SHLL_R3 (insn))
+ else if (IS_SHLL_R3 (inst))
{
r3_val <<= 1;
}
- else if (IS_ADD_R3SP (insn))
+ else if (IS_ADD_R3SP (inst))
{
depth += -r3_val;
}
- else if (IS_ADD_SP (insn))
+ else if (IS_ADD_IMM_SP (inst))
{
- depth -= ((insn & 0xff) ^ 0x80) - 0x80;
+ depth -= ((inst & 0xff) ^ 0x80) - 0x80;
}
- else if (IS_FMOV (insn))
+ else if (IS_FPUSH (inst))
{
- if (read_register (tdep->FPSCR_REGNUM) & FPSCR_SZ)
+ if (read_register (FPSCR_REGNUM) & FPSCR_SZ)
{
depth += 8;
}
@@ -1723,7 +759,7 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
depth += 4;
}
}
- else if (IS_MOV_SP_FP (insn))
+ else if (IS_MOV_SP_FP (inst))
break;
#if 0 /* This used to just stop when it found an instruction that
was not considered part of the prologue. Now, we just
@@ -1793,141 +829,8 @@ sh_init_extra_frame_info (int fromleaf, struct frame_info *fi)
{
DEPRECATED_FRAME_INIT_SAVED_REGS (fi);
get_frame_extra_info (fi)->return_pc =
- sh_find_callers_reg (fi, gdbarch_tdep (current_gdbarch)->PR_REGNUM);
- }
-}
-
-static void
-sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi)
-{
- int media_mode = pc_is_isa32 (get_frame_pc (fi));
-
- frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
-
- if (get_next_frame (fi))
- deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
-
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
- get_frame_base (fi)))
- {
- /* We need to setup fi->frame here because call_function_by_hand
- gets it wrong by assuming it's always FP. */
- deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
- get_frame_extra_info (fi)->return_pc =
- deprecated_read_register_dummy (get_frame_pc (fi),
- get_frame_base (fi), PC_REGNUM);
- get_frame_extra_info (fi)->f_offset = -(DEPRECATED_CALL_DUMMY_LENGTH + 4);
- get_frame_extra_info (fi)->leaf_function = 0;
- return;
- }
- else
- {
- DEPRECATED_FRAME_INIT_SAVED_REGS (fi);
- get_frame_extra_info (fi)->return_pc =
- sh64_get_saved_pr (fi, gdbarch_tdep (current_gdbarch)->PR_REGNUM);
- }
-}
-
-static void
-sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
- struct frame_info *frame, int regnum,
- enum lval_type *lval)
-{
- int media_mode;
- int live_regnum = regnum;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (!target_has_registers)
- error ("No registers.");
-
- /* Normal systems don't optimize out things with register numbers. */
- if (optimized != NULL)
- *optimized = 0;
-
- if (addrp) /* default assumption: not found in memory */
- *addrp = 0;
-
- if (raw_buffer)
- memset (raw_buffer, 0, sizeof (raw_buffer));
-
- /* We must do this here, before the following while loop changes
- frame, and makes it NULL. If this is a media register number,
- but we are in compact mode, it will become the corresponding
- compact pseudo register. If there is no corresponding compact
- pseudo-register what do we do?*/
- media_mode = pc_is_isa32 (get_frame_pc (frame));
- live_regnum = translate_insn_rn (regnum, media_mode);
-
- /* Note: since the current frame's registers could only have been
- saved by frames INTERIOR TO the current frame, we skip examining
- the current frame itself: otherwise, we would be getting the
- previous frame's registers which were saved by the current frame. */
-
- while (frame && ((frame = get_next_frame (frame)) != NULL))
- {
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
- {
- if (lval) /* found it in a CALL_DUMMY frame */
- *lval = not_lval;
- if (raw_buffer)
- memcpy (raw_buffer,
- (deprecated_generic_find_dummy_frame (get_frame_pc (frame), get_frame_base (frame))
- + REGISTER_BYTE (regnum)),
- REGISTER_RAW_SIZE (regnum));
- return;
- }
-
- DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
- if (get_frame_saved_regs (frame) != NULL
- && get_frame_saved_regs (frame)[regnum] != 0)
- {
- if (lval) /* found it saved on the stack */
- *lval = lval_memory;
- if (regnum == SP_REGNUM)
- {
- if (raw_buffer) /* SP register treated specially */
- store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum),
- get_frame_saved_regs (frame)[regnum]);
- }
- else
- { /* any other register */
-
- if (addrp)
- *addrp = get_frame_saved_regs (frame)[regnum];
- if (raw_buffer)
- {
- int size;
- if (tdep->sh_abi == SH_ABI_32
- && (live_regnum == DEPRECATED_FP_REGNUM
- || live_regnum == tdep->PR_REGNUM))
- size = 4;
- else
- size = REGISTER_RAW_SIZE (live_regnum);
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
- read_memory (get_frame_saved_regs (frame)[regnum], raw_buffer, size);
- else
- read_memory (get_frame_saved_regs (frame)[regnum],
- raw_buffer
- + REGISTER_RAW_SIZE (live_regnum)
- - size,
- size);
- }
- }
- return;
- }
+ sh_find_callers_reg (fi, PR_REGNUM);
}
-
- /* If we get thru the loop to this point, it means the register was
- not saved in any frame. Return the actual live-register value. */
-
- if (lval) /* found it in a live register */
- *lval = lval_register;
- if (addrp)
- *addrp = REGISTER_BYTE (live_regnum);
- if (raw_buffer)
- deprecated_read_register_gen (live_regnum, raw_buffer);
}
/* Extract from an array REGBUF containing the (raw) register state
@@ -1937,19 +840,11 @@ static CORE_ADDR
sh_extract_struct_value_address (struct regcache *regcache)
{
ULONGEST addr;
- /*FIXME: Is R0 really correct here? Not STRUCT_RETURN_REGNUM? */
regcache_cooked_read_unsigned (regcache, STRUCT_RETURN_REGNUM, &addr);
return addr;
}
static CORE_ADDR
-sh64_extract_struct_value_address (char *regbuf)
-{
- return (extract_unsigned_integer ((regbuf + REGISTER_BYTE (STRUCT_RETURN_REGNUM)),
- REGISTER_RAW_SIZE (STRUCT_RETURN_REGNUM)));
-}
-
-static CORE_ADDR
sh_frame_saved_pc (struct frame_info *frame)
{
return (get_frame_extra_info (frame)->return_pc);
@@ -1960,9 +855,9 @@ sh_frame_saved_pc (struct frame_info *frame)
static void
sh_pop_frame (void)
{
- register struct frame_info *frame = get_current_frame ();
- register CORE_ADDR fp;
- register int regnum;
+ struct frame_info *frame = get_current_frame ();
+ CORE_ADDR fp;
+ int regnum;
if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
get_frame_base (frame),
@@ -1985,56 +880,13 @@ sh_pop_frame (void)
flush_cached_frames ();
}
-/* Used in the 'return' command. */
-static void
-sh64_pop_frame (void)
-{
- register struct frame_info *frame = get_current_frame ();
- register CORE_ADDR fp;
- register int regnum;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- int media_mode = pc_is_isa32 (get_frame_pc (frame));
-
- if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
- get_frame_base (frame),
- get_frame_base (frame)))
- generic_pop_dummy_frame ();
- else
- {
- fp = get_frame_base (frame);
- DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
-
- /* Copy regs from where they were saved in the frame */
- for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
- if (get_frame_saved_regs (frame)[regnum])
- {
- int size;
- if (tdep->sh_abi == SH_ABI_32
- && (regnum == DEPRECATED_FP_REGNUM
- || regnum == tdep->PR_REGNUM))
- size = 4;
- else
- size = REGISTER_RAW_SIZE (translate_insn_rn (regnum,
- media_mode));
- write_register (regnum,
- read_memory_integer (get_frame_saved_regs (frame)[regnum],
- size));
- }
-
- write_register (PC_REGNUM, get_frame_extra_info (frame)->return_pc);
- write_register (SP_REGNUM, fp + 8);
- }
- flush_cached_frames ();
-}
-
static CORE_ADDR
sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
{
return sp & ~3;
}
-/* Function: push_arguments
+/* Function: push_dummy_call (formerly push_arguments)
Setup the function arguments for calling a function in the inferior.
On the Hitachi SH architecture, there are four registers (R4 to R7)
@@ -2042,6 +894,10 @@ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
four arguments (depending on size) may go into these registers.
The rest go on the stack.
+ MVS: Except on SH variants that have floating point registers.
+ In that case, float and double arguments are passed in the same
+ manner, but using FP registers instead of GP registers.
+
Arguments that are smaller than 4 bytes will still take up a whole
register or a whole 32-bit word on the stack, and will be
right-justified in the register or the stack word. This includes
@@ -2055,6 +911,11 @@ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
that will be passed in this way; in other words, the convention of
passing a pointer to a large aggregate instead of a copy is not used.
+ MVS: The above appears to be true for the SH variants that do not
+ have an FPU, however those that have an FPU appear to copy the
+ aggregate argument onto the stack (and not place it in registers)
+ if it is larger than 16 bytes (four GP registers).
+
An exceptional case exists for struct arguments (and possibly other
aggregates such as arrays) if the size is larger than 4 bytes but
not a multiple of 4 bytes. In this case the argument is never split
@@ -2078,14 +939,16 @@ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
to R7. */
static CORE_ADDR
-sh_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
- struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
- struct value **args, CORE_ADDR sp, int struct_return,
- CORE_ADDR struct_addr)
-
+sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
+ CORE_ADDR func_addr,
+ struct regcache *regcache,
+ CORE_ADDR bp_addr, int nargs,
+ struct value **args,
+ CORE_ADDR sp, int struct_return,
+ CORE_ADDR struct_addr)
{
int stack_offset, stack_alloc;
- int argreg;
+ int argreg, flt_argreg;
int argnum;
struct type *type;
CORE_ADDR regval;
@@ -2093,7 +956,6 @@ sh_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
char valbuf[4];
int len;
int odd_sized_struct;
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* first force sp to a 4-byte alignment */
sp = sh_frame_align (gdbarch, sp);
@@ -2101,7 +963,9 @@ sh_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
/* The "struct return pointer" pseudo-argument has its own dedicated
register */
if (struct_return)
- regcache_cooked_write_unsigned (regcache, STRUCT_RETURN_REGNUM, struct_addr);
+ regcache_cooked_write_unsigned (regcache,
+ STRUCT_RETURN_REGNUM,
+ struct_addr);
/* Now make sure there's space on the stack */
for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
@@ -2112,7 +976,8 @@ sh_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
registers, and push the rest onto the stack. There are 16 bytes
in four registers available. Loop thru args from first to last. */
- argreg = tdep->ARG0_REGNUM;
+ argreg = ARG0_REGNUM;
+ flt_argreg = FLOAT_ARG0_REGNUM;
for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
{
type = VALUE_TYPE (args[argnum]);
@@ -2132,12 +997,16 @@ sh_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
val = (char *) VALUE_CONTENTS (args[argnum]);
if (len > 4 && (len & 3) != 0)
- odd_sized_struct = 1; /* such structs go entirely on stack */
+ odd_sized_struct = 1; /* Such structs go entirely on stack. */
+ else if (len > 16)
+ odd_sized_struct = 1; /* So do aggregates bigger than 4 words. */
else
odd_sized_struct = 0;
while (len > 0)
{
- if (argreg > tdep->ARGLAST_REGNUM
+ if ((TYPE_CODE (type) == TYPE_CODE_FLT
+ && flt_argreg > FLOAT_ARGLAST_REGNUM)
+ || argreg > ARGLAST_REGNUM
|| odd_sized_struct)
{
/* must go on the stack */
@@ -2147,7 +1016,15 @@ sh_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
/* NOTE WELL!!!!! This is not an "else if" clause!!!
That's because some *&^%$ things get passed on the stack
AND in the registers! */
- if (argreg <= tdep->ARGLAST_REGNUM)
+ if (TYPE_CODE (type) == TYPE_CODE_FLT &&
+ flt_argreg > 0 && flt_argreg <= FLOAT_ARGLAST_REGNUM)
+ {
+ /* Argument goes in a single-precision fp reg. */
+ regval = extract_unsigned_integer (val, register_size (gdbarch,
+ argreg));
+ regcache_cooked_write_unsigned (regcache, flt_argreg++, regval);
+ }
+ else if (argreg <= ARGLAST_REGNUM)
{
/* there's room in a register */
regval = extract_unsigned_integer (val, register_size (gdbarch,
@@ -2163,7 +1040,7 @@ sh_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
}
/* Store return address. */
- regcache_cooked_write_unsigned (regcache, tdep->PR_REGNUM, bp_addr);
+ regcache_cooked_write_unsigned (regcache, PR_REGNUM, bp_addr);
/* Update stack pointer. */
regcache_cooked_write_unsigned (regcache, SP_REGNUM, sp);
@@ -2171,230 +1048,102 @@ sh_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
return sp;
}
-/* R2-R9 for integer types and integer equivalent (char, pointers) and
- non-scalar (struct, union) elements (even if the elements are
- floats).
- FR0-FR11 for single precision floating point (float)
- DR0-DR10 for double precision floating point (double)
-
- If a float is argument number 3 (for instance) and arguments number
- 1,2, and 4 are integer, the mapping will be:
- arg1 -->R2, arg2 --> R3, arg3 -->FR0, arg4 --> R5. I.e. R4 is not used.
-
- If a float is argument number 10 (for instance) and arguments number
- 1 through 10 are integer, the mapping will be:
- arg1->R2, arg2->R3, arg3->R4, arg4->R5, arg5->R6, arg6->R7, arg7->R8,
- arg8->R9, arg9->(0,SP)stack(8-byte aligned), arg10->FR0, arg11->stack(16,SP).
- I.e. there is hole in the stack.
-
- Different rules apply for variable arguments functions, and for functions
- for which the prototype is not known. */
-
static CORE_ADDR
-sh64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
- int struct_return, CORE_ADDR struct_addr)
+sh_push_dummy_call_nofpu (struct gdbarch *gdbarch,
+ CORE_ADDR func_addr,
+ struct regcache *regcache,
+ CORE_ADDR bp_addr,
+ int nargs, struct value **args,
+ CORE_ADDR sp, int struct_return,
+ CORE_ADDR struct_addr)
{
int stack_offset, stack_alloc;
- int int_argreg;
- int float_argreg;
- int double_argreg;
- int float_arg_index = 0;
- int double_arg_index = 0;
+ int argreg;
int argnum;
struct type *type;
CORE_ADDR regval;
char *val;
- char valbuf[8];
- char valbuf_tmp[8];
+ char valbuf[4];
int len;
- int argreg_size;
- int fp_args[12];
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- memset (fp_args, 0, sizeof (fp_args));
+ int odd_sized_struct;
- /* first force sp to a 8-byte alignment */
- sp = sp & ~7;
+ /* first force sp to a 4-byte alignment */
+ sp = sh_frame_align (gdbarch, sp);
/* The "struct return pointer" pseudo-argument has its own dedicated
register */
-
if (struct_return)
- write_register (STRUCT_RETURN_REGNUM, struct_addr);
+ regcache_cooked_write_unsigned (regcache,
+ STRUCT_RETURN_REGNUM,
+ struct_addr);
/* Now make sure there's space on the stack */
for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
- stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 7) & ~7);
+ stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 3) & ~3);
sp -= stack_alloc; /* make room on stack for args */
/* Now load as many as possible of the first arguments into
- registers, and push the rest onto the stack. There are 64 bytes
- in eight registers available. Loop thru args from first to last. */
-
- int_argreg = tdep->ARG0_REGNUM;
- float_argreg = FP0_REGNUM;
- double_argreg = tdep->DR0_REGNUM;
+ registers, and push the rest onto the stack. There are 16 bytes
+ in four registers available. Loop thru args from first to last. */
+ argreg = ARG0_REGNUM;
for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
{
type = VALUE_TYPE (args[argnum]);
len = TYPE_LENGTH (type);
memset (valbuf, 0, sizeof (valbuf));
-
- if (TYPE_CODE (type) != TYPE_CODE_FLT)
+ if (len < 4)
{
- argreg_size = REGISTER_RAW_SIZE (int_argreg);
-
- if (len < argreg_size)
- {
- /* value gets right-justified in the register or stack word */
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- memcpy (valbuf + argreg_size - len,
- (char *) VALUE_CONTENTS (args[argnum]), len);
- else
- memcpy (valbuf, (char *) VALUE_CONTENTS (args[argnum]), len);
-
- val = valbuf;
- }
+ /* value gets right-justified in the register or stack word */
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ memcpy (valbuf + (4 - len),
+ (char *) VALUE_CONTENTS (args[argnum]), len);
else
- val = (char *) VALUE_CONTENTS (args[argnum]);
-
- while (len > 0)
- {
- if (int_argreg > tdep->ARGLAST_REGNUM)
- {
- /* must go on the stack */
- write_memory (sp + stack_offset, val, argreg_size);
- stack_offset += 8;/*argreg_size;*/
- }
- /* NOTE WELL!!!!! This is not an "else if" clause!!!
- That's because some *&^%$ things get passed on the stack
- AND in the registers! */
- if (int_argreg <= tdep->ARGLAST_REGNUM)
- {
- /* there's room in a register */
- regval = extract_unsigned_integer (val, argreg_size);
- write_register (int_argreg, regval);
- }
- /* Store the value 8 bytes at a time. This means that
- things larger than 8 bytes may go partly in registers
- and partly on the stack. FIXME: argreg is incremented
- before we use its size. */
- len -= argreg_size;
- val += argreg_size;
- int_argreg++;
- }
+ memcpy (valbuf, (char *) VALUE_CONTENTS (args[argnum]), len);
+ val = valbuf;
}
else
+ val = (char *) VALUE_CONTENTS (args[argnum]);
+
+ if (len > 4 && (len & 3) != 0)
+ odd_sized_struct = 1; /* such structs go entirely on stack */
+ else
+ odd_sized_struct = 0;
+ while (len > 0)
{
- val = (char *) VALUE_CONTENTS (args[argnum]);
- if (len == 4)
- {
- /* Where is it going to be stored? */
- while (fp_args[float_arg_index])
- float_arg_index ++;
-
- /* Now float_argreg points to the register where it
- should be stored. Are we still within the allowed
- register set? */
- if (float_arg_index <= tdep->FLOAT_ARGLAST_REGNUM)
- {
- /* Goes in FR0...FR11 */
- deprecated_write_register_gen (FP0_REGNUM + float_arg_index,
- val);
- fp_args[float_arg_index] = 1;
- /* Skip the corresponding general argument register. */
- int_argreg ++;
- }
- else
- ;
- /* Store it as the integers, 8 bytes at the time, if
- necessary spilling on the stack. */
-
+ if (argreg > ARGLAST_REGNUM
+ || odd_sized_struct)
+ {
+ /* must go on the stack */
+ write_memory (sp + stack_offset, val, 4);
+ stack_offset += 4;
}
- else if (len == 8)
- {
- /* Where is it going to be stored? */
- while (fp_args[double_arg_index])
- double_arg_index += 2;
- /* Now double_argreg points to the register
- where it should be stored.
- Are we still within the allowed register set? */
- if (double_arg_index < tdep->FLOAT_ARGLAST_REGNUM)
- {
- /* Goes in DR0...DR10 */
- /* The numbering of the DRi registers is consecutive,
- i.e. includes odd numbers. */
- int double_register_offset = double_arg_index / 2;
- int regnum = tdep->DR0_REGNUM +
- double_register_offset;
-#if 0
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
- {
- memset (valbuf_tmp, 0, sizeof (valbuf_tmp));
- DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum,
- type, val,
- valbuf_tmp);
- val = valbuf_tmp;
- }
-#endif
- /* Note: must use write_register_gen here instead
- of regcache_raw_write, because
- regcache_raw_write works only for real
- registers, not pseudo. write_register_gen will
- call the gdbarch function to do register
- writes, and that will properly know how to deal
- with pseudoregs. */
- deprecated_write_register_gen (regnum, val);
- fp_args[double_arg_index] = 1;
- fp_args[double_arg_index + 1] = 1;
- /* Skip the corresponding general argument register. */
- int_argreg ++;
- }
- else
- ;
- /* Store it as the integers, 8 bytes at the time, if
- necessary spilling on the stack. */
- }
+ /* NOTE WELL!!!!! This is not an "else if" clause!!!
+ That's because some *&^%$ things get passed on the stack
+ AND in the registers! */
+ if (argreg <= ARGLAST_REGNUM)
+ {
+ /* there's room in a register */
+ regval = extract_unsigned_integer (val, register_size (gdbarch,
+ argreg));
+ regcache_cooked_write_unsigned (regcache, argreg++, regval);
+ }
+ /* Store the value 4 bytes at a time. This means that things
+ larger than 4 bytes may go partly in registers and partly
+ on the stack. */
+ len -= register_size (gdbarch, argreg);
+ val += register_size (gdbarch, argreg);
}
}
- return sp;
-}
-
-/* Function: push_return_address (pc)
- Set up the return address for the inferior function call.
- Needed for targets where we don't actually execute a JSR/BSR instruction */
-static CORE_ADDR
-sh64_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
-{
- write_register (gdbarch_tdep (current_gdbarch)->PR_REGNUM,
- CALL_DUMMY_ADDRESS ());
- return sp;
-}
+ /* Store return address. */
+ regcache_cooked_write_unsigned (regcache, PR_REGNUM, bp_addr);
-/* Function: fix_call_dummy
- Poke the callee function's address into the destination part of
- the CALL_DUMMY. The address is actually stored in a data word
- following the actualy CALL_DUMMY instructions, which will load
- it into a register using PC-relative addressing. This function
- expects the CALL_DUMMY to look like this:
-
- mov.w @(2,PC), R8
- jsr @R8
- nop
- trap
- <destination>
- */
+ /* Update stack pointer. */
+ regcache_cooked_write_unsigned (regcache, SP_REGNUM, sp);
-#if 0
-void
-sh_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
- struct value **args, struct type *type, int gcc_p)
-{
- *(unsigned long *) (dummy + 8) = fun;
+ return sp;
}
-#endif
/* Find a function's return value in the appropriate registers (in
regbuf), and copy it into valbuf. Extract from an array REGBUF
@@ -2440,59 +1189,6 @@ sh3e_sh4_extract_return_value (struct type *type, struct regcache *regcache,
sh_default_extract_return_value (type, regcache, valbuf);
}
-static void
-sh64_extract_return_value (struct type *type, char *regbuf, char *valbuf)
-{
- int offset;
- int return_register;
- int len = TYPE_LENGTH (type);
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (TYPE_CODE (type) == TYPE_CODE_FLT)
- {
- if (len == 4)
- {
- /* Return value stored in FP0_REGNUM */
- return_register = FP0_REGNUM;
- offset = REGISTER_BYTE (return_register);
- memcpy (valbuf, (char *) regbuf + offset, len);
- }
- else if (len == 8)
- {
- /* return value stored in DR0_REGNUM */
- DOUBLEST val;
-
- return_register = tdep->DR0_REGNUM;
- offset = REGISTER_BYTE (return_register);
-
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
- floatformat_to_doublest (&floatformat_ieee_double_littlebyte_bigword,
- (char *) regbuf + offset, &val);
- else
- floatformat_to_doublest (&floatformat_ieee_double_big,
- (char *) regbuf + offset, &val);
- deprecated_store_floating (valbuf, len, val);
- }
- }
- else
- {
- if (len <= 8)
- {
- /* Result is in register 2. If smaller than 8 bytes, it is padded
- at the most significant end. */
- return_register = tdep->RETURN_REGNUM;
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- offset = REGISTER_BYTE (return_register) +
- REGISTER_RAW_SIZE (return_register) - len;
- else
- offset = REGISTER_BYTE (return_register);
- memcpy (valbuf, (char *) regbuf + offset, len);
- }
- else
- error ("bad size for return value");
- }
-}
-
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format.
If the architecture is sh4 or sh3e, store a function's return value
@@ -2534,58 +1230,15 @@ sh3e_sh4_store_return_value (struct type *type, struct regcache *regcache,
sh_default_store_return_value (type, regcache, valbuf);
}
-static void
-sh64_store_return_value (struct type *type, char *valbuf)
-{
- char buf[64]; /* more than enough... */
- int len = TYPE_LENGTH (type);
-
- if (TYPE_CODE (type) == TYPE_CODE_FLT)
- {
- if (len == 4)
- {
- /* Return value stored in FP0_REGNUM */
- deprecated_write_register_gen (FP0_REGNUM, valbuf);
- }
- if (len == 8)
- {
- /* return value stored in DR0_REGNUM */
- /* FIXME: Implement */
- }
- }
- else
- {
- int return_register = gdbarch_tdep (current_gdbarch)->RETURN_REGNUM;
- int offset = 0;
-
- if (len <= REGISTER_RAW_SIZE (return_register))
- {
- /* Pad with zeros. */
- memset (buf, 0, REGISTER_RAW_SIZE (return_register));
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
- offset = 0; /*REGISTER_RAW_SIZE (return_register) - len;*/
- else
- offset = REGISTER_RAW_SIZE (return_register) - len;
-
- memcpy (buf + offset, valbuf, len);
- deprecated_write_register_gen (return_register, buf);
- }
- else
- deprecated_write_register_gen (return_register, valbuf);
- }
-}
-
/* Print the registers in a form similar to the E7000 */
static void
sh_generic_show_regs (void)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
paddr (read_register (PC_REGNUM)),
- (long) read_register (tdep->SR_REGNUM),
- (long) read_register (tdep->PR_REGNUM),
+ (long) read_register (SR_REGNUM),
+ (long) read_register (PR_REGNUM),
(long) read_register (MACH_REGNUM),
(long) read_register (MACL_REGNUM));
@@ -2616,12 +1269,10 @@ sh_generic_show_regs (void)
static void
sh3_show_regs (void)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
paddr (read_register (PC_REGNUM)),
- (long) read_register (tdep->SR_REGNUM),
- (long) read_register (tdep->PR_REGNUM),
+ (long) read_register (SR_REGNUM),
+ (long) read_register (PR_REGNUM),
(long) read_register (MACH_REGNUM),
(long) read_register (MACL_REGNUM));
@@ -2629,8 +1280,8 @@ sh3_show_regs (void)
(long) read_register (GBR_REGNUM),
(long) read_register (VBR_REGNUM));
printf_filtered (" SSR=%08lx SPC=%08lx",
- (long) read_register (tdep->SSR_REGNUM),
- (long) read_register (tdep->SPC_REGNUM));
+ (long) read_register (SSR_REGNUM),
+ (long) read_register (SPC_REGNUM));
printf_filtered ("\nR0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
(long) read_register (0),
@@ -2667,8 +1318,8 @@ sh2e_show_regs (void)
(long) read_register (GBR_REGNUM),
(long) read_register (VBR_REGNUM));
printf_filtered (" FPUL=%08lx FPSCR=%08lx",
- (long) read_register (gdbarch_tdep (current_gdbarch)->FPUL_REGNUM),
- (long) read_register (gdbarch_tdep (current_gdbarch)->FPSCR_REGNUM));
+ (long) read_register (FPUL_REGNUM),
+ (long) read_register (FPSCR_REGNUM));
printf_filtered ("\nR0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
(long) read_register (0),
@@ -2712,12 +1363,10 @@ sh2e_show_regs (void)
static void
sh3e_show_regs (void)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
paddr (read_register (PC_REGNUM)),
- (long) read_register (tdep->SR_REGNUM),
- (long) read_register (tdep->PR_REGNUM),
+ (long) read_register (SR_REGNUM),
+ (long) read_register (PR_REGNUM),
(long) read_register (MACH_REGNUM),
(long) read_register (MACL_REGNUM));
@@ -2725,11 +1374,11 @@ sh3e_show_regs (void)
(long) read_register (GBR_REGNUM),
(long) read_register (VBR_REGNUM));
printf_filtered (" SSR=%08lx SPC=%08lx",
- (long) read_register (tdep->SSR_REGNUM),
- (long) read_register (tdep->SPC_REGNUM));
+ (long) read_register (SSR_REGNUM),
+ (long) read_register (SPC_REGNUM));
printf_filtered (" FPUL=%08lx FPSCR=%08lx",
- (long) read_register (tdep->FPUL_REGNUM),
- (long) read_register (tdep->FPSCR_REGNUM));
+ (long) read_register (FPUL_REGNUM),
+ (long) read_register (FPSCR_REGNUM));
printf_filtered ("\nR0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
(long) read_register (0),
@@ -2773,12 +1422,10 @@ sh3e_show_regs (void)
static void
sh3_dsp_show_regs (void)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
paddr (read_register (PC_REGNUM)),
- (long) read_register (tdep->SR_REGNUM),
- (long) read_register (tdep->PR_REGNUM),
+ (long) read_register (SR_REGNUM),
+ (long) read_register (PR_REGNUM),
(long) read_register (MACH_REGNUM),
(long) read_register (MACL_REGNUM));
@@ -2787,11 +1434,11 @@ sh3_dsp_show_regs (void)
(long) read_register (VBR_REGNUM));
printf_filtered (" SSR=%08lx SPC=%08lx",
- (long) read_register (tdep->SSR_REGNUM),
- (long) read_register (tdep->SPC_REGNUM));
+ (long) read_register (SSR_REGNUM),
+ (long) read_register (SPC_REGNUM));
printf_filtered (" DSR=%08lx",
- (long) read_register (tdep->DSR_REGNUM));
+ (long) read_register (DSR_REGNUM));
printf_filtered ("\nR0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
(long) read_register (0),
@@ -2813,32 +1460,30 @@ sh3_dsp_show_regs (void)
(long) read_register (15));
printf_filtered ("A0G=%02lx A0=%08lx M0=%08lx X0=%08lx Y0=%08lx RS=%08lx MOD=%08lx\n",
- (long) read_register (tdep->A0G_REGNUM) & 0xff,
- (long) read_register (tdep->A0_REGNUM),
- (long) read_register (tdep->M0_REGNUM),
- (long) read_register (tdep->X0_REGNUM),
- (long) read_register (tdep->Y0_REGNUM),
- (long) read_register (tdep->RS_REGNUM),
- (long) read_register (tdep->MOD_REGNUM));
+ (long) read_register (A0G_REGNUM) & 0xff,
+ (long) read_register (A0_REGNUM),
+ (long) read_register (M0_REGNUM),
+ (long) read_register (X0_REGNUM),
+ (long) read_register (Y0_REGNUM),
+ (long) read_register (RS_REGNUM),
+ (long) read_register (MOD_REGNUM));
printf_filtered ("A1G=%02lx A1=%08lx M1=%08lx X1=%08lx Y1=%08lx RE=%08lx\n",
- (long) read_register (tdep->A1G_REGNUM) & 0xff,
- (long) read_register (tdep->A1_REGNUM),
- (long) read_register (tdep->M1_REGNUM),
- (long) read_register (tdep->X1_REGNUM),
- (long) read_register (tdep->Y1_REGNUM),
- (long) read_register (tdep->RE_REGNUM));
+ (long) read_register (A1G_REGNUM) & 0xff,
+ (long) read_register (A1_REGNUM),
+ (long) read_register (M1_REGNUM),
+ (long) read_register (X1_REGNUM),
+ (long) read_register (Y1_REGNUM),
+ (long) read_register (RE_REGNUM));
}
static void
sh4_show_regs (void)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- int pr = read_register (tdep->FPSCR_REGNUM) & 0x80000;
+ int pr = read_register (FPSCR_REGNUM) & 0x80000;
printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
paddr (read_register (PC_REGNUM)),
- (long) read_register (tdep->SR_REGNUM),
- (long) read_register (tdep->PR_REGNUM),
+ (long) read_register (SR_REGNUM),
+ (long) read_register (PR_REGNUM),
(long) read_register (MACH_REGNUM),
(long) read_register (MACL_REGNUM));
@@ -2846,11 +1491,11 @@ sh4_show_regs (void)
(long) read_register (GBR_REGNUM),
(long) read_register (VBR_REGNUM));
printf_filtered (" SSR=%08lx SPC=%08lx",
- (long) read_register (tdep->SSR_REGNUM),
- (long) read_register (tdep->SPC_REGNUM));
+ (long) read_register (SSR_REGNUM),
+ (long) read_register (SPC_REGNUM));
printf_filtered (" FPUL=%08lx FPSCR=%08lx",
- (long) read_register (tdep->FPUL_REGNUM),
- (long) read_register (tdep->FPSCR_REGNUM));
+ (long) read_register (FPUL_REGNUM),
+ (long) read_register (FPSCR_REGNUM));
printf_filtered ("\nR0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
(long) read_register (0),
@@ -2898,12 +1543,10 @@ sh4_show_regs (void)
static void
sh_dsp_show_regs (void)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
printf_filtered ("PC=%s SR=%08lx PR=%08lx MACH=%08lx MACHL=%08lx\n",
paddr (read_register (PC_REGNUM)),
- (long) read_register (tdep->SR_REGNUM),
- (long) read_register (tdep->PR_REGNUM),
+ (long) read_register (SR_REGNUM),
+ (long) read_register (PR_REGNUM),
(long) read_register (MACH_REGNUM),
(long) read_register (MACL_REGNUM));
@@ -2912,7 +1555,7 @@ sh_dsp_show_regs (void)
(long) read_register (VBR_REGNUM));
printf_filtered (" DSR=%08lx",
- (long) read_register (tdep->DSR_REGNUM));
+ (long) read_register (DSR_REGNUM));
printf_filtered ("\nR0-R7 %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
(long) read_register (0),
@@ -2934,112 +1577,20 @@ sh_dsp_show_regs (void)
(long) read_register (15));
printf_filtered ("A0G=%02lx A0=%08lx M0=%08lx X0=%08lx Y0=%08lx RS=%08lx MOD=%08lx\n",
- (long) read_register (tdep->A0G_REGNUM) & 0xff,
- (long) read_register (tdep->A0_REGNUM),
- (long) read_register (tdep->M0_REGNUM),
- (long) read_register (tdep->X0_REGNUM),
- (long) read_register (tdep->Y0_REGNUM),
- (long) read_register (tdep->RS_REGNUM),
- (long) read_register (tdep->MOD_REGNUM));
+ (long) read_register (A0G_REGNUM) & 0xff,
+ (long) read_register (A0_REGNUM),
+ (long) read_register (M0_REGNUM),
+ (long) read_register (X0_REGNUM),
+ (long) read_register (Y0_REGNUM),
+ (long) read_register (RS_REGNUM),
+ (long) read_register (MOD_REGNUM));
printf_filtered ("A1G=%02lx A1=%08lx M1=%08lx X1=%08lx Y1=%08lx RE=%08lx\n",
- (long) read_register (tdep->A1G_REGNUM) & 0xff,
- (long) read_register (tdep->A1_REGNUM),
- (long) read_register (tdep->M1_REGNUM),
- (long) read_register (tdep->X1_REGNUM),
- (long) read_register (tdep->Y1_REGNUM),
- (long) read_register (tdep->RE_REGNUM));
-}
-
-static void
-sh64_show_media_regs (void)
-{
- int i;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- printf_filtered ("PC=%s SR=%016llx \n",
- paddr (read_register (PC_REGNUM)),
- (long long) read_register (tdep->SR_REGNUM));
-
- printf_filtered ("SSR=%016llx SPC=%016llx \n",
- (long long) read_register (tdep->SSR_REGNUM),
- (long long) read_register (tdep->SPC_REGNUM));
- printf_filtered ("FPSCR=%016lx\n ",
- (long) read_register (tdep->FPSCR_REGNUM));
-
- for (i = 0; i < 64; i = i + 4)
- printf_filtered ("\nR%d-R%d %016llx %016llx %016llx %016llx\n",
- i, i + 3,
- (long long) read_register (i + 0),
- (long long) read_register (i + 1),
- (long long) read_register (i + 2),
- (long long) read_register (i + 3));
-
- printf_filtered ("\n");
-
- for (i = 0; i < 64; i = i + 8)
- printf_filtered ("FR%d-FR%d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- i, i + 7,
- (long) read_register (FP0_REGNUM + i + 0),
- (long) read_register (FP0_REGNUM + i + 1),
- (long) read_register (FP0_REGNUM + i + 2),
- (long) read_register (FP0_REGNUM + i + 3),
- (long) read_register (FP0_REGNUM + i + 4),
- (long) read_register (FP0_REGNUM + i + 5),
- (long) read_register (FP0_REGNUM + i + 6),
- (long) read_register (FP0_REGNUM + i + 7));
-}
-
-static void
-sh64_show_compact_regs (void)
-{
- int i;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- printf_filtered ("PC=%s \n",
- paddr (read_register (tdep->PC_C_REGNUM)));
-
- printf_filtered ("GBR=%08lx MACH=%08lx MACL=%08lx PR=%08lx T=%08lx\n",
- (long) read_register (tdep->GBR_C_REGNUM),
- (long) read_register (tdep->MACH_C_REGNUM),
- (long) read_register (tdep->MACL_C_REGNUM),
- (long) read_register (tdep->PR_C_REGNUM),
- (long) read_register (tdep->T_C_REGNUM));
- printf_filtered ("FPSCR=%08lx FPUL=%08lx\n",
- (long) read_register (tdep->FPSCR_REGNUM),
- (long) read_register (tdep->FPUL_REGNUM));
-
- for (i = 0; i < 16; i = i + 4)
- printf_filtered ("\nR%d-R%d %08lx %08lx %08lx %08lx\n",
- i, i + 3,
- (long) read_register (i + 0),
- (long) read_register (i + 1),
- (long) read_register (i + 2),
- (long) read_register (i + 3));
-
- printf_filtered ("\n");
-
- for (i = 0; i < 16; i = i + 8)
- printf_filtered ("FR%d-FR%d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
- i, i + 7,
- (long) read_register (FP0_REGNUM + i + 0),
- (long) read_register (FP0_REGNUM + i + 1),
- (long) read_register (FP0_REGNUM + i + 2),
- (long) read_register (FP0_REGNUM + i + 3),
- (long) read_register (FP0_REGNUM + i + 4),
- (long) read_register (FP0_REGNUM + i + 5),
- (long) read_register (FP0_REGNUM + i + 6),
- (long) read_register (FP0_REGNUM + i + 7));
-}
-
-/*FIXME!!! This only shows the registers for shmedia, excluding the
- pseudo registers. */
-static void
-sh64_show_regs (void)
-{
- if (pc_is_isa32 (get_frame_pc (deprecated_selected_frame)))
- sh64_show_media_regs ();
- else
- sh64_show_compact_regs ();
+ (long) read_register (A1G_REGNUM) & 0xff,
+ (long) read_register (A1_REGNUM),
+ (long) read_register (M1_REGNUM),
+ (long) read_register (X1_REGNUM),
+ (long) read_register (Y1_REGNUM),
+ (long) read_register (RE_REGNUM));
}
static void
@@ -3049,206 +1600,14 @@ sh_show_regs_command (char *args, int from_tty)
(*sh_show_regs)();
}
-/* *INDENT-OFF* */
-/*
- SH MEDIA MODE (ISA 32)
- general registers (64-bit) 0-63
-0 r0, r1, r2, r3, r4, r5, r6, r7,
-64 r8, r9, r10, r11, r12, r13, r14, r15,
-128 r16, r17, r18, r19, r20, r21, r22, r23,
-192 r24, r25, r26, r27, r28, r29, r30, r31,
-256 r32, r33, r34, r35, r36, r37, r38, r39,
-320 r40, r41, r42, r43, r44, r45, r46, r47,
-384 r48, r49, r50, r51, r52, r53, r54, r55,
-448 r56, r57, r58, r59, r60, r61, r62, r63,
-
- pc (64-bit) 64
-512 pc,
-
- status reg., saved status reg., saved pc reg. (64-bit) 65-67
-520 sr, ssr, spc,
-
- target registers (64-bit) 68-75
-544 tr0, tr1, tr2, tr3, tr4, tr5, tr6, tr7,
-
- floating point state control register (32-bit) 76
-608 fpscr,
-
- single precision floating point registers (32-bit) 77-140
-612 fr0, fr1, fr2, fr3, fr4, fr5, fr6, fr7,
-644 fr8, fr9, fr10, fr11, fr12, fr13, fr14, fr15,
-676 fr16, fr17, fr18, fr19, fr20, fr21, fr22, fr23,
-708 fr24, fr25, fr26, fr27, fr28, fr29, fr30, fr31,
-740 fr32, fr33, fr34, fr35, fr36, fr37, fr38, fr39,
-772 fr40, fr41, fr42, fr43, fr44, fr45, fr46, fr47,
-804 fr48, fr49, fr50, fr51, fr52, fr53, fr54, fr55,
-836 fr56, fr57, fr58, fr59, fr60, fr61, fr62, fr63,
-
-TOTAL SPACE FOR REGISTERS: 868 bytes
-
-From here on they are all pseudo registers: no memory allocated.
-REGISTER_BYTE returns the register byte for the base register.
-
- double precision registers (pseudo) 141-172
- dr0, dr2, dr4, dr6, dr8, dr10, dr12, dr14,
- dr16, dr18, dr20, dr22, dr24, dr26, dr28, dr30,
- dr32, dr34, dr36, dr38, dr40, dr42, dr44, dr46,
- dr48, dr50, dr52, dr54, dr56, dr58, dr60, dr62,
-
- floating point pairs (pseudo) 173-204
- fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14,
- fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30,
- fp32, fp34, fp36, fp38, fp40, fp42, fp44, fp46,
- fp48, fp50, fp52, fp54, fp56, fp58, fp60, fp62,
-
- floating point vectors (4 floating point regs) (pseudo) 205-220
- fv0, fv4, fv8, fv12, fv16, fv20, fv24, fv28,
- fv32, fv36, fv40, fv44, fv48, fv52, fv56, fv60,
-
- SH COMPACT MODE (ISA 16) (all pseudo) 221-272
- r0_c, r1_c, r2_c, r3_c, r4_c, r5_c, r6_c, r7_c,
- r8_c, r9_c, r10_c, r11_c, r12_c, r13_c, r14_c, r15_c,
- pc_c,
- gbr_c, mach_c, macl_c, pr_c, t_c,
- fpscr_c, fpul_c,
- fr0_c, fr1_c, fr2_c, fr3_c, fr4_c, fr5_c, fr6_c, fr7_c,
- fr8_c, fr9_c, fr10_c, fr11_c, fr12_c, fr13_c, fr14_c, fr15_c
- dr0_c, dr2_c, dr4_c, dr6_c, dr8_c, dr10_c, dr12_c, dr14_c
- fv0_c, fv4_c, fv8_c, fv12_c
-*/
-/* *INDENT-ON* */
-static int
-sh_sh64_register_byte (int reg_nr)
-{
- int base_regnum = -1;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- /* If it is a pseudo register, get the number of the first floating
- point register that is part of it. */
- if (reg_nr >= tdep->DR0_REGNUM
- && reg_nr <= tdep->DR_LAST_REGNUM)
- base_regnum = dr_reg_base_num (reg_nr);
-
- else if (reg_nr >= tdep->FPP0_REGNUM
- && reg_nr <= tdep->FPP_LAST_REGNUM)
- base_regnum = fpp_reg_base_num (reg_nr);
-
- else if (reg_nr >= tdep->FV0_REGNUM
- && reg_nr <= tdep->FV_LAST_REGNUM)
- base_regnum = fv_reg_base_num (reg_nr);
-
- /* sh compact pseudo register. FPSCR is a pathological case, need to
- treat it as special. */
- else if ((reg_nr >= tdep->R0_C_REGNUM
- && reg_nr <= tdep->FV_LAST_C_REGNUM)
- && reg_nr != tdep->FPSCR_C_REGNUM)
- base_regnum = sh64_compact_reg_base_num (reg_nr);
-
- /* Now return the offset in bytes within the register cache. */
- /* sh media pseudo register, i.e. any of DR, FFP, FV registers. */
- if (reg_nr >= tdep->DR0_REGNUM
- && reg_nr <= tdep->FV_LAST_REGNUM)
- return (base_regnum - FP0_REGNUM + 1) * 4
- + (tdep->TR7_REGNUM + 1) * 8;
-
- /* sh compact pseudo register: general register */
- if ((reg_nr >= tdep->R0_C_REGNUM
- && reg_nr <= tdep->R_LAST_C_REGNUM))
- return (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
- ? base_regnum * 8 + 4
- : base_regnum * 8);
-
- /* sh compact pseudo register: */
- if (reg_nr == tdep->PC_C_REGNUM
- || reg_nr == tdep->GBR_C_REGNUM
- || reg_nr == tdep->MACL_C_REGNUM
- || reg_nr == tdep->PR_C_REGNUM)
- return (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
- ? base_regnum * 8 + 4
- : base_regnum * 8);
-
- if (reg_nr == tdep->MACH_C_REGNUM)
- return base_regnum * 8;
-
- if (reg_nr == tdep->T_C_REGNUM)
- return base_regnum * 8; /* FIXME??? how do we get bit 0? Do we have to? */
-
- /* sh compact pseudo register: floating point register */
- else if (reg_nr >=tdep->FP0_C_REGNUM
- && reg_nr <= tdep->FV_LAST_C_REGNUM)
- return (base_regnum - FP0_REGNUM) * 4
- + (tdep->TR7_REGNUM + 1) * 8 + 4;
-
- else if (reg_nr == tdep->FPSCR_C_REGNUM)
- /* This is complicated, for now return the beginning of the
- architectural FPSCR register. */
- return (tdep->TR7_REGNUM + 1) * 8;
-
- else if (reg_nr == tdep->FPUL_C_REGNUM)
- return ((base_regnum - FP0_REGNUM) * 4 +
- (tdep->TR7_REGNUM + 1) * 8 + 4);
-
- /* It is not a pseudo register. */
- /* It is a 64 bit register. */
- else if (reg_nr <= tdep->TR7_REGNUM)
- return reg_nr * 8;
-
- /* It is a 32 bit register. */
- else
- if (reg_nr == tdep->FPSCR_REGNUM)
- return (tdep->FPSCR_REGNUM * 8);
-
- /* It is floating point 32-bit register */
- else
- return ((tdep->TR7_REGNUM + 1) * 8
- + (reg_nr - FP0_REGNUM + 1) * 4);
-}
-
-static int
-sh_sh64_register_raw_size (int reg_nr)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if ((reg_nr >= tdep->DR0_REGNUM
- && reg_nr <= tdep->DR_LAST_REGNUM)
- || (reg_nr >= tdep->FPP0_REGNUM
- && reg_nr <= tdep->FPP_LAST_REGNUM)
- || (reg_nr >= tdep->DR0_C_REGNUM
- && reg_nr <= tdep->DR_LAST_C_REGNUM)
- || (reg_nr <= tdep->TR7_REGNUM))
- return 8;
-
- else if ((reg_nr >= tdep->FV0_REGNUM
- && reg_nr <= tdep->FV_LAST_REGNUM)
- || (reg_nr >= tdep->FV0_C_REGNUM
- && reg_nr <= tdep->FV_LAST_C_REGNUM))
- return 16;
-
- else /* this covers also the 32-bit SH compact registers. */
- return 4;
-}
-
-/* ??????? FIXME */
-static int
-sh_sh64_register_virtual_size (int reg_nr)
-{
- if (reg_nr >= FP0_REGNUM
- && reg_nr <= gdbarch_tdep (current_gdbarch)->FP_LAST_REGNUM)
- return 4;
- else
- return 8;
-}
-
/* Return the GDB type object for the "standard" data type
of data in register N. */
static struct type *
sh_sh3e_register_type (struct gdbarch *gdbarch, int reg_nr)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
if ((reg_nr >= FP0_REGNUM
- && (reg_nr <= tdep->FP_LAST_REGNUM))
- || (reg_nr == tdep->FPUL_REGNUM))
+ && (reg_nr <= FP_LAST_REGNUM))
+ || (reg_nr == FPUL_REGNUM))
return builtin_type_float;
else
return builtin_type_int;
@@ -3266,55 +1625,21 @@ sh_sh4_build_float_register_type (int high)
static struct type *
sh_sh4_register_type (struct gdbarch *gdbarch, int reg_nr)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
if ((reg_nr >= FP0_REGNUM
- && (reg_nr <= tdep->FP_LAST_REGNUM))
- || (reg_nr == tdep->FPUL_REGNUM))
+ && (reg_nr <= FP_LAST_REGNUM))
+ || (reg_nr == FPUL_REGNUM))
return builtin_type_float;
- else if (reg_nr >= tdep->DR0_REGNUM
- && reg_nr <= tdep->DR_LAST_REGNUM)
+ else if (reg_nr >= DR0_REGNUM
+ && reg_nr <= DR_LAST_REGNUM)
return builtin_type_double;
- else if (reg_nr >= tdep->FV0_REGNUM
- && reg_nr <= tdep->FV_LAST_REGNUM)
+ else if (reg_nr >= FV0_REGNUM
+ && reg_nr <= FV_LAST_REGNUM)
return sh_sh4_build_float_register_type (3);
else
return builtin_type_int;
}
static struct type *
-sh_sh64_register_virtual_type (int reg_nr)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if ((reg_nr >= FP0_REGNUM
- && reg_nr <= tdep->FP_LAST_REGNUM)
- || (reg_nr >= tdep->FP0_C_REGNUM
- && reg_nr <= tdep->FP_LAST_C_REGNUM))
- return builtin_type_float;
- else if ((reg_nr >= tdep->DR0_REGNUM
- && reg_nr <= tdep->DR_LAST_REGNUM)
- || (reg_nr >= tdep->DR0_C_REGNUM
- && reg_nr <= tdep->DR_LAST_C_REGNUM))
- return builtin_type_double;
- else if (reg_nr >= tdep->FPP0_REGNUM
- && reg_nr <= tdep->FPP_LAST_REGNUM)
- return sh_sh4_build_float_register_type (1);
- else if ((reg_nr >= tdep->FV0_REGNUM
- && reg_nr <= tdep->FV_LAST_REGNUM)
- ||(reg_nr >= tdep->FV0_C_REGNUM
- && reg_nr <= tdep->FV_LAST_C_REGNUM))
- return sh_sh4_build_float_register_type (3);
- else if (reg_nr == tdep->FPSCR_REGNUM)
- return builtin_type_int;
- else if (reg_nr >= tdep->R0_C_REGNUM
- && reg_nr < tdep->FP0_C_REGNUM)
- return builtin_type_int;
- else
- return builtin_type_long_long;
-}
-
-static struct type *
sh_default_register_type (struct gdbarch *gdbarch, int reg_nr)
{
return builtin_type_int;
@@ -3350,10 +1675,8 @@ static void
sh_sh4_register_convert_to_virtual (int regnum, struct type *type,
char *from, char *to)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (regnum >= tdep->DR0_REGNUM
- && regnum <= tdep->DR_LAST_REGNUM)
+ if (regnum >= DR0_REGNUM
+ && regnum <= DR_LAST_REGNUM)
{
DOUBLEST val;
floatformat_to_doublest (&floatformat_ieee_double_littlebyte_bigword, from, &val);
@@ -3364,39 +1687,11 @@ sh_sh4_register_convert_to_virtual (int regnum, struct type *type,
}
static void
-sh_sh64_register_convert_to_virtual (int regnum, struct type *type,
- char *from, char *to)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (TARGET_BYTE_ORDER != BFD_ENDIAN_LITTLE)
- {
- /* It is a no-op. */
- memcpy (to, from, REGISTER_RAW_SIZE (regnum));
- return;
- }
-
- if ((regnum >= tdep->DR0_REGNUM
- && regnum <= tdep->DR_LAST_REGNUM)
- || (regnum >= tdep->DR0_C_REGNUM
- && regnum <= tdep->DR_LAST_C_REGNUM))
- {
- DOUBLEST val;
- floatformat_to_doublest (&floatformat_ieee_double_littlebyte_bigword, from, &val);
- deprecated_store_floating(to, TYPE_LENGTH(type), val);
- }
- else
- error("sh_register_convert_to_virtual called with non DR register number");
-}
-
-static void
sh_sh4_register_convert_to_raw (struct type *type, int regnum,
const void *from, void *to)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (regnum >= tdep->DR0_REGNUM
- && regnum <= tdep->DR_LAST_REGNUM)
+ if (regnum >= DR0_REGNUM
+ && regnum <= DR_LAST_REGNUM)
{
DOUBLEST val = extract_typed_floating (from, type);
floatformat_from_doublest (&floatformat_ieee_double_littlebyte_bigword, &val, to);
@@ -3406,40 +1701,14 @@ sh_sh4_register_convert_to_raw (struct type *type, int regnum,
}
static void
-sh_sh64_register_convert_to_raw (struct type *type, int regnum,
- const void *from, void *to)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (TARGET_BYTE_ORDER != BFD_ENDIAN_LITTLE)
- {
- /* It is a no-op. */
- memcpy (to, from, REGISTER_RAW_SIZE (regnum));
- return;
- }
-
- if ((regnum >= tdep->DR0_REGNUM
- && regnum <= tdep->DR_LAST_REGNUM)
- || (regnum >= tdep->DR0_C_REGNUM
- && regnum <= tdep->DR_LAST_C_REGNUM))
- {
- DOUBLEST val = deprecated_extract_floating (from, TYPE_LENGTH(type));
- floatformat_from_doublest (&floatformat_ieee_double_littlebyte_bigword, &val, to);
- }
- else
- error("sh_register_convert_to_raw called with non DR register number");
-}
-
-static void
sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
int reg_nr, void *buffer)
{
int base_regnum, portion;
char temp_buffer[MAX_REGISTER_SIZE];
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- if (reg_nr >= tdep->DR0_REGNUM
- && reg_nr <= tdep->DR_LAST_REGNUM)
+ if (reg_nr >= DR0_REGNUM
+ && reg_nr <= DR_LAST_REGNUM)
{
base_regnum = dr_reg_base_num (reg_nr);
@@ -3454,8 +1723,8 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
gdbarch_register_type (gdbarch, reg_nr),
temp_buffer, buffer);
}
- else if (reg_nr >= tdep->FV0_REGNUM
- && reg_nr <= tdep->FV_LAST_REGNUM)
+ else if (reg_nr >= FV0_REGNUM
+ && reg_nr <= FV_LAST_REGNUM)
{
base_regnum = fv_reg_base_num (reg_nr);
@@ -3468,181 +1737,14 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
}
static void
-sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
- int reg_nr, void *buffer)
-{
- int base_regnum;
- int portion;
- int offset = 0;
- char temp_buffer[MAX_REGISTER_SIZE];
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
- if (reg_nr >= tdep->DR0_REGNUM
- && reg_nr <= tdep->DR_LAST_REGNUM)
- {
- base_regnum = dr_reg_base_num (reg_nr);
-
- /* Build the value in the provided buffer. */
- /* DR regs are double precision registers obtained by
- concatenating 2 single precision floating point registers. */
- for (portion = 0; portion < 2; portion++)
- regcache_raw_read (regcache, base_regnum + portion,
- (temp_buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion));
-
- /* We must pay attention to the endiannes. */
- sh_sh64_register_convert_to_virtual (reg_nr, REGISTER_VIRTUAL_TYPE (reg_nr),
- temp_buffer, buffer);
-
- }
-
- else if (reg_nr >= tdep->FPP0_REGNUM
- && reg_nr <= tdep->FPP_LAST_REGNUM)
- {
- base_regnum = fpp_reg_base_num (reg_nr);
-
- /* Build the value in the provided buffer. */
- /* FPP regs are pairs of single precision registers obtained by
- concatenating 2 single precision floating point registers. */
- for (portion = 0; portion < 2; portion++)
- regcache_raw_read (regcache, base_regnum + portion,
- ((char *) buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion));
- }
-
- else if (reg_nr >= tdep->FV0_REGNUM
- && reg_nr <= tdep->FV_LAST_REGNUM)
- {
- base_regnum = fv_reg_base_num (reg_nr);
-
- /* Build the value in the provided buffer. */
- /* FV regs are vectors of single precision registers obtained by
- concatenating 4 single precision floating point registers. */
- for (portion = 0; portion < 4; portion++)
- regcache_raw_read (regcache, base_regnum + portion,
- ((char *) buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion));
- }
-
- /* sh compact pseudo registers. 1-to-1 with a shmedia register */
- else if (reg_nr >= tdep->R0_C_REGNUM
- && reg_nr <= tdep->T_C_REGNUM)
- {
- base_regnum = sh64_compact_reg_base_num (reg_nr);
-
- /* Build the value in the provided buffer. */
- regcache_raw_read (regcache, base_regnum, temp_buffer);
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- offset = 4;
- memcpy (buffer, temp_buffer + offset, 4); /* get LOWER 32 bits only????*/
- }
-
- else if (reg_nr >= tdep->FP0_C_REGNUM
- && reg_nr <= tdep->FP_LAST_C_REGNUM)
- {
- base_regnum = sh64_compact_reg_base_num (reg_nr);
-
- /* Build the value in the provided buffer. */
- /* Floating point registers map 1-1 to the media fp regs,
- they have the same size and endienness. */
- regcache_raw_read (regcache, base_regnum, buffer);
- }
-
- else if (reg_nr >= tdep->DR0_C_REGNUM
- && reg_nr <= tdep->DR_LAST_C_REGNUM)
- {
- base_regnum = sh64_compact_reg_base_num (reg_nr);
-
- /* DR_C regs are double precision registers obtained by
- concatenating 2 single precision floating point registers. */
- for (portion = 0; portion < 2; portion++)
- regcache_raw_read (regcache, base_regnum + portion,
- (temp_buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion));
-
- /* We must pay attention to the endiannes. */
- sh_sh64_register_convert_to_virtual (reg_nr, REGISTER_VIRTUAL_TYPE (reg_nr),
- temp_buffer, buffer);
- }
-
- else if (reg_nr >= tdep->FV0_C_REGNUM
- && reg_nr <= tdep->FV_LAST_C_REGNUM)
- {
- base_regnum = sh64_compact_reg_base_num (reg_nr);
-
- /* Build the value in the provided buffer. */
- /* FV_C regs are vectors of single precision registers obtained by
- concatenating 4 single precision floating point registers. */
- for (portion = 0; portion < 4; portion++)
- regcache_raw_read (regcache, base_regnum + portion,
- ((char *) buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion));
- }
-
- else if (reg_nr == tdep->FPSCR_C_REGNUM)
- {
- int fpscr_base_regnum;
- int sr_base_regnum;
- unsigned int fpscr_value;
- unsigned int sr_value;
- unsigned int fpscr_c_value;
- unsigned int fpscr_c_part1_value;
- unsigned int fpscr_c_part2_value;
-
- fpscr_base_regnum = tdep->FPSCR_REGNUM;
- sr_base_regnum = tdep->SR_REGNUM;
-
- /* Build the value in the provided buffer. */
- /* FPSCR_C is a very weird register that contains sparse bits
- from the FPSCR and the SR architectural registers.
- Specifically: */
- /* *INDENT-OFF* */
- /*
- FPSRC_C bit
- 0 Bit 0 of FPSCR
- 1 reserved
- 2-17 Bit 2-18 of FPSCR
- 18-20 Bits 12,13,14 of SR
- 21-31 reserved
- */
- /* *INDENT-ON* */
- /* Get FPSCR into a local buffer */
- regcache_raw_read (regcache, fpscr_base_regnum, temp_buffer);
- /* Get value as an int. */
- fpscr_value = extract_unsigned_integer (temp_buffer, 4);
- /* Get SR into a local buffer */
- regcache_raw_read (regcache, sr_base_regnum, temp_buffer);
- /* Get value as an int. */
- sr_value = extract_unsigned_integer (temp_buffer, 4);
- /* Build the new value. */
- fpscr_c_part1_value = fpscr_value & 0x3fffd;
- fpscr_c_part2_value = (sr_value & 0x7000) << 6;
- fpscr_c_value = fpscr_c_part1_value | fpscr_c_part2_value;
- /* Store that in out buffer!!! */
- store_unsigned_integer (buffer, 4, fpscr_c_value);
- /* FIXME There is surely an endianness gotcha here. */
- }
-
- else if (reg_nr == tdep->FPUL_C_REGNUM)
- {
- base_regnum = sh64_compact_reg_base_num (reg_nr);
-
- /* FPUL_C register is floating point register 32,
- same size, same endianness. */
- regcache_raw_read (regcache, base_regnum, buffer);
- }
-}
-
-static void
sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int reg_nr, const void *buffer)
{
int base_regnum, portion;
char temp_buffer[MAX_REGISTER_SIZE];
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- if (reg_nr >= tdep->DR0_REGNUM
- && reg_nr <= tdep->DR_LAST_REGNUM)
+ if (reg_nr >= DR0_REGNUM
+ && reg_nr <= DR_LAST_REGNUM)
{
base_regnum = dr_reg_base_num (reg_nr);
@@ -3656,8 +1758,8 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
(temp_buffer
+ register_size (gdbarch, base_regnum) * portion));
}
- else if (reg_nr >= tdep->FV0_REGNUM
- && reg_nr <= tdep->FV_LAST_REGNUM)
+ else if (reg_nr >= FV0_REGNUM
+ && reg_nr <= FV_LAST_REGNUM)
{
base_regnum = fv_reg_base_num (reg_nr);
@@ -3669,173 +1771,6 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
}
}
-static void
-sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
- int reg_nr, const void *buffer)
-{
- int base_regnum, portion;
- int offset;
- char temp_buffer[MAX_REGISTER_SIZE];
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
- if (reg_nr >= tdep->DR0_REGNUM
- && reg_nr <= tdep->DR_LAST_REGNUM)
- {
- base_regnum = dr_reg_base_num (reg_nr);
- /* We must pay attention to the endiannes. */
- sh_sh64_register_convert_to_raw (REGISTER_VIRTUAL_TYPE (reg_nr), reg_nr,
- buffer, temp_buffer);
-
-
- /* Write the real regs for which this one is an alias. */
- for (portion = 0; portion < 2; portion++)
- regcache_raw_write (regcache, base_regnum + portion,
- (temp_buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion));
- }
-
- else if (reg_nr >= tdep->FPP0_REGNUM
- && reg_nr <= tdep->FPP_LAST_REGNUM)
- {
- base_regnum = fpp_reg_base_num (reg_nr);
-
- /* Write the real regs for which this one is an alias. */
- for (portion = 0; portion < 2; portion++)
- regcache_raw_write (regcache, base_regnum + portion,
- ((char *) buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion));
- }
-
- else if (reg_nr >= tdep->FV0_REGNUM
- && reg_nr <= tdep->FV_LAST_REGNUM)
- {
- base_regnum = fv_reg_base_num (reg_nr);
-
- /* Write the real regs for which this one is an alias. */
- for (portion = 0; portion < 4; portion++)
- regcache_raw_write (regcache, base_regnum + portion,
- ((char *) buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion));
- }
-
- /* sh compact general pseudo registers. 1-to-1 with a shmedia
- register but only 4 bytes of it. */
- else if (reg_nr >= tdep->R0_C_REGNUM
- && reg_nr <= tdep->T_C_REGNUM)
- {
- base_regnum = sh64_compact_reg_base_num (reg_nr);
- /* reg_nr is 32 bit here, and base_regnum is 64 bits. */
- if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
- offset = 4;
- else
- offset = 0;
- /* Let's read the value of the base register into a temporary
- buffer, so that overwriting the last four bytes with the new
- value of the pseudo will leave the upper 4 bytes unchanged. */
- regcache_raw_read (regcache, base_regnum, temp_buffer);
- /* Write as an 8 byte quantity */
- memcpy (temp_buffer + offset, buffer, 4);
- regcache_raw_write (regcache, base_regnum, temp_buffer);
- }
-
- /* sh floating point compact pseudo registers. 1-to-1 with a shmedia
- registers. Both are 4 bytes. */
- else if (reg_nr >= tdep->FP0_C_REGNUM
- && reg_nr <= tdep->FP_LAST_C_REGNUM)
- {
- base_regnum = sh64_compact_reg_base_num (reg_nr);
- regcache_raw_write (regcache, base_regnum, buffer);
- }
-
- else if (reg_nr >= tdep->DR0_C_REGNUM
- && reg_nr <= tdep->DR_LAST_C_REGNUM)
- {
- base_regnum = sh64_compact_reg_base_num (reg_nr);
- for (portion = 0; portion < 2; portion++)
- {
- /* We must pay attention to the endiannes. */
- sh_sh64_register_convert_to_raw (REGISTER_VIRTUAL_TYPE (reg_nr), reg_nr,
- buffer, temp_buffer);
-
- regcache_raw_write (regcache, base_regnum + portion,
- (temp_buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion));
- }
- }
-
- else if (reg_nr >= tdep->FV0_C_REGNUM
- && reg_nr <= tdep->FV_LAST_C_REGNUM)
- {
- base_regnum = sh64_compact_reg_base_num (reg_nr);
-
- for (portion = 0; portion < 4; portion++)
- {
- regcache_raw_write (regcache, base_regnum + portion,
- ((char *) buffer
- + REGISTER_RAW_SIZE (base_regnum) * portion));
- }
- }
-
- else if (reg_nr == tdep->FPSCR_C_REGNUM)
- {
- int fpscr_base_regnum;
- int sr_base_regnum;
- unsigned int fpscr_value;
- unsigned int sr_value;
- unsigned int old_fpscr_value;
- unsigned int old_sr_value;
- unsigned int fpscr_c_value;
- unsigned int fpscr_mask;
- unsigned int sr_mask;
-
- fpscr_base_regnum = tdep->FPSCR_REGNUM;
- sr_base_regnum = tdep->SR_REGNUM;
-
- /* FPSCR_C is a very weird register that contains sparse bits
- from the FPSCR and the SR architectural registers.
- Specifically: */
- /* *INDENT-OFF* */
- /*
- FPSRC_C bit
- 0 Bit 0 of FPSCR
- 1 reserved
- 2-17 Bit 2-18 of FPSCR
- 18-20 Bits 12,13,14 of SR
- 21-31 reserved
- */
- /* *INDENT-ON* */
- /* Get value as an int. */
- fpscr_c_value = extract_unsigned_integer (buffer, 4);
-
- /* Build the new values. */
- fpscr_mask = 0x0003fffd;
- sr_mask = 0x001c0000;
-
- fpscr_value = fpscr_c_value & fpscr_mask;
- sr_value = (fpscr_value & sr_mask) >> 6;
-
- regcache_raw_read (regcache, fpscr_base_regnum, temp_buffer);
- old_fpscr_value = extract_unsigned_integer (temp_buffer, 4);
- old_fpscr_value &= 0xfffc0002;
- fpscr_value |= old_fpscr_value;
- store_unsigned_integer (temp_buffer, 4, fpscr_value);
- regcache_raw_write (regcache, fpscr_base_regnum, temp_buffer);
-
- regcache_raw_read (regcache, sr_base_regnum, temp_buffer);
- old_sr_value = extract_unsigned_integer (temp_buffer, 4);
- old_sr_value &= 0xffff8fff;
- sr_value |= old_sr_value;
- store_unsigned_integer (temp_buffer, 4, sr_value);
- regcache_raw_write (regcache, sr_base_regnum, temp_buffer);
- }
-
- else if (reg_nr == tdep->FPUL_C_REGNUM)
- {
- base_regnum = sh64_compact_reg_base_num (reg_nr);
- regcache_raw_write (regcache, base_regnum, buffer);
- }
-}
-
/* Floating point vector of 4 float registers. */
static void
do_fv_register_info (struct gdbarch *gdbarch, struct ui_file *file,
@@ -3843,39 +1778,13 @@ do_fv_register_info (struct gdbarch *gdbarch, struct ui_file *file,
{
int first_fp_reg_num = fv_reg_base_num (fv_regnum);
fprintf_filtered (file, "fv%d\t0x%08x\t0x%08x\t0x%08x\t0x%08x\n",
- fv_regnum - gdbarch_tdep (gdbarch)->FV0_REGNUM,
- (int) read_register (first_fp_reg_num),
- (int) read_register (first_fp_reg_num + 1),
- (int) read_register (first_fp_reg_num + 2),
- (int) read_register (first_fp_reg_num + 3));
-}
-
-/* Floating point vector of 4 float registers, compact mode. */
-static void
-do_fv_c_register_info (int fv_regnum)
-{
- int first_fp_reg_num = sh64_compact_reg_base_num (fv_regnum);
- printf_filtered ("fv%d_c\t0x%08x\t0x%08x\t0x%08x\t0x%08x\n",
- fv_regnum - gdbarch_tdep (current_gdbarch)->FV0_C_REGNUM,
+ fv_regnum - FV0_REGNUM,
(int) read_register (first_fp_reg_num),
(int) read_register (first_fp_reg_num + 1),
(int) read_register (first_fp_reg_num + 2),
(int) read_register (first_fp_reg_num + 3));
}
-/* Pairs of single regs. The DR are instead double precision
- registers. */
-static void
-do_fpp_register_info (int fpp_regnum)
-{
- int first_fp_reg_num = fpp_reg_base_num (fpp_regnum);
-
- printf_filtered ("fpp%d\t0x%08x\t0x%08x\n",
- fpp_regnum - gdbarch_tdep (current_gdbarch)->FPP0_REGNUM,
- (int) read_register (first_fp_reg_num),
- (int) read_register (first_fp_reg_num + 1));
-}
-
/* Double precision registers. */
static void
do_dr_register_info (struct gdbarch *gdbarch, struct ui_file *file,
@@ -3884,75 +1793,23 @@ do_dr_register_info (struct gdbarch *gdbarch, struct ui_file *file,
int first_fp_reg_num = dr_reg_base_num (dr_regnum);
fprintf_filtered (file, "dr%d\t0x%08x%08x\n",
- dr_regnum - gdbarch_tdep (gdbarch)->DR0_REGNUM,
+ dr_regnum - DR0_REGNUM,
(int) read_register (first_fp_reg_num),
(int) read_register (first_fp_reg_num + 1));
}
-/* Double precision registers, compact mode. */
-static void
-do_dr_c_register_info (int dr_regnum)
-{
- int first_fp_reg_num = sh64_compact_reg_base_num (dr_regnum);
-
- printf_filtered ("dr%d_c\t0x%08x%08x\n",
- dr_regnum - gdbarch_tdep (current_gdbarch)->DR0_C_REGNUM,
- (int) read_register (first_fp_reg_num),
- (int) read_register (first_fp_reg_num +1));
-}
-
-/* General register in compact mode. */
-static void
-do_r_c_register_info (int r_c_regnum)
-{
- int regnum = sh64_compact_reg_base_num (r_c_regnum);
-
- printf_filtered ("r%d_c\t0x%08x\n",
- r_c_regnum - gdbarch_tdep (current_gdbarch)->R0_C_REGNUM,
- /*FIXME!!!*/ (int) read_register (regnum));
-}
-
-/* FIXME:!! THIS SHOULD TAKE CARE OF GETTING THE RIGHT PORTION OF THE
- shmedia REGISTERS. */
-/* Control registers, compact mode. */
-static void
-do_cr_c_register_info (int cr_c_regnum)
-{
- switch (cr_c_regnum)
- {
- case 237: printf_filtered ("pc_c\t0x%08x\n", (int) read_register (cr_c_regnum));
- break;
- case 238: printf_filtered ("gbr_c\t0x%08x\n", (int) read_register (cr_c_regnum));
- break;
- case 239: printf_filtered ("mach_c\t0x%08x\n", (int) read_register (cr_c_regnum));
- break;
- case 240: printf_filtered ("macl_c\t0x%08x\n", (int) read_register (cr_c_regnum));
- break;
- case 241: printf_filtered ("pr_c\t0x%08x\n", (int) read_register (cr_c_regnum));
- break;
- case 242: printf_filtered ("t_c\t0x%08x\n", (int) read_register (cr_c_regnum));
- break;
- case 243: printf_filtered ("fpscr_c\t0x%08x\n", (int) read_register (cr_c_regnum));
- break;
- case 244: printf_filtered ("fpul_c\t0x%08x\n", (int)read_register (cr_c_regnum));
- break;
- }
-}
-
static void
sh_print_pseudo_register (struct gdbarch *gdbarch, struct ui_file *file,
int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
if (regnum < NUM_REGS || regnum >= NUM_REGS + NUM_PSEUDO_REGS)
internal_error (__FILE__, __LINE__,
"Invalid pseudo register number %d\n", regnum);
- else if (regnum >= tdep->DR0_REGNUM
- && regnum <= tdep->DR_LAST_REGNUM)
+ else if (regnum >= DR0_REGNUM
+ && regnum <= DR_LAST_REGNUM)
do_dr_register_info (gdbarch, file, regnum);
- else if (regnum >= tdep->FV0_REGNUM
- && regnum <= tdep->FV_LAST_REGNUM)
+ else if (regnum >= FV0_REGNUM
+ && regnum <= FV_LAST_REGNUM)
do_fv_register_info (gdbarch, file, regnum);
}
@@ -3988,7 +1845,7 @@ sh_do_fp_register (struct gdbarch *gdbarch, struct ui_file *file, int regnum)
fprintf_filtered (file, "\t(raw 0x");
for (j = 0; j < register_size (gdbarch, regnum); j++)
{
- register int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
+ int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
: register_size (gdbarch, regnum) - 1 - j;
fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]);
}
@@ -3997,51 +1854,6 @@ sh_do_fp_register (struct gdbarch *gdbarch, struct ui_file *file, int regnum)
}
static void
-sh64_do_pseudo_register (int regnum)
-{
- /* All the sh64-compact mode registers are pseudo registers. */
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (regnum < NUM_REGS
- || regnum >= NUM_REGS + NUM_PSEUDO_REGS_SH_MEDIA + NUM_PSEUDO_REGS_SH_COMPACT)
- internal_error (__FILE__, __LINE__,
- "Invalid pseudo register number %d\n", regnum);
-
- else if ((regnum >= tdep->DR0_REGNUM
- && regnum <= tdep->DR_LAST_REGNUM))
- do_dr_register_info (current_gdbarch, gdb_stdout, regnum);
-
- else if ((regnum >= tdep->DR0_C_REGNUM
- && regnum <= tdep->DR_LAST_C_REGNUM))
- do_dr_c_register_info (regnum);
-
- else if ((regnum >= tdep->FV0_REGNUM
- && regnum <= tdep->FV_LAST_REGNUM))
- do_fv_register_info (current_gdbarch, gdb_stdout, regnum);
-
- else if ((regnum >= tdep->FV0_C_REGNUM
- && regnum <= tdep->FV_LAST_C_REGNUM))
- do_fv_c_register_info (regnum);
-
- else if (regnum >= tdep->FPP0_REGNUM
- && regnum <= tdep->FPP_LAST_REGNUM)
- do_fpp_register_info (regnum);
-
- else if (regnum >= tdep->R0_C_REGNUM
- && regnum <= tdep->R_LAST_C_REGNUM)
- do_r_c_register_info (regnum); /* FIXME, this function will not print the right format */
-
- else if (regnum >= tdep->FP0_C_REGNUM
- && regnum <= tdep->FP_LAST_C_REGNUM)
- sh_do_fp_register (current_gdbarch, gdb_stdout, regnum); /* this should work also for pseudoregs */
-
- else if (regnum >= tdep->PC_C_REGNUM
- && regnum <= tdep->FPUL_C_REGNUM)
- do_cr_c_register_info (regnum);
-
-}
-
-static void
sh_do_register (struct gdbarch *gdbarch, struct ui_file *file, int regnum)
{
char raw_buffer[MAX_REGISTER_SIZE];
@@ -4078,10 +1890,7 @@ sh_print_register (struct gdbarch *gdbarch, struct ui_file *file, int regnum)
else if (regnum < NUM_REGS + NUM_PSEUDO_REGS)
{
- if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_sh5)
- sh64_do_pseudo_register (regnum);
- else
- sh_print_pseudo_register (gdbarch, file, regnum);
+ sh_print_pseudo_register (gdbarch, file, regnum);
}
}
@@ -4120,7 +1929,7 @@ sh_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
regnum ++;
}
else
- regnum += (gdbarch_tdep (gdbarch)->FP_LAST_REGNUM - FP0_REGNUM); /* skip FP regs */
+ regnum += (FP_LAST_REGNUM - FP0_REGNUM); /* skip FP regs */
}
else
{
@@ -4132,51 +1941,12 @@ sh_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
if (fpregs)
while (regnum < NUM_REGS + NUM_PSEUDO_REGS)
{
- if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_sh5)
- sh64_do_pseudo_register (regnum);
- else
- sh_print_pseudo_register (gdbarch, file, regnum);
+ sh_print_pseudo_register (gdbarch, file, regnum);
regnum++;
}
}
}
-static void
-sh_compact_do_registers_info (int regnum, int fpregs)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- if (regnum != -1) /* do one specified register */
- {
- if (*(REGISTER_NAME (regnum)) == '\0')
- error ("Not a valid register for the current processor type");
-
- if (regnum >= 0 && regnum < tdep->R0_C_REGNUM)
- error ("Not a valid register for the current processor mode.");
-
- sh_print_register (current_gdbarch, gdb_stdout, regnum);
- }
- else
- /* do all compact registers */
- {
- regnum = tdep->R0_C_REGNUM;
- while (regnum < NUM_REGS + NUM_PSEUDO_REGS)
- {
- sh64_do_pseudo_register (regnum);
- regnum++;
- }
- }
-}
-
-static void
-sh64_do_registers_info (int regnum, int fpregs)
-{
- if (pc_is_isa32 (get_frame_pc (deprecated_selected_frame)))
- sh_print_registers_info (current_gdbarch, gdb_stdout,
- deprecated_selected_frame, regnum, fpregs);
- else
- sh_compact_do_registers_info (regnum, fpregs);
-}
-
#ifdef SVR4_SHARED_LIBS
/* Fetch (and possibly build) an appropriate link_map_offsets structure
@@ -4221,45 +1991,21 @@ sh_linux_svr4_fetch_link_map_offsets (void)
}
#endif /* SVR4_SHARED_LIBS */
-
-enum
-{
- DSP_DSR_REGNUM = 24,
- DSP_A0G_REGNUM,
- DSP_A0_REGNUM,
- DSP_A1G_REGNUM,
- DSP_A1_REGNUM,
- DSP_M0_REGNUM,
- DSP_M1_REGNUM,
- DSP_X0_REGNUM,
- DSP_X1_REGNUM,
- DSP_Y0_REGNUM,
- DSP_Y1_REGNUM,
-
- DSP_MOD_REGNUM = 40,
-
- DSP_RS_REGNUM = 43,
- DSP_RE_REGNUM,
-
- DSP_R0_BANK_REGNUM = 51,
- DSP_R7_BANK_REGNUM = DSP_R0_BANK_REGNUM + 7
-};
-
static int
sh_dsp_register_sim_regno (int nr)
{
if (legacy_register_sim_regno (nr) < 0)
return legacy_register_sim_regno (nr);
- if (nr >= DSP_DSR_REGNUM && nr <= DSP_Y1_REGNUM)
- return nr - DSP_DSR_REGNUM + SIM_SH_DSR_REGNUM;
- if (nr == DSP_MOD_REGNUM)
+ if (nr >= DSR_REGNUM && nr <= Y1_REGNUM)
+ return nr - DSR_REGNUM + SIM_SH_DSR_REGNUM;
+ if (nr == MOD_REGNUM)
return SIM_SH_MOD_REGNUM;
- if (nr == DSP_RS_REGNUM)
+ if (nr == RS_REGNUM)
return SIM_SH_RS_REGNUM;
- if (nr == DSP_RE_REGNUM)
+ if (nr == RE_REGNUM)
return SIM_SH_RE_REGNUM;
- if (nr >= DSP_R0_BANK_REGNUM && nr <= DSP_R7_BANK_REGNUM)
- return nr - DSP_R0_BANK_REGNUM + SIM_SH_R0_BANK_REGNUM;
+ if (nr >= R0_BANK_REGNUM && nr <= R7_BANK_REGNUM)
+ return nr - R0_BANK_REGNUM + SIM_SH_R0_BANK_REGNUM;
return nr;
}
@@ -4268,9 +2014,39 @@ static gdbarch_init_ftype sh_gdbarch_init;
static struct gdbarch *
sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
- static LONGEST sh64_call_dummy_words[] = {0};
struct gdbarch *gdbarch;
- struct gdbarch_tdep *tdep;
+
+ sh_show_regs = sh_generic_show_regs;
+ switch (info.bfd_arch_info->mach)
+ {
+ case bfd_mach_sh2e:
+ sh_show_regs = sh2e_show_regs;
+ break;
+ case bfd_mach_sh_dsp:
+ sh_show_regs = sh_dsp_show_regs;
+ break;
+
+ case bfd_mach_sh3:
+ sh_show_regs = sh3_show_regs;
+ break;
+
+ case bfd_mach_sh3e:
+ sh_show_regs = sh3e_show_regs;
+ break;
+
+ case bfd_mach_sh3_dsp:
+ sh_show_regs = sh3_dsp_show_regs;
+ break;
+
+ case bfd_mach_sh4:
+ sh_show_regs = sh4_show_regs;
+ break;
+
+ case bfd_mach_sh5:
+ sh_show_regs = sh64_show_regs;
+ /* SH5 is handled entirely in sh64-tdep.c */
+ return sh64_gdbarch_init (info, arches);
+ }
/* If there is already a candidate, use it. */
arches = gdbarch_list_lookup_by_info (arches, &info);
@@ -4279,48 +2055,12 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* None found, create a new architecture from the information
provided. */
- tdep = XMALLOC (struct gdbarch_tdep);
- gdbarch = gdbarch_alloc (&info, tdep);
+ gdbarch = gdbarch_alloc (&info, NULL);
/* NOTE: cagney/2002-12-06: This can be deleted when this arch is
ready to unwind the PC first (see frame.c:get_prev_frame()). */
set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default);
- /* Initialize the register numbers that are not common to all the
- variants to -1, if necessary thse will be overwritten in the case
- statement below. */
- tdep->FPUL_REGNUM = -1;
- tdep->FPSCR_REGNUM = -1;
- tdep->PR_REGNUM = 17;
- tdep->SR_REGNUM = 22;
- tdep->DSR_REGNUM = -1;
- tdep->FP_LAST_REGNUM = -1;
- tdep->A0G_REGNUM = -1;
- tdep->A0_REGNUM = -1;
- tdep->A1G_REGNUM = -1;
- tdep->A1_REGNUM = -1;
- tdep->M0_REGNUM = -1;
- tdep->M1_REGNUM = -1;
- tdep->X0_REGNUM = -1;
- tdep->X1_REGNUM = -1;
- tdep->Y0_REGNUM = -1;
- tdep->Y1_REGNUM = -1;
- tdep->MOD_REGNUM = -1;
- tdep->RS_REGNUM = -1;
- tdep->RE_REGNUM = -1;
- tdep->SSR_REGNUM = -1;
- tdep->SPC_REGNUM = -1;
- tdep->DR0_REGNUM = -1;
- tdep->DR_LAST_REGNUM = -1;
- tdep->FV0_REGNUM = -1;
- tdep->FV_LAST_REGNUM = -1;
- tdep->ARG0_REGNUM = 4;
- tdep->ARGLAST_REGNUM = 7;
- tdep->RETURN_REGNUM = 0;
- tdep->FLOAT_ARGLAST_REGNUM = -1;
-
- tdep->sh_abi = SH_ABI_UNKNOWN;
-
set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
@@ -4330,7 +2070,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
- set_gdbarch_num_regs (gdbarch, SH_DEFAULT_NUM_REGS);
+ set_gdbarch_num_regs (gdbarch, SH_NUM_REGS);
set_gdbarch_sp_regnum (gdbarch, 15);
set_gdbarch_deprecated_fp_regnum (gdbarch, 14);
set_gdbarch_pc_regnum (gdbarch, 16);
@@ -4354,8 +2094,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
- skip_prologue_hard_way = sh_skip_prologue_hard_way;
-
set_gdbarch_deprecated_frame_chain (gdbarch, sh_frame_chain);
set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh_init_extra_frame_info);
@@ -4369,12 +2107,11 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
case bfd_mach_sh:
set_gdbarch_register_name (gdbarch, sh_sh_register_name);
set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
- sh_show_regs = sh_generic_show_regs;
set_gdbarch_register_type (gdbarch, sh_default_register_type);
set_gdbarch_push_dummy_code (gdbarch, sh_push_dummy_code);
set_gdbarch_store_return_value (gdbarch, sh_default_store_return_value);
set_gdbarch_extract_return_value (gdbarch, sh_default_extract_return_value);
- set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call);
+ set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_nofpu);
set_gdbarch_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs);
@@ -4382,12 +2119,11 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
case bfd_mach_sh2:
set_gdbarch_register_name (gdbarch, sh_sh_register_name);
set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
- sh_show_regs = sh_generic_show_regs;
set_gdbarch_register_type (gdbarch, sh_default_register_type);
set_gdbarch_push_dummy_code (gdbarch, sh_push_dummy_code);
set_gdbarch_store_return_value (gdbarch, sh_default_store_return_value);
set_gdbarch_extract_return_value (gdbarch, sh_default_extract_return_value);
- set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call);
+ set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_nofpu);
set_gdbarch_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs);
@@ -4398,60 +2134,38 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_name (gdbarch, sh_sh2e_register_name);
set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
- sh_show_regs = sh2e_show_regs;
set_gdbarch_register_type (gdbarch, sh_sh3e_register_type);
set_gdbarch_push_dummy_code (gdbarch, sh_push_dummy_code);
set_gdbarch_fp0_regnum (gdbarch, 25);
set_gdbarch_store_return_value (gdbarch, sh3e_sh4_store_return_value);
set_gdbarch_extract_return_value (gdbarch, sh3e_sh4_extract_return_value);
- set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call);
+ set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu);
set_gdbarch_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
- tdep->FPUL_REGNUM = 23;
- tdep->FPSCR_REGNUM = 24;
- tdep->FP_LAST_REGNUM = 40;
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs);
break;
case bfd_mach_sh_dsp:
set_gdbarch_register_name (gdbarch, sh_sh_dsp_register_name);
set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
- sh_show_regs = sh_dsp_show_regs;
set_gdbarch_register_type (gdbarch, sh_default_register_type);
set_gdbarch_push_dummy_code (gdbarch, sh_push_dummy_code);
set_gdbarch_register_sim_regno (gdbarch, sh_dsp_register_sim_regno);
set_gdbarch_store_return_value (gdbarch, sh_default_store_return_value);
set_gdbarch_extract_return_value (gdbarch, sh_default_extract_return_value);
- set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call);
+ set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_nofpu);
set_gdbarch_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
- tdep->DSR_REGNUM = 24;
- tdep->A0G_REGNUM = 25;
- tdep->A0_REGNUM = 26;
- tdep->A1G_REGNUM = 27;
- tdep->A1_REGNUM = 28;
- tdep->M0_REGNUM = 29;
- tdep->M1_REGNUM = 30;
- tdep->X0_REGNUM = 31;
- tdep->X1_REGNUM = 32;
- tdep->Y0_REGNUM = 33;
- tdep->Y1_REGNUM = 34;
- tdep->MOD_REGNUM = 40;
- tdep->RS_REGNUM = 43;
- tdep->RE_REGNUM = 44;
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs);
break;
case bfd_mach_sh3:
set_gdbarch_register_name (gdbarch, sh_sh3_register_name);
set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
- sh_show_regs = sh3_show_regs;
set_gdbarch_register_type (gdbarch, sh_default_register_type);
set_gdbarch_push_dummy_code (gdbarch, sh_push_dummy_code);
set_gdbarch_store_return_value (gdbarch, sh_default_store_return_value);
set_gdbarch_extract_return_value (gdbarch, sh_default_extract_return_value);
- set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call);
+ set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_nofpu);
set_gdbarch_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
- tdep->SSR_REGNUM = 41;
- tdep->SPC_REGNUM = 42;
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs);
break;
@@ -4461,56 +2175,32 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_name (gdbarch, sh_sh3e_register_name);
set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
- sh_show_regs = sh3e_show_regs;
set_gdbarch_register_type (gdbarch, sh_sh3e_register_type);
set_gdbarch_push_dummy_code (gdbarch, sh_push_dummy_code);
set_gdbarch_fp0_regnum (gdbarch, 25);
set_gdbarch_store_return_value (gdbarch, sh3e_sh4_store_return_value);
set_gdbarch_extract_return_value (gdbarch, sh3e_sh4_extract_return_value);
- set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call);
+ set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu);
set_gdbarch_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
- tdep->FPUL_REGNUM = 23;
- tdep->FPSCR_REGNUM = 24;
- tdep->FP_LAST_REGNUM = 40;
- tdep->SSR_REGNUM = 41;
- tdep->SPC_REGNUM = 42;
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_fp_frame_init_saved_regs);
break;
case bfd_mach_sh3_dsp:
set_gdbarch_register_name (gdbarch, sh_sh3_dsp_register_name);
set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
- sh_show_regs = sh3_dsp_show_regs;
set_gdbarch_register_type (gdbarch, sh_default_register_type);
set_gdbarch_push_dummy_code (gdbarch, sh_push_dummy_code);
set_gdbarch_register_sim_regno (gdbarch, sh_dsp_register_sim_regno);
set_gdbarch_store_return_value (gdbarch, sh_default_store_return_value);
set_gdbarch_extract_return_value (gdbarch, sh_default_extract_return_value);
- set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call);
+ set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_nofpu);
set_gdbarch_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
- tdep->DSR_REGNUM = 24;
- tdep->A0G_REGNUM = 25;
- tdep->A0_REGNUM = 26;
- tdep->A1G_REGNUM = 27;
- tdep->A1_REGNUM = 28;
- tdep->M0_REGNUM = 29;
- tdep->M1_REGNUM = 30;
- tdep->X0_REGNUM = 31;
- tdep->X1_REGNUM = 32;
- tdep->Y0_REGNUM = 33;
- tdep->Y1_REGNUM = 34;
- tdep->MOD_REGNUM = 40;
- tdep->RS_REGNUM = 43;
- tdep->RE_REGNUM = 44;
- tdep->SSR_REGNUM = 41;
- tdep->SPC_REGNUM = 42;
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_nofp_frame_init_saved_regs);
break;
case bfd_mach_sh4:
set_gdbarch_register_name (gdbarch, sh_sh4_register_name);
set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
- sh_show_regs = sh4_show_regs;
set_gdbarch_register_type (gdbarch, sh_sh4_register_type);
set_gdbarch_push_dummy_code (gdbarch, sh_push_dummy_code);
set_gdbarch_fp0_regnum (gdbarch, 25);
@@ -4519,126 +2209,14 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pseudo_register_write (gdbarch, sh_pseudo_register_write);
set_gdbarch_store_return_value (gdbarch, sh3e_sh4_store_return_value);
set_gdbarch_extract_return_value (gdbarch, sh3e_sh4_extract_return_value);
- set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call);
+ set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_fpu);
set_gdbarch_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
- tdep->FPUL_REGNUM = 23;
- tdep->FPSCR_REGNUM = 24;
- tdep->FP_LAST_REGNUM = 40;
- tdep->SSR_REGNUM = 41;
- tdep->SPC_REGNUM = 42;
- tdep->DR0_REGNUM = 59;
- tdep->DR_LAST_REGNUM = 66;
- tdep->FV0_REGNUM = 67;
- tdep->FV_LAST_REGNUM = 70;
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh_fp_frame_init_saved_regs);
break;
- case bfd_mach_sh5:
- tdep->PR_REGNUM = 18;
- tdep->SR_REGNUM = 65;
- tdep->FPSCR_REGNUM = SIM_SH64_FPCSR_REGNUM;
- tdep->FP_LAST_REGNUM = SIM_SH64_FR0_REGNUM + SIM_SH64_NR_FP_REGS - 1;
- tdep->SSR_REGNUM = SIM_SH64_SSR_REGNUM;
- tdep->SPC_REGNUM = SIM_SH64_SPC_REGNUM;
- tdep->TR7_REGNUM = SIM_SH64_TR0_REGNUM + 7;
- tdep->FPP0_REGNUM = 173;
- tdep->FPP_LAST_REGNUM = 204;
- tdep->DR0_REGNUM = 141;
- tdep->DR_LAST_REGNUM = 172;
- tdep->FV0_REGNUM = 205;
- tdep->FV_LAST_REGNUM = 220;
- tdep->R0_C_REGNUM = 221;
- tdep->R_LAST_C_REGNUM = 236;
- tdep->PC_C_REGNUM = 237;
- tdep->GBR_C_REGNUM = 238;
- tdep->MACH_C_REGNUM = 239;
- tdep->MACL_C_REGNUM = 240;
- tdep->PR_C_REGNUM = 241;
- tdep->T_C_REGNUM = 242;
- tdep->FPSCR_C_REGNUM = 243;
- tdep->FPUL_C_REGNUM = 244;
- tdep->FP0_C_REGNUM = 245;
- tdep->FP_LAST_C_REGNUM = 260;
- tdep->DR0_C_REGNUM = 261;
- tdep->DR_LAST_C_REGNUM = 268;
- tdep->FV0_C_REGNUM = 269;
- tdep->FV_LAST_C_REGNUM = 272;
- tdep->ARG0_REGNUM = 2;
- tdep->ARGLAST_REGNUM = 9;
- tdep->RETURN_REGNUM = 2;
- tdep->FLOAT_ARGLAST_REGNUM = 11;
-
- set_gdbarch_num_pseudo_regs (gdbarch, NUM_PSEUDO_REGS_SH_MEDIA + NUM_PSEUDO_REGS_SH_COMPACT);
- set_gdbarch_fp0_regnum (gdbarch, SIM_SH64_FR0_REGNUM);
- set_gdbarch_pc_regnum (gdbarch, 64);
-
- /* Determine the ABI */
- if (bfd_get_arch_size (info.abfd) == 64)
- {
- /* If the ABI is the 64-bit one, it can only be sh-media. */
- tdep->sh_abi = SH_ABI_64;
- set_gdbarch_ptr_bit (gdbarch, 8 * TARGET_CHAR_BIT);
- set_gdbarch_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
- }
- else
- {
- /* If the ABI is the 32-bit one it could be either media or
- compact. */
- tdep->sh_abi = SH_ABI_32;
- set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
- set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
- }
-
- /* the number of real registers is the same whether we are in
- ISA16(compact) or ISA32(media). */
- set_gdbarch_num_regs (gdbarch, SIM_SH64_NR_REGS);
- set_gdbarch_deprecated_register_size (gdbarch, 8); /*????*/
- set_gdbarch_deprecated_register_bytes (gdbarch,
- ((SIM_SH64_NR_FP_REGS + 1) * 4)
- + (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8);
-
- set_gdbarch_register_name (gdbarch, sh_sh64_register_name);
- sh_show_regs = sh64_show_regs;
- set_gdbarch_deprecated_register_virtual_type (gdbarch, sh_sh64_register_virtual_type);
- set_gdbarch_deprecated_store_return_value (gdbarch, sh64_store_return_value);
- skip_prologue_hard_way = sh64_skip_prologue_hard_way;
- set_gdbarch_deprecated_register_raw_size (gdbarch, sh_sh64_register_raw_size);
- set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_sh64_register_raw_size);
- set_gdbarch_deprecated_register_byte (gdbarch, sh_sh64_register_byte);
- /* This seems awfully wrong!*/
- /*set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);*/
- /* should include the size of the pseudo regs. */
- set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4 * 4);
- /* Or should that go in the virtual_size? */
- /*set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);*/
- set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4 * 4);
- set_gdbarch_pseudo_register_read (gdbarch, sh64_pseudo_register_read);
- set_gdbarch_pseudo_register_write (gdbarch, sh64_pseudo_register_write);
-
- set_gdbarch_deprecated_do_registers_info (gdbarch, sh64_do_registers_info);
- set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh64_nofp_frame_init_saved_regs);
- set_gdbarch_breakpoint_from_pc (gdbarch, sh_sh64_breakpoint_from_pc);
- set_gdbarch_deprecated_call_dummy_words (gdbarch, sh64_call_dummy_words);
- set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (sh64_call_dummy_words));
-
- set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh64_init_extra_frame_info);
- set_gdbarch_deprecated_frame_chain (gdbarch, sh64_frame_chain);
- set_gdbarch_deprecated_get_saved_register (gdbarch, sh64_get_saved_register);
- set_gdbarch_deprecated_extract_return_value (gdbarch, sh64_extract_return_value);
- set_gdbarch_deprecated_push_arguments (gdbarch, sh64_push_arguments);
- set_gdbarch_deprecated_push_return_address (gdbarch, sh64_push_return_address);
- set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
- set_gdbarch_deprecated_store_struct_return (gdbarch, sh64_store_struct_return);
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh64_extract_struct_value_address);
- set_gdbarch_use_struct_convention (gdbarch, sh64_use_struct_convention);
- set_gdbarch_deprecated_pop_frame (gdbarch, sh64_pop_frame);
- set_gdbarch_elf_make_msymbol_special (gdbarch,
- sh64_elf_make_msymbol_special);
- break;
default:
set_gdbarch_register_name (gdbarch, sh_generic_register_name);
set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
- sh_show_regs = sh_generic_show_regs;
set_gdbarch_register_type (gdbarch, sh_default_register_type);
set_gdbarch_push_dummy_code (gdbarch, sh_push_dummy_code);
set_gdbarch_store_return_value (gdbarch, sh_default_store_return_value);
@@ -4654,17 +2232,6 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return gdbarch;
}
-static void
-sh_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
-{
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (tdep == NULL)
- return;
-
- /* FIXME: dump the rest of gdbarch_tdep. */
-}
-
extern initialize_file_ftype _initialize_sh_tdep; /* -Wmissing-prototypes */
void
@@ -4672,7 +2239,7 @@ _initialize_sh_tdep (void)
{
struct cmd_list_element *c;
- gdbarch_register (bfd_arch_sh, sh_gdbarch_init, sh_dump_tdep);
+ gdbarch_register (bfd_arch_sh, sh_gdbarch_init, NULL);
add_com ("regs", class_vars, sh_show_regs_command, "Print all registers");
}
diff --git a/gdb/sh-tdep.h b/gdb/sh-tdep.h
index 1b9c8fe4b69..e609b52848a 100644
--- a/gdb/sh-tdep.h
+++ b/gdb/sh-tdep.h
@@ -24,85 +24,54 @@
/* Contributed by Steve Chamberlain sac@cygnus.com */
-/* Information that is dependent on the processor variant. */
-
-enum sh_abi
- {
- SH_ABI_UNKNOWN,
- SH_ABI_32,
- SH_ABI_64
- };
-
-struct gdbarch_tdep
- {
- int PR_REGNUM;
- int FPUL_REGNUM; /* sh3e, sh4 */
- int FPSCR_REGNUM; /* sh3e, sh4 */
- int SR_REGNUM; /* sh-dsp, sh3, sh3-dsp, sh3e, sh4 */
- int DSR_REGNUM; /* sh-dsp, sh3-dsp */
- int FP_LAST_REGNUM; /* sh3e, sh4 */
- int A0G_REGNUM; /* sh-dsp, sh3-dsp */
- int A0_REGNUM; /* sh-dsp, sh3-dsp */
- int A1G_REGNUM; /* sh-dsp, sh3-dsp */
- int A1_REGNUM; /* sh-dsp, sh3-dsp */
- int M0_REGNUM; /* sh-dsp, sh3-dsp */
- int M1_REGNUM; /* sh-dsp, sh3-dsp */
- int X0_REGNUM; /* sh-dsp, sh3-dsp */
- int X1_REGNUM; /* sh-dsp, sh3-dsp */
- int Y0_REGNUM; /* sh-dsp, sh3-dsp */
- int Y1_REGNUM; /* sh-dsp, sh3-dsp */
- int MOD_REGNUM; /* sh-dsp, sh3-dsp */
- int SSR_REGNUM; /* sh3, sh3-dsp, sh3e, sh4 */
- int SPC_REGNUM; /* sh3, sh3-dsp, sh3e, sh4 */
- int RS_REGNUM; /* sh-dsp, sh3-dsp */
- int RE_REGNUM; /* sh-dsp, sh3-dsp */
- int DR0_REGNUM; /* sh4 */
- int DR_LAST_REGNUM; /* sh4 */
- int FV0_REGNUM; /* sh4 */
- int FV_LAST_REGNUM; /* sh4 */
- /* FPP stands for Floating Point Pair, to avoid confusion with
- GDB's FP0_REGNUM, which is the number of the first Floating
- point register. Unfortunately on the sh5, the floating point
- registers are called FR, and the floating point pairs are called FP. */
- int TR7_REGNUM; /* sh5-media*/
- int FPP0_REGNUM; /* sh5-media*/
- int FPP_LAST_REGNUM; /* sh5-media*/
- int R0_C_REGNUM; /* sh5-compact*/
- int R_LAST_C_REGNUM; /* sh5-compact*/
- int PC_C_REGNUM; /* sh5-compact*/
- int GBR_C_REGNUM; /* sh5-compact*/
- int MACH_C_REGNUM; /* sh5-compact*/
- int MACL_C_REGNUM; /* sh5-compact*/
- int PR_C_REGNUM; /* sh5-compact*/
- int T_C_REGNUM; /* sh5-compact*/
- int FPSCR_C_REGNUM; /* sh5-compact*/
- int FPUL_C_REGNUM; /* sh5-compact*/
- int FP0_C_REGNUM; /* sh5-compact*/
- int FP_LAST_C_REGNUM; /* sh5-compact*/
- int DR0_C_REGNUM; /* sh5-compact*/
- int DR_LAST_C_REGNUM; /* sh5-compact*/
- int FV0_C_REGNUM; /* sh5-compact*/
- int FV_LAST_C_REGNUM; /* sh5-compact*/
- int ARG0_REGNUM;
- int ARGLAST_REGNUM;
- int FLOAT_ARGLAST_REGNUM;
- int RETURN_REGNUM;
- enum sh_abi sh_abi;
- };
-
-/* Registers common to all the SH variants. */
+/* Registers for all SH variants. Used also by sh3-rom.c. */
enum
{
R0_REGNUM = 0,
STRUCT_RETURN_REGNUM = 2,
- ARG0_REGNUM = 4, /* Used in h8300-tdep.c */
- ARGLAST_REGNUM = 7, /* Used in h8300-tdep.c */
- PR_REGNUM = 17, /* used in sh3-rom.c */
+ ARG0_REGNUM = 4,
+ ARGLAST_REGNUM = 7,
+ FP_REGNUM = 14,
+ PR_REGNUM = 17,
GBR_REGNUM = 18,
VBR_REGNUM = 19,
MACH_REGNUM = 20,
MACL_REGNUM = 21,
- SR_REGNUM = 22
+ SR_REGNUM = 22,
+ FPUL_REGNUM = 23,
+ /* Floating point registers */
+ FPSCR_REGNUM = 24,
+ FLOAT_ARG0_REGNUM = 29,
+ FLOAT_ARGLAST_REGNUM = 36,
+ FP_LAST_REGNUM = 40,
+ /* sh3,sh4 registers */
+ SSR_REGNUM = 41,
+ SPC_REGNUM = 42,
+ /* DSP registers */
+ DSR_REGNUM = 24,
+ A0G_REGNUM = 25,
+ A0_REGNUM = 26,
+ A1G_REGNUM = 27,
+ A1_REGNUM = 28,
+ M0_REGNUM = 29,
+ M1_REGNUM = 30,
+ X0_REGNUM = 31,
+ X1_REGNUM = 32,
+ Y0_REGNUM = 33,
+ Y1_REGNUM = 34,
+ MOD_REGNUM = 40,
+ RS_REGNUM = 43,
+ RE_REGNUM = 44,
+ R0_BANK_REGNUM = 51,
+ R7_BANK_REGNUM = 58,
+ /* Floating point pseudo registers */
+ DR0_REGNUM = 59,
+ DR_LAST_REGNUM = 66,
+ FV0_REGNUM = 67,
+ FV_LAST_REGNUM = 70
};
+extern gdbarch_init_ftype sh64_gdbarch_init;
+extern void sh64_show_regs (void);
+
#endif /* SH_TDEP_H */
diff --git a/gdb/sh3-rom.c b/gdb/sh3-rom.c
index b946e6fd71c..a2e21c198c8 100644
--- a/gdb/sh3-rom.c
+++ b/gdb/sh3-rom.c
@@ -77,9 +77,9 @@ sh3_supply_register (char *regname, int regnamelen, char *val, int vallen)
break;
case 'S':
if (regname[1] == 'S' && regname[2] == 'R')
- regno = gdbarch_tdep (current_gdbarch)->SSR_REGNUM;
+ regno = SSR_REGNUM;
else if (regname[1] == 'P' && regname[2] == 'C')
- regno = gdbarch_tdep (current_gdbarch)->SPC_REGNUM;
+ regno = SPC_REGNUM;
break;
}
}
@@ -281,8 +281,15 @@ sh3_open (char *args, int from_tty)
parallel_in_use = 1;
}
+
/* If we connected successfully, we know the processor is an SH3. */
- set_architecture_from_arch_mach (bfd_arch_sh, bfd_mach_sh3);
+ {
+ struct gdbarch_info info;
+ gdbarch_info_init (&info);
+ info.bfd_arch_info = bfd_lookup_arch (bfd_arch_sh, bfd_mach_sh3);
+ if (!gdbarch_update_p (info))
+ error ("Target is not an SH3");
+ }
}
@@ -329,7 +336,13 @@ sh3e_open (char *args, int from_tty)
}
/* If we connected successfully, we know the processor is an SH3E. */
- set_architecture_from_arch_mach (bfd_arch_sh, bfd_mach_sh3);
+ {
+ struct gdbarch_info info;
+ gdbarch_info_init (&info);
+ info.bfd_arch_info = bfd_lookup_arch (bfd_arch_sh, bfd_mach_sh3);
+ if (!gdbarch_update_p (info))
+ error ("Target is not an SH3");
+ }
}
static void
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
new file mode 100644
index 00000000000..99372b8b032
--- /dev/null
+++ b/gdb/sh64-tdep.c
@@ -0,0 +1,2950 @@
+/* Target-dependent code for Hitachi Super-H, for GDB.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/*
+ Contributed by Steve Chamberlain
+ sac@cygnus.com
+ */
+
+#include "defs.h"
+#include "frame.h"
+#include "symtab.h"
+#include "symfile.h"
+#include "gdbtypes.h"
+#include "gdbcmd.h"
+#include "gdbcore.h"
+#include "value.h"
+#include "dis-asm.h"
+#include "inferior.h"
+#include "gdb_string.h"
+#include "arch-utils.h"
+#include "floatformat.h"
+#include "regcache.h"
+#include "doublest.h"
+#include "osabi.h"
+
+#include "elf-bfd.h"
+#include "solib-svr4.h"
+
+/* sh flags */
+#include "elf/sh.h"
+/* registers numbers shared with the simulator */
+#include "gdb/sim-sh.h"
+
+/* Information that is dependent on the processor variant. */
+enum sh_abi
+ {
+ SH_ABI_UNKNOWN,
+ SH_ABI_32,
+ SH_ABI_64
+ };
+
+struct gdbarch_tdep
+ {
+ enum sh_abi sh_abi;
+ };
+
+/* Registers of SH5 */
+enum
+ {
+ R0_REGNUM = 0,
+ DEFAULT_RETURN_REGNUM = 2,
+ STRUCT_RETURN_REGNUM = 2,
+ ARG0_REGNUM = 2,
+ ARGLAST_REGNUM = 9,
+ FLOAT_ARGLAST_REGNUM = 11,
+ PR_REGNUM = 18,
+ SR_REGNUM = 65,
+ DR0_REGNUM = 141,
+ DR_LAST_REGNUM = 172,
+ /* FPP stands for Floating Point Pair, to avoid confusion with
+ GDB's FP0_REGNUM, which is the number of the first Floating
+ point register. Unfortunately on the sh5, the floating point
+ registers are called FR, and the floating point pairs are called FP. */
+ FPP0_REGNUM = 173,
+ FPP_LAST_REGNUM = 204,
+ FV0_REGNUM = 205,
+ FV_LAST_REGNUM = 220,
+ R0_C_REGNUM = 221,
+ R_LAST_C_REGNUM = 236,
+ PC_C_REGNUM = 237,
+ GBR_C_REGNUM = 238,
+ MACH_C_REGNUM = 239,
+ MACL_C_REGNUM = 240,
+ PR_C_REGNUM = 241,
+ T_C_REGNUM = 242,
+ FPSCR_C_REGNUM = 243,
+ FPUL_C_REGNUM = 244,
+ FP0_C_REGNUM = 245,
+ FP_LAST_C_REGNUM = 260,
+ DR0_C_REGNUM = 261,
+ DR_LAST_C_REGNUM = 268,
+ FV0_C_REGNUM = 269,
+ FV_LAST_C_REGNUM = 272,
+ FPSCR_REGNUM = SIM_SH64_FPCSR_REGNUM,
+ SSR_REGNUM = SIM_SH64_SSR_REGNUM,
+ SPC_REGNUM = SIM_SH64_SPC_REGNUM,
+ TR7_REGNUM = SIM_SH64_TR0_REGNUM + 7,
+ FP_LAST_REGNUM = SIM_SH64_FR0_REGNUM + SIM_SH64_NR_FP_REGS - 1
+ };
+
+
+/* Define other aspects of the stack frame.
+ we keep a copy of the worked out return pc lying around, since it
+ is a useful bit of info */
+
+struct frame_extra_info
+{
+ CORE_ADDR return_pc;
+ int leaf_function;
+ int f_offset;
+};
+
+static const char *
+sh_sh64_register_name (int reg_nr)
+{
+ static char *register_names[] =
+ {
+ /* SH MEDIA MODE (ISA 32) */
+ /* general registers (64-bit) 0-63 */
+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
+ "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
+ "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
+ "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39",
+ "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47",
+ "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55",
+ "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63",
+
+ /* pc (64-bit) 64 */
+ "pc",
+
+ /* status reg., saved status reg., saved pc reg. (64-bit) 65-67 */
+ "sr", "ssr", "spc",
+
+ /* target registers (64-bit) 68-75*/
+ "tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7",
+
+ /* floating point state control register (32-bit) 76 */
+ "fpscr",
+
+ /* single precision floating point registers (32-bit) 77-140*/
+ "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7",
+ "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
+ "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23",
+ "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31",
+ "fr32", "fr33", "fr34", "fr35", "fr36", "fr37", "fr38", "fr39",
+ "fr40", "fr41", "fr42", "fr43", "fr44", "fr45", "fr46", "fr47",
+ "fr48", "fr49", "fr50", "fr51", "fr52", "fr53", "fr54", "fr55",
+ "fr56", "fr57", "fr58", "fr59", "fr60", "fr61", "fr62", "fr63",
+
+ /* double precision registers (pseudo) 141-172 */
+ "dr0", "dr2", "dr4", "dr6", "dr8", "dr10", "dr12", "dr14",
+ "dr16", "dr18", "dr20", "dr22", "dr24", "dr26", "dr28", "dr30",
+ "dr32", "dr34", "dr36", "dr38", "dr40", "dr42", "dr44", "dr46",
+ "dr48", "dr50", "dr52", "dr54", "dr56", "dr58", "dr60", "dr62",
+
+ /* floating point pairs (pseudo) 173-204*/
+ "fp0", "fp2", "fp4", "fp6", "fp8", "fp10", "fp12", "fp14",
+ "fp16", "fp18", "fp20", "fp22", "fp24", "fp26", "fp28", "fp30",
+ "fp32", "fp34", "fp36", "fp38", "fp40", "fp42", "fp44", "fp46",
+ "fp48", "fp50", "fp52", "fp54", "fp56", "fp58", "fp60", "fp62",
+
+ /* floating point vectors (4 floating point regs) (pseudo) 205-220*/
+ "fv0", "fv4", "fv8", "fv12", "fv16", "fv20", "fv24", "fv28",
+ "fv32", "fv36", "fv40", "fv44", "fv48", "fv52", "fv56", "fv60",
+
+ /* SH COMPACT MODE (ISA 16) (all pseudo) 221-272*/
+ "r0_c", "r1_c", "r2_c", "r3_c", "r4_c", "r5_c", "r6_c", "r7_c",
+ "r8_c", "r9_c", "r10_c", "r11_c", "r12_c", "r13_c", "r14_c", "r15_c",
+ "pc_c",
+ "gbr_c", "mach_c", "macl_c", "pr_c", "t_c",
+ "fpscr_c", "fpul_c",
+ "fr0_c", "fr1_c", "fr2_c", "fr3_c", "fr4_c", "fr5_c", "fr6_c", "fr7_c",
+ "fr8_c", "fr9_c", "fr10_c", "fr11_c", "fr12_c", "fr13_c", "fr14_c", "fr15_c",
+ "dr0_c", "dr2_c", "dr4_c", "dr6_c", "dr8_c", "dr10_c", "dr12_c", "dr14_c",
+ "fv0_c", "fv4_c", "fv8_c", "fv12_c",
+ /* FIXME!!!! XF0 XF15, XD0 XD14 ?????*/
+ };
+
+ if (reg_nr < 0)
+ return NULL;
+ if (reg_nr >= (sizeof (register_names) / sizeof (*register_names)))
+ return NULL;
+ return register_names[reg_nr];
+}
+
+#define NUM_PSEUDO_REGS_SH_MEDIA 80
+#define NUM_PSEUDO_REGS_SH_COMPACT 51
+
+/* Macros and functions for setting and testing a bit in a minimal
+ symbol that marks it as 32-bit function. The MSB of the minimal
+ symbol's "info" field is used for this purpose. This field is
+ already being used to store the symbol size, so the assumption is
+ that the symbol size cannot exceed 2^31.
+
+ ELF_MAKE_MSYMBOL_SPECIAL
+ tests whether an ELF symbol is "special", i.e. refers
+ to a 32-bit function, and sets a "special" bit in a
+ minimal symbol to mark it as a 32-bit function
+ MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol
+ MSYMBOL_SIZE returns the size of the minimal symbol, i.e.
+ the "info" field with the "special" bit masked out */
+
+#define MSYMBOL_IS_SPECIAL(msym) \
+ (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
+
+static void
+sh64_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
+{
+ if (msym == NULL)
+ return;
+
+ if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_SH5_ISA32)
+ {
+ MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) | 0x80000000);
+ SYMBOL_VALUE_ADDRESS (msym) |= 1;
+ }
+}
+
+/* ISA32 (shmedia) function addresses are odd (bit 0 is set). Here
+ are some macros to test, set, or clear bit 0 of addresses. */
+#define IS_ISA32_ADDR(addr) ((addr) & 1)
+#define MAKE_ISA32_ADDR(addr) ((addr) | 1)
+#define UNMAKE_ISA32_ADDR(addr) ((addr) & ~1)
+
+static int
+pc_is_isa32 (bfd_vma memaddr)
+{
+ struct minimal_symbol *sym;
+
+ /* If bit 0 of the address is set, assume this is a
+ ISA32 (shmedia) address. */
+ if (IS_ISA32_ADDR (memaddr))
+ return 1;
+
+ /* A flag indicating that this is a ISA32 function is stored by elfread.c in
+ the high bit of the info field. Use this to decide if the function is
+ ISA16 or ISA32. */
+ sym = lookup_minimal_symbol_by_pc (memaddr);
+ if (sym)
+ return MSYMBOL_IS_SPECIAL (sym);
+ else
+ return 0;
+}
+
+static const unsigned char *
+sh_sh64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+{
+ /* The BRK instruction for shmedia is
+ 01101111 11110101 11111111 11110000
+ which translates in big endian mode to 0x6f, 0xf5, 0xff, 0xf0
+ and in little endian mode to 0xf0, 0xff, 0xf5, 0x6f */
+
+ /* The BRK instruction for shcompact is
+ 00000000 00111011
+ which translates in big endian mode to 0x0, 0x3b
+ and in little endian mode to 0x3b, 0x0*/
+
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ {
+ if (pc_is_isa32 (*pcptr))
+ {
+ static unsigned char big_breakpoint_media[] = {0x6f, 0xf5, 0xff, 0xf0};
+ *pcptr = UNMAKE_ISA32_ADDR (*pcptr);
+ *lenptr = sizeof (big_breakpoint_media);
+ return big_breakpoint_media;
+ }
+ else
+ {
+ static unsigned char big_breakpoint_compact[] = {0x0, 0x3b};
+ *lenptr = sizeof (big_breakpoint_compact);
+ return big_breakpoint_compact;
+ }
+ }
+ else
+ {
+ if (pc_is_isa32 (*pcptr))
+ {
+ static unsigned char little_breakpoint_media[] = {0xf0, 0xff, 0xf5, 0x6f};
+ *pcptr = UNMAKE_ISA32_ADDR (*pcptr);
+ *lenptr = sizeof (little_breakpoint_media);
+ return little_breakpoint_media;
+ }
+ else
+ {
+ static unsigned char little_breakpoint_compact[] = {0x3b, 0x0};
+ *lenptr = sizeof (little_breakpoint_compact);
+ return little_breakpoint_compact;
+ }
+ }
+}
+
+/* Prologue looks like
+ [mov.l <regs>,@-r15]...
+ [sts.l pr,@-r15]
+ [mov.l r14,@-r15]
+ [mov r15,r14]
+
+ Actually it can be more complicated than this. For instance, with
+ newer gcc's:
+
+ mov.l r14,@-r15
+ add #-12,r15
+ mov r15,r14
+ mov r4,r1
+ mov r5,r2
+ mov.l r6,@(4,r14)
+ mov.l r7,@(8,r14)
+ mov.b r1,@r14
+ mov r14,r1
+ mov r14,r1
+ add #2,r1
+ mov.w r2,@r1
+
+ */
+
+/* PTABS/L Rn, TRa 0110101111110001nnnnnnl00aaa0000
+ with l=1 and n = 18 0110101111110001010010100aaa0000 */
+#define IS_PTABSL_R18(x) (((x) & 0xffffff8f) == 0x6bf14a00)
+
+/* STS.L PR,@-r0 0100000000100010
+ r0-4-->r0, PR-->(r0) */
+#define IS_STS_R0(x) ((x) == 0x4022)
+
+/* STS PR, Rm 0000mmmm00101010
+ PR-->Rm */
+#define IS_STS_PR(x) (((x) & 0xf0ff) == 0x2a)
+
+/* MOV.L Rm,@(disp,r15) 00011111mmmmdddd
+ Rm-->(dispx4+r15) */
+#define IS_MOV_TO_R15(x) (((x) & 0xff00) == 0x1f00)
+
+/* MOV.L R14,@(disp,r15) 000111111110dddd
+ R14-->(dispx4+r15) */
+#define IS_MOV_R14(x) (((x) & 0xfff0) == 0x1fe0)
+
+/* ST.Q R14, disp, R18 101011001110dddddddddd0100100000
+ R18-->(dispx8+R14) */
+#define IS_STQ_R18_R14(x) (((x) & 0xfff003ff) == 0xace00120)
+
+/* ST.Q R15, disp, R18 101011001111dddddddddd0100100000
+ R18-->(dispx8+R15) */
+#define IS_STQ_R18_R15(x) (((x) & 0xfff003ff) == 0xacf00120)
+
+/* ST.L R15, disp, R18 101010001111dddddddddd0100100000
+ R18-->(dispx4+R15) */
+#define IS_STL_R18_R15(x) (((x) & 0xfff003ff) == 0xa8f00120)
+
+/* ST.Q R15, disp, R14 1010 1100 1111 dddd dddd dd00 1110 0000
+ R14-->(dispx8+R15) */
+#define IS_STQ_R14_R15(x) (((x) & 0xfff003ff) == 0xacf000e0)
+
+/* ST.L R15, disp, R14 1010 1000 1111 dddd dddd dd00 1110 0000
+ R14-->(dispx4+R15) */
+#define IS_STL_R14_R15(x) (((x) & 0xfff003ff) == 0xa8f000e0)
+
+/* ADDI.L R15,imm,R15 1101 0100 1111 ssss ssss ss00 1111 0000
+ R15 + imm --> R15 */
+#define IS_ADDIL_SP_MEDIA(x) (((x) & 0xfff003ff) == 0xd4f000f0)
+
+/* ADDI R15,imm,R15 1101 0000 1111 ssss ssss ss00 1111 0000
+ R15 + imm --> R15 */
+#define IS_ADDI_SP_MEDIA(x) (((x) & 0xfff003ff) == 0xd0f000f0)
+
+/* ADD.L R15,R63,R14 0000 0000 1111 1000 1111 1100 1110 0000
+ R15 + R63 --> R14 */
+#define IS_ADDL_SP_FP_MEDIA(x) ((x) == 0x00f8fce0)
+
+/* ADD R15,R63,R14 0000 0000 1111 1001 1111 1100 1110 0000
+ R15 + R63 --> R14 */
+#define IS_ADD_SP_FP_MEDIA(x) ((x) == 0x00f9fce0)
+
+#define IS_MOV_SP_FP_MEDIA(x) (IS_ADDL_SP_FP_MEDIA(x) || IS_ADD_SP_FP_MEDIA(x))
+
+/* MOV #imm, R0 1110 0000 ssss ssss
+ #imm-->R0 */
+#define IS_MOV_R0(x) (((x) & 0xff00) == 0xe000)
+
+/* MOV.L @(disp,PC), R0 1101 0000 iiii iiii */
+#define IS_MOVL_R0(x) (((x) & 0xff00) == 0xd000)
+
+/* ADD r15,r0 0011 0000 1111 1100
+ r15+r0-->r0 */
+#define IS_ADD_SP_R0(x) ((x) == 0x30fc)
+
+/* MOV.L R14 @-R0 0010 0000 1110 0110
+ R14-->(R0-4), R0-4-->R0 */
+#define IS_MOV_R14_R0(x) ((x) == 0x20e6)
+
+/* ADD Rm,R63,Rn Rm+R63-->Rn 0000 00mm mmmm 1001 1111 11nn nnnn 0000
+ where Rm is one of r2-r9 which are the argument registers. */
+/* FIXME: Recognize the float and double register moves too! */
+#define IS_MEDIA_IND_ARG_MOV(x) \
+((((x) & 0xfc0ffc0f) == 0x0009fc00) && (((x) & 0x03f00000) >= 0x00200000 && ((x) & 0x03f00000) <= 0x00900000))
+
+/* ST.Q Rn,0,Rm Rm-->Rn+0 1010 11nn nnnn 0000 0000 00mm mmmm 0000
+ or ST.L Rn,0,Rm Rm-->Rn+0 1010 10nn nnnn 0000 0000 00mm mmmm 0000
+ where Rm is one of r2-r9 which are the argument registers. */
+#define IS_MEDIA_ARG_MOV(x) \
+(((((x) & 0xfc0ffc0f) == 0xac000000) || (((x) & 0xfc0ffc0f) == 0xa8000000)) \
+ && (((x) & 0x000003f0) >= 0x00000020 && ((x) & 0x000003f0) <= 0x00000090))
+
+/* ST.B R14,0,Rn Rn-->(R14+0) 1010 0000 1110 0000 0000 00nn nnnn 0000*/
+/* ST.W R14,0,Rn Rn-->(R14+0) 1010 0100 1110 0000 0000 00nn nnnn 0000*/
+/* ST.L R14,0,Rn Rn-->(R14+0) 1010 1000 1110 0000 0000 00nn nnnn 0000*/
+/* FST.S R14,0,FRn Rn-->(R14+0) 1011 0100 1110 0000 0000 00nn nnnn 0000*/
+/* FST.D R14,0,DRn Rn-->(R14+0) 1011 1100 1110 0000 0000 00nn nnnn 0000*/
+#define IS_MEDIA_MOV_TO_R14(x) \
+((((x) & 0xfffffc0f) == 0xa0e00000) \
+|| (((x) & 0xfffffc0f) == 0xa4e00000) \
+|| (((x) & 0xfffffc0f) == 0xa8e00000) \
+|| (((x) & 0xfffffc0f) == 0xb4e00000) \
+|| (((x) & 0xfffffc0f) == 0xbce00000))
+
+/* MOV Rm, Rn Rm-->Rn 0110 nnnn mmmm 0011
+ where Rm is r2-r9 */
+#define IS_COMPACT_IND_ARG_MOV(x) \
+((((x) & 0xf00f) == 0x6003) && (((x) & 0x00f0) >= 0x0020) && (((x) & 0x00f0) <= 0x0090))
+
+/* compact direct arg move!
+ MOV.L Rn, @r14 0010 1110 mmmm 0010 */
+#define IS_COMPACT_ARG_MOV(x) \
+(((((x) & 0xff0f) == 0x2e02) && (((x) & 0x00f0) >= 0x0020) && ((x) & 0x00f0) <= 0x0090))
+
+/* MOV.B Rm, @R14 0010 1110 mmmm 0000
+ MOV.W Rm, @R14 0010 1110 mmmm 0001 */
+#define IS_COMPACT_MOV_TO_R14(x) \
+((((x) & 0xff0f) == 0x2e00) || (((x) & 0xff0f) == 0x2e01))
+
+#define IS_JSR_R0(x) ((x) == 0x400b)
+#define IS_NOP(x) ((x) == 0x0009)
+
+
+/* MOV r15,r14 0110111011110011
+ r15-->r14 */
+#define IS_MOV_SP_FP(x) ((x) == 0x6ef3)
+
+/* ADD #imm,r15 01111111iiiiiiii
+ r15+imm-->r15 */
+#define IS_ADD_SP(x) (((x) & 0xff00) == 0x7f00)
+
+/* Skip any prologue before the guts of a function */
+
+/* Skip the prologue using the debug information. If this fails we'll
+ fall back on the 'guess' method below. */
+static CORE_ADDR
+after_prologue (CORE_ADDR pc)
+{
+ struct symtab_and_line sal;
+ CORE_ADDR func_addr, func_end;
+
+ /* If we can not find the symbol in the partial symbol table, then
+ there is no hope we can determine the function's start address
+ with this code. */
+ if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end))
+ return 0;
+
+ /* Get the line associated with FUNC_ADDR. */
+ sal = find_pc_line (func_addr, 0);
+
+ /* There are only two cases to consider. First, the end of the source line
+ is within the function bounds. In that case we return the end of the
+ source line. Second is the end of the source line extends beyond the
+ bounds of the current function. We need to use the slow code to
+ examine instructions in that case. */
+ if (sal.end < func_end)
+ return sal.end;
+ else
+ return 0;
+}
+
+static CORE_ADDR
+look_for_args_moves (CORE_ADDR start_pc, int media_mode)
+{
+ CORE_ADDR here, end;
+ int w;
+ int insn_size = (media_mode ? 4 : 2);
+
+ for (here = start_pc, end = start_pc + (insn_size * 28); here < end;)
+ {
+ if (media_mode)
+ {
+ w = read_memory_integer (UNMAKE_ISA32_ADDR (here), insn_size);
+ here += insn_size;
+ if (IS_MEDIA_IND_ARG_MOV (w))
+ {
+ /* This must be followed by a store to r14, so the argument
+ is where the debug info says it is. This can happen after
+ the SP has been saved, unfortunately. */
+
+ int next_insn = read_memory_integer (UNMAKE_ISA32_ADDR (here),
+ insn_size);
+ here += insn_size;
+ if (IS_MEDIA_MOV_TO_R14 (next_insn))
+ start_pc = here;
+ }
+ else if (IS_MEDIA_ARG_MOV (w))
+ {
+ /* These instructions store directly the argument in r14. */
+ start_pc = here;
+ }
+ else
+ break;
+ }
+ else
+ {
+ w = read_memory_integer (here, insn_size);
+ w = w & 0xffff;
+ here += insn_size;
+ if (IS_COMPACT_IND_ARG_MOV (w))
+ {
+ /* This must be followed by a store to r14, so the argument
+ is where the debug info says it is. This can happen after
+ the SP has been saved, unfortunately. */
+
+ int next_insn = 0xffff & read_memory_integer (here, insn_size);
+ here += insn_size;
+ if (IS_COMPACT_MOV_TO_R14 (next_insn))
+ start_pc = here;
+ }
+ else if (IS_COMPACT_ARG_MOV (w))
+ {
+ /* These instructions store directly the argument in r14. */
+ start_pc = here;
+ }
+ else if (IS_MOVL_R0 (w))
+ {
+ /* There is a function that gcc calls to get the arguments
+ passed correctly to the function. Only after this
+ function call the arguments will be found at the place
+ where they are supposed to be. This happens in case the
+ argument has to be stored into a 64-bit register (for
+ instance doubles, long longs). SHcompact doesn't have
+ access to the full 64-bits, so we store the register in
+ stack slot and store the address of the stack slot in
+ the register, then do a call through a wrapper that
+ loads the memory value into the register. A SHcompact
+ callee calls an argument decoder
+ (GCC_shcompact_incoming_args) that stores the 64-bit
+ value in a stack slot and stores the address of the
+ stack slot in the register. GCC thinks the argument is
+ just passed by transparent reference, but this is only
+ true after the argument decoder is called. Such a call
+ needs to be considered part of the prologue. */
+
+ /* This must be followed by a JSR @r0 instruction and by
+ a NOP instruction. After these, the prologue is over! */
+
+ int next_insn = 0xffff & read_memory_integer (here, insn_size);
+ here += insn_size;
+ if (IS_JSR_R0 (next_insn))
+ {
+ next_insn = 0xffff & read_memory_integer (here, insn_size);
+ here += insn_size;
+
+ if (IS_NOP (next_insn))
+ start_pc = here;
+ }
+ }
+ else
+ break;
+ }
+ }
+
+ return start_pc;
+}
+
+static CORE_ADDR
+sh64_skip_prologue_hard_way (CORE_ADDR start_pc)
+{
+ CORE_ADDR here, end;
+ int updated_fp = 0;
+ int insn_size = 4;
+ int media_mode = 1;
+
+ if (!start_pc)
+ return 0;
+
+ if (pc_is_isa32 (start_pc) == 0)
+ {
+ insn_size = 2;
+ media_mode = 0;
+ }
+
+ for (here = start_pc, end = start_pc + (insn_size * 28); here < end;)
+ {
+
+ if (media_mode)
+ {
+ int w = read_memory_integer (UNMAKE_ISA32_ADDR (here), insn_size);
+ here += insn_size;
+ if (IS_STQ_R18_R14 (w) || IS_STQ_R18_R15 (w) || IS_STQ_R14_R15 (w)
+ || IS_STL_R14_R15 (w) || IS_STL_R18_R15 (w)
+ || IS_ADDIL_SP_MEDIA (w) || IS_ADDI_SP_MEDIA (w) || IS_PTABSL_R18 (w))
+ {
+ start_pc = here;
+ }
+ else if (IS_MOV_SP_FP (w) || IS_MOV_SP_FP_MEDIA(w))
+ {
+ start_pc = here;
+ updated_fp = 1;
+ }
+ else
+ if (updated_fp)
+ {
+ /* Don't bail out yet, we may have arguments stored in
+ registers here, according to the debug info, so that
+ gdb can print the frames correctly. */
+ start_pc = look_for_args_moves (here - insn_size, media_mode);
+ break;
+ }
+ }
+ else
+ {
+ int w = 0xffff & read_memory_integer (here, insn_size);
+ here += insn_size;
+
+ if (IS_STS_R0 (w) || IS_STS_PR (w)
+ || IS_MOV_TO_R15 (w) || IS_MOV_R14 (w)
+ || IS_MOV_R0 (w) || IS_ADD_SP_R0 (w) || IS_MOV_R14_R0 (w))
+ {
+ start_pc = here;
+ }
+ else if (IS_MOV_SP_FP (w))
+ {
+ start_pc = here;
+ updated_fp = 1;
+ }
+ else
+ if (updated_fp)
+ {
+ /* Don't bail out yet, we may have arguments stored in
+ registers here, according to the debug info, so that
+ gdb can print the frames correctly. */
+ start_pc = look_for_args_moves (here - insn_size, media_mode);
+ break;
+ }
+ }
+ }
+
+ return start_pc;
+}
+
+static CORE_ADDR
+sh_skip_prologue (CORE_ADDR pc)
+{
+ CORE_ADDR post_prologue_pc;
+
+ /* See if we can determine the end of the prologue via the symbol table.
+ If so, then return either PC, or the PC after the prologue, whichever
+ is greater. */
+ post_prologue_pc = after_prologue (pc);
+
+ /* If after_prologue returned a useful address, then use it. Else
+ fall back on the instruction skipping code. */
+ if (post_prologue_pc != 0)
+ return max (pc, post_prologue_pc);
+ else
+ return sh64_skip_prologue_hard_way (pc);
+}
+
+/* Immediately after a function call, return the saved pc.
+ Can't always go through the frames for this because on some machines
+ the new frame is not set up until the new function executes
+ some instructions.
+
+ The return address is the value saved in the PR register + 4 */
+static CORE_ADDR
+sh_saved_pc_after_call (struct frame_info *frame)
+{
+ return (ADDR_BITS_REMOVE (read_register (PR_REGNUM)));
+}
+
+/* Should call_function allocate stack space for a struct return? */
+static int
+sh64_use_struct_convention (int gcc_p, struct type *type)
+{
+ return (TYPE_LENGTH (type) > 8);
+}
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function.
+
+ We store structs through a pointer passed in R2 */
+static void
+sh64_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ write_register (STRUCT_RETURN_REGNUM, (addr));
+}
+
+/* Disassemble an instruction. */
+static int
+gdb_print_insn_sh (bfd_vma memaddr, disassemble_info *info)
+{
+ info->endian = TARGET_BYTE_ORDER;
+ return print_insn_sh (memaddr, info);
+}
+
+/* Given a register number RN as it appears in an assembly
+ instruction, find the corresponding register number in the GDB
+ scheme. */
+static int
+translate_insn_rn (int rn, int media_mode)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ /* FIXME: this assumes that the number rn is for a not pseudo
+ register only. */
+ if (media_mode)
+ return rn;
+ else
+ {
+ /* These registers don't have a corresponding compact one. */
+ /* FIXME: This is probably not enough. */
+#if 0
+ if ((rn >= 16 && rn <= 63) || (rn >= 93 && rn <= 140))
+ return rn;
+#endif
+ if (rn >= 0 && rn <= R0_C_REGNUM)
+ return R0_C_REGNUM + rn;
+ else
+ return rn;
+ }
+}
+
+/* Given a GDB frame, determine the address of the calling function's
+ frame. This will be used to create a new GDB frame struct, and
+ then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC
+ will be called for the new frame.
+
+ For us, the frame address is its stack pointer value, so we look up
+ the function prologue to determine the caller's sp value, and return it. */
+static CORE_ADDR
+sh64_frame_chain (struct frame_info *frame)
+{
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ return get_frame_base (frame); /* dummy frame same as caller's frame */
+ if (get_frame_pc (frame)
+ && !deprecated_inside_entry_file (get_frame_pc (frame)))
+ {
+ int media_mode = pc_is_isa32 (get_frame_pc (frame));
+ int size;
+ if (gdbarch_tdep (current_gdbarch)->sh_abi == SH_ABI_32)
+ size = 4;
+ else
+ size = REGISTER_RAW_SIZE (translate_insn_rn (DEPRECATED_FP_REGNUM, media_mode));
+ return read_memory_integer (get_frame_base (frame)
+ + get_frame_extra_info (frame)->f_offset,
+ size);
+ }
+ else
+ return 0;
+}
+
+static CORE_ADDR
+sh64_get_saved_pr (struct frame_info *fi, int pr_regnum)
+{
+ int media_mode = 0;
+
+ for (; fi; fi = get_next_frame (fi))
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ /* When the caller requests PR from the dummy frame, we return PC because
+ that's where the previous routine appears to have done a call from. */
+ return deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), pr_regnum);
+ else
+ {
+ DEPRECATED_FRAME_INIT_SAVED_REGS (fi);
+ if (!get_frame_pc (fi))
+ return 0;
+
+ media_mode = pc_is_isa32 (get_frame_pc (fi));
+
+ if (get_frame_saved_regs (fi)[pr_regnum] != 0)
+ {
+ int gdb_reg_num = translate_insn_rn (pr_regnum, media_mode);
+ int size = ((gdbarch_tdep (current_gdbarch)->sh_abi == SH_ABI_32)
+ ? 4
+ : REGISTER_RAW_SIZE (gdb_reg_num));
+ return read_memory_integer (get_frame_saved_regs (fi)[pr_regnum], size);
+ }
+ }
+ return read_register (pr_regnum);
+}
+
+/* For vectors of 4 floating point registers. */
+static int
+fv_reg_base_num (int fv_regnum)
+{
+ int fp_regnum;
+
+ fp_regnum = FP0_REGNUM +
+ (fv_regnum - FV0_REGNUM) * 4;
+ return fp_regnum;
+}
+
+/* For double precision floating point registers, i.e 2 fp regs.*/
+static int
+dr_reg_base_num (int dr_regnum)
+{
+ int fp_regnum;
+
+ fp_regnum = FP0_REGNUM +
+ (dr_regnum - DR0_REGNUM) * 2;
+ return fp_regnum;
+}
+
+/* For pairs of floating point registers */
+static int
+fpp_reg_base_num (int fpp_regnum)
+{
+ int fp_regnum;
+
+ fp_regnum = FP0_REGNUM +
+ (fpp_regnum - FPP0_REGNUM) * 2;
+ return fp_regnum;
+}
+
+static int
+is_media_pseudo (int rn)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ return (rn >= DR0_REGNUM
+ && rn <= FV_LAST_REGNUM);
+}
+
+static int
+sh64_get_gdb_regnum (int gcc_regnum, CORE_ADDR pc)
+{
+ return translate_insn_rn (gcc_regnum, pc_is_isa32 (pc));
+}
+
+static int
+sh64_media_reg_base_num (int reg_nr)
+{
+ int base_regnum = -1;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (reg_nr >= DR0_REGNUM
+ && reg_nr <= DR_LAST_REGNUM)
+ base_regnum = dr_reg_base_num (reg_nr);
+
+ else if (reg_nr >= FPP0_REGNUM
+ && reg_nr <= FPP_LAST_REGNUM)
+ base_regnum = fpp_reg_base_num (reg_nr);
+
+ else if (reg_nr >= FV0_REGNUM
+ && reg_nr <= FV_LAST_REGNUM)
+ base_regnum = fv_reg_base_num (reg_nr);
+
+ return base_regnum;
+}
+
+/* *INDENT-OFF* */
+/*
+ SH COMPACT MODE (ISA 16) (all pseudo) 221-272
+ GDB_REGNUM BASE_REGNUM
+ r0_c 221 0
+ r1_c 222 1
+ r2_c 223 2
+ r3_c 224 3
+ r4_c 225 4
+ r5_c 226 5
+ r6_c 227 6
+ r7_c 228 7
+ r8_c 229 8
+ r9_c 230 9
+ r10_c 231 10
+ r11_c 232 11
+ r12_c 233 12
+ r13_c 234 13
+ r14_c 235 14
+ r15_c 236 15
+
+ pc_c 237 64
+ gbr_c 238 16
+ mach_c 239 17
+ macl_c 240 17
+ pr_c 241 18
+ t_c 242 19
+ fpscr_c 243 76
+ fpul_c 244 109
+
+ fr0_c 245 77
+ fr1_c 246 78
+ fr2_c 247 79
+ fr3_c 248 80
+ fr4_c 249 81
+ fr5_c 250 82
+ fr6_c 251 83
+ fr7_c 252 84
+ fr8_c 253 85
+ fr9_c 254 86
+ fr10_c 255 87
+ fr11_c 256 88
+ fr12_c 257 89
+ fr13_c 258 90
+ fr14_c 259 91
+ fr15_c 260 92
+
+ dr0_c 261 77
+ dr2_c 262 79
+ dr4_c 263 81
+ dr6_c 264 83
+ dr8_c 265 85
+ dr10_c 266 87
+ dr12_c 267 89
+ dr14_c 268 91
+
+ fv0_c 269 77
+ fv4_c 270 81
+ fv8_c 271 85
+ fv12_c 272 91
+*/
+/* *INDENT-ON* */
+static int
+sh64_compact_reg_base_num (int reg_nr)
+{
+ int base_regnum = -1;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ /* general register N maps to general register N */
+ if (reg_nr >= R0_C_REGNUM
+ && reg_nr <= R_LAST_C_REGNUM)
+ base_regnum = reg_nr - R0_C_REGNUM;
+
+ /* floating point register N maps to floating point register N */
+ else if (reg_nr >= FP0_C_REGNUM
+ && reg_nr <= FP_LAST_C_REGNUM)
+ base_regnum = reg_nr - FP0_C_REGNUM + FP0_REGNUM;
+
+ /* double prec register N maps to base regnum for double prec register N */
+ else if (reg_nr >= DR0_C_REGNUM
+ && reg_nr <= DR_LAST_C_REGNUM)
+ base_regnum = dr_reg_base_num (DR0_REGNUM
+ + reg_nr - DR0_C_REGNUM);
+
+ /* vector N maps to base regnum for vector register N */
+ else if (reg_nr >= FV0_C_REGNUM
+ && reg_nr <= FV_LAST_C_REGNUM)
+ base_regnum = fv_reg_base_num (FV0_REGNUM
+ + reg_nr - FV0_C_REGNUM);
+
+ else if (reg_nr == PC_C_REGNUM)
+ base_regnum = PC_REGNUM;
+
+ else if (reg_nr == GBR_C_REGNUM)
+ base_regnum = 16;
+
+ else if (reg_nr == MACH_C_REGNUM
+ || reg_nr == MACL_C_REGNUM)
+ base_regnum = 17;
+
+ else if (reg_nr == PR_C_REGNUM)
+ base_regnum = 18;
+
+ else if (reg_nr == T_C_REGNUM)
+ base_regnum = 19;
+
+ else if (reg_nr == FPSCR_C_REGNUM)
+ base_regnum = FPSCR_REGNUM; /*???? this register is a mess. */
+
+ else if (reg_nr == FPUL_C_REGNUM)
+ base_regnum = FP0_REGNUM + 32;
+
+ return base_regnum;
+}
+
+/* Given a register number RN (according to the gdb scheme) , return
+ its corresponding architectural register. In media mode, only a
+ subset of the registers is pseudo registers. For compact mode, all
+ the registers are pseudo. */
+static int
+translate_rn_to_arch_reg_num (int rn, int media_mode)
+{
+
+ if (media_mode)
+ {
+ if (!is_media_pseudo (rn))
+ return rn;
+ else
+ return sh64_media_reg_base_num (rn);
+ }
+ else
+ /* All compact registers are pseudo. */
+ return sh64_compact_reg_base_num (rn);
+}
+
+static int
+sign_extend (int value, int bits)
+{
+ value = value & ((1 << bits) - 1);
+ return (value & (1 << (bits - 1))
+ ? value | (~((1 << bits) - 1))
+ : value);
+}
+
+static void
+sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
+{
+ int *where = (int *) alloca ((NUM_REGS + NUM_PSEUDO_REGS) * sizeof (int));
+ int rn;
+ int have_fp = 0;
+ int fp_regnum;
+ int sp_regnum;
+ int depth;
+ int pc;
+ int opc;
+ int insn;
+ int r0_val = 0;
+ int media_mode = 0;
+ int insn_size;
+ int gdb_register_number;
+ int register_number;
+ char *dummy_regs = deprecated_generic_find_dummy_frame (get_frame_pc (fi), get_frame_base (fi));
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (get_frame_saved_regs (fi) == NULL)
+ frame_saved_regs_zalloc (fi);
+ else
+ memset (get_frame_saved_regs (fi), 0, SIZEOF_FRAME_SAVED_REGS);
+
+ if (dummy_regs)
+ {
+ /* DANGER! This is ONLY going to work if the char buffer format of
+ the saved registers is byte-for-byte identical to the
+ CORE_ADDR regs[NUM_REGS] format used by struct frame_saved_regs! */
+ memcpy (get_frame_saved_regs (fi), dummy_regs, SIZEOF_FRAME_SAVED_REGS);
+ return;
+ }
+
+ get_frame_extra_info (fi)->leaf_function = 1;
+ get_frame_extra_info (fi)->f_offset = 0;
+
+ for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++)
+ where[rn] = -1;
+
+ depth = 0;
+
+ /* Loop around examining the prologue insns until we find something
+ that does not appear to be part of the prologue. But give up
+ after 20 of them, since we're getting silly then. */
+
+ pc = get_frame_func (fi);
+ if (!pc)
+ {
+ deprecated_update_frame_pc_hack (fi, 0);
+ return;
+ }
+
+ if (pc_is_isa32 (pc))
+ {
+ media_mode = 1;
+ insn_size = 4;
+ }
+ else
+ {
+ media_mode = 0;
+ insn_size = 2;
+ }
+
+ /* The frame pointer register is general register 14 in shmedia and
+ shcompact modes. In sh compact it is a pseudo register. Same goes
+ for the stack pointer register, which is register 15. */
+ fp_regnum = translate_insn_rn (DEPRECATED_FP_REGNUM, media_mode);
+ sp_regnum = translate_insn_rn (SP_REGNUM, media_mode);
+
+ for (opc = pc + (insn_size * 28); pc < opc; pc += insn_size)
+ {
+ insn = read_memory_integer (media_mode ? UNMAKE_ISA32_ADDR (pc) : pc,
+ insn_size);
+
+ if (media_mode == 0)
+ {
+ if (IS_STS_PR (insn))
+ {
+ int next_insn = read_memory_integer (pc + insn_size, insn_size);
+ if (IS_MOV_TO_R15 (next_insn))
+ {
+ int reg_nr = PR_C_REGNUM;
+
+ where[reg_nr] = depth - ((((next_insn & 0xf) ^ 0x8) - 0x8) << 2);
+ get_frame_extra_info (fi)->leaf_function = 0;
+ pc += insn_size;
+ }
+ }
+ else if (IS_MOV_R14 (insn))
+ {
+ where[fp_regnum] = depth - ((((insn & 0xf) ^ 0x8) - 0x8) << 2);
+ }
+
+ else if (IS_MOV_R0 (insn))
+ {
+ /* Put in R0 the offset from SP at which to store some
+ registers. We are interested in this value, because it
+ will tell us where the given registers are stored within
+ the frame. */
+ r0_val = ((insn & 0xff) ^ 0x80) - 0x80;
+ }
+ else if (IS_ADD_SP_R0 (insn))
+ {
+ /* This instruction still prepares r0, but we don't care.
+ We already have the offset in r0_val. */
+ }
+ else if (IS_STS_R0 (insn))
+ {
+ /* Store PR at r0_val-4 from SP. Decrement r0 by 4*/
+ int reg_nr = PR_C_REGNUM;
+ where[reg_nr] = depth - (r0_val - 4);
+ r0_val -= 4;
+ get_frame_extra_info (fi)->leaf_function = 0;
+ }
+ else if (IS_MOV_R14_R0 (insn))
+ {
+ /* Store R14 at r0_val-4 from SP. Decrement r0 by 4 */
+ where[fp_regnum] = depth - (r0_val - 4);
+ r0_val -= 4;
+ }
+
+ else if (IS_ADD_SP (insn))
+ {
+ depth -= ((insn & 0xff) ^ 0x80) - 0x80;
+ }
+ else if (IS_MOV_SP_FP (insn))
+ break;
+ }
+ else
+ {
+ if (IS_ADDIL_SP_MEDIA (insn)
+ || IS_ADDI_SP_MEDIA (insn))
+ {
+ depth -= sign_extend ((((insn & 0xffc00) ^ 0x80000) - 0x80000) >> 10, 9);
+ }
+
+ else if (IS_STQ_R18_R15 (insn))
+ {
+ where[PR_REGNUM] =
+ depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 3);
+ get_frame_extra_info (fi)->leaf_function = 0;
+ }
+
+ else if (IS_STL_R18_R15 (insn))
+ {
+ where[PR_REGNUM] =
+ depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 2);
+ get_frame_extra_info (fi)->leaf_function = 0;
+ }
+
+ else if (IS_STQ_R14_R15 (insn))
+ {
+ where[fp_regnum] = depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 3);
+ }
+
+ else if (IS_STL_R14_R15 (insn))
+ {
+ where[fp_regnum] = depth - (sign_extend ((insn & 0xffc00) >> 10, 9) << 2);
+ }
+
+ else if (IS_MOV_SP_FP_MEDIA (insn))
+ break;
+ }
+ }
+
+ /* Now we know how deep things are, we can work out their addresses. */
+ for (rn = 0; rn < NUM_REGS + NUM_PSEUDO_REGS; rn++)
+ {
+ register_number = translate_rn_to_arch_reg_num (rn, media_mode);
+
+ if (where[rn] >= 0)
+ {
+ if (rn == fp_regnum)
+ have_fp = 1;
+
+ /* Watch out! saved_regs is only for the real registers, and
+ doesn't include space for the pseudo registers. */
+ get_frame_saved_regs (fi)[register_number]= get_frame_base (fi) - where[rn] + depth;
+
+ }
+ else
+ get_frame_saved_regs (fi)[register_number] = 0;
+ }
+
+ if (have_fp)
+ {
+ /* SP_REGNUM is 15. For shmedia 15 is the real register. For
+ shcompact 15 is the arch register corresponding to the pseudo
+ register r15 which still is the SP register. */
+ /* The place on the stack where fp is stored contains the sp of
+ the caller. */
+ /* Again, saved_registers contains only space for the real
+ registers, so we store in DEPRECATED_FP_REGNUM position. */
+ int size;
+ if (tdep->sh_abi == SH_ABI_32)
+ size = 4;
+ else
+ size = REGISTER_RAW_SIZE (fp_regnum);
+ get_frame_saved_regs (fi)[sp_regnum] = read_memory_integer (get_frame_saved_regs (fi)[fp_regnum], size);
+ }
+ else
+ get_frame_saved_regs (fi)[sp_regnum] = get_frame_base (fi);
+
+ get_frame_extra_info (fi)->f_offset = depth - where[fp_regnum];
+}
+
+/* Initialize the extra info saved in a FRAME */
+static void
+sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi)
+{
+ int media_mode = pc_is_isa32 (get_frame_pc (fi));
+
+ frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
+
+ if (get_next_frame (fi))
+ deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
+
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
+ get_frame_base (fi)))
+ {
+ /* We need to setup fi->frame here because call_function_by_hand
+ gets it wrong by assuming it's always FP. */
+ deprecated_update_frame_base_hack (fi, deprecated_read_register_dummy (get_frame_pc (fi), get_frame_base (fi), SP_REGNUM));
+ get_frame_extra_info (fi)->return_pc =
+ deprecated_read_register_dummy (get_frame_pc (fi),
+ get_frame_base (fi), PC_REGNUM);
+ get_frame_extra_info (fi)->f_offset = -(DEPRECATED_CALL_DUMMY_LENGTH + 4);
+ get_frame_extra_info (fi)->leaf_function = 0;
+ return;
+ }
+ else
+ {
+ DEPRECATED_FRAME_INIT_SAVED_REGS (fi);
+ get_frame_extra_info (fi)->return_pc =
+ sh64_get_saved_pr (fi, PR_REGNUM);
+ }
+}
+
+static void
+sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
+ struct frame_info *frame, int regnum,
+ enum lval_type *lval)
+{
+ int media_mode;
+ int live_regnum = regnum;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (!target_has_registers)
+ error ("No registers.");
+
+ /* Normal systems don't optimize out things with register numbers. */
+ if (optimized != NULL)
+ *optimized = 0;
+
+ if (addrp) /* default assumption: not found in memory */
+ *addrp = 0;
+
+ if (raw_buffer)
+ memset (raw_buffer, 0, sizeof (raw_buffer));
+
+ /* We must do this here, before the following while loop changes
+ frame, and makes it NULL. If this is a media register number,
+ but we are in compact mode, it will become the corresponding
+ compact pseudo register. If there is no corresponding compact
+ pseudo-register what do we do?*/
+ media_mode = pc_is_isa32 (get_frame_pc (frame));
+ live_regnum = translate_insn_rn (regnum, media_mode);
+
+ /* Note: since the current frame's registers could only have been
+ saved by frames INTERIOR TO the current frame, we skip examining
+ the current frame itself: otherwise, we would be getting the
+ previous frame's registers which were saved by the current frame. */
+
+ while (frame && ((frame = get_next_frame (frame)) != NULL))
+ {
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ {
+ if (lval) /* found it in a CALL_DUMMY frame */
+ *lval = not_lval;
+ if (raw_buffer)
+ memcpy (raw_buffer,
+ (deprecated_generic_find_dummy_frame (get_frame_pc (frame), get_frame_base (frame))
+ + DEPRECATED_REGISTER_BYTE (regnum)),
+ REGISTER_RAW_SIZE (regnum));
+ return;
+ }
+
+ DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
+ if (get_frame_saved_regs (frame) != NULL
+ && get_frame_saved_regs (frame)[regnum] != 0)
+ {
+ if (lval) /* found it saved on the stack */
+ *lval = lval_memory;
+ if (regnum == SP_REGNUM)
+ {
+ if (raw_buffer) /* SP register treated specially */
+ store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum),
+ get_frame_saved_regs (frame)[regnum]);
+ }
+ else
+ { /* any other register */
+
+ if (addrp)
+ *addrp = get_frame_saved_regs (frame)[regnum];
+ if (raw_buffer)
+ {
+ int size;
+ if (tdep->sh_abi == SH_ABI_32
+ && (live_regnum == DEPRECATED_FP_REGNUM
+ || live_regnum == PR_REGNUM))
+ size = 4;
+ else
+ size = REGISTER_RAW_SIZE (live_regnum);
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
+ read_memory (get_frame_saved_regs (frame)[regnum], raw_buffer, size);
+ else
+ read_memory (get_frame_saved_regs (frame)[regnum],
+ raw_buffer
+ + REGISTER_RAW_SIZE (live_regnum)
+ - size,
+ size);
+ }
+ }
+ return;
+ }
+ }
+
+ /* If we get thru the loop to this point, it means the register was
+ not saved in any frame. Return the actual live-register value. */
+
+ if (lval) /* found it in a live register */
+ *lval = lval_register;
+ if (addrp)
+ *addrp = DEPRECATED_REGISTER_BYTE (live_regnum);
+ if (raw_buffer)
+ deprecated_read_register_gen (live_regnum, raw_buffer);
+}
+
+static CORE_ADDR
+sh64_extract_struct_value_address (char *regbuf)
+{
+ return (extract_unsigned_integer ((regbuf + DEPRECATED_REGISTER_BYTE (STRUCT_RETURN_REGNUM)),
+ REGISTER_RAW_SIZE (STRUCT_RETURN_REGNUM)));
+}
+
+static CORE_ADDR
+sh_frame_saved_pc (struct frame_info *frame)
+{
+ return (get_frame_extra_info (frame)->return_pc);
+}
+
+/* Discard from the stack the innermost frame, restoring all saved registers.
+ Used in the 'return' command. */
+static void
+sh64_pop_frame (void)
+{
+ struct frame_info *frame = get_current_frame ();
+ CORE_ADDR fp;
+ int regnum;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ int media_mode = pc_is_isa32 (get_frame_pc (frame));
+
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
+ get_frame_base (frame),
+ get_frame_base (frame)))
+ generic_pop_dummy_frame ();
+ else
+ {
+ fp = get_frame_base (frame);
+ DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
+
+ /* Copy regs from where they were saved in the frame */
+ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ if (get_frame_saved_regs (frame)[regnum])
+ {
+ int size;
+ if (tdep->sh_abi == SH_ABI_32
+ && (regnum == DEPRECATED_FP_REGNUM
+ || regnum == PR_REGNUM))
+ size = 4;
+ else
+ size = REGISTER_RAW_SIZE (translate_insn_rn (regnum,
+ media_mode));
+ write_register (regnum,
+ read_memory_integer (get_frame_saved_regs (frame)[regnum],
+ size));
+ }
+
+ write_register (PC_REGNUM, get_frame_extra_info (frame)->return_pc);
+ write_register (SP_REGNUM, fp + 8);
+ }
+ flush_cached_frames ();
+}
+
+static CORE_ADDR
+sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
+{
+ return sp & ~3;
+}
+
+/* Function: push_arguments
+ Setup the function arguments for calling a function in the inferior.
+
+ On the Hitachi SH architecture, there are four registers (R4 to R7)
+ which are dedicated for passing function arguments. Up to the first
+ four arguments (depending on size) may go into these registers.
+ The rest go on the stack.
+
+ Arguments that are smaller than 4 bytes will still take up a whole
+ register or a whole 32-bit word on the stack, and will be
+ right-justified in the register or the stack word. This includes
+ chars, shorts, and small aggregate types.
+
+ Arguments that are larger than 4 bytes may be split between two or
+ more registers. If there are not enough registers free, an argument
+ may be passed partly in a register (or registers), and partly on the
+ stack. This includes doubles, long longs, and larger aggregates.
+ As far as I know, there is no upper limit to the size of aggregates
+ that will be passed in this way; in other words, the convention of
+ passing a pointer to a large aggregate instead of a copy is not used.
+
+ An exceptional case exists for struct arguments (and possibly other
+ aggregates such as arrays) if the size is larger than 4 bytes but
+ not a multiple of 4 bytes. In this case the argument is never split
+ between the registers and the stack, but instead is copied in its
+ entirety onto the stack, AND also copied into as many registers as
+ there is room for. In other words, space in registers permitting,
+ two copies of the same argument are passed in. As far as I can tell,
+ only the one on the stack is used, although that may be a function
+ of the level of compiler optimization. I suspect this is a compiler
+ bug. Arguments of these odd sizes are left-justified within the
+ word (as opposed to arguments smaller than 4 bytes, which are
+ right-justified).
+
+ If the function is to return an aggregate type such as a struct, it
+ is either returned in the normal return value register R0 (if its
+ size is no greater than one byte), or else the caller must allocate
+ space into which the callee will copy the return value (if the size
+ is greater than one byte). In this case, a pointer to the return
+ value location is passed into the callee in register R2, which does
+ not displace any of the other arguments passed in via registers R4
+ to R7. */
+
+/* R2-R9 for integer types and integer equivalent (char, pointers) and
+ non-scalar (struct, union) elements (even if the elements are
+ floats).
+ FR0-FR11 for single precision floating point (float)
+ DR0-DR10 for double precision floating point (double)
+
+ If a float is argument number 3 (for instance) and arguments number
+ 1,2, and 4 are integer, the mapping will be:
+ arg1 -->R2, arg2 --> R3, arg3 -->FR0, arg4 --> R5. I.e. R4 is not used.
+
+ If a float is argument number 10 (for instance) and arguments number
+ 1 through 10 are integer, the mapping will be:
+ arg1->R2, arg2->R3, arg3->R4, arg4->R5, arg5->R6, arg6->R7, arg7->R8,
+ arg8->R9, arg9->(0,SP)stack(8-byte aligned), arg10->FR0, arg11->stack(16,SP).
+ I.e. there is hole in the stack.
+
+ Different rules apply for variable arguments functions, and for functions
+ for which the prototype is not known. */
+
+static CORE_ADDR
+sh64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ int stack_offset, stack_alloc;
+ int int_argreg;
+ int float_argreg;
+ int double_argreg;
+ int float_arg_index = 0;
+ int double_arg_index = 0;
+ int argnum;
+ struct type *type;
+ CORE_ADDR regval;
+ char *val;
+ char valbuf[8];
+ char valbuf_tmp[8];
+ int len;
+ int argreg_size;
+ int fp_args[12];
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ memset (fp_args, 0, sizeof (fp_args));
+
+ /* first force sp to a 8-byte alignment */
+ sp = sp & ~7;
+
+ /* The "struct return pointer" pseudo-argument has its own dedicated
+ register */
+
+ if (struct_return)
+ write_register (STRUCT_RETURN_REGNUM, struct_addr);
+
+ /* Now make sure there's space on the stack */
+ for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
+ stack_alloc += ((TYPE_LENGTH (VALUE_TYPE (args[argnum])) + 7) & ~7);
+ sp -= stack_alloc; /* make room on stack for args */
+
+ /* Now load as many as possible of the first arguments into
+ registers, and push the rest onto the stack. There are 64 bytes
+ in eight registers available. Loop thru args from first to last. */
+
+ int_argreg = ARG0_REGNUM;
+ float_argreg = FP0_REGNUM;
+ double_argreg = DR0_REGNUM;
+
+ for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
+ {
+ type = VALUE_TYPE (args[argnum]);
+ len = TYPE_LENGTH (type);
+ memset (valbuf, 0, sizeof (valbuf));
+
+ if (TYPE_CODE (type) != TYPE_CODE_FLT)
+ {
+ argreg_size = REGISTER_RAW_SIZE (int_argreg);
+
+ if (len < argreg_size)
+ {
+ /* value gets right-justified in the register or stack word */
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ memcpy (valbuf + argreg_size - len,
+ (char *) VALUE_CONTENTS (args[argnum]), len);
+ else
+ memcpy (valbuf, (char *) VALUE_CONTENTS (args[argnum]), len);
+
+ val = valbuf;
+ }
+ else
+ val = (char *) VALUE_CONTENTS (args[argnum]);
+
+ while (len > 0)
+ {
+ if (int_argreg > ARGLAST_REGNUM)
+ {
+ /* must go on the stack */
+ write_memory (sp + stack_offset, val, argreg_size);
+ stack_offset += 8;/*argreg_size;*/
+ }
+ /* NOTE WELL!!!!! This is not an "else if" clause!!!
+ That's because some *&^%$ things get passed on the stack
+ AND in the registers! */
+ if (int_argreg <= ARGLAST_REGNUM)
+ {
+ /* there's room in a register */
+ regval = extract_unsigned_integer (val, argreg_size);
+ write_register (int_argreg, regval);
+ }
+ /* Store the value 8 bytes at a time. This means that
+ things larger than 8 bytes may go partly in registers
+ and partly on the stack. FIXME: argreg is incremented
+ before we use its size. */
+ len -= argreg_size;
+ val += argreg_size;
+ int_argreg++;
+ }
+ }
+ else
+ {
+ val = (char *) VALUE_CONTENTS (args[argnum]);
+ if (len == 4)
+ {
+ /* Where is it going to be stored? */
+ while (fp_args[float_arg_index])
+ float_arg_index ++;
+
+ /* Now float_argreg points to the register where it
+ should be stored. Are we still within the allowed
+ register set? */
+ if (float_arg_index <= FLOAT_ARGLAST_REGNUM)
+ {
+ /* Goes in FR0...FR11 */
+ deprecated_write_register_gen (FP0_REGNUM + float_arg_index,
+ val);
+ fp_args[float_arg_index] = 1;
+ /* Skip the corresponding general argument register. */
+ int_argreg ++;
+ }
+ else
+ ;
+ /* Store it as the integers, 8 bytes at the time, if
+ necessary spilling on the stack. */
+
+ }
+ else if (len == 8)
+ {
+ /* Where is it going to be stored? */
+ while (fp_args[double_arg_index])
+ double_arg_index += 2;
+ /* Now double_argreg points to the register
+ where it should be stored.
+ Are we still within the allowed register set? */
+ if (double_arg_index < FLOAT_ARGLAST_REGNUM)
+ {
+ /* Goes in DR0...DR10 */
+ /* The numbering of the DRi registers is consecutive,
+ i.e. includes odd numbers. */
+ int double_register_offset = double_arg_index / 2;
+ int regnum = DR0_REGNUM +
+ double_register_offset;
+#if 0
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
+ {
+ memset (valbuf_tmp, 0, sizeof (valbuf_tmp));
+ DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum,
+ type, val,
+ valbuf_tmp);
+ val = valbuf_tmp;
+ }
+#endif
+ /* Note: must use write_register_gen here instead
+ of regcache_raw_write, because
+ regcache_raw_write works only for real
+ registers, not pseudo. write_register_gen will
+ call the gdbarch function to do register
+ writes, and that will properly know how to deal
+ with pseudoregs. */
+ deprecated_write_register_gen (regnum, val);
+ fp_args[double_arg_index] = 1;
+ fp_args[double_arg_index + 1] = 1;
+ /* Skip the corresponding general argument register. */
+ int_argreg ++;
+ }
+ else
+ ;
+ /* Store it as the integers, 8 bytes at the time, if
+ necessary spilling on the stack. */
+ }
+ }
+ }
+ return sp;
+}
+
+/* Function: push_return_address (pc)
+ Set up the return address for the inferior function call.
+ Needed for targets where we don't actually execute a JSR/BSR instruction */
+
+static CORE_ADDR
+sh64_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
+{
+ write_register (PR_REGNUM, entry_point_address ());
+ return sp;
+}
+
+/* Find a function's return value in the appropriate registers (in
+ regbuf), and copy it into valbuf. Extract from an array REGBUF
+ containing the (raw) register state a function return value of type
+ TYPE, and copy that, in virtual format, into VALBUF. */
+static void
+sh64_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+{
+ int offset;
+ int return_register;
+ int len = TYPE_LENGTH (type);
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ {
+ if (len == 4)
+ {
+ /* Return value stored in FP0_REGNUM */
+ return_register = FP0_REGNUM;
+ offset = DEPRECATED_REGISTER_BYTE (return_register);
+ memcpy (valbuf, (char *) regbuf + offset, len);
+ }
+ else if (len == 8)
+ {
+ /* return value stored in DR0_REGNUM */
+ DOUBLEST val;
+
+ return_register = DR0_REGNUM;
+ offset = DEPRECATED_REGISTER_BYTE (return_register);
+
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
+ floatformat_to_doublest (&floatformat_ieee_double_littlebyte_bigword,
+ (char *) regbuf + offset, &val);
+ else
+ floatformat_to_doublest (&floatformat_ieee_double_big,
+ (char *) regbuf + offset, &val);
+ deprecated_store_floating (valbuf, len, val);
+ }
+ }
+ else
+ {
+ if (len <= 8)
+ {
+ /* Result is in register 2. If smaller than 8 bytes, it is padded
+ at the most significant end. */
+ return_register = DEFAULT_RETURN_REGNUM;
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ offset = DEPRECATED_REGISTER_BYTE (return_register) +
+ REGISTER_RAW_SIZE (return_register) - len;
+ else
+ offset = DEPRECATED_REGISTER_BYTE (return_register);
+ memcpy (valbuf, (char *) regbuf + offset, len);
+ }
+ else
+ error ("bad size for return value");
+ }
+}
+
+/* Write into appropriate registers a function return value
+ of type TYPE, given in virtual format.
+ If the architecture is sh4 or sh3e, store a function's return value
+ in the R0 general register or in the FP0 floating point register,
+ depending on the type of the return value. In all the other cases
+ the result is stored in r0, left-justified. */
+
+static void
+sh64_store_return_value (struct type *type, char *valbuf)
+{
+ char buf[64]; /* more than enough... */
+ int len = TYPE_LENGTH (type);
+
+ if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ {
+ if (len == 4)
+ {
+ /* Return value stored in FP0_REGNUM */
+ deprecated_write_register_gen (FP0_REGNUM, valbuf);
+ }
+ if (len == 8)
+ {
+ /* return value stored in DR0_REGNUM */
+ /* FIXME: Implement */
+ }
+ }
+ else
+ {
+ int return_register = DEFAULT_RETURN_REGNUM;
+ int offset = 0;
+
+ if (len <= REGISTER_RAW_SIZE (return_register))
+ {
+ /* Pad with zeros. */
+ memset (buf, 0, REGISTER_RAW_SIZE (return_register));
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
+ offset = 0; /*REGISTER_RAW_SIZE (return_register) - len;*/
+ else
+ offset = REGISTER_RAW_SIZE (return_register) - len;
+
+ memcpy (buf + offset, valbuf, len);
+ deprecated_write_register_gen (return_register, buf);
+ }
+ else
+ deprecated_write_register_gen (return_register, valbuf);
+ }
+}
+
+static void
+sh64_show_media_regs (void)
+{
+ int i;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ printf_filtered ("PC=%s SR=%016llx \n",
+ paddr (read_register (PC_REGNUM)),
+ (long long) read_register (SR_REGNUM));
+
+ printf_filtered ("SSR=%016llx SPC=%016llx \n",
+ (long long) read_register (SSR_REGNUM),
+ (long long) read_register (SPC_REGNUM));
+ printf_filtered ("FPSCR=%016lx\n ",
+ (long) read_register (FPSCR_REGNUM));
+
+ for (i = 0; i < 64; i = i + 4)
+ printf_filtered ("\nR%d-R%d %016llx %016llx %016llx %016llx\n",
+ i, i + 3,
+ (long long) read_register (i + 0),
+ (long long) read_register (i + 1),
+ (long long) read_register (i + 2),
+ (long long) read_register (i + 3));
+
+ printf_filtered ("\n");
+
+ for (i = 0; i < 64; i = i + 8)
+ printf_filtered ("FR%d-FR%d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
+ i, i + 7,
+ (long) read_register (FP0_REGNUM + i + 0),
+ (long) read_register (FP0_REGNUM + i + 1),
+ (long) read_register (FP0_REGNUM + i + 2),
+ (long) read_register (FP0_REGNUM + i + 3),
+ (long) read_register (FP0_REGNUM + i + 4),
+ (long) read_register (FP0_REGNUM + i + 5),
+ (long) read_register (FP0_REGNUM + i + 6),
+ (long) read_register (FP0_REGNUM + i + 7));
+}
+
+static void
+sh64_show_compact_regs (void)
+{
+ int i;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ printf_filtered ("PC=%s \n",
+ paddr (read_register (PC_C_REGNUM)));
+
+ printf_filtered ("GBR=%08lx MACH=%08lx MACL=%08lx PR=%08lx T=%08lx\n",
+ (long) read_register (GBR_C_REGNUM),
+ (long) read_register (MACH_C_REGNUM),
+ (long) read_register (MACL_C_REGNUM),
+ (long) read_register (PR_C_REGNUM),
+ (long) read_register (T_C_REGNUM));
+ printf_filtered ("FPSCR=%08lx FPUL=%08lx\n",
+ (long) read_register (FPSCR_C_REGNUM),
+ (long) read_register (FPUL_C_REGNUM));
+
+ for (i = 0; i < 16; i = i + 4)
+ printf_filtered ("\nR%d-R%d %08lx %08lx %08lx %08lx\n",
+ i, i + 3,
+ (long) read_register (i + 0),
+ (long) read_register (i + 1),
+ (long) read_register (i + 2),
+ (long) read_register (i + 3));
+
+ printf_filtered ("\n");
+
+ for (i = 0; i < 16; i = i + 8)
+ printf_filtered ("FR%d-FR%d %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n",
+ i, i + 7,
+ (long) read_register (FP0_REGNUM + i + 0),
+ (long) read_register (FP0_REGNUM + i + 1),
+ (long) read_register (FP0_REGNUM + i + 2),
+ (long) read_register (FP0_REGNUM + i + 3),
+ (long) read_register (FP0_REGNUM + i + 4),
+ (long) read_register (FP0_REGNUM + i + 5),
+ (long) read_register (FP0_REGNUM + i + 6),
+ (long) read_register (FP0_REGNUM + i + 7));
+}
+
+/*FIXME!!! This only shows the registers for shmedia, excluding the
+ pseudo registers. */
+void
+sh64_show_regs (void)
+{
+ if (deprecated_selected_frame
+ && pc_is_isa32 (get_frame_pc (deprecated_selected_frame)))
+ sh64_show_media_regs ();
+ else
+ sh64_show_compact_regs ();
+}
+
+/* *INDENT-OFF* */
+/*
+ SH MEDIA MODE (ISA 32)
+ general registers (64-bit) 0-63
+0 r0, r1, r2, r3, r4, r5, r6, r7,
+64 r8, r9, r10, r11, r12, r13, r14, r15,
+128 r16, r17, r18, r19, r20, r21, r22, r23,
+192 r24, r25, r26, r27, r28, r29, r30, r31,
+256 r32, r33, r34, r35, r36, r37, r38, r39,
+320 r40, r41, r42, r43, r44, r45, r46, r47,
+384 r48, r49, r50, r51, r52, r53, r54, r55,
+448 r56, r57, r58, r59, r60, r61, r62, r63,
+
+ pc (64-bit) 64
+512 pc,
+
+ status reg., saved status reg., saved pc reg. (64-bit) 65-67
+520 sr, ssr, spc,
+
+ target registers (64-bit) 68-75
+544 tr0, tr1, tr2, tr3, tr4, tr5, tr6, tr7,
+
+ floating point state control register (32-bit) 76
+608 fpscr,
+
+ single precision floating point registers (32-bit) 77-140
+612 fr0, fr1, fr2, fr3, fr4, fr5, fr6, fr7,
+644 fr8, fr9, fr10, fr11, fr12, fr13, fr14, fr15,
+676 fr16, fr17, fr18, fr19, fr20, fr21, fr22, fr23,
+708 fr24, fr25, fr26, fr27, fr28, fr29, fr30, fr31,
+740 fr32, fr33, fr34, fr35, fr36, fr37, fr38, fr39,
+772 fr40, fr41, fr42, fr43, fr44, fr45, fr46, fr47,
+804 fr48, fr49, fr50, fr51, fr52, fr53, fr54, fr55,
+836 fr56, fr57, fr58, fr59, fr60, fr61, fr62, fr63,
+
+TOTAL SPACE FOR REGISTERS: 868 bytes
+
+From here on they are all pseudo registers: no memory allocated.
+REGISTER_BYTE returns the register byte for the base register.
+
+ double precision registers (pseudo) 141-172
+ dr0, dr2, dr4, dr6, dr8, dr10, dr12, dr14,
+ dr16, dr18, dr20, dr22, dr24, dr26, dr28, dr30,
+ dr32, dr34, dr36, dr38, dr40, dr42, dr44, dr46,
+ dr48, dr50, dr52, dr54, dr56, dr58, dr60, dr62,
+
+ floating point pairs (pseudo) 173-204
+ fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14,
+ fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30,
+ fp32, fp34, fp36, fp38, fp40, fp42, fp44, fp46,
+ fp48, fp50, fp52, fp54, fp56, fp58, fp60, fp62,
+
+ floating point vectors (4 floating point regs) (pseudo) 205-220
+ fv0, fv4, fv8, fv12, fv16, fv20, fv24, fv28,
+ fv32, fv36, fv40, fv44, fv48, fv52, fv56, fv60,
+
+ SH COMPACT MODE (ISA 16) (all pseudo) 221-272
+ r0_c, r1_c, r2_c, r3_c, r4_c, r5_c, r6_c, r7_c,
+ r8_c, r9_c, r10_c, r11_c, r12_c, r13_c, r14_c, r15_c,
+ pc_c,
+ gbr_c, mach_c, macl_c, pr_c, t_c,
+ fpscr_c, fpul_c,
+ fr0_c, fr1_c, fr2_c, fr3_c, fr4_c, fr5_c, fr6_c, fr7_c,
+ fr8_c, fr9_c, fr10_c, fr11_c, fr12_c, fr13_c, fr14_c, fr15_c
+ dr0_c, dr2_c, dr4_c, dr6_c, dr8_c, dr10_c, dr12_c, dr14_c
+ fv0_c, fv4_c, fv8_c, fv12_c
+*/
+/* *INDENT-ON* */
+static int
+sh_sh64_register_byte (int reg_nr)
+{
+ int base_regnum = -1;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ /* If it is a pseudo register, get the number of the first floating
+ point register that is part of it. */
+ if (reg_nr >= DR0_REGNUM
+ && reg_nr <= DR_LAST_REGNUM)
+ base_regnum = dr_reg_base_num (reg_nr);
+
+ else if (reg_nr >= FPP0_REGNUM
+ && reg_nr <= FPP_LAST_REGNUM)
+ base_regnum = fpp_reg_base_num (reg_nr);
+
+ else if (reg_nr >= FV0_REGNUM
+ && reg_nr <= FV_LAST_REGNUM)
+ base_regnum = fv_reg_base_num (reg_nr);
+
+ /* sh compact pseudo register. FPSCR is a pathological case, need to
+ treat it as special. */
+ else if ((reg_nr >= R0_C_REGNUM
+ && reg_nr <= FV_LAST_C_REGNUM)
+ && reg_nr != FPSCR_C_REGNUM)
+ base_regnum = sh64_compact_reg_base_num (reg_nr);
+
+ /* Now return the offset in bytes within the register cache. */
+ /* sh media pseudo register, i.e. any of DR, FFP, FV registers. */
+ if (reg_nr >= DR0_REGNUM
+ && reg_nr <= FV_LAST_REGNUM)
+ return (base_regnum - FP0_REGNUM + 1) * 4
+ + (TR7_REGNUM + 1) * 8;
+
+ /* sh compact pseudo register: general register */
+ if ((reg_nr >= R0_C_REGNUM
+ && reg_nr <= R_LAST_C_REGNUM))
+ return (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
+ ? base_regnum * 8 + 4
+ : base_regnum * 8);
+
+ /* sh compact pseudo register: */
+ if (reg_nr == PC_C_REGNUM
+ || reg_nr == GBR_C_REGNUM
+ || reg_nr == MACL_C_REGNUM
+ || reg_nr == PR_C_REGNUM)
+ return (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
+ ? base_regnum * 8 + 4
+ : base_regnum * 8);
+
+ if (reg_nr == MACH_C_REGNUM)
+ return base_regnum * 8;
+
+ if (reg_nr == T_C_REGNUM)
+ return base_regnum * 8; /* FIXME??? how do we get bit 0? Do we have to? */
+
+ /* sh compact pseudo register: floating point register */
+ else if (reg_nr >= FP0_C_REGNUM
+ && reg_nr <= FV_LAST_C_REGNUM)
+ return (base_regnum - FP0_REGNUM) * 4
+ + (TR7_REGNUM + 1) * 8 + 4;
+
+ else if (reg_nr == FPSCR_C_REGNUM)
+ /* This is complicated, for now return the beginning of the
+ architectural FPSCR register. */
+ return (TR7_REGNUM + 1) * 8;
+
+ else if (reg_nr == FPUL_C_REGNUM)
+ return ((base_regnum - FP0_REGNUM) * 4 +
+ (TR7_REGNUM + 1) * 8 + 4);
+
+ /* It is not a pseudo register. */
+ /* It is a 64 bit register. */
+ else if (reg_nr <= TR7_REGNUM)
+ return reg_nr * 8;
+
+ /* It is a 32 bit register. */
+ else if (reg_nr == FPSCR_REGNUM)
+ return (FPSCR_REGNUM * 8);
+
+ /* It is floating point 32-bit register */
+ else
+ return ((TR7_REGNUM + 1) * 8
+ + (reg_nr - FP0_REGNUM + 1) * 4);
+}
+
+static int
+sh_sh64_register_raw_size (int reg_nr)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if ((reg_nr >= DR0_REGNUM
+ && reg_nr <= DR_LAST_REGNUM)
+ || (reg_nr >= FPP0_REGNUM
+ && reg_nr <= FPP_LAST_REGNUM)
+ || (reg_nr >= DR0_C_REGNUM
+ && reg_nr <= DR_LAST_C_REGNUM)
+ || (reg_nr <= TR7_REGNUM))
+ return 8;
+
+ else if ((reg_nr >= FV0_REGNUM
+ && reg_nr <= FV_LAST_REGNUM)
+ || (reg_nr >= FV0_C_REGNUM
+ && reg_nr <= FV_LAST_C_REGNUM))
+ return 16;
+
+ else /* this covers also the 32-bit SH compact registers. */
+ return 4;
+}
+
+/* ??????? FIXME */
+static int
+sh_sh64_register_virtual_size (int reg_nr)
+{
+ if (reg_nr >= FP0_REGNUM
+ && reg_nr <= FP_LAST_REGNUM)
+ return 4;
+ else
+ return 8;
+}
+
+static struct type *
+sh_sh64_build_float_register_type (int high)
+{
+ struct type *temp;
+
+ temp = create_range_type (NULL, builtin_type_int, 0, high);
+ return create_array_type (NULL, builtin_type_float, temp);
+}
+
+static struct type *
+sh_sh64_register_virtual_type (int reg_nr)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if ((reg_nr >= FP0_REGNUM
+ && reg_nr <= FP_LAST_REGNUM)
+ || (reg_nr >= FP0_C_REGNUM
+ && reg_nr <= FP_LAST_C_REGNUM))
+ return builtin_type_float;
+ else if ((reg_nr >= DR0_REGNUM
+ && reg_nr <= DR_LAST_REGNUM)
+ || (reg_nr >= DR0_C_REGNUM
+ && reg_nr <= DR_LAST_C_REGNUM))
+ return builtin_type_double;
+ else if (reg_nr >= FPP0_REGNUM
+ && reg_nr <= FPP_LAST_REGNUM)
+ return sh_sh64_build_float_register_type (1);
+ else if ((reg_nr >= FV0_REGNUM
+ && reg_nr <= FV_LAST_REGNUM)
+ ||(reg_nr >= FV0_C_REGNUM
+ && reg_nr <= FV_LAST_C_REGNUM))
+ return sh_sh64_build_float_register_type (3);
+ else if (reg_nr == FPSCR_REGNUM)
+ return builtin_type_int;
+ else if (reg_nr >= R0_C_REGNUM
+ && reg_nr < FP0_C_REGNUM)
+ return builtin_type_int;
+ else
+ return builtin_type_long_long;
+}
+
+static void
+sh_sh64_register_convert_to_virtual (int regnum, struct type *type,
+ char *from, char *to)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (TARGET_BYTE_ORDER != BFD_ENDIAN_LITTLE)
+ {
+ /* It is a no-op. */
+ memcpy (to, from, REGISTER_RAW_SIZE (regnum));
+ return;
+ }
+
+ if ((regnum >= DR0_REGNUM
+ && regnum <= DR_LAST_REGNUM)
+ || (regnum >= DR0_C_REGNUM
+ && regnum <= DR_LAST_C_REGNUM))
+ {
+ DOUBLEST val;
+ floatformat_to_doublest (&floatformat_ieee_double_littlebyte_bigword, from, &val);
+ deprecated_store_floating(to, TYPE_LENGTH(type), val);
+ }
+ else
+ error("sh_register_convert_to_virtual called with non DR register number");
+}
+
+static void
+sh_sh64_register_convert_to_raw (struct type *type, int regnum,
+ const void *from, void *to)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (TARGET_BYTE_ORDER != BFD_ENDIAN_LITTLE)
+ {
+ /* It is a no-op. */
+ memcpy (to, from, REGISTER_RAW_SIZE (regnum));
+ return;
+ }
+
+ if ((regnum >= DR0_REGNUM
+ && regnum <= DR_LAST_REGNUM)
+ || (regnum >= DR0_C_REGNUM
+ && regnum <= DR_LAST_C_REGNUM))
+ {
+ DOUBLEST val = deprecated_extract_floating (from, TYPE_LENGTH(type));
+ floatformat_from_doublest (&floatformat_ieee_double_littlebyte_bigword, &val, to);
+ }
+ else
+ error("sh_register_convert_to_raw called with non DR register number");
+}
+
+static void
+sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+ int reg_nr, void *buffer)
+{
+ int base_regnum;
+ int portion;
+ int offset = 0;
+ char temp_buffer[MAX_REGISTER_SIZE];
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (reg_nr >= DR0_REGNUM
+ && reg_nr <= DR_LAST_REGNUM)
+ {
+ base_regnum = dr_reg_base_num (reg_nr);
+
+ /* Build the value in the provided buffer. */
+ /* DR regs are double precision registers obtained by
+ concatenating 2 single precision floating point registers. */
+ for (portion = 0; portion < 2; portion++)
+ regcache_raw_read (regcache, base_regnum + portion,
+ (temp_buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
+
+ /* We must pay attention to the endiannes. */
+ sh_sh64_register_convert_to_virtual (reg_nr, REGISTER_VIRTUAL_TYPE (reg_nr),
+ temp_buffer, buffer);
+
+ }
+
+ else if (reg_nr >= FPP0_REGNUM
+ && reg_nr <= FPP_LAST_REGNUM)
+ {
+ base_regnum = fpp_reg_base_num (reg_nr);
+
+ /* Build the value in the provided buffer. */
+ /* FPP regs are pairs of single precision registers obtained by
+ concatenating 2 single precision floating point registers. */
+ for (portion = 0; portion < 2; portion++)
+ regcache_raw_read (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
+ }
+
+ else if (reg_nr >= FV0_REGNUM
+ && reg_nr <= FV_LAST_REGNUM)
+ {
+ base_regnum = fv_reg_base_num (reg_nr);
+
+ /* Build the value in the provided buffer. */
+ /* FV regs are vectors of single precision registers obtained by
+ concatenating 4 single precision floating point registers. */
+ for (portion = 0; portion < 4; portion++)
+ regcache_raw_read (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
+ }
+
+ /* sh compact pseudo registers. 1-to-1 with a shmedia register */
+ else if (reg_nr >= R0_C_REGNUM
+ && reg_nr <= T_C_REGNUM)
+ {
+ base_regnum = sh64_compact_reg_base_num (reg_nr);
+
+ /* Build the value in the provided buffer. */
+ regcache_raw_read (regcache, base_regnum, temp_buffer);
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ offset = 4;
+ memcpy (buffer, temp_buffer + offset, 4); /* get LOWER 32 bits only????*/
+ }
+
+ else if (reg_nr >= FP0_C_REGNUM
+ && reg_nr <= FP_LAST_C_REGNUM)
+ {
+ base_regnum = sh64_compact_reg_base_num (reg_nr);
+
+ /* Build the value in the provided buffer. */
+ /* Floating point registers map 1-1 to the media fp regs,
+ they have the same size and endienness. */
+ regcache_raw_read (regcache, base_regnum, buffer);
+ }
+
+ else if (reg_nr >= DR0_C_REGNUM
+ && reg_nr <= DR_LAST_C_REGNUM)
+ {
+ base_regnum = sh64_compact_reg_base_num (reg_nr);
+
+ /* DR_C regs are double precision registers obtained by
+ concatenating 2 single precision floating point registers. */
+ for (portion = 0; portion < 2; portion++)
+ regcache_raw_read (regcache, base_regnum + portion,
+ (temp_buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
+
+ /* We must pay attention to the endiannes. */
+ sh_sh64_register_convert_to_virtual (reg_nr, REGISTER_VIRTUAL_TYPE (reg_nr),
+ temp_buffer, buffer);
+ }
+
+ else if (reg_nr >= FV0_C_REGNUM
+ && reg_nr <= FV_LAST_C_REGNUM)
+ {
+ base_regnum = sh64_compact_reg_base_num (reg_nr);
+
+ /* Build the value in the provided buffer. */
+ /* FV_C regs are vectors of single precision registers obtained by
+ concatenating 4 single precision floating point registers. */
+ for (portion = 0; portion < 4; portion++)
+ regcache_raw_read (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
+ }
+
+ else if (reg_nr == FPSCR_C_REGNUM)
+ {
+ int fpscr_base_regnum;
+ int sr_base_regnum;
+ unsigned int fpscr_value;
+ unsigned int sr_value;
+ unsigned int fpscr_c_value;
+ unsigned int fpscr_c_part1_value;
+ unsigned int fpscr_c_part2_value;
+
+ fpscr_base_regnum = FPSCR_REGNUM;
+ sr_base_regnum = SR_REGNUM;
+
+ /* Build the value in the provided buffer. */
+ /* FPSCR_C is a very weird register that contains sparse bits
+ from the FPSCR and the SR architectural registers.
+ Specifically: */
+ /* *INDENT-OFF* */
+ /*
+ FPSRC_C bit
+ 0 Bit 0 of FPSCR
+ 1 reserved
+ 2-17 Bit 2-18 of FPSCR
+ 18-20 Bits 12,13,14 of SR
+ 21-31 reserved
+ */
+ /* *INDENT-ON* */
+ /* Get FPSCR into a local buffer */
+ regcache_raw_read (regcache, fpscr_base_regnum, temp_buffer);
+ /* Get value as an int. */
+ fpscr_value = extract_unsigned_integer (temp_buffer, 4);
+ /* Get SR into a local buffer */
+ regcache_raw_read (regcache, sr_base_regnum, temp_buffer);
+ /* Get value as an int. */
+ sr_value = extract_unsigned_integer (temp_buffer, 4);
+ /* Build the new value. */
+ fpscr_c_part1_value = fpscr_value & 0x3fffd;
+ fpscr_c_part2_value = (sr_value & 0x7000) << 6;
+ fpscr_c_value = fpscr_c_part1_value | fpscr_c_part2_value;
+ /* Store that in out buffer!!! */
+ store_unsigned_integer (buffer, 4, fpscr_c_value);
+ /* FIXME There is surely an endianness gotcha here. */
+ }
+
+ else if (reg_nr == FPUL_C_REGNUM)
+ {
+ base_regnum = sh64_compact_reg_base_num (reg_nr);
+
+ /* FPUL_C register is floating point register 32,
+ same size, same endianness. */
+ regcache_raw_read (regcache, base_regnum, buffer);
+ }
+}
+
+static void
+sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
+ int reg_nr, const void *buffer)
+{
+ int base_regnum, portion;
+ int offset;
+ char temp_buffer[MAX_REGISTER_SIZE];
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (reg_nr >= DR0_REGNUM
+ && reg_nr <= DR_LAST_REGNUM)
+ {
+ base_regnum = dr_reg_base_num (reg_nr);
+ /* We must pay attention to the endiannes. */
+ sh_sh64_register_convert_to_raw (REGISTER_VIRTUAL_TYPE (reg_nr), reg_nr,
+ buffer, temp_buffer);
+
+
+ /* Write the real regs for which this one is an alias. */
+ for (portion = 0; portion < 2; portion++)
+ regcache_raw_write (regcache, base_regnum + portion,
+ (temp_buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
+ }
+
+ else if (reg_nr >= FPP0_REGNUM
+ && reg_nr <= FPP_LAST_REGNUM)
+ {
+ base_regnum = fpp_reg_base_num (reg_nr);
+
+ /* Write the real regs for which this one is an alias. */
+ for (portion = 0; portion < 2; portion++)
+ regcache_raw_write (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
+ }
+
+ else if (reg_nr >= FV0_REGNUM
+ && reg_nr <= FV_LAST_REGNUM)
+ {
+ base_regnum = fv_reg_base_num (reg_nr);
+
+ /* Write the real regs for which this one is an alias. */
+ for (portion = 0; portion < 4; portion++)
+ regcache_raw_write (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
+ }
+
+ /* sh compact general pseudo registers. 1-to-1 with a shmedia
+ register but only 4 bytes of it. */
+ else if (reg_nr >= R0_C_REGNUM
+ && reg_nr <= T_C_REGNUM)
+ {
+ base_regnum = sh64_compact_reg_base_num (reg_nr);
+ /* reg_nr is 32 bit here, and base_regnum is 64 bits. */
+ if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ offset = 4;
+ else
+ offset = 0;
+ /* Let's read the value of the base register into a temporary
+ buffer, so that overwriting the last four bytes with the new
+ value of the pseudo will leave the upper 4 bytes unchanged. */
+ regcache_raw_read (regcache, base_regnum, temp_buffer);
+ /* Write as an 8 byte quantity */
+ memcpy (temp_buffer + offset, buffer, 4);
+ regcache_raw_write (regcache, base_regnum, temp_buffer);
+ }
+
+ /* sh floating point compact pseudo registers. 1-to-1 with a shmedia
+ registers. Both are 4 bytes. */
+ else if (reg_nr >= FP0_C_REGNUM
+ && reg_nr <= FP_LAST_C_REGNUM)
+ {
+ base_regnum = sh64_compact_reg_base_num (reg_nr);
+ regcache_raw_write (regcache, base_regnum, buffer);
+ }
+
+ else if (reg_nr >= DR0_C_REGNUM
+ && reg_nr <= DR_LAST_C_REGNUM)
+ {
+ base_regnum = sh64_compact_reg_base_num (reg_nr);
+ for (portion = 0; portion < 2; portion++)
+ {
+ /* We must pay attention to the endiannes. */
+ sh_sh64_register_convert_to_raw (REGISTER_VIRTUAL_TYPE (reg_nr), reg_nr,
+ buffer, temp_buffer);
+
+ regcache_raw_write (regcache, base_regnum + portion,
+ (temp_buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
+ }
+ }
+
+ else if (reg_nr >= FV0_C_REGNUM
+ && reg_nr <= FV_LAST_C_REGNUM)
+ {
+ base_regnum = sh64_compact_reg_base_num (reg_nr);
+
+ for (portion = 0; portion < 4; portion++)
+ {
+ regcache_raw_write (regcache, base_regnum + portion,
+ ((char *) buffer
+ + REGISTER_RAW_SIZE (base_regnum) * portion));
+ }
+ }
+
+ else if (reg_nr == FPSCR_C_REGNUM)
+ {
+ int fpscr_base_regnum;
+ int sr_base_regnum;
+ unsigned int fpscr_value;
+ unsigned int sr_value;
+ unsigned int old_fpscr_value;
+ unsigned int old_sr_value;
+ unsigned int fpscr_c_value;
+ unsigned int fpscr_mask;
+ unsigned int sr_mask;
+
+ fpscr_base_regnum = FPSCR_REGNUM;
+ sr_base_regnum = SR_REGNUM;
+
+ /* FPSCR_C is a very weird register that contains sparse bits
+ from the FPSCR and the SR architectural registers.
+ Specifically: */
+ /* *INDENT-OFF* */
+ /*
+ FPSRC_C bit
+ 0 Bit 0 of FPSCR
+ 1 reserved
+ 2-17 Bit 2-18 of FPSCR
+ 18-20 Bits 12,13,14 of SR
+ 21-31 reserved
+ */
+ /* *INDENT-ON* */
+ /* Get value as an int. */
+ fpscr_c_value = extract_unsigned_integer (buffer, 4);
+
+ /* Build the new values. */
+ fpscr_mask = 0x0003fffd;
+ sr_mask = 0x001c0000;
+
+ fpscr_value = fpscr_c_value & fpscr_mask;
+ sr_value = (fpscr_value & sr_mask) >> 6;
+
+ regcache_raw_read (regcache, fpscr_base_regnum, temp_buffer);
+ old_fpscr_value = extract_unsigned_integer (temp_buffer, 4);
+ old_fpscr_value &= 0xfffc0002;
+ fpscr_value |= old_fpscr_value;
+ store_unsigned_integer (temp_buffer, 4, fpscr_value);
+ regcache_raw_write (regcache, fpscr_base_regnum, temp_buffer);
+
+ regcache_raw_read (regcache, sr_base_regnum, temp_buffer);
+ old_sr_value = extract_unsigned_integer (temp_buffer, 4);
+ old_sr_value &= 0xffff8fff;
+ sr_value |= old_sr_value;
+ store_unsigned_integer (temp_buffer, 4, sr_value);
+ regcache_raw_write (regcache, sr_base_regnum, temp_buffer);
+ }
+
+ else if (reg_nr == FPUL_C_REGNUM)
+ {
+ base_regnum = sh64_compact_reg_base_num (reg_nr);
+ regcache_raw_write (regcache, base_regnum, buffer);
+ }
+}
+
+/* Floating point vector of 4 float registers. */
+static void
+do_fv_register_info (struct gdbarch *gdbarch, struct ui_file *file,
+ int fv_regnum)
+{
+ int first_fp_reg_num = fv_reg_base_num (fv_regnum);
+ fprintf_filtered (file, "fv%d\t0x%08x\t0x%08x\t0x%08x\t0x%08x\n",
+ fv_regnum - FV0_REGNUM,
+ (int) read_register (first_fp_reg_num),
+ (int) read_register (first_fp_reg_num + 1),
+ (int) read_register (first_fp_reg_num + 2),
+ (int) read_register (first_fp_reg_num + 3));
+}
+
+/* Floating point vector of 4 float registers, compact mode. */
+static void
+do_fv_c_register_info (int fv_regnum)
+{
+ int first_fp_reg_num = sh64_compact_reg_base_num (fv_regnum);
+ printf_filtered ("fv%d_c\t0x%08x\t0x%08x\t0x%08x\t0x%08x\n",
+ fv_regnum - FV0_C_REGNUM,
+ (int) read_register (first_fp_reg_num),
+ (int) read_register (first_fp_reg_num + 1),
+ (int) read_register (first_fp_reg_num + 2),
+ (int) read_register (first_fp_reg_num + 3));
+}
+
+/* Pairs of single regs. The DR are instead double precision
+ registers. */
+static void
+do_fpp_register_info (int fpp_regnum)
+{
+ int first_fp_reg_num = fpp_reg_base_num (fpp_regnum);
+
+ printf_filtered ("fpp%d\t0x%08x\t0x%08x\n",
+ fpp_regnum - FPP0_REGNUM,
+ (int) read_register (first_fp_reg_num),
+ (int) read_register (first_fp_reg_num + 1));
+}
+
+/* Double precision registers. */
+static void
+do_dr_register_info (struct gdbarch *gdbarch, struct ui_file *file,
+ int dr_regnum)
+{
+ int first_fp_reg_num = dr_reg_base_num (dr_regnum);
+
+ fprintf_filtered (file, "dr%d\t0x%08x%08x\n",
+ dr_regnum - DR0_REGNUM,
+ (int) read_register (first_fp_reg_num),
+ (int) read_register (first_fp_reg_num + 1));
+}
+
+/* Double precision registers, compact mode. */
+static void
+do_dr_c_register_info (int dr_regnum)
+{
+ int first_fp_reg_num = sh64_compact_reg_base_num (dr_regnum);
+
+ printf_filtered ("dr%d_c\t0x%08x%08x\n",
+ dr_regnum - DR0_C_REGNUM,
+ (int) read_register (first_fp_reg_num),
+ (int) read_register (first_fp_reg_num +1));
+}
+
+/* General register in compact mode. */
+static void
+do_r_c_register_info (int r_c_regnum)
+{
+ int regnum = sh64_compact_reg_base_num (r_c_regnum);
+
+ printf_filtered ("r%d_c\t0x%08x\n",
+ r_c_regnum - R0_C_REGNUM,
+ /*FIXME!!!*/ (int) read_register (regnum));
+}
+
+/* FIXME:!! THIS SHOULD TAKE CARE OF GETTING THE RIGHT PORTION OF THE
+ shmedia REGISTERS. */
+/* Control registers, compact mode. */
+static void
+do_cr_c_register_info (int cr_c_regnum)
+{
+ switch (cr_c_regnum)
+ {
+ case 237: printf_filtered ("pc_c\t0x%08x\n", (int) read_register (cr_c_regnum));
+ break;
+ case 238: printf_filtered ("gbr_c\t0x%08x\n", (int) read_register (cr_c_regnum));
+ break;
+ case 239: printf_filtered ("mach_c\t0x%08x\n", (int) read_register (cr_c_regnum));
+ break;
+ case 240: printf_filtered ("macl_c\t0x%08x\n", (int) read_register (cr_c_regnum));
+ break;
+ case 241: printf_filtered ("pr_c\t0x%08x\n", (int) read_register (cr_c_regnum));
+ break;
+ case 242: printf_filtered ("t_c\t0x%08x\n", (int) read_register (cr_c_regnum));
+ break;
+ case 243: printf_filtered ("fpscr_c\t0x%08x\n", (int) read_register (cr_c_regnum));
+ break;
+ case 244: printf_filtered ("fpul_c\t0x%08x\n", (int)read_register (cr_c_regnum));
+ break;
+ }
+}
+
+static void
+sh_do_fp_register (struct gdbarch *gdbarch, struct ui_file *file, int regnum)
+{ /* do values for FP (float) regs */
+ char *raw_buffer;
+ double flt; /* double extracted from raw hex data */
+ int inv;
+ int j;
+
+ /* Allocate space for the float. */
+ raw_buffer = (char *) alloca (register_size (gdbarch, FP0_REGNUM));
+
+ /* Get the data in raw format. */
+ if (!frame_register_read (get_selected_frame (), regnum, raw_buffer))
+ error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum));
+
+ /* Get the register as a number */
+ flt = unpack_double (builtin_type_float, raw_buffer, &inv);
+
+ /* Print the name and some spaces. */
+ fputs_filtered (REGISTER_NAME (regnum), file);
+ print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), file);
+
+ /* Print the value. */
+ if (inv)
+ fprintf_filtered (file, "<invalid float>");
+ else
+ fprintf_filtered (file, "%-10.9g", flt);
+
+ /* Print the fp register as hex. */
+ fprintf_filtered (file, "\t(raw 0x");
+ for (j = 0; j < register_size (gdbarch, regnum); j++)
+ {
+ int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
+ : register_size (gdbarch, regnum) - 1 - j;
+ fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]);
+ }
+ fprintf_filtered (file, ")");
+ fprintf_filtered (file, "\n");
+}
+
+static void
+sh64_do_pseudo_register (int regnum)
+{
+ /* All the sh64-compact mode registers are pseudo registers. */
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (regnum < NUM_REGS
+ || regnum >= NUM_REGS + NUM_PSEUDO_REGS_SH_MEDIA + NUM_PSEUDO_REGS_SH_COMPACT)
+ internal_error (__FILE__, __LINE__,
+ "Invalid pseudo register number %d\n", regnum);
+
+ else if ((regnum >= DR0_REGNUM
+ && regnum <= DR_LAST_REGNUM))
+ do_dr_register_info (current_gdbarch, gdb_stdout, regnum);
+
+ else if ((regnum >= DR0_C_REGNUM
+ && regnum <= DR_LAST_C_REGNUM))
+ do_dr_c_register_info (regnum);
+
+ else if ((regnum >= FV0_REGNUM
+ && regnum <= FV_LAST_REGNUM))
+ do_fv_register_info (current_gdbarch, gdb_stdout, regnum);
+
+ else if ((regnum >= FV0_C_REGNUM
+ && regnum <= FV_LAST_C_REGNUM))
+ do_fv_c_register_info (regnum);
+
+ else if (regnum >= FPP0_REGNUM
+ && regnum <= FPP_LAST_REGNUM)
+ do_fpp_register_info (regnum);
+
+ else if (regnum >= R0_C_REGNUM
+ && regnum <= R_LAST_C_REGNUM)
+ do_r_c_register_info (regnum); /* FIXME, this function will not print the right format */
+
+ else if (regnum >= FP0_C_REGNUM
+ && regnum <= FP_LAST_C_REGNUM)
+ sh_do_fp_register (current_gdbarch, gdb_stdout, regnum); /* this should work also for pseudoregs */
+
+ else if (regnum >= PC_C_REGNUM
+ && regnum <= FPUL_C_REGNUM)
+ do_cr_c_register_info (regnum);
+
+}
+
+static void
+sh_do_register (struct gdbarch *gdbarch, struct ui_file *file, int regnum)
+{
+ char raw_buffer[MAX_REGISTER_SIZE];
+
+ fputs_filtered (REGISTER_NAME (regnum), file);
+ print_spaces_filtered (15 - strlen (REGISTER_NAME (regnum)), file);
+
+ /* Get the data in raw format. */
+ if (!frame_register_read (get_selected_frame (), regnum, raw_buffer))
+ fprintf_filtered (file, "*value not available*\n");
+
+ val_print (gdbarch_register_type (gdbarch, regnum), raw_buffer, 0, 0,
+ file, 'x', 1, 0, Val_pretty_default);
+ fprintf_filtered (file, "\t");
+ val_print (gdbarch_register_type (gdbarch, regnum), raw_buffer, 0, 0,
+ file, 0, 1, 0, Val_pretty_default);
+ fprintf_filtered (file, "\n");
+}
+
+static void
+sh_print_register (struct gdbarch *gdbarch, struct ui_file *file, int regnum)
+{
+ if (regnum < 0 || regnum >= NUM_REGS + NUM_PSEUDO_REGS)
+ internal_error (__FILE__, __LINE__,
+ "Invalid register number %d\n", regnum);
+
+ else if (regnum >= 0 && regnum < NUM_REGS)
+ {
+ if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
+ sh_do_fp_register (gdbarch, file, regnum); /* FP regs */
+ else
+ sh_do_register (gdbarch, file, regnum); /* All other regs */
+ }
+
+ else if (regnum < NUM_REGS + NUM_PSEUDO_REGS)
+ sh64_do_pseudo_register (regnum);
+}
+
+static void
+sh_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, int regnum, int fpregs)
+{
+ if (regnum != -1) /* do one specified register */
+ {
+ if (*(REGISTER_NAME (regnum)) == '\0')
+ error ("Not a valid register for the current processor type");
+
+ sh_print_register (gdbarch, file, regnum);
+ }
+ else
+ /* do all (or most) registers */
+ {
+ regnum = 0;
+ while (regnum < NUM_REGS)
+ {
+ /* If the register name is empty, it is undefined for this
+ processor, so don't display anything. */
+ if (REGISTER_NAME (regnum) == NULL
+ || *(REGISTER_NAME (regnum)) == '\0')
+ {
+ regnum++;
+ continue;
+ }
+
+ if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
+ {
+ if (fpregs)
+ {
+ /* true for "INFO ALL-REGISTERS" command */
+ sh_do_fp_register (gdbarch, file, regnum); /* FP regs */
+ regnum ++;
+ }
+ else
+ regnum += FP_LAST_REGNUM - FP0_REGNUM; /* skip FP regs */
+ }
+ else
+ {
+ sh_do_register (gdbarch, file, regnum); /* All other regs */
+ regnum++;
+ }
+ }
+
+ if (fpregs)
+ while (regnum < NUM_REGS + NUM_PSEUDO_REGS)
+ {
+ sh64_do_pseudo_register (regnum);
+ regnum++;
+ }
+ }
+}
+
+static void
+sh_compact_do_registers_info (int regnum, int fpregs)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+ if (regnum != -1) /* do one specified register */
+ {
+ if (*(REGISTER_NAME (regnum)) == '\0')
+ error ("Not a valid register for the current processor type");
+
+ if (regnum >= 0 && regnum < R0_C_REGNUM)
+ error ("Not a valid register for the current processor mode.");
+
+ sh_print_register (current_gdbarch, gdb_stdout, regnum);
+ }
+ else
+ /* do all compact registers */
+ {
+ regnum = R0_C_REGNUM;
+ while (regnum < NUM_REGS + NUM_PSEUDO_REGS)
+ {
+ sh64_do_pseudo_register (regnum);
+ regnum++;
+ }
+ }
+}
+
+static void
+sh64_do_registers_info (int regnum, int fpregs)
+{
+ if (pc_is_isa32 (get_frame_pc (deprecated_selected_frame)))
+ sh_print_registers_info (current_gdbarch, gdb_stdout,
+ deprecated_selected_frame, regnum, fpregs);
+ else
+ sh_compact_do_registers_info (regnum, fpregs);
+}
+
+#ifdef SVR4_SHARED_LIBS
+
+/* Fetch (and possibly build) an appropriate link_map_offsets structure
+ for native i386 linux targets using the struct offsets defined in
+ link.h (but without actual reference to that file).
+
+ This makes it possible to access i386-linux shared libraries from
+ a gdb that was not built on an i386-linux host (for cross debugging).
+ */
+
+struct link_map_offsets *
+sh_linux_svr4_fetch_link_map_offsets (void)
+{
+ static struct link_map_offsets lmo;
+ static struct link_map_offsets *lmp = 0;
+
+ if (lmp == 0)
+ {
+ lmp = &lmo;
+
+ lmo.r_debug_size = 8; /* 20 not actual size but all we need */
+
+ lmo.r_map_offset = 4;
+ lmo.r_map_size = 4;
+
+ lmo.link_map_size = 20; /* 552 not actual size but all we need */
+
+ lmo.l_addr_offset = 0;
+ lmo.l_addr_size = 4;
+
+ lmo.l_name_offset = 4;
+ lmo.l_name_size = 4;
+
+ lmo.l_next_offset = 12;
+ lmo.l_next_size = 4;
+
+ lmo.l_prev_offset = 16;
+ lmo.l_prev_size = 4;
+ }
+
+ return lmp;
+}
+#endif /* SVR4_SHARED_LIBS */
+
+gdbarch_init_ftype sh64_gdbarch_init;
+
+struct gdbarch *
+sh64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ static LONGEST sh64_call_dummy_words[] = {0};
+ struct gdbarch *gdbarch;
+ struct gdbarch_tdep *tdep;
+
+ /* If there is already a candidate, use it. */
+ arches = gdbarch_list_lookup_by_info (arches, &info);
+ if (arches != NULL)
+ return arches->gdbarch;
+
+ /* None found, create a new architecture from the information
+ provided. */
+ tdep = XMALLOC (struct gdbarch_tdep);
+ gdbarch = gdbarch_alloc (&info, tdep);
+
+ /* NOTE: cagney/2002-12-06: This can be deleted when this arch is
+ ready to unwind the PC first (see frame.c:get_prev_frame()). */
+ set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_default);
+
+ /* Determine the ABI */
+ if (info.abfd && bfd_get_arch_size (info.abfd) == 64)
+ {
+ /* If the ABI is the 64-bit one, it can only be sh-media. */
+ tdep->sh_abi = SH_ABI_64;
+ set_gdbarch_ptr_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+ set_gdbarch_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+ }
+ else
+ {
+ /* If the ABI is the 32-bit one it could be either media or
+ compact. */
+ tdep->sh_abi = SH_ABI_32;
+ set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ }
+
+ set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+ set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+ set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+
+ set_gdbarch_sp_regnum (gdbarch, 15);
+ set_gdbarch_deprecated_fp_regnum (gdbarch, 14);
+
+ set_gdbarch_print_insn (gdbarch, gdb_print_insn_sh);
+ set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno);
+
+ set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
+
+ set_gdbarch_skip_prologue (gdbarch, sh_skip_prologue);
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+ set_gdbarch_decr_pc_after_break (gdbarch, 0);
+ set_gdbarch_function_start_offset (gdbarch, 0);
+
+ set_gdbarch_frame_args_skip (gdbarch, 0);
+ set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue);
+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
+
+ set_gdbarch_deprecated_frame_saved_pc (gdbarch, sh_frame_saved_pc);
+ set_gdbarch_deprecated_saved_pc_after_call (gdbarch, sh_saved_pc_after_call);
+ set_gdbarch_frame_align (gdbarch, sh_frame_align);
+
+ set_gdbarch_num_pseudo_regs (gdbarch, NUM_PSEUDO_REGS_SH_MEDIA + NUM_PSEUDO_REGS_SH_COMPACT);
+ set_gdbarch_fp0_regnum (gdbarch, SIM_SH64_FR0_REGNUM);
+ set_gdbarch_pc_regnum (gdbarch, 64);
+
+ /* the number of real registers is the same whether we are in
+ ISA16(compact) or ISA32(media). */
+ set_gdbarch_num_regs (gdbarch, SIM_SH64_NR_REGS);
+ set_gdbarch_deprecated_register_size (gdbarch, 8); /*????*/
+ set_gdbarch_deprecated_register_bytes (gdbarch,
+ ((SIM_SH64_NR_FP_REGS + 1) * 4)
+ + (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8);
+
+ set_gdbarch_register_name (gdbarch, sh_sh64_register_name);
+ set_gdbarch_deprecated_register_virtual_type (gdbarch, sh_sh64_register_virtual_type);
+ set_gdbarch_deprecated_store_return_value (gdbarch, sh64_store_return_value);
+ set_gdbarch_deprecated_register_raw_size (gdbarch, sh_sh64_register_raw_size);
+ set_gdbarch_deprecated_register_virtual_size (gdbarch, sh_sh64_register_raw_size);
+ set_gdbarch_deprecated_register_byte (gdbarch, sh_sh64_register_byte);
+ /* This seems awfully wrong!*/
+ /*set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);*/
+ /* should include the size of the pseudo regs. */
+ set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4 * 4);
+ /* Or should that go in the virtual_size? */
+ /*set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);*/
+ set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4 * 4);
+ set_gdbarch_pseudo_register_read (gdbarch, sh64_pseudo_register_read);
+ set_gdbarch_pseudo_register_write (gdbarch, sh64_pseudo_register_write);
+
+ set_gdbarch_deprecated_do_registers_info (gdbarch, sh64_do_registers_info);
+ set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh64_nofp_frame_init_saved_regs);
+ set_gdbarch_breakpoint_from_pc (gdbarch, sh_sh64_breakpoint_from_pc);
+ set_gdbarch_deprecated_call_dummy_words (gdbarch, sh64_call_dummy_words);
+ set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (sh64_call_dummy_words));
+
+ set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh64_init_extra_frame_info);
+ set_gdbarch_deprecated_frame_chain (gdbarch, sh64_frame_chain);
+ set_gdbarch_deprecated_get_saved_register (gdbarch, sh64_get_saved_register);
+ set_gdbarch_deprecated_extract_return_value (gdbarch, sh64_extract_return_value);
+ set_gdbarch_deprecated_push_arguments (gdbarch, sh64_push_arguments);
+ set_gdbarch_deprecated_push_return_address (gdbarch, sh64_push_return_address);
+ set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_deprecated_store_struct_return (gdbarch, sh64_store_struct_return);
+ set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh64_extract_struct_value_address);
+ set_gdbarch_use_struct_convention (gdbarch, sh64_use_struct_convention);
+ set_gdbarch_deprecated_pop_frame (gdbarch, sh64_pop_frame);
+ set_gdbarch_elf_make_msymbol_special (gdbarch,
+ sh64_elf_make_msymbol_special);
+
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch);
+
+ return gdbarch;
+}
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 3ae0b65187e..4689de65ef5 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -62,6 +62,8 @@
#include "regcache.h"
#include "symfile.h"
+#include "gdb_string.h"
+
extern struct target_ops sol_thread_ops; /* Forward declaration */
extern struct target_ops sol_core_ops; /* Forward declaration */
@@ -646,10 +648,10 @@ sol_thread_store_registers (int regno)
if (regno != -1)
{ /* Not writing all the regs */
- /* save new register value */
- char* old_value = (char*) alloca (DEPRECATED_REGISTER_SIZE);
- memcpy (old_value, &deprecated_registers[REGISTER_BYTE (regno)],
- DEPRECATED_REGISTER_SIZE);
+ char old_value[MAX_REGISTER_SIZE];
+
+ /* Save new register value. */
+ regcache_collect (regno, old_value);
val = p_td_thr_getgregs (&thandle, gregset);
if (val != TD_OK)
@@ -660,9 +662,8 @@ sol_thread_store_registers (int regno)
error ("sol_thread_store_registers: td_thr_getfpregs %s",
td_err_string (val));
- /* restore new register value */
- memcpy (&deprecated_registers[REGISTER_BYTE (regno)], old_value,
- DEPRECATED_REGISTER_SIZE);
+ /* Restore new register value. */
+ supply_register (regno, old_value);
#if 0
/* thread_db doesn't seem to handle this right */
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 5ff6ba63ac8..7fda5e4e020 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -177,7 +177,7 @@ static CORE_ADDR breakpoint_addr; /* Address where end bkpt is set */
static int match_main (char *);
-static CORE_ADDR bfd_lookup_symbol (bfd *, char *);
+static CORE_ADDR bfd_lookup_symbol (bfd *, char *, flagword);
/*
@@ -187,7 +187,7 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, char *);
SYNOPSIS
- CORE_ADDR bfd_lookup_symbol (bfd *abfd, char *symname)
+ CORE_ADDR bfd_lookup_symbol (bfd *abfd, char *symname, flagword sect_flags)
DESCRIPTION
@@ -196,12 +196,15 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, char *);
shared library support to find the address of the debugger
interface structures in the shared library.
+ If SECT_FLAGS is non-zero, only match symbols in sections whose
+ flags include all those in SECT_FLAGS.
+
Note that 0 is specifically allowed as an error return (no
such symbol).
*/
static CORE_ADDR
-bfd_lookup_symbol (bfd *abfd, char *symname)
+bfd_lookup_symbol (bfd *abfd, char *symname, flagword sect_flags)
{
long storage_needed;
asymbol *sym;
@@ -222,7 +225,8 @@ bfd_lookup_symbol (bfd *abfd, char *symname)
for (i = 0; i < number_of_symbols; i++)
{
sym = *symbol_table++;
- if (STREQ (sym->name, symname))
+ if (STREQ (sym->name, symname)
+ && (sym->section->flags & sect_flags) == sect_flags)
{
/* Bfd symbols are section relative. */
symaddr = sym->value + sym->section->vma;
@@ -249,7 +253,9 @@ bfd_lookup_symbol (bfd *abfd, char *symname)
for (i = 0; i < number_of_symbols; i++)
{
sym = *symbol_table++;
- if (STREQ (sym->name, symname))
+
+ if (STREQ (sym->name, symname)
+ && (sym->section->flags & sect_flags) == sect_flags)
{
/* Bfd symbols are section relative. */
symaddr = sym->value + sym->section->vma;
@@ -355,7 +361,7 @@ look_for_base (int fd, CORE_ADDR baseaddr)
for (symbolp = debug_base_symbols; *symbolp != NULL; symbolp++)
{
- address = bfd_lookup_symbol (interp_bfd, *symbolp);
+ address = bfd_lookup_symbol (interp_bfd, *symbolp, 0);
if (address != 0)
{
break;
@@ -1060,7 +1066,16 @@ enable_break (void)
/* Now try to set a breakpoint in the dynamic linker. */
for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++)
{
- sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep);
+ /* On ABI's that use function descriptors, there are usually
+ two linker symbols associated with each C function: one
+ pointing at the actual entry point of the machine code,
+ and one pointing at the function's descriptor. The
+ latter symbol has the same name as the C function.
+
+ What we're looking for here is the machine code entry
+ point, so we are only interested in symbols in code
+ sections. */
+ sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep, SEC_CODE);
if (sym_addr != 0)
break;
}
diff --git a/gdb/solib.c b/gdb/solib.c
index 82df65a6d0b..f77993c574e 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -338,7 +338,7 @@ free_so (struct so_list *so)
static int
symbol_add_stub (void *arg)
{
- register struct so_list *so = (struct so_list *) arg; /* catch_errs bogon */
+ struct so_list *so = (struct so_list *) arg; /* catch_errs bogon */
struct section_addr_info *sap;
/* Have we already loaded this shared object? */
@@ -627,7 +627,7 @@ solib_add (char *pattern, int from_tty, struct target_ops *target, int readsyms)
static void
info_sharedlibrary_command (char *ignore, int from_tty)
{
- register struct so_list *so = NULL; /* link map state variable */
+ struct so_list *so = NULL; /* link map state variable */
int header_done = 0;
int addr_width;
char *addr_fmt;
@@ -709,7 +709,7 @@ info_sharedlibrary_command (char *ignore, int from_tty)
char *
solib_address (CORE_ADDR address)
{
- register struct so_list *so = 0; /* link map state variable */
+ struct so_list *so = 0; /* link map state variable */
for (so = so_list_head; so; so = so->next)
{
diff --git a/gdb/somread.c b/gdb/somread.c
index e3df6e167a1..971fea25f73 100644
--- a/gdb/somread.c
+++ b/gdb/somread.c
@@ -477,9 +477,9 @@ init_import_symbols (struct objfile *objfile)
unsigned int string_table;
unsigned int string_table_size;
char *string_buffer;
- register int i;
- register int j;
- register int k;
+ int i;
+ int j;
+ int k;
asection *text_section; /* section handle */
unsigned int dl_header[12]; /* SOM executable header */
@@ -597,9 +597,9 @@ init_export_symbols (struct objfile *objfile)
unsigned int string_table;
unsigned int string_table_size;
char *string_buffer;
- register int i;
- register int j;
- register int k;
+ int i;
+ int j;
+ int k;
asection *text_section; /* section handle */
unsigned int dl_header[12]; /* SOM executable header */
diff --git a/gdb/somsolib.c b/gdb/somsolib.c
index c4967521669..ed54ad089ad 100644
--- a/gdb/somsolib.c
+++ b/gdb/somsolib.c
@@ -74,9 +74,6 @@ extern struct unwind_table_entry *find_unwind_entry (CORE_ADDR pc);
/* TODO:
- * Most of this code should work for hp300 shared libraries. Does
- anyone care enough to weed out any SOM-isms.
-
* Support for hpux8 dynamic linker. */
/* The basic structure which describes a dynamically loaded object. This
diff --git a/gdb/source.c b/gdb/source.c
index e3b48367708..e4e5caa9568 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -219,7 +219,7 @@ clear_current_source_symtab_and_line (void)
before we need to would make things slower than necessary. */
void
-select_source_symtab (register struct symtab *s)
+select_source_symtab (struct symtab *s)
{
struct symtabs_and_lines sals;
struct symtab_and_line sal;
@@ -317,8 +317,8 @@ show_directories (char *ignore, int from_tty)
void
forget_cached_source_info (void)
{
- register struct symtab *s;
- register struct objfile *objfile;
+ struct symtab *s;
+ struct objfile *objfile;
struct partial_symtab *pst;
for (objfile = object_files; objfile != NULL; objfile = objfile->next)
@@ -418,7 +418,7 @@ add_path (char *dirname, char **which_path, int parse_separators)
do
{
char *name = dirname;
- register char *p;
+ char *p;
struct stat st;
{
@@ -526,7 +526,7 @@ add_path (char *dirname, char **which_path, int parse_separators)
append:
{
- register unsigned int len = strlen (name);
+ unsigned int len = strlen (name);
p = *which_path;
while (1)
@@ -594,7 +594,7 @@ add_path (char *dirname, char **which_path, int parse_separators)
static void
source_info (char *ignore, int from_tty)
{
- register struct symtab *s = current_source_symtab;
+ struct symtab *s = current_source_symtab;
if (!s)
{
@@ -660,11 +660,11 @@ openp (const char *path, int try_cwd_first, const char *string,
int mode, int prot,
char **filename_opened)
{
- register int fd;
- register char *filename;
+ int fd;
+ char *filename;
const char *p;
const char *p1;
- register int len;
+ int len;
int alloclen;
if (!path)
@@ -907,7 +907,7 @@ void
find_source_lines (struct symtab *s, int desc)
{
struct stat st;
- register char *data, *p, *end;
+ char *data, *p, *end;
int nlines = 0;
int lines_allocated = 1000;
int *line_charpos;
@@ -1019,10 +1019,10 @@ source_line_charpos (struct symtab *s, int line)
/* Return the line number of character position POS in symtab S. */
int
-source_charpos_line (register struct symtab *s, register int chr)
+source_charpos_line (struct symtab *s, int chr)
{
- register int line = 0;
- register int *lnp;
+ int line = 0;
+ int *lnp;
if (s == 0 || s->line_charpos == 0)
return 0;
@@ -1049,7 +1049,7 @@ source_charpos_line (register struct symtab *s, register int chr)
static int
get_filename_and_charpos (struct symtab *s, char **fullname)
{
- register int desc, linenums_changed = 0;
+ int desc, linenums_changed = 0;
desc = open_source_file (s);
if (desc < 0)
@@ -1107,9 +1107,9 @@ static void print_source_lines_base (struct symtab *s, int line, int stopline,
static void
print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
{
- register int c;
- register int desc;
- register FILE *stream;
+ int c;
+ int desc;
+ FILE *stream;
int nlines = stopline - line;
/* Regardless of whether we can open the file, set current_source_symtab. */
@@ -1351,9 +1351,9 @@ line_info (char *arg, int from_tty)
static void
forward_search_command (char *regex, int from_tty)
{
- register int c;
- register int desc;
- register FILE *stream;
+ int c;
+ int desc;
+ FILE *stream;
int line;
char *msg;
@@ -1390,7 +1390,7 @@ forward_search_command (char *regex, int from_tty)
while (1)
{
static char *buf = NULL;
- register char *p;
+ char *p;
int cursize, newsize;
cursize = 256;
@@ -1447,9 +1447,9 @@ forward_search_command (char *regex, int from_tty)
static void
reverse_search_command (char *regex, int from_tty)
{
- register int c;
- register int desc;
- register FILE *stream;
+ int c;
+ int desc;
+ FILE *stream;
int line;
char *msg;
@@ -1487,7 +1487,7 @@ reverse_search_command (char *regex, int from_tty)
{
/* FIXME!!! We walk right off the end of buf if we get a long line!!! */
char buf[4096]; /* Should be reasonable??? */
- register char *p = buf;
+ char *p = buf;
c = getc (stream);
if (c == EOF)
diff --git a/gdb/sparc-linux-nat.c b/gdb/sparc-linux-nat.c
index 261ed6061cc..f43cb593b20 100644
--- a/gdb/sparc-linux-nat.c
+++ b/gdb/sparc-linux-nat.c
@@ -40,7 +40,7 @@ supply_gregset (elf_gregset_t *gregsetp)
supply_register (PS_REGNUM, (char *) (regp + 32));
supply_register (PC_REGNUM, (char *) (regp + 33));
- supply_register (NPC_REGNUM, (char *) (regp + 34));
+ supply_register (DEPRECATED_NPC_REGNUM, (char *) (regp + 34));
supply_register (Y_REGNUM, (char *) (regp + 35));
supply_register (WIM_REGNUM, (char *) (regp + 36));
@@ -65,8 +65,8 @@ fill_gregset (elf_gregset_t *gregsetp, int regno)
if (regno == -1 || regno == PC_REGNUM)
regcache_collect (PC_REGNUM, regp + 33);
- if (regno == -1 || regno == NPC_REGNUM)
- regcache_collect (NPC_REGNUM, regp + 34);
+ if (regno == -1 || regno == DEPRECATED_NPC_REGNUM)
+ regcache_collect (DEPRECATED_NPC_REGNUM, regp + 34);
if (regno == -1 || regno == Y_REGNUM)
regcache_collect (Y_REGNUM, regp + 35);
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index 540bbcc9e3b..a4df86507b7 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -101,23 +101,23 @@ fetch_inferior_registers (int regno)
(PTRACE_ARG3_TYPE) & inferior_registers, 0))
perror ("ptrace_getregs");
- deprecated_registers[REGISTER_BYTE (0)] = 0;
- memcpy (&deprecated_registers[REGISTER_BYTE (1)],
+ deprecated_registers[DEPRECATED_REGISTER_BYTE (0)] = 0;
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (1)],
&inferior_registers.r_g1, 15 * REGISTER_RAW_SIZE (G0_REGNUM));
- *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)]
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)]
= inferior_registers.r_ps;
- *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)]
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)]
= inferior_registers.r_pc;
- *(int *) &deprecated_registers[REGISTER_BYTE (NPC_REGNUM)]
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (DEPRECATED_NPC_REGNUM)]
= inferior_registers.r_npc;
- *(int *) &deprecated_registers[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
for (i = G0_REGNUM; i <= O7_REGNUM; i++)
deprecated_register_valid[i] = 1;
deprecated_register_valid[Y_REGNUM] = 1;
deprecated_register_valid[PS_REGNUM] = 1;
deprecated_register_valid[PC_REGNUM] = 1;
- deprecated_register_valid[NPC_REGNUM] = 1;
+ deprecated_register_valid[DEPRECATED_NPC_REGNUM] = 1;
/* If we don't set these valid, read_register_bytes() rereads
all the regs every time it is called! FIXME. */
deprecated_register_valid[WIM_REGNUM] = 1; /* Not true yet, FIXME */
@@ -134,9 +134,9 @@ fetch_inferior_registers (int regno)
(PTRACE_ARG3_TYPE) & inferior_fp_registers,
0))
perror ("ptrace_getfpregs");
- memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
&inferior_fp_registers, sizeof inferior_fp_registers.fpu_fr);
- memcpy (&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPS_REGNUM)],
&inferior_fp_registers.Fpu_fsr, sizeof (FPU_FSR_TYPE));
for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
deprecated_register_valid[i] = 1;
@@ -147,19 +147,19 @@ fetch_inferior_registers (int regno)
all (16 ptrace calls!) if we really need them. */
if (regno == -1)
{
- CORE_ADDR sp = *(unsigned int *) & deprecated_registers[REGISTER_BYTE (SP_REGNUM)];
- target_read_memory (sp, &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
+ CORE_ADDR sp = *(unsigned int *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (SP_REGNUM)];
+ target_read_memory (sp, &deprecated_registers[DEPRECATED_REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
for (i = L0_REGNUM; i <= I7_REGNUM; i++)
deprecated_register_valid[i] = 1;
}
else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
{
- CORE_ADDR sp = *(unsigned int *) & deprecated_registers[REGISTER_BYTE (SP_REGNUM)];
- i = REGISTER_BYTE (regno);
+ CORE_ADDR sp = *(unsigned int *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (SP_REGNUM)];
+ i = DEPRECATED_REGISTER_BYTE (regno);
if (deprecated_register_valid[regno])
printf_unfiltered ("register %d valid and read\n", regno);
- target_read_memory (sp + i - REGISTER_BYTE (L0_REGNUM),
+ target_read_memory (sp + i - DEPRECATED_REGISTER_BYTE (L0_REGNUM),
&deprecated_registers[i], REGISTER_RAW_SIZE (regno));
deprecated_register_valid[regno] = 1;
}
@@ -226,22 +226,22 @@ store_inferior_registers (int regno)
if (wanna_store & STACK_REGS)
{
- CORE_ADDR sp = *(unsigned int *) & deprecated_registers[REGISTER_BYTE (SP_REGNUM)];
+ CORE_ADDR sp = *(unsigned int *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (SP_REGNUM)];
if (regno < 0 || regno == SP_REGNUM)
{
if (!deprecated_register_valid[L0_REGNUM + 5])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
target_write_memory (sp,
- &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
}
else
{
if (!deprecated_register_valid[regno])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
- target_write_memory (sp + REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM),
- &deprecated_registers[REGISTER_BYTE (regno)],
+ target_write_memory (sp + DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (L0_REGNUM),
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
}
@@ -253,17 +253,17 @@ store_inferior_registers (int regno)
internal_error (__FILE__, __LINE__, "failed internal consistency check");
memcpy (&inferior_registers.r_g1,
- &deprecated_registers[REGISTER_BYTE (G1_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (G1_REGNUM)],
15 * REGISTER_RAW_SIZE (G1_REGNUM));
inferior_registers.r_ps =
- *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)];
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)];
inferior_registers.r_pc =
- *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)];
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)];
inferior_registers.r_npc =
- *(int *) &deprecated_registers[REGISTER_BYTE (NPC_REGNUM)];
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (DEPRECATED_NPC_REGNUM)];
inferior_registers.r_y =
- *(int *) &deprecated_registers[REGISTER_BYTE (Y_REGNUM)];
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (Y_REGNUM)];
if (0 != ptrace (PTRACE_SETREGS, store_pid,
(PTRACE_ARG3_TYPE) & inferior_registers, 0))
@@ -275,10 +275,10 @@ store_inferior_registers (int regno)
if (!deprecated_register_valid[FP0_REGNUM + 9])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
memcpy (&inferior_fp_registers,
- &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
sizeof inferior_fp_registers.fpu_fr);
memcpy (&inferior_fp_registers.Fpu_fsr,
- &deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (FPS_REGNUM)],
sizeof (FPU_FSR_TYPE));
if (0 !=
ptrace (PTRACE_SETFPREGS, store_pid,
@@ -311,15 +311,15 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
#define gregs ((struct regs *)core_reg_sect)
/* G0 *always* holds 0. */
- *(int *) &deprecated_registers[REGISTER_BYTE (0)] = 0;
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (0)] = 0;
/* The globals and output registers. */
- memcpy (&deprecated_registers[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1,
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1,
15 * REGISTER_RAW_SIZE (G1_REGNUM));
- *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
- *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
- *(int *) &deprecated_registers[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
- *(int *) &deprecated_registers[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (DEPRECATED_NPC_REGNUM)] = gregs->r_npc;
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
/* My best guess at where to get the locals and input
registers is exactly where they usually are, right above
@@ -329,9 +329,9 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
{
int sp;
- sp = *(int *) &deprecated_registers[REGISTER_BYTE (SP_REGNUM)];
+ sp = *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (SP_REGNUM)];
if (0 != target_read_memory (sp,
- &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM)))
{
/* fprintf_unfiltered so user can still use gdb */
@@ -348,9 +348,9 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
#define fpuregs ((struct fpu *) core_reg_sect)
if (core_reg_size >= sizeof (struct fpu))
{
- memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
fpuregs->fpu_regs, sizeof (fpuregs->fpu_regs));
- memcpy (&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPS_REGNUM)],
&fpuregs->fpu_fsr, sizeof (FPU_FSR_TYPE));
}
else
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index ef6368f69f6..3a81821881c 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -33,6 +33,7 @@
#include "gdb_string.h"
#include "regcache.h"
#include "osabi.h"
+#include "dis-asm.h"
#include "sparc-tdep.h"
@@ -51,8 +52,6 @@
* Some local macros that have multi-arch and non-multi-arch versions:
*/
-#if (GDB_MULTI_ARCH > 0)
-
#if 0
// OBSOLETE /* Does the target have Floating Point registers? */
// OBSOLETE #define SPARC_HAS_FPU (gdbarch_tdep (current_gdbarch)->has_fpu)
@@ -67,49 +66,6 @@
/* Offset within the call dummy stack of the saved registers. */
#define DUMMY_REG_SAVE_OFFSET (gdbarch_tdep (current_gdbarch)->reg_save_offset)
-#else /* non-multi-arch */
-
-
-/* Does the target have Floating Point registers? */
-#if 0
-// OBSOLETE #if defined(TARGET_SPARCLET) || defined(TARGET_SPARCLITE)
-// OBSOLETE #define SPARC_HAS_FPU 0
-// OBSOLETE #else
-// OBSOLETE #define SPARC_HAS_FPU 1
-// OBSOLETE #endif
-#endif
-#define SPARC_HAS_FPU 1
-
-/* Number of bytes devoted to Floating Point registers: */
-#if (GDB_TARGET_IS_SPARC64)
-#define FP_REGISTER_BYTES (64 * 4)
-#else
-#if (SPARC_HAS_FPU)
-#define FP_REGISTER_BYTES (32 * 4)
-#else
-#define FP_REGISTER_BYTES 0
-#endif
-#endif
-
-/* Highest numbered Floating Point register. */
-#if (GDB_TARGET_IS_SPARC64)
-#define FP_MAX_REGNUM (FP0_REGNUM + 48)
-#else
-#define FP_MAX_REGNUM (FP0_REGNUM + 32)
-#endif
-
-/* Size of a general (integer) register: */
-#define SPARC_INTREG_SIZE (REGISTER_RAW_SIZE (G0_REGNUM))
-
-/* Offset within the call dummy stack of the saved registers. */
-#if (GDB_TARGET_IS_SPARC64)
-#define DUMMY_REG_SAVE_OFFSET (128 + 16)
-#else
-#define DUMMY_REG_SAVE_OFFSET 0x60
-#endif
-
-#endif /* GDB_MULTI_ARCH */
-
struct gdbarch_tdep
{
#if 0
@@ -212,7 +168,7 @@ typedef enum
Beihl (beihl@mcc.com). */
/* npc4 and next_pc describe the situation at the time that the
- step-breakpoint was set, not necessary the current value of NPC_REGNUM. */
+ step-breakpoint was set, not necessary the current value of DEPRECATED_NPC_REGNUM. */
static CORE_ADDR next_pc, npc4, target;
static int brknpc4, brktrg;
typedef char binsn_quantum[BREAKPOINT_MAX];
@@ -239,7 +195,7 @@ sparc_software_single_step (enum target_signal ignore, /* pid, but we don't need
if (insert_breakpoints_p)
{
/* Always set breakpoint for NPC. */
- next_pc = read_register (NPC_REGNUM);
+ next_pc = read_register (DEPRECATED_NPC_REGNUM);
npc4 = next_pc + 4; /* branch not taken */
target_insert_breakpoint (next_pc, break_mem[0]);
@@ -980,7 +936,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
{
if (lval != NULL)
*lval = lval_register;
- addr = REGISTER_BYTE (regnum);
+ addr = DEPRECATED_REGISTER_BYTE (regnum);
if (raw_buffer != NULL)
deprecated_read_register_gen (regnum, raw_buffer);
}
@@ -1016,10 +972,10 @@ sparc_push_dummy_frame (void)
if (GDB_TARGET_IS_SPARC64)
{
/* PC, NPC, CCR, FSR, FPRS, Y, ASI */
- deprecated_read_register_bytes (REGISTER_BYTE (PC_REGNUM),
+ deprecated_read_register_bytes (DEPRECATED_REGISTER_BYTE (PC_REGNUM),
&register_temp[0],
REGISTER_RAW_SIZE (PC_REGNUM) * 7);
- deprecated_read_register_bytes (REGISTER_BYTE (PSTATE_REGNUM),
+ deprecated_read_register_bytes (DEPRECATED_REGISTER_BYTE (PSTATE_REGNUM),
&register_temp[7 * SPARC_INTREG_SIZE],
REGISTER_RAW_SIZE (PSTATE_REGNUM));
/* FIXME: not sure what needs to be saved here. */
@@ -1027,21 +983,21 @@ sparc_push_dummy_frame (void)
else
{
/* Y, PS, WIM, TBR, PC, NPC, FPS, CPS regs */
- deprecated_read_register_bytes (REGISTER_BYTE (Y_REGNUM),
+ deprecated_read_register_bytes (DEPRECATED_REGISTER_BYTE (Y_REGNUM),
&register_temp[0],
REGISTER_RAW_SIZE (Y_REGNUM) * 8);
}
- deprecated_read_register_bytes (REGISTER_BYTE (O0_REGNUM),
+ deprecated_read_register_bytes (DEPRECATED_REGISTER_BYTE (O0_REGNUM),
&register_temp[8 * SPARC_INTREG_SIZE],
SPARC_INTREG_SIZE * 8);
- deprecated_read_register_bytes (REGISTER_BYTE (G0_REGNUM),
+ deprecated_read_register_bytes (DEPRECATED_REGISTER_BYTE (G0_REGNUM),
&register_temp[16 * SPARC_INTREG_SIZE],
SPARC_INTREG_SIZE * 8);
if (SPARC_HAS_FPU)
- deprecated_read_register_bytes (REGISTER_BYTE (FP0_REGNUM),
+ deprecated_read_register_bytes (DEPRECATED_REGISTER_BYTE (FP0_REGNUM),
&register_temp[24 * SPARC_INTREG_SIZE],
FP_REGISTER_BYTES);
@@ -1137,7 +1093,7 @@ static void sparc_frame_find_saved_regs (struct frame_info *, CORE_ADDR *);
static void
sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr)
{
- register int regnum;
+ int regnum;
CORE_ADDR frame_addr = get_frame_base (fi);
gdb_assert (fi != NULL);
@@ -1254,8 +1210,8 @@ sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr)
void
sparc_pop_frame (void)
{
- register struct frame_info *frame = get_current_frame ();
- register CORE_ADDR pc;
+ struct frame_info *frame = get_current_frame ();
+ CORE_ADDR pc;
CORE_ADDR *fsr;
char *raw_buffer;
int regnum;
@@ -1268,7 +1224,7 @@ sparc_pop_frame (void)
if (fsr[FP0_REGNUM])
{
read_memory (fsr[FP0_REGNUM], raw_buffer, FP_REGISTER_BYTES);
- deprecated_write_register_bytes (REGISTER_BYTE (FP0_REGNUM),
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP0_REGNUM),
raw_buffer, FP_REGISTER_BYTES);
}
if (!(GDB_TARGET_IS_SPARC64))
@@ -1288,7 +1244,7 @@ sparc_pop_frame (void)
if (fsr[G1_REGNUM])
{
read_memory (fsr[G1_REGNUM], raw_buffer, 7 * SPARC_INTREG_SIZE);
- deprecated_write_register_bytes (REGISTER_BYTE (G1_REGNUM), raw_buffer,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (G1_REGNUM), raw_buffer,
7 * SPARC_INTREG_SIZE);
}
@@ -1341,10 +1297,10 @@ sparc_pop_frame (void)
/* Restore the out registers.
Among other things this writes the new stack pointer. */
- deprecated_write_register_bytes (REGISTER_BYTE (O0_REGNUM), raw_buffer,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (O0_REGNUM), raw_buffer,
SPARC_INTREG_SIZE * 8);
- deprecated_write_register_bytes (REGISTER_BYTE (L0_REGNUM), reg_temp,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (L0_REGNUM), reg_temp,
SPARC_INTREG_SIZE * 16);
}
@@ -1364,10 +1320,10 @@ sparc_pop_frame (void)
write_register (PC_REGNUM,
read_memory_integer (fsr[PC_REGNUM],
REGISTER_RAW_SIZE (PC_REGNUM)));
- if (fsr[NPC_REGNUM])
- write_register (NPC_REGNUM,
- read_memory_integer (fsr[NPC_REGNUM],
- REGISTER_RAW_SIZE (NPC_REGNUM)));
+ if (fsr[DEPRECATED_NPC_REGNUM])
+ write_register (DEPRECATED_NPC_REGNUM,
+ read_memory_integer (fsr[DEPRECATED_NPC_REGNUM],
+ REGISTER_RAW_SIZE (DEPRECATED_NPC_REGNUM)));
}
else if (get_frame_extra_info (frame)->flat)
{
@@ -1386,7 +1342,7 @@ sparc_pop_frame (void)
}
write_register (PC_REGNUM, pc);
- write_register (NPC_REGNUM, pc + 4);
+ write_register (DEPRECATED_NPC_REGNUM, pc + 4);
}
else if (fsr[I7_REGNUM])
{
@@ -1394,7 +1350,7 @@ sparc_pop_frame (void)
pc = PC_ADJUST ((CORE_ADDR) read_memory_integer (fsr[I7_REGNUM],
SPARC_INTREG_SIZE));
write_register (PC_REGNUM, pc);
- write_register (NPC_REGNUM, pc + 4);
+ write_register (DEPRECATED_NPC_REGNUM, pc + 4);
}
flush_cached_frames ();
}
@@ -1523,7 +1479,7 @@ supply_gregset (gdb_gregset_t *gregsetp)
/* These require a bit more care. */
supply_register (PC_REGNUM, ((char *) (regp + R_PC)) + offset);
- supply_register (NPC_REGNUM, ((char *) (regp + R_nPC)) + offset);
+ supply_register (DEPRECATED_NPC_REGNUM, ((char *) (regp + R_nPC)) + offset);
supply_register (Y_REGNUM, ((char *) (regp + R_Y)) + offset);
if (GDB_TARGET_IS_SPARC64)
@@ -1642,8 +1598,8 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
if ((regno == -1) || (regno == PC_REGNUM))
deprecated_read_register_gen (PC_REGNUM, (char *) (regp + R_PC) + offset);
- if ((regno == -1) || (regno == NPC_REGNUM))
- deprecated_read_register_gen (NPC_REGNUM, (char *) (regp + R_nPC) + offset);
+ if ((regno == -1) || (regno == DEPRECATED_NPC_REGNUM))
+ deprecated_read_register_gen (DEPRECATED_NPC_REGNUM, (char *) (regp + R_nPC) + offset);
if ((regno == -1) || (regno == Y_REGNUM))
deprecated_read_register_gen (Y_REGNUM, (char *) (regp + R_Y) + offset);
@@ -1706,7 +1662,7 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
void
supply_fpregset (gdb_fpregset_t *fpregsetp)
{
- register int regi;
+ int regi;
char *from;
if (!SPARC_HAS_FPU)
@@ -1755,7 +1711,7 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
{
if ((regno == -1) || (regno == regi))
{
- from = (char *) &deprecated_registers[REGISTER_BYTE (regi)];
+ from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
to = (char *) &fpregsetp->pr_fr.pr_regs[regi - FP0_REGNUM];
memcpy (to, from, REGISTER_RAW_SIZE (regi));
}
@@ -1764,7 +1720,7 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
if (!(GDB_TARGET_IS_SPARC64)) /* FIXME: does Sparc64 have this register? */
if ((regno == -1) || (regno == FPS_REGNUM))
{
- from = (char *)&deprecated_registers[REGISTER_BYTE (FPS_REGNUM)];
+ from = (char *)&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPS_REGNUM)];
to = (char *) &fpregsetp->pr_fsr;
memcpy (to, from, REGISTER_RAW_SIZE (FPS_REGNUM));
}
@@ -2184,16 +2140,6 @@ sparc_do_registers_info (int regnum, int all)
// OBSOLETE }
#endif
-
-static int
-gdb_print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
-{
- /* It's necessary to override mach again because print_insn messes it up. */
- info->mach = TARGET_ARCHITECTURE->mach;
- return print_insn_sparc (memaddr, info);
-}
-
-
#define SPARC_F0_REGNUM FP0_REGNUM /* %f0 */
#define SPARC_F1_REGNUM (FP0_REGNUM + 1)/* %f1 */
#define SPARC_O0_REGNUM O0_REGNUM /* %o0 */
@@ -2470,7 +2416,7 @@ sparc_store_return_value (struct type *type, char *valbuf)
deprecated_write_register_gen (regno, buffer);
}
else
- deprecated_write_register_bytes (REGISTER_BYTE (regno), valbuf,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (regno), valbuf,
TYPE_LENGTH (type));
}
@@ -2604,8 +2550,6 @@ _initialize_sparc_tdep (void)
/* Hook us into the gdbarch mechanism. */
gdbarch_register (bfd_arch_sparc, sparc_gdbarch_init, sparc_dump_tdep);
- deprecated_tm_print_insn = gdb_print_insn_sparc;
- deprecated_tm_print_insn_info.mach = TM_PRINT_INSN_MACH; /* Selects sparc/sparclite */
/* OBSOLETE target_architecture_hook = sparc_target_architecture_hook; */
}
@@ -2749,7 +2693,7 @@ sparc64_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
default:
internal_error (__FILE__, __LINE__, "bad switch");
}
- deprecated_write_register_bytes (REGISTER_BYTE (fpreg),
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (fpreg),
VALUE_CONTENTS (args[i]),
len);
}
@@ -2782,7 +2726,7 @@ sp64_extract_return_value (struct type *type, char *regbuf, char *valbuf,
if (TYPE_CODE (type) == TYPE_CODE_FLT && SPARC_HAS_FPU)
{
- memcpy (valbuf, &regbuf[REGISTER_BYTE (FP0_REGNUM)], typelen);
+ memcpy (valbuf, &regbuf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], typelen);
return;
}
@@ -3024,8 +2968,10 @@ sparc_push_return_address (CORE_ADDR pc_unused, CORE_ADDR sp)
This address will actually be the program's entry point.
There will be a special call_dummy breakpoint there. */
- write_register (O7_REGNUM,
- CALL_DUMMY_ADDRESS () - 8);
+ if (DEPRECATED_CALL_DUMMY_ADDRESS_P ())
+ write_register (O7_REGNUM, DEPRECATED_CALL_DUMMY_ADDRESS () - 8);
+ else
+ write_register (O7_REGNUM, entry_point_address () - 8);
}
return sp;
@@ -3193,7 +3139,8 @@ sparc_gdbarch_fix_call_dummy (char *dummy,
sparc_fix_call_dummy (dummy, pc, fun, type, gcc_p);
}
-/* CALL_DUMMY_ADDRESS: fetch the breakpoint address for a call dummy. */
+/* DEPRECATED_CALL_DUMMY_ADDRESS: fetch the breakpoint address for a
+ call dummy. */
static CORE_ADDR
sparc_call_dummy_address (void)
@@ -3338,7 +3285,8 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_deprecated_pop_frame (gdbarch, sparc_pop_frame);
set_gdbarch_deprecated_push_return_address (gdbarch, sparc_push_return_address);
set_gdbarch_deprecated_push_dummy_frame (gdbarch, sparc_push_dummy_frame);
- set_gdbarch_reg_struct_has_addr (gdbarch, sparc_reg_struct_has_addr);
+ set_gdbarch_deprecated_reg_struct_has_addr
+ (gdbarch, sparc_reg_struct_has_addr);
set_gdbarch_return_value_on_stack (gdbarch, sparc_return_value_on_stack);
set_gdbarch_deprecated_saved_pc_after_call (gdbarch, sparc_saved_pc_after_call);
set_gdbarch_prologue_frameless_p (gdbarch, sparc_prologue_frameless_p);
@@ -3371,7 +3319,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
#ifdef SPARC32_CALL_DUMMY_ON_STACK
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
- set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address);
+ set_gdbarch_deprecated_call_dummy_address (gdbarch, sparc_call_dummy_address);
set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 0x30);
set_gdbarch_deprecated_call_dummy_length (gdbarch, 0x38);
@@ -3436,7 +3384,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_args_skip (gdbarch, 68);
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
- set_gdbarch_npc_regnum (gdbarch, SPARC32_NPC_REGNUM);
+ set_gdbarch_deprecated_npc_regnum (gdbarch, SPARC32_NPC_REGNUM);
set_gdbarch_pc_regnum (gdbarch, SPARC32_PC_REGNUM);
set_gdbarch_ptr_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_push_arguments (gdbarch, sparc32_push_arguments);
@@ -3451,7 +3399,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
#else
set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
#endif
- set_gdbarch_stack_align (gdbarch, sparc32_stack_align);
+ set_gdbarch_deprecated_stack_align (gdbarch, sparc32_stack_align);
set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1);
set_gdbarch_deprecated_store_struct_return (gdbarch, sparc32_store_struct_return);
set_gdbarch_use_struct_convention (gdbarch,
@@ -3471,7 +3419,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
#ifdef SPARC64_CALL_DUMMY_ON_STACK
set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
- set_gdbarch_call_dummy_address (gdbarch, sparc_call_dummy_address);
+ set_gdbarch_deprecated_call_dummy_address (gdbarch, sparc_call_dummy_address);
set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 8 * 4);
set_gdbarch_deprecated_call_dummy_length (gdbarch, 192);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
@@ -3485,7 +3433,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_frame_args_skip (gdbarch, 136);
set_gdbarch_function_start_offset (gdbarch, 0);
set_gdbarch_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
- set_gdbarch_npc_regnum (gdbarch, SPARC64_NPC_REGNUM);
+ set_gdbarch_deprecated_npc_regnum (gdbarch, SPARC64_NPC_REGNUM);
set_gdbarch_pc_regnum (gdbarch, SPARC64_PC_REGNUM);
set_gdbarch_ptr_bit (gdbarch, 8 * TARGET_CHAR_BIT);
set_gdbarch_deprecated_push_arguments (gdbarch, sparc64_push_arguments);
@@ -3504,7 +3452,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
#else
set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
#endif
- set_gdbarch_stack_align (gdbarch, sparc64_stack_align);
+ set_gdbarch_deprecated_stack_align (gdbarch, sparc64_stack_align);
set_gdbarch_deprecated_extra_stack_alignment_needed (gdbarch, 1);
set_gdbarch_deprecated_store_struct_return (gdbarch, sparc64_store_struct_return);
set_gdbarch_use_struct_convention (gdbarch,
@@ -3622,6 +3570,8 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
break;
}
+ set_gdbarch_print_insn (gdbarch, print_insn_sparc);
+
/* Hook in OS ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
new file mode 100644
index 00000000000..b605a1d1862
--- /dev/null
+++ b/gdb/sparc64-tdep.c
@@ -0,0 +1,1500 @@
+/* Target-dependent code for UltraSPARC.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "arch-utils.h"
+#include "floatformat.h"
+#include "frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "target.h"
+#include "value.h"
+
+#include "gdb_assert.h"
+#include "gdb_string.h"
+
+#include "sparc64-tdep.h"
+
+/* This file implements the The SPARC 64-bit ABI as defined by the
+ section "Low-Level System Information" of the SPARC Compliance
+ Definition (SCD) 2.4.1, which is the 64-bit System V psABI for
+ SPARC. */
+
+/* Please use the sparc32_-prefix for 32-bit specific code, the
+ sparc64_-prefix for 64-bit specific code and the sparc_-prefix for
+ code can handle both. */
+
+/* The stack pointer is offset from the stack frame by a BIAS of 2047
+ (0x7ff) for 64-bit code. BIAS is likely to be defined on SPARC
+ hosts, so undefine it first. */
+#undef BIAS
+#define BIAS 2047
+
+/* Macros to extract fields from SPARC instructions. */
+#define X_OP(i) (((i) >> 30) & 0x3)
+#define X_A(i) (((i) >> 29) & 1)
+#define X_COND(i) (((i) >> 25) & 0xf)
+#define X_OP2(i) (((i) >> 22) & 0x7)
+#define X_IMM22(i) ((i) & 0x3fffff)
+#define X_OP3(i) (((i) >> 19) & 0x3f)
+/* Sign extension macros. */
+#define X_DISP22(i) ((X_IMM22 (i) ^ 0x200000) - 0x200000)
+#define X_DISP19(i) ((((i) & 0x7ffff) ^ 0x40000) - 0x40000)
+
+/* Fetch the instruction at PC. Instructions are always big-endian
+ even if the processor operates in little-endian mode. */
+
+static unsigned long
+sparc_fetch_instruction (CORE_ADDR pc)
+{
+ unsigned char buf[4];
+ unsigned long insn;
+ int i;
+
+ read_memory (pc, buf, sizeof (buf));
+
+ insn = 0;
+ for (i = 0; i < sizeof (buf); i++)
+ insn = (insn << 8) | buf[i];
+ return insn;
+}
+
+/* The functions on this page are intended to be used to classify
+ function arguments. */
+
+/* Return the contents if register REGNUM as an address. */
+
+static CORE_ADDR
+sparc_address_from_register (int regnum)
+{
+ ULONGEST addr;
+
+ regcache_cooked_read_unsigned (current_regcache, regnum, &addr);
+ return addr;
+}
+
+/* Check whether TYPE is "Integral or Pointer". */
+
+static int
+sparc64_integral_or_pointer_p (const struct type *type)
+{
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_INT:
+ case TYPE_CODE_BOOL:
+ case TYPE_CODE_CHAR:
+ case TYPE_CODE_ENUM:
+ case TYPE_CODE_RANGE:
+ {
+ int len = TYPE_LENGTH (type);
+ gdb_assert (len == 1 || len == 2 || len == 4 || len == 8);
+ }
+ return 1;
+ case TYPE_CODE_PTR:
+ case TYPE_CODE_REF:
+ {
+ int len = TYPE_LENGTH (type);
+ gdb_assert (len == 8);
+ }
+ return 1;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+/* Check whether TYPE is "Floating". */
+
+static int
+sparc64_floating_p (const struct type *type)
+{
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_FLT:
+ {
+ int len = TYPE_LENGTH (type);
+ gdb_assert (len == 4 || len == 8 || len == 16);
+ }
+ return 1;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+/* Check whether TYPE is "Structure or Union". */
+
+static int
+sparc64_structure_or_union_p (const struct type *type)
+{
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_STRUCT:
+ case TYPE_CODE_UNION:
+ return 1;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+/* UltraSPARC architecture specific information. */
+
+struct gdbarch_tdep
+{
+ /* Offset of saved PC in jmp_buf. */
+ int jb_pc_offset;
+};
+
+/* Register information. */
+
+struct sparc64_register_info
+{
+ char *name;
+ struct type **type;
+};
+
+static struct sparc64_register_info sparc64_register_info[] =
+{
+ { "g0", &builtin_type_int64 },
+ { "g1", &builtin_type_int64 },
+ { "g2", &builtin_type_int64 },
+ { "g3", &builtin_type_int64 },
+ { "g4", &builtin_type_int64 },
+ { "g5", &builtin_type_int64 },
+ { "g6", &builtin_type_int64 },
+ { "g7", &builtin_type_int64 },
+
+ { "o0", &builtin_type_int64 },
+ { "o1", &builtin_type_int64 },
+ { "o2", &builtin_type_int64 },
+ { "o3", &builtin_type_int64 },
+ { "o4", &builtin_type_int64 },
+ { "o5", &builtin_type_int64 },
+ { "sp", &builtin_type_void_data_ptr },
+ { "o7", &builtin_type_int64 },
+
+ { "l0", &builtin_type_int64 },
+ { "l1", &builtin_type_int64 },
+ { "l2", &builtin_type_int64 },
+ { "l3", &builtin_type_int64 },
+ { "l4", &builtin_type_int64 },
+ { "l5", &builtin_type_int64 },
+ { "l6", &builtin_type_int64 },
+ { "l7", &builtin_type_int64 },
+
+ { "i0", &builtin_type_int64 },
+ { "i1", &builtin_type_int64 },
+ { "i2", &builtin_type_int64 },
+ { "i3", &builtin_type_int64 },
+ { "i4", &builtin_type_int64 },
+ { "i5", &builtin_type_int64 },
+ { "fp", &builtin_type_void_data_ptr },
+ { "i7", &builtin_type_int64 },
+
+ { "f0", &builtin_type_float },
+ { "f1", &builtin_type_float },
+ { "f2", &builtin_type_float },
+ { "f3", &builtin_type_float },
+ { "f4", &builtin_type_float },
+ { "f5", &builtin_type_float },
+ { "f6", &builtin_type_float },
+ { "f7", &builtin_type_float },
+ { "f8", &builtin_type_float },
+ { "f9", &builtin_type_float },
+ { "f10", &builtin_type_float },
+ { "f11", &builtin_type_float },
+ { "f12", &builtin_type_float },
+ { "f13", &builtin_type_float },
+ { "f14", &builtin_type_float },
+ { "f15", &builtin_type_float },
+ { "f16", &builtin_type_float },
+ { "f17", &builtin_type_float },
+ { "f18", &builtin_type_float },
+ { "f19", &builtin_type_float },
+ { "f20", &builtin_type_float },
+ { "f21", &builtin_type_float },
+ { "f22", &builtin_type_float },
+ { "f23", &builtin_type_float },
+ { "f24", &builtin_type_float },
+ { "f25", &builtin_type_float },
+ { "f26", &builtin_type_float },
+ { "f27", &builtin_type_float },
+ { "f28", &builtin_type_float },
+ { "f29", &builtin_type_float },
+ { "f30", &builtin_type_float },
+ { "f31", &builtin_type_float },
+ { "f32", &builtin_type_double },
+ { "f34", &builtin_type_double },
+ { "f36", &builtin_type_double },
+ { "f38", &builtin_type_double },
+ { "f40", &builtin_type_double },
+ { "f42", &builtin_type_double },
+ { "f44", &builtin_type_double },
+ { "f46", &builtin_type_double },
+ { "f48", &builtin_type_double },
+ { "f50", &builtin_type_double },
+ { "f52", &builtin_type_double },
+ { "f54", &builtin_type_double },
+ { "f56", &builtin_type_double },
+ { "f58", &builtin_type_double },
+ { "f60", &builtin_type_double },
+ { "f62", &builtin_type_double },
+
+ { "pc", &builtin_type_void_func_ptr },
+ { "npc", &builtin_type_void_func_ptr },
+
+ /* This raw register contains the contents of %cwp, %pstate, %asi
+ and %ccr as laid out in a %tstate register. */
+ /* FIXME: Give it a name until we start using register groups. */
+ { "state", &builtin_type_int64 },
+
+ { "fsr", &builtin_type_int64 },
+ { "fprs", &builtin_type_int64 },
+
+ /* "Although Y is a 64-bit register, its high-order 32 bits are
+ reserved and always read as 0." */
+ { "y", &builtin_type_int64 }
+};
+
+/* Total number of registers. */
+#define SPARC64_NUM_REGS \
+ (sizeof (sparc64_register_info) / sizeof (sparc64_register_info[0]))
+
+/* We provide the aliases %d0..%d62 and %q0..%q60 for the floating
+ registers as "psuedo" registers. */
+
+static struct sparc64_register_info sparc64_pseudo_register_info[] =
+{
+ { "cwp", &builtin_type_int64 },
+ { "pstate", &builtin_type_int64 },
+ { "asi", &builtin_type_int64 },
+ { "ccr", &builtin_type_int64 },
+
+ { "d0", &builtin_type_double },
+ { "d2", &builtin_type_double },
+ { "d4", &builtin_type_double },
+ { "d6", &builtin_type_double },
+ { "d8", &builtin_type_double },
+ { "d10", &builtin_type_double },
+ { "d12", &builtin_type_double },
+ { "d14", &builtin_type_double },
+ { "d16", &builtin_type_double },
+ { "d18", &builtin_type_double },
+ { "d20", &builtin_type_double },
+ { "d22", &builtin_type_double },
+ { "d24", &builtin_type_double },
+ { "d26", &builtin_type_double },
+ { "d28", &builtin_type_double },
+ { "d30", &builtin_type_double },
+ { "d32", &builtin_type_double },
+ { "d34", &builtin_type_double },
+ { "d36", &builtin_type_double },
+ { "d38", &builtin_type_double },
+ { "d40", &builtin_type_double },
+ { "d42", &builtin_type_double },
+ { "d44", &builtin_type_double },
+ { "d46", &builtin_type_double },
+ { "d48", &builtin_type_double },
+ { "d50", &builtin_type_double },
+ { "d52", &builtin_type_double },
+ { "d54", &builtin_type_double },
+ { "d56", &builtin_type_double },
+ { "d58", &builtin_type_double },
+ { "d60", &builtin_type_double },
+ { "d62", &builtin_type_double },
+
+ { "q0", &builtin_type_long_double },
+ { "q4", &builtin_type_long_double },
+ { "q8", &builtin_type_long_double },
+ { "q12", &builtin_type_long_double },
+ { "q16", &builtin_type_long_double },
+ { "q20", &builtin_type_long_double },
+ { "q24", &builtin_type_long_double },
+ { "q28", &builtin_type_long_double },
+ { "q32", &builtin_type_long_double },
+ { "q36", &builtin_type_long_double },
+ { "q40", &builtin_type_long_double },
+ { "q44", &builtin_type_long_double },
+ { "q48", &builtin_type_long_double },
+ { "q52", &builtin_type_long_double },
+ { "q56", &builtin_type_long_double },
+ { "q60", &builtin_type_long_double }
+};
+
+/* Total number of pseudo registers. */
+#define SPARC64_NUM_PSEUDO_REGS \
+ (sizeof (sparc64_pseudo_register_info) \
+ / sizeof (sparc64_pseudo_register_info[0]))
+
+/* Return the name of register REGNUM. */
+
+static const char *
+sparc64_register_name (int regnum)
+{
+ if (regnum >= 0 && regnum < SPARC64_NUM_REGS)
+ return sparc64_register_info[regnum].name;
+
+ if (regnum >= SPARC64_NUM_REGS
+ && regnum < SPARC64_NUM_REGS + SPARC64_NUM_PSEUDO_REGS)
+ return sparc64_pseudo_register_info[regnum - SPARC64_NUM_REGS].name;
+
+ return NULL;
+}
+
+/* Return the GDB type object for the "standard" data type of data in
+ register REGNUM. */
+
+static struct type *
+sparc64_register_type (struct gdbarch *gdbarch, int regnum)
+{
+ if (regnum >= SPARC64_NUM_REGS
+ && regnum < SPARC64_NUM_REGS + SPARC64_NUM_PSEUDO_REGS)
+ return *sparc64_pseudo_register_info[regnum - SPARC64_NUM_REGS].type;
+
+ gdb_assert (regnum >= 0 && regnum < SPARC64_NUM_REGS);
+ return *sparc64_register_info[regnum].type;
+}
+
+static void
+sparc64_pseudo_register_read (struct gdbarch *gdbarch,
+ struct regcache *regcache,
+ int regnum, void *buf)
+{
+ gdb_assert (regnum >= SPARC64_NUM_REGS);
+
+ if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D30_REGNUM)
+ {
+ regnum = SPARC_F0_REGNUM + 2 * (regnum - SPARC64_D0_REGNUM);
+ regcache_raw_read (regcache, regnum, buf);
+ regcache_raw_read (regcache, regnum + 1, ((char *)buf) + 4);
+ }
+ else if (regnum >= SPARC64_D32_REGNUM && regnum <= SPARC64_D62_REGNUM)
+ {
+ regnum = SPARC64_F32_REGNUM + (regnum - SPARC64_D32_REGNUM);
+ regcache_raw_read (regcache, regnum, buf);
+ }
+ else if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q28_REGNUM)
+ {
+ regnum = SPARC_F0_REGNUM + 4 * (regnum - SPARC64_Q0_REGNUM);
+ regcache_raw_read (regcache, regnum, buf);
+ regcache_raw_read (regcache, regnum + 1, ((char *)buf) + 4);
+ regcache_raw_read (regcache, regnum + 2, ((char *)buf) + 8);
+ regcache_raw_read (regcache, regnum + 3, ((char *)buf) + 12);
+ }
+ else if (regnum >= SPARC64_Q32_REGNUM && regnum <= SPARC64_Q60_REGNUM)
+ {
+ regnum = SPARC64_F32_REGNUM + 2 * (regnum - SPARC64_Q32_REGNUM);
+ regcache_raw_read (regcache, regnum, buf);
+ regcache_raw_read (regcache, regnum + 1, ((char *)buf) + 8);
+ }
+ else if (regnum == SPARC64_CWP_REGNUM
+ || regnum == SPARC64_PSTATE_REGNUM
+ || regnum == SPARC64_ASI_REGNUM
+ || regnum == SPARC64_CCR_REGNUM)
+ {
+ ULONGEST state;
+
+ regcache_raw_read_unsigned (regcache, SPARC64_STATE_REGNUM, &state);
+ switch (regnum)
+ {
+ case SPARC64_CWP_REGNUM:
+ state = (state >> 0) & ((1 << 5) - 1);
+ break;
+ case SPARC64_PSTATE_REGNUM:
+ state = (state >> 8) & ((1 << 12) - 1);
+ break;
+ case SPARC64_ASI_REGNUM:
+ state = (state >> 24) & ((1 << 8) - 1);
+ break;
+ case SPARC64_CCR_REGNUM:
+ state = (state >> 32) & ((1 << 8) - 1);
+ break;
+ }
+ store_unsigned_integer (buf, 8, state);
+ }
+}
+
+static void
+sparc64_pseudo_register_write (struct gdbarch *gdbarch,
+ struct regcache *regcache,
+ int regnum, const void *buf)
+{
+ gdb_assert (regnum >= SPARC64_NUM_REGS);
+
+ if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D30_REGNUM)
+ {
+ regnum = SPARC_F0_REGNUM + 2 * (regnum - SPARC64_D0_REGNUM);
+ regcache_raw_write (regcache, regnum, buf);
+ regcache_raw_write (regcache, regnum + 1, ((const char *)buf) + 4);
+ }
+ else if (regnum >= SPARC64_D32_REGNUM && regnum <= SPARC64_D62_REGNUM)
+ {
+ regnum = SPARC64_F32_REGNUM + (regnum - SPARC64_D32_REGNUM);
+ regcache_raw_write (regcache, regnum, buf);
+ }
+ else if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q28_REGNUM)
+ {
+ regnum = SPARC_F0_REGNUM + 4 * (regnum - SPARC64_Q0_REGNUM);
+ regcache_raw_write (regcache, regnum, buf);
+ regcache_raw_write (regcache, regnum + 1, ((const char *)buf) + 4);
+ regcache_raw_write (regcache, regnum + 2, ((const char *)buf) + 8);
+ regcache_raw_write (regcache, regnum + 3, ((const char *)buf) + 12);
+ }
+ else if (regnum >= SPARC64_Q32_REGNUM && regnum <= SPARC64_Q60_REGNUM)
+ {
+ regnum = SPARC64_F32_REGNUM + 2 * (regnum - SPARC64_Q32_REGNUM);
+ regcache_raw_write (regcache, regnum, buf);
+ regcache_raw_write (regcache, regnum + 1, ((const char *)buf) + 8);
+ }
+ else if (regnum == SPARC64_CWP_REGNUM
+ || regnum == SPARC64_PSTATE_REGNUM
+ || regnum == SPARC64_ASI_REGNUM
+ || regnum == SPARC64_CCR_REGNUM)
+ {
+ ULONGEST state, bits;
+
+ regcache_raw_read_unsigned (regcache, SPARC64_STATE_REGNUM, &state);
+ bits = extract_unsigned_integer (buf, 8);
+ switch (regnum)
+ {
+ case SPARC64_CWP_REGNUM:
+ state |= ((bits & ((1 << 5) - 1)) << 0);
+ break;
+ case SPARC64_PSTATE_REGNUM:
+ state |= ((bits & ((1 << 12) - 1)) << 8);
+ break;
+ case SPARC64_ASI_REGNUM:
+ state |= ((bits & ((1 << 8) - 1)) << 24);
+ break;
+ case SPARC64_CCR_REGNUM:
+ state |= ((bits & ((1 << 8) - 1)) << 32);
+ break;
+ }
+ regcache_raw_write_unsigned (regcache, SPARC64_STATE_REGNUM, state);
+ }
+}
+
+/* Use the program counter to determine the contents and size of a
+ breakpoint instruction. Return a pointer to a string of bytes that
+ encode a breakpoint instruction, store the length of the string in
+ *LEN and optionally adjust *PC to point to the correct memory
+ location for inserting the breakpoint. */
+
+static const unsigned char *
+sparc_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+{
+ static unsigned char break_insn[] = { 0x91, 0xd0, 0x20, 0x01 };
+
+ *len = sizeof (break_insn);
+ return break_insn;
+}
+
+
+struct sparc64_frame_cache
+{
+ /* Base address. */
+ CORE_ADDR base;
+ CORE_ADDR pc;
+
+ /* Do we have a frame? */
+ int frameless_p;
+};
+
+/* Allocate and initialize a frame cache. */
+
+static struct sparc64_frame_cache *
+sparc64_alloc_frame_cache (void)
+{
+ struct sparc64_frame_cache *cache;
+ int i;
+
+ cache = FRAME_OBSTACK_ZALLOC (struct sparc64_frame_cache);
+
+ /* Base address. */
+ cache->base = 0;
+ cache->pc = 0;
+
+ /* Frameless until proven otherwise. */
+ cache->frameless_p = 1;
+
+ return cache;
+}
+
+static CORE_ADDR
+sparc64_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
+ struct sparc64_frame_cache *cache)
+{
+ unsigned long insn;
+
+ if (current_pc <= pc)
+ return current_pc;
+
+ /* Check whether the function starts with a SAVE instruction. */
+ insn = sparc_fetch_instruction (pc);
+ if (X_OP (insn) == 2 && X_OP3 (insn) == 0x3c)
+ {
+ cache->frameless_p = 0;
+ return pc + 4;
+ }
+
+ return pc;
+}
+
+static CORE_ADDR
+sparc64_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+ return frame_unwind_register_unsigned (next_frame, SPARC64_PC_REGNUM);
+}
+
+/* Return PC of first real instruction of the function starting at
+ START_PC. */
+
+static CORE_ADDR
+sparc64_skip_prologue (CORE_ADDR start_pc)
+{
+ struct symtab_and_line sal;
+ CORE_ADDR func_start, func_end;
+ struct sparc64_frame_cache cache;
+
+ /* This is the preferred method, find the end of the prologue by
+ using the debugging information. */
+ if (find_pc_partial_function (start_pc, NULL, &func_start, &func_end))
+ {
+ sal = find_pc_line (func_start, 0);
+
+ if (sal.end < func_end
+ && start_pc <= sal.end)
+ return sal.end;
+ }
+
+ return sparc64_analyze_prologue (start_pc, 0xffffffffffffffffUL, &cache);
+}
+
+/* Normal frames. */
+
+static struct sparc64_frame_cache *
+sparc64_frame_cache (struct frame_info *next_frame, void **this_cache)
+{
+ struct sparc64_frame_cache *cache;
+
+ if (*this_cache)
+ return *this_cache;
+
+ cache = sparc64_alloc_frame_cache ();
+ *this_cache = cache;
+
+ /* In priciple, for normal frames, %fp (%i6) holds the frame
+ pointer, which holds the base address for the current stack
+ frame. */
+
+ cache->base = frame_unwind_register_unsigned (next_frame, SPARC_FP_REGNUM);
+ if (cache->base == 0)
+ return cache;
+
+ cache->pc = frame_func_unwind (next_frame);
+ if (cache->pc != 0)
+ sparc64_analyze_prologue (cache->pc, frame_pc_unwind (next_frame), cache);
+
+ if (cache->frameless_p)
+ {
+ /* We didn't find a valid frame, which means that CACHE->base
+ currently holds the frame pointer for our calling frame. */
+ cache->base = frame_unwind_register_unsigned (next_frame,
+ SPARC_SP_REGNUM);
+ }
+
+ return cache;
+}
+
+static void
+sparc64_frame_this_id (struct frame_info *next_frame, void **this_cache,
+ struct frame_id *this_id)
+{
+ struct sparc64_frame_cache *cache =
+ sparc64_frame_cache (next_frame, this_cache);
+
+ /* This marks the outermost frame. */
+ if (cache->base == 0)
+ return;
+
+ (*this_id) = frame_id_build (cache->base, cache->pc);
+}
+
+static void
+sparc64_frame_prev_register (struct frame_info *next_frame, void **this_cache,
+ int regnum, int *optimizedp,
+ enum lval_type *lvalp, CORE_ADDR *addrp,
+ int *realnump, void *valuep)
+{
+ struct sparc64_frame_cache *cache =
+ sparc64_frame_cache (next_frame, this_cache);
+
+ if (regnum == SPARC64_PC_REGNUM || regnum == SPARC64_NPC_REGNUM)
+ {
+ *optimizedp = 0;
+ *lvalp = not_lval;
+ *addrp = 0;
+ *realnump = -1;
+ if (valuep)
+ {
+ CORE_ADDR pc = (regnum == SPARC64_NPC_REGNUM) ? 4 : 0;
+
+ regnum = cache->frameless_p ? SPARC_O7_REGNUM : SPARC_I7_REGNUM;
+ pc += frame_unwind_register_unsigned (next_frame, regnum) + 8;
+ store_unsigned_integer (valuep, 8, pc);
+ }
+ return;
+ }
+
+ /* The previous frame's `local' and `in' registers have been saved
+ in the register save area. */
+ if (!cache->frameless_p
+ && regnum >= SPARC_L0_REGNUM && regnum <= SPARC_I7_REGNUM)
+ {
+ *optimizedp = 0;
+ *lvalp = lval_memory;
+ *addrp = cache->base + BIAS + (regnum - SPARC_L0_REGNUM) * 8;
+ *realnump = -1;
+ if (valuep)
+ {
+ struct gdbarch *gdbarch = get_frame_arch (next_frame);
+
+ /* Read the value in from memory. */
+ read_memory (*addrp, valuep, register_size (gdbarch, regnum));
+ }
+ return;
+ }
+
+ /* The previous frame's `out' registers are accessable as the
+ current frame's `in' registers. */
+ if (!cache->frameless_p
+ && regnum >= SPARC_O0_REGNUM && regnum <= SPARC_O7_REGNUM)
+ regnum += (SPARC_I0_REGNUM - SPARC_O0_REGNUM);
+
+ frame_register_unwind (next_frame, regnum,
+ optimizedp, lvalp, addrp, realnump, valuep);
+}
+
+static const struct frame_unwind sparc64_frame_unwind =
+{
+ NORMAL_FRAME,
+ sparc64_frame_this_id,
+ sparc64_frame_prev_register
+};
+
+static const struct frame_unwind *
+sparc64_frame_sniffer (struct frame_info *next_frame)
+{
+ return &sparc64_frame_unwind;
+}
+
+
+static CORE_ADDR
+sparc64_frame_base_address (struct frame_info *next_frame, void **this_cache)
+{
+ struct sparc64_frame_cache *cache =
+ sparc64_frame_cache (next_frame, this_cache);
+
+ /* ??? Should we take BIAS into account here? */
+ return cache->base;
+}
+
+static const struct frame_base sparc64_frame_base =
+{
+ &sparc64_frame_unwind,
+ sparc64_frame_base_address,
+ sparc64_frame_base_address,
+ sparc64_frame_base_address
+};
+
+static struct frame_id
+sparc_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+ CORE_ADDR sp;
+
+ sp = frame_unwind_register_unsigned (next_frame, SPARC_SP_REGNUM);
+ return frame_id_build (sp, frame_pc_unwind (next_frame));
+}
+
+/* Check whether TYPE must be 16-byte aligned. */
+
+static int
+sparc64_16_byte_align_p (struct type *type)
+{
+ if (sparc64_floating_p (type) && TYPE_LENGTH (type) == 16)
+ return 1;
+
+ if (sparc64_structure_or_union_p (type))
+ {
+ int i;
+
+ for (i = 0; i < TYPE_NFIELDS (type); i++)
+ if (sparc64_16_byte_align_p (TYPE_FIELD_TYPE (type, i)))
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Store floating fields of element ELEMENT of an "parameter array"
+ that has type TYPE and is stored at BITPOS in VALBUF in the
+ apropriate registers of REGCACHE. This function can be called
+ recursively and therefore handles floating types in addition to
+ structures. */
+
+static void
+sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
+ char *valbuf, int element, int bitpos)
+{
+ gdb_assert (element < 16);
+
+ if (sparc64_floating_p (type))
+ {
+ int len = TYPE_LENGTH (type);
+ int regnum;
+
+ if (len == 16)
+ {
+ gdb_assert (bitpos == 0);
+ gdb_assert ((element % 2) == 0);
+
+ regnum = SPARC64_Q0_REGNUM + element / 2;
+ regcache_cooked_write (regcache, regnum, valbuf);
+ }
+ else if (len == 8)
+ {
+ gdb_assert (bitpos == 0 || bitpos == 64);
+
+ regnum = SPARC64_D0_REGNUM + element + bitpos / 64;
+ regcache_cooked_write (regcache, regnum, valbuf + (bitpos / 8));
+ }
+ else
+ {
+ gdb_assert (len == 4);
+ gdb_assert (bitpos % 32 == 0 && bitpos >= 0 && bitpos < 128);
+
+ regnum = SPARC_F0_REGNUM + element * 2 + bitpos / 32;
+ regcache_cooked_write (regcache, regnum, valbuf + (bitpos / 8));
+ }
+ }
+ else if (sparc64_structure_or_union_p (type))
+ {
+ int i;
+
+ for (i = 0; i < TYPE_NFIELDS (type); i++)
+ sparc64_store_floating_fields (regcache, TYPE_FIELD_TYPE (type, i),
+ valbuf, element,
+ bitpos + TYPE_FIELD_BITPOS (type, i));
+ }
+}
+
+/* Fetch floating fields from a variable of type TYPE from the
+ appropriate registers for BITPOS in REGCACHE and store it at BITPOS
+ in VALBUF. This function can be called recursively and therefore
+ handles floating types in addition to structures. */
+
+static void
+sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
+ char *valbuf, int bitpos)
+{
+ if (sparc64_floating_p (type))
+ {
+ int len = TYPE_LENGTH (type);
+ int regnum;
+
+ if (len == 16)
+ {
+ gdb_assert (bitpos == 0 || bitpos == 128);
+
+ regnum = SPARC64_Q0_REGNUM + bitpos / 128;
+ regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8));
+ }
+ else if (len == 8)
+ {
+ gdb_assert (bitpos % 64 == 0 && bitpos >= 0 && bitpos < 256);
+
+ regnum = SPARC64_D0_REGNUM + bitpos / 64;
+ regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8));
+ }
+ else
+ {
+ gdb_assert (len == 4);
+ gdb_assert (bitpos % 32 == 0 && bitpos >= 0 && bitpos < 256);
+
+ regnum = SPARC_F0_REGNUM + bitpos / 32;
+ regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8));
+ }
+ }
+ else if (sparc64_structure_or_union_p (type))
+ {
+ int i;
+
+ for (i = 0; i < TYPE_NFIELDS (type); i++)
+ sparc64_extract_floating_fields (regcache, TYPE_FIELD_TYPE (type, i),
+ valbuf,
+ bitpos + TYPE_FIELD_BITPOS (type, i));
+ }
+}
+
+/* Store the NARGS arguments ARGS and STRUCT_ADDR (if STRUCT_RETURN is
+ non-zero) in REGCACHE and on the stack (starting from address SP). */
+
+static CORE_ADDR
+sparc64_store_arguments (struct regcache *regcache, int nargs,
+ struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ /* Number of extended words in the "parameter array". */
+ int num_elements = 0;
+ int element = 0;
+ int i;
+
+ /* Take BIAS into account. */
+ sp += BIAS;
+
+ /* First we calculate the number of extended words in the "parameter
+ array". While doing so we also convert some of the arguments. */
+
+ if (struct_return)
+ num_elements++;
+
+ for (i = 0; i < nargs; i++)
+ {
+ struct type *type = VALUE_TYPE (args[i]);
+ int len = TYPE_LENGTH (type);
+
+ if (sparc64_structure_or_union_p (type))
+ {
+ /* Structure or Union arguments. */
+ if (len <= 16)
+ {
+ if (num_elements % 2 && sparc64_16_byte_align_p (type))
+ num_elements++;
+ num_elements += ((len + 7) / 8);
+ }
+ else
+ {
+ /* The psABI says that "Structures or unions larger than
+ sixteen bytes are copied by the caller and passed
+ indirectly; the caller will pass the address of a
+ correctly aligned structure value. This sixty-four
+ bit address will occupy one word in the parameter
+ array, and may be promoted to an %o register like any
+ other pointer value." Allocate memory for these
+ values on the stack. */
+ sp -= len;
+
+ /* Use 16-byte alignment for these values. That's
+ always correct, and wasting a few bytes shouldn't be
+ a problem. */
+ sp &= ~0xf;
+
+ write_memory (sp, VALUE_CONTENTS (args[i]), len);
+ args[i] = value_from_pointer (lookup_pointer_type (type), sp);
+ num_elements++;
+ }
+ }
+ else if (sparc64_floating_p (type))
+ {
+ /* Floating arguments. */
+
+ if (len == 16)
+ {
+ /* The psABI says that "Each quad-precision parameter
+ value will be assigned to two extended words in the
+ parameter array. */
+ num_elements += 2;
+
+ /* The psABI says that "Long doubles must be
+ quad-aligned, and thus a hole might be introduced
+ into the parameter array to force alignment." Skip
+ an element if necessary. */
+ if (num_elements % 2)
+ num_elements++;
+ }
+ else
+ num_elements++;
+ }
+ else
+ {
+ /* Integral and pointer arguments. */
+ gdb_assert (sparc64_integral_or_pointer_p (type));
+
+ /* The psABI says that "Each argument value of integral type
+ smaller than an extended word will be widened by the
+ caller to an extended word according to the signed-ness
+ of the argument type." */
+ if (len < 8)
+ args[i] = value_cast (builtin_type_int64, args[i]);
+ num_elements++;
+ }
+ }
+
+ /* Allocate the "parameter array". */
+ sp -= num_elements * 8;
+
+ /* The psABI says that "Every stack frame must be 16-byte aligned." */
+ sp &= ~0xf;
+
+ /* Now we store the arguments in to the "paramater array". Some
+ Integer or Pointer arguments and Structure or Union arguments
+ will be passed in %o registers. Some Floating arguments and
+ floating members of structures are passed in floating-point
+ registers. However, for functions with variable arguments,
+ floating arguments are stored in an %0 register, and for
+ functions without a prototype floating arguments are stored in
+ both a floating-point and an %o registers, or a floating-point
+ register and memory. To simplify the logic here we always pass
+ arguments in memory, an %o register, and a floating-point
+ register if appropriate. This should be no problem since the
+ contents of any unused memory or registers in the "parameter
+ array" are undefined. */
+
+ if (struct_return)
+ {
+ regcache_cooked_write_unsigned (regcache, SPARC_O0_REGNUM, struct_addr);
+ element++;
+ }
+
+ for (i = 0; i < nargs; i++)
+ {
+ char *valbuf = VALUE_CONTENTS (args[i]);
+ struct type *type = VALUE_TYPE (args[i]);
+ int len = TYPE_LENGTH (type);
+ int regnum = -1;
+ char buf[16];
+
+ if (sparc64_structure_or_union_p (type))
+ {
+ /* Structure or Union arguments. */
+ gdb_assert (len <= 16);
+ memset (buf, 0, sizeof (buf));
+ valbuf = memcpy (buf, valbuf, len);
+
+ if (element % 2 && sparc64_16_byte_align_p (type))
+ element++;
+
+ if (element < 6)
+ {
+ regnum = SPARC_O0_REGNUM + element;
+ if (len > 8 && element < 5)
+ regcache_cooked_write (regcache, regnum + 1, valbuf + 8);
+ }
+
+ if (element < 16)
+ sparc64_store_floating_fields (regcache, type, valbuf, element, 0);
+ }
+ else if (sparc64_floating_p (type))
+ {
+ /* Floating arguments. */
+ if (len == 16)
+ {
+ if (element % 2)
+ element++;
+ if (element < 16)
+ regnum = SPARC64_Q0_REGNUM + element / 2;
+ }
+ else if (len == 8)
+ {
+ if (element < 16)
+ regnum = SPARC64_D0_REGNUM + element;
+ }
+ else
+ {
+ /* The psABI says "Each single-precision parameter value
+ will be assigned to one extended word in the
+ parameter array, and right-justified within that
+ word; the left half (even floatregister) is
+ undefined." Even though the psABI says that "the
+ left half is undefined", set it to zero here. */
+ memset (buf, 0, 4);
+ valbuf = memcpy (buf + 4, valbuf, 4);
+ len = 8;
+ if (element < 16)
+ regnum = SPARC64_D0_REGNUM;
+ }
+ }
+ else
+ {
+ /* Integral and pointer arguments. */
+ gdb_assert (len == 8);
+ if (element < 6)
+ regnum = SPARC_O0_REGNUM + element;
+ }
+
+ if (regnum != -1)
+ {
+ regcache_cooked_write (regcache, regnum, valbuf);
+
+ /* If we're storing the value in a floating-point register,
+ also store it in the corresponding %0 register(s). */
+ if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D10_REGNUM)
+ {
+ gdb_assert (element < 6);
+ regnum = SPARC_O0_REGNUM + element;
+ regcache_cooked_write (regcache, regnum, valbuf);
+ }
+ else if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q8_REGNUM)
+ {
+ gdb_assert (element < 6);
+ regnum = SPARC_O0_REGNUM + element;
+ regcache_cooked_write (regcache, regnum, valbuf);
+ regcache_cooked_write (regcache, regnum + 1, valbuf);
+ }
+ }
+
+ /* Always store the argument in memeory. */
+ write_memory (sp + element * 8, valbuf, len);
+ element += ((len + 7) / 8);
+ }
+
+ gdb_assert (element == num_elements);
+
+ /* Take BIAS into account. */
+ sp -= BIAS;
+ return sp;
+}
+
+static CORE_ADDR
+sparc64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+ struct regcache *regcache, CORE_ADDR bp_addr,
+ int nargs, struct value **args, CORE_ADDR sp,
+ int struct_return, CORE_ADDR struct_addr)
+{
+ /* Set return address. */
+ regcache_cooked_write_unsigned (regcache, SPARC_O7_REGNUM, bp_addr - 8);
+
+ /* Set up function arguments. */
+ sp = sparc64_store_arguments (regcache, nargs, args, sp,
+ struct_return, struct_addr);
+
+ /* Allocate the register save area. */
+ sp -= 16 * 8;
+
+ /* Stack should be 16-byte aligned at this point. */
+ gdb_assert ((sp + BIAS) % 16 == 0);
+
+ /* Finally, update the stack pointer. */
+ regcache_cooked_write_unsigned (regcache, SPARC_SP_REGNUM, sp);
+
+ return sp;
+}
+
+
+/* Extract from an array REGBUF containing the (raw) register state, a
+ function return value of TYPE, and copy that into VALBUF. */
+
+static void
+sparc64_extract_return_value (struct type *type, struct regcache *regcache,
+ void *valbuf)
+{
+ int len = TYPE_LENGTH (type);
+ char buf[32];
+ int i;
+
+ if (sparc64_structure_or_union_p (type))
+ {
+ /* Structure or Union return values. */
+ gdb_assert (len <= 32);
+
+ for (i = 0; i < ((len + 7) / 8); i++)
+ regcache_cooked_read (regcache, SPARC_O0_REGNUM + i, buf + i * 8);
+ if (TYPE_CODE (type) != TYPE_CODE_UNION)
+ sparc64_extract_floating_fields (regcache, type, buf, 0);
+ memcpy (valbuf, buf, len);
+ }
+ else if (sparc64_floating_p (type))
+ {
+ /* Floating return values. */
+ for (i = 0; i < len / 4; i++)
+ regcache_cooked_read (regcache, SPARC_F0_REGNUM + i, buf + i * 4);
+ memcpy (valbuf, buf, len);
+ }
+ else
+ {
+ /* Integral and pointer return values. */
+ gdb_assert (sparc64_integral_or_pointer_p (type));
+
+ /* Just stripping off any unused bytes should preserve the
+ signed-ness just fine. */
+ regcache_cooked_read (regcache, SPARC_O0_REGNUM, buf);
+ memcpy (valbuf, buf + 8 - len, len);
+ }
+}
+
+/* Write into the appropriate registers a function return value stored
+ in VALBUF of type TYPE. */
+
+static void
+sparc64_store_return_value (struct type *type, struct regcache *regcache,
+ const void *valbuf)
+{
+ int len = TYPE_LENGTH (type);
+ char buf[16];
+ int i;
+
+ if (sparc64_structure_or_union_p (type))
+ {
+ /* Structure or Union return values. */
+ gdb_assert (len <= 32);
+
+ /* Simplify matters by storing the complete value (including
+ floating members) into %o0 and %o1. Floating members are
+ also store in the appropriate floating-point registers. */
+ memset (buf, 0, sizeof (buf));
+ memcpy (buf, valbuf, len);
+ for (i = 0; i < ((len + 7) / 8); i++)
+ regcache_cooked_write (regcache, SPARC_O0_REGNUM + i, buf + i * 4);
+ if (TYPE_CODE (type) != TYPE_CODE_UNION)
+ sparc64_store_floating_fields (regcache, type, buf, 0, 0);
+ }
+ else if (sparc64_floating_p (type))
+ {
+ /* Floating return values. */
+ memcpy (buf, valbuf, len);
+ for (i = 0; i < len / 4; i++)
+ regcache_cooked_write (regcache, SPARC_F0_REGNUM + i, buf + i * 4);
+ }
+ else
+ {
+ /* Integral and pointer return values. */
+ gdb_assert (sparc64_integral_or_pointer_p (type));
+
+ /* ??? Do we need to do any sign-extension here? */
+ memset (buf, 0, 8);
+ memcpy (buf + 8 - len, valbuf, len);
+ regcache_cooked_write (regcache, SPARC_O0_REGNUM, buf);
+ }
+}
+
+/* Extract from REGCACHE, which contains the (raw) register state, the
+ address in which a function should return its structure value, as a
+ CORE_ADDR. */
+
+static CORE_ADDR
+sparc_extract_struct_value_address (struct regcache *regcache)
+{
+ ULONGEST addr;
+
+ regcache_cooked_read_unsigned (regcache, SPARC_O0_REGNUM, &addr);
+ return addr;
+}
+
+static int
+sparc64_use_struct_convention (int gcc_p, struct type *type)
+{
+ /* Structure and union types up to 32 bytes in size are returned in
+ registers. */
+ return (TYPE_LENGTH (type) > 32);
+}
+
+
+/* The SPARC Architecture doesn't have hardware single-step support,
+ and most operating systems don't implement it either, so we provide
+ software single-step mechanism. */
+
+static CORE_ADDR
+sparc_analyze_control_transfer (CORE_ADDR pc, CORE_ADDR *npc)
+{
+ unsigned long insn = sparc_fetch_instruction (pc);
+ int conditional_p = X_COND (insn) & 0x7;
+ int branch_p = 0;
+ long offset = 0; /* Must be signed for sign-extend. */
+
+ if (X_OP (insn) == 0 && X_OP2 (insn) == 3 && (insn & 0x1000000) == 0)
+ {
+ /* Branch on Integer Register with Prediction (BPr). */
+ branch_p = 1;
+ conditional_p = 1;
+ }
+ else if (X_OP (insn) == 0 && X_OP2 (insn) == 6)
+ {
+ /* Branch on Floating-Point Condition Codes (FBfcc). */
+ branch_p = 1;
+ offset = 4 * X_DISP22 (insn);
+ }
+ else if (X_OP (insn) == 0 && X_OP2 (insn) == 5)
+ {
+ /* Branch on Floating-Point Condition Codes with Prediction
+ (FBPfcc). */
+ branch_p = 1;
+ offset = 4 * X_DISP19 (insn);
+ }
+ else if (X_OP (insn) == 0 && X_OP2 (insn) == 2)
+ {
+ /* Branch on Integer Condition Codes (Bicc). */
+ branch_p = 1;
+ offset = 4 * X_DISP22 (insn);
+ }
+ else if (X_OP (insn) == 0 && X_OP2 (insn) == 1)
+ {
+ /* Branch on Integer Condition Codes with Prediction (BPcc). */
+ branch_p = 1;
+ offset = 4 * X_DISP19 (insn);
+ }
+
+ /* FIXME: Handle DONE and RETRY instructions. */
+
+ /* FIXME: Handle the Trap instruction. */
+
+ if (branch_p)
+ {
+ if (conditional_p)
+ {
+ /* For conditional branches, return nPC + 4 iff the annul
+ bit is 1. */
+ return (X_A (insn) ? *npc + 4 : 0);
+ }
+ else
+ {
+ /* For unconditional branches, return the target if its
+ specified condition is "always" and return nPC + 4 if the
+ condition is "never". If the annul bit is 1, set *NPC to
+ zero. */
+ if (X_COND (insn) == 0x0)
+ pc = *npc, offset = 4;
+ if (X_A (insn))
+ *npc = 0;
+
+ gdb_assert (offset != 0);
+ return pc + offset;
+ }
+ }
+
+ return 0;
+}
+
+void
+sparc_software_single_step (enum target_signal sig, int insert_breakpoints_p)
+{
+ static CORE_ADDR npc, nnpc;
+ static char npc_save[4], nnpc_save[4];
+
+ if (insert_breakpoints_p)
+ {
+ CORE_ADDR pc;
+
+ pc = sparc_address_from_register (SPARC64_PC_REGNUM);
+ npc = sparc_address_from_register (SPARC64_NPC_REGNUM);
+
+ /* Analyze the instruction at PC. */
+ nnpc = sparc_analyze_control_transfer (pc, &npc);
+ if (npc != 0)
+ target_insert_breakpoint (npc, npc_save);
+ if (nnpc != 0)
+ target_insert_breakpoint (nnpc, nnpc_save);
+
+ /* Assert that we have set at least one breakpoint. */
+ gdb_assert (npc != 0 || nnpc != 0);
+ }
+ else
+ {
+ if (npc != 0)
+ target_remove_breakpoint (npc, npc_save);
+ if (nnpc != 0)
+ target_remove_breakpoint (nnpc, nnpc_save);
+
+ npc = 0;
+ nnpc = 0;
+ }
+}
+
+
+static struct gdbarch *
+sparc64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+ struct gdbarch_tdep *tdep;
+ struct gdbarch *gdbarch;
+
+ /* If there is already a candidate, use it. */
+ arches = gdbarch_list_lookup_by_info (arches, &info);
+ if (arches != NULL)
+ return arches->gdbarch;
+
+ /* Allocate space for the new architecture. */
+ tdep = XMALLOC (struct gdbarch_tdep);
+ gdbarch = gdbarch_alloc (&info, tdep);
+
+ set_gdbarch_long_bit (gdbarch, 64);
+ set_gdbarch_long_long_bit (gdbarch, 64);
+ set_gdbarch_ptr_bit (gdbarch, 64);
+ set_gdbarch_long_double_bit (gdbarch, 128);
+
+ set_gdbarch_num_regs (gdbarch, SPARC64_NUM_REGS);
+ set_gdbarch_register_name (gdbarch, sparc64_register_name);
+ set_gdbarch_register_type (gdbarch, sparc64_register_type);
+ set_gdbarch_num_pseudo_regs (gdbarch, SPARC64_NUM_PSEUDO_REGS);
+ set_gdbarch_pseudo_register_read (gdbarch, sparc64_pseudo_register_read);
+ set_gdbarch_pseudo_register_write (gdbarch, sparc64_pseudo_register_write);
+
+ /* Register numbers of various important registers. */
+ set_gdbarch_sp_regnum (gdbarch, SPARC_SP_REGNUM); /* %sp */
+ set_gdbarch_pc_regnum (gdbarch, SPARC64_PC_REGNUM); /* %pc */
+ set_gdbarch_deprecated_npc_regnum (gdbarch, SPARC64_NPC_REGNUM);
+ set_gdbarch_fp0_regnum (gdbarch, SPARC_F0_REGNUM); /* %f0 */
+
+ /* Call dummy code. */
+ set_gdbarch_push_dummy_call (gdbarch, sparc64_push_dummy_call);
+
+ set_gdbarch_extract_return_value (gdbarch, sparc64_extract_return_value);
+ set_gdbarch_store_return_value (gdbarch, sparc64_store_return_value);
+ set_gdbarch_extract_struct_value_address
+ (gdbarch, sparc_extract_struct_value_address);
+ set_gdbarch_use_struct_convention (gdbarch, sparc64_use_struct_convention);
+
+ set_gdbarch_skip_prologue (gdbarch, sparc64_skip_prologue);
+
+ /* Stack grows downward. */
+ set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+
+ set_gdbarch_breakpoint_from_pc (gdbarch, sparc_breakpoint_from_pc);
+ set_gdbarch_decr_pc_after_break (gdbarch, 0);
+ set_gdbarch_function_start_offset (gdbarch, 0);
+
+ set_gdbarch_frame_args_skip (gdbarch, 8);
+
+ set_gdbarch_print_insn (gdbarch, print_insn_sparc);
+
+ set_gdbarch_software_single_step (gdbarch, sparc_software_single_step);
+
+ set_gdbarch_unwind_dummy_id (gdbarch, sparc_unwind_dummy_id);
+
+ set_gdbarch_unwind_pc (gdbarch, sparc64_unwind_pc);
+
+ frame_base_set_default (gdbarch, &sparc64_frame_base);
+
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch);
+
+ frame_unwind_append_sniffer (gdbarch, sparc64_frame_sniffer);
+
+ return gdbarch;
+}
+
+/* Helper functions for dealing with register windows. */
+
+void
+sparc_supply_rwindow (CORE_ADDR sp, int regnum)
+{
+ int offset = 0;
+ char buf[8];
+ int i;
+
+ if (sp & 1)
+ {
+ /* Registers are 64-bit. */
+ sp += BIAS;
+
+ for (i = SPARC_L0_REGNUM; i <= SPARC_I7_REGNUM; i++)
+ {
+ if (regnum == i || regnum == -1)
+ {
+ target_read_memory (sp + ((i - SPARC_L0_REGNUM) * 8), buf, 8);
+ supply_register (i, buf);
+ }
+ }
+ }
+ else
+ {
+ /* Registers are 32-bit. Toss any sign-extension of the stack
+ pointer. */
+ sp &= 0xffffffffUL;
+
+ /* Clear out the top half of the temporary buffer, and put the
+ register value in the bottom half if we're in 64-bit mode. */
+ if (gdbarch_ptr_bit (current_gdbarch) == 64)
+ {
+ memset (buf, 0, 4);
+ offset = 4;
+ }
+
+ for (i = SPARC_L0_REGNUM; i <= SPARC_I7_REGNUM; i++)
+ {
+ if (regnum == i || regnum == -1)
+ {
+ target_read_memory (sp + ((i - SPARC_L0_REGNUM) * 4),
+ buf + offset, 4);
+ supply_register (i, buf);
+ }
+ }
+ }
+}
+
+void
+sparc_fill_rwindow (CORE_ADDR sp, int regnum)
+{
+ int offset = 0;
+ char buf[8];
+ int i;
+
+ if (sp & 1)
+ {
+ /* Registers are 64-bit. */
+ sp += BIAS;
+
+ for (i = SPARC_L0_REGNUM; i <= SPARC_I7_REGNUM; i++)
+ {
+ if (regnum == -1 || regnum == SPARC_SP_REGNUM || regnum == i)
+ {
+ regcache_collect (i, buf);
+ target_write_memory (sp + ((i - SPARC_L0_REGNUM) * 8), buf, 8);
+ }
+ }
+ }
+ else
+ {
+ /* Registers are 32-bit. Toss any sign-extension of the stack
+ pointer. */
+ sp &= 0xffffffffUL;
+
+ /* Only use the bottom half if we're in 64-bit mode. */
+ if (gdbarch_ptr_bit (current_gdbarch) == 64)
+ offset = 4;
+
+ for (i = SPARC_L0_REGNUM; i <= SPARC_I7_REGNUM; i++)
+ {
+ if (regnum == -1 || regnum == SPARC_SP_REGNUM || regnum == i)
+ {
+ regcache_collect (i, buf);
+ target_write_memory (sp + ((i - SPARC_L0_REGNUM) * 4),
+ buf + offset, 4);
+ }
+ }
+ }
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+void _initialize_sparc64_tdep (void);
+
+void
+_initialize_sparc64_tdep (void)
+{
+ register_gdbarch_init (bfd_arch_sparc, sparc64_gdbarch_init);
+}
diff --git a/gdb/sparc64-tdep.h b/gdb/sparc64-tdep.h
new file mode 100644
index 00000000000..e7b910d55fe
--- /dev/null
+++ b/gdb/sparc64-tdep.h
@@ -0,0 +1,103 @@
+/* Target-dependent code for UltraSPARC.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef SPARC64_TDEP_H
+#define SPARC62_TDEP_H 1
+
+/* Register numbers of various important registers. */
+
+enum sparc_regnum
+{
+ SPARC_G0_REGNUM, /* %g0 */
+ SPARC_G1_REGNUM,
+ SPARC_G2_REGNUM,
+ SPARC_G3_REGNUM,
+ SPARC_G4_REGNUM,
+ SPARC_G5_REGNUM,
+ SPARC_G6_REGNUM,
+ SPARC_G7_REGNUM, /* %g7 */
+ SPARC_O0_REGNUM, /* %o0 */
+ SPARC_O1_REGNUM,
+ SPARC_O2_REGNUM,
+ SPARC_O3_REGNUM,
+ SPARC_O4_REGNUM,
+ SPARC_O5_REGNUM,
+ SPARC_SP_REGNUM, /* %sp (%o6) */
+ SPARC_O7_REGNUM, /* %o7 */
+ SPARC_L0_REGNUM, /* %l0 */
+ SPARC_L1_REGNUM,
+ SPARC_L2_REGNUM,
+ SPARC_L3_REGNUM,
+ SPARC_L4_REGNUM,
+ SPARC_L5_REGNUM,
+ SPARC_L6_REGNUM,
+ SPARC_L7_REGNUM, /* %l7 */
+ SPARC_I0_REGNUM, /* %i0 */
+ SPARC_I1_REGNUM,
+ SPARC_I2_REGNUM,
+ SPARC_I3_REGNUM,
+ SPARC_I4_REGNUM,
+ SPARC_I5_REGNUM,
+ SPARC_FP_REGNUM, /* %fp (%i6) */
+ SPARC_I7_REGNUM, /* %i7 */
+ SPARC_F0_REGNUM, /* %f0 */
+ SPARC_F31_REGNUM = SPARC_F0_REGNUM + 31 /* %f31 */
+};
+
+enum sparc64_regnum
+{
+ SPARC64_F32_REGNUM = SPARC_F0_REGNUM + 32, /* %f32 */
+ SPARC64_F62_REGNUM = SPARC64_F32_REGNUM + 15, /* %f62 */
+ SPARC64_PC_REGNUM, /* %pc */
+ SPARC64_NPC_REGNUM, /* %npc */
+ SPARC64_STATE_REGNUM,
+ SPARC64_FSR_REGNUM, /* %fsr */
+ SPARC64_FPRS_REGNUM, /* %fprs */
+ SPARC64_Y_REGNUM, /* %y */
+
+ /* Pseudo registers. */
+ SPARC64_CWP_REGNUM, /* %cwp */
+ SPARC64_PSTATE_REGNUM, /* %pstate */
+ SPARC64_ASI_REGNUM, /* %asi */
+ SPARC64_CCR_REGNUM, /* %ccr */
+ SPARC64_D0_REGNUM, /* %d0 */
+ SPARC64_D10_REGNUM = SPARC64_D0_REGNUM + 5, /* %d10 */
+ SPARC64_D30_REGNUM = SPARC64_D0_REGNUM + 15, /* %d30 */
+ SPARC64_D32_REGNUM = SPARC64_D0_REGNUM + 16, /* %d32 */
+ SPARC64_D62_REGNUM = SPARC64_D0_REGNUM + 31, /* %d62 */
+ SPARC64_Q0_REGNUM, /* %q0 */
+ SPARC64_Q8_REGNUM = SPARC64_Q0_REGNUM + 2, /* %q8 */
+ SPARC64_Q28_REGNUM = SPARC64_Q0_REGNUM + 7, /* %q28 */
+ SPARC64_Q32_REGNUM = SPARC64_Q0_REGNUM + 8, /* %q32 */
+ SPARC64_Q60_REGNUM = SPARC64_Q0_REGNUM + 15 /* %q60 */
+};
+
+extern void sparc_supply_rwindow (CORE_ADDR sp, int regnum);
+extern void sparc_fill_rwindow (CORE_ADDR sp, int regnum);
+
+/* Functions exported from sparc64fbsd-tdep.c. */
+
+extern void sparc64fbsd_supply_reg (const char *regs, int regnum);
+extern void sparc64fbsd_fill_reg (char *regs, int regnum);
+extern void sparc64fbsd_supply_fpreg (const char *regs, int regnum);
+extern void sparc64fbsd_fill_fpreg (char *regs, int regnum);
+
+#endif /* sparc64-tdep.h */
diff --git a/gdb/sparc64fbsd-nat.c b/gdb/sparc64fbsd-nat.c
new file mode 100644
index 00000000000..26c58d8d13b
--- /dev/null
+++ b/gdb/sparc64fbsd-nat.c
@@ -0,0 +1,80 @@
+/* Native-dependent code for FreeBSD/sparc64.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+
+#include "sparc64-tdep.h"
+#include "sparcbsd-nat.h"
+
+/* Determine whether `struct reg' contains register REGNUM. */
+
+static int
+sparc64fbsd_reg_supplies_p (int regnum)
+{
+ /* Integer registers. */
+ if ((regnum >= SPARC_G0_REGNUM && regnum <= SPARC_G7_REGNUM)
+ || (regnum >= SPARC_O0_REGNUM && regnum <= SPARC_O7_REGNUM)
+ || (regnum >= SPARC_L0_REGNUM && regnum <= SPARC_L7_REGNUM)
+ || (regnum >= SPARC_I0_REGNUM && regnum <= SPARC_I7_REGNUM))
+ return 1;
+
+ /* Control registers. */
+ if (regnum == SPARC64_PC_REGNUM
+ || regnum == SPARC64_NPC_REGNUM
+ || regnum == SPARC64_STATE_REGNUM
+ || regnum == SPARC64_FPRS_REGNUM
+ || regnum == SPARC64_Y_REGNUM)
+ return 1;
+
+ return 0;
+}
+
+/* Determine whether `struct fpreg' contains register REGNUM. */
+
+static int
+sparc64fbsd_fpreg_supplies_p (int regnum)
+{
+ /* Floating-point registers. */
+ if ((regnum >= SPARC_F0_REGNUM && regnum <= SPARC_F31_REGNUM)
+ || (regnum >= SPARC64_F32_REGNUM && regnum <= SPARC64_F62_REGNUM))
+ return 1;
+
+ /* Control registers. */
+ if (regnum == SPARC64_FSR_REGNUM)
+ return 1;
+
+ return 0;
+}
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+void _initialize_sparc64fbsd_nat (void);
+
+void
+_initialize_sparc64fbsd_nat (void)
+{
+ sparcbsd_supply_reg = sparc64fbsd_supply_reg;
+ sparcbsd_fill_reg = sparc64fbsd_fill_reg;
+ sparcbsd_supply_fpreg = sparc64fbsd_supply_fpreg;
+ sparcbsd_fill_fpreg = sparc64fbsd_fill_fpreg;
+
+ sparcbsd_reg_supplies_p = sparc64fbsd_reg_supplies_p;
+ sparcbsd_fpreg_supplies_p = sparc64fbsd_fpreg_supplies_p;
+}
diff --git a/gdb/sparc64fbsd-tdep.c b/gdb/sparc64fbsd-tdep.c
new file mode 100644
index 00000000000..2b910c1b33d
--- /dev/null
+++ b/gdb/sparc64fbsd-tdep.c
@@ -0,0 +1,237 @@
+/* Target-dependent code for FreeBSD/sparc64.
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "target.h"
+
+#include "gdb_string.h"
+
+#include "sparc64-tdep.h"
+
+/* From <machine/reg.h>. */
+
+/* Offset of registers in `struct reg'. */
+int sparc64fbsd_r_global_offset = (0 * 8);
+int sparc64fbsd_r_out_offset = (8 * 8);
+int sparc64fbsd_r_fprs_offset = (16 * 8);
+int sparc64fbsd_r_tnpc_offset = (24 * 8);
+int sparc64fbsd_r_tpc_offset = (25 * 8);
+int sparc64fbsd_r_tstate_offset = (26 * 8);
+int sparc64fbsd_r_y_offset = (28 * 8);
+
+/* Size of `struct reg' and `struct fpreg'. */
+int sparc64fbsd_sizeof_struct_reg = 256;
+int sparc64fbsd_sizeof_struct_fpreg = 272;
+
+void
+sparc64fbsd_supply_reg (const char *regs, int regnum)
+{
+ char buf[8];
+ int i;
+
+ if (regnum == SPARC64_PC_REGNUM || regnum == -1)
+ supply_register (SPARC64_PC_REGNUM, regs + sparc64fbsd_r_tpc_offset);
+
+ if (regnum == SPARC64_NPC_REGNUM || regnum == -1)
+ supply_register (SPARC64_NPC_REGNUM, regs + sparc64fbsd_r_tnpc_offset);
+
+ if (regnum == SPARC64_STATE_REGNUM || regnum == -1)
+ supply_register (SPARC64_STATE_REGNUM, regs + sparc64fbsd_r_tstate_offset);
+
+ if (regnum == SPARC64_FPRS_REGNUM || regnum == -1)
+ supply_register (SPARC64_FPRS_REGNUM, regs + sparc64fbsd_r_fprs_offset);
+
+ if (regnum == SPARC64_Y_REGNUM || regnum == -1)
+ supply_register (SPARC64_Y_REGNUM, regs + sparc64fbsd_r_y_offset);
+
+ if ((regnum >= SPARC_G0_REGNUM && regnum <= SPARC_G7_REGNUM) || regnum == -1)
+ {
+ if (regnum == SPARC_G0_REGNUM || regnum == -1)
+ supply_register (SPARC_G0_REGNUM, NULL); /* %g0 is always zero. */
+ for (i = SPARC_G1_REGNUM; i <= SPARC_G7_REGNUM; i++)
+ {
+ if (regnum == i || regnum == -1)
+ supply_register (i, (regs + sparc64fbsd_r_global_offset
+ + ((i - SPARC_G0_REGNUM) * 8)));
+ }
+ }
+
+ if ((regnum >= SPARC_O0_REGNUM && regnum <= SPARC_O7_REGNUM) || regnum == -1)
+ {
+ for (i = SPARC_O0_REGNUM; i <= SPARC_O7_REGNUM; i++)
+ {
+ if (regnum == i || regnum == -1)
+ supply_register (i, (regs + sparc64fbsd_r_out_offset
+ + ((i - SPARC_O0_REGNUM) * 8)));
+ }
+ }
+
+ /* Inputs and Locals are stored onto the stack by by the kernel. */
+ if ((regnum >= SPARC_L0_REGNUM && regnum <= SPARC_I7_REGNUM) || regnum == -1)
+ {
+ ULONGEST sp;
+
+ regcache_cooked_read_unsigned (current_regcache, SPARC_SP_REGNUM, &sp);
+ sparc_supply_rwindow (sp, regnum);
+ }
+}
+
+void
+sparc64fbsd_fill_reg (char *regs, int regnum)
+{
+ char buf[8];
+ int i;
+
+ if (regnum == SPARC64_PC_REGNUM || regnum == -1)
+ regcache_collect (SPARC64_PC_REGNUM, regs + sparc64fbsd_r_tpc_offset);
+
+ if (regnum == SPARC64_NPC_REGNUM || regnum == -1)
+ regcache_collect (SPARC64_NPC_REGNUM, regs + sparc64fbsd_r_tnpc_offset);
+
+ if (regnum == SPARC64_FPRS_REGNUM || regnum == -1)
+ regcache_collect (SPARC64_FPRS_REGNUM, regs + sparc64fbsd_r_fprs_offset);
+
+ if (regnum == SPARC64_Y_REGNUM || regnum == -1)
+ regcache_collect (SPARC64_Y_REGNUM, regs + sparc64fbsd_r_y_offset);
+
+ if ((regnum >= SPARC_G0_REGNUM && regnum <= SPARC_G7_REGNUM) || regnum == -1)
+ {
+ /* %g0 is always zero. */
+ for (i = SPARC_G1_REGNUM; i <= SPARC_G7_REGNUM; i++)
+ {
+ if (regnum == i || regnum == -1)
+ regcache_collect (i, (regs + sparc64fbsd_r_global_offset
+ + ((i - SPARC_G0_REGNUM) * 8)));
+ }
+ }
+
+ if ((regnum >= SPARC_O0_REGNUM && regnum <= SPARC_O7_REGNUM) || regnum == -1)
+ {
+ for (i = SPARC_O0_REGNUM; i <= SPARC_O7_REGNUM; i++)
+ {
+ if (regnum == i || regnum == -1)
+ regcache_collect (i, (regs + sparc64fbsd_r_out_offset
+ + ((i - SPARC_O0_REGNUM) * 8)));
+ }
+ }
+
+ /* Responsibility for the stack regs is pushed off onto the caller. */
+}
+
+void
+sparc64fbsd_supply_fpreg (const char *fpregs, int regnum)
+{
+ int i;
+
+ for (i = 0; i < 32; i++)
+ {
+ if (regnum == (SPARC_F0_REGNUM + i) || regnum == -1)
+ supply_register (SPARC_F0_REGNUM + i, fpregs + (i * 4));
+ }
+
+ for (i = 0; i < 16; i++)
+ {
+ if (regnum == (SPARC64_F32_REGNUM + i) || regnum == -1)
+ supply_register (SPARC64_F32_REGNUM + i, fpregs + (32 * 4) + (i * 8));
+ }
+
+ if (regnum == SPARC64_FSR_REGNUM || regnum == -1)
+ supply_register (SPARC64_FSR_REGNUM, fpregs + (32 * 4) + (16 * 8));
+}
+
+void
+sparc64fbsd_fill_fpreg (char *fpregs, int regnum)
+{
+ int i;
+
+ for (i = 0; i < 32; i++)
+ {
+ if (regnum == (SPARC_F0_REGNUM + i) || regnum == -1)
+ regcache_collect (SPARC_F0_REGNUM + i, fpregs + (i * 4));
+ }
+
+ for (i = 0; i < 16; i++)
+ {
+ if (regnum == (SPARC64_F32_REGNUM + i) || regnum == -1)
+ regcache_collect (SPARC64_F32_REGNUM + i, fpregs + (32 * 4) + (i * 8));
+ }
+
+ if (regnum == SPARC64_FSR_REGNUM || regnum == -1)
+ regcache_collect (SPARC64_FSR_REGNUM, fpregs + (32 * 4) + (16 * 8));
+}
+
+
+static void
+fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
+ CORE_ADDR ignore)
+{
+ switch (which)
+ {
+ case 0: /* Integer registers */
+ if (core_reg_size != sparc64fbsd_sizeof_struct_reg)
+ warning ("Wrong size register set in core file.");
+ else
+ sparc64fbsd_supply_reg (core_reg_sect, -1);
+ break;
+
+ case 2: /* Floating pointer registers */
+ if (core_reg_size != sparc64fbsd_sizeof_struct_fpreg)
+ warning ("Wrong size FP register set in core file.");
+ else
+ sparc64fbsd_supply_fpreg (core_reg_sect, -1);
+ break;
+
+ default:
+ /* Don't know what kind of register request this is; just ignore it. */
+ break;
+ }
+}
+
+static struct core_fns sparc64fbsd_core_fns =
+{
+ bfd_target_elf_flavour, /* core_flavour */
+ default_check_format, /* check_format */
+ default_core_sniffer, /* core_sniffer */
+ fetch_core_registers, /* core_read_registers */
+ NULL
+};
+
+
+static void
+sparc64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+ /* Nothing yet. */
+}
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+void _initialize_sparc64fbsd_tdep (void);
+
+void
+_initialize_sparc64fbsd_tdep (void)
+{
+ gdbarch_register_osabi (bfd_arch_sparc, bfd_mach_sparc_v9,
+ GDB_OSABI_FREEBSD_ELF, sparc64fbsd_init_abi);
+
+ add_core_fns (&sparc64fbsd_core_fns);
+}
diff --git a/gdb/sparcbsd-nat.c b/gdb/sparcbsd-nat.c
new file mode 100644
index 00000000000..8ab95375d08
--- /dev/null
+++ b/gdb/sparcbsd-nat.c
@@ -0,0 +1,126 @@
+/* Native-dependent code for SPARC BSD's.
+
+ Copyright 2002, 2003 Free Software Foundation, Inc.
+ Based on code contributed by Wasabi Systems, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include "defs.h"
+#include "inferior.h"
+#include "regcache.h"
+
+/* FIXME: Should be changed to sparc-tdep.h when the old code is gone. */
+#include "sparc64-tdep.h"
+#include "sparcbsd-nat.h"
+
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+
+/* Functions translating between `struct reg' and `struct fpreg' and
+ GDB's register cache. */
+void (*sparcbsd_supply_reg)(const char *, int);
+void (*sparcbsd_fill_reg)(char *, int);
+void (*sparcbsd_supply_fpreg)(const char *, int);
+void (*sparcbsd_fill_fpreg)(char *, int);
+
+/* Functions indication whether `struct reg' or `struct fpreg' provides
+ a certain register. */
+int (*sparcbsd_reg_supplies_p)(int);
+int (*sparcbsd_fpreg_supplies_p)(int);
+
+void
+fetch_inferior_registers (int regnum)
+{
+ if (regnum == -1 || sparcbsd_reg_supplies_p (regnum))
+ {
+ struct reg regs;
+
+ if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+ perror_with_name ("Couldn't get registers");
+
+ sparcbsd_supply_reg ((char *) &regs, regnum);
+ if (regnum != -1)
+ return;
+ }
+
+ if (regnum == -1 || sparcbsd_fpreg_supplies_p (regnum))
+ {
+ struct fpreg fpregs;
+
+ if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+ perror_with_name ("Couldn't get floating-point registers");
+
+ sparcbsd_supply_fpreg ((char *) &fpregs, regnum);
+ if (regnum != -1)
+ return;
+ }
+}
+
+void
+store_inferior_registers (int regnum)
+{
+ if (regnum == -1 || sparcbsd_reg_supplies_p (regnum))
+ {
+ struct reg regs;
+
+ if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+ perror_with_name ("Couldn't get registers");
+
+ sparcbsd_fill_reg ((char *) &regs, regnum);
+
+ if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+ perror_with_name ("Couldn't write registers");
+
+ /* Deal with the stack regs. */
+ if (regnum == -1 || regnum == SPARC_SP_REGNUM
+ || (regnum >= SPARC_L0_REGNUM && regnum <= SPARC_I7_REGNUM))
+ {
+ ULONGEST sp;
+
+ regcache_cooked_read_unsigned (current_regcache,
+ SPARC_SP_REGNUM, &sp);
+ sparc_fill_rwindow (sp, regnum);
+ }
+
+ if (regnum != -1)
+ return;
+ }
+
+ if (regnum == -1 || sparcbsd_fpreg_supplies_p (regnum))
+ {
+ struct fpreg fpregs;
+
+ if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+ perror_with_name ("Couldn't get floating-point registers");
+
+ sparcbsd_fill_fpreg ((char *) &fpregs, regnum);
+
+ if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
+ (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+ perror_with_name ("Couldn't write floating-point registers");
+
+ if (regnum != -1)
+ return;
+ }
+}
diff --git a/gdb/config/mips/xm-irix4.h b/gdb/sparcbsd-nat.h
index 8e0bfb539ef..326d669fe28 100644
--- a/gdb/config/mips/xm-irix4.h
+++ b/gdb/sparcbsd-nat.h
@@ -1,6 +1,6 @@
-/* Definitions for irix4 hosting support.
+/* Native-dependent code for SPARC BSD's.
- Copyright 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -19,16 +19,19 @@
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* This is for the iris. */
+#ifndef SPARCBSD_NAT_H
+#define SPARCBSD_NAT_H
-#include "mips/xm-irix3.h"
+/* Functions translating between `struct reg' and `struct fpreg' and
+ GDB's register cache. */
+extern void (*sparcbsd_supply_reg)(const char *, int);
+extern void (*sparcbsd_fill_reg)(char *, int);
+extern void (*sparcbsd_supply_fpreg)(const char *, int);
+extern void (*sparcbsd_fill_fpreg)(char *, int);
-#define BROKEN_SIGINFO_H /* <sys/siginfo.h> si_pid & si_uid are bogus */
+/* Functions indication whether `struct reg' or `struct fpreg' provides
+ a certain register. */
+extern int (*sparcbsd_reg_supplies_p)(int);
+extern int (*sparcbsd_fpreg_supplies_p)(int);
-/* Irix 4.0.1 and later have termios. Not sure about earlier versions. */
-#undef HAVE_TERMIO
-#define HAVE_TERMIOS
-
-/* This enables reliable signals (and the associated setjmp/longjmp), and gives
- bsdish prototypes for getpgrp/setpgrg/setgroups and initgroups. */
-#define _BSD_COMPAT
+#endif /* sparcbsd-nat.h */
diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c
index 6cd0e3f3a85..f2595074048 100644
--- a/gdb/sparcnbsd-tdep.c
+++ b/gdb/sparcnbsd-tdep.c
@@ -59,8 +59,8 @@ sparcnbsd_supply_reg32 (char *regs, int regno)
if (regno == PC_REGNUM || regno == -1)
supply_register (PC_REGNUM, regs + REG32_OFFSET_PC);
- if (regno == NPC_REGNUM || regno == -1)
- supply_register (NPC_REGNUM, regs + REG32_OFFSET_NPC);
+ if (regno == DEPRECATED_NPC_REGNUM || regno == -1)
+ supply_register (DEPRECATED_NPC_REGNUM, regs + REG32_OFFSET_NPC);
if (regno == Y_REGNUM || regno == -1)
supply_register (Y_REGNUM, regs + REG32_OFFSET_Y);
@@ -126,8 +126,8 @@ sparcnbsd_supply_reg64 (char *regs, int regno)
if (regno == PC_REGNUM || regno == -1)
supply_register (PC_REGNUM, regs + REG64_OFFSET_PC);
- if (regno == NPC_REGNUM || regno == -1)
- supply_register (NPC_REGNUM, regs + REG64_OFFSET_NPC);
+ if (regno == DEPRECATED_NPC_REGNUM || regno == -1)
+ supply_register (DEPRECATED_NPC_REGNUM, regs + REG64_OFFSET_NPC);
if (regno == Y_REGNUM || regno == -1)
{
@@ -220,8 +220,8 @@ sparcnbsd_fill_reg32 (char *regs, int regno)
if (regno == PC_REGNUM || regno == -1)
regcache_collect (PC_REGNUM, regs + REG32_OFFSET_PC);
- if (regno == NPC_REGNUM || regno == -1)
- regcache_collect (NPC_REGNUM, regs + REG32_OFFSET_NPC);
+ if (regno == DEPRECATED_NPC_REGNUM || regno == -1)
+ regcache_collect (DEPRECATED_NPC_REGNUM, regs + REG32_OFFSET_NPC);
if (regno == Y_REGNUM || regno == -1)
regcache_collect (Y_REGNUM, regs + REG32_OFFSET_Y);
@@ -261,8 +261,8 @@ sparcnbsd_fill_reg64 (char *regs, int regno)
if (regno == PC_REGNUM || regno == -1)
regcache_collect (PC_REGNUM, regs + REG64_OFFSET_PC);
- if (regno == NPC_REGNUM || regno == -1)
- regcache_collect (NPC_REGNUM, regs + REG64_OFFSET_NPC);
+ if (regno == DEPRECATED_NPC_REGNUM || regno == -1)
+ regcache_collect (DEPRECATED_NPC_REGNUM, regs + REG64_OFFSET_NPC);
if (regno == Y_REGNUM || regno == -1)
regcache_collect (Y_REGNUM, regs + REG64_OFFSET_Y);
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index d99a2caccce..e3400f800c9 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -255,11 +255,11 @@ static struct symbol *current_symbol = NULL;
static struct type **
dbx_lookup_type (int typenums[2])
{
- register int filenum = typenums[0];
- register int index = typenums[1];
+ int filenum = typenums[0];
+ int index = typenums[1];
unsigned old_len;
- register int real_filenum;
- register struct header_file *f;
+ int real_filenum;
+ struct header_file *f;
int f_orig_length;
if (filenum == -1) /* -1,-1 is for temporary types. */
@@ -356,7 +356,7 @@ dbx_lookup_type (int typenums[2])
static struct type *
dbx_alloc_type (int typenums[2], struct objfile *objfile)
{
- register struct type **type_addr;
+ struct type **type_addr;
if (typenums[0] == -1)
{
@@ -468,7 +468,7 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
Returns 0 for success, -1 for error. */
static int
-read_type_number (register char **pp, register int *typenums)
+read_type_number (char **pp, int *typenums)
{
int nbits;
if (**pp == '(')
@@ -1216,11 +1216,11 @@ struct symbol *
define_symbol (CORE_ADDR valu, char *string, int desc, int type,
struct objfile *objfile)
{
- register struct symbol *sym;
+ struct symbol *sym;
char *p = (char *) find_name_end (string);
int deftype;
int synonym = 0;
- register int i;
+ int i;
/* We would like to eliminate nameless symbols, but keep their types.
E.g. stab entry ":t10=*2" should produce a type 10, which is a pointer
@@ -1752,7 +1752,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
name to represent an argument passed in a register.
GCC uses 'P' for the same case. So if we find such a symbol pair
we combine it into one 'P' symbol. For Sun cc we need to do this
- regardless of REG_STRUCT_HAS_ADDR, because the compiler puts out
+ regardless of DEPRECATED_REG_STRUCT_HAS_ADDR, because the compiler puts out
the 'p' symbol even if it never saves the argument onto the stack.
On most machines, we want to preserve both symbols, so that
@@ -1768,8 +1768,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
if (local_symbols
&& local_symbols->nsyms > 0
#ifndef USE_REGISTER_NOT_ARG
- && REG_STRUCT_HAS_ADDR_P ()
- && REG_STRUCT_HAS_ADDR (processing_gcc_compilation,
+ && DEPRECATED_REG_STRUCT_HAS_ADDR_P ()
+ && DEPRECATED_REG_STRUCT_HAS_ADDR (processing_gcc_compilation,
SYMBOL_TYPE (sym))
&& (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_STRUCT
|| TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_UNION
@@ -1941,7 +1941,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
if (synonym)
{
/* Clone the sym and then modify it. */
- register struct symbol *typedef_sym = (struct symbol *)
+ struct symbol *typedef_sym = (struct symbol *)
obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
*typedef_sym = *sym;
SYMBOL_CLASS (typedef_sym) = LOC_TYPEDEF;
@@ -2050,8 +2050,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
/* When passing structures to a function, some systems sometimes pass
the address in a register, not the structure itself. */
- if (REG_STRUCT_HAS_ADDR_P ()
- && REG_STRUCT_HAS_ADDR (processing_gcc_compilation, SYMBOL_TYPE (sym))
+ if (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()
+ && DEPRECATED_REG_STRUCT_HAS_ADDR (processing_gcc_compilation, SYMBOL_TYPE (sym))
&& (SYMBOL_CLASS (sym) == LOC_REGPARM || SYMBOL_CLASS (sym) == LOC_ARG))
{
struct type *symbol_type = check_typedef (SYMBOL_TYPE (sym));
@@ -2061,7 +2061,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
|| (TYPE_CODE (symbol_type) == TYPE_CODE_BITSTRING)
|| (TYPE_CODE (symbol_type) == TYPE_CODE_SET))
{
- /* If REG_STRUCT_HAS_ADDR yields non-zero we have to convert
+ /* If DEPRECATED_REG_STRUCT_HAS_ADDR yields non-zero we have to convert
LOC_REGPARM to LOC_REGPARM_ADDR for structures and unions. */
if (SYMBOL_CLASS (sym) == LOC_REGPARM)
SYMBOL_CLASS (sym) = LOC_REGPARM_ADDR;
@@ -2264,9 +2264,9 @@ error_type (char **pp, struct objfile *objfile)
deciding whether to call read_type. */
static struct type *
-read_type (register char **pp, struct objfile *objfile)
+read_type (char **pp, struct objfile *objfile)
{
- register struct type *type = 0;
+ struct type *type = 0;
struct type *type1;
int typenums[2];
char type_descriptor;
@@ -3004,7 +3004,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
struct next_fnfieldlist *new_fnlist;
struct next_fnfield *new_sublist;
char *main_fn_name;
- register char *p;
+ char *p;
/* Process each list until we find something that is not a member function
or find the end of the functions. */
@@ -3465,7 +3465,7 @@ static int
read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type,
struct objfile *objfile)
{
- register char *p;
+ char *p;
const char *name;
char cpp_abbrev;
struct type *context;
@@ -3727,7 +3727,7 @@ static int
read_struct_fields (struct field_info *fip, char **pp, struct type *type,
struct objfile *objfile)
{
- register char *p;
+ char *p;
struct nextfield *new;
/* We better set p right now, in case there are no fields at all... */
@@ -3948,7 +3948,7 @@ static int
read_tilde_fields (struct field_info *fip, char **pp, struct type *type,
struct objfile *objfile)
{
- register char *p;
+ char *p;
STABS_CONTINUE (pp, objfile);
@@ -4027,9 +4027,9 @@ read_tilde_fields (struct field_info *fip, char **pp, struct type *type,
}
static int
-attach_fn_fields_to_type (struct field_info *fip, register struct type *type)
+attach_fn_fields_to_type (struct field_info *fip, struct type *type)
{
- register int n;
+ int n;
for (n = TYPE_NFN_FIELDS (type);
fip->fnlist != NULL;
@@ -4178,12 +4178,12 @@ attach_fn_fields_to_type (struct field_info *fip, register struct type *type)
for this class's virtual functions. */
static int
-attach_fields_to_type (struct field_info *fip, register struct type *type,
+attach_fields_to_type (struct field_info *fip, struct type *type,
struct objfile *objfile)
{
- register int nfields = 0;
- register int non_public_fields = 0;
- register struct nextfield *scan;
+ int nfields = 0;
+ int non_public_fields = 0;
+ struct nextfield *scan;
/* Count up the number of fields that we have, as well as taking note of
whether or not there are any non-public fields, which requires us to
@@ -4382,7 +4382,7 @@ read_struct_type (char **pp, struct type *type, enum type_code type_code,
array. */
static struct type *
-read_array_type (register char **pp, register struct type *type,
+read_array_type (char **pp, struct type *type,
struct objfile *objfile)
{
struct type *index_type, *element_type, *range_type;
@@ -4445,13 +4445,13 @@ read_array_type (register char **pp, register struct type *type,
Also defines the symbols that represent the values of the type. */
static struct type *
-read_enum_type (register char **pp, register struct type *type,
+read_enum_type (char **pp, struct type *type,
struct objfile *objfile)
{
- register char *p;
+ char *p;
char *name;
- register long n;
- register struct symbol *sym;
+ long n;
+ struct symbol *sym;
int nsyms = 0;
struct pending **symlist;
struct pending *osyms, *syms;
@@ -5119,7 +5119,7 @@ fix_common_block (struct symbol *sym, int valu)
struct pending *next = (struct pending *) SYMBOL_TYPE (sym);
for (; next; next = next->next)
{
- register int j;
+ int j;
for (j = next->nsyms - 1; j >= 0; j--)
SYMBOL_VALUE_ADDRESS (next->symbol[j]) += valu;
}
diff --git a/gdb/stack.c b/gdb/stack.c
index a10e1640866..9a5b4c24db8 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -213,7 +213,7 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
struct block *b = NULL;
int first = 1;
struct dict_iterator iter;
- register struct symbol *sym;
+ struct symbol *sym;
struct value *val;
/* Offset of next stack argument beyond the one we have seen that is
at the highest offset.
@@ -538,7 +538,7 @@ print_frame (struct frame_info *fi,
struct symtab_and_line sal)
{
struct symbol *func;
- register const char *funname = 0;
+ const char *funname = 0;
enum language funlang = language_unknown;
struct ui_stream *stb;
struct cleanup *old_chain;
@@ -899,7 +899,7 @@ frame_info (char *addr_exp, int from_tty)
}
else
{
- register struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi));
+ struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi));
if (msymbol != NULL)
{
funname = DEPRECATED_SYMBOL_NAME (msymbol);
@@ -1139,10 +1139,10 @@ static void
backtrace_command_1 (char *count_exp, int show_locals, int from_tty)
{
struct frame_info *fi;
- register int count;
- register int i;
- register struct frame_info *trailing;
- register int trailing_level;
+ int count;
+ int i;
+ struct frame_info *trailing;
+ int trailing_level;
if (!target_has_stack)
error ("No stack.");
@@ -1347,11 +1347,11 @@ print_block_frame_locals (struct block *b, struct frame_info *fi,
static int
print_block_frame_labels (struct block *b, int *have_default,
- register struct ui_file *stream)
+ struct ui_file *stream)
{
struct dict_iterator iter;
- register struct symbol *sym;
- register int values_printed = 0;
+ struct symbol *sym;
+ int values_printed = 0;
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
@@ -1388,11 +1388,11 @@ print_block_frame_labels (struct block *b, int *have_default,
on the function running in FRAME. */
static void
-print_frame_local_vars (register struct frame_info *fi, register int num_tabs,
- register struct ui_file *stream)
+print_frame_local_vars (struct frame_info *fi, int num_tabs,
+ struct ui_file *stream)
{
- register struct block *block = get_frame_block (fi, 0);
- register int values_printed = 0;
+ struct block *block = get_frame_block (fi, 0);
+ int values_printed = 0;
if (block == 0)
{
@@ -1421,12 +1421,12 @@ print_frame_local_vars (register struct frame_info *fi, register int num_tabs,
/* Same, but print labels. */
static void
-print_frame_label_vars (register struct frame_info *fi, int this_level_only,
- register struct ui_file *stream)
+print_frame_label_vars (struct frame_info *fi, int this_level_only,
+ struct ui_file *stream)
{
- register struct blockvector *bl;
- register struct block *block = get_frame_block (fi, 0);
- register int values_printed = 0;
+ struct blockvector *bl;
+ struct block *block = get_frame_block (fi, 0);
+ int values_printed = 0;
int index, have_default = 0;
char *blocks_printed;
CORE_ADDR pc = get_frame_pc (fi);
@@ -1526,14 +1526,14 @@ catch_info (char *ignore, int from_tty)
}
static void
-print_frame_arg_vars (register struct frame_info *fi,
- register struct ui_file *stream)
+print_frame_arg_vars (struct frame_info *fi,
+ struct ui_file *stream)
{
struct symbol *func = get_frame_function (fi);
- register struct block *b;
+ struct block *b;
struct dict_iterator iter;
- register struct symbol *sym, *sym2;
- register int values_printed = 0;
+ struct symbol *sym, *sym2;
+ int values_printed = 0;
if (func == 0)
{
@@ -1657,11 +1657,11 @@ get_selected_block (CORE_ADDR *addr_in_block)
how much farther the original request asked to go. */
struct frame_info *
-find_relative_frame (register struct frame_info *frame,
- register int *level_offset_ptr)
+find_relative_frame (struct frame_info *frame,
+ int *level_offset_ptr)
{
- register struct frame_info *prev;
- register struct frame_info *frame1;
+ struct frame_info *prev;
+ struct frame_info *frame1;
/* Going up is simple: just do get_prev_frame enough times
or until initial frame is reached. */
@@ -1740,7 +1740,7 @@ current_frame_command (char *level_exp, int from_tty)
static void
up_silently_base (char *count_exp)
{
- register struct frame_info *fi;
+ struct frame_info *fi;
int count = 1, count1;
if (count_exp)
count = parse_and_eval_long (count_exp);
@@ -1777,7 +1777,7 @@ up_command (char *count_exp, int from_tty)
static void
down_silently_base (char *count_exp)
{
- register struct frame_info *frame;
+ struct frame_info *frame;
int count = -1, count1;
if (count_exp)
count = -parse_and_eval_long (count_exp);
@@ -1981,7 +1981,7 @@ func_command (char *arg, int from_tty)
enum language
get_frame_language (void)
{
- register struct symtab *s;
+ struct symtab *s;
enum language flang; /* The language of the current frame */
if (deprecated_selected_frame)
diff --git a/gdb/standalone.c b/gdb/standalone.c
index 6ae8f5398b8..906e37a2b6e 100644
--- a/gdb/standalone.c
+++ b/gdb/standalone.c
@@ -1,6 +1,7 @@
/* Interface to bare machine for GDB running as kernel debugger.
- Copyright 1986, 1989, 1991, 1992, 1993, 1995, 1996, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1989, 1991, 1992, 1993, 1995, 1996, 2000, 2001,
+ 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -130,7 +131,7 @@ int sourcedesc;
open (char *filename, int modes)
{
- register char *next;
+ char *next;
if (modes)
{
@@ -213,8 +214,8 @@ myread (int desc, char *destptr, int size, char *filename)
int
fread (int bufp, int numelts, int eltsize, int stream)
{
- register int elts = min (numelts, sourceleft / eltsize);
- register int len = elts * eltsize;
+ int elts = min (numelts, sourceleft / eltsize);
+ int len = elts * eltsize;
if (stream != sourcedesc)
{
@@ -282,9 +283,9 @@ fprintf (int ign, int a1, int a2, int a3, int a4, int a5, int a6, int a7,
display_string (buffer);
}
-fwrite (register char *buf, int numelts, int size, int stream)
+fwrite (char *buf, int numelts, int size, int stream)
{
- register int i = numelts * size;
+ int i = numelts * size;
while (i-- > 0)
fputc (*buf++, stream);
}
@@ -560,7 +561,7 @@ int kdb_stack_end;
_initialize_standalone (void)
{
- register char *next;
+ char *next;
/* Find start of data on files. */
diff --git a/gdb/std-regs.c b/gdb/std-regs.c
index 1e8f3c8c8e6..0bce7edd1f3 100644
--- a/gdb/std-regs.c
+++ b/gdb/std-regs.c
@@ -90,7 +90,7 @@ value_of_builtin_frame_fp_reg (struct frame_info *frame)
memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
else
ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
- get_frame_base (frame));
+ get_frame_base_address (frame));
return val;
}
}
diff --git a/gdb/sun3-nat.c b/gdb/sun3-nat.c
index 1df78589bdb..6c52d3388c2 100644
--- a/gdb/sun3-nat.c
+++ b/gdb/sun3-nat.c
@@ -47,13 +47,13 @@ fetch_inferior_registers (int regno)
memcpy (deprecated_registers, &inferior_registers, 16 * 4);
if (FP0_REGNUM >= 0)
- memcpy (&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
&inferior_fp_registers, sizeof inferior_fp_registers.fps_regs);
- *(int *) &deprecated_registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
- *(int *) &deprecated_registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
+ *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
if (FP0_REGNUM >= 0)
- memcpy (&deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
&inferior_fp_registers.fps_control,
sizeof inferior_fp_registers -
sizeof inferior_fp_registers.fps_regs);
@@ -72,15 +72,15 @@ store_inferior_registers (int regno)
memcpy (&inferior_registers, deprecated_registers, 16 * 4);
if (FP0_REGNUM >= 0)
memcpy (&inferior_fp_registers,
- &deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
sizeof inferior_fp_registers.fps_regs);
- inferior_registers.r_ps = *(int *) &&deprecated_registers[REGISTER_BYTE (PS_REGNUM)];
- inferior_registers.r_pc = *(int *) &&deprecated_registers[REGISTER_BYTE (PC_REGNUM)];
+ inferior_registers.r_ps = *(int *) &&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)];
+ inferior_registers.r_pc = *(int *) &&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)];
if (FP0_REGNUM >= 0)
memcpy (&inferior_fp_registers.fps_control,
- &&deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
+ &&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
sizeof inferior_fp_registers -
sizeof inferior_fp_registers.fps_regs);
@@ -131,10 +131,10 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
{
if (FP0_REGNUM >= 0)
{
- memcpy (&&deprecated_registers[REGISTER_BYTE (FP0_REGNUM)],
+ memcpy (&&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
fpustruct->f_fpstatus.fps_regs,
sizeof fpustruct->f_fpstatus.fps_regs);
- memcpy (&&deprecated_registers[REGISTER_BYTE (FPC_REGNUM)],
+ memcpy (&&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
&fpustruct->f_fpstatus.fps_control,
sizeof fpustruct->f_fpstatus -
sizeof fpustruct->f_fpstatus.fps_regs);
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 2677350426c..586ecd10241 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -206,7 +206,7 @@ int auto_solib_limit;
static int
compare_symbols (const void *s1p, const void *s2p)
{
- register struct symbol **s1, **s2;
+ struct symbol **s1, **s2;
s1 = (struct symbol **) s1p;
s2 = (struct symbol **) s2p;
@@ -244,13 +244,13 @@ sort_pst_symbols (struct partial_symtab *pst)
char *
obsavestring (const char *ptr, int size, struct obstack *obstackp)
{
- register char *p = (char *) obstack_alloc (obstackp, size + 1);
+ char *p = (char *) obstack_alloc (obstackp, size + 1);
/* Open-coded memcpy--saves function call time. These strings are usually
short. FIXME: Is this really still true with a compiler that can
inline memcpy? */
{
- register const char *p1 = ptr;
- register char *p2 = p;
+ const char *p1 = ptr;
+ char *p2 = p;
const char *end = ptr + size;
while (p1 != end)
*p2++ = *p1++;
@@ -266,8 +266,8 @@ char *
obconcat (struct obstack *obstackp, const char *s1, const char *s2,
const char *s3)
{
- register int len = strlen (s1) + strlen (s2) + strlen (s3) + 1;
- register char *val = (char *) obstack_alloc (obstackp, len);
+ int len = strlen (s1) + strlen (s2) + strlen (s3) + 1;
+ char *val = (char *) obstack_alloc (obstackp, len);
strcpy (val, s1);
strcat (val, s2);
strcat (val, s3);
@@ -290,7 +290,7 @@ decrement_reading_symtab (void *dummy)
case inline. */
struct symtab *
-psymtab_to_symtab (register struct partial_symtab *pst)
+psymtab_to_symtab (struct partial_symtab *pst)
{
/* If it's been looked up before, return it. */
if (pst->symtab)
@@ -327,8 +327,8 @@ init_entry_point_info (struct objfile *objfile)
/* Examination of non-executable.o files. Short-circuit this stuff. */
objfile->ei.entry_point = INVALID_ENTRY_POINT;
}
- objfile->ei.entry_file_lowpc = INVALID_ENTRY_LOWPC;
- objfile->ei.entry_file_highpc = INVALID_ENTRY_HIGHPC;
+ objfile->ei.deprecated_entry_file_lowpc = INVALID_ENTRY_LOWPC;
+ objfile->ei.deprecated_entry_file_highpc = INVALID_ENTRY_HIGHPC;
objfile->ei.entry_func_lowpc = INVALID_ENTRY_LOWPC;
objfile->ei.entry_func_highpc = INVALID_ENTRY_HIGHPC;
objfile->ei.main_func_lowpc = INVALID_ENTRY_LOWPC;
@@ -710,7 +710,7 @@ syms_from_objfile (struct objfile *objfile,
init_objfile_sect_indices (objfile);
}
-#ifndef IBM6000_TARGET
+#ifndef DEPRECATED_IBM6000_TARGET
/* This is a SVR4/SunOS specific hack, I think. In any event, it
screws RS/6000. sym_offsets should be doing this sort of thing,
because it knows the mapping between bfd sections and
@@ -758,7 +758,7 @@ syms_from_objfile (struct objfile *objfile,
s->offset += s_addr;
}
}
-#endif /* not IBM6000_TARGET */
+#endif /* not DEPRECATED_IBM6000_TARGET */
(*objfile->sf->sym_read) (objfile, mainline);
@@ -854,7 +854,12 @@ symbol_file_add_with_addrs_or_offsets (char *name, int from_tty,
orig_addrs = alloc_section_addr_info (bfd_count_sections (abfd));
my_cleanups = make_cleanup (xfree, orig_addrs);
if (addrs)
- *orig_addrs = *addrs;
+ {
+ int i;
+ orig_addrs->num_sections = addrs->num_sections;
+ for (i = 0; i < addrs->num_sections; i++)
+ orig_addrs->other[i] = addrs->other[i];
+ }
/* If the objfile uses a mapped symbol file, and we have a psymtab for
it, then skip reading any symbols at this time. */
@@ -1377,10 +1382,6 @@ find_sym_fns (struct objfile *objfile)
|| our_flavour == bfd_target_tekhex_flavour)
return; /* No symbols. */
- /* Special kludge for apollo. See dstread.c. */
- if (STREQN (our_target, "apollo", 6))
- our_flavour = (enum bfd_flavour) -2;
-
for (sf = symtab_fns; sf != NULL; sf = sf->next)
{
if (our_flavour == sf->sym_flavour)
@@ -1865,7 +1866,7 @@ reread_symbols (void)
{
if (objfile->obfd)
{
-#ifdef IBM6000_TARGET
+#ifdef DEPRECATED_IBM6000_TARGET
/* If this object is from a shared library, then you should
stat on the library name, not member name. */
@@ -2280,7 +2281,7 @@ deduce_language_from_filename (char *filename)
struct symtab *
allocate_symtab (char *filename, struct objfile *objfile)
{
- register struct symtab *symtab;
+ struct symtab *symtab;
symtab = (struct symtab *)
obstack_alloc (&objfile->symbol_obstack, sizeof (struct symtab));
@@ -2519,9 +2520,9 @@ free_named_symtabs (char *name)
compilation units. We want to blow away any old info about these
compilation units, regardless of which objfiles they arrived in. --gnu. */
- register struct symtab *s;
- register struct symtab *prev;
- register struct partial_symtab *ps;
+ struct symtab *s;
+ struct symtab *prev;
+ struct partial_symtab *ps;
struct blockvector *bv;
int blewit = 0;
@@ -2633,12 +2634,19 @@ start_psymtab_common (struct objfile *objfile,
}
/* Add a symbol with a long value to a psymtab.
- Since one arg is a struct, we pass in a ptr and deref it (sigh). */
-
-/* NOTE: carlton/2002-12-18: I've modified this function to return the
- partial symbol in question. But pay heed to the 'const' qualifier
- in front: these partial symbols are stored in a bcache, and bad
- things will happen if you modify them. */
+ Since one arg is a struct, we pass in a ptr and deref it (sigh).
+ Return the partial symbol that has been added. */
+
+/* NOTE: carlton/2003-09-11: The reason why we return the partial
+ symbol is so that callers can get access to the symbol's demangled
+ name, which they don't have any cheap way to determine otherwise.
+ (Currenly, dwarf2read.c is the only file who uses that information,
+ though it's possible that other readers might in the future.)
+ Elena wasn't thrilled about that, and I don't blame her, but we
+ couldn't come up with a better way to get that information. If
+ it's needed in other situations, we could consider breaking up
+ SYMBOL_SET_NAMES to provide access to the demangled name lookup
+ cache. */
const struct partial_symbol *
add_psymbol_to_list (char *name, int namelength, domain_enum domain,
@@ -2647,7 +2655,7 @@ add_psymbol_to_list (char *name, int namelength, domain_enum domain,
CORE_ADDR coreaddr, /* Value as a CORE_ADDR */
enum language language, struct objfile *objfile)
{
- register struct partial_symbol *psym;
+ struct partial_symbol *psym;
char *buf = alloca (namelength + 1);
/* psymbol is static so that there will be no uninitialized gaps in the
structure which might contain random data, causing cache misses in
@@ -2700,7 +2708,7 @@ add_psymbol_with_dem_name_to_list (char *name, int namelength, char *dem_name,
enum language language,
struct objfile *objfile)
{
- register struct partial_symbol *psym;
+ struct partial_symbol *psym;
char *buf = alloca (namelength + 1);
/* psymbol is static so that there will be no uninitialized gaps in the
structure which might contain random data, causing cache misses in
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index afcafc42fca..794947ff6a0 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -116,10 +116,10 @@ free_symtab_block (struct objfile *objfile, struct block *b)
It is s->free_code that says which alternative to use. */
void
-free_symtab (register struct symtab *s)
+free_symtab (struct symtab *s)
{
- register int i, n;
- register struct blockvector *bv;
+ int i, n;
+ struct blockvector *bv;
switch (s->free_code)
{
@@ -1129,13 +1129,13 @@ maintenance_info_psymtabs (char *regexp, int from_tty)
void
maintenance_check_symtabs (char *ignore, int from_tty)
{
- register struct symbol *sym;
- register struct partial_symbol **psym;
- register struct symtab *s = NULL;
- register struct partial_symtab *ps;
+ struct symbol *sym;
+ struct partial_symbol **psym;
+ struct symtab *s = NULL;
+ struct partial_symtab *ps;
struct blockvector *bv;
- register struct objfile *objfile;
- register struct block *b;
+ struct objfile *objfile;
+ struct block *b;
int length;
ALL_PSYMTABS (objfile, ps)
@@ -1214,7 +1214,7 @@ maintenance_check_symtabs (char *ignore, int from_tty)
static int
block_depth (struct block *block)
{
- register int i = 0;
+ int i = 0;
while ((block = BLOCK_SUPERBLOCK (block)) != NULL)
{
i++;
@@ -1228,7 +1228,7 @@ block_depth (struct block *block)
be freed in free_objfile(). */
void
-extend_psymbol_list (register struct psymbol_allocation_list *listp,
+extend_psymbol_list (struct psymbol_allocation_list *listp,
struct objfile *objfile)
{
int new_size;
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 678e5e5c118..3554be1bba9 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -154,9 +154,9 @@ const struct block *block_found;
struct symtab *
lookup_symtab (const char *name)
{
- register struct symtab *s;
- register struct partial_symtab *ps;
- register struct objfile *objfile;
+ struct symtab *s;
+ struct partial_symtab *ps;
+ struct objfile *objfile;
char *real_path = NULL;
char *full_path = NULL;
@@ -247,8 +247,8 @@ got_symtab:
struct partial_symtab *
lookup_partial_symtab (const char *name)
{
- register struct partial_symtab *pst;
- register struct objfile *objfile;
+ struct partial_symtab *pst;
+ struct objfile *objfile;
char *full_path = NULL;
char *real_path = NULL;
@@ -682,8 +682,8 @@ init_sal (struct symtab_and_line *sal)
struct partial_symtab *
find_pc_sect_psymtab (CORE_ADDR pc, asection *section)
{
- register struct partial_symtab *pst;
- register struct objfile *objfile;
+ struct partial_symtab *pst;
+ struct objfile *objfile;
struct minimal_symbol *msymbol;
/* If we know that this is not a text address, return failure. This is
@@ -929,6 +929,14 @@ lookup_symbol_aux (const char *name, const char *linkage_name,
{
struct symbol *sym;
+ /* Make sure we do something sensible with is_a_field_of_this, since
+ the callers that set this parameter to some non-null value will
+ certainly use it later and expect it to be either 0 or 1.
+ If we don't set it, the contents of is_a_field_of_this are
+ undefined. */
+ if (is_a_field_of_this != NULL)
+ *is_a_field_of_this = 0;
+
/* Search specified block and its superiors. Don't search
STATIC_BLOCK or GLOBAL_BLOCK. */
@@ -945,7 +953,6 @@ lookup_symbol_aux (const char *name, const char *linkage_name,
{
struct value *v = current_language->la_value_of_this (0);
- *is_a_field_of_this = 0;
if (v && check_field (v, name))
{
*is_a_field_of_this = 1;
@@ -1612,12 +1619,12 @@ lookup_transparent_type (const char *name)
struct type *
lookup_transparent_type_aux (const char *name)
{
- register struct symbol *sym;
- register struct symtab *s = NULL;
- register struct partial_symtab *ps;
+ struct symbol *sym;
+ struct symtab *s = NULL;
+ struct partial_symtab *ps;
struct blockvector *bv;
- register struct objfile *objfile;
- register struct block *block;
+ struct objfile *objfile;
+ struct block *block;
/* Now search all the global symbols. Do the symtab's first, then
check the psymtab's. If a psymtab indicates the existence
@@ -1716,8 +1723,8 @@ lookup_transparent_type_aux (const char *name)
struct partial_symtab *
find_main_psymtab (void)
{
- register struct partial_symtab *pst;
- register struct objfile *objfile;
+ struct partial_symtab *pst;
+ struct objfile *objfile;
ALL_PSYMTABS (objfile, pst)
{
@@ -1745,7 +1752,7 @@ find_main_psymtab (void)
*/
struct symbol *
-lookup_block_symbol (register const struct block *block, const char *name,
+lookup_block_symbol (const struct block *block, const char *name,
const char *linkage_name,
const domain_enum domain)
{
@@ -1861,12 +1868,12 @@ find_active_alias (struct symbol *sym, CORE_ADDR addr)
struct symtab *
find_pc_sect_symtab (CORE_ADDR pc, asection *section)
{
- register struct block *b;
+ struct block *b;
struct blockvector *bv;
- register struct symtab *s = NULL;
- register struct symtab *best_s = NULL;
- register struct partial_symtab *ps;
- register struct objfile *objfile;
+ struct symtab *s = NULL;
+ struct symtab *best_s = NULL;
+ struct partial_symtab *ps;
+ struct objfile *objfile;
CORE_ADDR distance = 0;
struct minimal_symbol *msymbol;
@@ -1990,10 +1997,10 @@ struct symtab_and_line
find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent)
{
struct symtab *s;
- register struct linetable *l;
- register int len;
- register int i;
- register struct linetable_entry *item;
+ struct linetable *l;
+ int len;
+ int i;
+ struct linetable_entry *item;
struct symtab_and_line val;
struct blockvector *bv;
struct minimal_symbol *msymbol;
@@ -2403,11 +2410,11 @@ find_line_pc_range (struct symtab_and_line sal, CORE_ADDR *startptr,
Set *EXACT_MATCH nonzero if the value returned is an exact match. */
static int
-find_line_common (register struct linetable *l, register int lineno,
+find_line_common (struct linetable *l, int lineno,
int *exact_match)
{
- register int i;
- register int len;
+ int i;
+ int len;
/* BEST is the smallest linenumber > LINENO so far seen,
or 0 if none has been seen so far.
@@ -2424,7 +2431,7 @@ find_line_common (register struct linetable *l, register int lineno,
len = l->nitems;
for (i = 0; i < len; i++)
{
- register struct linetable_entry *item = &(l->item[i]);
+ struct linetable_entry *item = &(l->item[i]);
if (item->line == lineno)
{
@@ -2532,7 +2539,7 @@ operator_chars (char *p, char **end)
if (isalpha (*p) || *p == '_' || *p == '$')
{
- register char *q = p + 1;
+ char *q = p + 1;
while (isalnum (*q) || *q == '_' || *q == '$')
q++;
*end = q;
@@ -2722,9 +2729,9 @@ output_source_filename (char *name, int *first)
static void
sources_info (char *ignore, int from_tty)
{
- register struct symtab *s;
- register struct partial_symtab *ps;
- register struct objfile *objfile;
+ struct symtab *s;
+ struct partial_symtab *ps;
+ struct objfile *objfile;
int first;
if (!have_full_symbols () && !have_partial_symbols ())
@@ -2868,14 +2875,14 @@ void
search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
struct symbol_search **matches)
{
- register struct symtab *s;
- register struct partial_symtab *ps;
- register struct blockvector *bv;
+ struct symtab *s;
+ struct partial_symtab *ps;
+ struct blockvector *bv;
struct blockvector *prev_bv = 0;
- register struct block *b;
- register int i = 0;
+ struct block *b;
+ int i = 0;
struct dict_iterator iter;
- register struct symbol *sym;
+ struct symbol *sym;
struct partial_symbol **psym;
struct objfile *objfile;
struct minimal_symbol *msymbol;
@@ -3692,9 +3699,9 @@ make_symbol_completion_list (char *text, char *word)
char **
make_file_symbol_completion_list (char *text, char *word, char *srcfile)
{
- register struct symbol *sym;
- register struct symtab *s;
- register struct block *b;
+ struct symbol *sym;
+ struct symtab *s;
+ struct block *b;
struct dict_iterator iter;
/* The symbol we are completing on. Points in same buffer as text. */
char *sym_text;
@@ -3855,9 +3862,9 @@ not_interesting_fname (const char *fname)
char **
make_source_files_completion_list (char *text, char *word)
{
- register struct symtab *s;
- register struct partial_symtab *ps;
- register struct objfile *objfile;
+ struct symtab *s;
+ struct partial_symtab *ps;
+ struct objfile *objfile;
int first = 1;
int list_alloced = 1;
int list_used = 0;
diff --git a/gdb/symtab.h b/gdb/symtab.h
index cc30975ea9e..54d97313ab6 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -35,24 +35,55 @@ struct blockvector;
struct axs_value;
struct agent_expr;
-/* Don't do this; it means that if some .o's are compiled with GNU C
- and some are not (easy to do accidentally the way we configure
- things; also it is a pain to have to "make clean" every time you
- want to switch compilers), then GDB dies a horrible death. */
-/* GNU C supports enums that are bitfields. Some compilers don't. */
-#if 0 && defined(__GNUC__) && !defined(BYTE_BITFIELD)
-#define BYTE_BITFIELD :8;
-#else
-#define BYTE_BITFIELD /*nothing */
-#endif
+/* Some of the structures in this file are space critical.
+ The space-critical structures are:
+
+ struct general_symbol_info
+ struct symbol
+ struct partial_symbol
+
+ These structures are layed out to encourage good packing.
+ They use ENUM_BITFIELD and short int fields, and they order the
+ structure members so that fields less than a word are next
+ to each other so they can be packed together. */
+
+/* Rearranged: used ENUM_BITFIELD and rearranged field order in
+ all the space critical structures (plus struct minimal_symbol).
+ Memory usage dropped from 99360768 bytes to 90001408 bytes.
+ I measured this with before-and-after tests of
+ "HEAD-old-gdb -readnow HEAD-old-gdb" and
+ "HEAD-new-gdb -readnow HEAD-old-gdb" on native i686-pc-linux-gnu,
+ red hat linux 8, with LD_LIBRARY_PATH=/usr/lib/debug,
+ typing "maint space 1" at the first command prompt.
+
+ Here is another measurement (from andrew c):
+ # no /usr/lib/debug, just plain glibc, like a normal user
+ gdb HEAD-old-gdb
+ (gdb) break internal_error
+ (gdb) run
+ (gdb) maint internal-error
+ (gdb) backtrace
+ (gdb) maint space 1
+
+ gdb gdb_6_0_branch 2003-08-19 space used: 8896512
+ gdb HEAD 2003-08-19 space used: 8904704
+ gdb HEAD 2003-08-21 space used: 8396800 (+symtab.h)
+ gdb HEAD 2003-08-21 space used: 8265728 (+gdbtypes.h)
+
+ The third line shows the savings from the optimizations in symtab.h.
+ The fourth line shows the savings from the optimizations in
+ gdbtypes.h. Both optimizations are in gdb HEAD now.
+
+ --chastain 2003-08-21 */
+
+
/* Define a structure for the information that is common to all symbol types,
including minimal symbols, partial symbols, and full symbols. In a
multilanguage environment, some language specific information may need to
- be recorded along with each symbol.
+ be recorded along with each symbol. */
- These fields are ordered to encourage good packing, since we frequently
- have tens or hundreds of thousands of these. */
+/* This structure is space critical. See space comments at the top. */
struct general_symbol_info
{
@@ -107,7 +138,7 @@ struct general_symbol_info
This is used to select one of the fields from the language specific
union above. */
- enum language language BYTE_BITFIELD;
+ ENUM_BITFIELD(language) language : 8;
/* Which section is this symbol in? This is an index into
section_offsets for this objfile. Negative means that the symbol
@@ -228,6 +259,37 @@ extern const char *symbol_demangled_name (const struct general_symbol_info
#define SYMBOL_MATCHES_NATURAL_NAME(symbol, name) \
(strcmp_iw (SYMBOL_NATURAL_NAME (symbol), (name)) == 0)
+/* Classification types for a minimal symbol. These should be taken as
+ "advisory only", since if gdb can't easily figure out a
+ classification it simply selects mst_unknown. It may also have to
+ guess when it can't figure out which is a better match between two
+ types (mst_data versus mst_bss) for example. Since the minimal
+ symbol info is sometimes derived from the BFD library's view of a
+ file, we need to live with what information bfd supplies. */
+
+enum minimal_symbol_type
+{
+ mst_unknown = 0, /* Unknown type, the default */
+ mst_text, /* Generally executable instructions */
+ mst_data, /* Generally initialized data */
+ mst_bss, /* Generally uninitialized data */
+ mst_abs, /* Generally absolute (nonrelocatable) */
+ /* GDB uses mst_solib_trampoline for the start address of a shared
+ library trampoline entry. Breakpoints for shared library functions
+ are put there if the shared library is not yet loaded.
+ After the shared library is loaded, lookup_minimal_symbol will
+ prefer the minimal symbol from the shared library (usually
+ a mst_text symbol) over the mst_solib_trampoline symbol, and the
+ breakpoints will be moved to their true address in the shared
+ library via breakpoint_re_set. */
+ mst_solib_trampoline, /* Shared library trampoline code */
+ /* For the mst_file* types, the names are only guaranteed to be unique
+ within a given .o file. */
+ mst_file_text, /* Static version of mst_text */
+ mst_file_data, /* Static version of mst_data */
+ mst_file_bss /* Static version of mst_bss */
+};
+
/* Define a simple structure used to hold some very basic information about
all defined global symbols (text, data, bss, abs, etc). The only required
information is the general_symbol_info.
@@ -269,37 +331,9 @@ struct minimal_symbol
char *filename;
#endif
- /* Classification types for this symbol. These should be taken as "advisory
- only", since if gdb can't easily figure out a classification it simply
- selects mst_unknown. It may also have to guess when it can't figure out
- which is a better match between two types (mst_data versus mst_bss) for
- example. Since the minimal symbol info is sometimes derived from the
- BFD library's view of a file, we need to live with what information bfd
- supplies. */
+ /* Classification type for this minimal symbol. */
- enum minimal_symbol_type
- {
- mst_unknown = 0, /* Unknown type, the default */
- mst_text, /* Generally executable instructions */
- mst_data, /* Generally initialized data */
- mst_bss, /* Generally uninitialized data */
- mst_abs, /* Generally absolute (nonrelocatable) */
- /* GDB uses mst_solib_trampoline for the start address of a shared
- library trampoline entry. Breakpoints for shared library functions
- are put there if the shared library is not yet loaded.
- After the shared library is loaded, lookup_minimal_symbol will
- prefer the minimal symbol from the shared library (usually
- a mst_text symbol) over the mst_solib_trampoline symbol, and the
- breakpoints will be moved to their true address in the shared
- library via breakpoint_re_set. */
- mst_solib_trampoline, /* Shared library trampoline code */
- /* For the mst_file* types, the names are only guaranteed to be unique
- within a given .o file. */
- mst_file_text, /* Static version of mst_text */
- mst_file_data, /* Static version of mst_data */
- mst_file_bss /* Static version of mst_bss */
- }
- type BYTE_BITFIELD;
+ ENUM_BITFIELD(minimal_symbol_type) type : 8;
/* Minimal symbols with the same hash key are kept on a linked
list. This is the link. */
@@ -322,10 +356,7 @@ struct minimal_symbol
/* Different name domains for symbols. Looking up a symbol specifies a
domain and ignores symbol definitions in other name domains. */
-/* FIXME: carlton/2002-11-22: This name me crazy when doing C++
- namespace stuff. Maybe name_space_enum and XXX_NAME_SPACE? */
-
-typedef enum
+typedef enum domain_enum_tag
{
/* UNDEF_DOMAIN is used when a domain has not been discovered or
none of the following apply. This usually indicates an error either
@@ -571,6 +602,8 @@ struct alias_list
struct alias_list *next;
};
+/* This structure is space critical. See space comments at the top. */
+
struct symbol
{
@@ -584,11 +617,11 @@ struct symbol
/* Domain code. */
- domain_enum domain BYTE_BITFIELD;
+ ENUM_BITFIELD(domain_enum_tag) domain : 6;
/* Address class */
- enum address_class aclass BYTE_BITFIELD;
+ ENUM_BITFIELD(address_class) aclass : 6;
/* Line number of definition. FIXME: Should we really make the assumption
that nobody will try to debug files longer than 64K lines? What about
@@ -652,6 +685,8 @@ struct symbol
on a partial symtab list and which points to the corresponding
normal symtab once the partial_symtab has been referenced. */
+/* This structure is space critical. See space comments at the top. */
+
struct partial_symbol
{
@@ -661,11 +696,11 @@ struct partial_symbol
/* Name space code. */
- domain_enum domain BYTE_BITFIELD;
+ ENUM_BITFIELD(domain_enum_tag) domain : 6;
/* Address class (for info_symbols) */
- enum address_class aclass BYTE_BITFIELD;
+ ENUM_BITFIELD(address_class) aclass : 6;
};
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ead6cb1987c..94971aa4198 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,116 @@
+2003-09-15 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.asm/asm-source.exp: Add sh*-*-* as supported target.
+ * gdb.asm/sh.inc: New file.
+
+2003-09-11 David Carlton <carlton@kealia.com>
+
+ * gdb.c++/namespace.exp: Add tests for namespace types.
+ * gdb.c++/maint.exp (test_help): Test 'help maint cp namespace'.
+ (test_namespace): New.
+
+2003-09-11 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.base/relocate.exp: Handle new gdb output at startup.
+ * gdb.stabs/weird.exp: Ditto.
+
+2003-09-08 Michael Chastain <mec@shout.net>
+
+ * gdb.base/gdb1250.c: Rename 'gamma' to 'my_gamma'.
+
+2003-09-07 Michael Chastain <mec@shout.net>
+
+ * gdb.cp/classes.exp: Accommodate both 'syntax error' and
+ 'parse error'.
+
+2003-09-07 Mark Kettenis <m.kettenis@osp.nl>
+
+ * gdb.arch/i386-prologue.exp: Add checks for saved registers.
+
+2003-08-30 Michael Chastain <mec@shout.net>
+
+ * gdb.base/selftest.exp: Remove support for m68k*-*-hpux.
+ * gdb.gdb/observer.exp: Ditto.
+ * gdb.gdb/xfullpath.exp: Ditto.
+
+2003-08-29 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.base/interrupt.exp: XFAIL "call function when asleep" for
+ *-*-*bsd*.
+
+2003-08-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * gdb.base/dump.exp: Skip for ia64.
+
+2003-08-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ * gdb.asm/asm-source.exp: Add ia64 support.
+ * gdb.asm/ia64.inc: New file.
+
+2003-08-22 Michael Chastain <mec@shout.net>
+
+ * gdb.cp: New directory.
+ * gdb.cp/*: Copy from gdb.c++/*.
+ * gdb.c++/*: Remove.
+ * Makefile.in: Change gdb.c++ to gdb.cp.
+ * configure.in: Ditto.
+ * configure: Regnerate.
+
+2003-08-18 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.arch/i386-prologue.exp: Add testcase for PR backtrace/1338.
+ * gdb.arch/i386-prologue.c (gdb1338): Add function.
+
+2003-08-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * mi-var-display.exp (-var-list-children weird): Accept function
+ pointers with argument types.
+ * mi1-var-display.exp (-var-list-children weird): Likewise.
+ * mi2-var-display.exp (-var-list-children weird): Likewise.
+
+2003-08-17 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/annota3.exp: Add missing newline.
+
+2003-08-06 Michael Chastain <mec@shout.net>
+
+ * gdb.java/jmisc1.exp: Add test for pr gdb/1322.
+
+2003-08-12 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/float.exp: Add test for SH.
+
+2003-08-10 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.arch/i386-prologue.c, gdb.arch/i386-prologue.exp: New files.
+
+2003-08-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.base/completion.exp: Remove reduntant completion test
+ on filename.
+
+2003-08-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.base/attach.exp, gdb.base/detach.exp, gdb.base/gcore.exp,
+ gdb.mi/mi-basics.exp, gdb.threads/gcore-thread.exp,
+ gdb.trace/save-trace.exp: Make sure that full pathnames are
+ escaped correctly.
+
+2003-08-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * configure.in: Don't generate config.h from config.hin.
+ * configure: Regenerate.
+ * config.hin: Remove file.
+ * gdb.mi/pthreads.c: Remove include of config.h, and other ifdefs.
+ * gdb.threads/pthreads.c: Ditto.
+
+2003-08-07 Daniel Jacobowitz <drow@mvista.com>
+
+ From Kei Sakamoto <sakamoto.kei@renesas.com>:
+ * gdb.asm/asm-source.exp : Add -lgloss to link-flags.
+ * gdb.asm/m32r.inc : Remove an illegal nop after bl instruction.
+ Replace ld24 with seth/add3.
+
2003-09-12 David Carlton <carlton@kealia.com>
* carlton_runnamespace (TESTS): Fix typo in gdb.c++->gdb.cp
@@ -46,6 +159,16 @@
From Kei Sakamoto <sakamoto.kei@renesas.com>:
* gdb.base/relocate.c (dummy): New padding array.
+2003-07-22 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.disasm/8300s.s: Fix syntax of bsr insn.
+
+ * gdb.disasm/h8300s.exp : Minor changes in disassembler output require
+ patterns to be more general, accepting old and new output.
+ Some output chars (such as '+') also must be quoted.
+ Some addresses are displayed numerically instead of
+ symbolically.
+
2003-07-23 Michael Snyder <msnyder@redhat.com>
* gdb.base/return2.exp: Don't test long-long return.
@@ -10711,7 +10834,7 @@ Sun Feb 21 10:55:55 1993 Mike Werner (mtw@poseidon.cygnus.com)
made in a future update.
Local Variables:
-mode: indented-text
+mode: change-log
left-margin: 8
fill-column: 74
version-control: never
diff --git a/gdb/testsuite/config.hin b/gdb/testsuite/config.hin
deleted file mode 100644
index 1333b971c53..00000000000
--- a/gdb/testsuite/config.hin
+++ /dev/null
@@ -1,4 +0,0 @@
-/* config.hin. Generated automatically from configure.in by autoheader. */
-
-/* Define if you have the <pthread.h> header file. */
-#undef HAVE_PTHREAD_H
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index f75ec25d9bf..f5cb0895a2b 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -539,7 +539,6 @@ fi
-
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
@@ -560,7 +559,7 @@ ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:564: checking build system type" >&5
+echo "configure:563: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -584,7 +583,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:588: checking host system type" >&5
+echo "configure:587: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -605,7 +604,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:609: checking target system type" >&5
+echo "configure:608: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -720,7 +719,7 @@ fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:724: checking how to run the C preprocessor" >&5
+echo "configure:723: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -735,13 +734,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 739 "configure"
+#line 738 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -752,13 +751,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 756 "configure"
+#line 755 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -769,13 +768,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 773 "configure"
+#line 772 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -803,17 +802,17 @@ for ac_hdr in pthread.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:807: checking for $ac_hdr" >&5
+echo "configure:806: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 812 "configure"
+#line 811 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -841,12 +840,12 @@ done
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:845: checking for Cygwin environment" >&5
+echo "configure:844: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 850 "configure"
+#line 849 "configure"
#include "confdefs.h"
int main() {
@@ -857,7 +856,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -874,19 +873,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
CYGWIN=
test "$ac_cv_cygwin" = yes && CYGWIN=yes
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:878: checking for mingw32 environment" >&5
+echo "configure:877: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 883 "configure"
+#line 882 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -905,7 +904,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:909: checking for executable suffix" >&5
+echo "configure:908: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -915,7 +914,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -1001,7 +1000,19 @@ fi
trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-DEFS=-DHAVE_CONFIG_H
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}
@@ -1040,7 +1051,7 @@ ac_given_srcdir=$srcdir
trap 'rm -fr `echo "Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
gdb.cp/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \
- gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile config.h:config.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+ gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@@ -1188,113 +1199,6 @@ s%@top_srcdir@%$top_srcdir%g
fi; done
rm -f conftest.s*
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
-ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="config.h:config.hin"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
-
-# This sed command replaces #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-
-rm -f conftest.tail
-while :
-do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
- echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
- else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
- fi
-fi; done
-
EOF
cat >> $CONFIG_STATUS <<EOF
diff --git a/gdb/testsuite/configure.in b/gdb/testsuite/configure.in
index 03fb6991bfd..c60cf576a4d 100644
--- a/gdb/testsuite/configure.in
+++ b/gdb/testsuite/configure.in
@@ -21,7 +21,6 @@
AC_PREREQ(2.13)
AC_INIT(gdb.base)
-AC_CONFIG_HEADER(config.h:config.hin)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
diff --git a/gdb/testsuite/gdb.arch/i386-prologue.c b/gdb/testsuite/gdb.arch/i386-prologue.c
new file mode 100644
index 00000000000..4c92a9c83e5
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/i386-prologue.c
@@ -0,0 +1,37 @@
+void gdb1253 (void);
+void gdb1338 (void);
+
+int
+main (void)
+{
+ gdb1253 ();
+ gdb1338 ();
+ return 0;
+}
+
+/* Relevant part of the prologue from symtab/1253. */
+
+asm(".text\n"
+ " .align 8\n"
+ "gdb1253:\n"
+ " pushl %ebp\n"
+ " xorl %ecx, %ecx\n"
+ " movl %esp, %ebp\n"
+ " pushl %edi\n"
+ " int $0x03\n"
+ " leave\n"
+ " ret\n");
+
+/* Relevant part of the prologue from backtrace/1338. */
+
+asm(".text\n"
+ " .align 8\n"
+ "gdb1338:\n"
+ " pushl %edi\n"
+ " pushl %esi\n"
+ " pushl %ebx\n"
+ " int $0x03\n"
+ " popl %ebx\n"
+ " popl %esi\n"
+ " popl %edi\n"
+ " ret\n");
diff --git a/gdb/testsuite/gdb.arch/i386-prologue.exp b/gdb/testsuite/gdb.arch/i386-prologue.exp
new file mode 100644
index 00000000000..f1c1e72425a
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/i386-prologue.exp
@@ -0,0 +1,78 @@
+# Copyright 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@gnu.org
+
+# This file is part of the gdb testsuite.
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+# Test i386 prologue analyzer.
+
+set prms_id 0
+set bug_id 0
+
+if ![istarget "i?86-*-*"] then {
+ verbose "Skipping i386 prologue tests."
+ return
+}
+
+set testfile "i386-prologue"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# Run to `main' where we begin our tests.
+#
+
+if ![runto_main] then {
+ gdb_suppress_tests
+}
+
+# Testcase from symtab/1253.
+
+gdb_test "continue" "Program received signal SIGTRAP.*" "continue to gdb1253"
+
+gdb_test "backtrace 10" \
+ "#0\[ \t\]*$hex in gdb1253.*\r\n#1\[ \t\]*$hex in main.*" \
+ "backtrace in gdb1253"
+
+gdb_test "info frame" \
+ ".*Saved registers:.*ebp at.*edi at.*eip at.*" \
+ "saved registers in gdb1253"
+
+# Testcase from backtrace/1338.
+
+gdb_test "continue" "Program received signal SIGTRAP.*" "continue to gdb1338"
+
+gdb_test "backtrace 10" \
+ "#0\[ \t\]*$hex in gdb1338.*\r\n#1\[ \t\]*$hex in main.*" \
+ "backtrace in gdb1338"
+
+gdb_test "info frame" \
+ ".*Saved registers:.*ebx at.*esi at.*edi at.*eip at.*" \
+ "saved registers in gdb1338"
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index 3745e6062d3..8b0df38f3f1 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -69,6 +69,7 @@ switch -glob -- [istarget] {
}
"m32r*-*" {
set asm-arch m32r
+ set link-flags "-Wl,--whole-archive -lgloss -Wl,--no-whole-archive"
}
"m6811-*-*" {
set asm-arch m68hc11
@@ -84,6 +85,11 @@ switch -glob -- [istarget] {
"powerpc*-*" {
set asm-arch powerpc
}
+ "sh*-*-*" {
+ set asm-arch sh
+ set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set link-flags "--entry _start"
+ }
"sparc-*-*" {
set asm-arch sparc
}
@@ -102,6 +108,10 @@ switch -glob -- [istarget] {
"m68k-*-*" {
set asm-arch m68k
}
+ "ia64-*-*" {
+ set asm-arch ia64
+ set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ }
}
if { "${asm-arch}" == "" } {
diff --git a/gdb/testsuite/gdb.asm/ia64.inc b/gdb/testsuite/gdb.asm/ia64.inc
new file mode 100644
index 00000000000..d55cd221972
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/ia64.inc
@@ -0,0 +1,49 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ alloc r33=ar.pfs,0,2,0,0
+ mov r32=b0
+ nop.i 0
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ nop.m 0
+ mov ar.pfs=r33
+ mov b0=r32
+ nop.m 0
+ nop.f 0
+ br.ret.sptk.many b0
+ .endm
+
+ .macro gdbasm_call subr
+ nop.m 0
+ nop.f 0
+ br.call.sptk.many b0=\subr
+ .endm
+
+ .macro gdbasm_several_nops
+ nop.m 0
+ nop.i 0
+ nop.i 0
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ break.m 0x0
+ nop.m 0
+ nop.i 0
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ mov r32=r0
+ nop.i 0
+ nop.i 0
+ .endm
+
+ comment "Declare a data variable"
+ .macro gdbasm_datavar name value
+ .data
+\name:
+ .long \value
+ .endm
diff --git a/gdb/testsuite/gdb.asm/m32r.inc b/gdb/testsuite/gdb.asm/m32r.inc
index 6110373df41..fa104cdeacc 100644
--- a/gdb/testsuite/gdb.asm/m32r.inc
+++ b/gdb/testsuite/gdb.asm/m32r.inc
@@ -11,7 +11,7 @@
.endm
.macro gdbasm_call subr
- bl \subr -> nop
+ bl \subr
.endm
.macro gdbasm_several_nops
@@ -30,6 +30,7 @@
comment "crt0 startup"
.macro gdbasm_startup
- ld24 sp,_stack
+ seth sp, #shigh(_stack)
+ add3 sp, sp, #low(_stack)
ldi fp,#0
.endm
diff --git a/gdb/testsuite/gdb.asm/sh.inc b/gdb/testsuite/gdb.asm/sh.inc
new file mode 100644
index 00000000000..88a24c31899
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/sh.inc
@@ -0,0 +1,85 @@
+# You'll find a bunch of nop opcodes in the below macros. They are
+# there to keep the code correctly aligned. Be careful to maintain
+# them when changing the code.
+
+ comment "subroutine declare"
+ .macro gdbasm_declare name
+ .align 1
+ .global \name
+\name:
+ .endm
+
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ mov.l r14,@-r15
+ sts.l pr,@-r15
+ mov r15,r14
+ nop
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ mov r14,r15
+ lds.l @r15+,pr
+ mov.l @r15+,r14
+ rts
+ nop
+ nop
+ .endm
+
+ comment "subroutine end"
+ .macro gdbasm_end name
+ .size \name, .-_foo1
+ .align 1
+ .endm
+
+ comment "subroutine call"
+ .macro gdbasm_call subr
+ mov.l .Lconst\@,r1
+ bra .Lafterconst\@
+ nop
+ nop
+.Lconst\@:
+ .align 2
+ .long \subr
+ .align 1
+.Lafterconst\@:
+ jsr @r1
+ nop
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ sleep
+ nop
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ mov.l .stackaddr,r15
+ bra .afterstackaddr
+ nop
+ nop
+ .align 2
+.stackaddr:
+ .long 196608 ! 0x30000
+ .align 1
+.afterstackaddr:
+ .endm
+
+ comment "Declare a data variable"
+ .macro gdbasm_datavar name value
+ .data
+ .align 2
+ .type \name, @object
+ .size \name, 4
+\name:
+ .long \value
+ .endm
diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp
index 09a2e5ba94b..93086ef609f 100644
--- a/gdb/testsuite/gdb.base/annota3.exp
+++ b/gdb/testsuite/gdb.base/annota3.exp
@@ -331,7 +331,7 @@ gdb_expect_list "annotate ignore count change" "$gdb_prompt$" {
"\r\n\032\032post-prompt\r\n"
"\(\r\n\032\032frames-invalid\r\n\)+"
"\r\n\032\032breakpoint 5\r\n"
- "Breakpoint 5, main \\(\\) at .*annota3.c:46"
+ "Breakpoint 5, main \\(\\) at .*annota3.c:46\r\n"
"\r\n\032\032source .*annota3.c:46:\[0-9\]+:beg:0x\[0-9a-z\]+\r\n"
"1: value = 11\r\n"
"\r\n\032\032stopped\r\n"
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index 66e9f0ec311..ea11087f8af 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -45,6 +45,7 @@ set srcfile ${testfile}.c
set srcfile2 ${testfile}2.c
set binfile ${objdir}/${subdir}/${testfile}
set binfile2 ${objdir}/${subdir}/${testfile}2
+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}]
set cleanupfile ${objdir}/${subdir}/${testfile}.awk
#execute_anywhere "rm -f ${binfile} ${binfile2}"
@@ -76,6 +77,7 @@ if [get_compiler_info ${binfile}] {
proc do_attach_tests {} {
global gdb_prompt
global binfile
+ global escapedbinfile
global srcfile
global testfile
global objdir
@@ -157,13 +159,13 @@ proc do_attach_tests {} {
-re "Load new symbol table from.*y or n.*$" {
send_gdb "y\n"
gdb_expect {
- -re "Reading symbols from $binfile\.\.\.*done.*$gdb_prompt $"\
+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
{pass "(re)set file, before attach1"}
-re "$gdb_prompt $" {fail "(re)set file, before attach1"}
timeout {fail "(timeout) (re)set file, before attach1"}
}
}
- -re "Reading symbols from $binfile\.\.\.*done.*$gdb_prompt $"\
+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
{pass "set file, before attach1"}
-re "$gdb_prompt $" {fail "set file, before attach1"}
timeout {fail "(timeout) set file, before attach1"}
@@ -171,7 +173,7 @@ proc do_attach_tests {} {
send_gdb "attach $testpid\n"
gdb_expect {
- -re "Attaching to program.*`?$binfile'?, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $"\
+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $"\
{pass "attach1, after setting file"}
-re "$gdb_prompt $" {fail "attach1, after setting file"}
timeout {fail "(timeout) attach1, after setting file"}
@@ -192,7 +194,7 @@ proc do_attach_tests {} {
#
send_gdb "detach\n"
gdb_expect {
- -re "Detaching from program: .*$binfile.*$gdb_prompt $"\
+ -re "Detaching from program: .*$escapedbinfile.*$gdb_prompt $"\
{pass "attach1 detach"}
-re "$gdb_prompt $" {fail "attach1 detach"}
timeout {fail "(timeout) attach1 detach"}
@@ -234,7 +236,7 @@ proc do_attach_tests {} {
#
send_gdb "attach $testpid\n"
gdb_expect {
- -re "Attaching to process $testpid.*Reading symbols from $binfile.*main.*at .*$gdb_prompt $"\
+ -re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $"\
{pass "attach2"}
-re "$gdb_prompt $" {fail "attach2"}
timeout {fail "(timeout) attach2"}
@@ -335,7 +337,7 @@ proc do_attach_tests {} {
send_gdb "attach $testpid\n"
gdb_expect {
- -re "Attaching to process $testpid.*Reading symbols from $binfile.*main.*at .*$gdb_prompt $"\
+ -re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $"\
{pass "attach when process' a.out not in cwd"}
-re "$gdb_prompt $" {fail "attach when process' a.out not in cwd"}
timeout {fail "(timeout) attach when process' a.out not in cwd"}
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 1ac5a5092d3..a1ff58a2554 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -611,7 +611,7 @@ gdb_expect {
}
-# The following tests used to simply try to complete `${objdir}/Make',
+# The following tests used to simply try to complete `${objdir}/file',
# and so on. The problem is that ${objdir} can be very long; the
# completed filename may be more than eighty characters wide. When
# this happens, readline tries to manage things, producing output that
@@ -619,7 +619,7 @@ gdb_expect {
# recognize.
#
# In the case that motivated this change, the (gdb) prompt occupied
-# the leftmost six columns, and `${objdump}/' was seventy-four
+# the leftmost six columns, and `${objdir}/' was seventy-four
# characters long --- eighty in all. After printing the slash,
# readline emitted a space, a carriage return, and then `Makefile'
# (the tab character being received as input after `Make'.
@@ -631,36 +631,6 @@ gdb_expect {
#
# So, we avoid long lines. We `cd' to ${objdir} first, and then do
# the completion relative to the current directory.
-#
-# Note that if we are building in the source tree, then there will be
-# more than one completion for ./Make, so we need to handle that also.
-# A better long term solution might be to create a temporary directory,
-# populate it with a set of known names, and use that directory to
-# test completions.
-
-gdb_test "cd ${objdir}" "Working directory ${objdir}.*" "cd to \${objdir}"
-send_gdb "file ./Make\t"
-sleep 1
-gdb_expect {
- -re "^file ./Make(\\\x07|)file.*$"\
- { send_gdb "\n"
- gdb_expect {
- -re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $"\
- { send_gdb "n\n"
- gdb_expect {
- -re "\r\nProgram not killed\\.\r\n$gdb_prompt $"\
- { pass "complete 'file ./Make'"}
- -re ".*$gdb_prompt $" { fail "complete 'file ./Make'"}
- timeout {fail "(timeout) complete 'file ./Make'"}
- }
- }
- -re ".*$gdb_prompt $" { fail "complete 'file ./Make'"}
- timeout {fail "(timeout) complete 'file ./Make'"}
- }
- }
- -re ".*$gdb_prompt $" { fail "complete 'file ./Make'" }
- timeout { fail "(timeout) complete 'file ./Make'" }
- }
# ${srcdir} may be a relative path. We want to make sure we end up
# in the right directory - so make sure we know where it is.
diff --git a/gdb/testsuite/gdb.base/detach.exp b/gdb/testsuite/gdb.base/detach.exp
index 1556cf9cb53..1f86fecfca1 100644
--- a/gdb/testsuite/gdb.base/detach.exp
+++ b/gdb/testsuite/gdb.base/detach.exp
@@ -40,6 +40,7 @@ if [is_remote target] then {
set testfile "attach"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}]
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
@@ -48,12 +49,13 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
proc do_detach_tests {} {
global srcdir
global binfile
+ global escapedbinfile
global subdir
global pass
runto_main
gdb_test "set should_exit = 1" "" "set should_exit, $pass"
- gdb_test "detach" "Detaching from program: .*$binfile, .*" "detach, $pass"
+ gdb_test "detach" "Detaching from program: .*$escapedbinfile, .*" "detach, $pass"
}
# Start with a fresh gdb
diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp
index 1120d41321c..0bc4472b366 100644
--- a/gdb/testsuite/gdb.base/dump.exp
+++ b/gdb/testsuite/gdb.base/dump.exp
@@ -33,12 +33,18 @@ set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
set options {debug}
+set is64bitonly "no"
+
if [istarget "alpha*-*-*"] then {
# SREC etc cannot handle 64-bit addresses. Force the test
# program into the low 31 bits of the address space.
lappend options "additional_flags=-Wl,-taso"
}
+if [istarget "ia64*-*-*"] then {
+ set is64bitonly "yes"
+}
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${options}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
@@ -213,32 +219,42 @@ proc test_restore_saved_value { restore_args msg oldval newval } {
}
}
-test_reload_saved_value "intarr1.srec" "reload array as value, srec" \
+# srec format can not be loaded for 64-bit-only platforms
+if ![string compare $is64bitonly "no"] then {
+ test_reload_saved_value "intarr1.srec" "reload array as value, srec" \
$array_val "intarray"
-test_reload_saved_value "intstr1.srec" "reload struct as value, srec" \
+ test_reload_saved_value "intstr1.srec" "reload struct as value, srec" \
$struct_val "intstruct"
-test_reload_saved_value "intarr2.srec" "reload array as memory, srec" \
+ test_reload_saved_value "intarr2.srec" "reload array as memory, srec" \
$array_val "intarray"
-test_reload_saved_value "intstr2.srec" "reload struct as memory, srec" \
+ test_reload_saved_value "intstr2.srec" "reload struct as memory, srec" \
$struct_val "intstruct"
+}
+
+# ihex format can not be loaded for 64-bit-only platforms
+if ![string compare $is64bitonly "no"] then {
-test_reload_saved_value "intarr1.ihex" "reload array as value, intel hex" \
+ test_reload_saved_value "intarr1.ihex" "reload array as value, intel hex" \
$array_val "intarray"
-test_reload_saved_value "intstr1.ihex" "reload struct as value, intel hex" \
+ test_reload_saved_value "intstr1.ihex" "reload struct as value, intel hex" \
$struct_val "intstruct"
-test_reload_saved_value "intarr2.ihex" "reload array as memory, intel hex" \
+ test_reload_saved_value "intarr2.ihex" "reload array as memory, intel hex" \
$array_val "intarray"
-test_reload_saved_value "intstr2.ihex" "reload struct as memory, intel hex" \
+ test_reload_saved_value "intstr2.ihex" "reload struct as memory, intel hex" \
$struct_val "intstruct"
+}
-test_reload_saved_value "intarr1.tekhex" "reload array as value, tekhex" \
+# tekhex format can not be loaded for 64-bit-only platforms
+if ![string compare $is64bitonly "no"] then {
+ test_reload_saved_value "intarr1.tekhex" "reload array as value, tekhex" \
$array_val "intarray"
-test_reload_saved_value "intstr1.tekhex" "reload struct as value, tekhex" \
+ test_reload_saved_value "intstr1.tekhex" "reload struct as value, tekhex" \
$struct_val "intstruct"
-test_reload_saved_value "intarr2.tekhex" "reload array as memory, tekhex" \
+ test_reload_saved_value "intarr2.tekhex" "reload array as memory, tekhex" \
$array_val "intarray"
-test_reload_saved_value "intstr2.tekhex" "reload struct as memory, tekhex" \
+ test_reload_saved_value "intstr2.tekhex" "reload struct as memory, tekhex" \
$struct_val "intstruct"
+}
# Start a fresh gdb session
@@ -264,51 +280,53 @@ if { ![string compare $struct_val [capture_value "intstruct"]] } then {
pass "start with intstruct un-initialized, runto main"
}
-test_restore_saved_value "intarr1.srec" "array as value, srec" \
+if ![string compare $is64bitonly "no"] then {
+ test_restore_saved_value "intarr1.srec" "array as value, srec" \
$array_val "intarray"
-test_restore_saved_value "intstr1.srec" "struct as value, srec" \
+ test_restore_saved_value "intstr1.srec" "struct as value, srec" \
$struct_val "intstruct"
-gdb_test "print zero_all ()" "void" "zero all"
+ gdb_test "print zero_all ()" "void" "zero all"
-test_restore_saved_value "intarr2.srec" "array as memory, srec" \
+ test_restore_saved_value "intarr2.srec" "array as memory, srec" \
$array_val "intarray"
-test_restore_saved_value "intstr2.srec" "struct as memory, srec" \
+ test_restore_saved_value "intstr2.srec" "struct as memory, srec" \
$struct_val "intstruct"
-gdb_test "print zero_all ()" ""
+ gdb_test "print zero_all ()" ""
-test_restore_saved_value "intarr1.ihex" "array as value, ihex" \
+ test_restore_saved_value "intarr1.ihex" "array as value, ihex" \
$array_val "intarray"
-test_restore_saved_value "intstr1.ihex" "struct as value, ihex" \
+ test_restore_saved_value "intstr1.ihex" "struct as value, ihex" \
$struct_val "intstruct"
-gdb_test "print zero_all ()" ""
+ gdb_test "print zero_all ()" ""
-test_restore_saved_value "intarr2.ihex" "array as memory, ihex" \
+ test_restore_saved_value "intarr2.ihex" "array as memory, ihex" \
$array_val "intarray"
-test_restore_saved_value "intstr2.ihex" "struct as memory, ihex" \
+ test_restore_saved_value "intstr2.ihex" "struct as memory, ihex" \
$struct_val "intstruct"
-gdb_test "print zero_all ()" ""
+ gdb_test "print zero_all ()" ""
-test_restore_saved_value "intarr1.tekhex" "array as value, tekhex" \
+ test_restore_saved_value "intarr1.tekhex" "array as value, tekhex" \
$array_val "intarray"
-test_restore_saved_value "intstr1.tekhex" "struct as value, tekhex" \
+ test_restore_saved_value "intstr1.tekhex" "struct as value, tekhex" \
$struct_val "intstruct"
-gdb_test "print zero_all ()" ""
+ gdb_test "print zero_all ()" ""
-test_restore_saved_value "intarr2.tekhex" "array as memory, tekhex" \
+ test_restore_saved_value "intarr2.tekhex" "array as memory, tekhex" \
$array_val "intarray"
-test_restore_saved_value "intstr2.tekhex" "struct as memory, tekhex" \
+ test_restore_saved_value "intstr2.tekhex" "struct as memory, tekhex" \
$struct_val "intstruct"
+}
gdb_test "print zero_all ()" ""
@@ -341,33 +359,36 @@ set struct2_offset \
gdb_test "print zero_all ()" ""
-test_restore_saved_value "intarr1.srec $array2_offset" \
+
+if ![string compare $is64bitonly "no"] then {
+ test_restore_saved_value "intarr1.srec $array2_offset" \
"array copy, srec" \
$array_val "intarray2"
-test_restore_saved_value "intstr1.srec $struct2_offset" \
+ test_restore_saved_value "intstr1.srec $struct2_offset" \
"struct copy, srec" \
$struct_val "intstruct2"
-gdb_test "print zero_all ()" ""
+ gdb_test "print zero_all ()" ""
-test_restore_saved_value "intarr1.ihex $array2_offset" \
+ test_restore_saved_value "intarr1.ihex $array2_offset" \
"array copy, ihex" \
$array_val "intarray2"
-test_restore_saved_value "intstr1.ihex $struct2_offset" \
+ test_restore_saved_value "intstr1.ihex $struct2_offset" \
"struct copy, ihex" \
$struct_val "intstruct2"
-gdb_test "print zero_all ()" ""
+ gdb_test "print zero_all ()" ""
-test_restore_saved_value "intarr1.tekhex $array2_offset" \
+ test_restore_saved_value "intarr1.tekhex $array2_offset" \
"array copy, tekhex" \
$array_val "intarray2"
-test_restore_saved_value "intstr1.tekhex $struct2_offset" \
+ test_restore_saved_value "intstr1.tekhex $struct2_offset" \
"struct copy, tekhex" \
$struct_val "intstruct2"
+}
gdb_test "print zero_all ()" ""
@@ -395,32 +416,34 @@ set element3_offset \
set element4_offset \
[capture_value "/x (char *) &intarray\[4\] - (char *) &intarray\[0\]"]
-gdb_test "print zero_all ()" ""
+if ![string compare $is64bitonly "no"] then {
+ gdb_test "print zero_all ()" ""
-test_restore_saved_value "intarr1.srec 0 $element3_start $element4_start" \
+ test_restore_saved_value "intarr1.srec 0 $element3_start $element4_start" \
"array partial, srec" \
[capture_value "4"] "intarray\[3\]"
-gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 1"
-gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 1"
+ gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 1"
+ gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 1"
-gdb_test "print zero_all ()" ""
+ gdb_test "print zero_all ()" ""
-test_restore_saved_value "intarr1.ihex 0 $element3_start $element4_start" \
+ test_restore_saved_value "intarr1.ihex 0 $element3_start $element4_start" \
"array partial, ihex" \
[capture_value "4"] "intarray\[3\]"
-gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 2"
-gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 2"
+ gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 2"
+ gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 2"
-gdb_test "print zero_all ()" ""
+ gdb_test "print zero_all ()" ""
-test_restore_saved_value "intarr1.tekhex 0 $element3_start $element4_start" \
+ test_restore_saved_value "intarr1.tekhex 0 $element3_start $element4_start" \
"array partial, tekhex" \
[capture_value "4"] "intarray\[3\]"
-gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 3"
-gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 3"
+ gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 3"
+ gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 3"
+}
gdb_test "print zero_all ()" ""
@@ -432,17 +455,18 @@ test_restore_saved_value \
gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 4"
gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 4"
-gdb_test "print zero_all ()" "" ""
+if ![string compare $is64bitonly "no"] then {
+ gdb_test "print zero_all ()" "" ""
-# restore with expressions
-test_restore_saved_value \
+ # restore with expressions
+ test_restore_saved_value \
"intarr3.srec ${array2_start}-${array_start} &intarray\[3\] &intarray\[4\]" \
"array partial with expressions" \
[capture_value "4"] "intarray2\[3\]"
-gdb_test "print intarray2\[2\] == 0" " = 1" "element 2 not changed, == 4"
-gdb_test "print intarray2\[4\] == 0" " = 1" "element 4 not changed, == 4"
-
+ gdb_test "print intarray2\[2\] == 0" " = 1" "element 2 not changed, == 4"
+ gdb_test "print intarray2\[4\] == 0" " = 1" "element 4 not changed, == 4"
+}
# clean up files
diff --git a/gdb/testsuite/gdb.base/float.exp b/gdb/testsuite/gdb.base/float.exp
index f681e1f1468..6c80fbb07c3 100644
--- a/gdb/testsuite/gdb.base/float.exp
+++ b/gdb/testsuite/gdb.base/float.exp
@@ -63,6 +63,16 @@ if { [istarget "alpha*-*-*"] } then {
gdb_test "info float" "f0.*f1.*f127.*" "info float"
} elseif [istarget "m68k-*-*"] then {
gdb_test "info float" "fp0.*fp1.*fp7.*" "info float"
+} elseif [istarget "sh*-*"] then {
+ # SH may or may not have an FPU
+ gdb_test_multiple "info float" "info float" {
+ -re "fpul.*fr0.*fr1.*fr15.*$gdb_prompt $" {
+ pass "info float (with FPU)"
+ }
+ -re "No floating.point info available for this processor.*" {
+ pass "info float (without FPU)"
+ }
+ }
} else {
gdb_test "info float" "No floating.point info available for this processor." "info float"
}
diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp
index f8d5baac614..8c0ae8eb5c4 100644
--- a/gdb/testsuite/gdb.base/gcore.exp
+++ b/gdb/testsuite/gdb.base/gcore.exp
@@ -104,8 +104,10 @@ set pre_corefile_local_array \
set pre_corefile_extern_array \
[capture_command_output "print extern_array" "$print_prefix"]
+set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore.test]
+
gdb_test "gcore ${objdir}/${subdir}/gcore.test" \
- "Saved corefile ${objdir}/${subdir}/gcore.test" \
+ "Saved corefile ${escapedfilename}" \
"save a corefile"
# Now restart gdb and load the corefile.
diff --git a/gdb/testsuite/gdb.base/gdb1250.c b/gdb/testsuite/gdb.base/gdb1250.c
index 9d73f6735c2..0af58d92fcb 100644
--- a/gdb/testsuite/gdb.base/gdb1250.c
+++ b/gdb/testsuite/gdb.base/gdb1250.c
@@ -25,7 +25,11 @@
int global = 0;
-void gamma (int *parray)
+/* Foo, gcc thinks 'gamma' is a reserved identifier.
+ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12213
+ I am not interested in testing that point so just avoid the word.
+ -- chastain 2003-09-08. */
+void my_gamma (int *parray)
{
return;
}
@@ -37,7 +41,7 @@ void beta ()
array [1] = global++;
array [2] = global++;
array [3] = global++;
- gamma (array);
+ my_gamma (array);
abort ();
}
diff --git a/gdb/testsuite/gdb.base/interrupt.exp b/gdb/testsuite/gdb.base/interrupt.exp
index 6d5401d71aa..83e9630ef30 100644
--- a/gdb/testsuite/gdb.base/interrupt.exp
+++ b/gdb/testsuite/gdb.base/interrupt.exp
@@ -120,11 +120,11 @@ if ![file exists $binfile] then {
setup_xfail "sparc*-*-solaris2*"
setup_xfail "mips-*-ultrix*"
- setup_xfail "i*86-*-*bsd*"
setup_xfail "i*86-*-solaris2*"
setup_xfail "*-*-sysv4*"
setup_xfail "vax-*-*"
setup_xfail "alpha-*-*"
+ setup_xfail "*-*-*bsd*"
setup_xfail "*-*-irix*"
setup_xfail "*-*-hpux*"
setup_xfail "*-*-*lynx*"
diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp
index 8d8ff90bc9e..916ce1ce41c 100644
--- a/gdb/testsuite/gdb.base/relocate.exp
+++ b/gdb/testsuite/gdb.base/relocate.exp
@@ -67,7 +67,7 @@ gdb_reinitialize_dir $srcdir/$subdir
# Load the object file.
gdb_test "add-symbol-file ${binfile} 0" \
- "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\." \
+ "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
"add-symbol-file ${testfile}.o 0" \
"add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.text_addr = 0x0\[\r\n\]+\\(y or n\\) " \
"y"
@@ -116,7 +116,7 @@ gdb_test "set \$offset = 0x10000" ""
# Load the object file.
gdb_test "add-symbol-file ${binfile} \$offset" \
- "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\." \
+ "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
"add-symbol-file ${testfile}.o \$offset" \
"add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.text_addr = 0x10000\[\r\n\]+\\(y or n\\) " \
"y"
diff --git a/gdb/testsuite/gdb.base/selftest.exp b/gdb/testsuite/gdb.base/selftest.exp
index 6fe601eda52..9e1d4ddfb60 100644
--- a/gdb/testsuite/gdb.base/selftest.exp
+++ b/gdb/testsuite/gdb.base/selftest.exp
@@ -32,15 +32,6 @@ if [is_remote target] {
return
}
-if [istarget "m68k*-*-hpux*"] then {
- # The top-level makefile passes CFLAGS= (no -g) for hp300. This probably
- # should be fixed (it is only needed for gcc bootstrapping, not gdb),
- # but until then.....
- setup_xfail "*-*-*"
- fail "cannot test self if compiled without debug info"
- return -1
-}
-
# Not all of the lines of code near the start of main are executed for
# every machine. Also, optimization may reorder some of the lines.
# So all we do is try to step or next over everything until we get
diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp
index 3f398acc5ec..60f5ab75dc4 100644
--- a/gdb/testsuite/gdb.cp/classes.exp
+++ b/gdb/testsuite/gdb.cp/classes.exp
@@ -682,8 +682,14 @@ proc test_enums {} {
send_gdb "print (ClassWithEnum::PrivEnum) 42\n"
gdb_expect {
-re "\\$\[0-9\]* = yellow.*$gdb_prompt $" { pass "print (ClassWithEnum::PrivEnum) 42" }
- -re "A parse error in expression, near `42'.\r\n$gdb_prompt $"
- { kfail "gdb/826" "print (ClassWithEnum::PrivEnum) 42" }
+ -re "A parse error in expression, near `42'.\r\n$gdb_prompt $" {
+ # bison 1.35
+ kfail "gdb/826" "print (ClassWithEnum::PrivEnum) 42"
+ }
+ -re "A syntax error in expression, near `42'.\r\n$gdb_prompt $" {
+ # bison 1.875
+ kfail "gdb/826" "print (ClassWithEnum::PrivEnum) 42"
+ }
-re "$gdb_prompt $" { fail "print (ClassWithEnum::PrivEnum) 42" }
timeout { fail "(timeout) print (ClassWithEnum::PrivEnum) 42" }
}
diff --git a/gdb/testsuite/gdb.cp/psmang.exp b/gdb/testsuite/gdb.cp/psmang.exp
new file mode 100644
index 00000000000..31dd34643f0
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/psmang.exp
@@ -0,0 +1,226 @@
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file is part of the gdb testsuite
+
+# Looking up methods by name, in programs with multiple compilation units.
+
+# ====== PLEASE BE VERY CAREFUL WHEN CHANGING THIS TEST. =====
+#
+# The bug we're testing for (circa October 2002) is very sensitive to
+# various conditions that are hard to control directly in the test
+# suite. If you change the test, please revert this change, and make
+# sure the test still fails:
+#
+# 2002-08-29 Jim Blandy <jimb@redhat.com>
+#
+# * symtab.c (lookup_symbol_aux): In the cases where we find a
+# minimal symbol of an appropriate name and use its address to
+# select a symtab to read and search, use `name' (as passed to us)
+# as the demangled name when searching the symtab's global and
+# static blocks, not the minsym's name.
+#
+# The original bug was that you'd try to set a breakpoint on a method
+# (e.g., `break s::method1'), and you'd get an error, but if you
+# repeated the command, it would work the second time:
+#
+# (gdb) break s::method1
+# the class s does not have any method named method1
+# Hint: try 's::method1<TAB> or 's::method1<ESC-?>
+# (Note leading single quote.)
+# (gdb) break s::method1
+# Breakpoint 1 at 0x804841b: file psmang1.cc, line 13.
+# (gdb)
+#
+# We observed this bug first using Stabs, and then using Dwarf 2.
+#
+# The problem was in lookup_symbol_aux: when looking up s::method1, it
+# would fail to find it in any symtabs, find the minsym with the
+# corresponding mangled name (say, `_ZN1S7method1Ev'), pass the
+# minsym's address to find_pc_sect_symtab to look up the symtab
+# (causing the compilation unit's full symbols to be read in), and
+# then look up the symbol in that symtab's global block. All that is
+# correct. However, it would pass the minsym's name as the NAME
+# argument to lookup_block_symbol; a minsym's name is mangled, whereas
+# lookup_block_symbol's NAME argument should be demangled.
+#
+# This is a pretty simple bug, but it turns out to be a bear to
+# construct a test for. That's why this test case is so delicate. If
+# you can see how to make it less so, please contribute a patch.
+#
+# Here are the twists:
+#
+# The bug only manifests itself when we call lookup_symbol to look up
+# a method name (like "s::method1" or "s::method2"), and that method's
+# definition is in a compilation unit for which we have read partial
+# symbols, but not full symbols. The partial->full conversion must be
+# caused by that specific lookup. (If we already have full symbols
+# for the method's compilation unit, we won't need to look up the
+# minsym, find the symtab for the minsym's address, and then call
+# lookup_block_symbol; it's that last call where things go awry.)
+#
+# Now, when asked to set a breakpoint at `s::method1', GDB will first
+# look up `s' to see if that is, in fact, the name of a class, and
+# then look up 's::method1'. So we have to make sure that looking up
+# `s' doesn't cause full symbols to be read for the compilation unit
+# containing the definition of `s::method1'.
+#
+# The partial symbol tables for `psmang1.cc' and `psmang2.cc' will
+# both have entries for `s'; GDB will read full symbols for whichever
+# compilation unit's partial symbol table appears first in the
+# objfile's list. The order in which compilation units appear in the
+# partial symbol table list depends on how the program is linked, and
+# how the debug info reader does the partial symbol scan. Ideally,
+# the test shouldn't rely on them appearing in any particular order.
+#
+# So, since we don't know which compilation unit's full symbols are
+# going to get read, we simply try looking up one method from each of
+# the two compilation units. One of them has to come after the other
+# in the partial symbol table list, so whichever comes later will
+# still need its partial symbols read by the time we go to look up
+# 's::methodX'.
+#
+# Second twist: don't move the common definition of `struct s' into a
+# header file. If the compiler emits identical stabs for the
+# #inclusion of that header file into psmang1.cc and into psmang2.cc,
+# then the linker will do stabs compression, and replace one of the
+# BINCL/EINCL regions with an EXCL stab, pointing to the other
+# BINCL/EINCL region. GDB will read this, and record that the
+# compilation unit that got the EXCL depends on the compilation unit
+# that kept the BINCL/EINCL. Then, when it decides it needs to read
+# full symbols for the former, it'll also read full symbols for the
+# latter. Now, if it just so happens that the compilation unit that
+# got the EXCL is also the first one with a definition of `s' in the
+# partial symbol table list, then that first probe for `s' will cause
+# both compilation units' full symbols to be read --- again defeating
+# the test.
+#
+# We could work around this by having three compilation units, or by
+# ensuring that the header file produces different stabs each time
+# it's #included, but it seems simplest just to avoid compilation unit
+# dependencies altogether, drop the header file, and duplicate the
+# (pretty trivial) struct definition.
+#
+# Note that #including any header file at all into both compilation
+# units --- say, <stdio.h> --- could create this sort of dependency.
+#
+# This is the aspect of the test which the debug format is most likely
+# to affect, I think. The different formats create different kinds of
+# inter-CU dependencies, which could mask the bug. It might be
+# possible for the test to check that at least one of the partial
+# symtabs remains unread, and fail otherwise --- the failure
+# indicating that the test itself isn't going to catch the bug it was
+# meant to, not that GDB is misbehaving.
+#
+# Third twist: given the way lookup_block_symbol is written, it's
+# possible to find the symbol even when it gets passed a mangled name
+# for its NAME parameter. There are three ways lookup_block_symbol
+# might search a block, depending on how it was constructed:
+#
+# linear search. In this case, this bug will never manifest itself,
+# since we check every symbol against NAME using SYMBOL_MATCHES_NAME.
+# Since that macro checks its second argument (NAME) against both the
+# mangled and demangled names of the symbol, this will always find the
+# symbol successfully, so, no bug.
+#
+# hash table. If both the mangled and demangled names hash to the
+# same bucket, then you'll again find the symbol "by accident", since
+# we search the entire bucket using SYMBOL_SOURCE_NAME. Since GDB
+# chooses the number of buckets based on the number of symbols, small
+# compilation units may have only one hash bucket; in this case, the
+# search always succeeds, even though we hashed on the wrong name.
+# This test works around that by having a lot of dummy variables,
+# making it less likely that the mangled and demangled names fall in
+# the same bucket.
+#
+# binary search. (GDB 5.2 produced these sorts of blocks, and this
+# test tries to detect the bug there, but subsequent versions of GDB
+# almost never build them, and they may soon be removed entirely.) In
+# this case, the symbols in the block are sorted by their
+# SYMBOL_SOURCE_NAME (whose behavior depends on the current demangling
+# setting, so that's wrong, but let's try to stay focussed).
+# lookup_block_symbol does a binary search comparing NAME with
+# SYMBOL_SOURCE_NAME until the range has been narrowed down to only a
+# few symbols; then it starts a linear search forward from the lower
+# end of that range, until it reaches a symbol whose
+# SYMBOL_SOURCE_NAME follows NAME in lexicographic order. This means
+# that, if you're doing a binary search for a mangled name in a block
+# sorted by SYMBOL_SOURCE_NAME, you might find the symbol `by
+# accident' if the mangled and demangled names happen to fall near
+# each other in the ordering. The initial version of this patch used
+# a class called `S'; all the other symbols in the compilation unit
+# started with lower-case letters, so the demangled name `S::method1'
+# sorted at the same place as the mangled name `_ZN1S7method1Ev': at
+# the very beginning. Using a lower-case 's' as the name ensures that
+# the demangled name falls after all the dummy symbols introduced for
+# the hash table, as described above.
+#
+# This is all so tortured, someone will probably come up with still
+# other ways this test could fail to do its job. If you need to make
+# revisions, please be very careful.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# test running programs
+#
+
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "psmang"
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1;
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${testfile}1.cc" "${testfile}1.o" object {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${testfile}2.cc" "${testfile}2.o" object {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${testfile}1.o ${testfile}2.o" ${binfile} executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "break s::method1" "Breakpoint .* at .*: file .*psmang1.cc.*"
+
+# We have to exit and restart GDB here, to make sure that all the
+# compilation units are psymtabs again.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "break s::method2" "Breakpoint .* at .*: file .*psmang2.cc.*"
diff --git a/gdb/testsuite/gdb.cp/psmang1.cc b/gdb/testsuite/gdb.cp/psmang1.cc
new file mode 100644
index 00000000000..19a9283bbb4
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/psmang1.cc
@@ -0,0 +1,159 @@
+/* Do not move this definition into a header file! See the comments
+ in psmang.exp. */
+struct s
+{
+ int value;
+ void method1 (void);
+ void method2 (void);
+};
+
+void
+s::method1 ()
+{
+ value = 42;
+}
+
+int
+main (int argc, char **argv)
+{
+ s si;
+
+ si.method1 ();
+ si.method2 ();
+}
+
+
+/* The presence of these variables ensures there will be so many
+ symbols in psmang1.cc's symtab's global block that it will have a
+ non-trivial hash table. When there are only a very few symbols,
+ the block only has one hash bucket, so even if we compute the hash
+ value for the wrong symbol name, we'll still find a symbol that
+ matches. */
+int ax;
+int bx;
+int a1x;
+int b1x;
+int a2x;
+int b2x;
+int a12x;
+int b12x;
+int a3x;
+int b3x;
+int a13x;
+int b13x;
+int a23x;
+int b23x;
+int a123x;
+int b123x;
+int a4x;
+int b4x;
+int a14x;
+int b14x;
+int a24x;
+int b24x;
+int a124x;
+int b124x;
+int a34x;
+int b34x;
+int a134x;
+int b134x;
+int a234x;
+int b234x;
+int a1234x;
+int b1234x;
+int a5x;
+int b5x;
+int a15x;
+int b15x;
+int a25x;
+int b25x;
+int a125x;
+int b125x;
+int a35x;
+int b35x;
+int a135x;
+int b135x;
+int a235x;
+int b235x;
+int a1235x;
+int b1235x;
+int a45x;
+int b45x;
+int a145x;
+int b145x;
+int a245x;
+int b245x;
+int a1245x;
+int b1245x;
+int a345x;
+int b345x;
+int a1345x;
+int b1345x;
+int a2345x;
+int b2345x;
+int a12345x;
+int b12345x;
+int a6x;
+int b6x;
+int a16x;
+int b16x;
+int a26x;
+int b26x;
+int a126x;
+int b126x;
+int a36x;
+int b36x;
+int a136x;
+int b136x;
+int a236x;
+int b236x;
+int a1236x;
+int b1236x;
+int a46x;
+int b46x;
+int a146x;
+int b146x;
+int a246x;
+int b246x;
+int a1246x;
+int b1246x;
+int a346x;
+int b346x;
+int a1346x;
+int b1346x;
+int a2346x;
+int b2346x;
+int a12346x;
+int b12346x;
+int a56x;
+int b56x;
+int a156x;
+int b156x;
+int a256x;
+int b256x;
+int a1256x;
+int b1256x;
+int a356x;
+int b356x;
+int a1356x;
+int b1356x;
+int a2356x;
+int b2356x;
+int a12356x;
+int b12356x;
+int a456x;
+int b456x;
+int a1456x;
+int b1456x;
+int a2456x;
+int b2456x;
+int a12456x;
+int b12456x;
+int a3456x;
+int b3456x;
+int a13456x;
+int b13456x;
+int a23456x;
+int b23456x;
+int a123456x;
+int b123456x;
diff --git a/gdb/testsuite/gdb.cp/psmang2.cc b/gdb/testsuite/gdb.cp/psmang2.cc
new file mode 100644
index 00000000000..b9b1bb55b15
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/psmang2.cc
@@ -0,0 +1,152 @@
+#include <stdio.h>
+
+/* Do not move this definition into a header file! See the comments
+ in psmang.exp. */
+struct s
+{
+ int value;
+ void method1 (void);
+ void method2 (void);
+};
+
+void
+s::method2 (void)
+{
+ printf ("%d\n", value);
+}
+
+
+/* The presence of these variables ensures there will be so many
+ symbols in psmang2.cc's symtab's global block that it will have a
+ non-trivial hash table. When there are only a very few symbols,
+ the block only has one hash bucket, so even if we compute the hash
+ value for the wrong symbol name, we'll still find a symbol that
+ matches. */
+int a;
+int b;
+int a1;
+int b1;
+int a2;
+int b2;
+int a12;
+int b12;
+int a3;
+int b3;
+int a13;
+int b13;
+int a23;
+int b23;
+int a123;
+int b123;
+int a4;
+int b4;
+int a14;
+int b14;
+int a24;
+int b24;
+int a124;
+int b124;
+int a34;
+int b34;
+int a134;
+int b134;
+int a234;
+int b234;
+int a1234;
+int b1234;
+int a5;
+int b5;
+int a15;
+int b15;
+int a25;
+int b25;
+int a125;
+int b125;
+int a35;
+int b35;
+int a135;
+int b135;
+int a235;
+int b235;
+int a1235;
+int b1235;
+int a45;
+int b45;
+int a145;
+int b145;
+int a245;
+int b245;
+int a1245;
+int b1245;
+int a345;
+int b345;
+int a1345;
+int b1345;
+int a2345;
+int b2345;
+int a12345;
+int b12345;
+int a6;
+int b6;
+int a16;
+int b16;
+int a26;
+int b26;
+int a126;
+int b126;
+int a36;
+int b36;
+int a136;
+int b136;
+int a236;
+int b236;
+int a1236;
+int b1236;
+int a46;
+int b46;
+int a146;
+int b146;
+int a246;
+int b246;
+int a1246;
+int b1246;
+int a346;
+int b346;
+int a1346;
+int b1346;
+int a2346;
+int b2346;
+int a12346;
+int b12346;
+int a56;
+int b56;
+int a156;
+int b156;
+int a256;
+int b256;
+int a1256;
+int b1256;
+int a356;
+int b356;
+int a1356;
+int b1356;
+int a2356;
+int b2356;
+int a12356;
+int b12356;
+int a456;
+int b456;
+int a1456;
+int b1456;
+int a2456;
+int b2456;
+int a12456;
+int b12456;
+int a3456;
+int b3456;
+int a13456;
+int b13456;
+int a23456;
+int b23456;
+int a123456;
+int b123456;
diff --git a/gdb/testsuite/gdb.disasm/h8300s.exp b/gdb/testsuite/gdb.disasm/h8300s.exp
index eeaf23bfdd0..dff165c266b 100644
--- a/gdb/testsuite/gdb.disasm/h8300s.exp
+++ b/gdb/testsuite/gdb.disasm/h8300s.exp
@@ -189,22 +189,22 @@ proc all_inc_dec_adds_subs_tests { } {
send_gdb "x/16i inc_dec_adds_subs_tests\n"
gdb_expect {
-re "
-.*inc.b\tr0l.*
-.*inc.w\t#0x1,r4.*
-.*inc.w\t#0x2,r3.*
-.*inc.l\t#0x1,er2.*
-.*inc.l\t#0x2,er1.*
+.*inc(.b|)\tr0l.*
+.*inc.w\t#(0x|)1,r4.*
+.*inc.w\t#(0x|)2,r3.*
+.*inc.l\t#(0x|)1,er2.*
+.*inc.l\t#(0x|)2,er1.*
.*dec.b\tr0l.*
-.*dec.w\t#0x1,r4.*
-.*dec.w\t#0x2,r3.*
-.*dec.l\t#0x1,er2.*
-.*dec.l\t#0x2,er1.*
-.*adds\t#0x1,er7.*
-.*adds\t#0x2,er6.*
-.*adds\t#0x4,er5.*
-.*subs\t#0x1,er7.*
-.*subs\t#0x2,er6.*
-.*subs\t#0x4,er5.*
+.*dec.w\t#(0x|)1,r4.*
+.*dec.w\t#(0x|)2,r3.*
+.*dec.l\t#(0x|)1,er2.*
+.*dec.l\t#(0x|)2,er1.*
+.*adds\t#(0x|)1,er7.*
+.*adds\t#(0x|)2,er6.*
+.*adds\t#(0x|)4,er5.*
+.*subs\t#(0x|)1,er7.*
+.*subs\t#(0x|)2,er6.*
+.*subs\t#(0x|)4,er5.*
.*$gdb_prompt $" { pass "inc_dec_adds_subs_tests" }
-re "$gdb_prompt $" { fail "inc_dec_adds_subs_tests" }
timeout { fail "(timeout) inc_dec_adds_subs_tests" }
@@ -313,7 +313,7 @@ proc all_tas_mac_tests { } {
gdb_expect {
-re "
.*tas\t@er0.*
-.*mac\t@er1+,@er2+.*
+.*mac\t@er1\\+,@er2\\+.*
.*clrmac.*
.*ldmac\ter4,mach.*
.*ldmac\ter5,macl.*
@@ -345,8 +345,8 @@ proc all_logic_operations_tests { } {
.*or.w\tr1,r2.*
.*or.l\t#0x12345678,er0.*
.*or.l\ter1,er2.*
-.*xor.b\t#0x12,r0l.*
-.*xor.b\tr1l,r2h.*
+.*xor(.b|)\t#0x12,r0l.*
+.*xor(.b|)\tr1l,r2h.*
.*xor.w\t#0x1234,r0.*
.*xor.w\tr1,r2.*
.*xor.l\t#0x12345678,er0.*
@@ -368,18 +368,18 @@ proc all_sha_shl_tests { } {
send_gdb "x/12i sha_shl_tests\n"
gdb_expect {
-re "
-.*shal\tr0l.*
-.*shal\tr1.*
-.*shal\ter2.*
-.*shar\tr3l.*
-.*shar\tr4.*
-.*shar\ter5.*
-.*shll\tr0l.*
-.*shll\tr1.*
-.*shll\ter2.*
-.*shlr\tr3l.*
-.*shlr\tr4.*
-.*shlr\ter5.*
+.*shal(.b|)\tr0l.*
+.*shal(.w|)\tr1.*
+.*shal(.l|)\ter2.*
+.*shar(.b|)\tr3l.*
+.*shar(.w|)\tr4.*
+.*shar(.l|)\ter5.*
+.*shll(.b|)\tr0l.*
+.*shll(.w|)\tr1.*
+.*shll(.l|)\ter2.*
+.*shlr(.b|)\tr3l.*
+.*shlr(.w|)\tr4.*
+.*shlr(.l|)\ter5.*
.*$gdb_prompt $" { pass "sha_shl_tests" }
-re "$gdb_prompt $" { fail "sha_shl_tests" }
timeout { fail "(timeout) sha_shl_tests" }
@@ -394,18 +394,18 @@ proc all_rot_rotx_tests { } {
send_gdb "x/12i rot_rotx_tests\n"
gdb_expect {
-re "
-.*rotl\tr0l.*
-.*rotl\tr1.*
-.*rotl\ter2.*
-.*rotr\tr3l.*
-.*rotr\tr4.*
-.*rotr\ter5.*
-.*rotxl\tr0l.*
-.*rotxl\tr1.*
-.*rotxl\ter2.*
-.*rotxr\tr3l.*
-.*rotxr\tr4.*
-.*rotxr\ter5.*
+.*rotl(.b|)\tr0l.*
+.*rotl(.w|)\tr1.*
+.*rotl(.l|)\ter2.*
+.*rotr(.b|)\tr3l.*
+.*rotr(.w|)\tr4.*
+.*rotr(.l|)\ter5.*
+.*rotxl(.b|)\tr0l.*
+.*rotxl(.w|)\tr1.*
+.*rotxl(.l|)\ter2.*
+.*rotxr(.b|)\tr3l.*
+.*rotxr(.w|)\tr4.*
+.*rotxr(.l|)\ter5.*
.*$gdb_prompt $" { pass "rot_rotx_tests" }
-re "$gdb_prompt $" { fail "rot_rotx_tests" }
timeout { fail "(timeout) rot_rotx_tests" }
@@ -551,30 +551,30 @@ proc all_branch_tests { } {
send_gdb "x/25i branch_tests\n"
gdb_expect {
-re "
-.*bra\tbranch_tests.*
-.*brn\tbranch_tests.*
-.*bhi\tbranch_tests.*
-.*bls\tbranch_tests.*
-.*bcc\tbranch_tests.*
-.*bcs\tbranch_tests.*
-.*bne\tbranch_tests.*
-.*beq\tbranch_tests.*
-.*bvc\tbranch_tests.*
-.*bvs\tbranch_tests.*
-.*bpl\tbranch_tests.*
-.*bmi\tbranch_tests.*
-.*bge\tbranch_tests.*
-.*blt\tbranch_tests.*
-.*bgt\tbranch_tests.*
-.*ble\tbranch_tests.*
+.*bra\t(branch_tests|.-2 ).*
+.*brn\t(branch_tests|.-4 ).*
+.*bhi\t(branch_tests|.-6 ).*
+.*bls\t(branch_tests|.-8 ).*
+.*bcc\t(branch_tests|.-10 ).*
+.*bcs\t(branch_tests|.-12 ).*
+.*bne\t(branch_tests|.-14 ).*
+.*beq\t(branch_tests|.-16 ).*
+.*bvc\t(branch_tests|.-18 ).*
+.*bvs\t(branch_tests|.-20 ).*
+.*bpl\t(branch_tests|.-22 ).*
+.*bmi\t(branch_tests|.-24 ).*
+.*bge\t(branch_tests|.-26 ).*
+.*blt\t(branch_tests|.-28 ).*
+.*bgt\t(branch_tests|.-30 ).*
+.*ble\t(branch_tests|.-32 ).*
.*jmp\t@er0.*
-.*jmp\t@branch_tests.*
-.*jmp\t@@0 (0).*
-.*bsr\tbranch_tests.*
-.*bsr\tbranch_tests.*
+.*jmp\t@(branch_tests|0x).*
+.*jmp\t@@0 \\((0x|)0\\).*
+.*bsr\t(branch_tests|.-42 ).*
+.*bsr\t(branch_tests|.-46 ).*
.*jsr\t@er0.*
-.*jsr\t@branch_tests.*
-.*jsr\t@@0 (0).*
+.*jsr\t@(branch_tests|0x).*
+.*jsr\t@@0 \\((0x|)0\\).*
.*rts.*
.*$gdb_prompt $" { pass "branch_tests" }
-re "$gdb_prompt $" { fail "branch_tests" }
diff --git a/gdb/testsuite/gdb.disasm/h8300s.s b/gdb/testsuite/gdb.disasm/h8300s.s
index ec66a55a002..6510d40ef4e 100644
--- a/gdb/testsuite/gdb.disasm/h8300s.s
+++ b/gdb/testsuite/gdb.disasm/h8300s.s
@@ -302,8 +302,8 @@ branch_tests:
jmp @er0
jmp @branch_tests
jmp @@0 (0)
- bsr @branch_tests:8
- bsr @branch_tests:16
+ bsr branch_tests:8
+ bsr branch_tests:16
jsr @er0
jsr @branch_tests
jsr @@0 (0)
diff --git a/gdb/testsuite/gdb.gdb/observer.exp b/gdb/testsuite/gdb.gdb/observer.exp
index 390df8d61b0..80ab29a05b5 100644
--- a/gdb/testsuite/gdb.gdb/observer.exp
+++ b/gdb/testsuite/gdb.gdb/observer.exp
@@ -33,15 +33,6 @@ if [is_remote target] {
return
}
-if [istarget "m68k*-*-hpux*"] then {
- # The top-level makefile passes CFLAGS= (no -g) for hp300. This probably
- # should be fixed (it is only needed for gcc bootstrapping, not gdb),
- # but until then.....
- setup_xfail "*-*-*"
- fail "cannot test self if compiled without debug info"
- return -1
-}
-
proc setup_test { executable } {
global gdb_prompt
global timeout
diff --git a/gdb/testsuite/gdb.gdb/xfullpath.exp b/gdb/testsuite/gdb.gdb/xfullpath.exp
index e4a6e2a0419..60449a343c5 100644
--- a/gdb/testsuite/gdb.gdb/xfullpath.exp
+++ b/gdb/testsuite/gdb.gdb/xfullpath.exp
@@ -1,4 +1,4 @@
-# Copyright 2002
+# Copyright 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -33,15 +33,6 @@ if [is_remote target] {
return
}
-if [istarget "m68k*-*-hpux*"] then {
- # The top-level makefile passes CFLAGS= (no -g) for hp300. This probably
- # should be fixed (it is only needed for gcc bootstrapping, not gdb),
- # but until then.....
- setup_xfail "*-*-*"
- fail "cannot test self if compiled without debug info"
- return -1
-}
-
proc setup_test { executable } {
global gdb_prompt
global timeout
diff --git a/gdb/testsuite/gdb.java/jmisc1.exp b/gdb/testsuite/gdb.java/jmisc1.exp
index eea559e11b9..dd5af98bbe2 100644
--- a/gdb/testsuite/gdb.java/jmisc1.exp
+++ b/gdb/testsuite/gdb.java/jmisc1.exp
@@ -1,4 +1,4 @@
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -88,4 +88,30 @@ if ![set_lang_java] then {
-re ".*$gdb_prompt $" { fail "p *args" }
timeout { fail "p *args (timeout)" ; return }
}
+
+ # The idea of running to 'exit' is that 'exit' is in a different
+ # objfile from the rest of the program (provided that program is
+ # linked normally with a shared libc). That causes gdb to examine
+ # fresh objfiles. There is nothing important about 'exit'
+ # semantics; it could be any symbol that is in a shared library.
+ # -- chastain 2003-08-06
+
+ gdb_test "break exit" ".*Breakpoint $decimal at .*"
+ gdb_test_multiple "continue" "continue to exit" {
+ -re ".*Breakpoint $decimal, .*exit.*$gdb_prompt $" {
+ pass "continue to exit"
+ }
+ -re ".*internal-error: sect_index_text not initialized.*\\(y or n\\) " {
+ # gdb choked on the "anonymous objfile" (probably).
+ kfail "gdb/1322" "continue to exit"
+ # get back to the gdb prompt
+ gdb_test_multiple "no" "internal sync 1" {
+ -re ".*\\(y or n\\) " {
+ gdb_test_multiple "no" "internal sync 2" {
+ -re ".*$gdb_prompt $" { ; }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/gdb/testsuite/gdb.mi/ChangeLog b/gdb/testsuite/gdb.mi/ChangeLog
index e4aec350f68..6f263c33056 100644
--- a/gdb/testsuite/gdb.mi/ChangeLog
+++ b/gdb/testsuite/gdb.mi/ChangeLog
@@ -1,3 +1,14 @@
+2003-08-07 Andrew Cagney <cagney@redhat.com>
+
+ * mi2-basics.exp: Copy base MI .exp file, set MIFLAGS to -i=mi2.
+ * mi2-break.exp, mi2-cli.exp, mi2-console.exp: Ditto.
+ * mi2-disassemble.exp, mi2-eval.exp, mi2-file.exp: Ditto.
+ * mi2-hack-cli.exp, mi2-pthreads.exp, mi2-read-memory.exp: Ditto.
+ * mi2-regs.exp, mi2-return.exp, mi2-simplerun.exp: Ditto.
+ * mi2-stack.exp, mi2-stepi.exp, mi2-syn-frame.exp: Ditto.
+ * mi2-until.exp, mi2-var-block.exp, mi2-var-child.exp: Ditto.
+ * mi2-var-cmd.exp, mi2-var-display.exp, mi2-watch.exp: Ditto.
+
2003-05-03 J. Brobecker <brobecker@gnat.com>
From Thierry Schneider <tpschneider1@yahoo.com>:
diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp
index 98ffe1d2acf..9377baf9e6c 100644
--- a/gdb/testsuite/gdb.mi/mi-basics.exp
+++ b/gdb/testsuite/gdb.mi/mi-basics.exp
@@ -40,6 +40,9 @@ if [mi_gdb_start] {
set testfile "basics"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
+set escapedobjdir [string_to_regexp ${objdir}]
+set escapedsrcdir [string_to_regexp ${srcdir}]
+
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
@@ -154,25 +157,25 @@ proc test_dir_specification {} {
# -environment-directory
# -environment-directory -r
-#exp_internal 1
+ set envirodir [string_to_regexp ${srcdir}/${subdir}]
+
mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \
- "\\\^done,source-path=\"${srcdir}/${subdir}.\\\$cdir.\\\$cwd\"" \
+ "\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory arg operation"
mi_gdb_test "203-environment-directory" \
- "\\\^done,source-path=\"${srcdir}/${subdir}.\\\$cdir.\\\$cwd\"" \
+ "\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory empty-string operation"
mi_gdb_test "204-environment-directory -r" \
"\\\^done,source-path=\"\\\$cdir.\\\$cwd\"" \
"environment-directory operation"
-
-#exp_internal 0
}
proc test_cwd_specification {} {
global mi_gdb_prompt
global objdir
+ global escapedobjdir
global subdir
# Change the working directory, then print the current working directory
@@ -185,7 +188,7 @@ proc test_cwd_specification {} {
"environment-cd arg operation"
mi_gdb_test "206-environment-pwd" \
- "\\\^done,cwd=\"${objdir}\"" \
+ "\\\^done,cwd=\"${escapedobjdir}\"" \
"environment-pwd operation"
}
@@ -194,6 +197,8 @@ proc test_path_specification {} {
global orig_path
global objdir
global srcdir
+ global escapedobjdir
+ global escapedsrcdir
# Add to the path, display, then reset
# Tests:
@@ -202,8 +207,6 @@ proc test_path_specification {} {
# -environment-path -r dir
# -environment-path -r
-#exp_internal 1
-
send_gdb "-environment-path\n"
gdb_expect 20 {
-re "\\\^done,path=\"\(.*\)\"\r\n$mi_gdb_prompt" {
@@ -220,18 +223,17 @@ proc test_path_specification {} {
"environment-path no-args operation"
mi_gdb_test "208-environment-path $srcdir $objdir" \
- "\\\^done,path=\"$srcdir.$objdir.$orig_path\"" \
+ "\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \
"environment-path dir1 dir2 operation"
mi_gdb_test "209-environment-path -r $objdir" \
- "\\\^done,path=\"$objdir.$orig_path\"" \
+ "\\\^done,path=\"$escapedobjdir.$orig_path\"" \
"environment-path -r dir operation"
mi_gdb_test "210-environment-path -r" \
"\\\^done,path=\"$orig_path\"" \
"environment-path -r operation"
-#exp_internal 0
}
if [test_mi_interpreter_selection] {
diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp
index fafa79a3390..ab5a17b4ada 100644
--- a/gdb/testsuite/gdb.mi/mi-var-display.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-display.exp
@@ -183,7 +183,7 @@ mi_gdb_test "-var-create weird * weird" \
"create local variable weird"
mi_gdb_test "-var-list-children weird" \
- "\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
+ "\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
"get children local variable weird"
diff --git a/gdb/testsuite/gdb.mi/mi1-var-display.exp b/gdb/testsuite/gdb.mi/mi1-var-display.exp
index 0bdaee44ae4..593a1c0e3e9 100644
--- a/gdb/testsuite/gdb.mi/mi1-var-display.exp
+++ b/gdb/testsuite/gdb.mi/mi1-var-display.exp
@@ -183,7 +183,7 @@ mi_gdb_test "-var-create weird * weird" \
"create local variable weird"
mi_gdb_test "-var-list-children weird" \
- "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
+ "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
"get children local variable weird"
diff --git a/gdb/testsuite/gdb.mi/mi2-basics.exp b/gdb/testsuite/gdb.mi/mi2-basics.exp
new file mode 100644
index 00000000000..44d2e4b9dfa
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-basics.exp
@@ -0,0 +1,246 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# test basic Machine interface (MI) operations
+#
+# Verify that, using the MI, we can load a program and do
+# other basic things that are used by all test files through mi_gdb_exit,
+# mi_gdb_start, mi_delete_breakpoints, mi_gdb_reinitialize_dir and
+# mi_gdb_load, so we can safely use those.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but the command syntax and correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# In this file we want to test if the operations needed by the following
+# procedures work, so it makes no sense using them here.
+
+# mi_delete_breakpoints
+# mi_gdb_reinitialize_dir $srcdir/$subdir
+# mi_gdb_load ${binfile}
+
+# Test if the MI interpreter has been configured
+
+proc test_mi_interpreter_selection {} {
+ global mi_gdb_prompt
+ global gdb_prompt
+
+ # All this test expects is to get the prompt back
+ # with no syntax error message
+ send_gdb "-gdb-version\n"
+ gdb_expect {
+ -re "GNU gdb .*\r\n$mi_gdb_prompt$" \
+ { pass "acceptance of MI operations"
+ return 1}
+ -re ".*\r\n$mi_gdb_prompt$" \
+ { fail "acceptance of MI operations"
+ note "Skipping all other MI tests." }
+ -re "Undefined command.*$gdb_prompt $" \
+ { fail "acceptance of MI operations"
+ note "Skipping all other MI tests." }
+ -re ".*$gdb_prompt $" \
+ { fail "acceptance of MI operations"
+ note "Skipping all other MI tests." }
+ timeout { fail "acceptance of MI operations (timeout)"
+ note "Skipping all other MI tests." }
+ }
+ return 0
+}
+
+proc test_exec_and_symbol_mi_operatons {} {
+ global mi_gdb_prompt
+ global binfile
+
+ # Load symbols and specify executable on a single operation
+ # Tests:
+ # -file-exec-and-symbols
+
+ # Can't use mi_gdb_test as if this doesn't work,
+ # we must give up on the whole test file
+ send_gdb "-file-exec-and-symbols ${binfile}\n"
+ gdb_expect {
+ -re "\[\r\n\]*\\\^done\r\n$mi_gdb_prompt$" \
+ { pass "file-exec-and-symbols operation" }
+ timeout { fail "file-exec-and-symbols operation (timeout)"
+ note "Skipping all other MI tests."
+ return 0}
+ }
+
+ # The following is not used by mi-support.exp, but we test here so
+ # we get done with loading a program basics.
+
+ # Do it again, but now load symbols and specify executable with
+ # two separate operations
+ # Tests:
+ # -file-clear
+ # -file-exec-file
+ # -file-symbol-file
+
+ # FIXME: file-clear is not implemented yet.
+# mi_gdb_test "-file-clear" \
+# "\\\^done" \
+# "file-clear operation"
+
+ mi_gdb_test "-file-exec-file ${binfile}" \
+ "\\\^done" \
+ "file-exec-file operation"
+
+ mi_gdb_test "-file-symbol-file ${binfile}" \
+ "\\\^done" \
+ "file-symbol-file operation"
+
+ # FIXME: if we cannot load we have to skip all other tests.
+}
+
+proc test_breakpoints_deletion {} {
+ global mi_gdb_prompt
+ global srcfile
+
+ # Clear all breakpoints and list to confirm
+ # Tests:
+ # -break-delete (all)
+ # -break-list
+
+ # The all parameter is actually no parameter.
+ mi_gdb_test "200-break-delete" \
+ "\\\^done" \
+ "break-delete (all) operation"
+
+ mi_gdb_test "201-break-list" \
+ ".*\\\^done,BreakpointTable=\\\{.*,body=\\\[\\\]\\\}" \
+ "all breakpoints removed"
+}
+
+proc test_dir_specification {} {
+ global mi_gdb_prompt
+ global srcdir
+ global subdir
+
+ # Add to the search directories, display, then reset back to default
+ # Tests:
+ # -environment-directory arg
+ # -environment-directory
+ # -environment-directory -r
+
+#exp_internal 1
+ mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \
+ "\\\^done,source-path=\"${srcdir}/${subdir}.\\\$cdir.\\\$cwd\"" \
+ "environment-directory arg operation"
+
+ mi_gdb_test "203-environment-directory" \
+ "\\\^done,source-path=\"${srcdir}/${subdir}.\\\$cdir.\\\$cwd\"" \
+ "environment-directory empty-string operation"
+
+ mi_gdb_test "204-environment-directory -r" \
+ "\\\^done,source-path=\"\\\$cdir.\\\$cwd\"" \
+ "environment-directory operation"
+
+#exp_internal 0
+}
+
+proc test_cwd_specification {} {
+ global mi_gdb_prompt
+ global objdir
+ global subdir
+
+ # Change the working directory, then print the current working directory
+ # Tests:
+ # -environment-cd ${objdir}
+ # -environment-pwd
+
+ mi_gdb_test "205-environment-cd ${objdir}" \
+ "\\\^done" \
+ "environment-cd arg operation"
+
+ mi_gdb_test "206-environment-pwd" \
+ "\\\^done,cwd=\"${objdir}\"" \
+ "environment-pwd operation"
+}
+
+proc test_path_specification {} {
+ global mi_gdb_prompt
+ global orig_path
+ global objdir
+ global srcdir
+
+ # Add to the path, display, then reset
+ # Tests:
+ # -environment-path
+ # -environment-path dir1 dir2
+ # -environment-path -r dir
+ # -environment-path -r
+
+#exp_internal 1
+
+ send_gdb "-environment-path\n"
+ gdb_expect 20 {
+ -re "\\\^done,path=\"\(.*\)\"\r\n$mi_gdb_prompt" {
+ set orig_path $expect_out(1,string);
+ }
+ timeout {
+ perror "-environment-path (timeout)" ;
+ return
+ }
+ }
+
+ mi_gdb_test "207-environment-path" \
+ "\\\^done,path=\"$orig_path\"" \
+ "environment-path no-args operation"
+
+ mi_gdb_test "208-environment-path $srcdir $objdir" \
+ "\\\^done,path=\"$srcdir.$objdir.$orig_path\"" \
+ "environment-path dir1 dir2 operation"
+
+ mi_gdb_test "209-environment-path -r $objdir" \
+ "\\\^done,path=\"$objdir.$orig_path\"" \
+ "environment-path -r dir operation"
+
+ mi_gdb_test "210-environment-path -r" \
+ "\\\^done,path=\"$orig_path\"" \
+ "environment-path -r operation"
+
+#exp_internal 0
+}
+
+if [test_mi_interpreter_selection] {
+ test_exec_and_symbol_mi_operatons
+ test_breakpoints_deletion
+ test_dir_specification
+ test_cwd_specification
+ test_path_specification
+}
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-break.exp b/gdb/testsuite/gdb.mi/mi2-break.exp
new file mode 100644
index 00000000000..11cb0d98045
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-break.exp
@@ -0,0 +1,138 @@
+# Copyright 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_tbreak_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert -t main
+ # -break-insert -t basics.c:callee2
+ # -break-insert -t basics.c:15
+ # -break-insert -t srcfile:6
+ # -break-list
+
+ mi_gdb_test "222-break-insert -t main" \
+ "222\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert -t operation"
+
+ mi_gdb_test "333-break-insert -t basics.c:callee2" \
+ "333\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \
+ "insert temp breakpoint at basics.c:callee2"
+
+ mi_gdb_test "444-break-insert -t basics.c:15" \
+ "444\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \
+ "insert temp breakpoint at basics.c:15 (callee3)"
+
+ # Getting the quoting right is tricky. That is "\"<file>\":6"
+ mi_gdb_test "555-break-insert -t \"\\\"${srcfile}\\\":6\"" \
+ "555\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \
+ "insert temp breakpoint at \"<fullfilename>\":6 (callee4)"
+
+ mi_gdb_test "666-break-list" \
+ "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}.*\\\]\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "777-break-delete" \
+ "777\\^done" \
+ "delete temp breakpoints"
+}
+
+proc test_rbreak_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert -r main
+ # -break-insert -r callee2
+ # -break-insert -r callee
+ # -break-insert -r .*llee
+ # -break-list
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "122-break-insert -r main" \
+ "122\\^done,bkpt=\{number=\"5\",addr=\"$hex\",file=\".*basics.c\",line=\"32\"\}" \
+ "break-insert -r operation"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "133-break-insert -r callee2" \
+ "133\\^done,bkpt=\{number=\"6\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\}" \
+ "insert breakpoint with regexp callee2"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "144-break-insert -r callee" \
+ "144\\^done,bkpt=\{number=\"7\",addr=\"$hex\",file=\".*basics.c\",line=\"27\"\},bkpt=\{number=\"8\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\},bkpt=\{number=\"9\",addr=\"$hex\",file=\".*basics.c\",line=\"17\"\},bkpt=\{number=\"10\",addr=\"$hex\",file=\".*basics.c\",line=\"8\"\}" \
+ "insert breakpoint with regexp callee"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "155-break-insert -r \.\*llee" \
+ "155\\^done,bkpt=\{number=\"11\",addr=\"$hex\",file=\".*basics.c\",line=\"27\"\},bkpt=\{number=\"12\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\},bkpt=\{number=\"13\",addr=\"$hex\",file=\".*basics.c\",line=\"17\"\},bkpt=\{number=\"14\",addr=\"$hex\",file=\".*basics.c\",line=\"8\"\}" \
+ "insert breakpoint with regexp .*llee"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "166-break-list" \
+ "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\]\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "177-break-delete" \
+ "177\\^done" \
+ "delete temp breakpoints"
+}
+
+test_tbreak_creation_and_listing
+test_rbreak_creation_and_listing
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-cli.exp b/gdb/testsuite/gdb.mi/mi2-cli.exp
new file mode 100644
index 00000000000..10295a90ce2
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-cli.exp
@@ -0,0 +1,208 @@
+# Copyright 2002, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file tests that GDB's console can be accessed via the MI.
+# Specifically, we are testing the "interpreter-exec" command and that
+# the commands that are executed via this command are properly executed.
+# Console commands executed via MI should use MI output wrappers, MI event
+# handlers, etc.
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_gdb_reinitialize_dir $srcdir/$subdir
+
+mi_gdb_test "-interpreter-exec" \
+ {\^error,msg="mi_cmd_interpreter_exec: Usage: -interpreter-exec interp command"} \
+ "-interpreter-exec with no arguments"
+
+mi_gdb_test "-interpreter-exec console" \
+ {\^error,msg="mi_cmd_interpreter_exec: Usage: -interpreter-exec interp command"} \
+ "-interpreter-exec with one argument"
+
+mi_gdb_test "-interpreter-exec bogus command" \
+ {\^error,msg="mi_cmd_interpreter_exec: could not find interpreter \\\"bogus\\\""} \
+ "-interpreter-exec with bogus interpreter"
+
+set msg {Undefined command: \\\"bogus\\\"\. Try \\\"help\\\"\.}
+mi_gdb_test "-interpreter-exec console bogus" \
+ "&\\\"$msg\\\\n\\\".*\\^error,msg=\\\"$msg\\\".*" \
+ "-interpreter-exec console bogus"
+
+# NOTE: cagney/2003-02-03: Not yet.
+# mi_gdb_test "-interpreter-exec console \"file $binfile\"" \
+# {(=.*)+\^done} \
+# "-interpreter-exec console \"file \$binfile\""
+mi_gdb_test "-interpreter-exec console \"file $binfile\"" \
+ {\^done} \
+ "-interpreter-exec console \"file \$binfile\""
+
+mi_run_to_main
+
+mi_gdb_test "-interpreter-exec console \"set args foobar\"" \
+ {\^done} \
+ "-interpreter-exec console \"set args foobar\""
+
+mi_gdb_test "-interpreter-exec console \"show args\"" \
+ {\~"Argument list to give program being debugged when it is started is \\\"foobar\\\"\.\\n".*\^done} \
+ "-interpreter-exec console \"show args\""
+
+# NOTE: cagney/2003-02-03: Not yet.
+# mi_gdb_test "-interpreter-exec console \"break callee4\"" \
+# {(&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-create,number="2".*\^done} \
+# "-interpreter-exec console \"break callee4\""
+mi_gdb_test "-interpreter-exec console \"break callee4\"" \
+ {(&.*)*.*~"Breakpoint 2 at.*\\n".*\^done} \
+ "-interpreter-exec console \"break callee4\""
+
+mi_gdb_test "-interpreter-exec console \"info break\"" \
+ {\~"Num[ \t]*Type[ \t]*Disp[ \t]*Enb[ \t]*Address[ \t]*What\\n".*~"2[ \t]*breakpoint[ \t]*keep[ \t]*y[ \t]*0x[0-9A-Fa-f]+[ \t]*in callee4 at .*basics.c:[0-9]+\\n".*\^done} \
+ "-interpreter-exec console \"info break\""
+
+mi_gdb_test "-interpreter-exec console \"set listsize 1\"" \
+ {\^done} \
+ "-interpreter-exec console \"set listsize 1\""
+
+mi_gdb_test "-interpreter-exec console \"list\"" \
+ {.*\~"32[ \t(\\t)]*callee1.*\\n".*\^done} \
+ "-interpreter-exec console \"list\""
+
+# # NOTE: cagney/2003-02-03: Not yet.
+# mi_gdb_test "-exec-continue" \
+# {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",line="8"\}} \
+# "-interpreter-exec console \"continue to callee4\""
+send_gdb "999-exec-continue\n"
+gdb_expect {
+ -re "999\\^running\[\r\n\]+$mi_gdb_prompt.*999\\*stopped,reason=.breakpoint-hit.*$mi_gdb_prompt$" {
+ pass "continue to callee4"
+ }
+ timeout {
+ fail "continue to callee4 (timeout)"
+ }
+}
+
+# NOTE: cagney/2003-02-03: Not yet.
+# mi_gdb_test "100-interpreter-exec console \"delete 2\"" \
+# {.*=breakpoint-delete,number=\"2\".*\^done} \
+# "-interpreter-exec console \"delete 2\""
+mi_gdb_test "100-interpreter-exec console \"delete 2\"" \
+ {100\^done} \
+ "-interpreter-exec console \"delete 2\""
+
+# NOTE: cagney/2003-02-03: Not yet.
+# mi_gdb_test "200-interpreter-exec console \"up\"" \
+# {.*=selected-frame-level-changed,level="1".*\^done} \
+# "-interpreter-exec console \"up\""
+mi_gdb_test "200-interpreter-exec console \"up\"" \
+ {200\^done} \
+ "-interpreter-exec console \"up\""
+
+# NOTE: cagney/2003-02-03: Not yet.
+# mi_gdb_test "300-interpreter-exec console \"down\"" \
+# {.*=selected-frame-level-changed,level="0".*\^done} \
+# "-interpreter-exec console \"down\""
+mi_gdb_test "300-interpreter-exec console \"down\"" \
+ {300\^done} \
+ "-interpreter-exec console \"down\""
+
+# NOTE: cagney/2003-02-03: Not yet.
+# mi_gdb_test "-interpreter-exec console \"frame 2\"" \
+# {.*=selected-frame-level-changed,level="2".*\^done} \
+# "-interpreter-exec console \"frame 2\""
+mi_gdb_test "400-interpreter-exec console \"frame 2\"" \
+ {400\^done} \
+ "-interpreter-exec console \"frame 2\""
+
+# NOTE: cagney/2003-02-03: Not yet.
+# mi_gdb_test "-stack-select-frame 0" \
+# {.*=selected-frame-level-changed,level="0".*\^done} \
+# "-stack-select-frame 0"
+mi_gdb_test "500-stack-select-frame 0" \
+ {500\^done} \
+ "-stack-select-frame 0"
+
+# NOTE: cagney/2003-02-03: Not yet.
+# mi_gdb_test "-break-insert -t basics.c:35" \
+# {.*=breakpoint-create,number="3".*\^done} \
+# "-break-insert -t basics.c:35"
+mi_gdb_test "600-break-insert -t basics.c:35" \
+ {600\^done,bkpt=.number="3",type="breakpoint".*\}} \
+ "-break-insert -t basics.c:35"
+
+# mi_gdb_test "-exec-continue" \
+# {.*\*stopped.*,file=".*basics.c",line="35"\}} \
+# "-exec-continue to line 35"
+send_gdb "700-exec-continue\n"
+gdb_expect {
+ -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,line=.35.*$mi_gdb_prompt$" {
+ pass "-exec-continue to line 35"
+ }
+ timeout {
+ fail "-exec-continue to line 35"
+ }
+}
+
+# NOTE: cagney/2003-02-03: Not yet.
+# mi_gdb_test "-exec-next" \
+# {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="37"\}} \
+# "-exec-next to line 37"
+send_gdb "800-exec-next\n"
+gdb_expect {
+ -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=.*basics.c.,line=.37.*$mi_gdb_prompt$" {
+ pass "-exec-next to line 37"
+ }
+ timeout {
+ fail "-exec-next to line 37"
+ }
+}
+
+mi_gdb_test "-interpreter-exec console \"list\"" \
+ {\~"37[ \t(\\t)]*return 0;\\n".*\^done} \
+ "-interpreter-exec console \"list\" at basics.c:37"
+
+mi_gdb_test "-interpreter-exec console \"help set args\"" \
+ {\~"Set argument list to give program being debugged when it is started\.\\nFollow this command with any number of args, to be passed to the program\.".*\^done} \
+ "-interpreter-exec console \"help set args\""
+
+# NOTE: cagney/2003-02-03: Not yet.
+# mi_gdb_test "-interpreter-exec console \"set \$pc=0x0\"" \
+# {.*=target-changed.*\^done} \
+# "-interpreter-exec console \"set \$pc=0x0\""
+mi_gdb_test "888-interpreter-exec console \"set \$pc=0x0\"" \
+ {888\^done} \
+ "-interpreter-exec console \"set \$pc=0x0\""
+
+#mi_gdb_test "-interpreter-exec console \"\"" \
+ {} \
+ "-interpreter-exec console \"\""
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-console.exp b/gdb/testsuite/gdb.mi/mi2-console.exp
new file mode 100644
index 00000000000..5e307b9e6f3
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-console.exp
@@ -0,0 +1,97 @@
+# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+# This test only works when talking to a target that routes its output
+# through GDB. Check that we're either talking to a simulator or a
+# remote target.
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "mi-console"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_run_to_main
+
+# Next over the hello() call which will produce lots of output
+send_gdb "47-exec-next\n"
+gdb_expect {
+ -re "47\\^running\r\n$mi_gdb_prompt" {
+ pass "Started step over hello"
+ }
+ timeout {
+ fail "Started step over hello (timeout)"
+ }
+}
+
+gdb_expect {
+ -re "@\"H\"\r\n.*@\"e\"\r\n.*@\"l\"\r\n.*@\"l\"\r\n.*@\"o\"\r\n.*@\" \"\r\n.*@\"\\\\\\\\\"\r\n.*@\"\\\\\"\"\r\n.*@\"!\"\r\n.*@\"\\\\r\"\r\n.*@\"\\\\n\"\r\n" {
+ pass "Hello message"
+ }
+ -re "Hello" {
+
+ # Probably a native system where GDB doesn't have direct
+ # control over the inferior console.
+ # For this to work, GDB would need to run the inferior process
+ # under a PTY and then use the even-loops ability to wait on
+ # multiple event sources to channel the output back through the
+ # MI.
+
+ kfail "gdb/623" "Hello message"
+ }
+ timeout {
+ fail "Hello message (timeout)"
+ }
+}
+
+gdb_expect {
+ -re "47\\*stopped.*$mi_gdb_prompt$" {
+ pass "Finished step over hello"
+ }
+ timeout {
+ fail "Finished step over hello (timeout)"
+ }
+}
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-disassemble.exp b/gdb/testsuite/gdb.mi/mi2-disassemble.exp
new file mode 100644
index 00000000000..8cd76f968c4
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-disassemble.exp
@@ -0,0 +1,178 @@
+# Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test Machine interface (MI) operations for disassembly.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_disassembly_only {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassemble -s $pc -e "$pc+8" -- 0
+ # -data-disassembly -f basics.c -l 32 -- 0
+
+ mi_gdb_test "print/x \$pc" "" ""
+ mi_gdb_test "111-data-disassemble -s \$pc -e \"\$pc + 12\" -- 0" \
+ "111\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\]" \
+ "data-disassemble from pc to pc+12 assembly only"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -- 0" \
+ "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \
+ "data-disassemble file & line, assembly only"
+}
+
+proc test_disassembly_lines_limit {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassembly -f basics.c -l 32 -n 20 -- 0
+ # -data-disassembly -f basics.c -l 32 -n 0 -- 0
+ # -data-disassembly -f basics.c -l 32 -n 50 -- 0
+
+ mi_gdb_test "print/x \$pc" "" ""
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 0" \
+ "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \
+ "data-disassemble file, line, number assembly only"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 0" \
+ "222\\^done,asm_insns=\\\[\\\]" \
+ "data-disassemble file, line, number (zero lines) assembly only"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 0" \
+ "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \
+ "data-disassemble file, line, number (more than main lines) assembly only"
+}
+
+
+proc test_disassembly_mixed {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassembly -f basics.c -l 21 -- 1
+ # -data-disassembly -s $pc -e "$pc+8" -- 1
+
+ mi_gdb_test "002-data-disassemble -f basics.c -l 21 -- 1" \
+ "002\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"21\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",inst=\".*\"\}.*\\\]\}.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \
+ "data-disassemble file, line assembly mixed"
+
+ #
+ # In mixed mode, the lowest level of granularity is the source line.
+ # So we are going to get the disassembly for the source line at
+ # which we are now, even if we have specified that the range is only 2 insns.
+ #
+ mi_gdb_test "003-data-disassemble -s \$pc -e \"\$pc+4\" -- 1" \
+ "003\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \
+ "data-disassemble range assembly mixed"
+}
+
+proc test_disassembly_mixed_lines_limit {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassembly -f basics.c -l 32 -n 20 -- 1
+ # -data-disassembly -f basics.c -l 32 -n 0 -- 1
+ # -data-disassembly -f basics.c -l 32 -n 50 -- 1
+
+ mi_gdb_test "print/x \$pc" "" ""
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 1" \
+ "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \
+ "data-disassemble file, line, number assembly mixed"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 1" \
+ "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"31\",file=\".*basics.c\",line_asm_insn=\\\[\\\]\}\\\]" \
+ "data-disassemble file, line, number (zero lines) assembly mixed"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 1" \
+ "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\}.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \
+ "data-disassemble file, line, number (more than main lines) assembly mixed"
+}
+
+proc test_disassembly_bogus_args {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Test that bogus input to disassembly command is rejected.
+ # Tests:
+ # -data-disassembly -f foo -l abc -n 0 -- 0
+ # -data-disassembly -s foo -e bar -- 0
+ # -data-disassembly -s $pc -f basics.c -- 0
+ # -data-disassembly -f basics.c -l 32 -- 9
+
+ mi_gdb_test "123-data-disassemble -f foo -l abc -n 0 -- 0" \
+ ".*123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \
+ "data-disassemble bogus filename"
+
+ mi_gdb_test "321-data-disassemble -s foo -e bar -- 0" \
+ "321\\^error,msg=\"No symbol \\\\\"foo\\\\\" in current context.\"" \
+ "data-disassemble bogus address"
+
+ mi_gdb_test "456-data-disassemble -s \$pc -f basics.c -- 0" \
+ "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. | .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \
+ "data-disassemble mix different args"
+
+ mi_gdb_test "789-data-disassemble -f basics.c -l 32 -- 9" \
+ "789\\^error,msg=\"mi_cmd_disassemble: Mixed_mode argument must be 0 or 1.\"" \
+ "data-disassemble wrong mode arg"
+
+}
+
+mi_run_to_main
+test_disassembly_only
+test_disassembly_mixed
+test_disassembly_bogus_args
+test_disassembly_lines_limit
+test_disassembly_mixed_lines_limit
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-eval.exp b/gdb/testsuite/gdb.mi/mi2-eval.exp
new file mode 100644
index 00000000000..85fd991bbd3
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-eval.exp
@@ -0,0 +1,62 @@
+# Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify -data-evaluate-expression. There are really minimal tests.
+
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_runto callee4
+mi_next_to "callee4" "" "basics.c" "9" "next at callee4"
+
+mi_gdb_test "211-data-evaluate-expression A" "211\\^done,value=\"1\"" "eval A"
+
+mi_gdb_test "311-data-evaluate-expression &A" "311\\^done,value=\"$hex\"" "eval &A"
+
+mi_gdb_test "411-data-evaluate-expression A+3" "411\\^done,value=\"4\"" "eval A+3"
+
+mi_gdb_test "511-data-evaluate-expression \"A + 3\"" "511\\^done,value=\"4\"" "eval A + 3"
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-file.exp b/gdb/testsuite/gdb.mi/mi2-file.exp
new file mode 100644
index 00000000000..fe75a934197
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-file.exp
@@ -0,0 +1,65 @@
+# Copyright 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_tbreak_creation_and_listing {} {
+ global srcfile
+ global srcdir
+ global subdir
+ set srcfilepath [string_to_regexp ${srcdir}/${subdir}/${srcfile}]
+
+ # get the path and absolute path to the current executable
+ mi_gdb_test "111-file-list-exec-source-file" \
+ "111\\\^done,line=\"23\",file=\"${srcfilepath}\",fullname=\"/.*/${srcfile}\"" \
+ "request path info of current source file (${srcfile})"
+}
+
+test_tbreak_creation_and_listing
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-hack-cli.exp b/gdb/testsuite/gdb.mi/mi2-hack-cli.exp
new file mode 100644
index 00000000000..066eea2d425
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-hack-cli.exp
@@ -0,0 +1,40 @@
+# Copyright 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+
+# Some basic checks for the CLI.
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+mi_gdb_test "show architecture" \
+ "&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n\\^done" \
+ "show architecture"
+
+mi_gdb_test "47show architecture" \
+ "&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n47\\^done" \
+ "47show architecture"
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-pthreads.exp b/gdb/testsuite/gdb.mi/mi2-pthreads.exp
new file mode 100644
index 00000000000..fe007e55334
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-pthreads.exp
@@ -0,0 +1,221 @@
+# Copyright 2002, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file tests MI thread commands.
+# Specifically, we are testing the MI command set and the console (in MI)
+# command set ("interpreter-exec") and that the commands that are executed
+# via these command pathways are properly executed. Console commands
+# executed via MI should use MI output wrappers, MI event handlers, etc.
+
+# This only works with native configurations
+if {![isnative]} {
+ return
+}
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if {[mi_gdb_start]} {
+ continue
+}
+
+# The procs below dealing with parsing cli/mi output for the threadlist
+# is duplicated in gdb669.exp. Any changes here will probably need to
+# be made there as well.
+
+proc get_mi_thread_list {name} {
+ global expect_out
+
+ # MI will return a list of thread ids:
+ #
+ # -thread-list-ids
+ # ^done,thread-ids=[thread-id="1",thread-id="2",...],number-of-threads="N"
+ # (gdb)
+ mi_gdb_test "-thread-list-ids" \
+ {\^done,thread-ids={(thread-id="[0-9]+"(,)?)+},number-of-threads="[0-9]+"} \
+ "-thread_list_ids ($name)"
+
+ set output {}
+ if {[info exists expect_out(buffer)]} {
+ set output $expect_out(buffer)
+ }
+
+ set thread_list {}
+ if {![regexp {thread-ids=\{(thread-id="[0-9]+"(,)?)*\}} $output threads]} {
+ fail "finding threads in MI output ($name)"
+ } else {
+ pass "finding threads in MI output ($name)"
+
+ # Make list of console threads
+ set start [expr {[string first \{ $threads] + 1}]
+ set end [expr {[string first \} $threads] - 1}]
+ set threads [string range $threads $start $end]
+ foreach thread [split $threads ,] {
+ if {[scan $thread {thread-id="%d"} num]} {
+ lappend thread_list $num
+ }
+ }
+ }
+
+ return $thread_list
+}
+
+# Check that MI and the console know of the same threads.
+# Appends NAME to all test names.
+proc check_mi_and_console_threads {name} {
+ global expect_out
+
+ mi_gdb_test "-thread-list-ids" \
+ {\^done,thread-ids={(thread-id="[0-9]+"(,)*)+},number-of-threads="[0-9]+"} \
+ "-thread-list-ids ($name)"
+ set mi_output {}
+ if {[info exists expect_out(buffer)]} {
+ set mi_output $expect_out(buffer)
+ }
+
+ # GDB will return a list of thread ids and some more info:
+ #
+ # (gdb)
+ # -interpreter-exec console "info threads"
+ # ~" 4 Thread 2051 (LWP 7734) 0x401166b1 in __libc_nanosleep () at __libc_nanosleep:-1"
+ # ~" 3 Thread 1026 (LWP 7733) () at __libc_nanosleep:-1"
+ # ~" 2 Thread 2049 (LWP 7732) 0x401411f8 in __poll (fds=0x804bb24, nfds=1, timeout=2000) at ../sysdeps/unix/sysv/linux/poll.c:63"
+ # ~"* 1 Thread 1024 (LWP 7731) main (argc=1, argv=0xbfffdd94) at ../../../src/gdb/testsuite/gdb.mi/pthreads.c:160"
+ # FIXME: kseitz/2002-09-05: Don't use the hack-cli method.
+ mi_gdb_test "info threads" \
+ {.*(~".*"[\r\n]*)+.*} \
+ "info threads ($name)"
+ set console_output {}
+ if {[info exists $expect_out(buffer)]} {
+ set console_output $expect_out(buffer)
+ }
+
+ # Make a list of all known threads to console (gdb's thread IDs)
+ set console_thread_list {}
+ foreach line [split $console_output \n] {
+ if {[string index $line 0] == "~"} {
+ # This is a line from the console; trim off "~", " ", "*", and "\""
+ set line [string trim $line ~\ \"\*]
+ if {[scan $line "%d" id] == 1} {
+ lappend console_thread_list $id
+ }
+ }
+ }
+
+ # Now find the result string from MI
+ set mi_result ""
+ foreach line [split $mi_output \n] {
+ if {[string range $line 0 4] == "^done"} {
+ set mi_result $line
+ }
+ }
+ if {$mi_result == ""} {
+ fail "finding MI result string ($name)"
+ } else {
+ pass "finding MI result string ($name)"
+ }
+
+ # Finally, extract the thread ids and compare them to the console
+ set num_mi_threads_str ""
+ if {![regexp {number-of-threads="[0-9]+"} $mi_result num_mi_threads_str]} {
+ fail "finding number of threads in MI output ($name)"
+ } else {
+ pass "finding number of threads in MI output ($name)"
+
+ # Extract the number of threads from the MI result
+ if {![scan $num_mi_threads_str {number-of-threads="%d"} num_mi_threads]} {
+ fail "got number of threads from MI ($name)"
+ } else {
+ pass "got number of threads from MI ($name)"
+
+ # Check if MI and console have same number of threads
+ if {$num_mi_threads != [llength $console_thread_list]} {
+ fail "console and MI have same number of threads ($name)"
+ } else {
+ pass "console and MI have same number of threads ($name)"
+
+ # Get MI thread list
+ set mi_thread_list [get_mi_thread_list $name]
+
+ # Check if MI and console have the same threads
+ set fails 0
+ foreach ct [lsort $console_thread_list] mt [lsort $mi_thread_list] {
+ if {$ct != $mt} {
+ incr fails
+ }
+ }
+ if {$fails > 0} {
+ fail "MI and console have same threads ($name)"
+
+ # Send a list of failures to the log
+ send_log "Console has thread ids: $console_thread_list\n"
+ send_log "MI has thread ids: $mi_thread_list\n"
+ } else {
+ pass "MI and console have same threads ($name)"
+ }
+ }
+ }
+ }
+}
+
+# This procedure tests the various thread commands in MI.
+proc check_mi_thread_command_set {} {
+
+ mi_runto done_making_threads
+
+ set thread_list [get_mi_thread_list "in check_mi_thread_command_set"]
+
+ mi_gdb_test "-thread-select" \
+ {\^error,msg="mi_cmd_thread_select: USAGE: threadnum."} \
+ "check_mi_thread_command_set: -thread-select"
+
+ mi_gdb_test "-thread-select 123456789" \
+ {\^error,msg="Thread ID 123456789 not known\."} \
+ "check_mi_thread_command_set: -thread-select 123456789"
+
+ foreach thread $thread_list {
+ # line and file are optional.
+ # many of the threads are blocked in libc calls,
+ # and many people have libc's with no symbols.
+ mi_gdb_test "-thread-select $thread" \
+ "\\^done,new-thread-id=\"$thread\",frame={.*}(,line=\"(-)?\[0-9\]+\",file=\".*\")?" \
+ "check_mi_thread_command_set: -thread-select $thread"
+ }
+}
+
+#
+# Start here
+#
+set testfile "pthreads"
+set srcfile "$testfile.c"
+set binfile "$objdir/$subdir/$testfile"
+
+set options [list debug incdir=$objdir]
+if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
+ return -1
+}
+
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load $binfile
+
+check_mi_thread_command_set
+
+mi_gdb_exit
+
diff --git a/gdb/testsuite/gdb.mi/mi2-read-memory.exp b/gdb/testsuite/gdb.mi/mi2-read-memory.exp
new file mode 100644
index 00000000000..eee36a75f16
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-read-memory.exp
@@ -0,0 +1,86 @@
+# Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# test basic Machine interface (MI) operations
+#
+# Verify that, using the MI, we can load a program and do
+# other basic things that are used by all test files through mi_gdb_exit,
+# mi_gdb_start, mi_delete_breakpoints, mi_gdb_reinitialize_dir and
+# mi_gdb_load, so we can safely use those.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but the command syntax and correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "mi-read-memory"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+mi_run_to_main
+mi_next_to "main" "" "mi-read-memory.c" "20" "next at main"
+
+mi_gdb_test "1-data-read-memory" \
+ "1\\^error,msg=\".*\"" \
+ "no arguments"
+
+
+mi_gdb_test "2-data-read-memory bytes x 1 3 2" \
+ "2\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x00\",\"0x01\"\\\]},{addr=\"$hex\",data=\\\[\"0x02\",\"0x03\"\\\]},{addr=\"$hex\",data=\\\[\"0x04\",\"0x05\"\\\]}\\\]" \
+ "3x2, one byte"
+
+
+mi_gdb_test "9-data-read-memory -o -6 -- -0+bytes+6 x 1 3 2" \
+ "9\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x00\",\"0x01\"\\\]},{addr=\"$hex\",data=\\\[\"0x02\",\"0x03\"\\\]},{addr=\"$hex\",data=\\\[\"0x04\",\"0x05\"\\\]}\\\]" \
+ "3x2, one byte offset by -6"
+
+
+mi_gdb_test "3-data-read-memory \"(shorts + 128)\" x 2 1 2" \
+ "3\\^done,addr=\"$hex\",nr-bytes=\"4\",total-bytes=\"4\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x0100\",\"0x0102\"\\\]}\\\]" \
+ "expression in quotes"
+
+
+mi_gdb_test "4-data-read-memory bytes+16 x 1 8 4 x" \
+ "4\\^done,addr=\"$hex\",nr-bytes=\"32\",total-bytes=\"32\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x10\",\"0x11\",\"0x12\",\"0x13\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x14\",\"0x15\",\"0x16\",\"0x17\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x18\",\"0x19\",\"0x1a\",\"0x1b\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x1c\",\"0x1d\",\"0x1e\",\"0x1f\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x20\",\"0x21\",\"0x22\",\"0x23\"\\\],ascii=\" !\\\\\"#\"},{addr=\"$hex\",data=\\\[\"0x24\",\"0x25\",\"0x26\",\"0x27\"\\\],ascii=\"\\$%&'\"},{addr=\"$hex\",data=\\\[\"0x28\",\"0x29\",\"0x2a\",\"0x2b\"\\\],ascii=\"().+\"},{addr=\"$hex\",data=\\\[\"0x2c\",\"0x2d\",\"0x2e\",\"0x2f\"\\\],ascii=\",-\./\"}\\\]" \
+ "ascii and data"
+
+
+mi_gdb_test "5-data-read-memory shorts+64 d 2 1 1" \
+ "5\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"128\"\\\]}\\\]" \
+ "decimal"
+
+mi_gdb_test "6-data-read-memory shorts+64 o 2 1 1" \
+ "6\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0200\"\\\]}\\\]" \
+ "octal"
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-regs.exp b/gdb/testsuite/gdb.mi/mi2-regs.exp
new file mode 100644
index 00000000000..a14b2417767
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-regs.exp
@@ -0,0 +1,129 @@
+# Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and look at registers.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc sparc_register_tests_no_exec { } {
+ # Test the generic IDT chip.
+ mi_gdb_test "111-data-list-register-values" \
+ ".*111\\^error,msg=\"mi_cmd_data_list_register_values: Usage: -data-list-register-values <format> \\\[<regnum1>...<regnumN>\\\]\"" \
+ "wrong arguments"
+
+ mi_gdb_test "111-data-list-register-values x" \
+ ".*111\\^error,msg=\"mi_cmd_data_list_register_values: No registers\.\"" \
+ "no executable"
+}
+
+# These tests exercise IDT-specific MIPS registers for several
+# different processor models.
+
+# This should detect the actual processor in use and change
+# the expected results appropriately. FIXME
+
+proc sparc_register_tests { } {
+ global hex
+ global decimal
+ set octal "\[0-7\]+"
+ set binary "\[0-1\]+"
+ set float "\\-?((\[0-9\]+(\\.\[0-9\]+)?(e\[-+\]\[0-9\]+)?)|(nan\\($hex\\)))"
+ set float2 "\\-?\[0-9\]+"
+
+ mi_gdb_test "111-data-list-register-names" \
+ "111\\^done,register-names=\\\[\"g0\",\"g1\",\"g2\",\"g3\",\"g4\",\"g5\",\"g6\",\"g7\",\"o0\",\"o1\",\"o2\",\"o3\",\"o4\",\"o5\",\"sp\",\"o7\",\"l0\",\"l1\",\"l2\",\"l3\",\"l4\",\"l5\",\"l6\",\"l7\",\"i0\",\"i1\",\"i2\",\"i3\",\"i4\",\"i5\",\"fp\",\"i7\",\"f0\",\"f1\",\"f2\",\"f3\",\"f4\",\"f5\",\"f6\",\"f7\",\"f8\",\"f9\",\"f10\",\"f11\",\"f12\",\"f13\",\"f14\",\"f15\",\"f16\",\"f17\",\"f18\",\"f19\",\"f20\",\"f21\",\"f22\",\"f23\",\"f24\",\"f25\",\"f26\",\"f27\",\"f28\",\"f29\",\"f30\",\"f31\",\"y\",\"psr\",\"wim\",\"tbr\",\"pc\",\"npc\",\"fpsr\",\"cpsr\"\\\]" \
+ "list register names"
+
+ mi_gdb_test "222-data-list-register-values x" \
+ "222\\^done,register-values=\\\[\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\\\]" \
+ "register values x"
+
+ mi_gdb_test "333-data-list-register-values f" \
+ "333\\^done,register-values=\\\[\{number=\"0\",value=\"$float\"\},\{number=\"1\",value=\"$float\"\},.*\{number=\"71\",value=\"$float\"\}\\\]" \
+ "register values f"
+
+ mi_gdb_test "444-data-list-register-values d" \
+ "444\\^done,register-values=\\\[\{number=\"0\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\\\]" \
+ "register values d"
+
+ mi_gdb_test "555-data-list-register-values o" \
+ "555\\^done,register-values=\\\[\{number=\"0\",value=\"$octal\"\}.*\{number=\"71\",value=\"$octal\"\}\\\]" \
+ "register values o"
+
+ mi_gdb_test "666-data-list-register-values t" \
+ "666\\^done,register-values=\\\[\{number=\"0\",value=\"$binary\"\}.*\{number=\"71\",value=\"$binary\"\}\\\]" \
+ "register values t"
+
+ # On the sparc, registers 0-31 are int, 32-63 float, 64-71 int
+
+ mi_gdb_test "777-data-list-register-values N" \
+ "777\\^done,register-values=\\\[\{number=\"0\",value=\"$decimal\"\}.*\{number=\"31\",value=\"$decimal\"\},\{number=\"32\",value=\"$float\"\}.*\{number=\"63\",value=\"$float\"\},\{number=\"64\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\\\]" \
+ "register values N"
+
+ mi_gdb_test "888-data-list-register-values r" \
+ "888\\^done,register-values=\\\[\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\\\]" \
+ "register values r"
+
+ mi_gdb_test "999-data-list-register-names 68 69 70 71" \
+ "999\\^done,register-names=\\\[\"pc\",\"npc\",\"fpsr\",\"cpsr\"\\\]" \
+ "list names of some regs"
+
+ mi_gdb_test "001-data-list-register-values x 68 69 70 71" \
+ "001\\^done,register-values=\\\[\{number=\"68\",value=\"$hex\"\},\{number=\"69\",value=\"$hex\"\},\{number=\"70\",value=\"$hex\"\},\{number=\"71\",value=\"$hex\"\}\\\]" \
+ "list values of some regs"
+
+ mi_gdb_test "002-data-list-changed-registers" \
+ "002\\^done,changed-registers=\\\[(\"${decimal}\"(,\"${decimal}\")*)?\\\]" \
+ "list changed registers"
+}
+
+if [istarget "sparc-*-*"] then {
+ sparc_register_tests_no_exec
+ mi_run_to_main
+ sparc_register_tests
+} else {
+ verbose "mi-regs.exp tests ignored for this target"
+}
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-return.exp b/gdb/testsuite/gdb.mi/mi2-return.exp
new file mode 100644
index 00000000000..b54f15a6d89
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-return.exp
@@ -0,0 +1,72 @@
+# Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test Machine interface (MI) operations
+# Verify that, using the MI, we can run a simple program and perform
+# exec-return.
+
+# The goal is not to
+# test gdb functionality, which is done by other tests, but to verify
+# the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+
+proc test_return_simple {} {
+ global mi_gdb_prompt
+ global hex
+
+ send_gdb "111-exec-return\n"
+ gdb_expect {
+ -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
+ -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
+ timeout { fail "return from callee4 now (timeout)"
+ }
+ }
+}
+
+mi_runto callee4
+
+mi_gdb_test "205-break-delete" \
+ "205\\^done.*" \
+ "delete all breakpoints"
+
+test_return_simple
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-simplerun.exp b/gdb/testsuite/gdb.mi/mi2-simplerun.exp
new file mode 100644
index 00000000000..93d44265699
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-simplerun.exp
@@ -0,0 +1,199 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_breakpoints_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert
+ # -break-list
+ # -break-disable
+ # -break-info
+
+ mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_gdb_test "201-break-insert basics.c:callee2" \
+ "201\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \
+ "insert breakpoint at basics.c:callee2"
+
+ mi_gdb_test "202-break-insert basics.c:15" \
+ "202\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \
+ "insert breakpoint at basics.c:15 (callee3)"
+
+ mi_gdb_test "203-break-insert \"\\\"${srcfile}\\\":6\"" \
+ "203\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \
+ "insert breakpoint at \"<fullfilename>\":6 (callee4)"
+
+ mi_gdb_test "204-break-list" \
+ "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\]\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "205-break-disable 2 3 4" \
+ "205\\^done.*" \
+ "disabling of breakpoints"
+
+ mi_gdb_test "206-break-info 2" \
+ "206\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"2\",.*,enabled=\"n\",.*\}\\\]\}" \
+ "list of breakpoints, 16 disabled"
+}
+
+proc test_running_the_program {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Run the program without args, then specify srgs and rerun the program
+ # Tests:
+ # -exec-run
+ # -gdb-set
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ # The following is equivalent to a send_gdb "000-exec-run\n"
+ mi_run_cmd
+ gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to main (2)"
+ }
+ timeout {
+ fail "run to main (timeout)"
+ }
+ }
+}
+
+proc test_controlled_execution {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Continue execution until a breakpoint is reached, step into calls, verifying
+ # if the arguments are correctly shown, continue to the end of a called
+ # function, step over a call (next).
+ # Tests:
+ # -exec-continue
+ # -exec-next
+ # -exec-step
+ # -exec-finish
+
+ mi_next_to "main" "" "basics.c" "33" "next at main"
+
+ # FIXME: A string argument is not printed right; should be fixed and
+ # we should look for the right thing here.
+ # NOTE: The ``\\\\\"'' is for \".
+ mi_step_to "callee1" \
+ "\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}" \
+ "basics.c" "27" "step at main"
+
+ # FIXME: A string argument is not printed right; should be fixed and
+ # we should look for the right thing here.
+ mi_execute_to "exec-step 3" "end-stepping-range" "callee4" "" \
+ "basics.c" "8" "" "step to callee4"
+
+ # FIXME: A string argument is not printed right; should be fixed and
+ # we should look for the right thing here.
+ # NOTE: The ``.'' is part of ``gdb-result-var="$1"''
+ mi_finish_to "callee3" ".*" "basics.c" "18" ".1" "0" "exec-finish"
+}
+
+proc test_controlling_breakpoints {} {
+ global mi_gdb_prompt
+
+ # Enable, delete, set ignore counts in breakpoints
+ # (disable was already tested above)
+ # Tests:
+ # -break-delete
+ # -break-enable
+ # -break-after
+ # -break-condition
+
+}
+
+proc test_program_termination {} {
+ global mi_gdb_prompt
+
+ # Run to completion: normal and forced
+ # Tests:
+ # -exec-abort
+ # (normal termination of inferior)
+
+ # FIXME: "stopped" doesn't seem appropriate.
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ send_gdb "999-exec-continue\n"
+ gdb_expect {
+ -re "999\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "999\\*stopped,reason=\"exited-normally\"\r\n$mi_gdb_prompt$" {
+ pass "continue to end"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "continue to end (2)"}
+ timeout {fail "continue to end (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "continue to end (1)"}
+ timeout {fail "continue to end (timeout 1)"}
+ }
+}
+
+test_breakpoints_creation_and_listing
+test_running_the_program
+test_controlled_execution
+test_controlling_breakpoints
+test_program_termination
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-stack.exp b/gdb/testsuite/gdb.mi/mi2-stack.exp
new file mode 100644
index 00000000000..f0a4a6124be
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-stack.exp
@@ -0,0 +1,203 @@
+# Copyright 2000, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that stack commands work.
+
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_stack_frame_listing {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain a stack trace
+ # Tests:
+ # -stack-list-frames
+ # -stack-list-frames 1 1
+ # -stack-list-frames 1 3
+
+ mi_gdb_test "231-stack-list-frames" \
+ "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \
+ "stack frame listing"
+ mi_gdb_test "232-stack-list-frames 1 1" \
+ "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
+ "stack frame listing 1 1"
+ mi_gdb_test "233-stack-list-frames 1 3" \
+ "233\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\}\\\]" \
+ "stack frame listing 1 3"
+
+ mi_gdb_test "234-stack-list-frames 1" \
+ "234\\^error,msg=\"mi_cmd_stack_list_frames: Usage.*FRAME_LOW FRAME_HIGH.*\"" \
+ "stack frame listing wrong"
+}
+
+proc test_stack_args_listing {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain lists for args for the stack frames
+ # Tests:
+ # -stack-list-arguments 0
+ # -stack-list-arguments 0 1 1
+ # -stack-list-arguments 0 1 3
+ # -stack-list-arguments 1
+ # -stack-list-arguments 1 1 1
+ # -stack-list-arguments 1 1 3
+ # -stack-list-arguments
+
+ mi_gdb_test "231-stack-list-arguments 0" \
+ "231\\^done,stack-args=\\\[frame=\{level=\"0\",args=\\\[\\\]\},frame=\{level=\"1\",args=\\\[name=\"strarg\"\\\]\},frame=\{level=\"2\",args=\\\[name=\"intarg\",name=\"strarg\"\\\]\},frame=\{level=\"3\",args=\\\[name=\"intarg\",name=\"strarg\",name=\"fltarg\"\\\]\},frame=\{level=\"4\",args=\\\[\\\]\}\\\]" \
+ "stack args listing 0"
+
+ mi_gdb_test "232-stack-list-arguments 0 1 1" \
+ "232\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[name=\"strarg\"\\\]\}\\\]" \
+ "stack args listing 0 1 1"
+
+ mi_gdb_test "233-stack-list-arguments 0 1 3" \
+ "233\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[name=\"strarg\"\\\]\},frame=\{level=\"2\",args=\\\[name=\"intarg\",name=\"strarg\"\\\]\},frame=\{level=\"3\",args=\\\[name=\"intarg\",name=\"strarg\",name=\"fltarg\"\\\]\}\\\]" \
+ "stack args listing 0 1 3"
+
+ mi_gdb_test "231-stack-list-arguments 1" \
+ "231\\^done,stack-args=\\\[frame=\{level=\"0\",args=\\\[\\\]\},frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"2\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"3\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\\\]\},frame=\{level=\"4\",args=\\\[\\\]\}\\\]" \
+ "stack args listing 1"
+
+ mi_gdb_test "232-stack-list-arguments 1 1 1" \
+ "232\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\}\\\]" \
+ "stack args listing 1 1 1"
+
+ mi_gdb_test "233-stack-list-arguments 1 1 3" \
+ "233\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"2\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"3\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\\\]\}\\\]" \
+ "stack args listing 1 1 3"
+
+ mi_gdb_test "234-stack-list-arguments" \
+ "234\\^error,msg=\"mi_cmd_stack_list_args: Usage.*PRINT_VALUES.*FRAME_LOW FRAME_HIGH.*\"" \
+ "stack args listing wrong"
+}
+
+proc test_stack_info_depth {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain depth of stack
+ # Tests:
+ # -stack-info-depth
+ # -stack-info-depth 3
+ # -stack-info-depth 99
+
+ mi_gdb_test "231-stack-info-depth" \
+ "231\\^done,depth=\"5\"" \
+ "stack info-depth"
+
+ mi_gdb_test "231-stack-info-depth 3" \
+ "231\\^done,depth=\"3\"" \
+ "stack info-depth 3"
+
+ mi_gdb_test "231-stack-info-depth 99" \
+ "231\\^done,depth=\"5\"" \
+ "stack info-depth 99"
+
+ mi_gdb_test "231-stack-info-depth 99 99" \
+ "231\\^error,msg=\"mi_cmd_stack_info_depth: Usage: .MAX_DEPTH.\"" \
+ "stack info-depth wrong usage"
+}
+
+proc test_stack_locals_listing {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain lists for locals for the stack frames
+ # Tests:
+ # -stack-list-locals 0
+ # -stack-list-locals 1
+ # -stack-list-arguments
+
+ mi_gdb_test "232-stack-list-locals 0" \
+ "232\\^done,locals=\\\[name=\"A\",name=\"B\",name=\"C\"\\\]" \
+ "stack locals listing 0"
+
+# step until A, B, C, have some reasonable values.
+send_gdb "-exec-next 3\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
+ pass "next's in callee4"
+ }
+ timeout { fail "next in callee4 (timeout)" }
+}
+
+ mi_gdb_test "232-stack-list-locals 1" \
+ "232\\^done,locals=\\\[\{name=\"A\",value=\"1\"\},\{name=\"B\",value=\"2\"\},\{name=\"C\",value=\"3\"\}\\\]" \
+ "stack locals listing 1"
+
+ mi_gdb_test "234-stack-list-locals" \
+ "234\\^error,msg=\"mi_cmd_stack_list_locals: Usage.*PRINT_VALUES.*\"" \
+ "stack locals listing wrong"
+
+ mi_gdb_test "232-stack-select-frame 1" \
+ "232\\^done" \
+ "stack select frame 1"
+
+ mi_gdb_test "232-stack-list-locals 1" \
+ "232\\^done,locals=\\\[\\\]" \
+ "stack locals listing for new frame"
+
+# this should be a no-op
+
+ mi_gdb_test "232-stack-select-frame" \
+ "232\\^done" \
+ "stack select same frame"
+
+ mi_gdb_test "232-stack-list-locals 1" \
+ "232\\^done,locals=\\\[\\\]" \
+ "stack locals for same frame (level 1)"
+
+}
+
+mi_runto callee4
+test_stack_frame_listing
+test_stack_args_listing
+test_stack_locals_listing
+test_stack_info_depth
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-stepi.exp b/gdb/testsuite/gdb.mi/mi2-stepi.exp
new file mode 100644
index 00000000000..208b9e2ba06
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-stepi.exp
@@ -0,0 +1,86 @@
+# Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test Machine interface (MI) operations
+# Verify that, using the MI, we can run a simple program and perform
+# exec-step-instruction and exec-next-instruction.
+
+# The goal is not to
+# test gdb functionality, which is done by other tests, but to verify
+# the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_stepi_nexti {} {
+ global mi_gdb_prompt
+ global hex
+
+ send_gdb "111-exec-step-instruction\n"
+ gdb_expect {
+ -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" {
+ pass "step-instruction at main"
+ }
+ timeout {
+ fail "step-instruction at main (timeout)"
+ }
+ }
+ send_gdb "222-exec-next-instruction\n"
+ gdb_expect {
+ -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" {
+ pass "next-instruction at main"
+ }
+ timeout {
+ fail "next-instruction at main (timeout)"
+ }
+ }
+ send_gdb "333-exec-next-instruction\n"
+ gdb_expect {
+ -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" {
+ pass "next-instruction at main"
+ }
+ timeout {
+ fail "next-instruction at main (timeout)"
+ }
+ }
+}
+
+mi_run_to_main
+test_stepi_nexti
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-syn-frame.exp b/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
new file mode 100644
index 00000000000..263bb39f05d
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
@@ -0,0 +1,111 @@
+# Copyright 2002, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test MI output with synthetic frames on the stack (call dummies,
+# signal handlers).
+
+if [target_info exists gdb,nosignals] {
+ verbose "Skipping mi-syn-frame.exp because of nosignals."
+ continue
+}
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+set testfile "mi-syn-frame"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+set my_mi_gdb_prompt "\\(gdb\\)\[ \]*\[\r\n\]*"
+
+mi_gdb_exit
+mi_gdb_start
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+mi_run_to_main
+
+mi_gdb_test "400-break-insert foo" "400\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}"
+
+
+#
+# Call foo() by hand, where we'll hit a breakpoint.
+#
+
+mi_gdb_test "401-data-evaluate-expression foo()" "\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(foo\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+401\\^error,msg=\"The program being debugged stopped while in a function called from GDB.*\"" "call inferior's function with a breakpoint set in it"
+
+mi_gdb_test "402-stack-list-frames" "402\\^done,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"foo\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]" "backtrace from inferior function stopped at bp, showing gdb dummy frame"
+
+#
+# Continue back to main()
+#
+
+send_gdb "403-exec-continue\n"
+gdb_expect {
+ -re "403\\^running\[\r\n\]+${my_mi_gdb_prompt}hi in foo\[\r\n\]+403\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
+ pass "403-exec-continue"
+ }
+ timeout {
+ fail "403-exec-continue"
+ }
+}
+
+mi_gdb_test "404-stack-list-frames 0 0" "404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
+
+
+#
+# Call have_a_very_merry_interrupt() which will eventually raise a signal
+# that's caught by handler() which calls subroutine().
+
+mi_gdb_test "405-break-insert subroutine" "405\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\",times=\"0\"\}"
+
+mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" "Waiting to get a signal\[\r\n\]+\\&\"The program being debugged stopped while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"When the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\n\"\[\r\n\]+\\&\"stop \\(instead of continuing to evaluate the expression containing\\\\n\"\[\r\n\]+\\&\"the function call\\).\\\\n\"\[\r\n\]+406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nWhen the function \\(have_a_very_merry_interrupt\\) is done executing, GDB will silently\\\\nstop \\(instead of continuing to evaluate the expression containing\\\\nthe function call\\).\""
+
+# We should have both a signal handler and a call dummy frame
+# in this next output.
+
+mi_gdb_test "407-stack-list-frames" "407\\^done,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"subroutine\",args=\\\[\{name=\"in\",value=\"$decimal\"\}\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"subroutine\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"handler\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"<signal handler called>\"\},.*frame=\{level=\"$decimal\",addr=\"$hex\",func=\"have_a_very_merry_interrupt\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"$decimal\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
+
+
+send_gdb "408-exec-continue\n"
+gdb_expect {
+ -re "408\\^running\[\r\n\]+${my_mi_gdb_prompt}408\\\*stopped\[\r\n\]+${my_mi_gdb_prompt}$" {
+ pass "408-exec-continue"
+ }
+ timeout {
+ fail "408-exec-continue"
+ }
+}
+
+mi_gdb_test "409-stack-list-frames 0 0" "409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"\}.*\\\]"
+
+#
+# Call bar() by hand, which should get an exception while running.
+#
+
+mi_gdb_test "410-data-evaluate-expression bar()" "hi in bar\[\r\n\]+\\&\"The program being debugged was signaled while in a function called from GDB.\\\\n\"\[\r\n\]+\\&\"GDB remains in the frame where the signal was received.\\\\n\"\[\r\n\]+\\&\"To change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\n\"\[\r\n\]+\\&\"Evaluation of the expression containing the function \\(bar\\) will be abandoned.\\\\n\"\[\r\n\]+410\\^error,msg=\"The program being debugged was signaled while in a function called from GDB.\\\\nGDB remains in the frame where the signal was received.\\\\nTo change this behavior use \\\\\"set unwindonsignal on\\\\\"\\\\nEvaluation of the expression containing the function \\(bar\\) will be abandoned.\"" "call inferior function which raises exception"
+
+mi_gdb_test "411-stack-list-frames" "411\\^done,reason=\"signal-received\",signal-name=\".*\",signal-meaning=\".*\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"bar\",args=\\\[\\\],file=\".*mi-syn-frame.c\",line=\"$decimal\"\},stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
+
+mi_gdb_exit
+
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-until.exp b/gdb/testsuite/gdb.mi/mi2-until.exp
new file mode 100644
index 00000000000..4ef296c0121
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-until.exp
@@ -0,0 +1,127 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test Machine interface (MI) operations
+# Verify that, using the MI, we can run a simple program and perform
+# exec-until.
+
+# The goal is not to
+# test gdb functionality, which is done by other tests, but to verify
+# the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "until"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_running_to_foo {} {
+ global mi_gdb_prompt
+ global hex
+
+ mi_gdb_test "200-break-insert 10" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*until.c\",line=\"10\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_run_cmd
+
+ gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to main (2)"
+ }
+ timeout {
+ fail "run to main (timeout)"
+ }
+ }
+
+ mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1"
+
+}
+
+proc test_until {} {
+ global mi_gdb_prompt
+ global hex
+
+ send_gdb "111-exec-until\n"
+ gdb_expect {
+ -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
+ pass "until after while loop"
+ }
+ timeout {
+ fail "until after while loop (timeout)"
+ }
+ }
+
+ send_gdb "222-exec-until 15\n"
+ gdb_expect {
+ -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
+ pass "until line number"
+ }
+ timeout {
+ fail "until line number (timeout)"
+ }
+ }
+
+ send_gdb "333-exec-until until.c:17\n"
+ gdb_expect {
+ -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
+ pass "until line number:file"
+ }
+ timeout {
+ fail "until line number:file (timeout)"
+ }
+ }
+
+ # This is supposed to NOT stop at line 25. It stops right after foo is over.
+
+ send_gdb "444-exec-until until.c:25\n"
+ gdb_expect {
+ -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
+ pass "until after current function"
+ }
+ timeout {
+ fail "until after current function (timeout)"
+ }
+ }
+
+}
+
+test_running_to_foo
+test_until
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-var-block.exp b/gdb/testsuite/gdb.mi/mi2-var-block.exp
new file mode 100644
index 00000000000..84bc1fffba4
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-var-block.exp
@@ -0,0 +1,173 @@
+# Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+#
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_runto do_block_tests
+
+# Test: c_variable-3.2
+# Desc: create cb and foo
+mi_gdb_test "-var-create cb * cb" \
+ "\\^done,name=\"cb\",numchild=\"0\",type=\"int\"" \
+ "create local variable cb"
+
+mi_gdb_test "-var-create foo * foo" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create local variable foo"
+
+# step to "foo = 123;"
+mi_step_to "do_block_tests" "" "var-cmd.c" "158" "step at do_block_test"
+
+
+# Be paranoid and assume 3.2 created foo
+mi_gdb_test "-var-delete foo" \
+ "&\"Variable object not found\\\\n\".*\\^error,msg=\"Variable object not found\"" \
+ "delete var foo"
+
+
+# Test: c_variable-3.3
+# Desc: create foo
+mi_gdb_test "-var-create foo * foo" \
+ "\\^done,name=\"foo\",numchild=\"0\",type=\"int\"" \
+ "create local variable foo"
+
+# step to "foo2 = 123;"
+mi_step_to "do_block_tests" "" "var-cmd.c" "161" "step at do_block_test"
+
+# Test: c_variable-3.4
+# Desc: check foo, cb changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"foo\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"cb\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: cb foo changed"
+
+# step to "foo = 321;"
+mi_step_to "do_block_tests" "" "var-cmd.c" "164" "step at do_block_test"
+
+# Test: c_variable-3.5
+# Desc: create inner block foo
+mi_gdb_test "-var-create inner_foo * foo" \
+ "\\^done,name=\"inner_foo\",numchild=\"0\",type=\"int\"" \
+ "create local variable inner_foo"
+
+# step to "foo2 = 0;"
+mi_step_to "do_block_tests" "" "var-cmd.c" "166" "step at do_block_test"
+
+# Test: c_variable-3.6
+# Desc: create foo2
+mi_gdb_test "-var-create foo2 * foo2" \
+ "\\^done,name=\"foo2\",numchild=\"0\",type=\"int\"" \
+ "create local variable foo2"
+
+# Test: c_variable-3.7
+# Desc: check that outer foo in scope and inner foo out of scope
+# Note: also a known gdb problem
+setup_xfail *-*-*
+mi_gdb_test "-var-update inner_foo" \
+ "\\^done,changelist=\{FIXME\}" \
+ "update inner_foo: should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+
+setup_xfail *-*-*
+mi_gdb_test "-var-evaluate-expression inner_foo" \
+ "\\^done,value=\{FIXME\}" \
+ "evaluate inner_foo: should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+
+mi_gdb_test "-var-update foo" \
+ "\\^done,changelist=\\\[\\\]" \
+ "update foo: did not change"
+
+mi_gdb_test "-var-delete inner_foo" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var inner_foo"
+
+# step to "foo = 0;"
+mi_step_to "do_block_tests" "" "var-cmd.c" "168" "step at do_block_test"
+
+# Test: c_variable-3.8
+# Desc: check that foo2 out of scope (known gdb problem)
+setup_xfail *-*-*
+mi_gdb_test "-var-update foo2" \
+ "\\^done,changelist=\{FIXME\}" \
+ "update foo2: should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+
+# step to "cb = 21;"
+mi_step_to "do_block_tests" "" "var-cmd.c" "171" "step at do_block_test"
+
+# Test: c_variable-3.9
+# Desc: check that only cb is in scope (known gdb problem)
+setup_xfail *-*-*
+mi_gdb_test "-var-update foo2" \
+ "\\^done,changelist=\\\[FIXME\\\]" \
+ "update foo2 should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+setup_xfail *-*-*
+mi_gdb_test "-var-update foo" \
+ "\\^done,changelist=\{FIXME\}" \
+ "update foo should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+mi_gdb_test "-var-update cb" \
+ "\\^done,changelist=\\\[\\\]" \
+ "update cb"
+
+# Test: c_variable-3.10
+# Desc: names of editable variables
+#gdbtk_test c_variable-3.10 {names of editable variables} {
+# editable_variables
+#} {{foo cb foo2} {}}
+
+# Done with block tests
+mi_gdb_test "-var-delete foo" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var foo"
+
+mi_gdb_test "-var-delete foo2" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var foo2"
+
+mi_gdb_test "-var-delete cb" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var cb"
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-var-child.exp b/gdb/testsuite/gdb.mi/mi2-var-child.exp
new file mode 100644
index 00000000000..3f6a3fddfc6
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-var-child.exp
@@ -0,0 +1,1203 @@
+# Copyright (C) 1999, 2000, 2002 Free Software Foundation
+
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_runto do_children_tests
+
+##### #####
+# #
+# children tests #
+# #
+##### #####
+
+
+# Test: c_variable-4.2
+# Desc: create variable "struct_declarations"
+mi_gdb_test "-var-create struct_declarations * struct_declarations" \
+ "\\^done,name=\"struct_declarations\",numchild=\"11\",type=\"struct _struct_decl\"" \
+ "create local variable struct_declarations"
+
+# Test: c_variable-4.3
+# Desc: children of struct_declarations
+# STABS doesn't give us argument types for the func ptr structs, but
+# Dwarf 2 does.
+mi_gdb_test "-var-list-children struct_declarations" \
+ "\\^done,numchild=\"11\",children=\\\[child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
+ "get children of struct_declarations"
+
+#gdbtk_test c_variable-4.3 {children of struct_declarations} {
+# get_children struct_declarations
+#} {integer character char_ptr long_int int_ptr_ptr long_array func_ptr func_ptr_struct func_ptr_ptr u1 s2}
+
+# Test: c_variable-4.4
+# Desc: number of children of struct_declarations
+mi_gdb_test "-var-info-num-children struct_declarations" \
+ "\\^done,numchild=\"11\"" \
+ "get number of children of struct_declarations"
+
+# Test: c_variable-4.5
+# Desc: children of struct_declarations.integer
+mi_gdb_test "-var-list-children struct_declarations.integer" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.integer"
+
+# Test: c_variable-4.6
+# Desc: number of children of struct_declarations.integer
+mi_gdb_test "-var-info-num-children struct_declarations.integer" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.integer"
+
+# Test: c_variable-4.7
+# Desc: children of struct_declarations.character
+mi_gdb_test "-var-list-children struct_declarations.character" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.character"
+
+# Test: c_variable-4.8
+# Desc: number of children of struct_declarations.character
+mi_gdb_test "-var-info-num-children struct_declarations.character" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.character"
+
+# Test: c_variable-4.9
+# Desc: children of struct_declarations.char_ptr
+mi_gdb_test "-var-list-children struct_declarations.char_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
+ "get children of struct_declarations.char_ptr"
+
+# Test: c_variable-4.10
+# Desc: number of children of struct_declarations.char_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.char_ptr"
+
+# Test: c_variable-4.11
+# Desc: children of struct_declarations.long_int
+mi_gdb_test "-var-list-children struct_declarations.long_int" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_int"
+
+# Test: c_variable-4.12
+# Desc: number of children of struct_declarations.long_int
+mi_gdb_test "-var-info-num-children struct_declarations.long_int" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_int"
+
+# Test: c_variable-4.13
+# Desc: children of int_ptr_ptr
+mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \
+ "get children of struct_declarations.int_ptr_ptr"
+
+#gdbtk_test c_variable-4.13 {children of int_ptr_ptr} {
+# get_children struct_declarations.int_ptr_ptr
+#} {*int_ptr_ptr}
+
+# Test: c_variable-4.14
+# Desc: number of children of int_ptr_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.int_ptr_ptr"
+
+
+# Test: c_variable-4.15
+# Desc: children of struct_declarations.long_array
+mi_gdb_test "-var-list-children struct_declarations.long_array" \
+ "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \
+ "get children of struct_declarations.long_array"
+
+# Test: c_variable-4.16
+# Desc: number of children of struct_declarations.long_array
+mi_gdb_test "-var-info-num-children struct_declarations.long_array" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of struct_declarations.long_array"
+
+# Test: c_variable-4.17
+# Desc: children of struct_declarations.func_ptr
+mi_gdb_test "-var-list-children struct_declarations.func_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.func_ptr"
+
+
+# Test: c_variable-4.18
+# Desc: number of children of struct_declarations.func_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.func_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.func_ptr"
+
+
+# Test: c_variable-4.19
+# Desc: children of struct_declarations.func_ptr_struct
+mi_gdb_test "-var-list-children struct_declarations.func_ptr_struct" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.func_ptr_struct"
+
+# Test: c_variable-4.20
+# Desc: number of children of struct_declarations.func_ptr_struct
+mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_struct" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.func_ptr_struct"
+
+
+# Test: c_variable-4.21
+# Desc: children of struct_declarations.func_ptr_ptr
+mi_gdb_test "-var-list-children struct_declarations.func_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.func_ptr_ptr"
+
+# Test: c_variable-4.22
+# Desc: number of children of struct_declarations.func_ptr_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.func_ptr_ptr"
+
+
+# Test: c_variable-4.23
+# Desc: children of struct_declarations.u1
+mi_gdb_test "-var-list-children struct_declarations.u1" \
+ "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.u1.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.u1.b\",exp=\"b\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.u1.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.u1.d\",exp=\"d\",numchild=\"0\",type=\"enum foo\"\}\\\]" \
+ "get children of struct_declarations.u1"
+
+# Test: c_variable-4.24
+# Desc: number of children of struct_declarations.u1
+mi_gdb_test "-var-info-num-children struct_declarations.u1" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of struct_declarations.u1"
+
+# Test: c_variable-4.25
+# Desc: children of struct_declarations.s2
+mi_gdb_test "-var-list-children struct_declarations.s2" \
+ "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.s2.u2\",exp=\"u2\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.g\",exp=\"g\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.h\",exp=\"h\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.i\",exp=\"i\",numchild=\"10\",type=\"long int \\\[10\\\]\"\}\\\]" \
+ "get children of struct_declarations.s2"
+#gdbtk_test c_variable-4.25 {children of struct_declarations.s2} {
+# get_children struct_declarations.s2
+#} {u2 g h i}
+
+# Test: c_variable-4.26
+# Desc: number of children of struct_declarations.s2
+mi_gdb_test "-var-info-num-children struct_declarations.s2" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of struct_declarations.s2"
+
+
+# Test: c_variable-4.27
+# Desc: children of struct_declarations.long_array.1
+mi_gdb_test "-var-list-children struct_declarations.long_array.1" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.1"
+
+# Test: c_variable-4.28
+# Desc: number of children of struct_declarations.long_array.1
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.1" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.1"
+
+# Test: c_variable-4.29
+# Desc: children of struct_declarations.long_array.2
+mi_gdb_test "-var-list-children struct_declarations.long_array.2" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.2"
+
+# Test: c_variable-4.30
+# Desc: number of children of struct_declarations.long_array.2
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.2" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.2"
+
+# Test: c_variable-4.31
+# Desc: children of struct_declarations.long_array.3
+mi_gdb_test "-var-list-children struct_declarations.long_array.3" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.3"
+
+# Test: c_variable-4.32
+# Desc: number of children of struct_declarations.long_array.3
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.3" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.3"
+
+# Test: c_variable-4.33
+# Desc: children of struct_declarations.long_array.4
+mi_gdb_test "-var-list-children struct_declarations.long_array.4" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.4"
+
+# Test: c_variable-4.34
+# Desc: number of children of struct_declarations.long_array.4
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.4" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.4"
+
+# Test: c_variable-4.35
+# Desc: children of struct_declarations.long_array.5
+mi_gdb_test "-var-list-children struct_declarations.long_array.5" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.5"
+
+# Test: c_variable-4.36
+# Desc: number of children of struct_declarations.long_array.5
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.5" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.5"
+
+# Test: c_variable-4.37
+# Desc: children of struct_declarations.long_array.6
+mi_gdb_test "-var-list-children struct_declarations.long_array.6" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.6"
+
+# Test: c_variable-4.38
+# Desc: number of children of struct_declarations.long_array.6
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.6" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.6"
+
+# Test: c_variable-4.39
+# Desc: children of struct_declarations.long_array.7
+mi_gdb_test "-var-list-children struct_declarations.long_array.7" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.7"
+
+# Test: c_variable-4.40
+# Desc: number of children of struct_declarations.long_array.7
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.7" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.7"
+
+# Test: c_variable-4.41
+# Desc: children of struct_declarations.long_array.8
+mi_gdb_test "-var-list-children struct_declarations.long_array.8" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.8"
+
+# Test: c_variable-4.42
+# Desc: number of children of struct_declarations.long_array.8
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.8" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.8"
+
+
+# Test: c_variable-4.43
+# Desc: children of struct_declarations.long_array.9
+mi_gdb_test "-var-list-children struct_declarations.long_array.9" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.9"
+
+# Test: c_variable-4.44
+# Desc: number of children of struct_declarations.long_array.9
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.9" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.9"
+
+# Test: c_variable-4.45
+# Desc: children of struct_declarations.u1.a
+mi_gdb_test "-var-list-children struct_declarations.u1.a" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.u1.a"
+
+# Test: c_variable-4.46
+# Desc: number of children of struct_declarations.u1.a
+mi_gdb_test "-var-info-num-children struct_declarations.u1.a" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.u1.a"
+
+# Test: c_variable-4.47
+# Desc: children of struct_declarations.u1.b
+mi_gdb_test "-var-list-children struct_declarations.u1.b" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.u1.b.\\*b\",exp=\"\\*b\",numchild=\"0\",type=\"char\"\}\\\]" \
+ "get children of struct_declarations.u1.b"
+
+# Test: c_variable-4.48
+# Desc: number of children of struct_declarations.u1.b
+mi_gdb_test "-var-info-num-children struct_declarations.u1.b" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.u1.b"
+
+# Test: c_variable-4.49
+# Desc: children of struct_declarations.u1.c
+mi_gdb_test "-var-list-children struct_declarations.u1.c" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.u1.c"
+
+# Test: c_variable-4.50
+# Desc: number of children of struct_declarations.u1.c
+mi_gdb_test "-var-info-num-children struct_declarations.u1.c" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.u1.c"
+
+# Test: c_variable-4.51
+# Desc: children of struct_declarations.u1.d
+mi_gdb_test "-var-list-children struct_declarations.u1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.u1.d"
+
+
+# Test: c_variable-4.52
+# Desc: number of children of struct_declarations.u1.d
+mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.u1.d"
+
+
+# Test: c_variable-4.53
+# Desc: children of struct_declarations.s2.u2
+mi_gdb_test "-var-list-children struct_declarations.s2.u2" \
+ "\\^done,numchild=\"3\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1\",exp=\"u1s1\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.u2.f\",exp=\"f\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.u2.u1s2\",exp=\"u1s2\",numchild=\"2\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
+ "get children of struct_declarations.s2.u2"
+
+# Test: c_variable-4.54
+# Desc: number of children of struct_declarations.s2.u2
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of struct_declarations.s2.u2"
+
+# Test: c_variable-4.55
+# Desc: children of struct_declarations.s2.g
+mi_gdb_test "-var-list-children struct_declarations.s2.g" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.g"
+
+# Test: c_variable-4.56
+# Desc: number of children of struct_declarations.s2.g
+mi_gdb_test "-var-info-num-children struct_declarations.s2.g" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.g"
+
+
+# Test: c_variable-4.57
+# Desc: children of struct_declarations.s2.h
+mi_gdb_test "-var-list-children struct_declarations.s2.h" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.h"
+
+# Test: c_variable-4.58
+# Desc: number of children of struct_declarations.s2.h
+mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.h"
+
+
+# Test: c_variable-4.59
+# Desc: children of struct_declarations.s2.i
+mi_gdb_test "-var-list-children struct_declarations.s2.i" \
+ "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.s2.i.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \
+ "get children of struct_declarations.s2.i"
+
+# Test: c_variable-4.60
+# Desc: number of children of struct_declarations.s2.i
+mi_gdb_test "-var-info-num-children struct_declarations.s2.i" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of struct_declarations.s2.i"
+
+# Test: c_variable-4.61
+# Desc: children of struct_declarations.s2.u2.u1s1
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1" \
+ "\\^done,numchild=\"4\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1.d\",exp=\"d\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e\",exp=\"e\",numchild=\"10\",type=\"char \\\[10\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.func\",exp=\"func\",numchild=\"0\",type=\"int \\*\\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.foo\",exp=\"foo\",numchild=\"0\",type=\"efoo\"\}\\\]" \
+ "get children of struct_declarations.s2.u2.u1s1"
+
+# Test: c_variable-4.62
+# Desc: number of children of struct_declarations.s2.u2.u1s1
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1"
+
+# Test: c_variable-4.63
+# Desc: children of struct_declarations.s2.u2.f
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.f" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.f"
+
+# Test: c_variable-4.64
+# Desc: number of children of struct_declarations.s2.u2.f
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.f" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.f"
+
+# Test: c_variable-4.65
+# Desc: children of struct_declarations.s2.u2.u1s2
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2" \
+ "\\^done,numchild=\"2\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr\",exp=\"array_ptr\",numchild=\"2\",type=\"char \\\[2\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s2.func\",exp=\"func\",numchild=\"0\",type=\"int \\(\\*\\)\\((int, char \\*)?\\)\"\}\\\]" \
+ "get children of struct_declarations.s2.u2.u1s2"
+
+# Test: c_variable-4.66
+# Desc: number of children of struct_declarations.s2.u2.u1s2
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2" \
+ "\\^done,numchild=\"2\"" \
+ "get number of children of struct_declarations.s2.u2.u1s2"
+
+# Test: c_variable-4.67
+# Desc: children of struct_declarations.s2.u2.u1s1.d
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s1.d"
+
+# Test: c_variable-4.68
+# Desc: number of children of struct_declarations.s2.u2.u1s1.d
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.d"
+
+# Test: c_variable-4.69
+# Desc: children of struct_declarations.s2.u2.u1s1.e
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.e" \
+ "\\^done,numchild=\"10\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s1.e.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.1\",exp=\"1\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.2\",exp=\"2\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s1.e.3\",exp=\"3\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.4\",exp=\"4\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.5\",exp=\"5\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.6\",exp=\"6\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.7\",exp=\"7\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.8\",exp=\"8\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.9\",exp=\"9\",numchild=\"0\",type=\"char\"\}\\\]" \
+ "get children of struct_declarations.s2.u2.u1s1.e"
+
+# Test: c_variable-4.70
+# Desc: number of children of struct_declarations.s2.u2.u1s1.e
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.e" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.e"
+
+
+# Test: c_variable-4.71
+# Desc: children of struct_declarations.s2.u2.u1s1.func
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.func" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s1.func"
+
+# Test: c_variable-4.72
+# Desc: number of children of struct_declarations.s2.u2.u1s1.func
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.func" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.func"
+
+
+# Test: c_variable-4.73
+# Desc: children of struct_declarations.s2.u2.u1s1.foo
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.foo" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s1.foo"
+
+# Test: c_variable-4.74
+# Desc: number of children of struct_declarations.s2.u2.u1s1.foo
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.foo" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.foo"
+
+
+# Test: c_variable-4.75
+# Desc: children of struct_declarations.s2.u2.u1s2.array_ptr
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.array_ptr" \
+ "\\^done,numchild=\"2\",children=\\\[child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s2.array_ptr.1\",exp=\"1\",numchild=\"0\",type=\"char\"\}\\\]" \
+ "get children of struct_declarations.s2.u2.u1s2.array_ptr"
+
+# Test: c_variable-4.76
+# Desc: number of children of struct_declarations.s2.u2.u1s2.array_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.array_ptr" \
+ "\\^done,numchild=\"2\"" \
+ "get number of children of struct_declarations.s2.u2.u1s2.array_ptr"
+
+# Test: c_variable-4.77
+# Desc: children of struct_declarations.s2.u2.u1s2.func
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.func" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s2.func"
+
+# Test: c_variable-4.78
+# Desc: number of children of struct_declarations.s2.u2.u1s2.func
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.func" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s2.func"
+
+# Test: c_variable-4.79
+# Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
+mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \
+ "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
+#} {**int_ptr_ptr}
+
+# Test: c_variable-4.80
+# Desc: Number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
+
+
+# Step to "struct_declarations.integer = 123;"
+set line 192
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step to line $line"
+
+# Test: c_variable-4.81
+# Desc: create local variable "weird"
+mi_gdb_test "-var-create weird * weird" \
+ "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
+ "create local variable weird"
+
+# Test: c_variable-4.82
+# Desc: children of weird
+mi_gdb_test "-var-list-children weird" \
+ "\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
+ "get children of weird"
+
+# Test: c_variable-4.83
+# Desc: number of children of weird
+mi_gdb_test "-var-info-num-children weird" \
+ "\\^done,numchild=\"11\"" \
+ "get number of children of weird"
+
+
+# Test: c_variable-4.84
+# Desc: children of weird->long_array
+mi_gdb_test "-var-list-children weird.long_array" \
+ "\\^done,numchild=\"10\",children=\\\[child=\{name=\"weird.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\\\]" \
+ "get children of weird.long_array"
+#gdbtk_test c_variable-4.84 {children of weird->long_array} {
+# get_children weird.long_array
+#} {0 1 2 3 4 5 6 7 8 9}
+
+# Test: c_variable-4.85
+# Desc: number of children of weird.long_array
+mi_gdb_test "-var-info-num-children weird.long_array" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of weird.long_array"
+
+# Test: c_variable-4.86
+# Desc: children of weird.int_ptr_ptr
+mi_gdb_test "-var-list-children weird.int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \
+ "get children of weird.int_ptr_ptr"
+#gdbtk_test c_variable-4.86 {children of weird->int_ptr_ptr} {
+# get_children weird.int_ptr_ptr
+#} {*int_ptr_ptr}
+
+# Test: c_variable-4.87
+# Desc: number of children of weird.int_ptr_ptr
+mi_gdb_test "-var-info-num-children weird.int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird.int_ptr_ptr"
+
+# Test: c_variable-4.88
+# Desc: children of *weird->int_ptr_ptr
+mi_gdb_test "-var-list-children weird.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \
+ "get children of weird.int_ptr_ptr.*int_ptr_ptr"
+#gdbtk_test c_variable-4.88 {children of *weird->int_ptr_ptr} {
+# get_children weird.int_ptr_ptr.*int_ptr_ptr
+#} {**int_ptr_ptr}
+
+# Test: c_variable-4.89
+# Desc: number of children *weird->int_ptr_ptr
+mi_gdb_test "-var-info-num-children weird.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird.int_ptr_ptr.*int_ptr_ptr"
+
+# Test: c_variable-4.90
+# Desc: create weird->int_ptr_ptr
+mi_gdb_test "-var-create weird->int_ptr_ptr * weird->int_ptr_ptr" \
+ "\\^done,name=\"weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"" \
+ "create local variable weird->int_ptr_ptr"
+
+# Test: c_variable-4.91
+# Desc: children of weird->int_ptr_ptr
+mi_gdb_test "-var-list-children weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",exp=\"\\*weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\\\]" \
+ "get children of weird->int_ptr_ptr"
+
+
+# Test: c_variable-4.92
+# Desc: number of children of (weird->int_ptr_ptr)
+mi_gdb_test "-var-info-num-children weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird->int_ptr_ptr"
+
+# Test: c_variable-4.93
+# Desc: children of *(weird->int_ptr_ptr)
+mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",exp=\"\\*\\*weird->int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\\\]" \
+ "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
+
+# Test: c_variable-4.94
+# Desc: number of children of *(weird->int_ptr_ptr)
+mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
+
+# Test: c_variable-4.95
+# Desc: children of *(*(weird->int_ptr_ptr))
+mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
+
+# Test: c_variable-4.96
+# Desc: number of children of *(*(weird->int_ptr_ptr))
+mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
+
+# Test: c_variable-4.97
+# Desc: is weird editable
+mi_gdb_test "-var-show-attributes weird" \
+ "\\^done,attr=\"editable\"" \
+ "is weird editable"
+
+# Test: c_variable-4.98
+# Desc: is weird->int_ptr_ptr editable
+mi_gdb_test "-var-show-attributes weird->int_ptr_ptr" \
+ "\\^done,attr=\"editable\"" \
+ "is weird->int_ptr_ptr editable"
+
+# Test: c_variable-4.99
+# Desc: is *(weird->int_ptr_ptr) editable
+mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,attr=\"editable\"" \
+ "is weird.int_ptr_ptr.*int_ptr_ptr editable"
+
+# Test: c_variable-4.100
+# Desc: is *(*(weird->int_ptr_ptr)) editable
+mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr" \
+ "\\^done,attr=\"editable\"" \
+ "is weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr editable"
+
+# Test: c_variable-4.101
+# Desc: is weird->u1 editable
+mi_gdb_test "-var-show-attributes weird.u1" \
+ "\\^done,attr=\"noneditable\"" \
+ "is weird.u1 editable"
+
+# Test: c_variable-4.102
+# Desc: is weird->s2 editable
+mi_gdb_test "-var-show-attributes weird.s2" \
+ "\\^done,attr=\"noneditable\"" \
+ "is weird.s2 editable"
+
+# Test: c_variable-4.103
+# Desc: is struct_declarations.u1.a editable
+mi_gdb_test "-var-show-attributes struct_declarations.u1.a" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.u1.a editable"
+
+# Test: c_variable-4.104
+# Desc: is struct_declarations.u1.b editable
+mi_gdb_test "-var-show-attributes struct_declarations.u1.b" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.u1.b editable"
+
+# Test: c_variable-4.105
+# Desc: is struct_declarations.u1.c editable
+mi_gdb_test "-var-show-attributes struct_declarations.u1.c" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.u1.c editable"
+
+# Test: c_variable-4.106
+# Desc: is struct_declarations.long_array editable
+mi_gdb_test "-var-show-attributes struct_declarations.long_array" \
+ "\\^done,attr=\"noneditable\"" \
+ "is struct_declarations.long_array editable"
+
+# Test: c_variable-4.107
+# Desc: is struct_declarations.long_array[0] editable
+mi_gdb_test "-var-show-attributes struct_declarations.long_array.0" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.long_array.0 editable"
+
+# Test: c_variable-4.108
+# Desc: is struct_declarations editable
+mi_gdb_test "-var-show-attributes struct_declarations" \
+ "\\^done,attr=\"noneditable\"" \
+ "is struct_declarations editable"
+
+mi_gdb_test "-var-delete weird" \
+ "\\^done,ndeleted=\"24\"" \
+ "delete var weird"
+
+##### #####
+# #
+# children and update tests #
+# #
+##### #####
+
+# Test: c_variable-5.1
+# Desc: check that nothing changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\\\]" \
+ "update all vars. None changed"
+
+# Step over "struct_declarations.integer = 123;"
+set line 193
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.2
+# Desc: check that integer changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars struct_declarations.integer"
+
+# Step over:
+# weird->char_ptr = "hello";
+# bar = 2121;
+# foo = &bar;
+set line 196
+mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
+
+# Test: c_variable-5.3
+# Desc: check that char_ptr changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars struct_declarations.char_ptr"
+
+# Step over "struct_declarations.int_ptr_ptr = &foo;"
+set line 197
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.4
+# Desc: check that int_ptr_ptr and children changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars int_ptr_ptr and children changed"
+
+# Step over "weird->long_array[0] = 1234;"
+set line 198
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.5
+# Desc: check that long_array[0] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars struct_declarations.long_array.0 changed"
+
+# Step over "struct_declarations.long_array[1] = 2345;"
+set line 199
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.6
+# Desc: check that long_array[1] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars struct_declarations.long_array.1 changed"
+
+# Step over "weird->long_array[2] = 3456;"
+set line 200
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.7
+# Desc: check that long_array[2] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars struct_declarations.long_array.2 changed"
+
+# Step over:
+# struct_declarations.long_array[3] = 4567;
+# weird->long_array[4] = 5678;
+# struct_declarations.long_array[5] = 6789;
+# weird->long_array[6] = 7890;
+# struct_declarations.long_array[7] = 8901;
+# weird->long_array[8] = 9012;
+# struct_declarations.long_array[9] = 1234;
+set line 208
+mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
+
+# Test: c_variable-5.8
+# Desc: check that long_array[3-9] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars struct_declarations.long_array.3-9 changed"
+
+
+# Step over "weird->func_ptr = nothing;"
+set line 211
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.9
+# Desc: check that func_ptr changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars struct_declarations.func_ptr changed"
+
+# Delete all variables
+mi_gdb_test "-var-delete struct_declarations" \
+ "\\^done,ndeleted=\"65\"" \
+ "delete var struct_declarations"
+
+mi_gdb_test "-var-delete weird->int_ptr_ptr" \
+ "\\^done,ndeleted=\"3\"" \
+ "delete var weird->int_ptr_ptr"
+
+# Step over all lines:
+# ...
+# psnp = &snp0;
+set line 254
+mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
+
+# Test: c_variable-5.10
+# Desc: create psnp->char_ptr
+mi_gdb_test "-var-create psnp->char_ptr * psnp->char_ptr" \
+ "\\^done,name=\"psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"" \
+ "create local variable psnp->char_ptr"
+
+# Test: c_variable-5.11
+# Desc: children of psnp->char_ptr
+mi_gdb_test "-var-list-children psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",exp=\"\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\\\]" \
+ "get children of psnp->char_ptr"
+
+# Test: c_variable-5.12
+# Desc: number of children of psnp->char_ptr
+mi_gdb_test "-var-info-num-children psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr"
+
+# Test: c_variable-5.13
+# Desc: children of *(psnp->char_ptr)
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",exp=\"\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\\\]" \
+ "get children of psnp->char_ptr.*psnp->char_ptr"
+
+# Test: c_variable-5.14
+# Desc: number of children of *(psnp->char_ptr)
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr"
+
+# Test: c_variable-5.15
+# Desc: children of *(*(psnp->char_ptr))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+
+# Test: c_variable-5.15B
+# Desc: children of *(*(*(psnp->char_ptr)))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+
+# Test: c_variable-5.16
+# Desc: number of children of *(*(psnp->char_ptr))
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+
+# Test: c_variable-5.17
+# Desc: children of *(*(*(psnp->char_ptr)))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
+
+# Test: c_variable-5.18
+# Desc: number of children of *(*(*(psnp->char_ptr)))
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
+
+# Test: c_variable-5.17B
+# Desc: children of *(*(*(*(psnp->char_ptr))))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
+
+# Test: c_variable-5.18B
+# Desc: number of children of *(*(*(*(psnp->char_ptr))))
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
+
+
+# Test: c_variable-5.19
+# Desc: create psnp->long_ptr
+mi_gdb_test "-var-create psnp->long_ptr * psnp->long_ptr" \
+ "\\^done,name=\"psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"" \
+ "create local variable psnp->long_ptr"
+
+# Test: c_variable-5.20
+# Desc: children of psnp->long_ptr
+mi_gdb_test "-var-list-children psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",exp=\"\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\"\}\\\]" \
+ "get children of psnp->long_ptr"
+
+# Test: c_variable-5.21
+# Desc: number of children of psnp->long_ptr
+mi_gdb_test "-var-info-num-children psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr"
+
+# Test: c_variable-5.22
+# Desc: children of *(psnp->long_ptr)
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",exp=\"\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\"\}\\\]" \
+ "get children of psnp->long_ptr.*psnp->long_ptr"
+
+
+# Test: c_variable-5.23
+# Desc: number of children of *(psnp->long_ptr)
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr"
+
+# Test: c_variable-5.24
+# Desc: children of *(*(psnp->long_ptr))
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\"\}\\\]" \
+ "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
+
+# Test: c_variable-5.25
+# Desc: number of children of *(*(psnp->long_ptr))
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
+
+# Test: c_variable-5.26
+# Desc: children of *(*(*(psnp->long_ptr)))
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*\\*psnp->long_ptr\",numchild=\"0\",type=\"long int\"\}\\\]" \
+ "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
+
+# Test: c_variable-5.27
+# Desc: number of children of *(*(*(psnp->long_ptr)))
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
+
+# Test: c_variable-5.28
+# Desc: children of *(*(*(*(psnp->long_ptr))))
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
+
+# Test: c_variable-5.29
+# Desc: number of children of *(*(*(*(psnp->long_ptr))))
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
+
+# Test: c_variable-5.30
+# Desc: create psnp->ptrs
+mi_gdb_test "-var-create psnp->ptrs * psnp->ptrs" \
+ "\\^done,name=\"psnp->ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"" \
+ "create local variable psnp->ptrs"
+
+# Test: c_variable-5.31
+# Desc: children of psnp->ptrs
+mi_gdb_test "-var-list-children psnp->ptrs" \
+ "\\^done,numchild=\"3\",children=\\\[child=\{name=\"psnp->ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
+ "get children of psnp->ptrs"
+
+# Test: c_variable-5.32
+# Desc: number of children of psnp->ptrs
+mi_gdb_test "-var-info-num-children psnp->ptrs" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of psnp->ptrs"
+
+# Test: c_variable-5.33
+# Desc: children of psnp->ptrs[0]
+mi_gdb_test "-var-list-children psnp->ptrs.0" \
+ "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
+ "get children of psnp->ptrs.0"
+
+# Test: c_variable-5.34
+# Desc: number of children of psnp->ptrs[0]
+mi_gdb_test "-var-info-num-children psnp->ptrs.0" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of psnp->ptrs.0"
+
+# Test: c_variable-5.35
+# Desc: children of psnp->ptrs[0]->next
+mi_gdb_test "-var-list-children psnp->ptrs.0.next" \
+ "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
+ "get children of psnp->ptrs.0.next"
+
+#} {char_ptr long_ptr ptrs next}
+
+# Test: c_variable-5.36
+# Desc: number of children of psnp->ptrs[0]->next
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of psnp->ptrs.0.next"
+
+
+# Test: c_variable-5.37
+# Desc: children of psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\\\]" \
+ "get children of psnp->ptrs.0.next.char_ptr"
+
+#gdbtk_test c_variable-5.37 {children of psnp->ptrs[0]->next->char_ptr} {
+# get_children psnp->ptrs.0.next.char_ptr
+#} {*char_ptr}
+
+# Test: c_variable-5.38
+# Desc: number of children of psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr"
+
+# Test: c_variable-5.39
+# Desc: children of *psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",exp=\"\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\\\]" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr"
+
+# Test: c_variable-5.40
+# Desc: number of children of *psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr"
+
+# Test: c_variable-5.41
+# Desc: children of **psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+
+# Test: c_variable-5.41B
+# Desc: children of ***psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+
+# Test: c_variable-5.42
+# Desc: number of children of **psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+
+# Test: c_variable-5.43
+# Desc: children of ***psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
+ "\\^done,numchild=\"1\",children=\\\[child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\\\]" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.44
+# Desc: number of children of ***psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.43B
+# Desc: children of ****psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.44B
+# Desc: number of children of ****psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.45
+# Desc: children of psnp->ptrs[0]->next->next
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.next" \
+ "\\^done,numchild=\"4\",children=\\\[child=\{name=\"psnp->ptrs.0.next.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
+ "get children of psnp->ptrs.0.next.next"
+
+# Test: c_variable-5.46
+# Desc: children of psnp->ptrs[0]->next->next->ptrs
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \
+ "\\^done,numchild=\"3\",children=\\\[child=\{name=\"psnp->ptrs.0.next.next.ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\\\]" \
+ "get children of psnp->ptrs.0.next.next.ptrs"
+
+# Step over "snp0.char_ptr = &b3;"
+set line 255
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.47
+# Desc: check that psnp->char_ptr (and [0].char_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars psnp->char_ptr (and 0.char_ptr) changed"
+
+# Step over "snp1.char_ptr = &c3;"
+set line 256
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.48
+# Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars psnp->next->char_ptr (and 1.char_ptr) changed"
+
+
+# Step over "snp2.char_ptr = &a3;"
+set line 257
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.49
+# Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars psnp->next->next->char_ptr (and 2.char_ptr) changed"
+
+
+# Step over "snp0.long_ptr = &y3;"
+set line 258
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.50
+# Desc: check that psnp->long_ptr (and [0].long_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars psnp->long_ptr (and 0.long_ptr) changed"
+
+
+# Step over "snp1.long_ptr = &x3;"
+set line 259
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.51
+# Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed
+# Why does this have a FIXME?
+setup_xfail *-*-*
+mi_gdb_test "-var-update *" \
+ "FIXME\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars psnp->next->long_ptr (and 1.long_ptr) changed"
+clear_xfail *-*-*
+
+# This command produces this error message:
+# &"warning: varobj_list: assertion failed - mycount <> 0\n"
+#
+
+# Step over "snp2.long_ptr = &z3;"
+set line 260
+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
+
+# Test: c_variable-5.52
+# Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed"
+
+
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-var-cmd.exp b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp
new file mode 100644
index 00000000000..25326dfe886
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-var-cmd.exp
@@ -0,0 +1,560 @@
+# Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+#
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+
+##### #####
+# #
+# Variable Creation tests #
+# #
+##### #####
+
+# Test: c_variable-1.1
+# Desc: Create global variable
+
+mi_gdb_test "111-var-create global_simple * global_simple" \
+ "111\\^done,name=\"global_simple\",numchild=\"6\",type=\"simpleton\"" \
+ "create global variable"
+
+# Test: c_variable-1.2
+# Desc: Create non-existent variable
+
+mi_gdb_test "112-var-create bogus_unknown_variable * bogus_unknown_variable" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*112\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create non-existent variable"
+
+# Test: c_variable-1.3
+# Desc: Create out of scope variable
+
+mi_gdb_test "113-var-create argc * argc" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*113\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create out of scope variable"
+
+mi_runto do_locals_tests
+
+# Test: c_variable-1.4
+# Desc: create local variables
+
+mi_gdb_test "-var-create linteger * linteger" \
+ "\\^done,name=\"linteger\",numchild=\"0\",type=\"int\"" \
+ "create local variable linteger"
+
+mi_gdb_test "-var-create lpinteger * lpinteger" \
+ "\\^done,name=\"lpinteger\",numchild=\"1\",type=\"int \\*\"" \
+ "create local variable lpinteger"
+
+mi_gdb_test "-var-create lcharacter * lcharacter" \
+ "\\^done,name=\"lcharacter\",numchild=\"0\",type=\"char\"" \
+ "create local variablelcharacter "
+
+mi_gdb_test "-var-create lpcharacter * lpcharacter" \
+ "\\^done,name=\"lpcharacter\",numchild=\"1\",type=\"char \\*\"" \
+ "create local variable lpcharacter"
+
+mi_gdb_test "-var-create llong * llong" \
+ "\\^done,name=\"llong\",numchild=\"0\",type=\"long int\"" \
+ "create local variable llong"
+
+mi_gdb_test "-var-create lplong * lplong" \
+ "\\^done,name=\"lplong\",numchild=\"1\",type=\"long int \\*\"" \
+ "create local variable lplong"
+
+mi_gdb_test "-var-create lfloat * lfloat" \
+ "\\^done,name=\"lfloat\",numchild=\"0\",type=\"float\"" \
+ "create local variable lfloat"
+
+mi_gdb_test "-var-create lpfloat * lpfloat" \
+ "\\^done,name=\"lpfloat\",numchild=\"1\",type=\"float \\*\"" \
+ "create local variable lpfloat"
+
+mi_gdb_test "-var-create ldouble * ldouble" \
+ "\\^done,name=\"ldouble\",numchild=\"0\",type=\"double\"" \
+ "create local variable ldouble"
+
+mi_gdb_test "-var-create lpdouble * lpdouble" \
+ "\\^done,name=\"lpdouble\",numchild=\"1\",type=\"double \\*\"" \
+ "create local variable lpdouble"
+
+mi_gdb_test "-var-create lsimple * lsimple" \
+ "\\^done,name=\"lsimple\",numchild=\"6\",type=\"struct _simple_struct\"" \
+ "create local variable lsimple"
+
+mi_gdb_test "-var-create lpsimple * lpsimple" \
+ "\\^done,name=\"lpsimple\",numchild=\"6\",type=\"struct _simple_struct \\*\"" \
+ "create local variable lpsimple"
+
+mi_gdb_test "-var-create func * func" \
+ "\\^done,name=\"func\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"" \
+ "create local variable func"
+
+# Test: c_variable-1.5
+# Desc: create lsimple.character
+mi_gdb_test "-var-create lsimple.character * lsimple.character" \
+ "\\^done,name=\"lsimple.character\",numchild=\"0\",type=\"char\"" \
+ "create lsimple.character"
+
+# Test: c_variable-1.6
+# Desc: create lpsimple->integer
+mi_gdb_test "-var-create lsimple->integer * lsimple->integer" \
+ "\\^done,name=\"lsimple->integer\",numchild=\"0\",type=\"int\"" \
+ "create lsimple->integer"
+
+# Test: c_variable-1.7
+# Desc: ceate lsimple.integer
+mi_gdb_test "-var-create lsimple.integer * lsimple.integer" \
+ "\\^done,name=\"lsimple.integer\",numchild=\"0\",type=\"int\"" \
+ "create lsimple->integer"
+
+
+# Test: c_variable-1.9
+# Desc: create type name
+# Type names (like int, long, etc..) are all proper expressions to gdb.
+# make sure variable code does not allow users to create variables, though.
+mi_gdb_test "-var-create int * int" \
+ "&\"Attempt to use a type name as an expression.mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create int"
+
+
+##### #####
+# #
+# Value changed tests #
+# #
+##### #####
+
+# Test: c_variable-2.1
+# Desc: check whether values changed at do_block_tests
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\\\]" \
+ "update all vars"
+
+# Step over "linteger = 1234;"
+mi_step_to "do_locals_tests" "" "var-cmd.c" "107" "step at do_locals_test"
+
+# Test: c_variable-2.2
+# Desc: check whether only linteger changed values
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: linteger changed"
+
+# Step over "lpinteger = &linteger;"
+mi_step_to "do_locals_tests" "" "var-cmd.c" 108 "step at do_locals_tests (2)"
+
+# Test: c_variable-2.3
+# Desc: check whether only lpinteger changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: lpinteger changed"
+
+# Step over "lcharacter = 'a';"
+mi_step_to "do_locals_tests" "" "var-cmd.c" "109" "step at do_locals_tests (3)"
+
+# Test: c_variable-2.4
+# Desc: check whether only lcharacter changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: lcharacter changed"
+
+# Step over "lpcharacter = &lcharacter;"
+mi_step_to "do_locals_tests" "" "var-cmd.c" "110" "step at do_locals_tests (4)"
+
+# Test: c_variable-2.5
+# Desc: check whether only lpcharacter changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: lpcharacter changed"
+
+
+# Step over:
+# llong = 2121L;
+# lplong = &llong;
+# lfloat = 2.1;
+# lpfloat = &lfloat;
+# ldouble = 2.718281828459045;
+# lpdouble = &ldouble;
+# lsimple.integer = 1234;
+# lsimple.unsigned_integer = 255;
+# lsimple.character = 'a';
+
+mi_execute_to "exec-step 9" "end-stepping-range" "do_locals_tests" "" \
+ "var-cmd.c" "119" "" "step at do_locals_tests (5)"
+
+# Test: c_variable-2.6
+# Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer,
+# lsimple.unsigned_character lsimple.integer lsimple.character changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lplong\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: many changed"
+
+# Step over:
+# lsimple.signed_character = 21;
+# lsimple.char_ptr = &lcharacter;
+# lpsimple = &lsimple;
+# func = nothing;
+
+mi_execute_to "exec-step 4" "end-stepping-range" "do_locals_tests" "" \
+ "var-cmd.c" "125" "" "step at do_locals_tests (6)"
+
+# Test: c_variable-2.7
+# Desc: check whether (lsimple.signed_character, lsimple.char_ptr) lpsimple, func changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"func\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: func and lpsimple changed"
+
+# Step over
+# linteger = 4321;
+# lcharacter = 'b';
+# llong = 1212L;
+# lfloat = 1.2;
+# ldouble = 5.498548281828172;
+# lsimple.integer = 255;
+# lsimple.unsigned_integer = 4321;
+# lsimple.character = 'b';
+
+mi_execute_to "exec-step 8" "end-stepping-range" "do_locals_tests" "" \
+ "var-cmd.c" "133" "" "step at do_locals_tests (7)"
+
+# Test: c_variable-2.8
+# Desc: check whether linteger, lcharacter, llong, lfoat, ldouble, lsimple.integer,
+# lpsimple.integer lsimple.character changed
+# Note: this test also checks that lpsimple->integer and lsimple.integer have
+# changed (they are the same)
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"ldouble\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lfloat\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\},\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: func and lpsimple changed"
+
+
+###
+#
+# Test assignment to variables. More tests on assignment are in other files.
+#
+###
+mi_gdb_test "-var-assign global_simple 0" \
+ "&\"mi_cmd_var_assign: Variable object is not editable\\\\n\".*\\^error,msg=\"mi_cmd_var_assign: Variable object is not editable\"" \
+ "assign to global_simple"
+
+mi_gdb_test "-var-assign linteger 3333" \
+ "\\^done,value=\"3333\"" \
+ "assign to linteger"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: linteger changed after assign"
+
+mi_gdb_test "-var-assign linteger 3333" \
+ "\\^done,value=\"3333\"" \
+ "assign to linteger again, same value"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\\\]" \
+ "update all vars: linteger not changed after same assign"
+
+mi_gdb_test "-var-evaluate-expression linteger" \
+ "\\^done,value=\"3333\"" \
+ "eval linteger"
+
+mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lpinteger"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: lpinteger changed after assign"
+
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\\\]" \
+ "update all vars: no changes on second update"
+
+mi_gdb_test "-var-evaluate-expression lpinteger" \
+ "\\^done,value=\"$hex\"" \
+ "eval lpinteger"
+
+# reset the values to the original ones so that the rest of the file doesn't suffer.
+
+mi_gdb_test "-var-assign linteger 4321" \
+ "\\^done,value=\"4321\"" \
+ "assign to linteger"
+
+mi_gdb_test "-var-assign lpinteger &linteger" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lpinteger"
+
+mi_gdb_test "-var-assign lcharacter 'z'" \
+ "\\^done,value=\"122 'z'\"" \
+ "assign to lcharacter"
+
+mi_gdb_test "-var-evaluate-expression lcharacter" \
+ "\\^done,value=\"122 'z'\"" \
+ "eval lcharacter"
+
+mi_gdb_test "-var-assign llong 1313L" \
+ "\\^done,value=\"1313\"" \
+ "assign to llong"
+mi_gdb_test "-var-evaluate-expression llong" \
+ "\\^done,value=\"1313\"" \
+ "eval llong"
+mi_gdb_test "-var-assign llong 1212L" \
+ "\\^done,value=\"1212\"" \
+ "assign to llong"
+
+mi_gdb_test "-var-assign lplong &llong+4" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lplong"
+mi_gdb_test "-var-evaluate-expression lplong" \
+ "\\^done,value=\"$hex\"" \
+ "eval lplong"
+mi_gdb_test "-var-assign lplong &llong" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lplong"
+
+mi_gdb_test "-var-assign lfloat 3.4567" \
+ "\\^done,value=\"3.45.*\"" \
+ "assign to lfloat"
+mi_gdb_test "-var-evaluate-expression lfloat" \
+ "\\^done,value=\"3.45.*\"" \
+ "eval lfloat"
+mi_gdb_test "-var-assign lfloat 1.2345" \
+ "\\^done,value=\"1.23.*\"" \
+ "assign to lfloat"
+
+mi_gdb_test "-var-assign lpfloat &lfloat+4" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lpfloat"
+
+mi_gdb_test "-var-assign ldouble 5.333318284590435" \
+ "\\^done,value=\"5.333318284590435\"" \
+ "assign to ldouble"
+
+mi_gdb_test "-var-assign func do_block_tests" \
+ "\\^done,value=\"$hex <do_block_tests>\"" \
+ "assign to func"
+
+mi_gdb_test "-var-assign lsimple.character 'd'" \
+ "\\^done,value=\"100 'd'\"" \
+ "assign to lsimple.character"
+
+mi_gdb_test "-var-assign lsimple->integer 222" \
+ "\\^done,value=\"222\"" \
+ "assign to lsimple->integer"
+
+mi_gdb_test "-var-assign lsimple.integer 333" \
+ "\\^done,value=\"333\"" \
+ "assign to lsimple.integer"
+
+######
+# End of assign tests
+#####
+
+mi_gdb_test "-break-insert subroutine1" \
+ "\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine1\",file=\".*var-cmd.c\",line=\"146\",times=\"0\"\}" \
+ "break-insert subroutine1"
+mi_continue_to "2" "subroutine1" \
+ "\{name=\"i\",value=\"4321\"\},\{name=\"l\",value=\"$hex\"\}" \
+ "var-cmd.c" "146" "continue to subroutine1"
+
+# Test: c_variable-2.10
+# Desc: create variable for locals i,l in subroutine1
+mi_gdb_test "-var-create i * i" \
+ "\\^done,name=\"i\",numchild=\"0\",type=\"int\"" \
+ "create i"
+
+mi_gdb_test "-var-create l * l" \
+ "\\^done,name=\"l\",numchild=\"1\",type=\"long int \\*\"" \
+ "create l"
+
+# Test: c_variable-2.11
+# Desc: create do_locals_tests local in subroutine1
+mi_gdb_test "-var-create linteger * linteger" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create linteger"
+
+mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
+ "var-cmd.c" "147" "step at subroutine1"
+
+# Test: c_variable-2.12
+# Desc: change global_simple.integer
+# Note: This also tests whether we are reporting changes in structs properly.
+# gdb normally would say that global_simple has changed, but we
+# special case that, since it is not what a human expects to
+# see.
+
+setup_xfail *-*-*
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{FIXME: WHAT IS CORRECT HERE\}" \
+ "update all vars: changed FIXME"
+clear_xfail *-*-*
+
+mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
+ "var-cmd.c" "148" "step at subroutine1 (2)"
+
+# Test: c_variable-2.13
+# Desc: change subroutine1 local i
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"i\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: i changed"
+
+mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
+ "var-cmd.c" "149" "step at subroutine1 (3)"
+
+# Test: c_variable-2.14
+# Desc: change do_locals_tests local llong
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
+ "update all vars: llong changed"
+
+mi_next_to "do_locals_tests" "" "var-cmd.c" "136" "next out of subroutine1"
+
+# Test: c_variable-2.15
+# Desc: check for out of scope subroutine1 locals
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\\\[\{name=\"l\",in_scope=\"false\"\},\{name=\"i\",in_scope=\"false\"\}\\\]" \
+ "update all vars: all now out of scope"
+
+# Done with locals/globals tests. Erase all variables
+#delete_all_variables
+mi_gdb_test "-var-delete global_simple" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var"
+
+mi_gdb_test "-var-delete linteger" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var linteger"
+
+mi_gdb_test "-var-delete lpinteger" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpinteger"
+
+mi_gdb_test "-var-delete lcharacter" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lcharacter"
+
+mi_gdb_test "-var-delete lpcharacter" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpcharacter"
+
+mi_gdb_test "-var-delete llong" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var llong"
+
+mi_gdb_test "-var-delete lplong" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lplong"
+
+mi_gdb_test "-var-delete lfloat" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lfloat"
+
+mi_gdb_test "-var-delete lpfloat" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpfloat"
+
+mi_gdb_test "-var-delete ldouble" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var ldouble"
+
+mi_gdb_test "-var-delete lpdouble" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpdouble"
+
+mi_gdb_test "-var-delete lsimple" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple"
+
+mi_gdb_test "-var-delete lpsimple" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpsimple"
+
+mi_gdb_test "-var-delete func" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var func"
+
+mi_gdb_test "-var-delete lsimple.character" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple.character"
+
+mi_gdb_test "-var-delete lsimple->integer" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple->integer"
+
+mi_gdb_test "-var-delete lsimple.integer" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple.integer"
+
+mi_gdb_test "-var-delete i" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var i"
+
+mi_gdb_test "-var-delete l" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var l"
+
+# Test whether we can follow the name of a variable through multiple
+# stack frames.
+mi_gdb_test "-break-insert do_special_tests" \
+ {\^done,bkpt=.*} \
+ "set breakpoint at do_special_tests"
+
+mi_continue_to {.*} do_special_tests {.*} {.*var-cmd.c} {.*} {stop in do_special_tests}
+
+mi_gdb_test "-var-create selected_a @ a" \
+ {\^done,name="selected_a",numchild="0",type="int"} \
+ "create selected_a"
+
+mi_gdb_test "-break-insert incr_a" \
+ {\^done,bkpt=.*} \
+ "set breakpoint at incr_a"
+
+mi_continue_to {.*} incr_a {.*} {.*var-cmd.c} {.*} {stop in incr_a}
+
+mi_gdb_test "-var-update selected_a" \
+ "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",new_type=\"char\",new_num_children=\"0\"\}\\\]" \
+ "update selected_a in incr_a"
+
+mi_next "step a line in incr_a"
+mi_next "return from incr_a to do_special_tests"
+
+mi_gdb_test "-var-update selected_a" \
+ "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",new_type=\"int\",new_num_children=\"0\"\}\\\]" \
+ "update selected_a in do_special_tests"
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-var-display.exp b/gdb/testsuite/gdb.mi/mi2-var-display.exp
new file mode 100644
index 00000000000..3b0990d7866
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-var-display.exp
@@ -0,0 +1,627 @@
+# Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+#
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_gdb_test "200-break-insert 260" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"260\",times=\"0\"\}" \
+ "break-insert operation"
+
+mi_run_cmd
+# The running part has been checked already by mi_run_cmd
+gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to do_children_tests"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
+ timeout {fail "run to do_children_tests (timeout 2)"}
+}
+
+##### #####
+# #
+# Display tests #
+# #
+##### #####
+
+# Test: c_variable-6.1
+# Desc: create variable bar
+mi_gdb_test "-var-create bar * bar" \
+ "\\^done,name=\"bar\",numchild=\"0\",type=\"int\"" \
+ "create local variable bar"
+
+# Test: c_variable-6.2
+# Desc: type of variable bar
+mi_gdb_test "-var-info-type bar" \
+ "\\^done,type=\"int\"" \
+ "info type variable bar"
+
+# Test: c_variable-6.3
+# Desc: format of variable bar
+mi_gdb_test "-var-show-format bar" \
+ "\\^done,format=\"natural\"" \
+ "show format variable bar"
+
+# Test: c_variable-6.4
+# Desc: value of variable bar
+mi_gdb_test "-var-evaluate-expression bar" \
+ "\\^done,value=\"2121\"" \
+ "eval variable bar"
+
+# Test: c_variable-6.5
+# Desc: change format of bar to hex
+mi_gdb_test "-var-set-format bar hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable bar"
+
+# Test: c_variable-6.6
+# Desc: value of bar with new format
+mi_gdb_test "-var-evaluate-expression bar" \
+ "\\^done,value=\"0x849\"" \
+ "eval variable bar with new format"
+
+# Test: c_variable-6.7
+# Desc: change value of bar
+mi_gdb_test "-var-assign bar 3" \
+ "\\^done,value=\"0x3\"" \
+ "assing to variable bar"
+
+mi_gdb_test "-var-set-format bar decimal" \
+ "\\^done,format=\"decimal\"" \
+ "set format variable bar"
+
+mi_gdb_test "-var-evaluate-expression bar" \
+ "\\^done,value=\"3\"" \
+ "eval variable bar with new value"
+
+mi_gdb_test "-var-delete bar" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var bar"
+
+# Test: c_variable-6.11
+# Desc: create variable foo
+mi_gdb_test "-var-create foo * foo" \
+ "\\^done,name=\"foo\",numchild=\"1\",type=\"int \\*\"" \
+ "create local variable foo"
+
+# Test: c_variable-6.12
+# Desc: type of variable foo
+mi_gdb_test "-var-info-type foo" \
+ "\\^done,type=\"int \\*\"" \
+ "info type variable foo"
+
+# Test: c_variable-6.13
+# Desc: format of variable foo
+mi_gdb_test "-var-show-format foo" \
+ "\\^done,format=\"natural\"" \
+ "show format variable foo"
+
+# Test: c_variable-6.14
+# Desc: value of variable foo
+mi_gdb_test "-var-evaluate-expression foo" \
+ "\\^done,value=\"$hex\"" \
+ "eval variable foo"
+
+# Test: c_variable-6.15
+# Desc: change format of var to octal
+mi_gdb_test "-var-set-format foo octal" \
+ "\\^done,format=\"octal\"" \
+ "set format variable foo"
+
+mi_gdb_test "-var-show-format foo" \
+ "\\^done,format=\"octal\"" \
+ "show format variable foo"
+
+# Test: c_variable-6.16
+# Desc: value of foo with new format
+mi_gdb_test "-var-evaluate-expression foo" \
+ "\\^done,value=\"\[0-7\]+\"" \
+ "eval variable foo"
+
+# Test: c_variable-6.17
+# Desc: change value of foo
+mi_gdb_test "-var-assign foo 3" \
+ "\\^done,value=\"03\"" \
+ "assing to variable foo"
+
+mi_gdb_test "-var-set-format foo decimal" \
+ "\\^done,format=\"decimal\"" \
+ "set format variable foo"
+
+# Test: c_variable-6.18
+# Desc: check new value of foo
+mi_gdb_test "-var-evaluate-expression foo" \
+ "\\^done,value=\"3\"" \
+ "eval variable foo"
+
+mi_gdb_test "-var-delete foo" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var foo"
+
+# Test: c_variable-6.21
+# Desc: create variable weird and children
+mi_gdb_test "-var-create weird * weird" \
+ "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
+ "create local variable weird"
+
+mi_gdb_test "-var-list-children weird" \
+ "\\^done,numchild=\"11\",children=\\\[child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int|)\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\\\]" \
+ "get children local variable weird"
+
+
+# Test: c_variable-6.23
+# Desc: change format of weird.func_ptr and weird.func_ptr_ptr
+mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr"
+
+mi_gdb_test "-var-show-format weird.func_ptr" \
+ "\\^done,format=\"hexadecimal\"" \
+ "show format variable weird.func_ptr"
+
+mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr_ptr"
+
+mi_gdb_test "-var-show-format weird.func_ptr_ptr" \
+ "\\^done,format=\"hexadecimal\"" \
+ "show format variable weird.func_ptr_ptr"
+
+# Test: c_variable-6.24
+# Desc: format of weird and children
+mi_gdb_test "-var-set-format weird natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird"
+
+mi_gdb_test "-var-set-format weird.integer natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.integer"
+
+mi_gdb_test "-var-set-format weird.character natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.character"
+
+mi_gdb_test "-var-set-format weird.char_ptr natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.char_ptr"
+
+mi_gdb_test "-var-set-format weird.long_int natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.long_int"
+
+mi_gdb_test "-var-set-format weird.int_ptr_ptr natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.int_ptr_ptr"
+
+mi_gdb_test "-var-set-format weird.long_array natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.long_array"
+
+mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr"
+
+mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr_struct"
+
+mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.func_ptr_ptr"
+
+mi_gdb_test "-var-set-format weird.u1 natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.u1"
+
+mi_gdb_test "-var-set-format weird.s2 natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.s2"
+
+# Test: c_variable-6.25
+# Desc: value of weird and children
+#gdbtk_test c_variable-6.25 {value of weird and children} {
+# set values {}
+# foreach v [lsort [array names var]] f [list x "" "" x x x x d d d d d] {
+# lappend values [value $v $f]
+# }
+
+# set values
+#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
+
+# Test: c_variable-6.26
+# Desc: change format of weird and children to octal
+#gdbtk_test c_variable-6.26 {change format of weird and children to octal} {
+# set formats {}
+# foreach v [lsort [array names var]] {
+# $var($v) format octal
+# lappend formats [$var($v) format]
+# }
+
+# set formats
+#} {octal octal octal octal octal octal octal octal octal octal octal octal}
+
+# Test: c_variable-6.27
+# Desc: value of weird and children with new format
+#gdbtk_test c_variable-6.27 {value of foo with new format} {
+# set values {}
+# foreach v [lsort [array names var]] {
+# lappend values [value $v o]
+# }
+
+# set values
+#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
+
+# Test: c_variable-6.30
+# Desc: create more children of weird
+#gdbtk_test c_variable-6.30 {create more children of weird} {
+# foreach v [array names var] {
+# get_children $v
+# }
+
+# # Do it twice to get more children
+# foreach v [array names var] {
+# get_children $v
+# }
+
+# lsort [array names var]
+#} {weird weird.char_ptr weird.character weird.func_ptr weird.func_ptr_ptr weird.func_ptr_struct weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.integer weird.long_array weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.long_int weird.s2 weird.s2.g weird.s2.h weird.s2.i weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9 weird.s2.u2 weird.s2.u2.f weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.u1 weird.u1.a weird.u1.b weird.u1.c weird.u1.d}
+
+# Test: c_variable-6.31
+# Desc: check that all children of weird change
+# Ok, obviously things like weird.s2 and weird.u1 will not change!
+#gdbtk_test *c_variable-6.31 {check that all children of weird change (ops, we are now reporting array names as changed in this case - seems harmless though)} {
+# $var(weird) value 0x2121
+# check_update
+#} {{weird.integer weird.character weird.char_ptr weird.long_int weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.func_ptr weird.func_ptr_struct weird.func_ptr_ptr weird.u1.a weird.u1.b weird.u1.c weird.u1.d weird.s2.u2.f weird.s2.g weird.s2.h weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9} {weird.s2.i weird.s2.u2 weird weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.s2 weird.long_array weird.u1} {}}
+
+mi_gdb_test "-var-delete weird" \
+ "\\^done,ndeleted=\"12\"" \
+ "delete var weird"
+
+
+##### #####
+# #
+# Special Display Tests #
+# #
+##### #####
+
+# Stop in "do_special_tests"
+mi_gdb_test "200-break-insert do_special_tests" \
+ "200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"282\",times=\"0\"\}" \
+ "break-insert operation"
+
+send_gdb "-exec-continue\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" {
+ pass "continue to do_special_tests"
+ }
+ timeout {
+ fail "continue to do_special_tests (timeout)"
+ }
+}
+
+# Test: c_variable-7.10
+# Desc: create union u
+mi_gdb_test "-var-create u * u" \
+ "\\^done,name=\"u\",numchild=\"2\",type=\"union named_union\"" \
+ "create local variable u"
+
+# Test: c_variable-7.11
+# Desc: value of u
+mi_gdb_test "-var-evaluate-expression u" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable u"
+
+# Test: c_variable-7.12
+# Desc: type of u
+mi_gdb_test "-var-info-type u" \
+ "\\^done,type=\"union named_union\"" \
+ "info type variable u"
+
+# Test: c_variable-7.13
+# Desc: is u editable
+mi_gdb_test "-var-show-attributes u" \
+ "\\^done,attr=\"noneditable\"" \
+ "is u editable"
+
+# Test: c_variable-7.14
+# Desc: number of children of u
+mi_gdb_test "-var-info-num-children u" \
+ "\\^done,numchild=\"2\"" \
+ "get number of children of u"
+
+# Test: c_variable-7.15
+# Desc: children of u
+mi_gdb_test "-var-list-children u" \
+ "\\^done,numchild=\"2\",children=\\\[child=\{name=\"u.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"u.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\}\\\]" \
+ "get children of u"
+
+# Test: c_variable-7.20
+# Desc: create anonu
+mi_gdb_test "-var-create anonu * anonu" \
+ "\\^done,name=\"anonu\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"" \
+ "create local variable anonu"
+
+# Test: c_variable-7.21
+# Desc: value of anonu
+mi_gdb_test "-var-evaluate-expression anonu" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable anonu"
+
+# Test: c_variable-7.22
+# Desc: type of anonu
+mi_gdb_test "-var-info-type anonu" \
+ "\\^done,type=\"union \{\\.\\.\\.\}\"" \
+ "info type variable anonu"
+
+# Test: c_variable-7.23
+# Desc: is anonu editable
+mi_gdb_test "-var-show-attributes anonu" \
+ "\\^done,attr=\"noneditable\"" \
+ "is anonu editable"
+
+# Test: c_variable-7.24
+# Desc: number of children of anonu
+mi_gdb_test "-var-info-num-children anonu" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of anonu"
+
+# Test: c_variable-7.25
+# Desc: children of anonu
+mi_gdb_test "-var-list-children anonu" \
+ "\\^done,numchild=\"3\",children=\\\[child=\{name=\"anonu.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anonu.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anonu.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\\\]" \
+ "get children of anonu"
+
+# Test: c_variable-7.30
+# Desc: create struct s
+mi_gdb_test "-var-create s * s" \
+ "\\^done,name=\"s\",numchild=\"6\",type=\"struct _simple_struct\"" \
+ "create local variable s"
+
+
+# Test: c_variable-7.31
+# Desc: value of s
+mi_gdb_test "-var-evaluate-expression s" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable s"
+
+# Test: c_variable-7.32
+# Desc: type of s
+mi_gdb_test "-var-info-type s" \
+ "\\^done,type=\"struct _simple_struct\"" \
+ "info type variable s"
+
+# Test: c_variable-7.33
+# Desc: is s editable
+mi_gdb_test "-var-show-attributes s" \
+ "\\^done,attr=\"noneditable\"" \
+ "is s editable"
+
+# Test: c_variable-7.34
+# Desc: number of children of s
+mi_gdb_test "-var-info-num-children s" \
+ "\\^done,numchild=\"6\"" \
+ "get number of children of s"
+
+# Test: c_variable-7.35
+# Desc: children of s
+mi_gdb_test "-var-list-children s" \
+ "\\^done,numchild=\"6\",children=\\\[child=\{name=\"s.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"s.unsigned_integer\",exp=\"unsigned_integer\",numchild=\"0\",type=\"unsigned int\"\},child=\{name=\"s.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"s.signed_character\",exp=\"signed_character\",numchild=\"0\",type=\"signed char\"\},child=\{name=\"s.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"s.array_of_10\",exp=\"array_of_10\",numchild=\"10\",type=\"int \\\[10\\\]\"\}\\\]" \
+ "get children of s"
+#} {integer unsigned_integer character signed_character char_ptr array_of_10}
+
+# Test: c_variable-7.40
+# Desc: create anons
+mi_gdb_test "-var-create anons * anons" \
+ "\\^done,name=\"anons\",numchild=\"3\",type=\"struct \{\\.\\.\\.\}\"" \
+ "create local variable anons"
+
+# Test: c_variable-7.41
+# Desc: value of anons
+mi_gdb_test "-var-evaluate-expression anons" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable anons"
+
+# Test: c_variable-7.42
+# Desc: type of anons
+mi_gdb_test "-var-info-type anons" \
+ "\\^done,type=\"struct \{\\.\\.\\.\}\"" \
+ "info type variable anons"
+
+# Test: c_variable-7.43
+# Desc: is anons editable
+mi_gdb_test "-var-show-attributes anons" \
+ "\\^done,attr=\"noneditable\"" \
+ "is anons editable"
+
+# Test: c_variable-7.44
+# Desc: number of children of anons
+mi_gdb_test "-var-info-num-children anons" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of anons"
+
+# Test: c_variable-7.45
+# Desc: children of anons
+mi_gdb_test "-var-list-children anons" \
+ "\\^done,numchild=\"3\",children=\\\[child=\{name=\"anons.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anons.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anons.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\\\]" \
+ "get children of anons"
+
+
+# Test: c_variable-7.50
+# Desc: create enum e
+mi_gdb_test "-var-create e * e" \
+ "\\^done,name=\"e\",numchild=\"0\",type=\"enum foo\"" \
+ "create local variable e"
+
+setup_xfail "*-*-*"
+# Test: c_variable-7.51
+# Desc: value of e
+mi_gdb_test "-var-evaluate-expression e" \
+ "\\^done,value=\"FIXME\"" \
+ "eval variable e"
+clear_xfail "*-*-*"
+
+# Test: c_variable-7.52
+# Desc: type of e
+mi_gdb_test "-var-info-type e" \
+ "\\^done,type=\"enum foo\"" \
+ "info type variable e"
+
+# Test: c_variable-7.53
+# Desc: is e editable
+mi_gdb_test "-var-show-attributes e" \
+ "\\^done,attr=\"editable\"" \
+ "is e editable"
+
+# Test: c_variable-7.54
+# Desc: number of children of e
+mi_gdb_test "-var-info-num-children e" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of e"
+
+# Test: c_variable-7.55
+# Desc: children of e
+mi_gdb_test "-var-list-children e" \
+ "\\^done,numchild=\"0\"" \
+ "get children of e"
+
+# Test: c_variable-7.60
+# Desc: create anone
+mi_gdb_test "-var-create anone * anone" \
+ "\\^done,name=\"anone\",numchild=\"0\",type=\"enum \{\\.\\.\\.\}\"" \
+ "create local variable anone"
+
+setup_xfail "*-*-*"
+# Test: c_variable-7.61
+# Desc: value of anone
+mi_gdb_test "-var-evaluate-expression anone" \
+ "\\^done,value=\"A\"" \
+ "eval variable anone"
+clear_xfail "*-*-*"
+
+
+# Test: c_variable-7.70
+# Desc: create anone
+mi_gdb_test "-var-create anone * anone" \
+ "&\"Duplicate variable object name\\\\n\".*\\^error,msg=\"Duplicate variable object name\"" \
+ "create duplicate local variable anone"
+
+
+# Test: c_variable-7.72
+# Desc: type of anone
+mi_gdb_test "-var-info-type anone" \
+ "\\^done,type=\"enum \{\\.\\.\\.\}\"" \
+ "info type variable anone"
+
+
+# Test: c_variable-7.73
+# Desc: is anone editable
+mi_gdb_test "-var-show-attributes anone" \
+ "\\^done,attr=\"editable\"" \
+ "is anone editable"
+
+# Test: c_variable-7.74
+# Desc: number of children of anone
+mi_gdb_test "-var-info-num-children anone" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of anone"
+
+# Test: c_variable-7.75
+# Desc: children of anone
+mi_gdb_test "-var-list-children anone" \
+ "\\^done,numchild=\"0\"" \
+ "get children of anone"
+
+
+# Record fp
+
+send_gdb "p/x \$fp\n"
+gdb_expect {
+ -re ".*($hex).*\\^done\r\n$mi_gdb_prompt$" {
+ pass "print FP register"
+ set fp $expect_out(1,string)
+ }
+# -re ".*" { fail "print FP register"}
+ timeout { fail "print FP register (timeout)"}
+}
+
+mi_gdb_test "200-break-insert incr_a" \
+ "200\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"incr_a\",file=\".*var-cmd.c\",line=\"85\",times=\"0\"\}" \
+ "break-insert operation"
+send_gdb "-exec-continue\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" {
+ pass "continue to incr_a"
+ }
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"8\[345\]\"\}\r\n$mi_gdb_prompt$" {
+ fail "continue to incr_a (compiler debug info incorrect)"
+ }
+ -re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
+ fail "continue to incr_a (unknown output)"
+ }
+ timeout {
+ fail "continue to incr_a (timeout)"
+ }
+}
+
+# Test: c_variable-7.81
+# Desc: Create variables in different scopes
+mi_gdb_test "-var-create a1 * a" \
+ "\\^done,name=\"a1\",numchild=\"0\",type=\"char\"" \
+ "create local variable a1"
+
+mi_gdb_test "-var-create a2 $fp a" \
+ "\\^done,name=\"a2\",numchild=\"0\",type=\"int\"" \
+ "create variable a2 in different scope"
+
+#gdbtk_test c_variable-7.81 {create variables in different scopes} {
+# set a1 [gdb_variable create -expr a]
+# set a2 [gdb_variable create -expr a -frame $fp]
+
+# set vals {}
+# lappend vals [$a1 value]
+# lappend vals [$a2 value]
+# set vals
+#} {2 1}
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-watch.exp b/gdb/testsuite/gdb.mi/mi2-watch.exp
new file mode 100644
index 00000000000..ba7df2b4648
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi2-watch.exp
@@ -0,0 +1,166 @@
+# Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi2"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_watchpoint_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert a watchpoint and list
+ # Tests:
+ # -break-watch C
+ # -break-list
+
+ mi_gdb_test "111-break-watch C" \
+ "111\\^done,wpt=\{number=\"2\",exp=\"C\"\}" \
+ "break-watch operation"
+
+ mi_gdb_test "222-break-list" \
+ "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"1\"\},bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\\\]\}" \
+ "list of watchpoints"
+
+}
+
+# UNUSED at the time
+proc test_awatch_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert an access watchpoint and list it
+ # Tests:
+ # -break-watch -a A
+ # -break-list
+
+ mi_gdb_test "333-break-watch -a A" \
+ "333\\^done,bkpt=\{number=\"1\",addr=\"$hex\",file=\".*basics.c\",line=\"32\"\}" \
+ "break-watch -a operation"
+
+ mi_gdb_test "444-break-list" \
+ "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\]\}" \
+ "list of watchpoints awatch"
+
+ mi_gdb_test "777-break-delete 3" \
+ "777\\^done" \
+ "delete access watchpoint"
+}
+
+# UNUSED at the time
+proc test_rwatch_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert a read watchpoint and list it.
+ # Tests:
+ # -break-insert -r B
+ # -break-list
+
+ mi_gdb_test "200-break-watch -r C" \
+ "200\\^done,bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert -r operation"
+
+ mi_gdb_test "300-break-list" \
+ "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\}\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "177-break-delete 4" \
+ "177\\^done" \
+ "delete read watchpoint"
+}
+
+proc test_watchpoint_triggering {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Continue execution until the watchpoint is reached, continue again,
+ # to see the watchpoint go out of scope.
+ # Does:
+ # -exec-continue (Here wp triggers)
+ # -exec-continue (Here wp goes out of scope)
+
+ send_gdb "222-exec-continue\n"
+ gdb_expect {
+ -re "222\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
+ pass "watchpoint trigger"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"}
+ timeout {fail "watchpoint trigger (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (1)"}
+ timeout {fail "watchpoint trigger (timeout 1)"}
+ }
+
+ send_gdb "223-exec-continue\n"
+ gdb_expect {
+ -re "223\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {
+ pass "wp out of scope"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"}
+ timeout {fail "wp out of scope (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "wp out of scope (1)"}
+ timeout {fail "wp out of scope (timeout 1)"}
+ }
+}
+
+mi_runto callee4
+test_watchpoint_creation_and_listing
+#test_rwatch_creation_and_listing
+#test_awatch_creation_and_listing
+test_watchpoint_triggering
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/pthreads.c b/gdb/testsuite/gdb.mi/pthreads.c
index c3e17bc6ace..1ba5a15f9fd 100644
--- a/gdb/testsuite/gdb.mi/pthreads.c
+++ b/gdb/testsuite/gdb.mi/pthreads.c
@@ -1,26 +1,4 @@
#include <stdio.h>
-
-#include "config.h"
-
-#ifndef HAVE_PTHREAD_H
-
-/* Don't even try to compile. In fact, cause a syntax error that we can
- look for as a compiler error message and know that we have no pthread
- support. In that case we can just suppress the test completely. */
-
-#error "no posix threads support"
-
-#else
-
-/* OK. We have the right header. If we try to compile this and fail, then
- there is something wrong and the user should know about it so the testsuite
- should issue an ERROR result.. */
-
-#ifdef __linux__
-#define _MIT_POSIX_THREADS 1 /* GNU/Linux (or at least RedHat 4.0)
- needs this */
-#endif
-
#include <pthread.h>
/* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create
@@ -77,4 +55,3 @@ main (int argc, char *argv[])
return 0;
}
-#endif /* ifndef HAVE_PTHREAD_H */
diff --git a/gdb/testsuite/gdb.stabs/weird.exp b/gdb/testsuite/gdb.stabs/weird.exp
index e584cba3135..e3bbfb5e6cc 100644
--- a/gdb/testsuite/gdb.stabs/weird.exp
+++ b/gdb/testsuite/gdb.stabs/weird.exp
@@ -308,7 +308,7 @@ gdb_expect 60 {
send_gdb "y\n"
exp_continue
}
- -re "^Reading symbols from $binfile\\.\\.\\.done\.\r*\n$gdb_prompt $" {
+ -re "^Reading symbols from $binfile\\.\\.\\.done\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)\r\n$gdb_prompt $" {
pass "weirdx.o read without error"
}
-re ".*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.threads/gcore-thread.exp b/gdb/testsuite/gdb.threads/gcore-thread.exp
index 8184fa52d0b..5cb80bd7c79 100644
--- a/gdb/testsuite/gdb.threads/gcore-thread.exp
+++ b/gdb/testsuite/gdb.threads/gcore-thread.exp
@@ -103,9 +103,10 @@ delete_breakpoints
gdb_breakpoint "thread2"
gdb_test "continue" "Continuing.*Breakpoint.* thread2 .*" "thread 2 is running"
+set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore.test]
# Drop corefile
gdb_test "gcore ${objdir}/${subdir}/gcore.test" \
- "Saved corefile ${objdir}/${subdir}/gcore.test" \
+ "Saved corefile ${escapedfilename}" \
"save a corefile"
# Now restart gdb and load the corefile.
diff --git a/gdb/testsuite/gdb.threads/pthreads.c b/gdb/testsuite/gdb.threads/pthreads.c
index b8f126debd0..fdc03242f42 100644
--- a/gdb/testsuite/gdb.threads/pthreads.c
+++ b/gdb/testsuite/gdb.threads/pthreads.c
@@ -1,26 +1,4 @@
#include <stdio.h>
-
-#include "config.h"
-
-#ifndef HAVE_PTHREAD_H
-
-/* Don't even try to compile. In fact, cause a syntax error that we can
- look for as a compiler error message and know that we have no pthread
- support. In that case we can just suppress the test completely. */
-
-#error "no posix threads support"
-
-#else
-
-/* OK. We have the right header. If we try to compile this and fail, then
- there is something wrong and the user should know about it so the testsuite
- should issue an ERROR result.. */
-
-#ifdef __linux__
-#define _MIT_POSIX_THREADS 1 /* GNU/Linux (or at least RedHat 4.0)
- needs this */
-#endif
-
#include <pthread.h>
/* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create
@@ -168,4 +146,3 @@ main(argc, argv)
exit(0);
}
-#endif /* ifndef HAVE_PTHREAD_H */
diff --git a/gdb/testsuite/gdb.trace/save-trace.exp b/gdb/testsuite/gdb.trace/save-trace.exp
index b461ad85940..a5b7cf0ccde 100644
--- a/gdb/testsuite/gdb.trace/save-trace.exp
+++ b/gdb/testsuite/gdb.trace/save-trace.exp
@@ -145,9 +145,10 @@ remote_file host delete savetrace.tr
# 10.3 repeat with a path to the file
+set escapedfilename [string_to_regexp $objdir/savetrace.tr]
remote_file host delete $objdir/savetrace.tr
gdb_test "save-tracepoints $objdir/savetrace.tr" \
- "Tracepoints saved to file '$objdir/savetrace.tr'." \
+ "Tracepoints saved to file '${escapedfilename}'." \
"10.3: save tracepoint definitions, full path"
gdb_delete_tracepoints
diff --git a/gdb/thread-db.c b/gdb/thread-db.c
index a039ca28add..efd0d33b45f 100644
--- a/gdb/thread-db.c
+++ b/gdb/thread-db.c
@@ -375,6 +375,15 @@ thread_db_init (struct target_ops *target)
target_beneath = target;
}
+static void *
+verbose_dlsym (void *handle, const char *name)
+{
+ void *sym = dlsym (handle, name);
+ if (sym == NULL)
+ warning ("Symbol \"%s\" not found in libthread_db: %s", name, dlerror ());
+ return sym;
+}
+
static int
thread_db_load (void)
{
@@ -394,47 +403,47 @@ thread_db_load (void)
/* Initialize pointers to the dynamic library functions we will use.
Essential functions first. */
- td_init_p = dlsym (handle, "td_init");
+ td_init_p = verbose_dlsym (handle, "td_init");
if (td_init_p == NULL)
return 0;
- td_ta_new_p = dlsym (handle, "td_ta_new");
+ td_ta_new_p = verbose_dlsym (handle, "td_ta_new");
if (td_ta_new_p == NULL)
return 0;
- td_ta_map_id2thr_p = dlsym (handle, "td_ta_map_id2thr");
+ td_ta_map_id2thr_p = verbose_dlsym (handle, "td_ta_map_id2thr");
if (td_ta_map_id2thr_p == NULL)
return 0;
- td_ta_map_lwp2thr_p = dlsym (handle, "td_ta_map_lwp2thr");
+ td_ta_map_lwp2thr_p = verbose_dlsym (handle, "td_ta_map_lwp2thr");
if (td_ta_map_lwp2thr_p == NULL)
return 0;
- td_ta_thr_iter_p = dlsym (handle, "td_ta_thr_iter");
+ td_ta_thr_iter_p = verbose_dlsym (handle, "td_ta_thr_iter");
if (td_ta_thr_iter_p == NULL)
return 0;
- td_thr_validate_p = dlsym (handle, "td_thr_validate");
+ td_thr_validate_p = verbose_dlsym (handle, "td_thr_validate");
if (td_thr_validate_p == NULL)
return 0;
- td_thr_get_info_p = dlsym (handle, "td_thr_get_info");
+ td_thr_get_info_p = verbose_dlsym (handle, "td_thr_get_info");
if (td_thr_get_info_p == NULL)
return 0;
- td_thr_getfpregs_p = dlsym (handle, "td_thr_getfpregs");
+ td_thr_getfpregs_p = verbose_dlsym (handle, "td_thr_getfpregs");
if (td_thr_getfpregs_p == NULL)
return 0;
- td_thr_getgregs_p = dlsym (handle, "td_thr_getgregs");
+ td_thr_getgregs_p = verbose_dlsym (handle, "td_thr_getgregs");
if (td_thr_getgregs_p == NULL)
return 0;
- td_thr_setfpregs_p = dlsym (handle, "td_thr_setfpregs");
+ td_thr_setfpregs_p = verbose_dlsym (handle, "td_thr_setfpregs");
if (td_thr_setfpregs_p == NULL)
return 0;
- td_thr_setgregs_p = dlsym (handle, "td_thr_setgregs");
+ td_thr_setgregs_p = verbose_dlsym (handle, "td_thr_setgregs");
if (td_thr_setgregs_p == NULL)
return 0;
@@ -587,6 +596,30 @@ thread_db_new_objfile (struct objfile *objfile)
{
td_err_e err;
+ /* First time through, report that libthread_db was successfuly
+ loaded. Can't print this in in thread_db_load as, at that stage,
+ the interpreter and it's console haven't started. The real
+ problem here is that libthread_db is loaded too early - it should
+ only be loaded when there is a program to debug. */
+ {
+ static int dejavu;
+ if (!dejavu)
+ {
+ Dl_info info;
+ const char *library = NULL;
+ /* Try dladdr. */
+ if (dladdr ((*td_ta_new_p), &info) != 0)
+ library = info.dli_fname;
+ /* Try dlinfo? */
+ if (library == NULL)
+ /* Paranoid - don't let a NULL path slip through. */
+ library = LIBTHREAD_DB_SO;
+ printf_unfiltered ("Using host libthread_db library \"%s\".\n",
+ library);
+ dejavu = 1;
+ }
+ }
+
/* Don't attempt to use thread_db on targets which can not run
(core files). */
if (objfile == NULL || !target_has_execution)
@@ -624,6 +657,8 @@ thread_db_new_objfile (struct objfile *objfile)
break;
case TD_OK:
+ printf_unfiltered ("[Thread debugging using libthread_db enabled]\n");
+
/* The thread library was detected. Activate the thread_db target. */
push_target (&thread_db_ops);
using_thread_db = 1;
diff --git a/gdb/top.c b/gdb/top.c
index e4f9642fcf4..6f0f9a10a65 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -640,8 +640,8 @@ do_chdir_cleanup (void *old_dir)
void
execute_command (char *p, int from_tty)
{
- register struct cmd_list_element *c;
- register enum language flang;
+ struct cmd_list_element *c;
+ enum language flang;
static int warned = 0;
char *line;
@@ -1135,7 +1135,7 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
{
static char *linebuffer = 0;
static unsigned linelength = 0;
- register char *p;
+ char *p;
char *p1;
char *rl;
char *local_prompt = prompt_arg;
@@ -1388,267 +1388,13 @@ There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
/* get_prompt: access method for the GDB prompt string. */
-#define MAX_PROMPT_SIZE 256
-
-/*
- * int get_prompt_1 (char * buf);
- *
- * Work-horse for get_prompt (called via catch_errors).
- * Argument is buffer to hold the formatted prompt.
- *
- * Returns: 1 for success (use formatted prompt)
- * 0 for failure (use gdb_prompt_string).
- */
-
-static int gdb_prompt_escape;
-
-static int
-get_prompt_1 (void *data)
-{
- char *formatted_prompt = data;
- char *local_prompt;
-
- if (event_loop_p)
- local_prompt = PROMPT (0);
- else
- local_prompt = gdb_prompt_string;
-
-
- if (gdb_prompt_escape == 0)
- {
- return 0; /* do no formatting */
- }
- else
- /* formatted prompt */
- {
- char fmt[40], *promptp, *outp, *tmp;
- struct value *arg_val;
- DOUBLEST doubleval;
- LONGEST longval;
- CORE_ADDR addrval;
-
- int i, len;
- struct type *arg_type, *elt_type;
-
- promptp = local_prompt;
- outp = formatted_prompt;
-
- while (*promptp != '\0')
- {
- int available = MAX_PROMPT_SIZE - (outp - formatted_prompt) - 1;
-
- if (*promptp != gdb_prompt_escape)
- {
- if (available >= 1) /* overflow protect */
- *outp++ = *promptp++;
- }
- else
- {
- /* GDB prompt string contains escape char. Parse for arg.
- Two consecutive escape chars followed by arg followed by
- a comma means to insert the arg using a default format.
- Otherwise a printf format string may be included between
- the two escape chars. eg:
- %%foo, insert foo using default format
- %2.2f%foo, insert foo using "%2.2f" format
- A mismatch between the format string and the data type
- of "foo" is an error (which we don't know how to protect
- against). */
-
- fmt[0] = '\0'; /* assume null format string */
- if (promptp[1] == gdb_prompt_escape) /* double esc char */
- {
- promptp += 2; /* skip past two escape chars. */
- }
- else
- {
- /* extract format string from between two esc chars */
- i = 0;
- do
- {
- fmt[i++] = *promptp++; /* copy format string */
- }
- while (i < sizeof (fmt) - 1 &&
- *promptp != gdb_prompt_escape &&
- *promptp != '\0');
-
- if (*promptp != gdb_prompt_escape)
- error ("Syntax error at prompt position %d",
- (int) (promptp - local_prompt));
- else
- {
- promptp++; /* skip second escape char */
- fmt[i++] = '\0'; /* terminate the format string */
- }
- }
-
- arg_val = parse_to_comma_and_eval (&promptp);
- if (*promptp == ',')
- promptp++; /* skip past the comma */
- arg_type = check_typedef (VALUE_TYPE (arg_val));
- switch (TYPE_CODE (arg_type))
- {
- case TYPE_CODE_ARRAY:
- elt_type = check_typedef (TYPE_TARGET_TYPE (arg_type));
- if (TYPE_LENGTH (arg_type) > 0 &&
- TYPE_LENGTH (elt_type) == 1 &&
- TYPE_CODE (elt_type) == TYPE_CODE_INT)
- {
- int len = TYPE_LENGTH (arg_type);
-
- if (VALUE_LAZY (arg_val))
- value_fetch_lazy (arg_val);
- tmp = VALUE_CONTENTS (arg_val);
-
- if (len > available)
- len = available; /* overflow protect */
-
- /* FIXME: how to protect GDB from crashing
- from bad user-supplied format string? */
- if (fmt[0] != 0)
- sprintf (outp, fmt, tmp);
- else
- strncpy (outp, tmp, len);
- outp[len] = '\0';
- }
- break;
- case TYPE_CODE_PTR:
- elt_type = check_typedef (TYPE_TARGET_TYPE (arg_type));
- addrval = value_as_address (arg_val);
-
- if (TYPE_LENGTH (elt_type) == 1 &&
- TYPE_CODE (elt_type) == TYPE_CODE_INT &&
- addrval != 0)
- {
- /* display it as a string */
- char *default_fmt = "%s";
- char *tmp;
- int err = 0;
-
- /* Limiting the number of bytes that the following call
- will read protects us from sprintf overflow later. */
- i = target_read_string (addrval, /* src */
- &tmp, /* dest */
- available, /* len */
- &err);
- if (err) /* read failed */
- error ("%s on target_read", safe_strerror (err));
-
- tmp[i] = '\0'; /* force-terminate string */
- /* FIXME: how to protect GDB from crashing
- from bad user-supplied format string? */
- sprintf (outp, fmt[0] == 0 ? default_fmt : fmt,
- tmp);
- xfree (tmp);
- }
- else
- {
- /* display it as a pointer */
- char *default_fmt = "0x%x";
-
- /* FIXME: how to protect GDB from crashing
- from bad user-supplied format string? */
- if (available >= 16 /*? */ ) /* overflow protect */
- sprintf (outp, fmt[0] == 0 ? default_fmt : fmt,
- (long) addrval);
- }
- break;
- case TYPE_CODE_FLT:
- {
- char *default_fmt = "%g";
-
- doubleval = value_as_double (arg_val);
- /* FIXME: how to protect GDB from crashing
- from bad user-supplied format string? */
- if (available >= 16 /*? */ ) /* overflow protect */
- sprintf (outp, fmt[0] == 0 ? default_fmt : fmt,
- (double) doubleval);
- break;
- }
- case TYPE_CODE_INT:
- {
- char *default_fmt = "%d";
-
- longval = value_as_long (arg_val);
- /* FIXME: how to protect GDB from crashing
- from bad user-supplied format string? */
- if (available >= 16 /*? */ ) /* overflow protect */
- sprintf (outp, fmt[0] == 0 ? default_fmt : fmt,
- (long) longval);
- break;
- }
- case TYPE_CODE_BOOL:
- {
- /* no default format for bool */
- longval = value_as_long (arg_val);
- if (available >= 8 /*? */ ) /* overflow protect */
- {
- if (longval)
- strcpy (outp, "<true>");
- else
- strcpy (outp, "<false>");
- }
- break;
- }
- case TYPE_CODE_ENUM:
- {
- /* no default format for enum */
- longval = value_as_long (arg_val);
- len = TYPE_NFIELDS (arg_type);
- /* find enum name if possible */
- for (i = 0; i < len; i++)
- if (TYPE_FIELD_BITPOS (arg_type, i) == longval)
- break; /* match -- end loop */
-
- if (i < len) /* enum name found */
- {
- char *name = TYPE_FIELD_NAME (arg_type, i);
-
- strncpy (outp, name, available);
- /* in casel available < strlen (name), */
- outp[available] = '\0';
- }
- else
- {
- if (available >= 16 /*? */ ) /* overflow protect */
- sprintf (outp, "%ld", (long) longval);
- }
- break;
- }
- case TYPE_CODE_VOID:
- *outp = '\0';
- break; /* void type -- no output */
- default:
- error ("bad data type at prompt position %d",
- (int) (promptp - local_prompt));
- break;
- }
- outp += strlen (outp);
- }
- }
- *outp++ = '\0'; /* terminate prompt string */
- return 1;
- }
-}
-
char *
get_prompt (void)
{
- static char buf[MAX_PROMPT_SIZE];
-
- if (catch_errors (get_prompt_1, buf, "bad formatted prompt: ",
- RETURN_MASK_ALL))
- {
- return &buf[0]; /* successful formatted prompt */
- }
+ if (event_loop_p)
+ return PROMPT (0);
else
- {
- /* Prompt could not be formatted. */
- if (event_loop_p)
- return PROMPT (0);
- else
- return gdb_prompt_string;
- }
+ return gdb_prompt_string;
}
void
@@ -1693,28 +1439,25 @@ quit_confirm (void)
return 1;
}
-/* Quit without asking for confirmation. */
+/* Helper routine for quit_force that requires error handling. */
-void
-quit_force (char *args, int from_tty)
+struct qt_args
{
- int exit_code = 0;
-
- /* An optional expression may be used to cause gdb to terminate with the
- value of that expression. */
- if (args)
- {
- struct value *val = parse_and_eval (args);
+ char *args;
+ int from_tty;
+};
- exit_code = (int) value_as_long (val);
- }
+static int
+quit_target (void *arg)
+{
+ struct qt_args *qt = (struct qt_args *)arg;
if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
{
if (attach_flag)
- target_detach (args, from_tty);
+ target_detach (qt->args, qt->from_tty);
else
- target_kill ();
+ target_kill ();
}
/* UDI wants this, to kill the TIP. */
@@ -1726,6 +1469,29 @@ quit_force (char *args, int from_tty)
do_final_cleanups (ALL_CLEANUPS); /* Do any final cleanups before exiting */
+ return 0;
+}
+
+/* Quit without asking for confirmation. */
+
+void
+quit_force (char *args, int from_tty)
+{
+ int exit_code = 0;
+
+ /* An optional expression may be used to cause gdb to terminate with the
+ value of that expression. */
+ if (args)
+ {
+ struct value *val = parse_and_eval (args);
+
+ exit_code = (int) value_as_long (val);
+ }
+
+ /* We want to handle any quit errors and exit regardless. */
+ catch_errors (quit_target, args,
+ "Quitting: ", RETURN_MASK_ALL);
+
exit (exit_code);
}
@@ -1946,7 +1712,6 @@ init_main (void)
if (annotation_level > 1)
set_async_annotation_level (NULL, 0, NULL);
}
- gdb_prompt_escape = 0; /* default to none. */
/* Set the important stuff up for command editing. */
command_editing_p = 1;
@@ -1986,13 +1751,6 @@ init_main (void)
set_cmd_sfunc (c, set_async_prompt);
}
- add_show_from_set
- (add_set_cmd ("prompt-escape-char", class_support, var_zinteger,
- (char *) &gdb_prompt_escape,
- "Set escape character for formatting of gdb's prompt",
- &setlist),
- &showlist);
-
add_com ("dont-repeat", class_support, dont_repeat_command, "Don't repeat this command.\n\
Primarily used inside of user-defined commands that should not be repeated when\n\
hitting return.");
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 314f0cc8739..8ac758171a6 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -266,7 +266,7 @@ set_traceframe_context (CORE_ADDR trace_pc)
set_internalvar (lookup_internalvar ("trace_file"),
value_from_pointer (charstar, (LONGEST) 0));
set_internalvar (lookup_internalvar ("trace_line"),
- value_from_pointer (builtin_type_int, (LONGEST) - 1));
+ value_from_longest (builtin_type_int, (LONGEST) - 1));
return;
}
@@ -334,7 +334,7 @@ set_traceframe_context (CORE_ADDR trace_pc)
static struct tracepoint *
set_raw_tracepoint (struct symtab_and_line sal)
{
- register struct tracepoint *t, *tc;
+ struct tracepoint *t, *tc;
struct cleanup *old_chain;
t = (struct tracepoint *) xmalloc (sizeof (struct tracepoint));
@@ -2511,7 +2511,7 @@ trace_dump_command (char *args, int from_tty)
to the tracepoint PC. If not, then the current frame was
collected during single-stepping. */
- stepping_frame = (t->address != read_pc ());
+ stepping_frame = (t->address != (read_pc () - DECR_PC_AFTER_BREAK));
for (action = t->actions; action; action = action->next)
{
diff --git a/gdb/trad-frame.c b/gdb/trad-frame.c
index d73813b9f1f..f397f5d8241 100644
--- a/gdb/trad-frame.c
+++ b/gdb/trad-frame.c
@@ -111,7 +111,7 @@ trad_frame_prev_register (struct frame_info *next_frame,
}
else if (trad_frame_realreg_p (this_saved_regs, regnum))
{
- /* As the next frame to return the value of the register. */
+ /* Ask the next frame to return the value of the register. */
frame_register_unwind (next_frame, this_saved_regs[regnum].realreg,
optimizedp, lvalp, addrp, realregp, bufferp);
}
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index 8eb6d330c74..68386a49786 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -1,3 +1,7 @@
+2003-09-13 Andrew Cagney <cagney@redhat.com>
+
+ * tui.h (struct ui_file): Add opaque declaration.
+
2003-08-04 Daniel Jacobowitz <drow@mvista.com>
* tui-interp.c: Include "cli-out.h".
diff --git a/gdb/tui/tui.h b/gdb/tui/tui.h
index ed66a4ff052..c627b865170 100644
--- a/gdb/tui/tui.h
+++ b/gdb/tui/tui.h
@@ -33,6 +33,8 @@
#undef chtype
#endif
+struct ui_file;
+
/* Opaque data type */
typedef char *Opaque;
typedef
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index 00b0eae2342..9b514bfb67b 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -117,7 +117,7 @@ whatis_exp (char *exp, int show)
{
struct expression *expr;
struct value *val;
- register struct cleanup *old_chain = NULL;
+ struct cleanup *old_chain = NULL;
struct type *real_type = NULL;
struct type *type;
int full = 0;
@@ -204,9 +204,9 @@ ptype_eval (struct expression *exp)
static void
ptype_command (char *typename, int from_tty)
{
- register struct type *type;
+ struct type *type;
struct expression *expr;
- register struct cleanup *old_chain;
+ struct cleanup *old_chain;
if (typename == NULL)
{
@@ -325,8 +325,8 @@ void
maintenance_print_type (char *typename, int from_tty)
{
struct value *val;
- register struct type *type;
- register struct cleanup *old_chain;
+ struct type *type;
+ struct cleanup *old_chain;
struct expression *expr;
if (typename != NULL)
diff --git a/gdb/utils.c b/gdb/utils.c
index 6f97752f0df..9ba67a7ee7e 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -102,8 +102,7 @@ static void malloc_botch (void);
static void prompt_for_continue (void);
-static void set_width_command (char *, int, struct cmd_list_element *);
-
+static void set_screen_size (void);
static void set_width (void);
/* Chain of cleanup actions established with make_cleanup,
@@ -267,9 +266,9 @@ struct cleanup *
make_my_cleanup (struct cleanup **pmy_chain, make_cleanup_ftype *function,
void *arg)
{
- register struct cleanup *new
+ struct cleanup *new
= (struct cleanup *) xmalloc (sizeof (struct cleanup));
- register struct cleanup *old_chain = *pmy_chain;
+ struct cleanup *old_chain = *pmy_chain;
new->next = *pmy_chain;
new->function = function;
@@ -283,40 +282,40 @@ make_my_cleanup (struct cleanup **pmy_chain, make_cleanup_ftype *function,
until we get back to the point OLD_CHAIN in the cleanup_chain. */
void
-do_cleanups (register struct cleanup *old_chain)
+do_cleanups (struct cleanup *old_chain)
{
do_my_cleanups (&cleanup_chain, old_chain);
}
void
-do_final_cleanups (register struct cleanup *old_chain)
+do_final_cleanups (struct cleanup *old_chain)
{
do_my_cleanups (&final_cleanup_chain, old_chain);
}
void
-do_run_cleanups (register struct cleanup *old_chain)
+do_run_cleanups (struct cleanup *old_chain)
{
do_my_cleanups (&run_cleanup_chain, old_chain);
}
void
-do_exec_cleanups (register struct cleanup *old_chain)
+do_exec_cleanups (struct cleanup *old_chain)
{
do_my_cleanups (&exec_cleanup_chain, old_chain);
}
void
-do_exec_error_cleanups (register struct cleanup *old_chain)
+do_exec_error_cleanups (struct cleanup *old_chain)
{
do_my_cleanups (&exec_error_cleanup_chain, old_chain);
}
void
-do_my_cleanups (register struct cleanup **pmy_chain,
- register struct cleanup *old_chain)
+do_my_cleanups (struct cleanup **pmy_chain,
+ struct cleanup *old_chain)
{
- register struct cleanup *ptr;
+ struct cleanup *ptr;
while ((ptr = *pmy_chain) != old_chain)
{
*pmy_chain = ptr->next; /* Do this first incase recursion */
@@ -329,28 +328,28 @@ do_my_cleanups (register struct cleanup **pmy_chain,
until we get back to the point OLD_CHAIN in the cleanup_chain. */
void
-discard_cleanups (register struct cleanup *old_chain)
+discard_cleanups (struct cleanup *old_chain)
{
discard_my_cleanups (&cleanup_chain, old_chain);
}
void
-discard_final_cleanups (register struct cleanup *old_chain)
+discard_final_cleanups (struct cleanup *old_chain)
{
discard_my_cleanups (&final_cleanup_chain, old_chain);
}
void
-discard_exec_error_cleanups (register struct cleanup *old_chain)
+discard_exec_error_cleanups (struct cleanup *old_chain)
{
discard_my_cleanups (&exec_error_cleanup_chain, old_chain);
}
void
-discard_my_cleanups (register struct cleanup **pmy_chain,
- register struct cleanup *old_chain)
+discard_my_cleanups (struct cleanup **pmy_chain,
+ struct cleanup *old_chain)
{
- register struct cleanup *ptr;
+ struct cleanup *ptr;
while ((ptr = *pmy_chain) != old_chain)
{
*pmy_chain = ptr->next;
@@ -1178,6 +1177,17 @@ xfree (void *ptr)
/* Like asprintf/vasprintf but get an internal_error if the call
fails. */
+char *
+xstrprintf (const char *format, ...)
+{
+ char *ret;
+ va_list args;
+ va_start (args, format);
+ xvasprintf (&ret, format, args);
+ va_end (args);
+ return ret;
+}
+
void
xasprintf (char **ret, const char *format, ...)
{
@@ -1210,7 +1220,7 @@ xvasprintf (char **ret, const char *format, va_list ap)
int
myread (int desc, char *addr, int len)
{
- register int val;
+ int val;
int orglen = len;
while (len > 0)
@@ -1233,7 +1243,7 @@ myread (int desc, char *addr, int len)
char *
savestring (const char *ptr, size_t size)
{
- register char *p = (char *) xmalloc (size + 1);
+ char *p = (char *) xmalloc (size + 1);
memcpy (p, ptr, size);
p[size] = 0;
return p;
@@ -1242,7 +1252,7 @@ savestring (const char *ptr, size_t size)
char *
msavestring (void *md, const char *ptr, size_t size)
{
- register char *p = (char *) xmmalloc (md, size + 1);
+ char *p = (char *) xmmalloc (md, size + 1);
memcpy (p, ptr, size);
p[size] = 0;
return p;
@@ -1255,7 +1265,7 @@ mstrsave (void *md, const char *ptr)
}
void
-print_spaces (register int n, register struct ui_file *file)
+print_spaces (int n, struct ui_file *file)
{
fputs_unfiltered (n_spaces (n), file);
}
@@ -1283,8 +1293,8 @@ int
query (const char *ctlstr, ...)
{
va_list args;
- register int answer;
- register int ans2;
+ int answer;
+ int ans2;
int retval;
va_start (args, ctlstr);
@@ -1388,7 +1398,7 @@ int
parse_escape (char **string_ptr)
{
int target_char;
- register int c = *(*string_ptr)++;
+ int c = *(*string_ptr)++;
if (c_parse_backslash (c, &target_char))
return target_char;
else
@@ -1446,8 +1456,8 @@ parse_escape (char **string_ptr)
case '6':
case '7':
{
- register int i = c - '0';
- register int count = 0;
+ int i = c - '0';
+ int count = 0;
while (++count < 3)
{
c = (**string_ptr);
@@ -1556,11 +1566,12 @@ fputstrn_unfiltered (const char *str, int n, int quoter,
}
-
/* Number of lines per page or UINT_MAX if paging is disabled. */
static unsigned int lines_per_page;
+
/* Number of chars per line or UINT_MAX if line folding is disabled. */
static unsigned int chars_per_line;
+
/* Current count of lines printed on this page, chars on this line. */
static unsigned int lines_printed, chars_printed;
@@ -1589,7 +1600,8 @@ static char *wrap_indent;
static int wrap_column;
-/* Inialize the lines and chars per page */
+/* Inialize the number of lines per page and chars per line. */
+
void
init_page_info (void)
{
@@ -1597,66 +1609,65 @@ init_page_info (void)
if (!tui_get_command_dimension (&chars_per_line, &lines_per_page))
#endif
{
- /* These defaults will be used if we are unable to get the correct
- values from termcap. */
#if defined(__GO32__)
lines_per_page = ScreenRows ();
chars_per_line = ScreenCols ();
#else
- lines_per_page = 24;
- chars_per_line = 80;
-
-#if !defined (_WIN32)
- /* Initialize the screen height and width from termcap. */
- {
- char *termtype = getenv ("TERM");
+ int rows, cols;
- /* Positive means success, nonpositive means failure. */
- int status;
+ /* Make sure Readline has initialized its terminal settings. */
+ rl_reset_terminal (NULL);
- /* 2048 is large enough for all known terminals, according to the
- GNU termcap manual. */
- char term_buffer[2048];
+ /* Get the screen size from Readline. */
+ rl_get_screen_size (&rows, &cols);
+ lines_per_page = rows;
+ chars_per_line = cols;
- if (termtype)
- {
- status = tgetent (term_buffer, termtype);
- if (status > 0)
- {
- int val;
- int running_in_emacs = getenv ("EMACS") != NULL;
-
- val = tgetnum ("li");
- if (val >= 0 && !running_in_emacs)
- lines_per_page = val;
- else
- /* The number of lines per page is not mentioned
- in the terminal description. This probably means
- that paging is not useful (e.g. emacs shell window),
- so disable paging. */
- lines_per_page = UINT_MAX;
-
- val = tgetnum ("co");
- if (val >= 0)
- chars_per_line = val;
- }
- }
- }
-#endif
+ /* Readline should have fetched the termcap entry for us. */
+ if (tgetnum ("li") < 0 || getenv ("EMACS"))
+ {
+ /* The number of lines per page is not mentioned in the
+ terminal description. This probably means that paging is
+ not useful (e.g. emacs shell window), so disable paging. */
+ lines_per_page = UINT_MAX;
+ }
+ /* FIXME: Get rid of this junk. */
#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
-
- /* If there is a better way to determine the window size, use it. */
SIGWINCH_HANDLER (SIGWINCH);
#endif
-#endif
+
/* If the output is not a terminal, don't paginate it. */
if (!ui_file_isatty (gdb_stdout))
lines_per_page = UINT_MAX;
- } /* the command_line_version */
+ }
+#endif
+
+ set_screen_size ();
set_width ();
}
+/* Set the screen size based on LINES_PER_PAGE and CHARS_PER_LINE. */
+
+static void
+set_screen_size (void)
+{
+ int rows = lines_per_page;
+ int cols = chars_per_line;
+
+ if (rows <= 0)
+ rows = INT_MAX;
+
+ if (cols <= 0)
+ rl_get_screen_size (NULL, &cols);
+
+ /* Update Readline's idea of the terminal size. */
+ rl_set_screen_size (rows, cols);
+}
+
+/* Reinitialize WRAP_BUFFER according to the current value of
+ CHARS_PER_LINE. */
+
static void
set_width (void)
{
@@ -1670,16 +1681,24 @@ set_width (void)
}
else
wrap_buffer = (char *) xrealloc (wrap_buffer, chars_per_line + 2);
- wrap_pointer = wrap_buffer; /* Start it at the beginning */
+ wrap_pointer = wrap_buffer; /* Start it at the beginning. */
}
/* ARGSUSED */
static void
set_width_command (char *args, int from_tty, struct cmd_list_element *c)
{
+ set_screen_size ();
set_width ();
}
+/* ARGSUSED */
+static void
+set_height_command (char *args, int from_tty, struct cmd_list_element *c)
+{
+ set_screen_size ();
+}
+
/* Wait, so the user can read what's on the screen. Prompt the user
to continue by pressing RETURN. */
@@ -2476,27 +2495,19 @@ initialize_utils (void)
{
struct cmd_list_element *c;
- c = add_set_cmd ("width", class_support, var_uinteger,
- (char *) &chars_per_line,
+ c = add_set_cmd ("width", class_support, var_uinteger, &chars_per_line,
"Set number of characters gdb thinks are in a line.",
&setlist);
add_show_from_set (c, &showlist);
set_cmd_sfunc (c, set_width_command);
- add_show_from_set
- (add_set_cmd ("height", class_support,
- var_uinteger, (char *) &lines_per_page,
- "Set number of lines gdb thinks are in a page.", &setlist),
- &showlist);
+ c = add_set_cmd ("height", class_support, var_uinteger, &lines_per_page,
+ "Set number of lines gdb thinks are in a page.", &setlist);
+ add_show_from_set (c, &showlist);
+ set_cmd_sfunc (c, set_height_command);
init_page_info ();
- /* If the output is not a terminal, don't paginate it. */
- if (!ui_file_isatty (gdb_stdout))
- lines_per_page = UINT_MAX;
-
- set_width_command ((char *) NULL, 0, c);
-
add_show_from_set
(add_set_cmd ("demangle", class_support, var_boolean,
(char *) &demangle,
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 19bdec398e0..2b239b62741 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -31,6 +31,7 @@
#include "arch-utils.h"
#include "regcache.h"
#include "symtab.h"
+#include "dis-asm.h"
struct gdbarch_tdep
{
@@ -174,6 +175,10 @@ v850_processor_type_table[] =
}
,
{
+ v850e_reg_names, bfd_mach_v850e1
+ }
+ ,
+ {
NULL, 0
}
};
@@ -1000,7 +1005,7 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
static CORE_ADDR
v850_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
- write_register (E_RP_REGNUM, CALL_DUMMY_ADDRESS ());
+ write_register (E_RP_REGNUM, entry_point_address ());
return sp;
}
@@ -1060,7 +1065,7 @@ v850_extract_return_value (struct type *type, char *regbuf, char *valbuf)
/* Scalar return values of <= 8 bytes are returned in
E_V0_REGNUM to E_V1_REGNUM. */
memcpy (valbuf,
- &regbuf[REGISTER_BYTE (E_V0_REGNUM)],
+ &regbuf[DEPRECATED_REGISTER_BYTE (E_V0_REGNUM)],
TYPE_LENGTH (type));
}
else
@@ -1068,7 +1073,7 @@ v850_extract_return_value (struct type *type, char *regbuf, char *valbuf)
/* Aggregates and return values > 8 bytes are returned in memory,
pointed to by R6. */
return_buffer =
- extract_unsigned_integer (regbuf + REGISTER_BYTE (E_V0_REGNUM),
+ extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (E_V0_REGNUM),
REGISTER_RAW_SIZE (E_V0_REGNUM));
read_memory (return_buffer, valbuf, TYPE_LENGTH (type));
@@ -1096,7 +1101,7 @@ v850_store_return_value (struct type *type, char *valbuf)
CORE_ADDR return_buffer;
if (!v850_use_struct_convention (0, type))
- deprecated_write_register_bytes (REGISTER_BYTE (E_V0_REGNUM), valbuf,
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (E_V0_REGNUM), valbuf,
TYPE_LENGTH (type));
else
{
@@ -1215,7 +1220,6 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
if (v850_processor_type_table[i].mach == info.bfd_arch_info->mach)
{
v850_register_names = v850_processor_type_table[i].regnames;
- deprecated_tm_print_insn_info.mach = info.bfd_arch_info->mach;
break;
}
}
@@ -1288,6 +1292,8 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_v850);
+
return gdbarch;
}
@@ -1296,6 +1302,5 @@ extern initialize_file_ftype _initialize_v850_tdep; /* -Wmissing-prototypes */
void
_initialize_v850_tdep (void)
{
- deprecated_tm_print_insn = print_insn_v850;
register_gdbarch_init (bfd_arch_v850, v850_gdbarch_init);
}
diff --git a/gdb/v850ice.c b/gdb/v850ice.c
index 770e942a8d1..bb1385a6325 100644
--- a/gdb/v850ice.c
+++ b/gdb/v850ice.c
@@ -560,7 +560,7 @@ v850ice_store_registers (int regno)
return;
}
- regval = extract_unsigned_integer (&deprecated_registers[REGISTER_BYTE (regno)],
+ regval = extract_unsigned_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
strcpy (cmd, "reg ");
if (!convert_register (regno, &cmd[4]))
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 42164fbe2a8..a876767bab1 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -1158,8 +1158,8 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
int
value_logical_not (struct value *arg1)
{
- register int len;
- register char *p;
+ int len;
+ char *p;
struct type *type1;
COERCE_NUMBER (arg1);
@@ -1216,8 +1216,8 @@ value_strcmp (struct value *arg1, struct value *arg2)
int
value_equal (struct value *arg1, struct value *arg2)
{
- register int len;
- register char *p1, *p2;
+ int len;
+ char *p1, *p2;
struct type *type1, *type2;
enum type_code code1;
enum type_code code2;
@@ -1275,8 +1275,8 @@ value_equal (struct value *arg1, struct value *arg2)
int
value_less (struct value *arg1, struct value *arg2)
{
- register enum type_code code1;
- register enum type_code code2;
+ enum type_code code1;
+ enum type_code code2;
struct type *type1, *type2;
COERCE_NUMBER (arg1);
@@ -1317,8 +1317,8 @@ value_less (struct value *arg1, struct value *arg2)
struct value *
value_neg (struct value *arg1)
{
- register struct type *type;
- register struct type *result_type = VALUE_TYPE (arg1);
+ struct type *type;
+ struct type *result_type = VALUE_TYPE (arg1);
COERCE_REF (arg1);
COERCE_ENUM (arg1);
@@ -1346,8 +1346,8 @@ value_neg (struct value *arg1)
struct value *
value_complement (struct value *arg1)
{
- register struct type *type;
- register struct type *result_type = VALUE_TYPE (arg1);
+ struct type *type;
+ struct type *result_type = VALUE_TYPE (arg1);
int typecode;
COERCE_REF (arg1);
diff --git a/gdb/valops.c b/gdb/valops.c
index f0d1a2a0f95..543595d2788 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -143,7 +143,7 @@ int overload_resolution = 0;
struct value *
find_function_in_inferior (const char *name)
{
- register struct symbol *sym;
+ struct symbol *sym;
sym = lookup_symbol_linkage (name);
if (sym != NULL)
{
@@ -212,9 +212,9 @@ allocate_space_in_inferior (int len)
struct value *
value_cast (struct type *type, struct value *arg2)
{
- register enum type_code code1;
- register enum type_code code2;
- register int scalar;
+ enum type_code code1;
+ enum type_code code2;
+ int scalar;
struct type *type2;
int convert_to_boolean = 0;
@@ -535,7 +535,7 @@ value_fetch_lazy (struct value *val)
struct value *
value_assign (struct value *toval, struct value *fromval)
{
- register struct type *type;
+ struct type *type;
struct value *val;
char raw_buffer[MAX_REGISTER_SIZE];
int use_buffer = 0;
@@ -855,7 +855,7 @@ value_of_variable (const struct symbol *var, const struct block *b)
struct value *
value_coerce_array (struct value *arg1)
{
- register struct type *type = check_typedef (VALUE_TYPE (arg1));
+ struct type *type = check_typedef (VALUE_TYPE (arg1));
if (VALUE_LVAL (arg1) != lval_memory)
error ("Attempt to take address of value not located in memory.");
@@ -975,7 +975,7 @@ value_ind (struct value *arg1)
CORE_ADDR
push_word (CORE_ADDR sp, ULONGEST word)
{
- register int len = DEPRECATED_REGISTER_SIZE;
+ int len = DEPRECATED_REGISTER_SIZE;
char buffer[MAX_REGISTER_SIZE];
store_unsigned_integer (buffer, len, word);
@@ -1024,11 +1024,11 @@ push_bytes (CORE_ADDR sp, char *buffer, int len)
it to be an argument to a function. */
static CORE_ADDR
-value_push (register CORE_ADDR sp, struct value *arg)
+value_push (CORE_ADDR sp, struct value *arg)
{
- register int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg));
- register int container_len = len;
- register int offset;
+ int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg));
+ int container_len = len;
+ int offset;
/* How big is the container we're going to put this value in? */
if (PARM_BOUNDARY)
@@ -1287,7 +1287,7 @@ typecmp (int staticp, int varargs, int nargs,
static struct value *
search_struct_field (const char *name, struct value *arg1, int offset,
- register struct type *type, int looking_for_baseclass)
+ struct type *type, int looking_for_baseclass)
{
int i;
int nbases = TYPE_N_BASECLASSES (type);
@@ -1527,7 +1527,7 @@ find_rt_vbase_offset (struct type *type, struct type *basetype, char *valaddr,
static struct value *
search_struct_method (char *name, struct value **arg1p,
struct value **args, int offset,
- int *static_memfuncp, register struct type *type)
+ int *static_memfuncp, struct type *type)
{
int i;
struct value *v;
@@ -1672,7 +1672,7 @@ struct value *
value_struct_elt (struct value **argp, struct value **args,
char *name, int *static_memfuncp, char *err)
{
- register struct type *t;
+ struct type *t;
struct value *v;
COERCE_ARRAY (*argp);
@@ -1952,7 +1952,7 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method,
int num_fns = 0; /* Number of overloaded instances being considered */
struct type *basetype = NULL;
int boffset;
- register int ix;
+ int ix;
int static_offset;
struct cleanup *old_cleanups = NULL;
@@ -2395,9 +2395,9 @@ destructor_name_p (const char *name, const struct type *type)
target structure/union is defined, otherwise, return 0. */
static int
-check_field_in (register struct type *type, const char *name)
+check_field_in (struct type *type, const char *name)
{
- register int i;
+ int i;
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{
@@ -2438,7 +2438,7 @@ check_field_in (register struct type *type, const char *name)
int
check_field (struct value *arg1, const char *name)
{
- register struct type *t;
+ struct type *t;
COERCE_ARRAY (arg1);
@@ -2503,8 +2503,8 @@ value_struct_elt_for_reference (struct type *domain, int offset,
const struct block *block,
enum noside noside)
{
- register struct type *t = curtype;
- register int i;
+ struct type *t = curtype;
+ int i;
struct value *v;
for (i = TYPE_NFIELDS (t) - 1; i >= TYPE_N_BASECLASSES (t); i--)
diff --git a/gdb/value.h b/gdb/value.h
index 51235f9b142..99b84163827 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -427,8 +427,7 @@ extern struct value *value_in (struct value *element, struct value *set);
extern int value_bit_index (struct type *type, char *addr, int index);
-extern int using_struct_return (struct value *function, CORE_ADDR funcaddr,
- struct type *value_type, int gcc_p);
+extern int using_struct_return (struct type *value_type, int gcc_p);
extern void set_return_value (struct value *val);
diff --git a/gdb/values.c b/gdb/values.c
index 2dc2ed8c302..3bde2aaf21c 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -214,7 +214,7 @@ value_release_to_mark (struct value *mark)
struct value *
value_copy (struct value *arg)
{
- register struct type *encl_type = VALUE_ENCLOSING_TYPE (arg);
+ struct type *encl_type = VALUE_ENCLOSING_TYPE (arg);
struct value *val = allocate_value (encl_type);
VALUE_TYPE (val) = VALUE_TYPE (arg);
VALUE_LVAL (val) = VALUE_LVAL (arg);
@@ -291,8 +291,8 @@ struct value *
access_value_history (int num)
{
struct value_history_chunk *chunk;
- register int i;
- register int absnum = num;
+ int i;
+ int absnum = num;
if (absnum <= 0)
absnum += value_history_count;
@@ -329,7 +329,7 @@ void
clear_value_history (void)
{
struct value_history_chunk *next;
- register int i;
+ int i;
struct value *val;
while (value_history_chain)
@@ -347,7 +347,7 @@ clear_value_history (void)
static void
show_values (char *num_exp, int from_tty)
{
- register int i;
+ int i;
struct value *val;
static int num = 1;
@@ -404,7 +404,7 @@ static struct internalvar *internalvars;
struct internalvar *
lookup_internalvar (char *name)
{
- register struct internalvar *var;
+ struct internalvar *var;
for (var = internalvars; var; var = var->next)
if (strcmp (var->name, name) == 0)
@@ -436,7 +436,7 @@ void
set_internalvar_component (struct internalvar *var, int offset, int bitpos,
int bitsize, struct value *newval)
{
- register char *addr = VALUE_CONTENTS (var->value) + offset;
+ char *addr = VALUE_CONTENTS (var->value) + offset;
if (bitsize)
modify_field (addr, value_as_long (newval),
@@ -483,7 +483,7 @@ internalvar_name (struct internalvar *var)
void
clear_internalvars (void)
{
- register struct internalvar *var;
+ struct internalvar *var;
while (internalvars)
{
@@ -498,7 +498,7 @@ clear_internalvars (void)
static void
show_convenience (char *ignore, int from_tty)
{
- register struct internalvar *var;
+ struct internalvar *var;
int varseen = 0;
for (var = internalvars; var; var = var->next)
@@ -664,9 +664,9 @@ value_as_address (struct value *val)
LONGEST
unpack_long (struct type *type, const char *valaddr)
{
- register enum type_code code = TYPE_CODE (type);
- register int len = TYPE_LENGTH (type);
- register int nosign = TYPE_UNSIGNED (type);
+ enum type_code code = TYPE_CODE (type);
+ int len = TYPE_LENGTH (type);
+ int nosign = TYPE_UNSIGNED (type);
if (current_language->la_language == language_scm
&& is_scmvalue_type (type))
@@ -739,7 +739,14 @@ unpack_double (struct type *type, const char *valaddr, int *invp)
also not defined either. Oops!
Hopefully someone will add both the missing floatformat
- definitions and floatformat_is_invalid() function. */
+ definitions and the new cases for floatformat_is_valid (). */
+
+ if (!floatformat_is_valid (floatformat_from_type (type), valaddr))
+ {
+ *invp = 1;
+ return 0.0;
+ }
+
return extract_typed_floating (valaddr, type);
}
else if (nosign)
@@ -876,10 +883,10 @@ value_change_enclosing_type (struct value *val, struct type *new_encl_type)
struct value *
value_primitive_field (struct value *arg1, int offset,
- register int fieldno, register struct type *arg_type)
+ int fieldno, struct type *arg_type)
{
struct value *v;
- register struct type *type;
+ struct type *type;
CHECK_TYPEDEF (arg_type);
type = TYPE_FIELD_TYPE (arg_type, fieldno);
@@ -945,7 +952,7 @@ value_primitive_field (struct value *arg1, int offset,
FIELDNO says which field. */
struct value *
-value_field (struct value *arg1, register int fieldno)
+value_field (struct value *arg1, int fieldno)
{
return value_primitive_field (arg1, 0, fieldno, VALUE_TYPE (arg1));
}
@@ -963,7 +970,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty
int offset)
{
struct value *v;
- register struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);
+ struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);
char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
struct symbol *sym;
struct minimal_symbol *msym;
@@ -1107,11 +1114,11 @@ modify_field (char *addr, LONGEST fieldval, int bitpos, int bitsize)
/* Convert C numbers into newly allocated values */
struct value *
-value_from_longest (struct type *type, register LONGEST num)
+value_from_longest (struct type *type, LONGEST num)
{
struct value *val = allocate_value (type);
- register enum type_code code;
- register int len;
+ enum type_code code;
+ int len;
retry:
code = TYPE_CODE (type);
len = TYPE_LENGTH (type);
@@ -1182,8 +1189,8 @@ value_from_double (struct type *type, DOUBLEST num)
{
struct value *val = allocate_value (type);
struct type *base_type = check_typedef (type);
- register enum type_code code = TYPE_CODE (base_type);
- register int len = TYPE_LENGTH (base_type);
+ enum type_code code = TYPE_CODE (base_type);
+ int len = TYPE_LENGTH (base_type);
if (code == TYPE_CODE_FLT)
{
@@ -1272,19 +1279,15 @@ generic_use_struct_convention (int gcc_p, struct type *value_type)
|| TYPE_LENGTH (value_type) == 8));
}
-/* Return true if the function specified is using the structure returning
- convention on this machine to return arguments, or 0 if it is using
- the value returning convention. FUNCTION is the value representing
- the function, FUNCADDR is the address of the function, and VALUE_TYPE
- is the type returned by the function. GCC_P is nonzero if compiled
+/* Return true if the function returning the specified type is using
+ the convention of returning structures in memory (passing in the
+ address as a hidden first parameter). GCC_P is nonzero if compiled
with GCC. */
-/* ARGSUSED */
int
-using_struct_return (struct value *function, CORE_ADDR funcaddr,
- struct type *value_type, int gcc_p)
+using_struct_return (struct type *value_type, int gcc_p)
{
- register enum type_code code = TYPE_CODE (value_type);
+ enum type_code code = TYPE_CODE (value_type);
if (code == TYPE_CODE_ERROR)
error ("Function return type unknown.");
@@ -1306,7 +1309,7 @@ void
set_return_value (struct value *val)
{
struct type *type = check_typedef (VALUE_TYPE (val));
- register enum type_code code = TYPE_CODE (type);
+ enum type_code code = TYPE_CODE (type);
if (code == TYPE_CODE_ERROR)
error ("Function return type unknown.");
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 1c5fc6382f5..c662518c82f 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -412,7 +412,7 @@ find_frame_addr_in_frame_chain (CORE_ADDR frame_addr)
frame = get_prev_frame (frame);
if (frame == NULL)
return NULL;
- if (get_frame_base (frame) == frame_addr)
+ if (get_frame_base_address (frame) == frame_addr)
return frame;
}
}
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index c2a3fbb5033..2bbe42199e0 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -30,6 +30,7 @@
#include "arch-utils.h"
#include "gdb_string.h"
#include "osabi.h"
+#include "dis-asm.h"
#include "vax-tdep.h"
@@ -187,7 +188,7 @@ vax_frame_chain (struct frame_info *frame)
{
/* In the case of the VAX, the frame's nominal address is the FP value,
and 12 bytes later comes the saved previous FP value as a 4-byte word. */
- if (inside_entry_file (get_frame_pc (frame)))
+ if (deprecated_inside_entry_file (get_frame_pc (frame)))
return (0);
return (read_memory_integer (get_frame_base (frame) + 12, 4));
@@ -266,7 +267,7 @@ vax_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
static void
vax_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
{
- memcpy (valbuf, regbuf + REGISTER_BYTE (0), TYPE_LENGTH (valtype));
+ memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (0), TYPE_LENGTH (valtype));
}
static void
@@ -278,7 +279,7 @@ vax_store_return_value (struct type *valtype, char *valbuf)
static CORE_ADDR
vax_extract_struct_value_address (char *regbuf)
{
- return (extract_unsigned_integer (regbuf + REGISTER_BYTE (0),
+ return (extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (0),
REGISTER_RAW_SIZE (0)));
}
@@ -297,7 +298,7 @@ vax_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
static CORE_ADDR
vax_skip_prologue (CORE_ADDR pc)
{
- register int op = (unsigned char) read_memory_integer (pc, 1);
+ int op = (unsigned char) read_memory_integer (pc, 1);
if (op == 0x11)
pc += 2; /* skip brb */
if (op == 0x31)
diff --git a/gdb/version.in b/gdb/version.in
index e6e841892ca..a51444879d7 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-2003-08-05-cvs
+2003-09-17-cvs
diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c
index 897a541ba9d..f0d87efe24f 100644
--- a/gdb/win32-nat.c
+++ b/gdb/win32-nat.c
@@ -27,7 +27,6 @@
/* We assume we're being built with and will be used for cygwin. */
#include "defs.h"
-#include "tm.h" /* required for SSE registers */
#include "frame.h" /* required by inferior.h */
#include "inferior.h"
#include "target.h"
@@ -70,12 +69,8 @@ enum
#include <sys/procfs.h>
#include <psapi.h>
-#ifdef HAVE_SSE_REGS
#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS \
| CONTEXT_EXTENDED_REGISTERS
-#else
-#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS
-#endif
static unsigned dr[8];
static int debug_registers_changed = 0;
diff --git a/gdb/x86-64-linux-nat.c b/gdb/x86-64-linux-nat.c
index 87b69c9d853..a21ac1373ff 100644
--- a/gdb/x86-64-linux-nat.c
+++ b/gdb/x86-64-linux-nat.c
@@ -25,6 +25,7 @@
#include "inferior.h"
#include "gdbcore.h"
#include "regcache.h"
+#include "linux-nat.h"
#include "gdb_assert.h"
#include "gdb_string.h"
@@ -49,13 +50,56 @@
#include "x86-64-tdep.h"
#include "x86-64-linux-tdep.h"
+#include "i386-linux-tdep.h"
+#include "amd64-nat.h"
+
+/* Mapping between the general-purpose registers in GNU/Linux x86-64
+ `struct user' format and GDB's register cache layout. */
+
+static int x86_64_linux_gregset64_reg_offset[] =
+{
+ RAX * 8, RBX * 8, /* %rax, %rbx */
+ RCX * 8, RDX * 8, /* %rcx, %rdx */
+ RSI * 8, RDI * 8, /* %rsi, %rdi */
+ RBP * 8, RSP * 8, /* %rbp, %rsp */
+ R8 * 8, R9 * 8, /* %r8 ... */
+ R10 * 8, R11 * 8,
+ R12 * 8, R13 * 8,
+ R14 * 8, R15 * 8, /* ... %r15 */
+ RIP * 8, EFLAGS * 8, /* %rip, %eflags */
+ DS * 8, ES * 8, /* %ds, %es */
+ FS * 8, GS * 8 /* %fs, %gs */
+};
+
+
+/* Mapping between the general-purpose registers in GNU/Linux x86-64
+ `struct user' format and GDB's register cache layout for GNU/Linux
+ i386.
+
+ Note that most GNU/Linux x86-64 registers are 64-bit, while the
+ GNU/Linux i386 registers are all 32-bit, but since we're
+ little-endian we get away with that. */
+
+/* From <sys/reg.h> on GNU/Linux i386. */
+static int x86_64_linux_gregset32_reg_offset[] =
+{
+ 10 * 8, 11 * 8, /* %eax, %ecx */
+ 12 * 8, 13 * 8, /* %edx, %ebx */
+ 19 * 8, 4 * 8, /* %esp, %ebp */
+ 13 * 8, 14 * 8, /* %esi, %edi */
+ 16 * 8, 18 * 8, /* %eip, %eflags */
+ 17 * 8, 20 * 8, /* %cs, %ss */
+ 23 * 8, 24 * 8, /* %ds, %es */
+ 25 * 4, 26 * 4, /* %fs, %gs */
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 15 * 8 /* "orig_eax" */
+};
/* Which ptrace request retrieves which registers?
These apply to the corresponding SET requests as well. */
-#define GETREGS_SUPPLIES(regno) \
- (0 <= (regno) && (regno) < X86_64_NUM_GREGS)
-
#define GETFPREGS_SUPPLIES(regno) \
(FP0_REGNUM <= (regno) && (regno) <= MXCSR_REGNUM)
@@ -63,27 +107,27 @@
/* Transfering the general-purpose registers between GDB, inferiors
and core files. */
-/* Fill GDB's register array with the general-purpose register values
+/* Fill GDB's register cache with the general-purpose register values
in *GREGSETP. */
void
supply_gregset (elf_gregset_t *gregsetp)
{
- x86_64_linux_supply_gregset ((char *) gregsetp);
+ amd64_supply_native_gregset (current_regcache, gregsetp, -1);
}
-/* Fill register REGNO (if it is a general-purpose register) in
- *GREGSETPS with the value in GDB's register array. If REGNO is -1,
+/* Fill register REGNUM (if it is a general-purpose register) in
+ *GREGSETP with the value in GDB's register cache. If REGNUM is -1,
do this for all registers. */
void
-fill_gregset (elf_gregset_t *gregsetp, int regno)
+fill_gregset (elf_gregset_t *gregsetp, int regnum)
{
- x86_64_linux_fill_gregset ((char *) gregsetp, regno);
+ amd64_collect_native_gregset (current_regcache, gregsetp, regnum);
}
/* Fetch all general-purpose registers from process/thread TID and
- store their values in GDB's register array. */
+ store their values in GDB's register cache. */
static void
fetch_regs (int tid)
@@ -96,18 +140,18 @@ fetch_regs (int tid)
supply_gregset (&regs);
}
-/* Store all valid general-purpose registers in GDB's register array
+/* Store all valid general-purpose registers in GDB's register cache
into the process/thread specified by TID. */
static void
-store_regs (int tid, int regno)
+store_regs (int tid, int regnum)
{
elf_gregset_t regs;
if (ptrace (PTRACE_GETREGS, tid, 0, (long) &regs) < 0)
perror_with_name ("Couldn't get registers");
- fill_gregset (&regs, regno);
+ fill_gregset (&regs, regnum);
if (ptrace (PTRACE_SETREGS, tid, 0, (long) &regs) < 0)
perror_with_name ("Couldn't write registers");
@@ -116,17 +160,17 @@ store_regs (int tid, int regno)
/* Transfering floating-point registers between GDB, inferiors and cores. */
-/* Fill GDB's register array with the floating-point and SSE register
+/* Fill GDB's register cache with the floating-point and SSE register
values in *FPREGSETP. */
void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
- x86_64_supply_fxsave ((char *) fpregsetp);
+ x86_64_supply_fxsave ((const char *) fpregsetp, -1);
}
/* Fill register REGNUM (if it is a floating-point or SSE register) in
- *FPREGSETP with the value in GDB's register array. If REGNUM is
+ *FPREGSETP with the value in GDB's register cache. If REGNUM is
-1, do this for all registers. */
void
@@ -136,7 +180,7 @@ fill_fpregset (elf_fpregset_t *fpregsetp, int regnum)
}
/* Fetch all floating-point registers from process/thread TID and store
- thier values in GDB's register array. */
+ thier values in GDB's register cache. */
static void
fetch_fpregs (int tid)
@@ -149,18 +193,18 @@ fetch_fpregs (int tid)
supply_fpregset (&fpregs);
}
-/* Store all valid floating-point registers in GDB's register array
+/* Store all valid floating-point registers in GDB's register cache
into the process/thread specified by TID. */
static void
-store_fpregs (int tid, int regno)
+store_fpregs (int tid, int regnum)
{
elf_fpregset_t fpregs;
if (ptrace (PTRACE_GETFPREGS, tid, 0, (long) &fpregs) < 0)
perror_with_name ("Couldn't get floating point status");
- fill_fpregset (&fpregs, regno);
+ fill_fpregset (&fpregs, regnum);
if (ptrace (PTRACE_SETFPREGS, tid, 0, (long) &fpregs) < 0)
perror_with_name ("Couldn't write floating point status");
@@ -169,12 +213,12 @@ store_fpregs (int tid, int regno)
/* Transferring arbitrary registers between GDB and inferior. */
-/* Fetch register REGNO from the child process. If REGNO is -1, do
+/* Fetch register REGNUM from the child process. If REGNUM is -1, do
this for all registers (including the floating point and SSE
registers). */
void
-fetch_inferior_registers (int regno)
+fetch_inferior_registers (int regnum)
{
int tid;
@@ -183,35 +227,29 @@ fetch_inferior_registers (int regno)
if (tid == 0)
tid = PIDGET (inferior_ptid); /* Not a threaded program. */
- if (regno == -1)
+ if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
{
fetch_regs (tid);
- fetch_fpregs (tid);
- return;
- }
-
- if (GETREGS_SUPPLIES (regno))
- {
- fetch_regs (tid);
- return;
+ if (regnum != -1)
+ return;
}
- if (GETFPREGS_SUPPLIES (regno))
+ if (regnum == -1 || GETFPREGS_SUPPLIES (regnum))
{
fetch_fpregs (tid);
return;
}
internal_error (__FILE__, __LINE__,
- "Got request for bad register number %d.", regno);
+ "Got request for bad register number %d.", regnum);
}
-/* Store register REGNO back into the child process. If REGNO is -1,
- do this for all registers (including the floating-point and SSE
+/* Store register REGNUM back into the child process. If REGNUM is
+ -1, do this for all registers (including the floating-point and SSE
registers). */
void
-store_inferior_registers (int regno)
+store_inferior_registers (int regnum)
{
int tid;
@@ -220,27 +258,21 @@ store_inferior_registers (int regno)
if (tid == 0)
tid = PIDGET (inferior_ptid); /* Not a threaded program. */
- if (regno == -1)
+ if (regnum == -1 || amd64_native_gregset_supplies_p (regnum))
{
- store_regs (tid, regno);
- store_fpregs (tid, regno);
- return;
+ store_regs (tid, regnum);
+ if (regnum != -1)
+ return;
}
- if (GETREGS_SUPPLIES (regno))
+ if (regnum == -1 || GETFPREGS_SUPPLIES (regnum))
{
- store_regs (tid, regno);
- return;
- }
-
- if (GETFPREGS_SUPPLIES (regno))
- {
- store_fpregs (tid, regno);
+ store_fpregs (tid, regnum);
return;
}
internal_error (__FILE__, __LINE__,
- "Got request to store bad register number %d.", regno);
+ "Got request to store bad register number %d.", regnum);
}
@@ -316,12 +348,12 @@ x86_64_linux_dr_get_status (void)
{
return x86_64_linux_dr_get (DR_STATUS);
}
+
-extern ps_err_e
+ps_err_e
ps_get_thread_area (const struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
-
/* This definition comes from prctl.h, but some kernels may not have it. */
#ifndef PTRACE_ARCH_PRCTL
#define PTRACE_ARCH_PRCTL 30
@@ -335,15 +367,39 @@ ps_get_thread_area (const struct ps_prochandle *ph,
{
case FS:
if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_FS) == 0)
- return PS_OK;
+ return PS_OK;
break;
case GS:
if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_GS) == 0)
- return PS_OK;
+ return PS_OK;
break;
default: /* Should not happen. */
return PS_BADADDR;
}
return PS_ERR; /* ptrace failed. */
}
+
+
+void
+child_post_startup_inferior (ptid_t ptid)
+{
+ i386_cleanup_dregs ();
+ linux_child_post_startup_inferior (ptid);
+}
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+void _initialize_x86_64_linux_nat (void);
+
+void
+_initialize_x86_64_linux_nat (void)
+{
+ amd64_native_gregset32_reg_offset = x86_64_linux_gregset32_reg_offset;
+ amd64_native_gregset32_num_regs = I386_LINUX_NUM_REGS;
+ amd64_native_gregset64_reg_offset = x86_64_linux_gregset64_reg_offset;
+
+ gdb_assert (ARRAY_SIZE (x86_64_linux_gregset32_reg_offset)
+ == amd64_native_gregset32_num_regs);
+ gdb_assert (ARRAY_SIZE (x86_64_linux_gregset64_reg_offset)
+ == amd64_native_gregset64_num_regs);
+}
diff --git a/gdb/x86-64-linux-tdep.c b/gdb/x86-64-linux-tdep.c
index 7aab1d4e2fa..2c499530115 100644
--- a/gdb/x86-64-linux-tdep.c
+++ b/gdb/x86-64-linux-tdep.c
@@ -68,7 +68,7 @@ static int user_to_gdb_regmap[] =
USER_RSI, USER_RDI, USER_RBP, USER_RSP,
USER_R8, USER_R9, USER_R10, USER_R11,
USER_R12, USER_R13, USER_R14, USER_R15,
- USER_RIP, USER_EFLAGS, USER_CS, USER_SS,
+ USER_RIP, USER_EFLAGS,
USER_DS, USER_ES, USER_FS, USER_GS
};
@@ -123,7 +123,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
if (core_reg_size != 512)
warning ("Wrong size XMM register set in core file.");
else
- x86_64_supply_fxsave (core_reg_sect);
+ x86_64_supply_fxsave (core_reg_sect, -1);
break;
default:
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index a2ae63189f4..e855503f2ba 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -144,7 +144,7 @@ x86_64_register_type (struct gdbarch *gdbarch, int regnum)
static int x86_64_dwarf_regmap[] =
{
/* General Purpose Registers RAX, RDX, RCX, RBX, RSI, RDI. */
- X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, 3, 2,
+ X86_64_RAX_REGNUM, X86_64_RDX_REGNUM, 2, 1,
4, X86_64_RDI_REGNUM,
/* Frame Pointer Register RBP. */
@@ -172,7 +172,7 @@ static int x86_64_dwarf_regmap[] =
X86_64_XMM0_REGNUM + 14, X86_64_XMM0_REGNUM + 15,
/* Floating Point Registers 0-7. */
- X86_64_ST0_REGNUM + 0, X86_64_ST0_REGNUM + 1,
+ X86_64_ST0_REGNUM + 0, X86_64_ST0_REGNUM + 1,
X86_64_ST0_REGNUM + 2, X86_64_ST0_REGNUM + 3,
X86_64_ST0_REGNUM + 4, X86_64_ST0_REGNUM + 5,
X86_64_ST0_REGNUM + 6, X86_64_ST0_REGNUM + 7
@@ -613,6 +613,7 @@ x86_64_push_arguments (struct regcache *regcache, int nargs,
int stack_values_count = 0;
int *stack_values;
stack_values = alloca (nargs * sizeof (int));
+
for (i = 0; i < nargs; i++)
{
enum x86_64_reg_class class[MAX_CLASSES];
@@ -1195,6 +1196,14 @@ x86_64_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
return frame_id_build (fp + 16, frame_pc_unwind (next_frame));
}
+/* 16 byte align the SP per frame requirements. */
+
+static CORE_ADDR
+x86_64_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
+{
+ return sp & -(CORE_ADDR)16;
+}
+
void
x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -1238,6 +1247,8 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
/* Call dummy code. */
set_gdbarch_push_dummy_call (gdbarch, x86_64_push_dummy_call);
+ set_gdbarch_frame_align (gdbarch, x86_64_frame_align);
+ set_gdbarch_frame_red_zone_size (gdbarch, 128);
set_gdbarch_convert_register_p (gdbarch, x86_64_convert_register_p);
set_gdbarch_register_to_value (gdbarch, i387_register_to_value);
@@ -1277,24 +1288,27 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
bits of these pointers (instead of just the 16-bits of the segment
selector). */
-/* Fill GDB's register array with the floating-point and SSE register
- values in *FXSAVE. This function masks off any of the reserved
- bits in *FXSAVE. */
+/* Fill register REGNUM in GDB's register cache with the appropriate
+ floating-point or SSE register value from *FXSAVE. If REGNUM is
+ -1, do this for all registers. This function masks off any of the
+ reserved bits in *FXSAVE. */
void
-x86_64_supply_fxsave (char *fxsave)
+x86_64_supply_fxsave (const char *fxsave, int regnum)
{
- i387_supply_fxsave (fxsave);
+ i387_supply_fxsave (fxsave, regnum);
if (fxsave)
{
- supply_register (I387_FISEG_REGNUM, fxsave + 12);
+ if (regnum == -1 || regnum == I387_FISEG_REGNUM)
+ supply_register (I387_FISEG_REGNUM, fxsave + 12);
+ if (regnum == -1 || regnum == I387_FOSEG_REGNUM)
supply_register (I387_FOSEG_REGNUM, fxsave + 20);
}
}
/* Fill register REGNUM (if it is a floating-point or SSE register) in
- *FXSAVE with the value in GDB's register array. If REGNUM is -1, do
+ *FXSAVE with the value in GDB's register cache. If REGNUM is -1, do
this for all registers. This function doesn't touch any of the
reserved bits in *FXSAVE. */
diff --git a/gdb/x86-64-tdep.h b/gdb/x86-64-tdep.h
index 7ad6990f76a..76bb3d32564 100644
--- a/gdb/x86-64-tdep.h
+++ b/gdb/x86-64-tdep.h
@@ -48,17 +48,24 @@ struct frame_info;
void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch);
-/* Fill GDB's register array with the floating-point and SSE register
- values in *FXSAVE. This function masks off any of the reserved
- bits in *FXSAVE. */
+/* Fill register REGNUM in GDB's register cache with the appropriate
+ floating-point or SSE register value from *FXSAVE. If REGNUM is
+ -1, do this for all registers. This function masks off any of the
+ reserved bits in *FXSAVE. */
-void x86_64_supply_fxsave (char *fxsave);
+void x86_64_supply_fxsave (const char *fxsave, int regnum);
/* Fill register REGNUM (if it is a floating-point or SSE register) in
- *FXSAVE with the value in GDB's register array. If REGNUM is -1, do
+ *FXSAVE with the value in GDB's register cache. If REGNUM is -1, do
this for all registers. This function doesn't touch any of the
reserved bits in *FXSAVE. */
void x86_64_fill_fxsave (char *fxsave, int regnum);
+
+
+/* Variables exported from amd64fbsd-tdep.c. */
+extern CORE_ADDR amd64fbsd_sigtramp_start;
+extern CORE_ADDR amd64fbsd_sigtramp_end;
+extern int amd64fbsd_sc_reg_offset[];
#endif /* x86-64-tdep.h */
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 70081922424..05fb159bcd7 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -1438,10 +1438,10 @@ static struct type *var_symbol_type;
/* process one xcoff symbol. */
static struct symbol *
-process_xcoff_symbol (register struct coff_symbol *cs, struct objfile *objfile)
+process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
{
struct symbol onesymbol;
- register struct symbol *sym = &onesymbol;
+ struct symbol *sym = &onesymbol;
struct symbol *sym2 = NULL;
char *name, *pp;
@@ -2535,7 +2535,7 @@ scan_xcoff_symtab (struct objfile *objfile)
if (pst && STREQ (namestring, pst->filename))
continue;
{
- register int i;
+ int i;
for (i = 0; i < includes_used; i++)
if (STREQ (namestring, psymtab_include_list[i]))
{
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index 076bd23464d..1e8629492b4 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -27,6 +27,7 @@
#include "regcache.h"
#include "gdbcore.h"
#include "objfiles.h"
+#include "dis-asm.h"
struct gdbarch_tdep
{
@@ -220,7 +221,7 @@ xstormy16_extract_return_value (struct type *type, char *regbuf, char *valbuf)
/* Scalar return values of <= 12 bytes are returned in
E_1ST_ARG_REGNUM to E_LST_ARG_REGNUM. */
memcpy (valbuf,
- &regbuf[REGISTER_BYTE (E_1ST_ARG_REGNUM)] + offset,
+ &regbuf[DEPRECATED_REGISTER_BYTE (E_1ST_ARG_REGNUM)] + offset,
TYPE_LENGTH (type));
}
else
@@ -228,7 +229,7 @@ xstormy16_extract_return_value (struct type *type, char *regbuf, char *valbuf)
/* Aggregates and return values > 12 bytes are returned in memory,
pointed to by R2. */
return_buffer =
- extract_unsigned_integer (regbuf + REGISTER_BYTE (E_PTR_RET_REGNUM),
+ extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (E_PTR_RET_REGNUM),
REGISTER_RAW_SIZE (E_PTR_RET_REGNUM));
read_memory (return_buffer, valbuf, TYPE_LENGTH (type));
@@ -312,7 +313,7 @@ xstormy16_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
{
unsigned char buf[xstormy16_pc_size];
- store_unsigned_integer (buf, xstormy16_pc_size, CALL_DUMMY_ADDRESS ());
+ store_unsigned_integer (buf, xstormy16_pc_size, entry_point_address ());
write_memory (sp, buf, xstormy16_pc_size);
return sp + xstormy16_pc_size;
}
@@ -392,7 +393,7 @@ xstormy16_store_return_value (struct type *type, char *valbuf)
}
else if (xstormy16_type_is_scalar (type) &&
TYPE_LENGTH (type) <= E_MAX_RETTYPE_SIZE_IN_REGS)
- deprecated_write_register_bytes (REGISTER_BYTE (E_1ST_ARG_REGNUM),
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (E_1ST_ARG_REGNUM),
valbuf, TYPE_LENGTH (type));
else
{
@@ -1102,7 +1103,7 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_address_to_pointer (gdbarch, xstormy16_address_to_pointer);
set_gdbarch_pointer_to_address (gdbarch, xstormy16_pointer_to_address);
- set_gdbarch_stack_align (gdbarch, xstormy16_stack_align);
+ set_gdbarch_deprecated_stack_align (gdbarch, xstormy16_stack_align);
set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, xstormy16_save_dummy_frame_tos);
@@ -1114,6 +1115,8 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_xstormy16);
+
return gdbarch;
}
@@ -1126,8 +1129,5 @@ extern initialize_file_ftype _initialize_xstormy16_tdep; /* -Wmissing-prototypes
void
_initialize_xstormy16_tdep (void)
{
- extern int print_insn_xstormy16 ();
-
register_gdbarch_init (bfd_arch_xstormy16, xstormy16_gdbarch_init);
- deprecated_tm_print_insn = print_insn_xstormy16;
}
diff --git a/include/ChangeLog b/include/ChangeLog
index 5145a48ab8d..331aef1e901 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,37 @@
+2003-09-15 Andrew Cagney <cagney@redhat.com>
+
+ * floatformat.h (floatformat_to_double): Make input buffer constant.
+ (floatformat_from_double, floatformat_is_valid): Ditto.
+
+2003-09-15 Andrew Cagney <cagney@redhat.com>
+
+ * floatformat.h (struct floatformat): Make "exp_bias" signed.
+
+2003-09-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * floatformat.h (floatformat_is_valid): Add prototype.
+
+2003-08-27 Andrew Cagney <cagney@redhat.com>
+
+ * dis-asm.h (init_disassemble_info): Declare.
+ (INIT_DISASSEMBLE_INFO): Redefine as a call to
+ init_disassemble_info.
+ (INIT_DISASSEMBLE_INFO_NO_ARCH): Ditto.
+
+2003-08-20 Nick Clifton <nickc@redhat.com>
+
+ * bfdlink.h (enum report_method): New enum. Describes how to
+ report something.
+ (struct bfd_link_info): Delete fields 'no_undefined' and
+ 'allow_shlib_undefined'. Replace with
+ 'unresolved_symbols_in_objects' and
+ 'unresolved_symbols_in_shared_libs'.
+
+2003-08-07 Alan Modra <amodra@bigpond.net.au>
+
+ * bfdlink.h: Remove PARAMS macro. Replace PTR with void *.
+ * dis-asm.h: Likewise.
+
2003-07-09 Bob Wilson <bob.wilson@acm.org>
* xtensa-config.h: Undef all macros before defining them.
diff --git a/include/bfdlink.h b/include/bfdlink.h
index 10746ee98e0..c174dcdc698 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -171,26 +171,26 @@ struct bfd_link_hash_table
follows bfd_link_hash_indirect and bfd_link_hash_warning links to
the real symbol. */
extern struct bfd_link_hash_entry *bfd_link_hash_lookup
- PARAMS ((struct bfd_link_hash_table *, const char *, bfd_boolean create,
- bfd_boolean copy, bfd_boolean follow));
+ (struct bfd_link_hash_table *, const char *, bfd_boolean create,
+ bfd_boolean copy, bfd_boolean follow);
/* Look up an entry in the main linker hash table if the symbol might
be wrapped. This should only be used for references to an
undefined symbol, not for definitions of a symbol. */
extern struct bfd_link_hash_entry *bfd_wrapped_link_hash_lookup
- PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean,
- bfd_boolean, bfd_boolean));
+ (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
+ bfd_boolean, bfd_boolean);
/* Traverse a link hash table. */
extern void bfd_link_hash_traverse
- PARAMS ((struct bfd_link_hash_table *,
- bfd_boolean (*) (struct bfd_link_hash_entry *, PTR),
- PTR));
+ (struct bfd_link_hash_table *,
+ bfd_boolean (*) (struct bfd_link_hash_entry *, void *),
+ void *);
/* Add an entry to the undefs list. */
extern void bfd_link_add_undef
- PARAMS ((struct bfd_link_hash_table *, struct bfd_link_hash_entry *));
+ (struct bfd_link_hash_table *, struct bfd_link_hash_entry *);
struct bfd_sym_chain
{
@@ -198,6 +198,19 @@ struct bfd_sym_chain
const char *name;
};
+/* How to handle unresolved symbols.
+ There are four possibilities which are enumerated below: */
+enum report_method
+{
+ /* This is the initial value when then link_info structure is created.
+ It allows the various stages of the linker to determine whether they
+ allowed to set the value. */
+ RM_NOT_YET_SET = 0,
+ RM_IGNORE,
+ RM_GENERATE_WARNING,
+ RM_GENERATE_ERROR
+};
+
/* This structure holds all the information needed to communicate
between BFD and the linker when doing a link. */
@@ -238,24 +251,6 @@ struct bfd_link_info
need much more time and therefore must be explicitly selected. */
unsigned int optimize: 1;
- /* TRUE if BFD should generate errors for undefined symbols
- even if generating a shared object. */
- unsigned int no_undefined: 1;
-
- /* TRUE if BFD should allow undefined symbols in shared objects even
- when no_undefined is set to disallow undefined symbols. The net
- result will be that undefined symbols in regular objects will
- still trigger an error, but undefined symbols in shared objects
- will be ignored. The implementation of no_undefined makes the
- assumption that the runtime linker will choke on undefined
- symbols. However there is at least one system (BeOS) where
- undefined symbols in shared libraries is normal since the kernel
- patches them at load time to select which function is most
- appropriate for the current architecture. I.E. dynamically
- select an appropriate memset function. Apparently it is also
- normal for HPPA shared libraries to have undefined symbols. */
- unsigned int allow_shlib_undefined: 1;
-
/* TRUE if ok to have multiple definition. */
unsigned int allow_multiple_definition: 1;
@@ -305,6 +300,17 @@ struct bfd_link_info
flags. */
unsigned int noexecstack: 1;
+ /* What to do with unresolved symbols in an object file.
+ When producing static binaries the default is GENERATE_ERROR.
+ When producing dynamic binaries the default is IGNORE. The
+ assumption with dynamic binaries is that the reference will be
+ resolved at load/execution time. */
+ enum report_method unresolved_syms_in_objects;
+
+ /* What to do with unresolved symbols in a shared library.
+ The same defaults apply. */
+ enum report_method unresolved_syms_in_shared_libs;
+
/* Which symbols to strip. */
enum bfd_link_strip strip;
@@ -350,7 +356,7 @@ struct bfd_link_info
struct bfd_sym_chain *gc_sym_list;
/* If a base output file is wanted, then this points to it */
- PTR base_file;
+ void *base_file;
/* The function to call when the executable or shared object is
loaded. */
@@ -399,7 +405,7 @@ struct bfd_link_callbacks
name of the symbol which caused the archive element to be pulled
in. */
bfd_boolean (*add_archive_element)
- PARAMS ((struct bfd_link_info *, bfd *abfd, const char *name));
+ (struct bfd_link_info *, bfd *abfd, const char *name);
/* A function which is called when a symbol is found with multiple
definitions. NAME is the symbol which is defined multiple times.
OBFD is the old BFD, OSEC is the old section, OVAL is the old
@@ -407,9 +413,9 @@ struct bfd_link_callbacks
the new value. OBFD may be NULL. OSEC and NSEC may be
bfd_com_section or bfd_ind_section. */
bfd_boolean (*multiple_definition)
- PARAMS ((struct bfd_link_info *, const char *name,
- bfd *obfd, asection *osec, bfd_vma oval,
- bfd *nbfd, asection *nsec, bfd_vma nval));
+ (struct bfd_link_info *, const char *name,
+ bfd *obfd, asection *osec, bfd_vma oval,
+ bfd *nbfd, asection *nsec, bfd_vma nval);
/* A function which is called when a common symbol is defined
multiple times. NAME is the symbol appearing multiple times.
OBFD is the BFD of the existing symbol; it may be NULL if this is
@@ -422,9 +428,9 @@ struct bfd_link_callbacks
bfd_link_hash_indirect. If NTYPE is bfd_link_hash_common, NSIZE
is the size of the new symbol. */
bfd_boolean (*multiple_common)
- PARAMS ((struct bfd_link_info *, const char *name,
- bfd *obfd, enum bfd_link_hash_type otype, bfd_vma osize,
- bfd *nbfd, enum bfd_link_hash_type ntype, bfd_vma nsize));
+ (struct bfd_link_info *, const char *name,
+ bfd *obfd, enum bfd_link_hash_type otype, bfd_vma osize,
+ bfd *nbfd, enum bfd_link_hash_type ntype, bfd_vma nsize);
/* A function which is called to add a symbol to a set. ENTRY is
the link hash table entry for the set itself (e.g.,
__CTOR_LIST__). RELOC is the relocation to use for an entry in
@@ -432,9 +438,8 @@ struct bfd_link_callbacks
get the size of the entry when generating an executable file.
ABFD, SEC and VALUE identify the value to add to the set. */
bfd_boolean (*add_to_set)
- PARAMS ((struct bfd_link_info *, struct bfd_link_hash_entry *entry,
- bfd_reloc_code_real_type reloc, bfd *abfd, asection *sec,
- bfd_vma value));
+ (struct bfd_link_info *, struct bfd_link_hash_entry *entry,
+ bfd_reloc_code_real_type reloc, bfd *abfd, asection *sec, bfd_vma value);
/* A function which is called when the name of a g++ constructor or
destructor is found. This is only called by some object file
formats. CONSTRUCTOR is TRUE for a constructor, FALSE for a
@@ -442,8 +447,8 @@ struct bfd_link_callbacks
relocatable file. NAME is the name of the symbol found. ABFD,
SECTION and VALUE are the value of the symbol. */
bfd_boolean (*constructor)
- PARAMS ((struct bfd_link_info *, bfd_boolean constructor,
- const char *name, bfd *abfd, asection *sec, bfd_vma value));
+ (struct bfd_link_info *, bfd_boolean constructor, const char *name,
+ bfd *abfd, asection *sec, bfd_vma value);
/* A function which is called to issue a linker warning. For
example, this is called when there is a reference to a warning
symbol. WARNING is the warning to be issued. SYMBOL is the name
@@ -452,16 +457,16 @@ struct bfd_link_callbacks
which trigerred the warning; either ABFD or SECTION or both may
be NULL if the location is not known. */
bfd_boolean (*warning)
- PARAMS ((struct bfd_link_info *, const char *warning, const char *symbol,
- bfd *abfd, asection *section, bfd_vma address));
+ (struct bfd_link_info *, const char *warning, const char *symbol,
+ bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a relocation is attempted against
an undefined symbol. NAME is the symbol which is undefined.
ABFD, SECTION and ADDRESS identify the location from which the
reference is made. FATAL indicates whether an undefined symbol is
a fatal error or not. In some cases SECTION may be NULL. */
bfd_boolean (*undefined_symbol)
- PARAMS ((struct bfd_link_info *, const char *name, bfd *abfd,
- asection *section, bfd_vma address, bfd_boolean fatal));
+ (struct bfd_link_info *, const char *name, bfd *abfd,
+ asection *section, bfd_vma address, bfd_boolean fatal);
/* A function which is called when a reloc overflow occurs. NAME is
the name of the symbol or section the reloc is against,
RELOC_NAME is the name of the relocation, and ADDEND is any
@@ -470,8 +475,8 @@ struct bfd_link_callbacks
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
ABFD will be NULL. */
bfd_boolean (*reloc_overflow)
- PARAMS ((struct bfd_link_info *, const char *name, const char *reloc_name,
- bfd_vma addend, bfd *abfd, asection *section, bfd_vma address));
+ (struct bfd_link_info *, const char *name, const char *reloc_name,
+ bfd_vma addend, bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a dangerous reloc is performed.
The canonical example is an a29k IHCONST reloc which does not
follow an IHIHALF reloc. MESSAGE is an appropriate message.
@@ -480,8 +485,8 @@ struct bfd_link_callbacks
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
ABFD will be NULL. */
bfd_boolean (*reloc_dangerous)
- PARAMS ((struct bfd_link_info *, const char *message,
- bfd *abfd, asection *section, bfd_vma address));
+ (struct bfd_link_info *, const char *message,
+ bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a reloc is found to be attached
to a symbol which is not being written out. NAME is the name of
the symbol. ABFD, SECTION and ADDRESS identify the location of
@@ -489,20 +494,20 @@ struct bfd_link_callbacks
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
ABFD will be NULL. */
bfd_boolean (*unattached_reloc)
- PARAMS ((struct bfd_link_info *, const char *name,
- bfd *abfd, asection *section, bfd_vma address));
+ (struct bfd_link_info *, const char *name,
+ bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a symbol in notice_hash is
defined or referenced. NAME is the symbol. ABFD, SECTION and
ADDRESS are the value of the symbol. If SECTION is
bfd_und_section, this is a reference. */
bfd_boolean (*notice)
- PARAMS ((struct bfd_link_info *, const char *name,
- bfd *abfd, asection *section, bfd_vma address));
+ (struct bfd_link_info *, const char *name,
+ bfd *abfd, asection *section, bfd_vma address);
/* A function which is called for reporting a linker error. ID is the
error identifier. The remaining input is the same as einfo () in
ld. */
bfd_boolean (*error_handler)
- PARAMS ((int id, const char * fmt, ...));
+ (int id, const char *fmt, ...);
/* Identifiers of linker error messages used by error_handler. */
#define LD_DEFINITION_IN_DISCARDED_SECTION 1
@@ -605,7 +610,7 @@ struct bfd_link_order_reloc
};
/* Allocate a new link_order for a section. */
-extern struct bfd_link_order *bfd_new_link_order PARAMS ((bfd *, asection *));
+extern struct bfd_link_order *bfd_new_link_order (bfd *, asection *);
/* These structures are used to describe version information for the
ELF linker. These structures could be manipulated entirely inside
@@ -621,7 +626,7 @@ struct bfd_elf_version_expr
/* Regular expression. */
const char *pattern;
/* Matching function. */
- int (*match) PARAMS ((struct bfd_elf_version_expr *, const char *));
+ int (*match) (struct bfd_elf_version_expr *, const char *);
/* Defined by ".symver". */
unsigned int symver: 1;
/* Defined by version script. */
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog
index f9e1fea87c6..75a7ff818f9 100644
--- a/include/coff/ChangeLog
+++ b/include/coff/ChangeLog
@@ -1,3 +1,18 @@
+2003-08-23 Jason Eckhardt <jle@rice.edu>
+
+ * coff/i860.h (COFF860_R_PAIR, COFF860_R_LOW0, COFF860_R_LOW1,
+ COFF860_R_LOW2, COFF860_R_LOW3, COFF860_R_LOW4, COFF860_R_SPLIT0,
+ COFF860_R_SPLIT1, COFF860_R_SPLIT2, COFF860_R_HIGHADJ,
+ COFF860_R_BRADDR): Define new relocation constants and document.
+ Minor formatting adjustments.
+
+2003-08-07 Alan Modra <amodra@bigpond.net.au>
+
+ * ti.h (GET_SCNHDR_NRELOC): Rename PTR param to LOC.
+ (PUT_SCNHDR_NRELOC, GET_SCNHDR_NLNNO, PUT_SCNHDR_NLNNO): Likewise.
+ (GET_SCNHDR_FLAGS, PUT_SCNHDR_FLAGS): Likewise.
+ (GET_SCNHDR_PAGE, PUT_SCNHDR_PAGE): Likewise.
+
2003-07-17 Jeff Muizelaar <muizelaar@rogers.com>
* pe.h: (IMAGE_FILE_NET_RUN_FROM_SWAP): Define.
diff --git a/include/coff/i860.h b/include/coff/i860.h
index 95d0c1a2716..c7072b26b23 100644
--- a/include/coff/i860.h
+++ b/include/coff/i860.h
@@ -1,6 +1,6 @@
-/* coff information for Intel 860.
+/* COFF information for the Intel i860.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -55,3 +55,32 @@ struct external_reloc
#define RELOC struct external_reloc
#define RELSZ 10
+
+/* The relocation directory entry types.
+ PAIR : The low half that follows relates to the preceeding HIGH[ADJ].
+ HIGH : The high half of a 32-bit constant.
+ LOWn : The low half, insn bits 15..(n-1), 2^n-byte aligned.
+ SPLITn : The low half, insn bits 20..16 and 10..(n-1), 2^n-byte aligned.
+ HIGHADJ: Similar to HIGH, but with adjustment.
+ BRADDR : 26-bit branch displacement.
+
+ Note: The Intel assembler manual lists LOW4 as one of the
+ relocation types, but it appears to be useless for the i860.
+ We will recognize it anyway, just in case it actually appears in
+ any object files. */
+
+enum {
+ COFF860_R_PAIR = 0x1c,
+ COFF860_R_HIGH = 0x1e,
+ COFF860_R_LOW0 = 0x1f,
+ COFF860_R_LOW1 = 0x20,
+ COFF860_R_LOW2 = 0x21,
+ COFF860_R_LOW3 = 0x22,
+ COFF860_R_LOW4 = 0x23,
+ COFF860_R_SPLIT0 = 0x24,
+ COFF860_R_SPLIT1 = 0x25,
+ COFF860_R_SPLIT2 = 0x26,
+ COFF860_R_HIGHADJ = 0x27,
+ COFF860_R_BRADDR = 0x28
+};
+
diff --git a/include/coff/ti.h b/include/coff/ti.h
index 8df15223c8d..a15fe717ab6 100644
--- a/include/coff/ti.h
+++ b/include/coff/ti.h
@@ -2,7 +2,7 @@
customized in a target-specific file, and then this file included (see
tic54x.h for an example).
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -215,25 +215,25 @@ struct external_scnhdr {
Assume we're dealing with the COFF2 scnhdr structure, and adjust
accordingly
*/
-#define GET_SCNHDR_NRELOC(ABFD, PTR) \
- (COFF2_P (ABFD) ? H_GET_32 (ABFD, PTR) : H_GET_16 (ABFD, PTR))
-#define PUT_SCNHDR_NRELOC(ABFD, VAL, PTR) \
- (COFF2_P (ABFD) ? H_PUT_32 (ABFD, VAL, PTR) : H_PUT_16 (ABFD, VAL, PTR))
-#define GET_SCNHDR_NLNNO(ABFD, PTR) \
- (COFF2_P (ABFD) ? H_GET_32 (ABFD, PTR) : H_GET_16 (ABFD, (PTR) -2))
-#define PUT_SCNHDR_NLNNO(ABFD, VAL, PTR) \
- (COFF2_P (ABFD) ? H_PUT_32 (ABFD, VAL, PTR) : H_PUT_16 (ABFD, VAL, (PTR) -2))
-#define GET_SCNHDR_FLAGS(ABFD, PTR) \
- (COFF2_P (ABFD) ? H_GET_32 (ABFD, PTR) : H_GET_16 (ABFD, (PTR) -4))
-#define PUT_SCNHDR_FLAGS(ABFD, VAL, PTR) \
- (COFF2_P (ABFD) ? H_PUT_32 (ABFD, VAL, PTR) : H_PUT_16 (ABFD, VAL, (PTR) -4))
-#define GET_SCNHDR_PAGE(ABFD, PTR) \
- (COFF2_P (ABFD) ? H_GET_16 (ABFD, PTR) : (unsigned) H_GET_8 (ABFD, (PTR) -7))
+#define GET_SCNHDR_NRELOC(ABFD, LOC) \
+ (COFF2_P (ABFD) ? H_GET_32 (ABFD, LOC) : H_GET_16 (ABFD, LOC))
+#define PUT_SCNHDR_NRELOC(ABFD, VAL, LOC) \
+ (COFF2_P (ABFD) ? H_PUT_32 (ABFD, VAL, LOC) : H_PUT_16 (ABFD, VAL, LOC))
+#define GET_SCNHDR_NLNNO(ABFD, LOC) \
+ (COFF2_P (ABFD) ? H_GET_32 (ABFD, LOC) : H_GET_16 (ABFD, (LOC) - 2))
+#define PUT_SCNHDR_NLNNO(ABFD, VAL, LOC) \
+ (COFF2_P (ABFD) ? H_PUT_32 (ABFD, VAL, LOC) : H_PUT_16 (ABFD, VAL, (LOC) - 2))
+#define GET_SCNHDR_FLAGS(ABFD, LOC) \
+ (COFF2_P (ABFD) ? H_GET_32 (ABFD, LOC) : H_GET_16 (ABFD, (LOC) - 4))
+#define PUT_SCNHDR_FLAGS(ABFD, VAL, LOC) \
+ (COFF2_P (ABFD) ? H_PUT_32 (ABFD, VAL, LOC) : H_PUT_16 (ABFD, VAL, (LOC) - 4))
+#define GET_SCNHDR_PAGE(ABFD, LOC) \
+ (COFF2_P (ABFD) ? H_GET_16 (ABFD, LOC) : (unsigned) H_GET_8 (ABFD, (LOC) - 7))
/* on output, make sure that the "reserved" field is zero */
-#define PUT_SCNHDR_PAGE(ABFD, VAL, PTR) \
+#define PUT_SCNHDR_PAGE(ABFD, VAL, LOC) \
(COFF2_P (ABFD) \
- ? H_PUT_16 (ABFD, VAL, PTR) \
- : H_PUT_8 (ABFD, VAL, (PTR) -7), H_PUT_8 (ABFD, 0, (PTR) -8))
+ ? H_PUT_16 (ABFD, VAL, LOC) \
+ : H_PUT_8 (ABFD, VAL, (LOC) - 7), H_PUT_8 (ABFD, 0, (LOC) - 8))
/* TI COFF stores section size as number of bytes (address units, not octets),
so adjust to be number of octets, which is what BFD expects */
diff --git a/include/dis-asm.h b/include/dis-asm.h
index 392cbf9b46d..6bdd7517de5 100644
--- a/include/dis-asm.h
+++ b/include/dis-asm.h
@@ -1,6 +1,6 @@
/* Interface between the opcode library and its callers.
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@ extern "C" {
#include <stdio.h>
#include "bfd.h"
-typedef int (*fprintf_ftype) PARAMS((PTR, const char*, ...));
+typedef int (*fprintf_ftype) (void *, const char*, ...);
enum dis_insn_type {
dis_noninsn, /* Not a valid instruction */
@@ -59,8 +59,8 @@ enum dis_insn_type {
typedef struct disassemble_info {
fprintf_ftype fprintf_func;
- PTR stream;
- PTR application_data;
+ void *stream;
+ void *application_data;
/* Target description. We could replace this with a pointer to the bfd,
but that would require one. There currently isn't any such requirement
@@ -98,7 +98,7 @@ typedef struct disassemble_info {
The bottom 16 bits are for the internal use of the disassembler. */
unsigned long flags;
#define INSN_HAS_RELOC 0x80000000
- PTR private_data;
+ void *private_data;
/* Function used to get bytes to disassemble. MEMADDR is the
address of the stuff to be disassembled, MYADDR is the address to
@@ -106,19 +106,19 @@ typedef struct disassemble_info {
INFO is a pointer to this struct.
Returns an errno value or 0 for success. */
int (*read_memory_func)
- PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,
- struct disassemble_info *info));
+ (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,
+ struct disassemble_info *info);
/* Function which should be called if we get an error that we can't
recover from. STATUS is the errno value from read_memory_func and
MEMADDR is the address that we were trying to read. INFO is a
pointer to this struct. */
void (*memory_error_func)
- PARAMS ((int status, bfd_vma memaddr, struct disassemble_info *info));
+ (int status, bfd_vma memaddr, struct disassemble_info *info);
/* Function called to print ADDR. */
void (*print_address_func)
- PARAMS ((bfd_vma addr, struct disassemble_info *info));
+ (bfd_vma addr, struct disassemble_info *info);
/* Function called to determine if there is a symbol at the given ADDR.
If there is, the function returns 1, otherwise it returns 0.
@@ -128,7 +128,7 @@ typedef struct disassemble_info {
address, (normally because there is a symbol associated with
that address), but sometimes we want to mask out the overlay bits. */
int (* symbol_at_address_func)
- PARAMS ((bfd_vma addr, struct disassemble_info * info));
+ (bfd_vma addr, struct disassemble_info * info);
/* These are for buffer_read_memory. */
bfd_byte *buffer;
@@ -177,88 +177,88 @@ typedef struct disassemble_info {
/* Standard disassemblers. Disassemble one instruction at the given
target address. Return number of octets processed. */
-typedef int (*disassembler_ftype)
- PARAMS((bfd_vma, disassemble_info *));
-
-extern int print_insn_big_mips PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_little_mips PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_i386 PARAMS ((bfd_vma, disassemble_info *));
-extern int print_insn_i386_att PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_i386_intel PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_ia64 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_i370 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_m68hc11 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_m68hc12 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_m68k PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_z8001 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_z8002 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_h8300 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_h8300h PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_h8300s PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_h8500 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_alpha PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_big_arm PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_little_arm PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_sparc PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_big_a29k PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_little_a29k PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_avr PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_d10v PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_d30v PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_dlx PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_fr30 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_hppa PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_i860 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_i960 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_ip2k PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_m32r PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_m88k PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_mcore PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_mmix PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_mn10200 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_mn10300 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_msp430 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_ns32k PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_openrisc PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_big_or32 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_little_or32 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_pdp11 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_pj PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_big_powerpc PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_little_powerpc PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_rs6000 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_s390 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_sh PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_tic30 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_tic4x PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_tic54x PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_tic80 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_v850 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_vax PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_w65 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_xstormy16 PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_xtensa PARAMS ((bfd_vma, disassemble_info*));
-extern int print_insn_sh64 PARAMS ((bfd_vma, disassemble_info *));
-extern int print_insn_sh64x_media PARAMS ((bfd_vma, disassemble_info *));
-extern int print_insn_frv PARAMS ((bfd_vma, disassemble_info *));
-extern int print_insn_iq2000 PARAMS ((bfd_vma, disassemble_info *));
-
-extern disassembler_ftype arc_get_disassembler PARAMS ((void *));
-extern disassembler_ftype cris_get_disassembler PARAMS ((bfd *));
-
-extern void print_mips_disassembler_options PARAMS ((FILE *));
-extern void print_ppc_disassembler_options PARAMS ((FILE *));
-extern void print_arm_disassembler_options PARAMS ((FILE *));
-extern void parse_arm_disassembler_option PARAMS ((char *));
-extern int get_arm_regname_num_options PARAMS ((void));
-extern int set_arm_regname_option PARAMS ((int));
-extern int get_arm_regnames PARAMS ((int, const char **, const char **, const char ***));
+typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);
+
+extern int print_insn_big_mips (bfd_vma, disassemble_info *);
+extern int print_insn_little_mips (bfd_vma, disassemble_info *);
+extern int print_insn_i386 (bfd_vma, disassemble_info *);
+extern int print_insn_i386_att (bfd_vma, disassemble_info *);
+extern int print_insn_i386_intel (bfd_vma, disassemble_info *);
+extern int print_insn_ia64 (bfd_vma, disassemble_info *);
+extern int print_insn_i370 (bfd_vma, disassemble_info *);
+extern int print_insn_m68hc11 (bfd_vma, disassemble_info *);
+extern int print_insn_m68hc12 (bfd_vma, disassemble_info *);
+extern int print_insn_m68k (bfd_vma, disassemble_info *);
+extern int print_insn_z8001 (bfd_vma, disassemble_info *);
+extern int print_insn_z8002 (bfd_vma, disassemble_info *);
+extern int print_insn_h8300 (bfd_vma, disassemble_info *);
+extern int print_insn_h8300h (bfd_vma, disassemble_info *);
+extern int print_insn_h8300s (bfd_vma, disassemble_info *);
+extern int print_insn_h8500 (bfd_vma, disassemble_info *);
+extern int print_insn_alpha (bfd_vma, disassemble_info *);
+extern int print_insn_big_arm (bfd_vma, disassemble_info *);
+extern int print_insn_little_arm (bfd_vma, disassemble_info *);
+extern int print_insn_sparc (bfd_vma, disassemble_info *);
+extern int print_insn_big_a29k (bfd_vma, disassemble_info *);
+extern int print_insn_little_a29k (bfd_vma, disassemble_info *);
+extern int print_insn_avr (bfd_vma, disassemble_info *);
+extern int print_insn_d10v (bfd_vma, disassemble_info *);
+extern int print_insn_d30v (bfd_vma, disassemble_info *);
+extern int print_insn_dlx (bfd_vma, disassemble_info *);
+extern int print_insn_fr30 (bfd_vma, disassemble_info *);
+extern int print_insn_hppa (bfd_vma, disassemble_info *);
+extern int print_insn_i860 (bfd_vma, disassemble_info *);
+extern int print_insn_i960 (bfd_vma, disassemble_info *);
+extern int print_insn_ip2k (bfd_vma, disassemble_info *);
+extern int print_insn_m32r (bfd_vma, disassemble_info *);
+extern int print_insn_m88k (bfd_vma, disassemble_info *);
+extern int print_insn_mcore (bfd_vma, disassemble_info *);
+extern int print_insn_mmix (bfd_vma, disassemble_info *);
+extern int print_insn_mn10200 (bfd_vma, disassemble_info *);
+extern int print_insn_mn10300 (bfd_vma, disassemble_info *);
+extern int print_insn_msp430 (bfd_vma, disassemble_info *);
+extern int print_insn_ns32k (bfd_vma, disassemble_info *);
+extern int print_insn_openrisc (bfd_vma, disassemble_info *);
+extern int print_insn_big_or32 (bfd_vma, disassemble_info *);
+extern int print_insn_little_or32 (bfd_vma, disassemble_info *);
+extern int print_insn_pdp11 (bfd_vma, disassemble_info *);
+extern int print_insn_pj (bfd_vma, disassemble_info *);
+extern int print_insn_big_powerpc (bfd_vma, disassemble_info *);
+extern int print_insn_little_powerpc (bfd_vma, disassemble_info *);
+extern int print_insn_rs6000 (bfd_vma, disassemble_info *);
+extern int print_insn_s390 (bfd_vma, disassemble_info *);
+extern int print_insn_sh (bfd_vma, disassemble_info *);
+extern int print_insn_tic30 (bfd_vma, disassemble_info *);
+extern int print_insn_tic4x (bfd_vma, disassemble_info *);
+extern int print_insn_tic54x (bfd_vma, disassemble_info *);
+extern int print_insn_tic80 (bfd_vma, disassemble_info *);
+extern int print_insn_v850 (bfd_vma, disassemble_info *);
+extern int print_insn_vax (bfd_vma, disassemble_info *);
+extern int print_insn_w65 (bfd_vma, disassemble_info *);
+extern int print_insn_xstormy16 (bfd_vma, disassemble_info *);
+extern int print_insn_xtensa (bfd_vma, disassemble_info *);
+extern int print_insn_sh64 (bfd_vma, disassemble_info *);
+extern int print_insn_sh64x_media (bfd_vma, disassemble_info *);
+extern int print_insn_frv (bfd_vma, disassemble_info *);
+extern int print_insn_iq2000 (bfd_vma, disassemble_info *);
+
+extern disassembler_ftype arc_get_disassembler (void *);
+extern disassembler_ftype cris_get_disassembler (bfd *);
+
+extern void print_mips_disassembler_options (FILE *);
+extern void print_ppc_disassembler_options (FILE *);
+extern void print_arm_disassembler_options (FILE *);
+extern void parse_arm_disassembler_option (char *);
+extern int get_arm_regname_num_options (void);
+extern int set_arm_regname_option (int);
+extern int get_arm_regnames
+ (int, const char **, const char **, const char ***);
/* Fetch the disassembler for a given BFD, if that support is available. */
-extern disassembler_ftype disassembler PARAMS ((bfd *));
+extern disassembler_ftype disassembler (bfd *);
/* Document any target specific options available from the disassembler. */
-extern void disassembler_usage PARAMS ((FILE *));
+extern void disassembler_usage (FILE *);
/* This block of definitions is for particular callers who read instructions
@@ -267,59 +267,34 @@ extern void disassembler_usage PARAMS ((FILE *));
/* Here is a function which callers may wish to use for read_memory_func.
It gets bytes from a buffer. */
extern int buffer_read_memory
- PARAMS ((bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *));
+ (bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *);
/* This function goes with buffer_read_memory.
It prints a message using info->fprintf_func and info->stream. */
-extern void perror_memory PARAMS ((int, bfd_vma, struct disassemble_info *));
+extern void perror_memory (int, bfd_vma, struct disassemble_info *);
/* Just print the address in hex. This is included for completeness even
though both GDB and objdump provide their own (to print symbolic
addresses). */
extern void generic_print_address
- PARAMS ((bfd_vma, struct disassemble_info *));
+ (bfd_vma, struct disassemble_info *);
/* Always true. */
extern int generic_symbol_at_address
- PARAMS ((bfd_vma, struct disassemble_info *));
+ (bfd_vma, struct disassemble_info *);
-/* Macro to initialize a disassemble_info struct. This should be called
- by all applications creating such a struct. */
-#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
- (INFO).flavour = bfd_target_unknown_flavour, \
- (INFO).arch = bfd_arch_unknown, \
- (INFO).mach = 0, \
- (INFO).insn_sets = 0, \
- (INFO).endian = BFD_ENDIAN_UNKNOWN, \
- (INFO).octets_per_byte = 1, \
- INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC)
-
-/* Call this macro to initialize only the internal variables for the
- disassembler. Architecture dependent things such as byte order, or machine
- variant are not touched by this macro. This makes things much easier for
- GDB which must initialize these things separately. */
+/* Method to initialize a disassemble_info struct. This should be
+ called by all applications creating such a struct. */
+extern void init_disassemble_info (struct disassemble_info *info, void *stream,
+ fprintf_ftype fprintf_func);
+/* For compatibility with existing code. */
+#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
+ init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
- (INFO).fprintf_func = (fprintf_ftype)(FPRINTF_FUNC), \
- (INFO).stream = (PTR)(STREAM), \
- (INFO).section = NULL, \
- (INFO).symbols = NULL, \
- (INFO).num_symbols = 0, \
- (INFO).private_data = NULL, \
- (INFO).buffer = NULL, \
- (INFO).buffer_vma = 0, \
- (INFO).buffer_length = 0, \
- (INFO).read_memory_func = buffer_read_memory, \
- (INFO).memory_error_func = perror_memory, \
- (INFO).print_address_func = generic_print_address, \
- (INFO).symbol_at_address_func = generic_symbol_at_address, \
- (INFO).flags = 0, \
- (INFO).bytes_per_line = 0, \
- (INFO).bytes_per_chunk = 0, \
- (INFO).display_endian = BFD_ENDIAN_UNKNOWN, \
- (INFO).disassembler_options = NULL, \
- (INFO).insn_info_valid = 0
+ init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
+
#ifdef __cplusplus
}
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 6b0a8c57a37..02f20528d30 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,27 @@
+2003-09-11 James Cownie <jcownie@etnus.com>
+
+ * dwarf2.h: Add HP dwarf extensions from their hacked gdb
+ header files (ftp://ftp.hp.com/pub/lang/tools/WDB/wdb-4.0.tar.gz).
+
+2003-09-04 Nick Clifton <nickc@redhat.com>
+
+ * v850.h (E_V850E1_ARCH): Define.
+
+2003-08-21 James Cownie <jcownie@etnus.com>
+
+ * dwarf2.h: Add PGI dwarf extensions.
+
+2003-08-08 Dmitry Diky <diwil@mail.ru>
+
+ * msp430.h: Add xW42 and xE42 parts. Sort MPU list according to
+ gcc order.
+
+2003-08-07 Alan Modra <amodra@bigpond.net.au>
+
+ * reloc-macros.h (START_RELOC_NUMBERS) : Remove PARAMS macro. Use
+ C90 function definition. Formatting.
+ (RELOC_NUMBER): Remove !__STDC__ code.
+
2003-07-28 Eric Christopher <echristo@redhat.com>
* ppc.h (R_PPC_RELAX32): New. Fake relocation.
@@ -38,10 +62,6 @@
* mmix.h: Convert to ISO C90 prototypes.
* mips.h: Likewise.
- * reloc-macros.h (START_RELOC_NUMBERS): Convert to ISO C90
- prototype.
- (RELOC_NUMBER): Remove !__STDC__ code.
-
2003-06-13 Robert Millan <zeratul2@wanadoo.es>
* common.h (GNU_ABI_TAG_NETBSD): New tag.
diff --git a/include/elf/dwarf2.h b/include/elf/dwarf2.h
index 9c8ce4e0063..bede7e297a3 100644
--- a/include/elf/dwarf2.h
+++ b/include/elf/dwarf2.h
@@ -1,7 +1,7 @@
/* Declarations and definitions of codes relating to the DWARF2 symbolic
debugging information format.
- Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
+ 2003 Free Software Foundation, Inc.
Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
Office (AJPO), Florida State Unviversity and Silicon Graphics Inc.
@@ -189,6 +189,8 @@ enum dwarf_tag
DW_TAG_imported_unit = 0x3d,
/* SGI/MIPS Extensions. */
DW_TAG_MIPS_loop = 0x4081,
+ /* HP extensions. See: ftp://ftp.hp.com/pub/lang/tools/WDB/wdb-4.0.tar.gz . */
+ DW_TAG_HP_array_descriptor = 0x4090,
/* GNU extensions. */
DW_TAG_format_label = 0x4101, /* For FORTRAN 77 and Fortran 90. */
DW_TAG_function_template = 0x4102, /* For C++. */
@@ -198,7 +200,10 @@ enum dwarf_tag
/* Extensions for UPC. See: http://upc.gwu.edu/~upc. */
DW_TAG_upc_shared_type = 0x8765,
DW_TAG_upc_strict_type = 0x8766,
- DW_TAG_upc_relaxed_type = 0x8767
+ DW_TAG_upc_relaxed_type = 0x8767,
+ /* PGI (STMicroelectronics) extensions. No documentation available. */
+ DW_TAG_PGI_kanji_type = 0xA000,
+ DW_TAG_PGI_interface_block = 0xA020
};
#define DW_TAG_lo_user 0x4080
@@ -235,7 +240,6 @@ enum dwarf_form
};
/* Attribute names and codes. */
-
enum dwarf_attribute
{
DW_AT_sibling = 0x01,
@@ -325,6 +329,21 @@ enum dwarf_attribute
DW_AT_MIPS_abstract_name = 0x2009,
DW_AT_MIPS_clone_origin = 0x200a,
DW_AT_MIPS_has_inlines = 0x200b,
+ /* HP extensions. */
+ DW_AT_HP_block_index = 0x2000,
+ DW_AT_HP_unmodifiable = 0x2001, /* Same as DW_AT_MIPS_fde. */
+ DW_AT_HP_actuals_stmt_list = 0x2010,
+ DW_AT_HP_proc_per_section = 0x2011,
+ DW_AT_HP_raw_data_ptr = 0x2012,
+ DW_AT_HP_pass_by_reference = 0x2013,
+ DW_AT_HP_opt_level = 0x2014,
+ DW_AT_HP_prof_version_id = 0x2015,
+ DW_AT_HP_opt_flags = 0x2016,
+ DW_AT_HP_cold_region_low_pc = 0x2017,
+ DW_AT_HP_cold_region_high_pc = 0x2018,
+ DW_AT_HP_all_variables_modifiable = 0x2019,
+ DW_AT_HP_linkage_name = 0x201a,
+ DW_AT_HP_prof_flags = 0x201b, /* In comp unit of procs_info for -g. */
/* GNU extensions. */
DW_AT_sf_names = 0x2101,
DW_AT_src_info = 0x2102,
@@ -336,7 +355,11 @@ enum dwarf_attribute
/* VMS extensions. */
DW_AT_VMS_rtnbeg_pd_address = 0x2201,
/* UPC extension. */
- DW_AT_upc_threads_scaled = 0x3210
+ DW_AT_upc_threads_scaled = 0x3210,
+ /* PGI (STMicroelectronics) extensions. */
+ DW_AT_PGI_lbase = 0x3a00,
+ DW_AT_PGI_soffset = 0x3a01,
+ DW_AT_PGI_lstride = 0x3a02
};
#define DW_AT_lo_user 0x2000 /* Implementation-defined range start. */
@@ -496,7 +519,15 @@ enum dwarf_location_atom
DW_OP_call4 = 0x99,
DW_OP_call_ref = 0x9a,
/* GNU extensions. */
- DW_OP_GNU_push_tls_address = 0xe0
+ DW_OP_GNU_push_tls_address = 0xe0,
+ /* HP extensions. */
+ DW_OP_HP_unknown = 0xe0, /* Ouch, the same as GNU_push_tls_address. */
+ DW_OP_HP_is_value = 0xe1,
+ DW_OP_HP_fltconst4 = 0xe2,
+ DW_OP_HP_fltconst8 = 0xe3,
+ DW_OP_HP_mod_range = 0xe4,
+ DW_OP_HP_unmod_range = 0xe5,
+ DW_OP_HP_tls = 0xe6
};
#define DW_OP_lo_user 0xe0 /* Implementation-defined range start. */
@@ -515,7 +546,15 @@ enum dwarf_type
DW_ATE_unsigned = 0x7,
DW_ATE_unsigned_char = 0x8,
/* DWARF 3. */
- DW_ATE_imaginary_float = 0x9
+ DW_ATE_imaginary_float = 0x9,
+ /* HP extensions. */
+ DW_ATE_HP_float80 = 0x80, /* Floating-point (80 bit). */
+ DW_ATE_HP_complex_float80 = 0x81, /* Complex floating-point (80 bit). */
+ DW_ATE_HP_float128 = 0x82, /* Floating-point (128 bit). */
+ DW_ATE_HP_complex_float128 = 0x83, /* Complex floating-point (128 bit). */
+ DW_ATE_HP_floathpintel = 0x84, /* Floating-point (82 bit IA64). */
+ DW_ATE_HP_imaginary_float80 = 0x85,
+ DW_ATE_HP_imaginary_float128 = 0x86
};
#define DW_ATE_lo_user 0x80
@@ -612,7 +651,18 @@ enum dwarf_line_number_x_ops
{
DW_LNE_end_sequence = 1,
DW_LNE_set_address = 2,
- DW_LNE_define_file = 3
+ DW_LNE_define_file = 3,
+ /* HP extensions. */
+ DW_LNE_HP_negate_is_UV_update = 0x11,
+ DW_LNE_HP_push_context = 0x12,
+ DW_LNE_HP_pop_context = 0x13,
+ DW_LNE_HP_set_file_line_column = 0x14,
+ DW_LNE_HP_set_routine_name = 0x15,
+ DW_LNE_HP_set_sequence = 0x16,
+ DW_LNE_HP_negate_post_semantics = 0x17,
+ DW_LNE_HP_negate_function_exit = 0x18,
+ DW_LNE_HP_negate_front_end_logical = 0x19,
+ DW_LNE_HP_define_proc = 0x20
};
/* Call frame information. */
@@ -636,17 +686,14 @@ enum dwarf_call_frame_info
DW_CFA_def_cfa = 0x0c,
DW_CFA_def_cfa_register = 0x0d,
DW_CFA_def_cfa_offset = 0x0e,
-
/* DWARF 3. */
DW_CFA_def_cfa_expression = 0x0f,
DW_CFA_expression = 0x10,
DW_CFA_offset_extended_sf = 0x11,
DW_CFA_def_cfa_sf = 0x12,
DW_CFA_def_cfa_offset_sf = 0x13,
-
/* SGI/MIPS specific. */
DW_CFA_MIPS_advance_loc8 = 0x1d,
-
/* GNU extensions. */
DW_CFA_GNU_window_save = 0x2d,
DW_CFA_GNU_args_size = 0x2e,
diff --git a/include/elf/msp430.h b/include/elf/msp430.h
index cb3f241dea1..912ded7685d 100644
--- a/include/elf/msp430.h
+++ b/include/elf/msp430.h
@@ -26,19 +26,20 @@
/* Processor specific flags for the ELF header e_flags field. */
#define EF_MSP430_MACH 0xff
-#define E_MSP430_MACH_MSP430x11x1 110
#define E_MSP430_MACH_MSP430x11 11
+#define E_MSP430_MACH_MSP430x11x1 110
#define E_MSP430_MACH_MSP430x12 12
#define E_MSP430_MACH_MSP430x13 13
#define E_MSP430_MACH_MSP430x14 14
+#define E_MSP430_MACH_MSP430x15 15
+#define E_MSP430_MACH_MSP430x16 16
#define E_MSP430_MACH_MSP430x31 31
#define E_MSP430_MACH_MSP430x32 32
#define E_MSP430_MACH_MSP430x33 33
#define E_MSP430_MACH_MSP430x41 41
+#define E_MSP430_MACH_MSP430x42 42
#define E_MSP430_MACH_MSP430x43 43
#define E_MSP430_MACH_MSP430x44 44
-#define E_MSP430_MACH_MSP430x15 15
-#define E_MSP430_MACH_MSP430x16 16
/* Relocations. */
START_RELOC_NUMBERS (elf_msp430_reloc_type)
diff --git a/include/elf/reloc-macros.h b/include/elf/reloc-macros.h
index 9ad346c9f3d..4a3a60f7ef5 100644
--- a/include/elf/reloc-macros.h
+++ b/include/elf/reloc-macros.h
@@ -1,5 +1,5 @@
/* Generic relocation support for BFD.
- Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -46,10 +46,9 @@
If RELOC_MACROS_GEN_FUNC *is* defined, then instead the
following function will be generated:
- static const char * foo PARAMS ((unsigned long rtype));
+ static const char *foo (unsigned long rtype);
static const char *
- foo (rtype)
- unsigned long rtype;
+ foo (unsigned long rtype)
{
switch (rtype)
{
@@ -70,26 +69,22 @@
the relocation is not recognised, NULL is returned. */
#define START_RELOC_NUMBERS(name) \
-static const char * name PARAMS ((unsigned long rtype)); \
+static const char *name (unsigned long rtype); \
static const char * \
-name (rtype) \
- unsigned long rtype; \
+name (unsigned long rtype) \
{ \
switch (rtype) \
- {
+ {
-#if defined (__STDC__) || defined (ALMOST_STDC)
-#define RELOC_NUMBER(name, number) case number : return #name ;
-#else
-#define RELOC_NUMBER(name, number) case number : return "name" ;
-#endif
+#define RELOC_NUMBER(name, number) \
+ case number: return #name;
#define FAKE_RELOC(name, number)
#define EMPTY_RELOC(name)
#define END_RELOC_NUMBERS(name) \
default: return NULL; \
- } \
+ } \
}
diff --git a/include/elf/v850.h b/include/elf/v850.h
index db5b2d9fd1a..7d5110b3342 100644
--- a/include/elf/v850.h
+++ b/include/elf/v850.h
@@ -1,5 +1,5 @@
/* V850 ELF support for BFD.
- Copyright 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
Created by Michael Meissner, Cygnus Support <meissner@cygnus.com>
This file is part of BFD, the Binary File Descriptor library.
@@ -35,6 +35,9 @@
/* v850e code. */
#define E_V850E_ARCH 0x10000000
+/* v850e1 code. */
+#define E_V850E1_ARCH 0x20000000
+
/* Flags for the st_other field. */
#define V850_OTHER_SDA 0x01 /* Symbol had SDA relocations. */
diff --git a/include/floatformat.h b/include/floatformat.h
index 53ead3eee61..3d0fd7a87ad 100644
--- a/include/floatformat.h
+++ b/include/floatformat.h
@@ -1,5 +1,5 @@
/* IEEE floating point support declarations, for GDB, the GNU Debugger.
- Copyright 1991, 1994, 1995, 1997, 2000 Free Software Foundation, Inc.
+ Copyright 1991, 1994, 1995, 1997, 2000, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -61,8 +61,12 @@ struct floatformat
unsigned int exp_start;
unsigned int exp_len;
- /* Amount added to "true" exponent. 0x3fff for many IEEE extendeds. */
- unsigned int exp_bias;
+ /* Bias added to a "true" exponent to form the biased exponent. It
+ is intentionally signed as, otherwize, -exp_bias can turn into a
+ very large number (e.g., given the exp_bias of 0x3fff and a 64
+ bit long, the equation (long)(1 - exp_bias) evaluates to
+ 4294950914) instead of -16382). */
+ int exp_bias;
/* Exponent value which indicates NaN. This is the actual value stored in
the float, not adjusted by the exp_bias. This usually consists of all
one bits. */
@@ -109,13 +113,18 @@ extern const struct floatformat floatformat_ia64_quad_little;
Store the double in *TO. */
extern void
-floatformat_to_double PARAMS ((const struct floatformat *, char *, double *));
+floatformat_to_double PARAMS ((const struct floatformat *, const char *, double *));
/* The converse: convert the double *FROM to FMT
and store where TO points. */
extern void
floatformat_from_double PARAMS ((const struct floatformat *,
- double *, char *));
+ const double *, char *));
+
+/* Return non-zero iff the data at FROM is a valid number in format FMT. */
+
+extern int
+floatformat_is_valid PARAMS ((const struct floatformat *fmt, const char *from));
#endif /* defined (FLOATFORMAT_H) */
diff --git a/include/nlm/ChangeLog b/include/nlm/ChangeLog
index 979b1621257..b3c9529b806 100644
--- a/include/nlm/ChangeLog
+++ b/include/nlm/ChangeLog
@@ -1,3 +1,7 @@
+2003-08-07 Alan Modra <amodra@bigpond.net.au>
+
+ * internal.h (Nlm_Internal_Custom_Header): Replace PTR with void *.
+
2001-10-02 Alan Modra <amodra@bigpond.net.au>
* common.h (NLM_CAT, NLM_CAT3): Don't define.
diff --git a/include/nlm/internal.h b/include/nlm/internal.h
index cae93f80b2c..f61c42db8e7 100644
--- a/include/nlm/internal.h
+++ b/include/nlm/internal.h
@@ -1,5 +1,5 @@
/* NLM (NetWare Loadable Module) support for BFD.
- Copyright 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 2003 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support.
@@ -282,7 +282,7 @@ typedef struct nlm_internal_custom_header
file_ptr dataOffset;
bfd_size_type dataLength;
char dataStamp[8];
- PTR hdr;
+ void *hdr;
} Nlm_Internal_Custom_Header;
#define nlm32_internal_custom_header nlm_internal_custom_header
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index 5b2706091a3..aaea21428e2 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,42 @@
+2003-09-04 Nick Clifton <nickc@redhat.com>
+
+ * v850.h (PROCESSOR_V850E1): Define.
+
+2003-08-19 Alan Modra <amodra@bigpond.net.au>
+
+ * ppc.h (PPC_OPCODE_440): Define. Formatting. Use hex for other
+ PPC_OPCODE_* defines.
+
+2003-08-16 Jason Eckhardt <jle@rice.edu>
+
+ * i860.h (fmov.ds): Expand as famov.ds.
+ (fmov.sd): Expand as famov.sd.
+ (pfmov.ds): Expand as pfamov.ds.
+
+2003-08-07 Michael Meissner <gnu@the-meissners.org>
+
+ * cgen.h: Remove PARAM macro usage in all prototypes.
+ (CGEN_EXTRACT_INFO): Use void * instead of PTR.
+ (cgen_print_fn): Ditto.
+ (CGEN_HW_ENTRY): Ditto.
+ (CGEN_MAYBE_MULTI_IFLD): Ditto.
+ (struct cgen_insn): Ditto.
+ (CGEN_CPU_TABLE): Ditto.
+
+2003-08-07 Alan Modra <amodra@bigpond.net.au>
+
+ * alpha.h: Remove PARAMS macro.
+ * arc.h: Likewise.
+ * d10v.h: Likewise.
+ * d30v.h: Likewise.
+ * i370.h: Likewise.
+ * or32.h: Likewise.
+ * pj.h: Likewise.
+ * ppc.h: Likewise.
+ * sparc.h: Likewise.
+ * tic80.h: Likewise.
+ * v850.h: Likewise.
+
2003-07-18 Michael Snyder <msnyder@redhat.com>
* include/opcode/h8sx.h (DO_MOVA1, DO_MOVA2): Reformatting.
diff --git a/include/opcode/alpha.h b/include/opcode/alpha.h
index 487b69605a3..efe16260ea4 100644
--- a/include/opcode/alpha.h
+++ b/include/opcode/alpha.h
@@ -1,5 +1,5 @@
/* alpha.h -- Header file for Alpha opcode table
- Copyright 1996, 1999 Free Software Foundation, Inc.
+ Copyright 1996, 1999, 2001, 2003 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@tamu.edu>,
patterned after the PPC opcode table written by Ian Lance Taylor.
@@ -108,8 +108,7 @@ struct alpha_operand
string (the operand will be inserted in any case). If the
operand value is legal, *ERRMSG will be unchanged (most operands
can accept any value). */
- unsigned (*insert) PARAMS ((unsigned instruction, int op,
- const char **errmsg));
+ unsigned (*insert) (unsigned instruction, int op, const char **errmsg);
/* Extraction function. This is used by the disassembler. To
extract this operand type from an instruction, check this field.
@@ -128,7 +127,7 @@ struct alpha_operand
non-zero if this operand type can not actually be extracted from
this operand (i.e., the instruction does not match). If the
operand is valid, *INVALID will not be changed. */
- int (*extract) PARAMS ((unsigned instruction, int *invalid));
+ int (*extract) (unsigned instruction, int *invalid);
};
/* Elements in the table are retrieved by indexing with values from
diff --git a/include/opcode/arc.h b/include/opcode/arc.h
index 3da68ec80f3..629979d54a7 100644
--- a/include/opcode/arc.h
+++ b/include/opcode/arc.h
@@ -1,5 +1,6 @@
/* Opcode table for the ARC.
- Copyright 1994, 1995, 1997, 2001 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1997, 2001, 2002, 2003
+ Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com).
This file is part of GAS, the GNU Assembler, GDB, the GNU debugger, and
@@ -17,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with GAS or GDB; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA. */
/* List of the various cpu types.
@@ -226,10 +228,9 @@ struct arc_operand {
REG is non-NULL when inserting a register value. */
- arc_insn (*insert) PARAMS ((arc_insn insn,
- const struct arc_operand *operand, int mods,
- const struct arc_operand_value *reg, long value,
- const char **errmsg));
+ arc_insn (*insert)
+ (arc_insn insn, const struct arc_operand *operand, int mods,
+ const struct arc_operand_value *reg, long value, const char **errmsg);
/* Extraction function. This is used by the disassembler. To
extract this operand type from an instruction, check this field.
@@ -255,10 +256,9 @@ struct arc_operand {
Operands that have a printable form like registers and suffixes have
their struct arc_operand_value pointer stored in OPVAL. */
- long (*extract) PARAMS ((arc_insn *insn,
- const struct arc_operand *operand,
- int mods, const struct arc_operand_value **opval,
- int *invalid));
+ long (*extract)
+ (arc_insn *insn, const struct arc_operand *operand, int mods,
+ const struct arc_operand_value **opval, int *invalid);
};
/* Bits that say what version of cpu we have. These should be passed to
@@ -302,22 +302,22 @@ extern const int arc_reg_names_count;
extern unsigned char arc_operand_map[];
/* Utility fns in arc-opc.c. */
-int arc_get_opcode_mach PARAMS ((int, int));
+int arc_get_opcode_mach (int, int);
/* `arc_opcode_init_tables' must be called before `arc_xxx_supported'. */
-void arc_opcode_init_tables PARAMS ((int));
-void arc_opcode_init_insert PARAMS ((void));
-void arc_opcode_init_extract PARAMS ((void));
-const struct arc_opcode *arc_opcode_lookup_asm PARAMS ((const char *));
-const struct arc_opcode *arc_opcode_lookup_dis PARAMS ((unsigned int));
-int arc_opcode_limm_p PARAMS ((long *));
+void arc_opcode_init_tables (int);
+void arc_opcode_init_insert (void);
+void arc_opcode_init_extract (void);
+const struct arc_opcode *arc_opcode_lookup_asm (const char *);
+const struct arc_opcode *arc_opcode_lookup_dis (unsigned int);
+int arc_opcode_limm_p (long *);
const struct arc_operand_value *arc_opcode_lookup_suffix
- PARAMS ((const struct arc_operand *type, int value));
-int arc_opcode_supported PARAMS ((const struct arc_opcode *));
-int arc_opval_supported PARAMS ((const struct arc_operand_value *));
-int arc_limm_fixup_adjust PARAMS ((arc_insn));
-int arc_insn_is_j PARAMS ((arc_insn));
-int arc_insn_not_jl PARAMS ((arc_insn));
-int arc_operand_type PARAMS ((int));
-struct arc_operand_value *get_ext_suffix PARAMS ((char *));
-int arc_get_noshortcut_flag PARAMS ((void));
+ (const struct arc_operand *type, int value);
+int arc_opcode_supported (const struct arc_opcode *);
+int arc_opval_supported (const struct arc_operand_value *);
+int arc_limm_fixup_adjust (arc_insn);
+int arc_insn_is_j (arc_insn);
+int arc_insn_not_jl (arc_insn);
+int arc_operand_type (int);
+struct arc_operand_value *get_ext_suffix (char *);
+int arc_get_noshortcut_flag (void);
diff --git a/include/opcode/cgen.h b/include/opcode/cgen.h
index 76a0af47b5d..16366fd0d75 100644
--- a/include/opcode/cgen.h
+++ b/include/opcode/cgen.h
@@ -242,9 +242,9 @@ typedef struct cgen_fields CGEN_FIELDS;
typedef struct {
/* A pointer to the disassemble_info struct.
- We don't require dis-asm.h so we use PTR for the type here.
+ We don't require dis-asm.h so we use void * for the type here.
If NULL, BYTES is full of valid data (VALID == -1). */
- PTR dis_info;
+ void *dis_info;
/* Points to a working buffer of sufficient size. */
unsigned char *insn_bytes;
/* Mask of bytes that are valid in INSN_BYTES. */
@@ -265,8 +265,8 @@ typedef struct {
If not it is left alone.
The result is NULL if success or an error message. */
typedef const char * (cgen_parse_fn)
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
- const char **strp_, CGEN_FIELDS *fields_));
+ (CGEN_CPU_DESC, const CGEN_INSN *insn_,
+ const char **strp_, CGEN_FIELDS *fields_);
/* Insert handler.
CD is a cpu table descriptor.
@@ -279,9 +279,9 @@ typedef const char * (cgen_parse_fn)
#ifdef __BFD_H_SEEN__
typedef const char * (cgen_insert_fn)
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
- CGEN_FIELDS *fields_, CGEN_INSN_BYTES_PTR insnp_,
- bfd_vma pc_));
+ (CGEN_CPU_DESC, const CGEN_INSN *insn_,
+ CGEN_FIELDS *fields_, CGEN_INSN_BYTES_PTR insnp_,
+ bfd_vma pc_);
#else
typedef const char * (cgen_insert_fn) ();
#endif
@@ -300,9 +300,9 @@ typedef const char * (cgen_insert_fn) ();
#ifdef __BFD_H_SEEN__
typedef int (cgen_extract_fn)
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
- CGEN_EXTRACT_INFO *ex_info_, CGEN_INSN_INT base_insn_,
- CGEN_FIELDS *fields_, bfd_vma pc_));
+ (CGEN_CPU_DESC, const CGEN_INSN *insn_,
+ CGEN_EXTRACT_INFO *ex_info_, CGEN_INSN_INT base_insn_,
+ CGEN_FIELDS *fields_, bfd_vma pc_);
#else
typedef int (cgen_extract_fn) ();
#endif
@@ -319,8 +319,8 @@ typedef int (cgen_extract_fn) ();
#ifdef __BFD_H_SEEN__
typedef void (cgen_print_fn)
- PARAMS ((CGEN_CPU_DESC, PTR info_, const CGEN_INSN *insn_,
- CGEN_FIELDS *fields_, bfd_vma pc_, int len_));
+ (CGEN_CPU_DESC, void * info_, const CGEN_INSN *insn_,
+ CGEN_FIELDS *fields_, bfd_vma pc_, int len_);
#else
typedef void (cgen_print_fn) ();
#endif
@@ -384,9 +384,9 @@ enum cgen_parse_operand_result
#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily. */
typedef const char * (cgen_parse_operand_fn)
- PARAMS ((CGEN_CPU_DESC,
- enum cgen_parse_operand_type, const char **, int, int,
- enum cgen_parse_operand_result *, bfd_vma *));
+ (CGEN_CPU_DESC,
+ enum cgen_parse_operand_type, const char **, int, int,
+ enum cgen_parse_operand_result *, bfd_vma *);
#else
typedef const char * (cgen_parse_operand_fn) ();
#endif
@@ -394,11 +394,11 @@ typedef const char * (cgen_parse_operand_fn) ();
/* Set the cgen_parse_operand_fn callback. */
extern void cgen_set_parse_operand_fn
- PARAMS ((CGEN_CPU_DESC, cgen_parse_operand_fn));
+ (CGEN_CPU_DESC, cgen_parse_operand_fn);
/* Called before trying to match a table entry with the insn. */
-extern void cgen_init_parse_operand PARAMS ((CGEN_CPU_DESC));
+extern void cgen_init_parse_operand (CGEN_CPU_DESC);
/* Operand values (keywords, integers, symbols, etc.) */
@@ -422,7 +422,7 @@ typedef struct
/* There is currently no example where both index specs and value specs
are required, so for now both are clumped under "asm_data". */
enum cgen_asm_type asm_type;
- PTR asm_data;
+ void *asm_data;
#ifndef CGEN_HW_NBOOL_ATTRS
#define CGEN_HW_NBOOL_ATTRS 1
#endif
@@ -453,9 +453,9 @@ typedef struct {
} CGEN_HW_TABLE;
extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_name
- PARAMS ((CGEN_CPU_DESC, const char *));
+ (CGEN_CPU_DESC, const char *);
extern const CGEN_HW_ENTRY * cgen_hw_lookup_by_num
- PARAMS ((CGEN_CPU_DESC, unsigned int));
+ (CGEN_CPU_DESC, unsigned int);
/* This struct is used to describe things like register names, etc. */
@@ -543,41 +543,41 @@ typedef struct
/* Lookup a keyword from its name. */
const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_name
- PARAMS ((CGEN_KEYWORD *, const char *));
+ (CGEN_KEYWORD *, const char *);
/* Lookup a keyword from its value. */
const CGEN_KEYWORD_ENTRY *cgen_keyword_lookup_value
- PARAMS ((CGEN_KEYWORD *, int));
+ (CGEN_KEYWORD *, int);
/* Add a keyword. */
-void cgen_keyword_add PARAMS ((CGEN_KEYWORD *, CGEN_KEYWORD_ENTRY *));
+void cgen_keyword_add (CGEN_KEYWORD *, CGEN_KEYWORD_ENTRY *);
/* Keyword searching.
This can be used to retrieve every keyword, or a subset. */
CGEN_KEYWORD_SEARCH cgen_keyword_search_init
- PARAMS ((CGEN_KEYWORD *, const char *));
+ (CGEN_KEYWORD *, const char *);
const CGEN_KEYWORD_ENTRY *cgen_keyword_search_next
- PARAMS ((CGEN_KEYWORD_SEARCH *));
+ (CGEN_KEYWORD_SEARCH *);
/* Operand value support routines. */
extern const char *cgen_parse_keyword
- PARAMS ((CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *));
+ (CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *);
#ifdef __BFD_H_SEEN__ /* Don't require bfd.h unnecessarily. */
extern const char *cgen_parse_signed_integer
- PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
+ (CGEN_CPU_DESC, const char **, int, long *);
extern const char *cgen_parse_unsigned_integer
- PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *));
+ (CGEN_CPU_DESC, const char **, int, unsigned long *);
extern const char *cgen_parse_address
- PARAMS ((CGEN_CPU_DESC, const char **, int, int,
- enum cgen_parse_operand_result *, bfd_vma *));
+ (CGEN_CPU_DESC, const char **, int, int,
+ enum cgen_parse_operand_result *, bfd_vma *);
extern const char *cgen_validate_signed_integer
- PARAMS ((long, long, long));
+ (long, long, long);
extern const char *cgen_validate_unsigned_integer
- PARAMS ((unsigned long, unsigned long, unsigned long));
+ (unsigned long, unsigned long, unsigned long);
#endif
/* Operand modes. */
@@ -621,7 +621,7 @@ typedef struct cgen_maybe_multi_ifield
n: indexed by array of more cgen_maybe_multi_ifields. */
union
{
- const PTR p;
+ const void *p;
const struct cgen_maybe_multi_ifield * multi;
const struct cgen_ifld * leaf;
} val;
@@ -705,9 +705,9 @@ typedef struct {
} CGEN_OPERAND_TABLE;
extern const CGEN_OPERAND * cgen_operand_lookup_by_name
- PARAMS ((CGEN_CPU_DESC, const char *));
+ (CGEN_CPU_DESC, const char *);
extern const CGEN_OPERAND * cgen_operand_lookup_by_num
- PARAMS ((CGEN_CPU_DESC, int));
+ (CGEN_CPU_DESC, int);
/* Instruction operand instances.
@@ -1061,8 +1061,8 @@ typedef struct
/* Return number of instructions. This includes any added at run-time. */
-extern int cgen_insn_count PARAMS ((CGEN_CPU_DESC));
-extern int cgen_macro_insn_count PARAMS ((CGEN_CPU_DESC));
+extern int cgen_insn_count (CGEN_CPU_DESC);
+extern int cgen_macro_insn_count (CGEN_CPU_DESC);
/* Macros to access the other insn elements not recorded in CGEN_IBASE. */
@@ -1126,9 +1126,10 @@ typedef struct cgen_minsn_expansion {
If the expansion fails (e.g. "no match") NULL is returned.
Space for the expansion is obtained with malloc.
It is up to the caller to free it. */
- const char * (* fn) PARAMS ((const struct cgen_minsn_expansion *,
- const char *, const char **, int *,
- CGEN_OPERAND **));
+ const char * (* fn)
+ (const struct cgen_minsn_expansion *,
+ const char *, const char **, int *,
+ CGEN_OPERAND **);
#define CGEN_MIEXPN_FN(ex) ((ex)->fn)
/* Instruction(s) the macro expands to.
@@ -1146,15 +1147,15 @@ typedef struct cgen_minsn_expansion {
may contain further macro invocations. */
extern const char * cgen_expand_macro_insn
- PARAMS ((CGEN_CPU_DESC, const struct cgen_minsn_expansion *,
- const char *, const char **, int *, CGEN_OPERAND **));
+ (CGEN_CPU_DESC, const struct cgen_minsn_expansion *,
+ const char *, const char **, int *, CGEN_OPERAND **);
/* The assembler insn table is hashed based on some function of the mnemonic
(the actually hashing done is up to the target, but we provide a few
examples like the first letter or a function of the entire mnemonic). */
extern CGEN_INSN_LIST * cgen_asm_lookup_insn
- PARAMS ((CGEN_CPU_DESC, const char *));
+ (CGEN_CPU_DESC, const char *);
#define CGEN_ASM_LOOKUP_INSN(cd, string) cgen_asm_lookup_insn ((cd), (string))
#define CGEN_ASM_NEXT_INSN(insn) ((insn)->next)
@@ -1162,7 +1163,7 @@ extern CGEN_INSN_LIST * cgen_asm_lookup_insn
instruction (the actually hashing done is up to the target). */
extern CGEN_INSN_LIST * cgen_dis_lookup_insn
- PARAMS ((CGEN_CPU_DESC, const char *, CGEN_INSN_INT));
+ (CGEN_CPU_DESC, const char *, CGEN_INSN_INT);
/* FIXME: delete these two */
#define CGEN_DIS_LOOKUP_INSN(cd, buf, value) cgen_dis_lookup_insn ((cd), (buf), (value))
#define CGEN_DIS_NEXT_INSN(insn) ((insn)->next)
@@ -1246,25 +1247,24 @@ typedef struct cgen_cpu_desc
int int_insn_p;
/* Called to rebuild the tables after something has changed. */
- void (*rebuild_tables) PARAMS ((CGEN_CPU_DESC));
+ void (*rebuild_tables) (CGEN_CPU_DESC);
/* Operand parser callback. */
cgen_parse_operand_fn * parse_operand_fn;
/* Parse/insert/extract/print cover fns for operands. */
const char * (*parse_operand)
- PARAMS ((CGEN_CPU_DESC, int opindex_, const char **,
- CGEN_FIELDS *fields_));
+ (CGEN_CPU_DESC, int opindex_, const char **, CGEN_FIELDS *fields_);
#ifdef __BFD_H_SEEN__
const char * (*insert_operand)
- PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_,
- CGEN_INSN_BYTES_PTR, bfd_vma pc_));
+ (CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_,
+ CGEN_INSN_BYTES_PTR, bfd_vma pc_);
int (*extract_operand)
- PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
- CGEN_FIELDS *fields_, bfd_vma pc_));
+ (CGEN_CPU_DESC, int opindex_, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
+ CGEN_FIELDS *fields_, bfd_vma pc_);
void (*print_operand)
- PARAMS ((CGEN_CPU_DESC, int opindex_, PTR info_, CGEN_FIELDS * fields_,
- void const *attrs_, bfd_vma pc_, int length_));
+ (CGEN_CPU_DESC, int opindex_, void * info_, CGEN_FIELDS * fields_,
+ void const *attrs_, bfd_vma pc_, int length_);
#else
const char * (*insert_operand) ();
int (*extract_operand) ();
@@ -1280,19 +1280,19 @@ typedef struct cgen_cpu_desc
#define CGEN_CPU_SIZEOF_FIELDS(cd) ((cd)->sizeof_fields)
/* Set the bitsize field. */
- void (*set_fields_bitsize) PARAMS ((CGEN_FIELDS *fields_, int size_));
+ void (*set_fields_bitsize) (CGEN_FIELDS *fields_, int size_);
#define CGEN_CPU_SET_FIELDS_BITSIZE(cd) ((cd)->set_fields_bitsize)
/* CGEN_FIELDS accessors. */
int (*get_int_operand)
- PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_));
+ (CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_);
void (*set_int_operand)
- PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, int value_));
+ (CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, int value_);
#ifdef __BFD_H_SEEN__
bfd_vma (*get_vma_operand)
- PARAMS ((CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_));
+ (CGEN_CPU_DESC, int opindex_, const CGEN_FIELDS *fields_);
void (*set_vma_operand)
- PARAMS ((CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, bfd_vma value_));
+ (CGEN_CPU_DESC, int opindex_, CGEN_FIELDS *fields_, bfd_vma value_);
#else
long (*get_vma_operand) ();
void (*set_vma_operand) ();
@@ -1314,19 +1314,19 @@ typedef struct cgen_cpu_desc
#define CGEN_PRINT_FN(cd, insn) (cd->print_handlers[(insn)->opcode->handlers.print])
/* Return non-zero if insn should be added to hash table. */
- int (* asm_hash_p) PARAMS ((const CGEN_INSN *));
+ int (* asm_hash_p) (const CGEN_INSN *);
/* Assembler hash function. */
- unsigned int (* asm_hash) PARAMS ((const char *));
+ unsigned int (* asm_hash) (const char *);
/* Number of entries in assembler hash table. */
unsigned int asm_hash_size;
/* Return non-zero if insn should be added to hash table. */
- int (* dis_hash_p) PARAMS ((const CGEN_INSN *));
+ int (* dis_hash_p) (const CGEN_INSN *);
/* Disassembler hash function. */
- unsigned int (* dis_hash) PARAMS ((const char *, CGEN_INSN_INT));
+ unsigned int (* dis_hash) (const char *, CGEN_INSN_INT);
/* Number of entries in disassembler hash table. */
unsigned int dis_hash_size;
@@ -1381,81 +1381,80 @@ extern CGEN_CPU_DESC CGEN_SYM (cpu_open) (enum cgen_cpu_open_arg, ...);
/* Cover fn to handle simple case. */
-extern CGEN_CPU_DESC CGEN_SYM (cpu_open_1) PARAMS ((const char *mach_name_,
- enum cgen_endian endian_));
+extern CGEN_CPU_DESC CGEN_SYM (cpu_open_1)
+ (const char *mach_name_, enum cgen_endian endian_);
/* Close it. */
-extern void CGEN_SYM (cpu_close) PARAMS ((CGEN_CPU_DESC));
+extern void CGEN_SYM (cpu_close) (CGEN_CPU_DESC);
/* Initialize the opcode table for use.
Called by init_asm/init_dis. */
-extern void CGEN_SYM (init_opcode_table) PARAMS ((CGEN_CPU_DESC cd_));
+extern void CGEN_SYM (init_opcode_table) (CGEN_CPU_DESC cd_);
/* build the insn selection regex.
called by init_opcode_table */
-extern char * CGEN_SYM(build_insn_regex) PARAMS ((CGEN_INSN *insn_));
+extern char * CGEN_SYM(build_insn_regex) (CGEN_INSN *insn_);
/* Initialize the ibld table for use.
Called by init_asm/init_dis. */
-extern void CGEN_SYM (init_ibld_table) PARAMS ((CGEN_CPU_DESC cd_));
+extern void CGEN_SYM (init_ibld_table) (CGEN_CPU_DESC cd_);
/* Initialize an cpu table for assembler or disassembler use.
These must be called immediately after cpu_open. */
-extern void CGEN_SYM (init_asm) PARAMS ((CGEN_CPU_DESC));
-extern void CGEN_SYM (init_dis) PARAMS ((CGEN_CPU_DESC));
+extern void CGEN_SYM (init_asm) (CGEN_CPU_DESC);
+extern void CGEN_SYM (init_dis) (CGEN_CPU_DESC);
/* Initialize the operand instance table for use. */
-extern void CGEN_SYM (init_opinst_table) PARAMS ((CGEN_CPU_DESC cd_));
+extern void CGEN_SYM (init_opinst_table) (CGEN_CPU_DESC cd_);
/* Assemble an instruction. */
extern const CGEN_INSN * CGEN_SYM (assemble_insn)
- PARAMS ((CGEN_CPU_DESC, const char *, CGEN_FIELDS *,
- CGEN_INSN_BYTES_PTR, char **));
+ (CGEN_CPU_DESC, const char *, CGEN_FIELDS *,
+ CGEN_INSN_BYTES_PTR, char **);
extern const CGEN_KEYWORD CGEN_SYM (operand_mach);
-extern int CGEN_SYM (get_mach) PARAMS ((const char *));
+extern int CGEN_SYM (get_mach) (const char *);
/* Operand index computation. */
extern const CGEN_INSN * cgen_lookup_insn
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN * insn_,
- CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
- int length_, CGEN_FIELDS *fields_, int alias_p_));
+ (CGEN_CPU_DESC, const CGEN_INSN * insn_,
+ CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
+ int length_, CGEN_FIELDS *fields_, int alias_p_);
extern void cgen_get_insn_operands
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN * insn_,
- const CGEN_FIELDS *fields_, int *indices_));
+ (CGEN_CPU_DESC, const CGEN_INSN * insn_,
+ const CGEN_FIELDS *fields_, int *indices_);
extern const CGEN_INSN * cgen_lookup_get_insn_operands
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *insn_,
- CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
- int length_, int *indices_, CGEN_FIELDS *fields_));
+ (CGEN_CPU_DESC, const CGEN_INSN *insn_,
+ CGEN_INSN_INT int_value_, unsigned char *bytes_value_,
+ int length_, int *indices_, CGEN_FIELDS *fields_);
/* Cover fns to bfd_get/set. */
extern CGEN_INSN_INT cgen_get_insn_value
- PARAMS ((CGEN_CPU_DESC, unsigned char *, int));
+ (CGEN_CPU_DESC, unsigned char *, int);
extern void cgen_put_insn_value
- PARAMS ((CGEN_CPU_DESC, unsigned char *, int, CGEN_INSN_INT));
+ (CGEN_CPU_DESC, unsigned char *, int, CGEN_INSN_INT);
/* Read in a cpu description file.
??? For future concerns, including adding instructions to the assembler/
disassembler at run-time. */
-extern const char * cgen_read_cpu_file
- PARAMS ((CGEN_CPU_DESC, const char * filename_));
+extern const char * cgen_read_cpu_file (CGEN_CPU_DESC, const char * filename_);
/* Allow signed overflow of instruction fields. */
-extern void cgen_set_signed_overflow_ok PARAMS ((CGEN_CPU_DESC));
+extern void cgen_set_signed_overflow_ok (CGEN_CPU_DESC);
/* Generate an error message if a signed field in an instruction overflows. */
-extern void cgen_clear_signed_overflow_ok PARAMS ((CGEN_CPU_DESC));
+extern void cgen_clear_signed_overflow_ok (CGEN_CPU_DESC);
/* Will an error message be generated if a signed field in an instruction overflows ? */
-extern unsigned int cgen_signed_overflow_ok_p PARAMS ((CGEN_CPU_DESC));
+extern unsigned int cgen_signed_overflow_ok_p (CGEN_CPU_DESC);
#endif /* CGEN_H */
diff --git a/include/opcode/d10v.h b/include/opcode/d10v.h
index cc27850b033..74d9006f17c 100644
--- a/include/opcode/d10v.h
+++ b/include/opcode/d10v.h
@@ -1,5 +1,6 @@
/* d10v.h -- Header file for D10V opcode table
- Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003
+ Free Software Foundation, Inc.
Written by Martin Hunt (hunt@cygnus.com), Cygnus Support
This file is part of GDB, GAS, and the GNU binutils.
@@ -198,7 +199,7 @@ struct pd_reg
};
extern const struct pd_reg d10v_predefined_registers[];
-int d10v_reg_name_cnt PARAMS ((void));
+int d10v_reg_name_cnt (void);
/* an expressionS only has one register type, so we fake it */
/* by setting high bits to indicate type */
diff --git a/include/opcode/d30v.h b/include/opcode/d30v.h
index c18874b66b3..809bdeb7db7 100644
--- a/include/opcode/d30v.h
+++ b/include/opcode/d30v.h
@@ -1,5 +1,5 @@
/* d30v.h -- Header file for D30V opcode table
- Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
Written by Martin Hunt (hunt@cygnus.com), Cygnus Solutions
This file is part of GDB, GAS, and the GNU binutils.
@@ -32,7 +32,7 @@ struct pd_reg
};
extern const struct pd_reg pre_defined_registers[];
-int reg_name_cnt PARAMS ((void));
+int reg_name_cnt (void);
/* the number of control registers */
#define MAX_CONTROL_REG 64
diff --git a/include/opcode/i370.h b/include/opcode/i370.h
index 155a3cf866d..e317f23642e 100644
--- a/include/opcode/i370.h
+++ b/include/opcode/i370.h
@@ -1,5 +1,5 @@
/* i370.h -- Header file for S/390 opcode table
- Copyright 1994, 1995, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
PowerPC version written by Ian Lance Taylor, Cygnus Support
Rewritten for i370 ESA/390 support, Linas Vepstas <linas@linas.org>
@@ -159,8 +159,8 @@ struct i370_operand
string (the operand will be inserted in any case). If the
operand value is legal, *ERRMSG will be unchanged (most operands
can accept any value). */
- i370_insn_t (*insert) PARAMS ((i370_insn_t instruction, long op,
- const char **errmsg));
+ i370_insn_t (*insert)
+ (i370_insn_t instruction, long op, const char **errmsg);
/* Extraction function. This is used by the disassembler. To
extract this operand type from an instruction, check this field.
@@ -179,7 +179,7 @@ struct i370_operand
non-zero if this operand type can not actually be extracted from
this operand (i.e., the instruction does not match). If the
operand is valid, *INVALID will not be changed. */
- long (*extract) PARAMS ((i370_insn_t instruction, int *invalid));
+ long (*extract) (i370_insn_t instruction, int *invalid);
/* One bit syntax flags. */
unsigned long flags;
diff --git a/include/opcode/i860.h b/include/opcode/i860.h
index 6e2a683a499..b46a5e5a4eb 100644
--- a/include/opcode/i860.h
+++ b/include/opcode/i860.h
@@ -494,9 +494,9 @@ static const struct i860_opcode i860_opcodes[] =
/* Floating point pseudo-instructions. */
{ "fmov.ss", 0x48000049, 0xb7e005b6, "e,g", 0 }, /* fiadd.ss fsrc1,f0,fdest */
{ "fmov.dd", 0x480001c9, 0xb7e00436, "e,g", 0 }, /* fiadd.dd fsrc1,f0,fdest */
-{ "fmov.sd", 0x480000b0, 0xb7e0054f, "e,g", 0 }, /* fadd.sd fsrc1,f0,fdest */
-{ "fmov.ds", 0x48000130, 0xb7e004cf, "e,g", 0 }, /* fadd.ds fsrc1,f0,fdest */
-{ "pfmov.ds", 0x48000530, 0xb73000cf, "e,g", 0 }, /* pfadd.ds fsrc1,f0,fdest */
+{ "fmov.sd", 0x480000b3, 0xb400054c, "e,g", 0 }, /* famov.sd fsrc1,fdest */
+{ "fmov.ds", 0x48000133, 0xb40004cc, "e,g", 0 }, /* famov.ds fsrc1,fdest */
+{ "pfmov.ds", 0x48000533, 0xb40000cc, "e,g", 0 }, /* pfamov.ds fsrc1,fdest */
{ "pfmov.dd", 0x480005c9, 0xb7e00036, "e,g", 0 }, /* pfiadd.dd fsrc1,f0,fdest */
{ 0, 0, 0, 0, 0 },
diff --git a/include/opcode/or32.h b/include/opcode/or32.h
index 4609a48db56..d72b9bda35f 100644
--- a/include/opcode/or32.h
+++ b/include/opcode/or32.h
@@ -1,5 +1,5 @@
/* Table of opcodes for the OpenRISC 1000 ISA.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2003 Free Software Foundation, Inc.
Contributed by Damjan Lampret (lampret@opencores.org).
This file is part of or1k_gen_isa, or1ksim, GDB and GAS.
@@ -27,10 +27,6 @@
#define NUM_UNSIGNED (0)
#define NUM_SIGNED (1)
-#ifndef PARAMS
-#define PARAMS(x) x
-#endif
-
#define MAX_GPRS 32
#define PAGE_SIZE 4096
#undef __HALF_WORD_INSN__
@@ -71,7 +67,7 @@ struct or32_opcode
/* Opcode and operand encoding. */
char *encoding;
- void (*exec) PARAMS ((void));
+ void (*exec) (void);
unsigned int flags;
};
@@ -93,59 +89,59 @@ extern struct insn_op_struct
} **op_start;
#ifdef HAS_EXECUTION
-extern void l_invalid PARAMS ((void));
-extern void l_sfne PARAMS ((void));
-extern void l_bf PARAMS ((void));
-extern void l_add PARAMS ((void));
-extern void l_sw PARAMS ((void));
-extern void l_sb PARAMS ((void));
-extern void l_sh PARAMS ((void));
-extern void l_lwz PARAMS ((void));
-extern void l_lbs PARAMS ((void));
-extern void l_lbz PARAMS ((void));
-extern void l_lhs PARAMS ((void));
-extern void l_lhz PARAMS ((void));
-extern void l_movhi PARAMS ((void));
-extern void l_and PARAMS ((void));
-extern void l_or PARAMS ((void));
-extern void l_xor PARAMS ((void));
-extern void l_sub PARAMS ((void));
-extern void l_mul PARAMS ((void));
-extern void l_div PARAMS ((void));
-extern void l_divu PARAMS ((void));
-extern void l_sll PARAMS ((void));
-extern void l_sra PARAMS ((void));
-extern void l_srl PARAMS ((void));
-extern void l_j PARAMS ((void));
-extern void l_jal PARAMS ((void));
-extern void l_jalr PARAMS ((void));
-extern void l_jr PARAMS ((void));
-extern void l_rfe PARAMS ((void));
-extern void l_nop PARAMS ((void));
-extern void l_bnf PARAMS ((void));
-extern void l_sfeq PARAMS ((void));
-extern void l_sfgts PARAMS ((void));
-extern void l_sfges PARAMS ((void));
-extern void l_sflts PARAMS ((void));
-extern void l_sfles PARAMS ((void));
-extern void l_sfgtu PARAMS ((void));
-extern void l_sfgeu PARAMS ((void));
-extern void l_sfltu PARAMS ((void));
-extern void l_sfleu PARAMS ((void));
-extern void l_mtspr PARAMS ((void));
-extern void l_mfspr PARAMS ((void));
-extern void l_sys PARAMS ((void));
-extern void l_trap PARAMS ((void)); /* CZ 21/06/01. */
-extern void l_macrc PARAMS ((void));
-extern void l_mac PARAMS ((void));
-extern void l_msb PARAMS ((void));
-extern void l_invalid PARAMS ((void));
-extern void l_cust1 PARAMS ((void));
-extern void l_cust2 PARAMS ((void));
-extern void l_cust3 PARAMS ((void));
-extern void l_cust4 PARAMS ((void));
+extern void l_invalid (void);
+extern void l_sfne (void);
+extern void l_bf (void);
+extern void l_add (void);
+extern void l_sw (void);
+extern void l_sb (void);
+extern void l_sh (void);
+extern void l_lwz (void);
+extern void l_lbs (void);
+extern void l_lbz (void);
+extern void l_lhs (void);
+extern void l_lhz (void);
+extern void l_movhi (void);
+extern void l_and (void);
+extern void l_or (void);
+extern void l_xor (void);
+extern void l_sub (void);
+extern void l_mul (void);
+extern void l_div (void);
+extern void l_divu (void);
+extern void l_sll (void);
+extern void l_sra (void);
+extern void l_srl (void);
+extern void l_j (void);
+extern void l_jal (void);
+extern void l_jalr (void);
+extern void l_jr (void);
+extern void l_rfe (void);
+extern void l_nop (void);
+extern void l_bnf (void);
+extern void l_sfeq (void);
+extern void l_sfgts (void);
+extern void l_sfges (void);
+extern void l_sflts (void);
+extern void l_sfles (void);
+extern void l_sfgtu (void);
+extern void l_sfgeu (void);
+extern void l_sfltu (void);
+extern void l_sfleu (void);
+extern void l_mtspr (void);
+extern void l_mfspr (void);
+extern void l_sys (void);
+extern void l_trap (void); /* CZ 21/06/01. */
+extern void l_macrc (void);
+extern void l_mac (void);
+extern void l_msb (void);
+extern void l_invalid (void);
+extern void l_cust1 (void);
+extern void l_cust2 (void);
+extern void l_cust3 (void);
+extern void l_cust4 (void);
#endif
-extern void l_none PARAMS ((void));
+extern void l_none (void);
extern const struct or32_letter or32_letters[];
@@ -154,31 +150,31 @@ extern const struct or32_opcode or32_opcodes[];
extern const unsigned int or32_num_opcodes;
/* Calculates instruction length in bytes. Always 4 for OR32. */
-extern int insn_len PARAMS ((int));
+extern int insn_len (int);
/* Is individual insn's operand signed or unsigned? */
-extern int letter_signed PARAMS ((char));
+extern int letter_signed (char);
/* Number of letters in the individual lettered operand. */
-extern int letter_range PARAMS ((char));
+extern int letter_range (char);
/* MM: Returns index of given instruction name. */
-extern int insn_index PARAMS ((char *));
+extern int insn_index (char *);
/* MM: Returns instruction name from index. */
-extern const char *insn_name PARAMS ((int));
+extern const char *insn_name (int);
/* MM: Constructs new FSM, based on or32_opcodes. */
-extern void build_automata PARAMS ((void));
+extern void build_automata (void);
/* MM: Destructs FSM. */
-extern void destruct_automata PARAMS ((void));
+extern void destruct_automata (void);
/* MM: Decodes instruction using FSM. Call build_automata first. */
-extern int insn_decode PARAMS ((unsigned int));
+extern int insn_decode (unsigned int);
/* Disassemble one instruction from insn to disassemble.
Return the size of the instruction. */
-int disassemble_insn PARAMS ((unsigned long));
+int disassemble_insn (unsigned long);
#endif
diff --git a/include/opcode/pj.h b/include/opcode/pj.h
index 5779507be80..f9e44dbef18 100644
--- a/include/opcode/pj.h
+++ b/include/opcode/pj.h
@@ -1,5 +1,5 @@
/* Definitions for decoding the picoJava opcode table.
- Copyright 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2002, 2003 Free Software Foundation, Inc.
Contributed by Steve Chamberlain of Transmeta (sac@pobox.com).
This program is free software; you can redistribute it and/or modify
@@ -44,6 +44,6 @@ typedef struct pj_opc_info_t
unsigned char arg[2];
union {
const char *name;
- void (*func) PARAMS ((struct pj_opc_info_t *, char *));
+ void (*func) (struct pj_opc_info_t *, char *);
} u;
} pj_opc_info_t;
diff --git a/include/opcode/ppc.h b/include/opcode/ppc.h
index c4adf712b75..342237e8dd6 100644
--- a/include/opcode/ppc.h
+++ b/include/opcode/ppc.h
@@ -59,77 +59,80 @@ extern const int powerpc_num_opcodes;
/* Values defined for the flags field of a struct powerpc_opcode. */
/* Opcode is defined for the PowerPC architecture. */
-#define PPC_OPCODE_PPC (01)
+#define PPC_OPCODE_PPC 1
/* Opcode is defined for the POWER (RS/6000) architecture. */
-#define PPC_OPCODE_POWER (02)
+#define PPC_OPCODE_POWER 2
/* Opcode is defined for the POWER2 (Rios 2) architecture. */
-#define PPC_OPCODE_POWER2 (04)
+#define PPC_OPCODE_POWER2 4
/* Opcode is only defined on 32 bit architectures. */
-#define PPC_OPCODE_32 (010)
+#define PPC_OPCODE_32 8
/* Opcode is only defined on 64 bit architectures. */
-#define PPC_OPCODE_64 (020)
+#define PPC_OPCODE_64 0x10
/* Opcode is supported by the Motorola PowerPC 601 processor. The 601
is assumed to support all PowerPC (PPC_OPCODE_PPC) instructions,
but it also supports many additional POWER instructions. */
-#define PPC_OPCODE_601 (040)
+#define PPC_OPCODE_601 0x20
/* Opcode is supported in both the Power and PowerPC architectures
(ie, compiler's -mcpu=common or assembler's -mcom). */
-#define PPC_OPCODE_COMMON (0100)
+#define PPC_OPCODE_COMMON 0x40
/* Opcode is supported for any Power or PowerPC platform (this is
for the assembler's -many option, and it eliminates duplicates). */
-#define PPC_OPCODE_ANY (0200)
+#define PPC_OPCODE_ANY 0x80
/* Opcode is supported as part of the 64-bit bridge. */
-#define PPC_OPCODE_64_BRIDGE (0400)
+#define PPC_OPCODE_64_BRIDGE 0x100
/* Opcode is supported by Altivec Vector Unit */
-#define PPC_OPCODE_ALTIVEC (01000)
+#define PPC_OPCODE_ALTIVEC 0x200
/* Opcode is supported by PowerPC 403 processor. */
-#define PPC_OPCODE_403 (02000)
+#define PPC_OPCODE_403 0x400
/* Opcode is supported by PowerPC BookE processor. */
-#define PPC_OPCODE_BOOKE (04000)
+#define PPC_OPCODE_BOOKE 0x800
/* Opcode is only supported by 64-bit PowerPC BookE processor. */
-#define PPC_OPCODE_BOOKE64 (010000)
+#define PPC_OPCODE_BOOKE64 0x1000
+
+/* Opcode is supported by PowerPC 440 processor. */
+#define PPC_OPCODE_440 0x2000
/* Opcode is only supported by Power4 architecture. */
-#define PPC_OPCODE_POWER4 (020000)
+#define PPC_OPCODE_POWER4 0x4000
/* Opcode isn't supported by Power4 architecture. */
-#define PPC_OPCODE_NOPOWER4 (040000)
+#define PPC_OPCODE_NOPOWER4 0x8000
/* Opcode is only supported by POWERPC Classic architecture. */
-#define PPC_OPCODE_CLASSIC (0100000)
+#define PPC_OPCODE_CLASSIC 0x10000
/* Opcode is only supported by e500x2 Core. */
-#define PPC_OPCODE_SPE (0200000)
+#define PPC_OPCODE_SPE 0x20000
/* Opcode is supported by e500x2 Integer select APU. */
-#define PPC_OPCODE_ISEL (0400000)
+#define PPC_OPCODE_ISEL 0x40000
/* Opcode is an e500 SPE floating point instruction. */
-#define PPC_OPCODE_EFS (01000000)
+#define PPC_OPCODE_EFS 0x80000
/* Opcode is supported by branch locking APU. */
-#define PPC_OPCODE_BRLOCK (02000000)
+#define PPC_OPCODE_BRLOCK 0x100000
/* Opcode is supported by performance monitor APU. */
-#define PPC_OPCODE_PMR (04000000)
+#define PPC_OPCODE_PMR 0x200000
/* Opcode is supported by cache locking APU. */
-#define PPC_OPCODE_CACHELCK (010000000)
+#define PPC_OPCODE_CACHELCK 0x400000
/* Opcode is supported by machine check APU. */
-#define PPC_OPCODE_RFMCI (020000000)
+#define PPC_OPCODE_RFMCI 0x800000
/* A macro to extract the major opcode from an instruction. */
#define PPC_OP(i) (((i) >> 26) & 0x3f)
@@ -160,9 +163,8 @@ struct powerpc_operand
string (the operand will be inserted in any case). If the
operand value is legal, *ERRMSG will be unchanged (most operands
can accept any value). */
- unsigned long (*insert) PARAMS ((unsigned long instruction, long op,
- int dialect,
- const char **errmsg));
+ unsigned long (*insert)
+ (unsigned long instruction, long op, int dialect, const char **errmsg);
/* Extraction function. This is used by the disassembler. To
extract this operand type from an instruction, check this field.
@@ -181,8 +183,7 @@ struct powerpc_operand
non-zero if this operand type can not actually be extracted from
this operand (i.e., the instruction does not match). If the
operand is valid, *INVALID will not be changed. */
- long (*extract) PARAMS ((unsigned long instruction, int dialect,
- int *invalid));
+ long (*extract) (unsigned long instruction, int dialect, int *invalid);
/* One bit syntax flags. */
unsigned long flags;
diff --git a/include/opcode/sparc.h b/include/opcode/sparc.h
index c41292364b1..c3364933a68 100644
--- a/include/opcode/sparc.h
+++ b/include/opcode/sparc.h
@@ -1,6 +1,6 @@
/* Definitions for opcode table for the sparc.
- Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2002
- Free Software Foundation, Inc.
+ Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2002,
+ 2003 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler, GDB, the GNU debugger, and
the GNU Binutils.
@@ -74,8 +74,7 @@ struct sparc_opcode_arch {
extern const struct sparc_opcode_arch sparc_opcode_archs[];
/* Given architecture name, look up it's sparc_opcode_arch_val value. */
-extern enum sparc_opcode_arch_val sparc_opcode_lookup_arch
- PARAMS ((const char *));
+extern enum sparc_opcode_arch_val sparc_opcode_lookup_arch (const char *);
/* Return the bitmask of supported architectures for ARCH. */
#define SPARC_OPCODE_SUPPORTED(ARCH) (sparc_opcode_archs[ARCH].supported)
@@ -223,14 +222,14 @@ The following chars are unused: (note: ,[] are used as punctuation)
extern const struct sparc_opcode sparc_opcodes[];
extern const int sparc_num_opcodes;
-extern int sparc_encode_asi PARAMS ((const char *));
-extern const char *sparc_decode_asi PARAMS ((int));
-extern int sparc_encode_membar PARAMS ((const char *));
-extern const char *sparc_decode_membar PARAMS ((int));
-extern int sparc_encode_prefetch PARAMS ((const char *));
-extern const char *sparc_decode_prefetch PARAMS ((int));
-extern int sparc_encode_sparclet_cpreg PARAMS ((const char *));
-extern const char *sparc_decode_sparclet_cpreg PARAMS ((int));
+extern int sparc_encode_asi (const char *);
+extern const char *sparc_decode_asi (int);
+extern int sparc_encode_membar (const char *);
+extern const char *sparc_decode_membar (int);
+extern int sparc_encode_prefetch (const char *);
+extern const char *sparc_decode_prefetch (int);
+extern int sparc_encode_sparclet_cpreg (const char *);
+extern const char *sparc_decode_sparclet_cpreg (int);
/*
* Local Variables:
diff --git a/include/opcode/tic80.h b/include/opcode/tic80.h
index 01159e46b1c..c6a79df286f 100644
--- a/include/opcode/tic80.h
+++ b/include/opcode/tic80.h
@@ -1,5 +1,5 @@
/* tic80.h -- Header file for TI TMS320C80 (MV) opcode table
- Copyright 1996, 1997 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 2003 Free Software Foundation, Inc.
Written by Fred Fish (fnf@cygnus.com), Cygnus Support
This file is part of GDB, GAS, and the GNU binutils.
@@ -90,8 +90,8 @@ struct tic80_operand
operand value is legal, *ERRMSG will be unchanged (most operands
can accept any value). */
- unsigned long (*insert) PARAMS ((unsigned long instruction, long op,
- const char **errmsg));
+ unsigned long (*insert)
+ (unsigned long instruction, long op, const char **errmsg);
/* Extraction function. This is used by the disassembler. To
extract this operand type from an instruction, check this field.
@@ -111,7 +111,7 @@ struct tic80_operand
this operand (i.e., the instruction does not match). If the
operand is valid, *INVALID will not be changed. */
- long (*extract) PARAMS ((unsigned long instruction, int *invalid));
+ long (*extract) (unsigned long instruction, int *invalid);
/* One bit syntax flags. */
@@ -265,13 +265,18 @@ struct predefined_symbol
#define PDS_NAME(pdsp) ((pdsp) -> name)
#define PDS_VALUE(pdsp) ((pdsp) -> value)
-extern const struct predefined_symbol tic80_predefined_symbols[]; /* Translation array */
-extern const int tic80_num_predefined_symbols; /* How many members in the array */
+/* Translation array. */
+extern const struct predefined_symbol tic80_predefined_symbols[];
+/* How many members in the array. */
+extern const int tic80_num_predefined_symbols;
-const char *tic80_value_to_symbol PARAMS ((int val, int class)); /* Translate value to symbolic name */
-int tic80_symbol_to_value PARAMS ((char *name, int class)); /* Translate symbolic name to value */
+/* Translate value to symbolic name. */
+const char *tic80_value_to_symbol (int val, int class);
-const struct predefined_symbol *
-tic80_next_predefined_symbol PARAMS ((const struct predefined_symbol *));
+/* Translate symbolic name to value. */
+int tic80_symbol_to_value (char *name, int class);
+
+const struct predefined_symbol *tic80_next_predefined_symbol
+ (const struct predefined_symbol *);
#endif /* TIC80_H */
diff --git a/include/opcode/v850.h b/include/opcode/v850.h
index 2183bc8586b..75689bff67a 100644
--- a/include/opcode/v850.h
+++ b/include/opcode/v850.h
@@ -1,5 +1,5 @@
/* v850.h -- Header file for NEC V850 opcode table
- Copyright 1996, 1997, 2001 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 2001, 2003 Free Software Foundation, Inc.
Written by J.T. Conklin, Cygnus Support
This file is part of GDB, GAS, and the GNU binutils.
@@ -59,6 +59,7 @@ struct v850_opcode
#define PROCESSOR_V850E (1 << 1) /* Just the V850E. */
#define PROCESSOR_NOT_V850 (~ PROCESSOR_V850) /* Any processor except the V850. */
#define PROCESSOR_V850EA (1 << 2) /* Just the V850EA. */
+#define PROCESSOR_V850E1 (1 << 3) /* Just the V850E1. */
/* The table itself is sorted by major opcode number, and is otherwise
in the order in which the disassembler should consider
@@ -95,8 +96,8 @@ struct v850_operand
string (the operand will be inserted in any case). If the
operand value is legal, *ERRMSG will be unchanged (most operands
can accept any value). */
- unsigned long (* insert) PARAMS ((unsigned long instruction, long op,
- const char ** errmsg));
+ unsigned long (* insert)
+ (unsigned long instruction, long op, const char ** errmsg);
/* Extraction function. This is used by the disassembler. To
extract this operand type from an instruction, check this field.
@@ -114,7 +115,7 @@ struct v850_operand
non-zero if this operand type can not actually be extracted from
this operand (i.e., the instruction does not match). If the
operand is valid, *INVALID will not be changed. */
- unsigned long (* extract) PARAMS ((unsigned long instruction, int * invalid));
+ unsigned long (* extract) (unsigned long instruction, int * invalid);
/* One bit syntax flags. */
int flags;
diff --git a/install-sh b/install-sh
index e9de23842dc..0ec27bcd488 100755
--- a/install-sh
+++ b/install-sh
@@ -1,19 +1,37 @@
#!/bin/sh
#
# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
#
-# Copyright 1991 by the Massachusetts Institute of Technology
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission. M.I.T. makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
@@ -56,7 +74,7 @@ dir_arg=""
while [ x"$1" != x ]; do
case $1 in
- -c) instcmd="$cpprog"
+ -c) instcmd=$cpprog
shift
continue;;
@@ -79,7 +97,7 @@ while [ x"$1" != x ]; do
shift
continue;;
- -s) stripcmd="$stripprog"
+ -s) stripcmd=$stripprog
shift
continue;;
@@ -106,128 +124,132 @@ done
if [ x"$src" = x ]
then
- echo "install: no input file specified"
+ echo "$0: no input file specified" >&2
exit 1
else
- true
+ :
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
-
- if [ -d $dst ]; then
+
+ if [ -d "$dst" ]; then
instcmd=:
chmodcmd=""
else
- instcmd=mkdir
+ instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
+# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
- if [ -f $src -o -d $src ]
+ if [ -f "$src" ] || [ -d "$src" ]
then
- true
+ :
else
- echo "install: $src does not exist"
+ echo "$0: $src does not exist" >&2
exit 1
fi
-
+
if [ x"$dst" = x ]
then
- echo "install: no destination specified"
+ echo "$0: no destination specified" >&2
exit 1
else
- true
+ :
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
- if [ -d $dst ]
+ if [ -d "$dst" ]
then
- dst="$dst"/`basename $src`
+ dst=$dst/`basename "$src"`
else
- true
+ :
fi
fi
## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
+defaultIFS='
+ '
+IFS="${IFS-$defaultIFS}"
-oIFS="${IFS}"
+oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
+set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS=$oIFS
pathcomp=''
while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
+ pathcomp=$pathcomp$1
shift
- if [ ! -d "${pathcomp}" ] ;
+ if [ ! -d "$pathcomp" ] ;
then
- $mkdirprog "${pathcomp}"
+ $mkdirprog "$pathcomp"
else
- true
+ :
fi
- pathcomp="${pathcomp}/"
+ pathcomp=$pathcomp/
done
fi
if [ x"$dir_arg" != x ]
then
- $doit $instcmd $dst &&
+ $doit $instcmd "$dst" &&
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
- if [ x"$transformarg" = x ]
+ if [ x"$transformarg" = x ]
then
- dstfile=`basename $dst`
+ dstfile=`basename "$dst"`
else
- dstfile=`basename $dst $transformbasename |
+ dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
- if [ x"$dstfile" = x ]
+ if [ x"$dstfile" = x ]
then
- dstfile=`basename $dst`
+ dstfile=`basename "$dst"`
else
- true
+ :
fi
-# Make a temp file name in the proper directory.
+# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/#inst.$$#
+ rmtmp=$dstdir/#rm.$$#
-# Move or copy the file name to the temp name
+# Trap to clean up temp files at exit.
- $doit $instcmd $src $dsttmp &&
+ trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+ trap '(exit $?); exit' 1 2 13 15
- trap "rm -f ${dsttmp}" 0 &&
+# Move or copy the file name to the temp name
+
+ $doit $instcmd "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits
@@ -235,17 +257,38 @@ else
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
+
+# Now remove or move aside any old file at destination location. We try this
+# two ways since rm can't unlink itself on some systems and the destination
+# file might be busy for other reasons. In this case, the final cleanup
+# might fail but the new file should still install successfully.
+
+{
+ if [ -f "$dstdir/$dstfile" ]
+ then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
+ $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
+ {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit
+ }
+ else
+ :
+ fi
+} &&
# Now rename the file to the real destination.
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
+# The final little trick to "correctly" pass the exit status to the exit trap.
-exit 0
+{
+ (exit 0); exit
+}
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index f26593fc081..5c4175bbd48 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,41 @@
+2003-09-15 Andrew Cagney <cagney@redhat.com>
+
+ * floatformat.c (get_field): Make "data" constant.
+ (floatformat_is_valid, floatformat_to_double): Make "from"
+ constant, fix casts.
+ (floatformat_from_double): Make "from" constant.
+
+2003-09-15 Daniel Jacobowitz <drow@mvista.com>
+
+ * floatformat.c (floatformat_is_valid): New function.
+ (get_field, put_field): Correct comments.
+
+2003-09-06 Josef Zlomek <zlomekj@suse.cz>
+
+ * fibheap.c (fibheap_replace_key_data): Change type of OKEY to
+ FIBHEAPKEY_T.
+
+2003-09-02 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR bootstrap/12100
+ * aclocal.m4 (AC_LANG_FUNC_LINK_TRY): Define.
+ * configure: Rebuilt.
+
+2003-08-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * aclocal.m4: Include acx.m4 and no-executables.m4.
+ (libiberty_AC_FUNC_STRNCMP): Use AC_LIBOBJ.
+ (LIB_AC_PROG_CC): Remove.
+ * configure.in: Update AC_PREREQ to 2.57. Use GCC_NO_EXECUTABLES.
+ Use AC_PROG_CC and set ac_libiberty_warn_cflags instead of using
+ LIB_AC_PROG_CC. Use AC_LIBOBJ. Call AC_ISC_POSIX later, only if
+ performing link tests.
+ * configure: Regenerated.
+
+2003-08-12 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * cp-demangle.c: Clarify what package(s) this is part of.
+
2003-07-05 Danny Smith <dannysmith@users.sourceforge.net>
* pex-win32.c (pexecute): Mark parameters this_pname and
diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
index a3349f3b08f..f33e0c6218d 100644
--- a/libiberty/aclocal.m4
+++ b/libiberty/aclocal.m4
@@ -1,4 +1,6 @@
sinclude(../config/accross.m4)
+sinclude(../config/acx.m4)
+sinclude(../config/no-executables.m4)
dnl See whether strncmp reads past the end of its string parameters.
dnl On some versions of SunOS4 at least, strncmp reads a word at a time
@@ -71,7 +73,7 @@ main ()
ac_cv_func_strncmp_works=no)
rm -f core core.* *.core])
if test $ac_cv_func_strncmp_works = no ; then
- LIBOBJS="$LIBOBJS strncmp.o"
+ AC_LIBOBJ([strncmp])
fi
])
@@ -118,48 +120,6 @@ if test $libiberty_cv_decl_needed_$1 = yes; then
fi
])dnl
-# FIXME: We temporarily define our own version of AC_PROG_CC. This is
-# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
-# are probably using a cross compiler, which will not be able to fully
-# link an executable. This should really be fixed in autoconf
-# itself.
-
-AC_DEFUN(LIB_AC_PROG_CC,
-[AC_BEFORE([$0], [AC_PROG_CPP])dnl
-AC_PROVIDE([AC_PROG_CC])
-AC_CHECK_PROG(CC, gcc, gcc)
-if test -z "$CC"; then
- AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
- test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-fi
-
-AC_PROG_CC_GNU
-
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
-dnl Check whether -g works, even if CFLAGS is set, in case the package
-dnl plays around with CFLAGS (such as to build both debugging and
-dnl normal versions of a library), tasteless as that idea is.
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- AC_PROG_CC_G
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-O2"
- fi
-else
- GCC=
- ac_libiberty_warn_cflags=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
-fi
-AC_SUBST(ac_libiberty_warn_cflags)
-])
-
# Work around a bug in autoheader. This can go away when we switch to
# autoconf >2.50. The use of define instead of AC_DEFUN is
# deliberate.
@@ -220,3 +180,52 @@ AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction,
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown])
])
+
+# AC_LANG_FUNC_LINK_TRY(C)(FUNCTION)
+# ----------------------------------
+# Don't include <ctype.h> because on OSF/1 3.0 it includes
+# <sys/types.h> which includes <sys/select.h> which contains a
+# prototype for select. Similarly for bzero.
+#
+# This test used to merely assign f=$1 in main(), but that was
+# optimized away by HP unbundled cc A.05.36 for ia64 under +O3,
+# presumably on the basis that there's no need to do that store if the
+# program is about to exit. Conversely, the AIX linker optimizes an
+# unused external declaration that initializes f=$1. So this test
+# program has both an external initialization of f, and a use of f in
+# main that affects the exit status.
+#
+m4_define([AC_LANG_FUNC_LINK_TRY(C)],
+[AC_LANG_PROGRAM(
+[/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $1 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $1 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$1) || defined (__stub___$1)
+choke me
+#else
+char (*f) () = $1;
+#endif
+#ifdef __cplusplus
+}
+#endif
+], [return f != $1;])])
+
diff --git a/libiberty/configure b/libiberty/configure
index 77d5170a877..98a641e8ab0 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1,40 +1,324 @@
#! /bin/sh
-
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
-# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Generated by GNU Autoconf 2.57.
#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
-# Defaults:
-ac_help=
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
- --with-target-subdir=SUBDIR Configuring in a subdirectory for target"
-ac_help="$ac_help
- --with-build-subdir=SUBDIR Configuring in a subdirectory for build"
-ac_help="$ac_help
- --with-cross-host=HOST Configuring with a cross compiler"
-ac_help="$ac_help
- --with-newlib Configuring with newlib"
-ac_help="$ac_help
- --enable-maintainer-mode
- enable make rules and dependencies not useful
- (and sometimes confusing) to the casual installer"
-ac_help="$ac_help
- --enable-install-libiberty Install headers for end users"
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="xmalloc.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libiberty_topdir MAINT NOTMAINT MAKEINFO BUILD_INFO PERL HAVE_PERL build build_cpu build_vendor build_os host host_cpu host_vendor host_os AR ac_ct_AR RANLIB ac_ct_RANLIB CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ac_libiberty_warn_cflags NO_MINUS_C_MINUS_O OUTPUT_OPTION INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP LIBOBJS CHECK target_header_dir pexecute INSTALL_DEST LTLIBOBJS'
+ac_subst_files='host_makefile_frag'
# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
# The variables have the same names as the options, with
# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
exec_prefix=NONE
-host=NONE
no_create=
-nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
@@ -43,10 +327,15 @@ program_transform_name=s,x,x,
silent=
site=
srcdir=
-target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
@@ -60,17 +349,9 @@ oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'
-# Initialize some other variables.
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-ac_max_here_lines=12
-
ac_prev=
for ac_option
do
-
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
@@ -78,59 +359,59 @@ do
continue
fi
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
# Accept the important Cygnus configure options, so we can diagnose typos.
- case "$ac_option" in
+ case $ac_option in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
+ bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
+ ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
+ build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
| --da=*)
- datadir="$ac_optarg" ;;
+ datadir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
-enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
+ eval "enable_$ac_feature='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -139,95 +420,47 @@ do
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
+ exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
-EOF
- cat << EOF
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
-EOF
- if test -n "$ac_help"; then
- echo "--enable and --with options recognized:$ac_help"
- fi
- exit 0 ;;
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
-host | --host | --hos | --ho)
- ac_prev=host ;;
+ ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
+ host_alias=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir="$ac_optarg" ;;
+ includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
+ infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
+ libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
- libexecdir="$ac_optarg" ;;
+ libexecdir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst \
@@ -236,19 +469,19 @@ EOF
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
+ localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
+ mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
+ | --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -262,26 +495,26 @@ EOF
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
+ oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
+ prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
+ program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
+ program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
@@ -298,7 +531,7 @@ EOF
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
+ program_transform_name=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
@@ -308,7 +541,7 @@ EOF
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
+ sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -319,58 +552,57 @@ EOF
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
+ sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
+ site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
+ srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir="$ac_optarg" ;;
+ sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
+ ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
+ target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
- exit 0 ;;
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "with_${ac_package}='$ac_optarg'" ;;
+ eval "with_$ac_package='$ac_optarg'" ;;
-without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
--x)
# Obsolete; use --with-x.
@@ -381,99 +613,110 @@ EOF
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
+ x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
+ x_libraries=$ac_optarg ;;
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
;;
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
*)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
esac
done
if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
fi
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 some systems may open it to /dev/tty
-# 4 used on the Kubota Titan
-# 6 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 6>/dev/null
-else
- exec 6>&1
-fi
-exec 5>./config.log
-
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
esac
done
-# NLS nuisances.
-# Only set these to C if already set. These must not be set unconditionally
-# because not all systems understand e.g. LANG=C (notably SCO).
-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
-# Non-C LC_CTYPE values break the ctype check.
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=xmalloc.c
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
@@ -483,13 +726,442 @@ else
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
fi
fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode
+ enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --enable-install-libiberty Install headers for end users
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-target-subdir=SUBDIR Configuring in a subdirectory for target
+ --with-build-subdir=SUBDIR Configuring in a subdirectory for build
+ --with-cross-host=HOST Configuring with a cross compiler
+ --with-newlib Configuring with newlib
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core core.* *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
@@ -500,39 +1172,103 @@ if test -z "$CONFIG_SITE"; then
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
else
- echo "creating cache $cache_file"
- > $cache_file
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
fi
ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-ac_exeext=
-ac_objext=o
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
- fi
-else
- ac_n= ac_c='\c' ac_t=
-fi
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -542,30 +1278,30 @@ fi
# exported. We don't use libtool yet, but some day we might, so...
ORIGINAL_LD_FOR_MULTILIBS=$LD
+
# Check whether --with-target-subdir or --without-target-subdir was given.
if test "${with_target_subdir+set}" = set; then
withval="$with_target_subdir"
- :
-fi
+
+fi;
# Check whether --with-build-subdir or --without-build-subdir was given.
if test "${with_build_subdir+set}" = set; then
withval="$with_build_subdir"
- :
-fi
+
+fi;
# Check whether --with-cross-host or --without-cross-host was given.
if test "${with_cross_host+set}" = set; then
withval="$with_cross_host"
- :
-fi
+
+fi;
# Check whether --with-newlib or --without-newlib was given.
if test "${with_newlib+set}" = set; then
withval="$with_newlib"
- :
-fi
+fi;
if test "${srcdir}" = "."; then
if test -n "${with_build_subdir}"; then
@@ -594,29 +1330,35 @@ for ac_dir in $libiberty_topdir $srcdir/$libiberty_topdir; do
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $libiberty_topdir $srcdir/$libiberty_topdir" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $libiberty_topdir $srcdir/$libiberty_topdir" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $libiberty_topdir $srcdir/$libiberty_topdir" >&2;}
+ { (exit 1); exit 1; }; }
fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:610: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then
enableval="$enable_maintainer_mode"
maintainer_mode=$enableval
else
maintainer_mode=no
-fi
+fi;
-
-echo "$ac_t""$maintainer_mode" 1>&6
+echo "$as_me:$LINENO: result: $maintainer_mode" >&5
+echo "${ECHO_T}$maintainer_mode" >&6
if test "$maintainer_mode" = "yes"; then
MAINT=''
@@ -630,31 +1372,37 @@ fi
# rely on it - libiberty is built before texinfo.
# Extract the first word of "makeinfo", so it can be a program name with args.
set dummy makeinfo; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:635: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MAKEINFO+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$MAKEINFO"; then
ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_MAKEINFO="makeinfo"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MAKEINFO="makeinfo"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-MAKEINFO="$ac_cv_prog_MAKEINFO"
+MAKEINFO=$ac_cv_prog_MAKEINFO
if test -n "$MAKEINFO"; then
- echo "$ac_t""$MAKEINFO" 1>&6
+ echo "$as_me:$LINENO: result: $MAKEINFO" >&5
+echo "${ECHO_T}$MAKEINFO" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test "x$MAKEINFO" = "x"; then
@@ -666,8 +1414,10 @@ else
x*\ [1-3].* )
MAKEINFO="@echo $MAKEINFO is too old, 4.0 or newer required; true"
BUILD_INFO=
- echo "configure: warning:
-*** Makeinfo is too old. Info documentation will not be built." 1>&2
+ { echo "$as_me:$LINENO: WARNING:
+*** Makeinfo is too old. Info documentation will not be built." >&5
+echo "$as_me: WARNING:
+*** Makeinfo is too old. Info documentation will not be built." >&2;}
;;
esac
fi
@@ -676,31 +1426,37 @@ fi
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:681: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_PERL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$PERL"; then
ac_cv_prog_PERL="$PERL" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_PERL="perl"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_PERL="perl"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-PERL="$ac_cv_prog_PERL"
+PERL=$ac_cv_prog_PERL
if test -n "$PERL"; then
- echo "$ac_t""$PERL" 1>&6
+ echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
if test x"$PERL" = x""; then
@@ -710,324 +1466,1195 @@ else
fi
-
# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:721: checking host system type" >&5
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:744: checking build system type" >&5
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
-if test $host != $build; then
- ac_tool_prefix=${host_alias}-
-else
- ac_tool_prefix=
-fi
-# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:770: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$AR"; then
ac_cv_prog_AR="$AR" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-AR="$ac_cv_prog_AR"
+AR=$ac_cv_prog_AR
if test -n "$AR"; then
- echo "$ac_t""$AR" 1>&6
+ echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ AR=$ac_ct_AR
+else
+ AR="$ac_cv_prog_AR"
+fi
-# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:802: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-RANLIB="$ac_cv_prog_RANLIB"
+RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
+fi
if test -z "$ac_cv_prog_RANLIB"; then
-if test -n "$ac_tool_prefix"; then
+ ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:834: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
fi
fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ RANLIB=$ac_ct_RANLIB
else
- RANLIB=":"
-fi
+ RANLIB="$ac_cv_prog_RANLIB"
fi
-# Extract the first word of "gcc", so it can be a program name with args.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:871: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:901: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- break
- fi
- done
- IFS="$ac_save_ifs"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
- if test $# -gt 0; then
+ if test $# != 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
- set dummy "$ac_dir/$ac_word" "$@"
- shift
- ac_cv_prog_CC="$@"
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:950: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
else
- ac_cv_prog_gcc=no
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+# FIXME: Cleanup?
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ gcc_no_link=no
+else
+ gcc_no_link=yes
+fi
+
+if test x$gcc_no_link = xyes; then
+ # Setting cross_compile will disable run tests; it will
+ # also disable AC_CHECK_FILE but that's generally
+ # correct if we can't link.
+ cross_compiling=yes
+ EXEEXT=
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:975: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_cc_g=yes
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+fi
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
else
- ac_cv_prog_cc_g=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
-rm -f conftest*
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
CFLAGS="-O2"
+ else
+ CFLAGS=
fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ ''\
+ '#include <stdlib.h>' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
else
- GCC=
- ac_libiberty_warn_cflags=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+if test x$GCC = xyes; then
+ ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
+fi
if test "x$CC" != xcc; then
- echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
-echo "configure:1007: checking whether $CC and cc understand -c and -o together" >&5
+ echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5
+echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6
else
- echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
-echo "configure:1010: checking whether cc understands -c and -o together" >&5
+ echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5
+echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6
fi
-set dummy $CC; ac_cc="`echo $2 |
- sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
-if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+set dummy $CC; ac_cc=`echo $2 |
+ sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo 'foo(){}' > conftest.c
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
# Make sure it works both with $CC and with simple cc.
# We do the test twice because some compilers refuse to overwrite an
# existing .o file with -o, though they will create one.
-ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
-if { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5'
+if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); };
then
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
if test "x$CC" != xcc; then
# Test first that cc exists at all.
- if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
- ac_try='cc -c conftest.c -o conftest.o 1>&5'
- if { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+ if { ac_try='cc -c conftest.$ac_ext >&5'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5'
+ if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); };
then
# cc works too.
:
@@ -1044,12 +2671,15 @@ rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- echo "$ac_t""no" 1>&6
- cat >> confdefs.h <<\EOF
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+cat >>confdefs.h <<\_ACEOF
#define NO_MINUS_C_MINUS_O 1
-EOF
+_ACEOF
fi
@@ -1062,198 +2692,260 @@ fi
-echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1067: checking for POSIXized ISC" >&5
-if test -d /etc/conf/kconfig.d &&
- grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
-then
- echo "$ac_t""yes" 1>&6
- ISC=yes # If later tests want to check for ISC.
- cat >> confdefs.h <<\EOF
-#define _POSIX_SOURCE 1
-EOF
- if test "$GCC" = yes; then
- CC="$CC -posix"
- else
- CC="$CC -Xp"
- fi
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
- ISC=
-fi
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1088: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1093 "configure"
-#include "confdefs.h"
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset x;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *ccp;
+ char **p;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ ccp = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++ccp;
+ p = (char**) ccp;
+ ccp = (char const *const *) p;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ }
+#endif
-int main() {
-
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
+ ;
+ return 0;
}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
-
-; return 0; }
-EOF
-if { (eval echo configure:1142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_const=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_c_const=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_c_const" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
if test $ac_cv_c_const = no; then
- cat >> confdefs.h <<\EOF
-#define const
-EOF
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
fi
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1163: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
- cat > conftest.$ac_ext <<EOF
-#line 1170 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:1177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_inline=$ac_kw; break
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+case $ac_cv_c_inline in
inline | yes) ;;
- no) cat >> confdefs.h <<\EOF
-#define inline
-EOF
+ no)
+cat >>confdefs.h <<\_ACEOF
+#define inline
+_ACEOF
;;
- *) cat >> confdefs.h <<EOF
+ *) cat >>confdefs.h <<_ACEOF
#define inline $ac_cv_c_inline
-EOF
+_ACEOF
;;
esac
-echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:1203: checking whether byte ordering is bigendian" >&5
-if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
+if test "${ac_cv_c_bigendian+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
-cat > conftest.$ac_ext <<EOF
-#line 1210 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <sys/param.h>
-int main() {
+int
+main ()
+{
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
bogus endian macros
#endif
-; return 0; }
-EOF
-if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
# It does; now see whether it defined to BIG_ENDIAN or not.
-cat > conftest.$ac_ext <<EOF
-#line 1225 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <sys/param.h>
-int main() {
+int
+main ()
+{
#if BYTE_ORDER != BIG_ENDIAN
not big endian
#endif
-; return 0; }
-EOF
-if { (eval echo configure:1236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_bigendian=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_c_bigendian=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_bigendian=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_c_bigendian = unknown; then
if test "$cross_compiling" = yes; then
- echo $ac_n "cross-compiling... " 2>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1256 "configure"
-#include "confdefs.h"
+ echo $ac_n "cross-compiling... " 2>&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
main () {
/* Are we little or big endian? From Harbison&Steele. */
union
@@ -1264,26 +2956,36 @@ main () {
u.l = 1;
exit (u.c[sizeof (long) - 1] == 1);
}
-EOF
-if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_bigendian=no
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_c_bigendian=yes
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_bigendian=yes
fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
fi
-
-echo "$ac_t""$ac_cv_c_bigendian" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6
if test $ac_cv_c_bigendian = unknown; then
-echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
-echo "configure:1287: checking to probe for byte ordering" >&5
+echo "$as_me:$LINENO: checking to probe for byte ordering" >&5
+echo $ECHO_N "checking to probe for byte ordering... $ECHO_C" >&6
cat >conftest.c <<EOF
short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
@@ -1311,32 +3013,39 @@ EOF
echo $ac_n 'guessing bigendian ... ' >&6
fi
fi
-echo "$ac_t""$ac_cv_c_bigendian" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6
fi
if test $ac_cv_c_bigendian = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define WORDS_BIGENDIAN 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HOST_WORDS_BIG_ENDIAN 1
-EOF
+_ACEOF
BYTEORDER=4321
else
BYTEORDER=1234
fi
-cat >> confdefs.h <<EOF
+
+cat >>confdefs.h <<_ACEOF
#define BYTEORDER $BYTEORDER
-EOF
+_ACEOF
if test $ac_cv_c_bigendian = unknown; then
- { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: unknown endianess - sorry" >&5
+echo "$as_me: error: unknown endianess - sorry" >&2;}
+ { (exit please pre-set ac_cv_c_bigendian); exit please pre-set ac_cv_c_bigendian; }; }
fi
+ ac_config_headers="$ac_config_headers config.h:config.in"
@@ -1347,60 +3056,73 @@ fi
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1356: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
- for ac_dir in $PATH; do
- # Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
- /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- if test -f $ac_dir/$ac_prog; then
- if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- else
- ac_cv_path_install="$ac_dir/$ac_prog -c"
- break 2
- fi
- fi
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
+ done
+ ;;
+esac
+done
+
fi
if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+ INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. We don't cache a
# path for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the path is relative.
- INSTALL="$ac_install_sh"
+ INSTALL=$ac_install_sh
fi
fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
@@ -1412,278 +3134,318 @@ host_makefile_frag=${frag}
# It's OK to check for header files. Although the compiler may not be
# able to link anything, it had better be able to at least compile
# something.
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1417: checking how to run the C preprocessor" >&5
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 1432 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 1449 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
:
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP="${CC-cc} -nologo -E"
- cat > conftest.$ac_ext <<EOF
-#line 1466 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- :
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
+ ac_cpp_err=yes
fi
-rm -f conftest*
-fi
-rm -f conftest*
-fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
-fi
- CPP="$ac_cv_prog_CPP"
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
else
- ac_cv_prog_CPP="$CPP"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
-echo "$ac_t""$CPP" 1>&6
+rm -f conftest.err conftest.$ac_ext
-for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1500: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1505 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
fi
-rm -f conftest*
+
+ done
+ ac_cv_prog_CPP=$CPP
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+ CPP=$ac_cv_prog_CPP
else
- echo "$ac_t""no" 1>&6
+ ac_cv_prog_CPP=$CPP
fi
-done
-
-echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1537: checking for sys/wait.h that is POSIX.1 compatible" >&5
-if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1542 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/wait.h>
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
#endif
-int main() {
-int s;
-wait (&s);
-s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
-; return 0; }
-EOF
-if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_header_sys_wait_h=yes
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_sys_wait_h=no
+ ac_cpp_err=yes
fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
-if test $ac_cv_header_sys_wait_h = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_SYS_WAIT_H 1
-EOF
-
-fi
-
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1579: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+if test -z "$ac_cpp_err"; then
+ :
else
- cat > conftest.$ac_ext <<EOF
-#line 1584 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-int main() {
-struct tm *tp;
-; return 0; }
-EOF
-if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_header_time=yes
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_time=no
+ ac_cpp_err=yes
fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_header_time" 1>&6
-if test $ac_cv_header_time = yes; then
- cat >> confdefs.h <<\EOF
-#define TIME_WITH_SYS_TIME 1
-EOF
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
+rm -f conftest.err conftest.$ac_ext
-
-echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6
-echo "configure:1615: checking whether errno must be declared" >&5
-if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1620 "configure"
-#include "confdefs.h"
-#include <errno.h>
-int main() {
-int x = errno;
-; return 0; }
-EOF
-if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- libiberty_cv_declare_errno=no
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- libiberty_cv_declare_errno=yes
-fi
-rm -f conftest*
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
-echo "$ac_t""$libiberty_cv_declare_errno" 1>&6
-if test $libiberty_cv_declare_errno = yes
-then cat >> confdefs.h <<\EOF
-#define NEED_DECLARATION_ERRNO 1
-EOF
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1649: checking for ANSI C header files" >&5
-if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1654 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_header_stdc=yes
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1679 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <string.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
+ $EGREP "memchr" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1692,16 +3454,20 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-cat > conftest.$ac_ext <<EOF
-#line 1697 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
+ $EGREP "free" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1710,115 +3476,592 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then
:
else
- cat > conftest.$ac_ext <<EOF
-#line 1718 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
-EOF
-if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
:
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
-EOF
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
fi
-echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6
-echo "configure:1753: checking for uintptr_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
else
- cat > conftest.$ac_ext <<EOF
-#line 1758 "configure"
-#include "confdefs.h"
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
+if test "${ac_cv_header_sys_wait_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
+#include <sys/wait.h>
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])uintptr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
- ac_cv_type_uintptr_t=yes
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+int
+main ()
+{
+ int s;
+ wait (&s);
+ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_sys_wait_h=yes
else
- rm -rf conftest*
- ac_cv_type_uintptr_t=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_sys_wait_h=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
+if test $ac_cv_header_sys_wait_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYS_WAIT_H 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+if test "${ac_cv_header_time+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_time=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_time=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$ac_t""$ac_cv_type_uintptr_t" 1>&6
-if test $ac_cv_type_uintptr_t = no; then
- cat >> confdefs.h <<\EOF
+echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking whether errno must be declared" >&5
+echo $ECHO_N "checking whether errno must be declared... $ECHO_C" >&6
+if test "${libiberty_cv_declare_errno+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <errno.h>
+int
+main ()
+{
+int x = errno;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ libiberty_cv_declare_errno=no
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+libiberty_cv_declare_errno=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $libiberty_cv_declare_errno" >&5
+echo "${ECHO_T}$libiberty_cv_declare_errno" >&6
+if test $libiberty_cv_declare_errno = yes
+then
+cat >>confdefs.h <<\_ACEOF
+#define NEED_DECLARATION_ERRNO 1
+_ACEOF
+
+fi
+
+
+echo "$as_me:$LINENO: checking for uintptr_t" >&5
+echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6
+if test "${ac_cv_type_uintptr_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((uintptr_t *) 0)
+ return 0;
+if (sizeof (uintptr_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_uintptr_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_uintptr_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5
+echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6
+if test $ac_cv_type_uintptr_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
#define uintptr_t unsigned long
-EOF
+_ACEOF
fi
# Given the above check, we always have uintptr_t or a fallback
# definition. So define HAVE_UINTPTR_T in case any imported code
# relies on it.
-cat >> confdefs.h <<\EOF
-#define HAVE_UINTPTR_T 1
-EOF
-
-echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1794: checking for pid_t" >&5
-if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1799 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
- rm -rf conftest*
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UINTPTR_T 1
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+if test "${ac_cv_type_pid_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((pid_t *) 0)
+ return 0;
+if (sizeof (pid_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_type_pid_t=yes
else
- rm -rf conftest*
- ac_cv_type_pid_t=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_pid_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$ac_t""$ac_cv_type_pid_t" 1>&6
-if test $ac_cv_type_pid_t = no; then
- cat >> confdefs.h <<\EOF
+echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+if test $ac_cv_type_pid_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
#define pid_t int
-EOF
+_ACEOF
fi
@@ -1884,7 +4127,70 @@ checkfuncs="$checkfuncs getsysinfo table sysctl"
# These are neither executed nor required, but they help keep
# autoheader happy without adding a bunch of text to acconfig.h.
if test "x" = "y"; then
- for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \
getcwd getpagesize index insque mkstemps memchr memcmp memcpy \
memmove mempcpy memset putenv random rename rindex sigsetmask \
strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr \
@@ -1894,70 +4200,108 @@ if test "x" = "y"; then
pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl \
realpath canonicalize_file_name
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1899: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1904 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:1927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_SYS_ERRLIST 1
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_SYS_NERR 1
-EOF
+_ACEOF
+
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_SYS_SIGLIST 1
-EOF
+_ACEOF
fi
@@ -1979,7 +4323,12 @@ if test -n "${with_target_subdir}"; then
# newlib provide and which ones we will be expected to provide.
if test "x${with_newlib}" = "xyes"; then
- LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
+ LIBOBJS="$LIBOBJS asprintf.$ac_objext"
+ LIBOBJS="$LIBOBJS basename.$ac_objext"
+ LIBOBJS="$LIBOBJS insque.$ac_objext"
+ LIBOBJS="$LIBOBJS random.$ac_objext"
+ LIBOBJS="$LIBOBJS strdup.$ac_objext"
+ LIBOBJS="$LIBOBJS vasprintf.$ac_objext"
for f in $funcs; do
case "$f" in
@@ -1987,9 +4336,9 @@ if test -n "${with_target_subdir}"; then
;;
*)
n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define $n 1
-EOF
+_ACEOF
;;
esac
@@ -2015,17 +4364,16 @@ if test "${enable_install_libiberty+set}" = set; then
enable_install_libiberty=$enableval
else
enable_install_libiberty=no
-fi
-
+fi;
# Option parsed, now set things appropriately.
case x"$enable_install_libiberty" in
xyes|x)
target_header_dir=libiberty
;;
- xno)
+ xno)
target_header_dir=
;;
- *)
+ *)
# This could be sanity-checked in various ways...
target_header_dir="${enable_install_libiberty}"
;;
@@ -2062,8 +4410,16 @@ if test -z "${setobjs}"; then
# Handle VxWorks configuration specially, since on VxWorks the
# libraries are actually on the target board, not in the file
# system.
- LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
- LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
+ LIBOBJS="$LIBOBJS basename.$ac_objext"
+ LIBOBJS="$LIBOBJS getpagesize.$ac_objext"
+ LIBOBJS="$LIBOBJS insque.$ac_objext"
+ LIBOBJS="$LIBOBJS random.$ac_objext"
+ LIBOBJS="$LIBOBJS strcasecmp.$ac_objext"
+ LIBOBJS="$LIBOBJS strncasecmp.$ac_objext"
+ LIBOBJS="$LIBOBJS strdup.$ac_objext"
+ LIBOBJS="$LIBOBJS vfork.$ac_objext"
+ LIBOBJS="$LIBOBJS waitpid.$ac_objext"
+ LIBOBJS="$LIBOBJS vasprintf.$ac_objext"
for f in $funcs; do
case "$f" in
basename | getpagesize | insque | random | strcasecmp)
@@ -2072,9 +4428,9 @@ if test -z "${setobjs}"; then
;;
*)
n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define $n 1
-EOF
+_ACEOF
;;
esac
@@ -2112,11 +4468,11 @@ if test -z "${setobjs}"; then
# missing.
# DJ - only if we're *building* cygwin, not just building *with* cygwin
-
+
if test -n "${with_target_subdir}"
then
funcs="`echo $funcs | sed -e 's/random//'`"
- LIBOBJS="$LIBOBJS random.o"
+ LIBOBJS="$LIBOBJS random.$ac_objext"
vars="`echo $vars | sed -e 's/sys_siglist//'`"
checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
fi
@@ -2130,19 +4486,19 @@ if test -z "${setobjs}"; then
;;
*-*-uwin*)
- # Under some versions of uwin, vfork is notoriously buggy and the test
+ # Under some versions of uwin, vfork is notoriously buggy and the test
# can hang configure; on other versions, vfork exists just as a stub.
# FIXME: This should be removed once vfork in uwin's runtime is fixed.
ac_cv_func_vfork_works=no
# Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are
- # macros (actually, these are imported from a DLL, but the end effect
+ # macros (actually, these are imported from a DLL, but the end effect
# is the same), so the test below won't find them.
libiberty_cv_var_sys_nerr=yes
libiberty_cv_var_sys_errlist=yes
;;
*-*-*vms*)
- # Under VMS, vfork works very different than on Unix. The standard test
+ # Under VMS, vfork works very different than on Unix. The standard test
# won't work, and it isn't easily adaptable. It makes more sense to
# just force it.
ac_cv_func_vfork_works=yes
@@ -2152,205 +4508,354 @@ if test -z "${setobjs}"; then
# We haven't set the list of objects yet. Use the standard autoconf
# tests. This will only work if the compiler works.
- echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2157: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
-
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
-
-cat > conftest.$ac_ext << EOF
+ echo "$as_me:$LINENO: checking for library containing strerror" >&5
+echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
+if test "${ac_cv_search_strerror+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_strerror=no
+if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-#line 2168 "configure"
-#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strerror ();
+int
+main ()
+{
+strerror ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_strerror="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_strerror" = no; then
+ for ac_lib in cposix; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-main(){return(0);}
-EOF
-if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- ac_cv_prog_cc_works=yes
- # If we can't run a trivial program, we are probably using a cross compiler.
- if (./conftest; exit) 2>/dev/null; then
- ac_cv_prog_cc_cross=no
- else
- ac_cv_prog_cc_cross=yes
- fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char strerror ();
+int
+main ()
+{
+strerror ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_strerror="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
fi
-rm -fr conftest*
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
-cross_compiling=$ac_cv_prog_cc_cross
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
+echo "${ECHO_T}$ac_cv_search_strerror" >&6
+if test "$ac_cv_search_strerror" != no; then
+ test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
-if test $ac_cv_prog_cc_works = no; then
- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2199: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
-cross_compiling=$ac_cv_prog_cc_cross
- for ac_func in $funcs
+
+for ac_func in $funcs
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2206: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2211 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+ LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
fi
done
- echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2261: checking whether alloca needs Cray hooks" >&5
-if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking whether alloca needs Cray hooks" >&5
+echo $ECHO_N "checking whether alloca needs Cray hooks... $ECHO_C" >&6
+if test "${ac_cv_os_cray+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2266 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif
-EOF
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "webecray" >/dev/null 2>&1; then
- rm -rf conftest*
+ $EGREP "webecray" >/dev/null 2>&1; then
ac_cv_os_cray=yes
else
- rm -rf conftest*
ac_cv_os_cray=no
fi
rm -f conftest*
fi
-
-echo "$ac_t""$ac_cv_os_cray" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
- echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2291: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2296 "configure"
-#include "confdefs.h"
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:2319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<EOF
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+
+cat >>confdefs.h <<_ACEOF
#define CRAY_STACKSEG_END $ac_func
-EOF
+_ACEOF
break
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
-echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2345: checking stack direction for C alloca" >&5
-if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+if test "${ac_cv_c_stack_direction+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
ac_cv_c_stack_direction=0
else
- cat > conftest.$ac_ext <<EOF
-#line 2353 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
find_stack_direction ()
{
static char *addr = 0;
@@ -2367,142 +4872,377 @@ main ()
{
exit (find_stack_direction() < 0);
}
-EOF
-if { (eval echo configure:2372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_stack_direction=1
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_c_stack_direction=-1
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_stack_direction=-1
fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
+echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
-echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
-EOF
+_ACEOF
+
- ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2394: checking for vfork.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+
+for ac_header in unistd.h vfork.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
else
- cat > conftest.$ac_ext <<EOF
-#line 2399 "configure"
-#include "confdefs.h"
-#include <vfork.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_VFORK_H 1
-EOF
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
-else
- echo "$ac_t""no" 1>&6
fi
-echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2429: checking for working vfork" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$cross_compiling" = yes; then
- echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:2435: checking for vfork" >&5
-if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2440 "configure"
-#include "confdefs.h"
+done
+
+
+
+for ac_func in fork vfork
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char vfork(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char vfork();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_vfork) || defined (__stub___vfork)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-vfork();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:2463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_vfork=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_vfork=no"
-fi
-rm -f conftest*
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
fi
+done
-if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
+if test "x$ac_cv_func_fork" = xyes; then
+ echo "$as_me:$LINENO: checking for working fork" >&5
+echo $ECHO_N "checking for working fork... $ECHO_C" >&6
+if test "${ac_cv_func_fork_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_fork_works=cross
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* By Ruediger Kuhlmann. */
+ #include <sys/types.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+ /* Some systems only have a dummy stub for fork() */
+ int main ()
+ {
+ if (fork() < 0)
+ exit (1);
+ exit (0);
+ }
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_fork_works=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_fork_works=no
+fi
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
+echo "${ECHO_T}$ac_cv_func_fork_works" >&6
+
+else
+ ac_cv_func_fork_works=$ac_cv_func_fork
+fi
+if test "x$ac_cv_func_fork_works" = xcross; then
+ case $host in
+ *-*-amigaos* | *-*-msdosdjgpp*)
+ # Override, as these systems have only a dummy fork() stub
+ ac_cv_func_fork_works=no
+ ;;
+ *)
+ ac_cv_func_fork_works=yes
+ ;;
+ esac
+ { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
+echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
fi
-
ac_cv_func_vfork_works=$ac_cv_func_vfork
+if test "x$ac_cv_func_vfork" = xyes; then
+ echo "$as_me:$LINENO: checking for working vfork" >&5
+echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
+if test "${ac_cv_func_vfork_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2485 "configure"
-#include "confdefs.h"
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_vfork_works=cross
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#include <sys/wait.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
#endif
-#ifdef HAVE_VFORK_H
-#include <vfork.h>
+#if HAVE_VFORK_H
+# include <vfork.h>
#endif
/* On some sparc systems, changes by the child to local and incoming
- argument registers are propagated back to the parent.
- The compiler is told about this with #include <vfork.h>,
- but some compilers (e.g. gcc -O) don't grok <vfork.h>.
- Test for this by using a static variable whose address
- is put into a register that is clobbered by the vfork. */
-static
+ argument registers are propagated back to the parent. The compiler
+ is told about this with #include <vfork.h>, but some compilers
+ (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
+ static variable whose address is put into a register that is
+ clobbered by the vfork. */
+static void
#ifdef __cplusplus
sparc_address_test (int arg)
-#else
+# else
sparc_address_test (arg) int arg;
#endif
{
@@ -2520,25 +5260,27 @@ sparc_address_test (arg) int arg;
}
}
}
-main() {
+
+int
+main ()
+{
pid_t parent = getpid ();
pid_t child;
- sparc_address_test ();
+ sparc_address_test (0);
child = vfork ();
if (child == 0) {
- /* Here is another test for sparc vfork register problems.
- This test uses lots of local variables, at least
- as many local variables as main has allocated so far
- including compiler temporaries. 4 locals are enough for
- gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
- A buggy compiler should reuse the register of parent
- for one of the local variables, since it will think that
- parent can't possibly be used any more in this routine.
- Assigning to the local variable will thus munge parent
- in the parent process. */
+ /* Here is another test for sparc vfork register problems. This
+ test uses lots of local variables, at least as many local
+ variables as main has allocated so far including compiler
+ temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
+ 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
+ reuse the register of parent for one of the local variables,
+ since it will think that parent can't possibly be used any more
+ in this routine. Assigning to the local variable will thus
+ munge parent in the parent process. */
pid_t
p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
@@ -2548,11 +5290,10 @@ main() {
|| p != p5 || p != p6 || p != p7)
_exit(1);
- /* On some systems (e.g. IRIX 3.3),
- vfork doesn't separate parent from child file descriptors.
- If the child closes a descriptor before it execs or exits,
- this munges the parent's descriptor as well.
- Test for this by closing stdout in the child. */
+ /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
+ from child file descriptors. If the child closes a descriptor
+ before it execs or exits, this munges the parent's descriptor
+ as well. Test for this by closing stdout in the child. */
_exit(close(fileno(stdout)) != 0);
} else {
int status;
@@ -2575,279 +5316,470 @@ main() {
);
}
}
-EOF
-if { (eval echo configure:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_func_vfork_works=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_vfork_works=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_vfork_works=no
fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
+echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
+fi;
+if test "x$ac_cv_func_fork_works" = xcross; then
+ ac_cv_func_vfork_works=ac_cv_func_vfork
+ { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
+echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
fi
-echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
-if test $ac_cv_func_vfork_works = no; then
- cat >> confdefs.h <<\EOF
+if test "x$ac_cv_func_vfork_works" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WORKING_VFORK 1
+_ACEOF
+
+else
+
+cat >>confdefs.h <<\_ACEOF
#define vfork fork
-EOF
+_ACEOF
+
+fi
+if test "x$ac_cv_func_fork_works" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WORKING_FORK 1
+_ACEOF
fi
if test $ac_cv_func_vfork_works = no; then
- LIBOBJS="$LIBOBJS vfork.o"
+ LIBOBJS="$LIBOBJS vfork.$ac_objext"
fi
# We only need _doprnt if we might use it to implement v*printf.
if test $ac_cv_func_vprintf != yes \
|| test $ac_cv_func_vfprintf != yes \
|| test $ac_cv_func_vsprintf != yes; then
- for ac_func in _doprnt
+
+for ac_func in _doprnt
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2612: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2617 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:2640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
-
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+ LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
fi
done
else
- for ac_func in _doprnt
+
+for ac_func in _doprnt
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2670: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2675 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:2698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
fi
for v in $vars; do
- echo $ac_n "checking for $v""... $ac_c" 1>&6
-echo "configure:2726: checking for $v" >&5
- if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2731 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for $v" >&5
+echo $ECHO_N "checking for $v... $ECHO_C" >&6
+ if eval "test \"\${libiberty_cv_var_$v+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
int *p;
-int main() {
+int
+main ()
+{
extern int $v []; p = $v;
-; return 0; }
-EOF
-if { (eval echo configure:2738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
eval "libiberty_cv_var_$v=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "libiberty_cv_var_$v=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "libiberty_cv_var_$v=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
+ cat >>confdefs.h <<_ACEOF
#define $n 1
-EOF
+_ACEOF
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
done
# special check for _system_configuration because AIX <4.3.2 do not
# contain the `physmem' member.
- echo $ac_n "checking for external symbol _system_configuration""... $ac_c" 1>&6
-echo "configure:2765: checking for external symbol _system_configuration" >&5
- cat > conftest.$ac_ext <<EOF
-#line 2767 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for external symbol _system_configuration" >&5
+echo $ECHO_N "checking for external symbol _system_configuration... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/systemcfg.h>
-int main() {
+int
+main ()
+{
double x = _system_configuration.physmem;
-; return 0; }
-EOF
-if { (eval echo configure:2774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE__SYSTEM_CONFIGURATION 1
-EOF
+_ACEOF
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+
- for ac_func in $checkfuncs
+for ac_func in $checkfuncs
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2792: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2797 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
- echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
-echo "configure:2845: checking whether canonicalize_file_name must be declared" >&5
-if eval "test \"`echo '$''{'libiberty_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking whether canonicalize_file_name must be declared" >&5
+echo $ECHO_N "checking whether canonicalize_file_name must be declared... $ECHO_C" >&6
+if test "${libiberty_cv_decl_needed_canonicalize_file_name+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2850 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include "confdefs.h"
#include <stdio.h>
@@ -2864,27 +5796,43 @@ else
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-int main() {
+int
+main ()
+{
char *(*pfn) = (char *(*)) canonicalize_file_name
-; return 0; }
-EOF
-if { (eval echo configure:2872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
libiberty_cv_decl_needed_canonicalize_file_name=no
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- libiberty_cv_decl_needed_canonicalize_file_name=yes
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+libiberty_cv_decl_needed_canonicalize_file_name=yes
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-echo "$ac_t""$libiberty_cv_decl_needed_canonicalize_file_name" 1>&6
+echo "$as_me:$LINENO: result: $libiberty_cv_decl_needed_canonicalize_file_name" >&5
+echo "${ECHO_T}$libiberty_cv_decl_needed_canonicalize_file_name" >&6
if test $libiberty_cv_decl_needed_canonicalize_file_name = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
-EOF
+_ACEOF
fi
@@ -2900,112 +5848,264 @@ case "${host}" in
esac
-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+if test x$gcc_no_link = xyes; then
+ if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
+ ac_cv_func_mmap_fixed_mapped=no
+ fi
+fi
+if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
+
+
+for ac_header in stdlib.h unistd.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2908: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2913 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-rm -f conftest*
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
fi
+
done
+
for ac_func in getpagesize
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2947: checking for $ac_func" >&5
-if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 2952 "configure"
-#include "confdefs.h"
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test x$gcc_no_link = xyes; then
+ { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
+echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. Under hpux,
+ including <limits.h> includes <sys/time.h> and causes problems
+ checking for functions defined therein. */
+#if defined (__STDC__) && !defined (_HPUX_SOURCE)
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:2975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
-fi
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
fi
done
-echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3000: checking for working mmap" >&5
-if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_mmap_fixed_mapped=no
else
- cat > conftest.$ac_ext <<EOF
-#line 3008 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
/* Thanks to Mike Haertel and Jim Avera for this test.
Here is a matrix of mmap possibilities:
@@ -3019,47 +6119,34 @@ else
back from the file, nor mmap's back from the file at a different
address. (There have been systems where private was not correctly
implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the filesystem buffer cache
+ VM page cache was not coherent with the file system buffer cache
like early versions of FreeBSD and possibly contemporary NetBSD.)
For shared mappings, we should conversely verify that changes get
- propogated back to all the places they're supposed to be.
+ propagated back to all the places they're supposed to be.
Grep wants private fixed already mapped.
The main things grep needs to know about mmap are:
* does it exist and is it safe to write into the mmap'd area
* how to use it (BSD variants) */
-#include <sys/types.h>
+
#include <fcntl.h>
#include <sys/mman.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
+#if !STDC_HEADERS && !HAVE_STDLIB_H
+char *malloc ();
#endif
/* This mess was copied from the GNU getpagesize.h. */
-#ifndef HAVE_GETPAGESIZE
-
+#if !HAVE_GETPAGESIZE
/* Assume that all systems that can run configure have sys/param.h. */
-# ifndef HAVE_SYS_PARAM_H
+# if !HAVE_SYS_PARAM_H
# define HAVE_SYS_PARAM_H 1
# endif
# ifdef _SC_PAGESIZE
# define getpagesize() sysconf(_SC_PAGESIZE)
# else /* no _SC_PAGESIZE */
-# ifdef HAVE_SYS_PARAM_H
+# if HAVE_SYS_PARAM_H
# include <sys/param.h>
# ifdef EXEC_PAGESIZE
# define getpagesize() EXEC_PAGESIZE
@@ -3086,111 +6173,114 @@ else
#endif /* no HAVE_GETPAGESIZE */
-#ifdef __cplusplus
-extern "C" { void *malloc(unsigned); }
-#else
-char *malloc();
-#endif
-
int
-main()
+main ()
{
- char *data, *data2, *data3;
- int i, pagesize;
- int fd;
-
- pagesize = getpagesize();
-
- /*
- * First, make a file with some known garbage in it.
- */
- data = malloc(pagesize);
- if (!data)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- *(data + i) = rand();
- umask(0);
- fd = creat("conftestmmap", 0600);
- if (fd < 0)
- exit(1);
- if (write(fd, data, pagesize) != pagesize)
- exit(1);
- close(fd);
-
- /*
- * Next, try to mmap the file at a fixed address which
- * already has something else allocated at it. If we can,
- * also make sure that we see the same garbage.
- */
- fd = open("conftestmmap", O_RDWR);
- if (fd < 0)
- exit(1);
- data2 = malloc(2 * pagesize);
- if (!data2)
- exit(1);
- data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
- if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data2 + i))
- exit(1);
-
- /*
- * Finally, make sure that changes to the mapped area
- * do not percolate back to the file as seen by read().
- * (This is a bug on some variants of i386 svr4.0.)
- */
- for (i = 0; i < pagesize; ++i)
- *(data2 + i) = *(data2 + i) + 1;
- data3 = malloc(pagesize);
- if (!data3)
- exit(1);
- if (read(fd, data3, pagesize) != pagesize)
- exit(1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data3 + i))
- exit(1);
- close(fd);
- unlink("conftestmmap");
- exit(0);
-}
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
-EOF
-if { (eval echo configure:3161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+ pagesize = getpagesize ();
+
+ /* First, make a file with some known garbage in it. */
+ data = (char *) malloc (pagesize);
+ if (!data)
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ *(data + i) = rand ();
+ umask (0);
+ fd = creat ("conftest.mmap", 0600);
+ if (fd < 0)
+ exit (1);
+ if (write (fd, data, pagesize) != pagesize)
+ exit (1);
+ close (fd);
+
+ /* Next, try to mmap the file at a fixed address which already has
+ something else allocated at it. If we can, also make sure that
+ we see the same garbage. */
+ fd = open ("conftest.mmap", O_RDWR);
+ if (fd < 0)
+ exit (1);
+ data2 = (char *) malloc (2 * pagesize);
+ if (!data2)
+ exit (1);
+ data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+ if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data2 + i))
+ exit (1);
+
+ /* Finally, make sure that changes to the mapped area do not
+ percolate back to the file as seen by read(). (This is a bug on
+ some variants of i386 svr4.0.) */
+ for (i = 0; i < pagesize; ++i)
+ *(data2 + i) = *(data2 + i) + 1;
+ data3 = (char *) malloc (pagesize);
+ if (!data3)
+ exit (1);
+ if (read (fd, data3, pagesize) != pagesize)
+ exit (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data3 + i))
+ exit (1);
+ close (fd);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_func_mmap_fixed_mapped=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_mmap_fixed_mapped=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_mmap_fixed_mapped=no
fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
-
-echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
if test $ac_cv_func_mmap_fixed_mapped = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_MMAP 1
-EOF
+_ACEOF
fi
+rm -f conftest.mmap
+fi
-echo $ac_n "checking for working strncmp""... $ac_c" 1>&6
-echo "configure:3185: checking for working strncmp" >&5
-if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for working strncmp" >&5
+echo $ECHO_N "checking for working strncmp... $ECHO_C" >&6
+if test "${ac_cv_func_strncmp_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
ac_cv_func_strncmp_works=no
else
- cat > conftest.$ac_ext <<EOF
-#line 3193 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* Test by Jim Wilson and Kaveh Ghazi.
Check whether strncmp reads past the end of its string parameters. */
@@ -3230,7 +6320,7 @@ main ()
dev_zero = open ("/dev/zero", O_RDONLY);
if (dev_zero < 0)
exit (1);
-
+
p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
MAP_ANON|MAP_PRIVATE, dev_zero, 0);
if (p == (char *)-1)
@@ -3252,25 +6342,35 @@ main ()
exit (0);
}
-EOF
-if { (eval echo configure:3257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_func_strncmp_works=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_strncmp_works=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_strncmp_works=no
fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
rm -f core core.* *.core
fi
-
-echo "$ac_t""$ac_cv_func_strncmp_works" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_func_strncmp_works" >&5
+echo "${ECHO_T}$ac_cv_func_strncmp_works" >&6
if test $ac_cv_func_strncmp_works = no ; then
- LIBOBJS="$LIBOBJS strncmp.o"
+ LIBOBJS="$LIBOBJS strncmp.$ac_objext"
fi
@@ -3284,396 +6384,1167 @@ fi
# We need multilib support, but only if configuring for the target.
-trap '' 1 2 15
-cat > confcache <<\EOF
+ ac_config_files="$ac_config_files Makefile testsuite/Makefile"
+ ac_config_commands="$ac_config_commands default"
+cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
#
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote substitution
- # turns \\\\ into \\, and sed turns \\ into \).
- sed -n \
- -e "s/'/'\\\\''/g" \
- -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
- ;;
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
- ;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
-else
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
else
echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
-
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
fi
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
DEFS=-DHAVE_CONFIG_H
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
+# configure, is in config.log if it exists.
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
done
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
-trap 'rm -fr `echo "Makefile testsuite/Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
-$ac_vpsub
-$extrasub
-s%@SHELL@%$SHELL%g
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@FFLAGS@%$FFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@bindir@%$bindir%g
-s%@sbindir@%$sbindir%g
-s%@libexecdir@%$libexecdir%g
-s%@datadir@%$datadir%g
-s%@sysconfdir@%$sysconfdir%g
-s%@sharedstatedir@%$sharedstatedir%g
-s%@localstatedir@%$localstatedir%g
-s%@libdir@%$libdir%g
-s%@includedir@%$includedir%g
-s%@oldincludedir@%$oldincludedir%g
-s%@infodir@%$infodir%g
-s%@mandir@%$mandir%g
-s%@libiberty_topdir@%$libiberty_topdir%g
-s%@MAINT@%$MAINT%g
-s%@NOTMAINT@%$NOTMAINT%g
-s%@MAKEINFO@%$MAKEINFO%g
-s%@BUILD_INFO@%$BUILD_INFO%g
-s%@PERL@%$PERL%g
-s%@HAVE_PERL@%$HAVE_PERL%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@build@%$build%g
-s%@build_alias@%$build_alias%g
-s%@build_cpu@%$build_cpu%g
-s%@build_vendor@%$build_vendor%g
-s%@build_os@%$build_os%g
-s%@AR@%$AR%g
-s%@RANLIB@%$RANLIB%g
-s%@CC@%$CC%g
-s%@ac_libiberty_warn_cflags@%$ac_libiberty_warn_cflags%g
-s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g
-s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-/@host_makefile_frag@/r $host_makefile_frag
-s%@host_makefile_frag@%%g
-s%@CPP@%$CPP%g
-s%@CHECK@%$CHECK%g
-s%@target_header_dir@%$target_header_dir%g
-s%@LIBOBJS@%$LIBOBJS%g
-s%@pexecute@%$pexecute%g
-s%@INSTALL_DEST@%$INSTALL_DEST%g
-CEOF
-EOF
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
-cat >> $CONFIG_STATUS <<\EOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ as_ln_s='ln -s'
fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.57,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
-EOF
-cat >> $CONFIG_STATUS <<EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
-CONFIG_FILES=\${CONFIG_FILES-"Makefile testsuite/Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+srcdir=${srcdir}
+host=${host}
+target=${target}
+with_target_subdir=${with_target_subdir}
+with_build_subdir=${with_build_subdir}
+with_multisubdir=${with_multisubdir}
+ac_configure_args="--enable-multilib ${ac_configure_args}"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
+libiberty_topdir=${libiberty_topdir}
+
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "testsuite/Makefile" ) CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
+ "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
esac
+done
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@libiberty_topdir@,$libiberty_topdir,;t t
+s,@MAINT@,$MAINT,;t t
+s,@NOTMAINT@,$NOTMAINT,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@BUILD_INFO@,$BUILD_INFO,;t t
+s,@PERL@,$PERL,;t t
+s,@HAVE_PERL@,$HAVE_PERL,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@ac_libiberty_warn_cflags@,$ac_libiberty_warn_cflags,;t t
+s,@NO_MINUS_C_MINUS_O@,$NO_MINUS_C_MINUS_O,;t t
+s,@OUTPUT_OPTION@,$OUTPUT_OPTION,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@CHECK@,$CHECK,;t t
+s,@target_header_dir@,$target_header_dir,;t t
+s,@pexecute@,$pexecute,;t t
+s,@INSTALL_DEST@,$INSTALL_DEST,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+/@host_makefile_frag@/r $host_makefile_frag
+s,@host_makefile_frag@,,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
fi
+fi # test -n "$CONFIG_FILES"
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
-EOF
-cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="config.h:config.in"
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. And first:
-# Protect against being on the right side of a sed subst in config.status.
-# Protect against being in an unquoted here document in config.status.
-rm -f conftest.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
rm -f conftest.tail
-while :
+while grep . conftest.undefs >/dev/null
do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
echo 'CEOF
- sed -f conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
fi
-fi; done
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
-EOF
-cat >> $CONFIG_STATUS <<EOF
-srcdir=${srcdir}
-host=${host}
-target=${target}
-with_target_subdir=${with_target_subdir}
-with_build_subdir=${with_build_subdir}
-with_multisubdir=${with_multisubdir}
-ac_configure_args="--enable-multilib ${ac_configure_args}"
-CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
-libiberty_topdir=${libiberty_topdir}
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ default ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
if test -n "$CONFIG_FILES"; then
if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
# FIXME: We shouldn't need to set ac_file
@@ -3681,10 +7552,37 @@ if test -n "$CONFIG_FILES"; then
LD="${ORIGINAL_LD_FOR_MULTILIBS}"
. ${libiberty_topdir}/config-ml.in
fi
-fi
-exit 0
-EOF
+fi ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
diff --git a/libiberty/configure.in b/libiberty/configure.in
index 5dca13ed6f6..56e8a198321 100644
--- a/libiberty/configure.in
+++ b/libiberty/configure.in
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script
-AC_PREREQ(2.13)
+AC_PREREQ(2.57)
AC_INIT(xmalloc.c)
# This works around the fact that libtool configuration may change LD
@@ -99,7 +99,13 @@ dnl to call AC_CHECK_PROG.
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
-LIB_AC_PROG_CC
+GCC_NO_EXECUTABLES
+AC_PROG_CC
+
+if test x$GCC = xyes; then
+ ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
+fi
+AC_SUBST(ac_libiberty_warn_cflags)
AC_PROG_CC_C_O
# autoconf is lame and doesn't give us any substitution variable for this.
@@ -111,7 +117,6 @@ fi
AC_SUBST(NO_MINUS_C_MINUS_O)
AC_SUBST(OUTPUT_OPTION)
-AC_ISC_POSIX
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN_CROSS
@@ -250,7 +255,12 @@ if test -n "${with_target_subdir}"; then
# newlib provide and which ones we will be expected to provide.
if test "x${with_newlib}" = "xyes"; then
- LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
+ AC_LIBOBJ([asprintf])
+ AC_LIBOBJ([basename])
+ AC_LIBOBJ([insque])
+ AC_LIBOBJ([random])
+ AC_LIBOBJ([strdup])
+ AC_LIBOBJ([vasprintf])
for f in $funcs; do
case "$f" in
@@ -318,8 +328,16 @@ if test -z "${setobjs}"; then
# Handle VxWorks configuration specially, since on VxWorks the
# libraries are actually on the target board, not in the file
# system.
- LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
- LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
+ AC_LIBOBJ([basename])
+ AC_LIBOBJ([getpagesize])
+ AC_LIBOBJ([insque])
+ AC_LIBOBJ([random])
+ AC_LIBOBJ([strcasecmp])
+ AC_LIBOBJ([strncasecmp])
+ AC_LIBOBJ([strdup])
+ AC_LIBOBJ([vfork])
+ AC_LIBOBJ([waitpid])
+ AC_LIBOBJ([vasprintf])
for f in $funcs; do
case "$f" in
basename | getpagesize | insque | random | strcasecmp)
@@ -366,7 +384,7 @@ if test -z "${setobjs}"; then
if test -n "${with_target_subdir}"
then
funcs="`echo $funcs | sed -e 's/random//'`"
- LIBOBJS="$LIBOBJS random.o"
+ AC_LIBOBJ([random])
vars="`echo $vars | sed -e 's/sys_siglist//'`"
checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
fi
@@ -402,12 +420,12 @@ if test -z "${setobjs}"; then
# We haven't set the list of objects yet. Use the standard autoconf
# tests. This will only work if the compiler works.
- AC_PROG_CC_WORKS
+ AC_ISC_POSIX
AC_REPLACE_FUNCS($funcs)
libiberty_AC_FUNC_C_ALLOCA
AC_FUNC_VFORK
if test $ac_cv_func_vfork_works = no; then
- LIBOBJS="$LIBOBJS vfork.o"
+ AC_LIBOBJ([vfork])
fi
# We only need _doprnt if we might use it to implement v*printf.
if test $ac_cv_func_vprintf != yes \
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 5dcce5560ee..bd4882239fb 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -2,9 +2,9 @@
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
Written by Alex Samuel <samuel@codesourcery.com>.
- This file is part of GNU CC.
+ This file is part of the libiberty library, which is part of GCC.
- This program is free software; you can redistribute it and/or modify
+ This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
diff --git a/libiberty/fibheap.c b/libiberty/fibheap.c
index 36062d451a2..bcecf80251f 100644
--- a/libiberty/fibheap.c
+++ b/libiberty/fibheap.c
@@ -218,7 +218,7 @@ fibheap_replace_key_data (heap, node, key, data)
void *data;
{
void *odata;
- int okey;
+ fibheapkey_t okey;
fibnode_t y;
/* If we wanted to, we could actually do a real increase by redeleting and
diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c
index d69024f7390..ee87e273415 100644
--- a/libiberty/floatformat.c
+++ b/libiberty/floatformat.c
@@ -1,5 +1,5 @@
/* IEEE floating point support routines, for GDB, the GNU Debugger.
- Copyright (C) 1991, 1994, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1994, 1999, 2000, 2003 Free Software Foundation, Inc.
This file is part of GDB.
@@ -143,17 +143,17 @@ const struct floatformat floatformat_ia64_quad_little =
"floatformat_ia64_quad_little"
};
-static unsigned long get_field PARAMS ((unsigned char *,
+static unsigned long get_field PARAMS ((const unsigned char *,
enum floatformat_byteorders,
unsigned int,
unsigned int,
unsigned int));
-/* Extract a field which starts at START and is LEN bytes long. DATA and
+/* Extract a field which starts at START and is LEN bits long. DATA and
TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */
static unsigned long
get_field (data, order, total_len, start, len)
- unsigned char *data;
+ const unsigned char *data;
enum floatformat_byteorders order;
unsigned int total_len;
unsigned int start;
@@ -207,10 +207,10 @@ get_field (data, order, total_len, start, len)
void
floatformat_to_double (fmt, from, to)
const struct floatformat *fmt;
- char *from;
+ const char *from;
double *to;
{
- unsigned char *ufrom = (unsigned char *)from;
+ const unsigned char *ufrom = (const unsigned char *)from;
double dto;
long exponent;
unsigned long mant;
@@ -273,7 +273,7 @@ static void put_field PARAMS ((unsigned char *, enum floatformat_byteorders,
unsigned int,
unsigned long));
-/* Set a field which starts at START and is LEN bytes long. DATA and
+/* Set a field which starts at START and is LEN bits long. DATA and
TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */
static void
put_field (data, order, total_len, start, len, stuff_to_put)
@@ -331,7 +331,7 @@ put_field (data, order, total_len, start, len, stuff_to_put)
void
floatformat_from_double (fmt, from, to)
const struct floatformat *fmt;
- double *from;
+ const double *from;
char *to;
{
double dfrom;
@@ -404,6 +404,39 @@ floatformat_from_double (fmt, from, to)
}
}
+/* Return non-zero iff the data at FROM is a valid number in format FMT. */
+
+int
+floatformat_is_valid (fmt, from)
+ const struct floatformat *fmt;
+ const char *from;
+{
+ if (fmt == &floatformat_i387_ext)
+ {
+ /* In the i387 double-extended format, if the exponent is all
+ ones, then the integer bit must be set. If the exponent
+ is neither 0 nor ~0, the intbit must also be set. Only
+ if the exponent is zero can it be zero, and then it must
+ be zero. */
+ unsigned long exponent, int_bit;
+ const unsigned char *ufrom = (const unsigned char *) from;
+
+ exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
+ fmt->exp_start, fmt->exp_len);
+ int_bit = get_field (ufrom, fmt->byteorder, fmt->totalsize,
+ fmt->man_start, 1);
+
+ if ((exponent == 0) != (int_bit == 0))
+ return 0;
+ else
+ return 1;
+ }
+
+ /* Other formats with invalid representations should be added
+ here. */
+ return 1;
+}
+
#ifdef IEEE_DEBUG
diff --git a/missing b/missing
index 7789652e877..25c96676def 100755
--- a/missing
+++ b/missing
@@ -1,7 +1,7 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,11 +18,37 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+case "$1" in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
@@ -35,6 +61,7 @@ error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
@@ -43,13 +70,15 @@ Supported PROGRAM values:
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing - GNU libit 0.0"
+ echo "missing 0.4 - GNU automake"
;;
-*)
@@ -58,31 +87,46 @@ Supported PROGRAM values:
exit 1
;;
- aclocal)
+ aclocal*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acinclude.m4' or \`configure.in'. You might want
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`configure.in'. You might want to install the
+ you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acconfig.h' or \`configure.in'. You might want
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
@@ -95,10 +139,15 @@ WARNING: \`$1' is missing on your system. You should only need it if
touch $touch_files
;;
- automake)
+ automake*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
@@ -106,6 +155,34 @@ WARNING: \`$1' is missing on your system. You should only need it if
while read f; do touch "$f"; done
;;
+ autom4te)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
@@ -159,7 +236,37 @@ WARNING: \`$1' is missing on your system. You should only need it if
fi
;;
+ help2man)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
makeinfo)
+ if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+ # We have makeinfo, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
@@ -175,6 +282,45 @@ WARNING: \`$1' is missing on your system. You should only need it if
touch $file
;;
+ tar)
+ shift
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ fi
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 7c8edbd5db3..9b109a6e3b6 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,212 @@
+2003-09-14 Andreas Jaeger <aj@suse.de>
+
+ * i386-dis.c: Convert to ISO C90 prototypes.
+ * i370-dis.c: Likewise.
+ * i370-opc.c: Likewiwse.
+ * i960-dis.c: Likewise.
+ * ia64-opc.c: Likewise.
+
+2003-09-09 Dave Brolley <brolley@redhat.com>
+
+ * frv-desc.c: Regenerated.
+
+2003-09-08 Dave Brolley <brolley@redhat.com>
+
+ On behalf of Doug Evans <dje@sebabeach.org>
+ * Makefile.am (run-cgen): Pass new args archfile and opcfile
+ to cgen.sh.
+ (stamp-ip2k,stamp-m32r,stamp-fr30,stamp-frv,stamp-openrisc,
+ stamp-iq2000,stamp-xstormy16): Pass paths of .cpu and .opc files
+ to cgen.sh.
+ (stamp-frv): Delete hardcoded path spec workaround.
+ * Makefile.in: Regenerate.
+ * cgen.sh: New args archfile and opcfile. Pass on to cgen.
+
+2003-09-04 Nick Clifton <nickc@redhat.com>
+
+ * v850-dis.c (disassemble): Accept bfd_mach_v850e1.
+ * v850-opc.c (v850_opcodes): Add DBTRAP and DBRET instructions.
+
+2003-09-04 Alan Modra <amodra@bigpond.net.au>
+
+ * ppc-dis.c (struct dis_private): New.
+ (powerpc_dialect): Make static. Accept -Many in addition to existing
+ options. Save dialect in dis_private.
+ (print_insn_big_powerpc): Retrieve dialect from dis_private.
+ (print_insn_little_powerpc): Likewise.
+ (print_insn_powerpc): Call powpc_dialect here. Remove unnecessary
+ efs/altivec check. Try harder to disassemble if given -Many.
+ * ppc-opc.c (insert_fxm): Expand comment.
+ (PPC, PPCCOM, PPC32, PPC64, PPCVEC): Remove PPC_OPCODE_ANY.
+ (POWER, POWER2, PPCPWR2, POWER32, COM, COM32, M601, PWRCOM): Likewise.
+ (POWER4): Remove PPCCOM.
+ (PPCONLY): Don't define. Update all occurrences to PPC.
+
+2003-09-03 Andrew Cagney <cagney@redhat.com>
+
+ * dis-init.c (init_disassemble_info): New file and function.
+ * Makefile.am (CFILES): Add "dis-init.c".
+ (libopcodes_la_SOURCES): Add "dis-init.c".
+ (dis-init.lo): Specify dependencies.
+ * Makefile.in: Regenerate.
+
+2003-09-03 Dave Brolley <brolley@redhat.com>
+
+ * frv-*: Regenerated.
+
+2003-09-02 Alan Modra <amodra@bigpond.net.au>
+
+ * ppc-opc.c (powerpc_opcodes): Combine identical PPC403/BOOKE entries.
+ Move duplicate mnemonic entries together. Use RS instead of RT on
+ all mt*.
+ * ppc-dis.c: Convert to ISO C.
+
+2003-08-29 Dave Brolley <brolley@redhat.com>
+
+ * Makefile.am (stamp-frv): Copy frv.cpu and frv.opc from
+ $(srcdir)/../cpu temporarily when regenerating source files.
+ * Makefile.in: Regenerated.
+
+2003-08-19 Nick Clifton <nickc@redhat.com>
+
+ * arm-dis.c (print_insn_arm: case 'A'): Add code to
+ disassemble unindexed form of Addressing Mode 5.
+
+2003-08-19 Alan Modra <amodra@bigpond.net.au>
+
+ * ppc-opc.c (PPC440): Define.
+ (powerpc_opcodes): Allow mac*, mul*, nmac*, dccci, dcread, iccci,
+ icread instructions when PPC440. Add dlmzb instruction.
+
+2003-08-14 Alan Modra <amodra@bigpond.net.au>
+
+ * dep-in.sed: Remove libintl.h.
+ * Makefile.am (POTFILES.in): Unset LC_COLLATE.
+ Run "make dep-am".
+ * Makefile.in: Regenerate.
+
+2003-08-07 Michael Meissner <gnu@the-meissners.org>
+
+ * cgen-asm.c (hash_insn_array): Remove PARAMS macro.
+ (hash_insn_list): Ditto.
+ (build_asm_hash_table): Ditto.
+ (cgen_set_parse_operand_fn): Prototype definition.
+ (cgen_init_parse_operand): Ditto.
+ (hash_insn_array): Ditto.
+ (hash_insn_list): Ditto.
+ (build_asm_hash_table): Ditto.
+ (cgen_asm_lookup_insn): Ditto.
+ (cgen_parse_keyword): Ditto.
+ (cgen_parse_signed_integer): Ditto.
+ (cgen_parse_unsigned_integer): Ditto.
+ (cgen_parse_address): Ditto.
+ (cgen_validate_signed_integer): Ditto.
+ (cgen_validate_unsigned_integer): Ditto.
+
+ * cgen-opc.c (hash_keyword_name): Remove PARAMS macro.
+ (hash_keyword_value): Ditto.
+ (build_keyword_hash_tables): Ditto.
+ (cgen_keyword_lookup_name): Prototype definition.
+ (cgen_keyword_lookup_value): Ditto.
+ (cgen_keyword_add): Ditto.
+ (cgen_keyword_search_init): Ditto.
+ (cgen_keyword_search_next): Ditto.
+ (hash_keyword_name): Ditto.
+ (hash_keyword_value): Ditto.
+ (build_keyword_hash_tables): Ditto.
+ (cgen_hw_lookup_by_name): Ditto.
+ (cgen_hw_lookup_by_num): Ditto.
+ (cgen_operand_lookup_by_name): Ditto.
+ (cgen_operand_lookup_by_num): Ditto.
+ (cgen_insn_count): Ditto.
+ (cgen_macro_insn_count): Ditto.
+ (cgen_get_insn_value): Ditto.
+ (cgen_put_insn_value): Ditto.
+ (cgen_lookup_insn): Ditto.
+ (cgen_get_insn_operands): Ditto.
+ (cgen_lookup_get_insn_operands): Ditto.
+ (cgen_set_signed_overflow_ok): Ditto.
+ (cgen_clear_signed_overflow_ok): Ditto.
+ (cgen_signed_overflow_ok_p): Ditto.
+
+ * cgen-dis.c (hash_insn_array): Remove PARAMS macro.
+ (hash_insn_list): Ditto.
+ (build_dis_hash_table): Ditto.
+ (count_decodable_bits): Ditto.
+ (add_insn_to_hash_chain): Ditto.
+ (count_decodable_bits): Prototype definition.
+ (add_insn_to_hash_chain): Ditto.
+ (hash_insn_array): Ditto.
+ (hash_insn_list): Ditto.
+ (build_dis_hash_table): Ditto.
+ (cgen_dis_lookup_insn): Ditto.
+
+ * cgen-asm.in (parse_insn_normal): Remove PARAMS macro.
+ (@arch@_cgen_build_insn_regex): Prototype definition.
+ (parse_insn_normal): Ditto.
+ (@arch@_cgen_assemble_insn): Ditto.
+ (@arch@_cgen_asm_hash_keywords): Ditto.
+
+ * cgen-dis.in (print_normal): Remove PARAMS macro. Use void *
+ instead of PTR.
+ (print_address): Ditto.
+ (print_keyword): Ditto.
+ (print_insn_normal): Ditto.
+ (print_insn): Ditto.
+ (default_print_insn): Ditto.
+ (read_insn): Ditto.
+ (print_normal): Prototype definition. Use void * instead of PTR.
+ (print_address): Ditto.
+ (print_keyword): Ditto.
+ (print_insn_normal): Ditto.
+ (read_insn): Ditto.
+ (print_insn): Ditto.
+ (default_print_insn): Ditto.
+ (print_insn_@arch@): Ditto.
+
+ * cgen-ibld.in (insert_normal): Remove PARAMS macro.
+ (insn_insn_normal): Ditto.
+ (extract_normal): Ditto.
+ (extract_insn_normal): Ditto.
+ (put_insn_int_value): Ditto.
+ (insert_1): Ditto.
+ (fill_cache): Ditto.
+ (extract_1): Ditto.
+ (insert_1): Prototype definition.
+ (insert_normal): Ditto.
+ (insert_insn_normal): Ditto.
+ (put_insn_int_value): Ditto.
+ (fill_cache): Ditto.
+ (extract_1): Ditto.
+ (extract_normal): Ditto.
+ (extract_insn_normal): Ditto.
+
+ * fr30-asm.c: Regenerate.
+ * fr30-dis.c: Ditto.
+ * fr30-ibld.c: Ditto.
+ * frv-asm.c: Ditto.
+ * frv-dis.c: Ditto.
+ * frv-ibld.c: Ditto.
+ * ip2k-asm.c: Ditto.
+ * ip2k-dis.c: Ditto.
+ * ip2k-ibld.c: Ditto.
+ * iq2000-asm.c: Ditto.
+ * iq2000-dis.c: Ditto.
+ * iq2000-ibld.c: Ditto.
+ * m32r-asm.c: Ditto.
+ * m32r-dis.c: Ditto.
+ * m32r-ibld.c: Ditto.
+ * openrisc-asm.c: Ditto.
+ * openrisc-dis.c: Ditto.
+ * openrisc-ibld.c: Ditto.
+ * xstormy16-asm.c: Ditto.
+ * xstormy16-dis.c: Ditto.
+ * xstormy16-ibld.c: Ditto.
+
+2003-08-06 Nick Clifton <nickc@redhat.com>
+
+ * po/fr.po: Updated French translation.
+
2003-08-05 Nick Clifton <nickc@redhat.com>
* configure.in (ALL_LINGUAS): Add nl.
@@ -6,7 +215,7 @@
2003-07-30 Jason Eckhardt <jle@rice.edu>
- * i860-dis.c: Convert to ISO C90. Remove superflous prototypes.
+ * i860-dis.c: Convert to ISO C90. Remove superflous prototypes.
2003-07-30 Nick Clifton <nickc@redhat.com>
@@ -24,8 +233,8 @@
* arm-dis.c (parse_arm_disassembler_option): Do not expect
option string to be NUL terminated.
- (parse_disassembler_options): Allow options to be space or
- comma separated.
+ (parse_disassembler_options): Allow options to be space or
+ comma separated.
2003-07-17 Nick Clifton <nickc@redhat.com>
diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index 7097be0f8dd..6859a9d4c98 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -63,6 +63,7 @@ CFILES = \
d30v-opc.c \
dlx-dis.c \
dis-buf.c \
+ dis-init.c \
disassemble.c \
fr30-asm.c \
fr30-desc.c \
@@ -281,7 +282,7 @@ INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFI
disassemble.lo: disassemble.c $(INCDIR)/dis-asm.h
$(LIBTOOL) --mode=compile $(COMPILE) -c @archdefs@ $(srcdir)/disassemble.c
-libopcodes_la_SOURCES = dis-buf.c disassemble.c
+libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c
libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
@@ -306,7 +307,7 @@ libopcodes.a: stamp-lib ; @true
POTFILES = $(HFILES) $(CFILES)
po/POTFILES.in: @MAINT@ Makefile
- for file in $(POTFILES); do echo $$file; done | sort > tmp \
+ for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
&& mv tmp $(srcdir)/po/POTFILES.in
# We should reconfigure whenever bfd/configure.in changes, because
@@ -378,8 +379,8 @@ endif
run-cgen:
$(SHELL) $(srcdir)/cgen.sh opcodes $(srcdir) $(CGEN) \
- $(CGENDIR) "$(CGENFLAGS)" $(arch) $(prefix) \
- "$(options)" $(extrafiles)
+ $(CGENDIR) "$(CGENFLAGS)" $(arch) $(prefix) $(archfile) $(opcfile) \
+ "$(options)" "$(extrafiles)"
touch stamp-${prefix}
.PHONY: run-cgen
@@ -395,38 +396,47 @@ run-cgen-all:
$(srcdir)/ip2k-desc.h $(srcdir)/ip2k-desc.c $(srcdir)/ip2k-opc.h $(srcdir)/ip2k-opc.c $(srcdir)/ip2k-ibld.c $(srcdir)/ip2k-asm.c $(srcdir)/ip2k-dis.c: $(IP2K_DEPS)
@true
stamp-ip2k: $(CGENDEPS) $(CPUDIR)/ip2k.cpu $(CPUDIR)/ip2k.opc
- $(MAKE) run-cgen arch=ip2k prefix=ip2k options= extrafiles=
+ $(MAKE) run-cgen arch=ip2k prefix=ip2k options= \
+ archfile=$(CPUDIR)/ip2k.cpu opcfile=$(CPUDIR)/ip2k.opc extrafiles=
$(srcdir)/m32r-desc.h $(srcdir)/m32r-desc.c $(srcdir)/m32r-opc.h $(srcdir)/m32r-opc.c $(srcdir)/m32r-ibld.c $(srcdir)/m32r-opinst.c $(srcdir)/m32r-asm.c $(srcdir)/m32r-dis.c: $(M32R_DEPS)
@true
stamp-m32r: $(CGENDEPS) $(CPUDIR)/m32r.cpu $(CPUDIR)/m32r.opc
- $(MAKE) run-cgen arch=m32r prefix=m32r options=opinst extrafiles=opinst
+ $(MAKE) run-cgen arch=m32r prefix=m32r options=opinst \
+ archfile=$(CPUDIR)/m32r.cpu opcfile=$(CPUDIR)/m32r.opc extrafiles=opinst
$(srcdir)/fr30-desc.h $(srcdir)/fr30-desc.c $(srcdir)/fr30-opc.h $(srcdir)/fr30-opc.c $(srcdir)/fr30-ibld.c $(srcdir)/fr30-asm.c $(srcdir)/fr30-dis.c: $(FR30_DEPS)
@true
stamp-fr30: $(CGENDEPS) $(CPUDIR)/fr30.cpu $(CPUDIR)/fr30.opc
- $(MAKE) run-cgen arch=fr30 prefix=fr30 options= extrafiles=
+ $(MAKE) run-cgen arch=fr30 prefix=fr30 options= \
+ archfile=$(CPUDIR)/fr30.cpu opcfile=$(CPUDIR)/fr30.opc extrafiles=
$(srcdir)/frv-desc.h $(srcdir)/frv-desc.c $(srcdir)/frv-opc.h $(srcdir)/frv-opc.c $(srcdir)/frv-ibld.c $(srcdir)/frv-asm.c $(srcdir)/frv-dis.c: $(FRV_DEPS)
@true
-stamp-frv: $(CGENDEPS) $(CPUDIR)/frv.cpu $(CPUDIR)/frv.opc
- $(MAKE) run-cgen arch=frv prefix=frv options= extrafiles=
+# .cpu and .opc files for frv are kept in a different directory, but cgen has no switch to specify that location, so
+# copy those file to the regular place.
+stamp-frv: $(CGENDEPS) $(srcdir)/../cpu/frv.cpu $(srcdir)/../cpu/frv.opc
+ $(MAKE) run-cgen arch=frv prefix=frv options= \
+ archfile=$(srcdir)/../cpu/frv.cpu opcfile=$(srcdir)/../cpu/frv.opc extrafiles=
$(srcdir)/openrisc-desc.h $(srcdir)/openrisc-desc.c $(srcdir)/openrisc-opc.h $(srcdir)/openrisc-opc.c $(srcdir)/openrisc-ibld.c $(srcdir)/openrisc-asm.c $(srcdir)/openrisc-dis.c: $(OPENRISC_DEPS)
@true
stamp-openrisc: $(CGENDEPS) $(CPUDIR)/openrisc.cpu $(CPUDIR)/openrisc.opc
- $(MAKE) run-cgen arch=openrisc prefix=openrisc options= extrafiles=
+ $(MAKE) run-cgen arch=openrisc prefix=openrisc options= \
+ archfile=$(CPUDIR)/openrisc.cpu opcfile=$(CPUDIR)/openrisc.opc extrafiles=
$(srcdir)/iq2000-desc.h $(srcdir)/iq2000-desc.c $(srcdir)/iq2000-opc.h $(srcdir)/iq2000-opc.c $(srcdir)/iq2000-ibld.c $(srcdir)/iq2000-asm.c $(srcdir)/iq2000-dis.c: $(IQ2000_DEPS)
@true
stamp-iq2000: $(CGENDEPS) $(CPUDIR)/iq2000.cpu $(CPUDIR)/iq2000.opc \
$(CPUDIR)/iq2000m.cpu $(CPUDIR)/iq10.cpu
- $(MAKE) run-cgen arch=iq2000 prefix=iq2000 options= extrafiles=
+ $(MAKE) run-cgen arch=iq2000 prefix=iq2000 options= \
+ archfile=$(CPUDIR)/iq2000.cpu opcfile=$(CPUDIR)/iq2000.opc extrafiles=
$(srcdir)/xstormy16-desc.h $(srcdir)/xstormy16-desc.c $(srcdir)/xstormy16-opc.h $(srcdir)/xstormy16-opc.c $(srcdir)/xstormy16-ibld.c $(srcdir)/xstormy16-asm.c $(srcdir)/xstormy16-dis.c: $(XSTORMY16_DEPS)
@true
stamp-xstormy16: $(CGENDEPS) $(CPUDIR)/xstormy16.cpu $(CPUDIR)/xstormy16.opc
- $(MAKE) run-cgen arch=xstormy16 prefix=xstormy16 options= extrafiles=
+ $(MAKE) run-cgen arch=xstormy16 prefix=xstormy16 options= \
+ archfile=$(CPUDIR)/xstormy16.cpu opcfile=$(CPUDIR)/xstormy16.opc extrafiles=
ia64-gen: ia64-gen.o
$(LINK) ia64-gen.o $(LIBIBERTY)
@@ -515,9 +525,9 @@ arc-ext.lo: arc-ext.c sysdep.h config.h $(INCDIR)/ansidecl.h \
arm-dis.lo: arm-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h arm-opc.h \
$(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- opintl.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/arm.h \
- $(INCDIR)/elf/reloc-macros.h
+ opintl.h $(INCDIR)/safe-ctype.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h
avr-dis.lo: avr-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h \
$(INCDIR)/libiberty.h $(INCDIR)/opcode/avr.h
@@ -547,6 +557,8 @@ dlx-dis.lo: dlx-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/dlx.h
dis-buf.lo: dis-buf.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h
+dis-init.lo: dis-init.c sysdep.h config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h
disassemble.lo: disassemble.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h
fr30-asm.lo: fr30-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \
@@ -624,7 +636,7 @@ ia64-gen.lo: ia64-gen.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h sysdep.h config.h $(INCDIR)/getopt.h \
ia64-opc.h $(INCDIR)/opcode/ia64.h $(BFD_H) $(INCDIR)/symcat.h \
ia64-opc-a.c ia64-opc-i.c ia64-opc-m.c ia64-opc-b.c \
- ia64-opc-f.c ia64-opc-x.c ia64-opc-d.c ../intl/libintl.h
+ ia64-opc-f.c ia64-opc-x.c ia64-opc-d.c
ia64-asmtab.lo: ia64-asmtab.c
ip2k-asm.lo: ip2k-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h $(INCDIR)/opcode/cgen.h \
diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in
index a9875a1e5a6..57aee2dcbb5 100644
--- a/opcodes/Makefile.in
+++ b/opcodes/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -174,6 +174,7 @@ CFILES = \
d30v-opc.c \
dlx-dis.c \
dis-buf.c \
+ dis-init.c \
disassemble.c \
fr30-asm.c \
fr30-desc.c \
@@ -391,7 +392,7 @@ OFILES = @BFD_MACHINES@
INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl
-libopcodes_la_SOURCES = dis-buf.c disassemble.c
+libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c
libopcodes_la_DEPENDENCIES = $(OFILES) ../bfd/libbfd.la
libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@ ../bfd/libbfd.la
libopcodes_la_LDFLAGS = -release $(VERSION) @WIN32LDFLAGS@
@@ -455,7 +456,7 @@ libopcodes_a_SOURCES = libopcodes.a.c
libopcodes_a_OBJECTS = libopcodes.a.$(OBJEXT)
LTLIBRARIES = $(bfdlib_LTLIBRARIES)
-libopcodes_la_OBJECTS = dis-buf.lo disassemble.lo
+libopcodes_la_OBJECTS = dis-buf.lo disassemble.lo dis-init.lo
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -616,7 +617,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
- test "$$subdir" != "." || dot_seen=yes; \
+ test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
@@ -840,7 +841,7 @@ stamp-lib: libopcodes.la
libopcodes.a: stamp-lib ; @true
po/POTFILES.in: @MAINT@ Makefile
- for file in $(POTFILES); do echo $$file; done | sort > tmp \
+ for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
&& mv tmp $(srcdir)/po/POTFILES.in
# We should reconfigure whenever bfd/configure.in changes, because
@@ -874,8 +875,8 @@ uninstall_libopcodes:
run-cgen:
$(SHELL) $(srcdir)/cgen.sh opcodes $(srcdir) $(CGEN) \
- $(CGENDIR) "$(CGENFLAGS)" $(arch) $(prefix) \
- "$(options)" $(extrafiles)
+ $(CGENDIR) "$(CGENFLAGS)" $(arch) $(prefix) $(archfile) $(opcfile) \
+ "$(options)" "$(extrafiles)"
touch stamp-${prefix}
.PHONY: run-cgen
@@ -891,38 +892,47 @@ run-cgen-all:
$(srcdir)/ip2k-desc.h $(srcdir)/ip2k-desc.c $(srcdir)/ip2k-opc.h $(srcdir)/ip2k-opc.c $(srcdir)/ip2k-ibld.c $(srcdir)/ip2k-asm.c $(srcdir)/ip2k-dis.c: $(IP2K_DEPS)
@true
stamp-ip2k: $(CGENDEPS) $(CPUDIR)/ip2k.cpu $(CPUDIR)/ip2k.opc
- $(MAKE) run-cgen arch=ip2k prefix=ip2k options= extrafiles=
+ $(MAKE) run-cgen arch=ip2k prefix=ip2k options= \
+ archfile=$(CPUDIR)/ip2k.cpu opcfile=$(CPUDIR)/ip2k.opc extrafiles=
$(srcdir)/m32r-desc.h $(srcdir)/m32r-desc.c $(srcdir)/m32r-opc.h $(srcdir)/m32r-opc.c $(srcdir)/m32r-ibld.c $(srcdir)/m32r-opinst.c $(srcdir)/m32r-asm.c $(srcdir)/m32r-dis.c: $(M32R_DEPS)
@true
stamp-m32r: $(CGENDEPS) $(CPUDIR)/m32r.cpu $(CPUDIR)/m32r.opc
- $(MAKE) run-cgen arch=m32r prefix=m32r options=opinst extrafiles=opinst
+ $(MAKE) run-cgen arch=m32r prefix=m32r options=opinst \
+ archfile=$(CPUDIR)/m32r.cpu opcfile=$(CPUDIR)/m32r.opc extrafiles=opinst
$(srcdir)/fr30-desc.h $(srcdir)/fr30-desc.c $(srcdir)/fr30-opc.h $(srcdir)/fr30-opc.c $(srcdir)/fr30-ibld.c $(srcdir)/fr30-asm.c $(srcdir)/fr30-dis.c: $(FR30_DEPS)
@true
stamp-fr30: $(CGENDEPS) $(CPUDIR)/fr30.cpu $(CPUDIR)/fr30.opc
- $(MAKE) run-cgen arch=fr30 prefix=fr30 options= extrafiles=
+ $(MAKE) run-cgen arch=fr30 prefix=fr30 options= \
+ archfile=$(CPUDIR)/fr30.cpu opcfile=$(CPUDIR)/fr30.opc extrafiles=
$(srcdir)/frv-desc.h $(srcdir)/frv-desc.c $(srcdir)/frv-opc.h $(srcdir)/frv-opc.c $(srcdir)/frv-ibld.c $(srcdir)/frv-asm.c $(srcdir)/frv-dis.c: $(FRV_DEPS)
@true
-stamp-frv: $(CGENDEPS) $(CPUDIR)/frv.cpu $(CPUDIR)/frv.opc
- $(MAKE) run-cgen arch=frv prefix=frv options= extrafiles=
+# .cpu and .opc files for frv are kept in a different directory, but cgen has no switch to specify that location, so
+# copy those file to the regular place.
+stamp-frv: $(CGENDEPS) $(srcdir)/../cpu/frv.cpu $(srcdir)/../cpu/frv.opc
+ $(MAKE) run-cgen arch=frv prefix=frv options= \
+ archfile=$(srcdir)/../cpu/frv.cpu opcfile=$(srcdir)/../cpu/frv.opc extrafiles=
$(srcdir)/openrisc-desc.h $(srcdir)/openrisc-desc.c $(srcdir)/openrisc-opc.h $(srcdir)/openrisc-opc.c $(srcdir)/openrisc-ibld.c $(srcdir)/openrisc-asm.c $(srcdir)/openrisc-dis.c: $(OPENRISC_DEPS)
@true
stamp-openrisc: $(CGENDEPS) $(CPUDIR)/openrisc.cpu $(CPUDIR)/openrisc.opc
- $(MAKE) run-cgen arch=openrisc prefix=openrisc options= extrafiles=
+ $(MAKE) run-cgen arch=openrisc prefix=openrisc options= \
+ archfile=$(CPUDIR)/openrisc.cpu opcfile=$(CPUDIR)/openrisc.opc extrafiles=
$(srcdir)/iq2000-desc.h $(srcdir)/iq2000-desc.c $(srcdir)/iq2000-opc.h $(srcdir)/iq2000-opc.c $(srcdir)/iq2000-ibld.c $(srcdir)/iq2000-asm.c $(srcdir)/iq2000-dis.c: $(IQ2000_DEPS)
@true
stamp-iq2000: $(CGENDEPS) $(CPUDIR)/iq2000.cpu $(CPUDIR)/iq2000.opc \
$(CPUDIR)/iq2000m.cpu $(CPUDIR)/iq10.cpu
- $(MAKE) run-cgen arch=iq2000 prefix=iq2000 options= extrafiles=
+ $(MAKE) run-cgen arch=iq2000 prefix=iq2000 options= \
+ archfile=$(CPUDIR)/iq2000.cpu opcfile=$(CPUDIR)/iq2000.opc extrafiles=
$(srcdir)/xstormy16-desc.h $(srcdir)/xstormy16-desc.c $(srcdir)/xstormy16-opc.h $(srcdir)/xstormy16-opc.c $(srcdir)/xstormy16-ibld.c $(srcdir)/xstormy16-asm.c $(srcdir)/xstormy16-dis.c: $(XSTORMY16_DEPS)
@true
stamp-xstormy16: $(CGENDEPS) $(CPUDIR)/xstormy16.cpu $(CPUDIR)/xstormy16.opc
- $(MAKE) run-cgen arch=xstormy16 prefix=xstormy16 options= extrafiles=
+ $(MAKE) run-cgen arch=xstormy16 prefix=xstormy16 options= \
+ archfile=$(CPUDIR)/xstormy16.cpu opcfile=$(CPUDIR)/xstormy16.opc extrafiles=
ia64-gen: ia64-gen.o
$(LINK) ia64-gen.o $(LIBIBERTY)
@@ -1011,9 +1021,9 @@ arc-ext.lo: arc-ext.c sysdep.h config.h $(INCDIR)/ansidecl.h \
arm-dis.lo: arm-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h arm-opc.h \
$(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \
- opintl.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/arm.h \
- $(INCDIR)/elf/reloc-macros.h
+ opintl.h $(INCDIR)/safe-ctype.h $(BFDDIR)/elf-bfd.h \
+ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/arm.h $(INCDIR)/elf/reloc-macros.h
avr-dis.lo: avr-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h \
$(INCDIR)/libiberty.h $(INCDIR)/opcode/avr.h
@@ -1043,6 +1053,8 @@ dlx-dis.lo: dlx-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h $(INCDIR)/opcode/dlx.h
dis-buf.lo: dis-buf.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h
+dis-init.lo: dis-init.c sysdep.h config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h opintl.h
disassemble.lo: disassemble.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dis-asm.h $(BFD_H) $(INCDIR)/symcat.h
fr30-asm.lo: fr30-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \
@@ -1120,7 +1132,7 @@ ia64-gen.lo: ia64-gen.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h sysdep.h config.h $(INCDIR)/getopt.h \
ia64-opc.h $(INCDIR)/opcode/ia64.h $(BFD_H) $(INCDIR)/symcat.h \
ia64-opc-a.c ia64-opc-i.c ia64-opc-m.c ia64-opc-b.c \
- ia64-opc-f.c ia64-opc-x.c ia64-opc-d.c ../intl/libintl.h
+ ia64-opc-f.c ia64-opc-x.c ia64-opc-d.c
ia64-asmtab.lo: ia64-asmtab.c
ip2k-asm.lo: ip2k-asm.c sysdep.h config.h $(INCDIR)/ansidecl.h \
$(BFD_H) $(INCDIR)/symcat.h ip2k-desc.h $(INCDIR)/opcode/cgen.h \
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index 97ec8423485..ac36e88006b 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -445,9 +445,11 @@ print_insn_arm (pc, info, given)
case 'A':
func (stream, "[%s", arm_regnames [(given >> 16) & 0xf]);
- if ((given & 0x01000000) != 0)
+
+ if ((given & (1 << 24)) != 0)
{
int offset = given & 0xff;
+
if (offset)
func (stream, ", %s#%d]%s",
((given & 0x00800000) == 0 ? "-" : ""),
@@ -459,12 +461,18 @@ print_insn_arm (pc, info, given)
else
{
int offset = given & 0xff;
- if (offset)
- func (stream, "], %s#%d",
- ((given & 0x00800000) == 0 ? "-" : ""),
- offset * 4);
+
+ func (stream, "]");
+
+ if (given & (1 << 21))
+ {
+ if (offset)
+ func (stream, ", %s#%d",
+ ((given & 0x00800000) == 0 ? "-" : ""),
+ offset * 4);
+ }
else
- func (stream, "]");
+ func (stream, ", {%d}", offset);
}
break;
diff --git a/opcodes/cgen-asm.c b/opcodes/cgen-asm.c
index c71c70de08e..7231e2d7aed 100644
--- a/opcodes/cgen-asm.c
+++ b/opcodes/cgen-asm.c
@@ -28,16 +28,14 @@
#include "opcode/cgen.h"
#include "opintl.h"
-static CGEN_INSN_LIST * hash_insn_array PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, int, int, CGEN_INSN_LIST **, CGEN_INSN_LIST *));
-static CGEN_INSN_LIST * hash_insn_list PARAMS ((CGEN_CPU_DESC, const CGEN_INSN_LIST *, CGEN_INSN_LIST **, CGEN_INSN_LIST *));
-static void build_asm_hash_table PARAMS ((CGEN_CPU_DESC));
+static CGEN_INSN_LIST * hash_insn_array (CGEN_CPU_DESC, const CGEN_INSN *, int, int, CGEN_INSN_LIST **, CGEN_INSN_LIST *);
+static CGEN_INSN_LIST * hash_insn_list (CGEN_CPU_DESC, const CGEN_INSN_LIST *, CGEN_INSN_LIST **, CGEN_INSN_LIST *);
+static void build_asm_hash_table (CGEN_CPU_DESC);
/* Set the cgen_parse_operand_fn callback. */
void
-cgen_set_parse_operand_fn (cd, fn)
- CGEN_CPU_DESC cd;
- cgen_parse_operand_fn fn;
+cgen_set_parse_operand_fn (CGEN_CPU_DESC cd, cgen_parse_operand_fn fn)
{
cd->parse_operand_fn = fn;
}
@@ -45,8 +43,7 @@ cgen_set_parse_operand_fn (cd, fn)
/* Called whenever starting to parse an insn. */
void
-cgen_init_parse_operand (cd)
- CGEN_CPU_DESC cd;
+cgen_init_parse_operand (CGEN_CPU_DESC cd)
{
/* This tells the callback to re-initialize. */
(void) (* cd->parse_operand_fn)
@@ -66,13 +63,12 @@ cgen_init_parse_operand (cd)
list and we want earlier ones to be prefered. */
static CGEN_INSN_LIST *
-hash_insn_array (cd, insns, count, entsize, htable, hentbuf)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insns;
- int count;
- int entsize ATTRIBUTE_UNUSED;
- CGEN_INSN_LIST **htable;
- CGEN_INSN_LIST *hentbuf;
+hash_insn_array (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insns,
+ int count,
+ int entsize ATTRIBUTE_UNUSED,
+ CGEN_INSN_LIST **htable,
+ CGEN_INSN_LIST *hentbuf)
{
int i;
@@ -97,11 +93,10 @@ hash_insn_array (cd, insns, count, entsize, htable, hentbuf)
in a list. */
static CGEN_INSN_LIST *
-hash_insn_list (cd, insns, htable, hentbuf)
- CGEN_CPU_DESC cd;
- const CGEN_INSN_LIST *insns;
- CGEN_INSN_LIST **htable;
- CGEN_INSN_LIST *hentbuf;
+hash_insn_list (CGEN_CPU_DESC cd,
+ const CGEN_INSN_LIST *insns,
+ CGEN_INSN_LIST **htable,
+ CGEN_INSN_LIST *hentbuf)
{
const CGEN_INSN_LIST *ilist;
@@ -123,8 +118,7 @@ hash_insn_list (cd, insns, htable, hentbuf)
/* Build the assembler instruction hash table. */
static void
-build_asm_hash_table (cd)
- CGEN_CPU_DESC cd;
+build_asm_hash_table (CGEN_CPU_DESC cd)
{
int count = cgen_insn_count (cd) + cgen_macro_insn_count (cd);
CGEN_INSN_TABLE *insn_table = &cd->insn_table;
@@ -179,9 +173,7 @@ build_asm_hash_table (cd)
/* Return the first entry in the hash list for INSN. */
CGEN_INSN_LIST *
-cgen_asm_lookup_insn (cd, insn)
- CGEN_CPU_DESC cd;
- const char *insn;
+cgen_asm_lookup_insn (CGEN_CPU_DESC cd, const char *insn)
{
unsigned int hash;
@@ -201,11 +193,10 @@ cgen_asm_lookup_insn (cd, insn)
recording something in the keyword table]. */
const char *
-cgen_parse_keyword (cd, strp, keyword_table, valuep)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- const char **strp;
- CGEN_KEYWORD *keyword_table;
- long *valuep;
+cgen_parse_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ const char **strp,
+ CGEN_KEYWORD *keyword_table,
+ long *valuep)
{
const CGEN_KEYWORD_ENTRY *ke;
char buf[256];
@@ -262,11 +253,10 @@ cgen_parse_keyword (cd, strp, keyword_table, valuep)
cgen_parse_address. */
const char *
-cgen_parse_signed_integer (cd, strp, opindex, valuep)
- CGEN_CPU_DESC cd;
- const char **strp;
- int opindex;
- long *valuep;
+cgen_parse_signed_integer (CGEN_CPU_DESC cd,
+ const char **strp,
+ int opindex,
+ long *valuep)
{
bfd_vma value;
enum cgen_parse_operand_result result;
@@ -287,11 +277,10 @@ cgen_parse_signed_integer (cd, strp, opindex, valuep)
cgen_parse_address. */
const char *
-cgen_parse_unsigned_integer (cd, strp, opindex, valuep)
- CGEN_CPU_DESC cd;
- const char **strp;
- int opindex;
- unsigned long *valuep;
+cgen_parse_unsigned_integer (CGEN_CPU_DESC cd,
+ const char **strp,
+ int opindex,
+ unsigned long *valuep)
{
bfd_vma value;
enum cgen_parse_operand_result result;
@@ -309,13 +298,12 @@ cgen_parse_unsigned_integer (cd, strp, opindex, valuep)
/* Address parser. */
const char *
-cgen_parse_address (cd, strp, opindex, opinfo, resultp, valuep)
- CGEN_CPU_DESC cd;
- const char **strp;
- int opindex;
- int opinfo;
- enum cgen_parse_operand_result *resultp;
- bfd_vma *valuep;
+cgen_parse_address (CGEN_CPU_DESC cd,
+ const char **strp,
+ int opindex,
+ int opinfo,
+ enum cgen_parse_operand_result *resultp,
+ bfd_vma *valuep)
{
bfd_vma value;
enum cgen_parse_operand_result result_type;
@@ -337,8 +325,7 @@ cgen_parse_address (cd, strp, opindex, opinfo, resultp, valuep)
/* Signed integer validation routine. */
const char *
-cgen_validate_signed_integer (value, min, max)
- long value, min, max;
+cgen_validate_signed_integer (long value, long min, long max)
{
if (value < min || value > max)
{
@@ -358,8 +345,9 @@ cgen_validate_signed_integer (value, min, max)
cases where min != 0 (and max > LONG_MAX). */
const char *
-cgen_validate_unsigned_integer (value, min, max)
- unsigned long value, min, max;
+cgen_validate_unsigned_integer (unsigned long value,
+ unsigned long min,
+ unsigned long max)
{
if (value < min || value > max)
{
diff --git a/opcodes/cgen-asm.in b/opcodes/cgen-asm.in
index 1ea076809b9..420f640ec3b 100644
--- a/opcodes/cgen-asm.in
+++ b/opcodes/cgen-asm.in
@@ -43,7 +43,7 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
+ (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *);
/* -- assembler routines inserted here. */
@@ -60,8 +60,7 @@ static const char * parse_insn_normal
Returns NULL for success, an error message for failure. */
char *
-@arch@_cgen_build_insn_regex (insn)
- CGEN_INSN *insn;
+@arch@_cgen_build_insn_regex (CGEN_INSN *insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
@@ -184,11 +183,10 @@ char *
Returns NULL for success, an error message for failure. */
static const char *
-parse_insn_normal (cd, insn, strp, fields)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- const char **strp;
- CGEN_FIELDS *fields;
+parse_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ const char **strp,
+ CGEN_FIELDS *fields)
{
/* ??? Runtime added insns not handled yet. */
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
@@ -326,12 +324,11 @@ parse_insn_normal (cd, insn, strp, fields)
mind helps keep the design clean. */
const CGEN_INSN *
-@arch@_cgen_assemble_insn (cd, str, fields, buf, errmsg)
- CGEN_CPU_DESC cd;
- const char *str;
- CGEN_FIELDS *fields;
- CGEN_INSN_BYTES_PTR buf;
- char **errmsg;
+@arch@_cgen_assemble_insn (CGEN_CPU_DESC cd,
+ const char *str,
+ CGEN_FIELDS *fields,
+ CGEN_INSN_BYTES_PTR buf,
+ char **errmsg)
{
const char *start;
CGEN_INSN_LIST *ilist;
@@ -435,9 +432,7 @@ const CGEN_INSN *
FIXME: Not currently used. */
void
-@arch@_cgen_asm_hash_keywords (cd, opvals)
- CGEN_CPU_DESC cd;
- CGEN_KEYWORD *opvals;
+@arch@_cgen_asm_hash_keywords (CGEN_CPU_DESC cd, CGEN_KEYWORD *opvals)
{
CGEN_KEYWORD_SEARCH search = cgen_keyword_search_init (opvals, NULL);
const CGEN_KEYWORD_ENTRY * ke;
diff --git a/opcodes/cgen-dis.c b/opcodes/cgen-dis.c
index 881ee1470f3..ca621dec2d3 100644
--- a/opcodes/cgen-dis.c
+++ b/opcodes/cgen-dis.c
@@ -27,19 +27,18 @@
#include "symcat.h"
#include "opcode/cgen.h"
-static CGEN_INSN_LIST * hash_insn_array PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, int, int, CGEN_INSN_LIST **, CGEN_INSN_LIST *));
-static CGEN_INSN_LIST * hash_insn_list PARAMS ((CGEN_CPU_DESC, const CGEN_INSN_LIST *, CGEN_INSN_LIST **, CGEN_INSN_LIST *));
-static void build_dis_hash_table PARAMS ((CGEN_CPU_DESC));
-static int count_decodable_bits PARAMS ((const CGEN_INSN *));
-static void add_insn_to_hash_chain PARAMS ((CGEN_INSN_LIST *,
- const CGEN_INSN *,
- CGEN_INSN_LIST **,
- unsigned int));
+static CGEN_INSN_LIST * hash_insn_array (CGEN_CPU_DESC, const CGEN_INSN *, int, int, CGEN_INSN_LIST **, CGEN_INSN_LIST *);
+static CGEN_INSN_LIST * hash_insn_list (CGEN_CPU_DESC, const CGEN_INSN_LIST *, CGEN_INSN_LIST **, CGEN_INSN_LIST *);
+static void build_dis_hash_table (CGEN_CPU_DESC);
+static int count_decodable_bits (const CGEN_INSN *);
+static void add_insn_to_hash_chain (CGEN_INSN_LIST *,
+ const CGEN_INSN *,
+ CGEN_INSN_LIST **,
+ unsigned int);
/* Return the number of decodable bits in this insn. */
static int
-count_decodable_bits (insn)
- const CGEN_INSN *insn;
+count_decodable_bits (const CGEN_INSN *insn)
{
unsigned mask = CGEN_INSN_BASE_MASK (insn);
int bits = 0;
@@ -54,11 +53,10 @@ count_decodable_bits (insn)
/* Add an instruction to the hash chain. */
static void
-add_insn_to_hash_chain (hentbuf, insn, htable, hash)
- CGEN_INSN_LIST *hentbuf;
- const CGEN_INSN *insn;
- CGEN_INSN_LIST **htable;
- unsigned int hash;
+add_insn_to_hash_chain (CGEN_INSN_LIST *hentbuf,
+ const CGEN_INSN *insn,
+ CGEN_INSN_LIST **htable,
+ unsigned int hash)
{
CGEN_INSN_LIST *current_buf;
CGEN_INSN_LIST *previous_buf;
@@ -100,13 +98,12 @@ add_insn_to_hash_chain (hentbuf, insn, htable, hash)
list and we want earlier ones to be prefered. */
static CGEN_INSN_LIST *
-hash_insn_array (cd, insns, count, entsize, htable, hentbuf)
- CGEN_CPU_DESC cd;
- const CGEN_INSN * insns;
- int count;
- int entsize ATTRIBUTE_UNUSED;
- CGEN_INSN_LIST ** htable;
- CGEN_INSN_LIST * hentbuf;
+hash_insn_array (CGEN_CPU_DESC cd,
+ const CGEN_INSN * insns,
+ int count,
+ int entsize ATTRIBUTE_UNUSED,
+ CGEN_INSN_LIST ** htable,
+ CGEN_INSN_LIST * hentbuf)
{
int big_p = CGEN_CPU_ENDIAN (cd) == CGEN_ENDIAN_BIG;
int i;
@@ -141,11 +138,10 @@ hash_insn_array (cd, insns, count, entsize, htable, hentbuf)
in a list. */
static CGEN_INSN_LIST *
-hash_insn_list (cd, insns, htable, hentbuf)
- CGEN_CPU_DESC cd;
- const CGEN_INSN_LIST *insns;
- CGEN_INSN_LIST **htable;
- CGEN_INSN_LIST *hentbuf;
+hash_insn_list (CGEN_CPU_DESC cd,
+ const CGEN_INSN_LIST *insns,
+ CGEN_INSN_LIST **htable,
+ CGEN_INSN_LIST *hentbuf)
{
int big_p = CGEN_CPU_ENDIAN (cd) == CGEN_ENDIAN_BIG;
const CGEN_INSN_LIST *ilist;
@@ -177,8 +173,7 @@ hash_insn_list (cd, insns, htable, hentbuf)
/* Build the disassembler instruction hash table. */
static void
-build_dis_hash_table (cd)
- CGEN_CPU_DESC cd;
+build_dis_hash_table (CGEN_CPU_DESC cd)
{
int count = cgen_insn_count (cd) + cgen_macro_insn_count (cd);
CGEN_INSN_TABLE *insn_table = & cd->insn_table;
@@ -233,10 +228,7 @@ build_dis_hash_table (cd)
/* Return the first entry in the hash list for INSN. */
CGEN_INSN_LIST *
-cgen_dis_lookup_insn (cd, buf, value)
- CGEN_CPU_DESC cd;
- const char * buf;
- CGEN_INSN_INT value;
+cgen_dis_lookup_insn (CGEN_CPU_DESC cd, const char * buf, CGEN_INSN_INT value)
{
unsigned int hash;
diff --git a/opcodes/cgen-dis.in b/opcodes/cgen-dis.in
index 9203b71d027..1a3c0fa59d6 100644
--- a/opcodes/cgen-dis.in
+++ b/opcodes/cgen-dis.in
@@ -41,34 +41,32 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define UNKNOWN_INSN_MSG _("*unknown*")
static void print_normal
- PARAMS ((CGEN_CPU_DESC, PTR, long, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
static void print_address
- PARAMS ((CGEN_CPU_DESC, PTR, bfd_vma, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int);
static void print_keyword
- PARAMS ((CGEN_CPU_DESC, PTR, CGEN_KEYWORD *, long, unsigned int));
+ (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int);
static void print_insn_normal
- PARAMS ((CGEN_CPU_DESC, PTR, const CGEN_INSN *, CGEN_FIELDS *,
- bfd_vma, int));
+ (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
static int print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned);
static int default_print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *);
static int read_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int,
- CGEN_EXTRACT_INFO *, unsigned long *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int, CGEN_EXTRACT_INFO *,
+ unsigned long *);
/* -- disassembler routines inserted here */
/* Default print handler. */
static void
-print_normal (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- long value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ long value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -88,13 +86,12 @@ print_normal (cd, dis_info, value, attrs, pc, length)
/* Default address handler. */
static void
-print_address (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- bfd_vma value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ bfd_vma value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -118,12 +115,11 @@ print_address (cd, dis_info, value, attrs, pc, length)
/* Keyword print handler. */
static void
-print_keyword (cd, dis_info, keyword_table, value, attrs)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- CGEN_KEYWORD *keyword_table;
- long value;
- unsigned int attrs ATTRIBUTE_UNUSED;
+print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ CGEN_KEYWORD *keyword_table,
+ long value,
+ unsigned int attrs ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
const CGEN_KEYWORD_ENTRY *ke;
@@ -137,17 +133,16 @@ print_keyword (cd, dis_info, keyword_table, value, attrs)
/* Default insn printer.
- DIS_INFO is defined as `PTR' so the disassembler needn't know anything
+ DIS_INFO is defined as `void *' so the disassembler needn't know anything
about disassemble_info. */
static void
-print_insn_normal (cd, dis_info, insn, fields, pc, length)
- CGEN_CPU_DESC cd;
- PTR dis_info;
- const CGEN_INSN *insn;
- CGEN_FIELDS *fields;
- bfd_vma pc;
- int length;
+print_insn_normal (CGEN_CPU_DESC cd,
+ void *dis_info,
+ const CGEN_INSN *insn,
+ CGEN_FIELDS *fields,
+ bfd_vma pc,
+ int length)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
disassemble_info *info = (disassemble_info *) dis_info;
@@ -179,14 +174,13 @@ print_insn_normal (cd, dis_info, insn, fields, pc, length)
Returns 0 if all is well, non-zero otherwise. */
static int
-read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- int buflen;
- CGEN_EXTRACT_INFO *ex_info;
- unsigned long *insn_value;
+read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ int buflen,
+ CGEN_EXTRACT_INFO *ex_info,
+ unsigned long *insn_value)
{
int status = (*info->read_memory_func) (pc, buf, buflen, info);
if (status != 0)
@@ -210,12 +204,11 @@ read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
been called). */
static int
-print_insn (cd, pc, info, buf, buflen)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- unsigned int buflen;
+print_insn (CGEN_CPU_DESC cd,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ unsigned int buflen)
{
CGEN_INSN_INT insn_value;
const CGEN_INSN_LIST *insn_list;
@@ -320,10 +313,7 @@ print_insn (cd, pc, info, buf, buflen)
#endif
static int
-default_print_insn (cd, pc, info)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
+default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
{
char buf[CGEN_MAX_INSN_SIZE];
int buflen;
@@ -362,9 +352,7 @@ typedef struct cpu_desc_list {
} cpu_desc_list;
int
-print_insn_@arch@ (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_@arch@ (bfd_vma pc, disassemble_info *info)
{
static cpu_desc_list *cd_list = 0;
cpu_desc_list *cl = 0;
diff --git a/opcodes/cgen-ibld.in b/opcodes/cgen-ibld.in
index d2bfd02a91f..316f183c41e 100644
--- a/opcodes/cgen-ibld.in
+++ b/opcodes/cgen-ibld.in
@@ -44,30 +44,29 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define FLD(f) (fields->f)
static const char * insert_normal
- PARAMS ((CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR));
+ (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
static const char * insert_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *,
- CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *,
+ CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
static int extract_normal
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
- unsigned int, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, bfd_vma, long *));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
+ unsigned int, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, bfd_vma, long *);
static int extract_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
- CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
+ CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
#if CGEN_INT_INSN_P
static void put_insn_int_value
- PARAMS ((CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT));
+ (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
#endif
#if ! CGEN_INT_INSN_P
static CGEN_INLINE void insert_1
- PARAMS ((CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *));
+ (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
static CGEN_INLINE int fill_cache
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
static CGEN_INLINE long extract_1
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int,
- unsigned char *, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
#endif
/* Operand insertion. */
@@ -77,11 +76,12 @@ static CGEN_INLINE long extract_1
/* Subroutine of insert_normal. */
static CGEN_INLINE void
-insert_1 (cd, value, start, length, word_length, bufp)
- CGEN_CPU_DESC cd;
- unsigned long value;
- int start,length,word_length;
- unsigned char *bufp;
+insert_1 (CGEN_CPU_DESC cd,
+ unsigned long value,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp)
{
unsigned long x,mask;
int shift;
@@ -118,13 +118,15 @@ insert_1 (cd, value, start, length, word_length, bufp)
necessary. */
static const char *
-insert_normal (cd, value, attrs, word_offset, start, length, word_length,
- total_length, buffer)
- CGEN_CPU_DESC cd;
- long value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
- CGEN_INSN_BYTES_PTR buffer;
+insert_normal (CGEN_CPU_DESC cd,
+ long value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
+ CGEN_INSN_BYTES_PTR buffer)
{
static char errbuf[100];
/* Written this way to avoid undefined behaviour. */
@@ -232,12 +234,11 @@ insert_normal (cd, value, attrs, word_offset, start, length, word_length,
The result is an error message or NULL if success. */
static const char *
-insert_insn_normal (cd, insn, fields, buffer, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN * insn;
- CGEN_FIELDS * fields;
- CGEN_INSN_BYTES_PTR buffer;
- bfd_vma pc;
+insert_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN * insn,
+ CGEN_FIELDS * fields,
+ CGEN_INSN_BYTES_PTR buffer,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
unsigned long value;
@@ -288,12 +289,11 @@ insert_insn_normal (cd, insn, fields, buffer, pc)
because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
static void
-put_insn_int_value (cd, buf, length, insn_length, value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_INSN_BYTES_PTR buf;
- int length;
- int insn_length;
- CGEN_INSN_INT value;
+put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_INSN_BYTES_PTR buf,
+ int length,
+ int insn_length,
+ CGEN_INSN_INT value)
{
/* For architectures with insns smaller than the base-insn-bitsize,
length may be too big. */
@@ -320,11 +320,11 @@ put_insn_int_value (cd, buf, length, insn_length, value)
Returns 1 for success, 0 for failure. */
static CGEN_INLINE int
-fill_cache (cd, ex_info, offset, bytes, pc)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_EXTRACT_INFO *ex_info;
- int offset, bytes;
- bfd_vma pc;
+fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_EXTRACT_INFO *ex_info,
+ int offset,
+ int bytes,
+ bfd_vma pc)
{
/* It's doubtful that the middle part has already been fetched so
we don't optimize that case. kiss. */
@@ -364,12 +364,13 @@ fill_cache (cd, ex_info, offset, bytes, pc)
/* Subroutine of extract_normal. */
static CGEN_INLINE long
-extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
- CGEN_CPU_DESC cd;
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
- int start,length,word_length;
- unsigned char *bufp;
- bfd_vma pc ATTRIBUTE_UNUSED;
+extract_1 (CGEN_CPU_DESC cd,
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp,
+ bfd_vma pc ATTRIBUTE_UNUSED)
{
unsigned long x;
int shift;
@@ -408,23 +409,25 @@ extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
necessary. */
static int
-extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
- word_length, total_length, pc, valuep)
- CGEN_CPU_DESC cd;
+extract_normal (CGEN_CPU_DESC cd,
#if ! CGEN_INT_INSN_P
- CGEN_EXTRACT_INFO *ex_info;
+ CGEN_EXTRACT_INFO *ex_info,
#else
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
#endif
- CGEN_INSN_INT insn_value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
+ CGEN_INSN_INT insn_value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
#if ! CGEN_INT_INSN_P
- bfd_vma pc;
+ bfd_vma pc,
#else
- bfd_vma pc ATTRIBUTE_UNUSED;
+ bfd_vma pc ATTRIBUTE_UNUSED,
#endif
- long *valuep;
+ long *valuep)
{
long value, mask;
@@ -505,13 +508,12 @@ extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
been called). */
static int
-extract_insn_normal (cd, insn, ex_info, insn_value, fields, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- CGEN_EXTRACT_INFO *ex_info;
- CGEN_INSN_INT insn_value;
- CGEN_FIELDS *fields;
- bfd_vma pc;
+extract_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ CGEN_EXTRACT_INFO *ex_info,
+ CGEN_INSN_INT insn_value,
+ CGEN_FIELDS *fields,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
const CGEN_SYNTAX_CHAR_TYPE *syn;
diff --git a/opcodes/cgen-opc.c b/opcodes/cgen-opc.c
index 06544ca057d..882b34898be 100644
--- a/opcodes/cgen-opc.c
+++ b/opcodes/cgen-opc.c
@@ -33,11 +33,11 @@
#endif
static unsigned int hash_keyword_name
- PARAMS ((const CGEN_KEYWORD *, const char *, int));
+ (const CGEN_KEYWORD *, const char *, int);
static unsigned int hash_keyword_value
- PARAMS ((const CGEN_KEYWORD *, unsigned int));
+ (const CGEN_KEYWORD *, unsigned int);
static void build_keyword_hash_tables
- PARAMS ((CGEN_KEYWORD *));
+ (CGEN_KEYWORD *);
/* Return number of hash table entries to use for N elements. */
#define KEYWORD_HASH_SIZE(n) ((n) <= 31 ? 17 : 31)
@@ -46,9 +46,7 @@ static void build_keyword_hash_tables
The result is the keyword entry or NULL if not found. */
const CGEN_KEYWORD_ENTRY *
-cgen_keyword_lookup_name (kt, name)
- CGEN_KEYWORD *kt;
- const char *name;
+cgen_keyword_lookup_name (CGEN_KEYWORD *kt, const char *name)
{
const CGEN_KEYWORD_ENTRY *ke;
const char *p,*n;
@@ -87,9 +85,7 @@ cgen_keyword_lookup_name (kt, name)
The result is the keyword entry or NULL if not found. */
const CGEN_KEYWORD_ENTRY *
-cgen_keyword_lookup_value (kt, value)
- CGEN_KEYWORD *kt;
- int value;
+cgen_keyword_lookup_value (CGEN_KEYWORD *kt, int value)
{
const CGEN_KEYWORD_ENTRY *ke;
@@ -111,9 +107,7 @@ cgen_keyword_lookup_value (kt, value)
/* Add an entry to a keyword table. */
void
-cgen_keyword_add (kt, ke)
- CGEN_KEYWORD *kt;
- CGEN_KEYWORD_ENTRY *ke;
+cgen_keyword_add (CGEN_KEYWORD *kt, CGEN_KEYWORD_ENTRY *ke)
{
unsigned int hash;
size_t i;
@@ -159,9 +153,7 @@ cgen_keyword_add (kt, ke)
It is passed to each call to cgen_keyword_search_next. */
CGEN_KEYWORD_SEARCH
-cgen_keyword_search_init (kt, spec)
- CGEN_KEYWORD *kt;
- const char *spec;
+cgen_keyword_search_init (CGEN_KEYWORD *kt, const char *spec)
{
CGEN_KEYWORD_SEARCH search;
@@ -183,8 +175,7 @@ cgen_keyword_search_init (kt, spec)
The result is the next entry or NULL if there are no more. */
const CGEN_KEYWORD_ENTRY *
-cgen_keyword_search_next (search)
- CGEN_KEYWORD_SEARCH *search;
+cgen_keyword_search_next (CGEN_KEYWORD_SEARCH *search)
{
/* Has search finished? */
if (search->current_hash == search->table->hash_table_size)
@@ -218,10 +209,9 @@ cgen_keyword_search_next (search)
If CASE_SENSITIVE_P is non-zero, return a case sensitive hash. */
static unsigned int
-hash_keyword_name (kt, name, case_sensitive_p)
- const CGEN_KEYWORD *kt;
- const char *name;
- int case_sensitive_p;
+hash_keyword_name (const CGEN_KEYWORD *kt,
+ const char *name,
+ int case_sensitive_p)
{
unsigned int hash;
@@ -237,9 +227,7 @@ hash_keyword_name (kt, name, case_sensitive_p)
/* Return first entry in hash chain for VALUE. */
static unsigned int
-hash_keyword_value (kt, value)
- const CGEN_KEYWORD *kt;
- unsigned int value;
+hash_keyword_value (const CGEN_KEYWORD *kt, unsigned int value)
{
return value % kt->hash_table_size;
}
@@ -249,8 +237,7 @@ hash_keyword_value (kt, value)
we're using the disassembler, but we keep things simple. */
static void
-build_keyword_hash_tables (kt)
- CGEN_KEYWORD *kt;
+build_keyword_hash_tables (CGEN_KEYWORD *kt)
{
int i;
/* Use the number of compiled in entries as an estimate for the
@@ -278,9 +265,7 @@ build_keyword_hash_tables (kt)
mach/isa. */
const CGEN_HW_ENTRY *
-cgen_hw_lookup_by_name (cd, name)
- CGEN_CPU_DESC cd;
- const char *name;
+cgen_hw_lookup_by_name (CGEN_CPU_DESC cd, const char *name)
{
unsigned int i;
const CGEN_HW_ENTRY **hw = cd->hw_table.entries;
@@ -298,9 +283,7 @@ cgen_hw_lookup_by_name (cd, name)
Returns NULL if HWNUM is not supported by the currently selected mach. */
const CGEN_HW_ENTRY *
-cgen_hw_lookup_by_num (cd, hwnum)
- CGEN_CPU_DESC cd;
- unsigned int hwnum;
+cgen_hw_lookup_by_num (CGEN_CPU_DESC cd, unsigned int hwnum)
{
unsigned int i;
const CGEN_HW_ENTRY **hw = cd->hw_table.entries;
@@ -320,9 +303,7 @@ cgen_hw_lookup_by_num (cd, hwnum)
mach/isa. */
const CGEN_OPERAND *
-cgen_operand_lookup_by_name (cd, name)
- CGEN_CPU_DESC cd;
- const char *name;
+cgen_operand_lookup_by_name (CGEN_CPU_DESC cd, const char *name)
{
unsigned int i;
const CGEN_OPERAND **op = cd->operand_table.entries;
@@ -341,9 +322,7 @@ cgen_operand_lookup_by_name (cd, name)
mach/isa. */
const CGEN_OPERAND *
-cgen_operand_lookup_by_num (cd, opnum)
- CGEN_CPU_DESC cd;
- int opnum;
+cgen_operand_lookup_by_num (CGEN_CPU_DESC cd, int opnum)
{
return cd->operand_table.entries[opnum];
}
@@ -353,8 +332,7 @@ cgen_operand_lookup_by_num (cd, opnum)
/* Return number of instructions. This includes any added at runtime. */
int
-cgen_insn_count (cd)
- CGEN_CPU_DESC cd;
+cgen_insn_count (CGEN_CPU_DESC cd)
{
int count = cd->insn_table.num_init_entries;
CGEN_INSN_LIST *rt_insns = cd->insn_table.new_entries;
@@ -369,8 +347,7 @@ cgen_insn_count (cd)
This includes any added at runtime. */
int
-cgen_macro_insn_count (cd)
- CGEN_CPU_DESC cd;
+cgen_macro_insn_count (CGEN_CPU_DESC cd)
{
int count = cd->macro_insn_table.num_init_entries;
CGEN_INSN_LIST *rt_insns = cd->macro_insn_table.new_entries;
@@ -384,10 +361,7 @@ cgen_macro_insn_count (cd)
/* Cover function to read and properly byteswap an insn value. */
CGEN_INSN_INT
-cgen_get_insn_value (cd, buf, length)
- CGEN_CPU_DESC cd;
- unsigned char *buf;
- int length;
+cgen_get_insn_value (CGEN_CPU_DESC cd, unsigned char *buf, int length)
{
int big_p = (cd->insn_endian == CGEN_ENDIAN_BIG);
int insn_chunk_bitsize = cd->insn_chunk_bitsize;
@@ -423,11 +397,10 @@ cgen_get_insn_value (cd, buf, length)
/* Cover function to store an insn value properly byteswapped. */
void
-cgen_put_insn_value (cd, buf, length, value)
- CGEN_CPU_DESC cd;
- unsigned char *buf;
- int length;
- CGEN_INSN_INT value;
+cgen_put_insn_value (CGEN_CPU_DESC cd,
+ unsigned char *buf,
+ int length,
+ CGEN_INSN_INT value)
{
int big_p = (cd->insn_endian == CGEN_ENDIAN_BIG);
int insn_chunk_bitsize = cd->insn_chunk_bitsize;
@@ -472,16 +445,14 @@ cgen_put_insn_value (cd, buf, length, value)
/* ??? Will need to be revisited for VLIW architectures. */
const CGEN_INSN *
-cgen_lookup_insn (cd, insn, insn_int_value, insn_bytes_value, length, fields,
- alias_p)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- CGEN_INSN_INT insn_int_value;
- /* ??? CGEN_INSN_BYTES would be a nice type name to use here. */
- unsigned char *insn_bytes_value;
- int length;
- CGEN_FIELDS *fields;
- int alias_p;
+cgen_lookup_insn (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ CGEN_INSN_INT insn_int_value,
+ /* ??? CGEN_INSN_BYTES would be a nice type name to use here. */
+ unsigned char *insn_bytes_value,
+ int length,
+ CGEN_FIELDS *fields,
+ int alias_p)
{
unsigned char *buf;
CGEN_INSN_INT base_insn;
@@ -571,11 +542,10 @@ cgen_lookup_insn (cd, insn, insn_int_value, insn_bytes_value, length, fields,
in. */
void
-cgen_get_insn_operands (cd, insn, fields, indices)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- const CGEN_FIELDS *fields;
- int *indices;
+cgen_get_insn_operands (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ const CGEN_FIELDS *fields,
+ int *indices)
{
const CGEN_OPINST *opinst;
int i;
@@ -603,16 +573,14 @@ cgen_get_insn_operands (cd, insn, fields, indices)
recognized. */
const CGEN_INSN *
-cgen_lookup_get_insn_operands (cd, insn, insn_int_value, insn_bytes_value,
- length, indices, fields)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- CGEN_INSN_INT insn_int_value;
- /* ??? CGEN_INSN_BYTES would be a nice type name to use here. */
- unsigned char *insn_bytes_value;
- int length;
- int *indices;
- CGEN_FIELDS *fields;
+cgen_lookup_get_insn_operands (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ CGEN_INSN_INT insn_int_value,
+ /* ??? CGEN_INSN_BYTES would be a nice type name to use here. */
+ unsigned char *insn_bytes_value,
+ int length,
+ int *indices,
+ CGEN_FIELDS *fields)
{
/* Pass non-zero for ALIAS_P only if INSN != NULL.
If INSN == NULL, we want a real insn. */
@@ -627,24 +595,21 @@ cgen_lookup_get_insn_operands (cd, insn, insn_int_value, insn_bytes_value,
/* Allow signed overflow of instruction fields. */
void
-cgen_set_signed_overflow_ok (cd)
- CGEN_CPU_DESC cd;
+cgen_set_signed_overflow_ok (CGEN_CPU_DESC cd)
{
cd->signed_overflow_ok_p = 1;
}
/* Generate an error message if a signed field in an instruction overflows. */
void
-cgen_clear_signed_overflow_ok (cd)
- CGEN_CPU_DESC cd;
+cgen_clear_signed_overflow_ok (CGEN_CPU_DESC cd)
{
cd->signed_overflow_ok_p = 0;
}
/* Will an error message be generated if a signed field in an instruction overflows ? */
unsigned int
-cgen_signed_overflow_ok_p (cd)
- CGEN_CPU_DESC cd;
+cgen_signed_overflow_ok_p (CGEN_CPU_DESC cd)
{
return cd->signed_overflow_ok_p;
}
diff --git a/opcodes/cgen.sh b/opcodes/cgen.sh
index a9483bdb972..5a340b6e527 100644
--- a/opcodes/cgen.sh
+++ b/opcodes/cgen.sh
@@ -23,11 +23,19 @@
# arch-asm.c, arch-dis.c, arch-opinst.c, arch-ibld.[ch].
#
# Usage:
-# cgen.sh action srcdir cgen cgendir cgenflags arch prefix options
+# cgen.sh action srcdir cgen cgendir cgenflags arch prefix \
+# arch-file opc-file options [extrafiles]
#
# ACTION is currently always "opcodes". It exists to be consistent with the
# simulator.
-# OPTIONS is comma separated list of options:
+# ARCH is the name of the architecture.
+# It is substituted into @arch@ and @ARCH@ in the generated files.
+# PREFIX is both the generated file prefix and is substituted into
+# @prefix@ in the generated files.
+# ARCH-FILE is the name of the .cpu file (including path).
+# OPC-FILE is the name of the .opc file (including path).
+# OPTIONS is comma separated list of options (???).
+# EXTRAFILES is a space separated list (1 arg still) of extra files to build:
# - opinst - arch-opinst.c is being made, causes semantic analysis
#
# We store the generated files in the source directory until we decide to
@@ -44,11 +52,13 @@ cgendir=$4
cgenflags=$5
arch=$6
prefix=$7
-options=$8
+archfile=$8
+opcfile=$9
+shift ; options=$9
# List of extra files to build.
# Values: opinst (only 1 extra file at present)
-extrafiles=$9
+shift ; extrafiles=$9
rootdir=${srcdir}/..
@@ -88,7 +98,8 @@ opcodes)
${cgenflags} \
-f "${options}" \
-m all \
- -a ${arch} \
+ -a ${archfile} \
+ -OPC ${opcfile} \
-H tmp-desc.h1 \
-C tmp-desc.c1 \
-O tmp-opc.h1 \
diff --git a/opcodes/dep-in.sed b/opcodes/dep-in.sed
index e373d4ca84e..94da2adc340 100644
--- a/opcodes/dep-in.sed
+++ b/opcodes/dep-in.sed
@@ -10,6 +10,7 @@ s!@TOPDIR@/include!$(INCDIR)!g
s!@BFDDIR@!$(BFDDIR)!g
s!@TOPDIR@/bfd!$(BFDDIR)!g
s!@SRCDIR@/!!g
+s! \.\./intl/libintl\.h!!g
s/\\\n */ /g
diff --git a/opcodes/dis-init.c b/opcodes/dis-init.c
new file mode 100644
index 00000000000..4c3e36e6e8c
--- /dev/null
+++ b/opcodes/dis-init.c
@@ -0,0 +1,41 @@
+/* Initialize "struct disassemble_info".
+
+ Copyright 2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include "sysdep.h"
+#include "dis-asm.h"
+#include "bfd.h"
+
+void
+init_disassemble_info (struct disassemble_info *info, void *stream,
+ fprintf_ftype fprintf_func)
+{
+ memset (info, 0, sizeof (*info));
+ info->flavour = bfd_target_unknown_flavour;
+ info->arch = bfd_arch_unknown;
+ info->endian = BFD_ENDIAN_UNKNOWN;
+ info->octets_per_byte = 1;
+ info->fprintf_func = fprintf_func;
+ info->stream = stream;
+ info->read_memory_func = buffer_read_memory;
+ info->memory_error_func = perror_memory;
+ info->print_address_func = generic_print_address;
+ info->symbol_at_address_func = generic_symbol_at_address;
+ info->display_endian = BFD_ENDIAN_UNKNOWN;
+}
+
diff --git a/opcodes/fr30-asm.c b/opcodes/fr30-asm.c
index 8e7c7b80975..f1c18a16bd5 100644
--- a/opcodes/fr30-asm.c
+++ b/opcodes/fr30-asm.c
@@ -43,7 +43,7 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
+ (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *);
/* -- assembler routines inserted here. */
@@ -356,8 +356,7 @@ fr30_cgen_init_asm (cd)
Returns NULL for success, an error message for failure. */
char *
-fr30_cgen_build_insn_regex (insn)
- CGEN_INSN *insn;
+fr30_cgen_build_insn_regex (CGEN_INSN *insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
@@ -480,11 +479,10 @@ fr30_cgen_build_insn_regex (insn)
Returns NULL for success, an error message for failure. */
static const char *
-parse_insn_normal (cd, insn, strp, fields)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- const char **strp;
- CGEN_FIELDS *fields;
+parse_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ const char **strp,
+ CGEN_FIELDS *fields)
{
/* ??? Runtime added insns not handled yet. */
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
@@ -622,12 +620,11 @@ parse_insn_normal (cd, insn, strp, fields)
mind helps keep the design clean. */
const CGEN_INSN *
-fr30_cgen_assemble_insn (cd, str, fields, buf, errmsg)
- CGEN_CPU_DESC cd;
- const char *str;
- CGEN_FIELDS *fields;
- CGEN_INSN_BYTES_PTR buf;
- char **errmsg;
+fr30_cgen_assemble_insn (CGEN_CPU_DESC cd,
+ const char *str,
+ CGEN_FIELDS *fields,
+ CGEN_INSN_BYTES_PTR buf,
+ char **errmsg)
{
const char *start;
CGEN_INSN_LIST *ilist;
@@ -731,9 +728,7 @@ fr30_cgen_assemble_insn (cd, str, fields, buf, errmsg)
FIXME: Not currently used. */
void
-fr30_cgen_asm_hash_keywords (cd, opvals)
- CGEN_CPU_DESC cd;
- CGEN_KEYWORD *opvals;
+fr30_cgen_asm_hash_keywords (CGEN_CPU_DESC cd, CGEN_KEYWORD *opvals)
{
CGEN_KEYWORD_SEARCH search = cgen_keyword_search_init (opvals, NULL);
const CGEN_KEYWORD_ENTRY * ke;
diff --git a/opcodes/fr30-dis.c b/opcodes/fr30-dis.c
index ef7b37a5a24..0b99a4af395 100644
--- a/opcodes/fr30-dis.c
+++ b/opcodes/fr30-dis.c
@@ -41,21 +41,20 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define UNKNOWN_INSN_MSG _("*unknown*")
static void print_normal
- PARAMS ((CGEN_CPU_DESC, PTR, long, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
static void print_address
- PARAMS ((CGEN_CPU_DESC, PTR, bfd_vma, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int);
static void print_keyword
- PARAMS ((CGEN_CPU_DESC, PTR, CGEN_KEYWORD *, long, unsigned int));
+ (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int);
static void print_insn_normal
- PARAMS ((CGEN_CPU_DESC, PTR, const CGEN_INSN *, CGEN_FIELDS *,
- bfd_vma, int));
+ (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
static int print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned);
static int default_print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *);
static int read_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int,
- CGEN_EXTRACT_INFO *, unsigned long *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int, CGEN_EXTRACT_INFO *,
+ unsigned long *);
/* -- disassembler routines inserted here */
@@ -343,13 +342,12 @@ fr30_cgen_init_dis (cd)
/* Default print handler. */
static void
-print_normal (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- long value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ long value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -369,13 +367,12 @@ print_normal (cd, dis_info, value, attrs, pc, length)
/* Default address handler. */
static void
-print_address (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- bfd_vma value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ bfd_vma value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -399,12 +396,11 @@ print_address (cd, dis_info, value, attrs, pc, length)
/* Keyword print handler. */
static void
-print_keyword (cd, dis_info, keyword_table, value, attrs)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- CGEN_KEYWORD *keyword_table;
- long value;
- unsigned int attrs ATTRIBUTE_UNUSED;
+print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ CGEN_KEYWORD *keyword_table,
+ long value,
+ unsigned int attrs ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
const CGEN_KEYWORD_ENTRY *ke;
@@ -418,17 +414,16 @@ print_keyword (cd, dis_info, keyword_table, value, attrs)
/* Default insn printer.
- DIS_INFO is defined as `PTR' so the disassembler needn't know anything
+ DIS_INFO is defined as `void *' so the disassembler needn't know anything
about disassemble_info. */
static void
-print_insn_normal (cd, dis_info, insn, fields, pc, length)
- CGEN_CPU_DESC cd;
- PTR dis_info;
- const CGEN_INSN *insn;
- CGEN_FIELDS *fields;
- bfd_vma pc;
- int length;
+print_insn_normal (CGEN_CPU_DESC cd,
+ void *dis_info,
+ const CGEN_INSN *insn,
+ CGEN_FIELDS *fields,
+ bfd_vma pc,
+ int length)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
disassemble_info *info = (disassemble_info *) dis_info;
@@ -460,14 +455,13 @@ print_insn_normal (cd, dis_info, insn, fields, pc, length)
Returns 0 if all is well, non-zero otherwise. */
static int
-read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- int buflen;
- CGEN_EXTRACT_INFO *ex_info;
- unsigned long *insn_value;
+read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ int buflen,
+ CGEN_EXTRACT_INFO *ex_info,
+ unsigned long *insn_value)
{
int status = (*info->read_memory_func) (pc, buf, buflen, info);
if (status != 0)
@@ -491,12 +485,11 @@ read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
been called). */
static int
-print_insn (cd, pc, info, buf, buflen)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- unsigned int buflen;
+print_insn (CGEN_CPU_DESC cd,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ unsigned int buflen)
{
CGEN_INSN_INT insn_value;
const CGEN_INSN_LIST *insn_list;
@@ -601,10 +594,7 @@ print_insn (cd, pc, info, buf, buflen)
#endif
static int
-default_print_insn (cd, pc, info)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
+default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
{
char buf[CGEN_MAX_INSN_SIZE];
int buflen;
@@ -643,9 +633,7 @@ typedef struct cpu_desc_list {
} cpu_desc_list;
int
-print_insn_fr30 (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_fr30 (bfd_vma pc, disassemble_info *info)
{
static cpu_desc_list *cd_list = 0;
cpu_desc_list *cl = 0;
diff --git a/opcodes/fr30-ibld.c b/opcodes/fr30-ibld.c
index 96374619e6c..b01e483e323 100644
--- a/opcodes/fr30-ibld.c
+++ b/opcodes/fr30-ibld.c
@@ -44,30 +44,29 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define FLD(f) (fields->f)
static const char * insert_normal
- PARAMS ((CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR));
+ (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
static const char * insert_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *,
- CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *,
+ CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
static int extract_normal
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
- unsigned int, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, bfd_vma, long *));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
+ unsigned int, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, bfd_vma, long *);
static int extract_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
- CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
+ CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
#if CGEN_INT_INSN_P
static void put_insn_int_value
- PARAMS ((CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT));
+ (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
#endif
#if ! CGEN_INT_INSN_P
static CGEN_INLINE void insert_1
- PARAMS ((CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *));
+ (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
static CGEN_INLINE int fill_cache
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
static CGEN_INLINE long extract_1
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int,
- unsigned char *, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
#endif
/* Operand insertion. */
@@ -77,11 +76,12 @@ static CGEN_INLINE long extract_1
/* Subroutine of insert_normal. */
static CGEN_INLINE void
-insert_1 (cd, value, start, length, word_length, bufp)
- CGEN_CPU_DESC cd;
- unsigned long value;
- int start,length,word_length;
- unsigned char *bufp;
+insert_1 (CGEN_CPU_DESC cd,
+ unsigned long value,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp)
{
unsigned long x,mask;
int shift;
@@ -118,13 +118,15 @@ insert_1 (cd, value, start, length, word_length, bufp)
necessary. */
static const char *
-insert_normal (cd, value, attrs, word_offset, start, length, word_length,
- total_length, buffer)
- CGEN_CPU_DESC cd;
- long value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
- CGEN_INSN_BYTES_PTR buffer;
+insert_normal (CGEN_CPU_DESC cd,
+ long value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
+ CGEN_INSN_BYTES_PTR buffer)
{
static char errbuf[100];
/* Written this way to avoid undefined behaviour. */
@@ -232,12 +234,11 @@ insert_normal (cd, value, attrs, word_offset, start, length, word_length,
The result is an error message or NULL if success. */
static const char *
-insert_insn_normal (cd, insn, fields, buffer, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN * insn;
- CGEN_FIELDS * fields;
- CGEN_INSN_BYTES_PTR buffer;
- bfd_vma pc;
+insert_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN * insn,
+ CGEN_FIELDS * fields,
+ CGEN_INSN_BYTES_PTR buffer,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
unsigned long value;
@@ -288,12 +289,11 @@ insert_insn_normal (cd, insn, fields, buffer, pc)
because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
static void
-put_insn_int_value (cd, buf, length, insn_length, value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_INSN_BYTES_PTR buf;
- int length;
- int insn_length;
- CGEN_INSN_INT value;
+put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_INSN_BYTES_PTR buf,
+ int length,
+ int insn_length,
+ CGEN_INSN_INT value)
{
/* For architectures with insns smaller than the base-insn-bitsize,
length may be too big. */
@@ -320,11 +320,11 @@ put_insn_int_value (cd, buf, length, insn_length, value)
Returns 1 for success, 0 for failure. */
static CGEN_INLINE int
-fill_cache (cd, ex_info, offset, bytes, pc)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_EXTRACT_INFO *ex_info;
- int offset, bytes;
- bfd_vma pc;
+fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_EXTRACT_INFO *ex_info,
+ int offset,
+ int bytes,
+ bfd_vma pc)
{
/* It's doubtful that the middle part has already been fetched so
we don't optimize that case. kiss. */
@@ -364,12 +364,13 @@ fill_cache (cd, ex_info, offset, bytes, pc)
/* Subroutine of extract_normal. */
static CGEN_INLINE long
-extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
- CGEN_CPU_DESC cd;
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
- int start,length,word_length;
- unsigned char *bufp;
- bfd_vma pc ATTRIBUTE_UNUSED;
+extract_1 (CGEN_CPU_DESC cd,
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp,
+ bfd_vma pc ATTRIBUTE_UNUSED)
{
unsigned long x;
int shift;
@@ -408,23 +409,25 @@ extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
necessary. */
static int
-extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
- word_length, total_length, pc, valuep)
- CGEN_CPU_DESC cd;
+extract_normal (CGEN_CPU_DESC cd,
#if ! CGEN_INT_INSN_P
- CGEN_EXTRACT_INFO *ex_info;
+ CGEN_EXTRACT_INFO *ex_info,
#else
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
#endif
- CGEN_INSN_INT insn_value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
+ CGEN_INSN_INT insn_value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
#if ! CGEN_INT_INSN_P
- bfd_vma pc;
+ bfd_vma pc,
#else
- bfd_vma pc ATTRIBUTE_UNUSED;
+ bfd_vma pc ATTRIBUTE_UNUSED,
#endif
- long *valuep;
+ long *valuep)
{
long value, mask;
@@ -505,13 +508,12 @@ extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
been called). */
static int
-extract_insn_normal (cd, insn, ex_info, insn_value, fields, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- CGEN_EXTRACT_INFO *ex_info;
- CGEN_INSN_INT insn_value;
- CGEN_FIELDS *fields;
- bfd_vma pc;
+extract_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ CGEN_EXTRACT_INFO *ex_info,
+ CGEN_INSN_INT insn_value,
+ CGEN_FIELDS *fields,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
const CGEN_SYNTAX_CHAR_TYPE *syn;
diff --git a/opcodes/frv-asm.c b/opcodes/frv-asm.c
index 0e3d8ddf669..1d24b28d405 100644
--- a/opcodes/frv-asm.c
+++ b/opcodes/frv-asm.c
@@ -43,7 +43,7 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
+ (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *);
/* -- assembler routines inserted here. */
@@ -66,6 +66,12 @@ static const char * parse_u12
PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
static const char * parse_even_register
PARAMS ((CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *));
+static const char * parse_A0
+ PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
+static const char * parse_A1
+ PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
+static const char * parse_A
+ PARAMS ((CGEN_CPU_DESC, const char **, int, long *, long));
static const char *
parse_ulo16 (cd, strp, opindex, valuep)
@@ -349,6 +355,49 @@ parse_u12 (cd, strp, opindex, valuep)
}
static const char *
+parse_A (cd, strp, opindex, valuep, A)
+ CGEN_CPU_DESC cd;
+ const char **strp;
+ int opindex;
+ long *valuep;
+ long A;
+{
+ const char *errmsg;
+
+ if (**strp == '#')
+ ++*strp;
+
+ errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, valuep);
+ if (errmsg)
+ return errmsg;
+
+ if (*valuep != A)
+ return "Value of A operand must be 0 or 1";
+
+ return NULL;
+}
+
+static const char *
+parse_A0 (cd, strp, opindex, valuep)
+ CGEN_CPU_DESC cd;
+ const char **strp;
+ int opindex;
+ long *valuep;
+{
+ return parse_A (cd, strp, opindex, valuep, 0);
+}
+
+static const char *
+parse_A1 (cd, strp, opindex, valuep)
+ CGEN_CPU_DESC cd;
+ const char **strp;
+ int opindex;
+ long *valuep;
+{
+ return parse_A (cd, strp, opindex, valuep, 1);
+}
+
+static const char *
parse_even_register (cd, strP, tableP, valueP)
CGEN_CPU_DESC cd;
const char ** strP;
@@ -399,8 +448,11 @@ frv_cgen_parse_operand (cd, opindex, strp, fields)
switch (opindex)
{
- case FRV_OPERAND_A :
- errmsg = cgen_parse_unsigned_integer (cd, strp, FRV_OPERAND_A, &fields->f_A);
+ case FRV_OPERAND_A0 :
+ errmsg = parse_A0 (cd, strp, FRV_OPERAND_A0, &fields->f_A);
+ break;
+ case FRV_OPERAND_A1 :
+ errmsg = parse_A1 (cd, strp, FRV_OPERAND_A1, &fields->f_A);
break;
case FRV_OPERAND_ACC40SI :
errmsg = cgen_parse_keyword (cd, strp, & frv_cgen_opval_acc_names, & fields->f_ACC40Si);
@@ -659,8 +711,7 @@ frv_cgen_init_asm (cd)
Returns NULL for success, an error message for failure. */
char *
-frv_cgen_build_insn_regex (insn)
- CGEN_INSN *insn;
+frv_cgen_build_insn_regex (CGEN_INSN *insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
@@ -783,11 +834,10 @@ frv_cgen_build_insn_regex (insn)
Returns NULL for success, an error message for failure. */
static const char *
-parse_insn_normal (cd, insn, strp, fields)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- const char **strp;
- CGEN_FIELDS *fields;
+parse_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ const char **strp,
+ CGEN_FIELDS *fields)
{
/* ??? Runtime added insns not handled yet. */
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
@@ -925,12 +975,11 @@ parse_insn_normal (cd, insn, strp, fields)
mind helps keep the design clean. */
const CGEN_INSN *
-frv_cgen_assemble_insn (cd, str, fields, buf, errmsg)
- CGEN_CPU_DESC cd;
- const char *str;
- CGEN_FIELDS *fields;
- CGEN_INSN_BYTES_PTR buf;
- char **errmsg;
+frv_cgen_assemble_insn (CGEN_CPU_DESC cd,
+ const char *str,
+ CGEN_FIELDS *fields,
+ CGEN_INSN_BYTES_PTR buf,
+ char **errmsg)
{
const char *start;
CGEN_INSN_LIST *ilist;
@@ -1034,9 +1083,7 @@ frv_cgen_assemble_insn (cd, str, fields, buf, errmsg)
FIXME: Not currently used. */
void
-frv_cgen_asm_hash_keywords (cd, opvals)
- CGEN_CPU_DESC cd;
- CGEN_KEYWORD *opvals;
+frv_cgen_asm_hash_keywords (CGEN_CPU_DESC cd, CGEN_KEYWORD *opvals)
{
CGEN_KEYWORD_SEARCH search = cgen_keyword_search_init (opvals, NULL);
const CGEN_KEYWORD_ENTRY * ke;
diff --git a/opcodes/frv-desc.c b/opcodes/frv-desc.c
index 97d49b3077b..1e660261c85 100644
--- a/opcodes/frv-desc.c
+++ b/opcodes/frv-desc.c
@@ -68,15 +68,23 @@ static const CGEN_ATTR_ENTRY UNIT_attr[] =
{ "I0", UNIT_I0 },
{ "I1", UNIT_I1 },
{ "I01", UNIT_I01 },
+ { "IALL", UNIT_IALL },
{ "FM0", UNIT_FM0 },
{ "FM1", UNIT_FM1 },
{ "FM01", UNIT_FM01 },
+ { "FMALL", UNIT_FMALL },
+ { "FMLOW", UNIT_FMLOW },
{ "B0", UNIT_B0 },
{ "B1", UNIT_B1 },
{ "B01", UNIT_B01 },
{ "C", UNIT_C },
{ "MULT_DIV", UNIT_MULT_DIV },
{ "LOAD", UNIT_LOAD },
+ { "STORE", UNIT_STORE },
+ { "SCAN", UNIT_SCAN },
+ { "DCPL", UNIT_DCPL },
+ { "MDUALACC", UNIT_MDUALACC },
+ { "MCLRACC_1", UNIT_MCLRACC_1 },
{ "NUM_UNITS", UNIT_NUM_UNITS },
{ 0, 0 }
};
@@ -2157,10 +2165,6 @@ const CGEN_OPERAND frv_cgen_operand_table[] =
{ "debug", FRV_OPERAND_DEBUG, HW_H_UINT, 25, 1,
{ 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_DEBUG] } },
{ 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
-/* A: all accumulator indicator */
- { "A", FRV_OPERAND_A, HW_H_UINT, 17, 1,
- { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_A] } },
- { 0|A(HASH_PREFIX), { (1<<MACH_BASE) } } },
/* ae: all entries indicator */
{ "ae", FRV_OPERAND_AE, HW_H_UINT, 25, 1,
{ 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_AE] } },
@@ -2173,6 +2177,14 @@ const CGEN_OPERAND frv_cgen_operand_table[] =
{ "label24", FRV_OPERAND_LABEL24, HW_H_IADDR, 17, 24,
{ 2, { (const PTR) &FRV_F_LABEL24_MULTI_IFIELD[0] } },
{ 0|A(PCREL_ADDR)|A(VIRTUAL), { (1<<MACH_BASE) } } },
+/* A0: A==0 operand of mclracc */
+ { "A0", FRV_OPERAND_A0, HW_H_UINT, 17, 1,
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_A] } },
+ { 0, { (1<<MACH_BASE) } } },
+/* A1: A==1 operand of mclracc */
+ { "A1", FRV_OPERAND_A1, HW_H_UINT, 17, 1,
+ { 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_A] } },
+ { 0, { (1<<MACH_BASE) } } },
/* FRintieven: (even) source register 1 */
{ "FRintieven", FRV_OPERAND_FRINTIEVEN, HW_H_FR_INT, 17, 6,
{ 0, { (const PTR) &frv_cgen_ifld_table[FRV_F_FRI] } },
@@ -2272,32 +2284,32 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* add$pack $GRi,$GRj,$GRk */
{
FRV_INSN_ADD, "add", "add", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* sub$pack $GRi,$GRj,$GRk */
{
FRV_INSN_SUB, "sub", "sub", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* and$pack $GRi,$GRj,$GRk */
{
FRV_INSN_AND, "and", "and", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* or$pack $GRi,$GRj,$GRk */
{
FRV_INSN_OR, "or", "or", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* xor$pack $GRi,$GRj,$GRk */
{
FRV_INSN_XOR, "xor", "xor", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* not$pack $GRj,$GRk */
{
FRV_INSN_NOT, "not", "not", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* sdiv$pack $GRi,$GRj,$GRk */
{
@@ -2332,52 +2344,52 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* sll$pack $GRi,$GRj,$GRk */
{
FRV_INSN_SLL, "sll", "sll", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* srl$pack $GRi,$GRj,$GRk */
{
FRV_INSN_SRL, "srl", "srl", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* sra$pack $GRi,$GRj,$GRk */
{
FRV_INSN_SRA, "sra", "sra", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* scan$pack $GRi,$GRj,$GRk */
{
FRV_INSN_SCAN, "scan", "scan", 32,
- { 0, { (1<<MACH_BASE), UNIT_MULT_DIV, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_SCAN, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* cadd$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CADD, "cadd", "cadd", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* csub$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CSUB, "csub", "csub", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* cand$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CAND, "cand", "cand", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* cor$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_COR, "cor", "cor", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* cxor$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CXOR, "cxor", "cxor", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* cnot$pack $GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CNOT, "cnot", "cnot", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* csmul$pack $GRi,$GRj,$GRdoublek,$CCi,$cond */
{
@@ -2397,62 +2409,62 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* csll$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CSLL, "csll", "csll", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* csrl$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CSRL, "csrl", "csrl", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* csra$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CSRA, "csra", "csra", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* cscan$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CSCAN, "cscan", "cscan", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_MULT_DIV, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_SCAN, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* addcc$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_ADDCC, "addcc", "addcc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* subcc$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_SUBCC, "subcc", "subcc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* andcc$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_ANDCC, "andcc", "andcc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* orcc$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_ORCC, "orcc", "orcc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* xorcc$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_XORCC, "xorcc", "xorcc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* sllcc$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_SLLCC, "sllcc", "sllcc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* srlcc$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_SRLCC, "srlcc", "srlcc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* sracc$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_SRACC, "sracc", "sracc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* smulcc$pack $GRi,$GRj,$GRdoublek,$ICCi_1 */
{
@@ -2467,12 +2479,12 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* caddcc$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CADDCC, "caddcc", "caddcc", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* csubcc$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CSUBCC, "csubcc", "csubcc", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* csmulcc$pack $GRi,$GRj,$GRdoublek,$CCi,$cond */
{
@@ -2482,77 +2494,77 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* candcc$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CANDCC, "candcc", "candcc", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* corcc$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CORCC, "corcc", "corcc", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* cxorcc$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CXORCC, "cxorcc", "cxorcc", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* csllcc$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CSLLCC, "csllcc", "csllcc", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* csrlcc$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CSRLCC, "csrlcc", "csrlcc", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* csracc$pack $GRi,$GRj,$GRk,$CCi,$cond */
{
FRV_INSN_CSRACC, "csracc", "csracc", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* addx$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_ADDX, "addx", "addx", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* subx$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_SUBX, "subx", "subx", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* addxcc$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_ADDXCC, "addxcc", "addxcc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* subxcc$pack $GRi,$GRj,$GRk,$ICCi_1 */
{
FRV_INSN_SUBXCC, "subxcc", "subxcc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* addi$pack $GRi,$s12,$GRk */
{
FRV_INSN_ADDI, "addi", "addi", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* subi$pack $GRi,$s12,$GRk */
{
FRV_INSN_SUBI, "subi", "subi", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* andi$pack $GRi,$s12,$GRk */
{
FRV_INSN_ANDI, "andi", "andi", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* ori$pack $GRi,$s12,$GRk */
{
FRV_INSN_ORI, "ori", "ori", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* xori$pack $GRi,$s12,$GRk */
{
FRV_INSN_XORI, "xori", "xori", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* sdivi$pack $GRi,$s12,$GRk */
{
@@ -2587,47 +2599,47 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* slli$pack $GRi,$s12,$GRk */
{
FRV_INSN_SLLI, "slli", "slli", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* srli$pack $GRi,$s12,$GRk */
{
FRV_INSN_SRLI, "srli", "srli", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* srai$pack $GRi,$s12,$GRk */
{
FRV_INSN_SRAI, "srai", "srai", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* scani$pack $GRi,$s12,$GRk */
{
FRV_INSN_SCANI, "scani", "scani", 32,
- { 0, { (1<<MACH_BASE), UNIT_MULT_DIV, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_SCAN, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* addicc$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_ADDICC, "addicc", "addicc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* subicc$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_SUBICC, "subicc", "subicc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* andicc$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_ANDICC, "andicc", "andicc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* oricc$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_ORICC, "oricc", "oricc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* xoricc$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_XORICC, "xoricc", "xoricc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* smulicc$pack $GRi,$s10,$GRdoublek,$ICCi_1 */
{
@@ -2642,62 +2654,62 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* sllicc$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_SLLICC, "sllicc", "sllicc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* srlicc$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_SRLICC, "srlicc", "srlicc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* sraicc$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_SRAICC, "sraicc", "sraicc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* addxi$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_ADDXI, "addxi", "addxi", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* subxi$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_SUBXI, "subxi", "subxi", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* addxicc$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_ADDXICC, "addxicc", "addxicc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* subxicc$pack $GRi,$s10,$GRk,$ICCi_1 */
{
FRV_INSN_SUBXICC, "subxicc", "subxicc", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* cmpb$pack $GRi,$GRj,$ICCi_1 */
{
FRV_INSN_CMPB, "cmpb", "cmpb", 32,
- { 0, { (1<<MACH_FR400), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_NONE } }
},
/* cmpba$pack $GRi,$GRj,$ICCi_1 */
{
FRV_INSN_CMPBA, "cmpba", "cmpba", 32,
- { 0, { (1<<MACH_FR400), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_NONE } }
},
/* setlo$pack $ulo16,$GRklo */
{
FRV_INSN_SETLO, "setlo", "setlo", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* sethi$pack $uhi16,$GRkhi */
{
FRV_INSN_SETHI, "sethi", "sethi", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* setlos$pack $slo16,$GRk */
{
FRV_INSN_SETLOS, "setlos", "setlos", 32,
- { 0, { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* ldsb$pack @($GRi,$GRj),$GRk */
{
@@ -3092,182 +3104,182 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* stb$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_STB, "stb", "stb", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* sth$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_STH, "sth", "sth", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* st$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_ST, "st", "st", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stbf$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_STBF, "stbf", "stbf", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* sthf$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_STHF, "sthf", "sthf", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stf$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_STF, "stf", "stf", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stc$pack $CPRk,@($GRi,$GRj) */
{
FRV_INSN_STC, "stc", "stc", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* rstb$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_RSTB, "rstb", "rstb", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* rsth$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_RSTH, "rsth", "rsth", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* rst$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_RST, "rst", "rst", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* rstbf$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_RSTBF, "rstbf", "rstbf", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* rsthf$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_RSTHF, "rsthf", "rsthf", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* rstf$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_RSTF, "rstf", "rstf", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* std$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_STD, "std", "std", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stdf$pack $FRk,@($GRi,$GRj) */
{
FRV_INSN_STDF, "stdf", "stdf", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stdc$pack $CPRk,@($GRi,$GRj) */
{
FRV_INSN_STDC, "stdc", "stdc", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* rstd$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_RSTD, "rstd", "rstd", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* rstdf$pack $FRk,@($GRi,$GRj) */
{
FRV_INSN_RSTDF, "rstdf", "rstdf", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* stq$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_STQ, "stq", "stq", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* stqf$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_STQF, "stqf", "stqf", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* stqc$pack $CPRk,@($GRi,$GRj) */
{
FRV_INSN_STQC, "stqc", "stqc", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* rstq$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_RSTQ, "rstq", "rstq", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* rstqf$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_RSTQF, "rstqf", "rstqf", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* stbu$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_STBU, "stbu", "stbu", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* sthu$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_STHU, "sthu", "sthu", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stu$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_STU, "stu", "stu", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stbfu$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_STBFU, "stbfu", "stbfu", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* sthfu$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_STHFU, "sthfu", "sthfu", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stfu$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_STFU, "stfu", "stfu", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stcu$pack $CPRk,@($GRi,$GRj) */
{
FRV_INSN_STCU, "stcu", "stcu", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stdu$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_STDU, "stdu", "stdu", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stdfu$pack $FRk,@($GRi,$GRj) */
{
FRV_INSN_STDFU, "stdfu", "stdfu", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stdcu$pack $CPRk,@($GRi,$GRj) */
{
FRV_INSN_STDCU, "stdcu", "stdcu", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stqu$pack $GRk,@($GRi,$GRj) */
{
FRV_INSN_STQU, "stqu", "stqu", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* stqfu$pack $FRintk,@($GRi,$GRj) */
{
FRV_INSN_STQFU, "stqfu", "stqfu", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* stqcu$pack $CPRk,@($GRi,$GRj) */
{
FRV_INSN_STQCU, "stqcu", "stqcu", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* cldsb$pack @($GRi,$GRj),$GRk,$CCi,$cond */
{
@@ -3382,137 +3394,137 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* cstb$pack $GRk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTB, "cstb", "cstb", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* csth$pack $GRk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTH, "csth", "csth", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* cst$pack $GRk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CST, "cst", "cst", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* cstbf$pack $FRintk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTBF, "cstbf", "cstbf", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* csthf$pack $FRintk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTHF, "csthf", "csthf", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* cstf$pack $FRintk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTF, "cstf", "cstf", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* cstd$pack $GRk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTD, "cstd", "cstd", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* cstdf$pack $FRk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTDF, "cstdf", "cstdf", 32,
- { 0|A(FR_ACCESS)|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS)|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* cstq$pack $GRk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTQ, "cstq", "cstq", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* cstbu$pack $GRk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTBU, "cstbu", "cstbu", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* csthu$pack $GRk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTHU, "csthu", "csthu", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* cstu$pack $GRk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTU, "cstu", "cstu", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* cstbfu$pack $FRintk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTBFU, "cstbfu", "cstbfu", 32,
- { 0|A(FR_ACCESS)|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS)|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* csthfu$pack $FRintk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTHFU, "csthfu", "csthfu", 32,
- { 0|A(FR_ACCESS)|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS)|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* cstfu$pack $FRintk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTFU, "cstfu", "cstfu", 32,
- { 0|A(FR_ACCESS)|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS)|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* cstdu$pack $GRk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTDU, "cstdu", "cstdu", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* cstdfu$pack $FRk,@($GRi,$GRj),$CCi,$cond */
{
FRV_INSN_CSTDFU, "cstdfu", "cstdfu", 32,
- { 0|A(FR_ACCESS)|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS)|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stbi$pack $GRk,@($GRi,$d12) */
{
FRV_INSN_STBI, "stbi", "stbi", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* sthi$pack $GRk,@($GRi,$d12) */
{
FRV_INSN_STHI, "sthi", "sthi", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* sti$pack $GRk,@($GRi,$d12) */
{
FRV_INSN_STI, "sti", "sti", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stbfi$pack $FRintk,@($GRi,$d12) */
{
FRV_INSN_STBFI, "stbfi", "stbfi", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* sthfi$pack $FRintk,@($GRi,$d12) */
{
FRV_INSN_STHFI, "sthfi", "sthfi", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stfi$pack $FRintk,@($GRi,$d12) */
{
FRV_INSN_STFI, "stfi", "stfi", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stdi$pack $GRk,@($GRi,$d12) */
{
FRV_INSN_STDI, "stdi", "stdi", 32,
- { 0, { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stdfi$pack $FRk,@($GRi,$d12) */
{
FRV_INSN_STDFI, "stdfi", "stdfi", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_I0, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_BASE), UNIT_STORE, FR400_MAJOR_I_3, FR500_MAJOR_I_3 } }
},
/* stqi$pack $GRk,@($GRi,$d12) */
{
FRV_INSN_STQI, "stqi", "stqi", 32,
- { 0, { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* stqfi$pack $FRintk,@($GRi,$d12) */
{
FRV_INSN_STQFI, "stqfi", "stqfi", 32,
- { 0|A(FR_ACCESS), { (1<<MACH_FRV), UNIT_I0, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
+ { 0|A(FR_ACCESS), { (1<<MACH_FRV), UNIT_STORE, FR400_MAJOR_NONE, FR500_MAJOR_I_3 } }
},
/* swap$pack @($GRi,$GRj),$GRk */
{
@@ -4877,7 +4889,7 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* dcpl$pack $GRi,$GRj,$lock */
{
FRV_INSN_DCPL, "dcpl", "dcpl", 32,
- { 0, { (1<<MACH_BASE), UNIT_C, FR400_MAJOR_C_2, FR500_MAJOR_C_2 } }
+ { 0, { (1<<MACH_BASE), UNIT_DCPL, FR400_MAJOR_C_2, FR500_MAJOR_C_2 } }
},
/* icul$pack $GRi */
{
@@ -4952,62 +4964,62 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* fitos$pack $FRintj,$FRk */
{
FRV_INSN_FITOS, "fitos", "fitos", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fstoi$pack $FRj,$FRintk */
{
FRV_INSN_FSTOI, "fstoi", "fstoi", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fitod$pack $FRintj,$FRdoublek */
{
FRV_INSN_FITOD, "fitod", "fitod", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fdtoi$pack $FRdoublej,$FRintk */
{
FRV_INSN_FDTOI, "fdtoi", "fdtoi", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fditos$pack $FRintj,$FRk */
{
FRV_INSN_FDITOS, "fditos", "fditos", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fdstoi$pack $FRj,$FRintk */
{
FRV_INSN_FDSTOI, "fdstoi", "fdstoi", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* nfditos$pack $FRintj,$FRk */
{
FRV_INSN_NFDITOS, "nfditos", "nfditos", 32,
- { 0|A(NON_EXCEPTING), { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0|A(NON_EXCEPTING), { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* nfdstoi$pack $FRj,$FRintk */
{
FRV_INSN_NFDSTOI, "nfdstoi", "nfdstoi", 32,
- { 0|A(NON_EXCEPTING), { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0|A(NON_EXCEPTING), { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* cfitos$pack $FRintj,$FRk,$CCi,$cond */
{
FRV_INSN_CFITOS, "cfitos", "cfitos", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* cfstoi$pack $FRj,$FRintk,$CCi,$cond */
{
FRV_INSN_CFSTOI, "cfstoi", "cfstoi", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* nfitos$pack $FRintj,$FRk */
{
FRV_INSN_NFITOS, "nfitos", "nfitos", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* nfstoi$pack $FRj,$FRintk */
{
FRV_INSN_NFSTOI, "nfstoi", "nfstoi", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fmovs$pack $FRj,$FRk */
{
@@ -5022,7 +5034,7 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* fdmovs$pack $FRj,$FRk */
{
FRV_INSN_FDMOVS, "fdmovs", "fdmovs", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* cfmovs$pack $FRj,$FRk,$CCi,$cond */
{
@@ -5032,42 +5044,42 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* fnegs$pack $FRj,$FRk */
{
FRV_INSN_FNEGS, "fnegs", "fnegs", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fnegd$pack $FRdoublej,$FRdoublek */
{
FRV_INSN_FNEGD, "fnegd", "fnegd", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fdnegs$pack $FRj,$FRk */
{
FRV_INSN_FDNEGS, "fdnegs", "fdnegs", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* cfnegs$pack $FRj,$FRk,$CCi,$cond */
{
FRV_INSN_CFNEGS, "cfnegs", "cfnegs", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fabss$pack $FRj,$FRk */
{
FRV_INSN_FABSS, "fabss", "fabss", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fabsd$pack $FRdoublej,$FRdoublek */
{
FRV_INSN_FABSD, "fabsd", "fabsd", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fdabss$pack $FRj,$FRk */
{
FRV_INSN_FDABSS, "fdabss", "fdabss", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* cfabss$pack $FRj,$FRk,$CCi,$cond */
{
FRV_INSN_CFABSS, "cfabss", "cfabss", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_1 } }
},
/* fsqrts$pack $FRj,$FRk */
{
@@ -5102,12 +5114,12 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* fadds$pack $FRi,$FRj,$FRk */
{
FRV_INSN_FADDS, "fadds", "fadds", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
},
/* fsubs$pack $FRi,$FRj,$FRk */
{
FRV_INSN_FSUBS, "fsubs", "fsubs", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
},
/* fmuls$pack $FRi,$FRj,$FRk */
{
@@ -5122,32 +5134,32 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* faddd$pack $FRdoublei,$FRdoublej,$FRdoublek */
{
FRV_INSN_FADDD, "faddd", "faddd", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
},
/* fsubd$pack $FRdoublei,$FRdoublej,$FRdoublek */
{
FRV_INSN_FSUBD, "fsubd", "fsubd", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
},
/* fmuld$pack $FRdoublei,$FRdoublej,$FRdoublek */
{
FRV_INSN_FMULD, "fmuld", "fmuld", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_3 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_3 } }
},
/* fdivd$pack $FRdoublei,$FRdoublej,$FRdoublek */
{
FRV_INSN_FDIVD, "fdivd", "fdivd", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_4 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_4 } }
},
/* cfadds$pack $FRi,$FRj,$FRk,$CCi,$cond */
{
FRV_INSN_CFADDS, "cfadds", "cfadds", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
},
/* cfsubs$pack $FRi,$FRj,$FRk,$CCi,$cond */
{
FRV_INSN_CFSUBS, "cfsubs", "cfsubs", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
},
/* cfmuls$pack $FRi,$FRj,$FRk,$CCi,$cond */
{
@@ -5162,12 +5174,12 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* nfadds$pack $FRi,$FRj,$FRk */
{
FRV_INSN_NFADDS, "nfadds", "nfadds", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
},
/* nfsubs$pack $FRi,$FRj,$FRk */
{
FRV_INSN_NFSUBS, "nfsubs", "nfsubs", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
},
/* nfmuls$pack $FRi,$FRj,$FRk */
{
@@ -5182,72 +5194,72 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* fcmps$pack $FRi,$FRj,$FCCi_2 */
{
FRV_INSN_FCMPS, "fcmps", "fcmps", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
},
/* fcmpd$pack $FRdoublei,$FRdoublej,$FCCi_2 */
{
FRV_INSN_FCMPD, "fcmpd", "fcmpd", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
},
/* cfcmps$pack $FRi,$FRj,$FCCi_2,$CCi,$cond */
{
FRV_INSN_CFCMPS, "cfcmps", "cfcmps", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_2 } }
},
/* fdcmps$pack $FRi,$FRj,$FCCi_2 */
{
FRV_INSN_FDCMPS, "fdcmps", "fdcmps", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_6 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_6 } }
},
/* fmadds$pack $FRi,$FRj,$FRk */
{
FRV_INSN_FMADDS, "fmadds", "fmadds", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
},
/* fmsubs$pack $FRi,$FRj,$FRk */
{
FRV_INSN_FMSUBS, "fmsubs", "fmsubs", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
},
/* fmaddd$pack $FRdoublei,$FRdoublej,$FRdoublek */
{
FRV_INSN_FMADDD, "fmaddd", "fmaddd", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
},
/* fmsubd$pack $FRdoublei,$FRdoublej,$FRdoublek */
{
FRV_INSN_FMSUBD, "fmsubd", "fmsubd", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
},
/* fdmadds$pack $FRi,$FRj,$FRk */
{
FRV_INSN_FDMADDS, "fdmadds", "fdmadds", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
},
/* nfdmadds$pack $FRi,$FRj,$FRk */
{
FRV_INSN_NFDMADDS, "nfdmadds", "nfdmadds", 32,
- { 0, { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
+ { 0, { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
},
/* cfmadds$pack $FRi,$FRj,$FRk,$CCi,$cond */
{
FRV_INSN_CFMADDS, "cfmadds", "cfmadds", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
},
/* cfmsubs$pack $FRi,$FRj,$FRk,$CCi,$cond */
{
FRV_INSN_CFMSUBS, "cfmsubs", "cfmsubs", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
},
/* nfmadds$pack $FRi,$FRj,$FRk */
{
FRV_INSN_NFMADDS, "nfmadds", "nfmadds", 32,
- { 0|A(NON_EXCEPTING), { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
+ { 0|A(NON_EXCEPTING), { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
},
/* nfmsubs$pack $FRi,$FRj,$FRk */
{
FRV_INSN_NFMSUBS, "nfmsubs", "nfmsubs", 32,
- { 0|A(NON_EXCEPTING), { (1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
+ { 0|A(NON_EXCEPTING), { (1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_5 } }
},
/* fmas$pack $FRi,$FRj,$FRk */
{
@@ -5377,72 +5389,72 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* mhsetlos$pack $u12,$FRklo */
{
FRV_INSN_MHSETLOS, "mhsetlos", "mhsetlos", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
},
/* mhsethis$pack $u12,$FRkhi */
{
FRV_INSN_MHSETHIS, "mhsethis", "mhsethis", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
},
/* mhdsets$pack $u12,$FRintk */
{
FRV_INSN_MHDSETS, "mhdsets", "mhdsets", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
},
/* mhsetloh$pack $s5,$FRklo */
{
FRV_INSN_MHSETLOH, "mhsetloh", "mhsetloh", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
},
/* mhsethih$pack $s5,$FRkhi */
{
FRV_INSN_MHSETHIH, "mhsethih", "mhsethih", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
},
/* mhdseth$pack $s5,$FRintk */
{
FRV_INSN_MHDSETH, "mhdseth", "mhdseth", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
},
/* mand$pack $FRinti,$FRintj,$FRintk */
{
FRV_INSN_MAND, "mand", "mand", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* mor$pack $FRinti,$FRintj,$FRintk */
{
FRV_INSN_MOR, "mor", "mor", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* mxor$pack $FRinti,$FRintj,$FRintk */
{
FRV_INSN_MXOR, "mxor", "mxor", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* cmand$pack $FRinti,$FRintj,$FRintk,$CCi,$cond */
{
FRV_INSN_CMAND, "cmand", "cmand", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* cmor$pack $FRinti,$FRintj,$FRintk,$CCi,$cond */
{
FRV_INSN_CMOR, "cmor", "cmor", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* cmxor$pack $FRinti,$FRintj,$FRintk,$CCi,$cond */
{
FRV_INSN_CMXOR, "cmxor", "cmxor", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* mnot$pack $FRintj,$FRintk */
{
FRV_INSN_MNOT, "mnot", "mnot", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* cmnot$pack $FRintj,$FRintk,$CCi,$cond */
{
FRV_INSN_CMNOT, "cmnot", "cmnot", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* mrotli$pack $FRinti,$u6,$FRintk */
{
@@ -5487,12 +5499,12 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* mdcutssi$pack $ACC40Si,$s6,$FRintkeven */
{
FRV_INSN_MDCUTSSI, "mdcutssi", "mdcutssi", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM0, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMLOW, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
},
/* maveh$pack $FRinti,$FRintj,$FRintk */
{
FRV_INSN_MAVEH, "maveh", "maveh", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* msllhi$pack $FRinti,$u6,$FRintk */
{
@@ -5512,342 +5524,342 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* mdrotli$pack $FRintieven,$s6,$FRintkeven */
{
FRV_INSN_MDROTLI, "mdrotli", "mdrotli", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM0, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMLOW, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
},
/* mcplhi$pack $FRinti,$u6,$FRintk */
{
FRV_INSN_MCPLHI, "mcplhi", "mcplhi", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM0, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMLOW, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
},
/* mcpli$pack $FRinti,$u6,$FRintk */
{
FRV_INSN_MCPLI, "mcpli", "mcpli", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM0, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMLOW, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
},
/* msaths$pack $FRinti,$FRintj,$FRintk */
{
FRV_INSN_MSATHS, "msaths", "msaths", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* mqsaths$pack $FRintieven,$FRintjeven,$FRintkeven */
{
FRV_INSN_MQSATHS, "mqsaths", "mqsaths", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
},
/* msathu$pack $FRinti,$FRintj,$FRintk */
{
FRV_INSN_MSATHU, "msathu", "msathu", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* mcmpsh$pack $FRinti,$FRintj,$FCCk */
{
FRV_INSN_MCMPSH, "mcmpsh", "mcmpsh", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* mcmpuh$pack $FRinti,$FRintj,$FCCk */
{
FRV_INSN_MCMPUH, "mcmpuh", "mcmpuh", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* mabshs$pack $FRintj,$FRintk */
{
FRV_INSN_MABSHS, "mabshs", "mabshs", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
},
/* maddhss$pack $FRinti,$FRintj,$FRintk */
{
FRV_INSN_MADDHSS, "maddhss", "maddhss", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* maddhus$pack $FRinti,$FRintj,$FRintk */
{
FRV_INSN_MADDHUS, "maddhus", "maddhus", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* msubhss$pack $FRinti,$FRintj,$FRintk */
{
FRV_INSN_MSUBHSS, "msubhss", "msubhss", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* msubhus$pack $FRinti,$FRintj,$FRintk */
{
FRV_INSN_MSUBHUS, "msubhus", "msubhus", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* cmaddhss$pack $FRinti,$FRintj,$FRintk,$CCi,$cond */
{
FRV_INSN_CMADDHSS, "cmaddhss", "cmaddhss", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* cmaddhus$pack $FRinti,$FRintj,$FRintk,$CCi,$cond */
{
FRV_INSN_CMADDHUS, "cmaddhus", "cmaddhus", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* cmsubhss$pack $FRinti,$FRintj,$FRintk,$CCi,$cond */
{
FRV_INSN_CMSUBHSS, "cmsubhss", "cmsubhss", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* cmsubhus$pack $FRinti,$FRintj,$FRintk,$CCi,$cond */
{
FRV_INSN_CMSUBHUS, "cmsubhus", "cmsubhus", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
},
/* mqaddhss$pack $FRintieven,$FRintjeven,$FRintkeven */
{
FRV_INSN_MQADDHSS, "mqaddhss", "mqaddhss", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
},
/* mqaddhus$pack $FRintieven,$FRintjeven,$FRintkeven */
{
FRV_INSN_MQADDHUS, "mqaddhus", "mqaddhus", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
},
/* mqsubhss$pack $FRintieven,$FRintjeven,$FRintkeven */
{
FRV_INSN_MQSUBHSS, "mqsubhss", "mqsubhss", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
},
/* mqsubhus$pack $FRintieven,$FRintjeven,$FRintkeven */
{
FRV_INSN_MQSUBHUS, "mqsubhus", "mqsubhus", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
},
/* cmqaddhss$pack $FRintieven,$FRintjeven,$FRintkeven,$CCi,$cond */
{
FRV_INSN_CMQADDHSS, "cmqaddhss", "cmqaddhss", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
},
/* cmqaddhus$pack $FRintieven,$FRintjeven,$FRintkeven,$CCi,$cond */
{
FRV_INSN_CMQADDHUS, "cmqaddhus", "cmqaddhus", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
},
/* cmqsubhss$pack $FRintieven,$FRintjeven,$FRintkeven,$CCi,$cond */
{
FRV_INSN_CMQSUBHSS, "cmqsubhss", "cmqsubhss", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
},
/* cmqsubhus$pack $FRintieven,$FRintjeven,$FRintkeven,$CCi,$cond */
{
FRV_INSN_CMQSUBHUS, "cmqsubhus", "cmqsubhus", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_1 } }
},
/* maddaccs$pack $ACC40Si,$ACC40Sk */
{
FRV_INSN_MADDACCS, "maddaccs", "maddaccs", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
},
/* msubaccs$pack $ACC40Si,$ACC40Sk */
{
FRV_INSN_MSUBACCS, "msubaccs", "msubaccs", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
},
/* mdaddaccs$pack $ACC40Si,$ACC40Sk */
{
FRV_INSN_MDADDACCS, "mdaddaccs", "mdaddaccs", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM0, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_MDUALACC, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
},
/* mdsubaccs$pack $ACC40Si,$ACC40Sk */
{
FRV_INSN_MDSUBACCS, "mdsubaccs", "mdsubaccs", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM0, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_MDUALACC, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
},
/* masaccs$pack $ACC40Si,$ACC40Sk */
{
FRV_INSN_MASACCS, "masaccs", "masaccs", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_NONE } }
},
/* mdasaccs$pack $ACC40Si,$ACC40Sk */
{
FRV_INSN_MDASACCS, "mdasaccs", "mdasaccs", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM0, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_MDUALACC, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
},
/* mmulhs$pack $FRinti,$FRintj,$ACC40Sk */
{
FRV_INSN_MMULHS, "mmulhs", "mmulhs", 32,
- { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mmulhu$pack $FRinti,$FRintj,$ACC40Sk */
{
FRV_INSN_MMULHU, "mmulhu", "mmulhu", 32,
- { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mmulxhs$pack $FRinti,$FRintj,$ACC40Sk */
{
FRV_INSN_MMULXHS, "mmulxhs", "mmulxhs", 32,
- { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mmulxhu$pack $FRinti,$FRintj,$ACC40Sk */
{
FRV_INSN_MMULXHU, "mmulxhu", "mmulxhu", 32,
- { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* cmmulhs$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond */
{
FRV_INSN_CMMULHS, "cmmulhs", "cmmulhs", 32,
- { 0|A(CONDITIONAL)|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL)|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* cmmulhu$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond */
{
FRV_INSN_CMMULHU, "cmmulhu", "cmmulhu", 32,
- { 0|A(CONDITIONAL)|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL)|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mqmulhs$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQMULHS, "mqmulhs", "mqmulhs", 32,
- { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* mqmulhu$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQMULHU, "mqmulhu", "mqmulhu", 32,
- { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* mqmulxhs$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQMULXHS, "mqmulxhs", "mqmulxhs", 32,
- { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* mqmulxhu$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQMULXHU, "mqmulxhu", "mqmulxhu", 32,
- { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* cmqmulhs$pack $FRintieven,$FRintjeven,$ACC40Sk,$CCi,$cond */
{
FRV_INSN_CMQMULHS, "cmqmulhs", "cmqmulhs", 32,
- { 0|A(CONDITIONAL)|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL)|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* cmqmulhu$pack $FRintieven,$FRintjeven,$ACC40Sk,$CCi,$cond */
{
FRV_INSN_CMQMULHU, "cmqmulhu", "cmqmulhu", 32,
- { 0|A(CONDITIONAL)|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL)|A(PRESERVE_OVF), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* mmachs$pack $FRinti,$FRintj,$ACC40Sk */
{
FRV_INSN_MMACHS, "mmachs", "mmachs", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mmachu$pack $FRinti,$FRintj,$ACC40Uk */
{
FRV_INSN_MMACHU, "mmachu", "mmachu", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mmrdhs$pack $FRinti,$FRintj,$ACC40Sk */
{
FRV_INSN_MMRDHS, "mmrdhs", "mmrdhs", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mmrdhu$pack $FRinti,$FRintj,$ACC40Uk */
{
FRV_INSN_MMRDHU, "mmrdhu", "mmrdhu", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* cmmachs$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond */
{
FRV_INSN_CMMACHS, "cmmachs", "cmmachs", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* cmmachu$pack $FRinti,$FRintj,$ACC40Uk,$CCi,$cond */
{
FRV_INSN_CMMACHU, "cmmachu", "cmmachu", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mqmachs$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQMACHS, "mqmachs", "mqmachs", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* mqmachu$pack $FRintieven,$FRintjeven,$ACC40Uk */
{
FRV_INSN_MQMACHU, "mqmachu", "mqmachu", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* cmqmachs$pack $FRintieven,$FRintjeven,$ACC40Sk,$CCi,$cond */
{
FRV_INSN_CMQMACHS, "cmqmachs", "cmqmachs", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* cmqmachu$pack $FRintieven,$FRintjeven,$ACC40Uk,$CCi,$cond */
{
FRV_INSN_CMQMACHU, "cmqmachu", "cmqmachu", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* mqxmachs$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQXMACHS, "mqxmachs", "mqxmachs", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM0, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_MDUALACC, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
},
/* mqxmacxhs$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQXMACXHS, "mqxmacxhs", "mqxmacxhs", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM0, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_MDUALACC, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
},
/* mqmacxhs$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQMACXHS, "mqmacxhs", "mqmacxhs", 32,
- { 0, { (1<<MACH_FR400), UNIT_FM0, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
+ { 0, { (1<<MACH_FR400), UNIT_MDUALACC, FR400_MAJOR_M_2, FR500_MAJOR_NONE } }
},
/* mcpxrs$pack $FRinti,$FRintj,$ACC40Sk */
{
FRV_INSN_MCPXRS, "mcpxrs", "mcpxrs", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mcpxru$pack $FRinti,$FRintj,$ACC40Sk */
{
FRV_INSN_MCPXRU, "mcpxru", "mcpxru", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mcpxis$pack $FRinti,$FRintj,$ACC40Sk */
{
FRV_INSN_MCPXIS, "mcpxis", "mcpxis", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mcpxiu$pack $FRinti,$FRintj,$ACC40Sk */
{
FRV_INSN_MCPXIU, "mcpxiu", "mcpxiu", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* cmcpxrs$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond */
{
FRV_INSN_CMCPXRS, "cmcpxrs", "cmcpxrs", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* cmcpxru$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond */
{
FRV_INSN_CMCPXRU, "cmcpxru", "cmcpxru", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* cmcpxis$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond */
{
FRV_INSN_CMCPXIS, "cmcpxis", "cmcpxis", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* cmcpxiu$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond */
{
FRV_INSN_CMCPXIU, "cmcpxiu", "cmcpxiu", 32,
- { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
+ { 0|A(CONDITIONAL), { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_4 } }
},
/* mqcpxrs$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQCPXRS, "mqcpxrs", "mqcpxrs", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* mqcpxru$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQCPXRU, "mqcpxru", "mqcpxru", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* mqcpxis$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQCPXIS, "mqcpxis", "mqcpxis", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* mqcpxiu$pack $FRintieven,$FRintjeven,$ACC40Sk */
{
FRV_INSN_MQCPXIU, "mqcpxiu", "mqcpxiu", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_2, FR500_MAJOR_M_4 } }
},
/* mexpdhw$pack $FRinti,$u6,$FRintk */
{
@@ -5919,10 +5931,20 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
FRV_INSN_CMBTOHE, "cmbtohe", "cmbtohe", 32,
{ 0|A(CONDITIONAL), { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_M_7 } }
},
-/* mclracc$pack $ACC40Sk,$A */
+/* mnop$pack */
+ {
+ FRV_INSN_MNOP, "mnop", "mnop", 32,
+ { 0, { (1<<MACH_BASE), UNIT_FMALL, FR400_MAJOR_M_1, FR500_MAJOR_M_1 } }
+ },
+/* mclracc$pack $ACC40Sk,$A0 */
+ {
+ FRV_INSN_MCLRACC_0, "mclracc-0", "mclracc", 32,
+ { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_M_1, FR500_MAJOR_M_3 } }
+ },
+/* mclracc$pack $ACC40Sk,$A1 */
{
- FRV_INSN_MCLRACC, "mclracc", "mclracc", 32,
- { 0, { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_M_3 } }
+ FRV_INSN_MCLRACC_1, "mclracc-1", "mclracc", 32,
+ { 0, { (1<<MACH_BASE), UNIT_MCLRACC_1, FR400_MAJOR_M_2, FR500_MAJOR_M_6 } }
},
/* mrdacc$pack $ACC40Si,$FRintk */
{
@@ -5957,7 +5979,7 @@ static const CGEN_IBASE frv_cgen_insn_table[MAX_INSNS] =
/* fnop$pack */
{
FRV_INSN_FNOP, "fnop", "fnop", 32,
- { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_F_8 } }
+ { 0, { (1<<MACH_SIMPLE)|(1<<MACH_TOMCAT)|(1<<MACH_FR500)|(1<<MACH_FRV), UNIT_FMALL, FR400_MAJOR_NONE, FR500_MAJOR_F_8 } }
},
};
diff --git a/opcodes/frv-desc.h b/opcodes/frv-desc.h
index a169e7a6092..5e6b061d412 100644
--- a/opcodes/frv-desc.h
+++ b/opcodes/frv-desc.h
@@ -541,9 +541,11 @@ typedef enum isa_attr {
/* Enum declaration for parallel execution pipeline selection. */
typedef enum unit_attr {
UNIT_NIL, UNIT_I0, UNIT_I1, UNIT_I01
- , UNIT_FM0, UNIT_FM1, UNIT_FM01, UNIT_B0
- , UNIT_B1, UNIT_B01, UNIT_C, UNIT_MULT_DIV
- , UNIT_LOAD, UNIT_NUM_UNITS
+ , UNIT_IALL, UNIT_FM0, UNIT_FM1, UNIT_FM01
+ , UNIT_FMALL, UNIT_FMLOW, UNIT_B0, UNIT_B1
+ , UNIT_B01, UNIT_C, UNIT_MULT_DIV, UNIT_LOAD
+ , UNIT_STORE, UNIT_SCAN, UNIT_DCPL, UNIT_MDUALACC
+ , UNIT_MCLRACC_1, UNIT_NUM_UNITS
} UNIT_ATTR;
/* Enum declaration for fr400 major insn categories. */
@@ -676,17 +678,17 @@ typedef enum cgen_operand_type {
, FRV_OPERAND_U16, FRV_OPERAND_S16, FRV_OPERAND_S6, FRV_OPERAND_S6_1
, FRV_OPERAND_U6, FRV_OPERAND_S5, FRV_OPERAND_COND, FRV_OPERAND_CCOND
, FRV_OPERAND_HINT, FRV_OPERAND_HINT_TAKEN, FRV_OPERAND_HINT_NOT_TAKEN, FRV_OPERAND_LI
- , FRV_OPERAND_LOCK, FRV_OPERAND_DEBUG, FRV_OPERAND_A, FRV_OPERAND_AE
- , FRV_OPERAND_LABEL16, FRV_OPERAND_LABEL24, FRV_OPERAND_FRINTIEVEN, FRV_OPERAND_FRINTJEVEN
- , FRV_OPERAND_FRINTKEVEN, FRV_OPERAND_D12, FRV_OPERAND_S12, FRV_OPERAND_U12
- , FRV_OPERAND_SPR, FRV_OPERAND_ULO16, FRV_OPERAND_SLO16, FRV_OPERAND_UHI16
- , FRV_OPERAND_PSR_ESR, FRV_OPERAND_PSR_S, FRV_OPERAND_PSR_PS, FRV_OPERAND_PSR_ET
- , FRV_OPERAND_BPSR_BS, FRV_OPERAND_BPSR_BET, FRV_OPERAND_TBR_TBA, FRV_OPERAND_TBR_TT
- , FRV_OPERAND_MAX
+ , FRV_OPERAND_LOCK, FRV_OPERAND_DEBUG, FRV_OPERAND_AE, FRV_OPERAND_LABEL16
+ , FRV_OPERAND_LABEL24, FRV_OPERAND_A0, FRV_OPERAND_A1, FRV_OPERAND_FRINTIEVEN
+ , FRV_OPERAND_FRINTJEVEN, FRV_OPERAND_FRINTKEVEN, FRV_OPERAND_D12, FRV_OPERAND_S12
+ , FRV_OPERAND_U12, FRV_OPERAND_SPR, FRV_OPERAND_ULO16, FRV_OPERAND_SLO16
+ , FRV_OPERAND_UHI16, FRV_OPERAND_PSR_ESR, FRV_OPERAND_PSR_S, FRV_OPERAND_PSR_PS
+ , FRV_OPERAND_PSR_ET, FRV_OPERAND_BPSR_BS, FRV_OPERAND_BPSR_BET, FRV_OPERAND_TBR_TBA
+ , FRV_OPERAND_TBR_TT, FRV_OPERAND_MAX
} CGEN_OPERAND_TYPE;
/* Number of operands types. */
-#define MAX_OPERANDS 80
+#define MAX_OPERANDS 81
/* Maximum number of operands referenced by any insn. */
#define MAX_OPERAND_INSTANCES 8
diff --git a/opcodes/frv-dis.c b/opcodes/frv-dis.c
index dfe053d5c15..b0f51bce0ab 100644
--- a/opcodes/frv-dis.c
+++ b/opcodes/frv-dis.c
@@ -41,21 +41,20 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define UNKNOWN_INSN_MSG _("*unknown*")
static void print_normal
- PARAMS ((CGEN_CPU_DESC, PTR, long, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
static void print_address
- PARAMS ((CGEN_CPU_DESC, PTR, bfd_vma, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int);
static void print_keyword
- PARAMS ((CGEN_CPU_DESC, PTR, CGEN_KEYWORD *, long, unsigned int));
+ (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int);
static void print_insn_normal
- PARAMS ((CGEN_CPU_DESC, PTR, const CGEN_INSN *, CGEN_FIELDS *,
- bfd_vma, int));
+ (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
static int print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned);
static int default_print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *);
static int read_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int,
- CGEN_EXTRACT_INFO *, unsigned long *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int, CGEN_EXTRACT_INFO *,
+ unsigned long *);
/* -- disassembler routines inserted here */
@@ -152,8 +151,11 @@ frv_cgen_print_operand (cd, opindex, xinfo, fields, attrs, pc, length)
switch (opindex)
{
- case FRV_OPERAND_A :
- print_normal (cd, info, fields->f_A, 0|(1<<CGEN_OPERAND_HASH_PREFIX), pc, length);
+ case FRV_OPERAND_A0 :
+ print_normal (cd, info, fields->f_A, 0, pc, length);
+ break;
+ case FRV_OPERAND_A1 :
+ print_normal (cd, info, fields->f_A, 0, pc, length);
break;
case FRV_OPERAND_ACC40SI :
print_keyword (cd, info, & frv_cgen_opval_acc_names, fields->f_ACC40Si, 0);
@@ -394,13 +396,12 @@ frv_cgen_init_dis (cd)
/* Default print handler. */
static void
-print_normal (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- long value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ long value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -420,13 +421,12 @@ print_normal (cd, dis_info, value, attrs, pc, length)
/* Default address handler. */
static void
-print_address (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- bfd_vma value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ bfd_vma value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -450,12 +450,11 @@ print_address (cd, dis_info, value, attrs, pc, length)
/* Keyword print handler. */
static void
-print_keyword (cd, dis_info, keyword_table, value, attrs)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- CGEN_KEYWORD *keyword_table;
- long value;
- unsigned int attrs ATTRIBUTE_UNUSED;
+print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ CGEN_KEYWORD *keyword_table,
+ long value,
+ unsigned int attrs ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
const CGEN_KEYWORD_ENTRY *ke;
@@ -469,17 +468,16 @@ print_keyword (cd, dis_info, keyword_table, value, attrs)
/* Default insn printer.
- DIS_INFO is defined as `PTR' so the disassembler needn't know anything
+ DIS_INFO is defined as `void *' so the disassembler needn't know anything
about disassemble_info. */
static void
-print_insn_normal (cd, dis_info, insn, fields, pc, length)
- CGEN_CPU_DESC cd;
- PTR dis_info;
- const CGEN_INSN *insn;
- CGEN_FIELDS *fields;
- bfd_vma pc;
- int length;
+print_insn_normal (CGEN_CPU_DESC cd,
+ void *dis_info,
+ const CGEN_INSN *insn,
+ CGEN_FIELDS *fields,
+ bfd_vma pc,
+ int length)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
disassemble_info *info = (disassemble_info *) dis_info;
@@ -511,14 +509,13 @@ print_insn_normal (cd, dis_info, insn, fields, pc, length)
Returns 0 if all is well, non-zero otherwise. */
static int
-read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- int buflen;
- CGEN_EXTRACT_INFO *ex_info;
- unsigned long *insn_value;
+read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ int buflen,
+ CGEN_EXTRACT_INFO *ex_info,
+ unsigned long *insn_value)
{
int status = (*info->read_memory_func) (pc, buf, buflen, info);
if (status != 0)
@@ -542,12 +539,11 @@ read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
been called). */
static int
-print_insn (cd, pc, info, buf, buflen)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- unsigned int buflen;
+print_insn (CGEN_CPU_DESC cd,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ unsigned int buflen)
{
CGEN_INSN_INT insn_value;
const CGEN_INSN_LIST *insn_list;
@@ -652,10 +648,7 @@ print_insn (cd, pc, info, buf, buflen)
#endif
static int
-default_print_insn (cd, pc, info)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
+default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
{
char buf[CGEN_MAX_INSN_SIZE];
int buflen;
@@ -694,9 +687,7 @@ typedef struct cpu_desc_list {
} cpu_desc_list;
int
-print_insn_frv (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_frv (bfd_vma pc, disassemble_info *info)
{
static cpu_desc_list *cd_list = 0;
cpu_desc_list *cl = 0;
diff --git a/opcodes/frv-ibld.c b/opcodes/frv-ibld.c
index bac1837e1be..565f4f49a0e 100644
--- a/opcodes/frv-ibld.c
+++ b/opcodes/frv-ibld.c
@@ -44,30 +44,29 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define FLD(f) (fields->f)
static const char * insert_normal
- PARAMS ((CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR));
+ (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
static const char * insert_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *,
- CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *,
+ CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
static int extract_normal
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
- unsigned int, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, bfd_vma, long *));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
+ unsigned int, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, bfd_vma, long *);
static int extract_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
- CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
+ CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
#if CGEN_INT_INSN_P
static void put_insn_int_value
- PARAMS ((CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT));
+ (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
#endif
#if ! CGEN_INT_INSN_P
static CGEN_INLINE void insert_1
- PARAMS ((CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *));
+ (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
static CGEN_INLINE int fill_cache
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
static CGEN_INLINE long extract_1
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int,
- unsigned char *, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
#endif
/* Operand insertion. */
@@ -77,11 +76,12 @@ static CGEN_INLINE long extract_1
/* Subroutine of insert_normal. */
static CGEN_INLINE void
-insert_1 (cd, value, start, length, word_length, bufp)
- CGEN_CPU_DESC cd;
- unsigned long value;
- int start,length,word_length;
- unsigned char *bufp;
+insert_1 (CGEN_CPU_DESC cd,
+ unsigned long value,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp)
{
unsigned long x,mask;
int shift;
@@ -118,13 +118,15 @@ insert_1 (cd, value, start, length, word_length, bufp)
necessary. */
static const char *
-insert_normal (cd, value, attrs, word_offset, start, length, word_length,
- total_length, buffer)
- CGEN_CPU_DESC cd;
- long value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
- CGEN_INSN_BYTES_PTR buffer;
+insert_normal (CGEN_CPU_DESC cd,
+ long value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
+ CGEN_INSN_BYTES_PTR buffer)
{
static char errbuf[100];
/* Written this way to avoid undefined behaviour. */
@@ -232,12 +234,11 @@ insert_normal (cd, value, attrs, word_offset, start, length, word_length,
The result is an error message or NULL if success. */
static const char *
-insert_insn_normal (cd, insn, fields, buffer, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN * insn;
- CGEN_FIELDS * fields;
- CGEN_INSN_BYTES_PTR buffer;
- bfd_vma pc;
+insert_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN * insn,
+ CGEN_FIELDS * fields,
+ CGEN_INSN_BYTES_PTR buffer,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
unsigned long value;
@@ -288,12 +289,11 @@ insert_insn_normal (cd, insn, fields, buffer, pc)
because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
static void
-put_insn_int_value (cd, buf, length, insn_length, value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_INSN_BYTES_PTR buf;
- int length;
- int insn_length;
- CGEN_INSN_INT value;
+put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_INSN_BYTES_PTR buf,
+ int length,
+ int insn_length,
+ CGEN_INSN_INT value)
{
/* For architectures with insns smaller than the base-insn-bitsize,
length may be too big. */
@@ -320,11 +320,11 @@ put_insn_int_value (cd, buf, length, insn_length, value)
Returns 1 for success, 0 for failure. */
static CGEN_INLINE int
-fill_cache (cd, ex_info, offset, bytes, pc)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_EXTRACT_INFO *ex_info;
- int offset, bytes;
- bfd_vma pc;
+fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_EXTRACT_INFO *ex_info,
+ int offset,
+ int bytes,
+ bfd_vma pc)
{
/* It's doubtful that the middle part has already been fetched so
we don't optimize that case. kiss. */
@@ -364,12 +364,13 @@ fill_cache (cd, ex_info, offset, bytes, pc)
/* Subroutine of extract_normal. */
static CGEN_INLINE long
-extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
- CGEN_CPU_DESC cd;
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
- int start,length,word_length;
- unsigned char *bufp;
- bfd_vma pc ATTRIBUTE_UNUSED;
+extract_1 (CGEN_CPU_DESC cd,
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp,
+ bfd_vma pc ATTRIBUTE_UNUSED)
{
unsigned long x;
int shift;
@@ -408,23 +409,25 @@ extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
necessary. */
static int
-extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
- word_length, total_length, pc, valuep)
- CGEN_CPU_DESC cd;
+extract_normal (CGEN_CPU_DESC cd,
#if ! CGEN_INT_INSN_P
- CGEN_EXTRACT_INFO *ex_info;
+ CGEN_EXTRACT_INFO *ex_info,
#else
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
#endif
- CGEN_INSN_INT insn_value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
+ CGEN_INSN_INT insn_value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
#if ! CGEN_INT_INSN_P
- bfd_vma pc;
+ bfd_vma pc,
#else
- bfd_vma pc ATTRIBUTE_UNUSED;
+ bfd_vma pc ATTRIBUTE_UNUSED,
#endif
- long *valuep;
+ long *valuep)
{
long value, mask;
@@ -505,13 +508,12 @@ extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
been called). */
static int
-extract_insn_normal (cd, insn, ex_info, insn_value, fields, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- CGEN_EXTRACT_INFO *ex_info;
- CGEN_INSN_INT insn_value;
- CGEN_FIELDS *fields;
- bfd_vma pc;
+extract_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ CGEN_EXTRACT_INFO *ex_info,
+ CGEN_INSN_INT insn_value,
+ CGEN_FIELDS *fields,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
const CGEN_SYNTAX_CHAR_TYPE *syn;
@@ -569,7 +571,10 @@ frv_cgen_insert_operand (cd, opindex, fields, buffer, pc)
switch (opindex)
{
- case FRV_OPERAND_A :
+ case FRV_OPERAND_A0 :
+ errmsg = insert_normal (cd, fields->f_A, 0, 0, 17, 1, 32, total_length, buffer);
+ break;
+ case FRV_OPERAND_A1 :
errmsg = insert_normal (cd, fields->f_A, 0, 0, 17, 1, 32, total_length, buffer);
break;
case FRV_OPERAND_ACC40SI :
@@ -868,7 +873,10 @@ frv_cgen_extract_operand (cd, opindex, ex_info, insn_value, fields, pc)
switch (opindex)
{
- case FRV_OPERAND_A :
+ case FRV_OPERAND_A0 :
+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 1, 32, total_length, pc, & fields->f_A);
+ break;
+ case FRV_OPERAND_A1 :
length = extract_normal (cd, ex_info, insn_value, 0, 0, 17, 1, 32, total_length, pc, & fields->f_A);
break;
case FRV_OPERAND_ACC40SI :
@@ -1156,7 +1164,10 @@ frv_cgen_get_int_operand (cd, opindex, fields)
switch (opindex)
{
- case FRV_OPERAND_A :
+ case FRV_OPERAND_A0 :
+ value = fields->f_A;
+ break;
+ case FRV_OPERAND_A1 :
value = fields->f_A;
break;
case FRV_OPERAND_ACC40SI :
@@ -1390,7 +1401,10 @@ frv_cgen_get_vma_operand (cd, opindex, fields)
switch (opindex)
{
- case FRV_OPERAND_A :
+ case FRV_OPERAND_A0 :
+ value = fields->f_A;
+ break;
+ case FRV_OPERAND_A1 :
value = fields->f_A;
break;
case FRV_OPERAND_ACC40SI :
@@ -1633,7 +1647,10 @@ frv_cgen_set_int_operand (cd, opindex, fields, value)
{
switch (opindex)
{
- case FRV_OPERAND_A :
+ case FRV_OPERAND_A0 :
+ fields->f_A = value;
+ break;
+ case FRV_OPERAND_A1 :
fields->f_A = value;
break;
case FRV_OPERAND_ACC40SI :
@@ -1864,7 +1881,10 @@ frv_cgen_set_vma_operand (cd, opindex, fields, value)
{
switch (opindex)
{
- case FRV_OPERAND_A :
+ case FRV_OPERAND_A0 :
+ fields->f_A = value;
+ break;
+ case FRV_OPERAND_A1 :
fields->f_A = value;
break;
case FRV_OPERAND_ACC40SI :
diff --git a/opcodes/frv-opc.c b/opcodes/frv-opc.c
index de27a43f5a0..7143a0e7c01 100644
--- a/opcodes/frv-opc.c
+++ b/opcodes/frv-opc.c
@@ -141,7 +141,7 @@ frv_is_media_insn (const CGEN_INSN *insn)
/* This table represents the allowable packing for vliw insns for the fr400.
The fr400 has only 2 vliw slots. Represent this by not allowing any insns
- in slots 2 and 3.
+ in the extra slots.
Subsets of any given row are also allowed. */
static VLIW_COMBO fr400_allowed_vliw[] =
{
@@ -184,15 +184,23 @@ static CGEN_ATTR_VALUE_TYPE fr400_unit_mapping[] =
/* I0 */ UNIT_I0,
/* I1 */ UNIT_I1,
/* I01 */ UNIT_I01,
+/* IALL */ UNIT_I01, /* only I0 and I1 units */
/* FM0 */ UNIT_FM0,
/* FM1 */ UNIT_FM1,
/* FM01 */ UNIT_FM01,
+/* FMALL */ UNIT_FM01,/* Only F0,F1,M0,M1 units */
+/* FMLOW */ UNIT_FM0, /* Only F0,M0 units */
/* B0 */ UNIT_B0, /* branches only in B0 unit. */
/* B1 */ UNIT_B0,
/* B01 */ UNIT_B0,
/* C */ UNIT_C,
-/* MULT-DIV */ UNIT_I0, /* multiply and divide only in I0 unit. */
-/* LOAD */ UNIT_I0 /* load only in I0 unit. */
+/* MULT-DIV */ UNIT_I0, /* multiply and divide only in I0 unit. */
+/* LOAD */ UNIT_I0, /* load only in I0 unit. */
+/* STORE */ UNIT_I0, /* store only in I0 unit. */
+/* SCAN */ UNIT_I0, /* scan only in I0 unit. */
+/* DCPL */ UNIT_C, /* dcpl only in C unit. */
+/* MDUALACC */ UNIT_FM0, /* media dual acc insn only in FM0 unit. */
+/* MCLRACC-1*/ UNIT_FM0 /* mclracc,A==1 insn only in FM0 unit. */
};
static CGEN_ATTR_VALUE_TYPE fr500_unit_mapping[] =
@@ -202,15 +210,23 @@ static CGEN_ATTR_VALUE_TYPE fr500_unit_mapping[] =
/* I0 */ UNIT_I0,
/* I1 */ UNIT_I1,
/* I01 */ UNIT_I01,
+/* IALL */ UNIT_I01, /* only I0 and I1 units */
/* FM0 */ UNIT_FM0,
/* FM1 */ UNIT_FM1,
/* FM01 */ UNIT_FM01,
+/* FMALL */ UNIT_FM01,/* Only F0,F1,M0,M1 units */
+/* FMLOW */ UNIT_FM0, /* Only F0,M0 units */
/* B0 */ UNIT_B0,
/* B1 */ UNIT_B1,
/* B01 */ UNIT_B01,
/* C */ UNIT_C,
/* MULT-DIV */ UNIT_I01, /* multiply and divide in I0 or I1 unit. */
-/* LOAD */ UNIT_I01 /* load in I0 or I1 unit. */
+/* LOAD */ UNIT_I01, /* load in I0 or I1 unit. */
+/* STORE */ UNIT_I0, /* store only in I0 unit. */
+/* SCAN */ UNIT_I01, /* scan in I0 or I1 unit. */
+/* DCPL */ UNIT_C, /* dcpl only in C unit. */
+/* MDUALACC */ UNIT_FM0, /* media dual acc insn only in FM0 unit. */
+/* MCLRACC-1*/ UNIT_FM01 /* mclracc,A==1 in FM0 or FM1 unit. */
};
void
@@ -493,10 +509,15 @@ frv_vliw_add_insn (FRV_VLIW *vliw, const CGEN_INSN *insn)
if (unit == UNIT_NIL)
abort (); /* no UNIT specified for this insn in frv.cpu */
- if (vliw->mach == bfd_mach_fr400)
- major = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR400_MAJOR);
- else
- major = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR500_MAJOR);
+ switch (vliw->mach)
+ {
+ case bfd_mach_fr400:
+ major = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR400_MAJOR);
+ break;
+ default:
+ major = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR500_MAJOR);
+ break;
+ }
if (index <= 0)
{
@@ -1133,8 +1154,12 @@ static const CGEN_IFMT ifmt_cmbtohe = {
32, 32, 0x1fff0c0, { { F (F_PACK) }, { F (F_FRK) }, { F (F_OP) }, { F (F_FRI_NULL) }, { F (F_CCI) }, { F (F_COND) }, { F (F_OPE4) }, { F (F_FRJ) }, { 0 } }
};
-static const CGEN_IFMT ifmt_mclracc = {
- 32, 32, 0x1fdffff, { { F (F_PACK) }, { F (F_ACC40SK) }, { F (F_OP) }, { F (F_A) }, { F (F_MISC_NULL_10) }, { F (F_OPE1) }, { F (F_FRJ_NULL) }, { 0 } }
+static const CGEN_IFMT ifmt_mnop = {
+ 32, 32, 0x7fffffff, { { F (F_PACK) }, { F (F_ACC40SK) }, { F (F_OP) }, { F (F_A) }, { F (F_MISC_NULL_10) }, { F (F_OPE1) }, { F (F_FRJ_NULL) }, { 0 } }
+};
+
+static const CGEN_IFMT ifmt_mclracc_0 = {
+ 32, 32, 0x1ffffff, { { F (F_PACK) }, { F (F_ACC40SK) }, { F (F_OP) }, { F (F_A) }, { F (F_MISC_NULL_10) }, { F (F_OPE1) }, { F (F_FRJ_NULL) }, { 0 } }
};
static const CGEN_IFMT ifmt_mrdacc = {
@@ -5560,11 +5585,23 @@ static const CGEN_OPCODE frv_cgen_insn_opcode_table[MAX_INSNS] =
{ { MNEM, OP (PACK), ' ', OP (FRINTJ), ',', OP (FRINTK), ',', OP (CCI), ',', OP (COND), 0 } },
& ifmt_cmbtohe, { 0x1dc0080 }
},
-/* mclracc$pack $ACC40Sk,$A */
+/* mnop$pack */
+ {
+ { 0, 0, 0, 0 },
+ { { MNEM, OP (PACK), 0 } },
+ & ifmt_mnop, { 0x7fee0ec0 }
+ },
+/* mclracc$pack $ACC40Sk,$A0 */
{
{ 0, 0, 0, 0 },
- { { MNEM, OP (PACK), ' ', OP (ACC40SK), ',', OP (A), 0 } },
- & ifmt_mclracc, { 0x1ec0ec0 }
+ { { MNEM, OP (PACK), ' ', OP (ACC40SK), ',', OP (A0), 0 } },
+ & ifmt_mclracc_0, { 0x1ec0ec0 }
+ },
+/* mclracc$pack $ACC40Sk,$A1 */
+ {
+ { 0, 0, 0, 0 },
+ { { MNEM, OP (PACK), ' ', OP (ACC40SK), ',', OP (A1), 0 } },
+ & ifmt_mclracc_0, { 0x1ee0ec0 }
},
/* mrdacc$pack $ACC40Si,$FRintk */
{
@@ -5626,10 +5663,6 @@ static const CGEN_IFMT ifmt_nop = {
32, 32, 0x7fffffff, { { F (F_PACK) }, { F (F_GRK) }, { F (F_OP) }, { F (F_GRI) }, { F (F_D12) }, { 0 } }
};
-static const CGEN_IFMT ifmt_mnop = {
- 32, 32, 0x7fffffff, { { F (F_PACK) }, { F (F_ACC40SK) }, { F (F_OP) }, { F (F_A) }, { F (F_MISC_NULL_10) }, { F (F_OPE1) }, { F (F_FRJ_NULL) }, { 0 } }
-};
-
static const CGEN_IFMT ifmt_ret = {
32, 32, 0x7fffffff, { { F (F_PACK) }, { F (F_INT_CC) }, { F (F_ICCI_2_NULL) }, { F (F_OP) }, { F (F_HINT) }, { F (F_OPE3) }, { F (F_CCOND_NULL) }, { F (F_S12_NULL) }, { 0 } }
};
@@ -5678,12 +5711,7 @@ static const CGEN_IBASE frv_cgen_macro_insn_table[] =
/* nop$pack */
{
-1, "nop", "nop", 32,
- { 0|A(ALIAS), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
- },
-/* mnop$pack */
- {
- -1, "mnop", "mnop", 32,
- { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), UNIT_FM01, FR400_MAJOR_NONE, FR500_MAJOR_M_3 } }
+ { 0|A(ALIAS), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* ret$pack */
{
@@ -5693,27 +5721,27 @@ static const CGEN_IBASE frv_cgen_macro_insn_table[] =
/* cmp$pack $GRi,$GRj,$ICCi_1 */
{
-1, "cmp", "cmp", 32,
- { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* cmpi$pack $GRi,$s10,$ICCi_1 */
{
-1, "cmpi", "cmpi", 32,
- { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* ccmp$pack $GRi,$GRj,$CCi,$cond */
{
-1, "ccmp", "ccmp", 32,
- { 0|A(CONDITIONAL)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* mov$pack $GRi,$GRk */
{
-1, "mov", "mov", 32,
- { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
/* cmov$pack $GRi,$GRk,$CCi,$cond */
{
-1, "cmov", "cmov", 32,
- { 0|A(CONDITIONAL)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), UNIT_I01, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
+ { 0|A(CONDITIONAL)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), UNIT_IALL, FR400_MAJOR_I_1, FR500_MAJOR_I_1 } }
},
};
@@ -5727,12 +5755,6 @@ static const CGEN_OPCODE frv_cgen_macro_insn_opcode_table[] =
{ { MNEM, OP (PACK), 0 } },
& ifmt_nop, { 0x880000 }
},
-/* mnop$pack */
- {
- { 0, 0, 0, 0 },
- { { MNEM, OP (PACK), 0 } },
- & ifmt_mnop, { 0x7fee0ec0 }
- },
/* ret$pack */
{
{ 0, 0, 0, 0 },
diff --git a/opcodes/frv-opc.h b/opcodes/frv-opc.h
index 5d23cf91043..eb0b9022b59 100644
--- a/opcodes/frv-opc.h
+++ b/opcodes/frv-opc.h
@@ -244,9 +244,10 @@ typedef enum cgen_insn_type {
, FRV_INSN_MQCPXIU, FRV_INSN_MEXPDHW, FRV_INSN_CMEXPDHW, FRV_INSN_MEXPDHD
, FRV_INSN_CMEXPDHD, FRV_INSN_MPACKH, FRV_INSN_MDPACKH, FRV_INSN_MUNPACKH
, FRV_INSN_MDUNPACKH, FRV_INSN_MBTOH, FRV_INSN_CMBTOH, FRV_INSN_MHTOB
- , FRV_INSN_CMHTOB, FRV_INSN_MBTOHE, FRV_INSN_CMBTOHE, FRV_INSN_MCLRACC
- , FRV_INSN_MRDACC, FRV_INSN_MRDACCG, FRV_INSN_MWTACC, FRV_INSN_MWTACCG
- , FRV_INSN_MCOP1, FRV_INSN_MCOP2, FRV_INSN_FNOP
+ , FRV_INSN_CMHTOB, FRV_INSN_MBTOHE, FRV_INSN_CMBTOHE, FRV_INSN_MNOP
+ , FRV_INSN_MCLRACC_0, FRV_INSN_MCLRACC_1, FRV_INSN_MRDACC, FRV_INSN_MRDACCG
+ , FRV_INSN_MWTACC, FRV_INSN_MWTACCG, FRV_INSN_MCOP1, FRV_INSN_MCOP2
+ , FRV_INSN_FNOP
} CGEN_INSN_TYPE;
/* Index of `invalid' insn place holder. */
diff --git a/opcodes/i370-dis.c b/opcodes/i370-dis.c
index 51c0ff1dd3e..0f04f27f6bb 100644
--- a/opcodes/i370-dis.c
+++ b/opcodes/i370-dis.c
@@ -1,6 +1,5 @@
-
/* i370-dis.c -- Disassemble Instruction 370 (ESA/390) instructions
- Copyright 1994, 2000 Free Software Foundation, Inc.
+ Copyright 1994, 2000, 2003 Free Software Foundation, Inc.
PowerPC version written by Ian Lance Taylor, Cygnus Support
Rewritten for i370 ESA/390 support by Linas Vepstas <linas@linas.org>
@@ -30,9 +29,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
*/
int
-print_insn_i370 (memaddr, info)
- bfd_vma memaddr;
- struct disassemble_info *info;
+print_insn_i370 (bfd_vma memaddr, struct disassemble_info *info)
{
bfd_byte buffer[8];
int status;
diff --git a/opcodes/i370-opc.c b/opcodes/i370-opc.c
index 376dd0eaac9..4ce7994eea8 100644
--- a/opcodes/i370-opc.c
+++ b/opcodes/i370-opc.c
@@ -1,5 +1,5 @@
/* i370-opc.c -- Instruction 370 (ESA/390) architecture opcode list
- Copyright 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1994, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
PowerPC version written by Ian Lance Taylor, Cygnus Support
Rewritten for i370 ESA/390 support by Linas Vepstas <linas@linas.org> 1998, 1999
@@ -36,12 +36,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
file. */
/* Local insertion and extraction functions. */
-static i370_insn_t insert_ss_b2 PARAMS (( i370_insn_t, long, const char **));
-static i370_insn_t insert_ss_d2 PARAMS (( i370_insn_t, long, const char **));
-static i370_insn_t insert_rxf_r3 PARAMS (( i370_insn_t, long, const char **));
-static long extract_ss_b2 PARAMS (( i370_insn_t, int *));
-static long extract_ss_d2 PARAMS (( i370_insn_t, int *));
-static long extract_rxf_r3 PARAMS (( i370_insn_t, int *));
+static i370_insn_t insert_ss_b2 (i370_insn_t, long, const char **);
+static i370_insn_t insert_ss_d2 (i370_insn_t, long, const char **);
+static i370_insn_t insert_rxf_r3 (i370_insn_t, long, const char **);
+static long extract_ss_b2 (i370_insn_t, int *);
+static long extract_ss_d2 (i370_insn_t, int *);
+static long extract_rxf_r3 (i370_insn_t, int *);
/* The operands table.
@@ -231,55 +231,43 @@ const struct i370_operand i370_operands[] =
/*ARGSUSED*/
static i370_insn_t
-insert_ss_b2 (insn, value, errmsg)
- i370_insn_t insn;
- long value;
- const char **errmsg ATTRIBUTE_UNUSED;
+insert_ss_b2 (i370_insn_t insn, long value,
+ const char **errmsg ATTRIBUTE_UNUSED)
{
insn.i[1] |= (value & 0xf) << 28;
return insn;
}
static i370_insn_t
-insert_ss_d2 (insn, value, errmsg)
- i370_insn_t insn;
- long value;
- const char **errmsg ATTRIBUTE_UNUSED;
+insert_ss_d2 (i370_insn_t insn, long value,
+ const char **errmsg ATTRIBUTE_UNUSED)
{
insn.i[1] |= (value & 0xfff) << 16;
return insn;
}
static i370_insn_t
-insert_rxf_r3 (insn, value, errmsg)
- i370_insn_t insn;
- long value;
- const char **errmsg ATTRIBUTE_UNUSED;
+insert_rxf_r3 (i370_insn_t insn, long value,
+ const char **errmsg ATTRIBUTE_UNUSED)
{
insn.i[1] |= (value & 0xf) << 28;
return insn;
}
static long
-extract_ss_b2 (insn, invalid)
- i370_insn_t insn;
- int *invalid ATTRIBUTE_UNUSED;
+extract_ss_b2 (i370_insn_t insn, int *invalid ATTRIBUTE_UNUSED)
{
return (insn.i[1] >>28) & 0xf;
}
static long
-extract_ss_d2 (insn, invalid)
- i370_insn_t insn;
- int *invalid ATTRIBUTE_UNUSED;
+extract_ss_d2 (i370_insn_t insn, int *invalid ATTRIBUTE_UNUSED)
{
return (insn.i[1] >>16) & 0xfff;
}
static long
-extract_rxf_r3 (insn, invalid)
- i370_insn_t insn;
- int *invalid ATTRIBUTE_UNUSED;
+extract_rxf_r3 (i370_insn_t insn, int *invalid ATTRIBUTE_UNUSED)
{
return (insn.i[1] >>28) & 0xf;
}
@@ -831,45 +819,45 @@ const struct i370_opcode i370_opcodes[] = {
{ "xi", 4, {{SI(0x97,0,0,0), 0}}, {{SI_MASK, 0}}, I370, {SI_D1, SI_B1, SI_I2} },
/* S form instructions */
-{ "cfc", 4, {{S(0xb21a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "csch", 4, {{S(0xb230,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "hsch", 4, {{S(0xb231,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "ipk", 4, {{S(0xb20b,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "lfpc", 4, {{S(0xb29d,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
-{ "lpsw", 4, {{S(0x8200,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "msch", 4, {{S(0xb232,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "pc", 4, {{S(0xb218,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "pcf", 4, {{S(0xb218,0,0), 0}}, {{S_MASK, 0}}, IPC, {S_D2, S_B2} },
-{ "ptlb", 4, {{S(0xb20d,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "rchp", 4, {{S(0xb23b,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "rp", 4, {{S(0xb277,0,0), 0}}, {{S_MASK, 0}}, IRP, {0} },
-{ "rsch", 4, {{S(0xb238,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "sac", 4, {{S(0xb219,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "sacf", 4, {{S(0xb279,0,0), 0}}, {{S_MASK, 0}}, ISA, {S_D2, S_B2} },
-{ "sal", 4, {{S(0xb237,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "schm", 4, {{S(0xb23c,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
-{ "sck", 4, {{S(0xb204,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "sckc", 4, {{S(0xb206,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "spka", 4, {{S(0xb20a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "spt", 4, {{S(0xb208,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "spx", 4, {{S(0xb210,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "srnm", 4, {{S(0xb299,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
-{ "ssch", 4, {{S(0xb233,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "ssm", 4, {{S(0x8000,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "stap", 4, {{S(0xb212,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stck", 4, {{S(0xb205,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stckc", 4, {{S(0xb207,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "stcps", 4, {{S(0xb23a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stcrw", 4, {{S(0xb239,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stfpc", 4, {{S(0xb29c,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
-{ "stidp", 4, {{S(0xb202,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "stpt", 4, {{S(0xb209,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stpx", 4, {{S(0xb211,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "stsch", 4, {{S(0xb234,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "tpi", 4, {{S(0xb236,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
-{ "trap4", 4, {{S(0xb2ff,0,0), 0}}, {{S_MASK, 0}}, ITR, {S_D2, S_B2} },
-{ "ts", 4, {{S(0x9300,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
-{ "tsch", 4, {{S(0xb235,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "cfc", 4, {{S(0xb21a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "csch", 4, {{S(0xb230,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "hsch", 4, {{S(0xb231,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "ipk", 4, {{S(0xb20b,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "lfpc", 4, {{S(0xb29d,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
+{ "lpsw", 4, {{S(0x8200,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "msch", 4, {{S(0xb232,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "pc", 4, {{S(0xb218,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "pcf", 4, {{S(0xb218,0,0), 0}}, {{S_MASK, 0}}, IPC, {S_D2, S_B2} },
+{ "ptlb", 4, {{S(0xb20d,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "rchp", 4, {{S(0xb23b,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "rp", 4, {{S(0xb277,0,0), 0}}, {{S_MASK, 0}}, IRP, {0} },
+{ "rsch", 4, {{S(0xb238,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "sac", 4, {{S(0xb219,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "sacf", 4, {{S(0xb279,0,0), 0}}, {{S_MASK, 0}}, ISA, {S_D2, S_B2} },
+{ "sal", 4, {{S(0xb237,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "schm", 4, {{S(0xb23c,0,0), 0}}, {{S_MASK, 0}}, IXA, {0} },
+{ "sck", 4, {{S(0xb204,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "sckc", 4, {{S(0xb206,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "spka", 4, {{S(0xb20a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "spt", 4, {{S(0xb208,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "spx", 4, {{S(0xb210,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "srnm", 4, {{S(0xb299,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
+{ "ssch", 4, {{S(0xb233,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "ssm", 4, {{S(0x8000,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "stap", 4, {{S(0xb212,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stck", 4, {{S(0xb205,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stckc", 4, {{S(0xb207,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "stcps", 4, {{S(0xb23a,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stcrw", 4, {{S(0xb239,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stfpc", 4, {{S(0xb29c,0,0), 0}}, {{S_MASK, 0}}, IBF, {S_D2, S_B2} },
+{ "stidp", 4, {{S(0xb202,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "stpt", 4, {{S(0xb209,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stpx", 4, {{S(0xb211,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "stsch", 4, {{S(0xb234,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "tpi", 4, {{S(0xb236,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
+{ "trap4", 4, {{S(0xb2ff,0,0), 0}}, {{S_MASK, 0}}, ITR, {S_D2, S_B2} },
+{ "ts", 4, {{S(0x9300,0,0), 0}}, {{S_MASK, 0}}, I370, {S_D2, S_B2} },
+{ "tsch", 4, {{S(0xb235,0,0), 0}}, {{S_MASK, 0}}, IXA, {S_D2, S_B2} },
/* SS form instructions */
{ "ap", 6, {{SSH(0xfa,0,0,0), 0}}, {{SS_MASK, 0}}, I370, {SS_D1,SS_L,SS_B1,SS_D2,SS_B2} },
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 7c03205a191..0ef57efb93c 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -48,53 +48,53 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define UNIXWARE_COMPAT 1
#endif
-static int fetch_data PARAMS ((struct disassemble_info *, bfd_byte *));
-static void ckprefix PARAMS ((void));
-static const char *prefix_name PARAMS ((int, int));
-static int print_insn PARAMS ((bfd_vma, disassemble_info *));
-static void dofloat PARAMS ((int));
-static void OP_ST PARAMS ((int, int));
-static void OP_STi PARAMS ((int, int));
-static int putop PARAMS ((const char *, int));
-static void oappend PARAMS ((const char *));
-static void append_seg PARAMS ((void));
-static void OP_indirE PARAMS ((int, int));
-static void print_operand_value PARAMS ((char *, int, bfd_vma));
-static void OP_E PARAMS ((int, int));
-static void OP_G PARAMS ((int, int));
-static bfd_vma get64 PARAMS ((void));
-static bfd_signed_vma get32 PARAMS ((void));
-static bfd_signed_vma get32s PARAMS ((void));
-static int get16 PARAMS ((void));
-static void set_op PARAMS ((bfd_vma, int));
-static void OP_REG PARAMS ((int, int));
-static void OP_IMREG PARAMS ((int, int));
-static void OP_I PARAMS ((int, int));
-static void OP_I64 PARAMS ((int, int));
-static void OP_sI PARAMS ((int, int));
-static void OP_J PARAMS ((int, int));
-static void OP_SEG PARAMS ((int, int));
-static void OP_DIR PARAMS ((int, int));
-static void OP_OFF PARAMS ((int, int));
-static void OP_OFF64 PARAMS ((int, int));
-static void ptr_reg PARAMS ((int, int));
-static void OP_ESreg PARAMS ((int, int));
-static void OP_DSreg PARAMS ((int, int));
-static void OP_C PARAMS ((int, int));
-static void OP_D PARAMS ((int, int));
-static void OP_T PARAMS ((int, int));
-static void OP_Rd PARAMS ((int, int));
-static void OP_MMX PARAMS ((int, int));
-static void OP_XMM PARAMS ((int, int));
-static void OP_EM PARAMS ((int, int));
-static void OP_EX PARAMS ((int, int));
-static void OP_MS PARAMS ((int, int));
-static void OP_XS PARAMS ((int, int));
-static void OP_3DNowSuffix PARAMS ((int, int));
-static void OP_SIMD_Suffix PARAMS ((int, int));
-static void SIMD_Fixup PARAMS ((int, int));
-static void PNI_Fixup PARAMS ((int, int));
-static void BadOp PARAMS ((void));
+static int fetch_data (struct disassemble_info *, bfd_byte *);
+static void ckprefix (void);
+static const char *prefix_name (int, int);
+static int print_insn (bfd_vma, disassemble_info *);
+static void dofloat (int);
+static void OP_ST (int, int);
+static void OP_STi (int, int);
+static int putop (const char *, int);
+static void oappend (const char *);
+static void append_seg (void);
+static void OP_indirE (int, int);
+static void print_operand_value (char *, int, bfd_vma);
+static void OP_E (int, int);
+static void OP_G (int, int);
+static bfd_vma get64 (void);
+static bfd_signed_vma get32 (void);
+static bfd_signed_vma get32s (void);
+static int get16 (void);
+static void set_op (bfd_vma, int);
+static void OP_REG (int, int);
+static void OP_IMREG (int, int);
+static void OP_I (int, int);
+static void OP_I64 (int, int);
+static void OP_sI (int, int);
+static void OP_J (int, int);
+static void OP_SEG (int, int);
+static void OP_DIR (int, int);
+static void OP_OFF (int, int);
+static void OP_OFF64 (int, int);
+static void ptr_reg (int, int);
+static void OP_ESreg (int, int);
+static void OP_DSreg (int, int);
+static void OP_C (int, int);
+static void OP_D (int, int);
+static void OP_T (int, int);
+static void OP_Rd (int, int);
+static void OP_MMX (int, int);
+static void OP_XMM (int, int);
+static void OP_EM (int, int);
+static void OP_EX (int, int);
+static void OP_MS (int, int);
+static void OP_XS (int, int);
+static void OP_3DNowSuffix (int, int);
+static void OP_SIMD_Suffix (int, int);
+static void SIMD_Fixup (int, int);
+static void PNI_Fixup (int, int);
+static void BadOp (void);
struct dis_private {
/* Points to first byte not fetched. */
@@ -161,9 +161,7 @@ static int used_prefixes;
? 1 : fetch_data ((info), (addr)))
static int
-fetch_data (info, addr)
- struct disassemble_info *info;
- bfd_byte *addr;
+fetch_data (struct disassemble_info *info, bfd_byte *addr)
{
int status;
struct dis_private *priv = (struct dis_private *) info->private_data;
@@ -427,7 +425,7 @@ fetch_data (info, addr)
#define X86_64_0 NULL, NULL, X86_64_SPECIAL, NULL, 0, NULL, 0
-typedef void (*op_rtn) PARAMS ((int bytemode, int sizeflag));
+typedef void (*op_rtn) (int bytemode, int sizeflag);
struct dis386 {
const char *name;
@@ -1699,7 +1697,7 @@ static const struct dis386 x86_64_table[][2] = {
#define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
static void
-ckprefix ()
+ckprefix (void)
{
int newrex;
rex = 0;
@@ -1797,9 +1795,7 @@ ckprefix ()
prefix byte. */
static const char *
-prefix_name (pref, sizeflag)
- int pref;
- int sizeflag;
+prefix_name (int pref, int sizeflag)
{
switch (pref)
{
@@ -1893,9 +1889,7 @@ static char scale_char;
print_insn_i386_att and print_insn_i386_intel these functions can
disappear, and print_insn_i386 be merged into print_insn. */
int
-print_insn_i386_att (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_i386_att (bfd_vma pc, disassemble_info *info)
{
intel_syntax = 0;
@@ -1903,9 +1897,7 @@ print_insn_i386_att (pc, info)
}
int
-print_insn_i386_intel (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
{
intel_syntax = 1;
@@ -1913,9 +1905,7 @@ print_insn_i386_intel (pc, info)
}
int
-print_insn_i386 (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_i386 (bfd_vma pc, disassemble_info *info)
{
intel_syntax = -1;
@@ -1923,9 +1913,7 @@ print_insn_i386 (pc, info)
}
static int
-print_insn (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn (bfd_vma pc, disassemble_info *info)
{
const struct dis386 *dp;
int i;
@@ -2034,7 +2022,7 @@ print_insn (pc, info)
puts most long word instructions on a single line. */
info->bytes_per_line = 7;
- info->private_data = (PTR) &priv;
+ info->private_data = &priv;
priv.max_fetched = priv.the_buffer;
priv.insn_start = pc;
@@ -2555,8 +2543,7 @@ static char *fgrps[][8] = {
};
static void
-dofloat (sizeflag)
- int sizeflag;
+dofloat (int sizeflag)
{
const struct dis386 *dp;
unsigned char floatop;
@@ -2602,17 +2589,13 @@ dofloat (sizeflag)
}
static void
-OP_ST (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
oappend ("%st");
}
static void
-OP_STi (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
sprintf (scratchbuf, "%%st(%d)", rm);
oappend (scratchbuf + intel_syntax);
@@ -2620,9 +2603,7 @@ OP_STi (bytemode, sizeflag)
/* Capital letters in template are macros. */
static int
-putop (template, sizeflag)
- const char *template;
- int sizeflag;
+putop (const char *template, int sizeflag)
{
const char *p;
int alt;
@@ -2895,15 +2876,14 @@ putop (template, sizeflag)
}
static void
-oappend (s)
- const char *s;
+oappend (const char *s)
{
strcpy (obufp, s);
obufp += strlen (s);
}
static void
-append_seg ()
+append_seg (void)
{
if (prefixes & PREFIX_CS)
{
@@ -2938,9 +2918,7 @@ append_seg ()
}
static void
-OP_indirE (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_indirE (int bytemode, int sizeflag)
{
if (!intel_syntax)
oappend ("*");
@@ -2948,10 +2926,7 @@ OP_indirE (bytemode, sizeflag)
}
static void
-print_operand_value (buf, hex, disp)
- char *buf;
- int hex;
- bfd_vma disp;
+print_operand_value (char *buf, int hex, bfd_vma disp)
{
if (mode_64bit)
{
@@ -3008,9 +2983,7 @@ print_operand_value (buf, hex, disp)
}
static void
-OP_E (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_E (int bytemode, int sizeflag)
{
bfd_vma disp;
int add = 0;
@@ -3293,9 +3266,7 @@ OP_E (bytemode, sizeflag)
}
static void
-OP_G (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_G (int bytemode, int sizeflag)
{
int add = 0;
USED_REX (REX_EXTX);
@@ -3336,7 +3307,7 @@ OP_G (bytemode, sizeflag)
}
static bfd_vma
-get64 ()
+get64 (void)
{
bfd_vma x;
#ifdef BFD64
@@ -3361,7 +3332,7 @@ get64 ()
}
static bfd_signed_vma
-get32 ()
+get32 (void)
{
bfd_signed_vma x = 0;
@@ -3374,7 +3345,7 @@ get32 ()
}
static bfd_signed_vma
-get32s ()
+get32s (void)
{
bfd_signed_vma x = 0;
@@ -3390,7 +3361,7 @@ get32s ()
}
static int
-get16 ()
+get16 (void)
{
int x = 0;
@@ -3401,9 +3372,7 @@ get16 ()
}
static void
-set_op (op, riprel)
- bfd_vma op;
- int riprel;
+set_op (bfd_vma op, int riprel)
{
op_index[op_ad] = op_ad;
if (mode_64bit)
@@ -3420,9 +3389,7 @@ set_op (op, riprel)
}
static void
-OP_REG (code, sizeflag)
- int code;
- int sizeflag;
+OP_REG (int code, int sizeflag)
{
const char *s;
int add = 0;
@@ -3482,9 +3449,7 @@ OP_REG (code, sizeflag)
}
static void
-OP_IMREG (code, sizeflag)
- int code;
- int sizeflag;
+OP_IMREG (int code, int sizeflag)
{
const char *s;
@@ -3531,9 +3496,7 @@ OP_IMREG (code, sizeflag)
}
static void
-OP_I (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_I (int bytemode, int sizeflag)
{
bfd_signed_vma op;
bfd_signed_vma mask = -1;
@@ -3585,9 +3548,7 @@ OP_I (bytemode, sizeflag)
}
static void
-OP_I64 (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_I64 (int bytemode, int sizeflag)
{
bfd_signed_vma op;
bfd_signed_vma mask = -1;
@@ -3638,9 +3599,7 @@ OP_I64 (bytemode, sizeflag)
}
static void
-OP_sI (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_sI (int bytemode, int sizeflag)
{
bfd_signed_vma op;
bfd_signed_vma mask = -1;
@@ -3689,9 +3648,7 @@ OP_sI (bytemode, sizeflag)
}
static void
-OP_J (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_J (int bytemode, int sizeflag)
{
bfd_vma disp;
bfd_vma mask = -1;
@@ -3727,17 +3684,13 @@ OP_J (bytemode, sizeflag)
}
static void
-OP_SEG (dummy, sizeflag)
- int dummy ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_SEG (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
oappend (names_seg[reg]);
}
static void
-OP_DIR (dummy, sizeflag)
- int dummy ATTRIBUTE_UNUSED;
- int sizeflag;
+OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)
{
int seg, offset;
@@ -3760,9 +3713,7 @@ OP_DIR (dummy, sizeflag)
}
static void
-OP_OFF (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag;
+OP_OFF (int bytemode ATTRIBUTE_UNUSED, int sizeflag)
{
bfd_vma off;
@@ -3787,9 +3738,7 @@ OP_OFF (bytemode, sizeflag)
}
static void
-OP_OFF64 (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_OFF64 (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
bfd_vma off;
@@ -3817,9 +3766,7 @@ OP_OFF64 (bytemode, sizeflag)
}
static void
-ptr_reg (code, sizeflag)
- int code;
- int sizeflag;
+ptr_reg (int code, int sizeflag)
{
const char *s;
if (intel_syntax)
@@ -3847,18 +3794,14 @@ ptr_reg (code, sizeflag)
}
static void
-OP_ESreg (code, sizeflag)
- int code;
- int sizeflag;
+OP_ESreg (int code, int sizeflag)
{
oappend ("%es:" + intel_syntax);
ptr_reg (code, sizeflag);
}
static void
-OP_DSreg (code, sizeflag)
- int code;
- int sizeflag;
+OP_DSreg (int code, int sizeflag)
{
if ((prefixes
& (PREFIX_CS
@@ -3873,9 +3816,7 @@ OP_DSreg (code, sizeflag)
}
static void
-OP_C (dummy, sizeflag)
- int dummy ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
int add = 0;
USED_REX (REX_EXTX);
@@ -3886,9 +3827,7 @@ OP_C (dummy, sizeflag)
}
static void
-OP_D (dummy, sizeflag)
- int dummy ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
int add = 0;
USED_REX (REX_EXTX);
@@ -3902,18 +3841,14 @@ OP_D (dummy, sizeflag)
}
static void
-OP_T (dummy, sizeflag)
- int dummy ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
sprintf (scratchbuf, "%%tr%d", reg);
oappend (scratchbuf + intel_syntax);
}
static void
-OP_Rd (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_Rd (int bytemode, int sizeflag)
{
if (mod == 3)
OP_E (bytemode, sizeflag);
@@ -3922,9 +3857,7 @@ OP_Rd (bytemode, sizeflag)
}
static void
-OP_MMX (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
int add = 0;
USED_REX (REX_EXTX);
@@ -3939,9 +3872,7 @@ OP_MMX (bytemode, sizeflag)
}
static void
-OP_XMM (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_XMM (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
int add = 0;
USED_REX (REX_EXTX);
@@ -3952,9 +3883,7 @@ OP_XMM (bytemode, sizeflag)
}
static void
-OP_EM (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_EM (int bytemode, int sizeflag)
{
int add = 0;
if (mod != 3)
@@ -3978,9 +3907,7 @@ OP_EM (bytemode, sizeflag)
}
static void
-OP_EX (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_EX (int bytemode, int sizeflag)
{
int add = 0;
if (mod != 3)
@@ -4000,9 +3927,7 @@ OP_EX (bytemode, sizeflag)
}
static void
-OP_MS (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_MS (int bytemode, int sizeflag)
{
if (mod == 3)
OP_EM (bytemode, sizeflag);
@@ -4011,9 +3936,7 @@ OP_MS (bytemode, sizeflag)
}
static void
-OP_XS (bytemode, sizeflag)
- int bytemode;
- int sizeflag;
+OP_XS (int bytemode, int sizeflag)
{
if (mod == 3)
OP_EX (bytemode, sizeflag);
@@ -4089,9 +4012,7 @@ static const char *const Suffix3DNow[] = {
};
static void
-OP_3DNowSuffix (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
const char *mnemonic;
@@ -4127,9 +4048,7 @@ static const char *simd_cmp_op[] = {
};
static void
-OP_SIMD_Suffix (bytemode, sizeflag)
- int bytemode ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+OP_SIMD_Suffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
unsigned int cmp_type;
@@ -4169,9 +4088,7 @@ OP_SIMD_Suffix (bytemode, sizeflag)
}
static void
-SIMD_Fixup (extrachar, sizeflag)
- int extrachar;
- int sizeflag ATTRIBUTE_UNUSED;
+SIMD_Fixup (int extrachar, int sizeflag ATTRIBUTE_UNUSED)
{
/* Change movlps/movhps to movhlps/movlhps for 2 register operand
forms of these instructions. */
@@ -4187,9 +4104,7 @@ SIMD_Fixup (extrachar, sizeflag)
}
static void
-PNI_Fixup (extrachar, sizeflag)
- int extrachar ATTRIBUTE_UNUSED;
- int sizeflag ATTRIBUTE_UNUSED;
+PNI_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
{
if (mod == 3 && reg == 1)
{
diff --git a/opcodes/i960-dis.c b/opcodes/i960-dis.c
index 9210d02d800..fa6f1882781 100644
--- a/opcodes/i960-dis.c
+++ b/opcodes/i960-dis.c
@@ -1,5 +1,5 @@
/* Disassemble i80960 instructions.
- Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+ Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2003
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -31,26 +31,24 @@ static const char *const reg_names[] = {
static FILE *stream; /* Output goes here */
static struct disassemble_info *info;
-static void print_addr PARAMS ((bfd_vma));
-static void ctrl PARAMS ((bfd_vma, unsigned long, unsigned long));
-static void cobr PARAMS ((bfd_vma, unsigned long, unsigned long));
-static void reg PARAMS ((unsigned long));
-static int mem PARAMS ((bfd_vma, unsigned long, unsigned long, int));
-static void ea PARAMS ((bfd_vma, int, const char *, const char *, int, unsigned int));
-static void dstop PARAMS ((int, int, int));
-static void regop PARAMS ((int, int, int, int));
-static void invalid PARAMS ((int));
-static int pinsn PARAMS ((bfd_vma, unsigned long, unsigned long));
-static void put_abs PARAMS ((unsigned long, unsigned long));
+static void print_addr (bfd_vma);
+static void ctrl (bfd_vma, unsigned long, unsigned long);
+static void cobr (bfd_vma, unsigned long, unsigned long);
+static void reg (unsigned long);
+static int mem (bfd_vma, unsigned long, unsigned long, int);
+static void ea (bfd_vma, int, const char *, const char *, int, unsigned int);
+static void dstop (int, int, int);
+static void regop (int, int, int, int);
+static void invalid (int);
+static int pinsn (bfd_vma, unsigned long, unsigned long);
+static void put_abs (unsigned long, unsigned long);
/* Print the i960 instruction at address 'memaddr' in debugged memory,
on INFO->STREAM. Returns length of the instruction, in bytes. */
int
-print_insn_i960 (memaddr, info_arg)
- bfd_vma memaddr;
- struct disassemble_info *info_arg;
+print_insn_i960 (bfd_vma memaddr, struct disassemble_info *info_arg)
{
unsigned int word1, word2 = 0xdeadbeef;
bfd_byte buffer[8];
@@ -118,12 +116,10 @@ struct sparse_tabent {
};
static int
-pinsn (memaddr, word1, word2)
- bfd_vma memaddr;
- unsigned long word1, word2;
+pinsn (bfd_vma memaddr, unsigned long word1, unsigned long word2)
{
int instr_len;
-
+
instr_len = 4;
put_abs (word1, word2);
@@ -161,10 +157,7 @@ pinsn (memaddr, word1, word2)
/* CTRL format.. */
static void
-ctrl (memaddr, word1, word2)
- bfd_vma memaddr;
- unsigned long word1;
- unsigned long word2 ATTRIBUTE_UNUSED;
+ctrl (bfd_vma memaddr, unsigned long word1, unsigned long word2 ATTRIBUTE_UNUSED)
{
int i;
static const struct tabent ctrl_tab[] = {
@@ -233,15 +226,12 @@ ctrl (memaddr, word1, word2)
/* COBR format. */
static void
-cobr (memaddr, word1, word2)
- bfd_vma memaddr;
- unsigned long word1;
- unsigned long word2 ATTRIBUTE_UNUSED;
+cobr (bfd_vma memaddr, unsigned long word1, unsigned long word2 ATTRIBUTE_UNUSED)
{
int src1;
int src2;
int i;
-
+
static const struct tabent cobr_tab[] = {
{ "testno", 1, }, /* 0x20 */
{ "testg", 1, }, /* 0x21 */
@@ -324,18 +314,14 @@ cobr (memaddr, word1, word2)
/* Returns instruction length: 4 or 8. */
static int
-mem (memaddr, word1, word2, noprint)
- bfd_vma memaddr;
- unsigned long word1, word2;
- int noprint; /* If TRUE, return instruction length, but
- don't output any text. */
+mem (bfd_vma memaddr, unsigned long word1, unsigned long word2, int noprint)
{
int i, j;
int len;
int mode;
int offset;
const char *reg1, *reg2, *reg3;
-
+
/* This lookup table is too sparse to make it worth typing in, but not
so large as to make a sparse array necessary. We create the table
at runtime. */
@@ -395,7 +381,7 @@ mem (memaddr, word1, word2, noprint)
&& ((mode == 5) || (mode >= 12)))
/* With 32-bit displacement. */
len = 8;
- else
+ else
len = 4;
if (noprint)
@@ -426,7 +412,7 @@ mem (memaddr, word1, word2, noprint)
{ /* MEMA FORMAT */
(*info->fprintf_func) (stream, "0x%x", (unsigned) offset);
- if (mode & 8)
+ if (mode & 8)
(*info->fprintf_func) (stream, "(%s)", reg2);
(*info->fprintf_func)(stream, ",%s", reg1);
@@ -445,7 +431,7 @@ mem (memaddr, word1, word2, noprint)
/* MEMA FORMAT */
(*info->fprintf_func) (stream, "%s,0x%x", reg1, (unsigned) offset);
- if (mode & 8)
+ if (mode & 8)
(*info->fprintf_func) (stream, "(%s)", reg2);
}
break;
@@ -472,8 +458,7 @@ mem (memaddr, word1, word2, noprint)
/* REG format. */
static void
-reg (word1)
- unsigned long word1;
+reg (unsigned long word1)
{
int i, j;
int opcode;
@@ -488,14 +473,14 @@ reg (word1)
at runtime. */
/* NOTE: In this table, the meaning of 'numops' is:
- 1: single operand, which is NOT a destination.
- -1: single operand, which IS a destination.
- 2: 2 operands, the 2nd of which is NOT a destination.
- -2: 2 operands, the 2nd of which IS a destination.
- 3: 3 operands
-
- If an opcode mnemonic begins with "F", it is a floating-point
- opcode (the "F" is not printed). */
+ 1: single operand, which is NOT a destination.
+ -1: single operand, which IS a destination.
+ 2: 2 operands, the 2nd of which is NOT a destination.
+ -2: 2 operands, the 2nd of which IS a destination.
+ 3: 3 operands
+
+ If an opcode mnemonic begins with "F", it is a floating-point
+ opcode (the "F" is not printed). */
static struct tabent *reg_tab;
static const struct sparse_tabent reg_init[] =
@@ -777,13 +762,8 @@ reg (word1)
/* Print out effective address for memb instructions. */
static void
-ea (memaddr, mode, reg2, reg3, word1, word2)
- bfd_vma memaddr;
- int mode;
- const char *reg2;
- const char *reg3;
- int word1;
- unsigned int word2;
+ea (bfd_vma memaddr, int mode, const char *reg2, const char *reg3, int word1,
+ unsigned int word2)
{
int scale;
static const int scale_tab[] = { 1, 2, 4, 8, 16 };
@@ -842,8 +822,7 @@ ea (memaddr, mode, reg2, reg3, word1, word2)
/* Register Instruction Operand. */
static void
-regop (mode, spec, reg, fp)
- int mode, spec, reg, fp;
+regop (int mode, int spec, int reg, int fp)
{
if (fp)
{
@@ -897,8 +876,7 @@ regop (mode, spec, reg, fp)
/* Register Instruction Destination Operand. */
static void
-dstop (mode, reg, fp)
- int mode, reg, fp;
+dstop (int mode, int reg, int fp)
{
/* 'dst' operand can't be a literal. On non-FP instructions, register
mode is assumed and "m3" acts as if were "s3"; on FP-instructions,
@@ -910,23 +888,20 @@ dstop (mode, reg, fp)
}
static void
-invalid (word1)
- int word1;
+invalid (int word1)
{
(*info->fprintf_func) (stream, ".word\t0x%08x", (unsigned) word1);
}
static void
-print_addr (a)
- bfd_vma a;
+print_addr (bfd_vma a)
{
(*info->print_address_func) (a, info);
}
static void
-put_abs (word1, word2)
- unsigned long word1 ATTRIBUTE_UNUSED;
- unsigned long word2 ATTRIBUTE_UNUSED;
+put_abs (unsigned long word1 ATTRIBUTE_UNUSED,
+ unsigned long word2 ATTRIBUTE_UNUSED)
{
#ifdef IN_GDB
return;
diff --git a/opcodes/ia64-opc.c b/opcodes/ia64-opc.c
index 9726381dd6a..fc90213a6b5 100644
--- a/opcodes/ia64-opc.c
+++ b/opcodes/ia64-opc.c
@@ -1,5 +1,5 @@
/* ia64-opc.c -- Functions to access the compacted opcode table
- Copyright 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2003 Free Software Foundation, Inc.
Written by Bob Manson of Cygnus Solutions, <manson@cygnus.com>
This file is part of GDB, GAS, and the GNU binutils.
@@ -25,19 +25,19 @@
#include "ia64-asmtab.h"
#include "ia64-asmtab.c"
-static void get_opc_prefix PARAMS ((const char **, char *));
-static short int find_string_ent PARAMS ((const char *));
-static short int find_main_ent PARAMS ((short int));
-static short int find_completer PARAMS ((short int, short int, const char *));
-static ia64_insn apply_completer PARAMS ((ia64_insn, int));
-static int extract_op_bits PARAMS ((int, int, int));
-static int extract_op PARAMS ((int, int *, unsigned int *));
-static int opcode_verify PARAMS ((ia64_insn, int, enum ia64_insn_type));
-static int locate_opcode_ent PARAMS ((ia64_insn, enum ia64_insn_type));
+static void get_opc_prefix (const char **, char *);
+static short int find_string_ent (const char *);
+static short int find_main_ent (short int);
+static short int find_completer (short int, short int, const char *);
+static ia64_insn apply_completer (ia64_insn, int);
+static int extract_op_bits (int, int, int);
+static int extract_op (int, int *, unsigned int *);
+static int opcode_verify (ia64_insn, int, enum ia64_insn_type);
+static int locate_opcode_ent (ia64_insn, enum ia64_insn_type);
static struct ia64_opcode *make_ia64_opcode
- PARAMS ((ia64_insn, const char *, int, int));
+ (ia64_insn, const char *, int, int);
static struct ia64_opcode *ia64_find_matching_opcode
- PARAMS ((const char *, short int));
+ (const char *, short int);
const struct ia64_templ_desc ia64_templ_desc[16] =
{
@@ -65,9 +65,7 @@ const struct ia64_templ_desc ia64_templ_desc[16] =
of the opcode, or at the NUL character. */
static void
-get_opc_prefix (ptr, dest)
- const char **ptr;
- char *dest;
+get_opc_prefix (const char **ptr, char *dest)
{
char *c = strchr (*ptr, '.');
if (c != NULL)
@@ -89,8 +87,7 @@ get_opc_prefix (ptr, dest)
STR; return -1 if one does not exist. */
static short
-find_string_ent (str)
- const char *str;
+find_string_ent (const char *str)
{
short start = 0;
short end = sizeof (ia64_strings) / sizeof (const char *);
@@ -124,8 +121,7 @@ find_string_ent (str)
return -1 if one does not exist. */
static short
-find_main_ent (nameindex)
- short nameindex;
+find_main_ent (short nameindex)
{
short start = 0;
short end = sizeof (main_table) / sizeof (struct ia64_main_table);
@@ -164,10 +160,7 @@ find_main_ent (nameindex)
return -1 if one does not exist. */
static short
-find_completer (main_ent, prev_completer, name)
- short main_ent;
- short prev_completer;
- const char *name;
+find_completer (short main_ent, short prev_completer, const char *name)
{
short name_index = find_string_ent (name);
@@ -200,9 +193,7 @@ find_completer (main_ent, prev_completer, name)
return the result. */
static ia64_insn
-apply_completer (opcode, completer_index)
- ia64_insn opcode;
- int completer_index;
+apply_completer (ia64_insn opcode, int completer_index)
{
ia64_insn mask = completer_table[completer_index].mask;
ia64_insn bits = completer_table[completer_index].bits;
@@ -220,10 +211,7 @@ apply_completer (opcode, completer_index)
first byte in OP_POINTER.) */
static int
-extract_op_bits (op_pointer, bitoffset, bits)
- int op_pointer;
- int bitoffset;
- int bits;
+extract_op_bits (int op_pointer, int bitoffset, int bits)
{
int res = 0;
@@ -259,10 +247,7 @@ extract_op_bits (op_pointer, bitoffset, bits)
state entry in bits is returned. */
static int
-extract_op (op_pointer, opval, op)
- int op_pointer;
- int *opval;
- unsigned int *op;
+extract_op (int op_pointer, int *opval, unsigned int *op)
{
int oplen = 5;
@@ -317,10 +302,7 @@ extract_op (op_pointer, opval, op)
PLACE matches OPCODE and is of type TYPE. */
static int
-opcode_verify (opcode, place, type)
- ia64_insn opcode;
- int place;
- enum ia64_insn_type type;
+opcode_verify (ia64_insn opcode, int place, enum ia64_insn_type type)
{
if (main_table[place].opcode_type != type)
{
@@ -364,9 +346,7 @@ opcode_verify (opcode, place, type)
priority. */
static int
-locate_opcode_ent (opcode, type)
- ia64_insn opcode;
- enum ia64_insn_type type;
+locate_opcode_ent (ia64_insn opcode, enum ia64_insn_type type)
{
int currtest[41];
int bitpos[41];
@@ -545,11 +525,7 @@ locate_opcode_ent (opcode, type)
/* Construct an ia64_opcode entry based on OPCODE, NAME and PLACE. */
static struct ia64_opcode *
-make_ia64_opcode (opcode, name, place, depind)
- ia64_insn opcode;
- const char *name;
- int place;
- int depind;
+make_ia64_opcode (ia64_insn opcode, const char *name, int place, int depind)
{
struct ia64_opcode *res =
(struct ia64_opcode *) xmalloc (sizeof (struct ia64_opcode));
@@ -572,9 +548,7 @@ make_ia64_opcode (opcode, name, place, depind)
/* Determine the ia64_opcode entry for the opcode specified by INSN
and TYPE. If a valid entry is not found, return NULL. */
struct ia64_opcode *
-ia64_dis_opcode (insn, type)
- ia64_insn insn;
- enum ia64_insn_type type;
+ia64_dis_opcode (ia64_insn insn, enum ia64_insn_type type)
{
int disent = locate_opcode_ent (insn, type);
@@ -633,9 +607,7 @@ ia64_dis_opcode (insn, type)
matches NAME. Return NULL if one is not found. */
static struct ia64_opcode *
-ia64_find_matching_opcode (name, place)
- const char *name;
- short place;
+ia64_find_matching_opcode (const char *name, short place)
{
char op[129];
const char *suffix;
@@ -696,8 +668,7 @@ ia64_find_matching_opcode (name, place)
release any resources used by the returned entry. */
struct ia64_opcode *
-ia64_find_next_opcode (prev_ent)
- struct ia64_opcode *prev_ent;
+ia64_find_next_opcode (struct ia64_opcode *prev_ent)
{
return ia64_find_matching_opcode (prev_ent->name,
prev_ent->ent_index + 1);
@@ -710,8 +681,7 @@ ia64_find_next_opcode (prev_ent)
release any resources used by the returned entry. */
struct ia64_opcode *
-ia64_find_opcode (name)
- const char *name;
+ia64_find_opcode (const char *name)
{
char op[129];
const char *suffix;
@@ -741,16 +711,14 @@ ia64_find_opcode (name)
/* Free any resources used by ENT. */
void
-ia64_free_opcode (ent)
- struct ia64_opcode *ent;
+ia64_free_opcode (struct ia64_opcode *ent)
{
free ((void *)ent->name);
free (ent);
}
const struct ia64_dependency *
-ia64_find_dependency (index)
- int index;
+ia64_find_dependency (int index)
{
index = DEP(index);
diff --git a/opcodes/ip2k-asm.c b/opcodes/ip2k-asm.c
index 524f256a537..593db9db03d 100644
--- a/opcodes/ip2k-asm.c
+++ b/opcodes/ip2k-asm.c
@@ -43,7 +43,7 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
+ (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *);
/* -- assembler routines inserted here. */
@@ -607,8 +607,7 @@ ip2k_cgen_init_asm (cd)
Returns NULL for success, an error message for failure. */
char *
-ip2k_cgen_build_insn_regex (insn)
- CGEN_INSN *insn;
+ip2k_cgen_build_insn_regex (CGEN_INSN *insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
@@ -731,11 +730,10 @@ ip2k_cgen_build_insn_regex (insn)
Returns NULL for success, an error message for failure. */
static const char *
-parse_insn_normal (cd, insn, strp, fields)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- const char **strp;
- CGEN_FIELDS *fields;
+parse_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ const char **strp,
+ CGEN_FIELDS *fields)
{
/* ??? Runtime added insns not handled yet. */
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
@@ -873,12 +871,11 @@ parse_insn_normal (cd, insn, strp, fields)
mind helps keep the design clean. */
const CGEN_INSN *
-ip2k_cgen_assemble_insn (cd, str, fields, buf, errmsg)
- CGEN_CPU_DESC cd;
- const char *str;
- CGEN_FIELDS *fields;
- CGEN_INSN_BYTES_PTR buf;
- char **errmsg;
+ip2k_cgen_assemble_insn (CGEN_CPU_DESC cd,
+ const char *str,
+ CGEN_FIELDS *fields,
+ CGEN_INSN_BYTES_PTR buf,
+ char **errmsg)
{
const char *start;
CGEN_INSN_LIST *ilist;
@@ -982,9 +979,7 @@ ip2k_cgen_assemble_insn (cd, str, fields, buf, errmsg)
FIXME: Not currently used. */
void
-ip2k_cgen_asm_hash_keywords (cd, opvals)
- CGEN_CPU_DESC cd;
- CGEN_KEYWORD *opvals;
+ip2k_cgen_asm_hash_keywords (CGEN_CPU_DESC cd, CGEN_KEYWORD *opvals)
{
CGEN_KEYWORD_SEARCH search = cgen_keyword_search_init (opvals, NULL);
const CGEN_KEYWORD_ENTRY * ke;
diff --git a/opcodes/ip2k-dis.c b/opcodes/ip2k-dis.c
index f33fcc05ff6..00e764ccced 100644
--- a/opcodes/ip2k-dis.c
+++ b/opcodes/ip2k-dis.c
@@ -41,21 +41,20 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define UNKNOWN_INSN_MSG _("*unknown*")
static void print_normal
- PARAMS ((CGEN_CPU_DESC, PTR, long, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
static void print_address
- PARAMS ((CGEN_CPU_DESC, PTR, bfd_vma, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int);
static void print_keyword
- PARAMS ((CGEN_CPU_DESC, PTR, CGEN_KEYWORD *, long, unsigned int));
+ (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int);
static void print_insn_normal
- PARAMS ((CGEN_CPU_DESC, PTR, const CGEN_INSN *, CGEN_FIELDS *,
- bfd_vma, int));
+ (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
static int print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned);
static int default_print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *);
static int read_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int,
- CGEN_EXTRACT_INFO *, unsigned long *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int, CGEN_EXTRACT_INFO *,
+ unsigned long *);
/* -- disassembler routines inserted here */
@@ -352,13 +351,12 @@ ip2k_cgen_init_dis (cd)
/* Default print handler. */
static void
-print_normal (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- long value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ long value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -378,13 +376,12 @@ print_normal (cd, dis_info, value, attrs, pc, length)
/* Default address handler. */
static void
-print_address (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- bfd_vma value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ bfd_vma value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -408,12 +405,11 @@ print_address (cd, dis_info, value, attrs, pc, length)
/* Keyword print handler. */
static void
-print_keyword (cd, dis_info, keyword_table, value, attrs)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- CGEN_KEYWORD *keyword_table;
- long value;
- unsigned int attrs ATTRIBUTE_UNUSED;
+print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ CGEN_KEYWORD *keyword_table,
+ long value,
+ unsigned int attrs ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
const CGEN_KEYWORD_ENTRY *ke;
@@ -427,17 +423,16 @@ print_keyword (cd, dis_info, keyword_table, value, attrs)
/* Default insn printer.
- DIS_INFO is defined as `PTR' so the disassembler needn't know anything
+ DIS_INFO is defined as `void *' so the disassembler needn't know anything
about disassemble_info. */
static void
-print_insn_normal (cd, dis_info, insn, fields, pc, length)
- CGEN_CPU_DESC cd;
- PTR dis_info;
- const CGEN_INSN *insn;
- CGEN_FIELDS *fields;
- bfd_vma pc;
- int length;
+print_insn_normal (CGEN_CPU_DESC cd,
+ void *dis_info,
+ const CGEN_INSN *insn,
+ CGEN_FIELDS *fields,
+ bfd_vma pc,
+ int length)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
disassemble_info *info = (disassemble_info *) dis_info;
@@ -469,14 +464,13 @@ print_insn_normal (cd, dis_info, insn, fields, pc, length)
Returns 0 if all is well, non-zero otherwise. */
static int
-read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- int buflen;
- CGEN_EXTRACT_INFO *ex_info;
- unsigned long *insn_value;
+read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ int buflen,
+ CGEN_EXTRACT_INFO *ex_info,
+ unsigned long *insn_value)
{
int status = (*info->read_memory_func) (pc, buf, buflen, info);
if (status != 0)
@@ -500,12 +494,11 @@ read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
been called). */
static int
-print_insn (cd, pc, info, buf, buflen)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- unsigned int buflen;
+print_insn (CGEN_CPU_DESC cd,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ unsigned int buflen)
{
CGEN_INSN_INT insn_value;
const CGEN_INSN_LIST *insn_list;
@@ -610,10 +603,7 @@ print_insn (cd, pc, info, buf, buflen)
#endif
static int
-default_print_insn (cd, pc, info)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
+default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
{
char buf[CGEN_MAX_INSN_SIZE];
int buflen;
@@ -652,9 +642,7 @@ typedef struct cpu_desc_list {
} cpu_desc_list;
int
-print_insn_ip2k (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_ip2k (bfd_vma pc, disassemble_info *info)
{
static cpu_desc_list *cd_list = 0;
cpu_desc_list *cl = 0;
diff --git a/opcodes/ip2k-ibld.c b/opcodes/ip2k-ibld.c
index 22e2d8dea6b..e0c53090517 100644
--- a/opcodes/ip2k-ibld.c
+++ b/opcodes/ip2k-ibld.c
@@ -44,30 +44,29 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define FLD(f) (fields->f)
static const char * insert_normal
- PARAMS ((CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR));
+ (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
static const char * insert_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *,
- CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *,
+ CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
static int extract_normal
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
- unsigned int, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, bfd_vma, long *));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
+ unsigned int, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, bfd_vma, long *);
static int extract_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
- CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
+ CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
#if CGEN_INT_INSN_P
static void put_insn_int_value
- PARAMS ((CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT));
+ (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
#endif
#if ! CGEN_INT_INSN_P
static CGEN_INLINE void insert_1
- PARAMS ((CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *));
+ (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
static CGEN_INLINE int fill_cache
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
static CGEN_INLINE long extract_1
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int,
- unsigned char *, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
#endif
/* Operand insertion. */
@@ -77,11 +76,12 @@ static CGEN_INLINE long extract_1
/* Subroutine of insert_normal. */
static CGEN_INLINE void
-insert_1 (cd, value, start, length, word_length, bufp)
- CGEN_CPU_DESC cd;
- unsigned long value;
- int start,length,word_length;
- unsigned char *bufp;
+insert_1 (CGEN_CPU_DESC cd,
+ unsigned long value,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp)
{
unsigned long x,mask;
int shift;
@@ -118,13 +118,15 @@ insert_1 (cd, value, start, length, word_length, bufp)
necessary. */
static const char *
-insert_normal (cd, value, attrs, word_offset, start, length, word_length,
- total_length, buffer)
- CGEN_CPU_DESC cd;
- long value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
- CGEN_INSN_BYTES_PTR buffer;
+insert_normal (CGEN_CPU_DESC cd,
+ long value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
+ CGEN_INSN_BYTES_PTR buffer)
{
static char errbuf[100];
/* Written this way to avoid undefined behaviour. */
@@ -232,12 +234,11 @@ insert_normal (cd, value, attrs, word_offset, start, length, word_length,
The result is an error message or NULL if success. */
static const char *
-insert_insn_normal (cd, insn, fields, buffer, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN * insn;
- CGEN_FIELDS * fields;
- CGEN_INSN_BYTES_PTR buffer;
- bfd_vma pc;
+insert_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN * insn,
+ CGEN_FIELDS * fields,
+ CGEN_INSN_BYTES_PTR buffer,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
unsigned long value;
@@ -288,12 +289,11 @@ insert_insn_normal (cd, insn, fields, buffer, pc)
because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
static void
-put_insn_int_value (cd, buf, length, insn_length, value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_INSN_BYTES_PTR buf;
- int length;
- int insn_length;
- CGEN_INSN_INT value;
+put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_INSN_BYTES_PTR buf,
+ int length,
+ int insn_length,
+ CGEN_INSN_INT value)
{
/* For architectures with insns smaller than the base-insn-bitsize,
length may be too big. */
@@ -320,11 +320,11 @@ put_insn_int_value (cd, buf, length, insn_length, value)
Returns 1 for success, 0 for failure. */
static CGEN_INLINE int
-fill_cache (cd, ex_info, offset, bytes, pc)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_EXTRACT_INFO *ex_info;
- int offset, bytes;
- bfd_vma pc;
+fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_EXTRACT_INFO *ex_info,
+ int offset,
+ int bytes,
+ bfd_vma pc)
{
/* It's doubtful that the middle part has already been fetched so
we don't optimize that case. kiss. */
@@ -364,12 +364,13 @@ fill_cache (cd, ex_info, offset, bytes, pc)
/* Subroutine of extract_normal. */
static CGEN_INLINE long
-extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
- CGEN_CPU_DESC cd;
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
- int start,length,word_length;
- unsigned char *bufp;
- bfd_vma pc ATTRIBUTE_UNUSED;
+extract_1 (CGEN_CPU_DESC cd,
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp,
+ bfd_vma pc ATTRIBUTE_UNUSED)
{
unsigned long x;
int shift;
@@ -408,23 +409,25 @@ extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
necessary. */
static int
-extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
- word_length, total_length, pc, valuep)
- CGEN_CPU_DESC cd;
+extract_normal (CGEN_CPU_DESC cd,
#if ! CGEN_INT_INSN_P
- CGEN_EXTRACT_INFO *ex_info;
+ CGEN_EXTRACT_INFO *ex_info,
#else
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
#endif
- CGEN_INSN_INT insn_value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
+ CGEN_INSN_INT insn_value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
#if ! CGEN_INT_INSN_P
- bfd_vma pc;
+ bfd_vma pc,
#else
- bfd_vma pc ATTRIBUTE_UNUSED;
+ bfd_vma pc ATTRIBUTE_UNUSED,
#endif
- long *valuep;
+ long *valuep)
{
long value, mask;
@@ -505,13 +508,12 @@ extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
been called). */
static int
-extract_insn_normal (cd, insn, ex_info, insn_value, fields, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- CGEN_EXTRACT_INFO *ex_info;
- CGEN_INSN_INT insn_value;
- CGEN_FIELDS *fields;
- bfd_vma pc;
+extract_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ CGEN_EXTRACT_INFO *ex_info,
+ CGEN_INSN_INT insn_value,
+ CGEN_FIELDS *fields,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
const CGEN_SYNTAX_CHAR_TYPE *syn;
diff --git a/opcodes/iq2000-asm.c b/opcodes/iq2000-asm.c
index 7fb795eb155..62d03f857a6 100644
--- a/opcodes/iq2000-asm.c
+++ b/opcodes/iq2000-asm.c
@@ -43,7 +43,7 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
+ (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *);
/* -- assembler routines inserted here. */
@@ -493,8 +493,7 @@ iq2000_cgen_init_asm (cd)
Returns NULL for success, an error message for failure. */
char *
-iq2000_cgen_build_insn_regex (insn)
- CGEN_INSN *insn;
+iq2000_cgen_build_insn_regex (CGEN_INSN *insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
@@ -617,11 +616,10 @@ iq2000_cgen_build_insn_regex (insn)
Returns NULL for success, an error message for failure. */
static const char *
-parse_insn_normal (cd, insn, strp, fields)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- const char **strp;
- CGEN_FIELDS *fields;
+parse_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ const char **strp,
+ CGEN_FIELDS *fields)
{
/* ??? Runtime added insns not handled yet. */
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
@@ -759,12 +757,11 @@ parse_insn_normal (cd, insn, strp, fields)
mind helps keep the design clean. */
const CGEN_INSN *
-iq2000_cgen_assemble_insn (cd, str, fields, buf, errmsg)
- CGEN_CPU_DESC cd;
- const char *str;
- CGEN_FIELDS *fields;
- CGEN_INSN_BYTES_PTR buf;
- char **errmsg;
+iq2000_cgen_assemble_insn (CGEN_CPU_DESC cd,
+ const char *str,
+ CGEN_FIELDS *fields,
+ CGEN_INSN_BYTES_PTR buf,
+ char **errmsg)
{
const char *start;
CGEN_INSN_LIST *ilist;
@@ -868,9 +865,7 @@ iq2000_cgen_assemble_insn (cd, str, fields, buf, errmsg)
FIXME: Not currently used. */
void
-iq2000_cgen_asm_hash_keywords (cd, opvals)
- CGEN_CPU_DESC cd;
- CGEN_KEYWORD *opvals;
+iq2000_cgen_asm_hash_keywords (CGEN_CPU_DESC cd, CGEN_KEYWORD *opvals)
{
CGEN_KEYWORD_SEARCH search = cgen_keyword_search_init (opvals, NULL);
const CGEN_KEYWORD_ENTRY * ke;
diff --git a/opcodes/iq2000-dis.c b/opcodes/iq2000-dis.c
index b1bfa0ef4b4..c20e9788517 100644
--- a/opcodes/iq2000-dis.c
+++ b/opcodes/iq2000-dis.c
@@ -41,21 +41,20 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define UNKNOWN_INSN_MSG _("*unknown*")
static void print_normal
- PARAMS ((CGEN_CPU_DESC, PTR, long, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
static void print_address
- PARAMS ((CGEN_CPU_DESC, PTR, bfd_vma, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int);
static void print_keyword
- PARAMS ((CGEN_CPU_DESC, PTR, CGEN_KEYWORD *, long, unsigned int));
+ (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int);
static void print_insn_normal
- PARAMS ((CGEN_CPU_DESC, PTR, const CGEN_INSN *, CGEN_FIELDS *,
- bfd_vma, int));
+ (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
static int print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned);
static int default_print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *);
static int read_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int,
- CGEN_EXTRACT_INFO *, unsigned long *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int, CGEN_EXTRACT_INFO *,
+ unsigned long *);
/* -- disassembler routines inserted here */
@@ -215,13 +214,12 @@ iq2000_cgen_init_dis (cd)
/* Default print handler. */
static void
-print_normal (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- long value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ long value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -241,13 +239,12 @@ print_normal (cd, dis_info, value, attrs, pc, length)
/* Default address handler. */
static void
-print_address (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- bfd_vma value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ bfd_vma value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -271,12 +268,11 @@ print_address (cd, dis_info, value, attrs, pc, length)
/* Keyword print handler. */
static void
-print_keyword (cd, dis_info, keyword_table, value, attrs)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- CGEN_KEYWORD *keyword_table;
- long value;
- unsigned int attrs ATTRIBUTE_UNUSED;
+print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ CGEN_KEYWORD *keyword_table,
+ long value,
+ unsigned int attrs ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
const CGEN_KEYWORD_ENTRY *ke;
@@ -290,17 +286,16 @@ print_keyword (cd, dis_info, keyword_table, value, attrs)
/* Default insn printer.
- DIS_INFO is defined as `PTR' so the disassembler needn't know anything
+ DIS_INFO is defined as `void *' so the disassembler needn't know anything
about disassemble_info. */
static void
-print_insn_normal (cd, dis_info, insn, fields, pc, length)
- CGEN_CPU_DESC cd;
- PTR dis_info;
- const CGEN_INSN *insn;
- CGEN_FIELDS *fields;
- bfd_vma pc;
- int length;
+print_insn_normal (CGEN_CPU_DESC cd,
+ void *dis_info,
+ const CGEN_INSN *insn,
+ CGEN_FIELDS *fields,
+ bfd_vma pc,
+ int length)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
disassemble_info *info = (disassemble_info *) dis_info;
@@ -332,14 +327,13 @@ print_insn_normal (cd, dis_info, insn, fields, pc, length)
Returns 0 if all is well, non-zero otherwise. */
static int
-read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- int buflen;
- CGEN_EXTRACT_INFO *ex_info;
- unsigned long *insn_value;
+read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ int buflen,
+ CGEN_EXTRACT_INFO *ex_info,
+ unsigned long *insn_value)
{
int status = (*info->read_memory_func) (pc, buf, buflen, info);
if (status != 0)
@@ -363,12 +357,11 @@ read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
been called). */
static int
-print_insn (cd, pc, info, buf, buflen)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- unsigned int buflen;
+print_insn (CGEN_CPU_DESC cd,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ unsigned int buflen)
{
CGEN_INSN_INT insn_value;
const CGEN_INSN_LIST *insn_list;
@@ -473,10 +466,7 @@ print_insn (cd, pc, info, buf, buflen)
#endif
static int
-default_print_insn (cd, pc, info)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
+default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
{
char buf[CGEN_MAX_INSN_SIZE];
int buflen;
@@ -515,9 +505,7 @@ typedef struct cpu_desc_list {
} cpu_desc_list;
int
-print_insn_iq2000 (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_iq2000 (bfd_vma pc, disassemble_info *info)
{
static cpu_desc_list *cd_list = 0;
cpu_desc_list *cl = 0;
diff --git a/opcodes/iq2000-ibld.c b/opcodes/iq2000-ibld.c
index 4917d9fa3d5..f0640f0774f 100644
--- a/opcodes/iq2000-ibld.c
+++ b/opcodes/iq2000-ibld.c
@@ -44,30 +44,29 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define FLD(f) (fields->f)
static const char * insert_normal
- PARAMS ((CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR));
+ (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
static const char * insert_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *,
- CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *,
+ CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
static int extract_normal
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
- unsigned int, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, bfd_vma, long *));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
+ unsigned int, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, bfd_vma, long *);
static int extract_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
- CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
+ CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
#if CGEN_INT_INSN_P
static void put_insn_int_value
- PARAMS ((CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT));
+ (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
#endif
#if ! CGEN_INT_INSN_P
static CGEN_INLINE void insert_1
- PARAMS ((CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *));
+ (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
static CGEN_INLINE int fill_cache
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
static CGEN_INLINE long extract_1
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int,
- unsigned char *, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
#endif
/* Operand insertion. */
@@ -77,11 +76,12 @@ static CGEN_INLINE long extract_1
/* Subroutine of insert_normal. */
static CGEN_INLINE void
-insert_1 (cd, value, start, length, word_length, bufp)
- CGEN_CPU_DESC cd;
- unsigned long value;
- int start,length,word_length;
- unsigned char *bufp;
+insert_1 (CGEN_CPU_DESC cd,
+ unsigned long value,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp)
{
unsigned long x,mask;
int shift;
@@ -118,13 +118,15 @@ insert_1 (cd, value, start, length, word_length, bufp)
necessary. */
static const char *
-insert_normal (cd, value, attrs, word_offset, start, length, word_length,
- total_length, buffer)
- CGEN_CPU_DESC cd;
- long value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
- CGEN_INSN_BYTES_PTR buffer;
+insert_normal (CGEN_CPU_DESC cd,
+ long value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
+ CGEN_INSN_BYTES_PTR buffer)
{
static char errbuf[100];
/* Written this way to avoid undefined behaviour. */
@@ -232,12 +234,11 @@ insert_normal (cd, value, attrs, word_offset, start, length, word_length,
The result is an error message or NULL if success. */
static const char *
-insert_insn_normal (cd, insn, fields, buffer, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN * insn;
- CGEN_FIELDS * fields;
- CGEN_INSN_BYTES_PTR buffer;
- bfd_vma pc;
+insert_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN * insn,
+ CGEN_FIELDS * fields,
+ CGEN_INSN_BYTES_PTR buffer,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
unsigned long value;
@@ -288,12 +289,11 @@ insert_insn_normal (cd, insn, fields, buffer, pc)
because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
static void
-put_insn_int_value (cd, buf, length, insn_length, value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_INSN_BYTES_PTR buf;
- int length;
- int insn_length;
- CGEN_INSN_INT value;
+put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_INSN_BYTES_PTR buf,
+ int length,
+ int insn_length,
+ CGEN_INSN_INT value)
{
/* For architectures with insns smaller than the base-insn-bitsize,
length may be too big. */
@@ -320,11 +320,11 @@ put_insn_int_value (cd, buf, length, insn_length, value)
Returns 1 for success, 0 for failure. */
static CGEN_INLINE int
-fill_cache (cd, ex_info, offset, bytes, pc)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_EXTRACT_INFO *ex_info;
- int offset, bytes;
- bfd_vma pc;
+fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_EXTRACT_INFO *ex_info,
+ int offset,
+ int bytes,
+ bfd_vma pc)
{
/* It's doubtful that the middle part has already been fetched so
we don't optimize that case. kiss. */
@@ -364,12 +364,13 @@ fill_cache (cd, ex_info, offset, bytes, pc)
/* Subroutine of extract_normal. */
static CGEN_INLINE long
-extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
- CGEN_CPU_DESC cd;
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
- int start,length,word_length;
- unsigned char *bufp;
- bfd_vma pc ATTRIBUTE_UNUSED;
+extract_1 (CGEN_CPU_DESC cd,
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp,
+ bfd_vma pc ATTRIBUTE_UNUSED)
{
unsigned long x;
int shift;
@@ -408,23 +409,25 @@ extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
necessary. */
static int
-extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
- word_length, total_length, pc, valuep)
- CGEN_CPU_DESC cd;
+extract_normal (CGEN_CPU_DESC cd,
#if ! CGEN_INT_INSN_P
- CGEN_EXTRACT_INFO *ex_info;
+ CGEN_EXTRACT_INFO *ex_info,
#else
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
#endif
- CGEN_INSN_INT insn_value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
+ CGEN_INSN_INT insn_value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
#if ! CGEN_INT_INSN_P
- bfd_vma pc;
+ bfd_vma pc,
#else
- bfd_vma pc ATTRIBUTE_UNUSED;
+ bfd_vma pc ATTRIBUTE_UNUSED,
#endif
- long *valuep;
+ long *valuep)
{
long value, mask;
@@ -505,13 +508,12 @@ extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
been called). */
static int
-extract_insn_normal (cd, insn, ex_info, insn_value, fields, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- CGEN_EXTRACT_INFO *ex_info;
- CGEN_INSN_INT insn_value;
- CGEN_FIELDS *fields;
- bfd_vma pc;
+extract_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ CGEN_EXTRACT_INFO *ex_info,
+ CGEN_INSN_INT insn_value,
+ CGEN_FIELDS *fields,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
const CGEN_SYNTAX_CHAR_TYPE *syn;
diff --git a/opcodes/m32r-asm.c b/opcodes/m32r-asm.c
index 2bd751af6db..a8c9485f20f 100644
--- a/opcodes/m32r-asm.c
+++ b/opcodes/m32r-asm.c
@@ -43,7 +43,7 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
+ (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *);
/* -- assembler routines inserted here. */
@@ -358,8 +358,7 @@ m32r_cgen_init_asm (cd)
Returns NULL for success, an error message for failure. */
char *
-m32r_cgen_build_insn_regex (insn)
- CGEN_INSN *insn;
+m32r_cgen_build_insn_regex (CGEN_INSN *insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
@@ -482,11 +481,10 @@ m32r_cgen_build_insn_regex (insn)
Returns NULL for success, an error message for failure. */
static const char *
-parse_insn_normal (cd, insn, strp, fields)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- const char **strp;
- CGEN_FIELDS *fields;
+parse_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ const char **strp,
+ CGEN_FIELDS *fields)
{
/* ??? Runtime added insns not handled yet. */
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
@@ -624,12 +622,11 @@ parse_insn_normal (cd, insn, strp, fields)
mind helps keep the design clean. */
const CGEN_INSN *
-m32r_cgen_assemble_insn (cd, str, fields, buf, errmsg)
- CGEN_CPU_DESC cd;
- const char *str;
- CGEN_FIELDS *fields;
- CGEN_INSN_BYTES_PTR buf;
- char **errmsg;
+m32r_cgen_assemble_insn (CGEN_CPU_DESC cd,
+ const char *str,
+ CGEN_FIELDS *fields,
+ CGEN_INSN_BYTES_PTR buf,
+ char **errmsg)
{
const char *start;
CGEN_INSN_LIST *ilist;
@@ -733,9 +730,7 @@ m32r_cgen_assemble_insn (cd, str, fields, buf, errmsg)
FIXME: Not currently used. */
void
-m32r_cgen_asm_hash_keywords (cd, opvals)
- CGEN_CPU_DESC cd;
- CGEN_KEYWORD *opvals;
+m32r_cgen_asm_hash_keywords (CGEN_CPU_DESC cd, CGEN_KEYWORD *opvals)
{
CGEN_KEYWORD_SEARCH search = cgen_keyword_search_init (opvals, NULL);
const CGEN_KEYWORD_ENTRY * ke;
diff --git a/opcodes/m32r-dis.c b/opcodes/m32r-dis.c
index 5688049ef16..e8abbc61346 100644
--- a/opcodes/m32r-dis.c
+++ b/opcodes/m32r-dis.c
@@ -41,21 +41,20 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define UNKNOWN_INSN_MSG _("*unknown*")
static void print_normal
- PARAMS ((CGEN_CPU_DESC, PTR, long, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
static void print_address
- PARAMS ((CGEN_CPU_DESC, PTR, bfd_vma, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int);
static void print_keyword
- PARAMS ((CGEN_CPU_DESC, PTR, CGEN_KEYWORD *, long, unsigned int));
+ (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int);
static void print_insn_normal
- PARAMS ((CGEN_CPU_DESC, PTR, const CGEN_INSN *, CGEN_FIELDS *,
- bfd_vma, int));
+ (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
static int print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned);
static int default_print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *);
static int read_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int,
- CGEN_EXTRACT_INFO *, unsigned long *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int, CGEN_EXTRACT_INFO *,
+ unsigned long *);
/* -- disassembler routines inserted here */
@@ -274,13 +273,12 @@ m32r_cgen_init_dis (cd)
/* Default print handler. */
static void
-print_normal (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- long value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ long value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -300,13 +298,12 @@ print_normal (cd, dis_info, value, attrs, pc, length)
/* Default address handler. */
static void
-print_address (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- bfd_vma value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ bfd_vma value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -330,12 +327,11 @@ print_address (cd, dis_info, value, attrs, pc, length)
/* Keyword print handler. */
static void
-print_keyword (cd, dis_info, keyword_table, value, attrs)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- CGEN_KEYWORD *keyword_table;
- long value;
- unsigned int attrs ATTRIBUTE_UNUSED;
+print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ CGEN_KEYWORD *keyword_table,
+ long value,
+ unsigned int attrs ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
const CGEN_KEYWORD_ENTRY *ke;
@@ -349,17 +345,16 @@ print_keyword (cd, dis_info, keyword_table, value, attrs)
/* Default insn printer.
- DIS_INFO is defined as `PTR' so the disassembler needn't know anything
+ DIS_INFO is defined as `void *' so the disassembler needn't know anything
about disassemble_info. */
static void
-print_insn_normal (cd, dis_info, insn, fields, pc, length)
- CGEN_CPU_DESC cd;
- PTR dis_info;
- const CGEN_INSN *insn;
- CGEN_FIELDS *fields;
- bfd_vma pc;
- int length;
+print_insn_normal (CGEN_CPU_DESC cd,
+ void *dis_info,
+ const CGEN_INSN *insn,
+ CGEN_FIELDS *fields,
+ bfd_vma pc,
+ int length)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
disassemble_info *info = (disassemble_info *) dis_info;
@@ -391,14 +386,13 @@ print_insn_normal (cd, dis_info, insn, fields, pc, length)
Returns 0 if all is well, non-zero otherwise. */
static int
-read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- int buflen;
- CGEN_EXTRACT_INFO *ex_info;
- unsigned long *insn_value;
+read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ int buflen,
+ CGEN_EXTRACT_INFO *ex_info,
+ unsigned long *insn_value)
{
int status = (*info->read_memory_func) (pc, buf, buflen, info);
if (status != 0)
@@ -422,12 +416,11 @@ read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
been called). */
static int
-print_insn (cd, pc, info, buf, buflen)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- unsigned int buflen;
+print_insn (CGEN_CPU_DESC cd,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ unsigned int buflen)
{
CGEN_INSN_INT insn_value;
const CGEN_INSN_LIST *insn_list;
@@ -532,10 +525,7 @@ print_insn (cd, pc, info, buf, buflen)
#endif
static int
-default_print_insn (cd, pc, info)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
+default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
{
char buf[CGEN_MAX_INSN_SIZE];
int buflen;
@@ -574,9 +564,7 @@ typedef struct cpu_desc_list {
} cpu_desc_list;
int
-print_insn_m32r (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_m32r (bfd_vma pc, disassemble_info *info)
{
static cpu_desc_list *cd_list = 0;
cpu_desc_list *cl = 0;
diff --git a/opcodes/m32r-ibld.c b/opcodes/m32r-ibld.c
index ef1ee0e0126..2a8d104e3f7 100644
--- a/opcodes/m32r-ibld.c
+++ b/opcodes/m32r-ibld.c
@@ -44,30 +44,29 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define FLD(f) (fields->f)
static const char * insert_normal
- PARAMS ((CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR));
+ (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
static const char * insert_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *,
- CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *,
+ CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
static int extract_normal
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
- unsigned int, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, bfd_vma, long *));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
+ unsigned int, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, bfd_vma, long *);
static int extract_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
- CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
+ CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
#if CGEN_INT_INSN_P
static void put_insn_int_value
- PARAMS ((CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT));
+ (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
#endif
#if ! CGEN_INT_INSN_P
static CGEN_INLINE void insert_1
- PARAMS ((CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *));
+ (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
static CGEN_INLINE int fill_cache
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
static CGEN_INLINE long extract_1
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int,
- unsigned char *, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
#endif
/* Operand insertion. */
@@ -77,11 +76,12 @@ static CGEN_INLINE long extract_1
/* Subroutine of insert_normal. */
static CGEN_INLINE void
-insert_1 (cd, value, start, length, word_length, bufp)
- CGEN_CPU_DESC cd;
- unsigned long value;
- int start,length,word_length;
- unsigned char *bufp;
+insert_1 (CGEN_CPU_DESC cd,
+ unsigned long value,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp)
{
unsigned long x,mask;
int shift;
@@ -118,13 +118,15 @@ insert_1 (cd, value, start, length, word_length, bufp)
necessary. */
static const char *
-insert_normal (cd, value, attrs, word_offset, start, length, word_length,
- total_length, buffer)
- CGEN_CPU_DESC cd;
- long value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
- CGEN_INSN_BYTES_PTR buffer;
+insert_normal (CGEN_CPU_DESC cd,
+ long value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
+ CGEN_INSN_BYTES_PTR buffer)
{
static char errbuf[100];
/* Written this way to avoid undefined behaviour. */
@@ -232,12 +234,11 @@ insert_normal (cd, value, attrs, word_offset, start, length, word_length,
The result is an error message or NULL if success. */
static const char *
-insert_insn_normal (cd, insn, fields, buffer, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN * insn;
- CGEN_FIELDS * fields;
- CGEN_INSN_BYTES_PTR buffer;
- bfd_vma pc;
+insert_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN * insn,
+ CGEN_FIELDS * fields,
+ CGEN_INSN_BYTES_PTR buffer,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
unsigned long value;
@@ -288,12 +289,11 @@ insert_insn_normal (cd, insn, fields, buffer, pc)
because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
static void
-put_insn_int_value (cd, buf, length, insn_length, value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_INSN_BYTES_PTR buf;
- int length;
- int insn_length;
- CGEN_INSN_INT value;
+put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_INSN_BYTES_PTR buf,
+ int length,
+ int insn_length,
+ CGEN_INSN_INT value)
{
/* For architectures with insns smaller than the base-insn-bitsize,
length may be too big. */
@@ -320,11 +320,11 @@ put_insn_int_value (cd, buf, length, insn_length, value)
Returns 1 for success, 0 for failure. */
static CGEN_INLINE int
-fill_cache (cd, ex_info, offset, bytes, pc)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_EXTRACT_INFO *ex_info;
- int offset, bytes;
- bfd_vma pc;
+fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_EXTRACT_INFO *ex_info,
+ int offset,
+ int bytes,
+ bfd_vma pc)
{
/* It's doubtful that the middle part has already been fetched so
we don't optimize that case. kiss. */
@@ -364,12 +364,13 @@ fill_cache (cd, ex_info, offset, bytes, pc)
/* Subroutine of extract_normal. */
static CGEN_INLINE long
-extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
- CGEN_CPU_DESC cd;
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
- int start,length,word_length;
- unsigned char *bufp;
- bfd_vma pc ATTRIBUTE_UNUSED;
+extract_1 (CGEN_CPU_DESC cd,
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp,
+ bfd_vma pc ATTRIBUTE_UNUSED)
{
unsigned long x;
int shift;
@@ -408,23 +409,25 @@ extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
necessary. */
static int
-extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
- word_length, total_length, pc, valuep)
- CGEN_CPU_DESC cd;
+extract_normal (CGEN_CPU_DESC cd,
#if ! CGEN_INT_INSN_P
- CGEN_EXTRACT_INFO *ex_info;
+ CGEN_EXTRACT_INFO *ex_info,
#else
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
#endif
- CGEN_INSN_INT insn_value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
+ CGEN_INSN_INT insn_value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
#if ! CGEN_INT_INSN_P
- bfd_vma pc;
+ bfd_vma pc,
#else
- bfd_vma pc ATTRIBUTE_UNUSED;
+ bfd_vma pc ATTRIBUTE_UNUSED,
#endif
- long *valuep;
+ long *valuep)
{
long value, mask;
@@ -505,13 +508,12 @@ extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
been called). */
static int
-extract_insn_normal (cd, insn, ex_info, insn_value, fields, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- CGEN_EXTRACT_INFO *ex_info;
- CGEN_INSN_INT insn_value;
- CGEN_FIELDS *fields;
- bfd_vma pc;
+extract_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ CGEN_EXTRACT_INFO *ex_info,
+ CGEN_INSN_INT insn_value,
+ CGEN_FIELDS *fields,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
const CGEN_SYNTAX_CHAR_TYPE *syn;
diff --git a/opcodes/openrisc-asm.c b/opcodes/openrisc-asm.c
index 26b2625957f..9f6ee325888 100644
--- a/opcodes/openrisc-asm.c
+++ b/opcodes/openrisc-asm.c
@@ -43,7 +43,7 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
+ (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *);
/* -- assembler routines inserted here. */
@@ -277,8 +277,7 @@ openrisc_cgen_init_asm (cd)
Returns NULL for success, an error message for failure. */
char *
-openrisc_cgen_build_insn_regex (insn)
- CGEN_INSN *insn;
+openrisc_cgen_build_insn_regex (CGEN_INSN *insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
@@ -401,11 +400,10 @@ openrisc_cgen_build_insn_regex (insn)
Returns NULL for success, an error message for failure. */
static const char *
-parse_insn_normal (cd, insn, strp, fields)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- const char **strp;
- CGEN_FIELDS *fields;
+parse_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ const char **strp,
+ CGEN_FIELDS *fields)
{
/* ??? Runtime added insns not handled yet. */
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
@@ -543,12 +541,11 @@ parse_insn_normal (cd, insn, strp, fields)
mind helps keep the design clean. */
const CGEN_INSN *
-openrisc_cgen_assemble_insn (cd, str, fields, buf, errmsg)
- CGEN_CPU_DESC cd;
- const char *str;
- CGEN_FIELDS *fields;
- CGEN_INSN_BYTES_PTR buf;
- char **errmsg;
+openrisc_cgen_assemble_insn (CGEN_CPU_DESC cd,
+ const char *str,
+ CGEN_FIELDS *fields,
+ CGEN_INSN_BYTES_PTR buf,
+ char **errmsg)
{
const char *start;
CGEN_INSN_LIST *ilist;
@@ -652,9 +649,7 @@ openrisc_cgen_assemble_insn (cd, str, fields, buf, errmsg)
FIXME: Not currently used. */
void
-openrisc_cgen_asm_hash_keywords (cd, opvals)
- CGEN_CPU_DESC cd;
- CGEN_KEYWORD *opvals;
+openrisc_cgen_asm_hash_keywords (CGEN_CPU_DESC cd, CGEN_KEYWORD *opvals)
{
CGEN_KEYWORD_SEARCH search = cgen_keyword_search_init (opvals, NULL);
const CGEN_KEYWORD_ENTRY * ke;
diff --git a/opcodes/openrisc-dis.c b/opcodes/openrisc-dis.c
index 5c4da5f3e94..6b721e213fb 100644
--- a/opcodes/openrisc-dis.c
+++ b/opcodes/openrisc-dis.c
@@ -41,21 +41,20 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define UNKNOWN_INSN_MSG _("*unknown*")
static void print_normal
- PARAMS ((CGEN_CPU_DESC, PTR, long, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
static void print_address
- PARAMS ((CGEN_CPU_DESC, PTR, bfd_vma, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int);
static void print_keyword
- PARAMS ((CGEN_CPU_DESC, PTR, CGEN_KEYWORD *, long, unsigned int));
+ (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int);
static void print_insn_normal
- PARAMS ((CGEN_CPU_DESC, PTR, const CGEN_INSN *, CGEN_FIELDS *,
- bfd_vma, int));
+ (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
static int print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned);
static int default_print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *);
static int read_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int,
- CGEN_EXTRACT_INFO *, unsigned long *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int, CGEN_EXTRACT_INFO *,
+ unsigned long *);
/* -- disassembler routines inserted here */
@@ -161,13 +160,12 @@ openrisc_cgen_init_dis (cd)
/* Default print handler. */
static void
-print_normal (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- long value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ long value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -187,13 +185,12 @@ print_normal (cd, dis_info, value, attrs, pc, length)
/* Default address handler. */
static void
-print_address (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- bfd_vma value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ bfd_vma value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -217,12 +214,11 @@ print_address (cd, dis_info, value, attrs, pc, length)
/* Keyword print handler. */
static void
-print_keyword (cd, dis_info, keyword_table, value, attrs)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- CGEN_KEYWORD *keyword_table;
- long value;
- unsigned int attrs ATTRIBUTE_UNUSED;
+print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ CGEN_KEYWORD *keyword_table,
+ long value,
+ unsigned int attrs ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
const CGEN_KEYWORD_ENTRY *ke;
@@ -236,17 +232,16 @@ print_keyword (cd, dis_info, keyword_table, value, attrs)
/* Default insn printer.
- DIS_INFO is defined as `PTR' so the disassembler needn't know anything
+ DIS_INFO is defined as `void *' so the disassembler needn't know anything
about disassemble_info. */
static void
-print_insn_normal (cd, dis_info, insn, fields, pc, length)
- CGEN_CPU_DESC cd;
- PTR dis_info;
- const CGEN_INSN *insn;
- CGEN_FIELDS *fields;
- bfd_vma pc;
- int length;
+print_insn_normal (CGEN_CPU_DESC cd,
+ void *dis_info,
+ const CGEN_INSN *insn,
+ CGEN_FIELDS *fields,
+ bfd_vma pc,
+ int length)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
disassemble_info *info = (disassemble_info *) dis_info;
@@ -278,14 +273,13 @@ print_insn_normal (cd, dis_info, insn, fields, pc, length)
Returns 0 if all is well, non-zero otherwise. */
static int
-read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- int buflen;
- CGEN_EXTRACT_INFO *ex_info;
- unsigned long *insn_value;
+read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ int buflen,
+ CGEN_EXTRACT_INFO *ex_info,
+ unsigned long *insn_value)
{
int status = (*info->read_memory_func) (pc, buf, buflen, info);
if (status != 0)
@@ -309,12 +303,11 @@ read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
been called). */
static int
-print_insn (cd, pc, info, buf, buflen)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- unsigned int buflen;
+print_insn (CGEN_CPU_DESC cd,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ unsigned int buflen)
{
CGEN_INSN_INT insn_value;
const CGEN_INSN_LIST *insn_list;
@@ -419,10 +412,7 @@ print_insn (cd, pc, info, buf, buflen)
#endif
static int
-default_print_insn (cd, pc, info)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
+default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
{
char buf[CGEN_MAX_INSN_SIZE];
int buflen;
@@ -461,9 +451,7 @@ typedef struct cpu_desc_list {
} cpu_desc_list;
int
-print_insn_openrisc (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_openrisc (bfd_vma pc, disassemble_info *info)
{
static cpu_desc_list *cd_list = 0;
cpu_desc_list *cl = 0;
diff --git a/opcodes/openrisc-ibld.c b/opcodes/openrisc-ibld.c
index c2e5156e8d2..751ac07c3cf 100644
--- a/opcodes/openrisc-ibld.c
+++ b/opcodes/openrisc-ibld.c
@@ -44,30 +44,29 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define FLD(f) (fields->f)
static const char * insert_normal
- PARAMS ((CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR));
+ (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
static const char * insert_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *,
- CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *,
+ CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
static int extract_normal
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
- unsigned int, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, bfd_vma, long *));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
+ unsigned int, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, bfd_vma, long *);
static int extract_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
- CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
+ CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
#if CGEN_INT_INSN_P
static void put_insn_int_value
- PARAMS ((CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT));
+ (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
#endif
#if ! CGEN_INT_INSN_P
static CGEN_INLINE void insert_1
- PARAMS ((CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *));
+ (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
static CGEN_INLINE int fill_cache
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
static CGEN_INLINE long extract_1
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int,
- unsigned char *, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
#endif
/* Operand insertion. */
@@ -77,11 +76,12 @@ static CGEN_INLINE long extract_1
/* Subroutine of insert_normal. */
static CGEN_INLINE void
-insert_1 (cd, value, start, length, word_length, bufp)
- CGEN_CPU_DESC cd;
- unsigned long value;
- int start,length,word_length;
- unsigned char *bufp;
+insert_1 (CGEN_CPU_DESC cd,
+ unsigned long value,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp)
{
unsigned long x,mask;
int shift;
@@ -118,13 +118,15 @@ insert_1 (cd, value, start, length, word_length, bufp)
necessary. */
static const char *
-insert_normal (cd, value, attrs, word_offset, start, length, word_length,
- total_length, buffer)
- CGEN_CPU_DESC cd;
- long value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
- CGEN_INSN_BYTES_PTR buffer;
+insert_normal (CGEN_CPU_DESC cd,
+ long value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
+ CGEN_INSN_BYTES_PTR buffer)
{
static char errbuf[100];
/* Written this way to avoid undefined behaviour. */
@@ -232,12 +234,11 @@ insert_normal (cd, value, attrs, word_offset, start, length, word_length,
The result is an error message or NULL if success. */
static const char *
-insert_insn_normal (cd, insn, fields, buffer, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN * insn;
- CGEN_FIELDS * fields;
- CGEN_INSN_BYTES_PTR buffer;
- bfd_vma pc;
+insert_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN * insn,
+ CGEN_FIELDS * fields,
+ CGEN_INSN_BYTES_PTR buffer,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
unsigned long value;
@@ -288,12 +289,11 @@ insert_insn_normal (cd, insn, fields, buffer, pc)
because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
static void
-put_insn_int_value (cd, buf, length, insn_length, value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_INSN_BYTES_PTR buf;
- int length;
- int insn_length;
- CGEN_INSN_INT value;
+put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_INSN_BYTES_PTR buf,
+ int length,
+ int insn_length,
+ CGEN_INSN_INT value)
{
/* For architectures with insns smaller than the base-insn-bitsize,
length may be too big. */
@@ -320,11 +320,11 @@ put_insn_int_value (cd, buf, length, insn_length, value)
Returns 1 for success, 0 for failure. */
static CGEN_INLINE int
-fill_cache (cd, ex_info, offset, bytes, pc)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_EXTRACT_INFO *ex_info;
- int offset, bytes;
- bfd_vma pc;
+fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_EXTRACT_INFO *ex_info,
+ int offset,
+ int bytes,
+ bfd_vma pc)
{
/* It's doubtful that the middle part has already been fetched so
we don't optimize that case. kiss. */
@@ -364,12 +364,13 @@ fill_cache (cd, ex_info, offset, bytes, pc)
/* Subroutine of extract_normal. */
static CGEN_INLINE long
-extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
- CGEN_CPU_DESC cd;
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
- int start,length,word_length;
- unsigned char *bufp;
- bfd_vma pc ATTRIBUTE_UNUSED;
+extract_1 (CGEN_CPU_DESC cd,
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp,
+ bfd_vma pc ATTRIBUTE_UNUSED)
{
unsigned long x;
int shift;
@@ -408,23 +409,25 @@ extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
necessary. */
static int
-extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
- word_length, total_length, pc, valuep)
- CGEN_CPU_DESC cd;
+extract_normal (CGEN_CPU_DESC cd,
#if ! CGEN_INT_INSN_P
- CGEN_EXTRACT_INFO *ex_info;
+ CGEN_EXTRACT_INFO *ex_info,
#else
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
#endif
- CGEN_INSN_INT insn_value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
+ CGEN_INSN_INT insn_value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
#if ! CGEN_INT_INSN_P
- bfd_vma pc;
+ bfd_vma pc,
#else
- bfd_vma pc ATTRIBUTE_UNUSED;
+ bfd_vma pc ATTRIBUTE_UNUSED,
#endif
- long *valuep;
+ long *valuep)
{
long value, mask;
@@ -505,13 +508,12 @@ extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
been called). */
static int
-extract_insn_normal (cd, insn, ex_info, insn_value, fields, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- CGEN_EXTRACT_INFO *ex_info;
- CGEN_INSN_INT insn_value;
- CGEN_FIELDS *fields;
- bfd_vma pc;
+extract_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ CGEN_EXTRACT_INFO *ex_info,
+ CGEN_INSN_INT insn_value,
+ CGEN_FIELDS *fields,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
const CGEN_SYNTAX_CHAR_TYPE *syn;
diff --git a/opcodes/po/fr.po b/opcodes/po/fr.po
index 08ae66193a7..7ec06af1903 100644
--- a/opcodes/po/fr.po
+++ b/opcodes/po/fr.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: opcodes 2.14rel030712\n"
"POT-Creation-Date: 2003-07-11 13:56+0930\n"
-"PO-Revision-Date: 2003-07-22 08:00-0500\n"
+"PO-Revision-Date: 2003-08-05 08:00-0500\n"
"Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n"
"Language-Team: French <traduc@traduc.org>\n"
"MIME-Version: 1.0\n"
@@ -66,12 +66,12 @@ msgstr "contrainte inconnue « %c »"
#: iq2000-ibld.c:195 m32r-ibld.c:195 openrisc-ibld.c:195 xstormy16-ibld.c:195
#, c-format
msgid "operand out of range (%ld not between %ld and %ld)"
-msgstr "opérande hors gamme (%ld n'est pas entre %ld et %ld)"
+msgstr "opérande hors limite (%ld n'est pas entre %ld et %ld)"
#: cgen-asm.c:369
#, c-format
msgid "operand out of range (%lu not between %lu and %lu)"
-msgstr "opérande hors gamme (%lu n'est pas entre %lu et %lu)"
+msgstr "opérande hors limite (%lu n'est pas entre %lu et %lu)"
#: d30v-dis.c:312
#, c-format
@@ -87,7 +87,7 @@ msgstr "Erreur inconnue %d\n"
#: dis-buf.c:62
#, c-format
msgid "Address 0x%x is out of bounds.\n"
-msgstr "Adresse 0x%x est hors gamme.\n"
+msgstr "Adresse 0x%x est hors limite.\n"
#: fr30-asm.c:323 frv-asm.c:626 ip2k-asm.c:574 iq2000-asm.c:460 m32r-asm.c:325
#: openrisc-asm.c:261 xstormy16-asm.c:284
@@ -161,13 +161,13 @@ msgstr "Champ non reconnu %d lors de l'impression insn.\n"
#: m32r-ibld.c:166 openrisc-ibld.c:166 xstormy16-ibld.c:166
#, c-format
msgid "operand out of range (%ld not between %ld and %lu)"
-msgstr "opérande hors gamme (%ld n'est pas entre %ld et %lu)"
+msgstr "opérande hors limite (%ld n'est pas entre %ld et %lu)"
#: fr30-ibld.c:179 frv-ibld.c:179 ip2k-ibld.c:179 iq2000-ibld.c:179
#: m32r-ibld.c:179 openrisc-ibld.c:179 xstormy16-ibld.c:179
#, c-format
msgid "operand out of range (%lu not between 0 and %lu)"
-msgstr "opérande hors gamme (%lu n'est pas entre 0 et %lu)"
+msgstr "opérande hors limite (%lu n'est pas entre 0 et %lu)"
#: fr30-ibld.c:730 frv-ibld.c:829 ip2k-ibld.c:607 iq2000-ibld.c:713
#: m32r-ibld.c:659 openrisc-ibld.c:633 xstormy16-ibld.c:678
@@ -358,13 +358,13 @@ msgstr "décalage(IP) n'a pas un format valide"
#. of range.
#: ip2k-asm.c:175
msgid "(DP) offset out of range."
-msgstr "décalage (DP) est hors gamme."
+msgstr "décalage (DP) est hors limite."
#. Found something there in front of (SP) but it's out
#. of range.
#: ip2k-asm.c:221
msgid "(SP) offset out of range."
-msgstr "décalage (SP) est hors gamme."
+msgstr "décalage (SP) est hors limite."
#: ip2k-asm.c:241
msgid "illegal use of parentheses"
@@ -372,7 +372,7 @@ msgstr "usage illégal des parenthèses"
#: ip2k-asm.c:248
msgid "operand out of range (not between 1 and 255)"
-msgstr "opérande hors gamme (n'est pas entre 1 et 255)"
+msgstr "opérande hors limite (n'est pas entre 1 et 255)"
#. Something is very wrong. opindex has to be one of the above.
#: ip2k-asm.c:273
@@ -402,11 +402,11 @@ msgstr "valeur immédiate doit être un registre"
#: iq2000-asm.c:120 iq2000-asm.c:151
msgid "immediate value out of range"
-msgstr "valeur immédiate est hors gamme"
+msgstr "valeur immédiate est hors limite"
#: iq2000-asm.c:180
msgid "21-bit offset out of range"
-msgstr "décalage de 21 bits est hors gamme"
+msgstr "décalage de 21 bits est hors limite"
#: iq2000-asm.c:205 iq2000-asm.c:235 iq2000-asm.c:272 iq2000-asm.c:305
#: openrisc-asm.c:96 openrisc-asm.c:155
@@ -647,7 +647,7 @@ msgstr "masque de bits illégal"
#: ppc-opc.c:1192
msgid "value out of range"
-msgstr "valeur hors gamme"
+msgstr "valeur hors limite"
#: ppc-opc.c:1262
msgid "index register in load range"
@@ -706,11 +706,11 @@ msgstr "registre de pile inconnu: %d\n"
#. specific command line option is given to GAS.
#: v850-opc.c:68
msgid "displacement value is not in range and is not aligned"
-msgstr "La valeur de déplacement est hors gamme et n'est pas alignée."
+msgstr "La valeur de déplacement est hors limite et n'est pas alignée."
#: v850-opc.c:69
msgid "displacement value is out of range"
-msgstr "valeur de déplacement est hors gamme"
+msgstr "valeur de déplacement est hors limite"
#: v850-opc.c:70
msgid "displacement value is not aligned"
@@ -718,15 +718,15 @@ msgstr "valeur de déplacement n'est pas alignée"
#: v850-opc.c:72
msgid "immediate value is out of range"
-msgstr "valeur immédiate est hors gamme"
+msgstr "valeur immédiate est hors limite"
#: v850-opc.c:83
msgid "branch value not in range and to odd offset"
-msgstr "valeur de branchement est hors gamme et a un décalage impair"
+msgstr "valeur de branchement est hors limite et a un décalage impair"
#: v850-opc.c:85 v850-opc.c:117
msgid "branch value out of range"
-msgstr "valeur de branchement hors gamme"
+msgstr "valeur de branchement hors limite"
#: v850-opc.c:88 v850-opc.c:120
msgid "branch to odd offset"
@@ -734,7 +734,7 @@ msgstr "Branchement avec un décalage impair"
#: v850-opc.c:115
msgid "branch value not in range and to an odd offset"
-msgstr "valeur de branchement est hors gamme et a un décalage impair"
+msgstr "valeur de branchement est hors limite et a un décalage impair"
#: v850-opc.c:346
msgid "invalid register for stack adjustment"
@@ -742,7 +742,7 @@ msgstr "registre invalide pour un ajustement de la pile"
#: v850-opc.c:370
msgid "immediate value not in range and not even"
-msgstr "valeur immédiate est hors gamme et est impaire"
+msgstr "valeur immédiate est hors limite et est impaire"
#: v850-opc.c:375
msgid "immediate value must be even"
diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c
index b8b8b1ad592..76af4e7af12 100644
--- a/opcodes/ppc-dis.c
+++ b/opcodes/ppc-dis.c
@@ -30,18 +30,19 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
in both big and little endian mode and also for the POWER (RS/6000)
chip. */
-static int print_insn_powerpc PARAMS ((bfd_vma, struct disassemble_info *,
- int bigendian, int dialect));
+static int print_insn_powerpc (bfd_vma, struct disassemble_info *, int, int);
-static int powerpc_dialect PARAMS ((struct disassemble_info *));
+struct dis_private {
+ /* Stash the result of parsing disassembler_options here. */
+ int dialect;
+};
/* Determine which set of machines to disassemble for. PPC403/601 or
BookE. For convenience, also disassemble instructions supported
by the AltiVec vector unit. */
-int
-powerpc_dialect(info)
- struct disassemble_info *info;
+static int
+powerpc_dialect (struct disassemble_info *info)
{
int dialect = PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC;
@@ -49,40 +50,39 @@ powerpc_dialect(info)
dialect |= PPC_OPCODE_64;
if (info->disassembler_options
- && (strcmp (info->disassembler_options, "booke") == 0
- || strcmp (info->disassembler_options, "booke32") == 0
- || strcmp (info->disassembler_options, "booke64") == 0))
+ && strstr (info->disassembler_options, "booke") != NULL)
dialect |= PPC_OPCODE_BOOKE | PPC_OPCODE_BOOKE64;
- else
- if ((info->mach == bfd_mach_ppc_e500)
- || (info->disassembler_options
- && ( strcmp (info->disassembler_options, "e500") == 0
- || strcmp (info->disassembler_options, "e500x2") == 0)))
- {
- dialect |= PPC_OPCODE_BOOKE
- | PPC_OPCODE_SPE | PPC_OPCODE_ISEL
- | PPC_OPCODE_EFS | PPC_OPCODE_BRLOCK
- | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK
- | PPC_OPCODE_RFMCI;
- /* efs* and AltiVec conflict. */
- dialect &= ~PPC_OPCODE_ALTIVEC;
- }
- else
- if (info->disassembler_options
- && (strcmp (info->disassembler_options, "efs") == 0))
- {
- dialect |= PPC_OPCODE_EFS;
- /* efs* and AltiVec conflict. */
- dialect &= ~PPC_OPCODE_ALTIVEC;
- }
+ else if ((info->mach == bfd_mach_ppc_e500)
+ || (info->disassembler_options
+ && strstr (info->disassembler_options, "e500") != NULL))
+ {
+ dialect |= PPC_OPCODE_BOOKE
+ | PPC_OPCODE_SPE | PPC_OPCODE_ISEL
+ | PPC_OPCODE_EFS | PPC_OPCODE_BRLOCK
+ | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK
+ | PPC_OPCODE_RFMCI;
+ /* efs* and AltiVec conflict. */
+ dialect &= ~PPC_OPCODE_ALTIVEC;
+ }
+ else if (info->disassembler_options
+ && strstr (info->disassembler_options, "efs") != NULL)
+ {
+ dialect |= PPC_OPCODE_EFS;
+ /* efs* and AltiVec conflict. */
+ dialect &= ~PPC_OPCODE_ALTIVEC;
+ }
else
dialect |= (PPC_OPCODE_403 | PPC_OPCODE_601 | PPC_OPCODE_CLASSIC
| PPC_OPCODE_COMMON);
if (info->disassembler_options
- && strcmp (info->disassembler_options, "power4") == 0)
+ && strstr (info->disassembler_options, "power4") != NULL)
dialect |= PPC_OPCODE_POWER4;
+ if (info->disassembler_options
+ && strstr (info->disassembler_options, "any") != NULL)
+ dialect |= PPC_OPCODE_ANY;
+
if (info->disassembler_options)
{
if (strstr (info->disassembler_options, "32") != NULL)
@@ -91,35 +91,32 @@ powerpc_dialect(info)
dialect |= PPC_OPCODE_64;
}
+ ((struct dis_private *) &info->private_data)->dialect = dialect;
return dialect;
}
/* Print a big endian PowerPC instruction. */
int
-print_insn_big_powerpc (memaddr, info)
- bfd_vma memaddr;
- struct disassemble_info *info;
+print_insn_big_powerpc (bfd_vma memaddr, struct disassemble_info *info)
{
- return print_insn_powerpc (memaddr, info, 1, powerpc_dialect(info));
+ int dialect = ((struct dis_private *) &info->private_data)->dialect;
+ return print_insn_powerpc (memaddr, info, 1, dialect);
}
/* Print a little endian PowerPC instruction. */
int
-print_insn_little_powerpc (memaddr, info)
- bfd_vma memaddr;
- struct disassemble_info *info;
+print_insn_little_powerpc (bfd_vma memaddr, struct disassemble_info *info)
{
- return print_insn_powerpc (memaddr, info, 0, powerpc_dialect(info));
+ int dialect = ((struct dis_private *) &info->private_data)->dialect;
+ return print_insn_powerpc (memaddr, info, 0, dialect);
}
/* Print a POWER (RS/6000) instruction. */
int
-print_insn_rs6000 (memaddr, info)
- bfd_vma memaddr;
- struct disassemble_info *info;
+print_insn_rs6000 (bfd_vma memaddr, struct disassemble_info *info)
{
return print_insn_powerpc (memaddr, info, 1, PPC_OPCODE_POWER);
}
@@ -127,11 +124,10 @@ print_insn_rs6000 (memaddr, info)
/* Print a PowerPC or POWER instruction. */
static int
-print_insn_powerpc (memaddr, info, bigendian, dialect)
- bfd_vma memaddr;
- struct disassemble_info *info;
- int bigendian;
- int dialect;
+print_insn_powerpc (bfd_vma memaddr,
+ struct disassemble_info *info,
+ int bigendian,
+ int dialect)
{
bfd_byte buffer[4];
int status;
@@ -140,6 +136,9 @@ print_insn_powerpc (memaddr, info, bigendian, dialect)
const struct powerpc_opcode *opcode_end;
unsigned long op;
+ if (dialect == 0)
+ dialect = powerpc_dialect (info);
+
status = (*info->read_memory_func) (memaddr, buffer, 4, info);
if (status != 0)
{
@@ -158,6 +157,7 @@ print_insn_powerpc (memaddr, info, bigendian, dialect)
/* Find the first match in the opcode table. We could speed this up
a bit by doing a binary search on the major opcode. */
opcode_end = powerpc_opcodes + powerpc_num_opcodes;
+ again:
for (opcode = powerpc_opcodes; opcode < opcode_end; opcode++)
{
unsigned long table_op;
@@ -177,9 +177,6 @@ print_insn_powerpc (memaddr, info, bigendian, dialect)
|| (opcode->flags & dialect) == 0)
continue;
- if ((dialect & PPC_OPCODE_EFS) && (opcode->flags & PPC_OPCODE_ALTIVEC))
- continue;
-
/* Make two passes over the operands. First see if any of them
have extraction functions, and, if they do, make sure the
instruction is valid. */
@@ -288,6 +285,12 @@ print_insn_powerpc (memaddr, info, bigendian, dialect)
return 4;
}
+ if ((dialect & PPC_OPCODE_ANY) != 0)
+ {
+ dialect = ~PPC_OPCODE_ANY;
+ goto again;
+ }
+
/* We could not find a match. */
(*info->fprintf_func) (info->stream, ".long 0x%lx", insn);
@@ -295,7 +298,7 @@ print_insn_powerpc (memaddr, info, bigendian, dialect)
}
void
-print_ppc_disassembler_options (FILE * stream)
+print_ppc_disassembler_options (FILE *stream)
{
fprintf (stream, "\n\
The following PPC specific disassembler options are supported for use with\n\
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index 0f04cfb8468..c37943bd149 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -1001,7 +1001,8 @@ insert_fxm (unsigned long insn,
;
/* If only one bit of the FXM field is set, we can use the new form
- of the instruction, which is faster. */
+ of the instruction, which is faster. Unlike the Power4 branch hint
+ encoding, this is not backward compatible. */
else if ((dialect & PPC_OPCODE_POWER4) != 0 && (value & -value) == value)
insn |= 1 << 20;
@@ -1762,26 +1763,26 @@ extract_tbr (unsigned long insn,
/* Smaller names for the flags so each entry in the opcodes table will
fit on a single line. */
#undef PPC
-#define PPC PPC_OPCODE_PPC | PPC_OPCODE_ANY
-#define PPCCOM PPC_OPCODE_PPC | PPC_OPCODE_COMMON | PPC_OPCODE_ANY
+#define PPC PPC_OPCODE_PPC
+#define PPCCOM PPC_OPCODE_PPC | PPC_OPCODE_COMMON
#define NOPOWER4 PPC_OPCODE_NOPOWER4 | PPCCOM
-#define POWER4 PPC_OPCODE_POWER4 | PPCCOM
-#define PPC32 PPC_OPCODE_32 | PPC_OPCODE_PPC | PPC_OPCODE_ANY
-#define PPC64 PPC_OPCODE_64 | PPC_OPCODE_PPC | PPC_OPCODE_ANY
-#define PPCONLY PPC_OPCODE_PPC
+#define POWER4 PPC_OPCODE_POWER4
+#define PPC32 PPC_OPCODE_32 | PPC_OPCODE_PPC
+#define PPC64 PPC_OPCODE_64 | PPC_OPCODE_PPC
#define PPC403 PPC_OPCODE_403
#define PPC405 PPC403
+#define PPC440 PPC_OPCODE_440
#define PPC750 PPC
#define PPC860 PPC
-#define PPCVEC PPC_OPCODE_ALTIVEC | PPC_OPCODE_ANY | PPC_OPCODE_PPC
-#define POWER PPC_OPCODE_POWER | PPC_OPCODE_ANY
-#define POWER2 PPC_OPCODE_POWER | PPC_OPCODE_POWER2 | PPC_OPCODE_ANY
-#define PPCPWR2 PPC_OPCODE_PPC | PPC_OPCODE_POWER | PPC_OPCODE_POWER2 | PPC_OPCODE_ANY
-#define POWER32 PPC_OPCODE_POWER | PPC_OPCODE_ANY | PPC_OPCODE_32
-#define COM PPC_OPCODE_POWER | PPC_OPCODE_PPC | PPC_OPCODE_COMMON | PPC_OPCODE_ANY
-#define COM32 PPC_OPCODE_POWER | PPC_OPCODE_PPC | PPC_OPCODE_COMMON | PPC_OPCODE_ANY | PPC_OPCODE_32
-#define M601 PPC_OPCODE_POWER | PPC_OPCODE_601 | PPC_OPCODE_ANY
-#define PWRCOM PPC_OPCODE_POWER | PPC_OPCODE_601 | PPC_OPCODE_COMMON | PPC_OPCODE_ANY
+#define PPCVEC PPC_OPCODE_ALTIVEC | PPC_OPCODE_PPC
+#define POWER PPC_OPCODE_POWER
+#define POWER2 PPC_OPCODE_POWER | PPC_OPCODE_POWER2
+#define PPCPWR2 PPC_OPCODE_PPC | PPC_OPCODE_POWER | PPC_OPCODE_POWER2
+#define POWER32 PPC_OPCODE_POWER | PPC_OPCODE_32
+#define COM PPC_OPCODE_POWER | PPC_OPCODE_PPC | PPC_OPCODE_COMMON
+#define COM32 PPC_OPCODE_POWER | PPC_OPCODE_PPC | PPC_OPCODE_COMMON | PPC_OPCODE_32
+#define M601 PPC_OPCODE_POWER | PPC_OPCODE_601
+#define PWRCOM PPC_OPCODE_POWER | PPC_OPCODE_601 | PPC_OPCODE_COMMON
#define MFDEC1 PPC_OPCODE_POWER
#define MFDEC2 PPC_OPCODE_PPC | PPC_OPCODE_601 | PPC_OPCODE_BOOKE
#define BOOKE PPC_OPCODE_BOOKE
@@ -1863,90 +1864,90 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "twi", OP(3), OP_MASK, PPCCOM, { TO, RA, SI } },
{ "ti", OP(3), OP_MASK, PWRCOM, { TO, RA, SI } },
-{ "macchw", XO(4,172,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchw.", XO(4,172,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwo", XO(4,172,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwo.", XO(4,172,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchws", XO(4,236,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchws.", XO(4,236,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwso", XO(4,236,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwso.", XO(4,236,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwsu", XO(4,204,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwsu.", XO(4,204,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwsuo", XO(4,204,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwsuo.", XO(4,204,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwu", XO(4,140,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwu.", XO(4,140,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwuo", XO(4,140,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "macchwuo.", XO(4,140,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhw", XO(4,44,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhw.", XO(4,44,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwo", XO(4,44,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwo.", XO(4,44,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhws", XO(4,108,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhws.", XO(4,108,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwso", XO(4,108,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwso.", XO(4,108,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwsu", XO(4,76,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwsu.", XO(4,76,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwsuo", XO(4,76,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwsuo.", XO(4,76,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwu", XO(4,12,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwu.", XO(4,12,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwuo", XO(4,12,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "machhwuo.", XO(4,12,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhw", XO(4,428,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhw.", XO(4,428,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwo", XO(4,428,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwo.", XO(4,428,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhws", XO(4,492,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhws.", XO(4,492,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwso", XO(4,492,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwso.", XO(4,492,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwsu", XO(4,460,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwsu.", XO(4,460,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwsuo", XO(4,460,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwsuo.", XO(4,460,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwu", XO(4,396,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwu.", XO(4,396,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwuo", XO(4,396,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "maclhwuo.", XO(4,396,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "mulchw", XRC(4,168,0), X_MASK, PPC405, { RT, RA, RB } },
-{ "mulchw.", XRC(4,168,1), X_MASK, PPC405, { RT, RA, RB } },
-{ "mulchwu", XRC(4,136,0), X_MASK, PPC405, { RT, RA, RB } },
-{ "mulchwu.", XRC(4,136,1), X_MASK, PPC405, { RT, RA, RB } },
-{ "mulhhw", XRC(4,40,0), X_MASK, PPC405, { RT, RA, RB } },
-{ "mulhhw.", XRC(4,40,1), X_MASK, PPC405, { RT, RA, RB } },
-{ "mulhhwu", XRC(4,8,0), X_MASK, PPC405, { RT, RA, RB } },
-{ "mulhhwu.", XRC(4,8,1), X_MASK, PPC405, { RT, RA, RB } },
-{ "mullhw", XRC(4,424,0), X_MASK, PPC405, { RT, RA, RB } },
-{ "mullhw.", XRC(4,424,1), X_MASK, PPC405, { RT, RA, RB } },
-{ "mullhwu", XRC(4,392,0), X_MASK, PPC405, { RT, RA, RB } },
-{ "mullhwu.", XRC(4,392,1), X_MASK, PPC405, { RT, RA, RB } },
-{ "nmacchw", XO(4,174,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmacchw.", XO(4,174,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmacchwo", XO(4,174,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmacchwo.", XO(4,174,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmacchws", XO(4,238,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmacchws.", XO(4,238,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmacchwso", XO(4,238,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmacchwso.", XO(4,238,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmachhw", XO(4,46,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmachhw.", XO(4,46,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmachhwo", XO(4,46,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmachhwo.", XO(4,46,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmachhws", XO(4,110,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmachhws.", XO(4,110,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmachhwso", XO(4,110,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmachhwso.", XO(4,110,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmaclhw", XO(4,430,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmaclhw.", XO(4,430,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmaclhwo", XO(4,430,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmaclhwo.", XO(4,430,1,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmaclhws", XO(4,494,0,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmaclhws.", XO(4,494,0,1), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmaclhwso", XO(4,494,1,0), XO_MASK, PPC405, { RT, RA, RB } },
-{ "nmaclhwso.", XO(4,494,1,1), XO_MASK, PPC405, { RT, RA, RB } },
+{ "macchw", XO(4,172,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchw.", XO(4,172,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwo", XO(4,172,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwo.", XO(4,172,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchws", XO(4,236,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchws.", XO(4,236,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwso", XO(4,236,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwso.", XO(4,236,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwsu", XO(4,204,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwsu.", XO(4,204,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwsuo", XO(4,204,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwsuo.", XO(4,204,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwu", XO(4,140,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwu.", XO(4,140,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwuo", XO(4,140,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "macchwuo.", XO(4,140,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhw", XO(4,44,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhw.", XO(4,44,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwo", XO(4,44,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwo.", XO(4,44,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhws", XO(4,108,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhws.", XO(4,108,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwso", XO(4,108,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwso.", XO(4,108,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwsu", XO(4,76,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwsu.", XO(4,76,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwsuo", XO(4,76,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwsuo.", XO(4,76,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwu", XO(4,12,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwu.", XO(4,12,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwuo", XO(4,12,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "machhwuo.", XO(4,12,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhw", XO(4,428,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhw.", XO(4,428,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwo", XO(4,428,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwo.", XO(4,428,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhws", XO(4,492,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhws.", XO(4,492,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwso", XO(4,492,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwso.", XO(4,492,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwsu", XO(4,460,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwsu.", XO(4,460,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwsuo", XO(4,460,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwsuo.", XO(4,460,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwu", XO(4,396,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwu.", XO(4,396,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwuo", XO(4,396,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "maclhwuo.", XO(4,396,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mulchw", XRC(4,168,0), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mulchw.", XRC(4,168,1), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mulchwu", XRC(4,136,0), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mulchwu.", XRC(4,136,1), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mulhhw", XRC(4,40,0), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mulhhw.", XRC(4,40,1), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mulhhwu", XRC(4,8,0), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mulhhwu.", XRC(4,8,1), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mullhw", XRC(4,424,0), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mullhw.", XRC(4,424,1), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mullhwu", XRC(4,392,0), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "mullhwu.", XRC(4,392,1), X_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmacchw", XO(4,174,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmacchw.", XO(4,174,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmacchwo", XO(4,174,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmacchwo.", XO(4,174,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmacchws", XO(4,238,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmacchws.", XO(4,238,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmacchwso", XO(4,238,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmacchwso.", XO(4,238,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmachhw", XO(4,46,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmachhw.", XO(4,46,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmachhwo", XO(4,46,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmachhwo.", XO(4,46,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmachhws", XO(4,110,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmachhws.", XO(4,110,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmachhwso", XO(4,110,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmachhwso.", XO(4,110,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmaclhw", XO(4,430,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmaclhw.", XO(4,430,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmaclhwo", XO(4,430,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmaclhwo.", XO(4,430,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmaclhws", XO(4,494,0,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmaclhws.", XO(4,494,0,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmaclhwso", XO(4,494,1,0), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
+{ "nmaclhwso.", XO(4,494,1,1), XO_MASK, PPC405|PPC440, { RT, RA, RB } },
{ "mfvscr", VX(4, 1540), VX_MASK, PPCVEC, { VD } },
{ "mtvscr", VX(4, 1604), VX_MASK, PPCVEC, { VB } },
{ "vaddcuw", VX(4, 384), VX_MASK, PPCVEC, { VD, VA, VB } },
@@ -2368,12 +2369,12 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "cmplwi", OPL(10,0), OPL_MASK, PPCCOM, { OBF, RA, UI } },
{ "cmpldi", OPL(10,1), OPL_MASK, PPC64, { OBF, RA, UI } },
-{ "cmpli", OP(10), OP_MASK, PPCONLY, { BF, L, RA, UI } },
+{ "cmpli", OP(10), OP_MASK, PPC, { BF, L, RA, UI } },
{ "cmpli", OP(10), OP_MASK, PWRCOM, { BF, RA, UI } },
{ "cmpwi", OPL(11,0), OPL_MASK, PPCCOM, { OBF, RA, SI } },
{ "cmpdi", OPL(11,1), OPL_MASK, PPC64, { OBF, RA, SI } },
-{ "cmpi", OP(11), OP_MASK, PPCONLY, { BF, L, RA, SI } },
+{ "cmpi", OP(11), OP_MASK, PPC, { BF, L, RA, SI } },
{ "cmpi", OP(11), OP_MASK, PWRCOM, { BF, RA, SI } },
{ "addic", OP(12), OP_MASK, PPCCOM, { RT, RA, SI } },
@@ -2681,186 +2682,186 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "brl", XLO(19,BOU,16,1), XLBOBIBB_MASK, PWRCOM, { 0 } },
{ "bdnzlr", XLO(19,BODNZ,16,0), XLBOBIBB_MASK, PPCCOM, { 0 } },
{ "bdnzlr-", XLO(19,BODNZ,16,0), XLBOBIBB_MASK, NOPOWER4, { 0 } },
-{ "bdnzlr+", XLO(19,BODNZP,16,0), XLBOBIBB_MASK, NOPOWER4, { 0 } },
{ "bdnzlr-", XLO(19,BODNZM4,16,0), XLBOBIBB_MASK, POWER4, { 0 } },
+{ "bdnzlr+", XLO(19,BODNZP,16,0), XLBOBIBB_MASK, NOPOWER4, { 0 } },
{ "bdnzlr+", XLO(19,BODNZP4,16,0), XLBOBIBB_MASK, POWER4, { 0 } },
{ "bdnzlrl", XLO(19,BODNZ,16,1), XLBOBIBB_MASK, PPCCOM, { 0 } },
{ "bdnzlrl-",XLO(19,BODNZ,16,1), XLBOBIBB_MASK, NOPOWER4, { 0 } },
-{ "bdnzlrl+",XLO(19,BODNZP,16,1), XLBOBIBB_MASK, NOPOWER4, { 0 } },
{ "bdnzlrl-",XLO(19,BODNZM4,16,1), XLBOBIBB_MASK, POWER4, { 0 } },
+{ "bdnzlrl+",XLO(19,BODNZP,16,1), XLBOBIBB_MASK, NOPOWER4, { 0 } },
{ "bdnzlrl+",XLO(19,BODNZP4,16,1), XLBOBIBB_MASK, POWER4, { 0 } },
{ "bdzlr", XLO(19,BODZ,16,0), XLBOBIBB_MASK, PPCCOM, { 0 } },
{ "bdzlr-", XLO(19,BODZ,16,0), XLBOBIBB_MASK, NOPOWER4, { 0 } },
-{ "bdzlr+", XLO(19,BODZP,16,0), XLBOBIBB_MASK, NOPOWER4, { 0 } },
{ "bdzlr-", XLO(19,BODZM4,16,0), XLBOBIBB_MASK, POWER4, { 0 } },
+{ "bdzlr+", XLO(19,BODZP,16,0), XLBOBIBB_MASK, NOPOWER4, { 0 } },
{ "bdzlr+", XLO(19,BODZP4,16,0), XLBOBIBB_MASK, POWER4, { 0 } },
{ "bdzlrl", XLO(19,BODZ,16,1), XLBOBIBB_MASK, PPCCOM, { 0 } },
{ "bdzlrl-", XLO(19,BODZ,16,1), XLBOBIBB_MASK, NOPOWER4, { 0 } },
-{ "bdzlrl+", XLO(19,BODZP,16,1), XLBOBIBB_MASK, NOPOWER4, { 0 } },
{ "bdzlrl-", XLO(19,BODZM4,16,1), XLBOBIBB_MASK, POWER4, { 0 } },
+{ "bdzlrl+", XLO(19,BODZP,16,1), XLBOBIBB_MASK, NOPOWER4, { 0 } },
{ "bdzlrl+", XLO(19,BODZP4,16,1), XLBOBIBB_MASK, POWER4, { 0 } },
{ "bltlr", XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bltlr-", XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bltlr+", XLOCB(19,BOTP,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bltlr-", XLOCB(19,BOTM4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bltlr+", XLOCB(19,BOTP,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bltlr+", XLOCB(19,BOTP4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bltr", XLOCB(19,BOT,CBLT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bltlrl", XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bltlrl-", XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bltlrl+", XLOCB(19,BOTP,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bltlrl-", XLOCB(19,BOTM4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bltlrl+", XLOCB(19,BOTP,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bltlrl+", XLOCB(19,BOTP4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bltrl", XLOCB(19,BOT,CBLT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bgtlr", XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bgtlr-", XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bgtlr+", XLOCB(19,BOTP,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgtlr-", XLOCB(19,BOTM4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtlr+", XLOCB(19,BOTP,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgtlr+", XLOCB(19,BOTP4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bgtr", XLOCB(19,BOT,CBGT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bgtlrl", XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bgtlrl-", XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bgtlrl+", XLOCB(19,BOTP,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgtlrl-", XLOCB(19,BOTM4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtlrl+", XLOCB(19,BOTP,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgtlrl+", XLOCB(19,BOTP4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bgtrl", XLOCB(19,BOT,CBGT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "beqlr", XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "beqlr-", XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "beqlr+", XLOCB(19,BOTP,CBEQ,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "beqlr-", XLOCB(19,BOTM4,CBEQ,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqlr+", XLOCB(19,BOTP,CBEQ,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "beqlr+", XLOCB(19,BOTP4,CBEQ,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "beqr", XLOCB(19,BOT,CBEQ,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "beqlrl", XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "beqlrl-", XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "beqlrl+", XLOCB(19,BOTP,CBEQ,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "beqlrl-", XLOCB(19,BOTM4,CBEQ,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqlrl+", XLOCB(19,BOTP,CBEQ,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "beqlrl+", XLOCB(19,BOTP4,CBEQ,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "beqrl", XLOCB(19,BOT,CBEQ,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bsolr", XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bsolr-", XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bsolr+", XLOCB(19,BOTP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bsolr-", XLOCB(19,BOTM4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsolr+", XLOCB(19,BOTP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bsolr+", XLOCB(19,BOTP4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bsor", XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bsolrl", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bsolrl-", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bsolrl+", XLOCB(19,BOTP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bsolrl-", XLOCB(19,BOTM4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsolrl+", XLOCB(19,BOTP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bsolrl+", XLOCB(19,BOTP4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bsorl", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bunlr", XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bunlr-", XLOCB(19,BOT,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bunlr+", XLOCB(19,BOTP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bunlr-", XLOCB(19,BOTM4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bunlr+", XLOCB(19,BOTP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bunlr+", XLOCB(19,BOTP4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bunlrl", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bunlrl-", XLOCB(19,BOT,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bunlrl+", XLOCB(19,BOTP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bunlrl-", XLOCB(19,BOTM4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bunlrl+", XLOCB(19,BOTP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bunlrl+", XLOCB(19,BOTP4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bgelr", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bgelr-", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bgelr+", XLOCB(19,BOFP,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgelr-", XLOCB(19,BOFM4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgelr+", XLOCB(19,BOFP,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgelr+", XLOCB(19,BOFP4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bger", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bgelrl", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bgelrl-", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bgelrl+", XLOCB(19,BOFP,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgelrl-", XLOCB(19,BOFM4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgelrl+", XLOCB(19,BOFP,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgelrl+", XLOCB(19,BOFP4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bgerl", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bnllr", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnllr-", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnllr+", XLOCB(19,BOFP,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnllr-", XLOCB(19,BOFM4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnllr+", XLOCB(19,BOFP,CBLT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnllr+", XLOCB(19,BOFP4,CBLT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnlr", XLOCB(19,BOF,CBLT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bnllrl", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnllrl-", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnllrl+", XLOCB(19,BOFP,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnllrl-", XLOCB(19,BOFM4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnllrl+", XLOCB(19,BOFP,CBLT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnllrl+", XLOCB(19,BOFP4,CBLT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnlrl", XLOCB(19,BOF,CBLT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "blelr", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "blelr-", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "blelr+", XLOCB(19,BOFP,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "blelr-", XLOCB(19,BOFM4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "blelr+", XLOCB(19,BOFP,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "blelr+", XLOCB(19,BOFP4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bler", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "blelrl", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "blelrl-", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "blelrl+", XLOCB(19,BOFP,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "blelrl-", XLOCB(19,BOFM4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "blelrl+", XLOCB(19,BOFP,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "blelrl+", XLOCB(19,BOFP4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "blerl", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bnglr", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnglr-", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnglr+", XLOCB(19,BOFP,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnglr-", XLOCB(19,BOFM4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnglr+", XLOCB(19,BOFP,CBGT,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnglr+", XLOCB(19,BOFP4,CBGT,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bngr", XLOCB(19,BOF,CBGT,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bnglrl", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnglrl-", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnglrl+", XLOCB(19,BOFP,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnglrl-", XLOCB(19,BOFM4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnglrl+", XLOCB(19,BOFP,CBGT,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnglrl+", XLOCB(19,BOFP4,CBGT,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bngrl", XLOCB(19,BOF,CBGT,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bnelr", XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnelr-", XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnelr+", XLOCB(19,BOFP,CBEQ,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnelr-", XLOCB(19,BOFM4,CBEQ,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnelr+", XLOCB(19,BOFP,CBEQ,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnelr+", XLOCB(19,BOFP4,CBEQ,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bner", XLOCB(19,BOF,CBEQ,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bnelrl", XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnelrl-", XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnelrl+", XLOCB(19,BOFP,CBEQ,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnelrl-", XLOCB(19,BOFM4,CBEQ,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnelrl+", XLOCB(19,BOFP,CBEQ,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnelrl+", XLOCB(19,BOFP4,CBEQ,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnerl", XLOCB(19,BOF,CBEQ,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bnslr", XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnslr-", XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnslr+", XLOCB(19,BOFP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnslr-", XLOCB(19,BOFM4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnslr+", XLOCB(19,BOFP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnslr+", XLOCB(19,BOFP4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnsr", XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bnslrl", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnslrl-", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnslrl+", XLOCB(19,BOFP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnslrl-", XLOCB(19,BOFM4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnslrl+", XLOCB(19,BOFP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnslrl+", XLOCB(19,BOFP4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnsrl", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PWRCOM, { CR } },
{ "bnulr", XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnulr-", XLOCB(19,BOF,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnulr+", XLOCB(19,BOFP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnulr-", XLOCB(19,BOFM4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnulr+", XLOCB(19,BOFP,CBSO,16,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnulr+", XLOCB(19,BOFP4,CBSO,16,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnulrl", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnulrl-", XLOCB(19,BOF,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnulrl+", XLOCB(19,BOFP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnulrl-", XLOCB(19,BOFM4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnulrl+", XLOCB(19,BOFP,CBSO,16,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnulrl+", XLOCB(19,BOFP4,CBSO,16,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "btlr", XLO(19,BOT,16,0), XLBOBB_MASK, PPCCOM, { BI } },
{ "btlr-", XLO(19,BOT,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
-{ "btlr+", XLO(19,BOTP,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
{ "btlr-", XLO(19,BOTM4,16,0), XLBOBB_MASK, POWER4, { BI } },
+{ "btlr+", XLO(19,BOTP,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
{ "btlr+", XLO(19,BOTP4,16,0), XLBOBB_MASK, POWER4, { BI } },
{ "bbtr", XLO(19,BOT,16,0), XLBOBB_MASK, PWRCOM, { BI } },
{ "btlrl", XLO(19,BOT,16,1), XLBOBB_MASK, PPCCOM, { BI } },
{ "btlrl-", XLO(19,BOT,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
-{ "btlrl+", XLO(19,BOTP,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
{ "btlrl-", XLO(19,BOTM4,16,1), XLBOBB_MASK, POWER4, { BI } },
+{ "btlrl+", XLO(19,BOTP,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
{ "btlrl+", XLO(19,BOTP4,16,1), XLBOBB_MASK, POWER4, { BI } },
{ "bbtrl", XLO(19,BOT,16,1), XLBOBB_MASK, PWRCOM, { BI } },
{ "bflr", XLO(19,BOF,16,0), XLBOBB_MASK, PPCCOM, { BI } },
{ "bflr-", XLO(19,BOF,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
-{ "bflr+", XLO(19,BOFP,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
{ "bflr-", XLO(19,BOFM4,16,0), XLBOBB_MASK, POWER4, { BI } },
+{ "bflr+", XLO(19,BOFP,16,0), XLBOBB_MASK, NOPOWER4, { BI } },
{ "bflr+", XLO(19,BOFP4,16,0), XLBOBB_MASK, POWER4, { BI } },
{ "bbfr", XLO(19,BOF,16,0), XLBOBB_MASK, PWRCOM, { BI } },
{ "bflrl", XLO(19,BOF,16,1), XLBOBB_MASK, PPCCOM, { BI } },
{ "bflrl-", XLO(19,BOF,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
-{ "bflrl+", XLO(19,BOFP,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
{ "bflrl-", XLO(19,BOFM4,16,1), XLBOBB_MASK, POWER4, { BI } },
+{ "bflrl+", XLO(19,BOFP,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
{ "bflrl+", XLO(19,BOFP4,16,1), XLBOBB_MASK, POWER4, { BI } },
{ "bbfrl", XLO(19,BOF,16,1), XLBOBB_MASK, PWRCOM, { BI } },
{ "bdnztlr", XLO(19,BODNZT,16,0), XLBOBB_MASK, PPCCOM, { BI } },
@@ -2905,8 +2906,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "rfmci", X(19,38), 0xffffffff, PPCRFMCI, { 0 } },
{ "rfi", XL(19,50), 0xffffffff, COM, { 0 } },
-{ "rfci", XL(19,51), 0xffffffff, PPC403, { 0 } },
-{ "rfci", XL(19,51), 0xffffffff, BOOKE, { 0 } },
+{ "rfci", XL(19,51), 0xffffffff, PPC403 | BOOKE, { 0 } },
{ "rfsvc", XL(19,82), 0xffffffff, POWER, { 0 } },
@@ -2934,143 +2934,143 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "bctrl", XLO(19,BOU,528,1), XLBOBIBB_MASK, COM, { 0 } },
{ "bltctr", XLOCB(19,BOT,CBLT,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bltctr-", XLOCB(19,BOT,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bltctr+", XLOCB(19,BOTP,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bltctr-", XLOCB(19,BOTM4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bltctr+", XLOCB(19,BOTP,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bltctr+", XLOCB(19,BOTP4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bltctrl", XLOCB(19,BOT,CBLT,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bltctrl-",XLOCB(19,BOT,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bltctrl+",XLOCB(19,BOTP,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bltctrl-",XLOCB(19,BOTM4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bltctrl+",XLOCB(19,BOTP,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bltctrl+",XLOCB(19,BOTP4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bgtctr", XLOCB(19,BOT,CBGT,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bgtctr-", XLOCB(19,BOT,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bgtctr+", XLOCB(19,BOTP,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgtctr-", XLOCB(19,BOTM4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtctr+", XLOCB(19,BOTP,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgtctr+", XLOCB(19,BOTP4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bgtctrl", XLOCB(19,BOT,CBGT,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bgtctrl-",XLOCB(19,BOT,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bgtctrl+",XLOCB(19,BOTP,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgtctrl-",XLOCB(19,BOTM4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgtctrl+",XLOCB(19,BOTP,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgtctrl+",XLOCB(19,BOTP4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "beqctr", XLOCB(19,BOT,CBEQ,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "beqctr-", XLOCB(19,BOT,CBEQ,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "beqctr+", XLOCB(19,BOTP,CBEQ,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "beqctr-", XLOCB(19,BOTM4,CBEQ,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqctr+", XLOCB(19,BOTP,CBEQ,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "beqctr+", XLOCB(19,BOTP4,CBEQ,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "beqctrl", XLOCB(19,BOT,CBEQ,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "beqctrl-",XLOCB(19,BOT,CBEQ,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "beqctrl+",XLOCB(19,BOTP,CBEQ,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "beqctrl-",XLOCB(19,BOTM4,CBEQ,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "beqctrl+",XLOCB(19,BOTP,CBEQ,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "beqctrl+",XLOCB(19,BOTP4,CBEQ,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bsoctr", XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bsoctr-", XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bsoctr+", XLOCB(19,BOTP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bsoctr-", XLOCB(19,BOTM4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsoctr+", XLOCB(19,BOTP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bsoctr+", XLOCB(19,BOTP4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bsoctrl", XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bsoctrl-",XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bsoctrl+",XLOCB(19,BOTP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bsoctrl-",XLOCB(19,BOTM4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bsoctrl+",XLOCB(19,BOTP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bsoctrl+",XLOCB(19,BOTP4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bunctr", XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bunctr-", XLOCB(19,BOT,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bunctr+", XLOCB(19,BOTP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bunctr-", XLOCB(19,BOTM4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bunctr+", XLOCB(19,BOTP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bunctr+", XLOCB(19,BOTP4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bunctrl", XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bunctrl-",XLOCB(19,BOT,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bunctrl+",XLOCB(19,BOTP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bunctrl-",XLOCB(19,BOTM4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bunctrl+",XLOCB(19,BOTP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bunctrl+",XLOCB(19,BOTP4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bgectr", XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bgectr-", XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bgectr+", XLOCB(19,BOFP,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgectr-", XLOCB(19,BOFM4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgectr+", XLOCB(19,BOFP,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgectr+", XLOCB(19,BOFP4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bgectrl", XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bgectrl-",XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bgectrl+",XLOCB(19,BOFP,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgectrl-",XLOCB(19,BOFM4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bgectrl+",XLOCB(19,BOFP,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bgectrl+",XLOCB(19,BOFP4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnlctr", XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnlctr-", XLOCB(19,BOF,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnlctr+", XLOCB(19,BOFP,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnlctr-", XLOCB(19,BOFM4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnlctr+", XLOCB(19,BOFP,CBLT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnlctr+", XLOCB(19,BOFP4,CBLT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnlctrl", XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnlctrl-",XLOCB(19,BOF,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnlctrl+",XLOCB(19,BOFP,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnlctrl-",XLOCB(19,BOFM4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnlctrl+",XLOCB(19,BOFP,CBLT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnlctrl+",XLOCB(19,BOFP4,CBLT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "blectr", XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "blectr-", XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "blectr+", XLOCB(19,BOFP,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "blectr-", XLOCB(19,BOFM4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "blectr+", XLOCB(19,BOFP,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "blectr+", XLOCB(19,BOFP4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "blectrl", XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "blectrl-",XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "blectrl+",XLOCB(19,BOFP,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "blectrl-",XLOCB(19,BOFM4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "blectrl+",XLOCB(19,BOFP,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "blectrl+",XLOCB(19,BOFP4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bngctr", XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bngctr-", XLOCB(19,BOF,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bngctr+", XLOCB(19,BOFP,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bngctr-", XLOCB(19,BOFM4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bngctr+", XLOCB(19,BOFP,CBGT,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bngctr+", XLOCB(19,BOFP4,CBGT,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bngctrl", XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bngctrl-",XLOCB(19,BOF,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bngctrl+",XLOCB(19,BOFP,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bngctrl-",XLOCB(19,BOFM4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bngctrl+",XLOCB(19,BOFP,CBGT,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bngctrl+",XLOCB(19,BOFP4,CBGT,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnectr", XLOCB(19,BOF,CBEQ,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnectr-", XLOCB(19,BOF,CBEQ,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnectr+", XLOCB(19,BOFP,CBEQ,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnectr-", XLOCB(19,BOFM4,CBEQ,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnectr+", XLOCB(19,BOFP,CBEQ,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnectr+", XLOCB(19,BOFP4,CBEQ,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnectrl", XLOCB(19,BOF,CBEQ,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnectrl-",XLOCB(19,BOF,CBEQ,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnectrl+",XLOCB(19,BOFP,CBEQ,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnectrl-",XLOCB(19,BOFM4,CBEQ,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnectrl+",XLOCB(19,BOFP,CBEQ,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnectrl+",XLOCB(19,BOFP4,CBEQ,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnsctr", XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnsctr-", XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnsctr+", XLOCB(19,BOFP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnsctr-", XLOCB(19,BOFM4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnsctr+", XLOCB(19,BOFP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnsctr+", XLOCB(19,BOFP4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnsctrl", XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnsctrl-",XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnsctrl+",XLOCB(19,BOFP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnsctrl-",XLOCB(19,BOFM4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnsctrl+",XLOCB(19,BOFP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnsctrl+",XLOCB(19,BOFP4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnuctr", XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnuctr-", XLOCB(19,BOF,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnuctr+", XLOCB(19,BOFP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnuctr-", XLOCB(19,BOFM4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnuctr+", XLOCB(19,BOFP,CBSO,528,0), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnuctr+", XLOCB(19,BOFP4,CBSO,528,0), XLBOCBBB_MASK, POWER4, { CR } },
{ "bnuctrl", XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, PPCCOM, { CR } },
{ "bnuctrl-",XLOCB(19,BOF,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
-{ "bnuctrl+",XLOCB(19,BOFP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnuctrl-",XLOCB(19,BOFM4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
+{ "bnuctrl+",XLOCB(19,BOFP,CBSO,528,1), XLBOCBBB_MASK, NOPOWER4, { CR } },
{ "bnuctrl+",XLOCB(19,BOFP4,CBSO,528,1), XLBOCBBB_MASK, POWER4, { CR } },
{ "btctr", XLO(19,BOT,528,0), XLBOBB_MASK, PPCCOM, { BI } },
{ "btctr-", XLO(19,BOT,528,0), XLBOBB_MASK, NOPOWER4, { BI } },
-{ "btctr+", XLO(19,BOTP,528,0), XLBOBB_MASK, NOPOWER4, { BI } },
{ "btctr-", XLO(19,BOTM4,528,0), XLBOBB_MASK, POWER4, { BI } },
+{ "btctr+", XLO(19,BOTP,528,0), XLBOBB_MASK, NOPOWER4, { BI } },
{ "btctr+", XLO(19,BOTP4,528,0), XLBOBB_MASK, POWER4, { BI } },
{ "btctrl", XLO(19,BOT,528,1), XLBOBB_MASK, PPCCOM, { BI } },
{ "btctrl-", XLO(19,BOT,528,1), XLBOBB_MASK, NOPOWER4, { BI } },
-{ "btctrl+", XLO(19,BOTP,528,1), XLBOBB_MASK, NOPOWER4, { BI } },
{ "btctrl-", XLO(19,BOTM4,528,1), XLBOBB_MASK, POWER4, { BI } },
+{ "btctrl+", XLO(19,BOTP,528,1), XLBOBB_MASK, NOPOWER4, { BI } },
{ "btctrl+", XLO(19,BOTP4,528,1), XLBOBB_MASK, POWER4, { BI } },
{ "bfctr", XLO(19,BOF,528,0), XLBOBB_MASK, PPCCOM, { BI } },
{ "bfctr-", XLO(19,BOF,528,0), XLBOBB_MASK, NOPOWER4, { BI } },
-{ "bfctr+", XLO(19,BOFP,528,0), XLBOBB_MASK, NOPOWER4, { BI } },
{ "bfctr-", XLO(19,BOFM4,528,0), XLBOBB_MASK, POWER4, { BI } },
+{ "bfctr+", XLO(19,BOFP,528,0), XLBOBB_MASK, NOPOWER4, { BI } },
{ "bfctr+", XLO(19,BOFP4,528,0), XLBOBB_MASK, POWER4, { BI } },
{ "bfctrl", XLO(19,BOF,528,1), XLBOBB_MASK, PPCCOM, { BI } },
{ "bfctrl-", XLO(19,BOF,528,1), XLBOBB_MASK, NOPOWER4, { BI } },
-{ "bfctrl+", XLO(19,BOFP,528,1), XLBOBB_MASK, NOPOWER4, { BI } },
{ "bfctrl-", XLO(19,BOFM4,528,1), XLBOBB_MASK, POWER4, { BI } },
+{ "bfctrl+", XLO(19,BOFP,528,1), XLBOBB_MASK, NOPOWER4, { BI } },
{ "bfctrl+", XLO(19,BOFP4,528,1), XLBOBB_MASK, POWER4, { BI } },
{ "bcctr", XLLK(19,528,0), XLYBB_MASK, PPCCOM, { BO, BI } },
{ "bcctr-", XLYLK(19,528,0,0), XLYBB_MASK, PPCCOM, { BOE, BI } },
@@ -3158,7 +3158,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "cmpw", XCMPL(31,0,0), XCMPL_MASK, PPCCOM, { OBF, RA, RB } },
{ "cmpd", XCMPL(31,0,1), XCMPL_MASK, PPC64, { OBF, RA, RB } },
-{ "cmp", X(31,0), XCMP_MASK, PPCONLY, { BF, L, RA, RB } },
+{ "cmp", X(31,0), XCMP_MASK, PPC, { BF, L, RA, RB } },
{ "cmp", X(31,0), XCMPL_MASK, PWRCOM, { BF, RA, RB } },
{ "twlgt", XTO(31,4,TOLGT), XTO_MASK, PPCCOM, { RA, RB } },
@@ -3234,6 +3234,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "ldx", X(31,21), X_MASK, PPC64, { RT, RA, RB } },
{ "icbt", X(31,22), X_MASK, BOOKE, { CT, RA, RB } },
+{ "icbt", X(31,262), XRT_MASK, PPC403, { RA, RB } },
{ "lwzx", X(31,23), X_MASK, PPCCOM, { RT, RA, RB } },
{ "lx", X(31,23), X_MASK, PWRCOM, { RT, RA, RB } },
@@ -3263,7 +3264,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "cmplw", XCMPL(31,32,0), XCMPL_MASK, PPCCOM, { OBF, RA, RB } },
{ "cmpld", XCMPL(31,32,1), XCMPL_MASK, PPC64, { OBF, RA, RB } },
-{ "cmpl", X(31,32), XCMP_MASK, PPCONLY, { BF, L, RA, RB } },
+{ "cmpl", X(31,32), XCMP_MASK, PPC, { BF, L, RA, RB } },
{ "cmpl", X(31,32), XCMPL_MASK, PWRCOM, { BF, RA, RB } },
{ "subf", XO(31,40,0,0), XO_MASK, PPC, { RT, RA, RB } },
@@ -3314,6 +3315,9 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mulhw", XO(31,75,0,0), XO_MASK, PPC, { RT, RA, RB } },
{ "mulhw.", XO(31,75,0,1), XO_MASK, PPC, { RT, RA, RB } },
+{ "dlmzb", XRC(31,78,0), X_MASK, PPC403|PPC440, { RA, RS, RB } },
+{ "dlmzb.", XRC(31,78,1), X_MASK, PPC403|PPC440, { RA, RS, RB } },
+
{ "mtsrd", X(31,82), XRB_MASK|(1<<20), PPC64, { SR, RS } },
{ "mfmsr", X(31,83), XRARB_MASK, COM, { RT } },
@@ -3353,8 +3357,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "lbzuxe", X(31,127), X_MASK, BOOKE64, { RT, RAL, RB } },
-{ "wrtee", X(31,131), XRARB_MASK, PPC403, { RS } },
-{ "wrtee", X(31,131), XRARB_MASK, BOOKE, { RS } },
+{ "wrtee", X(31,131), XRARB_MASK, PPC403 | BOOKE, { RS } },
{ "dcbtstls",X(31,134), X_MASK, PPCCHLK, { CT, RA, RB }},
@@ -3400,8 +3403,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "sle", XRC(31,153,0), X_MASK, M601, { RA, RS, RB } },
{ "sle.", XRC(31,153,1), X_MASK, M601, { RA, RS, RB } },
-{ "wrteei", X(31,163), XE_MASK, PPC403, { E } },
-{ "wrteei", X(31,163), XE_MASK, BOOKE, { E } },
+{ "wrteei", X(31,163), XE_MASK, PPC403 | BOOKE, { E } },
{ "dcbtls", X(31,166), X_MASK, PPCCHLK, { CT, RA, RB }},
{ "dcbtlse", X(31,174), X_MASK, PPCCHLK64, { CT, RA, RB }},
@@ -3501,8 +3503,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mfdcrx", X(31,259), X_MASK, BOOKE, { RS, RA } },
-{ "icbt", X(31,262), XRT_MASK, PPC403, { RA, RB } },
-
{ "doz", XO(31,264,0,0), XO_MASK, M601, { RT, RA, RB } },
{ "doz.", XO(31,264,0,1), XO_MASK, M601, { RT, RA, RB } },
{ "dozo", XO(31,264,1,0), XO_MASK, M601, { RT, RA, RB } },
@@ -3581,8 +3581,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mfdmasa3", XSPR(31,323,219), XSPR_MASK, PPC403, { RT } },
{ "mfdmacc3", XSPR(31,323,220), XSPR_MASK, PPC403, { RT } },
{ "mfdmasr", XSPR(31,323,224), XSPR_MASK, PPC403, { RT } },
-{ "mfdcr", X(31,323), X_MASK, PPC403, { RT, SPR } },
-{ "mfdcr", X(31,323), X_MASK, BOOKE, { RT, SPR } },
+{ "mfdcr", X(31,323), X_MASK, PPC403 | BOOKE, { RT, SPR } },
{ "div", XO(31,331,0,0), XO_MASK, M601, { RT, RA, RB } },
{ "div.", XO(31,331,0,1), XO_MASK, M601, { RT, RA, RB } },
@@ -3596,21 +3595,24 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mfrtcu", XSPR(31,339,4), XSPR_MASK, COM, { RT } },
{ "mfrtcl", XSPR(31,339,5), XSPR_MASK, COM, { RT } },
{ "mfdec", XSPR(31,339,6), XSPR_MASK, MFDEC1, { RT } },
+{ "mfdec", XSPR(31,339,22), XSPR_MASK, MFDEC2, { RT } },
{ "mflr", XSPR(31,339,8), XSPR_MASK, COM, { RT } },
{ "mfctr", XSPR(31,339,9), XSPR_MASK, COM, { RT } },
{ "mftid", XSPR(31,339,17), XSPR_MASK, POWER, { RT } },
{ "mfdsisr", XSPR(31,339,18), XSPR_MASK, COM, { RT } },
{ "mfdar", XSPR(31,339,19), XSPR_MASK, COM, { RT } },
-{ "mfdec", XSPR(31,339,22), XSPR_MASK, MFDEC2, { RT } },
{ "mfsdr0", XSPR(31,339,24), XSPR_MASK, POWER, { RT } },
{ "mfsdr1", XSPR(31,339,25), XSPR_MASK, COM, { RT } },
{ "mfsrr0", XSPR(31,339,26), XSPR_MASK, COM, { RT } },
{ "mfsrr1", XSPR(31,339,27), XSPR_MASK, COM, { RT } },
{ "mfpid", XSPR(31,339,48), XSPR_MASK, BOOKE, { RT } },
+{ "mfpid", XSPR(31,339,945), XSPR_MASK, PPC403, { RT } },
{ "mfcsrr0", XSPR(31,339,58), XSPR_MASK, BOOKE, { RT } },
{ "mfcsrr1", XSPR(31,339,59), XSPR_MASK, BOOKE, { RT } },
{ "mfdear", XSPR(31,339,61), XSPR_MASK, BOOKE, { RT } },
+{ "mfdear", XSPR(31,339,981), XSPR_MASK, PPC403, { RT } },
{ "mfesr", XSPR(31,339,62), XSPR_MASK, BOOKE, { RT } },
+{ "mfesr", XSPR(31,339,980), XSPR_MASK, PPC403, { RT } },
{ "mfivpr", XSPR(31,339,63), XSPR_MASK, BOOKE, { RT } },
{ "mfcmpa", XSPR(31,339,144), XSPR_MASK, PPC860, { RT } },
{ "mfcmpb", XSPR(31,339,145), XSPR_MASK, PPC860, { RT } },
@@ -3634,8 +3636,11 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mfsprg5", XSPR(31,339,261), XSPR_MASK, PPC405, { RT } },
{ "mfsprg6", XSPR(31,339,262), XSPR_MASK, PPC405, { RT } },
{ "mfsprg7", XSPR(31,339,263), XSPR_MASK, PPC405, { RT } },
+{ "mftb", X(31,371), X_MASK, CLASSIC, { RT, TBR } },
{ "mftb", XSPR(31,339,268), XSPR_MASK, BOOKE, { RT } },
+{ "mftbl", XSPR(31,371,268), XSPR_MASK, CLASSIC, { RT } },
{ "mftbl", XSPR(31,339,268), XSPR_MASK, BOOKE, { RT } },
+{ "mftbu", XSPR(31,371,269), XSPR_MASK, CLASSIC, { RT } },
{ "mftbu", XSPR(31,339,269), XSPR_MASK, BOOKE, { RT } },
{ "mfsprg", XSPR(31,339,272), XSPRG_MASK, PPC, { RT, SPRG } },
{ "mfsprg0", XSPR(31,339,272), XSPR_MASK, PPC, { RT } },
@@ -3647,19 +3652,32 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mfpir", XSPR(31,339,286), XSPR_MASK, BOOKE, { RT } },
{ "mfpvr", XSPR(31,339,287), XSPR_MASK, PPC, { RT } },
{ "mfdbsr", XSPR(31,339,304), XSPR_MASK, BOOKE, { RT } },
+{ "mfdbsr", XSPR(31,339,1008), XSPR_MASK, PPC403, { RT } },
{ "mfdbcr0", XSPR(31,339,308), XSPR_MASK, BOOKE, { RT } },
+{ "mfdbcr0", XSPR(31,339,1010), XSPR_MASK, PPC405, { RT } },
{ "mfdbcr1", XSPR(31,339,309), XSPR_MASK, BOOKE, { RT } },
+{ "mfdbcr1", XSPR(31,339,957), XSPR_MASK, PPC405, { RT } },
{ "mfdbcr2", XSPR(31,339,310), XSPR_MASK, BOOKE, { RT } },
{ "mfiac1", XSPR(31,339,312), XSPR_MASK, BOOKE, { RT } },
+{ "mfiac1", XSPR(31,339,1012), XSPR_MASK, PPC403, { RT } },
{ "mfiac2", XSPR(31,339,313), XSPR_MASK, BOOKE, { RT } },
+{ "mfiac2", XSPR(31,339,1013), XSPR_MASK, PPC403, { RT } },
{ "mfiac3", XSPR(31,339,314), XSPR_MASK, BOOKE, { RT } },
+{ "mfiac3", XSPR(31,339,948), XSPR_MASK, PPC405, { RT } },
{ "mfiac4", XSPR(31,339,315), XSPR_MASK, BOOKE, { RT } },
+{ "mfiac4", XSPR(31,339,949), XSPR_MASK, PPC405, { RT } },
{ "mfdac1", XSPR(31,339,316), XSPR_MASK, BOOKE, { RT } },
+{ "mfdac1", XSPR(31,339,1014), XSPR_MASK, PPC403, { RT } },
{ "mfdac2", XSPR(31,339,317), XSPR_MASK, BOOKE, { RT } },
+{ "mfdac2", XSPR(31,339,1015), XSPR_MASK, PPC403, { RT } },
{ "mfdvc1", XSPR(31,339,318), XSPR_MASK, BOOKE, { RT } },
+{ "mfdvc1", XSPR(31,339,950), XSPR_MASK, PPC405, { RT } },
{ "mfdvc2", XSPR(31,339,319), XSPR_MASK, BOOKE, { RT } },
+{ "mfdvc2", XSPR(31,339,951), XSPR_MASK, PPC405, { RT } },
{ "mftsr", XSPR(31,339,336), XSPR_MASK, BOOKE, { RT } },
+{ "mftsr", XSPR(31,339,984), XSPR_MASK, PPC403, { RT } },
{ "mftcr", XSPR(31,339,340), XSPR_MASK, BOOKE, { RT } },
+{ "mftcr", XSPR(31,339,986), XSPR_MASK, PPC403, { RT } },
{ "mfivor0", XSPR(31,339,400), XSPR_MASK, BOOKE, { RT } },
{ "mfivor1", XSPR(31,339,401), XSPR_MASK, BOOKE, { RT } },
{ "mfivor2", XSPR(31,339,402), XSPR_MASK, BOOKE, { RT } },
@@ -3722,12 +3740,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mfupmc3", XSPR(31,339,941), XSPR_MASK, PPC750, { RT } },
{ "mfupmc4", XSPR(31,339,942), XSPR_MASK, PPC750, { RT } },
{ "mfzpr", XSPR(31,339,944), XSPR_MASK, PPC403, { RT } },
-{ "mfpid", XSPR(31,339,945), XSPR_MASK, PPC403, { RT } },
{ "mfccr0", XSPR(31,339,947), XSPR_MASK, PPC405, { RT } },
-{ "mfiac3", XSPR(31,339,948), XSPR_MASK, PPC405, { RT } },
-{ "mfiac4", XSPR(31,339,949), XSPR_MASK, PPC405, { RT } },
-{ "mfdvc1", XSPR(31,339,950), XSPR_MASK, PPC405, { RT } },
-{ "mfdvc2", XSPR(31,339,951), XSPR_MASK, PPC405, { RT } },
{ "mfmmcr0", XSPR(31,339,952), XSPR_MASK, PPC750, { RT } },
{ "mfpmc1", XSPR(31,339,953), XSPR_MASK, PPC750, { RT } },
{ "mfsgr", XSPR(31,339,953), XSPR_MASK, PPC403, { RT } },
@@ -3738,26 +3751,15 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mfmmcr1", XSPR(31,339,956), XSPR_MASK, PPC750, { RT } },
{ "mfsu0r", XSPR(31,339,956), XSPR_MASK, PPC405, { RT } },
{ "mfpmc3", XSPR(31,339,957), XSPR_MASK, PPC750, { RT } },
-{ "mfdbcr1", XSPR(31,339,957), XSPR_MASK, PPC405, { RT } },
{ "mfpmc4", XSPR(31,339,958), XSPR_MASK, PPC750, { RT } },
{ "mficdbdr", XSPR(31,339,979), XSPR_MASK, PPC403, { RT } },
-{ "mfesr", XSPR(31,339,980), XSPR_MASK, PPC403, { RT } },
-{ "mfdear", XSPR(31,339,981), XSPR_MASK, PPC403, { RT } },
{ "mfevpr", XSPR(31,339,982), XSPR_MASK, PPC403, { RT } },
{ "mfcdbcr", XSPR(31,339,983), XSPR_MASK, PPC403, { RT } },
-{ "mftsr", XSPR(31,339,984), XSPR_MASK, PPC403, { RT } },
-{ "mftcr", XSPR(31,339,986), XSPR_MASK, PPC403, { RT } },
{ "mfpit", XSPR(31,339,987), XSPR_MASK, PPC403, { RT } },
{ "mftbhi", XSPR(31,339,988), XSPR_MASK, PPC403, { RT } },
{ "mftblo", XSPR(31,339,989), XSPR_MASK, PPC403, { RT } },
{ "mfsrr2", XSPR(31,339,990), XSPR_MASK, PPC403, { RT } },
{ "mfsrr3", XSPR(31,339,991), XSPR_MASK, PPC403, { RT } },
-{ "mfdbsr", XSPR(31,339,1008), XSPR_MASK, PPC403, { RT } },
-{ "mfdbcr0", XSPR(31,339,1010), XSPR_MASK, PPC405, { RT } },
-{ "mfiac1", XSPR(31,339,1012), XSPR_MASK, PPC403, { RT } },
-{ "mfiac2", XSPR(31,339,1013), XSPR_MASK, PPC403, { RT } },
-{ "mfdac1", XSPR(31,339,1014), XSPR_MASK, PPC403, { RT } },
-{ "mfdac2", XSPR(31,339,1015), XSPR_MASK, PPC403, { RT } },
{ "mfl2cr", XSPR(31,339,1017), XSPR_MASK, PPC750, { RT } },
{ "mfdccr", XSPR(31,339,1018), XSPR_MASK, PPC403, { RT } },
{ "mficcr", XSPR(31,339,1019), XSPR_MASK, PPC403, { RT } },
@@ -3783,7 +3785,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "dstst", XDSS(31,374,0), XDSS_MASK, PPCVEC, { RA, RB, STRM } },
{ "dststt", XDSS(31,374,1), XDSS_MASK, PPCVEC, { RA, RB, STRM } },
-{ "dccci", X(31,454), XRT_MASK, PPC403, { RA, RB } },
+{ "dccci", X(31,454), XRT_MASK, PPC403|PPC440, { RA, RB } },
{ "abs", XO(31,360,0,0), XORB_MASK, M601, { RT, RA } },
{ "abs.", XO(31,360,0,1), XORB_MASK, M601, { RT, RA } },
@@ -3797,10 +3799,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "tlbia", X(31,370), 0xffffffff, PPC, { 0 } },
-{ "mftbl", XSPR(31,371,268), XSPR_MASK, CLASSIC, { RT } },
-{ "mftbu", XSPR(31,371,269), XSPR_MASK, CLASSIC, { RT } },
-{ "mftb", X(31,371), X_MASK, CLASSIC, { RT, TBR } },
-
{ "lwaux", X(31,373), X_MASK, PPC64, { RT, RAL, RB } },
{ "lhaux", X(31,375), X_MASK, COM, { RT, RAL, RB } },
@@ -3852,42 +3850,41 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mr.", XRC(31,444,1), X_MASK, COM, { RA, RS, RBS } },
{ "or.", XRC(31,444,1), X_MASK, COM, { RA, RS, RB } },
-{ "mtexisr", XSPR(31,451,64), XSPR_MASK, PPC403, { RT } },
-{ "mtexier", XSPR(31,451,66), XSPR_MASK, PPC403, { RT } },
-{ "mtbr0", XSPR(31,451,128), XSPR_MASK, PPC403, { RT } },
-{ "mtbr1", XSPR(31,451,129), XSPR_MASK, PPC403, { RT } },
-{ "mtbr2", XSPR(31,451,130), XSPR_MASK, PPC403, { RT } },
-{ "mtbr3", XSPR(31,451,131), XSPR_MASK, PPC403, { RT } },
-{ "mtbr4", XSPR(31,451,132), XSPR_MASK, PPC403, { RT } },
-{ "mtbr5", XSPR(31,451,133), XSPR_MASK, PPC403, { RT } },
-{ "mtbr6", XSPR(31,451,134), XSPR_MASK, PPC403, { RT } },
-{ "mtbr7", XSPR(31,451,135), XSPR_MASK, PPC403, { RT } },
-{ "mtbear", XSPR(31,451,144), XSPR_MASK, PPC403, { RT } },
-{ "mtbesr", XSPR(31,451,145), XSPR_MASK, PPC403, { RT } },
-{ "mtiocr", XSPR(31,451,160), XSPR_MASK, PPC403, { RT } },
-{ "mtdmacr0", XSPR(31,451,192), XSPR_MASK, PPC403, { RT } },
-{ "mtdmact0", XSPR(31,451,193), XSPR_MASK, PPC403, { RT } },
-{ "mtdmada0", XSPR(31,451,194), XSPR_MASK, PPC403, { RT } },
-{ "mtdmasa0", XSPR(31,451,195), XSPR_MASK, PPC403, { RT } },
-{ "mtdmacc0", XSPR(31,451,196), XSPR_MASK, PPC403, { RT } },
-{ "mtdmacr1", XSPR(31,451,200), XSPR_MASK, PPC403, { RT } },
-{ "mtdmact1", XSPR(31,451,201), XSPR_MASK, PPC403, { RT } },
-{ "mtdmada1", XSPR(31,451,202), XSPR_MASK, PPC403, { RT } },
-{ "mtdmasa1", XSPR(31,451,203), XSPR_MASK, PPC403, { RT } },
-{ "mtdmacc1", XSPR(31,451,204), XSPR_MASK, PPC403, { RT } },
-{ "mtdmacr2", XSPR(31,451,208), XSPR_MASK, PPC403, { RT } },
-{ "mtdmact2", XSPR(31,451,209), XSPR_MASK, PPC403, { RT } },
-{ "mtdmada2", XSPR(31,451,210), XSPR_MASK, PPC403, { RT } },
-{ "mtdmasa2", XSPR(31,451,211), XSPR_MASK, PPC403, { RT } },
-{ "mtdmacc2", XSPR(31,451,212), XSPR_MASK, PPC403, { RT } },
-{ "mtdmacr3", XSPR(31,451,216), XSPR_MASK, PPC403, { RT } },
-{ "mtdmact3", XSPR(31,451,217), XSPR_MASK, PPC403, { RT } },
-{ "mtdmada3", XSPR(31,451,218), XSPR_MASK, PPC403, { RT } },
-{ "mtdmasa3", XSPR(31,451,219), XSPR_MASK, PPC403, { RT } },
-{ "mtdmacc3", XSPR(31,451,220), XSPR_MASK, PPC403, { RT } },
-{ "mtdmasr", XSPR(31,451,224), XSPR_MASK, PPC403, { RT } },
-{ "mtdcr", X(31,451), X_MASK, PPC403, { SPR, RS } },
-{ "mtdcr", X(31,451), X_MASK, BOOKE, { SPR, RS } },
+{ "mtexisr", XSPR(31,451,64), XSPR_MASK, PPC403, { RS } },
+{ "mtexier", XSPR(31,451,66), XSPR_MASK, PPC403, { RS } },
+{ "mtbr0", XSPR(31,451,128), XSPR_MASK, PPC403, { RS } },
+{ "mtbr1", XSPR(31,451,129), XSPR_MASK, PPC403, { RS } },
+{ "mtbr2", XSPR(31,451,130), XSPR_MASK, PPC403, { RS } },
+{ "mtbr3", XSPR(31,451,131), XSPR_MASK, PPC403, { RS } },
+{ "mtbr4", XSPR(31,451,132), XSPR_MASK, PPC403, { RS } },
+{ "mtbr5", XSPR(31,451,133), XSPR_MASK, PPC403, { RS } },
+{ "mtbr6", XSPR(31,451,134), XSPR_MASK, PPC403, { RS } },
+{ "mtbr7", XSPR(31,451,135), XSPR_MASK, PPC403, { RS } },
+{ "mtbear", XSPR(31,451,144), XSPR_MASK, PPC403, { RS } },
+{ "mtbesr", XSPR(31,451,145), XSPR_MASK, PPC403, { RS } },
+{ "mtiocr", XSPR(31,451,160), XSPR_MASK, PPC403, { RS } },
+{ "mtdmacr0", XSPR(31,451,192), XSPR_MASK, PPC403, { RS } },
+{ "mtdmact0", XSPR(31,451,193), XSPR_MASK, PPC403, { RS } },
+{ "mtdmada0", XSPR(31,451,194), XSPR_MASK, PPC403, { RS } },
+{ "mtdmasa0", XSPR(31,451,195), XSPR_MASK, PPC403, { RS } },
+{ "mtdmacc0", XSPR(31,451,196), XSPR_MASK, PPC403, { RS } },
+{ "mtdmacr1", XSPR(31,451,200), XSPR_MASK, PPC403, { RS } },
+{ "mtdmact1", XSPR(31,451,201), XSPR_MASK, PPC403, { RS } },
+{ "mtdmada1", XSPR(31,451,202), XSPR_MASK, PPC403, { RS } },
+{ "mtdmasa1", XSPR(31,451,203), XSPR_MASK, PPC403, { RS } },
+{ "mtdmacc1", XSPR(31,451,204), XSPR_MASK, PPC403, { RS } },
+{ "mtdmacr2", XSPR(31,451,208), XSPR_MASK, PPC403, { RS } },
+{ "mtdmact2", XSPR(31,451,209), XSPR_MASK, PPC403, { RS } },
+{ "mtdmada2", XSPR(31,451,210), XSPR_MASK, PPC403, { RS } },
+{ "mtdmasa2", XSPR(31,451,211), XSPR_MASK, PPC403, { RS } },
+{ "mtdmacc2", XSPR(31,451,212), XSPR_MASK, PPC403, { RS } },
+{ "mtdmacr3", XSPR(31,451,216), XSPR_MASK, PPC403, { RS } },
+{ "mtdmact3", XSPR(31,451,217), XSPR_MASK, PPC403, { RS } },
+{ "mtdmada3", XSPR(31,451,218), XSPR_MASK, PPC403, { RS } },
+{ "mtdmasa3", XSPR(31,451,219), XSPR_MASK, PPC403, { RS } },
+{ "mtdmacc3", XSPR(31,451,220), XSPR_MASK, PPC403, { RS } },
+{ "mtdmasr", XSPR(31,451,224), XSPR_MASK, PPC403, { RS } },
+{ "mtdcr", X(31,451), X_MASK, PPC403 | BOOKE, { SPR, RS } },
{ "subfze64",XO(31,456,0,0), XORB_MASK, BOOKE64, { RT, RA } },
{ "subfze64o",XO(31,456,1,0), XORB_MASK, BOOKE64, { RT, RA } },
@@ -3920,61 +3917,73 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mtsrr0", XSPR(31,467,26), XSPR_MASK, COM, { RS } },
{ "mtsrr1", XSPR(31,467,27), XSPR_MASK, COM, { RS } },
{ "mtpid", XSPR(31,467,48), XSPR_MASK, BOOKE, { RS } },
+{ "mtpid", XSPR(31,467,945), XSPR_MASK, PPC403, { RS } },
{ "mtdecar", XSPR(31,467,54), XSPR_MASK, BOOKE, { RS } },
{ "mtcsrr0", XSPR(31,467,58), XSPR_MASK, BOOKE, { RS } },
{ "mtcsrr1", XSPR(31,467,59), XSPR_MASK, BOOKE, { RS } },
{ "mtdear", XSPR(31,467,61), XSPR_MASK, BOOKE, { RS } },
+{ "mtdear", XSPR(31,467,981), XSPR_MASK, PPC403, { RS } },
{ "mtesr", XSPR(31,467,62), XSPR_MASK, BOOKE, { RS } },
+{ "mtesr", XSPR(31,467,980), XSPR_MASK, PPC403, { RS } },
{ "mtivpr", XSPR(31,467,63), XSPR_MASK, BOOKE, { RS } },
-{ "mtcmpa", XSPR(31,467,144), XSPR_MASK, PPC860, { RT } },
-{ "mtcmpb", XSPR(31,467,145), XSPR_MASK, PPC860, { RT } },
-{ "mtcmpc", XSPR(31,467,146), XSPR_MASK, PPC860, { RT } },
-{ "mtcmpd", XSPR(31,467,147), XSPR_MASK, PPC860, { RT } },
-{ "mticr", XSPR(31,467,148), XSPR_MASK, PPC860, { RT } },
-{ "mtder", XSPR(31,467,149), XSPR_MASK, PPC860, { RT } },
-{ "mtcounta", XSPR(31,467,150), XSPR_MASK, PPC860, { RT } },
-{ "mtcountb", XSPR(31,467,151), XSPR_MASK, PPC860, { RT } },
-{ "mtcmpe", XSPR(31,467,152), XSPR_MASK, PPC860, { RT } },
-{ "mtcmpf", XSPR(31,467,153), XSPR_MASK, PPC860, { RT } },
-{ "mtcmpg", XSPR(31,467,154), XSPR_MASK, PPC860, { RT } },
-{ "mtcmph", XSPR(31,467,155), XSPR_MASK, PPC860, { RT } },
-{ "mtlctrl1", XSPR(31,467,156), XSPR_MASK, PPC860, { RT } },
-{ "mtlctrl2", XSPR(31,467,157), XSPR_MASK, PPC860, { RT } },
-{ "mtictrl", XSPR(31,467,158), XSPR_MASK, PPC860, { RT } },
-{ "mtbar", XSPR(31,467,159), XSPR_MASK, PPC860, { RT } },
-{ "mtvrsave", XSPR(31,467,256), XSPR_MASK, PPCVEC, { RT } },
+{ "mtcmpa", XSPR(31,467,144), XSPR_MASK, PPC860, { RS } },
+{ "mtcmpb", XSPR(31,467,145), XSPR_MASK, PPC860, { RS } },
+{ "mtcmpc", XSPR(31,467,146), XSPR_MASK, PPC860, { RS } },
+{ "mtcmpd", XSPR(31,467,147), XSPR_MASK, PPC860, { RS } },
+{ "mticr", XSPR(31,467,148), XSPR_MASK, PPC860, { RS } },
+{ "mtder", XSPR(31,467,149), XSPR_MASK, PPC860, { RS } },
+{ "mtcounta", XSPR(31,467,150), XSPR_MASK, PPC860, { RS } },
+{ "mtcountb", XSPR(31,467,151), XSPR_MASK, PPC860, { RS } },
+{ "mtcmpe", XSPR(31,467,152), XSPR_MASK, PPC860, { RS } },
+{ "mtcmpf", XSPR(31,467,153), XSPR_MASK, PPC860, { RS } },
+{ "mtcmpg", XSPR(31,467,154), XSPR_MASK, PPC860, { RS } },
+{ "mtcmph", XSPR(31,467,155), XSPR_MASK, PPC860, { RS } },
+{ "mtlctrl1", XSPR(31,467,156), XSPR_MASK, PPC860, { RS } },
+{ "mtlctrl2", XSPR(31,467,157), XSPR_MASK, PPC860, { RS } },
+{ "mtictrl", XSPR(31,467,158), XSPR_MASK, PPC860, { RS } },
+{ "mtbar", XSPR(31,467,159), XSPR_MASK, PPC860, { RS } },
+{ "mtvrsave", XSPR(31,467,256), XSPR_MASK, PPCVEC, { RS } },
{ "mtusprg0", XSPR(31,467,256), XSPR_MASK, BOOKE, { RS } },
{ "mtsprg", XSPR(31,467,272), XSPRG_MASK,PPC, { SPRG, RS } },
-{ "mtsprg0", XSPR(31,467,272), XSPR_MASK, PPC, { RT } },
-{ "mtsprg1", XSPR(31,467,273), XSPR_MASK, PPC, { RT } },
-{ "mtsprg2", XSPR(31,467,274), XSPR_MASK, PPC, { RT } },
-{ "mtsprg3", XSPR(31,467,275), XSPR_MASK, PPC, { RT } },
-{ "mtsprg4", XSPR(31,467,276), XSPR_MASK, PPC405, { RT } },
-{ "mtsprg4", XSPR(31,467,276), XSPR_MASK, BOOKE, { RS } },
-{ "mtsprg5", XSPR(31,467,277), XSPR_MASK, PPC405, { RT } },
-{ "mtsprg5", XSPR(31,467,277), XSPR_MASK, BOOKE, { RS } },
-{ "mtsprg6", XSPR(31,467,278), XSPR_MASK, PPC405, { RT } },
-{ "mtsprg6", XSPR(31,467,278), XSPR_MASK, BOOKE, { RS } },
-{ "mtsprg7", XSPR(31,467,279), XSPR_MASK, PPC405, { RT } },
-{ "mtsprg7", XSPR(31,467,279), XSPR_MASK, BOOKE, { RS } },
+{ "mtsprg0", XSPR(31,467,272), XSPR_MASK, PPC, { RS } },
+{ "mtsprg1", XSPR(31,467,273), XSPR_MASK, PPC, { RS } },
+{ "mtsprg2", XSPR(31,467,274), XSPR_MASK, PPC, { RS } },
+{ "mtsprg3", XSPR(31,467,275), XSPR_MASK, PPC, { RS } },
+{ "mtsprg4", XSPR(31,467,276), XSPR_MASK, PPC405 | BOOKE, { RS } },
+{ "mtsprg5", XSPR(31,467,277), XSPR_MASK, PPC405 | BOOKE, { RS } },
+{ "mtsprg6", XSPR(31,467,278), XSPR_MASK, PPC405 | BOOKE, { RS } },
+{ "mtsprg7", XSPR(31,467,279), XSPR_MASK, PPC405 | BOOKE, { RS } },
{ "mtasr", XSPR(31,467,280), XSPR_MASK, PPC64, { RS } },
{ "mtear", XSPR(31,467,282), XSPR_MASK, PPC, { RS } },
{ "mttbl", XSPR(31,467,284), XSPR_MASK, PPC, { RS } },
{ "mttbu", XSPR(31,467,285), XSPR_MASK, PPC, { RS } },
{ "mtdbsr", XSPR(31,467,304), XSPR_MASK, BOOKE, { RS } },
+{ "mtdbsr", XSPR(31,467,1008), XSPR_MASK, PPC403, { RS } },
{ "mtdbcr0", XSPR(31,467,308), XSPR_MASK, BOOKE, { RS } },
+{ "mtdbcr0", XSPR(31,467,1010), XSPR_MASK, PPC405, { RS } },
{ "mtdbcr1", XSPR(31,467,309), XSPR_MASK, BOOKE, { RS } },
+{ "mtdbcr1", XSPR(31,467,957), XSPR_MASK, PPC405, { RS } },
{ "mtdbcr2", XSPR(31,467,310), XSPR_MASK, BOOKE, { RS } },
{ "mtiac1", XSPR(31,467,312), XSPR_MASK, BOOKE, { RS } },
+{ "mtiac1", XSPR(31,467,1012), XSPR_MASK, PPC403, { RS } },
{ "mtiac2", XSPR(31,467,313), XSPR_MASK, BOOKE, { RS } },
+{ "mtiac2", XSPR(31,467,1013), XSPR_MASK, PPC403, { RS } },
{ "mtiac3", XSPR(31,467,314), XSPR_MASK, BOOKE, { RS } },
+{ "mtiac3", XSPR(31,467,948), XSPR_MASK, PPC405, { RS } },
{ "mtiac4", XSPR(31,467,315), XSPR_MASK, BOOKE, { RS } },
+{ "mtiac4", XSPR(31,467,949), XSPR_MASK, PPC405, { RS } },
{ "mtdac1", XSPR(31,467,316), XSPR_MASK, BOOKE, { RS } },
+{ "mtdac1", XSPR(31,467,1014), XSPR_MASK, PPC403, { RS } },
{ "mtdac2", XSPR(31,467,317), XSPR_MASK, BOOKE, { RS } },
+{ "mtdac2", XSPR(31,467,1015), XSPR_MASK, PPC403, { RS } },
{ "mtdvc1", XSPR(31,467,318), XSPR_MASK, BOOKE, { RS } },
+{ "mtdvc1", XSPR(31,467,950), XSPR_MASK, PPC405, { RS } },
{ "mtdvc2", XSPR(31,467,319), XSPR_MASK, BOOKE, { RS } },
+{ "mtdvc2", XSPR(31,467,951), XSPR_MASK, PPC405, { RS } },
{ "mttsr", XSPR(31,467,336), XSPR_MASK, BOOKE, { RS } },
+{ "mttsr", XSPR(31,467,984), XSPR_MASK, PPC403, { RS } },
{ "mttcr", XSPR(31,467,340), XSPR_MASK, BOOKE, { RS } },
+{ "mttcr", XSPR(31,467,986), XSPR_MASK, PPC403, { RS } },
{ "mtivor0", XSPR(31,467,400), XSPR_MASK, BOOKE, { RS } },
{ "mtivor1", XSPR(31,467,401), XSPR_MASK, BOOKE, { RS } },
{ "mtivor2", XSPR(31,467,402), XSPR_MASK, BOOKE, { RS } },
@@ -4001,61 +4010,45 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mtmcsrr0", XSPR(31,467,570), XSPR_MASK, PPCRFMCI, { RS } },
{ "mtmcsrr1", XSPR(31,467,571), XSPR_MASK, PPCRFMCI, { RS } },
{ "mtmcsr", XSPR(31,467,572), XSPR_MASK, PPCRFMCI, { RS } },
-{ "mtummcr0", XSPR(31,467,936), XSPR_MASK, PPC750, { RT } },
-{ "mtupmc1", XSPR(31,467,937), XSPR_MASK, PPC750, { RT } },
-{ "mtupmc2", XSPR(31,467,938), XSPR_MASK, PPC750, { RT } },
-{ "mtusia", XSPR(31,467,939), XSPR_MASK, PPC750, { RT } },
-{ "mtummcr1", XSPR(31,467,940), XSPR_MASK, PPC750, { RT } },
-{ "mtupmc3", XSPR(31,467,941), XSPR_MASK, PPC750, { RT } },
-{ "mtupmc4", XSPR(31,467,942), XSPR_MASK, PPC750, { RT } },
-{ "mtzpr", XSPR(31,467,944), XSPR_MASK, PPC403, { RT } },
-{ "mtpid", XSPR(31,467,945), XSPR_MASK, PPC403, { RT } },
-{ "mtccr0", XSPR(31,467,947), XSPR_MASK, PPC405, { RT } },
-{ "mtiac3", XSPR(31,467,948), XSPR_MASK, PPC405, { RT } },
-{ "mtiac4", XSPR(31,467,949), XSPR_MASK, PPC405, { RT } },
-{ "mtdvc1", XSPR(31,467,950), XSPR_MASK, PPC405, { RT } },
-{ "mtdvc2", XSPR(31,467,951), XSPR_MASK, PPC405, { RT } },
-{ "mtmmcr0", XSPR(31,467,952), XSPR_MASK, PPC750, { RT } },
-{ "mtsgr", XSPR(31,467,953), XSPR_MASK, PPC403, { RT } },
-{ "mtpmc1", XSPR(31,467,953), XSPR_MASK, PPC750, { RT } },
-{ "mtdcwr", XSPR(31,467,954), XSPR_MASK, PPC403, { RT } },
-{ "mtpmc2", XSPR(31,467,954), XSPR_MASK, PPC750, { RT } },
-{ "mtsler", XSPR(31,467,955), XSPR_MASK, PPC405, { RT } },
-{ "mtsia", XSPR(31,467,955), XSPR_MASK, PPC750, { RT } },
-{ "mtsu0r", XSPR(31,467,956), XSPR_MASK, PPC405, { RT } },
-{ "mtmmcr1", XSPR(31,467,956), XSPR_MASK, PPC750, { RT } },
-{ "mtdbcr1", XSPR(31,467,957), XSPR_MASK, PPC405, { RT } },
-{ "mtpmc3", XSPR(31,467,957), XSPR_MASK, PPC750, { RT } },
-{ "mtpmc4", XSPR(31,467,958), XSPR_MASK, PPC750, { RT } },
-{ "mticdbdr", XSPR(31,467,979), XSPR_MASK, PPC403, { RT } },
-{ "mtesr", XSPR(31,467,980), XSPR_MASK, PPC403, { RT } },
-{ "mtdear", XSPR(31,467,981), XSPR_MASK, PPC403, { RT } },
-{ "mtevpr", XSPR(31,467,982), XSPR_MASK, PPC403, { RT } },
-{ "mtcdbcr", XSPR(31,467,983), XSPR_MASK, PPC403, { RT } },
-{ "mttsr", XSPR(31,467,984), XSPR_MASK, PPC403, { RT } },
-{ "mttcr", XSPR(31,467,986), XSPR_MASK, PPC403, { RT } },
-{ "mtpit", XSPR(31,467,987), XSPR_MASK, PPC403, { RT } },
-{ "mttbhi", XSPR(31,467,988), XSPR_MASK, PPC403, { RT } },
-{ "mttblo", XSPR(31,467,989), XSPR_MASK, PPC403, { RT } },
-{ "mtsrr2", XSPR(31,467,990), XSPR_MASK, PPC403, { RT } },
-{ "mtsrr3", XSPR(31,467,991), XSPR_MASK, PPC403, { RT } },
-{ "mtdbsr", XSPR(31,467,1008), XSPR_MASK, PPC403, { RT } },
-{ "mtdbcr0", XSPR(31,467,1010), XSPR_MASK, PPC405, { RT } },
-{ "mtiac1", XSPR(31,467,1012), XSPR_MASK, PPC403, { RT } },
-{ "mtiac2", XSPR(31,467,1013), XSPR_MASK, PPC403, { RT } },
-{ "mtdac1", XSPR(31,467,1014), XSPR_MASK, PPC403, { RT } },
-{ "mtdac2", XSPR(31,467,1015), XSPR_MASK, PPC403, { RT } },
-{ "mtl2cr", XSPR(31,467,1017), XSPR_MASK, PPC750, { RT } },
-{ "mtdccr", XSPR(31,467,1018), XSPR_MASK, PPC403, { RT } },
-{ "mticcr", XSPR(31,467,1019), XSPR_MASK, PPC403, { RT } },
-{ "mtictc", XSPR(31,467,1019), XSPR_MASK, PPC750, { RT } },
-{ "mtpbl1", XSPR(31,467,1020), XSPR_MASK, PPC403, { RT } },
-{ "mtthrm1", XSPR(31,467,1020), XSPR_MASK, PPC750, { RT } },
-{ "mtpbu1", XSPR(31,467,1021), XSPR_MASK, PPC403, { RT } },
-{ "mtthrm2", XSPR(31,467,1021), XSPR_MASK, PPC750, { RT } },
-{ "mtpbl2", XSPR(31,467,1022), XSPR_MASK, PPC403, { RT } },
-{ "mtthrm3", XSPR(31,467,1022), XSPR_MASK, PPC750, { RT } },
-{ "mtpbu2", XSPR(31,467,1023), XSPR_MASK, PPC403, { RT } },
+{ "mtummcr0", XSPR(31,467,936), XSPR_MASK, PPC750, { RS } },
+{ "mtupmc1", XSPR(31,467,937), XSPR_MASK, PPC750, { RS } },
+{ "mtupmc2", XSPR(31,467,938), XSPR_MASK, PPC750, { RS } },
+{ "mtusia", XSPR(31,467,939), XSPR_MASK, PPC750, { RS } },
+{ "mtummcr1", XSPR(31,467,940), XSPR_MASK, PPC750, { RS } },
+{ "mtupmc3", XSPR(31,467,941), XSPR_MASK, PPC750, { RS } },
+{ "mtupmc4", XSPR(31,467,942), XSPR_MASK, PPC750, { RS } },
+{ "mtzpr", XSPR(31,467,944), XSPR_MASK, PPC403, { RS } },
+{ "mtccr0", XSPR(31,467,947), XSPR_MASK, PPC405, { RS } },
+{ "mtmmcr0", XSPR(31,467,952), XSPR_MASK, PPC750, { RS } },
+{ "mtsgr", XSPR(31,467,953), XSPR_MASK, PPC403, { RS } },
+{ "mtpmc1", XSPR(31,467,953), XSPR_MASK, PPC750, { RS } },
+{ "mtdcwr", XSPR(31,467,954), XSPR_MASK, PPC403, { RS } },
+{ "mtpmc2", XSPR(31,467,954), XSPR_MASK, PPC750, { RS } },
+{ "mtsler", XSPR(31,467,955), XSPR_MASK, PPC405, { RS } },
+{ "mtsia", XSPR(31,467,955), XSPR_MASK, PPC750, { RS } },
+{ "mtsu0r", XSPR(31,467,956), XSPR_MASK, PPC405, { RS } },
+{ "mtmmcr1", XSPR(31,467,956), XSPR_MASK, PPC750, { RS } },
+{ "mtpmc3", XSPR(31,467,957), XSPR_MASK, PPC750, { RS } },
+{ "mtpmc4", XSPR(31,467,958), XSPR_MASK, PPC750, { RS } },
+{ "mticdbdr", XSPR(31,467,979), XSPR_MASK, PPC403, { RS } },
+{ "mtevpr", XSPR(31,467,982), XSPR_MASK, PPC403, { RS } },
+{ "mtcdbcr", XSPR(31,467,983), XSPR_MASK, PPC403, { RS } },
+{ "mtpit", XSPR(31,467,987), XSPR_MASK, PPC403, { RS } },
+{ "mttbhi", XSPR(31,467,988), XSPR_MASK, PPC403, { RS } },
+{ "mttblo", XSPR(31,467,989), XSPR_MASK, PPC403, { RS } },
+{ "mtsrr2", XSPR(31,467,990), XSPR_MASK, PPC403, { RS } },
+{ "mtsrr3", XSPR(31,467,991), XSPR_MASK, PPC403, { RS } },
+{ "mtl2cr", XSPR(31,467,1017), XSPR_MASK, PPC750, { RS } },
+{ "mtdccr", XSPR(31,467,1018), XSPR_MASK, PPC403, { RS } },
+{ "mticcr", XSPR(31,467,1019), XSPR_MASK, PPC403, { RS } },
+{ "mtictc", XSPR(31,467,1019), XSPR_MASK, PPC750, { RS } },
+{ "mtpbl1", XSPR(31,467,1020), XSPR_MASK, PPC403, { RS } },
+{ "mtthrm1", XSPR(31,467,1020), XSPR_MASK, PPC750, { RS } },
+{ "mtpbu1", XSPR(31,467,1021), XSPR_MASK, PPC403, { RS } },
+{ "mtthrm2", XSPR(31,467,1021), XSPR_MASK, PPC750, { RS } },
+{ "mtpbl2", XSPR(31,467,1022), XSPR_MASK, PPC403, { RS } },
+{ "mtthrm3", XSPR(31,467,1022), XSPR_MASK, PPC750, { RS } },
+{ "mtpbu2", XSPR(31,467,1023), XSPR_MASK, PPC403, { RS } },
{ "mtspr", X(31,467), X_MASK, COM, { SPR, RS } },
{ "dcbi", X(31,470), XRT_MASK, PPC, { RA, RB } },
@@ -4065,7 +4058,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "dcbie", X(31,478), XRT_MASK, BOOKE64, { RA, RB } },
-{ "dcread", X(31,486), X_MASK, PPC403, { RT, RA, RB }},
+{ "dcread", X(31,486), X_MASK, PPC403|PPC440, { RT, RA, RB }},
{ "mtpmr", X(31,462), X_MASK, PPCPMR, { PMR, RS }},
@@ -4144,7 +4137,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "lswi", X(31,597), X_MASK, PPCCOM, { RT, RA, NB } },
{ "lsi", X(31,597), X_MASK, PWRCOM, { RT, RA, NB } },
-{ "lwsync", XSYNC(31,598,1), 0xffffffff, PPCONLY, { 0 } },
+{ "lwsync", XSYNC(31,598,1), 0xffffffff, PPC, { 0 } },
{ "ptesync", XSYNC(31,598,2), 0xffffffff, PPC64, { 0 } },
{ "msync", X(31,598), 0xffffffff, BOOKE, { 0 } },
{ "sync", X(31,598), XSYNC_MASK, PPCCOM, { LS } },
@@ -4202,8 +4195,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "stfdxe", X(31,735), X_MASK, BOOKE64, { FRS, RA, RB } },
-{ "dcba", X(31,758), XRT_MASK, PPC405, { RA, RB } },
-{ "dcba", X(31,758), XRT_MASK, BOOKE, { RA, RB } },
+{ "dcba", X(31,758), XRT_MASK, PPC405 | BOOKE, { RA, RB } },
{ "stfdux", X(31,759), X_MASK, COM, { FRS, RAS, RB } },
@@ -4247,11 +4239,10 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "mbar", X(31,854), X_MASK, BOOKE, { MO } },
{ "eieio", X(31,854), 0xffffffff, PPC, { 0 } },
-{ "tlbsx", XRC(31,914,0), X_MASK, PPC403, { RT, RA, RB } },
-{ "tlbsx.", XRC(31,914,1), X_MASK, PPC403, { RT, RA, RB } },
-
{ "tlbsx", XRC(31,914,0), X_MASK, BOOKE, { RA, RB } },
+{ "tlbsx", XRC(31,914,0), X_MASK, PPC403, { RT, RA, RB } },
{ "tlbsx.", XRC(31,914,1), X_MASK, BOOKE, { RA, RB } },
+{ "tlbsx.", XRC(31,914,1), X_MASK, PPC403, { RT, RA, RB } },
{ "tlbsxe", XRC(31,915,0), X_MASK, BOOKE64, { RA, RB } },
{ "tlbsxe.", XRC(31,915,1), X_MASK, BOOKE64, { RA, RB } },
@@ -4274,10 +4265,9 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "stdxe", X(31,927), X_MASK, BOOKE64, { RS, RA, RB } },
-{ "tlbre", X(31,946), X_MASK, BOOKE, { 0 } },
-
{ "tlbrehi", XTLB(31,946,0), XTLB_MASK, PPC403, { RT, RA } },
{ "tlbrelo", XTLB(31,946,1), XTLB_MASK, PPC403, { RT, RA } },
+{ "tlbre", X(31,946), X_MASK, BOOKE, { 0 } },
{ "tlbre", X(31,946), X_MASK, PPC403, { RS, RA, SH } },
{ "sraiq", XRC(31,952,0), X_MASK, M601, { RA, RS, SH } },
@@ -4288,15 +4278,13 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "stduxe", X(31,959), X_MASK, BOOKE64, { RS, RAS, RB } },
-{ "iccci", X(31,966), XRT_MASK, PPC403, { RA, RB } },
-
-{ "tlbwe", X(31,978), X_MASK, BOOKE, { 0 } },
-
-{ "tlbld", X(31,978), XRTRA_MASK, PPC, { RB } },
+{ "iccci", X(31,966), XRT_MASK, PPC403|PPC440, { RA, RB } },
{ "tlbwehi", XTLB(31,978,0), XTLB_MASK, PPC403, { RT, RA } },
{ "tlbwelo", XTLB(31,978,1), XTLB_MASK, PPC403, { RT, RA } },
+{ "tlbwe", X(31,978), X_MASK, BOOKE, { 0 } },
{ "tlbwe", X(31,978), X_MASK, PPC403, { RS, RA, SH } },
+{ "tlbld", X(31,978), XRTRA_MASK, PPC, { RB } },
{ "icbi", X(31,982), XRT_MASK, PPC, { RA, RB } },
@@ -4305,7 +4293,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
{ "extsw", XRC(31,986,0), XRB_MASK, PPC64 | BOOKE64,{ RA, RS } },
{ "extsw.", XRC(31,986,1), XRB_MASK, PPC64, { RA, RS } },
-{ "icread", X(31,998), XRT_MASK, PPC403, { RA, RB } },
+{ "icread", X(31,998), XRT_MASK, PPC403|PPC440, { RA, RB } },
{ "icbie", X(31,990), XRT_MASK, BOOKE64, { RA, RB } },
{ "stfiwxe", X(31,991), X_MASK, BOOKE64, { FRS, RA, RB } },
diff --git a/opcodes/v850-dis.c b/opcodes/v850-dis.c
index 7c449f67ad1..b5022cd42d0 100644
--- a/opcodes/v850-dis.c
+++ b/opcodes/v850-dis.c
@@ -1,20 +1,20 @@
/* Disassemble V850 instructions.
- Copyright 1996, 1997, 1998, 2000, 2001, 2002
+ Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdio.h>
@@ -78,6 +78,10 @@ disassemble (memaddr, info, insn)
case bfd_mach_v850e:
target_processor = PROCESSOR_V850E;
break;
+
+ case bfd_mach_v850e1:
+ target_processor = PROCESSOR_V850E1;
+ break;
}
/* Find the opcode. */
diff --git a/opcodes/v850-opc.c b/opcodes/v850-opc.c
index 94969ac48f2..2249d16803d 100644
--- a/opcodes/v850-opc.c
+++ b/opcodes/v850-opc.c
@@ -1,37 +1,37 @@
/* Assemble V850 instructions.
- Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "opcode/v850.h"
#include <stdio.h>
#include "opintl.h"
-/* regular opcode */
+/* Regular opcodes. */
#define OP(x) ((x & 0x3f) << 5)
#define OP_MASK OP (0x3f)
-/* conditional branch opcode */
+/* Conditional branch opcodes. */
#define BOP(x) ((0x0b << 7) | (x & 0x0f))
#define BOP_MASK ((0x0f << 7) | 0x0f)
-/* one-word opcodes */
+/* One-word opcodes. */
#define one(x) ((unsigned int) (x))
-/* two-word opcodes */
+/* Two-word opcodes. */
#define two(x,y) ((unsigned int) (x) | ((unsigned int) (y) << 16))
static long unsigned insert_d9 PARAMS ((long unsigned, long, const char **));
@@ -402,15 +402,15 @@ const struct v850_operand v850_operands[] =
#define UNUSED 0
{ 0, 0, NULL, NULL, 0 },
-/* The R1 field in a format 1, 6, 7, or 9 insn. */
+/* The R1 field in a format 1, 6, 7, or 9 insn. */
#define R1 (UNUSED + 1)
{ 5, 0, NULL, NULL, V850_OPERAND_REG },
/* As above, but register 0 is not allowed. */
#define R1_NOTR0 (R1 + 1)
- { 5, 0, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 },
+ { 5, 0, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 },
-/* The R2 field in a format 1, 2, 4, 5, 6, 7, 9 insn. */
+/* The R2 field in a format 1, 2, 4, 5, 6, 7, 9 insn. */
#define R2 (R1_NOTR0 + 1)
{ 5, 11, NULL, NULL, V850_OPERAND_REG },
@@ -418,23 +418,23 @@ const struct v850_operand v850_operands[] =
#define R2_NOTR0 (R2 + 1)
{ 5, 11, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 },
-/* The imm5 field in a format 2 insn. */
+/* The imm5 field in a format 2 insn. */
#define I5 (R2_NOTR0 + 1)
{ 5, 0, NULL, NULL, V850_OPERAND_SIGNED },
-/* The unsigned imm5 field in a format 2 insn. */
+/* The unsigned imm5 field in a format 2 insn. */
#define I5U (I5 + 1)
{ 5, 0, NULL, NULL, 0 },
-/* The imm16 field in a format 6 insn. */
+/* The imm16 field in a format 6 insn. */
#define I16 (I5U + 1)
{ 16, 16, NULL, NULL, V850_OPERAND_SIGNED },
-/* The signed disp7 field in a format 4 insn. */
+/* The signed disp7 field in a format 4 insn. */
#define D7 (I16 + 1)
{ 7, 0, NULL, NULL, 0},
-/* The disp16 field in a format 6 insn. */
+/* The disp16 field in a format 6 insn. */
#define D16_15 (D7 + 1)
{ 15, 17, insert_d16_15, extract_d16_15, V850_OPERAND_SIGNED },
@@ -446,11 +446,11 @@ const struct v850_operand v850_operands[] =
#define CCCC (B3 + 1)
{ 4, 0, NULL, NULL, V850_OPERAND_CC },
-/* The unsigned DISP8 field in a format 4 insn. */
+/* The unsigned DISP8 field in a format 4 insn. */
#define D8_7 (CCCC + 1)
{ 7, 0, insert_d8_7, extract_d8_7, 0 },
-/* The unsigned DISP8 field in a format 4 insn. */
+/* The unsigned DISP8 field in a format 4 insn. */
#define D8_6 (D8_7 + 1)
{ 6, 1, insert_d8_6, extract_d8_6, 0 },
@@ -462,7 +462,7 @@ const struct v850_operand v850_operands[] =
#define EP (SR1 + 1)
{ 0, 0, NULL, NULL, V850_OPERAND_EP },
-/* The imm16 field (unsigned) in a format 6 insn. */
+/* The imm16 field (unsigned) in a format 6 insn. */
#define I16U (EP + 1)
{ 16, 16, NULL, NULL, 0},
@@ -470,11 +470,11 @@ const struct v850_operand v850_operands[] =
#define SR2 (I16U + 1)
{ 5, 11, NULL, NULL, V850_OPERAND_SRG },
-/* The disp16 field in a format 8 insn. */
+/* The disp16 field in a format 8 insn. */
#define D16 (SR2 + 1)
{ 16, 16, NULL, NULL, V850_OPERAND_SIGNED },
-/* The DISP9 field in a format 3 insn, relaxable. */
+/* The DISP9 field in a format 3 insn, relaxable. */
#define D9_RELAX (D16 + 1)
{ 9, 0, insert_d9, extract_d9, V850_OPERAND_RELAX | V850_OPERAND_SIGNED | V850_OPERAND_DISP },
@@ -484,19 +484,19 @@ const struct v850_operand v850_operands[] =
#define D22 (D9_RELAX + 1)
{ 22, 0, insert_d22, extract_d22, V850_OPERAND_SIGNED | V850_OPERAND_DISP },
-/* The signed disp4 field in a format 4 insn. */
+/* The signed disp4 field in a format 4 insn. */
#define D4 (D22 + 1)
{ 4, 0, NULL, NULL, 0},
-/* The unsigned disp5 field in a format 4 insn. */
+/* The unsigned disp5 field in a format 4 insn. */
#define D5_4 (D4 + 1)
{ 4, 0, insert_d5_4, extract_d5_4, 0 },
-/* The disp16 field in an format 7 unsigned byte load insn. */
+/* The disp16 field in an format 7 unsigned byte load insn. */
#define D16_16 (D5_4 + 1)
{ -1, 0xfffe0020, insert_d16_16, extract_d16_16, 0 },
-/* Third register in conditional moves. */
+/* Third register in conditional moves. */
#define R3 (D16_16 + 1)
{ 5, 27, NULL, NULL, V850_OPERAND_REG },
@@ -504,11 +504,11 @@ const struct v850_operand v850_operands[] =
#define MOVCC (R3 + 1)
{ 4, 17, NULL, NULL, V850_OPERAND_CC },
-/* The imm9 field in a multiply word. */
+/* The imm9 field in a multiply word. */
#define I9 (MOVCC + 1)
{ 9, 0, insert_i9, extract_i9, V850_OPERAND_SIGNED },
-/* The unsigned imm9 field in a multiply word. */
+/* The unsigned imm9 field in a multiply word. */
#define U9 (I9 + 1)
{ 9, 0, insert_u9, extract_u9, 0 },
@@ -516,7 +516,7 @@ const struct v850_operand v850_operands[] =
#define LIST12 (U9 + 1)
{ -1, 0xffe00001, NULL, NULL, V850E_PUSH_POP },
-/* The IMM6 field in a call instruction. */
+/* The IMM6 field in a call instruction. */
#define I6 (LIST12 + 1)
{ 6, 0, NULL, NULL, 0 },
@@ -528,19 +528,19 @@ const struct v850_operand v850_operands[] =
#define IMM32 (IMM16 + 1)
{ 0, 0, NULL, NULL, V850E_IMMEDIATE32 },
-/* The imm5 field in a push/pop instruction. */
+/* The imm5 field in a push/pop instruction. */
#define IMM5 (IMM32 + 1)
{ 5, 1, NULL, NULL, 0 },
-/* Reg2 in dispose instruction. */
+/* Reg2 in dispose instruction. */
#define R2DISPOSE (IMM5 + 1)
{ 5, 16, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0 },
-/* Stack pointer in prepare instruction. */
+/* Stack pointer in prepare instruction. */
#define SP (R2DISPOSE + 1)
{ 2, 19, insert_spe, extract_spe, V850_OPERAND_REG },
-/* The IMM5 field in a divide N step instruction. */
+/* The IMM5 field in a divide N step instruction. */
#define I5DIV (SP + 1)
{ 9, 0, insert_i5div, extract_i5div, V850_OPERAND_SIGNED },
@@ -550,23 +550,24 @@ const struct v850_operand v850_operands[] =
/* The list of registers in a PUSHML/POPML instruction. */
#define LIST18_L (LIST18_H + 1)
- { -1, 0xfff8001f, NULL, NULL, V850E_PUSH_POP }, /* The setting of the 4th bit is a flag to disassmble() in v850-dis.c */
+ /* The setting of the 4th bit is a flag to disassmble() in v850-dis.c. */
+ { -1, 0xfff8001f, NULL, NULL, V850E_PUSH_POP },
} ;
-/* reg-reg instruction format (Format I) */
+/* Reg - Reg instruction format (Format I). */
#define IF1 {R1, R2}
-/* imm-reg instruction format (Format II) */
+/* Imm - Reg instruction format (Format II). */
#define IF2 {I5, R2}
-/* conditional branch instruction format (Format III) */
+/* Conditional branch instruction format (Format III). */
#define IF3 {D9_RELAX}
-/* 3 operand instruction (Format VI) */
+/* 3 operand instruction (Format VI). */
#define IF6 {I16, R1, R2}
-/* 3 operand instruction (Format VI) */
+/* 3 operand instruction (Format VI). */
#define IF6U {I16U, R1, R2}
@@ -604,17 +605,22 @@ const struct v850_operand v850_operands[] =
const struct v850_opcode v850_opcodes[] =
{
{ "breakpoint", 0xffff, 0xffff, {UNUSED}, 0, PROCESSOR_ALL },
+{ "dbtrap", one (0xf840), one (0xffff), {UNUSED}, 0, PROCESSOR_V850E1 },
{ "jmp", one (0x0060), one (0xffe0), {R1}, 1, PROCESSOR_ALL },
-/* load/store instructions */
+/* Load/store instructions. */
+{ "sld.bu", one (0x0060), one (0x07f0), {D4, EP, R2_NOTR0}, 1, PROCESSOR_V850E1 },
{ "sld.bu", one (0x0060), one (0x07f0), {D4, EP, R2_NOTR0}, 1, PROCESSOR_V850E },
+{ "sld.hu", one (0x0070), one (0x07f0), {D5_4, EP, R2_NOTR0}, 1, PROCESSOR_V850E1 },
{ "sld.hu", one (0x0070), one (0x07f0), {D5_4, EP, R2_NOTR0}, 1, PROCESSOR_V850E },
+{ "sld.b", one (0x0300), one (0x0780), {D7, EP, R2}, 1, PROCESSOR_V850E1 },
{ "sld.b", one (0x0300), one (0x0780), {D7, EP, R2}, 1, PROCESSOR_V850E },
{ "sld.b", one (0x0300), one (0x0780), {D7, EP, R2}, 1, PROCESSOR_V850 },
+{ "sld.h", one (0x0400), one (0x0780), {D8_7, EP, R2}, 1, PROCESSOR_V850E1 },
{ "sld.h", one (0x0400), one (0x0780), {D8_7, EP, R2}, 1, PROCESSOR_V850E },
{ "sld.h", one (0x0400), one (0x0780), {D8_7, EP, R2}, 1, PROCESSOR_V850 },
{ "sld.w", one (0x0500), one (0x0781), {D8_6, EP, R2}, 1, PROCESSOR_ALL },
@@ -639,7 +645,7 @@ const struct v850_opcode v850_opcodes[] =
{ "st.h", two (0x0760, 0x0000), two (0x07e0, 0x0001), {R2, D16_15, R1}, 2, PROCESSOR_ALL },
{ "st.w", two (0x0760, 0x0001), two (0x07e0, 0x0001), {R2, D16_15, R1}, 2, PROCESSOR_ALL },
-/* byte swap/extend instructions */
+/* Byte swap/extend instructions. */
{ "zxb", one (0x0080), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 },
{ "zxh", one (0x00c0), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 },
{ "sxb", one (0x00a0), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 },
@@ -648,12 +654,12 @@ const struct v850_opcode v850_opcodes[] =
{ "bsw", two (0x07e0, 0x0340), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 },
{ "hsw", two (0x07e0, 0x0344), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 },
-/* jump table instructions */
+/* Jump table instructions. */
{ "switch", one (0x0040), one (0xffe0), {R1}, 1, PROCESSOR_NOT_V850 },
{ "callt", one (0x0200), one (0xffc0), {I6}, 0, PROCESSOR_NOT_V850 },
{ "ctret", two (0x07e0, 0x0144), two (0xffff, 0xffff), {0}, 0, PROCESSOR_NOT_V850 },
-/* arithmetic operation instructions */
+/* Arithmetic operation instructions. */
{ "setf", two (0x07e0, 0x0000), two (0x07f0, 0xffff), {CCCC, R2}, 0, PROCESSOR_ALL },
{ "cmov", two (0x07e0, 0x0320), two (0x07e0, 0x07e1), {MOVCC, R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
{ "cmov", two (0x07e0, 0x0300), two (0x07e0, 0x07e1), {MOVCC, I5, R2, R3}, 0, PROCESSOR_NOT_V850 },
@@ -686,14 +692,14 @@ const struct v850_opcode v850_opcodes[] =
{ "cmp", OP (0x0f), OP_MASK, IF1, 0, PROCESSOR_ALL },
{ "cmp", OP (0x13), OP_MASK, IF2, 0, PROCESSOR_ALL },
-/* saturated operation instructions */
+/* Saturated operation instructions. */
{ "satadd", OP (0x11), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL },
{ "satadd", OP (0x06), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
{ "satsub", OP (0x05), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
{ "satsubi", OP (0x33), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL },
{ "satsubr", OP (0x04), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
-/* logical operation instructions */
+/* Logical operation instructions. */
{ "tst", OP (0x0b), OP_MASK, IF1, 0, PROCESSOR_ALL },
{ "or", OP (0x08), OP_MASK, IF1, 0, PROCESSOR_ALL },
{ "ori", OP (0x34), OP_MASK, IF6U, 0, PROCESSOR_ALL },
@@ -710,21 +716,21 @@ const struct v850_opcode v850_opcodes[] =
{ "shr", two (0x07e0, 0x0080), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL },
{ "sasf", two (0x07e0, 0x0200), two (0x07f0, 0xffff), {CCCC, R2}, 0, PROCESSOR_NOT_V850 },
-/* branch instructions */
- /* signed integer */
+/* Branch instructions. */
+ /* Signed integer. */
{ "bgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "bge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "blt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "ble", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL },
- /* unsigned integer */
+ /* Unsigned integer. */
{ "bh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "bnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "bl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "bnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
- /* common */
+ /* Common. */
{ "be", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "bne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
- /* others */
+ /* Others. */
{ "bv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "bnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "bn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL },
@@ -741,20 +747,20 @@ const struct v850_opcode v850_opcodes[] =
We use the short form in the opcode/mask fields. The assembler
will twiddle bits as necessary if the long form is needed. */
- /* signed integer */
+ /* Signed integer. */
{ "jgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "jge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "jlt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "jle", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL },
- /* unsigned integer */
+ /* Unsigned integer. */
{ "jh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "jnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "jl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "jnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL },
- /* common */
+ /* Common. */
{ "je", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "jne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL },
- /* others */
+ /* Others. */
{ "jv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "jnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL },
{ "jn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL },
@@ -769,7 +775,7 @@ const struct v850_opcode v850_opcodes[] =
{ "jr", one (0x0780), two (0xffc0, 0x0001), {D22}, 0, PROCESSOR_ALL },
{ "jarl", one (0x0780), two (0x07c0, 0x0001), {D22, R2}, 0, PROCESSOR_ALL},
-/* bit manipulation instructions */
+/* Bit manipulation instructions. */
{ "set1", two (0x07c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL },
{ "set1", two (0x07e0, 0x00e0), two (0x07e0, 0xffff), {R2, R1}, 2, PROCESSOR_NOT_V850 },
{ "not1", two (0x47c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL },
@@ -779,7 +785,7 @@ const struct v850_opcode v850_opcodes[] =
{ "tst1", two (0xc7c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 2, PROCESSOR_ALL },
{ "tst1", two (0x07e0, 0x00e6), two (0x07e0, 0xffff), {R2, R1}, 2, PROCESSOR_NOT_V850 },
-/* special instructions */
+/* Special instructions. */
{ "di", two (0x07e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
{ "ei", two (0x87e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
{ "halt", two (0x07e0, 0x0120), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL },
@@ -787,10 +793,10 @@ const struct v850_opcode v850_opcodes[] =
{ "trap", two (0x07e0, 0x0100), two (0xffe0, 0xffff), {I5U}, 0, PROCESSOR_ALL },
{ "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0xffff), {R1, SR2}, 0, PROCESSOR_ALL },
{ "stsr", two (0x07e0, 0x0040), two (0x07e0, 0xffff), {SR1, R2}, 0, PROCESSOR_ALL },
+{ "dbret", two (0x07e0, 0x0146), two (0xffff, 0xffff), {UNUSED}, 0, PROCESSOR_V850E1 },
{ 0, 0, 0, {0}, 0, 0 },
} ;
const int v850_num_opcodes =
sizeof (v850_opcodes) / sizeof (v850_opcodes[0]);
-
diff --git a/opcodes/xstormy16-asm.c b/opcodes/xstormy16-asm.c
index 810938c4a93..618e33b2f07 100644
--- a/opcodes/xstormy16-asm.c
+++ b/opcodes/xstormy16-asm.c
@@ -43,7 +43,7 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
+ (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *);
/* -- assembler routines inserted here. */
@@ -317,8 +317,7 @@ xstormy16_cgen_init_asm (cd)
Returns NULL for success, an error message for failure. */
char *
-xstormy16_cgen_build_insn_regex (insn)
- CGEN_INSN *insn;
+xstormy16_cgen_build_insn_regex (CGEN_INSN *insn)
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
@@ -441,11 +440,10 @@ xstormy16_cgen_build_insn_regex (insn)
Returns NULL for success, an error message for failure. */
static const char *
-parse_insn_normal (cd, insn, strp, fields)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- const char **strp;
- CGEN_FIELDS *fields;
+parse_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ const char **strp,
+ CGEN_FIELDS *fields)
{
/* ??? Runtime added insns not handled yet. */
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
@@ -583,12 +581,11 @@ parse_insn_normal (cd, insn, strp, fields)
mind helps keep the design clean. */
const CGEN_INSN *
-xstormy16_cgen_assemble_insn (cd, str, fields, buf, errmsg)
- CGEN_CPU_DESC cd;
- const char *str;
- CGEN_FIELDS *fields;
- CGEN_INSN_BYTES_PTR buf;
- char **errmsg;
+xstormy16_cgen_assemble_insn (CGEN_CPU_DESC cd,
+ const char *str,
+ CGEN_FIELDS *fields,
+ CGEN_INSN_BYTES_PTR buf,
+ char **errmsg)
{
const char *start;
CGEN_INSN_LIST *ilist;
@@ -692,9 +689,7 @@ xstormy16_cgen_assemble_insn (cd, str, fields, buf, errmsg)
FIXME: Not currently used. */
void
-xstormy16_cgen_asm_hash_keywords (cd, opvals)
- CGEN_CPU_DESC cd;
- CGEN_KEYWORD *opvals;
+xstormy16_cgen_asm_hash_keywords (CGEN_CPU_DESC cd, CGEN_KEYWORD *opvals)
{
CGEN_KEYWORD_SEARCH search = cgen_keyword_search_init (opvals, NULL);
const CGEN_KEYWORD_ENTRY * ke;
diff --git a/opcodes/xstormy16-dis.c b/opcodes/xstormy16-dis.c
index 17c54a68a15..54af2571ab5 100644
--- a/opcodes/xstormy16-dis.c
+++ b/opcodes/xstormy16-dis.c
@@ -41,21 +41,20 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define UNKNOWN_INSN_MSG _("*unknown*")
static void print_normal
- PARAMS ((CGEN_CPU_DESC, PTR, long, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
static void print_address
- PARAMS ((CGEN_CPU_DESC, PTR, bfd_vma, unsigned int, bfd_vma, int));
+ (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int);
static void print_keyword
- PARAMS ((CGEN_CPU_DESC, PTR, CGEN_KEYWORD *, long, unsigned int));
+ (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int);
static void print_insn_normal
- PARAMS ((CGEN_CPU_DESC, PTR, const CGEN_INSN *, CGEN_FIELDS *,
- bfd_vma, int));
+ (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
static int print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, unsigned);
static int default_print_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *);
static int read_insn
- PARAMS ((CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int,
- CGEN_EXTRACT_INFO *, unsigned long *));
+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, char *, int, CGEN_EXTRACT_INFO *,
+ unsigned long *);
/* -- disassembler routines inserted here */
@@ -194,13 +193,12 @@ xstormy16_cgen_init_dis (cd)
/* Default print handler. */
static void
-print_normal (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- long value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ long value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -220,13 +218,12 @@ print_normal (cd, dis_info, value, attrs, pc, length)
/* Default address handler. */
static void
-print_address (cd, dis_info, value, attrs, pc, length)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- bfd_vma value;
- unsigned int attrs;
- bfd_vma pc ATTRIBUTE_UNUSED;
- int length ATTRIBUTE_UNUSED;
+print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ bfd_vma value,
+ unsigned int attrs,
+ bfd_vma pc ATTRIBUTE_UNUSED,
+ int length ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
@@ -250,12 +247,11 @@ print_address (cd, dis_info, value, attrs, pc, length)
/* Keyword print handler. */
static void
-print_keyword (cd, dis_info, keyword_table, value, attrs)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- PTR dis_info;
- CGEN_KEYWORD *keyword_table;
- long value;
- unsigned int attrs ATTRIBUTE_UNUSED;
+print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ void *dis_info,
+ CGEN_KEYWORD *keyword_table,
+ long value,
+ unsigned int attrs ATTRIBUTE_UNUSED)
{
disassemble_info *info = (disassemble_info *) dis_info;
const CGEN_KEYWORD_ENTRY *ke;
@@ -269,17 +265,16 @@ print_keyword (cd, dis_info, keyword_table, value, attrs)
/* Default insn printer.
- DIS_INFO is defined as `PTR' so the disassembler needn't know anything
+ DIS_INFO is defined as `void *' so the disassembler needn't know anything
about disassemble_info. */
static void
-print_insn_normal (cd, dis_info, insn, fields, pc, length)
- CGEN_CPU_DESC cd;
- PTR dis_info;
- const CGEN_INSN *insn;
- CGEN_FIELDS *fields;
- bfd_vma pc;
- int length;
+print_insn_normal (CGEN_CPU_DESC cd,
+ void *dis_info,
+ const CGEN_INSN *insn,
+ CGEN_FIELDS *fields,
+ bfd_vma pc,
+ int length)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
disassemble_info *info = (disassemble_info *) dis_info;
@@ -311,14 +306,13 @@ print_insn_normal (cd, dis_info, insn, fields, pc, length)
Returns 0 if all is well, non-zero otherwise. */
static int
-read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- int buflen;
- CGEN_EXTRACT_INFO *ex_info;
- unsigned long *insn_value;
+read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ int buflen,
+ CGEN_EXTRACT_INFO *ex_info,
+ unsigned long *insn_value)
{
int status = (*info->read_memory_func) (pc, buf, buflen, info);
if (status != 0)
@@ -342,12 +336,11 @@ read_insn (cd, pc, info, buf, buflen, ex_info, insn_value)
been called). */
static int
-print_insn (cd, pc, info, buf, buflen)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
- char *buf;
- unsigned int buflen;
+print_insn (CGEN_CPU_DESC cd,
+ bfd_vma pc,
+ disassemble_info *info,
+ char *buf,
+ unsigned int buflen)
{
CGEN_INSN_INT insn_value;
const CGEN_INSN_LIST *insn_list;
@@ -452,10 +445,7 @@ print_insn (cd, pc, info, buf, buflen)
#endif
static int
-default_print_insn (cd, pc, info)
- CGEN_CPU_DESC cd;
- bfd_vma pc;
- disassemble_info *info;
+default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
{
char buf[CGEN_MAX_INSN_SIZE];
int buflen;
@@ -494,9 +484,7 @@ typedef struct cpu_desc_list {
} cpu_desc_list;
int
-print_insn_xstormy16 (pc, info)
- bfd_vma pc;
- disassemble_info *info;
+print_insn_xstormy16 (bfd_vma pc, disassemble_info *info)
{
static cpu_desc_list *cd_list = 0;
cpu_desc_list *cl = 0;
diff --git a/opcodes/xstormy16-ibld.c b/opcodes/xstormy16-ibld.c
index 0e4876a6f48..13433e0ea63 100644
--- a/opcodes/xstormy16-ibld.c
+++ b/opcodes/xstormy16-ibld.c
@@ -44,30 +44,29 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#define FLD(f) (fields->f)
static const char * insert_normal
- PARAMS ((CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR));
+ (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR);
static const char * insert_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *,
- CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *,
+ CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma);
static int extract_normal
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
- unsigned int, unsigned int, unsigned int, unsigned int,
- unsigned int, unsigned int, bfd_vma, long *));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT,
+ unsigned int, unsigned int, unsigned int, unsigned int,
+ unsigned int, unsigned int, bfd_vma, long *);
static int extract_insn_normal
- PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
- CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma));
+ (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *,
+ CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma);
#if CGEN_INT_INSN_P
static void put_insn_int_value
- PARAMS ((CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT));
+ (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT);
#endif
#if ! CGEN_INT_INSN_P
static CGEN_INLINE void insert_1
- PARAMS ((CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *));
+ (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *);
static CGEN_INLINE int fill_cache
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma);
static CGEN_INLINE long extract_1
- PARAMS ((CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int,
- unsigned char *, bfd_vma));
+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma);
#endif
/* Operand insertion. */
@@ -77,11 +76,12 @@ static CGEN_INLINE long extract_1
/* Subroutine of insert_normal. */
static CGEN_INLINE void
-insert_1 (cd, value, start, length, word_length, bufp)
- CGEN_CPU_DESC cd;
- unsigned long value;
- int start,length,word_length;
- unsigned char *bufp;
+insert_1 (CGEN_CPU_DESC cd,
+ unsigned long value,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp)
{
unsigned long x,mask;
int shift;
@@ -118,13 +118,15 @@ insert_1 (cd, value, start, length, word_length, bufp)
necessary. */
static const char *
-insert_normal (cd, value, attrs, word_offset, start, length, word_length,
- total_length, buffer)
- CGEN_CPU_DESC cd;
- long value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
- CGEN_INSN_BYTES_PTR buffer;
+insert_normal (CGEN_CPU_DESC cd,
+ long value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
+ CGEN_INSN_BYTES_PTR buffer)
{
static char errbuf[100];
/* Written this way to avoid undefined behaviour. */
@@ -232,12 +234,11 @@ insert_normal (cd, value, attrs, word_offset, start, length, word_length,
The result is an error message or NULL if success. */
static const char *
-insert_insn_normal (cd, insn, fields, buffer, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN * insn;
- CGEN_FIELDS * fields;
- CGEN_INSN_BYTES_PTR buffer;
- bfd_vma pc;
+insert_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN * insn,
+ CGEN_FIELDS * fields,
+ CGEN_INSN_BYTES_PTR buffer,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
unsigned long value;
@@ -288,12 +289,11 @@ insert_insn_normal (cd, insn, fields, buffer, pc)
because it needs <prefix>-desc.h for CGEN_INT_INSN_P. */
static void
-put_insn_int_value (cd, buf, length, insn_length, value)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_INSN_BYTES_PTR buf;
- int length;
- int insn_length;
- CGEN_INSN_INT value;
+put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_INSN_BYTES_PTR buf,
+ int length,
+ int insn_length,
+ CGEN_INSN_INT value)
{
/* For architectures with insns smaller than the base-insn-bitsize,
length may be too big. */
@@ -320,11 +320,11 @@ put_insn_int_value (cd, buf, length, insn_length, value)
Returns 1 for success, 0 for failure. */
static CGEN_INLINE int
-fill_cache (cd, ex_info, offset, bytes, pc)
- CGEN_CPU_DESC cd ATTRIBUTE_UNUSED;
- CGEN_EXTRACT_INFO *ex_info;
- int offset, bytes;
- bfd_vma pc;
+fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ CGEN_EXTRACT_INFO *ex_info,
+ int offset,
+ int bytes,
+ bfd_vma pc)
{
/* It's doubtful that the middle part has already been fetched so
we don't optimize that case. kiss. */
@@ -364,12 +364,13 @@ fill_cache (cd, ex_info, offset, bytes, pc)
/* Subroutine of extract_normal. */
static CGEN_INLINE long
-extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
- CGEN_CPU_DESC cd;
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
- int start,length,word_length;
- unsigned char *bufp;
- bfd_vma pc ATTRIBUTE_UNUSED;
+extract_1 (CGEN_CPU_DESC cd,
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
+ int start,
+ int length,
+ int word_length,
+ unsigned char *bufp,
+ bfd_vma pc ATTRIBUTE_UNUSED)
{
unsigned long x;
int shift;
@@ -408,23 +409,25 @@ extract_1 (cd, ex_info, start, length, word_length, bufp, pc)
necessary. */
static int
-extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
- word_length, total_length, pc, valuep)
- CGEN_CPU_DESC cd;
+extract_normal (CGEN_CPU_DESC cd,
#if ! CGEN_INT_INSN_P
- CGEN_EXTRACT_INFO *ex_info;
+ CGEN_EXTRACT_INFO *ex_info,
#else
- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED;
+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED,
#endif
- CGEN_INSN_INT insn_value;
- unsigned int attrs;
- unsigned int word_offset, start, length, word_length, total_length;
+ CGEN_INSN_INT insn_value,
+ unsigned int attrs,
+ unsigned int word_offset,
+ unsigned int start,
+ unsigned int length,
+ unsigned int word_length,
+ unsigned int total_length,
#if ! CGEN_INT_INSN_P
- bfd_vma pc;
+ bfd_vma pc,
#else
- bfd_vma pc ATTRIBUTE_UNUSED;
+ bfd_vma pc ATTRIBUTE_UNUSED,
#endif
- long *valuep;
+ long *valuep)
{
long value, mask;
@@ -505,13 +508,12 @@ extract_normal (cd, ex_info, insn_value, attrs, word_offset, start, length,
been called). */
static int
-extract_insn_normal (cd, insn, ex_info, insn_value, fields, pc)
- CGEN_CPU_DESC cd;
- const CGEN_INSN *insn;
- CGEN_EXTRACT_INFO *ex_info;
- CGEN_INSN_INT insn_value;
- CGEN_FIELDS *fields;
- bfd_vma pc;
+extract_insn_normal (CGEN_CPU_DESC cd,
+ const CGEN_INSN *insn,
+ CGEN_EXTRACT_INFO *ex_info,
+ CGEN_INSN_INT insn_value,
+ CGEN_FIELDS *fields,
+ bfd_vma pc)
{
const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
const CGEN_SYNTAX_CHAR_TYPE *syn;
diff --git a/readline/doc/ChangeLog.gdb b/readline/doc/ChangeLog.gdb
index 49f4591c8ed..854d3ee8f2a 100644
--- a/readline/doc/ChangeLog.gdb
+++ b/readline/doc/ChangeLog.gdb
@@ -1,3 +1,7 @@
+2003-09-14 Andrew Cagney <cagney@redhat.com>
+
+ * history.0: Delete generated file.
+
2002-02-24 Elena Zannoni <ezannoni@redhat.com>
* ChangeLog.gdb: Renamed from ChangeLog.
diff --git a/readline/doc/history.0 b/readline/doc/history.0
deleted file mode 100644
index 324c363a66e..00000000000
--- a/readline/doc/history.0
+++ /dev/null
@@ -1,660 +0,0 @@
-
-
-
-HISTORY(3) HISTORY(3)
-
-
-NNAAMMEE
- history - GNU History Library
-
-CCOOPPYYRRIIGGHHTT
- The GNU History Library is Copyright (C) 1989-2002 by the
- Free Software Foundation, Inc.
-
-DDEESSCCRRIIPPTTIIOONN
- Many programs read input from the user a line at a time.
- The GNU History library is able to keep track of those
- lines, associate arbitrary data with each line, and uti-
- lize information from previous lines in composing new
- ones.
-
-
-HHIISSTTOORRYY EEXXPPAANNSSIIOONN
- The history library supports a history expansion feature
- that is identical to the history expansion in bbaasshh.. This
- section describes what syntax features are available.
-
- History expansions introduce words from the history list
- into the input stream, making it easy to repeat commands,
- insert the arguments to a previous command into the cur-
- rent input line, or fix errors in previous commands
- quickly.
-
- History expansion is usually performed immediately after a
- complete line is read. It takes place in two parts. The
- first is to determine which line from the history list to
- use during substitution. The second is to select portions
- of that line for inclusion into the current one. The line
- selected from the history is the _e_v_e_n_t, and the portions
- of that line that are acted upon are _w_o_r_d_s. Various _m_o_d_i_-
- _f_i_e_r_s are available to manipulate the selected words. The
- line is broken into words in the same fashion as bbaasshh does
- when reading input, so that several words that would oth-
- erwise be separated are considered one word when sur-
- rounded by quotes (see the description of hhiissttoorryy__ttookk--
- eenniizzee(()) below). History expansions are introduced by the
- appearance of the history expansion character, which is !!
- by default. Only backslash (\\) and single quotes can
- quote the history expansion character.
-
- EEvveenntt DDeessiiggnnaattoorrss
- An event designator is a reference to a command line entry
- in the history list.
-
- !! Start a history substitution, except when followed
- by a bbllaannkk, newline, = or (.
- !!_n Refer to command line _n.
- !!--_n Refer to the current command line minus _n.
- !!!! Refer to the previous command. This is a synonym
- for `!-1'.
-
-
-
-
-GNU History 4.3 2002 January 31 1
-
-
-
-
-
-HISTORY(3) HISTORY(3)
-
-
- !!_s_t_r_i_n_g
- Refer to the most recent command starting with
- _s_t_r_i_n_g.
- !!??_s_t_r_i_n_g[[??]]
- Refer to the most recent command containing _s_t_r_i_n_g.
- The trailing ?? may be omitted if _s_t_r_i_n_g is followed
- immediately by a newline.
- ^^_s_t_r_i_n_g_1^^_s_t_r_i_n_g_2^^
- Quick substitution. Repeat the last command,
- replacing _s_t_r_i_n_g_1 with _s_t_r_i_n_g_2. Equivalent to
- ``!!:s/_s_t_r_i_n_g_1/_s_t_r_i_n_g_2/'' (see MMooddiiffiieerrss below).
- !!## The entire command line typed so far.
-
- WWoorrdd DDeessiiggnnaattoorrss
- Word designators are used to select desired words from the
- event. A :: separates the event specification from the
- word designator. It may be omitted if the word designator
- begins with a ^^, $$, **, --, or %%. Words are numbered from
- the beginning of the line, with the first word being
- denoted by 0 (zero). Words are inserted into the current
- line separated by single spaces.
-
- 00 ((zzeerroo))
- The zeroth word. For the shell, this is the com-
- mand word.
- _n The _nth word.
- ^^ The first argument. That is, word 1.
- $$ The last argument.
- %% The word matched by the most recent `?_s_t_r_i_n_g?'
- search.
- _x--_y A range of words; `-_y' abbreviates `0-_y'.
- ** All of the words but the zeroth. This is a synonym
- for `_1_-_$'. It is not an error to use ** if there is
- just one word in the event; the empty string is
- returned in that case.
- xx** Abbreviates _x_-_$.
- xx-- Abbreviates _x_-_$ like xx**, but omits the last word.
-
- If a word designator is supplied without an event specifi-
- cation, the previous command is used as the event.
-
- MMooddiiffiieerrss
- After the optional word designator, there may appear a
- sequence of one or more of the following modifiers, each
- preceded by a `:'.
-
- hh Remove a trailing file name component, leaving only
- the head.
- tt Remove all leading file name components, leaving
- the tail.
- rr Remove a trailing suffix of the form _._x_x_x, leaving
- the basename.
- ee Remove all but the trailing suffix.
- pp Print the new command but do not execute it.
-
-
-
-GNU History 4.3 2002 January 31 2
-
-
-
-
-
-HISTORY(3) HISTORY(3)
-
-
- qq Quote the substituted words, escaping further sub-
- stitutions.
- xx Quote the substituted words as with qq, but break
- into words at bbllaannkkss and newlines.
- ss//_o_l_d//_n_e_w//
- Substitute _n_e_w for the first occurrence of _o_l_d in
- the event line. Any delimiter can be used in place
- of /. The final delimiter is optional if it is the
- last character of the event line. The delimiter
- may be quoted in _o_l_d and _n_e_w with a single back-
- slash. If & appears in _n_e_w, it is replaced by _o_l_d.
- A single backslash will quote the &. If _o_l_d is
- null, it is set to the last _o_l_d substituted, or, if
- no previous history substitutions took place, the
- last _s_t_r_i_n_g in a !!??_s_t_r_i_n_g[[??]] search.
- && Repeat the previous substitution.
- gg Cause changes to be applied over the entire event
- line. This is used in conjunction with `::ss' (e.g.,
- `::ggss//_o_l_d//_n_e_w//') or `::&&'. If used with `::ss', any
- delimiter can be used in place of /, and the final
- delimiter is optional if it is the last character
- of the event line.
-
-PPRROOGGRRAAMMMMIINNGG WWIITTHH HHIISSTTOORRYY FFUUNNCCTTIIOONNSS
- This section describes how to use the History library in
- other programs.
-
- IInnttrroodduuccttiioonn ttoo HHiissttoorryy
- The programmer using the History library has available
- functions for remembering lines on a history list, associ-
- ating arbitrary data with a line, removing lines from the
- list, searching through the list for a line containing an
- arbitrary text string, and referencing any line in the
- list directly. In addition, a history _e_x_p_a_n_s_i_o_n function
- is available which provides for a consistent user inter-
- face across different programs.
-
- The user using programs written with the History library
- has the benefit of a consistent user interface with a set
- of well-known commands for manipulating the text of previ-
- ous lines and using that text in new commands. The basic
- history manipulation commands are identical to the history
- substitution provided by bbaasshh.
-
- If the programmer desires, he can use the Readline
- library, which includes some history manipulation by
- default, and has the added advantage of command line edit-
- ing.
-
- Before declaring any functions using any functionality the
- History library provides in other code, an application
- writer should include the file _<_r_e_a_d_l_i_n_e_/_h_i_s_t_o_r_y_._h_> in any
- file that uses the History library's features. It sup-
- plies extern declarations for all of the library's public
-
-
-
-GNU History 4.3 2002 January 31 3
-
-
-
-
-
-HISTORY(3) HISTORY(3)
-
-
- functions and variables, and declares all of the public
- data structures.
-
-
- HHiissttoorryy SSttoorraaggee
- The history list is an array of history entries. A his-
- tory entry is declared as follows:
-
- _t_y_p_e_d_e_f _v_o_i_d _* hhiissttddaattaa__tt;;
-
- typedef struct _hist_entry {
- char *line;
- histdata_t data;
- } HIST_ENTRY;
-
- The history list itself might therefore be declared as
-
- _H_I_S_T___E_N_T_R_Y _*_* tthhee__hhiissttoorryy__lliisstt;;
-
- The state of the History library is encapsulated into a
- single structure:
-
- /*
- * A structure used to pass around the current state of the history.
- */
- typedef struct _hist_state {
- HIST_ENTRY **entries; /* Pointer to the entries themselves. */
- int offset; /* The location pointer within this array. */
- int length; /* Number of elements within this array. */
- int size; /* Number of slots allocated to this array. */
- int flags;
- } HISTORY_STATE;
-
- If the flags member includes HHSS__SSTTIIFFLLEEDD, the history has
- been stifled.
-
-HHiissttoorryy FFuunnccttiioonnss
- This section describes the calling sequence for the vari-
- ous functions exported by the GNU History library.
-
- IInniittiiaalliizziinngg HHiissttoorryy aanndd SSttaattee MMaannaaggeemmeenntt
- This section describes functions used to initialize and
- manage the state of the History library when you want to
- use the history functions in your program.
-
- _v_o_i_d uussiinngg__hhiissttoorryy (_v_o_i_d)
- Begin a session in which the history functions might be
- used. This initializes the interactive variables.
-
- _H_I_S_T_O_R_Y___S_T_A_T_E _* hhiissttoorryy__ggeett__hhiissttoorryy__ssttaattee (_v_o_i_d)
- Return a structure describing the current state of the
- input history.
-
- _v_o_i_d hhiissttoorryy__sseett__hhiissttoorryy__ssttaattee (_H_I_S_T_O_R_Y___S_T_A_T_E _*_s_t_a_t_e)
-
-
-
-GNU History 4.3 2002 January 31 4
-
-
-
-
-
-HISTORY(3) HISTORY(3)
-
-
- Set the state of the history list according to _s_t_a_t_e.
-
-
- HHiissttoorryy LLiisstt MMaannaaggeemmeenntt
- These functions manage individual entries on the history
- list, or set parameters managing the list itself.
-
- _v_o_i_d aadddd__hhiissttoorryy (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g)
- Place _s_t_r_i_n_g at the end of the history list. The associ-
- ated data field (if any) is set to NNUULLLL.
-
- _H_I_S_T___E_N_T_R_Y _* rreemmoovvee__hhiissttoorryy (_i_n_t _w_h_i_c_h)
- Remove history entry at offset _w_h_i_c_h from the history.
- The removed element is returned so you can free the line,
- data, and containing structure.
-
- _H_I_S_T___E_N_T_R_Y _* rreeppllaaccee__hhiissttoorryy__eennttrryy (_i_n_t _w_h_i_c_h_, _c_o_n_s_t _c_h_a_r
- _*_l_i_n_e_, _h_i_s_t_d_a_t_a___t _d_a_t_a)
- Make the history entry at offset _w_h_i_c_h have _l_i_n_e and _d_a_t_a.
- This returns the old entry so you can dispose of the data.
- In the case of an invalid _w_h_i_c_h, a NNUULLLL pointer is
- returned.
-
- _v_o_i_d cclleeaarr__hhiissttoorryy (_v_o_i_d)
- Clear the history list by deleting all the entries.
-
- _v_o_i_d ssttiiffllee__hhiissttoorryy (_i_n_t _m_a_x)
- Stifle the history list, remembering only the last _m_a_x
- entries.
-
- _i_n_t uunnssttiiffllee__hhiissttoorryy (_v_o_i_d)
- Stop stifling the history. This returns the previously-
- set maximum number of history entries (as set by ssttii--
- ffllee__hhiissttoorryy(())). history was stifled. The value is posi-
- tive if the history was stifled, negative if it wasn't.
-
- _i_n_t hhiissttoorryy__iiss__ssttiifflleedd (_v_o_i_d)
- Returns non-zero if the history is stifled, zero if it is
- not.
-
-
- IInnffoorrmmaattiioonn AAbboouutt tthhee HHiissttoorryy LLiisstt
- These functions return information about the entire his-
- tory list or individual list entries.
-
- _H_I_S_T___E_N_T_R_Y _*_* hhiissttoorryy__lliisstt (_v_o_i_d)
- Return a NNUULLLL terminated array of _H_I_S_T___E_N_T_R_Y _* which is
- the current input history. Element 0 of this list is the
- beginning of time. If there is no history, return NNUULLLL.
-
- _i_n_t wwhheerree__hhiissttoorryy (_v_o_i_d)
- Returns the offset of the current history element.
-
- _H_I_S_T___E_N_T_R_Y _* ccuurrrreenntt__hhiissttoorryy (_v_o_i_d)
-
-
-
-GNU History 4.3 2002 January 31 5
-
-
-
-
-
-HISTORY(3) HISTORY(3)
-
-
- Return the history entry at the current position, as
- determined by wwhheerree__hhiissttoorryy(()). If there is no entry
- there, return a NNUULLLL pointer.
-
- _H_I_S_T___E_N_T_R_Y _* hhiissttoorryy__ggeett (_i_n_t _o_f_f_s_e_t)
- Return the history entry at position _o_f_f_s_e_t, starting from
- hhiissttoorryy__bbaassee. If there is no entry there, or if _o_f_f_s_e_t is
- greater than the history length, return a NNUULLLL pointer.
-
- _i_n_t hhiissttoorryy__ttoottaall__bbyytteess (_v_o_i_d)
- Return the number of bytes that the primary history
- entries are using. This function returns the sum of the
- lengths of all the lines in the history.
-
-
- MMoovviinngg AArroouunndd tthhee HHiissttoorryy LLiisstt
- These functions allow the current index into the history
- list to be set or changed.
-
- _i_n_t hhiissttoorryy__sseett__ppooss (_i_n_t _p_o_s)
- Set the current history offset to _p_o_s, an absolute index
- into the list. Returns 1 on success, 0 if _p_o_s is less
- than zero or greater than the number of history entries.
-
- _H_I_S_T___E_N_T_R_Y _* pprreevviioouuss__hhiissttoorryy (_v_o_i_d)
- Back up the current history offset to the previous history
- entry, and return a pointer to that entry. If there is no
- previous entry, return a NNUULLLL pointer.
-
- _H_I_S_T___E_N_T_R_Y _* nneexxtt__hhiissttoorryy (_v_o_i_d)
- Move the current history offset forward to the next his-
- tory entry, and return the a pointer to that entry. If
- there is no next entry, return a NNUULLLL pointer.
-
-
- SSeeaarrcchhiinngg tthhee HHiissttoorryy LLiisstt
- These functions allow searching of the history list for
- entries containing a specific string. Searching may be
- performed both forward and backward from the current his-
- tory position. The search may be _a_n_c_h_o_r_e_d, meaning that
- the string must match at the beginning of the history
- entry.
-
- _i_n_t hhiissttoorryy__sseeaarrcchh (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g_, _i_n_t _d_i_r_e_c_t_i_o_n)
- Search the history for _s_t_r_i_n_g, starting at the current
- history offset. If _d_i_r_e_c_t_i_o_n is less than 0, then the
- search is through previous entries, otherwise through sub-
- sequent entries. If _s_t_r_i_n_g is found, then the current
- history index is set to that history entry, and the value
- returned is the offset in the line of the entry where
- _s_t_r_i_n_g was found. Otherwise, nothing is changed, and a -1
- is returned.
-
- _i_n_t hhiissttoorryy__sseeaarrcchh__pprreeffiixx (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g_, _i_n_t
-
-
-
-GNU History 4.3 2002 January 31 6
-
-
-
-
-
-HISTORY(3) HISTORY(3)
-
-
- _d_i_r_e_c_t_i_o_n)
- Search the history for _s_t_r_i_n_g, starting at the current
- history offset. The search is anchored: matching lines
- must begin with _s_t_r_i_n_g. If _d_i_r_e_c_t_i_o_n is less than 0, then
- the search is through previous entries, otherwise through
- subsequent entries. If _s_t_r_i_n_g is found, then the current
- history index is set to that entry, and the return value
- is 0. Otherwise, nothing is changed, and a -1 is
- returned.
-
- _i_n_t hhiissttoorryy__sseeaarrcchh__ppooss (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g_, _i_n_t _d_i_r_e_c_t_i_o_n_,
- _i_n_t _p_o_s)
- Search for _s_t_r_i_n_g in the history list, starting at _p_o_s, an
- absolute index into the list. If _d_i_r_e_c_t_i_o_n is negative,
- the search proceeds backward from _p_o_s, otherwise forward.
- Returns the absolute index of the history element where
- _s_t_r_i_n_g was found, or -1 otherwise.
-
-
- MMaannaaggiinngg tthhee HHiissttoorryy FFiillee
- The History library can read the history from and write it
- to a file. This section documents the functions for man-
- aging a history file.
-
- _i_n_t rreeaadd__hhiissttoorryy (_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e)
- Add the contents of _f_i_l_e_n_a_m_e to the history list, a line
- at a time. If _f_i_l_e_n_a_m_e is NNUULLLL, then read from _~_/_._h_i_s_-
- _t_o_r_y. Returns 0 if successful, or eerrrrnnoo if not.
-
- _i_n_t rreeaadd__hhiissttoorryy__rraannggee (_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e_, _i_n_t _f_r_o_m_,
- _i_n_t _t_o)
- Read a range of lines from _f_i_l_e_n_a_m_e, adding them to the
- history list. Start reading at line _f_r_o_m and end at _t_o.
- If _f_r_o_m is zero, start at the beginning. If _t_o is less
- than _f_r_o_m, then read until the end of the file. If _f_i_l_e_-
- _n_a_m_e is NNUULLLL, then read from _~_/_._h_i_s_t_o_r_y. Returns 0 if
- successful, or eerrrrnnoo if not.
-
- _i_n_t wwrriittee__hhiissttoorryy (_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e)
- Write the current history to _f_i_l_e_n_a_m_e, overwriting _f_i_l_e_-
- _n_a_m_e if necessary. If _f_i_l_e_n_a_m_e is NNUULLLL, then write the
- history list to _~_/_._h_i_s_t_o_r_y. Returns 0 on success, or
- eerrrrnnoo on a read or write error.
-
-
- _i_n_t aappppeenndd__hhiissttoorryy (_i_n_t _n_e_l_e_m_e_n_t_s_, _c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e)
- Append the last _n_e_l_e_m_e_n_t_s of the history list to _f_i_l_e_n_a_m_e.
- If _f_i_l_e_n_a_m_e is NNUULLLL, then append to _~_/_._h_i_s_t_o_r_y. Returns 0
- on success, or eerrrrnnoo on a read or write error.
-
- _i_n_t hhiissttoorryy__ttrruunnccaattee__ffiillee (_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e_, _i_n_t
- _n_l_i_n_e_s)
- Truncate the history file _f_i_l_e_n_a_m_e, leaving only the last
- _n_l_i_n_e_s lines. If _f_i_l_e_n_a_m_e is NNUULLLL, then _~_/_._h_i_s_t_o_r_y is
-
-
-
-GNU History 4.3 2002 January 31 7
-
-
-
-
-
-HISTORY(3) HISTORY(3)
-
-
- truncated. Returns 0 on success, or eerrrrnnoo on failure.
-
-
- HHiissttoorryy EExxppaannssiioonn
- These functions implement history expansion.
-
- _i_n_t hhiissttoorryy__eexxppaanndd (_c_h_a_r _*_s_t_r_i_n_g_, _c_h_a_r _*_*_o_u_t_p_u_t)
- Expand _s_t_r_i_n_g, placing the result into _o_u_t_p_u_t, a pointer
- to a string. Returns:
- 0 If no expansions took place (or, if the only
- change in the text was the removal of escape
- characters preceding the history expansion
- character);
- 1 if expansions did take place;
- -1 if there was an error in expansion;
- 2 if the returned line should be displayed,
- but not executed, as with the ::pp modifier.
- If an error ocurred in expansion, then _o_u_t_p_u_t contains a
- descriptive error message.
-
- _c_h_a_r _* ggeett__hhiissttoorryy__eevveenntt (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g_, _i_n_t _*_c_i_n_d_e_x_,
- _i_n_t _q_c_h_a_r)
- Returns the text of the history event beginning at _s_t_r_i_n_g
- + _*_c_i_n_d_e_x. _*_c_i_n_d_e_x is modified to point to after the
- event specifier. At function entry, _c_i_n_d_e_x points to the
- index into _s_t_r_i_n_g where the history event specification
- begins. _q_c_h_a_r is a character that is allowed to end the
- event specification in addition to the ``normal'' termi-
- nating characters.
-
- _c_h_a_r _*_* hhiissttoorryy__ttookkeenniizzee (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g)
- Return an array of tokens parsed out of _s_t_r_i_n_g, much as
- the shell might. The tokens are split on the characters
- in the hhiissttoorryy__wwoorrdd__ddeelliimmiitteerrss variable, and shell quoting
- conventions are obeyed.
-
- _c_h_a_r _* hhiissttoorryy__aarrgg__eexxttrraacctt (_i_n_t _f_i_r_s_t_, _i_n_t _l_a_s_t_, _c_o_n_s_t
- _c_h_a_r _*_s_t_r_i_n_g)
- Extract a string segment consisting of the _f_i_r_s_t through
- _l_a_s_t arguments present in _s_t_r_i_n_g. Arguments are split
- using hhiissttoorryy__ttookkeenniizzee(()).
-
-
- HHiissttoorryy VVaarriiaabblleess
- This section describes the externally-visible variables
- exported by the GNU History Library.
-
- _i_n_t hhiissttoorryy__bbaassee
- The logical offset of the first entry in the history list.
-
- _i_n_t hhiissttoorryy__lleennggtthh
- The number of entries currently stored in the history
- list.
-
-
-
-
-GNU History 4.3 2002 January 31 8
-
-
-
-
-
-HISTORY(3) HISTORY(3)
-
-
- _i_n_t hhiissttoorryy__mmaaxx__eennttrriieess
- The maximum number of history entries. This must be
- changed using ssttiiffllee__hhiissttoorryy(()).
-
- _c_h_a_r hhiissttoorryy__eexxppaannssiioonn__cchhaarr
- The character that introduces a history event. The
- default is !!. Setting this to 0 inhibits history expan-
- sion.
-
- _c_h_a_r hhiissttoorryy__ssuubbsstt__cchhaarr
- The character that invokes word substitution if found at
- the start of a line. The default is ^^.
-
- _c_h_a_r hhiissttoorryy__ccoommmmeenntt__cchhaarr
- During tokenization, if this character is seen as the
- first character of a word, then it and all subsequent
- characters up to a newline are ignored, suppressing his-
- tory expansion for the remainder of the line. This is
- disabled by default.
-
- _c_h_a_r _* hhiissttoorryy__wwoorrdd__ddeelliimmiitteerrss
- The characters that separate tokens for hhiissttoorryy__ttookk--
- eenniizzee(()). The default value is "" \\tt\\nn(())<<>>;;&&||"".
-
- _c_h_a_r _* hhiissttoorryy__nnoo__eexxppaanndd__cchhaarrss
- The list of characters which inhibit history expansion if
- found immediately following hhiissttoorryy__eexxppaannssiioonn__cchhaarr. The
- default is space, tab, newline, \\rr, and ==.
-
- _c_h_a_r _* hhiissttoorryy__sseeaarrcchh__ddeelliimmiitteerr__cchhaarrss
- The list of additional characters which can delimit a his-
- tory search string, in addition to space, tab, _: and _? in
- the case of a substring search. The default is empty.
-
- _i_n_t hhiissttoorryy__qquuootteess__iinnhhiibbiitt__eexxppaannssiioonn
- If non-zero, single-quoted words are not scanned for the
- history expansion character. The default value is 0.
-
- _r_l___l_i_n_e_b_u_f___f_u_n_c___t _* hhiissttoorryy__iinnhhiibbiitt__eexxppaannssiioonn__ffuunnccttiioonn
- This should be set to the address of a function that takes
- two arguments: a cchhaarr ** (_s_t_r_i_n_g) and an iinntt index into
- that string (_i). It should return a non-zero value if the
- history expansion starting at _s_t_r_i_n_g_[_i_] should not be per-
- formed; zero if the expansion should be done. It is
- intended for use by applications like bbaasshh that use the
- history expansion character for additional purposes. By
- default, this variable is set to NNUULLLL.
-
-FFIILLEESS
- _~_/_._h_i_s_t_o_r_y
- Default filename for reading and writing saved his-
- tory
-
-
-
-
-
-GNU History 4.3 2002 January 31 9
-
-
-
-
-
-HISTORY(3) HISTORY(3)
-
-
-SSEEEE AALLSSOO
- _T_h_e _G_n_u _R_e_a_d_l_i_n_e _L_i_b_r_a_r_y, Brian Fox and Chet Ramey
- _T_h_e _G_n_u _H_i_s_t_o_r_y _L_i_b_r_a_r_y, Brian Fox and Chet Ramey
- _b_a_s_h(1)
- _r_e_a_d_l_i_n_e(3)
-
-AAUUTTHHOORRSS
- Brian Fox, Free Software Foundation
- bfox@gnu.org
-
- Chet Ramey, Case Western Reserve University
- chet@ins.CWRU.Edu
-
-BBUUGG RREEPPOORRTTSS
- If you find a bug in the hhiissttoorryy library, you should
- report it. But first, you should make sure that it really
- is a bug, and that it appears in the latest version of the
- hhiissttoorryy library that you have.
-
- Once you have determined that a bug actually exists, mail
- a bug report to _b_u_g_-_r_e_a_d_l_i_n_e@_g_n_u_._o_r_g. If you have a fix,
- you are welcome to mail that as well! Suggestions and
- `philosophical' bug reports may be mailed to _b_u_g_-_r_e_a_d_-
- _l_i_n_e@_g_n_u_._o_r_g or posted to the Usenet newsgroup
- ggnnuu..bbaasshh..bbuugg.
-
- Comments and bug reports concerning this manual page
- should be directed to _c_h_e_t_@_i_n_s_._C_W_R_U_._E_d_u.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-GNU History 4.3 2002 January 31 10
-
-
diff --git a/sim/ChangeLog b/sim/ChangeLog
index c51cddd93ea..f8502764d6c 100644
--- a/sim/ChangeLog
+++ b/sim/ChangeLog
@@ -1,3 +1,28 @@
+2003-09-03 Andreas Schwab <schwab@suse.de>
+
+ * Makefile.in (FLAGS_TO_PASS): Pass down $(bindir) and $(mandir).
+
+2003-08-29 Dave Brolley <brolley@redhat.com>
+
+ * MAINTAINERS: Add myself as maintainer of the FRV port.
+
+2003-08-20 Michael Snyder <msnyder@redhat.com>
+ Dave Brolley <brolley@redhat.com>
+
+ * frv/: New directory, simulator for the Fujitsu FRV.
+ * configure.in: Add frv configury.
+ * configure: Regenerate.
+
+2003-08-10 Ben Elliston <bje@wasabisystems.com>
+
+ * MAINTAINERS: Update my mail address.
+
+2003-08-09 Andrew Cagney <cagney@redhat.com>
+
+ * MAINTAINERS: Andrew Cagney (mips) and Geoff Keating (ppc) drop
+ maintenance. List igen and sh maintainers. Mention that target
+ and global maintainers pick up the slack.
+
2003-07-09 Michael Snyder <msnyder@redhat.com>
* configure.in: Add testsuite to extra_subdirs for sh.
diff --git a/sim/MAINTAINERS b/sim/MAINTAINERS
index e54adb50433..6e057217ae5 100644
--- a/sim/MAINTAINERS
+++ b/sim/MAINTAINERS
@@ -10,10 +10,17 @@ gdb-patches@sources.redhat.com
Maintainers for particular sims:
arm Nick Clifton <nickc@redhat.com>
+frv Dave Brolley <brolley@redhat.com>
+igen (igen simulators)
ppc Andrew Cagney <ac131313@redhat.com>
-ppc Geoff Keating <geoffk@geoffk.org>
m68hc11 Stephane Carrez <stcarrez@nerim.fr>
-mips Andrew Cagney <ac131313@redhat.com>
mips Chris Demetriou <cgd@broadcom.com>
-common Ben Elliston <bje@redhat.com>
+sh (global maintainers)
+common Ben Elliston <bje@wasabisystems.com>
common Frank Ch. Eigler <fche@redhat.com>
+* (target, then global maintainers)
+
+ Past sim maintainers:
+
+mips Andrew Cagney <ac131313@redhat.com>
+ppc Geoff Keating <geoffk@geoffk.org>
diff --git a/sim/Makefile.in b/sim/Makefile.in
index 9a044f06043..a46dda81d1d 100644
--- a/sim/Makefile.in
+++ b/sim/Makefile.in
@@ -85,6 +85,8 @@ RUNTESTFLAGS=
FLAGS_TO_PASS = \
"prefix=$(prefix)" \
"exec_prefix=$(exec_prefix)" \
+ "bindir=$(bindir)" \
+ "mandir=$(mandir)" \
"against=$(against)" \
"AR=$(AR)" \
"AR_FLAGS=$(AR_FLAGS)" \
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index c7172f9d152..ca6d384a85f 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,26 @@
+2003-09-08 Dave Brolley <brolley@redhat.com>
+
+ On behalf of Doug Evans <dje@sebabeach.org>
+ * cgen.sh: New arg archfile.
+ * Make-common.in (cgen-arch,cgen-cpu,cgen-defs,cgen-decode,
+ cgen-cpu-decode,cgen-desc): Update call to cgen.sh.
+
+2003-08-28 Andrew Cagney <cagney@redhat.com>
+
+ * dv-glue.c (hw_glue_finish): Change %d to %ld to match sizeof.
+ * sim-options.c (print_help): Cast the format with specifier to
+ "int".
+
+2003-08-20 Michael Snyder <msnyder@redhat.com>
+ Dave Brolley <brolley@redhat.com>
+
+ * cgen-par.h (flags, word1): New target-specific
+ fields of CGEN_WRITE_QUEUE_ELEMENT.
+ (CGEN_WRITE_QUEUE_ELEMENT_FLAGS): New accessor macro.
+ (CGEN_WRITE_QUEUE_ELEMENT_WORD1): New accessor macro.
+ * gennltvals.sh: Add frv target.
+ * nltvals.def: Add frv target.
+
2003-06-23 Michael Snyder <msnyder@redhat.com>
* nrun.c (main): Delete h8/300 ifdef (sim now handles signals).
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 53f898a9636..cc93bde5e35 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -674,31 +674,37 @@ CGEN_FLAGS_TO_PASS = \
cgen-arch: force
$(SHELL) $(srccom)/cgen.sh arch $(srcdir) \
$(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
- $(arch) "$(FLAGS)" ignored "$(isa)" $(mach) ignored ignored
+ $(arch) "$(FLAGS)" ignored "$(isa)" $(mach) ignored \
+ $(archfile) ignored
cgen-cpu: force
$(SHELL) $(srccom)/cgen.sh cpu $(srcdir) \
$(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
- $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" "$(EXTRAFILES)"
+ $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
+ $(archfile) "$(EXTRAFILES)"
cgen-defs: force
$(SHELL) $(srccom)/cgen.sh defs $(srcdir) \
$(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
- $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" ignored
+ $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
+ $(archfile) ignored
cgen-decode: force
$(SHELL) $(srccom)/cgen.sh decode $(srcdir) \
$(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
- $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" "$(EXTRAFILES)"
+ $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
+ $(archfile) "$(EXTRAFILES)"
cgen-cpu-decode: force
$(SHELL) $(srccom)/cgen.sh cpu-decode $(srcdir) \
$(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
- $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" "$(EXTRAFILES)"
+ $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
+ $(archfile) "$(EXTRAFILES)"
cgen-desc: force
$(SHELL) $(srccom)/cgen.sh desc $(srcdir) \
$(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
- $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" ignored
+ $(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
+ $(archfile) ignored
## End COMMON_POST_CONFIG_FRAG
diff --git a/sim/common/cgen-par.h b/sim/common/cgen-par.h
index 1b8a3215237..fad04b96938 100644
--- a/sim/common/cgen-par.h
+++ b/sim/common/cgen-par.h
@@ -39,6 +39,8 @@ enum cgen_write_queue_kind {
typedef struct {
enum cgen_write_queue_kind kind; /* Used to select union member below. */
IADDR insn_address; /* Address of the insn performing the write. */
+ unsigned32 flags; /* Target specific flags. */
+ long word1; /* Target specific field. */
union {
struct {
BI *target;
@@ -152,6 +154,8 @@ typedef struct {
#define CGEN_WRITE_QUEUE_ELEMENT_KIND(element) ((element)->kind)
#define CGEN_WRITE_QUEUE_ELEMENT_IADDR(element) ((element)->insn_address)
+#define CGEN_WRITE_QUEUE_ELEMENT_FLAGS(element) ((element)->flags)
+#define CGEN_WRITE_QUEUE_ELEMENT_WORD1(element) ((element)->word1)
extern void cgen_write_queue_element_execute (
SIM_CPU *, CGEN_WRITE_QUEUE_ELEMENT *
diff --git a/sim/common/cgen.sh b/sim/common/cgen.sh
index bf467e13baa..172edcb7ca3 100644
--- a/sim/common/cgen.sh
+++ b/sim/common/cgen.sh
@@ -3,7 +3,7 @@
#
# Usage: /bin/sh cgen.sh {"arch"|"cpu"|"decode"|"defs"|"cpu-decode"} \
# srcdir cgen cgendir cgenflags \
-# arch archflags cpu mach suffix extrafiles
+# arch archflags cpu mach suffix archfile extrafiles
#
# We store the generated files in the source directory until we decide to
# ship a Scheme interpreter (or other implementation) with gdb/binutils.
@@ -24,6 +24,7 @@ isa=$9
# portably bring parameters beyond $9 into view
shift ; mach=$9
shift ; suffix=$9
+shift ; archfile=$9
shift ; extrafiles=$9
rootdir=${srcdir}/../..
@@ -57,7 +58,7 @@ arch)
${cgenflags} \
-f "${archflags}" \
-m ${mach} \
- -a ${arch} \
+ -a ${archfile} \
-i ${isa} \
-A tmp-arch.h1 \
-B tmp-arch.c1 \
@@ -111,7 +112,7 @@ cpu | decode | cpu-decode)
${cgenflags} \
-f "${archflags}" \
-m ${mach} \
- -a ${arch} \
+ -a ${archfile} \
-i ${isa} \
${fileopts}
@@ -180,7 +181,7 @@ defs)
${cgenflags} \
-f "${archflags}" \
-m ${mach} \
- -a ${arch} \
+ -a ${archfile} \
-i ${isa} \
-G tmp-defs.h1
sed $sedscript < tmp-defs.h1 > tmp-defs.h
@@ -197,7 +198,7 @@ desc)
${cgenflags} \
-f "${archflags}" \
-m ${mach} \
- -a ${arch} \
+ -a ${archfile} \
-i ${isa} \
-H tmp-desc.h1 \
-C tmp-desc.c1 \
diff --git a/sim/common/dv-glue.c b/sim/common/dv-glue.c
index 560fd7051ea..ab04fe737b2 100644
--- a/sim/common/dv-glue.c
+++ b/sim/common/dv-glue.c
@@ -221,7 +221,7 @@ hw_glue_finish (struct hw *me)
if (glue->sizeof_output == 0)
hw_abort (me, "at least one reg property size must be nonzero");
if (glue->sizeof_output % sizeof (unsigned_word) != 0)
- hw_abort (me, "reg property size must be %d aligned",
+ hw_abort (me, "reg property size must be %ld aligned",
sizeof (unsigned_word));
/* and the address */
hw_unit_address_to_attach_address (hw_parent (me),
@@ -230,7 +230,7 @@ hw_glue_finish (struct hw *me)
&glue->address,
me);
if (glue->address % (sizeof (unsigned_word) * max_nr_ports) != 0)
- hw_abort (me, "reg property address must be %d aligned",
+ hw_abort (me, "reg property address must be %ld aligned",
sizeof (unsigned_word) * max_nr_ports);
glue->nr_outputs = glue->sizeof_output / sizeof (unsigned_word);
glue->output = hw_zalloc (me, glue->sizeof_output);
diff --git a/sim/common/gennltvals.sh b/sim/common/gennltvals.sh
index fefd8807a31..8e8ad543361 100644
--- a/sim/common/gennltvals.sh
+++ b/sim/common/gennltvals.sh
@@ -41,6 +41,10 @@ dir=libgloss target=fr30
$shell ${srccom}/gentvals.sh $target sys ${srcroot}/$dir \
"syscall.h" 'SYS_[_A-Za-z0-9]*' "${cpp}"
+dir=libgloss target=frv
+$shell ${srccom}/gentvals.sh $target sys ${srcroot}/$dir \
+ "syscall.h" 'SYS_[_A-Za-z0-9]*' "${cpp}"
+
dir=libgloss/i960 target=i960
$shell ${srccom}/gentvals.sh $target sys ${srcroot}/$dir \
"syscall.h" 'SYS_[_A-Za-z0-9]*' "${cpp}"
@@ -64,3 +68,4 @@ $shell ${srccom}/gentvals.sh $target sys ${srcroot}/$dir \
dir=libgloss/v850/sys target=v850
$shell ${srccom}/gentvals.sh $target sys ${srcroot}/$dir \
"syscall.h" 'SYS_[_A-Za-z0-9]*' "${cpp}"
+
diff --git a/sim/common/nltvals.def b/sim/common/nltvals.def
index 14093ae39ac..9139dc462ba 100644
--- a/sim/common/nltvals.def
+++ b/sim/common/nltvals.def
@@ -238,6 +238,32 @@
/* end fr30 sys target macros */
#endif
#endif
+#ifdef NL_TARGET_frv
+#ifdef sys_defs
+/* from syscall.h */
+/* begin frv sys target macros */
+ { "SYS_argv", 13 },
+ { "SYS_argvlen", 12 },
+ { "SYS_chdir", 14 },
+ { "SYS_chmod", 16 },
+ { "SYS_close", 3 },
+ { "SYS_exit", 1 },
+ { "SYS_fstat", 10 },
+ { "SYS_getpid", 8 },
+ { "SYS_gettimeofday", 19 },
+ { "SYS_kill", 9 },
+ { "SYS_lseek", 6 },
+ { "SYS_open", 2 },
+ { "SYS_read", 4 },
+ { "SYS_stat", 15 },
+ { "SYS_time", 18 },
+ { "SYS_times", 20 },
+ { "SYS_unlink", 7 },
+ { "SYS_utime", 17 },
+ { "SYS_write", 5 },
+/* end frv sys target macros */
+#endif
+#endif
#ifdef NL_TARGET_i960
#ifdef sys_defs
/* from syscall.h */
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c
index 8c16d56cc75..df12a639b8a 100644
--- a/sim/common/sim-options.c
+++ b/sim/common/sim-options.c
@@ -769,7 +769,10 @@ print_help (SIM_DESC sd, sim_cpu *cpu, const struct option_list *ol, int is_comm
end --;
if (end == chp)
end = chp + doc_width - 1;
- sim_io_printf (sd, "%.*s\n%*s", end - chp, chp, indent, "");
+ /* The cast should be ok - its distances between to
+ points in a string. */
+ sim_io_printf (sd, "%.*s\n%*s", (int) (end - chp), chp, indent,
+ "");
chp = end;
while (isspace (*chp) && *chp != '\0')
chp++;
diff --git a/sim/configure b/sim/configure
index d6382b640c9..b342d3917fa 100755
--- a/sim/configure
+++ b/sim/configure
@@ -1430,6 +1430,9 @@ case "${target}" in
sim_target=h8300
extra_subdirs="${extra_subdirs} testsuite"
;;
+ frv-*-*) sim_target=frv
+ extra_subdirs="${extra_subdirs} testsuite"
+ ;;
h8500-*-*) sim_target=h8500 ;;
i960-*-*) sim_target=i960 ;;
m32r-*-*) sim_target=m32r ;;
diff --git a/sim/configure.in b/sim/configure.in
index da2f20a1bef..f9ec687d8f5 100644
--- a/sim/configure.in
+++ b/sim/configure.in
@@ -69,6 +69,9 @@ case "${target}" in
sim_target=h8300
extra_subdirs="${extra_subdirs} testsuite"
;;
+ frv-*-*) sim_target=frv
+ extra_subdirs="${extra_subdirs} testsuite"
+ ;;
h8500-*-*) sim_target=h8500 ;;
i960-*-*) sim_target=i960 ;;
m32r-*-*) sim_target=m32r ;;
diff --git a/sim/i960/ChangeLog b/sim/i960/ChangeLog
index 1f61c3150bf..becf43f263e 100644
--- a/sim/i960/ChangeLog
+++ b/sim/i960/ChangeLog
@@ -1,3 +1,8 @@
+2003-09-08 Dave Brolley <brolley@redhat.com>
+
+ On behalf of Doug Evans <dje@sebabeach.org>
+ * Makefile.in (stamp-arch,stamp-cpu, stamp-desc): Pass archfile to cgen.
+
2003-02-27 Andrew Cagney <cagney@redhat.com>
* sim-if.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
diff --git a/sim/i960/Makefile.in b/sim/i960/Makefile.in
index b1e0abeff0e..4fc24d4f765 100644
--- a/sim/i960/Makefile.in
+++ b/sim/i960/Makefile.in
@@ -107,19 +107,24 @@ CGEN_MAINT = ; @true
stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CGEN_CPU_DIR)/i960.cpu
$(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=all \
+ archfile=$(CGEN_CPU_DIR)/i960.cpu \
FLAGS="with-scache with-profile=fn"
touch stamp-arch
arch.h arch.c cpuall.h: $(CGEN_MAINT) stamp-arch
stamp-cpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CGEN_CPU_DIR)/i960.cpu
$(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \
- cpu=i960base mach=i960:ka_sa,i960:ca SUFFIX= FLAGS="with-scache with-profile=fn" EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)"
+ cpu=i960base mach=i960:ka_sa,i960:ca SUFFIX= \
+ archfile=$(CGEN_CPU_DIR)/i960.cpu \
+ FLAGS="with-scache with-profile=fn" \
+ EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)"
touch stamp-cpu
cpu.h sem.c sem-switch.c model.c decode.c decode.h: $(CGEN_MAINT) stamp-cpu
stamp-desc: $(CGEN_READ_SCM) $(CGEN_DESC_SCM) \
$(CGEN_CPU_DIR)/sparc.cpu $(CGEN_CPU_DIR)/sparccom.cpu $(CGEN_CPU_DIR)/i960.cpu $(CGEN_CPU_DIR)/i960.cpu
$(MAKE) cgen-desc $(CGEN_FLAGS_TO_PASS) \
- cpu=i960 mach=all
+ cpu=i960 mach=all \
+ archfile=$(CGEN_CPU_DIR)/i960.cpu
touch stamp-desc
i960-desc.c i960-desc.h i960-opc.h: $(CGEN_MAINT) stamp-desc
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog
index b4097dbe789..b6d7c244f75 100644
--- a/sim/m32r/ChangeLog
+++ b/sim/m32r/ChangeLog
@@ -1,3 +1,8 @@
+2003-09-08 Dave Brolley <brolley@redhat.com>
+
+ On behalf of Doug Evans <dje@sebabeach.org>
+ * Makefile.in (stamp-arch,stamp-cpu,stamp-xcpu): Pass archfile to cgen.
+
2003-02-27 Andrew Cagney <cagney@redhat.com>
* sim-if.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in
index 7f40a85d718..18d9d3f7dd8 100644
--- a/sim/m32r/Makefile.in
+++ b/sim/m32r/Makefile.in
@@ -126,6 +126,7 @@ CGEN_MAINT = ; @true
stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CGEN_CPU_DIR)/m32r.cpu
$(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=all \
+ archfile=$(CGEN_CPU_DIR)/m32r.cpu \
FLAGS="with-scache with-profile=fn"
touch stamp-arch
arch.h arch.c cpuall.h: $(CGEN_MAINT) stamp-arch
@@ -133,6 +134,7 @@ arch.h arch.c cpuall.h: $(CGEN_MAINT) stamp-arch
stamp-cpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CGEN_CPU_DIR)/m32r.cpu
$(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \
cpu=m32rbf mach=m32r SUFFIX= \
+ archfile=$(CGEN_CPU_DIR)/m32r.cpu \
FLAGS="with-scache with-profile=fn" \
EXTRAFILES="$(CGEN_CPU_SEM) $(CGEN_CPU_SEMSW)"
touch stamp-cpu
@@ -140,6 +142,9 @@ cpu.h sem.c sem-switch.c model.c decode.c decode.h: $(CGEN_MAINT) stamp-cpu
stamp-xcpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CGEN_CPU_DIR)/m32r.cpu
$(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \
- cpu=m32rxf mach=m32rx SUFFIX=x FLAGS="with-scache with-profile=fn" EXTRAFILES="$(CGEN_CPU_SEMSW)"
+ cpu=m32rxf mach=m32rx SUFFIX=x \
+ archfile=$(CGEN_CPU_DIR)/m32r.cpu \
+ FLAGS="with-scache with-profile=fn" \
+ EXTRAFILES="$(CGEN_CPU_SEMSW)"
touch stamp-xcpu
cpux.h semx-switch.c modelx.c decodex.c decodex.h: $(CGEN_MAINT) stamp-xcpu
diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index 9c34d47002b..3d019d76589 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,3 +1,57 @@
+2003-08-08 Stephane Carrez <stcarrez@nerim.fr>
+
+ * dv-m68hc11tim.c (cycle_to_string): Add flags parameter to better
+ control the translation.
+ (m68hc11tim_print_timer): Update cycle_to_string conversion.
+ (m68hc11tim_timer_event): Fix handling of output
+ compare register with its interrupts.
+ (m68hc11tim_io_write_buffer): Check output compare
+ after setting M6811_TMSK1.
+ (m68hc11tim_io_read_buffer): Fix compilation warning.
+ * dv-m68hc11.c (m68hc11_option_handler): Likewise.
+ * dv-m68hc11spi.c (m68hc11spi_info): Likewise.
+ * dv-m68hc11sio.c (m68hc11sio_info): Likewise.
+ * interrupts.c (interrupts_info): Likewise.
+ (interrupts_reset): Recognize bootstrap mode.
+ * sim-main.h (PRINT_CYCLE, PRINT_TIME): New defines.
+ (_sim_cpu): Add cpu_start_mode.
+ (cycle_to_string): Add flags member.
+ * m68hc11_sim.c (OPTION_CPU_BOOTSTRAP): New option.
+ (cpu_options): Declare new option bootstrap.
+ (cpu_option_handler): Handle it.
+ (cpu_info): Update call to cycle_to_string.
+
+2003-08-08 Stephane Carrez <stcarrez@nerim.fr>
+
+ * sim-main.h (phys_to_virt): Use memory bank parameters to translate
+ the physical address in virtual address.
+ (struct _sim_cpu): Add memory bank members.
+ * m68hc11_sim.c (cpu_initialize): Clear memory bank parameters.
+ * interp.c (sim_hw_configure): Create memory bank according to memory
+ bank parameters.
+ (sim_get_bank_parameters): New function to obtain memory bank config
+ from the symbol table.
+ (sim_prepare_for_program): Call it to obtain the memory bank parameters.
+ (sim_open): Call sim_prepare_for_program.
+ * dv-m68hc11.c (m68hc11cpu_io_write_buffer): Use memory bank parameters
+ to check if address is within bank window.
+ (m68hc11cpu_io_read_buffer): Likewise.
+ (attach_m68hc11_regs): Map the memory bank according to memory bank
+ parameters.
+
+2003-08-08 Stephane Carrez <stcarrez@nerim.fr>,
+
+ * sim-main.h (PAGE_REGNUM, Z_REGNUM): Use same numbering as gdb.
+
+2003-08-08 Stephane Carrez <stcarrez@nerim.fr>,
+ Gary Piercey <gpiercey@northstar-technical.com>
+
+ * m68hc11_sim.c (print_io_word): New function to print 16-bit value.
+ * sim-main.h (print_io_word): Declare.
+ * dv-m68hc11tim.c (tmsk1_desc): New description table for TMSK1.
+ (tflg1_desc): Likewise for TFLG1.
+ (m68hc11tim_info): Print input and output compare registers
+
2003-03-02 Stephane Carrez <stcarrez@nerim.fr>
* Makefile.in (SIM_EXTRA_CFLAGS): Set WITH_TARGET_ADDRESS_BITSIZE
diff --git a/sim/m68hc11/dv-m68hc11.c b/sim/m68hc11/dv-m68hc11.c
index 669a045357a..5cc716182bc 100644
--- a/sim/m68hc11/dv-m68hc11.c
+++ b/sim/m68hc11/dv-m68hc11.c
@@ -1,5 +1,5 @@
/* dv-m68hc11.c -- CPU 68HC11&68HC12 as a device.
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@nerim.fr)
(From a driver model Contributed by Cygnus Solutions.)
@@ -324,8 +324,8 @@ attach_m68hc11_regs (struct hw *me,
if (hw_find_property (me, "use_bank") != NULL)
hw_attach_address (hw_parent (me), 0,
exec_map,
- 0x08000,
- 0x04000,
+ cpu->bank_start,
+ cpu->bank_end - cpu->bank_start,
me);
cpu_mode = "expanded";
@@ -808,13 +808,15 @@ m68hc11_option_handler (SIM_DESC sd, sim_cpu *cpu,
" %d %d %35.35s\n",
osc->name, freq,
cur_value, next_value,
- cycle_to_string (cpu, t));
+ cycle_to_string (cpu, t,
+ PRINT_TIME | PRINT_CYCLE));
else
sim_io_printf (sd, " %4.4s %8.8s hz "
" %d %d %35.35s\n",
osc->name, freq,
cur_value, next_value,
- cycle_to_string (cpu, t));
+ cycle_to_string (cpu, t,
+ PRINT_TIME | PRINT_CYCLE));
}
}
break;
@@ -843,7 +845,7 @@ m68hc11cpu_io_read_buffer (struct hw *me,
sd = hw_system (me);
cpu = STATE_CPU (sd, 0);
- if (base >= 0x8000 && base < 0xc000)
+ if (base >= cpu->bank_start && base < cpu->bank_end)
{
address_word virt_addr = phys_to_virt (cpu, base);
if (virt_addr != base)
@@ -864,7 +866,7 @@ m68hc11cpu_io_read_buffer (struct hw *me,
break;
memcpy (dest, &cpu->ios[base], 1);
- dest++;
+ dest = (char*) dest + 1;
base++;
byte++;
nr_bytes--;
@@ -1091,7 +1093,7 @@ m68hc11cpu_io_write_buffer (struct hw *me,
sd = hw_system (me);
cpu = STATE_CPU (sd, 0);
- if (base >= 0x8000 && base < 0xc000)
+ if (base >= cpu->bank_start && base < cpu->bank_end)
{
address_word virt_addr = phys_to_virt (cpu, base);
if (virt_addr != base)
@@ -1113,7 +1115,7 @@ m68hc11cpu_io_write_buffer (struct hw *me,
val = *((uint8*) source);
m68hc11cpu_io_write (me, cpu, base, val);
- source++;
+ source = (char*) source + 1;
base++;
byte++;
nr_bytes--;
diff --git a/sim/m68hc11/dv-m68hc11sio.c b/sim/m68hc11/dv-m68hc11sio.c
index ec7a46de506..655a6dbe0d1 100644
--- a/sim/m68hc11/dv-m68hc11sio.c
+++ b/sim/m68hc11/dv-m68hc11sio.c
@@ -463,7 +463,8 @@ m68hc11sio_info (struct hw *me)
n = (clock_cycle - t) / controller->baud_cycle;
n = controller->data_length - n;
sim_io_printf (sd, " Transmit finished in %s (%d bit%s)\n",
- cycle_to_string (cpu, t), n, (n > 1 ? "s" : ""));
+ cycle_to_string (cpu, t, PRINT_TIME | PRINT_CYCLE),
+ n, (n > 1 ? "s" : ""));
}
if (controller->rx_poll_event)
{
@@ -471,7 +472,7 @@ m68hc11sio_info (struct hw *me)
t = hw_event_remain_time (me, controller->rx_poll_event);
sim_io_printf (sd, " Receive finished in %s\n",
- cycle_to_string (cpu, t));
+ cycle_to_string (cpu, t, PRINT_TIME | PRINT_CYCLE));
}
}
diff --git a/sim/m68hc11/dv-m68hc11spi.c b/sim/m68hc11/dv-m68hc11spi.c
index 5f5e0bbe9cb..619a2d31fcb 100644
--- a/sim/m68hc11/dv-m68hc11spi.c
+++ b/sim/m68hc11/dv-m68hc11spi.c
@@ -1,6 +1,6 @@
/* dv-m68hc11spi.c -- Simulation of the 68HC11 SPI
- Copyright (C) 2000, 2002 Free Software Foundation, Inc.
- Written by Stephane Carrez (stcarrez@worldnet.fr)
+ Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
+ Written by Stephane Carrez (stcarrez@nerim.fr)
(From a driver model Contributed by Cygnus Solutions.)
This file is part of the program GDB, the GNU debugger.
@@ -358,11 +358,11 @@ m68hc11spi_info (struct hw *me)
controller->tx_bit + 1);
t = hw_event_remain_time (me, controller->spi_event);
sim_io_printf (sd, " SPI current bit-cycle finished in %s\n",
- cycle_to_string (cpu, t));
+ cycle_to_string (cpu, t, PRINT_TIME | PRINT_CYCLE));
t += (controller->tx_bit + 1) * 2 * controller->clock;
sim_io_printf (sd, " SPI operation finished in %s\n",
- cycle_to_string (cpu, t));
+ cycle_to_string (cpu, t, PRINT_TIME | PRINT_CYCLE));
}
}
diff --git a/sim/m68hc11/dv-m68hc11tim.c b/sim/m68hc11/dv-m68hc11tim.c
index 3edcac068a3..0456f678912 100644
--- a/sim/m68hc11/dv-m68hc11tim.c
+++ b/sim/m68hc11/dv-m68hc11tim.c
@@ -1,6 +1,6 @@
/* dv-m68hc11tim.c -- Simulation of the 68HC11 timer devices.
- Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
- Written by Stephane Carrez (stcarrez@worldnet.fr)
+ Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Written by Stephane Carrez (stcarrez@nerim.fr)
(From a driver model Contributed by Cygnus Solutions.)
This file is part of the program GDB, the GNU debugger.
@@ -25,7 +25,7 @@
#include "sim-main.h"
#include "hw-main.h"
#include "sim-assert.h"
-
+#include <limits.h>
/* DEVICE
@@ -250,7 +250,9 @@ m68hc11tim_timer_event (struct hw *me, void *data)
unsigned mask;
unsigned flags;
unsigned long tcnt_internal;
- unsigned long tcnt;
+ unsigned long tcnt, tcnt_prev;
+ signed64 tcnt_insn_end;
+ signed64 tcnt_insn_start;
int i;
sim_events *events;
@@ -289,11 +291,8 @@ m68hc11tim_timer_event (struct hw *me, void *data)
break;
case OVERFLOW_EVENT:
- /* Compute the 68HC11 internal free running counter.
- There may be 'nr_ticks_to_process' pending cycles that are
- not (yet) taken into account by 'sim_events_time'. */
- tcnt_internal = sim_events_time (sd) - controller->tcnt_adjust;
- tcnt_internal += events->nr_ticks_to_process;
+ /* Compute the 68HC11 internal free running counter. */
+ tcnt_internal = (cpu->cpu_absolute_cycle - controller->tcnt_adjust);
/* We must take into account the prescaler that comes
before the counter (it's a power of 2). */
@@ -316,22 +315,22 @@ m68hc11tim_timer_event (struct hw *me, void *data)
break;
case COMPARE_EVENT:
- eventp = &controller->cmp_timer_event;
+ /* Compute value of TCNT register (64-bit precision) at beginning
+ and end of instruction. */
+ tcnt_insn_end = (cpu->cpu_absolute_cycle - controller->tcnt_adjust);
+ tcnt_insn_start = (tcnt_insn_end - cpu->cpu_current_cycle);
+
+ /* TCNT value at beginning of current instruction. */
+ tcnt_prev = (tcnt_insn_start / controller->clock_prescaler) & 0x0ffff;
- /* Compute the 68HC11 internal free running counter.
- There may be 'nr_ticks_to_process' pending cycles that are
- not (yet) taken into account by 'sim_events_time'. */
- events = STATE_EVENTS (sd);
- tcnt_internal = sim_events_time (sd) - controller->tcnt_adjust;
- tcnt_internal += events->nr_ticks_to_process;
+ /* TCNT value at end of current instruction. */
+ tcnt = (tcnt_insn_end / controller->clock_prescaler) & 0x0ffff;
/* We must take into account the prescaler that comes
before the counter (it's a power of 2). */
+ tcnt_internal = tcnt_insn_end;
tcnt_internal &= 0x0ffff * controller->clock_prescaler;
- /* Get current visible TCNT register value. */
- tcnt = tcnt_internal / controller->clock_prescaler;
-
flags = cpu->ios[M6811_TMSK1];
mask = 0x80;
delay = 65536 * controller->clock_prescaler;
@@ -342,12 +341,28 @@ m68hc11tim_timer_event (struct hw *me, void *data)
for (i = M6811_TOC1; i <= M6811_TOC5; i += 2, mask >>= 1)
{
unsigned long compare;
-
- compare = (cpu->ios[i] << 8) + cpu->ios[i+1];
- if (compare == tcnt && (flags & mask))
+
+ compare = (cpu->ios[i] << 8) + cpu->ios[i + 1];
+
+ /* See if compare is reached; handle wrap arround. */
+ if ((compare >= tcnt_prev && compare <= tcnt && tcnt_prev < tcnt)
+ || (compare >= tcnt_prev && tcnt_prev > tcnt)
+ || (compare < tcnt && tcnt_prev > tcnt))
{
+ unsigned dt;
+
+ if (compare > tcnt)
+ dt = 0x10000 - compare - tcnt;
+ else
+ dt = tcnt - compare;
+
cpu->ios[M6811_TFLG1] |= mask;
- check_interrupt++;
+
+ /* Raise interrupt now at the correct CPU cycle so that
+ we can find the interrupt latency. */
+ cpu->cpu_absolute_cycle -= dt;
+ interrupts_update_pending (&cpu->cpu_interrupts);
+ cpu->cpu_absolute_cycle += dt;
}
/* Compute how many times for the next match.
@@ -359,14 +374,18 @@ m68hc11tim_timer_event (struct hw *me, void *data)
else
compare = compare - tcnt_internal
+ 65536 * controller->clock_prescaler;
-
+
if (compare < delay)
delay = compare;
}
/* Deactivate the compare timer if no output compare is enabled. */
- if ((flags & 0xF0) == 0)
+ if ((flags & 0xF8) == 0)
delay = 0;
+ else
+ delay += events->nr_ticks_to_process;
+
+ eventp = &controller->cmp_timer_event;
break;
default:
@@ -394,6 +413,30 @@ m68hc11tim_timer_event (struct hw *me, void *data)
/* Descriptions of the Timer I/O ports. These descriptions are only used to
give information of the Timer device under GDB. */
+io_reg_desc tmsk1_desc[] = {
+ { M6811_OC1I, "OC1I ", "Timer Output Compare 1 Interrupt Enable" },
+ { M6811_OC2I, "OC2I ", "Timer Output Compare 2 Interrupt Enable" },
+ { M6811_OC3I, "OC3I ", "Timer Output Compare 3 Interrupt Enable" },
+ { M6811_OC4I, "OC4I ", "Timer Output Compare 4 Interrupt Enable" },
+ { M6811_OC5I, "OC5I ", "Timer Input Capture 4 / Output Compare 5 Enable" },
+ { M6811_IC1I, "IC1I ", "Timer Input Capture 1 Interrupt Enable" },
+ { M6811_IC2I, "IC2I ", "Timer Input Capture 2 Interrupt Enable" },
+ { M6811_IC3I, "IC3I ", "Timer Input Capture 3 Interrupt Enable" },
+ { 0, 0, 0 }
+};
+
+io_reg_desc tflg1_desc[] = {
+ { M6811_OC1F, "OC1F ", "Timer Output Compare 1 Interrupt Flag" },
+ { M6811_OC2F, "OC2F ", "Timer Output Compare 2 Interrupt Flag" },
+ { M6811_OC3F, "OC3F ", "Timer Output Compare 3 Interrupt Flag" },
+ { M6811_OC4F, "OC4F ", "Timer Output Compare 4 Interrupt Flag" },
+ { M6811_OC5F, "OC5F ", "Timer Input Capture 4 / Output Compare 5 Flag" },
+ { M6811_IC1F, "IC1F ", "Timer Input Capture 1 Interrupt Flag" },
+ { M6811_IC2F, "IC2F ", "Timer Input Capture 2 Interrupt Flag" },
+ { M6811_IC3F, "IC3F ", "Timer Input Capture 3 Interrupt Flag" },
+ { 0, 0, 0 }
+};
+
io_reg_desc tmsk2_desc[] = {
{ M6811_TOI, "TOI ", "Timer Overflow Interrupt Enable" },
{ M6811_RTII, "RTII ", "RTI Interrupt Enable" },
@@ -433,22 +476,35 @@ to_realtime (sim_cpu *cpu, signed64 t)
}
const char*
-cycle_to_string (sim_cpu *cpu, signed64 t)
+cycle_to_string (sim_cpu *cpu, signed64 t, int flags)
{
- double dt;
- char tbuf[32];
+ char time_buf[32];
+ char cycle_buf[32];
static char buf[64];
- dt = to_realtime (cpu, t);
- if (dt < 0.001)
- sprintf (tbuf, "(%3.1f us)", dt * 1000000.0);
- else if (dt < 1.0)
- sprintf (tbuf, "(%3.1f ms)", dt * 1000.0);
- else
- sprintf (tbuf, "(%3.1f s)", dt);
+ time_buf[0] = 0;
+ cycle_buf[0] = 0;
+ if (flags & PRINT_TIME)
+ {
+ double dt;
+
+ dt = to_realtime (cpu, t);
+ if (dt < 0.001)
+ sprintf (time_buf, " (%3.1f us)", dt * 1000000.0);
+ else if (dt < 1.0)
+ sprintf (time_buf, " (%3.1f ms)", dt * 1000.0);
+ else
+ sprintf (time_buf, " (%3.1f s)", dt);
+ }
+
+ if (flags & PRINT_CYCLE)
+ sprintf (cycle_buf, " cycle%s",
+ (t > 1 ? "s" : ""));
- sprintf (buf, "%llu cycle%s %10.10s", t,
- (t > 1 ? "s" : ""), tbuf);
+ if (t < LONG_MAX)
+ sprintf (buf, "%9lu%s%s", (unsigned long) t, cycle_buf, time_buf);
+ else
+ sprintf (buf, "%llu%s%s", t, cycle_buf, time_buf);
return buf;
}
@@ -472,7 +528,7 @@ m68hc11tim_print_timer (struct hw *me, const char *name,
t = hw_event_remain_time (me, event);
sim_io_printf (sd, " Next %s interrupt in %s\n",
- name, cycle_to_string (cpu, t));
+ name, cycle_to_string (cpu, t, PRINT_TIME | PRINT_CYCLE));
}
}
@@ -484,6 +540,7 @@ m68hc11tim_info (struct hw *me)
sim_cpu *cpu;
struct m68hc11tim *controller;
uint8 val;
+ uint16 val16;
sd = hw_system (me);
cpu = STATE_CPU (sd, 0);
@@ -493,6 +550,56 @@ m68hc11tim_info (struct hw *me)
base = cpu_get_io_base (cpu);
+ /* Info for TIC1 */
+ val16 = (cpu->ios[M6811_TIC1_H] << 8) + cpu->ios[M6811_TIC1_L];
+ print_io_word (sd, "TIC1 ", 0, val16, base + M6811_TIC1);
+ sim_io_printf (sd, "\n");
+
+ /* Info for TIC2 */
+ val16 = (cpu->ios[M6811_TIC2_H] << 8) + cpu->ios[M6811_TIC2_L];
+ print_io_word (sd, "TIC2 ", 0, val16, base + M6811_TIC2);
+ sim_io_printf (sd, "\n");
+
+ /* Info for TIC3 */
+ val16 = (cpu->ios[M6811_TIC3_H] << 8) + cpu->ios[M6811_TIC3_L];
+ print_io_word (sd, "TIC3 ", 0, val16, base + M6811_TIC3);
+ sim_io_printf (sd, "\n");
+
+ /* Info for TOC1 */
+ val16 = (cpu->ios[M6811_TOC1_H] << 8) + cpu->ios[M6811_TOC1_L];
+ print_io_word (sd, "TOC1 ", 0, val16, base + M6811_TOC1);
+ sim_io_printf (sd, "\n");
+
+ /* Info for TOC2 */
+ val16 = (cpu->ios[M6811_TOC2_H] << 8) + cpu->ios[M6811_TOC2_L];
+ print_io_word (sd, "TOC2 ", 0, val16, base + M6811_TOC2);
+ sim_io_printf (sd, "\n");
+
+ /* Info for TOC3 */
+ val16 = (cpu->ios[M6811_TOC3_H] << 8) + cpu->ios[M6811_TOC3_L];
+ print_io_word (sd, "TOC3 ", 0, val16, base + M6811_TOC3);
+ sim_io_printf (sd, "\n");
+
+ /* Info for TOC4 */
+ val16 = (cpu->ios[M6811_TOC4_H] << 8) + cpu->ios[M6811_TOC4_L];
+ print_io_word (sd, "TOC4 ", 0, val16, base + M6811_TOC4);
+ sim_io_printf (sd, "\n");
+
+ /* Info for TOC5 */
+ val16 = (cpu->ios[M6811_TOC5_H] << 8) + cpu->ios[M6811_TOC5_L];
+ print_io_word (sd, "TOC5 ", 0, val16, base + M6811_TOC5);
+ sim_io_printf (sd, "\n");
+
+ /* Info for TMSK1 */
+ val = cpu->ios[M6811_TMSK1];
+ print_io_byte (sd, "TMSK1 ", tmsk1_desc, val, base + M6811_TMSK1);
+ sim_io_printf (sd, "\n");
+
+ /* Info for TFLG1 */
+ val = cpu->ios[M6811_TFLG1];
+ print_io_byte (sd, "TFLG1", tflg1_desc, val, base + M6811_TFLG1);
+ sim_io_printf (sd, "\n");
+
val = cpu->ios[M6811_TMSK2];
print_io_byte (sd, "TMSK2 ", tmsk2_desc, val, base + M6811_TMSK2);
sim_io_printf (sd, "\n");
@@ -568,7 +675,7 @@ m68hc11tim_io_read_buffer (struct hw *me,
break;
}
*((unsigned8*) dest) = val;
- dest++;
+ dest = (char*) dest + 1;
base++;
nr_bytes--;
cnt++;
@@ -679,6 +786,7 @@ m68hc11tim_io_write_buffer (struct hw *me,
case M6811_TMSK1:
cpu->ios[M6811_TMSK1] = val;
interrupts_update_pending (&cpu->cpu_interrupts);
+ reset_compare = 1;
break;
case M6811_TFLG1:
@@ -695,7 +803,7 @@ m68hc11tim_io_write_buffer (struct hw *me,
cpu->ios[base] = val;
reset_compare = 1;
break;
-
+
case M6811_TCTL1:
case M6811_TCTL2:
cpu->ios[base] = val;
@@ -709,7 +817,7 @@ m68hc11tim_io_write_buffer (struct hw *me,
base++;
nr_bytes--;
cnt++;
- source++;
+ source = (char*) source + 1;
}
/* Re-compute the next timer compare event. */
diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c
index 3da382d88ad..b80bc940089 100644
--- a/sim/m68hc11/interp.c
+++ b/sim/m68hc11/interp.c
@@ -1,5 +1,5 @@
/* interp.c -- Simulator for Motorola 68HC11/68HC12
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@nerim.fr)
This file is part of GDB, the GNU debugger.
@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "hw-tree.h"
#include "hw-device.h"
#include "hw-ports.h"
+#include "elf32-m68hc1x.h"
#ifndef MONITOR_BASE
# define MONITOR_BASE (0x0C000)
@@ -194,8 +195,17 @@ sim_hw_configure (SIM_DESC sd)
sim_do_commandf (sd, "memory region 0x000@%d,0x8000",
M6811_RAM_LEVEL);
sim_hw_parse (sd, "/m68hc11/reg 0x1000 0x03F");
+ if (cpu->bank_start < cpu->bank_end)
+ {
+ sim_do_commandf (sd, "memory region 0x%lx@%d,0x100000",
+ cpu->bank_virtual, M6811_RAM_LEVEL);
+ sim_hw_parse (sd, "/m68hc11/use_bank 1");
+ }
}
-
+ if (cpu->cpu_start_mode)
+ {
+ sim_hw_parse (sd, "/m68hc11/mode %s", cpu->cpu_start_mode);
+ }
if (hw_tree_find_property (device_tree, "/m68hc11/m68hc11sio/reg") == 0)
{
sim_hw_parse (sd, "/m68hc11/m68hc11sio/reg 0x2b 0x5");
@@ -242,14 +252,16 @@ sim_hw_configure (SIM_DESC sd)
{
/* Allocate core external memory. */
sim_do_commandf (sd, "memory region 0x%lx@%d,0x%lx",
- 0xC000, M6811_RAM_LEVEL, 0x4000);
+ 0x8000, M6811_RAM_LEVEL, 0x8000);
sim_do_commandf (sd, "memory region 0x000@%d,0x8000",
M6811_RAM_LEVEL);
- sim_do_commandf (sd, "memory region 0x01000000@%d,0x100000",
- M6811_RAM_LEVEL);
-
+ if (cpu->bank_start < cpu->bank_end)
+ {
+ sim_do_commandf (sd, "memory region 0x%lx@%d,0x100000",
+ cpu->bank_virtual, M6811_RAM_LEVEL);
+ sim_hw_parse (sd, "/m68hc12/use_bank 1");
+ }
sim_hw_parse (sd, "/m68hc12/reg 0x0 0x3FF");
- sim_hw_parse (sd, "/m68hc12/use_bank 1");
}
if (!hw_tree_find_property (device_tree, "/m68hc12/m68hc12sio@1/reg"))
@@ -294,19 +306,77 @@ sim_hw_configure (SIM_DESC sd)
return 1;
}
+/* Get the memory bank parameters by looking at the global symbols
+ defined by the linker. */
static int
-sim_prepare_for_program (SIM_DESC sd, struct bfd* abfd)
+sim_get_bank_parameters (SIM_DESC sd, bfd* abfd)
{
sim_cpu *cpu;
+ long symsize;
+ long symbol_count, i;
+ unsigned size;
+ asymbol** asymbols;
+ asymbol** current;
cpu = STATE_CPU (sd, 0);
- if (!sim_hw_configure (sd))
- return SIM_RC_FAIL;
+ symsize = bfd_get_symtab_upper_bound (abfd);
+ if (symsize < 0)
+ {
+ sim_io_eprintf (sd, "Cannot read symbols of program");
+ return 0;
+ }
+ asymbols = (asymbol **) xmalloc (symsize);
+ symbol_count = bfd_canonicalize_symtab (abfd, asymbols);
+ if (symbol_count < 0)
+ {
+ sim_io_eprintf (sd, "Cannot read symbols of program");
+ return 0;
+ }
+
+ size = 0;
+ for (i = 0, current = asymbols; i < symbol_count; i++, current++)
+ {
+ const char* name = bfd_asymbol_name (*current);
+
+ if (strcmp (name, BFD_M68HC11_BANK_START_NAME) == 0)
+ {
+ cpu->bank_start = bfd_asymbol_value (*current);
+ }
+ else if (strcmp (name, BFD_M68HC11_BANK_SIZE_NAME) == 0)
+ {
+ size = bfd_asymbol_value (*current);
+ }
+ else if (strcmp (name, BFD_M68HC11_BANK_VIRTUAL_NAME) == 0)
+ {
+ cpu->bank_virtual = bfd_asymbol_value (*current);
+ }
+ }
+ free (asymbols);
+
+ cpu->bank_end = cpu->bank_start + size;
+ cpu->bank_shift = 0;
+ for (; size > 1; size >>= 1)
+ cpu->bank_shift++;
+
+ return 0;
+}
+
+static int
+sim_prepare_for_program (SIM_DESC sd, bfd* abfd)
+{
+ sim_cpu *cpu;
+ int elf_flags = 0;
+
+ cpu = STATE_CPU (sd, 0);
if (abfd != NULL)
{
asection *s;
+
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
+ elf_flags = elf_elfheader (abfd)->e_flags;
+
cpu->cpu_elf_start = bfd_get_start_address (abfd);
/* See if any section sets the reset address */
cpu->cpu_use_elf_start = 1;
@@ -331,8 +401,17 @@ sim_prepare_for_program (SIM_DESC sd, struct bfd* abfd)
}
}
}
+
+ if (elf_flags & E_M68HC12_BANKS)
+ {
+ if (sim_get_bank_parameters (sd, abfd) != 0)
+ sim_io_eprintf (sd, "Memory bank parameters are not initialized\n");
+ }
}
+ if (!sim_hw_configure (sd))
+ return SIM_RC_FAIL;
+
/* reset all state information */
sim_board_reset (sd);
@@ -341,7 +420,7 @@ sim_prepare_for_program (SIM_DESC sd, struct bfd* abfd)
SIM_DESC
sim_open (SIM_OPEN_KIND kind, host_callback *callback,
- struct bfd *abfd, char **argv)
+ bfd *abfd, char **argv)
{
SIM_DESC sd;
sim_cpu *cpu;
@@ -398,8 +477,11 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
free_state (sd);
return 0;
}
-
- sim_hw_configure (sd);
+ if (sim_prepare_for_program (sd, abfd) != SIM_RC_OK)
+ {
+ free_state (sd);
+ return 0;
+ }
/* Fudge our descriptor. */
return sd;
diff --git a/sim/m68hc11/interrupts.c b/sim/m68hc11/interrupts.c
index 5844c74ea12..b466d69dac9 100644
--- a/sim/m68hc11/interrupts.c
+++ b/sim/m68hc11/interrupts.c
@@ -1,6 +1,6 @@
/* interrupts.c -- 68HC11 Interrupts Emulation
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
- Written by Stephane Carrez (stcarrez@worldnet.fr)
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Written by Stephane Carrez (stcarrez@nerim.fr)
This file is part of GDB, GAS, and the GNU binutils.
@@ -166,6 +166,20 @@ interrupts_reset (struct interrupts *interrupts)
memset (interrupts->interrupts, 0,
sizeof (interrupts->interrupts));
+
+ /* In bootstrap mode, initialize the vector table to point
+ to the RAM location. */
+ if (interrupts->cpu->cpu_mode == M6811_SMOD)
+ {
+ bfd_vma addr = interrupts->vectors_addr;
+ uint16 vector = 0x0100 - 3 * (M6811_INT_NUMBER - 1);
+ for (i = 0; i < M6811_INT_NUMBER; i++)
+ {
+ memory_write16 (interrupts->cpu, addr, vector);
+ addr += 2;
+ vector += 3;
+ }
+ }
}
static int
@@ -517,7 +531,7 @@ interrupts_raise (struct interrupts *interrupts, enum M6811_INT number)
void
interrupts_info (SIM_DESC sd, struct interrupts *interrupts)
{
- signed64 t;
+ signed64 t, prev_interrupt;
int i;
sim_io_printf (sd, "Interrupts Info:\n");
@@ -533,21 +547,25 @@ interrupts_info (SIM_DESC sd, struct interrupts *interrupts)
interrupts->max_mask_cycles = t;
sim_io_printf (sd, " Current interrupts masked sequence: %s\n",
- cycle_to_string (interrupts->cpu, t));
+ cycle_to_string (interrupts->cpu, t,
+ PRINT_TIME | PRINT_CYCLE));
}
t = interrupts->min_mask_cycles == CYCLES_MAX ?
interrupts->max_mask_cycles :
interrupts->min_mask_cycles;
sim_io_printf (sd, " Shortest interrupts masked sequence: %s\n",
- cycle_to_string (interrupts->cpu, t));
+ cycle_to_string (interrupts->cpu, t,
+ PRINT_TIME | PRINT_CYCLE));
t = interrupts->max_mask_cycles;
sim_io_printf (sd, " Longest interrupts masked sequence: %s\n",
- cycle_to_string (interrupts->cpu, t));
+ cycle_to_string (interrupts->cpu, t,
+ PRINT_TIME | PRINT_CYCLE));
t = interrupts->last_mask_cycles;
sim_io_printf (sd, " Last interrupts masked sequence: %s\n",
- cycle_to_string (interrupts->cpu, t));
+ cycle_to_string (interrupts->cpu, t,
+ PRINT_TIME | PRINT_CYCLE));
if (interrupts->xirq_start_mask_cycle >= 0)
{
@@ -558,22 +576,26 @@ interrupts_info (SIM_DESC sd, struct interrupts *interrupts)
interrupts->xirq_max_mask_cycles = t;
sim_io_printf (sd, " XIRQ Current interrupts masked sequence: %s\n",
- cycle_to_string (interrupts->cpu, t));
+ cycle_to_string (interrupts->cpu, t,
+ PRINT_TIME | PRINT_CYCLE));
}
t = interrupts->xirq_min_mask_cycles == CYCLES_MAX ?
interrupts->xirq_max_mask_cycles :
interrupts->xirq_min_mask_cycles;
sim_io_printf (sd, " XIRQ Min interrupts masked sequence: %s\n",
- cycle_to_string (interrupts->cpu, t));
+ cycle_to_string (interrupts->cpu, t,
+ PRINT_TIME | PRINT_CYCLE));
t = interrupts->xirq_max_mask_cycles;
sim_io_printf (sd, " XIRQ Max interrupts masked sequence: %s\n",
- cycle_to_string (interrupts->cpu, t));
+ cycle_to_string (interrupts->cpu, t,
+ PRINT_TIME | PRINT_CYCLE));
t = interrupts->xirq_last_mask_cycles;
sim_io_printf (sd, " XIRQ Last interrupts masked sequence: %s\n",
- cycle_to_string (interrupts->cpu, t));
+ cycle_to_string (interrupts->cpu, t,
+ PRINT_TIME | PRINT_CYCLE));
if (interrupts->pending_mask)
{
@@ -590,6 +612,9 @@ interrupts_info (SIM_DESC sd, struct interrupts *interrupts)
sim_io_printf (sd, "\n");
}
+ prev_interrupt = 0;
+ sim_io_printf (sd, "N Interrupt Cycle Taken Latency"
+ " Delta between interrupts\n");
for (i = 0; i < MAX_INT_HISTORY; i++)
{
int which;
@@ -604,10 +629,18 @@ interrupts_info (SIM_DESC sd, struct interrupts *interrupts)
break;
dt = h->taken_cycle - h->raised_cycle;
- sim_io_printf (sd, "%2d %-10.10s %30.30s ", i,
+ sim_io_printf (sd, "%2d %-9.9s %15.15s ", i,
interrupt_names[h->type],
- cycle_to_string (interrupts->cpu, h->taken_cycle));
- sim_io_printf (sd, "%s\n",
- cycle_to_string (interrupts->cpu, dt));
+ cycle_to_string (interrupts->cpu, h->taken_cycle, 0));
+ sim_io_printf (sd, "%15.15s",
+ cycle_to_string (interrupts->cpu, dt, 0));
+ if (prev_interrupt)
+ {
+ dt = prev_interrupt - h->taken_cycle;
+ sim_io_printf (sd, " %s",
+ cycle_to_string (interrupts->cpu, dt, PRINT_TIME));
+ }
+ sim_io_printf (sd, "\n");
+ prev_interrupt = h->taken_cycle;
}
}
diff --git a/sim/m68hc11/m68hc11_sim.c b/sim/m68hc11/m68hc11_sim.c
index fe5985f8f1c..444147b9492 100644
--- a/sim/m68hc11/m68hc11_sim.c
+++ b/sim/m68hc11/m68hc11_sim.c
@@ -1,5 +1,5 @@
/* m6811_cpu.c -- 68HC11&68HC12 CPU Emulation
- Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@nerim.fr)
This file is part of GDB, GAS, and the GNU binutils.
@@ -27,6 +27,7 @@ enum {
OPTION_CPU_RESET = OPTION_START,
OPTION_EMUL_OS,
OPTION_CPU_CONFIG,
+ OPTION_CPU_BOOTSTRAP,
OPTION_CPU_MODE
};
@@ -46,6 +47,10 @@ static const OPTION cpu_options[] =
'\0', NULL, "Specify the initial CPU configuration register",
cpu_option_handler },
+ { {"bootstrap", no_argument, NULL, OPTION_CPU_BOOTSTRAP },
+ '\0', NULL, "Start the processing in bootstrap mode",
+ cpu_option_handler },
+
{ {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
};
@@ -77,7 +82,11 @@ cpu_option_handler (SIM_DESC sd, sim_cpu *cpu,
else
cpu->cpu_use_local_config = 0;
break;
-
+
+ case OPTION_CPU_BOOTSTRAP:
+ cpu->cpu_start_mode = "bootstrap";
+ break;
+
case OPTION_CPU_MODE:
break;
}
@@ -464,6 +473,9 @@ cpu_initialize (SIM_DESC sd, sim_cpu *cpu)
cpu->cpu_use_elf_start = 0;
cpu->cpu_elf_start = 0;
cpu->cpu_use_local_config = 0;
+ cpu->bank_start = 0;
+ cpu->bank_end = 0;
+ cpu->bank_shift = 0;
cpu->cpu_config = M6811_NOSEC | M6811_NOCOP | M6811_ROMON |
M6811_EEON;
interrupts_initialize (sd, cpu);
@@ -582,6 +594,15 @@ print_io_byte (SIM_DESC sd, const char *name, io_reg_desc *desc,
}
void
+print_io_word (SIM_DESC sd, const char *name, io_reg_desc *desc,
+ uint16 val, uint16 addr)
+{
+ sim_io_printf (sd, " %-9.9s @ 0x%04x 0x%04x ", name, addr, val);
+ if (desc)
+ print_io_reg_desc (sd, desc, val, 0);
+}
+
+void
cpu_ccr_update_tst8 (sim_cpu *proc, uint8 val)
{
cpu_set_ccr_V (proc, 0);
@@ -1037,7 +1058,8 @@ cpu_info (SIM_DESC sd, sim_cpu *cpu)
{
sim_io_printf (sd, "CPU info:\n");
sim_io_printf (sd, " Absolute cycle: %s\n",
- cycle_to_string (cpu, cpu->cpu_absolute_cycle));
+ cycle_to_string (cpu, cpu->cpu_absolute_cycle,
+ PRINT_TIME | PRINT_CYCLE));
sim_io_printf (sd, " Syscall emulation: %s\n",
cpu->cpu_emul_syscall ? "yes, via 0xcd <n>" : "no");
diff --git a/sim/m68hc11/sim-main.h b/sim/m68hc11/sim-main.h
index c8933a0791f..a4bd3a62bf8 100644
--- a/sim/m68hc11/sim-main.h
+++ b/sim/m68hc11/sim-main.h
@@ -1,5 +1,5 @@
/* sim-main.h -- Simulator for Motorola 68HC11 & 68HC12
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@nerim.fr)
This file is part of GDB, the GNU debugger.
@@ -79,8 +79,8 @@ enum cpu_type
#define A_REGNUM 5
#define B_REGNUM 6
#define PSW_REGNUM 7
-#define Z_REGNUM 8
-#define PAGE_REGNUM 9
+#define PAGE_REGNUM 8
+#define Z_REGNUM 9
typedef struct m6811_regs {
unsigned short d;
@@ -108,6 +108,8 @@ extern void print_io_reg_desc (SIM_DESC sd, io_reg_desc *desc, int val,
int mode);
extern void print_io_byte (SIM_DESC sd, const char *name,
io_reg_desc *desc, uint8 val, uint16 addr);
+extern void print_io_word (SIM_DESC sd, const char *name,
+ io_reg_desc *desc, uint16 val, uint16 addr);
/* List of special 68HC11&68HC12 instructions that are not handled by the
@@ -198,6 +200,7 @@ struct _sim_cpu {
/* The mode in which the CPU is configured (MODA and MODB pins). */
unsigned int cpu_mode;
+ const char* cpu_start_mode;
/* The cpu being configured. */
enum cpu_type cpu_type;
@@ -208,6 +211,14 @@ struct _sim_cpu {
uint8 ios[MAX_PORTS];
+ /* Memory bank parameters which describe how the memory bank window
+ is mapped in memory and how to convert it in virtual address. */
+ uint16 bank_start;
+ uint16 bank_end;
+ address_word bank_virtual;
+ unsigned bank_shift;
+
+
struct hw *hw_cpu;
/* ... base type ... */
@@ -235,7 +246,7 @@ struct _sim_cpu {
#define cpu_get_sp(PROC) ((PROC)->cpu_regs.sp)
#define cpu_get_a(PROC) ((PROC->cpu_regs.d >> 8) & 0x0FF)
#define cpu_get_b(PROC) ((PROC->cpu_regs.d) & 0x0FF)
-#define cpu_get_page(PROC) (PROC->cpu_regs.page)
+#define cpu_get_page(PROC) ((PROC)->cpu_regs.page)
/* 68HC12 specific and Motorola internal registers. */
#define cpu_get_tmp3(PROC) (0)
@@ -244,7 +255,7 @@ struct _sim_cpu {
#define cpu_set_d(PROC,VAL) (((PROC)->cpu_regs.d) = (VAL))
#define cpu_set_x(PROC,VAL) (((PROC)->cpu_regs.ix) = (VAL))
#define cpu_set_y(PROC,VAL) (((PROC)->cpu_regs.iy) = (VAL))
-#define cpu_set_page(PROC,VAL) ((PROC->cpu_regs.page) = (VAL))
+#define cpu_set_page(PROC,VAL) (((PROC)->cpu_regs.page) = (VAL))
/* 68HC12 specific and Motorola internal registers. */
#define cpu_set_tmp3(PROC,VAL) (0)
@@ -295,9 +306,10 @@ extern void cpu_memory_exception (struct _sim_cpu *proc,
inline address_word
phys_to_virt (sim_cpu *cpu, address_word addr)
{
- if (addr >= 0x8000 && addr < 0xc000)
- return ((address_word) (addr) - 0x8000)
- + (((address_word) cpu->cpu_regs.page) << 14) + 0x01000000;
+ if (addr >= cpu->bank_start && addr < cpu->bank_end)
+ return ((address_word) (addr - cpu->bank_start)
+ + (((address_word) cpu->cpu_regs.page) << cpu->bank_shift)
+ + cpu->bank_virtual);
else
return (address_word) (addr);
}
@@ -580,7 +592,9 @@ extern void sim_set_profile (int n);
extern void sim_set_profile_size (int n);
extern void sim_board_reset (SIM_DESC sd);
-extern const char *cycle_to_string (sim_cpu *cpu, signed64 t);
+#define PRINT_TIME 0x01
+#define PRINT_CYCLE 0x02
+extern const char *cycle_to_string (sim_cpu *cpu, signed64 t, int flags);
#endif
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog
index 9a5b6023ade..5602ce8fe95 100644
--- a/sim/mn10300/ChangeLog
+++ b/sim/mn10300/ChangeLog
@@ -1,3 +1,12 @@
+2003-08-28 Andrew Cagney <cagney@redhat.com>
+
+ * dv-mn103ser.c (do_polling_event): Change type of "serial_reg" to
+ "long".
+ (read_status_reg): Cast "serial_reg" to "long".
+ * dv-mn103tim.c (do_counter_event): Change type of "timer_nr" to
+ "long".
+ (do_counter6_event, write_mode_reg, write_tm6md): Ditto.
+
2003-02-27 Andrew Cagney <cagney@redhat.com>
* interp.c (sim_open, sim_create_inferior, sim_open)
diff --git a/sim/mn10300/dv-mn103ser.c b/sim/mn10300/dv-mn103ser.c
index 7f20ed1f6b2..bba20c9d920 100644
--- a/sim/mn10300/dv-mn103ser.c
+++ b/sim/mn10300/dv-mn103ser.c
@@ -240,7 +240,7 @@ do_polling_event (struct hw *me,
void *data)
{
struct mn103ser *serial = hw_data(me);
- int serial_reg = (int) data;
+ long serial_reg = (long) data;
char c;
int count;
@@ -421,7 +421,7 @@ read_status_reg (struct hw *me,
serial->device[serial_reg].event
= hw_event_queue_schedule (me, 1000,
do_polling_event,
- (void *)serial_reg);
+ (void *) (long) serial_reg);
}
if ( nr_bytes == 1 )
diff --git a/sim/mn10300/dv-mn103tim.c b/sim/mn10300/dv-mn103tim.c
index 9b1e0d2e7ee..a6272d8bc3a 100644
--- a/sim/mn10300/dv-mn103tim.c
+++ b/sim/mn10300/dv-mn103tim.c
@@ -568,7 +568,7 @@ do_counter_event (struct hw *me,
void *data)
{
struct mn103tim *timers = hw_data(me);
- int timer_nr = (int) data;
+ long timer_nr = (long) data;
int next_timer;
/* Check if counting is still enabled. */
@@ -609,7 +609,7 @@ do_counter6_event (struct hw *me,
void *data)
{
struct mn103tim *timers = hw_data(me);
- int timer_nr = (int) data;
+ long timer_nr = (long) data;
int next_timer;
/* Check if counting is still enabled. */
@@ -705,7 +705,7 @@ write_base_reg (struct hw *me,
static void
write_mode_reg (struct hw *me,
struct mn103tim *timers,
- int timer_nr,
+ long timer_nr,
const void *source,
unsigned nr_bytes)
/* for timers 0 to 5 */
@@ -716,7 +716,8 @@ write_mode_reg (struct hw *me,
if ( nr_bytes != 1 )
{
- hw_abort (me, "bad write size of %d bytes to TM%dMD.", nr_bytes, timer_nr);
+ hw_abort (me, "bad write size of %d bytes to TM%ldMD.", nr_bytes,
+ timer_nr);
}
mode_val = *(unsigned8 *)source;
@@ -742,7 +743,7 @@ write_mode_reg (struct hw *me,
{
if ( timer_nr == 0 || timer_nr == 4 )
{
- hw_abort(me, "Timer %d cannot be cascaded.", timer_nr);
+ hw_abort(me, "Timer %ld cannot be cascaded.", timer_nr);
}
}
else
@@ -839,7 +840,7 @@ write_tm6md (struct hw *me,
{
unsigned8 mode_val0 = 0x00, mode_val1 = 0x00;
unsigned32 div_ratio;
- int timer_nr = 6;
+ long timer_nr = 6;
unsigned_word offset = address - timers->block[0].base;
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog
index b34adb5cf87..7ab1394aef3 100644
--- a/sim/sh/ChangeLog
+++ b/sim/sh/ChangeLog
@@ -1,3 +1,13 @@
+2003-08-11 Shrinivas Atre <shrinivasa@KPITCummins.com>
+ * sim/sh/gencode.c ( tab[] ): Addition of MAC.L handler and
+ correction for MAC.W handler
+ * sim/sh/interp.c ( macl ): New Function. Implementation of
+ MAC.L handler.
+
+2003-08-07 Michael Snyder <msnyder@redhat.com>
+
+ * gencode.c (expand_ppi_code): Comment spelling fix.
+
2003-07-25 Michael Snyder <msnyder@redhat.com>
* gencode.c (pshl): Change < to <= (shift by 16 is allowed).
diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c
index d078fc6cca9..a4a1c2d34d7 100644
--- a/sim/sh/gencode.c
+++ b/sim/sh/gencode.c
@@ -580,12 +580,11 @@ op tab[] =
},
{ "nm", "nm", "mac.l @<REG_M>+,@<REG_N>+", "0000nnnnmmmm1111",
- "trap (255, R0, PC, memory, maskl, maskw, endianw);",
- "/* FIXME: mac.l support */",
+ "macl(&R0,memory,n,m);",
},
{ "nm", "nm", "mac.w @<REG_M>+,@<REG_N>+", "0100nnnnmmmm1111",
- "macw(R0,memory,n,m,endianw);",
+ "macw(&R0,memory,n,m,endianw);",
},
{ "n", "", "mov #<imm>,<REG_N>", "1110nnnni8*1....",
@@ -2324,7 +2323,7 @@ gendefines ()
static int ppi_index;
-/* Take an ppi code, expand all varying fields in it and fill all the
+/* Take a ppi code, expand all varying fields in it and fill all the
right entries in 'table' with the opcode index. */
static void
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index 887b7a602a4..91899f400e9 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -169,6 +169,7 @@ static char **prog_argv;
#if 1
static int maskw = 0;
+static int maskl = 0;
#endif
static SIM_OPEN_KIND sim_kind;
@@ -651,6 +652,7 @@ rbat_fast (memory, x, maskb)
#define RUWAT(x) (RWAT(x) & 0xffff)
#define RSWAT(x) ((short)(RWAT(x)))
+#define RSLAT(x) ((long)(RLAT(x)))
#define RSBAT(x) (SEXT(RBAT(x)))
#define RDAT(x, n) (do_rdat (memory, (x), (n), (maskl)))
@@ -1348,6 +1350,56 @@ macw (regs, memory, n, m, endianw)
MACL = sum;
}
+static void
+macl (regs, memory, n, m)
+ int *regs;
+ unsigned char *memory;
+ int m, n;
+{
+ long tempm, tempn;
+ long prod, macl, mach, sum;
+ long long ans,ansl,ansh,t;
+ unsigned long long high,low,combine;
+ union mac64
+ {
+ long m[2]; /* mach and macl*/
+ long long m64; /* 64 bit MAC */
+ }mac64;
+
+ tempm = RSLAT(regs[m]);
+ regs[m] += 4;
+
+ tempn = RSLAT(regs[n]);
+ regs[n] += 4;
+
+ mach = MACH;
+ macl = MACL;
+
+ mac64.m[0] = macl;
+ mac64.m[1] = mach;
+
+ ans = (long long)tempm * (long long)tempn; /* Multiply 32bit * 32bit */
+
+ mac64.m64 += ans; /* Accumulate 64bit + 64 bit */
+
+ macl = mac64.m[0];
+ mach = mac64.m[1];
+
+ if (S) /* Store only 48 bits of the result */
+ {
+ if (mach < 0) /* Result is negative */
+ {
+ mach = mach & 0x0000ffff; /* Mask higher 16 bits */
+ mach |= 0xffff8000; /* Sign extend higher 16 bits */
+ }
+ else
+ mach = mach & 0x00007fff; /* Postive Result */
+ }
+
+ MACL = macl;
+ MACH = mach;
+}
+
static struct loop_bounds
get_loop_bounds (rs, re, memory, mem_end, maskw, endianw)
int rs, re;
diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index 301fe81b2b1..ec6b7e379f9 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -1,3 +1,31 @@
+2003-09-11 Michael Snyder <msnyder@redhat.com>
+
+ * sim/testsuite/sim/frv/movgs.cgs: Change lcr to spr[273],
+ which according to the comments seems to be the intent.
+
+2003-09-09 Dave Brolley <brolley@redhat.com>
+
+ * sim/frv/maddaccs.cgs: move to fr400 subdirectory.
+ * sim/frv/msubaccs.cgs: move to fr400 subdirectory.
+ * sim/frv/masaccs.cgs: move to fr400 subdirectory.
+
+2003-09-03 Michael Snyder <msnyder@redhat.com>
+
+ * sim/frv/fr500/mclracc.cgs: Change mach to 'all', to be
+ consistent with other tests in the directory.
+
+2003-09-03 Michael Snyder <msnyder@redhat.com>
+
+ * sim/frv/interrupts/Ipipe-fr400.cgs: New file.
+ * sim/frv/interrupts/Ipipe-fr500.cgs: New file.
+ * sim/frv/interrupts/Ipipe.cgs: Remove (replaced by above).
+
+2003-08-20 Michael Snyder <msnyder@redhat.com>
+ On behalf of Dave Brolley
+
+ * sim/frv: New testsuite.
+ * frv-elf: New testsuite.
+
2003-07-09 Michael Snyder <msnyder@redhat.com>
* sim/sh: New directory. Tests for Renesas sh family.
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 42374e09772..017fcefb249 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -331,20 +331,20 @@ proc slurp_options { file } {
# whitespace is ignored anywhere except within the options list;
# option names are alphabetic only
set pat "^#${ws}(\[a-zA-Z\]*)\\(?(\[^):\]*)\\)?$ws:${ws}(.*)$ws\$"
- # Allow comment as first line of file.
- set firstline 1
+ # Allow arbitrary lines until the first option is seen.
+ set seen_opt 0
while { [gets $f line] != -1 } {
set line [string trim $line]
# Whitespace here is space-tab.
if [regexp $pat $line xxx opt_name opt_machs opt_val] {
# match!
lappend opt_array [list $opt_name $opt_machs $opt_val]
+ set seen_opt 1
} else {
- if { ! $firstline } {
+ if { $seen_opt } {
break
}
}
- set firstline 0
}
close $f
return $opt_array
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog
index 78fe7e288c2..6f528ef0671 100644
--- a/sim/v850/ChangeLog
+++ b/sim/v850/ChangeLog
@@ -1,3 +1,15 @@
+2003-09-05 Andrew Cagney <cagney@redhat.com>
+ Nick Clifton <nickc@redhat.com>
+
+ * interp.c (sim_open): Accept bfd_mach_v850e1.
+ * v850-dc: Add entry for v850e1.
+ * v850.igen: Add support for v850e1.
+ Add code for DBTRAP and DBRET instructions.
+ (dbtrap): Create a separate v850e1 specific instruction.
+ Only generate a trap if the target is not the v850e1.
+ Otherwise treat it as a special kind of branch.
+ (break): Mark as v850/v850e specific.
+
2003-05-16 Ian Lance Taylor <ian@airs.com>
* Makefile.in (SHELL): Make sure this is defined.
diff --git a/sim/v850/interp.c b/sim/v850/interp.c
index 62a46162152..1ca248ca3e9 100644
--- a/sim/v850/interp.c
+++ b/sim/v850/interp.c
@@ -277,6 +277,7 @@ sim_open (kind, cb, abfd, argv)
{
case bfd_mach_v850:
case bfd_mach_v850e:
+ case bfd_mach_v850e1:
STATE_CPU (sd, 0)->psw_mask = (PSW_NP | PSW_EP | PSW_ID | PSW_SAT
| PSW_CY | PSW_OV | PSW_S | PSW_Z);
break;
diff --git a/sim/v850/v850-dc b/sim/v850/v850-dc
index 1d061ecc570..29fa127d53b 100644
--- a/sim/v850/v850-dc
+++ b/sim/v850/v850-dc
@@ -11,6 +11,7 @@
switch,combine : 4 : 0 : : : : 1 : V,VII :
switch,combine : 4 : 0 : : : : 1 : V,XIII : v850e
+ switch,combine : 4 : 0 : : : : 1 : V,XIII : v850e1
# for opcode 63, 127, 1087 et.al.
diff --git a/sim/v850/v850.igen b/sim/v850/v850.igen
index 3f14957965a..4796ea5e4e3 100644
--- a/sim/v850/v850.igen
+++ b/sim/v850/v850.igen
@@ -12,6 +12,8 @@
:option:::multi-sim:true
:model:::v850e:v850e:
+:option:::multi-sim:true
+:model:::v850e1:v850e1:
// Cache macros
@@ -156,6 +158,7 @@ ddddd,1011,ddd,cccc:III:::Bcond
// BSH
rrrrr,11111100000 + wwwww,01101000010:XII:::bsh
*v850e
+*v850e1
"bsh r<reg2>, r<reg3>"
{
unsigned32 value;
@@ -178,6 +181,7 @@ rrrrr,11111100000 + wwwww,01101000010:XII:::bsh
// BSW
rrrrr,11111100000 + wwwww,01101000000:XII:::bsw
*v850e
+*v850e1
"bsw r<reg2>, r<reg3>"
{
#define WORDHASNULLBYTE(x) (((x) - 0x01010101) & ~(x)&0x80808080)
@@ -203,6 +207,7 @@ rrrrr,11111100000 + wwwww,01101000000:XII:::bsw
// CALLT
0000001000,iiiiii:II:::callt
*v850e
+*v850e1
"callt <imm6>"
{
unsigned32 adr;
@@ -225,6 +230,7 @@ rrrrr,11111100000 + wwwww,01101000000:XII:::bsw
rrrrr,111111,RRRRR + 0000000011100100:IX:::clr1
*v850e
+*v850e1
"clr1 r<reg2>, [r<reg1>]"
{
COMPAT_2 (OP_E407E0 ());
@@ -234,6 +240,7 @@ rrrrr,111111,RRRRR + 0000000011100100:IX:::clr1
// CTRET
0000011111100000 + 0000000101000100:X:::ctret
*v850e
+*v850e1
"ctret"
{
nia = (CTPC & ~1);
@@ -244,6 +251,7 @@ rrrrr,111111,RRRRR + 0000000011100100:IX:::clr1
// CMOV
rrrrr,111111,RRRRR + wwwww,011001,cccc,0:XI:::cmov
*v850e
+*v850e1
"cmov %s<cccc>, r<reg1>, r<reg2>, r<reg3>"
{
int cond = condition_met (cccc);
@@ -254,6 +262,7 @@ rrrrr,111111,RRRRR + wwwww,011001,cccc,0:XI:::cmov
rrrrr,111111,iiiii + wwwww,011000,cccc,0:XII:::cmov
*v850e
+*v850e1
"cmov %s<cccc>, <imm5>, r<reg2>, r<reg3>"
{
int cond = condition_met (cccc);
@@ -291,6 +300,7 @@ rrrrr,010011,iiiii:II:::cmp
// "dispose <imm5>, <list12>"
0000011001,iiiii,L + LLLLLLLLLLL,RRRRR:XIII:::dispose
*v850e
+*v850e1
"dispose <imm5>, <list12>":RRRRR == 0
"dispose <imm5>, <list12>, [reg1]"
{
@@ -322,6 +332,7 @@ rrrrr,010011,iiiii:II:::cmp
// DIV
rrrrr,111111,RRRRR + wwwww,01011000000:XI:::div
*v850e
+*v850e1
"div r<reg1>, r<reg2>, r<reg3>"
{
COMPAT_2 (OP_2C007E0 ());
@@ -378,6 +389,7 @@ rrrrr!0,000010,RRRRR!0:I:::divh
rrrrr,111111,RRRRR + wwwww,01010000000:XI:::divh
*v850e
+*v850e1
"divh r<reg1>, r<reg2>, r<reg3>"
{
COMPAT_2 (OP_28007E0 ());
@@ -387,6 +399,7 @@ rrrrr,111111,RRRRR + wwwww,01010000000:XI:::divh
// DIVHU
rrrrr,111111,RRRRR + wwwww,01010000010:XI:::divhu
*v850e
+*v850e1
"divhu r<reg1>, r<reg2>, r<reg3>"
{
COMPAT_2 (OP_28207E0 ());
@@ -396,6 +409,7 @@ rrrrr,111111,RRRRR + wwwww,01010000010:XI:::divhu
// DIVU
rrrrr,111111,RRRRR + wwwww,01011000010:XI:::divu
*v850e
+*v850e1
"divu r<reg1>, r<reg2>, r<reg3>"
{
COMPAT_2 (OP_2C207E0 ());
@@ -423,6 +437,7 @@ rrrrr,111111,RRRRR + wwwww,01011000010:XI:::divu
// HSW
rrrrr,11111100000 + wwwww,01101000100:XII:::hsw
*v850e
+*v850e1
"hsw r<reg2>, r<reg3>"
{
unsigned32 value;
@@ -497,6 +512,7 @@ rrrrr,111001,RRRRR + ddddddddddddddd,1:VII:::ld.w
rrrrr!0,11110,b,RRRRR + ddddddddddddddd,1:VII:::ld.bu
*v850e
+*v850e1
"ld.bu <disp16>[r<reg1>], r<reg2>"
{
COMPAT_2 (OP_10780 ());
@@ -504,6 +520,7 @@ rrrrr!0,11110,b,RRRRR + ddddddddddddddd,1:VII:::ld.bu
rrrrr!0,111111,RRRRR + ddddddddddddddd,1:VII:::ld.hu
*v850e
+*v850e1
"ld.hu <disp16>[r<reg1>], r<reg2>"
{
COMPAT_2 (OP_107E0 ());
@@ -544,6 +561,7 @@ rrrrr!0,010000,iiiii:II:::mov
00000110001,RRRRR + iiiiiiiiiiiiiiii + IIIIIIIIIIIIIIII:VI:::mov
*v850e
+*v850e1
"mov <imm32>, r<reg1>"
{
SAVE_2;
@@ -577,6 +595,7 @@ rrrrr!0,110010,RRRRR + iiiiiiiiiiiiiiii:VI:::movhi
// MUL
rrrrr,111111,RRRRR + wwwww,01000100000:XI:::mul
*v850e
+*v850e1
"mul r<reg1>, r<reg2>, r<reg3>"
{
COMPAT_2 (OP_22007E0 ());
@@ -584,6 +603,7 @@ rrrrr,111111,RRRRR + wwwww,01000100000:XI:::mul
rrrrr,111111,iiiii + wwwww,01001,IIII,00:XII:::mul
*v850e
+*v850e1
"mul <imm9>, r<reg2>, r<reg3>"
{
COMPAT_2 (OP_24007E0 ());
@@ -617,6 +637,7 @@ rrrrr!0,110111,RRRRR + iiiiiiiiiiiiiiii:VI:::mulhi
// MULU
rrrrr,111111,RRRRR + wwwww,01000100010:XI:::mulu
*v850e
+*v850e1
"mulu r<reg1>, r<reg2>, r<reg3>"
{
COMPAT_2 (OP_22207E0 ());
@@ -624,6 +645,7 @@ rrrrr,111111,RRRRR + wwwww,01000100010:XI:::mulu
rrrrr,111111,iiiii + wwwww,01001,IIII,10:XII:::mulu
*v850e
+*v850e1
"mulu <imm9>, r<reg2>, r<reg3>"
{
COMPAT_2 (OP_24207E0 ());
@@ -658,6 +680,7 @@ rrrrr,000001,RRRRR:I:::not
rrrrr,111111,RRRRR + 0000000011100010:IX:::not1
*v850e
+*v850e1
"not1 r<reg2>, r<reg1>"
{
COMPAT_2 (OP_E207E0 ());
@@ -686,6 +709,7 @@ rrrrr,110100,RRRRR + iiiiiiiiiiiiiiii:VI:::ori
// PREPARE
0000011110,iiiii,L + LLLLLLLLLLL,00001:XIII:::prepare
*v850e
+*v850e1
"prepare <list12>, <imm5>"
{
int i;
@@ -710,6 +734,7 @@ rrrrr,110100,RRRRR + iiiiiiiiiiiiiiii:VI:::ori
0000011110,iiiii,L + LLLLLLLLLLL,00011:XIII:::prepare00
*v850e
+*v850e1
"prepare <list12>, <imm5>, sp"
{
COMPAT_2 (OP_30780 ());
@@ -717,6 +742,7 @@ rrrrr,110100,RRRRR + iiiiiiiiiiiiiiii:VI:::ori
0000011110,iiiii,L + LLLLLLLLLLL,01011 + iiiiiiiiiiiiiiii:XIII:::prepare01
*v850e
+*v850e1
"prepare <list12>, <imm5>, <uimm16>"
{
COMPAT_2 (OP_B0780 ());
@@ -724,6 +750,7 @@ rrrrr,110100,RRRRR + iiiiiiiiiiiiiiii:VI:::ori
0000011110,iiiii,L + LLLLLLLLLLL,10011 + iiiiiiiiiiiiiiii:XIII:::prepare10
*v850e
+*v850e1
"prepare <list12>, <imm5>, <uimm16>"
{
COMPAT_2 (OP_130780 ());
@@ -731,6 +758,7 @@ rrrrr,110100,RRRRR + iiiiiiiiiiiiiiii:VI:::ori
0000011110,iiiii,L + LLLLLLLLLLL,11011 + iiiiiiiiiiiiiiii + dddddddddddddddd:XIII:::prepare11
*v850e
+*v850e1
"prepare <list12>, <imm5>, <uimm32>"
{
COMPAT_2 (OP_1B0780 ());
@@ -780,6 +808,7 @@ rrrrr,010101,iiiii:II:::sar
// SASF
rrrrr,1111110,cccc + 0000001000000000:IX:::sasf
*v850e
+*v850e1
"sasf %s<cccc>, r<reg2>"
{
COMPAT_2 (OP_20007E0 ());
@@ -848,6 +877,7 @@ rrrrr,1111110,cccc + 0000000000000000:IX:::setf
rrrrr,111111,RRRRR + 0000000011100000:IX:::set1
*v850e
+*v850e1
"set1 r<reg2>, [r<reg1>]"
{
COMPAT_2 (OP_E007E0 ());
@@ -935,6 +965,7 @@ rrrrr,1010,dddddd,0:IV:::sld.w
rrrrr!0,0000110,dddd:IV:::sld.bu
*v850e
+*v850e1
"sld.b <disp4>[ep], r<reg2>":(PSW & PSW_US)
"sld.bu <disp4>[ep], r<reg2>"
{
@@ -955,6 +986,7 @@ rrrrr!0,0000110,dddd:IV:::sld.bu
rrrrr!0,0000111,dddd:IV:::sld.hu
*v850e
+*v850e1
"sld.h <disp5>[ep], r<reg2>":(PSW & PSW_US)
"sld.hu <disp5>[ep], r<reg2>"
{
@@ -1037,6 +1069,7 @@ rrrrr,001100,RRRRR:I:::subr
// SWITCH
00000000010,RRRRR:I:::switch
*v850e
+*v850e1
"switch r<reg1>"
{
unsigned long adr;
@@ -1050,6 +1083,7 @@ rrrrr,001100,RRRRR:I:::subr
// SXB
00000000101,RRRRR:I:::sxb
*v850e
+*v850e1
"sxb r<reg1>"
{
TRACE_ALU_INPUT1 (GR[reg1]);
@@ -1060,6 +1094,7 @@ rrrrr,001100,RRRRR:I:::subr
// SXH
00000000111,RRRRR:I:::sxh
*v850e
+*v850e1
"sxh r<reg1>"
{
TRACE_ALU_INPUT1 (GR[reg1]);
@@ -1090,6 +1125,7 @@ rrrrr,001011,RRRRR:I:::tst
rrrrr,111111,RRRRR + 0000000011100110:IX:::tst1
*v850e
+*v850e1
"tst1 r<reg2>, [r<reg1>]"
{
COMPAT_2 (OP_E607E0 ());
@@ -1112,6 +1148,7 @@ rrrrr,110101,RRRRR + iiiiiiiiiiiiiiii:VI:::xori
// ZXB
00000000100,RRRRR:I:::zxb
*v850e
+*v850e1
"zxb r<reg1>"
{
TRACE_ALU_INPUT1 (GR[reg1]);
@@ -1122,6 +1159,7 @@ rrrrr,110101,RRRRR + iiiiiiiiiiiiiiii:VI:::xori
// ZXH
00000000110,RRRRR:I:::zxh
*v850e
+*v850e1
"zxh r<reg1>"
{
TRACE_ALU_INPUT1 (GR[reg1]);
@@ -1132,12 +1170,36 @@ rrrrr,110101,RRRRR + iiiiiiiiiiiiiiii:VI:::xori
// Right field must be zero so that it doesn't clash with DIVH
// Left field must be non-zero so that it doesn't clash with SWITCH
11111,000010,00000:I:::break
+*v850
+*v850e
{
sim_engine_halt (SD, CPU, NULL, cia, sim_stopped, SIM_SIGTRAP);
}
+11111,000010,00000:I:::dbtrap
+*v850e1
+"dbtrap"
+{
+ DBPC = cia + 2;
+ DBPSW = PSW;
+ PSW = PSW | (PSW_NP | PSW_EP | PSW_ID);
+ PC = 0x00000060;
+ nia = 0x00000060;
+ TRACE_BRANCH0 ();
+}
+
// New breakpoint: 0x7E0 0x7E0
00000,111111,00000 + 00000,11111,100000:X:::ilgop
{
sim_engine_halt (SD, CPU, NULL, cia, sim_stopped, SIM_SIGTRAP);
}
+
+// Return from debug trap: 0x146007e0
+0000011111100000 + 0000000101000110:X:::dbret
+*v850e1
+"dbret"
+{
+ nia = DBPC;
+ PSW = DBPSW;
+ TRACE_BRANCH1 (PSW);
+}
diff --git a/symlink-tree b/symlink-tree
index 5b18cab9238..22132c76afd 100755
--- a/symlink-tree
+++ b/symlink-tree
@@ -1,6 +1,31 @@
#!/bin/sh
# Create a symlink tree.
#
+# Copyright (C) 1995, 2000, 2003 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+#
+# Please report bugs to <gcc-bugs@gnu.org>
+# and send patches to <gcc-patches@gnu.org>.
+
# Syntax: symlink-tree srcdir "ignore1 ignore2 ..."
#
# where srcdir is the directory to create a symlink tree to,