aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobody <>2008-11-20 00:35:24 +0000
committernobody <>2008-11-20 00:35:24 +0000
commitb4812cfe4dc394392e47e0489f38521da4a0b7ce (patch)
tree172f8d09ca7fb6f4007896cdd0f4a7d7ba98fd4d
parent438f751013d510ce01e77855d560ce8dacc32276 (diff)
downloadfsf-binutils-gdb-b4812cfe4dc394392e47e0489f38521da4a0b7ce.zip
fsf-binutils-gdb-b4812cfe4dc394392e47e0489f38521da4a0b7ce.tar.gz
fsf-binutils-gdb-b4812cfe4dc394392e47e0489f38521da4a0b7ce.tar.bz2
This commit was manufactured by cvs2svn to create branchmultiprocess-20081120-branchpoint
'multiprocess-20081120-branch'. Sprout from reverse-20080930-branch 2008-09-30 21:53:33 UTC nobody 'This commit was manufactured by cvs2svn to create branch' Cherrypick from master 2008-11-20 00:35:23 UTC Doug Evans <dje@google.com> ' * inferior.h (proceed_to_finish): Delete, unused.': ChangeLog Makefile.def Makefile.in Makefile.tpl bfd/ChangeLog bfd/bfd-in2.h bfd/bfd.c bfd/bfdio.c bfd/cache.c bfd/cofflink.c bfd/config.bfd bfd/config.in bfd/configure bfd/configure.com bfd/configure.in bfd/doc/ChangeLog bfd/doc/bfd.texinfo bfd/doc/fdl.texi bfd/dwarf2.c bfd/elf-bfd.h bfd/elf.c bfd/elf32-arm.c bfd/elf32-avr.c bfd/elf32-cr16.c bfd/elf32-cris.c bfd/elf32-ppc.c bfd/elf32-sh-symbian.c bfd/elf32-spu.c bfd/elf64-ppc.c bfd/elflink.c bfd/elfxx-sparc.c bfd/hosts/alphavms.h bfd/libbfd.h bfd/linker.c bfd/mach-o-target.c bfd/mach-o.c bfd/mach-o.h bfd/makefile.vms bfd/po/id.po bfd/reloc.c bfd/version.h bfd/vms-hdr.c bfd/xtensa-modules.c configure configure.ac gdb/CONTRIBUTE gdb/ChangeLog gdb/MAINTAINERS gdb/Makefile.in gdb/NEWS gdb/ada-exp.y gdb/ada-lang.c gdb/ada-lang.h gdb/ada-tasks.c gdb/ada-valprint.c gdb/aix-thread.c gdb/amd64-tdep.c gdb/arm-tdep.c gdb/auxv.c gdb/breakpoint.c gdb/breakpoint.h gdb/bsd-uthread.c gdb/c-exp.y gdb/c-lang.c gdb/c-lang.h gdb/c-typeprint.c gdb/c-valprint.c gdb/cli/cli-cmds.c gdb/cli/cli-dump.c gdb/cli/cli-logging.c gdb/cli/cli-script.c gdb/coffread.c gdb/config/alpha/alpha-osf3.mh gdb/configure gdb/configure.ac gdb/configure.tgt gdb/corefile.c gdb/corelow.c gdb/cp-name-parser.y gdb/cp-valprint.c gdb/dbxread.c gdb/dec-thread.c gdb/defs.h gdb/doc/ChangeLog gdb/doc/gdb.texinfo gdb/doc/gdbint.texinfo gdb/doc/observer.texi gdb/dummy-frame.c gdb/dwarf2read.c gdb/elfread.c gdb/eval.c gdb/event-loop.c gdb/event-loop.h gdb/exec.c gdb/expprint.c gdb/f-lang.c gdb/f-lang.h gdb/f-typeprint.c gdb/f-valprint.c gdb/fbsd-nat.c gdb/features/Makefile gdb/features/rs6000/power-fpu-isa205.xml gdb/features/rs6000/powerpc-isa205-32l.c gdb/features/rs6000/powerpc-isa205-32l.xml gdb/features/rs6000/powerpc-isa205-64l.c gdb/features/rs6000/powerpc-isa205-64l.xml gdb/features/rs6000/powerpc-isa205-altivec32l.c gdb/features/rs6000/powerpc-isa205-altivec32l.xml gdb/features/rs6000/powerpc-isa205-altivec64l.c gdb/features/rs6000/powerpc-isa205-altivec64l.xml gdb/features/rs6000/powerpc-isa205-vsx32l.c gdb/features/rs6000/powerpc-isa205-vsx32l.xml gdb/features/rs6000/powerpc-isa205-vsx64l.c gdb/features/rs6000/powerpc-isa205-vsx64l.xml gdb/fork-child.c gdb/frv-tdep.c gdb/gdbarch.c gdb/gdbarch.h gdb/gdbarch.sh gdb/gdbinit.in gdb/gdbserver/ChangeLog gdb/gdbserver/Makefile.in gdb/gdbserver/configure.srv gdb/gdbserver/linux-low.c gdb/gdbserver/linux-ppc-low.c gdb/gdbserver/linux-sparc-low.c gdb/gdbserver/server.c gdb/gdbserver/xtensa-xtregs.c gdb/gdbthread.h gdb/gdbtypes.c gdb/gdbtypes.h gdb/gnu-nat.c gdb/gnu-nat.h gdb/go32-nat.c gdb/hpux-thread.c gdb/i386-dicos-tdep.c gdb/i386gnu-nat.c gdb/ia64-tdep.c gdb/inf-loop.c gdb/inf-ptrace.c gdb/inf-ttrace.c gdb/infcall.c gdb/infcmd.c gdb/inferior.c gdb/inferior.h gdb/inflow.c gdb/infrun.c gdb/interps.c gdb/jv-lang.h gdb/jv-typeprint.c gdb/jv-valprint.c gdb/language.c gdb/language.h gdb/linux-nat.c gdb/linux-thread-db.c gdb/m2-exp.y gdb/m2-lang.c gdb/m2-lang.h gdb/m2-typeprint.c gdb/m2-valprint.c gdb/m68hc11-tdep.c gdb/maint.c gdb/mdebugread.c gdb/mi/mi-cmd-stack.c gdb/mi/mi-cmds.c gdb/mi/mi-cmds.h gdb/mi/mi-common.h gdb/mi/mi-interp.c gdb/mi/mi-main.c gdb/minsyms.c gdb/mips-linux-tdep.c gdb/mips-tdep.c gdb/monitor.c gdb/mt-tdep.c gdb/nto-procfs.c gdb/objc-lang.c gdb/objfiles.h gdb/p-exp.y gdb/p-lang.c gdb/p-lang.h gdb/p-typeprint.c gdb/p-valprint.c gdb/parse.c gdb/ppc-linux-nat.c gdb/ppc-linux-tdep.c gdb/ppc-linux-tdep.h gdb/printcmd.c gdb/procfs.c gdb/python/python-internal.h gdb/python/python-value.c gdb/python/python.c gdb/python/python.h gdb/regcache.c gdb/regformats/reg-sparc64.dat gdb/regformats/reg-xtensa.dat gdb/regformats/rs6000/powerpc-isa205-32l.dat gdb/regformats/rs6000/powerpc-isa205-64l.dat gdb/regformats/rs6000/powerpc-isa205-altivec32l.dat gdb/regformats/rs6000/powerpc-isa205-altivec64l.dat gdb/regformats/rs6000/powerpc-isa205-vsx32l.dat gdb/regformats/rs6000/powerpc-isa205-vsx64l.dat gdb/reggroups.c gdb/remote-m32r-sdi.c gdb/remote-mips.c gdb/remote-sim.c gdb/remote.c gdb/reply_mig_hack.awk gdb/reverse.c gdb/rs6000-nat.c gdb/scm-lang.c gdb/scm-lang.h gdb/scm-valprint.c gdb/ser-mingw.c gdb/sh64-tdep.c gdb/sol-thread.c gdb/solib-frv.c gdb/solib-osf.c gdb/solib-som.c gdb/solib.c gdb/source.c gdb/stack.c gdb/symfile.c gdb/symmisc.c gdb/symtab.c gdb/symtab.h gdb/target.c gdb/target.h gdb/testsuite/ChangeLog gdb/testsuite/Makefile.in gdb/testsuite/configure gdb/testsuite/configure.ac gdb/testsuite/gdb.ada/int_deref.exp gdb/testsuite/gdb.ada/int_deref/foo.adb gdb/testsuite/gdb.ada/int_deref/pck.ads gdb/testsuite/gdb.ada/ref_tick_size.exp gdb/testsuite/gdb.ada/ref_tick_size/p.adb gdb/testsuite/gdb.ada/ref_tick_size/pck.adb gdb/testsuite/gdb.ada/ref_tick_size/pck.ads gdb/testsuite/gdb.arch/ppc-dfp.c gdb/testsuite/gdb.arch/ppc-dfp.exp gdb/testsuite/gdb.base/args.exp gdb/testsuite/gdb.base/callexit.c gdb/testsuite/gdb.base/callexit.exp gdb/testsuite/gdb.base/completion.exp gdb/testsuite/gdb.base/corefile.exp gdb/testsuite/gdb.base/dbx.exp gdb/testsuite/gdb.base/exprs.exp gdb/testsuite/gdb.base/foll-exec.exp gdb/testsuite/gdb.base/foll-fork.exp gdb/testsuite/gdb.base/hashline2.exp gdb/testsuite/gdb.base/hashline3.exp gdb/testsuite/gdb.base/help.exp gdb/testsuite/gdb.base/macscp.exp gdb/testsuite/gdb.base/maint.exp gdb/testsuite/gdb.base/pointers.c gdb/testsuite/gdb.base/pointers.exp gdb/testsuite/gdb.base/remotetimeout.exp gdb/testsuite/gdb.base/sepsymtab.exp gdb/testsuite/gdb.cp/gdb2384-base.cc gdb/testsuite/gdb.cp/gdb2384-base.h gdb/testsuite/gdb.cp/gdb2384.cc gdb/testsuite/gdb.cp/gdb2384.exp gdb/testsuite/gdb.cp/mb-ctor.exp gdb/testsuite/gdb.dwarf2/dw2-cu-size.S gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp gdb/testsuite/gdb.dwarf2/dw2-intercu.S gdb/testsuite/gdb.mi/gdb2549.exp gdb/testsuite/gdb.mi/mi-nonstop.exp gdb/testsuite/gdb.mi/mi-nsmoribund.exp gdb/testsuite/gdb.mi/mi-pthreads.exp gdb/testsuite/gdb.mi/mi-syn-frame.exp gdb/testsuite/gdb.mi/mi2-syn-frame.exp gdb/testsuite/gdb.mi/nsmoribund.c gdb/testsuite/gdb.python/Makefile.in gdb/testsuite/gdb.python/python-value.c gdb/testsuite/gdb.python/python-value.exp gdb/testsuite/lib/gdb.exp gdb/testsuite/lib/mi-support.exp gdb/thread.c gdb/tracepoint.c gdb/tui/tui-regs.c gdb/typeprint.c gdb/utils.c gdb/valops.c gdb/valprint.c gdb/valprint.h gdb/value.c gdb/value.h gdb/varobj.c gdb/version.in gdb/win32-nat.c gdb/xcoffread.c gdb/xml-tdesc.c gdb/xtensa-config.c gdb/xtensa-xtregs.c include/ChangeLog include/demangle.h include/elf/ChangeLog include/elf/arm.h include/elf/common.h include/elf/cris.h include/elf/internal.h include/elf/ppc.h include/fopen-vms.h include/obstack.h include/opcode/ChangeLog include/opcode/arm.h include/opcode/mips.h include/xtensa-config.h libdecnumber/ChangeLog libdecnumber/decBasic.c libdecnumber/decDouble.h libdecnumber/decNumberLocal.h libdecnumber/decQuad.h libdecnumber/decSingle.h libiberty/ChangeLog libiberty/Makefile.in libiberty/config.h-vms libiberty/config.in libiberty/configure libiberty/configure.ac libiberty/cp-demangle.c libiberty/cp-demangle.h libiberty/makefile.vms libiberty/testsuite/demangle-expected libiberty/xstrdup.c opcodes/ChangeLog opcodes/arm-dis.c opcodes/avr-dis.c opcodes/configure opcodes/configure.in opcodes/i386-opc.tbl opcodes/i386-tbl.h opcodes/makefile.vms opcodes/mips-dis.c opcodes/mips-opc.c sim/common/ChangeLog sim/common/Make-common.in sim/common/aclocal.m4 sim/erc32/ChangeLog sim/erc32/erc32.c sim/erc32/exec.c sim/m32c/ChangeLog sim/m32c/int.c sim/ppc/ChangeLog sim/ppc/Makefile.in sim/ppc/configure sim/ppc/configure.ac sim/ppc/debug.c sim/ppc/debug.h sim/ppc/hw_sem.c sim/ppc/hw_shm.c Delete: gdb/cli/cli-utils.c gdb/cli/cli-utils.h
-rw-r--r--ChangeLog58
-rw-r--r--bfd/ChangeLog318
-rw-r--r--bfd/bfd-in2.h13
-rw-r--r--bfd/bfd.c3
-rw-r--r--bfd/bfdio.c51
-rw-r--r--bfd/cache.c8
-rw-r--r--bfd/cofflink.c10
-rw-r--r--bfd/config.bfd2
-rw-r--r--bfd/config.in3
-rwxr-xr-xbfd/configure48
-rw-r--r--bfd/configure.com93
-rw-r--r--bfd/configure.in19
-rw-r--r--bfd/doc/ChangeLog5
-rw-r--r--bfd/doc/bfd.texinfo10
-rw-r--r--bfd/doc/fdl.texi442
-rw-r--r--bfd/dwarf2.c108
-rw-r--r--bfd/elf-bfd.h2
-rw-r--r--bfd/elf.c267
-rw-r--r--bfd/elf32-arm.c95
-rw-r--r--bfd/elf32-avr.c3
-rw-r--r--bfd/elf32-cr16.c58
-rw-r--r--bfd/elf32-cris.c39
-rw-r--r--bfd/elf32-ppc.c27
-rw-r--r--bfd/elf32-sh-symbian.c13
-rw-r--r--bfd/elf32-spu.c23
-rw-r--r--bfd/elf64-ppc.c34
-rw-r--r--bfd/elflink.c87
-rw-r--r--bfd/elfxx-sparc.c6
-rw-r--r--bfd/hosts/alphavms.h10
-rw-r--r--bfd/libbfd.h11
-rw-r--r--bfd/linker.c42
-rw-r--r--bfd/mach-o-target.c10
-rw-r--r--bfd/mach-o.c444
-rw-r--r--bfd/mach-o.h94
-rw-r--r--bfd/makefile.vms19
-rw-r--r--bfd/po/id.po3837
-rw-r--r--bfd/reloc.c25
-rw-r--r--bfd/version.h2
-rw-r--r--bfd/vms-hdr.c4
-rw-r--r--bfd/xtensa-modules.c4636
-rwxr-xr-xconfigure1
-rw-r--r--configure.ac1
-rw-r--r--gdb/CONTRIBUTE6
-rw-r--r--gdb/ChangeLog1557
-rw-r--r--gdb/MAINTAINERS2
-rw-r--r--gdb/Makefile.in56
-rw-r--r--gdb/NEWS25
-rw-r--r--gdb/ada-exp.y2
-rw-r--r--gdb/ada-lang.c102
-rw-r--r--gdb/ada-lang.h80
-rw-r--r--gdb/ada-tasks.c991
-rw-r--r--gdb/ada-valprint.c218
-rw-r--r--gdb/aix-thread.c12
-rw-r--r--gdb/amd64-tdep.c2
-rw-r--r--gdb/arm-tdep.c5
-rw-r--r--gdb/auxv.c17
-rw-r--r--gdb/breakpoint.c933
-rw-r--r--gdb/breakpoint.h59
-rw-r--r--gdb/bsd-uthread.c5
-rw-r--r--gdb/c-exp.y35
-rw-r--r--gdb/c-lang.c15
-rw-r--r--gdb/c-lang.h17
-rw-r--r--gdb/c-typeprint.c10
-rw-r--r--gdb/c-valprint.c167
-rw-r--r--gdb/cli/cli-cmds.c6
-rw-r--r--gdb/cli/cli-dump.c13
-rw-r--r--gdb/cli/cli-logging.c6
-rw-r--r--gdb/cli/cli-script.c8
-rw-r--r--gdb/coffread.c13
-rw-r--r--gdb/config/alpha/alpha-osf3.mh3
-rwxr-xr-xgdb/configure171
-rw-r--r--gdb/configure.ac101
-rw-r--r--gdb/configure.tgt3
-rw-r--r--gdb/corefile.c2
-rw-r--r--gdb/corelow.c6
-rw-r--r--gdb/cp-name-parser.y18
-rw-r--r--gdb/cp-valprint.c88
-rw-r--r--gdb/dbxread.c2
-rw-r--r--gdb/dec-thread.c683
-rw-r--r--gdb/defs.h17
-rw-r--r--gdb/doc/ChangeLog77
-rw-r--r--gdb/doc/gdb.texinfo747
-rw-r--r--gdb/doc/gdbint.texinfo13
-rw-r--r--gdb/doc/observer.texi18
-rw-r--r--gdb/dummy-frame.c4
-rw-r--r--gdb/dwarf2read.c414
-rw-r--r--gdb/elfread.c2
-rw-r--r--gdb/eval.c25
-rw-r--r--gdb/event-loop.c382
-rw-r--r--gdb/event-loop.h54
-rw-r--r--gdb/exec.c12
-rw-r--r--gdb/expprint.c67
-rw-r--r--gdb/f-lang.c19
-rw-r--r--gdb/f-lang.h11
-rw-r--r--gdb/f-typeprint.c39
-rw-r--r--gdb/f-valprint.c254
-rw-r--r--gdb/fbsd-nat.c5
-rw-r--r--gdb/features/Makefile6
-rw-r--r--gdb/features/rs6000/power-fpu-isa205.xml44
-rw-r--r--gdb/features/rs6000/powerpc-isa205-32l.c97
-rw-r--r--gdb/features/rs6000/powerpc-isa205-32l.xml17
-rw-r--r--gdb/features/rs6000/powerpc-isa205-64l.c97
-rw-r--r--gdb/features/rs6000/powerpc-isa205-64l.xml17
-rw-r--r--gdb/features/rs6000/powerpc-isa205-altivec32l.c168
-rw-r--r--gdb/features/rs6000/powerpc-isa205-altivec32l.xml19
-rw-r--r--gdb/features/rs6000/powerpc-isa205-altivec64l.c168
-rw-r--r--gdb/features/rs6000/powerpc-isa205-altivec64l.xml19
-rw-r--r--gdb/features/rs6000/powerpc-isa205-vsx32l.c202
-rw-r--r--gdb/features/rs6000/powerpc-isa205-vsx32l.xml20
-rw-r--r--gdb/features/rs6000/powerpc-isa205-vsx64l.c202
-rw-r--r--gdb/features/rs6000/powerpc-isa205-vsx64l.xml20
-rw-r--r--gdb/fork-child.c33
-rw-r--r--gdb/frv-tdep.c80
-rw-r--r--gdb/gdbarch.c23
-rw-r--r--gdb/gdbarch.h9
-rwxr-xr-xgdb/gdbarch.sh7
-rw-r--r--gdb/gdbinit.in17
-rw-r--r--gdb/gdbserver/ChangeLog42
-rw-r--r--gdb/gdbserver/Makefile.in47
-rw-r--r--gdb/gdbserver/configure.srv18
-rw-r--r--gdb/gdbserver/linux-low.c14
-rw-r--r--gdb/gdbserver/linux-ppc-low.c49
-rw-r--r--gdb/gdbserver/linux-sparc-low.c287
-rw-r--r--gdb/gdbserver/server.c24
-rw-r--r--gdb/gdbserver/xtensa-xtregs.c3
-rw-r--r--gdb/gdbthread.h13
-rw-r--r--gdb/gdbtypes.c105
-rw-r--r--gdb/gdbtypes.h94
-rw-r--r--gdb/gnu-nat.c65
-rw-r--r--gdb/gnu-nat.h2
-rw-r--r--gdb/go32-nat.c11
-rw-r--r--gdb/hpux-thread.c17
-rw-r--r--gdb/i386-dicos-tdep.c8
-rw-r--r--gdb/i386gnu-nat.c8
-rw-r--r--gdb/ia64-tdep.c3
-rw-r--r--gdb/inf-loop.c11
-rw-r--r--gdb/inf-ptrace.c44
-rw-r--r--gdb/inf-ttrace.c10
-rw-r--r--gdb/infcall.c18
-rw-r--r--gdb/infcmd.c336
-rw-r--r--gdb/inferior.c6
-rw-r--r--gdb/inferior.h43
-rw-r--r--gdb/inflow.c19
-rw-r--r--gdb/infrun.c804
-rw-r--r--gdb/interps.c19
-rw-r--r--gdb/jv-lang.h8
-rw-r--r--gdb/jv-typeprint.c2
-rw-r--r--gdb/jv-valprint.c110
-rw-r--r--gdb/language.c18
-rw-r--r--gdb/language.h35
-rw-r--r--gdb/linux-nat.c172
-rw-r--r--gdb/linux-thread-db.c40
-rw-r--r--gdb/m2-exp.y2
-rw-r--r--gdb/m2-lang.c15
-rw-r--r--gdb/m2-lang.h4
-rw-r--r--gdb/m2-typeprint.c2
-rw-r--r--gdb/m2-valprint.c174
-rw-r--r--gdb/m68hc11-tdep.c10
-rw-r--r--gdb/maint.c36
-rw-r--r--gdb/mdebugread.c21
-rw-r--r--gdb/mi/mi-cmd-stack.c23
-rw-r--r--gdb/mi/mi-cmds.c3
-rw-r--r--gdb/mi/mi-cmds.h2
-rw-r--r--gdb/mi/mi-common.h15
-rw-r--r--gdb/mi/mi-interp.c49
-rw-r--r--gdb/mi/mi-main.c207
-rw-r--r--gdb/minsyms.c13
-rw-r--r--gdb/mips-linux-tdep.c12
-rw-r--r--gdb/mips-tdep.c120
-rw-r--r--gdb/monitor.c11
-rw-r--r--gdb/mt-tdep.c6
-rw-r--r--gdb/nto-procfs.c56
-rw-r--r--gdb/objc-lang.c18
-rw-r--r--gdb/objfiles.h21
-rw-r--r--gdb/p-exp.y2
-rw-r--r--gdb/p-lang.c15
-rw-r--r--gdb/p-lang.h19
-rw-r--r--gdb/p-typeprint.c10
-rw-r--r--gdb/p-valprint.c213
-rw-r--r--gdb/parse.c5
-rw-r--r--gdb/ppc-linux-nat.c31
-rw-r--r--gdb/ppc-linux-tdep.c12
-rw-r--r--gdb/ppc-linux-tdep.h6
-rw-r--r--gdb/printcmd.c160
-rw-r--r--gdb/procfs.c114
-rw-r--r--gdb/python/python-internal.h13
-rw-r--r--gdb/python/python-value.c680
-rw-r--r--gdb/python/python.c4
-rw-r--r--gdb/python/python.h2
-rw-r--r--gdb/regcache.c4
-rw-r--r--gdb/regformats/reg-sparc64.dat91
-rw-r--r--gdb/regformats/reg-xtensa.dat34
-rw-r--r--gdb/regformats/rs6000/powerpc-isa205-32l.dat77
-rw-r--r--gdb/regformats/rs6000/powerpc-isa205-64l.dat77
-rw-r--r--gdb/regformats/rs6000/powerpc-isa205-altivec32l.dat111
-rw-r--r--gdb/regformats/rs6000/powerpc-isa205-altivec64l.dat111
-rw-r--r--gdb/regformats/rs6000/powerpc-isa205-vsx32l.dat143
-rw-r--r--gdb/regformats/rs6000/powerpc-isa205-vsx64l.dat143
-rw-r--r--gdb/reggroups.c4
-rw-r--r--gdb/remote-m32r-sdi.c7
-rw-r--r--gdb/remote-mips.c7
-rw-r--r--gdb/remote-sim.c26
-rw-r--r--gdb/remote.c2013
-rw-r--r--gdb/reply_mig_hack.awk2
-rw-r--r--gdb/reverse.c144
-rw-r--r--gdb/rs6000-nat.c9
-rw-r--r--gdb/scm-lang.c3
-rw-r--r--gdb/scm-lang.h10
-rw-r--r--gdb/scm-valprint.c71
-rw-r--r--gdb/ser-mingw.c13
-rw-r--r--gdb/sh64-tdep.c16
-rw-r--r--gdb/sol-thread.c22
-rw-r--r--gdb/solib-frv.c10
-rw-r--r--gdb/solib-osf.c1
-rw-r--r--gdb/solib-som.c4
-rw-r--r--gdb/solib.c2
-rw-r--r--gdb/source.c55
-rw-r--r--gdb/stack.c21
-rw-r--r--gdb/symfile.c23
-rw-r--r--gdb/symmisc.c205
-rw-r--r--gdb/symtab.c27
-rw-r--r--gdb/symtab.h33
-rw-r--r--gdb/target.c176
-rw-r--r--gdb/target.h61
-rw-r--r--gdb/testsuite/ChangeLog162
-rw-r--r--gdb/testsuite/Makefile.in2
-rwxr-xr-xgdb/testsuite/configure41
-rw-r--r--gdb/testsuite/configure.ac1
-rw-r--r--gdb/testsuite/gdb.ada/int_deref.exp45
-rw-r--r--gdb/testsuite/gdb.ada/int_deref/foo.adb21
-rw-r--r--gdb/testsuite/gdb.ada/int_deref/pck.ads20
-rw-r--r--gdb/testsuite/gdb.ada/ref_tick_size.exp48
-rw-r--r--gdb/testsuite/gdb.ada/ref_tick_size/p.adb29
-rw-r--r--gdb/testsuite/gdb.ada/ref_tick_size/pck.adb25
-rw-r--r--gdb/testsuite/gdb.ada/ref_tick_size/pck.ads22
-rw-r--r--gdb/testsuite/gdb.arch/ppc-dfp.c46
-rw-r--r--gdb/testsuite/gdb.arch/ppc-dfp.exp79
-rw-r--r--gdb/testsuite/gdb.base/args.exp19
-rw-r--r--gdb/testsuite/gdb.base/callexit.c (renamed from gdb/cli/cli-utils.c)22
-rw-r--r--gdb/testsuite/gdb.base/callexit.exp58
-rw-r--r--gdb/testsuite/gdb.base/completion.exp6
-rw-r--r--gdb/testsuite/gdb.base/corefile.exp13
-rw-r--r--gdb/testsuite/gdb.base/dbx.exp6
-rw-r--r--gdb/testsuite/gdb.base/exprs.exp11
-rw-r--r--gdb/testsuite/gdb.base/foll-exec.exp24
-rw-r--r--gdb/testsuite/gdb.base/foll-fork.exp24
-rw-r--r--gdb/testsuite/gdb.base/hashline2.exp2
-rw-r--r--gdb/testsuite/gdb.base/hashline3.exp2
-rw-r--r--gdb/testsuite/gdb.base/help.exp2
-rw-r--r--gdb/testsuite/gdb.base/macscp.exp20
-rw-r--r--gdb/testsuite/gdb.base/maint.exp2
-rw-r--r--gdb/testsuite/gdb.base/pointers.c9
-rw-r--r--gdb/testsuite/gdb.base/pointers.exp4
-rw-r--r--gdb/testsuite/gdb.base/remotetimeout.exp2
-rw-r--r--gdb/testsuite/gdb.base/sepsymtab.exp2
-rw-r--r--gdb/testsuite/gdb.cp/gdb2384-base.cc5
-rw-r--r--gdb/testsuite/gdb.cp/gdb2384-base.h6
-rw-r--r--gdb/testsuite/gdb.cp/gdb2384.cc23
-rw-r--r--gdb/testsuite/gdb.cp/gdb2384.exp65
-rw-r--r--gdb/testsuite/gdb.cp/mb-ctor.exp2
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-cu-size.S106
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp53
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-intercu.S4
-rw-r--r--gdb/testsuite/gdb.mi/gdb2549.exp85
-rw-r--r--gdb/testsuite/gdb.mi/mi-nonstop.exp2
-rw-r--r--gdb/testsuite/gdb.mi/mi-nsmoribund.exp177
-rw-r--r--gdb/testsuite/gdb.mi/mi-pthreads.exp6
-rw-r--r--gdb/testsuite/gdb.mi/mi-syn-frame.exp2
-rw-r--r--gdb/testsuite/gdb.mi/mi2-syn-frame.exp2
-rw-r--r--gdb/testsuite/gdb.mi/nsmoribund.c72
-rw-r--r--gdb/testsuite/gdb.python/Makefile.in14
-rw-r--r--gdb/testsuite/gdb.python/python-value.c (renamed from gdb/cli/cli-utils.h)31
-rw-r--r--gdb/testsuite/gdb.python/python-value.exp253
-rw-r--r--gdb/testsuite/lib/gdb.exp28
-rw-r--r--gdb/testsuite/lib/mi-support.exp25
-rw-r--r--gdb/thread.c64
-rw-r--r--gdb/tracepoint.c22
-rw-r--r--gdb/tui/tui-regs.c5
-rw-r--r--gdb/typeprint.c9
-rw-r--r--gdb/utils.c100
-rw-r--r--gdb/valops.c7
-rw-r--r--gdb/valprint.c197
-rw-r--r--gdb/valprint.h103
-rw-r--r--gdb/value.c65
-rw-r--r--gdb/value.h28
-rw-r--r--gdb/varobj.c11
-rw-r--r--gdb/version.in2
-rw-r--r--gdb/win32-nat.c16
-rw-r--r--gdb/xcoffread.c8
-rw-r--r--gdb/xml-tdesc.c10
-rw-r--r--gdb/xtensa-config.c242
-rw-r--r--gdb/xtensa-xtregs.c3
-rw-r--r--include/ChangeLog31
-rw-r--r--include/demangle.h4
-rw-r--r--include/elf/ChangeLog23
-rw-r--r--include/elf/arm.h6
-rw-r--r--include/elf/common.h3
-rw-r--r--include/elf/cris.h76
-rw-r--r--include/elf/internal.h2
-rw-r--r--include/elf/ppc.h5
-rw-r--r--include/fopen-vms.h12
-rw-r--r--include/obstack.h4
-rw-r--r--include/opcode/ChangeLog9
-rw-r--r--include/opcode/arm.h3
-rw-r--r--include/opcode/mips.h3
-rw-r--r--include/xtensa-config.h36
-rw-r--r--libdecnumber/ChangeLog12
-rw-r--r--libdecnumber/decBasic.c12
-rw-r--r--libdecnumber/decDouble.h6
-rw-r--r--libdecnumber/decNumberLocal.h12
-rw-r--r--libdecnumber/decQuad.h6
-rw-r--r--libdecnumber/decSingle.h6
-rw-r--r--libiberty/ChangeLog43
-rw-r--r--libiberty/Makefile.in10
-rwxr-xr-xlibiberty/configure1
-rw-r--r--libiberty/cp-demangle.c298
-rw-r--r--libiberty/cp-demangle.h2
-rw-r--r--libiberty/testsuite/demangle-expected32
-rw-r--r--libiberty/xstrdup.c2
-rw-r--r--opcodes/ChangeLog45
-rw-r--r--opcodes/arm-dis.c7
-rw-r--r--opcodes/avr-dis.c10
-rwxr-xr-xopcodes/configure4
-rw-r--r--opcodes/configure.in4
-rw-r--r--opcodes/i386-opc.tbl2
-rw-r--r--opcodes/i386-tbl.h24
-rw-r--r--opcodes/makefile.vms8
-rw-r--r--opcodes/mips-dis.c1
-rw-r--r--opcodes/mips-opc.c9
-rw-r--r--sim/common/ChangeLog8
-rw-r--r--sim/common/Make-common.in2
-rw-r--r--sim/common/aclocal.m442
-rw-r--r--sim/erc32/ChangeLog4
-rw-r--r--sim/erc32/erc32.c5
-rw-r--r--sim/erc32/exec.c4
-rw-r--r--sim/m32c/ChangeLog5
-rw-r--r--sim/m32c/int.c1
-rw-r--r--sim/ppc/ChangeLog8
-rw-r--r--sim/ppc/Makefile.in2
-rwxr-xr-xsim/ppc/configure259
-rw-r--r--sim/ppc/configure.ac100
-rw-r--r--sim/ppc/debug.c5
-rw-r--r--sim/ppc/debug.h2
-rw-r--r--sim/ppc/hw_sem.c289
-rw-r--r--sim/ppc/hw_shm.c236
345 files changed, 26594 insertions, 5985 deletions
diff --git a/ChangeLog b/ChangeLog
index a811612..dcf365a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,61 @@
+2008-11-14 Daniel Jacobowitz <dan@codesourcery.com>
+
+ PR bootstrap/38014
+ PR bootstrap/37923
+
+ Revert:
+
+ 2008-10-24 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * Makefile.tpl (HOST_EXPORTS): Correct CPPFLAGS typo.
+ * Makefile.in: Regenerated.
+
+ 2008-10-22 Daniel Jacobowitz <dan@codesourcery.com>
+
+ PR gdb/921
+ PR gdb/1646
+ PR gdb/2175
+ PR gdb/2176
+
+ * Makefile.def (flags_to_pass): Add CPPFLAGS_FOR_BUILD and CPPFLAGS.
+ * Makefile.tpl (BUILD_EXPORTS): Set CPPFLAGS.
+ (EXTRA_BUILD_FLAGS): Correct typo. Pass CPPFLAGS.
+ (HOST_EXPORTS): Pass CPPFLAGS.
+ (CPPFLAGS_FOR_BUILD, CPPFLAGS, CPPFLAGS_FOR_TARGET): Define.
+ (LDFLAGS_FOR_TARGET): Initialize from configure script.
+ (EXTRA_TARGET_FLAGS): Set CPPFLAGS.
+ * Makefile.in, configure: Regenerated.
+ * configure.ac: Set CPPFLAGS_FOR_TARGET, LDFLAGS_FOR_TARGET,
+ and CPPFLAGS_FOR_BUILD.
+
+2008-10-29 Stefan Schulze Frielinghaus <xxschulz@de.ibm.com>
+
+ * configure.ac [spu-*-*]: Do not set skipdirs.
+ * configure: Re-generate.
+
+2008-10-24 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * Makefile.tpl (HOST_EXPORTS): Correct CPPFLAGS typo.
+ * Makefile.in: Regenerated.
+
+2008-10-22 Daniel Jacobowitz <dan@codesourcery.com>
+
+ PR gdb/921
+ PR gdb/1646
+ PR gdb/2175
+ PR gdb/2176
+
+ * Makefile.def (flags_to_pass): Add CPPFLAGS_FOR_BUILD and CPPFLAGS.
+ * Makefile.tpl (BUILD_EXPORTS): Set CPPFLAGS.
+ (EXTRA_BUILD_FLAGS): Correct typo. Pass CPPFLAGS.
+ (HOST_EXPORTS): Pass CPPFLAGS.
+ (CPPFLAGS_FOR_BUILD, CPPFLAGS, CPPFLAGS_FOR_TARGET): Define.
+ (LDFLAGS_FOR_TARGET): Initialize from configure script.
+ (EXTRA_TARGET_FLAGS): Set CPPFLAGS.
+ * Makefile.in, configure: Regenerated.
+ * configure.ac: Set CPPFLAGS_FOR_TARGET, LDFLAGS_FOR_TARGET,
+ and CPPFLAGS_FOR_BUILD.
+
2008-09-29 Peter O'Gorman <pogma@thewrittenword.com>
* libtool.m4: Update to libtool 2.2.6.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f775536..3e5a87b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,317 @@
+2008-11-19 Bob Wilson <bob.wilson@acm.org>
+
+ * xtensa-modules.c (sysregs): Add MMID, VECBASE, EPC5, EPC6, EPC7,
+ EXCSAVE5, EXCSAVE6, EXCSAVE7, EPS5, EPS6, EPS7, CPENABLE,
+ SCOMPARE1, and THREADPTR registers.
+ (NUM_SYSREGS, MAX_USER_REG): Update.
+ (states): Change width of INTERRUPT, WindowBase, WindowStart, and
+ INTENABLE. Add VECBASE, EPC5, EPC6, EPC7, EXCSAVE5, EXCSAVE6,
+ EXCSAVE7, EPS6, EPS6, EPS7, THREADPTR, CPENABLE, and SCOMPARE1 states.
+ (NUM_STATES): Update.
+ (enum xtensa_state_id): Add entries for new states.
+ (enum xtensa_field_id): Add entries for xt_wbr15_imm and xt_wbr18_imm
+ fields, along with functions to extract and set them.
+ (regfiles): Change number of AR registers to 32.
+ (Operand_ar0_encode, Operand_ar4_encode, Operand_ar8_encode,
+ Operand_ar12_encode, Operand_ars_entry_encode): Update register mask.
+ (operands): Add entries for tp7, xt_wbr15_label, xt_wbr18_label,
+ xt_wbr15_imm, and xt_wbr18_imm operands, along with functions to
+ encode and decode them.
+ (enum xtensa_operand_id): Add entries for new operands.
+ (Iclass_xt_iclass_rfi_stateArgs): Add EPC5, EPC6, EPC7, EPS5, EPS6, and
+ EPC7 states.
+ (Iclass_xt_iclass_rfdo_stateArgs): Replace EPC4 and EPS4 by EPC6 and
+ EPS6, respectively.
+ (iclasses): Add entries for rur_threadptr, wur_threadptr,
+ xt_iclass_wsr_176, xt_iclass_rsr_epc5, xt_iclass_wsr_epc5,
+ xt_iclass_xsr_epc5, xt_iclass_rsr_excsave5, xt_iclass_wsr_excsave5,
+ xt_iclass_xsr_excsave5, xt_iclass_rsr_epc6, xt_iclass_wsr_epc6,
+ xt_iclass_xsr_epc6, xt_iclass_rsr_excsave6, xt_iclass_wsr_excsave6,
+ xt_iclass_xsr_excsave6, xt_iclass_rsr_epc7, xt_iclass_wsr_epc7,
+ xt_iclass_xsr_epc7, xt_iclass_rsr_excsave7, xt_iclass_wsr_excsave7,
+ xt_iclass_xsr_excsave7, xt_iclass_rsr_eps5, xt_iclass_wsr_eps5,
+ xt_iclass_xsr_eps5, xt_iclass_rsr_eps6, xt_iclass_wsr_eps6,
+ xt_iclass_xsr_eps6, xt_iclass_rsr_eps7, xt_iclass_wsr_eps7,
+ xt_iclass_xsr_eps7, xt_iclass_rsr_vecbase, xt_iclass_wsr_vecbase,
+ xt_iclass_xsr_vecbase, xt_iclass_mul16, xt_iclass_wsr_mmid,
+ xt_iclass_icache_lock, xt_iclass_dcache_lock, xt_iclass_rsr_cpenable,
+ xt_iclass_wsr_cpenable, xt_iclass_xsr_cpenable, xt_iclass_clamp,
+ xt_iclass_minmax, xt_iclass_sx, xt_iclass_l32ai, xt_iclass_s32ri,
+ xt_iclass_s32c1i, xt_iclass_rsr_scompare1, xt_iclass_wsr_scompare1,
+ xt_iclass_xsr_scompare1, xt_iclass_div, and xt_iclass_mul32, along
+ with corresponding argument and state argument arrays. Change
+ number of state arguments for xt_iclass_rfi. Add arguments for
+ xt_iclass_rfdo.
+ (enum xtensa_iclass_id): Add entries for new iclasses.
+ (opcodes): Add entries for RUR_THREADPTR, WUR_THREADPTR, WSR_176,
+ RSR_EPC5, WSR_EPC5, XSR_EPC5, RSR_EXCSAVE5, WSR_EXCSAVE5, XSR_EXCSAVE5,
+ RSR_EPC6, WSR_EPC6, XSR_EPC6, RSR_EXCSAVE6, WSR_EXCSAVE6, XSR_EXCSAVE6,
+ RSR_EPC7, WSR_EPC7, XSR_EPC7, RSR_EXCSAVE7, WSR_EXCSAVE7, XSR_EXCSAVE7,
+ RSR_EPS5, WSR_EPS5, XSR_EPS5, RSR_EPS6, WSR_EPS6, XSR_EPS6, RSR_EPS7,
+ WSR_EPS7, XSR_EPS7, RSR_VECBASE, WSR_VECBASE, XSR_VECBASE, MUL16U,
+ MUL16S, WSR_MMID, IPFL, IHU, IIU, DPFL, DHU, DIU, RSR_CPENABLE,
+ WSR_CPENABLE, XSR_CPENABLE, CLAMPS, MIN, MAX, MINU, MAXU, SEXT, L32AI,
+ S32RI, S32C1I, RSR_SCOMPARE1, WSR_SCOMPARE1, XSR_SCOMPARE1, QUOU, QUOS,
+ REMU, REMS, and MULL opcodes, along with the corresponding functions
+ to encode them.
+ (enum xtensa_opcode_id): Add entries for new opcodes.
+ (Slot_inst_decode): Handle new opcodes.
+ (Slot_inst_get_field_fns, Slot_inst_set_field_fns): Add entries for
+ xt_wbr15_imm and xt_wbr18_imm fields.
+ (Slot_inst16a_get_field_fns, Slot_inst16a_set_field_fns): Likewise.
+ (Slot_inst16b_get_field_fns, Slot_inst16b_set_field_fns): Likewise.
+ (xtensa_modules): Update number of fields, operands, iclasses and
+ opcodes.
+
+2008-11-19 Nix <nix@esperi.org.uk>
+
+ * elf.c (swap_out_syms) [USE_STT_COMMON]: Fix syntax error.
+
+2008-11-19 Nick Clifton <nickc@redhat.com>
+
+ PR 7027
+ * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Treat WPLT30 relocs
+ against local symbols in 64-bit binaries as if they were WDISP30
+ relocs.
+ (_bfd_sparc_elf_relocate_section): Likewise.
+
+2008-11-18 Catherine Moore <clm@codesourcery.com>
+
+ * elf32-arm.c (elf32_arm_merge_eabi_attributes): Merge
+ half-precision attributes.
+ (elf32_arm_copy_one_eabi_other_attribute): New.
+ (elf32_arm_copy_other_attribute_list): New.
+
+2008-11-18 Nick Clifton <nickc@redhat.com>
+
+ * dwarf2.c (read_section): Fix formatting.
+ (read_n_bytes): Remove unhelpful comment.
+ (read_indirect_string): Pass symbol table to read_section in case
+ the .debug_str section needs relocating.
+
+ PR 7037
+ * elf32-cr16.c (cr16_elf_howto_table): Zero the src_mask field of
+ the reloc descriptions.
+
+2008-11-14 Eric B. Weddington <eric.weddington@atmel.com>
+
+ PR 7022
+ * elf32-avr.c (bfd_elf_avr_final_write_processing):
+ Add missing break statements.
+
+2008-11-14 Bob Wilson <bob.wilson@acm.org>
+
+ * xtensa-modules.c (xtensa_state_id): New enum, replacing STATE macros.
+ (xtensa_field_id, xtensa_regfile_id, xtensa_operand_id)
+ (xtensa_iclass_id, xtensa_opcode_id): New enums.
+ Replace hardcoded constants throughout this file with enum values.
+
+2008-11-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * elf.c (assign_file_positions_for_load_sections): Use header_size
+ to avoid moving the load address of file headers.
+ (assign_file_positions_for_load_sections): Set header_size for
+ segments containing the file header.
+
+2008-11-14 Tristan Gingold <gingold@adacore.com>
+
+ * configure.com: Handle bfd_default_target_size, BFD_HOST_LONG_LONG,
+ BFD_HOST_64BIT_LONG_LONG, BFD_HOSTPTR_T, bfd_file_ptr.
+ Generate bfdver.h.
+ * vms-hdr.c (_bfd_vms_write_hdr): Use strdup/free instead of alloca.
+ * hosts/alphavms.h: Defines macros to bypass i18n.
+ * makefile.vms (OBJS): Update file list.
+ (DEFS): Remove VMS_DEBUG, const, add DEBUGDIR.
+ (CFLAGS): Update flags.
+ * bfdio.c (real_fopen): Add code specific to VMS: extract attributes
+ from modes.
+
+2008-11-13 Joel Brobecker <brobecker@adacore.com>
+
+ * configure.in: Deactivate large-file support on native 32bit
+ sparc-solaris unless the user explicitly requested it.
+ * configure: Regenerate.
+
+2008-11-13 Hans-Peter Nilsson <hp@axis.com>
+
+ PR ld/7028
+ * elf.c (assign_file_positions_for_load_sections): Allocate phrds
+ with bfd_zalloc2 instead of bfd_alloc2. For the amount, use
+ the possibly-preset header-size, not the computed one.
+
+2008-11-13 Alan Modra <amodra@bigpond.net.au>
+
+ PR 7023
+ * elf.c (bfd_section_from_shdr <SHT_SYMTAB>): Fail on invalid sh_info.
+
+2008-11-11 Alan Modra <amodra@bigpond.net.au>
+
+ * elf.c (assign_file_positions_for_non_load_sections): Consolidate
+ PT_GNU_RELRO handling.
+
+2008-11-11 Alan Modra <amodra@bigpond.net.au>
+
+ PR 7012
+ * dwarf2.c (find_line): Don't keep stale pointers into realloc'd
+ memory. Return on errors. Fix memory leak.
+ (_bfd_dwarf2_cleanup_debug_info): Free dwarf_str_buffer.
+
+2008-11-10 Andreas Schwab <schwab@suse.de>
+
+ PR 7011
+ * elf.c (assign_file_positions_for_non_load_sections): Handle
+ PT_GNU_RELRO specially.
+
+2008-11-06 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * config.bfd: Add m32c-*-rtems* and m32r-*-rtems*.
+
+2008-11-06 Tom Tromey <tromey@redhat.com>
+
+ * configure, config.in: Rebuild.
+ * configure.in: Check for fileno.
+ * bfdio.c (close_on_exec): New function.
+ (real_fopen): Use it.
+ (FD_CLOEXEC): New define.
+
+2008-11-06 Tristan Gingold <gingold@adacore.com>
+
+ * mach-o.h (BFD_MACH_O_NO_SECT): Add; reorders the macros.
+ (BFD_MACH_O_SYM_NTYPE, BFD_MACH_O_SYM_NSECT,
+ BFD_MACH_O_SYM_NDESC): New macros.
+ (bfd_mach_o_i386_thread_flavour): Define according to the latest
+ definition from system header.
+ (bfd_mach_o_load_command_type): Add BFD_MACH_O_LC_RPATH,
+ BFD_MACH_O_LC_CODE_SIGNATURE.
+ (BFD_MACH_O_SECTION_TYPE_MASK, BFD_MACH_O_SECTION_ATTRIBUTES_MASK,
+ BFD_MACH_O_SECTION_ATTRIBUTES_SYS, BFD_MACH_O_SECTION_ATTRIBUTES_USR,
+ BFD_MACH_O_S_ATTR_LOC_RELOC, BFD_MACH_O_S_ATTR_EXT_RELOC,
+ BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS, BFD_MACH_O_S_ATTR_DEBUG,
+ BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS): Add.
+ (bfd_mach_o_segment_command): Add room for a nul terminator in
+ segname field.
+ (BFD_MACH_O_PROT_READ, BFD_MACH_O_PROT_WRITE,
+ BFD_MACH_O_PROT_EXECUTE): Add.
+ (INDIRECT_SYMBOL_LOCAL): Renames to BFD_MACH_O_INDIRECT_SYMBOL_LOCAL.
+ (INDIRECT_SYMBOL_ABS): Renames to BFD_MACH_O_INDIRECT_SYMBOL_ABS.
+ (bfd_mach_o_uuid_command): Add the structure.
+ (bfd_mach_o_load_command): Add uuid field.
+ (bfd_get_mach_o_data): New macro.
+ * mach-o.c (bfd_mach_o_bfd_print_private_bfd_data): New function which
+ replaces the macro.
+ (SECTION_TYPE, SECTION_ATTRIBUTES, SECTION_ATTRIBUTES_USR,
+ S_ATTR_PURE_INSTRUCTIONS, SECTION_ATTRIBUTES_SYS,
+ S_ATTR_SOME_INSTRUCTIONS, S_ATTR_EXT_RELOC, S_ATTR_LOC_RELOC): Renamed
+ and moved to mach-o.h.
+ (N_STAB, N_TYPE, N_EXT, N_UNDF, N_ABS, N_TEXT, N_DATA, N_BSS,
+ N_SECT, N_INDR): Removed as they duplicated macros in mach-o.h.
+ (bfd_mach_o_print_symbol): Print much more details.
+ (bfd_mach_o_make_bfd_section): Add prot argument, use canonical
+ dwarf name for dwarf sections. Precisely set section flags.
+ (bfd_mach_o_scan_read_section_32): Add prot argument.
+ (bfd_mach_o_scan_read_section_64): Ditto.
+ (bfd_mach_o_scan_read_section): Ditto.
+ (bfd_mach_o_scan_read_symtab_symbol): Set section for debugging
+ stabs, set BSF_GLOBAL and LOCAL flags correctly. Fix section
+ for N_SECT symbols.
+ (bfd_mach_o_i386_flavour_string): Reindent and adjust for new
+ names.
+ (bfd_mach_o_scan_read_symtab): Set HAS_SYMS flags on bfd if there
+ are symbols.
+ (bfd_mach_o_scan_read_uuid): New function.
+ (bfd_mach_o_scan_read_segment): Add a trailing nul. Segments
+ flags are now simply HAS_CONTENTS. Pass protection to
+ bfd_mach_o_scan_read_section.
+ (bfd_mach_o_scan_read_command): Decode UUID command.
+ (bfd_mach_o_flatten_sections): Add comments. Fix flavour names.
+ (bfd_mach_o_scan): Set flags according to file type.
+ (mach_o_fat_archentry): Remove abfd field.
+ (bfd_mach_o_archive_p): Remove initialization of abfd field.
+ (bfd_mach_o_openr_next_archived_file): Find previous archive
+ by position and not by bfd (as former bfds may have been freed).
+ Give architecture name to archived file.
+ * mach-o-target.c (TARGET_NAME): Use generic archive for non fat
+ targets.
+
+2008-10-30 Jay Krell <jay.krell@cornell.edu>
+
+ * cache.c (cache_bread): Cast void * pointer before performing
+ arithmetic on it.
+
+2008-10-20 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_process_dot_syms): Renamed from
+ ppc64_elf_check_directives.
+ * elf32-sh-symbian.c (sh_symbian_process_directives): Combine..
+ (sh_symbian_check_directives): ..this
+ (bfd_elf32_sh_symbian_process_directives) ..and this function.
+
+2008-10-20 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.c (bfd_elf_final_link): Move code reading relocs to..
+ * elf32-spu.c (spu_elf_count_relocs): ..here. Adjust params.
+ * elf-bfd.h (struct elf_backend_data): Update elf_backend_count_relocs
+ params.
+
+2008-10-20 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.c (bfd_elf_final_link): Use d_ptr rather than d_val
+ where Elf_Internal_Dyn holds an address.
+
+2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
+
+ * elf32-ppc.c (ppc_elf_merge_obj_attributes): Merge
+ Tag_GNU_Power_ABI_Struct_Return.
+
+2008-10-09 Kai Tietz <kai.tietz@onevision.com>
+
+ * cofflink.c (_bfd_coff_generic_relocate_section): Dump bfd_vma
+ sized addresses instead of long sized.
+
+2008-10-09 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't attempt to
+ read plt relocs if no dynamic syms.
+
+2008-10-08 Nick Clifton <nickc@redhat.com>
+
+ * configure.in (ALL_LINGUAS): Add "id".
+ * configure: Regenerate.
+ * po/id.po: New Indonesian translation.
+
+2008-10-08 Alan Modra <amodra@bigpond.net.au>
+
+ * elf.c (assign_file_positions_for_load_sections): When checking
+ a segment for contents, don't assume that a non-TLS nobits section
+ must only be followed by nobits sections.
+
+2008-10-04 Hans-Peter Nilsson <hp@axis.com>
+
+ * elf32-cris.c (TLSHOWTO32, TLSHOWTO16): New macros.
+ (cris_elf_howto_table): Add entries for R_CRIS_32_GOT_GD,
+ R_CRIS_16_GOT_GD, R_CRIS_32_GD, R_CRIS_DTP, R_CRIS_32_DTPREL,
+ R_CRIS_16_DTPREL, R_CRIS_DTPMOD, R_CRIS_32_GOT_TPREL,
+ R_CRIS_16_GOT_TPREL, R_CRIS_32_TPREL, R_CRIS_16_TPREL.
+ (cris_reloc_map): Similarly.
+ * reloc.c (bfd_reloc_code_type): Add entries for
+ BFD_RELOC_CRIS_32_GOT_GD, BFD_RELOC_CRIS_16_GOT_GD,
+ BFD_RELOC_CRIS_32_GD, BFD_RELOC_CRIS_DTP,
+ BFD_RELOC_CRIS_32_DTPREL, BFD_RELOC_CRIS_16_DTPREL,
+ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_GOT_TPREL,
+ BFD_RELOC_CRIS_16_GOT_TPREL, BFD_RELOC_CRIS_32_TPREL,
+ BFD_RELOC_CRIS_16_TPREL.
+ * libbfd.h, bfd-in2.h: Regenerate.
+
+2008-10-03 Alan Modra <amodra@bigpond.net.au>
+
+ PR 6931
+ * elf.c (bfd_elf_set_group_contents): Assign sh_info for ld -r when
+ the signature symbol is global.
+ * elflink.c (elf_link_input_bfd): Ensure group signature symbol
+ is output when ld -r. Set group sh_info when local.
+ * linker.c (default_indirect_link_order): Handle group sections
+ specially.
+
2008-09-30 Wesley W. Terpstra <wesley@terpstra.ca>
Nick Clifton <nickc@redhat.com>
@@ -133,7 +447,7 @@
BFD_MACH_O_x86_EXCEPTION_STATE.
(bfd_mach_o_load_command_type): Add
BFD_MACH_O_LC_SEGMENT_64, BFD_MACH_O_LC_ROUTINES_64,
- BFD_MACH_O_LC_UUID.
+ BFD_MACH_O_LC_UUID.
(BFD_MACH_O_CPU_IS64BIT): Added.
(bfd_mach_o_cpu_type): Add BFD_MACH_O_CPU_TYPE_POWERPC_64,
BFD_MACH_O_CPU_TYPE_X86_64.
@@ -165,7 +479,7 @@
(bfd_mach_o_scan_start_address): Ditto.
(bfd_mach_o_scan): Ditto.
(bfd_mach_o_lookup_section): Ditto.
-
+
2008-08-27 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* elf-hppa.h (elf_hppa_reloc_final_type): Handle R_PARISC_GPREL64,
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index c8ef5f9..16609cb 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -4192,6 +4192,19 @@ This is the 5 bits of a value. */
/* 32-bit offset to symbol with PLT entry, relative to this relocation. */
BFD_RELOC_CRIS_32_PLT_PCREL,
+/* Relocs used in TLS code for CRIS. */
+ BFD_RELOC_CRIS_32_GOT_GD,
+ BFD_RELOC_CRIS_16_GOT_GD,
+ BFD_RELOC_CRIS_32_GD,
+ BFD_RELOC_CRIS_DTP,
+ BFD_RELOC_CRIS_32_DTPREL,
+ BFD_RELOC_CRIS_16_DTPREL,
+ BFD_RELOC_CRIS_32_GOT_TPREL,
+ BFD_RELOC_CRIS_16_GOT_TPREL,
+ BFD_RELOC_CRIS_32_TPREL,
+ BFD_RELOC_CRIS_16_TPREL,
+ BFD_RELOC_CRIS_DTPMOD,
+
/* Intel i860 Relocations. */
BFD_RELOC_860_COPY,
BFD_RELOC_860_GLOB_DAT,
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 1ffd7d05..1900c14 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1001,6 +1001,9 @@ bfd_get_sign_extend_vma (bfd *abfd)
|| strcmp (name, "pei-arm-wince-little") == 0)
return 1;
+ if (CONST_STRNEQ (name, "mach-o"))
+ return 0;
+
bfd_set_error (bfd_error_wrong_format);
return -1;
}
diff --git a/bfd/bfdio.c b/bfd/bfdio.c
index d8aa1de..7cba51f 100644
--- a/bfd/bfdio.c
+++ b/bfd/bfdio.c
@@ -38,6 +38,10 @@
#define S_IXOTH 0001 /* Execute by others. */
#endif
+#ifndef FD_CLOEXEC
+#define FD_CLOEXEC 1
+#endif
+
file_ptr
real_ftell (FILE *file)
{
@@ -62,14 +66,57 @@ real_fseek (FILE *file, file_ptr offset, int whence)
#endif
}
+/* Mark FILE as close-on-exec. Return FILE. FILE may be NULL, in
+ which case nothing is done. */
+static FILE *
+close_on_exec (FILE *file)
+{
+#if defined (HAVE_FILENO) && defined (F_GETFD)
+ if (file)
+ {
+ int fd = fileno (file);
+ int old = fcntl (fd, F_GETFD, 0);
+ if (old >= 0)
+ fcntl (fd, F_SETFD, old | FD_CLOEXEC);
+ }
+#endif
+ return file;
+}
+
FILE *
real_fopen (const char *filename, const char *modes)
{
+#ifdef VMS
+ char vms_modes[4];
+ char *vms_attr;
+
+ /* On VMS, fopen allows file attributes as optionnal arguments.
+ We need to use them but we'd better to use the common prototype.
+ In fopen-vms.h, they are separated from the mode with a comma.
+ Split here. */
+ vms_attr = strchr (modes, ',');
+ if (vms_attr == NULL)
+ {
+ /* No attributes. */
+ return close_on_exec (fopen (filename, modes));
+ }
+ else
+ {
+ /* Attribute found - rebuild modes. */
+ size_t modes_len = vms_attr - modes;
+
+ BFD_ASSERT (modes_len < sizeof (vms_modes));
+ memcpy (vms_modes, modes, modes_len);
+ vms_modes[modes_len] = 0;
+ return close_on_exec (fopen (filename, vms_modes, vms_attr + 1));
+ }
+#else /* !VMS */
#if defined (HAVE_FOPEN64)
- return fopen64 (filename, modes);
+ return close_on_exec (fopen64 (filename, modes));
#else
- return fopen (filename, modes);
+ return close_on_exec (fopen (filename, modes));
#endif
+#endif /* !VMS */
}
/*
diff --git a/bfd/cache.c b/bfd/cache.c
index 3906335..50674e8 100644
--- a/bfd/cache.c
+++ b/bfd/cache.c
@@ -317,7 +317,7 @@ cache_bread (struct bfd *abfd, void *buf, file_ptr nbytes)
if (chunk_size > max_chunk_size)
chunk_size = max_chunk_size;
- chunk_nread = cache_bread_1 (abfd, buf + nread, chunk_size);
+ chunk_nread = cache_bread_1 (abfd, (char *) buf + nread, chunk_size);
/* Update the nread count.
@@ -342,6 +342,7 @@ cache_bwrite (struct bfd *abfd, const void *where, file_ptr nbytes)
{
file_ptr nwrite;
FILE *f = bfd_cache_lookup (abfd, 0);
+
if (f == NULL)
return 0;
nwrite = fwrite (where, 1, nbytes, f);
@@ -364,6 +365,7 @@ cache_bflush (struct bfd *abfd)
{
int sts;
FILE *f = bfd_cache_lookup (abfd, CACHE_NO_OPEN);
+
if (f == NULL)
return 0;
sts = fflush (f);
@@ -377,6 +379,7 @@ cache_bstat (struct bfd *abfd, struct stat *sb)
{
int sts;
FILE *f = bfd_cache_lookup (abfd, CACHE_NO_SEEK_ERROR);
+
if (f == NULL)
return -1;
sts = fstat (fileno (f), sb);
@@ -385,7 +388,8 @@ cache_bstat (struct bfd *abfd, struct stat *sb)
return sts;
}
-static const struct bfd_iovec cache_iovec = {
+static const struct bfd_iovec cache_iovec =
+{
&cache_bread, &cache_bwrite, &cache_btell, &cache_bseek,
&cache_bclose, &cache_bflush, &cache_bstat
};
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 19a7dd2..d771168 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -2985,16 +2985,16 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
absolute. We output the address here to a file.
This file is then read by dlltool when generating the
reloc section. Note that the base file is not
- portable between systems. We write out a long here,
- and dlltool reads in a long. */
- long addr = (rel->r_vaddr
+ portable between systems. We write out a bfd_vma here,
+ and dlltool reads in a bfd_vma. */
+ bfd_vma addr = (rel->r_vaddr
- input_section->vma
+ input_section->output_offset
+ input_section->output_section->vma);
if (coff_data (output_bfd)->pe)
addr -= pe_data(output_bfd)->pe_opthdr.ImageBase;
- if (fwrite (&addr, 1, sizeof (long), (FILE *) info->base_file)
- != sizeof (long))
+ if (fwrite (&addr, 1, sizeof (bfd_vma), (FILE *) info->base_file)
+ != sizeof (bfd_vma))
{
bfd_set_error (bfd_error_system_call);
return FALSE;
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 9309502..1bc971d 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -721,7 +721,7 @@ case "${targ}" in
targ_defvec=bfd_elf32_iq2000_vec
;;
- m32c-*-elf)
+ m32c-*-elf | m32c-*-rtems*)
targ_defvec=bfd_elf32_m32c_vec
;;
diff --git a/bfd/config.in b/bfd/config.in
index f15e4ff..d1797ae 100644
--- a/bfd/config.in
+++ b/bfd/config.in
@@ -78,6 +78,9 @@
/* Define to 1 if you have the `fdopen' function. */
#undef HAVE_FDOPEN
+/* Define to 1 if you have the `fileno' function. */
+#undef HAVE_FILENO
+
/* Define to 1 if you have the `fopen64' function. */
#undef HAVE_FOPEN64
diff --git a/bfd/configure b/bfd/configure
index 0cefd4d..9827e6c 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -4934,6 +4934,21 @@ _ACEOF
_ACEOF
+
+case "${target}" in
+ sparc-*-solaris*)
+ # On native 32bit sparc-solaris, large-file and procfs support are
+ # mutually exclusive; and without procfs support, the elf module
+ # cannot provide certain routines such as elfcore_write_prpsinfo
+ # or elfcore_write_prstatus. So unless the user explicitly requested
+ # large-file support through the --enable-largefile switch, disable
+ # large-file support in favor of procfs support.
+ if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
+ enable_largefile="no"
+ fi
+ ;;
+esac
+
# Check whether --enable-largefile or --disable-largefile was given.
if test "${enable_largefile+set}" = set; then
enableval="$enable_largefile"
@@ -5705,13 +5720,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:5708: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:5723: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:5711: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:5726: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:5714: output\"" >&5)
+ (eval echo "\"\$as_me:5729: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -6868,7 +6883,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 6871 "configure"' > conftest.$ac_ext
+ echo '#line 6886 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -8144,11 +8159,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8147: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8162: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8151: \$? = $ac_status" >&5
+ echo "$as_me:8166: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8483,11 +8498,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8486: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8501: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8490: \$? = $ac_status" >&5
+ echo "$as_me:8505: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8588,11 +8603,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8591: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8606: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8595: \$? = $ac_status" >&5
+ echo "$as_me:8610: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -8643,11 +8658,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8646: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8661: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8650: \$? = $ac_status" >&5
+ echo "$as_me:8665: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -11440,7 +11455,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11443 "configure"
+#line 11458 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11536,7 +11551,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11539 "configure"
+#line 11554 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12091,7 +12106,7 @@ bfd_default_target_size=32
# host stuff:
-ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi fi"
+ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi fi id"
# If we haven't got the data from the intl directory,
# assume NLS is disabled.
USE_NLS=no
@@ -17553,7 +17568,8 @@ fi
-for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid
+
+for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
diff --git a/bfd/configure.com b/bfd/configure.com
index 929977c..de44dfc 100644
--- a/bfd/configure.com
+++ b/bfd/configure.com
@@ -49,12 +49,30 @@ $DECK
ERASE(match_pos);
COPY_TEXT('64');
ENDIF;
+ match_pos := SEARCH_QUIETLY('@bfd_default_target_size@', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT('64');
+ ENDIF;
match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang);
IF match_pos <> 0 THEN;
POSITION(BEGINNING_OF(match_pos));
ERASE(match_pos);
COPY_TEXT('0');
ENDIF;
+ match_pos := SEARCH_QUIETLY('@BFD_HOST_LONG_LONG@', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT('0');
+ ENDIF;
+ match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG_LONG@', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT('0');
+ ENDIF;
match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang);
IF match_pos <> 0 THEN;
POSITION(BEGINNING_OF(match_pos));
@@ -75,6 +93,24 @@ $DECK
ERASE(match_pos);
COPY_TEXT('uint64');
ENDIF;
+ match_pos := SEARCH_QUIETLY('@BFD_HOSTPTR_T@', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT('uint64');
+ ENDIF;
+ match_pos := SEARCH_QUIETLY('@bfd_file_ptr@', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT('bfd_signed_vma');
+ ENDIF;
+ match_pos := SEARCH_QUIETLY('unsigned @bfd_file_ptr@ ufile_ptr', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT('bfd_vma ufile_ptr');
+ ENDIF;
WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
QUIT
$ EOD
@@ -152,6 +188,61 @@ $endif
$
$ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
$!
+$! create bfdver.h
+$!
+$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
+ []version.h /output=[]bfdver.h
+$DECK
+!
+! Copy file, changing lines with macros (@@)
+!
+!
+ vfile := CREATE_BUFFER("vfile", "configure.in");
+ rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
+ match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ vers := CURRENT_LINE-")";
+ ELSE;
+ vers := "unknown";
+ ENDIF;
+ versnum := vers - "." - ".";
+
+ file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
+ rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
+
+ match_pos := SEARCH_QUIETLY('@bfd_version@', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT(versnum);
+ ENDIF;
+ match_pos := SEARCH_QUIETLY('@bfd_version_string@', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT('"');
+ COPY_TEXT(vers);
+ COPY_TEXT('"');
+ ENDIF;
+ match_pos := SEARCH_QUIETLY('@bfd_version_package@', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT('"(GNU Binutils) "');
+ ENDIF;
+ match_pos := SEARCH_QUIETLY('@report_bugs_to@', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT('"<http://www.sourceware.org/bugzilla/>"');
+ ENDIF;
+ WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
+ QUIT
+$ EOD
+$ write sys$output "Generated `bfdver.h' from 'version.h' and `configure.in'."
+$!
$!
$! create targmatch.h
$!
@@ -210,6 +301,8 @@ $ create []config.h
#define HAVE_TIME_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
+/* Disable NLS */
+#undef ENABLE_NLS
$!
$ write sys$output "Generated `config.h'"
diff --git a/bfd/configure.in b/bfd/configure.in
index 6c33648..22ceb61 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -22,6 +22,21 @@ AC_DISABLE_SHARED
AC_PROG_CC
AC_GNU_SOURCE
AC_USE_SYSTEM_EXTENSIONS
+
+case "${target}" in
+ sparc-*-solaris*)
+ # On native 32bit sparc-solaris, large-file and procfs support are
+ # mutually exclusive; and without procfs support, the elf module
+ # cannot provide certain routines such as elfcore_write_prpsinfo
+ # or elfcore_write_prstatus. So unless the user explicitly requested
+ # large-file support through the --enable-largefile switch, disable
+ # large-file support in favor of procfs support.
+ if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
+ enable_largefile="no"
+ fi
+ ;;
+esac
+
AC_SYS_LARGEFILE
LT_INIT
@@ -120,7 +135,7 @@ bfd_default_target_size=32
# host stuff:
-ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi fi"
+ALL_LINGUAS="fr tr ja es sv da zh_CN ro rw vi fi id"
ZW_GNU_GETTEXT_SISTER_DIR
AM_PO_SUBDIRS
@@ -179,7 +194,7 @@ GCC_HEADER_STDINT(bfd_stdint.h)
AC_HEADER_TIME
AC_HEADER_DIRENT
ACX_HEADER_STRING
-AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid)
+AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid fileno)
AC_CHECK_FUNCS(strtoull)
AC_CHECK_DECLS(basename)
diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog
index 4559d6b..8202a75 100644
--- a/bfd/doc/ChangeLog
+++ b/bfd/doc/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-19 Nick Clifton <nickc@redhat.com>
+
+ * fdl.texi: Update to v1.3
+ * bfd.texinfo: Change license to v1.3.
+
2008-08-24 Alan Modra <amodra@bigpond.net.au>
* Makefile.am (chew.o): Delete rule.
diff --git a/bfd/doc/bfd.texinfo b/bfd/doc/bfd.texinfo
index 04b4266..7eeb919 100644
--- a/bfd/doc/bfd.texinfo
+++ b/bfd/doc/bfd.texinfo
@@ -1,7 +1,7 @@
\input texinfo.tex
@setfilename bfd.info
@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000,
-@c 2001, 2002, 2003, 2006, 2007
+@c 2001, 2002, 2003, 2006, 2007, 2008
@c Free Software Foundation, Inc.
@c
@synindex fn cp
@@ -17,10 +17,10 @@ END-INFO-DIR-ENTRY
@copying
This file documents the BFD library.
-Copyright @copyright{} 1991, 2000, 2001, 2003, 2006, 2007 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 2000, 2001, 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``GNU General Public License'' and ``Funding
Free Software'', the Front-Cover texts being (a) (see below), and with
@@ -65,10 +65,10 @@ included in the section entitled ``GNU Free Documentation License''.
@end tex
@vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 2001, 2003, 2006 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 2001, 2003, 2006, 2008 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.1
+ under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
diff --git a/bfd/doc/fdl.texi b/bfd/doc/fdl.texi
index a83ecf7..8805f1a 100644
--- a/bfd/doc/fdl.texi
+++ b/bfd/doc/fdl.texi
@@ -1,26 +1,28 @@
-@c -*-texinfo-*-
-@appendix GNU Free Documentation License
-@center Version 1.1, March 2000
+@c The GNU Free Documentation License.
+@center Version 1.3, 3 November 2008
+
+@c This file is intended to be included within another document,
+@c hence no sectioning command or @node.
@display
-Copyright (C) 2000, 2003 Free Software Foundation, Inc.
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+@uref{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
-@sp 1
+
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
-written document ``free'' in the sense of freedom: to assure everyone
-the effective freedom to copy and redistribute it, with or without
-modifying it, either commercially or noncommercially. Secondarily,
-this License preserves for the author and publisher a way to get
-credit for their work, while not being considered responsible for
-modifications made by others.
+functional and useful document @dfn{free} in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
@@ -35,60 +37,72 @@ it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
-@sp 1
@item
APPLICABILITY AND DEFINITIONS
-This License applies to any manual or other work that contains a
-notice placed by the copyright holder saying it can be distributed
-under the terms of this License. The ``Document'', below, refers to any
-such manual or work. Any member of the public is a licensee, and is
-addressed as ``you.''
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The ``Document'', below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as ``you''. You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
-A ``Secondary Section'' is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall subject
-(or to related matters) and contains nothing that could fall directly
-within that overall subject. (For example, if the Document is in part a
-textbook of mathematics, a Secondary Section may not explain any
-mathematics.) The relationship could be a matter of historical
+A ``Secondary Section'' is a named appendix or a front-matter section
+of the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License.
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License.
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
-general public, whose contents can be viewed and edited directly and
+general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
-format whose markup has been designed to thwart or discourage
-subsequent modification by readers is not Transparent. A copy that is
-not ``Transparent'' is called ``Opaque.''
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML designed for human modification. Opaque formats include
-PostScript, PDF, proprietary formats that can be read and edited only
-by proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML produced by some word processors for output
-purposes only.
+@sc{ascii} without markup, Texinfo input format, La@TeX{} input
+format, @acronym{SGML} or @acronym{XML} using a publicly available
+@acronym{DTD}, and standard-conforming simple @acronym{HTML},
+PostScript or @acronym{PDF} designed for human modification. Examples
+of transparent image formats include @acronym{PNG}, @acronym{XCF} and
+@acronym{JPG}. Opaque formats include proprietary formats that can be
+read and edited only by proprietary word processors, @acronym{SGML} or
+@acronym{XML} for which the @acronym{DTD} and/or processing tools are
+not generally available, and the machine-generated @acronym{HTML},
+PostScript or @acronym{PDF} produced by some word processors for
+output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
@@ -96,7 +110,25 @@ this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
-@sp 1
+
+The ``publisher'' means any person or entity that distributes copies
+of the Document to the public.
+
+A section ``Entitled XYZ'' means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as ``Acknowledgements'',
+``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
+of such a section when you modify the Document means that it remains a
+section ``Entitled XYZ'' according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
@item
VERBATIM COPYING
@@ -112,13 +144,14 @@ number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
-@sp 1
+
@item
COPYING IN QUANTITY
-If you publish printed copies of the Document numbering more than 100,
-and the Document's license notice requires Cover Texts, you must enclose
-the copies in covers that carry, clearly and legibly, all these Cover
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
@@ -136,21 +169,20 @@ pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
-a publicly-accessible computer-network location containing a complete
-Transparent copy of the Document, free of added material, which the
-general network-using public has access to download anonymously at no
-charge using public-standard network protocols. If you use the latter
-option, you must take reasonably prudent steps, when you begin
-distribution of Opaque copies in quantity, to ensure that this
-Transparent copy will remain thus accessible at the stated location
-until at least one year after the last time you distribute an Opaque
-copy (directly or through your agents or retailers) of that edition to
-the public.
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
-@sp 1
+
@item
MODIFICATIONS
@@ -161,52 +193,85 @@ Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.@*
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has less than five).@*
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.@*
-D. Preserve all the copyright notices of the Document.@*
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.@*
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.@*
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.@*
-H. Include an unaltered copy of this License.@*
-I. Preserve the section entitled ``History'', and its title, and add to
- it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section entitled ``History'' in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.@*
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the ``History'' section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.@*
-K. In any section entitled ``Acknowledgements'' or ``Dedications'',
- preserve the section's title, and preserve in the section all the
- substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.@*
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.@*
-M. Delete any section entitled ``Endorsements.'' Such a section
- may not be included in the Modified Version.@*
-N. Do not retitle any existing section as ``Endorsements''
- or to conflict in title with any Invariant Section.@*
-@sp 1
+@enumerate A
+@item
+Use in the Title Page (and on the covers, if any) a title distinct
+from that of the Document, and from those of previous versions
+(which should, if there were any, be listed in the History section
+of the Document). You may use the same title as a previous version
+if the original publisher of that version gives permission.
+
+@item
+List on the Title Page, as authors, one or more persons or entities
+responsible for authorship of the modifications in the Modified
+Version, together with at least five of the principal authors of the
+Document (all of its principal authors, if it has fewer than five),
+unless they release you from this requirement.
+
+@item
+State on the Title page the name of the publisher of the
+Modified Version, as the publisher.
+
+@item
+Preserve all the copyright notices of the Document.
+
+@item
+Add an appropriate copyright notice for your modifications
+adjacent to the other copyright notices.
+
+@item
+Include, immediately after the copyright notices, a license notice
+giving the public permission to use the Modified Version under the
+terms of this License, in the form shown in the Addendum below.
+
+@item
+Preserve in that license notice the full lists of Invariant Sections
+and required Cover Texts given in the Document's license notice.
+
+@item
+Include an unaltered copy of this License.
+
+@item
+Preserve the section Entitled ``History'', Preserve its Title, and add
+to it an item stating at least the title, year, new authors, and
+publisher of the Modified Version as given on the Title Page. If
+there is no section Entitled ``History'' in the Document, create one
+stating the title, year, authors, and publisher of the Document as
+given on its Title Page, then add an item describing the Modified
+Version as stated in the previous sentence.
+
+@item
+Preserve the network location, if any, given in the Document for
+public access to a Transparent copy of the Document, and likewise
+the network locations given in the Document for previous versions
+it was based on. These may be placed in the ``History'' section.
+You may omit a network location for a work that was published at
+least four years before the Document itself, or if the original
+publisher of the version it refers to gives permission.
+
+@item
+For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
+the Title of the section, and preserve in the section all the
+substance and tone of each of the contributor acknowledgements and/or
+dedications given therein.
+
+@item
+Preserve all the Invariant Sections of the Document,
+unaltered in their text and in their titles. Section numbers
+or the equivalent are not considered part of the section titles.
+
+@item
+Delete any section Entitled ``Endorsements''. Such a section
+may not be included in the Modified Version.
+
+@item
+Do not retitle any existing section to be Entitled ``Endorsements'' or
+to conflict in title with any Invariant Section.
+
+@item
+Preserve any Warranty Disclaimers.
+@end enumerate
+
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
@@ -214,9 +279,9 @@ of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
-You may add a section entitled ``Endorsements'', provided it contains
+You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
+parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
@@ -233,7 +298,7 @@ permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
-@sp 1
+
@item
COMBINING DOCUMENTS
@@ -242,7 +307,7 @@ License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
-license notice.
+license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
@@ -253,12 +318,12 @@ author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
-In the combination, you must combine any sections entitled ``History''
-in the various original documents, forming one section entitled
-``History''; likewise combine any sections entitled ``Acknowledgements'',
-and any sections entitled ``Dedications.'' You must delete all sections
-entitled ``Endorsements.''
-@sp 1
+In the combination, you must combine any sections Entitled ``History''
+in the various original documents, forming one section Entitled
+``History''; likewise combine any sections Entitled ``Acknowledgements'',
+and any sections Entitled ``Dedications''. You must delete all
+sections Entitled ``Endorsements.''
+
@item
COLLECTIONS OF DOCUMENTS
@@ -272,25 +337,27 @@ You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
-@sp 1
+
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
-distribution medium, does not as a whole count as a Modified Version
-of the Document, provided no compilation copyright is claimed for the
-compilation. Such a compilation is called an ``aggregate'', and this
-License does not apply to the other self-contained works thus compiled
-with the Document, on account of their being thus compiled, if they
-are not themselves derivative works of the Document.
+distribution medium, is called an ``aggregate'' if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one quarter
-of the entire aggregate, the Document's Cover Texts may be placed on
-covers that surround only the Document within the aggregate.
-Otherwise they must appear on covers around the whole aggregate.
-@sp 1
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
@item
TRANSLATION
@@ -300,22 +367,46 @@ Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
-translation of this License provided that you also include the
-original English version of this License. In case of a disagreement
-between the translation and the original English version of this
-License, the original English version will prevail.
-@sp 1
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled ``Acknowledgements'',
+``Dedications'', or ``History'', the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
@item
TERMINATION
-You may not copy, modify, sublicense, or distribute the Document except
-as expressly provided for under this License. Any other attempt to
-copy, modify, sublicense or distribute the Document is void, and will
-automatically terminate your rights under this License. However,
-parties who have received copies, or rights, from you under this
-License will not have their licenses terminated so long as such
-parties remain in full compliance.
-@sp 1
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
@item
FUTURE REVISIONS OF THIS LICENSE
@@ -323,7 +414,7 @@ The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
-http://www.gnu.org/copyleft/.
+@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
@@ -332,11 +423,46 @@ following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation.
+as a draft) by the Free Software Foundation. If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy's public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+@item
+RELICENSING
+
+``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works. A
+public wiki that anybody can edit is an example of such a server. A
+``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
+site means any set of copyrightable works thus published on the MMC
+site.
+
+``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
+published by that same organization.
+
+``Incorporate'' means to publish or republish a Document, in whole or
+in part, as part of another Document.
+
+An MMC is ``eligible for relicensing'' if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole
+or in part into the MMC, (1) had no cover texts or invariant sections,
+and (2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
@end enumerate
-@unnumberedsec ADDENDUM: How to use this License for your documents
+@page
+@heading ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
@@ -344,23 +470,37 @@ license notices just after the title page:
@smallexample
@group
-Copyright (C) @var{year} @var{your name}.
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1
-or any later version published by the Free Software Foundation;
-with the Invariant Sections being @var{list their titles}, with the
-Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
-A copy of the license is included in the section entitled "GNU
-Free Documentation License."
+ Copyright (C) @var{year} @var{your name}.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+ Texts. A copy of the license is included in the section entitled ``GNU
+ Free Documentation License''.
@end group
@end smallexample
-If you have no Invariant Sections, write ``with no Invariant Sections''
-instead of saying which ones are invariant. If you have no
-Front-Cover Texts, write ``no Front-Cover Texts'' instead of
-``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the ``with@dots{}Texts.'' line with this:
+
+@smallexample
+@group
+ with the Invariant Sections being @var{list their titles}, with
+ the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
+ being @var{list}.
+@end group
+@end smallexample
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
+
+@c Local Variables:
+@c ispell-local-pdict: "ispell-dict"
+@c End:
+
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index a4918ac..f1f6c90 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -399,15 +399,19 @@ lookup_info_hash_table (struct info_hash_table *hash_table, const char *key)
}
/* Read a section into its appropriate place in the dwarf2_debug
- struct (indicated by SECTION_BUFFER and SECTION_SIZE). If syms is
+ struct (indicated by SECTION_BUFFER and SECTION_SIZE). If SYMS is
not NULL, use bfd_simple_get_relocated_section_contents to read the
- section contents, otherwise use bfd_get_section_contents. */
+ section contents, otherwise use bfd_get_section_contents. Fail if
+ the located section does not contain at least OFFSET bytes. */
static bfd_boolean
-read_section (bfd *abfd,
- const char* section_name, const char* compressed_section_name,
- asymbol** syms, bfd_uint64_t offset,
- bfd_byte **section_buffer, bfd_size_type *section_size)
+read_section (bfd * abfd,
+ const char * section_name,
+ const char * compressed_section_name,
+ asymbol ** syms,
+ bfd_uint64_t offset,
+ bfd_byte ** section_buffer,
+ bfd_size_type * section_size)
{
asection *msec;
bfd_boolean section_is_compressed = FALSE;
@@ -459,11 +463,11 @@ read_section (bfd *abfd,
}
/* It is possible to get a bad value for the offset into the section
- * that the client wants. Validate it here to avoid trouble later. */
+ that the client wants. Validate it here to avoid trouble later. */
if (offset != 0 && offset >= *section_size)
{
(*_bfd_error_handler) (_("Dwarf Error: Offset (%lu) greater than or equal to %s size (%lu)."),
- offset, section_name, *section_size);
+ (long) offset, section_name, *section_size);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
@@ -512,9 +516,6 @@ read_n_bytes (bfd *abfd ATTRIBUTE_UNUSED,
bfd_byte *buf,
unsigned int size ATTRIBUTE_UNUSED)
{
- /* If the size of a host char is 8 bits, we can return a pointer
- to the buffer, otherwise we have to copy the data to a buffer
- allocated on the temporary obstack. */
return buf;
}
@@ -525,6 +526,7 @@ read_string (bfd *abfd ATTRIBUTE_UNUSED,
{
/* Return a pointer to the embedded string. */
char *str = (char *) buf;
+
if (*str == '\0')
{
*bytes_read_ptr = 1;
@@ -535,10 +537,12 @@ read_string (bfd *abfd ATTRIBUTE_UNUSED,
return str;
}
+/* END VERBATIM */
+
static char *
-read_indirect_string (struct comp_unit* unit,
- bfd_byte *buf,
- unsigned int *bytes_read_ptr)
+read_indirect_string (struct comp_unit * unit,
+ bfd_byte * buf,
+ unsigned int * bytes_read_ptr)
{
bfd_uint64_t offset;
struct dwarf2_debug *stash = unit->stash;
@@ -548,12 +552,13 @@ read_indirect_string (struct comp_unit* unit,
offset = read_4_bytes (unit->abfd, buf);
else
offset = read_8_bytes (unit->abfd, buf);
+
*bytes_read_ptr = unit->offset_size;
if (! read_section (unit->abfd, ".debug_str", ".zdebug_str",
- 0, offset,
+ stash->syms, offset,
&stash->dwarf_str_buffer, &stash->dwarf_str_size))
- return 0;
+ return NULL;
str = (char *) stash->dwarf_str_buffer + offset;
if (*str == '\0')
@@ -561,8 +566,6 @@ read_indirect_string (struct comp_unit* unit,
return str;
}
-/* END VERBATIM */
-
static bfd_uint64_t
read_address (struct comp_unit *unit, bfd_byte *buf)
{
@@ -2989,8 +2992,6 @@ find_line (bfd *abfd,
symbols, 0,
&stash->info_ptr_memory, &total_size))
goto done;
- stash->info_ptr = stash->info_ptr_memory;
- stash->info_ptr_end = stash->info_ptr + total_size;
}
else
{
@@ -3008,63 +3009,64 @@ find_line (bfd *abfd,
if (stash->info_ptr_memory == NULL)
goto done;
- stash->info_ptr = stash->info_ptr_memory;
- stash->info_ptr_end = stash->info_ptr;
-
+ total_size = 0;
for (msec = find_debug_info (debug_bfd, NULL);
msec;
msec = find_debug_info (debug_bfd, msec))
{
bfd_size_type size;
- bfd_size_type start;
size = msec->size;
if (size == 0)
continue;
- start = stash->info_ptr_end - stash->info_ptr;
+ if (!(bfd_simple_get_relocated_section_contents
+ (debug_bfd, msec, stash->info_ptr_memory + total_size,
+ symbols)))
+ goto done;
- if ((bfd_simple_get_relocated_section_contents
- (debug_bfd, msec, stash->info_ptr + start, symbols))
- == NULL)
- continue;
-
- stash->info_ptr_end = stash->info_ptr + start + size;
+ total_size += size;
}
-
- BFD_ASSERT (stash->info_ptr_end == stash->info_ptr + total_size);
}
else
{
/* Case 3: multiple sections, some or all compressed. */
- stash->info_ptr_memory = bfd_malloc (1);
- stash->info_ptr = stash->info_ptr_memory;
- stash->info_ptr_end = stash->info_ptr;
+ stash->info_ptr_memory = NULL;
+ total_size = 0;
for (msec = find_debug_info (debug_bfd, NULL);
msec;
msec = find_debug_info (debug_bfd, msec))
{
bfd_size_type size = msec->size;
- bfd_byte* buffer
- = (bfd_simple_get_relocated_section_contents
- (debug_bfd, msec, NULL, symbols));
- if (! buffer)
+ bfd_byte* buffer;
+
+ if (size == 0)
continue;
+
+ buffer = (bfd_simple_get_relocated_section_contents
+ (debug_bfd, msec, NULL, symbols));
+ if (! buffer)
+ goto done;
+
if (strcmp (msec->name, DWARF2_COMPRESSED_DEBUG_INFO) == 0)
{
if (! bfd_uncompress_section_contents (&buffer, &size))
- continue;
+ {
+ free (buffer);
+ goto done;
+ }
}
- stash->info_ptr = bfd_realloc (stash->info_ptr,
- stash->info_ptr_end
- - stash->info_ptr + size);
- memcpy (stash->info_ptr_end, buffer, size);
+ stash->info_ptr_memory = bfd_realloc (stash->info_ptr_memory,
+ total_size + size);
+ memcpy (stash->info_ptr_memory + total_size, buffer, size);
free (buffer);
- stash->info_ptr_end += size;
+ total_size += size;
}
}
}
+ stash->info_ptr = stash->info_ptr_memory;
+ stash->info_ptr_end = stash->info_ptr + total_size;
stash->sec = find_debug_info (debug_bfd, NULL);
stash->sec_info_ptr = stash->info_ptr;
stash->syms = symbols;
@@ -3364,8 +3366,14 @@ _bfd_dwarf2_cleanup_debug_info (bfd *abfd)
}
}
- free (stash->dwarf_abbrev_buffer);
- free (stash->dwarf_line_buffer);
- free (stash->dwarf_ranges_buffer);
- free (stash->info_ptr_memory);
+ if (stash->dwarf_abbrev_buffer)
+ free (stash->dwarf_abbrev_buffer);
+ if (stash->dwarf_line_buffer)
+ free (stash->dwarf_line_buffer);
+ if (stash->dwarf_str_buffer)
+ free (stash->dwarf_str_buffer);
+ if (stash->dwarf_ranges_buffer)
+ free (stash->dwarf_ranges_buffer);
+ if (stash->info_ptr_memory)
+ free (stash->info_ptr_memory);
}
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 993458e..9615a4a 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1012,7 +1012,7 @@ struct elf_backend_data
/* Count relocations. Not called for relocatable links
or if all relocs are being preserved in the output. */
unsigned int (*elf_backend_count_relocs)
- (asection *, Elf_Internal_Rela *);
+ (struct bfd_link_info *, asection *);
/* This function, if defined, is called when an NT_PRSTATUS note is found
in a core file. */
diff --git a/bfd/elf.c b/bfd/elf.c
index 763750b..70ed765 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1608,6 +1608,8 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex)
if (hdr->sh_entsize != bed->s->sizeof_sym)
return FALSE;
+ if (hdr->sh_info * hdr->sh_entsize > hdr->sh_size)
+ return FALSE;
BFD_ASSERT (elf_onesymtab (abfd) == 0);
elf_onesymtab (abfd) = shindex;
elf_tdata (abfd)->symtab_hdr = *hdr;
@@ -2681,13 +2683,15 @@ elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg)
*failedptr = TRUE;
}
-/* Fill in the contents of a SHT_GROUP section. */
+/* Fill in the contents of a SHT_GROUP section. Called from
+ _bfd_elf_compute_section_file_positions for gas, objcopy, and
+ when ELF targets use the generic linker, ld. Called for ld -r
+ from bfd_elf_final_link. */
void
bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg)
{
bfd_boolean *failedptr = failedptrarg;
- unsigned long symindx;
asection *elt, *first;
unsigned char *loc;
bfd_boolean gas;
@@ -2698,20 +2702,49 @@ bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg)
|| *failedptr)
return;
- symindx = 0;
- if (elf_group_id (sec) != NULL)
- symindx = elf_group_id (sec)->udata.i;
+ if (elf_section_data (sec)->this_hdr.sh_info == 0)
+ {
+ unsigned long symindx = 0;
+
+ /* elf_group_id will have been set up by objcopy and the
+ generic linker. */
+ if (elf_group_id (sec) != NULL)
+ symindx = elf_group_id (sec)->udata.i;
- if (symindx == 0)
+ if (symindx == 0)
+ {
+ /* If called from the assembler, swap_out_syms will have set up
+ elf_section_syms. */
+ BFD_ASSERT (elf_section_syms (abfd) != NULL);
+ symindx = elf_section_syms (abfd)[sec->index]->udata.i;
+ }
+ elf_section_data (sec)->this_hdr.sh_info = symindx;
+ }
+ else if (elf_section_data (sec)->this_hdr.sh_info == (unsigned int) -2)
{
- /* If called from the assembler, swap_out_syms will have set up
- elf_section_syms; If called for "ld -r", use target_index. */
- if (elf_section_syms (abfd) != NULL)
- symindx = elf_section_syms (abfd)[sec->index]->udata.i;
- else
- symindx = sec->target_index;
+ /* The ELF backend linker sets sh_info to -2 when the group
+ signature symbol is global, and thus the index can't be
+ set until all local symbols are output. */
+ asection *igroup = elf_sec_group (elf_next_in_group (sec));
+ struct bfd_elf_section_data *sec_data = elf_section_data (igroup);
+ unsigned long symndx = sec_data->this_hdr.sh_info;
+ unsigned long extsymoff = 0;
+ struct elf_link_hash_entry *h;
+
+ if (!elf_bad_symtab (igroup->owner))
+ {
+ Elf_Internal_Shdr *symtab_hdr;
+
+ symtab_hdr = &elf_tdata (igroup->owner)->symtab_hdr;
+ extsymoff = symtab_hdr->sh_info;
+ }
+ h = elf_sym_hashes (igroup->owner)[symndx - extsymoff];
+ 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;
+
+ elf_section_data (sec)->this_hdr.sh_info = h->indx;
}
- elf_section_data (sec)->this_hdr.sh_info = symindx;
/* The contents won't be allocated for "ld -r" or objcopy. */
gas = TRUE;
@@ -4125,6 +4158,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
bfd_size_type maxpagesize;
unsigned int alloc;
unsigned int i, j;
+ bfd_vma header_pad = 0;
if (link_info == NULL
&& !_bfd_elf_map_sections_to_segments (abfd, link_info))
@@ -4132,7 +4166,11 @@ assign_file_positions_for_load_sections (bfd *abfd,
alloc = 0;
for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next)
- ++alloc;
+ {
+ ++alloc;
+ if (m->header_size)
+ header_pad = m->header_size;
+ }
elf_elfheader (abfd)->e_phoff = bed->s->sizeof_ehdr;
elf_elfheader (abfd)->e_phentsize = bed->s->sizeof_phdr;
@@ -4150,7 +4188,21 @@ assign_file_positions_for_load_sections (bfd *abfd,
return TRUE;
}
- phdrs = bfd_alloc2 (abfd, alloc, sizeof (Elf_Internal_Phdr));
+ /* We're writing the size in elf_tdata (abfd)->program_header_size,
+ see assign_file_positions_except_relocs, so make sure we have
+ that amount allocated, with trailing space cleared.
+ The variable alloc contains the computed need, while elf_tdata
+ (abfd)->program_header_size contains the size used for the
+ layout.
+ See ld/emultempl/elf-generic.em:gld${EMULATION_NAME}_map_segments
+ where the layout is forced to according to a larger size in the
+ last iterations for the testcase ld-elf/header. */
+ BFD_ASSERT (elf_tdata (abfd)->program_header_size % bed->s->sizeof_phdr
+ == 0);
+ phdrs = bfd_zalloc2 (abfd,
+ (elf_tdata (abfd)->program_header_size
+ / bed->s->sizeof_phdr),
+ sizeof (Elf_Internal_Phdr));
elf_tdata (abfd)->phdr = phdrs;
if (phdrs == NULL)
return FALSE;
@@ -4161,6 +4213,11 @@ assign_file_positions_for_load_sections (bfd *abfd,
off = bed->s->sizeof_ehdr;
off += alloc * bed->s->sizeof_phdr;
+ if (header_pad < (bfd_vma) off)
+ header_pad = 0;
+ else
+ header_pad -= off;
+ off += header_pad;
for (m = elf_tdata (abfd)->segment_map, p = phdrs, j = 0;
m != NULL;
@@ -4257,21 +4314,14 @@ assign_file_positions_for_load_sections (bfd *abfd,
elf_section_type (m->sections[i]) = SHT_NOBITS;
/* Find out whether this segment contains any loadable
- sections. If the first section isn't loadable, the same
- holds for any other sections. */
- i = 0;
- while (elf_section_type (m->sections[i]) == SHT_NOBITS)
- {
- /* If a segment starts with .tbss, we need to look
- at the next section to decide whether the segment
- has any loadable sections. */
- if ((elf_section_flags (m->sections[i]) & SHF_TLS) == 0
- || ++i >= m->count)
- {
- no_contents = TRUE;
- break;
- }
- }
+ sections. */
+ no_contents = TRUE;
+ for (i = 0; i < m->count; i++)
+ if (elf_section_type (m->sections[i]) != SHT_NOBITS)
+ {
+ no_contents = FALSE;
+ break;
+ }
off_adjust = vma_page_aligned_bias (m->sections[0]->vma, off, align);
off += off_adjust;
@@ -4355,6 +4405,11 @@ assign_file_positions_for_load_sections (bfd *abfd,
p->p_filesz += alloc * bed->s->sizeof_phdr;
p->p_memsz += alloc * bed->s->sizeof_phdr;
+ if (m->count)
+ {
+ p->p_filesz += header_pad;
+ p->p_memsz += header_pad;
+ }
}
if (p->p_type == PT_LOAD
@@ -4607,7 +4662,61 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
m != NULL;
m = m->next, p++)
{
- if (m->count != 0)
+ if (p->p_type == PT_GNU_RELRO)
+ {
+ const Elf_Internal_Phdr *lp;
+
+ BFD_ASSERT (!m->includes_filehdr && !m->includes_phdrs);
+
+ if (link_info != NULL)
+ {
+ /* During linking the range of the RELRO segment is passed
+ in link_info. */
+ for (lp = phdrs; lp < phdrs + count; ++lp)
+ {
+ if (lp->p_type == PT_LOAD
+ && lp->p_vaddr >= link_info->relro_start
+ && lp->p_vaddr < link_info->relro_end
+ && lp->p_vaddr + lp->p_filesz >= link_info->relro_end)
+ break;
+ }
+ }
+ else
+ {
+ /* Otherwise we are copying an executable or shared
+ library, but we need to use the same linker logic. */
+ for (lp = phdrs; lp < phdrs + count; ++lp)
+ {
+ if (lp->p_type == PT_LOAD
+ && lp->p_paddr == p->p_paddr)
+ break;
+ }
+ }
+
+ if (lp < phdrs + count)
+ {
+ p->p_vaddr = lp->p_vaddr;
+ p->p_paddr = lp->p_paddr;
+ p->p_offset = lp->p_offset;
+ if (link_info != NULL)
+ p->p_filesz = link_info->relro_end - lp->p_vaddr;
+ else if (m->p_size_valid)
+ p->p_filesz = m->p_size;
+ else
+ abort ();
+ p->p_memsz = p->p_filesz;
+ p->p_align = 1;
+ p->p_flags = (lp->p_flags & ~PF_W);
+ }
+ else if (link_info != NULL)
+ {
+ memset (p, 0, sizeof *p);
+ p->p_type = PT_NULL;
+ }
+ else
+ abort ();
+ }
+ else if (m->count != 0)
{
if (p->p_type != PT_LOAD
&& (p->p_type != PT_NOTE
@@ -4623,87 +4732,20 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
p->p_filesz = sect->filepos - m->sections[0]->filepos;
if (hdr->sh_type != SHT_NOBITS)
p->p_filesz += hdr->sh_size;
-
- if (p->p_type == PT_GNU_RELRO)
- {
- /* When we get here, we are copying executable
- or shared library. But we need to use the same
- linker logic. */
- Elf_Internal_Phdr *lp;
-
- for (lp = phdrs; lp < phdrs + count; ++lp)
- {
- if (lp->p_type == PT_LOAD
- && lp->p_paddr == p->p_paddr)
- break;
- }
-
- if (lp < phdrs + count)
- {
- /* We should use p_size if it is valid since it
- may contain the first few bytes of the next
- SEC_ALLOC section. */
- if (m->p_size_valid)
- p->p_filesz = m->p_size;
- else
- abort ();
- p->p_vaddr = lp->p_vaddr;
- p->p_offset = lp->p_offset;
- p->p_memsz = p->p_filesz;
- p->p_align = 1;
- }
- else
- abort ();
- }
- else
- p->p_offset = m->sections[0]->filepos;
+ p->p_offset = m->sections[0]->filepos;
}
}
- else
+ else if (m->includes_filehdr)
{
- if (m->includes_filehdr)
- {
- p->p_vaddr = filehdr_vaddr;
- if (! m->p_paddr_valid)
- p->p_paddr = filehdr_paddr;
- }
- else if (m->includes_phdrs)
- {
- p->p_vaddr = phdrs_vaddr;
- if (! m->p_paddr_valid)
- p->p_paddr = phdrs_paddr;
- }
- else if (p->p_type == PT_GNU_RELRO)
- {
- Elf_Internal_Phdr *lp;
-
- for (lp = phdrs; lp < phdrs + count; ++lp)
- {
- if (lp->p_type == PT_LOAD
- && lp->p_vaddr <= link_info->relro_end
- && lp->p_vaddr >= link_info->relro_start
- && (lp->p_vaddr + lp->p_filesz
- >= link_info->relro_end))
- break;
- }
-
- if (lp < phdrs + count
- && link_info->relro_end > lp->p_vaddr)
- {
- p->p_vaddr = lp->p_vaddr;
- p->p_paddr = lp->p_paddr;
- p->p_offset = lp->p_offset;
- p->p_filesz = link_info->relro_end - lp->p_vaddr;
- p->p_memsz = p->p_filesz;
- p->p_align = 1;
- p->p_flags = (lp->p_flags & ~PF_W);
- }
- else
- {
- memset (p, 0, sizeof *p);
- p->p_type = PT_NULL;
- }
- }
+ p->p_vaddr = filehdr_vaddr;
+ if (! m->p_paddr_valid)
+ p->p_paddr = filehdr_paddr;
+ }
+ else if (m->includes_phdrs)
+ {
+ p->p_vaddr = phdrs_vaddr;
+ if (! m->p_paddr_valid)
+ p->p_paddr = phdrs_paddr;
}
}
@@ -5850,6 +5892,10 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd)
phdr_included = TRUE;
}
+ if (map->includes_filehdr && first_section)
+ /* We need to keep the space used by the headers fixed. */
+ map->header_size = first_section->vma - segment->p_vaddr;
+
if (!map->includes_phdrs
&& !map->includes_filehdr
&& map->p_paddr_valid)
@@ -6414,9 +6460,8 @@ Unable to find equivalent output section for symbol '%s' from section '%s'"),
if (type == STT_OBJECT)
sym.st_info = ELF_ST_INFO (STB_GLOBAL, STT_COMMON);
else
-#else
- sym.st_info = ELF_ST_INFO (STB_GLOBAL, type);
#endif
+ sym.st_info = ELF_ST_INFO (STB_GLOBAL, type);
}
else if (bfd_is_und_section (syms[idx]->section))
sym.st_info = ELF_ST_INFO (((flags & BSF_WEAK)
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index da1ac24..9008a4b 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -8163,6 +8163,33 @@ elf32_arm_obj_attrs_arg_type (int tag)
return (tag & 1) != 0 ? 2 : 1;
}
+static void
+elf32_arm_copy_one_eabi_other_attribute (bfd *ibfd, bfd *obfd, obj_attribute_list *in_list)
+{
+ switch (in_list->tag)
+ {
+ case Tag_VFP_HP_extension:
+ case Tag_ABI_FP_16bit_format:
+ bfd_elf_add_obj_attr_int (obfd, OBJ_ATTR_PROC, in_list->tag, in_list->attr.i);
+ break;
+
+ default:
+ if ((in_list->tag & 127) < 64)
+ {
+ _bfd_error_handler
+ (_("Warning: %B: Unknown EABI object attribute %d"), ibfd, in_list->tag);
+ break;
+ }
+ }
+}
+
+static void
+elf32_arm_copy_eabi_other_attribute_list (bfd *ibfd, bfd *obfd, obj_attribute_list *in_list)
+{
+ for (; in_list; in_list = in_list->next )
+ elf32_arm_copy_one_eabi_other_attribute (ibfd, obfd, in_list);
+}
+
/* Merge EABI object attributes from IBFD into OBFD. Raise an error if there
are conflicting attributes. */
@@ -8172,6 +8199,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
obj_attribute *in_attr;
obj_attribute *out_attr;
obj_attribute_list *in_list;
+ obj_attribute_list *out_list;
/* Some tags have 0 = don't care, 1 = strong requirement,
2 = weak requirement. */
static const int order_312[3] = {3, 1, 2};
@@ -8196,7 +8224,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
/* This needs to happen before Tag_ABI_FP_number_model is merged. */
if (in_attr[Tag_ABI_VFP_args].i != out_attr[Tag_ABI_VFP_args].i)
{
- /* Ignore mismatches if teh object doesn't use floating point. */
+ /* Ignore mismatches if the object doesn't use floating point. */
if (out_attr[Tag_ABI_FP_number_model].i == 0)
out_attr[Tag_ABI_VFP_args].i = in_attr[Tag_ABI_VFP_args].i;
else if (in_attr[Tag_ABI_FP_number_model].i != 0)
@@ -8362,6 +8390,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
return FALSE;
}
break;
+
default: /* All known attributes should be explicitly covered. */
abort ();
}
@@ -8392,15 +8421,67 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
while (in_list && in_list->tag == Tag_compatibility)
in_list = in_list->next;
- for (; in_list; in_list = in_list->next)
+ out_list = elf_other_obj_attributes_proc (obfd);
+ while (out_list && out_list->tag == Tag_compatibility)
+ out_list = out_list->next;
+
+ for (; in_list != NULL; )
{
- if ((in_list->tag & 128) < 64)
+ if (out_list == NULL)
{
- _bfd_error_handler
- (_("Warning: %B: Unknown EABI object attribute %d"),
- ibfd, in_list->tag);
- break;
+ elf32_arm_copy_eabi_other_attribute_list (ibfd, obfd, in_list);
+ return TRUE;
+ }
+
+ /* The tags for each list are in numerical order. */
+ /* If the tags are equal, then merge. */
+ if (in_list->tag == out_list->tag)
+ {
+ switch (in_list->tag)
+ {
+ case Tag_VFP_HP_extension:
+ if (out_list->attr.i == 0)
+ out_list->attr.i = in_list->attr.i;
+ break;
+
+ case Tag_ABI_FP_16bit_format:
+ if (in_list->attr.i != 0 && out_list->attr.i != 0)
+ {
+ if (in_list->attr.i != out_list->attr.i)
+ {
+ _bfd_error_handler
+ (_("ERROR: fp16 format mismatch between %B and %B"),
+ ibfd, obfd);
+ return FALSE;
+ }
+ }
+ if (in_list->attr.i != 0)
+ out_list->attr.i = in_list->attr.i;
+ break;
+
+ default:
+ if ((in_list->tag & 127) < 64)
+ {
+ _bfd_error_handler
+ (_("Warning: %B: Unknown EABI object attribute %d"), ibfd, in_list->tag);
+ break;
+ }
+ }
+ }
+ else if (in_list->tag < out_list->tag)
+ {
+ /* This attribute is in ibfd, but not obfd. Copy to obfd and advance to
+ next input attribute. */
+ elf32_arm_copy_one_eabi_other_attribute (ibfd, obfd, in_list);
+ }
+ if (in_list->tag <= out_list->tag)
+ {
+ in_list = in_list->next;
+ if (in_list == NULL)
+ continue;
}
+ while (out_list && out_list->tag < in_list->tag)
+ out_list = out_list->next;
}
return TRUE;
}
diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c
index fffd040..17e20fa 100644
--- a/bfd/elf32-avr.c
+++ b/bfd/elf32-avr.c
@@ -1298,6 +1298,7 @@ bfd_elf_avr_final_write_processing (bfd *abfd,
case bfd_mach_avr25:
val = E_AVR_MACH_AVR25;
+ break;
case bfd_mach_avr3:
val = E_AVR_MACH_AVR3;
@@ -1305,9 +1306,11 @@ bfd_elf_avr_final_write_processing (bfd *abfd,
case bfd_mach_avr31:
val = E_AVR_MACH_AVR31;
+ break;
case bfd_mach_avr35:
val = E_AVR_MACH_AVR35;
+ break;
case bfd_mach_avr4:
val = E_AVR_MACH_AVR4;
diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c
index 84130b0..47eb2fc 100644
--- a/bfd/elf32-cr16.c
+++ b/bfd/elf32-cr16.c
@@ -93,7 +93,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_NUM8", /* name */
FALSE, /* partial_inplace */
- 0xff, /* src_mask */
+ 0x0, /* src_mask */
0xff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -107,7 +107,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_NUM16", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0x0, /* src_mask */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -121,7 +121,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_NUM32", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -135,7 +135,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_NUM32a", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -149,7 +149,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL4", /* name */
FALSE, /* partial_inplace */
- 0xf, /* src_mask */
+ 0x0, /* src_mask */
0xf, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -163,7 +163,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL4a", /* name */
FALSE, /* partial_inplace */
- 0xf, /* src_mask */
+ 0x0, /* src_mask */
0xf, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -177,7 +177,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL14", /* name */
FALSE, /* partial_inplace */
- 0x3fff, /* src_mask */
+ 0x0, /* src_mask */
0x3fff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -191,7 +191,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL14a", /* name */
FALSE, /* partial_inplace */
- 0x3fff, /* src_mask */
+ 0x0, /* src_mask */
0x3fff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -205,7 +205,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL16", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0x0, /* src_mask */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -219,7 +219,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL20", /* name */
FALSE, /* partial_inplace */
- 0xfffff, /* src_mask */
+ 0x0, /* src_mask */
0xfffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -233,7 +233,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_REGREL20a", /* name */
FALSE, /* partial_inplace */
- 0xfffff, /* src_mask */
+ 0x0, /* src_mask */
0xfffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -247,7 +247,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_ABS20", /* name */
FALSE, /* partial_inplace */
- 0xfffff, /* src_mask */
+ 0x0, /* src_mask */
0xfffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -261,7 +261,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_ABS24", /* name */
FALSE, /* partial_inplace */
- 0xffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -275,7 +275,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM4", /* name */
FALSE, /* partial_inplace */
- 0xf, /* src_mask */
+ 0x0, /* src_mask */
0xf, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -289,7 +289,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM8", /* name */
FALSE, /* partial_inplace */
- 0xff, /* src_mask */
+ 0x0, /* src_mask */
0xff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -303,7 +303,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM16", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0x0, /* src_mask */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -317,7 +317,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM20", /* name */
FALSE, /* partial_inplace */
- 0xfffff, /* src_mask */
+ 0x0, /* src_mask */
0xfffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -331,7 +331,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM24", /* name */
FALSE, /* partial_inplace */
- 0xffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -345,7 +345,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM32", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -359,7 +359,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_IMM32a", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -373,7 +373,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_DISP4", /* name */
FALSE, /* partial_inplace */
- 0xf, /* src_mask */
+ 0x0, /* src_mask */
0xf, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -387,7 +387,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_DISP8", /* name */
FALSE, /* partial_inplace */
- 0x1ff, /* src_mask */
+ 0x0, /* src_mask */
0x1ff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -401,7 +401,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_DISP16", /* name */
FALSE, /* partial_inplace */
- 0x1ffff, /* src_mask */
+ 0x0, /* src_mask */
0x1ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* REVISIT: DISP24 should be left-shift by 2 as per ISA doc
@@ -416,7 +416,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_DISP24", /* name */
FALSE, /* partial_inplace */
- 0x1ffffff, /* src_mask */
+ 0x0, /* src_mask */
0x1ffffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -430,7 +430,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_DISP24a", /* name */
FALSE, /* partial_inplace */
- 0xffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffff, /* dst_mask */
FALSE), /* pcrel_offset */
@@ -447,7 +447,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_SWITCH8", /* name */
FALSE, /* partial_inplace */
- 0xff, /* src_mask */
+ 0x0, /* src_mask */
0xff, /* dst_mask */
TRUE), /* pcrel_offset */
@@ -464,7 +464,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_SWITCH16", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0x0, /* src_mask */
0xffff, /* dst_mask */
TRUE), /* pcrel_offset */
@@ -481,7 +481,7 @@ static reloc_howto_type cr16_elf_howto_table[] =
bfd_elf_generic_reloc, /* special_function */
"R_CR16_SWITCH32", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
TRUE) /* pcrel_offset */
};
@@ -945,7 +945,7 @@ elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
(info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section,
rel->r_offset)))
- return FALSE;
+ return FALSE;
break;
case bfd_reloc_undefined:
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 75d0695..360cba6 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -409,7 +409,31 @@ static reloc_howto_type cris_elf_howto_table [] =
FALSE, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
- TRUE) /* pcrel_offset */
+ TRUE), /* pcrel_offset */
+
+ /* We don't handle these in any special manner and cross-format
+ linking is not supported; just recognize them enough to pass them
+ around. FIXME: do the same for most PIC relocs and add sanity
+ tests to actually refuse gracefully to handle these and PIC
+ relocs for cross-format linking. */
+#define TLSHOWTO32(name) \
+ HOWTO (name, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, \
+ bfd_elf_generic_reloc, #name, FALSE, 0, 0xffffffff, FALSE)
+#define TLSHOWTO16(name) \
+ HOWTO (name, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, \
+ bfd_elf_generic_reloc, #name, FALSE, 0, 0xffff, FALSE)
+
+ TLSHOWTO32 (R_CRIS_32_GOT_GD),
+ TLSHOWTO16 (R_CRIS_16_GOT_GD),
+ TLSHOWTO32 (R_CRIS_32_GD),
+ TLSHOWTO32 (R_CRIS_DTP),
+ TLSHOWTO32 (R_CRIS_32_DTPREL),
+ TLSHOWTO16 (R_CRIS_16_DTPREL),
+ TLSHOWTO32 (R_CRIS_32_GOT_TPREL),
+ TLSHOWTO16 (R_CRIS_16_GOT_TPREL),
+ TLSHOWTO32 (R_CRIS_32_TPREL),
+ TLSHOWTO16 (R_CRIS_16_TPREL),
+ TLSHOWTO32 (R_CRIS_DTPMOD)
};
/* Map BFD reloc types to CRIS ELF reloc types. */
@@ -441,7 +465,18 @@ static const struct cris_reloc_map cris_reloc_map [] =
{ BFD_RELOC_CRIS_32_GOTPLT, R_CRIS_32_GOTPLT },
{ BFD_RELOC_CRIS_32_GOTREL, R_CRIS_32_GOTREL },
{ BFD_RELOC_CRIS_32_PLT_GOTREL, R_CRIS_32_PLT_GOTREL },
- { BFD_RELOC_CRIS_32_PLT_PCREL, R_CRIS_32_PLT_PCREL }
+ { BFD_RELOC_CRIS_32_PLT_PCREL, R_CRIS_32_PLT_PCREL },
+ { BFD_RELOC_CRIS_32_GOT_GD, R_CRIS_32_GOT_GD },
+ { BFD_RELOC_CRIS_16_GOT_GD, R_CRIS_16_GOT_GD },
+ { BFD_RELOC_CRIS_32_GD, R_CRIS_32_GD },
+ { BFD_RELOC_CRIS_DTP, R_CRIS_DTP },
+ { BFD_RELOC_CRIS_32_DTPREL, R_CRIS_32_DTPREL },
+ { BFD_RELOC_CRIS_16_DTPREL, R_CRIS_16_DTPREL },
+ { BFD_RELOC_CRIS_32_GOT_TPREL, R_CRIS_32_GOT_TPREL },
+ { BFD_RELOC_CRIS_16_GOT_TPREL, R_CRIS_16_GOT_TPREL },
+ { BFD_RELOC_CRIS_32_TPREL, R_CRIS_32_TPREL },
+ { BFD_RELOC_CRIS_16_TPREL, R_CRIS_16_TPREL },
+ { BFD_RELOC_CRIS_DTPMOD, R_CRIS_DTPMOD }
};
static reloc_howto_type *
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 1d9cabd..83a9274 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3964,6 +3964,33 @@ ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
ibfd, obfd, in_abi, out_abi);
}
+ /* Check for conflicting Tag_GNU_Power_ABI_Struct_Return attributes
+ and merge non-conflicting ones. */
+ in_attr = &in_attrs[Tag_GNU_Power_ABI_Struct_Return];
+ out_attr = &out_attrs[Tag_GNU_Power_ABI_Struct_Return];
+ if (in_attr->i != out_attr->i)
+ {
+ out_attr->type = 1;
+ if (out_attr->i == 0)
+ out_attr->i = in_attr->i;
+ else if (in_attr->i == 0)
+ ;
+ else if (out_attr->i == 1 && in_attr->i == 2)
+ _bfd_error_handler
+ (_("Warning: %B uses r3/r4 for small structure returns, %B uses memory"), obfd, ibfd);
+ else if (out_attr->i == 2 && in_attr->i == 1)
+ _bfd_error_handler
+ (_("Warning: %B uses r3/r4 for small structure returns, %B uses memory"), ibfd, obfd);
+ else if (in_attr->i > 2)
+ _bfd_error_handler
+ (_("Warning: %B uses unknown small structure return convention %d"), ibfd,
+ in_attr->i);
+ else
+ _bfd_error_handler
+ (_("Warning: %B uses unknown small structure return convention %d"), obfd,
+ out_attr->i);
+ }
+
/* Merge Tag_compatibility attributes and any common GNU ones. */
_bfd_elf_merge_object_attributes (ibfd, obfd);
diff --git a/bfd/elf32-sh-symbian.c b/bfd/elf32-sh-symbian.c
index cec0d03..25e3af9 100644
--- a/bfd/elf32-sh-symbian.c
+++ b/bfd/elf32-sh-symbian.c
@@ -392,10 +392,9 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd,
/* Scan a bfd for a .directive section, and if found process it.
Returns TRUE upon success, FALSE otherwise. */
-bfd_boolean bfd_elf32_sh_symbian_process_directives (struct bfd_link_info *info, bfd * abfd);
-bfd_boolean
-bfd_elf32_sh_symbian_process_directives (struct bfd_link_info *info, bfd * abfd)
+static bfd_boolean
+sh_symbian_process_directives (bfd *abfd, struct bfd_link_info *info)
{
bfd_boolean result = FALSE;
bfd_byte * contents;
@@ -617,18 +616,12 @@ sh_symbian_relocate_section (bfd * output_bfd,
contents, relocs, local_syms, local_sections);
}
-static bfd_boolean
-sh_symbian_check_directives (bfd *abfd, struct bfd_link_info *info)
-{
- return bfd_elf32_sh_symbian_process_directives (info, abfd);
-}
-
#define TARGET_LITTLE_SYM bfd_elf32_shl_symbian_vec
#define TARGET_LITTLE_NAME "elf32-shl-symbian"
#undef elf_backend_relocate_section
#define elf_backend_relocate_section sh_symbian_relocate_section
#undef elf_backend_check_directives
-#define elf_backend_check_directives sh_symbian_check_directives
+#define elf_backend_check_directives sh_symbian_process_directives
#include "elf32-target.h"
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index 00681b2..708ab24 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -3895,16 +3895,27 @@ spu_elf_final_link (bfd *output_bfd, struct bfd_link_info *info)
that need to be emitted. */
static unsigned int
-spu_elf_count_relocs (asection *sec, Elf_Internal_Rela *relocs)
+spu_elf_count_relocs (struct bfd_link_info *info, asection *sec)
{
+ Elf_Internal_Rela *relocs;
unsigned int count = 0;
- Elf_Internal_Rela *relend = relocs + sec->reloc_count;
- for (; relocs < relend; relocs++)
+ relocs = _bfd_elf_link_read_relocs (sec->owner, sec, NULL, NULL,
+ info->keep_memory);
+ if (relocs != NULL)
{
- int r_type = ELF32_R_TYPE (relocs->r_info);
- if (r_type == R_SPU_PPU32 || r_type == R_SPU_PPU64)
- ++count;
+ Elf_Internal_Rela *rel;
+ Elf_Internal_Rela *relend = relocs + sec->reloc_count;
+
+ for (rel = relocs; rel < relend; rel++)
+ {
+ int r_type = ELF32_R_TYPE (rel->r_info);
+ if (r_type == R_SPU_PPU32 || r_type == R_SPU_PPU64)
+ ++count;
+ }
+
+ if (elf_section_data (sec)->relocs != relocs)
+ free (relocs);
}
return count;
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 86fe3c3..9138371 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -92,7 +92,7 @@ static bfd_vma opd_entry_value
#define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections
#define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol
#define elf_backend_add_symbol_hook ppc64_elf_add_symbol_hook
-#define elf_backend_check_directives ppc64_elf_check_directives
+#define elf_backend_check_directives ppc64_elf_process_dot_syms
#define elf_backend_as_needed_cleanup ppc64_elf_as_needed_cleanup
#define elf_backend_archive_symbol_lookup ppc64_elf_archive_symbol_lookup
#define elf_backend_check_relocs ppc64_elf_check_relocs
@@ -3005,8 +3005,8 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
}
/* Get start of .glink stubs from DT_PPC64_GLINK. */
- dynamic = bfd_get_section_by_name (abfd, ".dynamic");
- if (dynamic != NULL)
+ if (dyn_count != 0
+ && (dynamic = bfd_get_section_by_name (abfd, ".dynamic")) != NULL)
{
bfd_byte *dynbuf, *extdyn, *extdynend;
size_t extdynsize;
@@ -3061,21 +3061,21 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
if (resolv_vma)
size += sizeof (asymbol) + sizeof ("__glink_PLTresolve");
- }
- relplt = bfd_get_section_by_name (abfd, ".rela.plt");
- if (glink != NULL && relplt != NULL)
- {
- slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table;
- if (! (*slurp_relocs) (abfd, relplt, dyn_syms, TRUE))
- goto free_contents_and_exit;
+ relplt = bfd_get_section_by_name (abfd, ".rela.plt");
+ if (relplt != NULL)
+ {
+ slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table;
+ if (! (*slurp_relocs) (abfd, relplt, dyn_syms, TRUE))
+ goto free_contents_and_exit;
- plt_count = relplt->size / sizeof (Elf64_External_Rela);
- size += plt_count * sizeof (asymbol);
+ plt_count = relplt->size / sizeof (Elf64_External_Rela);
+ size += plt_count * sizeof (asymbol);
- p = relplt->relocation;
- for (i = 0; i < plt_count; i++, p++)
- size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt");
+ p = relplt->relocation;
+ for (i = 0; i < plt_count; i++, p++)
+ size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt");
+ }
}
s = *ret = bfd_malloc (size);
@@ -3620,7 +3620,7 @@ struct ppc_link_hash_table
/* Set on error. */
unsigned int stub_error:1;
- /* Temp used by ppc64_elf_check_directives. */
+ /* Temp used by ppc64_elf_process_dot_syms. */
unsigned int twiddled_syms:1;
/* Incremented every time we size stubs. */
@@ -4438,7 +4438,7 @@ add_symbol_adjust (struct ppc_link_hash_entry *eh, struct bfd_link_info *info)
/* Process list of dot-symbols we made in link_hash_newfunc. */
static bfd_boolean
-ppc64_elf_check_directives (bfd *ibfd, struct bfd_link_info *info)
+ppc64_elf_process_dot_syms (bfd *ibfd, struct bfd_link_info *info)
{
struct ppc_link_hash_table *htab;
struct ppc_link_hash_entry **p, *eh;
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 8e59383..f2015ee 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -9062,6 +9062,63 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
continue;
}
+ if (finfo->info->relocatable
+ && (o->flags & (SEC_LINKER_CREATED | SEC_GROUP)) == SEC_GROUP)
+ {
+ /* Deal with the group signature symbol. */
+ struct bfd_elf_section_data *sec_data = elf_section_data (o);
+ unsigned long symndx = sec_data->this_hdr.sh_info;
+ asection *osec = o->output_section;
+
+ if (symndx >= locsymcount
+ || (elf_bad_symtab (input_bfd)
+ && finfo->sections[symndx] == NULL))
+ {
+ struct elf_link_hash_entry *h = sym_hashes[symndx - extsymoff];
+ 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;
+ /* Arrange for symbol to be output. */
+ h->indx = -2;
+ elf_section_data (osec)->this_hdr.sh_info = -2;
+ }
+ else if (ELF_ST_TYPE (isymbuf[symndx].st_info) == STT_SECTION)
+ {
+ /* We'll use the output section target_index. */
+ asection *sec = finfo->sections[symndx]->output_section;
+ elf_section_data (osec)->this_hdr.sh_info = sec->target_index;
+ }
+ else
+ {
+ if (finfo->indices[symndx] == -1)
+ {
+ /* Otherwise output the local symbol now. */
+ Elf_Internal_Sym sym = isymbuf[symndx];
+ asection *sec = finfo->sections[symndx]->output_section;
+ const char *name;
+
+ name = bfd_elf_string_from_elf_section (input_bfd,
+ symtab_hdr->sh_link,
+ sym.st_name);
+ if (name == NULL)
+ return FALSE;
+
+ sym.st_shndx = _bfd_elf_section_from_bfd_section (output_bfd,
+ sec);
+ if (sym.st_shndx == SHN_BAD)
+ return FALSE;
+
+ sym.st_value += o->output_offset;
+
+ finfo->indices[symndx] = bfd_get_symcount (output_bfd);
+ if (! elf_link_output_sym (finfo, name, &sym, o, NULL))
+ return FALSE;
+ }
+ elf_section_data (osec)->this_hdr.sh_info
+ = finfo->indices[symndx];
+ }
+ }
+
if ((o->flags & SEC_HAS_CONTENTS) == 0
|| (o->size == 0 && (o->flags & SEC_RELOC) == 0))
continue;
@@ -10038,22 +10095,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
if (info->relocatable || info->emitrelocations)
reloc_count = sec->reloc_count;
else if (bed->elf_backend_count_relocs)
- {
- Elf_Internal_Rela * relocs;
-
- relocs = _bfd_elf_link_read_relocs (sec->owner, sec,
- NULL, NULL,
- info->keep_memory);
-
- if (relocs != NULL)
- {
- reloc_count
- = (*bed->elf_backend_count_relocs) (sec, relocs);
-
- if (elf_section_data (sec)->relocs != relocs)
- free (relocs);
- }
- }
+ reloc_count = (*bed->elf_backend_count_relocs) (info, sec);
if (sec->rawsize > max_contents_size)
max_contents_size = sec->rawsize;
@@ -10699,16 +10741,16 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
&& (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak))
{
- dyn.d_un.d_val = h->root.u.def.value;
+ dyn.d_un.d_ptr = h->root.u.def.value;
o = h->root.u.def.section;
if (o->output_section != NULL)
- dyn.d_un.d_val += (o->output_section->vma
+ dyn.d_un.d_ptr += (o->output_section->vma
+ o->output_offset);
else
{
/* The symbol is imported from another shared
library and does not apply to this one. */
- dyn.d_un.d_val = 0;
+ dyn.d_un.d_ptr = 0;
}
break;
}
@@ -10787,6 +10829,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
else
type = SHT_RELA;
dyn.d_un.d_val = 0;
+ dyn.d_un.d_ptr = 0;
for (i = 1; i < elf_numsections (abfd); i++)
{
Elf_Internal_Shdr *hdr;
@@ -10799,9 +10842,9 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
dyn.d_un.d_val += hdr->sh_size;
else
{
- if (dyn.d_un.d_val == 0
- || hdr->sh_addr < dyn.d_un.d_val)
- dyn.d_un.d_val = hdr->sh_addr;
+ if (dyn.d_un.d_ptr == 0
+ || hdr->sh_addr < dyn.d_un.d_ptr)
+ dyn.d_un.d_ptr = hdr->sh_addr;
}
}
}
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index 7b81555..83d26b0 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -1329,6 +1329,9 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
goto r_sparc_plt32;
break;
}
+ /* PR 7027: We need similar behaviour for 64-bit binaries. */
+ else if (r_type == R_SPARC_WPLT30)
+ break;
/* It does not make sense to have a procedure linkage
table entry for a local symbol. */
@@ -2760,6 +2763,9 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd,
if (h == NULL)
break;
}
+ /* PR 7027: We need similar behaviour for 64-bit binaries. */
+ else if (r_type == R_SPARC_WPLT30 && h == NULL)
+ break;
else
{
BFD_ASSERT (h != NULL);
diff --git a/bfd/hosts/alphavms.h b/bfd/hosts/alphavms.h
index b2a85c2..0afda86 100644
--- a/bfd/hosts/alphavms.h
+++ b/bfd/hosts/alphavms.h
@@ -34,6 +34,7 @@
#include <time.h>
#include "bfd.h"
+#include "filenames.h"
#ifndef BFD_HOST_64_BIT
/* Make the basic types 64-bit quantities on the host.
@@ -67,3 +68,12 @@ typedef BFD_HOST_64_BIT int64_type;
#endif
extern int getpagesize PARAMS ((void));
+
+/* No intl. */
+#define gettext(Msgid) (Msgid)
+#define dgettext(Domainname, Msgid) (Msgid)
+#define dcgettext(Domainname, Msgid, Category) (Msgid)
+#define textdomain(Domainname) while (0) /* nothing */
+#define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
+#define _(String) (String)
+#define N_(String) (String)
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index eb84d58..1707b06 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -1890,6 +1890,17 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_CRIS_32_GOTREL",
"BFD_RELOC_CRIS_32_PLT_GOTREL",
"BFD_RELOC_CRIS_32_PLT_PCREL",
+ "BFD_RELOC_CRIS_32_GOT_GD",
+ "BFD_RELOC_CRIS_16_GOT_GD",
+ "BFD_RELOC_CRIS_32_GD",
+ "BFD_RELOC_CRIS_DTP",
+ "BFD_RELOC_CRIS_32_DTPREL",
+ "BFD_RELOC_CRIS_16_DTPREL",
+ "BFD_RELOC_CRIS_32_GOT_TPREL",
+ "BFD_RELOC_CRIS_16_GOT_TPREL",
+ "BFD_RELOC_CRIS_32_TPREL",
+ "BFD_RELOC_CRIS_16_TPREL",
+ "BFD_RELOC_CRIS_DTPMOD",
"BFD_RELOC_860_COPY",
"BFD_RELOC_860_GLOB_DAT",
"BFD_RELOC_860_JUMP_SLOT",
diff --git a/bfd/linker.c b/bfd/linker.c
index baf280c..5080d7d 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -2796,18 +2796,36 @@ default_indirect_link_order (bfd *output_bfd,
}
}
- /* Get and relocate the section contents. */
- sec_size = (input_section->rawsize > input_section->size
- ? input_section->rawsize
- : input_section->size);
- contents = bfd_malloc (sec_size);
- if (contents == NULL && sec_size != 0)
- goto error_return;
- new_contents = (bfd_get_relocated_section_contents
- (output_bfd, info, link_order, contents, info->relocatable,
- _bfd_generic_link_get_symbols (input_bfd)));
- if (!new_contents)
- goto error_return;
+ if ((output_section->flags & (SEC_GROUP | SEC_LINKER_CREATED)) == SEC_GROUP
+ && input_section->size != 0)
+ {
+ /* Group section contents are set by bfd_elf_set_group_contents. */
+ if (!output_bfd->output_has_begun)
+ {
+ /* FIXME: This hack ensures bfd_elf_set_group_contents is called. */
+ if (!bfd_set_section_contents (output_bfd, output_section, "", 0, 1))
+ goto error_return;
+ }
+ new_contents = output_section->contents;
+ BFD_ASSERT (new_contents != NULL);
+ BFD_ASSERT (input_section->output_offset == 0);
+ }
+ else
+ {
+ /* Get and relocate the section contents. */
+ sec_size = (input_section->rawsize > input_section->size
+ ? input_section->rawsize
+ : input_section->size);
+ contents = bfd_malloc (sec_size);
+ if (contents == NULL && sec_size != 0)
+ goto error_return;
+ new_contents = (bfd_get_relocated_section_contents
+ (output_bfd, info, link_order, contents,
+ info->relocatable,
+ _bfd_generic_link_get_symbols (input_bfd)));
+ if (!new_contents)
+ goto error_return;
+ }
/* Output the section contents. */
loc = input_section->output_offset * bfd_octets_per_byte (output_bfd);
diff --git a/bfd/mach-o-target.c b/bfd/mach-o-target.c
index fd4d1e1..a435e6e 100644
--- a/bfd/mach-o-target.c
+++ b/bfd/mach-o-target.c
@@ -84,27 +84,31 @@ const bfd_target TARGET_NAME =
#else
_bfd_dummy_target,
bfd_mach_o_object_p,
- _bfd_dummy_target,
+ bfd_generic_archive_p,
bfd_mach_o_core_p
#endif
},
{ /* bfd_set_format. */
bfd_false,
bfd_mach_o_mkobject,
- bfd_false,
+ _bfd_generic_mkarchive,
bfd_mach_o_mkobject,
},
{ /* bfd_write_contents. */
bfd_false,
bfd_mach_o_write_contents,
- bfd_false,
+ _bfd_write_archive_contents,
bfd_mach_o_write_contents,
},
BFD_JUMP_TABLE_GENERIC (bfd_mach_o),
BFD_JUMP_TABLE_COPY (bfd_mach_o),
BFD_JUMP_TABLE_CORE (bfd_mach_o),
+#if TARGET_ARCHIVE
BFD_JUMP_TABLE_ARCHIVE (bfd_mach_o),
+#else
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd),
+#endif
BFD_JUMP_TABLE_SYMBOLS (bfd_mach_o),
BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
BFD_JUMP_TABLE_WRITE (bfd_mach_o),
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index d3d3abc..afad9fd 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -24,6 +24,7 @@
#include "bfd.h"
#include "libbfd.h"
#include "libiberty.h"
+#include "aout/stab_gnu.h"
#include <ctype.h>
#ifndef BFD_IO_FUNCS
@@ -64,7 +65,6 @@
#define bfd_mach_o_set_arch_mach bfd_default_set_arch_mach
#define bfd_mach_o_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
#define bfd_mach_o_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
-#define bfd_mach_o_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
#define bfd_mach_o_get_section_contents _bfd_generic_get_section_contents
#define bfd_mach_o_set_section_contents _bfd_generic_set_section_contents
#define bfd_mach_o_bfd_gc_sections bfd_generic_gc_sections
@@ -75,37 +75,6 @@
#define bfd_mach_o_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
#define bfd_mach_o_core_file_matches_executable_p generic_core_file_matches_executable_p
-
-/* The flags field of a section structure is separated into two parts a section
- type and section attributes. The section types are mutually exclusive (it
- can only have one type) but the section attributes are not (it may have more
- than one attribute). */
-
-#define SECTION_TYPE 0x000000ff /* 256 section types. */
-#define SECTION_ATTRIBUTES 0xffffff00 /* 24 section attributes. */
-
-/* Constants for the section attributes part of the flags field of a section
- structure. */
-
-#define SECTION_ATTRIBUTES_USR 0xff000000 /* User-settable attributes. */
-#define S_ATTR_PURE_INSTRUCTIONS 0x80000000 /* Section contains only true machine instructions. */
-#define SECTION_ATTRIBUTES_SYS 0x00ffff00 /* System setable attributes. */
-#define S_ATTR_SOME_INSTRUCTIONS 0x00000400 /* Section contains some machine instructions. */
-#define S_ATTR_EXT_RELOC 0x00000200 /* Section has external relocation entries. */
-#define S_ATTR_LOC_RELOC 0x00000100 /* Section has local relocation entries. */
-
-#define N_STAB 0xe0
-#define N_TYPE 0x1e
-#define N_EXT 0x01
-
-#define N_UNDF 0x0
-#define N_ABS 0x2
-#define N_TEXT 0x4
-#define N_DATA 0x6
-#define N_BSS 0x8
-#define N_SECT 0xe
-#define N_INDR 0xa
-
static unsigned int
bfd_mach_o_version (bfd *abfd)
{
@@ -255,6 +224,10 @@ bfd_mach_o_print_symbol (bfd *abfd,
bfd_print_symbol_type how)
{
FILE *file = (FILE *) afile;
+ unsigned char ntype;
+ unsigned char nsect;
+ unsigned int ndesc;
+ const char *name;
switch (how)
{
@@ -263,7 +236,40 @@ bfd_mach_o_print_symbol (bfd *abfd,
break;
default:
bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
- fprintf (file, " %-5s %s", symbol->section->name, symbol->name);
+ ntype = BFD_MACH_O_SYM_NTYPE (symbol);
+ nsect = BFD_MACH_O_SYM_NSECT (symbol);
+ ndesc = BFD_MACH_O_SYM_NDESC (symbol);
+ if (ntype & BFD_MACH_O_N_STAB)
+ name = bfd_get_stab_name (ntype);
+ else
+ switch (ntype & BFD_MACH_O_N_TYPE)
+ {
+ case BFD_MACH_O_N_UNDF:
+ name = "UND";
+ break;
+ case BFD_MACH_O_N_ABS:
+ name = "ABS";
+ break;
+ case BFD_MACH_O_N_INDR:
+ name = "INDR";
+ break;
+ case BFD_MACH_O_N_PBUD:
+ name = "PBUD";
+ break;
+ case BFD_MACH_O_N_SECT:
+ name = "SECT";
+ break;
+ default:
+ name = "???";
+ break;
+ }
+ if (name == NULL)
+ name = "";
+ fprintf (file, " %02x %-6s %02x %04x", ntype, name, nsect, ndesc);
+ if ((ntype & BFD_MACH_O_N_STAB) == 0
+ && (ntype & BFD_MACH_O_N_TYPE) == BFD_MACH_O_N_SECT)
+ fprintf (file, " %-5s", symbol->section->name);
+ fprintf (file, " %s", symbol->name);
}
}
@@ -554,9 +560,9 @@ bfd_mach_o_scan_write_symtab_symbols (bfd *abfd, bfd_mach_o_load_command *comman
s = &sym->symbols[i];
/* Instead just set from the stored values. */
- ntype = (s->udata.i >> 24) & 0xff;
- nsect = (s->udata.i >> 16) & 0xff;
- ndesc = s->udata.i & 0xffff;
+ ntype = BFD_MACH_O_SYM_NTYPE (s);
+ nsect = BFD_MACH_O_SYM_NSECT (s);
+ ndesc = BFD_MACH_O_SYM_NDESC (s);
bfd_h_put_32 (abfd, s->name - sym->strtab, buf);
bfd_h_put_8 (abfd, ntype, buf + 4);
@@ -769,7 +775,8 @@ bfd_mach_o_read_header (bfd *abfd, bfd_mach_o_header *header)
}
static asection *
-bfd_mach_o_make_bfd_section (bfd *abfd, bfd_mach_o_section *section)
+bfd_mach_o_make_bfd_section (bfd *abfd, bfd_mach_o_section *section,
+ unsigned long prot)
{
asection *bfdsec;
char *sname;
@@ -784,11 +791,31 @@ bfd_mach_o_make_bfd_section (bfd *abfd, bfd_mach_o_section *section)
sname = bfd_alloc (abfd, snamelen);
if (sname == NULL)
return NULL;
- sprintf (sname, "%s.%s.%s", prefix, section->segname, section->sectname);
- flags = SEC_ALLOC;
- if ((section->flags & SECTION_TYPE) != BFD_MACH_O_S_ZEROFILL)
- flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_CODE;
+ /* Use canonical dwarf section names for dwarf sections. */
+ if (strcmp (section->segname, "__DWARF") == 0
+ && strncmp (section->sectname, "__", 2) == 0)
+ sprintf (sname, ".%s", section->sectname + 2);
+ else
+ sprintf (sname, "%s.%s.%s", prefix, section->segname, section->sectname);
+
+ if (section->flags & BFD_MACH_O_S_ATTR_DEBUG)
+ flags = SEC_HAS_CONTENTS | SEC_DEBUGGING;
+ else
+ {
+ flags = SEC_ALLOC;
+ if ((section->flags & BFD_MACH_O_SECTION_TYPE_MASK)
+ != BFD_MACH_O_S_ZEROFILL)
+ {
+ flags |= SEC_HAS_CONTENTS | SEC_LOAD;
+ if (prot & BFD_MACH_O_PROT_EXECUTE)
+ flags |= SEC_CODE;
+ if (prot & BFD_MACH_O_PROT_WRITE)
+ flags |= SEC_DATA;
+ else if (prot & BFD_MACH_O_PROT_READ)
+ flags |= SEC_READONLY;
+ }
+ }
bfdsec = bfd_make_section_anyway_with_flags (abfd, sname, flags);
if (bfdsec == NULL)
return NULL;
@@ -806,7 +833,8 @@ bfd_mach_o_make_bfd_section (bfd *abfd, bfd_mach_o_section *section)
static int
bfd_mach_o_scan_read_section_32 (bfd *abfd,
bfd_mach_o_section *section,
- bfd_vma offset)
+ bfd_vma offset,
+ unsigned long prot)
{
unsigned char buf[68];
@@ -828,7 +856,7 @@ bfd_mach_o_scan_read_section_32 (bfd *abfd,
section->reserved1 = bfd_h_get_32 (abfd, buf + 60);
section->reserved2 = bfd_h_get_32 (abfd, buf + 64);
section->reserved3 = 0;
- section->bfdsection = bfd_mach_o_make_bfd_section (abfd, section);
+ section->bfdsection = bfd_mach_o_make_bfd_section (abfd, section, prot);
if (section->bfdsection == NULL)
return -1;
@@ -839,7 +867,8 @@ bfd_mach_o_scan_read_section_32 (bfd *abfd,
static int
bfd_mach_o_scan_read_section_64 (bfd *abfd,
bfd_mach_o_section *section,
- bfd_vma offset)
+ bfd_vma offset,
+ unsigned long prot)
{
unsigned char buf[80];
@@ -861,7 +890,7 @@ bfd_mach_o_scan_read_section_64 (bfd *abfd,
section->reserved1 = bfd_h_get_32 (abfd, buf + 68);
section->reserved2 = bfd_h_get_32 (abfd, buf + 72);
section->reserved3 = bfd_h_get_32 (abfd, buf + 76);
- section->bfdsection = bfd_mach_o_make_bfd_section (abfd, section);
+ section->bfdsection = bfd_mach_o_make_bfd_section (abfd, section, prot);
if (section->bfdsection == NULL)
return -1;
@@ -873,12 +902,13 @@ static int
bfd_mach_o_scan_read_section (bfd *abfd,
bfd_mach_o_section *section,
bfd_vma offset,
+ unsigned long prot,
unsigned int wide)
{
if (wide)
- return bfd_mach_o_scan_read_section_64 (abfd, section, offset);
+ return bfd_mach_o_scan_read_section_64 (abfd, section, offset, prot);
else
- return bfd_mach_o_scan_read_section_32 (abfd, section, offset);
+ return bfd_mach_o_scan_read_section_32 (abfd, section, offset, prot);
}
int
@@ -912,7 +942,7 @@ bfd_mach_o_scan_read_symtab_symbol (bfd *abfd,
stroff = bfd_h_get_32 (abfd, buf);
type = bfd_h_get_8 (abfd, buf + 4);
symtype = (type & 0x0e);
- section = bfd_h_get_8 (abfd, buf + 5) - 1;
+ section = bfd_h_get_8 (abfd, buf + 5);
desc = bfd_h_get_16 (abfd, buf + 6);
if (wide)
value = bfd_h_get_64 (abfd, buf + 8);
@@ -936,20 +966,35 @@ bfd_mach_o_scan_read_symtab_symbol (bfd *abfd,
{
s->flags |= BSF_DEBUGGING;
s->section = bfd_und_section_ptr;
+ switch (type)
+ {
+ case N_FUN:
+ case N_STSYM:
+ case N_LCSYM:
+ case N_BNSYM:
+ case N_SLINE:
+ case N_ENSYM:
+ case N_ECOMM:
+ case N_ECOML:
+ case N_GSYM:
+ if ((section > 0) && (section <= mdata->nsects))
+ {
+ s->section = mdata->sections[section - 1]->bfdsection;
+ s->value = s->value - mdata->sections[section - 1]->addr;
+ }
+ break;
+ }
}
else
{
if (type & BFD_MACH_O_N_PEXT)
- {
- type &= ~BFD_MACH_O_N_PEXT;
- s->flags |= BSF_GLOBAL;
- }
-
+ s->flags |= BSF_GLOBAL;
+
if (type & BFD_MACH_O_N_EXT)
- {
- type &= ~BFD_MACH_O_N_EXT;
- s->flags |= BSF_GLOBAL;
- }
+ s->flags |= BSF_GLOBAL;
+
+ if (!(type & (BFD_MACH_O_N_PEXT | BFD_MACH_O_N_EXT)))
+ s->flags |= BSF_LOCAL;
switch (symtype)
{
@@ -965,8 +1010,8 @@ bfd_mach_o_scan_read_symtab_symbol (bfd *abfd,
case BFD_MACH_O_N_SECT:
if ((section > 0) && (section <= mdata->nsects))
{
- s->section = mdata->sections[section]->bfdsection;
- s->value = s->value - mdata->sections[section]->addr;
+ s->section = mdata->sections[section - 1]->bfdsection;
+ s->value = s->value - mdata->sections[section - 1]->addr;
}
else
{
@@ -1094,18 +1139,19 @@ bfd_mach_o_i386_flavour_string (unsigned int flavour)
{
switch ((int) flavour)
{
- case BFD_MACH_O_i386_NEW_THREAD_STATE: return "i386_NEW_THREAD_STATE";
- case BFD_MACH_O_i386_FLOAT_STATE: return "i386_FLOAT_STATE";
- case BFD_MACH_O_i386_ISA_PORT_MAP_STATE: return "i386_ISA_PORT_MAP_STATE";
- case BFD_MACH_O_i386_V86_ASSIST_STATE: return "i386_V86_ASSIST_STATE";
- case BFD_MACH_O_i386_REGS_SEGS_STATE: return "i386_REGS_SEGS_STATE";
- case BFD_MACH_O_i386_THREAD_SYSCALL_STATE: return "i386_THREAD_SYSCALL_STATE";
- case BFD_MACH_O_i386_THREAD_STATE_NONE: return "i386_THREAD_STATE_NONE";
- case BFD_MACH_O_i386_SAVED_STATE: return "i386_SAVED_STATE";
- case BFD_MACH_O_i386_THREAD_STATE: return "i386_THREAD_STATE";
- case BFD_MACH_O_i386_THREAD_FPSTATE: return "i386_THREAD_FPSTATE";
- case BFD_MACH_O_i386_THREAD_EXCEPTSTATE: return "i386_THREAD_EXCEPTSTATE";
- case BFD_MACH_O_i386_THREAD_CTHREADSTATE: return "i386_THREAD_CTHREADSTATE";
+ case BFD_MACH_O_x86_THREAD_STATE32: return "x86_THREAD_STATE32";
+ case BFD_MACH_O_x86_FLOAT_STATE32: return "x86_FLOAT_STATE32";
+ case BFD_MACH_O_x86_EXCEPTION_STATE32: return "x86_EXCEPTION_STATE32";
+ case BFD_MACH_O_x86_THREAD_STATE64: return "x86_THREAD_STATE64";
+ case BFD_MACH_O_x86_FLOAT_STATE64: return "x86_FLOAT_STATE64";
+ case BFD_MACH_O_x86_EXCEPTION_STATE64: return "x86_EXCEPTION_STATE64";
+ case BFD_MACH_O_x86_THREAD_STATE: return "x86_THREAD_STATE";
+ case BFD_MACH_O_x86_FLOAT_STATE: return "x86_FLOAT_STATE";
+ case BFD_MACH_O_x86_EXCEPTION_STATE: return "x86_EXCEPTION_STATE";
+ case BFD_MACH_O_x86_DEBUG_STATE32: return "x86_DEBUG_STATE32";
+ case BFD_MACH_O_x86_DEBUG_STATE64: return "x86_DEBUG_STATE64";
+ case BFD_MACH_O_x86_DEBUG_STATE: return "x86_DEBUG_STATE";
+ case BFD_MACH_O_THREAD_STATE_NONE: return "THREAD_STATE_NONE";
default: return "UNKNOWN";
}
}
@@ -1422,6 +1468,9 @@ bfd_mach_o_scan_read_symtab (bfd *abfd, bfd_mach_o_load_command *command)
seg->stabs_segment = bfdsec;
+ if (seg->nsyms != 0)
+ abfd->flags |= HAS_SYMS;
+
prefix = "LC_SYMTAB.stabstr";
sname = bfd_alloc (abfd, strlen (prefix) + 1);
if (sname == NULL)
@@ -1444,6 +1493,40 @@ bfd_mach_o_scan_read_symtab (bfd *abfd, bfd_mach_o_load_command *command)
}
static int
+bfd_mach_o_scan_read_uuid (bfd *abfd, bfd_mach_o_load_command *command)
+{
+ bfd_mach_o_uuid_command *cmd = &command->command.uuid;
+ asection *bfdsec;
+ char *sname;
+ static const char prefix[] = "LC_UUID";
+
+ BFD_ASSERT (command->type == BFD_MACH_O_LC_UUID);
+
+ bfd_seek (abfd, command->offset + 8, SEEK_SET);
+ if (bfd_bread ((PTR) cmd->uuid, 16, abfd) != 16)
+ return -1;
+
+ sname = bfd_alloc (abfd, strlen (prefix) + 1);
+ if (sname == NULL)
+ return -1;
+ strcpy (sname, prefix);
+
+ bfdsec = bfd_make_section_anyway_with_flags (abfd, sname, SEC_HAS_CONTENTS);
+ if (bfdsec == NULL)
+ return -1;
+
+ bfdsec->vma = 0;
+ bfdsec->lma = 0;
+ bfdsec->size = command->len - 8;
+ bfdsec->filepos = command->offset + 8;
+ bfdsec->alignment_power = 0;
+
+ cmd->section = bfdsec;
+
+ return 0;
+}
+
+static int
bfd_mach_o_scan_read_segment (bfd *abfd,
bfd_mach_o_load_command *command,
unsigned int wide)
@@ -1465,6 +1548,7 @@ bfd_mach_o_scan_read_segment (bfd *abfd,
return -1;
memcpy (seg->segname, buf, 16);
+ seg->segname[16] = '\0';
seg->vmaddr = bfd_h_get_64 (abfd, buf + 16);
seg->vmsize = bfd_h_get_64 (abfd, buf + 24);
@@ -1484,6 +1568,7 @@ bfd_mach_o_scan_read_segment (bfd *abfd,
return -1;
memcpy (seg->segname, buf, 16);
+ seg->segname[16] = '\0';
seg->vmaddr = bfd_h_get_32 (abfd, buf + 16);
seg->vmsize = bfd_h_get_32 (abfd, buf + 20);
@@ -1510,7 +1595,7 @@ bfd_mach_o_scan_read_segment (bfd *abfd,
bfdsec->size = seg->filesize;
bfdsec->filepos = seg->fileoff;
bfdsec->alignment_power = 0x0;
- bfdsec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_CODE;
+ bfdsec->flags = SEC_HAS_CONTENTS;
bfdsec->segment_mark = 1;
seg->segment = bfdsec;
@@ -1530,7 +1615,7 @@ bfd_mach_o_scan_read_segment (bfd *abfd,
segoff = command->offset + 48 + 8 + (i * 68);
if (bfd_mach_o_scan_read_section
- (abfd, &seg->sections[i], segoff, wide) != 0)
+ (abfd, &seg->sections[i], segoff, seg->initprot, wide) != 0)
return -1;
}
}
@@ -1618,6 +1703,12 @@ bfd_mach_o_scan_read_command (bfd *abfd, bfd_mach_o_load_command *command)
case BFD_MACH_O_LC_TWOLEVEL_HINTS:
case BFD_MACH_O_LC_PREBIND_CKSUM:
break;
+ case BFD_MACH_O_LC_UUID:
+ if (bfd_mach_o_scan_read_uuid (abfd, command) != 0)
+ return -1;
+ break;
+ case BFD_MACH_O_LC_CODE_SIGNATURE:
+ break;
default:
fprintf (stderr, "unable to read unknown load command 0x%lx\n",
(unsigned long) command->type);
@@ -1634,6 +1725,7 @@ bfd_mach_o_flatten_sections (bfd *abfd)
long csect = 0;
unsigned long i, j;
+ /* Count total number of sections. */
mdata->nsects = 0;
for (i = 0; i < mdata->header.ncmds; i++)
@@ -1648,8 +1740,11 @@ bfd_mach_o_flatten_sections (bfd *abfd)
}
}
+ /* Allocate sections array. */
mdata->sections = bfd_alloc (abfd,
mdata->nsects * sizeof (bfd_mach_o_section *));
+
+ /* Fill the array. */
csect = 0;
for (i = 0; i < mdata->header.ncmds; i++)
@@ -1694,7 +1789,7 @@ bfd_mach_o_scan_start_address (bfd *abfd)
{
if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_I386)
&& (cmd->flavours[i].flavour
- == (unsigned long) BFD_MACH_O_i386_THREAD_STATE))
+ == (unsigned long) BFD_MACH_O_x86_THREAD_STATE32))
{
unsigned char buf[4];
@@ -1761,8 +1856,21 @@ bfd_mach_o_scan (bfd *abfd,
mdata->header = *header;
mdata->symbols = NULL;
- abfd->flags = (abfd->xvec->object_flags
- | (abfd->flags & (BFD_IN_MEMORY | BFD_IO_FUNCS)));
+ abfd->flags = abfd->flags & (BFD_IN_MEMORY | BFD_IO_FUNCS);
+ switch (header->filetype)
+ {
+ case BFD_MACH_O_MH_OBJECT:
+ abfd->flags |= HAS_RELOC;
+ break;
+ case BFD_MACH_O_MH_EXECUTE:
+ abfd->flags |= EXEC_P;
+ break;
+ case BFD_MACH_O_MH_DYLIB:
+ case BFD_MACH_O_MH_BUNDLE:
+ abfd->flags |= DYNAMIC;
+ break;
+ }
+
abfd->tdata.mach_o_data = mdata;
bfd_mach_o_convert_architecture (header->cputype, header->cpusubtype,
@@ -1938,7 +2046,6 @@ typedef struct mach_o_fat_archentry
unsigned long offset;
unsigned long size;
unsigned long align;
- bfd *abfd;
} mach_o_fat_archentry;
typedef struct mach_o_fat_data_struct
@@ -1984,7 +2091,6 @@ bfd_mach_o_archive_p (bfd *abfd)
adata->archentries[i].offset = bfd_getb32 (buf + 8);
adata->archentries[i].size = bfd_getb32 (buf + 12);
adata->archentries[i].align = bfd_getb32 (buf + 16);
- adata->archentries[i].abfd = NULL;
}
abfd->tdata.mach_o_fat_data = adata;
@@ -2003,6 +2109,11 @@ bfd_mach_o_openr_next_archived_file (bfd *archive, bfd *prev)
mach_o_fat_data_struct *adata;
mach_o_fat_archentry *entry = NULL;
unsigned long i;
+ bfd *nbfd;
+ const char *arch_name;
+ enum bfd_architecture arch_type;
+ unsigned long arch_subtype;
+ char *s = NULL;
adata = (mach_o_fat_data_struct *) archive->tdata.mach_o_fat_data;
BFD_ASSERT (adata != NULL);
@@ -2014,7 +2125,7 @@ bfd_mach_o_openr_next_archived_file (bfd *archive, bfd *prev)
{
for (i = 0; i < adata->nfat_arch; i++)
{
- if (adata->archentries[i].abfd == prev)
+ if (adata->archentries[i].offset == prev->origin)
break;
}
@@ -2034,25 +2145,23 @@ bfd_mach_o_openr_next_archived_file (bfd *archive, bfd *prev)
}
entry = &adata->archentries[i];
- if (entry->abfd == NULL)
- {
- bfd *nbfd = _bfd_new_bfd_contained_in (archive);
- char *s = NULL;
-
- if (nbfd == NULL)
- return NULL;
-
- nbfd->origin = entry->offset;
- s = bfd_malloc (strlen (archive->filename) + 1);
- if (s == NULL)
- return NULL;
- strcpy (s, archive->filename);
- nbfd->filename = s;
- nbfd->iostream = NULL;
- entry->abfd = nbfd;
- }
+ nbfd = _bfd_new_bfd_contained_in (archive);
+ if (nbfd == NULL)
+ return NULL;
+
+ nbfd->origin = entry->offset;
+
+ bfd_mach_o_convert_architecture (entry->cputype, entry->cpusubtype,
+ &arch_type, &arch_subtype);
+ arch_name = bfd_printable_arch_mach (arch_type, arch_subtype);
+ s = bfd_malloc (strlen (arch_name) + 1);
+ if (s == NULL)
+ return NULL;
+ strcpy (s, arch_name);
+ nbfd->filename = s;
+ nbfd->iostream = NULL;
- return entry->abfd;
+ return nbfd;
}
int
@@ -2161,6 +2270,147 @@ bfd_mach_o_stack_addr (enum bfd_mach_o_cpu_type type)
}
}
+static bfd_boolean
+bfd_mach_o_bfd_print_private_bfd_data (bfd *abfd, PTR ptr)
+{
+ bfd_mach_o_data_struct *mdata = abfd->tdata.mach_o_data;
+ FILE *file = (FILE *) ptr;
+ unsigned int i, j;
+ unsigned int sec_nbr = 0;
+
+ fprintf (file, _("Segments and Sections:\n"));
+ fprintf (file, _(" #: Segment name Section name Address\n"));
+
+ for (i = 0; i < mdata->header.ncmds; i++)
+ {
+ bfd_mach_o_segment_command *seg;
+
+ if (mdata->commands[i].type != BFD_MACH_O_LC_SEGMENT
+ && mdata->commands[i].type != BFD_MACH_O_LC_SEGMENT_64)
+ continue;
+
+ seg = &mdata->commands[i].command.segment;
+
+ fprintf (file, "[Segment %-16s ", seg->segname);
+ fprintf_vma (file, seg->vmaddr);
+ fprintf (file, "-");
+ fprintf_vma (file, seg->vmaddr + seg->vmsize - 1);
+ fputc (' ', file);
+ fputc (seg->initprot & BFD_MACH_O_PROT_READ ? 'r' : '-', file);
+ fputc (seg->initprot & BFD_MACH_O_PROT_WRITE ? 'w' : '-', file);
+ fputc (seg->initprot & BFD_MACH_O_PROT_EXECUTE ? 'x' : '-', file);
+ fprintf (file, "]\n");
+ for (j = 0; j < seg->nsects; j++)
+ {
+ bfd_mach_o_section *sec = &seg->sections[j];
+ fprintf (file, "%02u: %-16s %-16s ", ++sec_nbr,
+ sec->segname, sec->sectname);
+ fprintf_vma (file, sec->addr);
+ fprintf (file, " ");
+ fprintf_vma (file, sec->size);
+ fprintf (file, " %08lx\n", sec->flags);
+ }
+ }
+
+ for (i = 0; i < mdata->header.ncmds; i++)
+ {
+ bfd_mach_o_load_command *cmd = &mdata->commands[i];
+
+ switch (cmd->type)
+ {
+ case BFD_MACH_O_LC_SEGMENT:
+ case BFD_MACH_O_LC_SEGMENT_64:
+ break;
+ case BFD_MACH_O_LC_UUID:
+ {
+ bfd_mach_o_uuid_command *uuid = &cmd->command.uuid;
+ unsigned int i;
+
+ fprintf (file, "\n"
+ "UUID:");
+ for (i = 0; i < sizeof (uuid->uuid); i++)
+ fprintf (file, " %02x", uuid->uuid[i]);
+ fputc ('\n', file);
+ }
+ break;
+ case BFD_MACH_O_LC_LOAD_DYLIB:
+ {
+ bfd_mach_o_dylib_command *dylib = &cmd->command.dylib;
+ bfd_byte *data = NULL;
+
+ if (! bfd_malloc_and_get_section (abfd, dylib->section, &data))
+ {
+ if (data != NULL)
+ free (data);
+ break;
+ }
+ fprintf (file, "\n"
+ "LOAD_DYLIB: %s\n",
+ data + dylib->name_offset - cmd->offset - 8);
+ fprintf (file, " time stamp: 0x%08lx\n",
+ dylib->timestamp);
+ fprintf (file, " current version: 0x%08lx\n",
+ dylib->current_version);
+ fprintf (file, " comptibility version: 0x%08lx\n",
+ dylib->compatibility_version);
+ free (data);
+ break;
+ }
+ case BFD_MACH_O_LC_LOAD_DYLINKER:
+ {
+ bfd_mach_o_dylinker_command *linker = &cmd->command.dylinker;
+ bfd_byte *data = NULL;
+
+ if (! bfd_malloc_and_get_section (abfd, linker->section, &data))
+ {
+ if (data != NULL)
+ free (data);
+ break;
+ }
+ fprintf (file, "\n"
+ "LOAD_DYLINKER: %s\n",
+ data + linker->name_offset - cmd->offset - 8);
+ free (data);
+ break;
+ }
+ case BFD_MACH_O_LC_SYMTAB:
+ {
+ bfd_mach_o_symtab_command *symtab = &cmd->command.symtab;
+ fprintf (file, "\n"
+ "LC_SYMTAB: nsyms: %lu, strsize: %lu\n",
+ symtab->nsyms, symtab->strsize);
+ break;
+ }
+ case BFD_MACH_O_LC_DYSYMTAB:
+ {
+ bfd_mach_o_dysymtab_command *dysymtab = &cmd->command.dysymtab;
+ fprintf (file, "\n"
+ "LC_DYSYMTAB:\n"
+ " local symbols: index: %lu number: %lu\n",
+ dysymtab->ilocalsym, dysymtab->nlocalsym);
+ fprintf (file,
+ " external symbols: index: %lu number: %lu\n",
+ dysymtab->iextdefsym, dysymtab->nextdefsym);
+ fprintf (file,
+ " undefined symbols: index: %lu number: %lu\n",
+ dysymtab->iundefsym, dysymtab->nundefsym);
+ fprintf (file,
+ " ntoc: offset: %lu number: %lu\n",
+ dysymtab->tocoff, dysymtab->ntoc);
+ fprintf (file,
+ " module table: offset: %lu number: %lu\n",
+ dysymtab->modtaboff, dysymtab->nmodtab);
+ break;
+ }
+ default:
+ fprintf (file, "LC_%d\n", cmd->type);
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
int
bfd_mach_o_core_fetch_environment (bfd *abfd,
unsigned char **rbuf,
diff --git a/bfd/mach-o.h b/bfd/mach-o.h
index d73f205..8ffb1b2 100644
--- a/bfd/mach-o.h
+++ b/bfd/mach-o.h
@@ -30,9 +30,15 @@
#define BFD_MACH_O_N_EXT 0x01 /* External symbol bit, set for external symbols. */
#define BFD_MACH_O_N_UNDF 0x00 /* Undefined, n_sect == NO_SECT. */
#define BFD_MACH_O_N_ABS 0x02 /* Absolute, n_sect == NO_SECT. */
-#define BFD_MACH_O_N_SECT 0x0e /* Defined in section number n_sect. */
-#define BFD_MACH_O_N_PBUD 0x0c /* Prebound undefined (defined in a dylib). */
#define BFD_MACH_O_N_INDR 0x0a /* Indirect. */
+#define BFD_MACH_O_N_PBUD 0x0c /* Prebound undefined (defined in a dylib). */
+#define BFD_MACH_O_N_SECT 0x0e /* Defined in section number n_sect. */
+
+#define BFD_MACH_O_NO_SECT 0
+
+#define BFD_MACH_O_SYM_NTYPE(SYM) (((SYM)->udata.i >> 24) & 0xff)
+#define BFD_MACH_O_SYM_NSECT(SYM) (((SYM)->udata.i >> 16) & 0xff)
+#define BFD_MACH_O_SYM_NDESC(SYM) ((SYM)->udata.i & 0xffff)
typedef enum bfd_mach_o_ppc_thread_flavour
{
@@ -44,26 +50,22 @@ typedef enum bfd_mach_o_ppc_thread_flavour
}
bfd_mach_o_ppc_thread_flavour;
+/* Defined in <mach/i386/thread_status.h> */
typedef enum bfd_mach_o_i386_thread_flavour
{
- BFD_MACH_O_i386_NEW_THREAD_STATE = 1,
- BFD_MACH_O_i386_FLOAT_STATE = 2,
- BFD_MACH_O_i386_ISA_PORT_MAP_STATE = 3,
- BFD_MACH_O_i386_V86_ASSIST_STATE = 4,
- BFD_MACH_O_i386_REGS_SEGS_STATE = 5,
- BFD_MACH_O_i386_THREAD_SYSCALL_STATE = 6,
- BFD_MACH_O_i386_SAVED_STATE = 8,
- BFD_MACH_O_i386_THREAD_STATE = -1,
- BFD_MACH_O_i386_THREAD_FPSTATE = -2,
- BFD_MACH_O_i386_THREAD_EXCEPTSTATE = -3,
- BFD_MACH_O_i386_THREAD_CTHREADSTATE = -4,
+ BFD_MACH_O_x86_THREAD_STATE32 = 1,
+ BFD_MACH_O_x86_FLOAT_STATE32 = 2,
+ BFD_MACH_O_x86_EXCEPTION_STATE32 = 3,
BFD_MACH_O_x86_THREAD_STATE64 = 4,
BFD_MACH_O_x86_FLOAT_STATE64 = 5,
BFD_MACH_O_x86_EXCEPTION_STATE64 = 6,
BFD_MACH_O_x86_THREAD_STATE = 7,
BFD_MACH_O_x86_FLOAT_STATE = 8,
BFD_MACH_O_x86_EXCEPTION_STATE = 9,
- BFD_MACH_O_i386_THREAD_STATE_NONE = 10,
+ BFD_MACH_O_x86_DEBUG_STATE32 = 10,
+ BFD_MACH_O_x86_DEBUG_STATE64 = 11,
+ BFD_MACH_O_x86_DEBUG_STATE = 12,
+ BFD_MACH_O_THREAD_STATE_NONE = 13
}
bfd_mach_o_i386_thread_flavour;
@@ -99,9 +101,11 @@ typedef enum bfd_mach_o_load_command_type
BFD_MACH_O_LC_LOAD_WEAK_DYLIB = 0x18,
BFD_MACH_O_LC_SEGMENT_64 = 0x19, /* 64-bit segment of this file to be
mapped. */
- BFD_MACH_O_LC_ROUTINES_64 = 0x1a, /* Address of the dyld init routine
- in a dylib. */
- BFD_MACH_O_LC_UUID = 0x1b /* 128-bit UUID of the executable. */
+ BFD_MACH_O_LC_ROUTINES_64 = 0x1a, /* Address of the dyld init routine
+ in a dylib. */
+ BFD_MACH_O_LC_UUID = 0x1b, /* 128-bit UUID of the executable. */
+ BFD_MACH_O_LC_RPATH = 0x1c, /* Run path addiions. */
+ BFD_MACH_O_LC_CODE_SIGNATURE = 0x1d /* Local of code signature. */
}
bfd_mach_o_load_command_type;
@@ -188,6 +192,35 @@ typedef enum bfd_mach_o_section_type
}
bfd_mach_o_section_type;
+/* The flags field of a section structure is separated into two parts a section
+ type and section attributes. The section types are mutually exclusive (it
+ can only have one type) but the section attributes are not (it may have more
+ than one attribute). */
+
+#define BFD_MACH_O_SECTION_TYPE_MASK 0x000000ff
+
+/* Constants for the section attributes part of the flags field of a section
+ structure. */
+#define BFD_MACH_O_SECTION_ATTRIBUTES_MASK 0xffffff00
+/* System setable attributes. */
+#define BFD_MACH_O_SECTION_ATTRIBUTES_SYS 0x00ffff00
+/* User attributes. */
+#define BFD_MACH_O_SECTION_ATTRIBUTES_USR 0xff000000
+
+/* Section has local relocation entries. */
+#define BFD_MACH_O_S_ATTR_LOC_RELOC 0x00000100
+
+/* Section has external relocation entries. */
+#define BFD_MACH_O_S_ATTR_EXT_RELOC 0x00000200
+
+/* Section contains some machine instructions. */
+#define BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS 0x00004000
+
+#define BFD_MACH_O_S_ATTR_DEBUG 0x02000000
+
+/* Section contains only true machine instructions. */
+#define BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS 0x80000000
+
typedef unsigned long bfd_mach_o_cpu_subtype;
typedef struct bfd_mach_o_header
@@ -226,13 +259,13 @@ bfd_mach_o_section;
typedef struct bfd_mach_o_segment_command
{
- char segname[16];
+ char segname[16 + 1];
bfd_vma vmaddr;
bfd_vma vmsize;
bfd_vma fileoff;
unsigned long filesize;
- unsigned long maxprot;
- unsigned long initprot;
+ unsigned long maxprot; /* Maximum permitted protection. */
+ unsigned long initprot; /* Initial protection. */
unsigned long nsects;
unsigned long flags;
bfd_mach_o_section *sections;
@@ -240,6 +273,11 @@ typedef struct bfd_mach_o_segment_command
}
bfd_mach_o_segment_command;
+/* Protection flags. */
+#define BFD_MACH_O_PROT_READ 0x01
+#define BFD_MACH_O_PROT_WRITE 0x02
+#define BFD_MACH_O_PROT_EXECUTE 0x04
+
typedef struct bfd_mach_o_symtab_command
{
unsigned long symoff;
@@ -399,8 +437,8 @@ bfd_mach_o_dysymtab_command;
removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the
symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that. */
-#define INDIRECT_SYMBOL_LOCAL 0x80000000
-#define INDIRECT_SYMBOL_ABS 0x40000000
+#define BFD_MACH_O_INDIRECT_SYMBOL_LOCAL 0x80000000
+#define BFD_MACH_O_INDIRECT_SYMBOL_ABS 0x40000000
typedef struct bfd_mach_o_thread_flavour
{
@@ -452,6 +490,15 @@ typedef struct bfd_mach_o_prebound_dylib_command
}
bfd_mach_o_prebound_dylib_command;
+typedef struct bfd_mach_o_uuid_command
+{
+ unsigned long cmd; /* LC_PREBOUND_DYLIB. */
+ unsigned long cmdsize; /* Includes uuid. */
+ unsigned char uuid[16]; /* Uuid. */
+ asection *section;
+}
+bfd_mach_o_uuid_command;
+
typedef struct bfd_mach_o_load_command
{
bfd_mach_o_load_command_type type;
@@ -467,6 +514,7 @@ typedef struct bfd_mach_o_load_command
bfd_mach_o_dylib_command dylib;
bfd_mach_o_dylinker_command dylinker;
bfd_mach_o_prebound_dylib_command prebound_dylib;
+ bfd_mach_o_uuid_command uuid;
}
command;
}
@@ -484,6 +532,8 @@ typedef struct mach_o_data_struct
}
mach_o_data_struct;
+#define bfd_get_mach_o_data(abfd) ((abfd)->tdata.mach_o_data)
+
typedef struct mach_o_data_struct bfd_mach_o_data_struct;
bfd_boolean bfd_mach_o_valid (bfd *);
diff --git a/bfd/makefile.vms b/bfd/makefile.vms
index ad6b1ff..963441a 100644
--- a/bfd/makefile.vms
+++ b/bfd/makefile.vms
@@ -18,11 +18,12 @@ TARGETOBJS = cpu-vax.obj
endif
-OBJS=archive.obj,archures.obj,bfd.obj,cache.obj,coffgen.obj,corefile.obj,\
- format.obj,init.obj,libbfd.obj,opncls.obj,reloc.obj,section.obj,syms.obj,\
- targets.obj,hash.obj,linker.obj,elf.obj,srec.obj,binary.obj,tekhex.obj,\
- ihex.obj,stab-syms.obj,vms.obj,vms-hdr.obj,vms-gsd.obj,vms-tir.obj,\
- vms-misc.obj,$(TARGETOBJS)
+OBJS=archive.obj,archive64.obj,archures.obj,bfd.obj,bfdio.obj,binary.obj,\
+ cache.obj,coffgen.obj,compress.obj,corefile.obj,dwarf2.obj,elf.obj,\
+ format.obj,hash.obj,ihex.obj,init.obj,libbfd.obj,linker.obj,opncls.obj,\
+ reloc.obj,section.obj,simple.obj,srec.obj,stab-syms.obj,syms.obj,\
+ targets.obj,tekhex.obj,\
+ vms.obj,vms-hdr.obj,vms-gsd.obj,vms-tir.obj,vms-misc.obj,$(TARGETOBJS)
ifeq ($(CC),gcc)
ifeq ($(ARCH),ALPHA)
@@ -30,18 +31,18 @@ DEFS=/define=(SELECT_VECS="&vms_alpha_vec",SELECT_ARCHITECTURES="&bfd_alpha_arch
"HAVE_vms_alpha_vec=1")
else
DEFS=/define=(SELECT_VECS="&vms_vax_vec",SELECT_ARCHITECTURES="&bfd_vax_arch",\
-"HAVE_vms_vax_vec=1","VMS_DEBUG")
+"HAVE_vms_vax_vec=1")
endif
CFLAGS=/include=([],[-.include])$(DEFS)
else
ifeq ($(ARCH),ALPHA)
DEFS=/define=(SELECT_VECS="&vms_alpha_vec",SELECT_ARCHITECTURES="&bfd_alpha_arch",\
-"HAVE_vms_alpha_vec=1","unlink=remove","const=","VMS_DEBUG",)
+"HAVE_vms_alpha_vec=1","unlink=remove","DEBUGDIR=NULL")
else
DEFS=/define=(SELECT_VECS="&vms_vax_vec",SELECT_ARCHITECTURES="&bfd_vax_arch",\
-"HAVE_vms_vax_vec=1","unlink=remove","const=","VMS_DEBUG")
+"HAVE_vms_vax_vec=1","unlink=remove","const=")
endif
-CFLAGS=/noopt/debug/include=([],[-.include])$(DEFS)/warnings=disable=(missingreturn,implicitfunc,longextern)
+CFLAGS=/noopt/debug/show=incl/name=(as_is,shortened)/include=([],[-.include])$(DEFS)/warnings=disable=(missingreturn,longextern)
endif
diff --git a/bfd/po/id.po b/bfd/po/id.po
new file mode 100644
index 0000000..31a7017
--- /dev/null
+++ b/bfd/po/id.po
@@ -0,0 +1,3837 @@
+# Pesan Bahasa Indonesia untuk BFD
+# Copyright (C) 2008 Free Software Foundation, Inc.
+# This file is distributed under the same license as the binutils package.
+# Arif E. Nugroho <arif_endro@yahoo.com>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: bfd 2.18.90\n"
+"Report-Msgid-Bugs-To: bug-binutils@gnu.org\n"
+"POT-Creation-Date: 2008-09-09 15:56+0930\n"
+"PO-Revision-Date: 2008-10-08 07:45+0700\n"
+"Last-Translator: Arif E. Nugroho <arif_endro@yahoo.com>\n"
+"Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: aout-adobe.c:127
+msgid "%B: Unknown section type in a.out.adobe file: %x\n"
+msgstr "%B: Tipe bagian tidak diketahui dalam berkas a.out.adobe: %x\n"
+
+#: aout-cris.c:204
+#, c-format
+msgid "%s: Invalid relocation type exported: %d"
+msgstr "%s: Tipe relokasi tidak valid terekspor: %d"
+
+#: aout-cris.c:247
+msgid "%B: Invalid relocation type imported: %d"
+msgstr "%B: Tipe relokasi tidak valid terimpor: %d"
+
+#: aout-cris.c:258
+msgid "%B: Bad relocation record imported: %d"
+msgstr "%B: Catatan relokasi buruk terimpor: %d"
+
+#: aoutx.h:1268 aoutx.h:1604
+#, c-format
+msgid "%s: can not represent section `%s' in a.out object file format"
+msgstr "%s: tidak dapat merepresentasikan bagian `%s' dalam a.out objek format berkas"
+
+#: aoutx.h:1570
+#, c-format
+msgid "%s: can not represent section for symbol `%s' in a.out object file format"
+msgstr "%s: tidak dapat merepresentasikan bagian untuk simbol `%s' dalam format berkas a.out objek"
+
+#: aoutx.h:1572
+msgid "*unknown*"
+msgstr "*tidak diketahui*"
+
+#: aoutx.h:3989 aoutx.h:4315
+msgid "%P: %B: unexpected relocation type\n"
+msgstr "%P: %B: tipe relokasi tidak diduga\n"
+
+#: aoutx.h:5349
+#, c-format
+msgid "%s: relocatable link from %s to %s not supported"
+msgstr "%s: link relokasi dari %s ke %s tidak didukung"
+
+#: archive.c:2046
+msgid "Warning: writing archive was slow: rewriting timestamp\n"
+msgstr "Peringatan: penulisan archive lambat: menulis ulang timestamp\n"
+
+#: archive.c:2309
+msgid "Reading archive file mod timestamp"
+msgstr "Membaca berkas mod timestamp archive"
+
+#: archive.c:2333
+msgid "Writing updated armap timestamp"
+msgstr "Menulis armap timestamp terupdate"
+
+#: bfd.c:368
+msgid "No error"
+msgstr "Tidak error"
+
+#: bfd.c:369
+msgid "System call error"
+msgstr "Pemanggilan sistem error"
+
+#: bfd.c:370
+msgid "Invalid bfd target"
+msgstr "Target bfd tidak valid"
+
+#: bfd.c:371
+msgid "File in wrong format"
+msgstr "Berkas dalam format salah"
+
+#: bfd.c:372
+msgid "Archive object file in wrong format"
+msgstr "Archive berkas objek dalam format salah"
+
+#: bfd.c:373
+msgid "Invalid operation"
+msgstr "Operasi tidak valid"
+
+#: bfd.c:374
+msgid "Memory exhausted"
+msgstr "Kehabisan memori"
+
+#: bfd.c:375
+msgid "No symbols"
+msgstr "Bukan simbol"
+
+#: bfd.c:376
+msgid "Archive has no index; run ranlib to add one"
+msgstr "Archive tidak memiliki indek; jalankan ranlib untuk menambahkan satu"
+
+#: bfd.c:377
+msgid "No more archived files"
+msgstr "Tidak lagi berkas yang ter-archive"
+
+#: bfd.c:378
+msgid "Malformed archive"
+msgstr "Archive tidak terformat"
+
+#: bfd.c:379
+msgid "File format not recognized"
+msgstr "Berkas format tidak dikenal"
+
+#: bfd.c:380
+msgid "File format is ambiguous"
+msgstr "Berkas format ambigu"
+
+#: bfd.c:381
+msgid "Section has no contents"
+msgstr "Bagian tidak memiliki isi"
+
+#: bfd.c:382
+msgid "Nonrepresentable section on output"
+msgstr "Bagian tidak dapat direpresentasikan di keluaran"
+
+#: bfd.c:383
+msgid "Symbol needs debug section which does not exist"
+msgstr "Simbol membutuhkan bagian debug yang mana bagian tersebut tidak ada"
+
+#: bfd.c:384
+msgid "Bad value"
+msgstr "Nilai buruk"
+
+#: bfd.c:385
+msgid "File truncated"
+msgstr "Berkas terpotong"
+
+#: bfd.c:386
+msgid "File too big"
+msgstr "Berkas terlalu besar"
+
+#: bfd.c:387
+#, c-format
+msgid "Error reading %s: %s"
+msgstr "Error membaca %s: %s"
+
+#: bfd.c:388
+msgid "#<Invalid error code>"
+msgstr "#<Kode error tidak valid>"
+
+#: bfd.c:912
+#, c-format
+msgid "BFD %s assertion fail %s:%d"
+msgstr "BFD %s assertion gagal %s:%d"
+
+#: bfd.c:924
+#, c-format
+msgid "BFD %s internal error, aborting at %s line %d in %s\n"
+msgstr "BFD %s error internal, menggagalkan di %s baris %d dalam %s\n"
+
+#: bfd.c:928
+#, c-format
+msgid "BFD %s internal error, aborting at %s line %d\n"
+msgstr "BFD %s error internal, menggagalkan di %s baris %d\n"
+
+#: bfd.c:930
+msgid "Please report this bug.\n"
+msgstr "Tolong laporkan bug ini.\n"
+
+#: bfdwin.c:208
+#, c-format
+msgid "not mapping: data=%lx mapped=%d\n"
+msgstr "tidak termap: data=%lx mapped=%d\n"
+
+#: bfdwin.c:211
+#, c-format
+msgid "not mapping: env var not set\n"
+msgstr "tidak termap; env var tidak terset\n"
+
+#: binary.c:284
+#, c-format
+msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx."
+msgstr "Peringatan: Menulis bagian `%s' terlalu besar (ie negatif) berkas ofset 0x%lx."
+
+#: cache.c:222
+msgid "reopening %B: %s\n"
+msgstr "membuka kembali %B: %s\n"
+
+#: coff-alpha.c:490
+msgid ""
+"%B: Cannot handle compressed Alpha binaries.\n"
+" Use compiler flags, or objZ, to generate uncompressed binaries."
+msgstr ""
+"%B: Tidak dapat menangani binari yang dikompres Alpha.\n"
+" Menggunakan tanda kompiler, atau objZ, untuk menghasilkan binari tidak terkompres."
+
+#: coff-alpha.c:647
+msgid "%B: unknown/unsupported relocation type %d"
+msgstr "%B; tidak diketahui/tidak didukung tipe relokasi %d"
+
+#: coff-alpha.c:899 coff-alpha.c:936 coff-alpha.c:2024 coff-mips.c:1003
+msgid "GP relative relocation used when GP not defined"
+msgstr "GP relatif relokasi digunakan ketika GP tidak didefinisikan"
+
+#: coff-alpha.c:1501
+msgid "using multiple gp values"
+msgstr "menggunakan nilai gp multiple"
+
+#: coff-alpha.c:1560
+msgid "%B: unsupported relocation: ALPHA_R_GPRELHIGH"
+msgstr "%B: relokasi tidak didukung: ALPHA_R_GPRELHIGH"
+
+#: coff-alpha.c:1567
+msgid "%B: unsupported relocation: ALPHA_R_GPRELLOW"
+msgstr "%B: relokasi tidak didukung: ALPHA_R_GPRELLOW"
+
+#: coff-alpha.c:1574 elf32-m32r.c:2487 elf64-alpha.c:3970 elf64-alpha.c:4125
+#: elf32-ia64.c:4465 elf64-ia64.c:4465
+msgid "%B: unknown relocation type %d"
+msgstr "%B: tipe relokasi %d tidak diketahui"
+
+#: coff-arm.c:1039
+#, c-format
+msgid "%B: unable to find THUMB glue '%s' for `%s'"
+msgstr "%B: tidak dapat menemukan lem THUMB '%s' untuk `%s'"
+
+#: coff-arm.c:1068
+#, c-format
+msgid "%B: unable to find ARM glue '%s' for `%s'"
+msgstr "%B: tidak dapat menemukan lem ARM '%s' untuk `%s'"
+
+#: coff-arm.c:1370 elf32-arm.c:5453
+#, c-format
+msgid ""
+"%B(%s): warning: interworking not enabled.\n"
+" first occurrence: %B: arm call to thumb"
+msgstr ""
+"%B(%s): peringatan: antar-kerja tidak diaktifkan.\n"
+" pertemuan pertama: %B: arm panggil ke thumb"
+
+#: coff-arm.c:1460
+#, c-format
+msgid ""
+"%B(%s): warning: interworking not enabled.\n"
+" first occurrence: %B: thumb call to arm\n"
+" consider relinking with --support-old-code enabled"
+msgstr ""
+"%B(%s): peringatan: antar-kerja tidak diaktifkan.\n"
+" pertemuan pertama: %B: panggilan thumb ke arm\n"
+" pertimbangkan relinking dengan --support-old-code aktif"
+
+#: coff-arm.c:1755 coff-tic80.c:695 cofflink.c:3018
+msgid "%B: bad reloc address 0x%lx in section `%A'"
+msgstr "%B: alamat relokasi buruk 0x%lx dalam bagian `%A'"
+
+#: coff-arm.c:2080
+msgid "%B: illegal symbol index in reloc: %d"
+msgstr "%B: indek simbol ilegal dalam relokasi: %d"
+
+#: coff-arm.c:2211
+#, c-format
+msgid "ERROR: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d"
+msgstr "ERROR: %B dikompile untuk APCS-%d, dimana %B dikompile untuk APCS-%d"
+
+#: coff-arm.c:2227 elf32-arm.c:8563
+#, c-format
+msgid "ERROR: %B passes floats in float registers, whereas %B passes them in integer registers"
+msgstr "ERROR: %B melewati float dalam register float, dimana %B melewatinya register integer"
+
+#: coff-arm.c:2230 elf32-arm.c:8567
+#, c-format
+msgid "ERROR: %B passes floats in integer registers, whereas %B passes them in float registers"
+msgstr "ERROR: %B melewati float dalam register integer, dimana %B melewatinya float register"
+
+#: coff-arm.c:2244
+#, c-format
+msgid "ERROR: %B is compiled as position independent code, whereas target %B is absolute position"
+msgstr "ERROR: %B dikompile sebagai kode bebas posisi, dimana target %B yang memiliki posisi absolute"
+
+#: coff-arm.c:2247
+#, c-format
+msgid "ERROR: %B is compiled as absolute position code, whereas target %B is position independent"
+msgstr "ERROR: %B dikompile sebagai kode absolute posisi, dimana target %B adalah bebas posisi"
+
+#: coff-arm.c:2275 elf32-arm.c:8632
+#, c-format
+msgid "Warning: %B supports interworking, whereas %B does not"
+msgstr "Peringatan: %B mendukung antar-kerja, dimana %B tidak"
+
+#: coff-arm.c:2278 elf32-arm.c:8638
+#, c-format
+msgid "Warning: %B does not support interworking, whereas %B does"
+msgstr "Peringatan: %B tidak mendukung antar-kerja, dimana %B ya"
+
+#: coff-arm.c:2302
+#, c-format
+msgid "private flags = %x:"
+msgstr "tanda private = %x:"
+
+#: coff-arm.c:2310 elf32-arm.c:8689
+#, c-format
+msgid " [floats passed in float registers]"
+msgstr " [floats melewati dalam register float]"
+
+#: coff-arm.c:2312
+#, c-format
+msgid " [floats passed in integer registers]"
+msgstr " [float melewati register integer]"
+
+#: coff-arm.c:2315 elf32-arm.c:8692
+#, c-format
+msgid " [position independent]"
+msgstr " [bebas posisi]"
+
+#: coff-arm.c:2317
+#, c-format
+msgid " [absolute position]"
+msgstr " [absolute posisi]"
+
+#: coff-arm.c:2321
+#, c-format
+msgid " [interworking flag not initialised]"
+msgstr " [tanda antar-kerja tidak terinisialisasi]"
+
+#: coff-arm.c:2323
+#, c-format
+msgid " [interworking supported]"
+msgstr " [antar-kerja didukung]"
+
+#: coff-arm.c:2325
+#, c-format
+msgid " [interworking not supported]"
+msgstr " [antar-kerja tidak didukung]"
+
+#: coff-arm.c:2371 elf32-arm.c:8050
+#, c-format
+msgid "Warning: Not setting interworking flag of %B since it has already been specified as non-interworking"
+msgstr "Peringatan: Tidak menset tanda antar-kerja dari %B karena itu telah terspesifikasi sebagai bukan-antar-kerja"
+
+#: coff-arm.c:2375 elf32-arm.c:8054
+#, c-format
+msgid "Warning: Clearing the interworking flag of %B due to outside request"
+msgstr "Peringatan: Menghapus tanda antar-kerja dari %B karena diluar permintaan"
+
+#: coff-h8300.c:1122
+#, c-format
+msgid "cannot handle R_MEM_INDIRECT reloc when using %s output"
+msgstr "tidak dapat menangani R_MEM_INDIRECT relokasi ketika menggunakan keluaran %s"
+
+#: coff-i860.c:147
+#, c-format
+msgid "Relocation `%s' not yet implemented\n"
+msgstr "Relokasi `%s' belum terimplementasi\n"
+
+#: coff-i860.c:605 coff-tic54x.c:398 coffcode.h:4975
+msgid "%B: warning: illegal symbol index %ld in relocs"
+msgstr "%B: peringatan: indek simbol ilegal %ld dalam relokasi"
+
+#: coff-i960.c:143 coff-i960.c:506
+msgid "uncertain calling convention for non-COFF symbol"
+msgstr "tidak tentu pemanggilan konvensi untuk non-COFF simbol"
+
+#: coff-m68k.c:506 elf32-bfin.c:5510 elf32-m68k.c:3938
+msgid "unsupported reloc type"
+msgstr "tipe relokasi tidak didukung"
+
+#: coff-maxq.c:126
+msgid "Can't Make it a Short Jump"
+msgstr "Tidak dapat membuka ini sebuah lompatan pendek"
+
+#: coff-maxq.c:191
+msgid "Exceeds Long Jump Range"
+msgstr "Melewati jangkauan lompatan panjang"
+
+#: coff-maxq.c:202 coff-maxq.c:276
+msgid "Absolute address Exceeds 16 bit Range"
+msgstr "Alamat absolut melewati jangkauan 16 bit"
+
+#: coff-maxq.c:240
+msgid "Absolute address Exceeds 8 bit Range"
+msgstr "Alamat absolute melewati jangkauan 8 bit"
+
+#: coff-maxq.c:333
+msgid "Unrecognized Reloc Type"
+msgstr "Tipe relokasi tidak dikenal"
+
+#: coff-mips.c:688 elf32-mips.c:1014 elf32-score.c:345 elf64-mips.c:1991
+#: elfn32-mips.c:1832
+msgid "GP relative relocation when _gp not defined"
+msgstr "GP relokasi relatif ketika _gp tidak terdefinisi"
+
+#: coff-or32.c:229
+msgid "Unrecognized reloc"
+msgstr "Relokasi tidak dikenal"
+
+#: coff-rs6000.c:2803
+#, c-format
+msgid "%s: unsupported relocation type 0x%02x"
+msgstr "%s: tipe relokasi tidak didukung 0x%02x"
+
+#: coff-rs6000.c:2896
+#, c-format
+msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"
+msgstr "%s: TOC relokasi di 0x%x untuk simbol `%s' dengan tidak ada masukan TOC"
+
+#: coff-rs6000.c:3628 coff64-rs6000.c:2130
+msgid "%B: symbol `%s' has unrecognized smclas %d"
+msgstr "%B: simbol `%s' memiliki smclas tidak dikenal %d"
+
+#: coff-tic4x.c:195 coff-tic54x.c:299 coff-tic80.c:458
+#, c-format
+msgid "Unrecognized reloc type 0x%x"
+msgstr "Tipe relokasi tidak dikenal 0x%x"
+
+#: coff-tic4x.c:240
+#, c-format
+msgid "%s: warning: illegal symbol index %ld in relocs"
+msgstr "%s: peringatan: indek simbol ilegal %ld dalam relokasi"
+
+#: coff-w65.c:367
+#, c-format
+msgid "ignoring reloc %s\n"
+msgstr "mengabaikan relokasi %s\n"
+
+#: coffcode.h:850
+msgid "%B: warning: COMDAT symbol '%s' does not match section name '%s'"
+msgstr "%B: peringatan: COMDAT simbol '%s' tidak cocok dengan nama bagian '%s'"
+
+#. Generate a warning message rather using the 'unhandled'
+#. variable as this will allow some .sys files generate by
+#. other toolchains to be processed. See bugzilla issue 196.
+#: coffcode.h:1062
+msgid "%B: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"
+msgstr "%B: Peringatan: Mengabaikan tanda bagian IMAGE_SCN_MEM_NOT_PAGED dalam bagian %s"
+
+#: coffcode.h:1117
+msgid "%B (%s): Section flag %s (0x%x) ignored"
+msgstr "%B (%s): Tanda bagian %s (0x%x) diabaikan"
+
+#: coffcode.h:2244
+#, c-format
+msgid "Unrecognized TI COFF target id '0x%x'"
+msgstr "Target id '0x%x' TI COFF tidak dikenal"
+
+#: coffcode.h:2559
+msgid "%B: reloc against a non-existant symbol index: %ld"
+msgstr "%B: relokasi terhadap simbol indek yang tidak ada: %ld"
+
+#: coffcode.h:4309
+msgid "%B: warning: line number table read failed"
+msgstr "%B: peringatan: pembacaan tabel nomor baris gagal"
+
+#: coffcode.h:4339
+msgid "%B: warning: illegal symbol index %ld in line numbers"
+msgstr "%B: peringatan: simbol index %ld ilegal dalam nomor baris"
+
+#: coffcode.h:4353
+msgid "%B: warning: duplicate line number information for `%s'"
+msgstr "%B: peringatan: duplikasi informasi nomor baris untuk `%s'"
+
+#: coffcode.h:4744
+msgid "%B: Unrecognized storage class %d for %s symbol `%s'"
+msgstr "%B: kelas %d penyimpanan tidak dikenal untuk %s simbol `%s'"
+
+#: coffcode.h:4870
+msgid "warning: %B: local symbol `%s' has no section"
+msgstr "peringatan: %B: simbol lokal `%s' tidak memiliki bagian"
+
+#: coffcode.h:5013
+msgid "%B: illegal relocation type %d at address 0x%lx"
+msgstr "%B: tipe relokasi %d ilegal di alamat 0x%lx"
+
+#: coffgen.c:1518
+msgid "%B: bad string table size %lu"
+msgstr "%B: string buruk ukuran tabel %lu"
+
+#: cofflink.c:513 elflink.c:4218
+msgid "Warning: type of symbol `%s' changed from %d to %d in %B"
+msgstr "Peringatan: tipe dari simbole `%s' berubah dari %d ke %d dalam %B"
+
+#: cofflink.c:2296
+msgid "%B: relocs in section `%A', but it has no contents"
+msgstr "%B: relokasi dalam bagian `%A', tetapi ini tidak memiliki isi"
+
+#: cofflink.c:2627 coffswap.h:824
+#, c-format
+msgid "%s: %s: reloc overflow: 0x%lx > 0xffff"
+msgstr "%s: %s: relokasi overflow: 0x%lx > 0xffff"
+
+#: cofflink.c:2636 coffswap.h:810
+#, c-format
+msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff"
+msgstr "%s: peringatan: %s: nomor baris overflow: 0x%lx > 0xffff"
+
+#: cpu-arm.c:189 cpu-arm.c:200
+msgid "ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"
+msgstr "ERROR: %B dikompile untuk EP9312, dimana %B dikompile untuk XScale"
+
+#: cpu-arm.c:332
+#, c-format
+msgid "warning: unable to update contents of %s section in %s"
+msgstr "peringatan: tidak dapat mengupdate isi dari %s bagian dalam %s"
+
+#: dwarf2.c:424
+#, c-format
+msgid "Dwarf Error: Can't find %s section."
+msgstr "Dwarf Error: Tidak dapat menemukan bagian %s."
+
+#: dwarf2.c:452
+#, c-format
+msgid "Dwarf Error: unable to decompress %s section."
+msgstr "Dwarf Error: tidak dapat mengekstrak bagian %s."
+
+#: dwarf2.c:462
+#, c-format
+msgid "Dwarf Error: Offset (%lu) greater than or equal to %s size (%lu)."
+msgstr "Dwarf Error: Ofset (%lu) lebih besar atau sama dengan %s ukuran (%lu)."
+
+#: dwarf2.c:849
+#, c-format
+msgid "Dwarf Error: Invalid or unhandled FORM value: %u."
+msgstr "Dwarf Error: Tidak valid atau nilai FORM tidak tertangani: %u."
+
+#: dwarf2.c:1063
+msgid "Dwarf Error: mangled line number section (bad file number)."
+msgstr "Dwarf Error: mangled bagian nomor baris (nomor berkas buruk)."
+
+#: dwarf2.c:1393
+msgid "Dwarf Error: mangled line number section."
+msgstr "Dwarf Error: mangled bagian nomor baris."
+
+#: dwarf2.c:1726 dwarf2.c:1842 dwarf2.c:2114
+#, c-format
+msgid "Dwarf Error: Could not find abbrev number %u."
+msgstr "Dwarf Error: Tidak dapat menemukan nomor singkat %u."
+
+#: dwarf2.c:2075
+#, c-format
+msgid "Dwarf Error: found dwarf version '%u', this reader only handles version 2 information."
+msgstr "Dwarf Error: menemukan versi dwarf '%u', pembaca ini hanya menangani informasi versi 2."
+
+#: dwarf2.c:2082
+#, c-format
+msgid "Dwarf Error: found address size '%u', this reader can not handle sizes greater than '%u'."
+msgstr "Dwarf Error: menemukan ukuran alamat '%u', pembaca ini tidak dapat menangani ukuran lebih besar dari '%u'."
+
+#: dwarf2.c:2105
+#, c-format
+msgid "Dwarf Error: Bad abbrev number: %u."
+msgstr "Dwarf Error: Nomor singkat buruk: %u."
+
+#: ecoff.c:1227
+#, c-format
+msgid "Unknown basic type %d"
+msgstr "Tipe dasar %d tidak diketahui"
+
+#: ecoff.c:1484
+#, c-format
+msgid ""
+"\n"
+" End+1 symbol: %ld"
+msgstr ""
+"\n"
+" Simbol End+1: %ld"
+
+#: ecoff.c:1491 ecoff.c:1494
+#, c-format
+msgid ""
+"\n"
+" First symbol: %ld"
+msgstr ""
+"\n"
+" Simbol pertama: %ld"
+
+#: ecoff.c:1506
+#, c-format
+msgid ""
+"\n"
+" End+1 symbol: %-7ld Type: %s"
+msgstr ""
+"\n"
+" Simbol End+1: %-7ld Tipe: %s"
+
+#: ecoff.c:1513
+#, c-format
+msgid ""
+"\n"
+" Local symbol: %ld"
+msgstr ""
+"\n"
+" Simbol lokal: %ld"
+
+#: ecoff.c:1521
+#, c-format
+msgid ""
+"\n"
+" struct; End+1 symbol: %ld"
+msgstr ""
+"\n"
+" struct; simbol End+1: %ld"
+
+#: ecoff.c:1526
+#, c-format
+msgid ""
+"\n"
+" union; End+1 symbol: %ld"
+msgstr ""
+"\n"
+" union: End+1 simbol: %ld"
+
+#: ecoff.c:1531
+#, c-format
+msgid ""
+"\n"
+" enum; End+1 symbol: %ld"
+msgstr ""
+"\n"
+" enum; End+1 simbol: %ld"
+
+#: ecoff.c:1537
+#, c-format
+msgid ""
+"\n"
+" Type: %s"
+msgstr ""
+"\n"
+" Tipe: %s"
+
+#: elf-attrs.c:582
+msgid "ERROR: %B: Must be processed by '%s' toolchain"
+msgstr "ERROR: %B: Harus diproses dengan '%s' toolchain"
+
+#: elf-attrs.c:602 elf-attrs.c:621
+msgid "ERROR: %B: Incompatible object tag '%s':%d"
+msgstr "ERROR: %B: Tanda objek tidak kompatibel '%s':%d"
+
+#: elf-eh-frame.c:866
+msgid "%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"
+msgstr "%P: error dalam %B(%A); tidak ada .eh_frame_hdr tabel yang akan dibuat.\n"
+
+#: elf-eh-frame.c:1102
+msgid "%P: fde encoding in %B(%A) prevents .eh_frame_hdr table being created.\n"
+msgstr "%P: fde enkoding dalam %B(%A) menjaga .eh_frame_hdr tabel untuk dibuat.\n"
+
+#: elf-hppa.h:2241 elf-m10300.c:1546 elf32-arm.c:7954 elf32-i386.c:3582
+#: elf32-m32r.c:2598 elf32-m68k.c:3516 elf32-ppc.c:7223 elf32-s390.c:3058
+#: elf32-sh.c:3438 elf32-xtensa.c:3021 elf64-ppc.c:11528 elf64-s390.c:3019
+#: elf64-sh64.c:1648 elf64-x86-64.c:3239 elfxx-sparc.c:3336
+msgid "%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"
+msgstr "%B(%A+0x%lx): tidak teresolf %s relokasi terhadap simbol `%s'"
+
+#: elf-hppa.h:2266 elf-hppa.h:2280
+msgid "%B(%A): warning: unresolvable relocation against symbol `%s'"
+msgstr "%B(%A): peringatan: tidak teresolf relokasi terhadap simbol `%s'"
+
+#: elf-m10200.c:456 elf-m10300.c:1609 elf32-avr.c:1250 elf32-bfin.c:3214
+#: elf32-cr16.c:959 elf32-cr16c.c:790 elf32-cris.c:1538 elf32-crx.c:933
+#: elf32-d10v.c:516 elf32-fr30.c:616 elf32-frv.c:4114 elf32-h8300.c:516
+#: elf32-i860.c:1218 elf32-ip2k.c:1499 elf32-iq2000.c:691 elf32-m32c.c:560
+#: elf32-m32r.c:3124 elf32-m68hc1x.c:1135 elf32-mep.c:541 elf32-msp430.c:493
+#: elf32-mt.c:402 elf32-openrisc.c:411 elf32-score.c:2451 elf32-spu.c:4132
+#: elf32-v850.c:1703 elf32-xstormy16.c:948 elf64-mmix.c:1533
+msgid "internal error: out of range error"
+msgstr "internal error: diluar jangkauan error"
+
+#: elf-m10200.c:460 elf-m10300.c:1613 elf32-avr.c:1254 elf32-bfin.c:3218
+#: elf32-cr16.c:963 elf32-cr16c.c:794 elf32-cris.c:1542 elf32-crx.c:937
+#: elf32-d10v.c:520 elf32-fr30.c:620 elf32-frv.c:4118 elf32-h8300.c:520
+#: elf32-i860.c:1222 elf32-iq2000.c:695 elf32-m32c.c:564 elf32-m32r.c:3128
+#: elf32-m68hc1x.c:1139 elf32-mep.c:545 elf32-msp430.c:497
+#: elf32-openrisc.c:415 elf32-score.c:2455 elf32-spu.c:4136 elf32-v850.c:1707
+#: elf32-xstormy16.c:952 elf64-mmix.c:1537 elfxx-mips.c:9065
+msgid "internal error: unsupported relocation error"
+msgstr "internal error: relokasi tidak didukung error"
+
+#: elf-m10200.c:464 elf32-cr16.c:967 elf32-cr16c.c:798 elf32-crx.c:941
+#: elf32-d10v.c:524 elf32-h8300.c:524 elf32-m32r.c:3132 elf32-m68hc1x.c:1143
+#: elf32-score.c:2459 elf32-spu.c:4140
+msgid "internal error: dangerous error"
+msgstr "internal error error berbahaya"
+
+#: elf-m10200.c:468 elf-m10300.c:1626 elf32-avr.c:1262 elf32-bfin.c:3226
+#: elf32-cr16.c:971 elf32-cr16c.c:802 elf32-cris.c:1550 elf32-crx.c:945
+#: elf32-d10v.c:528 elf32-fr30.c:628 elf32-frv.c:4126 elf32-h8300.c:528
+#: elf32-i860.c:1230 elf32-ip2k.c:1514 elf32-iq2000.c:703 elf32-m32c.c:572
+#: elf32-m32r.c:3136 elf32-m68hc1x.c:1147 elf32-mep.c:553 elf32-msp430.c:505
+#: elf32-mt.c:410 elf32-openrisc.c:423 elf32-score.c:2463 elf32-spu.c:4144
+#: elf32-v850.c:1727 elf32-xstormy16.c:960 elf64-mmix.c:1545
+msgid "internal error: unknown error"
+msgstr "internal error: error tidak diketahui"
+
+#: elf-m10300.c:1618
+msgid "error: inappropriate relocation type for shared library (did you forget -fpic?)"
+msgstr "error: tipe relokasi tidak sesuai untuk shared library (apakah anda lupa -fpic?)"
+
+#: elf-m10300.c:1621
+msgid "internal error: suspicious relocation type used in shared library"
+msgstr "internal erro: suspicious tipe relokasi digunakan dalam shared library"
+
+#: elf-m10300.c:4397 elf32-arm.c:9578 elf32-cris.c:2403 elf32-hppa.c:1921
+#: elf32-i370.c:506 elf32-i386.c:1807 elf32-m32r.c:1931 elf32-m68k.c:2787
+#: elf32-ppc.c:4693 elf32-s390.c:1687 elf32-sh.c:2583 elf32-vax.c:1055
+#: elf64-ppc.c:6075 elf64-s390.c:1662 elf64-sh64.c:3432 elf64-x86-64.c:1641
+#: elfxx-sparc.c:1828
+#, c-format
+msgid "dynamic variable `%s' is zero size"
+msgstr "variabel dinamik `%s' memiliki ukuran nol"
+
+#: elf.c:328
+msgid "%B: invalid string offset %u >= %lu for section `%s'"
+msgstr "%B: string ofset tidak valid %u >= %lu untuk bagian `%s'"
+
+#: elf.c:438
+msgid "%B symbol number %lu references nonexistent SHT_SYMTAB_SHNDX section"
+msgstr "%B nomor simbol %lu referensi tidak ada SHT_SYMTAB_SHNDX bagian"
+
+#: elf.c:594
+msgid "%B: Corrupt size field in group section header: 0x%lx"
+msgstr "%B: Ukuran bagian korup dalam grup bagian kepala: 0x%lx"
+
+#: elf.c:630
+msgid "%B: invalid SHT_GROUP entry"
+msgstr "%B: masukan SHT_GROUP tidak valid"
+
+#: elf.c:700
+msgid "%B: no group info for section %A"
+msgstr "%B: tidak ada informasi grup untuk bagian %A"
+
+#: elf.c:729 elf.c:2976 elflink.c:9746
+msgid "%B: warning: sh_link not set for section `%A'"
+msgstr "%B: peringatan: sh_link tidak diset untuk bagian `%A'"
+
+#: elf.c:748
+msgid "%B: sh_link [%d] in section `%A' is incorrect"
+msgstr "%B: sh_link [%ld] dalam bagian `%A' tidak benar"
+
+#: elf.c:783
+msgid "%B: unknown [%d] section `%s' in group [%s]"
+msgstr "%B: tidak diketahui [%d] bagian `%s' dalam grup [%s]"
+
+#: elf.c:1159
+#, c-format
+msgid ""
+"\n"
+"Program Header:\n"
+msgstr ""
+"\n"
+"Kepala Aplikasi:\n"
+
+#: elf.c:1201
+#, c-format
+msgid ""
+"\n"
+"Dynamic Section:\n"
+msgstr ""
+"\n"
+"Bagian Dinamis:\n"
+
+#: elf.c:1337
+#, c-format
+msgid ""
+"\n"
+"Version definitions:\n"
+msgstr ""
+"\n"
+"Definisi Versi:\n"
+
+#: elf.c:1362
+#, c-format
+msgid ""
+"\n"
+"Version References:\n"
+msgstr ""
+"\n"
+"Referensi Versi:\n"
+
+#: elf.c:1367
+#, c-format
+msgid " required from %s:\n"
+msgstr " dibutuhkan dari %s:\n"
+
+#: elf.c:1755
+msgid "%B: invalid link %lu for reloc section %s (index %u)"
+msgstr "%B: link tidak valid %lu untuk bagian relokasi %s (indek %u)"
+
+#: elf.c:1924
+msgid "%B: don't know how to handle allocated, application specific section `%s' [0x%8x]"
+msgstr "%B: tidak tahu bagaimana menangani alokasi, bagian spesifik aplikasi `%s' [0x%8x]"
+
+#: elf.c:1936
+msgid "%B: don't know how to handle processor specific section `%s' [0x%8x]"
+msgstr "%B: tidak tahu bagaimana menangani bagian spesifik prosesor `%s' [0x%8x]"
+
+#: elf.c:1947
+msgid "%B: don't know how to handle OS specific section `%s' [0x%8x]"
+msgstr "%B: tidak tahu bagaimana menangani bagian spesifik OS `%s' [0x%8x]"
+
+#: elf.c:1957
+msgid "%B: don't know how to handle section `%s' [0x%8x]"
+msgstr "%B: tidak tahu bagaimana menangani bagian `%s' [0x%8x]"
+
+#: elf.c:2555
+#, c-format
+msgid "warning: section `%A' type changed to PROGBITS"
+msgstr "peringatan: bagian `%A' tipe berubah ke PROGBITS"
+
+#: elf.c:2933
+msgid "%B: sh_link of section `%A' points to discarded section `%A' of `%B'"
+msgstr "%B: sh_link dari bagian `%A' menunjuk ke bagian terbuang `%A' dari `%B'"
+
+#: elf.c:2956
+msgid "%B: sh_link of section `%A' points to removed section `%A' of `%B'"
+msgstr "%B: sh_link dari bagian `%A' menunjuk ke bagian terhapus `%A' dari `%B'"
+
+#: elf.c:4300
+msgid "%B: The first section in the PT_DYNAMIC segment is not the .dynamic section"
+msgstr "%B: bagian pertama dalam segmen PT_DYNAMIC tidak dalam bagian .dynamic"
+
+#: elf.c:4327
+msgid "%B: Not enough room for program headers, try linking with -N"
+msgstr "%B: tidak cukup ruang untuk kepala aplikasi, coba linking dengan -N"
+
+#: elf.c:4404
+msgid "%B: section %A vma 0x%lx overlaps previous sections"
+msgstr "%B: bagian %A vma 0x%lx overlaps bagian sebelumnya"
+
+#: elf.c:4499
+msgid "%B: section `%A' can't be allocated in segment %d"
+msgstr "%B: bagian `%A' tidak dapat dialokasikan dalam segmen %d"
+
+#: elf.c:4549
+msgid "%B: warning: allocated section `%s' not in segment"
+msgstr "%B: peringatan: alokasi bagian `%s' tidak dalam segmen"
+
+#: elf.c:5064
+msgid "%B: symbol `%s' required but not present"
+msgstr "%B: simbol `%s' dibutuhkan tetapi tidak ada"
+
+#: elf.c:5403
+msgid "%B: warning: Empty loadable segment detected, is this intentional ?\n"
+msgstr "%B: peringatan: loadable segmen kosong terdeteksi, apakah ini sengaja ?\n"
+
+#: elf.c:6366
+#, c-format
+msgid "Unable to find equivalent output section for symbol '%s' from section '%s'"
+msgstr "Tidak dapat menemukan bagian keluaran ekuivalen untuk simbol '%s' dari bagian '%s'"
+
+#: elf.c:7346
+msgid "%B: unsupported relocation type %s"
+msgstr "%B: tipe relokasi tidak didukung %s"
+
+#: elf32-arm.c:2846 elf32-arm.c:2878
+msgid ""
+"%B(%s): warning: interworking not enabled.\n"
+" first occurrence: %B: Thumb call to ARM"
+msgstr ""
+"%B(%s): peringatan: antar-kerja tidak aktif.\n"
+" pertemuan pertama: %B: Thumb call ke ARM"
+
+#: elf32-arm.c:3041
+#, c-format
+msgid "%s: cannot create stub entry %s"
+msgstr "%s: tidak dapat membuat masukan stub %s"
+
+#: elf32-arm.c:3825
+#, c-format
+msgid "unable to find THUMB glue '%s' for '%s'"
+msgstr "tidak dapat menemukan THUMB lem '%s' untuk '%s'"
+
+#: elf32-arm.c:3859
+#, c-format
+msgid "unable to find ARM glue '%s' for '%s'"
+msgstr "tidak dapat menemukan ARM lem '%s' untuk '%s'"
+
+#: elf32-arm.c:4463
+msgid "%B: BE8 images only valid in big-endian mode."
+msgstr "%B: hanya images BE8 valid dalam mode big-endian."
+
+#. Give a warning, but do as the user requests anyway.
+#: elf32-arm.c:4678
+msgid "%B: warning: selected VFP11 erratum workaround is not necessary for target architecture"
+msgstr "%B: peringatan: memilih VFP11 erratum penyelesaian adalah tidak diperlukan untuk arsitektur target"
+
+#: elf32-arm.c:5212 elf32-arm.c:5232
+msgid "%B: unable to find VFP11 veneer `%s'"
+msgstr "%B: tidak dapat menemukan VFP11 veneer `%s'"
+
+#: elf32-arm.c:5278
+#, c-format
+msgid "Invalid TARGET2 relocation type '%s'."
+msgstr "Tipe relokasi '%s' TARGET2 tidak valid."
+
+#: elf32-arm.c:5362
+msgid ""
+"%B(%s): warning: interworking not enabled.\n"
+" first occurrence: %B: thumb call to arm"
+msgstr ""
+"%B(%s): peringatan: antar-kerja tidak aktif.\n"
+" pertemuan pertama: %B: thumb call ke arm"
+
+#: elf32-arm.c:6094
+msgid "\\%B: Warning: Arm BLX instruction targets Arm function '%s'."
+msgstr "\\%B: Peringatan: Arm BLK instruksi target Arm fungsi '%s'."
+
+#: elf32-arm.c:6418
+msgid "%B: Warning: Thumb BLX instruction targets thumb function '%s'."
+msgstr "%B: Peringatan: Thumb BLX instruksi target thumb fungsi '%s'."
+
+#: elf32-arm.c:7095
+msgid "%B(%A+0x%lx): R_ARM_TLS_LE32 relocation not permitted in shared object"
+msgstr "%B(%A+0x%lx): R_ARM_TLS_LE32 relokasi tidak diperbolehkan dalam objek terbagi"
+
+#: elf32-arm.c:7310
+msgid "%B(%A+0x%lx): Only ADD or SUB instructions are allowed for ALU group relocations"
+msgstr "%B(%A+0x%lx): Hanya ADD atau SUB instruksi yang diperbolehkan untuk grup ALU relokasi"
+
+#: elf32-arm.c:7350 elf32-arm.c:7437 elf32-arm.c:7520 elf32-arm.c:7605
+msgid "%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"
+msgstr "%B(%A+0x%lx): Overflow ketika membagi 0x%lx untuk relokasi grup %s"
+
+#: elf32-arm.c:7812 elf32-sh.c:3334 elf64-sh64.c:1556
+msgid "%B(%A+0x%lx): %s relocation against SEC_MERGE section"
+msgstr "%B(%A+0x%lx): %s relokasi terhadap bagian SEC_MERGE"
+
+#: elf32-arm.c:7930 elf32-xtensa.c:2759 elf64-ppc.c:10374
+msgid "%B(%A+0x%lx): %s used with TLS symbol %s"
+msgstr "%B(%A+0x%lx): %s digunakan dengan simbol TLS %s"
+
+#: elf32-arm.c:7931 elf32-xtensa.c:2760 elf64-ppc.c:10375
+msgid "%B(%A+0x%lx): %s used with non-TLS symbol %s"
+msgstr "%B(%A+0x%lx): %s digunakan dengan simbol bukan-TLS %s"
+
+#: elf32-arm.c:7988
+msgid "out of range"
+msgstr "diluar jangkauan"
+
+#: elf32-arm.c:7992
+msgid "unsupported relocation"
+msgstr "relokasi tidak didukung"
+
+#: elf32-arm.c:8000
+msgid "unknown error"
+msgstr "error tidak diketahui"
+
+#: elf32-arm.c:8099
+msgid "Warning: Clearing the interworking flag of %B because non-interworking code in %B has been linked with it"
+msgstr "Peringatan: Menghapus tanda antar-kerja dari %B karena bukan kode antar-kerja dalam %B telah dihubungkan dengan itu"
+
+#: elf32-arm.c:8205
+msgid "ERROR: %B uses VFP register arguments, %B does not"
+msgstr "ERROR: %B menggunakan reguster argumen VFP, %B tidak"
+
+#: elf32-arm.c:8254
+msgid "ERROR: %B: Conflicting architecture profiles %c/%c"
+msgstr "ERROR: %B: Profil arsitektur konflik %c/%c"
+
+#: elf32-arm.c:8274
+msgid "Warning: %B: Conflicting platform configuration"
+msgstr "Peringatan: %B: Konflik konfigurasi platform"
+
+#: elf32-arm.c:8283
+msgid "ERROR: %B: Conflicting use of R9"
+msgstr "ERROR: %B: Konflik penggunaan R9"
+
+#: elf32-arm.c:8295
+msgid "ERROR: %B: SB relative addressing conflicts with use of R9"
+msgstr "ERROR: %B: SB pengalamatan relatif konflik dengan penggunaan dari R9"
+
+#: elf32-arm.c:8318
+msgid "warning: %B uses %u-byte wchar_t yet the output is to use %u-byte wchar_t; use of wchar_t values across objects may fail"
+msgstr "peringatan: %B menggunakan %u-byte wchar_t tapi keluaran menggunakan %u-byte wchar_t; menggunakan nilai wchar_t melewati objek mungkin gagal"
+
+#: elf32-arm.c:8347
+msgid "warning: %B uses %s enums yet the output is to use %s enums; use of enum values across objects may fail"
+msgstr "peringatan: %B menggunakan %s enums tapi keluaran menggunakan %s enums; menggunakan nilai dari enum dari objek mungkin gagal"
+
+#: elf32-arm.c:8360
+msgid "ERROR: %B uses iWMMXt register arguments, %B does not"
+msgstr "ERROR: %B menggunakan iWMMXt argumen register, %B tidak"
+
+#: elf32-arm.c:8400
+msgid "Warning: %B: Unknown EABI object attribute %d"
+msgstr "Peringatan: %B: atribut objek EABI tidak diketahui %d"
+
+#: elf32-arm.c:8460
+msgid "ERROR: %B is already in final BE8 format"
+msgstr "ERROR: %B telah dalam format akhir BE8"
+
+#: elf32-arm.c:8536
+msgid "ERROR: Source object %B has EABI version %d, but target %B has EABI version %d"
+msgstr "ERROR: Sumber objek %B memiliki versi EABI %d, tetapi target %B memiliki versi EABI %d"
+
+#: elf32-arm.c:8552
+msgid "ERROR: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"
+msgstr "ERROR: %B dikompile untuk APCS-%d, dimana target %B menggunakan APCS-%d"
+
+#: elf32-arm.c:8577
+msgid "ERROR: %B uses VFP instructions, whereas %B does not"
+msgstr "ERROR: %B menggunakan VFP instruksi, dimana %B tidak"
+
+#: elf32-arm.c:8581
+msgid "ERROR: %B uses FPA instructions, whereas %B does not"
+msgstr "ERROR: %B menggunakan FPA instruksi, dimana %B tidak"
+
+#: elf32-arm.c:8591
+msgid "ERROR: %B uses Maverick instructions, whereas %B does not"
+msgstr "ERROR: %B menggunakan Maverick instruksi, dimana %B tidak"
+
+#: elf32-arm.c:8595
+msgid "ERROR: %B does not use Maverick instructions, whereas %B does"
+msgstr "ERROR: %B tidak menggunakan Maveric instruksi, dimana %B menggunakan"
+
+#: elf32-arm.c:8614
+msgid "ERROR: %B uses software FP, whereas %B uses hardware FP"
+msgstr "ERROR: %B menggunakan software FP, dimana %B menggunakan hardware FP"
+
+#: elf32-arm.c:8618
+msgid "ERROR: %B uses hardware FP, whereas %B uses software FP"
+msgstr "ERROR: %B menggunakan hardware FP, dimana %B menggunakan software FP"
+
+#. Ignore init flag - it may not be set, despite the flags field
+#. containing valid data.
+#. Ignore init flag - it may not be set, despite the flags field containing valid data.
+#: elf32-arm.c:8665 elf32-bfin.c:4899 elf32-cris.c:3235 elf32-m68hc1x.c:1279
+#: elf32-m68k.c:774 elf32-score.c:3750 elf32-vax.c:538 elfxx-mips.c:12699
+#, c-format
+msgid "private flags = %lx:"
+msgstr "tanda private = %lx:"
+
+#: elf32-arm.c:8674
+#, c-format
+msgid " [interworking enabled]"
+msgstr " [antar-kerja aktif]"
+
+#: elf32-arm.c:8682
+#, c-format
+msgid " [VFP float format]"
+msgstr " [VFP float format]"
+
+#: elf32-arm.c:8684
+#, c-format
+msgid " [Maverick float format]"
+msgstr " [Maverick float format]"
+
+#: elf32-arm.c:8686
+#, c-format
+msgid " [FPA float format]"
+msgstr " [FPA float format]"
+
+#: elf32-arm.c:8695
+#, c-format
+msgid " [new ABI]"
+msgstr " [ABI baru]"
+
+#: elf32-arm.c:8698
+#, c-format
+msgid " [old ABI]"
+msgstr " [ABI lama]"
+
+#: elf32-arm.c:8701
+#, c-format
+msgid " [software FP]"
+msgstr " [software FP]"
+
+#: elf32-arm.c:8710
+#, c-format
+msgid " [Version1 EABI]"
+msgstr " [EABI Versi 1]"
+
+#: elf32-arm.c:8713 elf32-arm.c:8724
+#, c-format
+msgid " [sorted symbol table]"
+msgstr " [simbol tabel terurut]"
+
+#: elf32-arm.c:8715 elf32-arm.c:8726
+#, c-format
+msgid " [unsorted symbol table]"
+msgstr " [simbol tabel tidak terurut]"
+
+#: elf32-arm.c:8721
+#, c-format
+msgid " [Version2 EABI]"
+msgstr " [EABI Versi 2]"
+
+#: elf32-arm.c:8729
+#, c-format
+msgid " [dynamic symbols use segment index]"
+msgstr " [simbol dinamis menggunakan segmen indek]"
+
+#: elf32-arm.c:8732
+#, c-format
+msgid " [mapping symbols precede others]"
+msgstr " [simbol map mendahului yang lain]"
+
+#: elf32-arm.c:8739
+#, c-format
+msgid " [Version3 EABI]"
+msgstr " [EABI Versi 3]"
+
+#: elf32-arm.c:8743
+#, c-format
+msgid " [Version4 EABI]"
+msgstr " [EABI Versi 4]"
+
+#: elf32-arm.c:8747
+#, c-format
+msgid " [Version5 EABI]"
+msgstr " [EABI Versi 5]"
+
+#: elf32-arm.c:8750
+#, c-format
+msgid " [BE8]"
+msgstr " [BE8]"
+
+#: elf32-arm.c:8753
+#, c-format
+msgid " [LE8]"
+msgstr " [LE8]"
+
+#: elf32-arm.c:8759
+#, c-format
+msgid " <EABI version unrecognised>"
+msgstr " <EABI versi tidak dikenal>"
+
+#: elf32-arm.c:8766
+#, c-format
+msgid " [relocatable executable]"
+msgstr " [relocatable executable]"
+
+#: elf32-arm.c:8769
+#, c-format
+msgid " [has entry point]"
+msgstr " [memiliki titik masuk]"
+
+#: elf32-arm.c:8774
+#, c-format
+msgid "<Unrecognised flag bits set>"
+msgstr "<Tanda bit tidak dikenal terset>"
+
+#: elf32-arm.c:9013 elf32-i386.c:1236 elf32-s390.c:1006 elf32-xtensa.c:999
+#: elf64-s390.c:961 elf64-x86-64.c:1016 elfxx-sparc.c:1127
+msgid "%B: bad symbol index: %d"
+msgstr "%B: memiliki indek simbol: %d"
+
+#: elf32-arm.c:10125
+#, c-format
+msgid "Errors encountered processing file %s"
+msgstr "Errors ditemui dalam pemrosesan berkas %s"
+
+#: elf32-arm.c:11526 elf32-arm.c:11548
+msgid "%B: error: VFP11 veneer out of range"
+msgstr "%B: error: VFP11 veneer diluar jangkauan"
+
+#: elf32-avr.c:1258 elf32-bfin.c:3222 elf32-cris.c:1546 elf32-fr30.c:624
+#: elf32-frv.c:4122 elf32-i860.c:1226 elf32-ip2k.c:1510 elf32-iq2000.c:699
+#: elf32-m32c.c:568 elf32-mep.c:549 elf32-msp430.c:501 elf32-mt.c:406
+#: elf32-openrisc.c:419 elf32-v850.c:1711 elf32-xstormy16.c:956
+#: elf64-mmix.c:1541
+msgid "internal error: dangerous relocation"
+msgstr "internal error: relokasi berbahaya"
+
+#: elf32-avr.c:2396 elf32-hppa.c:605 elf32-m68hc1x.c:164 elf64-ppc.c:3983
+msgid "%B: cannot create stub entry %s"
+msgstr "%B: tidak dapat membuat masukan stub %s"
+
+#: elf32-bfin.c:1585
+msgid "%B(%A+0x%lx): unresolvable relocation against symbol `%s'"
+msgstr "%B(%A+0x%lx): relokasi tidak teresolf terhadap simbol `%s'"
+
+#: elf32-bfin.c:1618 elf32-i386.c:3623 elf32-m68k.c:3557 elf32-s390.c:3110
+#: elf64-s390.c:3071 elf64-x86-64.c:3278
+msgid "%B(%A+0x%lx): reloc against `%s': error %d"
+msgstr "%B(%A+0x%lx): relokasi terhadap `%s': error %d"
+
+#: elf32-bfin.c:2711
+msgid "%B: relocation at `%A+0x%x' references symbol `%s' with nonzero addend"
+msgstr "%B: relokasi di `%A+0x%x' simbol referensi `%s' dengan bukan nol ditambahkan"
+
+#: elf32-bfin.c:2725 elf32-frv.c:2904
+msgid "relocation references symbol not defined in the module"
+msgstr "relokasi referensi simbol tidak didefinisikan dalam modul"
+
+#: elf32-bfin.c:2822
+msgid "R_BFIN_FUNCDESC references dynamic symbol with nonzero addend"
+msgstr "R_BFIN_FUNCDESC referensi simbol dinamis dengan bukan nol ditambahkan"
+
+#: elf32-bfin.c:2861 elf32-bfin.c:2987 elf32-frv.c:3641 elf32-frv.c:3762
+msgid "cannot emit fixups in read-only section"
+msgstr "tidak dapat mengeluarkan fixups dalam bagian baca-saja"
+
+#: elf32-bfin.c:2889 elf32-bfin.c:3036 elf32-frv.c:3672 elf32-frv.c:3806
+msgid "cannot emit dynamic relocations in read-only section"
+msgstr "tidak dapat mengeluarkan relokasi dinamis dalam bagian baca-saja"
+
+#: elf32-bfin.c:2945
+msgid "R_BFIN_FUNCDESC_VALUE references dynamic symbol with nonzero addend"
+msgstr "R_BFIN_FUNCDESC_VALUE referensi simbol dinamis dengan bukan nol ditambahkan"
+
+#: elf32-bfin.c:3126
+msgid "relocations between different segments are not supported"
+msgstr "relokasi diantara segmen berbeda tidak didukung"
+
+#: elf32-bfin.c:3127
+msgid "warning: relocation references a different segment"
+msgstr "peringatan: relokasi referensi sebuah segmen berbeda"
+
+#: elf32-bfin.c:4791 elf32-frv.c:6404
+msgid "%B: unsupported relocation type %i"
+msgstr "%B: tipe relokasi %i tidak didukung"
+
+#: elf32-bfin.c:4944 elf32-frv.c:6812
+#, c-format
+msgid "%s: cannot link non-fdpic object file into fdpic executable"
+msgstr "%s: tidak dapat menghubungkan berkas objek bukan-fdpic kedalam aplikasi fdpic"
+
+#: elf32-bfin.c:4948 elf32-frv.c:6816
+#, c-format
+msgid "%s: cannot link fdpic object file into non-fdpic executable"
+msgstr "%s: tidak dapat menghubungkan berkas objek fdpic kedalam aplikasi bukan-fdpic"
+
+#: elf32-cris.c:1060
+msgid "%B, section %A: unresolvable relocation %s against symbol `%s'"
+msgstr "%B, bagian %A: relokasi tidak teresolf %s terhadap simbol `%s'"
+
+#: elf32-cris.c:1129
+msgid "%B, section %A: No PLT nor GOT for relocation %s against symbol `%s'"
+msgstr "%B, bagian %A: Bukan PLT atau GOT untuk relokasi %s terhadap simbol `%s'"
+
+#: elf32-cris.c:1131
+msgid "%B, section %A: No PLT for relocation %s against symbol `%s'"
+msgstr "%B, bagian %A: Bukan PLT untuk relokasi %s terhadap simbol `%s'"
+
+#: elf32-cris.c:1137 elf32-cris.c:1269
+msgid "[whose name is lost]"
+msgstr "[yang namanya hilang]"
+
+#: elf32-cris.c:1255
+msgid "%B, section %A: relocation %s with non-zero addend %d against local symbol"
+msgstr "%B, bagian %A: relokasi %s dengan bukan-nol ditambahkan %d terhadap simbol lokal"
+
+#: elf32-cris.c:1263
+msgid "%B, section %A: relocation %s with non-zero addend %d against symbol `%s'"
+msgstr "%B, bagian %A: relokasi %s dengan bukan-nol ditambakan %d terhadap simbol `%s'"
+
+#: elf32-cris.c:1289
+msgid "%B, section %A: relocation %s is not allowed for global symbol: `%s'"
+msgstr "%B, bagian %A: relokasi %s tidak diperbolehkan untuk simbol global: `%s'"
+
+#: elf32-cris.c:1305
+msgid "%B, section %A: relocation %s with no GOT created"
+msgstr "%B, bagian %A: relokasi %s dengan tidak GOT dibuat"
+
+#: elf32-cris.c:1423
+msgid "%B: Internal inconsistency; no relocation section %s"
+msgstr "%B: Internal tidak konsisten; bagian %s tidak bisa direlokasi"
+
+#: elf32-cris.c:2510
+msgid ""
+"%B, section %A:\n"
+" v10/v32 compatible object %s must not contain a PIC relocation"
+msgstr ""
+"%B, bagian %A:\n"
+" v10/v32 objek kompatibel %s harus berisi sebuah relokasi PIC"
+
+#: elf32-cris.c:2697 elf32-cris.c:2765
+msgid ""
+"%B, section %A:\n"
+" relocation %s should not be used in a shared object; recompile with -fPIC"
+msgstr ""
+"%B, bagian %A:\n"
+" relokasi %s seharusnya digunakan dalam sebuah objek terbagi; rekompile dengan -fPIC"
+
+#: elf32-cris.c:3184
+msgid "Unexpected machine number"
+msgstr "Nomor mesin tidak terduga"
+
+#: elf32-cris.c:3238
+#, c-format
+msgid " [symbols have a _ prefix]"
+msgstr " [simbol memiliki sebuah awalan _]"
+
+#: elf32-cris.c:3241
+#, c-format
+msgid " [v10 and v32]"
+msgstr " [v10 dan v32]"
+
+#: elf32-cris.c:3244
+#, c-format
+msgid " [v32]"
+msgstr " [v32]"
+
+#: elf32-cris.c:3289
+msgid "%B: uses _-prefixed symbols, but writing file with non-prefixed symbols"
+msgstr "%B: menggunakan awalan _ simbol, tetapi menulis berkas dengan simbol tanpa awalan"
+
+#: elf32-cris.c:3290
+msgid "%B: uses non-prefixed symbols, but writing file with _-prefixed symbols"
+msgstr "%B: menggunakan simbol tanpa awalan, tetapi menulis berkas dengan simbol awalan _"
+
+#: elf32-cris.c:3309
+msgid "%B contains CRIS v32 code, incompatible with previous objects"
+msgstr "%B berisi kode CRIS v32, tidak kompatibel dengan objek sebelumnya"
+
+#: elf32-cris.c:3311
+msgid "%B contains non-CRIS-v32 code, incompatible with previous objects"
+msgstr "%B berisi kode bukan CRIS v32, tidak kompatibel dengan objek sebelumnya"
+
+#: elf32-frv.c:1507 elf32-frv.c:1656
+msgid "relocation requires zero addend"
+msgstr "relokasi membutuhkan penambahan nol"
+
+#: elf32-frv.c:2891
+msgid "%B(%A+0x%x): relocation to `%s+%x' may have caused the error above"
+msgstr "%B(%A+0x%x): relokasi ke `%s+%x' mungkin menyebabkan error diatas"
+
+#: elf32-frv.c:2980
+msgid "R_FRV_GETTLSOFF not applied to a call instruction"
+msgstr "R_FRV_GETTLSOFF tidak teraplikasi untuk sebuah panggilan instruksi"
+
+#: elf32-frv.c:3022
+msgid "R_FRV_GOTTLSDESC12 not applied to an lddi instruction"
+msgstr "R_FRV_GOTTLSDESC12 tidak teraplikasi untuk sebuah instruksi lddi"
+
+#: elf32-frv.c:3093
+msgid "R_FRV_GOTTLSDESCHI not applied to a sethi instruction"
+msgstr "R_FRV_GOTTLSDESCHI tidak teraplikasi untuk sebuah instruksi sethi"
+
+#: elf32-frv.c:3130
+msgid "R_FRV_GOTTLSDESCLO not applied to a setlo or setlos instruction"
+msgstr "R_FRV_GOTTLSDESCLO tidak teraplikasi untuk sebuah instruksi setlo atau setlos"
+
+#: elf32-frv.c:3178
+msgid "R_FRV_TLSDESC_RELAX not applied to an ldd instruction"
+msgstr "R_FRV_TLSDESC_RELAX tidak teraplikasi untuk sebuah instruksi ldd"
+
+#: elf32-frv.c:3262
+msgid "R_FRV_GETTLSOFF_RELAX not applied to a calll instruction"
+msgstr "R_FRV_GETTLSOFF_RELAX tidak teraplikasi untuk sebuah instruksi calll"
+
+#: elf32-frv.c:3317
+msgid "R_FRV_GOTTLSOFF12 not applied to an ldi instruction"
+msgstr "R_FRV_GETTLSOFF12 tidak teraplikasi untuk sebuah instruksi ldi"
+
+#: elf32-frv.c:3347
+msgid "R_FRV_GOTTLSOFFHI not applied to a sethi instruction"
+msgstr "R_FRV_GOTTLSOFFHI tidak teraplikasi untuk sebuah instruksi sethi"
+
+#: elf32-frv.c:3376
+msgid "R_FRV_GOTTLSOFFLO not applied to a setlo or setlos instruction"
+msgstr "R_FRV_GOTTLSOFFLO tidak teraplikasi untuk sebuah instruksi setlo atau setlos"
+
+#: elf32-frv.c:3407
+msgid "R_FRV_TLSOFF_RELAX not applied to an ld instruction"
+msgstr "R_FRV_TLSOFF_RELAX tidak teraplikasi untuk sebuah instruksi ld"
+
+#: elf32-frv.c:3452
+msgid "R_FRV_TLSMOFFHI not applied to a sethi instruction"
+msgstr "R_FRV_TLSMOFFHI tidak teraplikasi untuk sebuah instruksi sethi"
+
+#: elf32-frv.c:3479
+msgid "R_FRV_TLSMOFFLO not applied to a setlo or setlos instruction"
+msgstr "R_FRV_TLSMOFFLO tidak teraplikasi untuk sebuah instruksi setlo atau setlos"
+
+#: elf32-frv.c:3600
+msgid "R_FRV_FUNCDESC references dynamic symbol with nonzero addend"
+msgstr "R_FRV_FUNCDESC referensi simbol dinamis dengan penambahan bukan nol"
+
+#: elf32-frv.c:3720
+msgid "R_FRV_FUNCDESC_VALUE references dynamic symbol with nonzero addend"
+msgstr "R_FRV_FUNCDESC_VALUE referensi simbol dinamis dengan penambahan bukan nol"
+
+#: elf32-frv.c:3977 elf32-frv.c:4133
+msgid "%B(%A+0x%lx): reloc against `%s': %s"
+msgstr "%B(%A+0x%lx): relokasi terhadap `%s': %s"
+
+#: elf32-frv.c:3979 elf32-frv.c:3983
+msgid "relocation references a different segment"
+msgstr "relokasi referensi ke segmen berbeda"
+
+#: elf32-frv.c:6726
+#, c-format
+msgid "%s: compiled with %s and linked with modules that use non-pic relocations"
+msgstr "%s: terkompile dengan %s dan terhubung dengan modul yang menggunakan relokasi bukan-pic"
+
+#: elf32-frv.c:6779 elf32-iq2000.c:852 elf32-m32c.c:814
+#, c-format
+msgid "%s: compiled with %s and linked with modules compiled with %s"
+msgstr "%s: terkompile dengan %s dan terhubung dengan modul terkompile dengan %s"
+
+#: elf32-frv.c:6791
+#, c-format
+msgid "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%lx)"
+msgstr "%s: menggunakan bagian e_flags (0x%lx) berbeda yang tidak dikenal dari modul sebelumnya (0x%lx)"
+
+#: elf32-frv.c:6841 elf32-iq2000.c:889 elf32-m32c.c:850 elf32-mt.c:583
+#, c-format
+msgid "private flags = 0x%lx:"
+msgstr "private flags = 0x%lx:"
+
+#: elf32-gen.c:69 elf64-gen.c:69
+msgid "%B: Relocations in generic ELF (EM: %d)"
+msgstr "%B: Relokasi dalam ELF standar (EM: %d)"
+
+#: elf32-hppa.c:854 elf32-hppa.c:3600
+msgid "%B(%A+0x%lx): cannot reach %s, recompile with -ffunction-sections"
+msgstr "%B(%A+0x%lx): tidak dapat mencapai %s, rekompile dengan -ffunction-sections"
+
+#: elf32-hppa.c:1263
+msgid "%B: relocation %s can not be used when making a shared object; recompile with -fPIC"
+msgstr "%B: relokasi %s tidak dapat digunakan ketika membuat sebuah objek terbagi; rekompile dengan -fPIC"
+
+#: elf32-hppa.c:1518
+#, c-format
+msgid "Could not find relocation section for %s"
+msgstr "Tidak dapat menemukan bagian relokasi untuk %s"
+
+#: elf32-hppa.c:2810
+msgid "%B: duplicate export stub %s"
+msgstr "%B: duplikasi export stub %s"
+
+#: elf32-hppa.c:3436
+msgid "%B(%A+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"
+msgstr "%B(%A+0x%lx): %s fixup untuk insn 0x%x tidak didukung dalam sebuah sambunga tidak terbagi"
+
+#: elf32-hppa.c:4290
+msgid "%B(%A+0x%lx): cannot handle %s for %s"
+msgstr "%B(%A+0x%lx): tidak dapat menangani %s untuk %s"
+
+#: elf32-hppa.c:4597
+msgid ".got section not immediately after .plt section"
+msgstr "bagian .got tidak mengikuti bagian .plt"
+
+#: elf32-i386.c:362 elf32-ppc.c:1616 elf32-s390.c:379 elf64-ppc.c:2153
+#: elf64-s390.c:403 elf64-x86-64.c:222
+msgid "%B: invalid relocation type %d"
+msgstr "%B: tipe relokasi %d tidak valid"
+
+#: elf32-i386.c:1183 elf64-x86-64.c:964
+msgid "%B: TLS transition from %s to %s against `%s' at 0x%lx in section `%A' failed"
+msgstr "%B: TLS transisi dari %s ke %s terhadap `%s' di 0x%lx dalam bagian `%A' gagal"
+
+#: elf32-i386.c:1364 elf32-s390.c:1188 elf32-sh.c:5098 elf32-xtensa.c:1162
+#: elf64-s390.c:1152 elfxx-sparc.c:1263
+msgid "%B: `%s' accessed both as normal and thread local symbol"
+msgstr "%B: `%s' terakses kedua sebagai normal dan memperlakukan lokal simbol"
+
+#: elf32-i386.c:1479 elf32-s390.c:1297 elf64-ppc.c:5046 elf64-s390.c:1264
+#: elf64-x86-64.c:1299
+msgid "%B: bad relocation section name `%s'"
+msgstr "%B: relokasi bagian nama `%s' buruk"
+
+#: elf32-i386.c:2598
+msgid "%B: unrecognized relocation (0x%x) in section `%A'"
+msgstr "%B: relokasi tidak dikenal (0x%x) dalam bagian `%A'"
+
+#: elf32-i386.c:2822 elf64-x86-64.c:2660
+msgid "hidden symbol"
+msgstr "simbol tersembunyi"
+
+#: elf32-i386.c:2825 elf64-x86-64.c:2663
+msgid "internal symbol"
+msgstr "internal simbol"
+
+#: elf32-i386.c:2828 elf64-x86-64.c:2666
+msgid "protected symbol"
+msgstr "simbol terproteksi"
+
+#: elf32-i386.c:2831 elf64-x86-64.c:2669
+msgid "symbol"
+msgstr "simbol"
+
+#: elf32-i386.c:2836
+msgid "%B: relocation R_386_GOTOFF against undefined %s `%s' can not be used when making a shared object"
+msgstr "%B: relokasi R_386_GOTOFF terhadap %s `%s' tidak terdefinisi tidak dapat digunakan ketika membuah sebuah objek terbagi"
+
+#: elf32-i386.c:2846
+msgid "%B: relocation R_386_GOTOFF against protected function `%s' can not be used when making a shared object"
+msgstr "%B: relokasi R_386_GOTOFF terhadap fungsi terproteksi `%s' tidak dapat digunakan ketika membuat sebuah objek terbagi"
+
+#: elf32-ip2k.c:868 elf32-ip2k.c:874 elf32-ip2k.c:941 elf32-ip2k.c:947
+msgid "ip2k relaxer: switch table without complete matching relocation information."
+msgstr "ip2k relaxer: tabel switch tanpa pencocokan informasi relokasi lengkap."
+
+#: elf32-ip2k.c:891 elf32-ip2k.c:974
+msgid "ip2k relaxer: switch table header corrupt."
+msgstr "ip2k relaxer: switch tabel header terkorupsi."
+
+#: elf32-ip2k.c:1316
+#, c-format
+msgid "ip2k linker: missing page instruction at 0x%08lx (dest = 0x%08lx)."
+msgstr "ip2k linker: hilang halaman instruksi di 0x%08lx (dest = 0x%08lx)."
+
+#: elf32-ip2k.c:1332
+#, c-format
+msgid "ip2k linker: redundant page instruction at 0x%08lx (dest = 0x%08lx)."
+msgstr "ip2k linker: redundant halaman instruksi di 0x%08lx (dest = 0x%08lx)."
+
+#. Only if it's not an unresolved symbol.
+#: elf32-ip2k.c:1506
+msgid "unsupported relocation between data/insn address spaces"
+msgstr "relokasi tidak didukung diantara data/insn ruang alamat"
+
+#: elf32-iq2000.c:865 elf32-m32c.c:826
+#, c-format
+msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
+msgstr "%s: menggunakan e_flags (0x%lx) field berbeda dari modul sebelumnya (0x%lx)"
+
+#: elf32-m32r.c:1453
+msgid "SDA relocation when _SDA_BASE_ not defined"
+msgstr "SDA relokasi ketika _SDA_BASE_ tidak terdefinisi"
+
+#: elf32-m32r.c:3061
+msgid "%B: The target (%s) of an %s relocation is in the wrong section (%A)"
+msgstr "%B: Target (%s) dari sebuah %s relokasi berada dalam bagian yang salah (%A)"
+
+#: elf32-m32r.c:3589
+msgid "%B: Instruction set mismatch with previous modules"
+msgstr "%B: Set Instruksi tidak cocok dengan modul sebelumnya"
+
+#: elf32-m32r.c:3610
+#, c-format
+msgid "private flags = %lx"
+msgstr "private flags = %lx"
+
+#: elf32-m32r.c:3615
+#, c-format
+msgid ": m32r instructions"
+msgstr ": m32r instruksi"
+
+#: elf32-m32r.c:3616
+#, c-format
+msgid ": m32rx instructions"
+msgstr ": m32rx instruksi"
+
+#: elf32-m32r.c:3617
+#, c-format
+msgid ": m32r2 instructions"
+msgstr ": m32r2 instruksi"
+
+#: elf32-m68hc1x.c:1047
+#, c-format
+msgid "Reference to the far symbol `%s' using a wrong relocation may result in incorrect execution"
+msgstr "Referensi ke simbol jauh `%s' menggunakan relokasi salah mungkin akan menghasilkan eksekusi salah"
+
+#: elf32-m68hc1x.c:1070
+#, c-format
+msgid "banked address [%lx:%04lx] (%lx) is not in the same bank as current banked address [%lx:%04lx] (%lx)"
+msgstr "banked address [%lx:%04lx] (%lx) tidak dalam bank yang sama seperti dalam alamat bank sekarang [%lx:%04lx] (%lx)"
+
+#: elf32-m68hc1x.c:1089
+#, c-format
+msgid "reference to a banked address [%lx:%04lx] in the normal address space at %04lx"
+msgstr "referensi ke alamat bank [%lx:%04lx] dalam ruang alamat normal di %04lx"
+
+#: elf32-m68hc1x.c:1222
+msgid "%B: linking files compiled for 16-bit integers (-mshort) and others for 32-bit integers"
+msgstr "%B: menghubungkan berkas yang dikompile untuk 16-bit integer (-mshort) dan yang lain untuk 32-bit integer"
+
+#: elf32-m68hc1x.c:1229
+msgid "%B: linking files compiled for 32-bit double (-fshort-double) and others for 64-bit double"
+msgstr "%B: menghubungkan berkas yang dikompile untuk 32-bit double (-fshort-double) dan yang lain untuk 64-bit double"
+
+#: elf32-m68hc1x.c:1238
+msgid "%B: linking files compiled for HCS12 with others compiled for HC12"
+msgstr "%B: menghubungkan berkas dikompile untuk HCS12 dengan yang lain dikompile untuk HC12"
+
+#: elf32-m68hc1x.c:1254 elf32-ppc.c:4046 elf64-sparc.c:697 elfxx-mips.c:12561
+msgid "%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
+msgstr "%B: menggunakan field e_flags (0x%lx) berbeda dari modul sebelumnya (0x%lx)"
+
+#: elf32-m68hc1x.c:1282
+#, c-format
+msgid "[abi=32-bit int, "
+msgstr "[abi=32-bit int, "
+
+#: elf32-m68hc1x.c:1284
+#, c-format
+msgid "[abi=16-bit int, "
+msgstr "[abi=16-bit int, "
+
+#: elf32-m68hc1x.c:1287
+#, c-format
+msgid "64-bit double, "
+msgstr "64-bit double, "
+
+#: elf32-m68hc1x.c:1289
+#, c-format
+msgid "32-bit double, "
+msgstr "32-bit double, "
+
+#: elf32-m68hc1x.c:1292
+#, c-format
+msgid "cpu=HC11]"
+msgstr "cpu=HC11]"
+
+#: elf32-m68hc1x.c:1294
+#, c-format
+msgid "cpu=HCS12]"
+msgstr "cpu=HCS12]"
+
+#: elf32-m68hc1x.c:1296
+#, c-format
+msgid "cpu=HC12]"
+msgstr "cpu=HC12]"
+
+#: elf32-m68hc1x.c:1299
+#, c-format
+msgid " [memory=bank-model]"
+msgstr " [memory=bank-model]"
+
+#: elf32-m68hc1x.c:1301
+#, c-format
+msgid " [memory=flat]"
+msgstr " [memory=flat]"
+
+#: elf32-m68k.c:789 elf32-m68k.c:790
+msgid "unknown"
+msgstr "tidak dikenal"
+
+#: elf32-m68k.c:1216
+msgid "%B: GOT overflow: Number of R_68K_GOT8O relocations > %d"
+msgstr "%B: GOT overflow: Jumlah dari R_68K_GOT80 relokasi > %d"
+
+#: elf32-m68k.c:1221
+msgid "%B: GOT overflow: Number of R_68K_GOT8O and R_68K_GOT16O relocations > %d"
+msgstr "%B: Memperoleh overflow: Jumlah dari R_68K_GOT80 dan R_68K_GOT160 relokasi > %d"
+
+#: elf32-mcore.c:99 elf32-mcore.c:442
+msgid "%B: Relocation %s (%d) is not currently supported.\n"
+msgstr "%B: Relokasi %s (%d) saat ini tidak didukung.\n"
+
+#: elf32-mcore.c:428
+msgid "%B: Unknown relocation type %d\n"
+msgstr "%B: Tipe relokasi %d tidak dikenal\n"
+
+#: elf32-mep.c:654
+msgid "%B and %B are for different cores"
+msgstr "%B dan %B adalah untuk cores berbeda"
+
+#: elf32-mep.c:671
+msgid "%B and %B are for different configurations"
+msgstr "%B dan %B adalah untuk konfigurasi berbeda"
+
+#: elf32-mep.c:709
+#, c-format
+msgid "private flags = 0x%lx"
+msgstr "private flags = 0x%lx"
+
+#: elf32-mips.c:1045 elf64-mips.c:2056 elfn32-mips.c:1888
+msgid "literal relocation occurs for an external symbol"
+msgstr "literal relokasi terjadi untuk simbol eksternal"
+
+#: elf32-mips.c:1085 elf32-score.c:484 elf64-mips.c:2099 elfn32-mips.c:1929
+msgid "32bits gp relative relocation occurs for an external symbol"
+msgstr "32bit gp relative relokasi terjadi untuk sebuah simbol eksternal"
+
+#: elf32-ppc.c:1681
+#, c-format
+msgid "generic linker can't handle %s"
+msgstr "linker generik tidak dapat menangani %s"
+
+#: elf32-ppc.c:2161
+msgid "corrupt or empty %s section in %B"
+msgstr "korup atau kosong %s bagian dalam %B"
+
+#: elf32-ppc.c:2168
+msgid "unable to read in %s section from %B"
+msgstr "tidak dapat membaca dalam bagian %s dari %B"
+
+#: elf32-ppc.c:2174
+msgid "corrupt %s section in %B"
+msgstr "korup bagian %s dalam %B"
+
+#: elf32-ppc.c:2217
+msgid "warning: unable to set size of %s section in %B"
+msgstr "peringatan: tidak dapat menset ukuran bagian %s dalam %B"
+
+#: elf32-ppc.c:2265
+msgid "failed to allocate space for new APUinfo section."
+msgstr "gagal mengalokasikan ruang untuk bagian baru APUinfo."
+
+#: elf32-ppc.c:2284
+msgid "failed to compute new APUinfo section."
+msgstr "gagal untuk menghitung bagian baru APUinfo."
+
+#: elf32-ppc.c:2287
+msgid "failed to install new APUinfo section."
+msgstr "gagal untuk memasang bagian baru APUinfo."
+
+#: elf32-ppc.c:3263
+msgid "%B: relocation %s cannot be used when making a shared object"
+msgstr "%B: relokasi %s tidak dapat digunakan ketika membuat sebuah objek terbagi"
+
+#. It does not make sense to have a procedure linkage
+#. table entry for a local symbol.
+#: elf32-ppc.c:3534
+msgid "%B(%A+0x%lx): %s reloc against local symbol"
+msgstr "%B(%A+0x%lx): %s relokasi terhadap simbol lokal"
+
+#: elf32-ppc.c:3885 elf32-ppc.c:3900 elfxx-mips.c:12268 elfxx-mips.c:12294
+#: elfxx-mips.c:12316 elfxx-mips.c:12342
+msgid "Warning: %B uses hard float, %B uses soft float"
+msgstr "Peringatan: %B menggunakan hard float, %B menggunakan soft float"
+
+#: elf32-ppc.c:3888 elf32-ppc.c:3892
+msgid "Warning: %B uses double-precision hard float, %B uses single-precision hard float"
+msgstr "Peringatan: %B menggunakan double-precision hard float, %B menggunakan single-precision hard float"
+
+#: elf32-ppc.c:3896
+msgid "Warning: %B uses soft float, %B uses single-precision hard float"
+msgstr "Peringatan: %B menggunakan soft float, %B menggunakan single-precision hard float"
+
+#: elf32-ppc.c:3903 elf32-ppc.c:3907 elfxx-mips.c:12248 elfxx-mips.c:12252
+msgid "Warning: %B uses unknown floating point ABI %d"
+msgstr "Peringatan: %B menggunkaan floating point ABI %d"
+
+#: elf32-ppc.c:3949 elf32-ppc.c:3953
+msgid "Warning: %B uses unknown vector ABI %d"
+msgstr "Peringatan: %B menggunakan vector ABI %d tidak dikenal"
+
+#: elf32-ppc.c:3957
+msgid "Warning: %B uses vector ABI \"%s\", %B uses \"%s\""
+msgstr "Peringatan: %B menggunakan vector ABI \"%s\", %B menggunakan \"%s\""
+
+#: elf32-ppc.c:4011
+msgid "%B: compiled with -mrelocatable and linked with modules compiled normally"
+msgstr "%B: dikompile dengan -mrelocatable dan dihubungkan dengan module yang dikompile secara normal"
+
+#: elf32-ppc.c:4019
+msgid "%B: compiled normally and linked with modules compiled with -mrelocatable"
+msgstr "%B: dikompile secara normal dan dihubungkan dengan modul yang dikompile dengan -mrelocatable"
+
+#: elf32-ppc.c:4105
+msgid "Using bss-plt due to %B"
+msgstr "Menggunakan bss-plt karena %B"
+
+#: elf32-ppc.c:6418 elf64-ppc.c:10881
+msgid "%B: unknown relocation type %d for symbol %s"
+msgstr "%B: tipe relokasi %d tidak dikenal untuk simbol %s"
+
+#: elf32-ppc.c:6668
+msgid "%B(%A+0x%lx): non-zero addend on %s reloc against `%s'"
+msgstr "%B(%A+0x%lx): bukan-nol ditambahkan di %s relokasi terhadap `%s'"
+
+#: elf32-ppc.c:7024 elf32-ppc.c:7050 elf32-ppc.c:7109
+msgid "%B: the target (%s) of a %s relocation is in the wrong output section (%s)"
+msgstr "%B: target (%s) dari sebuah relokasi %s berada dalam daerah keluaran salah (%s)"
+
+#: elf32-ppc.c:7164
+msgid "%B: relocation %s is not yet supported for symbol %s."
+msgstr "%B: relokasi %s tidak didukung untuk simbol %s."
+
+#: elf32-ppc.c:7272 elf64-ppc.c:11575
+msgid "%B(%A+0x%lx): %s reloc against `%s': error %d"
+msgstr "%B(%A+0x%lx): %s relokasi terhadap `%s': error %d"
+
+#: elf32-s390.c:2246 elf64-s390.c:2220
+msgid "%B(%A+0x%lx): invalid instruction for TLS relocation %s"
+msgstr "%B(%A+0x%lx): instruksi tidak valid untuk relokasi TLS %s"
+
+#: elf32-score.c:1415 elfxx-mips.c:3273
+msgid "not enough GOT space for local GOT entries"
+msgstr "tidak cukup ruang GOT untuk masukan lokal GOT"
+
+#: elf32-score.c:2545
+#, c-format
+msgid "%s: Malformed reloc detected for section %s"
+msgstr "%s: relokasi malformat terdeteksi untuk bagian %s"
+
+#: elf32-score.c:2596
+msgid "%B: CALL15 reloc at 0x%lx not against global symbol"
+msgstr "%B: CALL15 relokasi di 0x%lx tidak terhadap simbol global"
+
+#: elf32-score.c:3753
+#, c-format
+msgid " [pic]"
+msgstr " [pic]"
+
+#: elf32-score.c:3757
+#, c-format
+msgid " [fix dep]"
+msgstr " [fix dep]"
+
+#: elf32-score.c:3799
+msgid "%B: warning: linking PIC files with non-PIC files"
+msgstr "%B: peringatan: menghubungkan berkas PIC dengan berkas bukan-PIC"
+
+#: elf32-sh-symbian.c:130
+msgid "%B: IMPORT AS directive for %s conceals previous IMPORT AS"
+msgstr "%B: IMPORT SEBAGAI direktif untuk %s menyembunyikan IMPORT SEBAGAI sebelumnya"
+
+#: elf32-sh-symbian.c:383
+msgid "%B: Unrecognised .directive command: %s"
+msgstr "%B: Perintah .directive tidak dikenal: %s"
+
+#: elf32-sh-symbian.c:504
+msgid "%B: Failed to add renamed symbol %s"
+msgstr "%B: Gagal menambahkan simbol diubah namanya %s"
+
+#: elf32-sh.c:533
+msgid "%B: 0x%lx: warning: bad R_SH_USES offset"
+msgstr "%B: 0x%lx: peringatan: ofset R_SH_USES buruk"
+
+#: elf32-sh.c:545
+msgid "%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"
+msgstr "%B: 0x%lx: peringatan: R_SH_USES titik tidak dikenal insn 0x%x"
+
+#: elf32-sh.c:562
+msgid "%B: 0x%lx: warning: bad R_SH_USES load offset"
+msgstr "%B: 0x%lx: peringatan: ofset R_SH_USES beban buruk"
+
+#: elf32-sh.c:577
+msgid "%B: 0x%lx: warning: could not find expected reloc"
+msgstr "%B: 0x%lx: peringatan: tidak dapat menemukan relokasi yang diperkirakan"
+
+#: elf32-sh.c:605
+msgid "%B: 0x%lx: warning: symbol in unexpected section"
+msgstr "%B: 0x%lx: peringatan: simbol dalam bagian yang tidak diperkirakan"
+
+#: elf32-sh.c:731
+msgid "%B: 0x%lx: warning: could not find expected COUNT reloc"
+msgstr "%B: 0x%lx: peringatan: tidak dapat menemukan COUNT relokasi"
+
+#: elf32-sh.c:740
+msgid "%B: 0x%lx: warning: bad count"
+msgstr "%B: 0x%lx: peringatan: jumlah buruk"
+
+#: elf32-sh.c:1144 elf32-sh.c:1514
+msgid "%B: 0x%lx: fatal: reloc overflow while relaxing"
+msgstr "%B: 0x%lx: fatal: relokasi overflow ketika relaxing"
+
+#: elf32-sh.c:3279 elf64-sh64.c:1526
+msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled"
+msgstr "Tidak diperkirakan STO_SH5_ISA32 di simbol lokal tidak ditangani"
+
+#: elf32-sh.c:3516
+msgid "%B: 0x%lx: fatal: unaligned branch target for relax-support relocation"
+msgstr "%B: 0x%lx: fatal: unaligned branch target untuk relax-support relokasi"
+
+#: elf32-sh.c:3549 elf32-sh.c:3564
+msgid "%B: 0x%lx: fatal: unaligned %s relocation 0x%lx"
+msgstr "%B: 0x%lx: fatal: unaligned %s relokasi 0x%lx"
+
+#: elf32-sh.c:3578
+msgid "%B: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"
+msgstr "%B: 0x%lx: fatal: R_SH_PSHA relokasi %d tidak dalam jangkauan -32..32"
+
+#: elf32-sh.c:3592
+msgid "%B: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"
+msgstr "%B: 0x%lx: fatal: R_SH_PSHL relokasi %d tidak dalam jangkauan -32..32"
+
+#: elf32-sh.c:5310 elf64-alpha.c:4552
+msgid "%B: TLS local exec code cannot be linked into shared objects"
+msgstr "%B: TLS lokal exec kode tidak dapat dihubungkan dalam objek terbagi"
+
+#: elf32-sh64.c:222 elf64-sh64.c:2345
+#, c-format
+msgid "%s: compiled as 32-bit object and %s is 64-bit"
+msgstr "%s: dikompile sebagai 32-bit objek dan %s adalah 64-bit"
+
+#: elf32-sh64.c:225 elf64-sh64.c:2348
+#, c-format
+msgid "%s: compiled as 64-bit object and %s is 32-bit"
+msgstr "%s: dikompile sebagai 64-bit objek dan %s adalah 32-bit"
+
+#: elf32-sh64.c:227 elf64-sh64.c:2350
+#, c-format
+msgid "%s: object size does not match that of target %s"
+msgstr "%s: ukuran objek tidak cocok dari target %s"
+
+#: elf32-sh64.c:450 elf64-sh64.c:2888
+#, c-format
+msgid "%s: encountered datalabel symbol in input"
+msgstr "%s: ditemui datalabel simbol dalam masukan"
+
+#: elf32-sh64.c:527
+msgid "PTB mismatch: a SHmedia address (bit 0 == 1)"
+msgstr "PTB tidak cocok: sebuah SHmedia alamat (bit 0 ==1)"
+
+#: elf32-sh64.c:530
+msgid "PTA mismatch: a SHcompact address (bit 0 == 0)"
+msgstr "PTA tidak cocok: sebuah SHcompact alamat (bit 0 == 0)"
+
+#: elf32-sh64.c:548
+#, c-format
+msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16"
+msgstr "%s: GAS error: tidak diduga PTB insn dengan R_SH_PT_16"
+
+#: elf32-sh64.c:597
+msgid "%B: error: unaligned relocation type %d at %08x reloc %p\n"
+msgstr "%B: error: tipe relokasi unaligned %d di %08x relokasi %p\n"
+
+#: elf32-sh64.c:673
+#, c-format
+msgid "%s: could not write out added .cranges entries"
+msgstr "%s: tidak dapat menulis masukan tambahan .cranges"
+
+#: elf32-sh64.c:733
+#, c-format
+msgid "%s: could not write out sorted .cranges entries"
+msgstr "%s: tidak dapat menulis masukan terurut .cranges"
+
+#: elf32-sparc.c:89
+msgid "%B: compiled for a 64 bit system and target is 32 bit"
+msgstr "%B: dikompile untuk sebuah sistem 64 bit dan target adalah 32 bit"
+
+#: elf32-sparc.c:102
+msgid "%B: linking little endian files with big endian files"
+msgstr "%B: menghubungkan berkas little endian dengan berkas big endian"
+
+#: elf32-spu.c:607
+msgid "%X%P: overlay sections %A and %A do not start at the same address.\n"
+msgstr "%X%P: bagian overlay %A dan %A jangan diawali di alamat yang sama.\n"
+
+#: elf32-spu.c:805
+msgid "warning: call to non-function symbol %s defined in %B"
+msgstr "peringatan: panggilan bukan-fungsi simbol %s didefinisikan dalam %B"
+
+#: elf32-spu.c:1406
+msgid "%B is not allowed to define %s"
+msgstr "%B tidak diperbolehkan untuk didefinisikan %s"
+
+#: elf32-spu.c:1453
+#, c-format
+msgid "%s in overlay section"
+msgstr "%s dalam daerah overlay"
+
+#: elf32-spu.c:1469
+msgid "overlay stub relocation overflow"
+msgstr "relokasi stub overlay overflow"
+
+#: elf32-spu.c:1478 elf64-ppc.c:10078
+msgid "stubs don't match calculated size"
+msgstr "stub tidak cocok dengan ukuran yang dihitung"
+
+#: elf32-spu.c:1976
+#, c-format
+msgid "warning: %s overlaps %s\n"
+msgstr "peringatan: %s timpang tindih %s\n"
+
+#: elf32-spu.c:1992
+#, c-format
+msgid "warning: %s exceeds section size\n"
+msgstr "peringatan: %s melebihi ukuran daerah\n"
+
+#: elf32-spu.c:2023
+msgid "%A:0x%v not found in function table\n"
+msgstr "%A:0x%v tidak ditemukan dalam tabel fungsi\n"
+
+#: elf32-spu.c:2165
+msgid "%B(%A+0x%v): call to non-code section %B(%A), analysis incomplete\n"
+msgstr "%B(%A+0x%v): panggilan untuk daerah bukan-kode %B(%A), analysis tidak lengkap\n"
+
+#: elf32-spu.c:2339
+#, c-format
+msgid "%A link_order not found\n"
+msgstr "%A link_order tidak ditemukan\n"
+
+#: elf32-spu.c:2706
+#, c-format
+msgid "Stack analysis will ignore the call from %s to %s\n"
+msgstr "Stack analysis akan mengabaikan panggilan dari %s ke %s\n"
+
+#: elf32-spu.c:3348
+msgid " %s: 0x%v\n"
+msgstr " %s: 0x%v\n"
+
+#: elf32-spu.c:3349
+msgid "%s: 0x%v 0x%v\n"
+msgstr "%s: 0x%v 0x%v\n"
+
+#: elf32-spu.c:3354
+msgid " calls:\n"
+msgstr " panggilan:\n"
+
+#: elf32-spu.c:3362
+#, c-format
+msgid " %s%s %s\n"
+msgstr " %s%s %s\n"
+
+#: elf32-spu.c:3564
+#, c-format
+msgid "%s duplicated in %s\n"
+msgstr "%s duplikasi dalam %s\n"
+
+#: elf32-spu.c:3568
+#, c-format
+msgid "%s duplicated\n"
+msgstr "%s duplikasi\n"
+
+#: elf32-spu.c:3575
+msgid "sorry, no support for duplicate object files in auto-overlay script\n"
+msgstr "maaf, tidak ada dukungan untuk duplikasi berkas objek dalam auto-overlay script\n"
+
+#: elf32-spu.c:3605
+msgid "non-overlay size of 0x%v plus maximum overlay size of 0x%v exceeds local store\n"
+msgstr "ukuran non-overlay dari 0x%v plus maksimul overlay size dari 0x%v melebihi lokal store\n"
+
+#: elf32-spu.c:3741
+msgid "%B:%A%s exceeds overlay size\n"
+msgstr "%B:%A%s melebihi ukuran overlay\n"
+
+#: elf32-spu.c:3862
+msgid "Stack size for call graph root nodes.\n"
+msgstr "Ukuran stack untuk panggilan graph titik root.\n"
+
+#: elf32-spu.c:3863
+msgid ""
+"\n"
+"Stack size for functions. Annotations: '*' max stack, 't' tail call\n"
+msgstr ""
+"\n"
+"Ukuran stack untuk fungsi. Anotasi: '*' max stack, 't' tail call\n"
+
+#: elf32-spu.c:3871
+msgid "Maximum stack required is 0x%v\n"
+msgstr "Maksimal stack dibutuhkan adalah 0x%v\n"
+
+#: elf32-spu.c:4067
+msgid "%B(%s+0x%lx): unresolvable %s relocation against symbol `%s'"
+msgstr "%B(%s=0x%lx): tidak teresolf %s relokasi terhadap simbol `%s'"
+
+#: elf32-v850.c:165
+#, c-format
+msgid "Variable `%s' cannot occupy in multiple small data regions"
+msgstr "Variabel `%s' tidak dapat mengisi dalam beberapa daerah data kecil"
+
+#: elf32-v850.c:168
+#, c-format
+msgid "Variable `%s' can only be in one of the small, zero, and tiny data regions"
+msgstr "Variabel `%s' hanya dapat berada dalam satu dari kecil, nol, dan sangat kecil daerah data"
+
+#: elf32-v850.c:171
+#, c-format
+msgid "Variable `%s' cannot be in both small and zero data regions simultaneously"
+msgstr "Variabel `%s' tidak dapat berada dalam kecil dan nol daerah data secara bersamaan"
+
+#: elf32-v850.c:174
+#, c-format
+msgid "Variable `%s' cannot be in both small and tiny data regions simultaneously"
+msgstr "Variabel `%s' tidak dapat berada dalam kecil dan sangat kecil daerah data secara bersamaan"
+
+#: elf32-v850.c:177
+#, c-format
+msgid "Variable `%s' cannot be in both zero and tiny data regions simultaneously"
+msgstr "variabel `%s' tidak dapat dalam nol dan kecil daerah data secara bersamaan"
+
+#: elf32-v850.c:480
+#, c-format
+msgid "FAILED to find previous HI16 reloc\n"
+msgstr "GAGAL untuk menemukan relokasi HI16 sebelumnya\n"
+
+#: elf32-v850.c:1715
+msgid "could not locate special linker symbol __gp"
+msgstr "tidak dapat menemukan simbol linker spesial __gp"
+
+#: elf32-v850.c:1719
+msgid "could not locate special linker symbol __ep"
+msgstr "tidak dapat menemukan simbol linker spesial __ep"
+
+#: elf32-v850.c:1723
+msgid "could not locate special linker symbol __ctbp"
+msgstr "tidak dapat menemukan simbol linker spesial __ctbp"
+
+#: elf32-v850.c:1873
+msgid "%B: Architecture mismatch with previous modules"
+msgstr "%B: Arsitektur tidak cocok dengan modul sebelumnya"
+
+#: elf32-v850.c:1892
+#, c-format
+msgid "private flags = %lx: "
+msgstr "private flags = %lx: "
+
+#: elf32-v850.c:1897
+#, c-format
+msgid "v850 architecture"
+msgstr "v850 arsitektur"
+
+#: elf32-v850.c:1898
+#, c-format
+msgid "v850e architecture"
+msgstr "v850e arsitektur"
+
+#: elf32-v850.c:1899
+#, c-format
+msgid "v850e1 architecture"
+msgstr "v850e1 arsitektur"
+
+#: elf32-vax.c:541
+#, c-format
+msgid " [nonpic]"
+msgstr " [bukan-pic]"
+
+#: elf32-vax.c:544
+#, c-format
+msgid " [d-float]"
+msgstr " [d-float]"
+
+#: elf32-vax.c:547
+#, c-format
+msgid " [g-float]"
+msgstr " [g-float]"
+
+#: elf32-vax.c:657
+#, c-format
+msgid "%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of %ld"
+msgstr "%s: peringatan: GOT ditambahkan dari %ld ke `%s' tidak cocok dengan penambahan GOT sebelumnya dari %ld"
+
+#: elf32-vax.c:1589
+#, c-format
+msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored"
+msgstr "%s: peringatan: PLT ditambahkan dari %d ke `%s' dari %s bagian diabaikan"
+
+#: elf32-vax.c:1726
+#, c-format
+msgid "%s: warning: %s relocation against symbol `%s' from %s section"
+msgstr "%s: peringatan: %s relokasi terhadap simbol `%s' dari bagian %s"
+
+#: elf32-vax.c:1732
+#, c-format
+msgid "%s: warning: %s relocation to 0x%x from %s section"
+msgstr "%s: peringatan: relokasi %s ke 0x%x dari daerah %s"
+
+#: elf32-xstormy16.c:451 elf32-ia64.c:2794 elf64-ia64.c:2794
+msgid "non-zero addend in @fptr reloc"
+msgstr "bukan-nol ditambahkan dalam @fptr relokasi"
+
+#: elf32-xtensa.c:911
+msgid "%B(%A): invalid property table"
+msgstr "%B(%A): tabel properti tidak valid"
+
+#: elf32-xtensa.c:2734
+msgid "%B(%A+0x%lx): relocation offset out of range (size=0x%x)"
+msgstr "%B(%A+0x%lx): ofset relokasi diluar jangkauan (size=0x%x)"
+
+#: elf32-xtensa.c:2813 elf32-xtensa.c:2934
+msgid "dynamic relocation in read-only section"
+msgstr "relokasi dinamis dalam bagian baca-saja"
+
+#: elf32-xtensa.c:2910
+msgid "TLS relocation invalid without dynamic sections"
+msgstr "relokasi TLS tidak valid tanpa bagian dinamis"
+
+#: elf32-xtensa.c:3127
+msgid "internal inconsistency in size of .got.loc section"
+msgstr "internal tidak konsisten dalam ukuran dari daerah .got.loc"
+
+#: elf32-xtensa.c:3437
+msgid "%B: incompatible machine type. Output is 0x%x. Input is 0x%x"
+msgstr "%B: tipe mesin tidak kompatibel. Keluaran adalah 0x%x. Masukan adalah 0x%x"
+
+#: elf32-xtensa.c:4666 elf32-xtensa.c:4674
+msgid "Attempt to convert L32R/CALLX to CALL failed"
+msgstr "Mencoba untuk mengubah L32R/CALLX ke CALL gagal"
+
+#: elf32-xtensa.c:6276 elf32-xtensa.c:6352 elf32-xtensa.c:7468
+msgid "%B(%A+0x%lx): could not decode instruction; possible configuration mismatch"
+msgstr "%B(%A+0x%lx): tidak dapat mendeko instruksi; mungkin konfigurasi tidak cocok"
+
+#: elf32-xtensa.c:7208
+msgid "%B(%A+0x%lx): could not decode instruction for XTENSA_ASM_SIMPLIFY relocation; possible configuration mismatch"
+msgstr "%B(%A+0x%lx): tidak dapat mendeko instruksi untuk XTENSA_ASM_SIMPLIFY relokasi; mungkin konfigurasi tidak cocok"
+
+#: elf32-xtensa.c:8969
+msgid "invalid relocation address"
+msgstr "alamat relokasi tidak valid"
+
+#: elf32-xtensa.c:9018
+msgid "overflow after relaxation"
+msgstr "overflow setelah relaksasi"
+
+#: elf32-xtensa.c:10154
+msgid "%B(%A+0x%lx): unexpected fix for %s relocation"
+msgstr "%B(%A+0x%lx): unexpected fix untuk relokasi %s"
+
+#: elf64-alpha.c:452
+msgid "GPDISP relocation did not find ldah and lda instructions"
+msgstr "GPDISP relokasi tidak dapat menemukan instruksi ldah dan lda"
+
+#: elf64-alpha.c:2416
+msgid "%B: .got subsegment exceeds 64K (size %d)"
+msgstr "%B: .got subsegmen melebihi 64K (size %d)"
+
+#: elf64-alpha.c:4296 elf64-alpha.c:4308
+msgid "%B: gp-relative relocation against dynamic symbol %s"
+msgstr "%B: gp-relative relokasi terhadap simbol dinamis %s"
+
+#: elf64-alpha.c:4334 elf64-alpha.c:4469
+msgid "%B: pc-relative relocation against dynamic symbol %s"
+msgstr "%B: pc-relative relokasi terhadap simbol dinamis %s"
+
+#: elf64-alpha.c:4362
+msgid "%B: change in gp: BRSGP %s"
+msgstr "%B: perubahan dalam gp: BRSGP %s"
+
+#: elf64-alpha.c:4387
+msgid "<unknown>"
+msgstr "<tidak dikenal>"
+
+#: elf64-alpha.c:4392
+msgid "%B: !samegp reloc against symbol without .prologue: %s"
+msgstr "%B: !samegp relokasi terhadap simbol tanpa .prologue: %s"
+
+#: elf64-alpha.c:4444
+msgid "%B: unhandled dynamic relocation against %s"
+msgstr "%B: relokasi dinamis tidak ditangani terhadap %s"
+
+#: elf64-alpha.c:4476
+msgid "%B: pc-relative relocation against undefined weak symbol %s"
+msgstr "%B: pc-relative relokasi terhadap simbol lemah tidak terdefinisi %s"
+
+#: elf64-alpha.c:4536
+msgid "%B: dtp-relative relocation against dynamic symbol %s"
+msgstr "%B: dtp-relative relokasi terhadap simbol dinamis %s"
+
+#: elf64-alpha.c:4559
+msgid "%B: tp-relative relocation against dynamic symbol %s"
+msgstr "%B: tp-relative relokasi terhadap simbol dinamis %s"
+
+#: elf64-hppa.c:2071
+#, c-format
+msgid "stub entry for %s cannot load .plt, dp offset = %ld"
+msgstr "masukan stub untuk %s tidak dapat diload .plt, dp ofset = %ld"
+
+#: elf64-mmix.c:1177
+#, c-format
+msgid ""
+"%s: Internal inconsistency error for value for\n"
+" linker-allocated global register: linked: 0x%lx%08lx != relaxed: 0x%lx%08lx\n"
+msgstr ""
+"%s: Internal tidak konsisten error untuk nilai untuk\n"
+" linker-allocated global register: terhubung: 0x%lx%08lx != relaxed: 0x%lx%08lx\n"
+
+#: elf64-mmix.c:1618
+#, c-format
+msgid "%s: base-plus-offset relocation against register symbol: (unknown) in %s"
+msgstr "%s: base-plus-offset relokasi terhadap simbol register: (tidak diketahui) dalam %s"
+
+#: elf64-mmix.c:1623
+#, c-format
+msgid "%s: base-plus-offset relocation against register symbol: %s in %s"
+msgstr "%s: base-plus-offset relokasi terhadap simbol register: %s dalam %s"
+
+#: elf64-mmix.c:1667
+#, c-format
+msgid "%s: register relocation against non-register symbol: (unknown) in %s"
+msgstr "%s: register relokasi terhadap non-register simbol: (tidak diketahui) dalam %s"
+
+#: elf64-mmix.c:1672
+#, c-format
+msgid "%s: register relocation against non-register symbol: %s in %s"
+msgstr "%s: register relokasi terhadap bukan-register simbol: %s dalam %s"
+
+#: elf64-mmix.c:1709
+#, c-format
+msgid "%s: directive LOCAL valid only with a register or absolute value"
+msgstr "%s: direktif LOKAL hanya valid dengan sebuah register atau nilai absolut"
+
+#: elf64-mmix.c:1737
+#, c-format
+msgid "%s: LOCAL directive: Register $%ld is not a local register. First global register is $%ld."
+msgstr "%s: LOKAL direktif: Register $%ld bukan sebuah lokal register. Pertama global registar adala $%ld."
+
+#: elf64-mmix.c:2201
+#, c-format
+msgid "%s: Error: multiple definition of `%s'; start of %s is set in a earlier linked file\n"
+msgstr "%s: Error: multiple definisi dari `%s'; awal dari %s adalah diset dalam sebuah sebelum berkas terlink\n"
+
+#: elf64-mmix.c:2259
+msgid "Register section has contents\n"
+msgstr "Daerah register memiliki isi\n"
+
+#: elf64-mmix.c:2451
+#, c-format
+msgid ""
+"Internal inconsistency: remaining %u != max %u.\n"
+" Please report this bug."
+msgstr ""
+"Internal tidak konsisten: sisa %u != max %u.\n"
+" Tolong laporkan bug ini."
+
+#: elf64-ppc.c:2561 libbfd.c:978
+msgid "%B: compiled for a big endian system and target is little endian"
+msgstr "%B: dikompile untuk sebuah sistem big endian dan target adalah little endian"
+
+#: elf64-ppc.c:2564 libbfd.c:980
+msgid "%B: compiled for a little endian system and target is big endian"
+msgstr "%B: dikompile untuk sebuah sistem little endian dan target adalah big endian"
+
+#: elf64-ppc.c:6065
+#, c-format
+msgid "copy reloc against `%s' requires lazy plt linking; avoid setting LD_BIND_NOW=1 or upgrade gcc"
+msgstr "salin relokasi terhadap `%s' membutuhkan lazy plt linking; hindari konfigurasi LD_BIND_NOW=1 atau upgrade gcc"
+
+#: elf64-ppc.c:6486
+msgid "dynreloc miscount for %B, section %A"
+msgstr "dynareloc miscount untuk %B, bagian %A"
+
+#: elf64-ppc.c:6570
+msgid "%B: .opd is not a regular array of opd entries"
+msgstr "%B: .opd adalah bukan array regular dari masukan opd"
+
+#: elf64-ppc.c:6579
+msgid "%B: unexpected reloc type %u in .opd section"
+msgstr "%B: tipe relokasi %u tidak diduga dalam bagian .opd"
+
+#: elf64-ppc.c:6600
+msgid "%B: undefined sym `%s' in .opd section"
+msgstr "%B: tidak terdefinisi simbol `%s' dalam bagian .opd"
+
+#: elf64-ppc.c:7377 elf64-ppc.c:7754
+#, c-format
+msgid "%s defined in removed toc entry"
+msgstr "%s terdefinisi dalam masukan toc terhapus"
+
+#: elf64-ppc.c:8581
+#, c-format
+msgid "long branch stub `%s' offset overflow"
+msgstr "stub brach panjang `%s' ofset overflow"
+
+#: elf64-ppc.c:8640
+#, c-format
+msgid "can't find branch stub `%s'"
+msgstr "tidak dapat menemukan branch stub `%s'"
+
+#: elf64-ppc.c:8702 elf64-ppc.c:8822
+#, c-format
+msgid "linkage table error against `%s'"
+msgstr "linkage tabel error terhadap `%s'"
+
+#: elf64-ppc.c:8978
+#, c-format
+msgid "can't build branch stub `%s'"
+msgstr "tidak dapat membuat branch stub `%s'"
+
+#: elf64-ppc.c:9451
+msgid "%B section %A exceeds stub group size"
+msgstr "%B bagian %A melebihi ukuran grup stub"
+
+#: elf64-ppc.c:10090
+#, c-format
+msgid ""
+"linker stubs in %u group%s\n"
+" branch %lu\n"
+" toc adjust %lu\n"
+" long branch %lu\n"
+" long toc adj %lu\n"
+" plt call %lu"
+msgstr ""
+"linker stubs dalam %u grup %s\n"
+" cabang %lu\n"
+" toc adjust %lu\n"
+" cabang panjang %lu\n"
+" long toc adj %lu\n"
+" plt call %lu"
+
+#: elf64-ppc.c:10769
+msgid "%B(%A+0x%lx): automatic multiple TOCs not supported using your crt files; recompile with -mminimal-toc or upgrade gcc"
+msgstr "%B(%A+0x%lx): otomatis multiple TOC tidak didukung menggunakan berkas crt anda; rekompile dengan -mminimal-toc atau upgrade gcc"
+
+#: elf64-ppc.c:10777
+msgid "%B(%A+0x%lx): sibling call optimization to `%s' does not allow automatic multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, or make `%s' extern"
+msgstr "%B(%A+0x%lx): sibling call optimization ke `%s' tidak membolehkan otomatis multiple TOC; rekompile dengan -mminimal-toc atau -fno-optimize-sibling-calls, atau buat `%s' extern"
+
+#: elf64-ppc.c:11427
+msgid "%B: relocation %s is not supported for symbol %s."
+msgstr "%B: relokasi %s tidak didukung untuk simbol %s."
+
+#: elf64-ppc.c:11509
+msgid "%B: error: relocation %s not a multiple of %d"
+msgstr "%B: error: relokasi %s bukan multiple dari %d"
+
+#: elf64-sh64.c:1701
+#, c-format
+msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n"
+msgstr "%s: error: tipe relokasi %d unaligned di %08x relokasi %08x\n"
+
+#: elf64-sparc.c:439
+msgid "%B: Only registers %%g[2367] can be declared using STT_REGISTER"
+msgstr "%B: Hanya register %%g[2367] dapat dideklarasikan menggunakan STT_REGISTER"
+
+#: elf64-sparc.c:459
+msgid "Register %%g%d used incompatibly: %s in %B, previously %s in %B"
+msgstr "Register %%g%d digunakan tidak kompatibel: %s dalam %B, sebelumnya %s dalam %B"
+
+#: elf64-sparc.c:482
+msgid "Symbol `%s' has differing types: REGISTER in %B, previously %s in %B"
+msgstr "Simbol `%s' memiliki tipe berbeda: REGISTER dalam %B, sebelumnya %s dalam %B"
+
+#: elf64-sparc.c:527
+msgid "Symbol `%s' has differing types: %s in %B, previously REGISTER in %B"
+msgstr "Simbol `%s' memiliki tipe berbeda: %s dalam %B, sebelumnya REGISTER dalam %B"
+
+#: elf64-sparc.c:678
+msgid "%B: linking UltraSPARC specific with HAL specific code"
+msgstr "%B: menghubungkan UltraSPARC spesifik dengan HAL spesifik kode"
+
+#: elf64-x86-64.c:1047 elf64-x86-64.c:1207 elfxx-mips.c:7834
+msgid "%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"
+msgstr "%B: relokasi %s terhadap `%s' tidak dapat digunkan ketika membuat sebuah objek terbagi; rekompile dengan -fPIC"
+
+#: elf64-x86-64.c:1138
+msgid "%B: '%s' accessed both as normal and thread local symbol"
+msgstr "%B: '%s' keduanya diakses secara normal dan thread simbol lokal"
+
+#: elf64-x86-64.c:2559
+msgid "%B: relocation R_X86_64_GOTOFF64 against protected function `%s' can not be used when making a shared object"
+msgstr "%B: relokasi R_X86_64_GOTOFF64 terhadap fungsi terproteksi `%s' tidak dapat digunakan ketika membuat sebuah objek terbagi"
+
+#: elf64-x86-64.c:2670
+msgid "; recompile with -fPIC"
+msgstr "; rekompile dengan -fPIC"
+
+#: elf64-x86-64.c:2675
+msgid "%B: relocation %s against %s `%s' can not be used when making a shared object%s"
+msgstr "%B: relokasi %s terhadap %s `%s' tidak dapat digunakan ketika membuat sebuah objek terbagi%s"
+
+#: elf64-x86-64.c:2677
+msgid "%B: relocation %s against undefined %s `%s' can not be used when making a shared object%s"
+msgstr "%B: relokasi %s terhadap tidak terdefinisi %s `%s' tidak dapat digunakan ketika membuat sebuah objek terbagi %s"
+
+#: elfcode.h:795
+#, c-format
+msgid "warning: %s has a corrupt string table index - ignoring"
+msgstr "peringatan: %s memiliki sebuah string tabel korup index - diabaikan"
+
+#: elfcode.h:1201
+#, c-format
+msgid "%s: version count (%ld) does not match symbol count (%ld)"
+msgstr "%s: versi terhitung (%ld) tidak cocok dengan simbol terhitung (%ld)"
+
+#: elfcode.h:1435
+#, c-format
+msgid "%s(%s): relocation %d has invalid symbol index %ld"
+msgstr "%s(%s): relokasi %d memiliki indek simbol tidak valid %ld"
+
+#: elfcore.h:251
+msgid "Warning: %B is truncated: expected core file size >= %lu, found: %lu."
+msgstr "Peringatan: %B terpotong: diperkirakan ukuran berkas core >= %lu, ditemukan: %lu."
+
+#: elflink.c:1028
+msgid "%s: TLS definition in %B section %A mismatches non-TLS definition in %B section %A"
+msgstr "%s: TLS definisi dalam %B bagian %A tidak cocok bukan-TLS definisi dalam %B bagian %A"
+
+#: elflink.c:1032
+msgid "%s: TLS reference in %B mismatches non-TLS reference in %B"
+msgstr "%s: TLS referensi dalam %B tidak cocok bukan-TLS referensi dalam %B"
+
+#: elflink.c:1036
+msgid "%s: TLS definition in %B section %A mismatches non-TLS reference in %B"
+msgstr "%s: TLS definisi dalam %B bagian %A tidak cocok bukan-TLS referensi dalam %B"
+
+#: elflink.c:1040
+msgid "%s: TLS reference in %B mismatches non-TLS definition in %B section %A"
+msgstr "%s: TLS referensi dalam %B tidak cocok bukan-TLS definisi dalam %B bagian %A"
+
+#: elflink.c:1654
+msgid "%B: unexpected redefinition of indirect versioned symbol `%s'"
+msgstr "%B: tidak diduga redefinisi dari indirek versioned simbol `%s'"
+
+#: elflink.c:1982
+msgid "%B: version node not found for symbol %s"
+msgstr "%B: titik versi tidak ditemukan untuk simbol %s"
+
+#: elflink.c:2130
+msgid "%B: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%A'"
+msgstr "%B: bad relokasi simbol indeks (0x%lx >= 0x%lx) untuk ofset 0x%lx dalam daerah `%A'"
+
+#: elflink.c:2327
+msgid "%B: relocation size mismatch in %B section %A"
+msgstr "%B: ukuran relokasi tidak cocok dalam %B bagian %A"
+
+#: elflink.c:2629
+#, c-format
+msgid "warning: type and size of dynamic symbol `%s' are not defined"
+msgstr "peringatan: tipe dan ukuran dari simbol dinamis `%s' tidak terdefinisi"
+
+#: elflink.c:3953
+msgid "%B: %s: invalid version %u (max %d)"
+msgstr "%B: %s: versi %u tidak valid (max %d)"
+
+#: elflink.c:3989
+msgid "%B: %s: invalid needed version %d"
+msgstr "%B: %s: tidak valid dibutuhkan versi %d"
+
+#: elflink.c:4172
+msgid "Warning: alignment %u of common symbol `%s' in %B is greater than the alignment (%u) of its section %A"
+msgstr "Peringatan: alignmen %u dari simbol umum `%s' dalam %B adalah lebih besar daripada alignment (%u) dari bagian ini %A"
+
+#: elflink.c:4178
+msgid "Warning: alignment %u of symbol `%s' in %B is smaller than %u in %B"
+msgstr "Peringatan: alignment %u dari simbol `%s' dalam %B adalah lebih kecil daripada %u dalam %B"
+
+#: elflink.c:4193
+msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B"
+msgstr "Peringatan: ukuran dari simbol `%s' berubah dari %lu dalam %B ke %lu dalam %B"
+
+#: elflink.c:4371
+#, c-format
+msgid "%s: invalid DSO for symbol `%s' definition"
+msgstr "%s: tidak valid DSO untuk simbol `%s' definisi"
+
+#: elflink.c:5621
+#, c-format
+msgid "%s: undefined version: %s"
+msgstr "%s: versi tidak terdefinisi: %s"
+
+#: elflink.c:5689
+msgid "%B: .preinit_array section is not allowed in DSO"
+msgstr "%B: .preinit_array bagian tidak diperbolehkan dalam DSO"
+
+#: elflink.c:7414
+#, c-format
+msgid "undefined %s reference in complex symbol: %s"
+msgstr "undefined %s referensi dalam simbol kompleks: %s"
+
+#: elflink.c:7568
+#, c-format
+msgid "unknown operator '%c' in complex symbol"
+msgstr "operator tidak diketahui '%c' dalam simbol kompleks"
+
+#: elflink.c:7904 elflink.c:7921 elflink.c:7958 elflink.c:7975
+msgid "%B: Unable to sort relocs - they are in more than one size"
+msgstr "%B: Tidak dapat mengurutkan relokasi - mereka berada dalam lebih dari satu ukuran"
+
+#: elflink.c:7935 elflink.c:7989
+msgid "%B: Unable to sort relocs - they are of an unknown size"
+msgstr "%B: Tidak dapat mengurutkan relokasi - mereka dari ukuran yang tidak diketahui"
+
+#: elflink.c:8038
+msgid "Not enough memory to sort relocations"
+msgstr "Tidak cukup memori untuk mengurutkan relokasi"
+
+#: elflink.c:8227
+msgid "%B: Too many sections: %d (>= %d)"
+msgstr "%B: Terlalu banyak bagian: %d (>= %d)"
+
+#: elflink.c:8461
+msgid "%B: %s symbol `%s' in %B is referenced by DSO"
+msgstr "%B: %s simbol `%s' dalam %B adalah direferensikan oleh DSO"
+
+#: elflink.c:8544
+msgid "%B: could not find output section %A for input section %A"
+msgstr "%B: tidak dapat menemukan bagian keluaran %A untuk daerah masukan %A"
+
+#: elflink.c:8655
+msgid "%B: %s symbol `%s' isn't defined"
+msgstr "%B: %s simbol `%s' tidak didefinisikan"
+
+#: elflink.c:9141
+msgid "error: %B contains a reloc (0x%s) for section %A that references a non-existent global symbol"
+msgstr "error: %B berisi sebuah relokasi (0x%s) untuk daerah %A yang mereferensikan sebuah bukan-exist simbol global"
+
+#: elflink.c:9205
+msgid "%X`%s' referenced in section `%A' of %B: defined in discarded section `%A' of %B\n"
+msgstr "%X`%s' direferensikan dalam daerah `%A' dari %B: didefinisikan dalam daerah diabaikan `%A' dari %B\n"
+
+#: elflink.c:9825
+msgid "%A has both ordered [`%A' in %B] and unordered [`%A' in %B] sections"
+msgstr "%A memiliki keduanya terurut [`%A' dalam %B] dan daerah tidak terurut [`%A' dalam %B]"
+
+#: elflink.c:9830
+#, c-format
+msgid "%A has both ordered and unordered sections"
+msgstr "%A memiliki daerah terurut dan tidak terurut"
+
+#: elflink.c:10715 elflink.c:10759
+msgid "%B: could not find output section %s"
+msgstr "%B: tidak dapat menemukan daerah keluaran %s"
+
+#: elflink.c:10720
+#, c-format
+msgid "warning: %s section has zero size"
+msgstr "peringatan: %s daerah memiliki ukuran nol"
+
+#: elflink.c:10824
+msgid "%P: warning: creating a DT_TEXTREL in a shared object.\n"
+msgstr "%P: peringatan: membuat sebuah DT_TEXTREL dalam sebuah objek terbagi.\n"
+
+#: elflink.c:11006
+msgid "%P%X: can not read symbols: %E\n"
+msgstr "%P%X: tidak dapat membaca simbol: %E\n"
+
+#: elflink.c:11313
+msgid "Removing unused section '%s' in file '%B'"
+msgstr "Menghapus daerah tidak digunakan '%s' dalam berkas '%B'"
+
+#: elflink.c:11525
+msgid "Warning: gc-sections option ignored"
+msgstr "Peringatan: gc-sections opsi diabaikan"
+
+#: elflink.c:12056
+msgid "%B: ignoring duplicate section `%A'"
+msgstr "%B: peringatan daerah duplikasi `%A'"
+
+#: elflink.c:12063 elflink.c:12070
+msgid "%B: duplicate section `%A' has different size"
+msgstr "%B: daerah duplikasi `%A' memiliki ukuran berbeda"
+
+#: elflink.c:12078 elflink.c:12083
+msgid "%B: warning: could not read contents of section `%A'"
+msgstr "%B: peringatan: tidak dapat membaca isi dari daerah `%A'"
+
+#: elflink.c:12087
+msgid "%B: warning: duplicate section `%A' has different contents"
+msgstr "%B: peringatan: duplikasi daerah `%A' memiliki isi berbeda"
+
+#: elflink.c:12166 linker.c:3080
+msgid "%F%P: already_linked_table: %E"
+msgstr "%F%P: already_linked_table: %E"
+
+#: elfxx-mips.c:1197
+msgid "static procedure (no name)"
+msgstr "prosedur statis (tidak bernama)"
+
+#: elfxx-mips.c:5562
+msgid "%B: %A+0x%lx: jump to stub routine which is not jal"
+msgstr "%B: %A+0x%lx: lompat ke routine stub dimana bukan jal"
+
+#: elfxx-mips.c:6206 elfxx-mips.c:6427
+msgid "%B: Warning: bad `%s' option size %u smaller than its header"
+msgstr "%B: Peringatan: opsi `%s' buruk ukuran %u lebih kecil dari headernya"
+
+#: elfxx-mips.c:7174 elfxx-mips.c:7299
+msgid "%B: Warning: cannot determine the target function for stub section `%s'"
+msgstr "%B: Peringatan: tidak dapat menentukan fungsi terget untuk daerah stub `%s'"
+
+#: elfxx-mips.c:7428
+msgid "%B: Malformed reloc detected for section %s"
+msgstr "%B: Malformed relokasi terdeteksi untuk daerah %s"
+
+#: elfxx-mips.c:7468
+msgid "%B: GOT reloc at 0x%lx not expected in executables"
+msgstr "%B: GOT relokasi di 0x%lx tidak diduga dalam aplikasi"
+
+#: elfxx-mips.c:7566
+msgid "%B: CALL16 reloc at 0x%lx not against global symbol"
+msgstr "%B: CALL16 relokasi di 0x%lx tidak terhadap simbol global"
+
+#: elfxx-mips.c:8244
+#, c-format
+msgid "non-dynamic relocations refer to dynamic symbol %s"
+msgstr "bukan-dinamis relokasi refer ke simbol dinamis %s"
+
+#: elfxx-mips.c:8947
+msgid "%B: Can't find matching LO16 reloc against `%s' for %s at 0x%lx in section `%A'"
+msgstr "%B: Tidak dapat menemukan cocok LO16 relokasi terhadap `%s' untuk %s di 0x%lx di daerah `%A'"
+
+#: elfxx-mips.c:9086
+msgid "small-data section exceeds 64KB; lower small-data size limit (see option -G)"
+msgstr "daerah data-kecil melebihi 64KB; dibawah data-kecil batas ukuran (lihat opsi -G)"
+
+#: elfxx-mips.c:11887
+#, c-format
+msgid "%s: illegal section name `%s'"
+msgstr "%s: nama daerah `%s' ilegal"
+
+#: elfxx-mips.c:12262 elfxx-mips.c:12288
+msgid "Warning: %B uses -msingle-float, %B uses -mdouble-float"
+msgstr "Peringatan: %B menggunakan 0msingle-float, %B menggunakan -mdouble-float"
+
+#: elfxx-mips.c:12274 elfxx-mips.c:12330
+msgid "Warning: %B uses -msingle-float, %B uses -mips32r2 -mfp64"
+msgstr "Peringatan: %B menggunakan -msingle-float, %B menggunakan -mips32r2 -mfp64"
+
+#: elfxx-mips.c:12300 elfxx-mips.c:12336
+msgid "Warning: %B uses -mdouble-float, %B uses -mips32r2 -mfp64"
+msgstr "Peringatan: %B menggunakan -mdouble-float, %B menggunakan -mips32r2 -mfp64"
+
+#: elfxx-mips.c:12378
+msgid "%B: endianness incompatible with that of the selected emulation"
+msgstr "%B: endianness tidak kompatibel dengan yang dipilih di emulasi"
+
+#: elfxx-mips.c:12389
+msgid "%B: ABI is incompatible with that of the selected emulation"
+msgstr "%B: ABI tidak kompatibel dengan yang dipilih di emulasi"
+
+#: elfxx-mips.c:12470
+msgid "%B: warning: linking abicalls files with non-abicalls files"
+msgstr "%B: peringatan: menghubungkan berkas abicalls dengan berkas bukan-abicalls"
+
+#: elfxx-mips.c:12487
+msgid "%B: linking 32-bit code with 64-bit code"
+msgstr "%B: menghubungkan 32-bit kode dengan 64-bit kode"
+
+#: elfxx-mips.c:12515
+msgid "%B: linking %s module with previous %s modules"
+msgstr "%B: menghubungkan %s modul dengan modul %s sebelumnya"
+
+#: elfxx-mips.c:12538
+msgid "%B: ABI mismatch: linking %s module with previous %s modules"
+msgstr "%B: ABI tidak cocok: menghubungkan modul %s dengan modul %s sebelumnya"
+
+#: elfxx-mips.c:12702
+#, c-format
+msgid " [abi=O32]"
+msgstr " [abi=032]"
+
+#: elfxx-mips.c:12704
+#, c-format
+msgid " [abi=O64]"
+msgstr " [abi=064]"
+
+#: elfxx-mips.c:12706
+#, c-format
+msgid " [abi=EABI32]"
+msgstr " [abi=EABI32]"
+
+#: elfxx-mips.c:12708
+#, c-format
+msgid " [abi=EABI64]"
+msgstr " [abi=EABI64]"
+
+#: elfxx-mips.c:12710
+#, c-format
+msgid " [abi unknown]"
+msgstr " [abi tidak diketahui]"
+
+#: elfxx-mips.c:12712
+#, c-format
+msgid " [abi=N32]"
+msgstr " [abi=N32]"
+
+#: elfxx-mips.c:12714
+#, c-format
+msgid " [abi=64]"
+msgstr " [abi=64]"
+
+#: elfxx-mips.c:12716
+#, c-format
+msgid " [no abi set]"
+msgstr " [bukan abi set]"
+
+#: elfxx-mips.c:12737
+#, c-format
+msgid " [unknown ISA]"
+msgstr " [ISA tidak diketahui]"
+
+#: elfxx-mips.c:12748
+#, c-format
+msgid " [not 32bitmode]"
+msgstr " [bukan 32bitmode]"
+
+#: elfxx-sparc.c:440
+#, c-format
+msgid "invalid relocation type %d"
+msgstr "tipe relokasi %d tidak valid"
+
+#: elfxx-sparc.c:2976
+msgid "%B: probably compiled without -fPIC?"
+msgstr "%B: mungkin dikompile tanpa -fPIC?"
+
+#: i386linux.c:455 m68klinux.c:459 sparclinux.c:453
+#, c-format
+msgid "Output file requires shared library `%s'\n"
+msgstr "Berkas keluaran membutuhkan library terbagi `%s'\n"
+
+#: i386linux.c:463 m68klinux.c:467 sparclinux.c:461
+#, c-format
+msgid "Output file requires shared library `%s.so.%s'\n"
+msgstr "Berkas keluaran membutuhkan library terbagi `%s.so.%s'\n"
+
+#: i386linux.c:652 i386linux.c:702 m68klinux.c:659 m68klinux.c:707
+#: sparclinux.c:651 sparclinux.c:701
+#, c-format
+msgid "Symbol %s not defined for fixups\n"
+msgstr "Simbol %s tidak terdefinisi untuk fixups\n"
+
+#: i386linux.c:726 m68klinux.c:731 sparclinux.c:725
+msgid "Warning: fixup count mismatch\n"
+msgstr "Peringatan: jumlah fixup tidak cocok\n"
+
+#: ieee.c:159
+#, c-format
+msgid "%s: string too long (%d chars, max 65535)"
+msgstr "%s: string terlalu panjang (%d chars, max 65535)"
+
+#: ieee.c:286
+#, c-format
+msgid "%s: unrecognized symbol `%s' flags 0x%x"
+msgstr "%s: simbol tidak dikenal `%s' flags 0x%x"
+
+#: ieee.c:788
+msgid "%B: unimplemented ATI record %u for symbol %u"
+msgstr "%B: tidak terimplementasi ATI record %u untuk simbol %u"
+
+#: ieee.c:812
+msgid "%B: unexpected ATN type %d in external part"
+msgstr "%B: tipe ATN %d tidak diduga dalam bagian luar"
+
+#: ieee.c:834
+msgid "%B: unexpected type after ATN"
+msgstr "%B: tidak diduga tipe sesudah ATN"
+
+#: ihex.c:230
+msgid "%B:%d: unexpected character `%s' in Intel Hex file"
+msgstr "%B:%d: tidak diduga karakter `%s' dalam berkas Intel Hex"
+
+#: ihex.c:337
+msgid "%B:%u: bad checksum in Intel Hex file (expected %u, found %u)"
+msgstr "%B:%u: checksum buruk dalam berkas Intel Hex (diperkirakan %u, ditemukan %u)"
+
+#: ihex.c:392
+msgid "%B:%u: bad extended address record length in Intel Hex file"
+msgstr "%B:%u: buruk extended alamat panjang record dalam berkas Intel Hex"
+
+#: ihex.c:409
+msgid "%B:%u: bad extended start address length in Intel Hex file"
+msgstr "%B:%u: buruk extended awal panjang alamat dalam berkas Intel Hex "
+
+#: ihex.c:426
+msgid "%B:%u: bad extended linear address record length in Intel Hex file"
+msgstr "%B:%u: buruk extended alamat linear panjang record dalam berkas Intel Hex"
+
+#: ihex.c:443
+msgid "%B:%u: bad extended linear start address length in Intel Hex file"
+msgstr "%B:%u: buruk extended panjang awal alamat linear dalam berkas Intel Hex"
+
+#: ihex.c:460
+msgid "%B:%u: unrecognized ihex type %u in Intel Hex file"
+msgstr "%B:%u: tidak dikenal ihex tipe %u dalam berkas Intel Hex"
+
+#: ihex.c:579
+msgid "%B: internal error in ihex_read_section"
+msgstr "%B: internal error dalam ihex_read_section"
+
+#: ihex.c:613
+msgid "%B: bad section length in ihex_read_section"
+msgstr "%B: buruk panjang bagian dalam ihex_read_section"
+
+#: ihex.c:825
+#, c-format
+msgid "%s: address 0x%s out of range for Intel Hex file"
+msgstr "%s: alamat 0x%s diluar jangkauan untuk berkas Intel Hex"
+
+#: libbfd.c:1008
+#, c-format
+msgid "Deprecated %s called at %s line %d in %s\n"
+msgstr "Deprecated %s dipanggil di %s baris %d dalam %s\n"
+
+#: libbfd.c:1011
+#, c-format
+msgid "Deprecated %s called\n"
+msgstr "Deprecated %s dipanggil\n"
+
+#: linker.c:1874
+msgid "%B: indirect symbol `%s' to `%s' is a loop"
+msgstr "%B: indirect simbol `%s' ke `%s' adalah sebuah loop"
+
+#: linker.c:2740
+#, c-format
+msgid "Attempt to do relocatable link with %s input and %s output"
+msgstr "Mencoba untuk merelokasi link dengan masukan %s dan keluaran %s"
+
+#: linker.c:3047
+msgid "%B: warning: ignoring duplicate section `%A'\n"
+msgstr "%B: peringatan: mengabaikan bagiann terduplikasi `%A'\n"
+
+#: linker.c:3061
+msgid "%B: warning: duplicate section `%A' has different size\n"
+msgstr "%B: peringatan: bagian terduplikasi `%A' memiliki ukuran berbeda\n"
+
+#: merge.c:828
+#, c-format
+msgid "%s: access beyond end of merged section (%ld)"
+msgstr "%s: akses diluar dari daerah merged (%ld)"
+
+#: mmo.c:456
+#, c-format
+msgid "%s: No core to allocate section name %s\n"
+msgstr "%s: Tidak ada core untuk alokasi daerah nama %s\n"
+
+#: mmo.c:531
+#, c-format
+msgid "%s: No core to allocate a symbol %d bytes long\n"
+msgstr "%s: Tidak ada core untuk alokasi sebuah simbol %d bytes long\n"
+
+#: mmo.c:1187
+#, c-format
+msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n"
+msgstr "%s: berkas mmo tidak valid: nilai inisialisasi untuk $255 bukan `Main'\n"
+
+#: mmo.c:1332
+#, c-format
+msgid "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name starting with `%s'\n"
+msgstr "%s: tidak didukung dengan urutan karakter lebar 0x%02X 0x%02X sesudah nama simbol dimulai dengan `%s'\n"
+
+#: mmo.c:1566
+#, c-format
+msgid "%s: invalid mmo file: unsupported lopcode `%d'\n"
+msgstr "%s: berkas mmo tidak valid: lopcode tidak didukung `%d'\n"
+
+#: mmo.c:1576
+#, c-format
+msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n"
+msgstr "%s: berka mmo tidak valid: diduga YZ = 1 diperoleh YZ = %d untuk lop_quote\n"
+
+#: mmo.c:1612
+#, c-format
+msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n"
+msgstr "%s: berkas mmo tidak valid: diduga z = 1 atau z = 2, diperoleh z = %d untuk lop_loc\n"
+
+#: mmo.c:1658
+#, c-format
+msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n"
+msgstr "%s: berkas mmo tidak valid: diduga z = 1 atau z = 2, diperoleh z = %d untuk lop_fixo\n"
+
+#: mmo.c:1697
+#, c-format
+msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n"
+msgstr "%s: berkas mmo tidak valid: diduga y = 0, diperoleh y = %d untuk lop_fixrx\n"
+
+#: mmo.c:1706
+#, c-format
+msgid "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n"
+msgstr "%s: berkas mmo tidak valid: diduga z = 16 atau z = 24, diperoleh z = %d untuk lop_fixrx\n"
+
+#: mmo.c:1729
+#, c-format
+msgid "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d for lop_fixrx\n"
+msgstr "%s: berkas mmo tidak valid: awalan byte dari kata operand harus 0 atau 1, diperoleh %d untuk lop_fixrx\n"
+
+#: mmo.c:1752
+#, c-format
+msgid "%s: cannot allocate file name for file number %d, %d bytes\n"
+msgstr "%s: tidak dapat mengalokasikan nama berkas untuk nomor berkas %d, %d bytes\n"
+
+#: mmo.c:1772
+#, c-format
+msgid "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n"
+msgstr "%s: berkas mmo tidak valid: nomor berkas %d `%s', telah dimasukan sebagai `%s'\n"
+
+#: mmo.c:1785
+#, c-format
+msgid "%s: invalid mmo file: file name for number %d was not specified before use\n"
+msgstr "%s: berkas mmo tidak valid: nama berkas untuk nomor %d telah dispesifikasikan sebelum digunakan\n"
+
+#: mmo.c:1892
+#, c-format
+msgid "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n"
+msgstr "%s: berkas mmo tidak valid: daerah y dan z dari lop_stab bukan-nol, y: %d, z: %d\n"
+
+#: mmo.c:1928
+#, c-format
+msgid "%s: invalid mmo file: lop_end not last item in file\n"
+msgstr "%s: berkas mmo tidak valid: lop_end bukan item terakhir dalam berkas\n"
+
+#: mmo.c:1941
+#, c-format
+msgid "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras to the preceding lop_stab (%ld)\n"
+msgstr "%s: berkas mmo tidak valid: YZ dari lop_end (%ld) tidak sama dengan jumlah dari tetras yang mengawali lop_stab (%ld)\n"
+
+#: mmo.c:2651
+#, c-format
+msgid "%s: invalid symbol table: duplicate symbol `%s'\n"
+msgstr "%s: tabel simbol tidak valid: duplikasi simbol `%s'\n"
+
+#: mmo.c:2894
+#, c-format
+msgid "%s: Bad symbol definition: `Main' set to %s rather than the start address %s\n"
+msgstr "%s: Definisi simbol buruk: `Main' di set ke %s daripada ke awal alamat %s\n"
+
+#: mmo.c:2986
+#, c-format
+msgid "%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: %d. Only `Main' will be emitted.\n"
+msgstr "%s: Peringatan: tabel simbol terlalu besar untuk mmo, lebih besar daripada 65535 32-bit words: %d. Hanya `Main' yang akan dikeluarkan.\n"
+
+#: mmo.c:3031
+#, c-format
+msgid "%s: internal error, symbol table changed size from %d to %d words\n"
+msgstr "%s: internal error, tabel simbol berubah ukuran dari %d ke %d kata\n"
+
+#: mmo.c:3083
+#, c-format
+msgid "%s: internal error, internal register section %s had contents\n"
+msgstr "%s: internal error, daerah internal register %s memiliki isi\n"
+
+#: mmo.c:3134
+#, c-format
+msgid "%s: no initialized registers; section length 0\n"
+msgstr "%s: tidak ada register yang terinisialisasi; panjang daerah 0\n"
+
+#: mmo.c:3140
+#, c-format
+msgid "%s: too many initialized registers; section length %ld\n"
+msgstr "%s: terlalu banyak register yang terinisialisasi; panjang daerah %ld\n"
+
+#: mmo.c:3145
+#, c-format
+msgid "%s: invalid start address for initialized registers of length %ld: 0x%lx%08lx\n"
+msgstr "%s: awal alaman tidak valid untuk register terinisialisasi dari panjang %ld: 0x%lx%08lx\n"
+
+#: oasys.c:881
+#, c-format
+msgid "%s: can not represent section `%s' in oasys"
+msgstr "%s: tidak dapat merepresentasikan daerah `%s' dalam oasys"
+
+#: osf-core.c:139
+#, c-format
+msgid "Unhandled OSF/1 core file section type %d\n"
+msgstr "Tidak tertangani berkas core OSF/1 daerah tipe %d\n"
+
+#: pe-mips.c:607
+msgid "%B: `ld -r' not supported with PE MIPS objects\n"
+msgstr "%B: `ld -r' tidak didukung dengan PE MIPS objek\n"
+
+#. OK, at this point the following variables are set up:
+#. src = VMA of the memory we're fixing up
+#. mem = pointer to memory we're fixing up
+#. val = VMA of what we need to refer to.
+#: pe-mips.c:723
+msgid "%B: unimplemented %s\n"
+msgstr "%B: tidak terimplementasi %s\n"
+
+#: pe-mips.c:749
+msgid "%B: jump too far away\n"
+msgstr "%B: lompat terlalu jauh\n"
+
+#: pe-mips.c:775
+msgid "%B: bad pair/reflo after refhi\n"
+msgstr "%B: pasangan/reflo buruk setelah refhi\n"
+
+#. XXX code yet to be written.
+#: peicode.h:759
+msgid "%B: Unhandled import type; %x"
+msgstr "%B: Tipe impor tidak tertangani; %x"
+
+#: peicode.h:764
+msgid "%B: Unrecognised import type; %x"
+msgstr "%B: Tipe impor tidak dikenal; %x"
+
+#: peicode.h:778
+msgid "%B: Unrecognised import name type; %x"
+msgstr "%B: Nama tipe impor tidak dikenal; %x"
+
+#: peicode.h:1161
+msgid "%B: Unrecognised machine type (0x%x) in Import Library Format archive"
+msgstr "%B: Tipe mesin (0x%x) tidak dikenal dalam Import Library Format archive"
+
+#: peicode.h:1173
+msgid "%B: Recognised but unhandled machine type (0x%x) in Import Library Format archive"
+msgstr "%B: Dikenal tetapi tidak tertangani tipe mesin (0x%x) dalam Import Library Format archive"
+
+#: peicode.h:1191
+msgid "%B: size field is zero in Import Library Format header"
+msgstr "%B: besar field adalah nol dalam Import Library Format header"
+
+#: peicode.h:1222
+msgid "%B: string not null terminated in ILF object file."
+msgstr "%B: string tidak diakhiri kosong dalam berkas objek ILF."
+
+#: ppcboot.c:414
+#, c-format
+msgid ""
+"\n"
+"ppcboot header:\n"
+msgstr ""
+"\n"
+"ppcboot header:\n"
+
+#: ppcboot.c:415
+#, c-format
+msgid "Entry offset = 0x%.8lx (%ld)\n"
+msgstr "Ofset masukan = 0x%.8lx (%ld)\n"
+
+#: ppcboot.c:417
+#, c-format
+msgid "Length = 0x%.8lx (%ld)\n"
+msgstr "Panjang = 0x%.8lx (%ld)\n"
+
+#: ppcboot.c:421
+#, c-format
+msgid "Flag field = 0x%.2x\n"
+msgstr "Tanda daerah = 0x%.2x\n"
+
+#: ppcboot.c:427
+#, c-format
+msgid "Partition name = \"%s\"\n"
+msgstr "Nama partisi = \"%s\"\n"
+
+#: ppcboot.c:446
+#, c-format
+msgid ""
+"\n"
+"Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
+msgstr ""
+"\n"
+"Awal partisi[%d] = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
+
+#: ppcboot.c:452
+#, c-format
+msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
+msgstr "Akhir partisi[%d] = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n"
+
+#: ppcboot.c:458
+#, c-format
+msgid "Partition[%d] sector = 0x%.8lx (%ld)\n"
+msgstr "Daerah partisi[%d] = 0x%.8lx (%ld)\n"
+
+#: ppcboot.c:460
+#, c-format
+msgid "Partition[%d] length = 0x%.8lx (%ld)\n"
+msgstr "Panjang partisi[%d] = 0x%.8lx (%ld)\n"
+
+#: som.c:5137
+#, c-format
+msgid ""
+"\n"
+"Exec Auxiliary Header\n"
+msgstr ""
+"\n"
+"Tambahan exec header\n"
+
+#: som.c:5440
+msgid "som_sizeof_headers unimplemented"
+msgstr "som_sizeof_headers tidak terimplementasi"
+
+#: srec.c:261
+msgid "%B:%d: Unexpected character `%s' in S-record file\n"
+msgstr "%B:%d: Karakter `%s' tidak diduga dalam berkas S-record\n"
+
+#: srec.c:567 srec.c:600
+msgid "%B:%d: Bad checksum in S-record file\n"
+msgstr "%B:%d: Checksum buruk dalam berkas S-record\n"
+
+#: stabs.c:279
+msgid "%B(%A+0x%lx): Stabs entry has invalid string index."
+msgstr "%B(%A+0x%lx): Masukan stabs memiliki index string tidak valid."
+
+#: syms.c:1067
+msgid "Unsupported .stab relocation"
+msgstr "Relokasi .stab tidak didukung"
+
+#: vms-gsd.c:338
+#, c-format
+msgid "bfd_make_section (%s) failed"
+msgstr "bfd_make_section (%s) gagal"
+
+#: vms-gsd.c:353
+#, c-format
+msgid "bfd_set_section_flags (%s, %x) failed"
+msgstr "bfd_set_section_flags (%s, %x) gagal"
+
+#: vms-gsd.c:388
+#, c-format
+msgid "Size mismatch section %s=%lx, %s=%lx"
+msgstr "Ukuran tidak cocok daerah %s=%lx, %s=%lx"
+
+#: vms-gsd.c:679
+#, c-format
+msgid "unknown gsd/egsd subtype %d"
+msgstr "tidak diketahui gds/egsd subtype %d"
+
+#: vms-hdr.c:328
+msgid "Object module NOT error-free !\n"
+msgstr "Modul objek Tidak bebas-error !\n"
+
+#: vms-misc.c:474
+#, c-format
+msgid "Stack overflow (%d) in _bfd_vms_push"
+msgstr "Stack overflow (%d) dalam _bfd_vms_push"
+
+#: vms-misc.c:489
+msgid "Stack underflow in _bfd_vms_pop"
+msgstr "Stack underflow dalam _bfd_vms_pop"
+
+#: vms-misc.c:808
+msgid "_bfd_vms_output_counted called with zero bytes"
+msgstr "_bfd_vms_output_counted dipanggil dengan zero bytes"
+
+#: vms-misc.c:813
+msgid "_bfd_vms_output_counted called with too many bytes"
+msgstr "_bfd_vms_output_counted dipanggil dengan terlalu banyak bytes"
+
+#: vms-misc.c:931
+#, c-format
+msgid "Symbol %s replaced by %s\n"
+msgstr "Simbol %s digantikan oleh %s\n"
+
+#: vms-misc.c:990
+#, c-format
+msgid "failed to enter %s"
+msgstr "gagal untuk memasuki %s"
+
+#: vms-tir.c:57
+msgid "No Mem !"
+msgstr "Tidak ada Memori !"
+
+#: vms-tir.c:300
+#, c-format
+msgid "bad section index in %s"
+msgstr "Indek daerah buruk dalam %s"
+
+#: vms-tir.c:313
+#, c-format
+msgid "unsupported STA cmd %s"
+msgstr "perintah %s STA tidak didukung"
+
+#: vms-tir.c:318 vms-tir.c:1120
+#, c-format
+msgid "reserved STA cmd %d"
+msgstr "perintah %d STA direserve"
+
+#: vms-tir.c:410 vms-tir.c:432
+#, c-format
+msgid "%s: no symbol \"%s\""
+msgstr "%s: tidak ada simbol \"%s\""
+
+#. Unsigned shift.
+#. Rotate.
+#. Redefine symbol to current location.
+#. Define a literal.
+#: vms-tir.c:497 vms-tir.c:606 vms-tir.c:704 vms-tir.c:721 vms-tir.c:728
+#: vms-tir.c:736 vms-tir.c:1440
+#, c-format
+msgid "%s: not supported"
+msgstr "%s: tidak didukung"
+
+#: vms-tir.c:502 vms-tir.c:1297
+#, c-format
+msgid "%s: not implemented"
+msgstr "%s: tidak terimplementasi"
+
+#: vms-tir.c:506 vms-tir.c:1301
+#, c-format
+msgid "reserved STO cmd %d"
+msgstr "reserved STO perintah %d"
+
+#: vms-tir.c:621 vms-tir.c:1445
+#, c-format
+msgid "reserved OPR cmd %d"
+msgstr "reserved OPR perintah %d"
+
+#: vms-tir.c:681 vms-tir.c:1509
+#, c-format
+msgid "reserved CTL cmd %d"
+msgstr "reserved CTL perintah %d"
+
+#. stack byte from image
+#. arg: none.
+#: vms-tir.c:1028
+msgid "stack-from-image not implemented"
+msgstr "stack-from-image tidak terimplementasi"
+
+#: vms-tir.c:1046
+msgid "stack-entry-mask not fully implemented"
+msgstr "stack-entry-mask tidak terimplementasi secara penuh"
+
+#. compare procedure argument
+#. arg: cs symbol name
+#. by argument index
+#. da argument descriptor
+#.
+#. compare argument descriptor with symbol argument (ARG$V_PASSMECH)
+#. and stack TRUE (args match) or FALSE (args dont match) value.
+#: vms-tir.c:1060
+msgid "PASSMECH not fully implemented"
+msgstr "PASSMECH tidak terimplementasi secara penuh"
+
+#: vms-tir.c:1079
+msgid "stack-local-symbol not fully implemented"
+msgstr "stack-local-symbol tidak terimplementasi secara penuh"
+
+#: vms-tir.c:1092
+msgid "stack-literal not fully implemented"
+msgstr "stack-literal tidak terimplementasi secara penuh"
+
+#: vms-tir.c:1113
+msgid "stack-local-symbol-entry-point-mask not fully implemented"
+msgstr "stack-local-symbol-entry-point-mask tidak terimplementasi secara penuh"
+
+#: vms-tir.c:1387 vms-tir.c:1399 vms-tir.c:1411 vms-tir.c:1423 vms-tir.c:1488
+#: vms-tir.c:1496 vms-tir.c:1504
+#, c-format
+msgid "%s: not fully implemented"
+msgstr "%s: tidak terimplementasi secara penuh"
+
+#: vms-tir.c:1562
+#, c-format
+msgid "obj code %d not found"
+msgstr "obj kode %d tidak ditemukan"
+
+#: vms-tir.c:1870
+#, c-format
+msgid "SEC_RELOC with no relocs in section %s"
+msgstr "SEC_RELOC dengan tidak ada relokasi dalam daerah %s"
+
+#: vms-tir.c:2152
+#, c-format
+msgid "Unhandled relocation %s"
+msgstr "Relokasi %s tidak tertangani"
+
+#: xcofflink.c:566
+#, c-format
+msgid "%s: XCOFF shared object when not producing XCOFF output"
+msgstr "%s: XCOFF objek shared ketika tidak menghasilkan keluaran XCOFF"
+
+#: xcofflink.c:587
+#, c-format
+msgid "%s: dynamic object with no .loader section"
+msgstr "%s: objek dinamis dengan tidak ada daerah .loader"
+
+#: xcofflink.c:1150
+msgid "%B: `%s' has line numbers but no enclosing section"
+msgstr "%B: `%s' memiliki nomor baris tetapi tidak ditutupi daerah"
+
+#: xcofflink.c:1202
+msgid "%B: class %d symbol `%s' has no aux entries"
+msgstr "%B: kelas %d simbol `%s' tidak memiliki tambahan masukan"
+
+#: xcofflink.c:1225
+msgid "%B: symbol `%s' has unrecognized csect type %d"
+msgstr "%B: simbol `%s' memiliki tipe %d csect tidak dikenal"
+
+#: xcofflink.c:1237
+msgid "%B: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d"
+msgstr "%B: simbol XTY_ER buruk `%s': kelas %d scnum %d scnlen %d"
+
+#: xcofflink.c:1273
+msgid "%B: XMC_TC0 symbol `%s' is class %d scnlen %d"
+msgstr "%B: XMC_TC0 simbol `%s' adalah kelas %d scnlen %d"
+
+#: xcofflink.c:1419
+msgid "%B: csect `%s' not in enclosing section"
+msgstr "%B: csect `%s' tidak dalam lingkup daerah"
+
+#: xcofflink.c:1526
+msgid "%B: misplaced XTY_LD `%s'"
+msgstr "%B: salah tempat XTY_LD `%s'"
+
+#: xcofflink.c:1842
+msgid "%B: reloc %s:%d not in csect"
+msgstr "%B: relokasi %s:%d tidak dalam csect"
+
+#: xcofflink.c:2640
+#, c-format
+msgid "%s: no such symbol"
+msgstr "%s: tidak ada simbol seperti itu"
+
+#: xcofflink.c:2869
+#, c-format
+msgid "warning: attempt to export undefined symbol `%s'"
+msgstr "peringatan: mencoba untuk mengekspor simbol tidak terdefinisi `%s'"
+
+#: xcofflink.c:3036
+msgid "error: undefined symbol __rtinit"
+msgstr "error: simbol tidak terdefinisi __rtinit"
+
+#: xcofflink.c:3656
+#, c-format
+msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling"
+msgstr "TOC overflow: 0x%lx > 0x10000; coba -mminimal-toc ketika mengkompile"
+
+#: xcofflink.c:4492
+msgid "%B: loader reloc in unrecognized section `%A'"
+msgstr "%B: loader relokasi dalam daerah tidak dikenal `%A'"
+
+#: xcofflink.c:4513
+msgid "%B: `%s' in loader reloc but not loader sym"
+msgstr "%B: `%s' dalam relokasi loader tetapi bukan loader sym"
+
+#: xcofflink.c:4528
+msgid "%B: loader reloc in read-only section %A"
+msgstr "%B: loader relokasi dalam daerah baca-saja %A"
+
+#: xcofflink.c:4937 xcofflink.c:4999 xcofflink.c:5294
+#, c-format
+msgid "%s: loader reloc in unrecognized section `%s'"
+msgstr "%s: loader relokasi dalam daerah `%s' tidak dikenal"
+
+#: xcofflink.c:5305
+#, c-format
+msgid "%s: `%s' in loader reloc but not loader sym"
+msgstr "%s: `%s' dalam relokasi loader tetapi bukan loader sym"
+
+#: elf32-ia64.c:1037 elf64-ia64.c:1037
+msgid "%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect branch."
+msgstr "%B: Tidak dapat relaks br di 0x%lx dalam daerah `%A'. Tolong gunakan brl atau indirect branch."
+
+#: elf32-ia64.c:2742 elf64-ia64.c:2742
+msgid "@pltoff reloc against local symbol"
+msgstr "@pltoff relokasi terhadap simbol lokal"
+
+#: elf32-ia64.c:4317 elf64-ia64.c:4317
+#, c-format
+msgid "%s: short data segment overflowed (0x%lx >= 0x400000)"
+msgstr "%s: short data segment overflowed (0x%lx >= 0x400000)"
+
+#: elf32-ia64.c:4328 elf64-ia64.c:4328
+#, c-format
+msgid "%s: __gp does not cover short data segment"
+msgstr "%s: __gp tidak meliputi segmen data pendek"
+
+#: elf32-ia64.c:4598 elf64-ia64.c:4598
+msgid "%B: non-pic code with imm relocation against dynamic symbol `%s'"
+msgstr "%B: bukan-pic kode dengan relokasi imm terhadap simbol dinamis `%s'"
+
+#: elf32-ia64.c:4665 elf64-ia64.c:4665
+msgid "%B: @gprel relocation against dynamic symbol %s"
+msgstr "%B: @gprel relokasi terhadap simbol dinamis %s"
+
+#: elf32-ia64.c:4728 elf64-ia64.c:4728
+msgid "%B: linking non-pic code in a position independent executable"
+msgstr "%B: menghubungkan dengan kode bukan-pic dalam sebuah executable bebas posisi"
+
+#: elf32-ia64.c:4865 elf64-ia64.c:4865
+msgid "%B: @internal branch to dynamic symbol %s"
+msgstr "%B: @internal branck ke simbol dinamis %s"
+
+#: elf32-ia64.c:4867 elf64-ia64.c:4867
+msgid "%B: speculation fixup to dynamic symbol %s"
+msgstr "%B: spekulasi fixup ke simbol dinamis %s"
+
+#: elf32-ia64.c:4869 elf64-ia64.c:4869
+msgid "%B: @pcrel relocation against dynamic symbol %s"
+msgstr "%B: @pcrel relokasi terhadap simbol dinamis %s"
+
+#: elf32-ia64.c:5066 elf64-ia64.c:5066
+msgid "unsupported reloc"
+msgstr "relokasi tidak didukung"
+
+#: elf32-ia64.c:5104 elf64-ia64.c:5104
+msgid "%B: missing TLS section for relocation %s against `%s' at 0x%lx in section `%A'."
+msgstr "%B: hilang daerah TLS untuk relokasi %s terhadap `%s' di 0x%lx dalam daerah `%A'."
+
+#: elf32-ia64.c:5119 elf64-ia64.c:5119
+msgid "%B: Can't relax br (%s) to `%s' at 0x%lx in section `%A' with size 0x%lx (> 0x1000000)."
+msgstr "%B: Tidak dapat relaks br (%s) ke `%s' di 0x%lx dalam daerah `%A' dengan ukuran 0x%lx (> 0x1000000)."
+
+#: elf32-ia64.c:5375 elf64-ia64.c:5375
+msgid "%B: linking trap-on-NULL-dereference with non-trapping files"
+msgstr "%B: menghubungkan trap-on-NULL-dereference dengan berkas bukan-trapping"
+
+#: elf32-ia64.c:5384 elf64-ia64.c:5384
+msgid "%B: linking big-endian files with little-endian files"
+msgstr "%B: menghubungkan berkas big-endian dengan berkas little-endian"
+
+#: elf32-ia64.c:5393 elf64-ia64.c:5393
+msgid "%B: linking 64-bit files with 32-bit files"
+msgstr "%B: menghubungkan berkas 64-bit dengan berkas 32-bit"
+
+#: elf32-ia64.c:5402 elf64-ia64.c:5402
+msgid "%B: linking constant-gp files with non-constant-gp files"
+msgstr "%B: menghubungkan berkas constant-gp dengan berkas bukan-constant-gp"
+
+#: elf32-ia64.c:5412 elf64-ia64.c:5412
+msgid "%B: linking auto-pic files with non-auto-pic files"
+msgstr "%B: menghubungkan berkas auto-pic dengan berkas non-auto-pic"
+
+#: peigen.c:1000 pepigen.c:1000 pex64igen.c:1000
+#, c-format
+msgid "%s: line number overflow: 0x%lx > 0xffff"
+msgstr "%s: nomor baris overflow: 0x%lx > 0xffff"
+
+#: peigen.c:1027 pepigen.c:1027 pex64igen.c:1027
+msgid "Export Directory [.edata (or where ever we found it)]"
+msgstr "Direktori expor [.edata (atau dimanapun kita menemukannya)]"
+
+#: peigen.c:1028 pepigen.c:1028 pex64igen.c:1028
+msgid "Import Directory [parts of .idata]"
+msgstr "Impor Direktori [bagian dari .idata]"
+
+#: peigen.c:1029 pepigen.c:1029 pex64igen.c:1029
+msgid "Resource Directory [.rsrc]"
+msgstr "Resource Direktori [.rsrc]"
+
+#: peigen.c:1030 pepigen.c:1030 pex64igen.c:1030
+msgid "Exception Directory [.pdata]"
+msgstr "Exception Direktori [.pdata]"
+
+#: peigen.c:1031 pepigen.c:1031 pex64igen.c:1031
+msgid "Security Directory"
+msgstr "Direktori Keamanan"
+
+#: peigen.c:1032 pepigen.c:1032 pex64igen.c:1032
+msgid "Base Relocation Directory [.reloc]"
+msgstr "Dasar Relokasi Direktori [.reloc]"
+
+#: peigen.c:1033 pepigen.c:1033 pex64igen.c:1033
+msgid "Debug Directory"
+msgstr "Debug Direktori"
+
+#: peigen.c:1034 pepigen.c:1034 pex64igen.c:1034
+msgid "Description Directory"
+msgstr "Direktori Penjelasan"
+
+#: peigen.c:1035 pepigen.c:1035 pex64igen.c:1035
+msgid "Special Directory"
+msgstr "Direktori Spesial"
+
+#: peigen.c:1036 pepigen.c:1036 pex64igen.c:1036
+msgid "Thread Storage Directory [.tls]"
+msgstr "Thread Storage Direktori [.tls]"
+
+#: peigen.c:1037 pepigen.c:1037 pex64igen.c:1037
+msgid "Load Configuration Directory"
+msgstr "Direktori Konfigurasi Beban"
+
+#: peigen.c:1038 pepigen.c:1038 pex64igen.c:1038
+msgid "Bound Import Directory"
+msgstr "Direktori Bound Impor"
+
+#: peigen.c:1039 pepigen.c:1039 pex64igen.c:1039
+msgid "Import Address Table Directory"
+msgstr "Direktori Impor Tabel Alamat"
+
+#: peigen.c:1040 pepigen.c:1040 pex64igen.c:1040
+msgid "Delay Import Directory"
+msgstr "Delay Impor Direktori"
+
+#: peigen.c:1041 pepigen.c:1041 pex64igen.c:1041
+msgid "CLR Runtime Header"
+msgstr "CLR Runtime Header"
+
+#: peigen.c:1042 pepigen.c:1042 pex64igen.c:1042
+msgid "Reserved"
+msgstr "Reserved"
+
+#: peigen.c:1102 pepigen.c:1102 pex64igen.c:1102
+#, c-format
+msgid ""
+"\n"
+"There is an import table, but the section containing it could not be found\n"
+msgstr ""
+"\n"
+"Ada tabel impor, tetapi daerah yang berisi itu tidak dapat ditemukan\n"
+
+#: peigen.c:1107 pepigen.c:1107 pex64igen.c:1107
+#, c-format
+msgid ""
+"\n"
+"There is an import table in %s at 0x%lx\n"
+msgstr ""
+"\n"
+"Ada impor tabel di %s pada 0x%lx\n"
+
+#: peigen.c:1150 pepigen.c:1150 pex64igen.c:1150
+#, c-format
+msgid ""
+"\n"
+"Function descriptor located at the start address: %04lx\n"
+msgstr ""
+"\n"
+"Deskripsi fungsi ditempatkan di awal alamat: %04lx\n"
+
+#: peigen.c:1153 pepigen.c:1153 pex64igen.c:1153
+#, c-format
+msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n"
+msgstr "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n"
+
+#: peigen.c:1161 pepigen.c:1161 pex64igen.c:1161
+#, c-format
+msgid ""
+"\n"
+"No reldata section! Function descriptor not decoded.\n"
+msgstr ""
+"\n"
+"Tidak ada daerah reldata! Deskripsi fungsi tidak terdekode.\n"
+
+#: peigen.c:1166 pepigen.c:1166 pex64igen.c:1166
+#, c-format
+msgid ""
+"\n"
+"The Import Tables (interpreted %s section contents)\n"
+msgstr ""
+"\n"
+"Tabel Impor (diinterpretasikan isi daerah %s)\n"
+
+#: peigen.c:1169 pepigen.c:1169 pex64igen.c:1169
+#, c-format
+msgid ""
+" vma: Hint Time Forward DLL First\n"
+" Table Stamp Chain Name Thunk\n"
+msgstr ""
+"vma: Tips Waktu Forward DLL Pertama\n"
+" Tabel Stamp Rantai Nama Thunk\n"
+
+#: peigen.c:1217 pepigen.c:1217 pex64igen.c:1217
+#, c-format
+msgid ""
+"\n"
+"\tDLL Name: %s\n"
+msgstr ""
+"\n"
+"\tNama DLL: %s\n"
+
+#: peigen.c:1228 pepigen.c:1228 pex64igen.c:1228
+#, c-format
+msgid "\tvma: Hint/Ord Member-Name Bound-To\n"
+msgstr "\tvma: Tips/Ord Nama-Anggota Terikat-Ke\n"
+
+#: peigen.c:1253 pepigen.c:1253 pex64igen.c:1253
+#, c-format
+msgid ""
+"\n"
+"There is a first thunk, but the section containing it could not be found\n"
+msgstr ""
+"\n"
+"Ada thunk pertama, tetapi daerah yang berisi itu tidak dapat ditemukan\n"
+
+#: peigen.c:1418 pepigen.c:1418 pex64igen.c:1418
+#, c-format
+msgid ""
+"\n"
+"There is an export table, but the section containing it could not be found\n"
+msgstr ""
+"\n"
+"Ada tabel expor, tetapi daerah yang berisi itu tidak dapat ditemukan\n"
+
+#: peigen.c:1427 pepigen.c:1427 pex64igen.c:1427
+#, c-format
+msgid ""
+"\n"
+"There is an export table in %s, but it does not fit into that section\n"
+msgstr ""
+"\n"
+"Ada tabel expor dalam %s, tetapi ini tidak masuk dalam daerah itu\n"
+
+#: peigen.c:1433 pepigen.c:1433 pex64igen.c:1433
+#, c-format
+msgid ""
+"\n"
+"There is an export table in %s at 0x%lx\n"
+msgstr ""
+"\n"
+"Ada sebuah tabel expor dalam %s di 0x%lx\n"
+
+#: peigen.c:1461 pepigen.c:1461 pex64igen.c:1461
+#, c-format
+msgid ""
+"\n"
+"The Export Tables (interpreted %s section contents)\n"
+"\n"
+msgstr ""
+"\n"
+"Tabel expor (diinterpretasikan isi daerah %s)\n"
+
+#: peigen.c:1465 pepigen.c:1465 pex64igen.c:1465
+#, c-format
+msgid "Export Flags \t\t\t%lx\n"
+msgstr "Tanda Expor \t\t\t%lx\n"
+
+#: peigen.c:1468 pepigen.c:1468 pex64igen.c:1468
+#, c-format
+msgid "Time/Date stamp \t\t%lx\n"
+msgstr "Waktu/Tanggal stamp \t\t%lx\n"
+
+#: peigen.c:1471 pepigen.c:1471 pex64igen.c:1471
+#, c-format
+msgid "Major/Minor \t\t\t%d/%d\n"
+msgstr "Mayor/Minor \t\t\t%d/%d\n"
+
+#: peigen.c:1474 pepigen.c:1474 pex64igen.c:1474
+#, c-format
+msgid "Name \t\t\t\t"
+msgstr "Nama \t\t\t\t"
+
+#: peigen.c:1480 pepigen.c:1480 pex64igen.c:1480
+#, c-format
+msgid "Ordinal Base \t\t\t%ld\n"
+msgstr "Dasar Ordinal \t\t\t%ld\n"
+
+#: peigen.c:1483 pepigen.c:1483 pex64igen.c:1483
+#, c-format
+msgid "Number in:\n"
+msgstr "Nomor dalam:\n"
+
+#: peigen.c:1486 pepigen.c:1486 pex64igen.c:1486
+#, c-format
+msgid "\tExport Address Table \t\t%08lx\n"
+msgstr "\tTabel Alamat Expor \t\t%08lx\n"
+
+#: peigen.c:1490 pepigen.c:1490 pex64igen.c:1490
+#, c-format
+msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n"
+msgstr "\t[Nama Pointer/Ordinal] Tabel\t%08lx\n"
+
+#: peigen.c:1493 pepigen.c:1493 pex64igen.c:1493
+#, c-format
+msgid "Table Addresses\n"
+msgstr "Tabel Alamat\n"
+
+#: peigen.c:1496 pepigen.c:1496 pex64igen.c:1496
+#, c-format
+msgid "\tExport Address Table \t\t"
+msgstr "\tTabel Alamat Expor \t\t"
+
+#: peigen.c:1501 pepigen.c:1501 pex64igen.c:1501
+#, c-format
+msgid "\tName Pointer Table \t\t"
+msgstr "\tTabel Nama Pointer \t\t"
+
+#: peigen.c:1506 pepigen.c:1506 pex64igen.c:1506
+#, c-format
+msgid "\tOrdinal Table \t\t\t"
+msgstr "\tTabel Ordinal \t\t\t"
+
+#: peigen.c:1520 pepigen.c:1520 pex64igen.c:1520
+#, c-format
+msgid ""
+"\n"
+"Export Address Table -- Ordinal Base %ld\n"
+msgstr ""
+"\n"
+"Tabel Alamat Expor -- Ordinal Base %ld\n"
+
+#: peigen.c:1539 pepigen.c:1539 pex64igen.c:1539
+msgid "Forwarder RVA"
+msgstr "Forwarder RVA"
+
+#: peigen.c:1550 pepigen.c:1550 pex64igen.c:1550
+msgid "Export RVA"
+msgstr "Expor RVA"
+
+#: peigen.c:1557 pepigen.c:1557 pex64igen.c:1557
+#, c-format
+msgid ""
+"\n"
+"[Ordinal/Name Pointer] Table\n"
+msgstr ""
+"\n"
+"[Ordinal/Nama Pointer] Tabel\n"
+
+#: peigen.c:1617 peigen.c:1796 pepigen.c:1617 pepigen.c:1796 pex64igen.c:1617
+#: pex64igen.c:1796
+#, c-format
+msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n"
+msgstr "Peringatan, besar (%ld) daerah .pdata tidak dalam kelipatan dari %d\n"
+
+#: peigen.c:1621 peigen.c:1800 pepigen.c:1621 pepigen.c:1800 pex64igen.c:1621
+#: pex64igen.c:1800
+#, c-format
+msgid ""
+"\n"
+"The Function Table (interpreted .pdata section contents)\n"
+msgstr ""
+"\n"
+"Tabel Fungsi (diinterpretasikan isi daerah .pdata)\n"
+
+#: peigen.c:1624 pepigen.c:1624 pex64igen.c:1624
+#, c-format
+msgid " vma:\t\t\tBegin Address End Address Unwind Info\n"
+msgstr " vma:\t\t\tAwal Alamat Akhir Alamat Unwind Informasi\n"
+
+#: peigen.c:1626 pepigen.c:1626 pex64igen.c:1626
+#, c-format
+msgid ""
+" vma:\t\tBegin End EH EH PrologEnd Exception\n"
+" \t\tAddress Address Handler Data Address Mask\n"
+msgstr ""
+" vma:\t\tAwal Akhir EH EH PrologEnd Exception\n"
+" \t\tAlamat Alamat Handler Data Alamat Topeng\n"
+
+#: peigen.c:1696 pepigen.c:1696 pex64igen.c:1696
+#, c-format
+msgid " Register save millicode"
+msgstr " Register simpan millicode"
+
+#: peigen.c:1699 pepigen.c:1699 pex64igen.c:1699
+#, c-format
+msgid " Register restore millicode"
+msgstr " Register restore millicode"
+
+#: peigen.c:1702 pepigen.c:1702 pex64igen.c:1702
+#, c-format
+msgid " Glue code sequence"
+msgstr " Urutan kode pengikat"
+
+#: peigen.c:1802 pepigen.c:1802 pex64igen.c:1802
+#, c-format
+msgid ""
+" vma:\t\tBegin Prolog Function Flags Exception EH\n"
+" \t\tAddress Length Length 32b exc Handler Data\n"
+msgstr ""
+" vma:\t\tMulai Prolog Fungsi Flags Exception EH\n"
+" \t\tAlamat Panjang Panjang 32b exc Handler Data\n"
+
+#: peigen.c:1933 pepigen.c:1933 pex64igen.c:1933
+#, c-format
+msgid ""
+"\n"
+"\n"
+"PE File Base Relocations (interpreted .reloc section contents)\n"
+msgstr ""
+"\n"
+"\n"
+"Berkas Dasar Relokasi PE (diinterpretasikan isi daerah .reloc)\n"
+
+#: peigen.c:1963 pepigen.c:1963 pex64igen.c:1963
+#, c-format
+msgid ""
+"\n"
+"Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"
+msgstr ""
+"\n"
+"Alamat Maya: %08lx Besar potongan %ld (0x%lx) Jumlah dari perbaikan %ld\n"
+
+#: peigen.c:1976 pepigen.c:1976 pex64igen.c:1976
+#, c-format
+msgid "\treloc %4d offset %4x [%4lx] %s"
+msgstr "\trelokasi %4d ofset %4x [%4lx] %s"
+
+#. The MS dumpbin program reportedly ands with 0xff0f before
+#. printing the characteristics field. Not sure why. No reason to
+#. emulate it here.
+#: peigen.c:2015 pepigen.c:2015 pex64igen.c:2015
+#, c-format
+msgid ""
+"\n"
+"Characteristics 0x%x\n"
+msgstr ""
+"\n"
+"Karakteristik 0x%x\n"
+
+#: peigen.c:2289 pepigen.c:2289 pex64igen.c:2289
+msgid "%B: unable to fill in DataDictionary[1] because .idata$2 is missing"
+msgstr "%B: tidak dapat mengisi dalam DataDictionary[1] karena .idata$2 hilang"
+
+#: peigen.c:2307 pepigen.c:2307 pex64igen.c:2307
+msgid "%B: unable to fill in DataDictionary[1] because .idata$4 is missing"
+msgstr "%B: tidak dapat mengisi dalam DataDictionary[1] karena .data$4 hilang"
+
+#: peigen.c:2326 pepigen.c:2326 pex64igen.c:2326
+msgid "%B: unable to fill in DataDictionary[12] because .idata$5 is missing"
+msgstr "%B: tidak dapat mengisi dalam DataDictionary[12] karena .idata$5 hilang"
+
+#: peigen.c:2344 pepigen.c:2344 pex64igen.c:2344
+msgid "%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] because .idata$6 is missing"
+msgstr "%B: tidak dapat mengisi dalam DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] karena .idata$6 hilang"
+
+#: peigen.c:2364 pepigen.c:2364 pex64igen.c:2364
+msgid "%B: unable to fill in DataDictionary[9] because __tls_used is missing"
+msgstr "%B: tidak dapat mengisi dalam DataDictionary[9] karena __tls_used hilang"
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 9d993af..99d0094 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -4719,6 +4719,31 @@ ENUMDOC
32-bit offset to symbol with PLT entry, relative to this relocation.
ENUM
+ BFD_RELOC_CRIS_32_GOT_GD
+ENUMX
+ BFD_RELOC_CRIS_16_GOT_GD
+ENUMX
+ BFD_RELOC_CRIS_32_GD
+ENUMX
+ BFD_RELOC_CRIS_DTP
+ENUMX
+ BFD_RELOC_CRIS_32_DTPREL
+ENUMX
+ BFD_RELOC_CRIS_16_DTPREL
+ENUMX
+ BFD_RELOC_CRIS_32_GOT_TPREL
+ENUMX
+ BFD_RELOC_CRIS_16_GOT_TPREL
+ENUMX
+ BFD_RELOC_CRIS_32_TPREL
+ENUMX
+ BFD_RELOC_CRIS_16_TPREL
+ENUMX
+ BFD_RELOC_CRIS_DTPMOD
+ENUMDOC
+ Relocs used in TLS code for CRIS.
+
+ENUM
BFD_RELOC_860_COPY
ENUMX
BFD_RELOC_860_GLOB_DAT
diff --git a/bfd/version.h b/bfd/version.h
index 81d1c4d..473027d 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20080930
+#define BFD_VERSION_DATE 20081120
#define BFD_VERSION @bfd_version@
#define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@
#define REPORT_BUGS_TO @report_bugs_to@
diff --git a/bfd/vms-hdr.c b/bfd/vms-hdr.c
index 8e34bee..11e1af6 100644
--- a/bfd/vms-hdr.c
+++ b/bfd/vms-hdr.c
@@ -212,8 +212,7 @@ _bfd_vms_write_hdr (bfd *abfd, int objtype)
char *fname, *fout, *fptr;
fptr = bfd_get_filename (abfd);
- fname = alloca (strlen (fptr) + 1);
- strcpy (fname, fptr);
+ fname = strdup (fptr);
fout = strrchr (fname, ']');
if (fout == 0)
fout = strchr (fname, ':');
@@ -238,6 +237,7 @@ _bfd_vms_write_hdr (bfd *abfd, int objtype)
*fptr = 0;
}
_bfd_vms_output_counted (abfd, fout);
+ free (fname);
}
else
_bfd_vms_output_counted (abfd, "NONAME");
diff --git a/bfd/xtensa-modules.c b/bfd/xtensa-modules.c
index 805667b..b68e482 100644
--- a/bfd/xtensa-modules.c
+++ b/bfd/xtensa-modules.c
@@ -1,5 +1,5 @@
/* Xtensa configuration-specific ISA information.
- Copyright 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -30,6 +30,7 @@ static xtensa_sysreg_internal sysregs[] = {
{ "LEND", 1, 0 },
{ "LCOUNT", 2, 0 },
{ "PTEVADDR", 83, 0 },
+ { "MMID", 89, 0 },
{ "DDR", 104, 0 },
{ "176", 176, 0 },
{ "208", 208, 0 },
@@ -41,17 +42,27 @@ static xtensa_sysreg_internal sysregs[] = {
{ "CCOMPARE0", 240, 0 },
{ "CCOMPARE1", 241, 0 },
{ "CCOMPARE2", 242, 0 },
+ { "VECBASE", 231, 0 },
{ "EPC1", 177, 0 },
{ "EPC2", 178, 0 },
{ "EPC3", 179, 0 },
{ "EPC4", 180, 0 },
+ { "EPC5", 181, 0 },
+ { "EPC6", 182, 0 },
+ { "EPC7", 183, 0 },
{ "EXCSAVE1", 209, 0 },
{ "EXCSAVE2", 210, 0 },
{ "EXCSAVE3", 211, 0 },
{ "EXCSAVE4", 212, 0 },
+ { "EXCSAVE5", 213, 0 },
+ { "EXCSAVE6", 214, 0 },
+ { "EXCSAVE7", 215, 0 },
{ "EPS2", 194, 0 },
{ "EPS3", 195, 0 },
{ "EPS4", 196, 0 },
+ { "EPS5", 197, 0 },
+ { "EPS6", 198, 0 },
+ { "EPS7", 199, 0 },
{ "EXCCAUSE", 232, 0 },
{ "DEPC", 192, 0 },
{ "EXCVADDR", 238, 0 },
@@ -74,12 +85,15 @@ static xtensa_sysreg_internal sysregs[] = {
{ "DEBUGCAUSE", 233, 0 },
{ "RASID", 90, 0 },
{ "ITLBCFG", 91, 0 },
- { "DTLBCFG", 92, 0 }
+ { "DTLBCFG", 92, 0 },
+ { "CPENABLE", 224, 0 },
+ { "SCOMPARE1", 12, 0 },
+ { "THREADPTR", 231, 1 }
};
-#define NUM_SYSREGS 49
+#define NUM_SYSREGS 63
#define MAX_SPECIAL_REG 245
-#define MAX_USER_REG 0
+#define MAX_USER_REG 231
/* Processor states. */
@@ -89,20 +103,30 @@ static xtensa_state_internal states[] = {
{ "PC", 32, 0 },
{ "ICOUNT", 32, 0 },
{ "DDR", 32, 0 },
- { "INTERRUPT", 17, 0 },
+ { "INTERRUPT", 22, 0 },
{ "CCOUNT", 32, 0 },
{ "XTSYNC", 1, 0 },
+ { "VECBASE", 22, 0 },
{ "EPC1", 32, 0 },
{ "EPC2", 32, 0 },
{ "EPC3", 32, 0 },
{ "EPC4", 32, 0 },
+ { "EPC5", 32, 0 },
+ { "EPC6", 32, 0 },
+ { "EPC7", 32, 0 },
{ "EXCSAVE1", 32, 0 },
{ "EXCSAVE2", 32, 0 },
{ "EXCSAVE3", 32, 0 },
{ "EXCSAVE4", 32, 0 },
+ { "EXCSAVE5", 32, 0 },
+ { "EXCSAVE6", 32, 0 },
+ { "EXCSAVE7", 32, 0 },
{ "EPS2", 15, 0 },
{ "EPS3", 15, 0 },
{ "EPS4", 15, 0 },
+ { "EPS5", 15, 0 },
+ { "EPS6", 15, 0 },
+ { "EPS7", 15, 0 },
{ "EXCCAUSE", 6, 0 },
{ "PSINTLEVEL", 4, 0 },
{ "PSUM", 1, 0 },
@@ -111,19 +135,20 @@ static xtensa_state_internal states[] = {
{ "PSEXCM", 1, 0 },
{ "DEPC", 32, 0 },
{ "EXCVADDR", 32, 0 },
- { "WindowBase", 4, 0 },
- { "WindowStart", 16, 0 },
+ { "WindowBase", 3, 0 },
+ { "WindowStart", 8, 0 },
{ "PSCALLINC", 2, 0 },
{ "PSOWB", 4, 0 },
{ "LBEG", 32, 0 },
{ "LEND", 32, 0 },
{ "SAR", 6, 0 },
+ { "THREADPTR", 32, 0 },
{ "LITBADDR", 20, 0 },
{ "LITBEN", 1, 0 },
{ "MISC0", 32, 0 },
{ "MISC1", 32, 0 },
{ "InOCDMode", 1, 0 },
- { "INTENABLE", 17, 0 },
+ { "INTENABLE", 22, 0 },
{ "DBREAKA0", 32, 0 },
{ "DBREAKC0", 8, 0 },
{ "DBREAKA1", 32, 0 },
@@ -142,72 +167,86 @@ static xtensa_state_internal states[] = {
{ "ASID1", 8, 0 },
{ "INSTPGSZID4", 2, 0 },
{ "DATAPGSZID4", 2, 0 },
- { "PTBASE", 10, 0 }
-};
-
-#define NUM_STATES 58
-
-/* Macros for xtensa_state numbers (for use in iclasses because the
- state numbers are not available when the iclass table is generated). */
-
-#define STATE_LCOUNT 0
-#define STATE_PC 1
-#define STATE_ICOUNT 2
-#define STATE_DDR 3
-#define STATE_INTERRUPT 4
-#define STATE_CCOUNT 5
-#define STATE_XTSYNC 6
-#define STATE_EPC1 7
-#define STATE_EPC2 8
-#define STATE_EPC3 9
-#define STATE_EPC4 10
-#define STATE_EXCSAVE1 11
-#define STATE_EXCSAVE2 12
-#define STATE_EXCSAVE3 13
-#define STATE_EXCSAVE4 14
-#define STATE_EPS2 15
-#define STATE_EPS3 16
-#define STATE_EPS4 17
-#define STATE_EXCCAUSE 18
-#define STATE_PSINTLEVEL 19
-#define STATE_PSUM 20
-#define STATE_PSWOE 21
-#define STATE_PSRING 22
-#define STATE_PSEXCM 23
-#define STATE_DEPC 24
-#define STATE_EXCVADDR 25
-#define STATE_WindowBase 26
-#define STATE_WindowStart 27
-#define STATE_PSCALLINC 28
-#define STATE_PSOWB 29
-#define STATE_LBEG 30
-#define STATE_LEND 31
-#define STATE_SAR 32
-#define STATE_LITBADDR 33
-#define STATE_LITBEN 34
-#define STATE_MISC0 35
-#define STATE_MISC1 36
-#define STATE_InOCDMode 37
-#define STATE_INTENABLE 38
-#define STATE_DBREAKA0 39
-#define STATE_DBREAKC0 40
-#define STATE_DBREAKA1 41
-#define STATE_DBREAKC1 42
-#define STATE_IBREAKA0 43
-#define STATE_IBREAKA1 44
-#define STATE_IBREAKENABLE 45
-#define STATE_ICOUNTLEVEL 46
-#define STATE_DEBUGCAUSE 47
-#define STATE_DBNUM 48
-#define STATE_CCOMPARE0 49
-#define STATE_CCOMPARE1 50
-#define STATE_CCOMPARE2 51
-#define STATE_ASID3 52
-#define STATE_ASID2 53
-#define STATE_ASID1 54
-#define STATE_INSTPGSZID4 55
-#define STATE_DATAPGSZID4 56
-#define STATE_PTBASE 57
+ { "PTBASE", 10, 0 },
+ { "CPENABLE", 8, 0 },
+ { "SCOMPARE1", 32, 0 }
+};
+
+#define NUM_STATES 71
+
+enum xtensa_state_id {
+ STATE_LCOUNT,
+ STATE_PC,
+ STATE_ICOUNT,
+ STATE_DDR,
+ STATE_INTERRUPT,
+ STATE_CCOUNT,
+ STATE_XTSYNC,
+ STATE_VECBASE,
+ STATE_EPC1,
+ STATE_EPC2,
+ STATE_EPC3,
+ STATE_EPC4,
+ STATE_EPC5,
+ STATE_EPC6,
+ STATE_EPC7,
+ STATE_EXCSAVE1,
+ STATE_EXCSAVE2,
+ STATE_EXCSAVE3,
+ STATE_EXCSAVE4,
+ STATE_EXCSAVE5,
+ STATE_EXCSAVE6,
+ STATE_EXCSAVE7,
+ STATE_EPS2,
+ STATE_EPS3,
+ STATE_EPS4,
+ STATE_EPS5,
+ STATE_EPS6,
+ STATE_EPS7,
+ STATE_EXCCAUSE,
+ STATE_PSINTLEVEL,
+ STATE_PSUM,
+ STATE_PSWOE,
+ STATE_PSRING,
+ STATE_PSEXCM,
+ STATE_DEPC,
+ STATE_EXCVADDR,
+ STATE_WindowBase,
+ STATE_WindowStart,
+ STATE_PSCALLINC,
+ STATE_PSOWB,
+ STATE_LBEG,
+ STATE_LEND,
+ STATE_SAR,
+ STATE_THREADPTR,
+ STATE_LITBADDR,
+ STATE_LITBEN,
+ STATE_MISC0,
+ STATE_MISC1,
+ STATE_InOCDMode,
+ STATE_INTENABLE,
+ STATE_DBREAKA0,
+ STATE_DBREAKC0,
+ STATE_DBREAKA1,
+ STATE_DBREAKC1,
+ STATE_IBREAKA0,
+ STATE_IBREAKA1,
+ STATE_IBREAKENABLE,
+ STATE_ICOUNTLEVEL,
+ STATE_DEBUGCAUSE,
+ STATE_DBNUM,
+ STATE_CCOMPARE0,
+ STATE_CCOMPARE1,
+ STATE_CCOMPARE2,
+ STATE_ASID3,
+ STATE_ASID2,
+ STATE_ASID1,
+ STATE_INSTPGSZID4,
+ STATE_DATAPGSZID4,
+ STATE_PTBASE,
+ STATE_CPENABLE,
+ STATE_SCOMPARE1
+};
/* Field definitions. */
@@ -360,6 +399,25 @@ Field_sr_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
}
static unsigned
+Field_st_Slot_inst_get (const xtensa_insnbuf insn)
+{
+ unsigned tie_t = 0;
+ tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28);
+ tie_t = (tie_t << 4) | ((insn[0] << 12) >> 28);
+ return tie_t;
+}
+
+static void
+Field_st_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+{
+ uint32 tie_t;
+ tie_t = (val << 28) >> 28;
+ insn[0] = (insn[0] & ~0xf0000) | (tie_t << 16);
+ tie_t = (val << 24) >> 28;
+ insn[0] = (insn[0] & ~0xf000) | (tie_t << 12);
+}
+
+static unsigned
Field_thi3_Slot_inst_get (const xtensa_insnbuf insn)
{
unsigned tie_t = 0;
@@ -816,25 +874,6 @@ Field_sr_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
}
static unsigned
-Field_st_Slot_inst_get (const xtensa_insnbuf insn)
-{
- unsigned tie_t = 0;
- tie_t = (tie_t << 4) | ((insn[0] << 16) >> 28);
- tie_t = (tie_t << 4) | ((insn[0] << 12) >> 28);
- return tie_t;
-}
-
-static void
-Field_st_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
-{
- uint32 tie_t;
- tie_t = (val << 28) >> 28;
- insn[0] = (insn[0] & ~0xf0000) | (tie_t << 16);
- tie_t = (val << 24) >> 28;
- insn[0] = (insn[0] & ~0xf000) | (tie_t << 12);
-}
-
-static unsigned
Field_st_Slot_inst16a_get (const xtensa_insnbuf insn)
{
unsigned tie_t = 0;
@@ -1175,6 +1214,38 @@ Field_imm7_Slot_inst16b_set (xtensa_insnbuf insn, uint32 val)
insn[0] = (insn[0] & ~0x700) | (tie_t << 8);
}
+static unsigned
+Field_xt_wbr15_imm_Slot_inst_get (const xtensa_insnbuf insn)
+{
+ unsigned tie_t = 0;
+ tie_t = (tie_t << 15) | ((insn[0] << 8) >> 17);
+ return tie_t;
+}
+
+static void
+Field_xt_wbr15_imm_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+{
+ uint32 tie_t;
+ tie_t = (val << 17) >> 17;
+ insn[0] = (insn[0] & ~0xfffe00) | (tie_t << 9);
+}
+
+static unsigned
+Field_xt_wbr18_imm_Slot_inst_get (const xtensa_insnbuf insn)
+{
+ unsigned tie_t = 0;
+ tie_t = (tie_t << 18) | ((insn[0] << 8) >> 14);
+ return tie_t;
+}
+
+static void
+Field_xt_wbr18_imm_Slot_inst_set (xtensa_insnbuf insn, uint32 val)
+{
+ uint32 tie_t;
+ tie_t = (val << 14) >> 14;
+ insn[0] = (insn[0] & ~0xffffc0) | (tie_t << 6);
+}
+
static void
Implicit_Field_set (xtensa_insnbuf insn ATTRIBUTE_UNUSED,
uint32 val ATTRIBUTE_UNUSED)
@@ -1206,6 +1277,50 @@ Implicit_Field_ar12_get (const xtensa_insnbuf insn ATTRIBUTE_UNUSED)
return 12;
}
+enum xtensa_field_id {
+ FIELD_t,
+ FIELD_bbi4,
+ FIELD_bbi,
+ FIELD_imm12,
+ FIELD_imm8,
+ FIELD_s,
+ FIELD_imm12b,
+ FIELD_imm16,
+ FIELD_m,
+ FIELD_n,
+ FIELD_offset,
+ FIELD_op0,
+ FIELD_op1,
+ FIELD_op2,
+ FIELD_r,
+ FIELD_sa4,
+ FIELD_sae4,
+ FIELD_sae,
+ FIELD_sal,
+ FIELD_sargt,
+ FIELD_sas4,
+ FIELD_sas,
+ FIELD_sr,
+ FIELD_st,
+ FIELD_thi3,
+ FIELD_imm4,
+ FIELD_mn,
+ FIELD_i,
+ FIELD_imm6lo,
+ FIELD_imm6hi,
+ FIELD_imm7lo,
+ FIELD_imm7hi,
+ FIELD_z,
+ FIELD_imm6,
+ FIELD_imm7,
+ FIELD_xt_wbr15_imm,
+ FIELD_xt_wbr18_imm,
+ FIELD__ar0,
+ FIELD__ar4,
+ FIELD__ar8,
+ FIELD__ar12
+};
+
/* Functional units. */
@@ -1216,8 +1331,12 @@ static xtensa_funcUnit_internal funcUnits[] = {
/* Register files. */
+enum xtensa_regfile_id {
+ REGFILE_AR
+};
+
static xtensa_regfile_internal regfiles[] = {
- { "AR", "a", 0, 32, 64 }
+ { "AR", "a", REGFILE_AR, 32, 32 }
};
@@ -1422,7 +1541,7 @@ static int
Operand_ar0_encode (uint32 *valp)
{
int error;
- error = (*valp & ~0x3f) != 0;
+ error = (*valp & ~0x1f) != 0;
return error;
}
@@ -1436,7 +1555,7 @@ static int
Operand_ar4_encode (uint32 *valp)
{
int error;
- error = (*valp & ~0x3f) != 0;
+ error = (*valp & ~0x1f) != 0;
return error;
}
@@ -1450,7 +1569,7 @@ static int
Operand_ar8_encode (uint32 *valp)
{
int error;
- error = (*valp & ~0x3f) != 0;
+ error = (*valp & ~0x1f) != 0;
return error;
}
@@ -1464,7 +1583,7 @@ static int
Operand_ar12_encode (uint32 *valp)
{
int error;
- error = (*valp & ~0x3f) != 0;
+ error = (*valp & ~0x1f) != 0;
return error;
}
@@ -1478,7 +1597,7 @@ static int
Operand_ars_entry_encode (uint32 *valp)
{
int error;
- error = (*valp & ~0x3f) != 0;
+ error = (*valp & ~0x1f) != 0;
return error;
}
@@ -1487,7 +1606,7 @@ Operand_immrx4_decode (uint32 *valp)
{
unsigned immrx4_0, r_0;
r_0 = *valp & 0xf;
- immrx4_0 = ((((0xfffffff)) << 4) | r_0) << 2;
+ immrx4_0 = (((0xfffffff) << 4) | r_0) << 2;
*valp = immrx4_0;
return 0;
}
@@ -1547,7 +1666,7 @@ Operand_uimm6_decode (uint32 *valp)
{
unsigned uimm6_0, imm6_0;
imm6_0 = *valp & 0x3f;
- uimm6_0 = 0x4 + ((((0)) << 6) | imm6_0);
+ uimm6_0 = 0x4 + (((0) << 6) | imm6_0);
*valp = uimm6_0;
return 0;
}
@@ -1909,7 +2028,7 @@ Operand_ulabel8_decode (uint32 *valp)
{
unsigned ulabel8_0, imm8_0;
imm8_0 = *valp & 0xff;
- ulabel8_0 = 0x4 + ((((0)) << 8) | imm8_0);
+ ulabel8_0 = 0x4 + (((0) << 8) | imm8_0);
*valp = ulabel8_0;
return 0;
}
@@ -2011,7 +2130,7 @@ Operand_uimm16x4_decode (uint32 *valp)
{
unsigned uimm16x4_0, imm16_0;
imm16_0 = *valp & 0xffff;
- uimm16x4_0 = ((((0xffff)) << 16) | imm16_0) << 2;
+ uimm16x4_0 = (((0xffff) << 16) | imm16_0) << 2;
*valp = uimm16x4_0;
return 0;
}
@@ -2080,182 +2199,362 @@ Operand_imms_encode (uint32 *valp)
return 0;
}
+static int
+Operand_tp7_decode (uint32 *valp)
+{
+ unsigned tp7_0, t_0;
+ t_0 = *valp & 0xf;
+ tp7_0 = t_0 + 0x7;
+ *valp = tp7_0;
+ return 0;
+}
+
+static int
+Operand_tp7_encode (uint32 *valp)
+{
+ unsigned t_0, tp7_0;
+ tp7_0 = *valp;
+ t_0 = (tp7_0 - 0x7) & 0xf;
+ *valp = t_0;
+ return 0;
+}
+
+static int
+Operand_xt_wbr15_label_decode (uint32 *valp)
+{
+ unsigned xt_wbr15_label_0, xt_wbr15_imm_0;
+ xt_wbr15_imm_0 = *valp & 0x7fff;
+ xt_wbr15_label_0 = 0x4 + (((int) xt_wbr15_imm_0 << 17) >> 17);
+ *valp = xt_wbr15_label_0;
+ return 0;
+}
+
+static int
+Operand_xt_wbr15_label_encode (uint32 *valp)
+{
+ unsigned xt_wbr15_imm_0, xt_wbr15_label_0;
+ xt_wbr15_label_0 = *valp;
+ xt_wbr15_imm_0 = (xt_wbr15_label_0 - 0x4) & 0x7fff;
+ *valp = xt_wbr15_imm_0;
+ return 0;
+}
+
+static int
+Operand_xt_wbr15_label_ator (uint32 *valp, uint32 pc)
+{
+ *valp -= pc;
+ return 0;
+}
+
+static int
+Operand_xt_wbr15_label_rtoa (uint32 *valp, uint32 pc)
+{
+ *valp += pc;
+ return 0;
+}
+
+static int
+Operand_xt_wbr18_label_decode (uint32 *valp)
+{
+ unsigned xt_wbr18_label_0, xt_wbr18_imm_0;
+ xt_wbr18_imm_0 = *valp & 0x3ffff;
+ xt_wbr18_label_0 = 0x4 + (((int) xt_wbr18_imm_0 << 14) >> 14);
+ *valp = xt_wbr18_label_0;
+ return 0;
+}
+
+static int
+Operand_xt_wbr18_label_encode (uint32 *valp)
+{
+ unsigned xt_wbr18_imm_0, xt_wbr18_label_0;
+ xt_wbr18_label_0 = *valp;
+ xt_wbr18_imm_0 = (xt_wbr18_label_0 - 0x4) & 0x3ffff;
+ *valp = xt_wbr18_imm_0;
+ return 0;
+}
+
+static int
+Operand_xt_wbr18_label_ator (uint32 *valp, uint32 pc)
+{
+ *valp -= pc;
+ return 0;
+}
+
+static int
+Operand_xt_wbr18_label_rtoa (uint32 *valp, uint32 pc)
+{
+ *valp += pc;
+ return 0;
+}
+
static xtensa_operand_internal operands[] = {
- { "soffsetx4", 10, -1, 0,
+ { "soffsetx4", FIELD_offset, -1, 0,
XTENSA_OPERAND_IS_PCRELATIVE,
Operand_soffsetx4_encode, Operand_soffsetx4_decode,
Operand_soffsetx4_ator, Operand_soffsetx4_rtoa },
- { "uimm12x8", 3, -1, 0,
+ { "uimm12x8", FIELD_imm12, -1, 0,
0,
Operand_uimm12x8_encode, Operand_uimm12x8_decode,
0, 0 },
- { "simm4", 26, -1, 0,
+ { "simm4", FIELD_mn, -1, 0,
0,
Operand_simm4_encode, Operand_simm4_decode,
0, 0 },
- { "arr", 14, 0, 1,
+ { "arr", FIELD_r, REGFILE_AR, 1,
XTENSA_OPERAND_IS_REGISTER,
Operand_arr_encode, Operand_arr_decode,
0, 0 },
- { "ars", 5, 0, 1,
+ { "ars", FIELD_s, REGFILE_AR, 1,
XTENSA_OPERAND_IS_REGISTER,
Operand_ars_encode, Operand_ars_decode,
0, 0 },
- { "*ars_invisible", 5, 0, 1,
+ { "*ars_invisible", FIELD_s, REGFILE_AR, 1,
XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE,
Operand_ars_encode, Operand_ars_decode,
0, 0 },
- { "art", 0, 0, 1,
+ { "art", FIELD_t, REGFILE_AR, 1,
XTENSA_OPERAND_IS_REGISTER,
Operand_art_encode, Operand_art_decode,
0, 0 },
- { "ar0", 35, 0, 1,
+ { "ar0", FIELD__ar0, REGFILE_AR, 1,
XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE,
Operand_ar0_encode, Operand_ar0_decode,
0, 0 },
- { "ar4", 36, 0, 1,
+ { "ar4", FIELD__ar4, REGFILE_AR, 1,
XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE,
Operand_ar4_encode, Operand_ar4_decode,
0, 0 },
- { "ar8", 37, 0, 1,
+ { "ar8", FIELD__ar8, REGFILE_AR, 1,
XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE,
Operand_ar8_encode, Operand_ar8_decode,
0, 0 },
- { "ar12", 38, 0, 1,
+ { "ar12", FIELD__ar12, REGFILE_AR, 1,
XTENSA_OPERAND_IS_REGISTER | XTENSA_OPERAND_IS_INVISIBLE,
Operand_ar12_encode, Operand_ar12_decode,
0, 0 },
- { "ars_entry", 5, 0, 1,
+ { "ars_entry", FIELD_s, REGFILE_AR, 1,
XTENSA_OPERAND_IS_REGISTER,
Operand_ars_entry_encode, Operand_ars_entry_decode,
0, 0 },
- { "immrx4", 14, -1, 0,
+ { "immrx4", FIELD_r, -1, 0,
0,
Operand_immrx4_encode, Operand_immrx4_decode,
0, 0 },
- { "lsi4x4", 14, -1, 0,
+ { "lsi4x4", FIELD_r, -1, 0,
0,
Operand_lsi4x4_encode, Operand_lsi4x4_decode,
0, 0 },
- { "simm7", 34, -1, 0,
+ { "simm7", FIELD_imm7, -1, 0,
0,
Operand_simm7_encode, Operand_simm7_decode,
0, 0 },
- { "uimm6", 33, -1, 0,
+ { "uimm6", FIELD_imm6, -1, 0,
XTENSA_OPERAND_IS_PCRELATIVE,
Operand_uimm6_encode, Operand_uimm6_decode,
Operand_uimm6_ator, Operand_uimm6_rtoa },
- { "ai4const", 0, -1, 0,
+ { "ai4const", FIELD_t, -1, 0,
0,
Operand_ai4const_encode, Operand_ai4const_decode,
0, 0 },
- { "b4const", 14, -1, 0,
+ { "b4const", FIELD_r, -1, 0,
0,
Operand_b4const_encode, Operand_b4const_decode,
0, 0 },
- { "b4constu", 14, -1, 0,
+ { "b4constu", FIELD_r, -1, 0,
0,
Operand_b4constu_encode, Operand_b4constu_decode,
0, 0 },
- { "uimm8", 4, -1, 0,
+ { "uimm8", FIELD_imm8, -1, 0,
0,
Operand_uimm8_encode, Operand_uimm8_decode,
0, 0 },
- { "uimm8x2", 4, -1, 0,
+ { "uimm8x2", FIELD_imm8, -1, 0,
0,
Operand_uimm8x2_encode, Operand_uimm8x2_decode,
0, 0 },
- { "uimm8x4", 4, -1, 0,
+ { "uimm8x4", FIELD_imm8, -1, 0,
0,
Operand_uimm8x4_encode, Operand_uimm8x4_decode,
0, 0 },
- { "uimm4x16", 13, -1, 0,
+ { "uimm4x16", FIELD_op2, -1, 0,
0,
Operand_uimm4x16_encode, Operand_uimm4x16_decode,
0, 0 },
- { "simm8", 4, -1, 0,
+ { "simm8", FIELD_imm8, -1, 0,
0,
Operand_simm8_encode, Operand_simm8_decode,
0, 0 },
- { "simm8x256", 4, -1, 0,
+ { "simm8x256", FIELD_imm8, -1, 0,
0,
Operand_simm8x256_encode, Operand_simm8x256_decode,
0, 0 },
- { "simm12b", 6, -1, 0,
+ { "simm12b", FIELD_imm12b, -1, 0,
0,
Operand_simm12b_encode, Operand_simm12b_decode,
0, 0 },
- { "msalp32", 18, -1, 0,
+ { "msalp32", FIELD_sal, -1, 0,
0,
Operand_msalp32_encode, Operand_msalp32_decode,
0, 0 },
- { "op2p1", 13, -1, 0,
+ { "op2p1", FIELD_op2, -1, 0,
0,
Operand_op2p1_encode, Operand_op2p1_decode,
0, 0 },
- { "label8", 4, -1, 0,
+ { "label8", FIELD_imm8, -1, 0,
XTENSA_OPERAND_IS_PCRELATIVE,
Operand_label8_encode, Operand_label8_decode,
Operand_label8_ator, Operand_label8_rtoa },
- { "ulabel8", 4, -1, 0,
+ { "ulabel8", FIELD_imm8, -1, 0,
XTENSA_OPERAND_IS_PCRELATIVE,
Operand_ulabel8_encode, Operand_ulabel8_decode,
Operand_ulabel8_ator, Operand_ulabel8_rtoa },
- { "label12", 3, -1, 0,
+ { "label12", FIELD_imm12, -1, 0,
XTENSA_OPERAND_IS_PCRELATIVE,
Operand_label12_encode, Operand_label12_decode,
Operand_label12_ator, Operand_label12_rtoa },
- { "soffset", 10, -1, 0,
+ { "soffset", FIELD_offset, -1, 0,
XTENSA_OPERAND_IS_PCRELATIVE,
Operand_soffset_encode, Operand_soffset_decode,
Operand_soffset_ator, Operand_soffset_rtoa },
- { "uimm16x4", 7, -1, 0,
+ { "uimm16x4", FIELD_imm16, -1, 0,
XTENSA_OPERAND_IS_PCRELATIVE,
Operand_uimm16x4_encode, Operand_uimm16x4_decode,
Operand_uimm16x4_ator, Operand_uimm16x4_rtoa },
- { "immt", 0, -1, 0,
+ { "immt", FIELD_t, -1, 0,
0,
Operand_immt_encode, Operand_immt_decode,
0, 0 },
- { "imms", 5, -1, 0,
+ { "imms", FIELD_s, -1, 0,
0,
Operand_imms_encode, Operand_imms_decode,
0, 0 },
- { "t", 0, -1, 0, 0, 0, 0, 0, 0 },
- { "bbi4", 1, -1, 0, 0, 0, 0, 0, 0 },
- { "bbi", 2, -1, 0, 0, 0, 0, 0, 0 },
- { "imm12", 3, -1, 0, 0, 0, 0, 0, 0 },
- { "imm8", 4, -1, 0, 0, 0, 0, 0, 0 },
- { "s", 5, -1, 0, 0, 0, 0, 0, 0 },
- { "imm12b", 6, -1, 0, 0, 0, 0, 0, 0 },
- { "imm16", 7, -1, 0, 0, 0, 0, 0, 0 },
- { "m", 8, -1, 0, 0, 0, 0, 0, 0 },
- { "n", 9, -1, 0, 0, 0, 0, 0, 0 },
- { "offset", 10, -1, 0, 0, 0, 0, 0, 0 },
- { "op0", 11, -1, 0, 0, 0, 0, 0, 0 },
- { "op1", 12, -1, 0, 0, 0, 0, 0, 0 },
- { "op2", 13, -1, 0, 0, 0, 0, 0, 0 },
- { "r", 14, -1, 0, 0, 0, 0, 0, 0 },
- { "sa4", 15, -1, 0, 0, 0, 0, 0, 0 },
- { "sae4", 16, -1, 0, 0, 0, 0, 0, 0 },
- { "sae", 17, -1, 0, 0, 0, 0, 0, 0 },
- { "sal", 18, -1, 0, 0, 0, 0, 0, 0 },
- { "sargt", 19, -1, 0, 0, 0, 0, 0, 0 },
- { "sas4", 20, -1, 0, 0, 0, 0, 0, 0 },
- { "sas", 21, -1, 0, 0, 0, 0, 0, 0 },
- { "sr", 22, -1, 0, 0, 0, 0, 0, 0 },
- { "st", 23, -1, 0, 0, 0, 0, 0, 0 },
- { "thi3", 24, -1, 0, 0, 0, 0, 0, 0 },
- { "imm4", 25, -1, 0, 0, 0, 0, 0, 0 },
- { "mn", 26, -1, 0, 0, 0, 0, 0, 0 },
- { "i", 27, -1, 0, 0, 0, 0, 0, 0 },
- { "imm6lo", 28, -1, 0, 0, 0, 0, 0, 0 },
- { "imm6hi", 29, -1, 0, 0, 0, 0, 0, 0 },
- { "imm7lo", 30, -1, 0, 0, 0, 0, 0, 0 },
- { "imm7hi", 31, -1, 0, 0, 0, 0, 0, 0 },
- { "z", 32, -1, 0, 0, 0, 0, 0, 0 },
- { "imm6", 33, -1, 0, 0, 0, 0, 0, 0 },
- { "imm7", 34, -1, 0, 0, 0, 0, 0, 0 }
+ { "tp7", FIELD_t, -1, 0,
+ 0,
+ Operand_tp7_encode, Operand_tp7_decode,
+ 0, 0 },
+ { "xt_wbr15_label", FIELD_xt_wbr15_imm, -1, 0,
+ XTENSA_OPERAND_IS_PCRELATIVE,
+ Operand_xt_wbr15_label_encode, Operand_xt_wbr15_label_decode,
+ Operand_xt_wbr15_label_ator, Operand_xt_wbr15_label_rtoa },
+ { "xt_wbr18_label", FIELD_xt_wbr18_imm, -1, 0,
+ XTENSA_OPERAND_IS_PCRELATIVE,
+ Operand_xt_wbr18_label_encode, Operand_xt_wbr18_label_decode,
+ Operand_xt_wbr18_label_ator, Operand_xt_wbr18_label_rtoa },
+ { "t", FIELD_t, -1, 0, 0, 0, 0, 0, 0 },
+ { "bbi4", FIELD_bbi4, -1, 0, 0, 0, 0, 0, 0 },
+ { "bbi", FIELD_bbi, -1, 0, 0, 0, 0, 0, 0 },
+ { "imm12", FIELD_imm12, -1, 0, 0, 0, 0, 0, 0 },
+ { "imm8", FIELD_imm8, -1, 0, 0, 0, 0, 0, 0 },
+ { "s", FIELD_s, -1, 0, 0, 0, 0, 0, 0 },
+ { "imm12b", FIELD_imm12b, -1, 0, 0, 0, 0, 0, 0 },
+ { "imm16", FIELD_imm16, -1, 0, 0, 0, 0, 0, 0 },
+ { "m", FIELD_m, -1, 0, 0, 0, 0, 0, 0 },
+ { "n", FIELD_n, -1, 0, 0, 0, 0, 0, 0 },
+ { "offset", FIELD_offset, -1, 0, 0, 0, 0, 0, 0 },
+ { "op0", FIELD_op0, -1, 0, 0, 0, 0, 0, 0 },
+ { "op1", FIELD_op1, -1, 0, 0, 0, 0, 0, 0 },
+ { "op2", FIELD_op2, -1, 0, 0, 0, 0, 0, 0 },
+ { "r", FIELD_r, -1, 0, 0, 0, 0, 0, 0 },
+ { "sa4", FIELD_sa4, -1, 0, 0, 0, 0, 0, 0 },
+ { "sae4", FIELD_sae4, -1, 0, 0, 0, 0, 0, 0 },
+ { "sae", FIELD_sae, -1, 0, 0, 0, 0, 0, 0 },
+ { "sal", FIELD_sal, -1, 0, 0, 0, 0, 0, 0 },
+ { "sargt", FIELD_sargt, -1, 0, 0, 0, 0, 0, 0 },
+ { "sas4", FIELD_sas4, -1, 0, 0, 0, 0, 0, 0 },
+ { "sas", FIELD_sas, -1, 0, 0, 0, 0, 0, 0 },
+ { "sr", FIELD_sr, -1, 0, 0, 0, 0, 0, 0 },
+ { "st", FIELD_st, -1, 0, 0, 0, 0, 0, 0 },
+ { "thi3", FIELD_thi3, -1, 0, 0, 0, 0, 0, 0 },
+ { "imm4", FIELD_imm4, -1, 0, 0, 0, 0, 0, 0 },
+ { "mn", FIELD_mn, -1, 0, 0, 0, 0, 0, 0 },
+ { "i", FIELD_i, -1, 0, 0, 0, 0, 0, 0 },
+ { "imm6lo", FIELD_imm6lo, -1, 0, 0, 0, 0, 0, 0 },
+ { "imm6hi", FIELD_imm6hi, -1, 0, 0, 0, 0, 0, 0 },
+ { "imm7lo", FIELD_imm7lo, -1, 0, 0, 0, 0, 0, 0 },
+ { "imm7hi", FIELD_imm7hi, -1, 0, 0, 0, 0, 0, 0 },
+ { "z", FIELD_z, -1, 0, 0, 0, 0, 0, 0 },
+ { "imm6", FIELD_imm6, -1, 0, 0, 0, 0, 0, 0 },
+ { "imm7", FIELD_imm7, -1, 0, 0, 0, 0, 0, 0 },
+ { "xt_wbr15_imm", FIELD_xt_wbr15_imm, -1, 0, 0, 0, 0, 0, 0 },
+ { "xt_wbr18_imm", FIELD_xt_wbr18_imm, -1, 0, 0, 0, 0, 0, 0 }
+};
+
+enum xtensa_operand_id {
+ OPERAND_soffsetx4,
+ OPERAND_uimm12x8,
+ OPERAND_simm4,
+ OPERAND_arr,
+ OPERAND_ars,
+ OPERAND__ars_invisible,
+ OPERAND_art,
+ OPERAND_ar0,
+ OPERAND_ar4,
+ OPERAND_ar8,
+ OPERAND_ar12,
+ OPERAND_ars_entry,
+ OPERAND_immrx4,
+ OPERAND_lsi4x4,
+ OPERAND_simm7,
+ OPERAND_uimm6,
+ OPERAND_ai4const,
+ OPERAND_b4const,
+ OPERAND_b4constu,
+ OPERAND_uimm8,
+ OPERAND_uimm8x2,
+ OPERAND_uimm8x4,
+ OPERAND_uimm4x16,
+ OPERAND_simm8,
+ OPERAND_simm8x256,
+ OPERAND_simm12b,
+ OPERAND_msalp32,
+ OPERAND_op2p1,
+ OPERAND_label8,
+ OPERAND_ulabel8,
+ OPERAND_label12,
+ OPERAND_soffset,
+ OPERAND_uimm16x4,
+ OPERAND_immt,
+ OPERAND_imms,
+ OPERAND_tp7,
+ OPERAND_xt_wbr15_label,
+ OPERAND_xt_wbr18_label,
+ OPERAND_t,
+ OPERAND_bbi4,
+ OPERAND_bbi,
+ OPERAND_imm12,
+ OPERAND_imm8,
+ OPERAND_s,
+ OPERAND_imm12b,
+ OPERAND_imm16,
+ OPERAND_m,
+ OPERAND_n,
+ OPERAND_offset,
+ OPERAND_op0,
+ OPERAND_op1,
+ OPERAND_op2,
+ OPERAND_r,
+ OPERAND_sa4,
+ OPERAND_sae4,
+ OPERAND_sae,
+ OPERAND_sal,
+ OPERAND_sargt,
+ OPERAND_sas4,
+ OPERAND_sas,
+ OPERAND_sr,
+ OPERAND_st,
+ OPERAND_thi3,
+ OPERAND_imm4,
+ OPERAND_mn,
+ OPERAND_i,
+ OPERAND_imm6lo,
+ OPERAND_imm6hi,
+ OPERAND_imm7lo,
+ OPERAND_imm7hi,
+ OPERAND_z,
+ OPERAND_imm6,
+ OPERAND_imm7,
+ OPERAND_xt_wbr15_imm,
+ OPERAND_xt_wbr18_imm
};
@@ -2274,8 +2573,8 @@ static xtensa_arg_internal Iclass_xt_iclass_rfde_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_call12_args[] = {
- { { 0 /* soffsetx4 */ }, 'i' },
- { { 10 /* ar12 */ }, 'o' }
+ { { OPERAND_soffsetx4 }, 'i' },
+ { { OPERAND_ar12 }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_call12_stateArgs[] = {
@@ -2283,8 +2582,8 @@ static xtensa_arg_internal Iclass_xt_iclass_call12_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_call8_args[] = {
- { { 0 /* soffsetx4 */ }, 'i' },
- { { 9 /* ar8 */ }, 'o' }
+ { { OPERAND_soffsetx4 }, 'i' },
+ { { OPERAND_ar8 }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_call8_stateArgs[] = {
@@ -2292,8 +2591,8 @@ static xtensa_arg_internal Iclass_xt_iclass_call8_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_call4_args[] = {
- { { 0 /* soffsetx4 */ }, 'i' },
- { { 8 /* ar4 */ }, 'o' }
+ { { OPERAND_soffsetx4 }, 'i' },
+ { { OPERAND_ar4 }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_call4_stateArgs[] = {
@@ -2301,8 +2600,8 @@ static xtensa_arg_internal Iclass_xt_iclass_call4_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_callx12_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 10 /* ar12 */ }, 'o' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_ar12 }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_callx12_stateArgs[] = {
@@ -2310,8 +2609,8 @@ static xtensa_arg_internal Iclass_xt_iclass_callx12_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_callx8_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 9 /* ar8 */ }, 'o' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_ar8 }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_callx8_stateArgs[] = {
@@ -2319,8 +2618,8 @@ static xtensa_arg_internal Iclass_xt_iclass_callx8_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_callx4_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 8 /* ar4 */ }, 'o' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_ar4 }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_callx4_stateArgs[] = {
@@ -2328,9 +2627,9 @@ static xtensa_arg_internal Iclass_xt_iclass_callx4_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_entry_args[] = {
- { { 11 /* ars_entry */ }, 's' },
- { { 4 /* ars */ }, 'i' },
- { { 1 /* uimm12x8 */ }, 'i' }
+ { { OPERAND_ars_entry }, 's' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm12x8 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_entry_stateArgs[] = {
@@ -2342,8 +2641,8 @@ static xtensa_arg_internal Iclass_xt_iclass_entry_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_movsp_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_movsp_stateArgs[] = {
@@ -2352,7 +2651,7 @@ static xtensa_arg_internal Iclass_xt_iclass_movsp_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rotw_args[] = {
- { { 2 /* simm4 */ }, 'i' }
+ { { OPERAND_simm4 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_rotw_stateArgs[] = {
@@ -2362,7 +2661,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rotw_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_retw_args[] = {
- { { 5 /* *ars_invisible */ }, 'i' }
+ { { OPERAND__ars_invisible }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_retw_stateArgs[] = {
@@ -2382,9 +2681,9 @@ static xtensa_arg_internal Iclass_xt_iclass_rfwou_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_l32e_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 12 /* immrx4 */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_immrx4 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_l32e_stateArgs[] = {
@@ -2393,9 +2692,9 @@ static xtensa_arg_internal Iclass_xt_iclass_l32e_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_s32e_args[] = {
- { { 6 /* art */ }, 'i' },
- { { 4 /* ars */ }, 'i' },
- { { 12 /* immrx4 */ }, 'i' }
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_immrx4 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_s32e_stateArgs[] = {
@@ -2404,7 +2703,7 @@ static xtensa_arg_internal Iclass_xt_iclass_s32e_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_windowbase_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_windowbase_stateArgs[] = {
@@ -2414,7 +2713,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_windowbase_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_windowbase_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_windowbase_stateArgs[] = {
@@ -2424,7 +2723,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_windowbase_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_windowbase_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_windowbase_stateArgs[] = {
@@ -2434,7 +2733,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_windowbase_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_windowstart_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_windowstart_stateArgs[] = {
@@ -2444,7 +2743,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_windowstart_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_windowstart_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_windowstart_stateArgs[] = {
@@ -2454,7 +2753,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_windowstart_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_windowstart_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_windowstart_stateArgs[] = {
@@ -2464,147 +2763,163 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_windowstart_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_add_n_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_addi_n_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 16 /* ai4const */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_ai4const }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_bz6_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 15 /* uimm6 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm6 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_loadi4_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 13 /* lsi4x4 */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_lsi4x4 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_mov_n_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_movi_n_args[] = {
- { { 4 /* ars */ }, 'o' },
- { { 14 /* simm7 */ }, 'i' }
+ { { OPERAND_ars }, 'o' },
+ { { OPERAND_simm7 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_retn_args[] = {
- { { 5 /* *ars_invisible */ }, 'i' }
+ { { OPERAND__ars_invisible }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_storei4_args[] = {
- { { 6 /* art */ }, 'i' },
- { { 4 /* ars */ }, 'i' },
- { { 13 /* lsi4x4 */ }, 'i' }
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_lsi4x4 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_rur_threadptr_args[] = {
+ { { OPERAND_arr }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_rur_threadptr_stateArgs[] = {
+ { { STATE_THREADPTR }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_wur_threadptr_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_wur_threadptr_stateArgs[] = {
+ { { STATE_THREADPTR }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_addi_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 23 /* simm8 */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_simm8 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_addmi_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 24 /* simm8x256 */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_simm8x256 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_addsub_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_bit_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_bsi8_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 17 /* b4const */ }, 'i' },
- { { 28 /* label8 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_b4const }, 'i' },
+ { { OPERAND_label8 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_bsi8b_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 37 /* bbi */ }, 'i' },
- { { 28 /* label8 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_bbi }, 'i' },
+ { { OPERAND_label8 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_bsi8u_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 18 /* b4constu */ }, 'i' },
- { { 28 /* label8 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_b4constu }, 'i' },
+ { { OPERAND_label8 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_bst8_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 6 /* art */ }, 'i' },
- { { 28 /* label8 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_label8 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_bsz12_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 30 /* label12 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_label12 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_call0_args[] = {
- { { 0 /* soffsetx4 */ }, 'i' },
- { { 7 /* ar0 */ }, 'o' }
+ { { OPERAND_soffsetx4 }, 'i' },
+ { { OPERAND_ar0 }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_callx0_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 7 /* ar0 */ }, 'o' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_ar0 }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_exti_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 6 /* art */ }, 'i' },
- { { 52 /* sae */ }, 'i' },
- { { 27 /* op2p1 */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_sae }, 'i' },
+ { { OPERAND_op2p1 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_jump_args[] = {
- { { 31 /* soffset */ }, 'i' }
+ { { OPERAND_soffset }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_jumpx_args[] = {
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_l16ui_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 20 /* uimm8x2 */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x2 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_l16si_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 20 /* uimm8x2 */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x2 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_l32i_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 21 /* uimm8x4 */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x4 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_l32r_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 32 /* uimm16x4 */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_uimm16x4 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_l32r_stateArgs[] = {
@@ -2613,14 +2928,14 @@ static xtensa_arg_internal Iclass_xt_iclass_l32r_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_l8i_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 19 /* uimm8 */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_loop_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 29 /* ulabel8 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_ulabel8 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_loop_stateArgs[] = {
@@ -2630,8 +2945,8 @@ static xtensa_arg_internal Iclass_xt_iclass_loop_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_loopz_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 29 /* ulabel8 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_ulabel8 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_loopz_stateArgs[] = {
@@ -2641,45 +2956,45 @@ static xtensa_arg_internal Iclass_xt_iclass_loopz_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_movi_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 25 /* simm12b */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_simm12b }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_movz_args[] = {
- { { 3 /* arr */ }, 'm' },
- { { 4 /* ars */ }, 'i' },
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_arr }, 'm' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_neg_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_return_args[] = {
- { { 5 /* *ars_invisible */ }, 'i' }
+ { { OPERAND__ars_invisible }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_s16i_args[] = {
- { { 6 /* art */ }, 'i' },
- { { 4 /* ars */ }, 'i' },
- { { 20 /* uimm8x2 */ }, 'i' }
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x2 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_s32i_args[] = {
- { { 6 /* art */ }, 'i' },
- { { 4 /* ars */ }, 'i' },
- { { 21 /* uimm8x4 */ }, 'i' }
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x4 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_s8i_args[] = {
- { { 6 /* art */ }, 'i' },
- { { 4 /* ars */ }, 'i' },
- { { 19 /* uimm8 */ }, 'i' }
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_sar_args[] = {
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_sar_stateArgs[] = {
@@ -2687,7 +3002,7 @@ static xtensa_arg_internal Iclass_xt_iclass_sar_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_sari_args[] = {
- { { 56 /* sas */ }, 'i' }
+ { { OPERAND_sas }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_sari_stateArgs[] = {
@@ -2695,8 +3010,8 @@ static xtensa_arg_internal Iclass_xt_iclass_sari_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_shifts_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_shifts_stateArgs[] = {
@@ -2704,9 +3019,9 @@ static xtensa_arg_internal Iclass_xt_iclass_shifts_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_shiftst_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_shiftst_stateArgs[] = {
@@ -2714,8 +3029,8 @@ static xtensa_arg_internal Iclass_xt_iclass_shiftst_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_shiftt_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_shiftt_stateArgs[] = {
@@ -2723,21 +3038,21 @@ static xtensa_arg_internal Iclass_xt_iclass_shiftt_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_slli_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 4 /* ars */ }, 'i' },
- { { 26 /* msalp32 */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_msalp32 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_srai_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 6 /* art */ }, 'i' },
- { { 54 /* sargt */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_sargt }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_srli_args[] = {
- { { 3 /* arr */ }, 'o' },
- { { 6 /* art */ }, 'i' },
- { { 40 /* s */ }, 'i' }
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_s }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_sync_stateArgs[] = {
@@ -2745,8 +3060,8 @@ static xtensa_arg_internal Iclass_xt_iclass_sync_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsil_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 40 /* s */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_s }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsil_stateArgs[] = {
@@ -2760,7 +3075,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsil_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_lend_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_lend_stateArgs[] = {
@@ -2768,7 +3083,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_lend_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_lend_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_lend_stateArgs[] = {
@@ -2776,7 +3091,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_lend_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_lend_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_lend_stateArgs[] = {
@@ -2784,7 +3099,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_lend_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_lcount_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_lcount_stateArgs[] = {
@@ -2792,7 +3107,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_lcount_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_lcount_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_lcount_stateArgs[] = {
@@ -2801,7 +3116,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_lcount_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_lcount_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_lcount_stateArgs[] = {
@@ -2810,7 +3125,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_lcount_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_lbeg_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_lbeg_stateArgs[] = {
@@ -2818,7 +3133,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_lbeg_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_lbeg_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_lbeg_stateArgs[] = {
@@ -2826,7 +3141,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_lbeg_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_lbeg_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_lbeg_stateArgs[] = {
@@ -2834,7 +3149,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_lbeg_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_sar_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_sar_stateArgs[] = {
@@ -2842,7 +3157,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_sar_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_sar_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_sar_stateArgs[] = {
@@ -2851,7 +3166,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_sar_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_sar_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_sar_stateArgs[] = {
@@ -2859,7 +3174,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_sar_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_litbase_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_litbase_stateArgs[] = {
@@ -2868,7 +3183,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_litbase_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_litbase_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_litbase_stateArgs[] = {
@@ -2877,7 +3192,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_litbase_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_litbase_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_litbase_stateArgs[] = {
@@ -2886,7 +3201,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_litbase_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_176_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_176_stateArgs[] = {
@@ -2894,8 +3209,17 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_176_stateArgs[] = {
{ { STATE_PSRING }, 'i' }
};
+static xtensa_arg_internal Iclass_xt_iclass_wsr_176_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_176_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' }
+};
+
static xtensa_arg_internal Iclass_xt_iclass_rsr_208_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_208_stateArgs[] = {
@@ -2904,7 +3228,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_208_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ps_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ps_stateArgs[] = {
@@ -2918,7 +3242,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_ps_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ps_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ps_stateArgs[] = {
@@ -2932,7 +3256,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_ps_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ps_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ps_stateArgs[] = {
@@ -2946,7 +3270,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_ps_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_epc1_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_epc1_stateArgs[] = {
@@ -2956,7 +3280,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_epc1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_epc1_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_epc1_stateArgs[] = {
@@ -2966,7 +3290,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_epc1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_epc1_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_epc1_stateArgs[] = {
@@ -2976,7 +3300,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_epc1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave1_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave1_stateArgs[] = {
@@ -2986,7 +3310,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave1_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave1_stateArgs[] = {
@@ -2996,7 +3320,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave1_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave1_stateArgs[] = {
@@ -3006,7 +3330,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_epc2_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_epc2_stateArgs[] = {
@@ -3016,7 +3340,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_epc2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_epc2_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_epc2_stateArgs[] = {
@@ -3026,7 +3350,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_epc2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_epc2_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_epc2_stateArgs[] = {
@@ -3036,7 +3360,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_epc2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave2_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave2_stateArgs[] = {
@@ -3046,7 +3370,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave2_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave2_stateArgs[] = {
@@ -3056,7 +3380,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave2_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave2_stateArgs[] = {
@@ -3066,7 +3390,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_epc3_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_epc3_stateArgs[] = {
@@ -3076,7 +3400,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_epc3_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_epc3_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_epc3_stateArgs[] = {
@@ -3086,7 +3410,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_epc3_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_epc3_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_epc3_stateArgs[] = {
@@ -3096,7 +3420,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_epc3_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave3_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave3_stateArgs[] = {
@@ -3106,7 +3430,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave3_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave3_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave3_stateArgs[] = {
@@ -3116,7 +3440,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave3_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave3_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave3_stateArgs[] = {
@@ -3126,7 +3450,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave3_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_epc4_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_epc4_stateArgs[] = {
@@ -3136,7 +3460,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_epc4_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_epc4_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_epc4_stateArgs[] = {
@@ -3146,7 +3470,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_epc4_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_epc4_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_epc4_stateArgs[] = {
@@ -3156,7 +3480,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_epc4_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave4_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave4_stateArgs[] = {
@@ -3166,7 +3490,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave4_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave4_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave4_stateArgs[] = {
@@ -3176,7 +3500,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave4_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave4_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave4_stateArgs[] = {
@@ -3185,8 +3509,188 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave4_stateArgs[] = {
{ { STATE_EXCSAVE4 }, 'm' }
};
+static xtensa_arg_internal Iclass_xt_iclass_rsr_epc5_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_epc5_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPC5 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_epc5_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_epc5_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPC5 }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_epc5_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_epc5_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPC5 }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave5_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave5_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EXCSAVE5 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave5_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave5_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EXCSAVE5 }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave5_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave5_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EXCSAVE5 }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_epc6_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_epc6_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPC6 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_epc6_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_epc6_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPC6 }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_epc6_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_epc6_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPC6 }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave6_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave6_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EXCSAVE6 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave6_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave6_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EXCSAVE6 }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave6_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave6_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EXCSAVE6 }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_epc7_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_epc7_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPC7 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_epc7_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_epc7_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPC7 }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_epc7_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_epc7_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPC7 }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave7_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_excsave7_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EXCSAVE7 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave7_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_excsave7_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EXCSAVE7 }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave7_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_excsave7_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EXCSAVE7 }, 'm' }
+};
+
static xtensa_arg_internal Iclass_xt_iclass_rsr_eps2_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_eps2_stateArgs[] = {
@@ -3196,7 +3700,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_eps2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_eps2_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_eps2_stateArgs[] = {
@@ -3206,7 +3710,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_eps2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_eps2_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_eps2_stateArgs[] = {
@@ -3216,7 +3720,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_eps2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_eps3_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_eps3_stateArgs[] = {
@@ -3226,7 +3730,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_eps3_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_eps3_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_eps3_stateArgs[] = {
@@ -3236,7 +3740,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_eps3_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_eps3_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_eps3_stateArgs[] = {
@@ -3246,7 +3750,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_eps3_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_eps4_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_eps4_stateArgs[] = {
@@ -3256,7 +3760,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_eps4_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_eps4_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_eps4_stateArgs[] = {
@@ -3266,7 +3770,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_eps4_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_eps4_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_eps4_stateArgs[] = {
@@ -3275,8 +3779,98 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_eps4_stateArgs[] = {
{ { STATE_EPS4 }, 'm' }
};
+static xtensa_arg_internal Iclass_xt_iclass_rsr_eps5_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_eps5_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPS5 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_eps5_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_eps5_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPS5 }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_eps5_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_eps5_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPS5 }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_eps6_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_eps6_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPS6 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_eps6_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_eps6_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPS6 }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_eps6_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_eps6_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPS6 }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_eps7_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_eps7_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPS7 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_eps7_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_eps7_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPS7 }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_eps7_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_eps7_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_EPS7 }, 'm' }
+};
+
static xtensa_arg_internal Iclass_xt_iclass_rsr_excvaddr_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_excvaddr_stateArgs[] = {
@@ -3286,7 +3880,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_excvaddr_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_excvaddr_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_excvaddr_stateArgs[] = {
@@ -3296,7 +3890,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_excvaddr_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_excvaddr_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_excvaddr_stateArgs[] = {
@@ -3306,7 +3900,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_excvaddr_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_depc_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_depc_stateArgs[] = {
@@ -3316,7 +3910,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_depc_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_depc_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_depc_stateArgs[] = {
@@ -3326,7 +3920,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_depc_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_depc_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_depc_stateArgs[] = {
@@ -3336,7 +3930,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_depc_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_exccause_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_exccause_stateArgs[] = {
@@ -3347,7 +3941,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_exccause_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_exccause_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_exccause_stateArgs[] = {
@@ -3357,7 +3951,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_exccause_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_exccause_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_exccause_stateArgs[] = {
@@ -3367,7 +3961,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_exccause_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_misc0_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_misc0_stateArgs[] = {
@@ -3377,7 +3971,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_misc0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_misc0_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_misc0_stateArgs[] = {
@@ -3387,7 +3981,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_misc0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_misc0_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_misc0_stateArgs[] = {
@@ -3397,7 +3991,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_misc0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_misc1_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_misc1_stateArgs[] = {
@@ -3407,7 +4001,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_misc1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_misc1_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_misc1_stateArgs[] = {
@@ -3417,7 +4011,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_misc1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_misc1_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_misc1_stateArgs[] = {
@@ -3427,7 +4021,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_misc1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_prid_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_prid_stateArgs[] = {
@@ -3435,8 +4029,44 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_prid_stateArgs[] = {
{ { STATE_PSRING }, 'i' }
};
+static xtensa_arg_internal Iclass_xt_iclass_rsr_vecbase_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_vecbase_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_VECBASE }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_vecbase_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_vecbase_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_VECBASE }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_vecbase_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_vecbase_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_VECBASE }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_mul16_args[] = {
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_art }, 'i' }
+};
+
static xtensa_arg_internal Iclass_xt_iclass_rfi_args[] = {
- { { 40 /* s */ }, 'i' }
+ { { OPERAND_s }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_rfi_stateArgs[] = {
@@ -3451,14 +4081,20 @@ static xtensa_arg_internal Iclass_xt_iclass_rfi_stateArgs[] = {
{ { STATE_EPC2 }, 'i' },
{ { STATE_EPC3 }, 'i' },
{ { STATE_EPC4 }, 'i' },
+ { { STATE_EPC5 }, 'i' },
+ { { STATE_EPC6 }, 'i' },
+ { { STATE_EPC7 }, 'i' },
{ { STATE_EPS2 }, 'i' },
{ { STATE_EPS3 }, 'i' },
{ { STATE_EPS4 }, 'i' },
+ { { STATE_EPS5 }, 'i' },
+ { { STATE_EPS6 }, 'i' },
+ { { STATE_EPS7 }, 'i' },
{ { STATE_InOCDMode }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_wait_args[] = {
- { { 40 /* s */ }, 'i' }
+ { { OPERAND_s }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wait_stateArgs[] = {
@@ -3468,7 +4104,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wait_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_interrupt_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_interrupt_stateArgs[] = {
@@ -3478,7 +4114,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_interrupt_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_intset_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_intset_stateArgs[] = {
@@ -3489,7 +4125,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_intset_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_intclear_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_intclear_stateArgs[] = {
@@ -3500,7 +4136,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_intclear_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_intenable_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_intenable_stateArgs[] = {
@@ -3510,7 +4146,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_intenable_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_intenable_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_intenable_stateArgs[] = {
@@ -3520,7 +4156,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_intenable_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_intenable_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_intenable_stateArgs[] = {
@@ -3530,8 +4166,8 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_intenable_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_break_args[] = {
- { { 34 /* imms */ }, 'i' },
- { { 33 /* immt */ }, 'i' }
+ { { OPERAND_imms }, 'i' },
+ { { OPERAND_immt }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_break_stateArgs[] = {
@@ -3540,7 +4176,7 @@ static xtensa_arg_internal Iclass_xt_iclass_break_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_break_n_args[] = {
- { { 34 /* imms */ }, 'i' }
+ { { OPERAND_imms }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_break_n_stateArgs[] = {
@@ -3549,7 +4185,7 @@ static xtensa_arg_internal Iclass_xt_iclass_break_n_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreaka0_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreaka0_stateArgs[] = {
@@ -3559,7 +4195,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreaka0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreaka0_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreaka0_stateArgs[] = {
@@ -3570,7 +4206,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreaka0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreaka0_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreaka0_stateArgs[] = {
@@ -3581,7 +4217,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreaka0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreakc0_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreakc0_stateArgs[] = {
@@ -3591,7 +4227,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreakc0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreakc0_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreakc0_stateArgs[] = {
@@ -3602,7 +4238,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreakc0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreakc0_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreakc0_stateArgs[] = {
@@ -3613,7 +4249,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreakc0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreaka1_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreaka1_stateArgs[] = {
@@ -3623,7 +4259,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreaka1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreaka1_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreaka1_stateArgs[] = {
@@ -3634,7 +4270,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreaka1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreaka1_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreaka1_stateArgs[] = {
@@ -3645,7 +4281,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreaka1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreakc1_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreakc1_stateArgs[] = {
@@ -3655,7 +4291,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_dbreakc1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreakc1_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreakc1_stateArgs[] = {
@@ -3666,7 +4302,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_dbreakc1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreakc1_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreakc1_stateArgs[] = {
@@ -3677,7 +4313,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_dbreakc1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreaka0_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreaka0_stateArgs[] = {
@@ -3687,7 +4323,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreaka0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreaka0_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreaka0_stateArgs[] = {
@@ -3697,7 +4333,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreaka0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreaka0_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreaka0_stateArgs[] = {
@@ -3707,7 +4343,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreaka0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreaka1_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreaka1_stateArgs[] = {
@@ -3717,7 +4353,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreaka1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreaka1_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreaka1_stateArgs[] = {
@@ -3727,7 +4363,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreaka1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreaka1_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreaka1_stateArgs[] = {
@@ -3737,7 +4373,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreaka1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreakenable_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreakenable_stateArgs[] = {
@@ -3747,7 +4383,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_ibreakenable_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreakenable_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreakenable_stateArgs[] = {
@@ -3757,7 +4393,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_ibreakenable_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreakenable_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreakenable_stateArgs[] = {
@@ -3767,7 +4403,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_ibreakenable_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_debugcause_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_debugcause_stateArgs[] = {
@@ -3778,7 +4414,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_debugcause_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_debugcause_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_debugcause_stateArgs[] = {
@@ -3789,7 +4425,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_debugcause_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_debugcause_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_debugcause_stateArgs[] = {
@@ -3800,7 +4436,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_debugcause_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_icount_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_icount_stateArgs[] = {
@@ -3810,7 +4446,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_icount_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_icount_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_icount_stateArgs[] = {
@@ -3821,7 +4457,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_icount_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_icount_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_icount_stateArgs[] = {
@@ -3832,7 +4468,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_icount_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_icountlevel_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_icountlevel_stateArgs[] = {
@@ -3842,7 +4478,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_icountlevel_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_icountlevel_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_icountlevel_stateArgs[] = {
@@ -3852,7 +4488,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_icountlevel_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_icountlevel_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_icountlevel_stateArgs[] = {
@@ -3862,7 +4498,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_icountlevel_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ddr_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ddr_stateArgs[] = {
@@ -3872,7 +4508,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_ddr_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ddr_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ddr_stateArgs[] = {
@@ -3883,7 +4519,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_ddr_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ddr_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ddr_stateArgs[] = {
@@ -3893,9 +4529,13 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_ddr_stateArgs[] = {
{ { STATE_DDR }, 'm' }
};
+static xtensa_arg_internal Iclass_xt_iclass_rfdo_args[] = {
+ { { OPERAND_imms }, 'i' }
+};
+
static xtensa_arg_internal Iclass_xt_iclass_rfdo_stateArgs[] = {
{ { STATE_InOCDMode }, 'm' },
- { { STATE_EPC4 }, 'i' },
+ { { STATE_EPC6 }, 'i' },
{ { STATE_PSWOE }, 'o' },
{ { STATE_PSCALLINC }, 'o' },
{ { STATE_PSOWB }, 'o' },
@@ -3903,15 +4543,25 @@ static xtensa_arg_internal Iclass_xt_iclass_rfdo_stateArgs[] = {
{ { STATE_PSUM }, 'o' },
{ { STATE_PSEXCM }, 'o' },
{ { STATE_PSINTLEVEL }, 'o' },
- { { STATE_EPS4 }, 'i' }
+ { { STATE_EPS6 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_rfdd_stateArgs[] = {
{ { STATE_InOCDMode }, 'm' }
};
+static xtensa_arg_internal Iclass_xt_iclass_wsr_mmid_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_mmid_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_XTSYNC }, 'o' }
+};
+
static xtensa_arg_internal Iclass_xt_iclass_rsr_ccount_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ccount_stateArgs[] = {
@@ -3921,7 +4571,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_ccount_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ccount_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ccount_stateArgs[] = {
@@ -3932,7 +4582,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_ccount_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ccount_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ccount_stateArgs[] = {
@@ -3943,7 +4593,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_ccount_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare0_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare0_stateArgs[] = {
@@ -3953,7 +4603,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare0_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare0_stateArgs[] = {
@@ -3964,7 +4614,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare0_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare0_stateArgs[] = {
@@ -3975,7 +4625,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare0_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare1_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare1_stateArgs[] = {
@@ -3985,7 +4635,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare1_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare1_stateArgs[] = {
@@ -3996,7 +4646,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare1_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare1_stateArgs[] = {
@@ -4007,7 +4657,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare1_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare2_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare2_stateArgs[] = {
@@ -4017,7 +4667,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_ccompare2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare2_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare2_stateArgs[] = {
@@ -4028,7 +4678,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_ccompare2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare2_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare2_stateArgs[] = {
@@ -4039,13 +4689,23 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_ccompare2_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_icache_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 21 /* uimm8x4 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x4 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_icache_lock_args[] = {
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm4x16 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_icache_lock_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_icache_inv_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 21 /* uimm8x4 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x4 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_icache_inv_stateArgs[] = {
@@ -4054,8 +4714,8 @@ static xtensa_arg_internal Iclass_xt_iclass_icache_inv_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_licx_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_licx_stateArgs[] = {
@@ -4064,8 +4724,8 @@ static xtensa_arg_internal Iclass_xt_iclass_licx_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_sicx_args[] = {
- { { 6 /* art */ }, 'i' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_sicx_stateArgs[] = {
@@ -4074,13 +4734,13 @@ static xtensa_arg_internal Iclass_xt_iclass_sicx_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_dcache_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 21 /* uimm8x4 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x4 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_dcache_ind_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 22 /* uimm4x16 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm4x16 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_dcache_ind_stateArgs[] = {
@@ -4089,8 +4749,8 @@ static xtensa_arg_internal Iclass_xt_iclass_dcache_ind_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_dcache_inv_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 21 /* uimm8x4 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x4 }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_dcache_inv_stateArgs[] = {
@@ -4099,13 +4759,23 @@ static xtensa_arg_internal Iclass_xt_iclass_dcache_inv_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_dpf_args[] = {
- { { 4 /* ars */ }, 'i' },
- { { 21 /* uimm8x4 */ }, 'i' }
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x4 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_dcache_lock_args[] = {
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm4x16 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_dcache_lock_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_sdct_args[] = {
- { { 6 /* art */ }, 'i' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_sdct_stateArgs[] = {
@@ -4114,8 +4784,8 @@ static xtensa_arg_internal Iclass_xt_iclass_sdct_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_ldct_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_ldct_stateArgs[] = {
@@ -4124,7 +4794,7 @@ static xtensa_arg_internal Iclass_xt_iclass_ldct_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ptevaddr_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_ptevaddr_stateArgs[] = {
@@ -4135,7 +4805,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_ptevaddr_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ptevaddr_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_ptevaddr_stateArgs[] = {
@@ -4146,7 +4816,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_ptevaddr_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ptevaddr_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_ptevaddr_stateArgs[] = {
@@ -4158,7 +4828,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_ptevaddr_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_rasid_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_rasid_stateArgs[] = {
@@ -4170,7 +4840,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_rasid_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_rasid_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_rasid_stateArgs[] = {
@@ -4183,7 +4853,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_rasid_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_rasid_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_rasid_stateArgs[] = {
@@ -4196,7 +4866,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_rasid_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_itlbcfg_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_itlbcfg_stateArgs[] = {
@@ -4206,7 +4876,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_itlbcfg_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_itlbcfg_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_itlbcfg_stateArgs[] = {
@@ -4217,7 +4887,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_itlbcfg_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_itlbcfg_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_itlbcfg_stateArgs[] = {
@@ -4228,7 +4898,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_itlbcfg_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_dtlbcfg_args[] = {
- { { 6 /* art */ }, 'o' }
+ { { OPERAND_art }, 'o' }
};
static xtensa_arg_internal Iclass_xt_iclass_rsr_dtlbcfg_stateArgs[] = {
@@ -4238,7 +4908,7 @@ static xtensa_arg_internal Iclass_xt_iclass_rsr_dtlbcfg_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_dtlbcfg_args[] = {
- { { 6 /* art */ }, 'i' }
+ { { OPERAND_art }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wsr_dtlbcfg_stateArgs[] = {
@@ -4249,7 +4919,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wsr_dtlbcfg_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_dtlbcfg_args[] = {
- { { 6 /* art */ }, 'm' }
+ { { OPERAND_art }, 'm' }
};
static xtensa_arg_internal Iclass_xt_iclass_xsr_dtlbcfg_stateArgs[] = {
@@ -4260,7 +4930,7 @@ static xtensa_arg_internal Iclass_xt_iclass_xsr_dtlbcfg_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_idtlb_args[] = {
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_idtlb_stateArgs[] = {
@@ -4270,8 +4940,8 @@ static xtensa_arg_internal Iclass_xt_iclass_idtlb_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_rdtlb_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_rdtlb_stateArgs[] = {
@@ -4280,8 +4950,8 @@ static xtensa_arg_internal Iclass_xt_iclass_rdtlb_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_wdtlb_args[] = {
- { { 6 /* art */ }, 'i' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_wdtlb_stateArgs[] = {
@@ -4291,7 +4961,7 @@ static xtensa_arg_internal Iclass_xt_iclass_wdtlb_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_iitlb_args[] = {
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_iitlb_stateArgs[] = {
@@ -4300,8 +4970,8 @@ static xtensa_arg_internal Iclass_xt_iclass_iitlb_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_ritlb_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_ritlb_stateArgs[] = {
@@ -4310,8 +4980,8 @@ static xtensa_arg_internal Iclass_xt_iclass_ritlb_stateArgs[] = {
};
static xtensa_arg_internal Iclass_xt_iclass_witlb_args[] = {
- { { 6 /* art */ }, 'i' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_ars }, 'i' }
};
static xtensa_arg_internal Iclass_xt_iclass_witlb_stateArgs[] = {
@@ -4332,9 +5002,116 @@ static xtensa_arg_internal Iclass_xt_iclass_hwwdtlba_stateArgs[] = {
{ { STATE_EXCVADDR }, 'i' }
};
+static xtensa_arg_internal Iclass_xt_iclass_rsr_cpenable_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_cpenable_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_CPENABLE }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_cpenable_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_cpenable_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_CPENABLE }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_cpenable_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_cpenable_stateArgs[] = {
+ { { STATE_PSEXCM }, 'i' },
+ { { STATE_PSRING }, 'i' },
+ { { STATE_CPENABLE }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_clamp_args[] = {
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_tp7 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_minmax_args[] = {
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_art }, 'i' }
+};
+
static xtensa_arg_internal Iclass_xt_iclass_nsa_args[] = {
- { { 6 /* art */ }, 'o' },
- { { 4 /* ars */ }, 'i' }
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_sx_args[] = {
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_tp7 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_l32ai_args[] = {
+ { { OPERAND_art }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x4 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_s32ri_args[] = {
+ { { OPERAND_art }, 'i' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x4 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_s32c1i_args[] = {
+ { { OPERAND_art }, 'm' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_uimm8x4 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_s32c1i_stateArgs[] = {
+ { { STATE_SCOMPARE1 }, 'i' },
+ { { STATE_SCOMPARE1 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_scompare1_args[] = {
+ { { OPERAND_art }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_rsr_scompare1_stateArgs[] = {
+ { { STATE_SCOMPARE1 }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_scompare1_args[] = {
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_wsr_scompare1_stateArgs[] = {
+ { { STATE_SCOMPARE1 }, 'o' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_scompare1_args[] = {
+ { { OPERAND_art }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_xsr_scompare1_stateArgs[] = {
+ { { STATE_SCOMPARE1 }, 'm' }
+};
+
+static xtensa_arg_internal Iclass_xt_iclass_div_args[] = {
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_art }, 'i' }
+};
+
+static xtensa_arg_internal Iclass_xt_mul32_args[] = {
+ { { OPERAND_arr }, 'o' },
+ { { OPERAND_ars }, 'i' },
+ { { OPERAND_art }, 'i' }
};
static xtensa_iclass_internal iclasses[] = {
@@ -4406,6 +5183,10 @@ static xtensa_iclass_internal iclasses[] = {
0, 0, 0, 0 },
{ 3, Iclass_xt_iclass_storei4_args,
0, 0, 0, 0 },
+ { 1, Iclass_rur_threadptr_args,
+ 1, Iclass_rur_threadptr_stateArgs, 0, 0 },
+ { 1, Iclass_wur_threadptr_args,
+ 1, Iclass_wur_threadptr_stateArgs, 0, 0 },
{ 3, Iclass_xt_iclass_addi_args,
0, 0, 0, 0 },
{ 3, Iclass_xt_iclass_addmi_args,
@@ -4524,6 +5305,8 @@ static xtensa_iclass_internal iclasses[] = {
2, Iclass_xt_iclass_xsr_litbase_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_rsr_176_args,
2, Iclass_xt_iclass_rsr_176_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_176_args,
+ 2, Iclass_xt_iclass_wsr_176_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_rsr_208_args,
2, Iclass_xt_iclass_rsr_208_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_rsr_ps_args,
@@ -4580,6 +5363,42 @@ static xtensa_iclass_internal iclasses[] = {
3, Iclass_xt_iclass_wsr_excsave4_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_xsr_excsave4_args,
3, Iclass_xt_iclass_xsr_excsave4_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_epc5_args,
+ 3, Iclass_xt_iclass_rsr_epc5_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_epc5_args,
+ 3, Iclass_xt_iclass_wsr_epc5_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_epc5_args,
+ 3, Iclass_xt_iclass_xsr_epc5_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_excsave5_args,
+ 3, Iclass_xt_iclass_rsr_excsave5_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_excsave5_args,
+ 3, Iclass_xt_iclass_wsr_excsave5_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_excsave5_args,
+ 3, Iclass_xt_iclass_xsr_excsave5_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_epc6_args,
+ 3, Iclass_xt_iclass_rsr_epc6_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_epc6_args,
+ 3, Iclass_xt_iclass_wsr_epc6_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_epc6_args,
+ 3, Iclass_xt_iclass_xsr_epc6_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_excsave6_args,
+ 3, Iclass_xt_iclass_rsr_excsave6_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_excsave6_args,
+ 3, Iclass_xt_iclass_wsr_excsave6_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_excsave6_args,
+ 3, Iclass_xt_iclass_xsr_excsave6_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_epc7_args,
+ 3, Iclass_xt_iclass_rsr_epc7_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_epc7_args,
+ 3, Iclass_xt_iclass_wsr_epc7_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_epc7_args,
+ 3, Iclass_xt_iclass_xsr_epc7_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_excsave7_args,
+ 3, Iclass_xt_iclass_rsr_excsave7_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_excsave7_args,
+ 3, Iclass_xt_iclass_wsr_excsave7_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_excsave7_args,
+ 3, Iclass_xt_iclass_xsr_excsave7_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_rsr_eps2_args,
3, Iclass_xt_iclass_rsr_eps2_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_wsr_eps2_args,
@@ -4598,6 +5417,24 @@ static xtensa_iclass_internal iclasses[] = {
3, Iclass_xt_iclass_wsr_eps4_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_xsr_eps4_args,
3, Iclass_xt_iclass_xsr_eps4_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_eps5_args,
+ 3, Iclass_xt_iclass_rsr_eps5_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_eps5_args,
+ 3, Iclass_xt_iclass_wsr_eps5_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_eps5_args,
+ 3, Iclass_xt_iclass_xsr_eps5_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_eps6_args,
+ 3, Iclass_xt_iclass_rsr_eps6_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_eps6_args,
+ 3, Iclass_xt_iclass_wsr_eps6_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_eps6_args,
+ 3, Iclass_xt_iclass_xsr_eps6_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_eps7_args,
+ 3, Iclass_xt_iclass_rsr_eps7_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_eps7_args,
+ 3, Iclass_xt_iclass_wsr_eps7_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_eps7_args,
+ 3, Iclass_xt_iclass_xsr_eps7_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_rsr_excvaddr_args,
3, Iclass_xt_iclass_rsr_excvaddr_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_wsr_excvaddr_args,
@@ -4630,8 +5467,16 @@ static xtensa_iclass_internal iclasses[] = {
3, Iclass_xt_iclass_xsr_misc1_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_rsr_prid_args,
2, Iclass_xt_iclass_rsr_prid_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_vecbase_args,
+ 3, Iclass_xt_iclass_rsr_vecbase_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_vecbase_args,
+ 3, Iclass_xt_iclass_wsr_vecbase_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_vecbase_args,
+ 3, Iclass_xt_iclass_xsr_vecbase_stateArgs, 0, 0 },
+ { 3, Iclass_xt_iclass_mul16_args,
+ 0, 0, 0, 0 },
{ 1, Iclass_xt_iclass_rfi_args,
- 15, Iclass_xt_iclass_rfi_stateArgs, 0, 0 },
+ 21, Iclass_xt_iclass_rfi_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_wait_args,
3, Iclass_xt_iclass_wait_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_rsr_interrupt_args,
@@ -4716,10 +5561,12 @@ static xtensa_iclass_internal iclasses[] = {
4, Iclass_xt_iclass_wsr_ddr_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_xsr_ddr_args,
4, Iclass_xt_iclass_xsr_ddr_stateArgs, 0, 0 },
- { 0, 0 /* xt_iclass_rfdo */,
+ { 1, Iclass_xt_iclass_rfdo_args,
10, Iclass_xt_iclass_rfdo_stateArgs, 0, 0 },
{ 0, 0 /* xt_iclass_rfdd */,
1, Iclass_xt_iclass_rfdd_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_mmid_args,
+ 3, Iclass_xt_iclass_wsr_mmid_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_rsr_ccount_args,
3, Iclass_xt_iclass_rsr_ccount_stateArgs, 0, 0 },
{ 1, Iclass_xt_iclass_wsr_ccount_args,
@@ -4746,6 +5593,8 @@ static xtensa_iclass_internal iclasses[] = {
4, Iclass_xt_iclass_xsr_ccompare2_stateArgs, 0, 0 },
{ 2, Iclass_xt_iclass_icache_args,
0, 0, 0, 0 },
+ { 2, Iclass_xt_iclass_icache_lock_args,
+ 2, Iclass_xt_iclass_icache_lock_stateArgs, 0, 0 },
{ 2, Iclass_xt_iclass_icache_inv_args,
2, Iclass_xt_iclass_icache_inv_stateArgs, 0, 0 },
{ 2, Iclass_xt_iclass_licx_args,
@@ -4760,6 +5609,8 @@ static xtensa_iclass_internal iclasses[] = {
2, Iclass_xt_iclass_dcache_inv_stateArgs, 0, 0 },
{ 2, Iclass_xt_iclass_dpf_args,
0, 0, 0, 0 },
+ { 2, Iclass_xt_iclass_dcache_lock_args,
+ 2, Iclass_xt_iclass_dcache_lock_stateArgs, 0, 0 },
{ 2, Iclass_xt_iclass_sdct_args,
2, Iclass_xt_iclass_sdct_stateArgs, 0, 0 },
{ 2, Iclass_xt_iclass_ldct_args,
@@ -4806,10 +5657,327 @@ static xtensa_iclass_internal iclasses[] = {
1, Iclass_xt_iclass_hwwitlba_stateArgs, 0, 0 },
{ 0, 0 /* xt_iclass_hwwdtlba */,
1, Iclass_xt_iclass_hwwdtlba_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_cpenable_args,
+ 3, Iclass_xt_iclass_rsr_cpenable_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_cpenable_args,
+ 3, Iclass_xt_iclass_wsr_cpenable_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_cpenable_args,
+ 3, Iclass_xt_iclass_xsr_cpenable_stateArgs, 0, 0 },
+ { 3, Iclass_xt_iclass_clamp_args,
+ 0, 0, 0, 0 },
+ { 3, Iclass_xt_iclass_minmax_args,
+ 0, 0, 0, 0 },
{ 2, Iclass_xt_iclass_nsa_args,
+ 0, 0, 0, 0 },
+ { 3, Iclass_xt_iclass_sx_args,
+ 0, 0, 0, 0 },
+ { 3, Iclass_xt_iclass_l32ai_args,
+ 0, 0, 0, 0 },
+ { 3, Iclass_xt_iclass_s32ri_args,
+ 0, 0, 0, 0 },
+ { 3, Iclass_xt_iclass_s32c1i_args,
+ 2, Iclass_xt_iclass_s32c1i_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_rsr_scompare1_args,
+ 1, Iclass_xt_iclass_rsr_scompare1_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_wsr_scompare1_args,
+ 1, Iclass_xt_iclass_wsr_scompare1_stateArgs, 0, 0 },
+ { 1, Iclass_xt_iclass_xsr_scompare1_args,
+ 1, Iclass_xt_iclass_xsr_scompare1_stateArgs, 0, 0 },
+ { 3, Iclass_xt_iclass_div_args,
+ 0, 0, 0, 0 },
+ { 3, Iclass_xt_mul32_args,
0, 0, 0, 0 }
};
+enum xtensa_iclass_id {
+ ICLASS_xt_iclass_excw,
+ ICLASS_xt_iclass_rfe,
+ ICLASS_xt_iclass_rfde,
+ ICLASS_xt_iclass_syscall,
+ ICLASS_xt_iclass_simcall,
+ ICLASS_xt_iclass_call12,
+ ICLASS_xt_iclass_call8,
+ ICLASS_xt_iclass_call4,
+ ICLASS_xt_iclass_callx12,
+ ICLASS_xt_iclass_callx8,
+ ICLASS_xt_iclass_callx4,
+ ICLASS_xt_iclass_entry,
+ ICLASS_xt_iclass_movsp,
+ ICLASS_xt_iclass_rotw,
+ ICLASS_xt_iclass_retw,
+ ICLASS_xt_iclass_rfwou,
+ ICLASS_xt_iclass_l32e,
+ ICLASS_xt_iclass_s32e,
+ ICLASS_xt_iclass_rsr_windowbase,
+ ICLASS_xt_iclass_wsr_windowbase,
+ ICLASS_xt_iclass_xsr_windowbase,
+ ICLASS_xt_iclass_rsr_windowstart,
+ ICLASS_xt_iclass_wsr_windowstart,
+ ICLASS_xt_iclass_xsr_windowstart,
+ ICLASS_xt_iclass_add_n,
+ ICLASS_xt_iclass_addi_n,
+ ICLASS_xt_iclass_bz6,
+ ICLASS_xt_iclass_ill_n,
+ ICLASS_xt_iclass_loadi4,
+ ICLASS_xt_iclass_mov_n,
+ ICLASS_xt_iclass_movi_n,
+ ICLASS_xt_iclass_nopn,
+ ICLASS_xt_iclass_retn,
+ ICLASS_xt_iclass_storei4,
+ ICLASS_rur_threadptr,
+ ICLASS_wur_threadptr,
+ ICLASS_xt_iclass_addi,
+ ICLASS_xt_iclass_addmi,
+ ICLASS_xt_iclass_addsub,
+ ICLASS_xt_iclass_bit,
+ ICLASS_xt_iclass_bsi8,
+ ICLASS_xt_iclass_bsi8b,
+ ICLASS_xt_iclass_bsi8u,
+ ICLASS_xt_iclass_bst8,
+ ICLASS_xt_iclass_bsz12,
+ ICLASS_xt_iclass_call0,
+ ICLASS_xt_iclass_callx0,
+ ICLASS_xt_iclass_exti,
+ ICLASS_xt_iclass_ill,
+ ICLASS_xt_iclass_jump,
+ ICLASS_xt_iclass_jumpx,
+ ICLASS_xt_iclass_l16ui,
+ ICLASS_xt_iclass_l16si,
+ ICLASS_xt_iclass_l32i,
+ ICLASS_xt_iclass_l32r,
+ ICLASS_xt_iclass_l8i,
+ ICLASS_xt_iclass_loop,
+ ICLASS_xt_iclass_loopz,
+ ICLASS_xt_iclass_movi,
+ ICLASS_xt_iclass_movz,
+ ICLASS_xt_iclass_neg,
+ ICLASS_xt_iclass_nop,
+ ICLASS_xt_iclass_return,
+ ICLASS_xt_iclass_s16i,
+ ICLASS_xt_iclass_s32i,
+ ICLASS_xt_iclass_s8i,
+ ICLASS_xt_iclass_sar,
+ ICLASS_xt_iclass_sari,
+ ICLASS_xt_iclass_shifts,
+ ICLASS_xt_iclass_shiftst,
+ ICLASS_xt_iclass_shiftt,
+ ICLASS_xt_iclass_slli,
+ ICLASS_xt_iclass_srai,
+ ICLASS_xt_iclass_srli,
+ ICLASS_xt_iclass_memw,
+ ICLASS_xt_iclass_extw,
+ ICLASS_xt_iclass_isync,
+ ICLASS_xt_iclass_sync,
+ ICLASS_xt_iclass_rsil,
+ ICLASS_xt_iclass_rsr_lend,
+ ICLASS_xt_iclass_wsr_lend,
+ ICLASS_xt_iclass_xsr_lend,
+ ICLASS_xt_iclass_rsr_lcount,
+ ICLASS_xt_iclass_wsr_lcount,
+ ICLASS_xt_iclass_xsr_lcount,
+ ICLASS_xt_iclass_rsr_lbeg,
+ ICLASS_xt_iclass_wsr_lbeg,
+ ICLASS_xt_iclass_xsr_lbeg,
+ ICLASS_xt_iclass_rsr_sar,
+ ICLASS_xt_iclass_wsr_sar,
+ ICLASS_xt_iclass_xsr_sar,
+ ICLASS_xt_iclass_rsr_litbase,
+ ICLASS_xt_iclass_wsr_litbase,
+ ICLASS_xt_iclass_xsr_litbase,
+ ICLASS_xt_iclass_rsr_176,
+ ICLASS_xt_iclass_wsr_176,
+ ICLASS_xt_iclass_rsr_208,
+ ICLASS_xt_iclass_rsr_ps,
+ ICLASS_xt_iclass_wsr_ps,
+ ICLASS_xt_iclass_xsr_ps,
+ ICLASS_xt_iclass_rsr_epc1,
+ ICLASS_xt_iclass_wsr_epc1,
+ ICLASS_xt_iclass_xsr_epc1,
+ ICLASS_xt_iclass_rsr_excsave1,
+ ICLASS_xt_iclass_wsr_excsave1,
+ ICLASS_xt_iclass_xsr_excsave1,
+ ICLASS_xt_iclass_rsr_epc2,
+ ICLASS_xt_iclass_wsr_epc2,
+ ICLASS_xt_iclass_xsr_epc2,
+ ICLASS_xt_iclass_rsr_excsave2,
+ ICLASS_xt_iclass_wsr_excsave2,
+ ICLASS_xt_iclass_xsr_excsave2,
+ ICLASS_xt_iclass_rsr_epc3,
+ ICLASS_xt_iclass_wsr_epc3,
+ ICLASS_xt_iclass_xsr_epc3,
+ ICLASS_xt_iclass_rsr_excsave3,
+ ICLASS_xt_iclass_wsr_excsave3,
+ ICLASS_xt_iclass_xsr_excsave3,
+ ICLASS_xt_iclass_rsr_epc4,
+ ICLASS_xt_iclass_wsr_epc4,
+ ICLASS_xt_iclass_xsr_epc4,
+ ICLASS_xt_iclass_rsr_excsave4,
+ ICLASS_xt_iclass_wsr_excsave4,
+ ICLASS_xt_iclass_xsr_excsave4,
+ ICLASS_xt_iclass_rsr_epc5,
+ ICLASS_xt_iclass_wsr_epc5,
+ ICLASS_xt_iclass_xsr_epc5,
+ ICLASS_xt_iclass_rsr_excsave5,
+ ICLASS_xt_iclass_wsr_excsave5,
+ ICLASS_xt_iclass_xsr_excsave5,
+ ICLASS_xt_iclass_rsr_epc6,
+ ICLASS_xt_iclass_wsr_epc6,
+ ICLASS_xt_iclass_xsr_epc6,
+ ICLASS_xt_iclass_rsr_excsave6,
+ ICLASS_xt_iclass_wsr_excsave6,
+ ICLASS_xt_iclass_xsr_excsave6,
+ ICLASS_xt_iclass_rsr_epc7,
+ ICLASS_xt_iclass_wsr_epc7,
+ ICLASS_xt_iclass_xsr_epc7,
+ ICLASS_xt_iclass_rsr_excsave7,
+ ICLASS_xt_iclass_wsr_excsave7,
+ ICLASS_xt_iclass_xsr_excsave7,
+ ICLASS_xt_iclass_rsr_eps2,
+ ICLASS_xt_iclass_wsr_eps2,
+ ICLASS_xt_iclass_xsr_eps2,
+ ICLASS_xt_iclass_rsr_eps3,
+ ICLASS_xt_iclass_wsr_eps3,
+ ICLASS_xt_iclass_xsr_eps3,
+ ICLASS_xt_iclass_rsr_eps4,
+ ICLASS_xt_iclass_wsr_eps4,
+ ICLASS_xt_iclass_xsr_eps4,
+ ICLASS_xt_iclass_rsr_eps5,
+ ICLASS_xt_iclass_wsr_eps5,
+ ICLASS_xt_iclass_xsr_eps5,
+ ICLASS_xt_iclass_rsr_eps6,
+ ICLASS_xt_iclass_wsr_eps6,
+ ICLASS_xt_iclass_xsr_eps6,
+ ICLASS_xt_iclass_rsr_eps7,
+ ICLASS_xt_iclass_wsr_eps7,
+ ICLASS_xt_iclass_xsr_eps7,
+ ICLASS_xt_iclass_rsr_excvaddr,
+ ICLASS_xt_iclass_wsr_excvaddr,
+ ICLASS_xt_iclass_xsr_excvaddr,
+ ICLASS_xt_iclass_rsr_depc,
+ ICLASS_xt_iclass_wsr_depc,
+ ICLASS_xt_iclass_xsr_depc,
+ ICLASS_xt_iclass_rsr_exccause,
+ ICLASS_xt_iclass_wsr_exccause,
+ ICLASS_xt_iclass_xsr_exccause,
+ ICLASS_xt_iclass_rsr_misc0,
+ ICLASS_xt_iclass_wsr_misc0,
+ ICLASS_xt_iclass_xsr_misc0,
+ ICLASS_xt_iclass_rsr_misc1,
+ ICLASS_xt_iclass_wsr_misc1,
+ ICLASS_xt_iclass_xsr_misc1,
+ ICLASS_xt_iclass_rsr_prid,
+ ICLASS_xt_iclass_rsr_vecbase,
+ ICLASS_xt_iclass_wsr_vecbase,
+ ICLASS_xt_iclass_xsr_vecbase,
+ ICLASS_xt_iclass_mul16,
+ ICLASS_xt_iclass_rfi,
+ ICLASS_xt_iclass_wait,
+ ICLASS_xt_iclass_rsr_interrupt,
+ ICLASS_xt_iclass_wsr_intset,
+ ICLASS_xt_iclass_wsr_intclear,
+ ICLASS_xt_iclass_rsr_intenable,
+ ICLASS_xt_iclass_wsr_intenable,
+ ICLASS_xt_iclass_xsr_intenable,
+ ICLASS_xt_iclass_break,
+ ICLASS_xt_iclass_break_n,
+ ICLASS_xt_iclass_rsr_dbreaka0,
+ ICLASS_xt_iclass_wsr_dbreaka0,
+ ICLASS_xt_iclass_xsr_dbreaka0,
+ ICLASS_xt_iclass_rsr_dbreakc0,
+ ICLASS_xt_iclass_wsr_dbreakc0,
+ ICLASS_xt_iclass_xsr_dbreakc0,
+ ICLASS_xt_iclass_rsr_dbreaka1,
+ ICLASS_xt_iclass_wsr_dbreaka1,
+ ICLASS_xt_iclass_xsr_dbreaka1,
+ ICLASS_xt_iclass_rsr_dbreakc1,
+ ICLASS_xt_iclass_wsr_dbreakc1,
+ ICLASS_xt_iclass_xsr_dbreakc1,
+ ICLASS_xt_iclass_rsr_ibreaka0,
+ ICLASS_xt_iclass_wsr_ibreaka0,
+ ICLASS_xt_iclass_xsr_ibreaka0,
+ ICLASS_xt_iclass_rsr_ibreaka1,
+ ICLASS_xt_iclass_wsr_ibreaka1,
+ ICLASS_xt_iclass_xsr_ibreaka1,
+ ICLASS_xt_iclass_rsr_ibreakenable,
+ ICLASS_xt_iclass_wsr_ibreakenable,
+ ICLASS_xt_iclass_xsr_ibreakenable,
+ ICLASS_xt_iclass_rsr_debugcause,
+ ICLASS_xt_iclass_wsr_debugcause,
+ ICLASS_xt_iclass_xsr_debugcause,
+ ICLASS_xt_iclass_rsr_icount,
+ ICLASS_xt_iclass_wsr_icount,
+ ICLASS_xt_iclass_xsr_icount,
+ ICLASS_xt_iclass_rsr_icountlevel,
+ ICLASS_xt_iclass_wsr_icountlevel,
+ ICLASS_xt_iclass_xsr_icountlevel,
+ ICLASS_xt_iclass_rsr_ddr,
+ ICLASS_xt_iclass_wsr_ddr,
+ ICLASS_xt_iclass_xsr_ddr,
+ ICLASS_xt_iclass_rfdo,
+ ICLASS_xt_iclass_rfdd,
+ ICLASS_xt_iclass_wsr_mmid,
+ ICLASS_xt_iclass_rsr_ccount,
+ ICLASS_xt_iclass_wsr_ccount,
+ ICLASS_xt_iclass_xsr_ccount,
+ ICLASS_xt_iclass_rsr_ccompare0,
+ ICLASS_xt_iclass_wsr_ccompare0,
+ ICLASS_xt_iclass_xsr_ccompare0,
+ ICLASS_xt_iclass_rsr_ccompare1,
+ ICLASS_xt_iclass_wsr_ccompare1,
+ ICLASS_xt_iclass_xsr_ccompare1,
+ ICLASS_xt_iclass_rsr_ccompare2,
+ ICLASS_xt_iclass_wsr_ccompare2,
+ ICLASS_xt_iclass_xsr_ccompare2,
+ ICLASS_xt_iclass_icache,
+ ICLASS_xt_iclass_icache_lock,
+ ICLASS_xt_iclass_icache_inv,
+ ICLASS_xt_iclass_licx,
+ ICLASS_xt_iclass_sicx,
+ ICLASS_xt_iclass_dcache,
+ ICLASS_xt_iclass_dcache_ind,
+ ICLASS_xt_iclass_dcache_inv,
+ ICLASS_xt_iclass_dpf,
+ ICLASS_xt_iclass_dcache_lock,
+ ICLASS_xt_iclass_sdct,
+ ICLASS_xt_iclass_ldct,
+ ICLASS_xt_iclass_wsr_ptevaddr,
+ ICLASS_xt_iclass_rsr_ptevaddr,
+ ICLASS_xt_iclass_xsr_ptevaddr,
+ ICLASS_xt_iclass_rsr_rasid,
+ ICLASS_xt_iclass_wsr_rasid,
+ ICLASS_xt_iclass_xsr_rasid,
+ ICLASS_xt_iclass_rsr_itlbcfg,
+ ICLASS_xt_iclass_wsr_itlbcfg,
+ ICLASS_xt_iclass_xsr_itlbcfg,
+ ICLASS_xt_iclass_rsr_dtlbcfg,
+ ICLASS_xt_iclass_wsr_dtlbcfg,
+ ICLASS_xt_iclass_xsr_dtlbcfg,
+ ICLASS_xt_iclass_idtlb,
+ ICLASS_xt_iclass_rdtlb,
+ ICLASS_xt_iclass_wdtlb,
+ ICLASS_xt_iclass_iitlb,
+ ICLASS_xt_iclass_ritlb,
+ ICLASS_xt_iclass_witlb,
+ ICLASS_xt_iclass_ldpte,
+ ICLASS_xt_iclass_hwwitlba,
+ ICLASS_xt_iclass_hwwdtlba,
+ ICLASS_xt_iclass_rsr_cpenable,
+ ICLASS_xt_iclass_wsr_cpenable,
+ ICLASS_xt_iclass_xsr_cpenable,
+ ICLASS_xt_iclass_clamp,
+ ICLASS_xt_iclass_minmax,
+ ICLASS_xt_iclass_nsa,
+ ICLASS_xt_iclass_sx,
+ ICLASS_xt_iclass_l32ai,
+ ICLASS_xt_iclass_s32ri,
+ ICLASS_xt_iclass_s32c1i,
+ ICLASS_xt_iclass_rsr_scompare1,
+ ICLASS_xt_iclass_wsr_scompare1,
+ ICLASS_xt_iclass_xsr_scompare1,
+ ICLASS_xt_iclass_div,
+ ICLASS_xt_mul32
+};
+
/* Opcode encodings. */
@@ -5036,6 +6204,18 @@ Opcode_s32i_n_Slot_inst16a_encode (xtensa_insnbuf slotbuf)
}
static void
+Opcode_rur_threadptr_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x7e03e;
+}
+
+static void
+Opcode_wur_threadptr_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xe73f;
+}
+
+static void
Opcode_addi_Slot_inst_encode (xtensa_insnbuf slotbuf)
{
slotbuf[0] = 0x200c00;
@@ -5624,6 +6804,12 @@ Opcode_rsr_176_Slot_inst_encode (xtensa_insnbuf slotbuf)
}
static void
+Opcode_wsr_176_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xb031;
+}
+
+static void
Opcode_rsr_208_Slot_inst_encode (xtensa_insnbuf slotbuf)
{
slotbuf[0] = 0xd030;
@@ -5792,6 +6978,114 @@ Opcode_xsr_excsave4_Slot_inst_encode (xtensa_insnbuf slotbuf)
}
static void
+Opcode_rsr_epc5_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xb530;
+}
+
+static void
+Opcode_wsr_epc5_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xb531;
+}
+
+static void
+Opcode_xsr_epc5_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xb516;
+}
+
+static void
+Opcode_rsr_excsave5_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xd530;
+}
+
+static void
+Opcode_wsr_excsave5_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xd531;
+}
+
+static void
+Opcode_xsr_excsave5_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xd516;
+}
+
+static void
+Opcode_rsr_epc6_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xb630;
+}
+
+static void
+Opcode_wsr_epc6_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xb631;
+}
+
+static void
+Opcode_xsr_epc6_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xb616;
+}
+
+static void
+Opcode_rsr_excsave6_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xd630;
+}
+
+static void
+Opcode_wsr_excsave6_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xd631;
+}
+
+static void
+Opcode_xsr_excsave6_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xd616;
+}
+
+static void
+Opcode_rsr_epc7_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xb730;
+}
+
+static void
+Opcode_wsr_epc7_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xb731;
+}
+
+static void
+Opcode_xsr_epc7_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xb716;
+}
+
+static void
+Opcode_rsr_excsave7_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xd730;
+}
+
+static void
+Opcode_wsr_excsave7_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xd731;
+}
+
+static void
+Opcode_xsr_excsave7_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xd716;
+}
+
+static void
Opcode_rsr_eps2_Slot_inst_encode (xtensa_insnbuf slotbuf)
{
slotbuf[0] = 0xc230;
@@ -5846,6 +7140,60 @@ Opcode_xsr_eps4_Slot_inst_encode (xtensa_insnbuf slotbuf)
}
static void
+Opcode_rsr_eps5_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc530;
+}
+
+static void
+Opcode_wsr_eps5_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc531;
+}
+
+static void
+Opcode_xsr_eps5_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc516;
+}
+
+static void
+Opcode_rsr_eps6_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc630;
+}
+
+static void
+Opcode_wsr_eps6_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc631;
+}
+
+static void
+Opcode_xsr_eps6_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc616;
+}
+
+static void
+Opcode_rsr_eps7_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc730;
+}
+
+static void
+Opcode_wsr_eps7_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc731;
+}
+
+static void
+Opcode_xsr_eps7_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc716;
+}
+
+static void
Opcode_rsr_excvaddr_Slot_inst_encode (xtensa_insnbuf slotbuf)
{
slotbuf[0] = 0xee30;
@@ -5942,6 +7290,36 @@ Opcode_rsr_prid_Slot_inst_encode (xtensa_insnbuf slotbuf)
}
static void
+Opcode_rsr_vecbase_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xe730;
+}
+
+static void
+Opcode_wsr_vecbase_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xe731;
+}
+
+static void
+Opcode_xsr_vecbase_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xe716;
+}
+
+static void
+Opcode_mul16u_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x1c;
+}
+
+static void
+Opcode_mul16s_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x1d;
+}
+
+static void
Opcode_rfi_Slot_inst_encode (xtensa_insnbuf slotbuf)
{
slotbuf[0] = 0x10300;
@@ -6212,6 +7590,12 @@ Opcode_rfdd_Slot_inst_encode (xtensa_insnbuf slotbuf)
}
static void
+Opcode_wsr_mmid_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x5931;
+}
+
+static void
Opcode_rsr_ccount_Slot_inst_encode (xtensa_insnbuf slotbuf)
{
slotbuf[0] = 0xea30;
@@ -6296,6 +7680,24 @@ Opcode_ihi_Slot_inst_encode (xtensa_insnbuf slotbuf)
}
static void
+Opcode_ipfl_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x2d0700;
+}
+
+static void
+Opcode_ihu_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x2d0720;
+}
+
+static void
+Opcode_iiu_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x2d0730;
+}
+
+static void
Opcode_iii_Slot_inst_encode (xtensa_insnbuf slotbuf)
{
slotbuf[0] = 0x2f0700;
@@ -6386,6 +7788,24 @@ Opcode_dpfwo_Slot_inst_encode (xtensa_insnbuf slotbuf)
}
static void
+Opcode_dpfl_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x280700;
+}
+
+static void
+Opcode_dhu_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x280720;
+}
+
+static void
+Opcode_diu_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x280730;
+}
+
+static void
Opcode_sdct_Slot_inst_encode (xtensa_insnbuf slotbuf)
{
slotbuf[0] = 0x91f;
@@ -6548,6 +7968,54 @@ Opcode_hwwdtlba_Slot_inst_encode (xtensa_insnbuf slotbuf)
}
static void
+Opcode_rsr_cpenable_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xe030;
+}
+
+static void
+Opcode_wsr_cpenable_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xe031;
+}
+
+static void
+Opcode_xsr_cpenable_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xe016;
+}
+
+static void
+Opcode_clamps_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x33;
+}
+
+static void
+Opcode_min_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x34;
+}
+
+static void
+Opcode_max_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x35;
+}
+
+static void
+Opcode_minu_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x36;
+}
+
+static void
+Opcode_maxu_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x37;
+}
+
+static void
Opcode_nsa_Slot_inst_encode (xtensa_insnbuf slotbuf)
{
slotbuf[0] = 0xe04;
@@ -6559,6 +8027,78 @@ Opcode_nsau_Slot_inst_encode (xtensa_insnbuf slotbuf)
slotbuf[0] = 0xf04;
}
+static void
+Opcode_sext_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x32;
+}
+
+static void
+Opcode_l32ai_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x200b00;
+}
+
+static void
+Opcode_s32ri_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x200f00;
+}
+
+static void
+Opcode_s32c1i_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x200e00;
+}
+
+static void
+Opcode_rsr_scompare1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc30;
+}
+
+static void
+Opcode_wsr_scompare1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc31;
+}
+
+static void
+Opcode_xsr_scompare1_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0xc16;
+}
+
+static void
+Opcode_quou_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x2c;
+}
+
+static void
+Opcode_quos_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x2d;
+}
+
+static void
+Opcode_remu_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x2e;
+}
+
+static void
+Opcode_rems_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x2f;
+}
+
+static void
+Opcode_mull_Slot_inst_encode (xtensa_insnbuf slotbuf)
+{
+ slotbuf[0] = 0x28;
+}
+
xtensa_opcode_encode_fn Opcode_excw_encode_fns[] = {
Opcode_excw_Slot_inst_encode, 0, 0
};
@@ -6707,6 +8247,14 @@ xtensa_opcode_encode_fn Opcode_s32i_n_encode_fns[] = {
0, Opcode_s32i_n_Slot_inst16a_encode, 0
};
+xtensa_opcode_encode_fn Opcode_rur_threadptr_encode_fns[] = {
+ Opcode_rur_threadptr_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wur_threadptr_encode_fns[] = {
+ Opcode_wur_threadptr_Slot_inst_encode, 0, 0
+};
+
xtensa_opcode_encode_fn Opcode_addi_encode_fns[] = {
Opcode_addi_Slot_inst_encode, 0, 0
};
@@ -7099,6 +8647,10 @@ xtensa_opcode_encode_fn Opcode_rsr_176_encode_fns[] = {
Opcode_rsr_176_Slot_inst_encode, 0, 0
};
+xtensa_opcode_encode_fn Opcode_wsr_176_encode_fns[] = {
+ Opcode_wsr_176_Slot_inst_encode, 0, 0
+};
+
xtensa_opcode_encode_fn Opcode_rsr_208_encode_fns[] = {
Opcode_rsr_208_Slot_inst_encode, 0, 0
};
@@ -7211,6 +8763,78 @@ xtensa_opcode_encode_fn Opcode_xsr_excsave4_encode_fns[] = {
Opcode_xsr_excsave4_Slot_inst_encode, 0, 0
};
+xtensa_opcode_encode_fn Opcode_rsr_epc5_encode_fns[] = {
+ Opcode_rsr_epc5_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_epc5_encode_fns[] = {
+ Opcode_wsr_epc5_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_epc5_encode_fns[] = {
+ Opcode_xsr_epc5_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_rsr_excsave5_encode_fns[] = {
+ Opcode_rsr_excsave5_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_excsave5_encode_fns[] = {
+ Opcode_wsr_excsave5_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_excsave5_encode_fns[] = {
+ Opcode_xsr_excsave5_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_rsr_epc6_encode_fns[] = {
+ Opcode_rsr_epc6_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_epc6_encode_fns[] = {
+ Opcode_wsr_epc6_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_epc6_encode_fns[] = {
+ Opcode_xsr_epc6_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_rsr_excsave6_encode_fns[] = {
+ Opcode_rsr_excsave6_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_excsave6_encode_fns[] = {
+ Opcode_wsr_excsave6_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_excsave6_encode_fns[] = {
+ Opcode_xsr_excsave6_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_rsr_epc7_encode_fns[] = {
+ Opcode_rsr_epc7_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_epc7_encode_fns[] = {
+ Opcode_wsr_epc7_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_epc7_encode_fns[] = {
+ Opcode_xsr_epc7_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_rsr_excsave7_encode_fns[] = {
+ Opcode_rsr_excsave7_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_excsave7_encode_fns[] = {
+ Opcode_wsr_excsave7_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_excsave7_encode_fns[] = {
+ Opcode_xsr_excsave7_Slot_inst_encode, 0, 0
+};
+
xtensa_opcode_encode_fn Opcode_rsr_eps2_encode_fns[] = {
Opcode_rsr_eps2_Slot_inst_encode, 0, 0
};
@@ -7247,6 +8871,42 @@ xtensa_opcode_encode_fn Opcode_xsr_eps4_encode_fns[] = {
Opcode_xsr_eps4_Slot_inst_encode, 0, 0
};
+xtensa_opcode_encode_fn Opcode_rsr_eps5_encode_fns[] = {
+ Opcode_rsr_eps5_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_eps5_encode_fns[] = {
+ Opcode_wsr_eps5_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_eps5_encode_fns[] = {
+ Opcode_xsr_eps5_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_rsr_eps6_encode_fns[] = {
+ Opcode_rsr_eps6_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_eps6_encode_fns[] = {
+ Opcode_wsr_eps6_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_eps6_encode_fns[] = {
+ Opcode_xsr_eps6_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_rsr_eps7_encode_fns[] = {
+ Opcode_rsr_eps7_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_eps7_encode_fns[] = {
+ Opcode_wsr_eps7_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_eps7_encode_fns[] = {
+ Opcode_xsr_eps7_Slot_inst_encode, 0, 0
+};
+
xtensa_opcode_encode_fn Opcode_rsr_excvaddr_encode_fns[] = {
Opcode_rsr_excvaddr_Slot_inst_encode, 0, 0
};
@@ -7311,6 +8971,26 @@ xtensa_opcode_encode_fn Opcode_rsr_prid_encode_fns[] = {
Opcode_rsr_prid_Slot_inst_encode, 0, 0
};
+xtensa_opcode_encode_fn Opcode_rsr_vecbase_encode_fns[] = {
+ Opcode_rsr_vecbase_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_vecbase_encode_fns[] = {
+ Opcode_wsr_vecbase_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_vecbase_encode_fns[] = {
+ Opcode_xsr_vecbase_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_mul16u_encode_fns[] = {
+ Opcode_mul16u_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_mul16s_encode_fns[] = {
+ Opcode_mul16s_Slot_inst_encode, 0, 0
+};
+
xtensa_opcode_encode_fn Opcode_rfi_encode_fns[] = {
Opcode_rfi_Slot_inst_encode, 0, 0
};
@@ -7491,6 +9171,10 @@ xtensa_opcode_encode_fn Opcode_rfdd_encode_fns[] = {
Opcode_rfdd_Slot_inst_encode, 0, 0
};
+xtensa_opcode_encode_fn Opcode_wsr_mmid_encode_fns[] = {
+ Opcode_wsr_mmid_Slot_inst_encode, 0, 0
+};
+
xtensa_opcode_encode_fn Opcode_rsr_ccount_encode_fns[] = {
Opcode_rsr_ccount_Slot_inst_encode, 0, 0
};
@@ -7547,6 +9231,18 @@ xtensa_opcode_encode_fn Opcode_ihi_encode_fns[] = {
Opcode_ihi_Slot_inst_encode, 0, 0
};
+xtensa_opcode_encode_fn Opcode_ipfl_encode_fns[] = {
+ Opcode_ipfl_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_ihu_encode_fns[] = {
+ Opcode_ihu_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_iiu_encode_fns[] = {
+ Opcode_iiu_Slot_inst_encode, 0, 0
+};
+
xtensa_opcode_encode_fn Opcode_iii_encode_fns[] = {
Opcode_iii_Slot_inst_encode, 0, 0
};
@@ -7607,6 +9303,18 @@ xtensa_opcode_encode_fn Opcode_dpfwo_encode_fns[] = {
Opcode_dpfwo_Slot_inst_encode, 0, 0
};
+xtensa_opcode_encode_fn Opcode_dpfl_encode_fns[] = {
+ Opcode_dpfl_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_dhu_encode_fns[] = {
+ Opcode_dhu_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_diu_encode_fns[] = {
+ Opcode_diu_Slot_inst_encode, 0, 0
+};
+
xtensa_opcode_encode_fn Opcode_sdct_encode_fns[] = {
Opcode_sdct_Slot_inst_encode, 0, 0
};
@@ -7715,6 +9423,38 @@ xtensa_opcode_encode_fn Opcode_hwwdtlba_encode_fns[] = {
Opcode_hwwdtlba_Slot_inst_encode, 0, 0
};
+xtensa_opcode_encode_fn Opcode_rsr_cpenable_encode_fns[] = {
+ Opcode_rsr_cpenable_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_cpenable_encode_fns[] = {
+ Opcode_wsr_cpenable_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_cpenable_encode_fns[] = {
+ Opcode_xsr_cpenable_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_clamps_encode_fns[] = {
+ Opcode_clamps_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_min_encode_fns[] = {
+ Opcode_min_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_max_encode_fns[] = {
+ Opcode_max_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_minu_encode_fns[] = {
+ Opcode_minu_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_maxu_encode_fns[] = {
+ Opcode_maxu_Slot_inst_encode, 0, 0
+};
+
xtensa_opcode_encode_fn Opcode_nsa_encode_fns[] = {
Opcode_nsa_Slot_inst_encode, 0, 0
};
@@ -7723,883 +9463,1473 @@ xtensa_opcode_encode_fn Opcode_nsau_encode_fns[] = {
Opcode_nsau_Slot_inst_encode, 0, 0
};
+xtensa_opcode_encode_fn Opcode_sext_encode_fns[] = {
+ Opcode_sext_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_l32ai_encode_fns[] = {
+ Opcode_l32ai_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_s32ri_encode_fns[] = {
+ Opcode_s32ri_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_s32c1i_encode_fns[] = {
+ Opcode_s32c1i_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_rsr_scompare1_encode_fns[] = {
+ Opcode_rsr_scompare1_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_wsr_scompare1_encode_fns[] = {
+ Opcode_wsr_scompare1_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_xsr_scompare1_encode_fns[] = {
+ Opcode_xsr_scompare1_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_quou_encode_fns[] = {
+ Opcode_quou_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_quos_encode_fns[] = {
+ Opcode_quos_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_remu_encode_fns[] = {
+ Opcode_remu_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_rems_encode_fns[] = {
+ Opcode_rems_Slot_inst_encode, 0, 0
+};
+
+xtensa_opcode_encode_fn Opcode_mull_encode_fns[] = {
+ Opcode_mull_Slot_inst_encode, 0, 0
+};
+
/* Opcode table. */
static xtensa_opcode_internal opcodes[] = {
- { "excw", 0 /* xt_iclass_excw */,
+ { "excw", ICLASS_xt_iclass_excw,
0,
Opcode_excw_encode_fns, 0, 0 },
- { "rfe", 1 /* xt_iclass_rfe */,
+ { "rfe", ICLASS_xt_iclass_rfe,
XTENSA_OPCODE_IS_JUMP,
Opcode_rfe_encode_fns, 0, 0 },
- { "rfde", 2 /* xt_iclass_rfde */,
+ { "rfde", ICLASS_xt_iclass_rfde,
XTENSA_OPCODE_IS_JUMP,
Opcode_rfde_encode_fns, 0, 0 },
- { "syscall", 3 /* xt_iclass_syscall */,
+ { "syscall", ICLASS_xt_iclass_syscall,
0,
Opcode_syscall_encode_fns, 0, 0 },
- { "simcall", 4 /* xt_iclass_simcall */,
+ { "simcall", ICLASS_xt_iclass_simcall,
0,
Opcode_simcall_encode_fns, 0, 0 },
- { "call12", 5 /* xt_iclass_call12 */,
+ { "call12", ICLASS_xt_iclass_call12,
XTENSA_OPCODE_IS_CALL,
Opcode_call12_encode_fns, 0, 0 },
- { "call8", 6 /* xt_iclass_call8 */,
+ { "call8", ICLASS_xt_iclass_call8,
XTENSA_OPCODE_IS_CALL,
Opcode_call8_encode_fns, 0, 0 },
- { "call4", 7 /* xt_iclass_call4 */,
+ { "call4", ICLASS_xt_iclass_call4,
XTENSA_OPCODE_IS_CALL,
Opcode_call4_encode_fns, 0, 0 },
- { "callx12", 8 /* xt_iclass_callx12 */,
+ { "callx12", ICLASS_xt_iclass_callx12,
XTENSA_OPCODE_IS_CALL,
Opcode_callx12_encode_fns, 0, 0 },
- { "callx8", 9 /* xt_iclass_callx8 */,
+ { "callx8", ICLASS_xt_iclass_callx8,
XTENSA_OPCODE_IS_CALL,
Opcode_callx8_encode_fns, 0, 0 },
- { "callx4", 10 /* xt_iclass_callx4 */,
+ { "callx4", ICLASS_xt_iclass_callx4,
XTENSA_OPCODE_IS_CALL,
Opcode_callx4_encode_fns, 0, 0 },
- { "entry", 11 /* xt_iclass_entry */,
+ { "entry", ICLASS_xt_iclass_entry,
0,
Opcode_entry_encode_fns, 0, 0 },
- { "movsp", 12 /* xt_iclass_movsp */,
+ { "movsp", ICLASS_xt_iclass_movsp,
0,
Opcode_movsp_encode_fns, 0, 0 },
- { "rotw", 13 /* xt_iclass_rotw */,
+ { "rotw", ICLASS_xt_iclass_rotw,
0,
Opcode_rotw_encode_fns, 0, 0 },
- { "retw", 14 /* xt_iclass_retw */,
+ { "retw", ICLASS_xt_iclass_retw,
XTENSA_OPCODE_IS_JUMP,
Opcode_retw_encode_fns, 0, 0 },
- { "retw.n", 14 /* xt_iclass_retw */,
+ { "retw.n", ICLASS_xt_iclass_retw,
XTENSA_OPCODE_IS_JUMP,
Opcode_retw_n_encode_fns, 0, 0 },
- { "rfwo", 15 /* xt_iclass_rfwou */,
+ { "rfwo", ICLASS_xt_iclass_rfwou,
XTENSA_OPCODE_IS_JUMP,
Opcode_rfwo_encode_fns, 0, 0 },
- { "rfwu", 15 /* xt_iclass_rfwou */,
+ { "rfwu", ICLASS_xt_iclass_rfwou,
XTENSA_OPCODE_IS_JUMP,
Opcode_rfwu_encode_fns, 0, 0 },
- { "l32e", 16 /* xt_iclass_l32e */,
+ { "l32e", ICLASS_xt_iclass_l32e,
0,
Opcode_l32e_encode_fns, 0, 0 },
- { "s32e", 17 /* xt_iclass_s32e */,
+ { "s32e", ICLASS_xt_iclass_s32e,
0,
Opcode_s32e_encode_fns, 0, 0 },
- { "rsr.windowbase", 18 /* xt_iclass_rsr.windowbase */,
+ { "rsr.windowbase", ICLASS_xt_iclass_rsr_windowbase,
0,
Opcode_rsr_windowbase_encode_fns, 0, 0 },
- { "wsr.windowbase", 19 /* xt_iclass_wsr.windowbase */,
+ { "wsr.windowbase", ICLASS_xt_iclass_wsr_windowbase,
0,
Opcode_wsr_windowbase_encode_fns, 0, 0 },
- { "xsr.windowbase", 20 /* xt_iclass_xsr.windowbase */,
+ { "xsr.windowbase", ICLASS_xt_iclass_xsr_windowbase,
0,
Opcode_xsr_windowbase_encode_fns, 0, 0 },
- { "rsr.windowstart", 21 /* xt_iclass_rsr.windowstart */,
+ { "rsr.windowstart", ICLASS_xt_iclass_rsr_windowstart,
0,
Opcode_rsr_windowstart_encode_fns, 0, 0 },
- { "wsr.windowstart", 22 /* xt_iclass_wsr.windowstart */,
+ { "wsr.windowstart", ICLASS_xt_iclass_wsr_windowstart,
0,
Opcode_wsr_windowstart_encode_fns, 0, 0 },
- { "xsr.windowstart", 23 /* xt_iclass_xsr.windowstart */,
+ { "xsr.windowstart", ICLASS_xt_iclass_xsr_windowstart,
0,
Opcode_xsr_windowstart_encode_fns, 0, 0 },
- { "add.n", 24 /* xt_iclass_add.n */,
+ { "add.n", ICLASS_xt_iclass_add_n,
0,
Opcode_add_n_encode_fns, 0, 0 },
- { "addi.n", 25 /* xt_iclass_addi.n */,
+ { "addi.n", ICLASS_xt_iclass_addi_n,
0,
Opcode_addi_n_encode_fns, 0, 0 },
- { "beqz.n", 26 /* xt_iclass_bz6 */,
+ { "beqz.n", ICLASS_xt_iclass_bz6,
XTENSA_OPCODE_IS_BRANCH,
Opcode_beqz_n_encode_fns, 0, 0 },
- { "bnez.n", 26 /* xt_iclass_bz6 */,
+ { "bnez.n", ICLASS_xt_iclass_bz6,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bnez_n_encode_fns, 0, 0 },
- { "ill.n", 27 /* xt_iclass_ill.n */,
+ { "ill.n", ICLASS_xt_iclass_ill_n,
0,
Opcode_ill_n_encode_fns, 0, 0 },
- { "l32i.n", 28 /* xt_iclass_loadi4 */,
+ { "l32i.n", ICLASS_xt_iclass_loadi4,
0,
Opcode_l32i_n_encode_fns, 0, 0 },
- { "mov.n", 29 /* xt_iclass_mov.n */,
+ { "mov.n", ICLASS_xt_iclass_mov_n,
0,
Opcode_mov_n_encode_fns, 0, 0 },
- { "movi.n", 30 /* xt_iclass_movi.n */,
+ { "movi.n", ICLASS_xt_iclass_movi_n,
0,
Opcode_movi_n_encode_fns, 0, 0 },
- { "nop.n", 31 /* xt_iclass_nopn */,
+ { "nop.n", ICLASS_xt_iclass_nopn,
0,
Opcode_nop_n_encode_fns, 0, 0 },
- { "ret.n", 32 /* xt_iclass_retn */,
+ { "ret.n", ICLASS_xt_iclass_retn,
XTENSA_OPCODE_IS_JUMP,
Opcode_ret_n_encode_fns, 0, 0 },
- { "s32i.n", 33 /* xt_iclass_storei4 */,
+ { "s32i.n", ICLASS_xt_iclass_storei4,
0,
Opcode_s32i_n_encode_fns, 0, 0 },
- { "addi", 34 /* xt_iclass_addi */,
+ { "rur.threadptr", ICLASS_rur_threadptr,
+ 0,
+ Opcode_rur_threadptr_encode_fns, 0, 0 },
+ { "wur.threadptr", ICLASS_wur_threadptr,
+ 0,
+ Opcode_wur_threadptr_encode_fns, 0, 0 },
+ { "addi", ICLASS_xt_iclass_addi,
0,
Opcode_addi_encode_fns, 0, 0 },
- { "addmi", 35 /* xt_iclass_addmi */,
+ { "addmi", ICLASS_xt_iclass_addmi,
0,
Opcode_addmi_encode_fns, 0, 0 },
- { "add", 36 /* xt_iclass_addsub */,
+ { "add", ICLASS_xt_iclass_addsub,
0,
Opcode_add_encode_fns, 0, 0 },
- { "sub", 36 /* xt_iclass_addsub */,
+ { "sub", ICLASS_xt_iclass_addsub,
0,
Opcode_sub_encode_fns, 0, 0 },
- { "addx2", 36 /* xt_iclass_addsub */,
+ { "addx2", ICLASS_xt_iclass_addsub,
0,
Opcode_addx2_encode_fns, 0, 0 },
- { "addx4", 36 /* xt_iclass_addsub */,
+ { "addx4", ICLASS_xt_iclass_addsub,
0,
Opcode_addx4_encode_fns, 0, 0 },
- { "addx8", 36 /* xt_iclass_addsub */,
+ { "addx8", ICLASS_xt_iclass_addsub,
0,
Opcode_addx8_encode_fns, 0, 0 },
- { "subx2", 36 /* xt_iclass_addsub */,
+ { "subx2", ICLASS_xt_iclass_addsub,
0,
Opcode_subx2_encode_fns, 0, 0 },
- { "subx4", 36 /* xt_iclass_addsub */,
+ { "subx4", ICLASS_xt_iclass_addsub,
0,
Opcode_subx4_encode_fns, 0, 0 },
- { "subx8", 36 /* xt_iclass_addsub */,
+ { "subx8", ICLASS_xt_iclass_addsub,
0,
Opcode_subx8_encode_fns, 0, 0 },
- { "and", 37 /* xt_iclass_bit */,
+ { "and", ICLASS_xt_iclass_bit,
0,
Opcode_and_encode_fns, 0, 0 },
- { "or", 37 /* xt_iclass_bit */,
+ { "or", ICLASS_xt_iclass_bit,
0,
Opcode_or_encode_fns, 0, 0 },
- { "xor", 37 /* xt_iclass_bit */,
+ { "xor", ICLASS_xt_iclass_bit,
0,
Opcode_xor_encode_fns, 0, 0 },
- { "beqi", 38 /* xt_iclass_bsi8 */,
+ { "beqi", ICLASS_xt_iclass_bsi8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_beqi_encode_fns, 0, 0 },
- { "bnei", 38 /* xt_iclass_bsi8 */,
+ { "bnei", ICLASS_xt_iclass_bsi8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bnei_encode_fns, 0, 0 },
- { "bgei", 38 /* xt_iclass_bsi8 */,
+ { "bgei", ICLASS_xt_iclass_bsi8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bgei_encode_fns, 0, 0 },
- { "blti", 38 /* xt_iclass_bsi8 */,
+ { "blti", ICLASS_xt_iclass_bsi8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_blti_encode_fns, 0, 0 },
- { "bbci", 39 /* xt_iclass_bsi8b */,
+ { "bbci", ICLASS_xt_iclass_bsi8b,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bbci_encode_fns, 0, 0 },
- { "bbsi", 39 /* xt_iclass_bsi8b */,
+ { "bbsi", ICLASS_xt_iclass_bsi8b,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bbsi_encode_fns, 0, 0 },
- { "bgeui", 40 /* xt_iclass_bsi8u */,
+ { "bgeui", ICLASS_xt_iclass_bsi8u,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bgeui_encode_fns, 0, 0 },
- { "bltui", 40 /* xt_iclass_bsi8u */,
+ { "bltui", ICLASS_xt_iclass_bsi8u,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bltui_encode_fns, 0, 0 },
- { "beq", 41 /* xt_iclass_bst8 */,
+ { "beq", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_beq_encode_fns, 0, 0 },
- { "bne", 41 /* xt_iclass_bst8 */,
+ { "bne", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bne_encode_fns, 0, 0 },
- { "bge", 41 /* xt_iclass_bst8 */,
+ { "bge", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bge_encode_fns, 0, 0 },
- { "blt", 41 /* xt_iclass_bst8 */,
+ { "blt", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_blt_encode_fns, 0, 0 },
- { "bgeu", 41 /* xt_iclass_bst8 */,
+ { "bgeu", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bgeu_encode_fns, 0, 0 },
- { "bltu", 41 /* xt_iclass_bst8 */,
+ { "bltu", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bltu_encode_fns, 0, 0 },
- { "bany", 41 /* xt_iclass_bst8 */,
+ { "bany", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bany_encode_fns, 0, 0 },
- { "bnone", 41 /* xt_iclass_bst8 */,
+ { "bnone", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bnone_encode_fns, 0, 0 },
- { "ball", 41 /* xt_iclass_bst8 */,
+ { "ball", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_ball_encode_fns, 0, 0 },
- { "bnall", 41 /* xt_iclass_bst8 */,
+ { "bnall", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bnall_encode_fns, 0, 0 },
- { "bbc", 41 /* xt_iclass_bst8 */,
+ { "bbc", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bbc_encode_fns, 0, 0 },
- { "bbs", 41 /* xt_iclass_bst8 */,
+ { "bbs", ICLASS_xt_iclass_bst8,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bbs_encode_fns, 0, 0 },
- { "beqz", 42 /* xt_iclass_bsz12 */,
+ { "beqz", ICLASS_xt_iclass_bsz12,
XTENSA_OPCODE_IS_BRANCH,
Opcode_beqz_encode_fns, 0, 0 },
- { "bnez", 42 /* xt_iclass_bsz12 */,
+ { "bnez", ICLASS_xt_iclass_bsz12,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bnez_encode_fns, 0, 0 },
- { "bgez", 42 /* xt_iclass_bsz12 */,
+ { "bgez", ICLASS_xt_iclass_bsz12,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bgez_encode_fns, 0, 0 },
- { "bltz", 42 /* xt_iclass_bsz12 */,
+ { "bltz", ICLASS_xt_iclass_bsz12,
XTENSA_OPCODE_IS_BRANCH,
Opcode_bltz_encode_fns, 0, 0 },
- { "call0", 43 /* xt_iclass_call0 */,
+ { "call0", ICLASS_xt_iclass_call0,
XTENSA_OPCODE_IS_CALL,
Opcode_call0_encode_fns, 0, 0 },
- { "callx0", 44 /* xt_iclass_callx0 */,
+ { "callx0", ICLASS_xt_iclass_callx0,
XTENSA_OPCODE_IS_CALL,
Opcode_callx0_encode_fns, 0, 0 },
- { "extui", 45 /* xt_iclass_exti */,
+ { "extui", ICLASS_xt_iclass_exti,
0,
Opcode_extui_encode_fns, 0, 0 },
- { "ill", 46 /* xt_iclass_ill */,
+ { "ill", ICLASS_xt_iclass_ill,
0,
Opcode_ill_encode_fns, 0, 0 },
- { "j", 47 /* xt_iclass_jump */,
+ { "j", ICLASS_xt_iclass_jump,
XTENSA_OPCODE_IS_JUMP,
Opcode_j_encode_fns, 0, 0 },
- { "jx", 48 /* xt_iclass_jumpx */,
+ { "jx", ICLASS_xt_iclass_jumpx,
XTENSA_OPCODE_IS_JUMP,
Opcode_jx_encode_fns, 0, 0 },
- { "l16ui", 49 /* xt_iclass_l16ui */,
+ { "l16ui", ICLASS_xt_iclass_l16ui,
0,
Opcode_l16ui_encode_fns, 0, 0 },
- { "l16si", 50 /* xt_iclass_l16si */,
+ { "l16si", ICLASS_xt_iclass_l16si,
0,
Opcode_l16si_encode_fns, 0, 0 },
- { "l32i", 51 /* xt_iclass_l32i */,
+ { "l32i", ICLASS_xt_iclass_l32i,
0,
Opcode_l32i_encode_fns, 0, 0 },
- { "l32r", 52 /* xt_iclass_l32r */,
+ { "l32r", ICLASS_xt_iclass_l32r,
0,
Opcode_l32r_encode_fns, 0, 0 },
- { "l8ui", 53 /* xt_iclass_l8i */,
+ { "l8ui", ICLASS_xt_iclass_l8i,
0,
Opcode_l8ui_encode_fns, 0, 0 },
- { "loop", 54 /* xt_iclass_loop */,
+ { "loop", ICLASS_xt_iclass_loop,
XTENSA_OPCODE_IS_LOOP,
Opcode_loop_encode_fns, 0, 0 },
- { "loopnez", 55 /* xt_iclass_loopz */,
+ { "loopnez", ICLASS_xt_iclass_loopz,
XTENSA_OPCODE_IS_LOOP,
Opcode_loopnez_encode_fns, 0, 0 },
- { "loopgtz", 55 /* xt_iclass_loopz */,
+ { "loopgtz", ICLASS_xt_iclass_loopz,
XTENSA_OPCODE_IS_LOOP,
Opcode_loopgtz_encode_fns, 0, 0 },
- { "movi", 56 /* xt_iclass_movi */,
+ { "movi", ICLASS_xt_iclass_movi,
0,
Opcode_movi_encode_fns, 0, 0 },
- { "moveqz", 57 /* xt_iclass_movz */,
+ { "moveqz", ICLASS_xt_iclass_movz,
0,
Opcode_moveqz_encode_fns, 0, 0 },
- { "movnez", 57 /* xt_iclass_movz */,
+ { "movnez", ICLASS_xt_iclass_movz,
0,
Opcode_movnez_encode_fns, 0, 0 },
- { "movltz", 57 /* xt_iclass_movz */,
+ { "movltz", ICLASS_xt_iclass_movz,
0,
Opcode_movltz_encode_fns, 0, 0 },
- { "movgez", 57 /* xt_iclass_movz */,
+ { "movgez", ICLASS_xt_iclass_movz,
0,
Opcode_movgez_encode_fns, 0, 0 },
- { "neg", 58 /* xt_iclass_neg */,
+ { "neg", ICLASS_xt_iclass_neg,
0,
Opcode_neg_encode_fns, 0, 0 },
- { "abs", 58 /* xt_iclass_neg */,
+ { "abs", ICLASS_xt_iclass_neg,
0,
Opcode_abs_encode_fns, 0, 0 },
- { "nop", 59 /* xt_iclass_nop */,
+ { "nop", ICLASS_xt_iclass_nop,
0,
Opcode_nop_encode_fns, 0, 0 },
- { "ret", 60 /* xt_iclass_return */,
+ { "ret", ICLASS_xt_iclass_return,
XTENSA_OPCODE_IS_JUMP,
Opcode_ret_encode_fns, 0, 0 },
- { "s16i", 61 /* xt_iclass_s16i */,
+ { "s16i", ICLASS_xt_iclass_s16i,
0,
Opcode_s16i_encode_fns, 0, 0 },
- { "s32i", 62 /* xt_iclass_s32i */,
+ { "s32i", ICLASS_xt_iclass_s32i,
0,
Opcode_s32i_encode_fns, 0, 0 },
- { "s8i", 63 /* xt_iclass_s8i */,
+ { "s8i", ICLASS_xt_iclass_s8i,
0,
Opcode_s8i_encode_fns, 0, 0 },
- { "ssr", 64 /* xt_iclass_sar */,
+ { "ssr", ICLASS_xt_iclass_sar,
0,
Opcode_ssr_encode_fns, 0, 0 },
- { "ssl", 64 /* xt_iclass_sar */,
+ { "ssl", ICLASS_xt_iclass_sar,
0,
Opcode_ssl_encode_fns, 0, 0 },
- { "ssa8l", 64 /* xt_iclass_sar */,
+ { "ssa8l", ICLASS_xt_iclass_sar,
0,
Opcode_ssa8l_encode_fns, 0, 0 },
- { "ssa8b", 64 /* xt_iclass_sar */,
+ { "ssa8b", ICLASS_xt_iclass_sar,
0,
Opcode_ssa8b_encode_fns, 0, 0 },
- { "ssai", 65 /* xt_iclass_sari */,
+ { "ssai", ICLASS_xt_iclass_sari,
0,
Opcode_ssai_encode_fns, 0, 0 },
- { "sll", 66 /* xt_iclass_shifts */,
+ { "sll", ICLASS_xt_iclass_shifts,
0,
Opcode_sll_encode_fns, 0, 0 },
- { "src", 67 /* xt_iclass_shiftst */,
+ { "src", ICLASS_xt_iclass_shiftst,
0,
Opcode_src_encode_fns, 0, 0 },
- { "srl", 68 /* xt_iclass_shiftt */,
+ { "srl", ICLASS_xt_iclass_shiftt,
0,
Opcode_srl_encode_fns, 0, 0 },
- { "sra", 68 /* xt_iclass_shiftt */,
+ { "sra", ICLASS_xt_iclass_shiftt,
0,
Opcode_sra_encode_fns, 0, 0 },
- { "slli", 69 /* xt_iclass_slli */,
+ { "slli", ICLASS_xt_iclass_slli,
0,
Opcode_slli_encode_fns, 0, 0 },
- { "srai", 70 /* xt_iclass_srai */,
+ { "srai", ICLASS_xt_iclass_srai,
0,
Opcode_srai_encode_fns, 0, 0 },
- { "srli", 71 /* xt_iclass_srli */,
+ { "srli", ICLASS_xt_iclass_srli,
0,
Opcode_srli_encode_fns, 0, 0 },
- { "memw", 72 /* xt_iclass_memw */,
+ { "memw", ICLASS_xt_iclass_memw,
0,
Opcode_memw_encode_fns, 0, 0 },
- { "extw", 73 /* xt_iclass_extw */,
+ { "extw", ICLASS_xt_iclass_extw,
0,
Opcode_extw_encode_fns, 0, 0 },
- { "isync", 74 /* xt_iclass_isync */,
+ { "isync", ICLASS_xt_iclass_isync,
0,
Opcode_isync_encode_fns, 0, 0 },
- { "rsync", 75 /* xt_iclass_sync */,
+ { "rsync", ICLASS_xt_iclass_sync,
0,
Opcode_rsync_encode_fns, 0, 0 },
- { "esync", 75 /* xt_iclass_sync */,
+ { "esync", ICLASS_xt_iclass_sync,
0,
Opcode_esync_encode_fns, 0, 0 },
- { "dsync", 75 /* xt_iclass_sync */,
+ { "dsync", ICLASS_xt_iclass_sync,
0,
Opcode_dsync_encode_fns, 0, 0 },
- { "rsil", 76 /* xt_iclass_rsil */,
+ { "rsil", ICLASS_xt_iclass_rsil,
0,
Opcode_rsil_encode_fns, 0, 0 },
- { "rsr.lend", 77 /* xt_iclass_rsr.lend */,
+ { "rsr.lend", ICLASS_xt_iclass_rsr_lend,
0,
Opcode_rsr_lend_encode_fns, 0, 0 },
- { "wsr.lend", 78 /* xt_iclass_wsr.lend */,
+ { "wsr.lend", ICLASS_xt_iclass_wsr_lend,
0,
Opcode_wsr_lend_encode_fns, 0, 0 },
- { "xsr.lend", 79 /* xt_iclass_xsr.lend */,
+ { "xsr.lend", ICLASS_xt_iclass_xsr_lend,
0,
Opcode_xsr_lend_encode_fns, 0, 0 },
- { "rsr.lcount", 80 /* xt_iclass_rsr.lcount */,
+ { "rsr.lcount", ICLASS_xt_iclass_rsr_lcount,
0,
Opcode_rsr_lcount_encode_fns, 0, 0 },
- { "wsr.lcount", 81 /* xt_iclass_wsr.lcount */,
+ { "wsr.lcount", ICLASS_xt_iclass_wsr_lcount,
0,
Opcode_wsr_lcount_encode_fns, 0, 0 },
- { "xsr.lcount", 82 /* xt_iclass_xsr.lcount */,
+ { "xsr.lcount", ICLASS_xt_iclass_xsr_lcount,
0,
Opcode_xsr_lcount_encode_fns, 0, 0 },
- { "rsr.lbeg", 83 /* xt_iclass_rsr.lbeg */,
+ { "rsr.lbeg", ICLASS_xt_iclass_rsr_lbeg,
0,
Opcode_rsr_lbeg_encode_fns, 0, 0 },
- { "wsr.lbeg", 84 /* xt_iclass_wsr.lbeg */,
+ { "wsr.lbeg", ICLASS_xt_iclass_wsr_lbeg,
0,
Opcode_wsr_lbeg_encode_fns, 0, 0 },
- { "xsr.lbeg", 85 /* xt_iclass_xsr.lbeg */,
+ { "xsr.lbeg", ICLASS_xt_iclass_xsr_lbeg,
0,
Opcode_xsr_lbeg_encode_fns, 0, 0 },
- { "rsr.sar", 86 /* xt_iclass_rsr.sar */,
+ { "rsr.sar", ICLASS_xt_iclass_rsr_sar,
0,
Opcode_rsr_sar_encode_fns, 0, 0 },
- { "wsr.sar", 87 /* xt_iclass_wsr.sar */,
+ { "wsr.sar", ICLASS_xt_iclass_wsr_sar,
0,
Opcode_wsr_sar_encode_fns, 0, 0 },
- { "xsr.sar", 88 /* xt_iclass_xsr.sar */,
+ { "xsr.sar", ICLASS_xt_iclass_xsr_sar,
0,
Opcode_xsr_sar_encode_fns, 0, 0 },
- { "rsr.litbase", 89 /* xt_iclass_rsr.litbase */,
+ { "rsr.litbase", ICLASS_xt_iclass_rsr_litbase,
0,
Opcode_rsr_litbase_encode_fns, 0, 0 },
- { "wsr.litbase", 90 /* xt_iclass_wsr.litbase */,
+ { "wsr.litbase", ICLASS_xt_iclass_wsr_litbase,
0,
Opcode_wsr_litbase_encode_fns, 0, 0 },
- { "xsr.litbase", 91 /* xt_iclass_xsr.litbase */,
+ { "xsr.litbase", ICLASS_xt_iclass_xsr_litbase,
0,
Opcode_xsr_litbase_encode_fns, 0, 0 },
- { "rsr.176", 92 /* xt_iclass_rsr.176 */,
+ { "rsr.176", ICLASS_xt_iclass_rsr_176,
0,
Opcode_rsr_176_encode_fns, 0, 0 },
- { "rsr.208", 93 /* xt_iclass_rsr.208 */,
+ { "wsr.176", ICLASS_xt_iclass_wsr_176,
+ 0,
+ Opcode_wsr_176_encode_fns, 0, 0 },
+ { "rsr.208", ICLASS_xt_iclass_rsr_208,
0,
Opcode_rsr_208_encode_fns, 0, 0 },
- { "rsr.ps", 94 /* xt_iclass_rsr.ps */,
+ { "rsr.ps", ICLASS_xt_iclass_rsr_ps,
0,
Opcode_rsr_ps_encode_fns, 0, 0 },
- { "wsr.ps", 95 /* xt_iclass_wsr.ps */,
+ { "wsr.ps", ICLASS_xt_iclass_wsr_ps,
0,
Opcode_wsr_ps_encode_fns, 0, 0 },
- { "xsr.ps", 96 /* xt_iclass_xsr.ps */,
+ { "xsr.ps", ICLASS_xt_iclass_xsr_ps,
0,
Opcode_xsr_ps_encode_fns, 0, 0 },
- { "rsr.epc1", 97 /* xt_iclass_rsr.epc1 */,
+ { "rsr.epc1", ICLASS_xt_iclass_rsr_epc1,
0,
Opcode_rsr_epc1_encode_fns, 0, 0 },
- { "wsr.epc1", 98 /* xt_iclass_wsr.epc1 */,
+ { "wsr.epc1", ICLASS_xt_iclass_wsr_epc1,
0,
Opcode_wsr_epc1_encode_fns, 0, 0 },
- { "xsr.epc1", 99 /* xt_iclass_xsr.epc1 */,
+ { "xsr.epc1", ICLASS_xt_iclass_xsr_epc1,
0,
Opcode_xsr_epc1_encode_fns, 0, 0 },
- { "rsr.excsave1", 100 /* xt_iclass_rsr.excsave1 */,
+ { "rsr.excsave1", ICLASS_xt_iclass_rsr_excsave1,
0,
Opcode_rsr_excsave1_encode_fns, 0, 0 },
- { "wsr.excsave1", 101 /* xt_iclass_wsr.excsave1 */,
+ { "wsr.excsave1", ICLASS_xt_iclass_wsr_excsave1,
0,
Opcode_wsr_excsave1_encode_fns, 0, 0 },
- { "xsr.excsave1", 102 /* xt_iclass_xsr.excsave1 */,
+ { "xsr.excsave1", ICLASS_xt_iclass_xsr_excsave1,
0,
Opcode_xsr_excsave1_encode_fns, 0, 0 },
- { "rsr.epc2", 103 /* xt_iclass_rsr.epc2 */,
+ { "rsr.epc2", ICLASS_xt_iclass_rsr_epc2,
0,
Opcode_rsr_epc2_encode_fns, 0, 0 },
- { "wsr.epc2", 104 /* xt_iclass_wsr.epc2 */,
+ { "wsr.epc2", ICLASS_xt_iclass_wsr_epc2,
0,
Opcode_wsr_epc2_encode_fns, 0, 0 },
- { "xsr.epc2", 105 /* xt_iclass_xsr.epc2 */,
+ { "xsr.epc2", ICLASS_xt_iclass_xsr_epc2,
0,
Opcode_xsr_epc2_encode_fns, 0, 0 },
- { "rsr.excsave2", 106 /* xt_iclass_rsr.excsave2 */,
+ { "rsr.excsave2", ICLASS_xt_iclass_rsr_excsave2,
0,
Opcode_rsr_excsave2_encode_fns, 0, 0 },
- { "wsr.excsave2", 107 /* xt_iclass_wsr.excsave2 */,
+ { "wsr.excsave2", ICLASS_xt_iclass_wsr_excsave2,
0,
Opcode_wsr_excsave2_encode_fns, 0, 0 },
- { "xsr.excsave2", 108 /* xt_iclass_xsr.excsave2 */,
+ { "xsr.excsave2", ICLASS_xt_iclass_xsr_excsave2,
0,
Opcode_xsr_excsave2_encode_fns, 0, 0 },
- { "rsr.epc3", 109 /* xt_iclass_rsr.epc3 */,
+ { "rsr.epc3", ICLASS_xt_iclass_rsr_epc3,
0,
Opcode_rsr_epc3_encode_fns, 0, 0 },
- { "wsr.epc3", 110 /* xt_iclass_wsr.epc3 */,
+ { "wsr.epc3", ICLASS_xt_iclass_wsr_epc3,
0,
Opcode_wsr_epc3_encode_fns, 0, 0 },
- { "xsr.epc3", 111 /* xt_iclass_xsr.epc3 */,
+ { "xsr.epc3", ICLASS_xt_iclass_xsr_epc3,
0,
Opcode_xsr_epc3_encode_fns, 0, 0 },
- { "rsr.excsave3", 112 /* xt_iclass_rsr.excsave3 */,
+ { "rsr.excsave3", ICLASS_xt_iclass_rsr_excsave3,
0,
Opcode_rsr_excsave3_encode_fns, 0, 0 },
- { "wsr.excsave3", 113 /* xt_iclass_wsr.excsave3 */,
+ { "wsr.excsave3", ICLASS_xt_iclass_wsr_excsave3,
0,
Opcode_wsr_excsave3_encode_fns, 0, 0 },
- { "xsr.excsave3", 114 /* xt_iclass_xsr.excsave3 */,
+ { "xsr.excsave3", ICLASS_xt_iclass_xsr_excsave3,
0,
Opcode_xsr_excsave3_encode_fns, 0, 0 },
- { "rsr.epc4", 115 /* xt_iclass_rsr.epc4 */,
+ { "rsr.epc4", ICLASS_xt_iclass_rsr_epc4,
0,
Opcode_rsr_epc4_encode_fns, 0, 0 },
- { "wsr.epc4", 116 /* xt_iclass_wsr.epc4 */,
+ { "wsr.epc4", ICLASS_xt_iclass_wsr_epc4,
0,
Opcode_wsr_epc4_encode_fns, 0, 0 },
- { "xsr.epc4", 117 /* xt_iclass_xsr.epc4 */,
+ { "xsr.epc4", ICLASS_xt_iclass_xsr_epc4,
0,
Opcode_xsr_epc4_encode_fns, 0, 0 },
- { "rsr.excsave4", 118 /* xt_iclass_rsr.excsave4 */,
+ { "rsr.excsave4", ICLASS_xt_iclass_rsr_excsave4,
0,
Opcode_rsr_excsave4_encode_fns, 0, 0 },
- { "wsr.excsave4", 119 /* xt_iclass_wsr.excsave4 */,
+ { "wsr.excsave4", ICLASS_xt_iclass_wsr_excsave4,
0,
Opcode_wsr_excsave4_encode_fns, 0, 0 },
- { "xsr.excsave4", 120 /* xt_iclass_xsr.excsave4 */,
+ { "xsr.excsave4", ICLASS_xt_iclass_xsr_excsave4,
0,
Opcode_xsr_excsave4_encode_fns, 0, 0 },
- { "rsr.eps2", 121 /* xt_iclass_rsr.eps2 */,
+ { "rsr.epc5", ICLASS_xt_iclass_rsr_epc5,
+ 0,
+ Opcode_rsr_epc5_encode_fns, 0, 0 },
+ { "wsr.epc5", ICLASS_xt_iclass_wsr_epc5,
+ 0,
+ Opcode_wsr_epc5_encode_fns, 0, 0 },
+ { "xsr.epc5", ICLASS_xt_iclass_xsr_epc5,
+ 0,
+ Opcode_xsr_epc5_encode_fns, 0, 0 },
+ { "rsr.excsave5", ICLASS_xt_iclass_rsr_excsave5,
+ 0,
+ Opcode_rsr_excsave5_encode_fns, 0, 0 },
+ { "wsr.excsave5", ICLASS_xt_iclass_wsr_excsave5,
+ 0,
+ Opcode_wsr_excsave5_encode_fns, 0, 0 },
+ { "xsr.excsave5", ICLASS_xt_iclass_xsr_excsave5,
+ 0,
+ Opcode_xsr_excsave5_encode_fns, 0, 0 },
+ { "rsr.epc6", ICLASS_xt_iclass_rsr_epc6,
+ 0,
+ Opcode_rsr_epc6_encode_fns, 0, 0 },
+ { "wsr.epc6", ICLASS_xt_iclass_wsr_epc6,
+ 0,
+ Opcode_wsr_epc6_encode_fns, 0, 0 },
+ { "xsr.epc6", ICLASS_xt_iclass_xsr_epc6,
+ 0,
+ Opcode_xsr_epc6_encode_fns, 0, 0 },
+ { "rsr.excsave6", ICLASS_xt_iclass_rsr_excsave6,
+ 0,
+ Opcode_rsr_excsave6_encode_fns, 0, 0 },
+ { "wsr.excsave6", ICLASS_xt_iclass_wsr_excsave6,
+ 0,
+ Opcode_wsr_excsave6_encode_fns, 0, 0 },
+ { "xsr.excsave6", ICLASS_xt_iclass_xsr_excsave6,
+ 0,
+ Opcode_xsr_excsave6_encode_fns, 0, 0 },
+ { "rsr.epc7", ICLASS_xt_iclass_rsr_epc7,
+ 0,
+ Opcode_rsr_epc7_encode_fns, 0, 0 },
+ { "wsr.epc7", ICLASS_xt_iclass_wsr_epc7,
+ 0,
+ Opcode_wsr_epc7_encode_fns, 0, 0 },
+ { "xsr.epc7", ICLASS_xt_iclass_xsr_epc7,
+ 0,
+ Opcode_xsr_epc7_encode_fns, 0, 0 },
+ { "rsr.excsave7", ICLASS_xt_iclass_rsr_excsave7,
+ 0,
+ Opcode_rsr_excsave7_encode_fns, 0, 0 },
+ { "wsr.excsave7", ICLASS_xt_iclass_wsr_excsave7,
+ 0,
+ Opcode_wsr_excsave7_encode_fns, 0, 0 },
+ { "xsr.excsave7", ICLASS_xt_iclass_xsr_excsave7,
+ 0,
+ Opcode_xsr_excsave7_encode_fns, 0, 0 },
+ { "rsr.eps2", ICLASS_xt_iclass_rsr_eps2,
0,
Opcode_rsr_eps2_encode_fns, 0, 0 },
- { "wsr.eps2", 122 /* xt_iclass_wsr.eps2 */,
+ { "wsr.eps2", ICLASS_xt_iclass_wsr_eps2,
0,
Opcode_wsr_eps2_encode_fns, 0, 0 },
- { "xsr.eps2", 123 /* xt_iclass_xsr.eps2 */,
+ { "xsr.eps2", ICLASS_xt_iclass_xsr_eps2,
0,
Opcode_xsr_eps2_encode_fns, 0, 0 },
- { "rsr.eps3", 124 /* xt_iclass_rsr.eps3 */,
+ { "rsr.eps3", ICLASS_xt_iclass_rsr_eps3,
0,
Opcode_rsr_eps3_encode_fns, 0, 0 },
- { "wsr.eps3", 125 /* xt_iclass_wsr.eps3 */,
+ { "wsr.eps3", ICLASS_xt_iclass_wsr_eps3,
0,
Opcode_wsr_eps3_encode_fns, 0, 0 },
- { "xsr.eps3", 126 /* xt_iclass_xsr.eps3 */,
+ { "xsr.eps3", ICLASS_xt_iclass_xsr_eps3,
0,
Opcode_xsr_eps3_encode_fns, 0, 0 },
- { "rsr.eps4", 127 /* xt_iclass_rsr.eps4 */,
+ { "rsr.eps4", ICLASS_xt_iclass_rsr_eps4,
0,
Opcode_rsr_eps4_encode_fns, 0, 0 },
- { "wsr.eps4", 128 /* xt_iclass_wsr.eps4 */,
+ { "wsr.eps4", ICLASS_xt_iclass_wsr_eps4,
0,
Opcode_wsr_eps4_encode_fns, 0, 0 },
- { "xsr.eps4", 129 /* xt_iclass_xsr.eps4 */,
+ { "xsr.eps4", ICLASS_xt_iclass_xsr_eps4,
0,
Opcode_xsr_eps4_encode_fns, 0, 0 },
- { "rsr.excvaddr", 130 /* xt_iclass_rsr.excvaddr */,
+ { "rsr.eps5", ICLASS_xt_iclass_rsr_eps5,
+ 0,
+ Opcode_rsr_eps5_encode_fns, 0, 0 },
+ { "wsr.eps5", ICLASS_xt_iclass_wsr_eps5,
+ 0,
+ Opcode_wsr_eps5_encode_fns, 0, 0 },
+ { "xsr.eps5", ICLASS_xt_iclass_xsr_eps5,
+ 0,
+ Opcode_xsr_eps5_encode_fns, 0, 0 },
+ { "rsr.eps6", ICLASS_xt_iclass_rsr_eps6,
+ 0,
+ Opcode_rsr_eps6_encode_fns, 0, 0 },
+ { "wsr.eps6", ICLASS_xt_iclass_wsr_eps6,
+ 0,
+ Opcode_wsr_eps6_encode_fns, 0, 0 },
+ { "xsr.eps6", ICLASS_xt_iclass_xsr_eps6,
+ 0,
+ Opcode_xsr_eps6_encode_fns, 0, 0 },
+ { "rsr.eps7", ICLASS_xt_iclass_rsr_eps7,
+ 0,
+ Opcode_rsr_eps7_encode_fns, 0, 0 },
+ { "wsr.eps7", ICLASS_xt_iclass_wsr_eps7,
+ 0,
+ Opcode_wsr_eps7_encode_fns, 0, 0 },
+ { "xsr.eps7", ICLASS_xt_iclass_xsr_eps7,
+ 0,
+ Opcode_xsr_eps7_encode_fns, 0, 0 },
+ { "rsr.excvaddr", ICLASS_xt_iclass_rsr_excvaddr,
0,
Opcode_rsr_excvaddr_encode_fns, 0, 0 },
- { "wsr.excvaddr", 131 /* xt_iclass_wsr.excvaddr */,
+ { "wsr.excvaddr", ICLASS_xt_iclass_wsr_excvaddr,
0,
Opcode_wsr_excvaddr_encode_fns, 0, 0 },
- { "xsr.excvaddr", 132 /* xt_iclass_xsr.excvaddr */,
+ { "xsr.excvaddr", ICLASS_xt_iclass_xsr_excvaddr,
0,
Opcode_xsr_excvaddr_encode_fns, 0, 0 },
- { "rsr.depc", 133 /* xt_iclass_rsr.depc */,
+ { "rsr.depc", ICLASS_xt_iclass_rsr_depc,
0,
Opcode_rsr_depc_encode_fns, 0, 0 },
- { "wsr.depc", 134 /* xt_iclass_wsr.depc */,
+ { "wsr.depc", ICLASS_xt_iclass_wsr_depc,
0,
Opcode_wsr_depc_encode_fns, 0, 0 },
- { "xsr.depc", 135 /* xt_iclass_xsr.depc */,
+ { "xsr.depc", ICLASS_xt_iclass_xsr_depc,
0,
Opcode_xsr_depc_encode_fns, 0, 0 },
- { "rsr.exccause", 136 /* xt_iclass_rsr.exccause */,
+ { "rsr.exccause", ICLASS_xt_iclass_rsr_exccause,
0,
Opcode_rsr_exccause_encode_fns, 0, 0 },
- { "wsr.exccause", 137 /* xt_iclass_wsr.exccause */,
+ { "wsr.exccause", ICLASS_xt_iclass_wsr_exccause,
0,
Opcode_wsr_exccause_encode_fns, 0, 0 },
- { "xsr.exccause", 138 /* xt_iclass_xsr.exccause */,
+ { "xsr.exccause", ICLASS_xt_iclass_xsr_exccause,
0,
Opcode_xsr_exccause_encode_fns, 0, 0 },
- { "rsr.misc0", 139 /* xt_iclass_rsr.misc0 */,
+ { "rsr.misc0", ICLASS_xt_iclass_rsr_misc0,
0,
Opcode_rsr_misc0_encode_fns, 0, 0 },
- { "wsr.misc0", 140 /* xt_iclass_wsr.misc0 */,
+ { "wsr.misc0", ICLASS_xt_iclass_wsr_misc0,
0,
Opcode_wsr_misc0_encode_fns, 0, 0 },
- { "xsr.misc0", 141 /* xt_iclass_xsr.misc0 */,
+ { "xsr.misc0", ICLASS_xt_iclass_xsr_misc0,
0,
Opcode_xsr_misc0_encode_fns, 0, 0 },
- { "rsr.misc1", 142 /* xt_iclass_rsr.misc1 */,
+ { "rsr.misc1", ICLASS_xt_iclass_rsr_misc1,
0,
Opcode_rsr_misc1_encode_fns, 0, 0 },
- { "wsr.misc1", 143 /* xt_iclass_wsr.misc1 */,
+ { "wsr.misc1", ICLASS_xt_iclass_wsr_misc1,
0,
Opcode_wsr_misc1_encode_fns, 0, 0 },
- { "xsr.misc1", 144 /* xt_iclass_xsr.misc1 */,
+ { "xsr.misc1", ICLASS_xt_iclass_xsr_misc1,
0,
Opcode_xsr_misc1_encode_fns, 0, 0 },
- { "rsr.prid", 145 /* xt_iclass_rsr.prid */,
+ { "rsr.prid", ICLASS_xt_iclass_rsr_prid,
0,
Opcode_rsr_prid_encode_fns, 0, 0 },
- { "rfi", 146 /* xt_iclass_rfi */,
+ { "rsr.vecbase", ICLASS_xt_iclass_rsr_vecbase,
+ 0,
+ Opcode_rsr_vecbase_encode_fns, 0, 0 },
+ { "wsr.vecbase", ICLASS_xt_iclass_wsr_vecbase,
+ 0,
+ Opcode_wsr_vecbase_encode_fns, 0, 0 },
+ { "xsr.vecbase", ICLASS_xt_iclass_xsr_vecbase,
+ 0,
+ Opcode_xsr_vecbase_encode_fns, 0, 0 },
+ { "mul16u", ICLASS_xt_iclass_mul16,
+ 0,
+ Opcode_mul16u_encode_fns, 0, 0 },
+ { "mul16s", ICLASS_xt_iclass_mul16,
+ 0,
+ Opcode_mul16s_encode_fns, 0, 0 },
+ { "rfi", ICLASS_xt_iclass_rfi,
XTENSA_OPCODE_IS_JUMP,
Opcode_rfi_encode_fns, 0, 0 },
- { "waiti", 147 /* xt_iclass_wait */,
+ { "waiti", ICLASS_xt_iclass_wait,
0,
Opcode_waiti_encode_fns, 0, 0 },
- { "rsr.interrupt", 148 /* xt_iclass_rsr.interrupt */,
+ { "rsr.interrupt", ICLASS_xt_iclass_rsr_interrupt,
0,
Opcode_rsr_interrupt_encode_fns, 0, 0 },
- { "wsr.intset", 149 /* xt_iclass_wsr.intset */,
+ { "wsr.intset", ICLASS_xt_iclass_wsr_intset,
0,
Opcode_wsr_intset_encode_fns, 0, 0 },
- { "wsr.intclear", 150 /* xt_iclass_wsr.intclear */,
+ { "wsr.intclear", ICLASS_xt_iclass_wsr_intclear,
0,
Opcode_wsr_intclear_encode_fns, 0, 0 },
- { "rsr.intenable", 151 /* xt_iclass_rsr.intenable */,
+ { "rsr.intenable", ICLASS_xt_iclass_rsr_intenable,
0,
Opcode_rsr_intenable_encode_fns, 0, 0 },
- { "wsr.intenable", 152 /* xt_iclass_wsr.intenable */,
+ { "wsr.intenable", ICLASS_xt_iclass_wsr_intenable,
0,
Opcode_wsr_intenable_encode_fns, 0, 0 },
- { "xsr.intenable", 153 /* xt_iclass_xsr.intenable */,
+ { "xsr.intenable", ICLASS_xt_iclass_xsr_intenable,
0,
Opcode_xsr_intenable_encode_fns, 0, 0 },
- { "break", 154 /* xt_iclass_break */,
+ { "break", ICLASS_xt_iclass_break,
0,
Opcode_break_encode_fns, 0, 0 },
- { "break.n", 155 /* xt_iclass_break.n */,
+ { "break.n", ICLASS_xt_iclass_break_n,
0,
Opcode_break_n_encode_fns, 0, 0 },
- { "rsr.dbreaka0", 156 /* xt_iclass_rsr.dbreaka0 */,
+ { "rsr.dbreaka0", ICLASS_xt_iclass_rsr_dbreaka0,
0,
Opcode_rsr_dbreaka0_encode_fns, 0, 0 },
- { "wsr.dbreaka0", 157 /* xt_iclass_wsr.dbreaka0 */,
+ { "wsr.dbreaka0", ICLASS_xt_iclass_wsr_dbreaka0,
0,
Opcode_wsr_dbreaka0_encode_fns, 0, 0 },
- { "xsr.dbreaka0", 158 /* xt_iclass_xsr.dbreaka0 */,
+ { "xsr.dbreaka0", ICLASS_xt_iclass_xsr_dbreaka0,
0,
Opcode_xsr_dbreaka0_encode_fns, 0, 0 },
- { "rsr.dbreakc0", 159 /* xt_iclass_rsr.dbreakc0 */,
+ { "rsr.dbreakc0", ICLASS_xt_iclass_rsr_dbreakc0,
0,
Opcode_rsr_dbreakc0_encode_fns, 0, 0 },
- { "wsr.dbreakc0", 160 /* xt_iclass_wsr.dbreakc0 */,
+ { "wsr.dbreakc0", ICLASS_xt_iclass_wsr_dbreakc0,
0,
Opcode_wsr_dbreakc0_encode_fns, 0, 0 },
- { "xsr.dbreakc0", 161 /* xt_iclass_xsr.dbreakc0 */,
+ { "xsr.dbreakc0", ICLASS_xt_iclass_xsr_dbreakc0,
0,
Opcode_xsr_dbreakc0_encode_fns, 0, 0 },
- { "rsr.dbreaka1", 162 /* xt_iclass_rsr.dbreaka1 */,
+ { "rsr.dbreaka1", ICLASS_xt_iclass_rsr_dbreaka1,
0,
Opcode_rsr_dbreaka1_encode_fns, 0, 0 },
- { "wsr.dbreaka1", 163 /* xt_iclass_wsr.dbreaka1 */,
+ { "wsr.dbreaka1", ICLASS_xt_iclass_wsr_dbreaka1,
0,
Opcode_wsr_dbreaka1_encode_fns, 0, 0 },
- { "xsr.dbreaka1", 164 /* xt_iclass_xsr.dbreaka1 */,
+ { "xsr.dbreaka1", ICLASS_xt_iclass_xsr_dbreaka1,
0,
Opcode_xsr_dbreaka1_encode_fns, 0, 0 },
- { "rsr.dbreakc1", 165 /* xt_iclass_rsr.dbreakc1 */,
+ { "rsr.dbreakc1", ICLASS_xt_iclass_rsr_dbreakc1,
0,
Opcode_rsr_dbreakc1_encode_fns, 0, 0 },
- { "wsr.dbreakc1", 166 /* xt_iclass_wsr.dbreakc1 */,
+ { "wsr.dbreakc1", ICLASS_xt_iclass_wsr_dbreakc1,
0,
Opcode_wsr_dbreakc1_encode_fns, 0, 0 },
- { "xsr.dbreakc1", 167 /* xt_iclass_xsr.dbreakc1 */,
+ { "xsr.dbreakc1", ICLASS_xt_iclass_xsr_dbreakc1,
0,
Opcode_xsr_dbreakc1_encode_fns, 0, 0 },
- { "rsr.ibreaka0", 168 /* xt_iclass_rsr.ibreaka0 */,
+ { "rsr.ibreaka0", ICLASS_xt_iclass_rsr_ibreaka0,
0,
Opcode_rsr_ibreaka0_encode_fns, 0, 0 },
- { "wsr.ibreaka0", 169 /* xt_iclass_wsr.ibreaka0 */,
+ { "wsr.ibreaka0", ICLASS_xt_iclass_wsr_ibreaka0,
0,
Opcode_wsr_ibreaka0_encode_fns, 0, 0 },
- { "xsr.ibreaka0", 170 /* xt_iclass_xsr.ibreaka0 */,
+ { "xsr.ibreaka0", ICLASS_xt_iclass_xsr_ibreaka0,
0,
Opcode_xsr_ibreaka0_encode_fns, 0, 0 },
- { "rsr.ibreaka1", 171 /* xt_iclass_rsr.ibreaka1 */,
+ { "rsr.ibreaka1", ICLASS_xt_iclass_rsr_ibreaka1,
0,
Opcode_rsr_ibreaka1_encode_fns, 0, 0 },
- { "wsr.ibreaka1", 172 /* xt_iclass_wsr.ibreaka1 */,
+ { "wsr.ibreaka1", ICLASS_xt_iclass_wsr_ibreaka1,
0,
Opcode_wsr_ibreaka1_encode_fns, 0, 0 },
- { "xsr.ibreaka1", 173 /* xt_iclass_xsr.ibreaka1 */,
+ { "xsr.ibreaka1", ICLASS_xt_iclass_xsr_ibreaka1,
0,
Opcode_xsr_ibreaka1_encode_fns, 0, 0 },
- { "rsr.ibreakenable", 174 /* xt_iclass_rsr.ibreakenable */,
+ { "rsr.ibreakenable", ICLASS_xt_iclass_rsr_ibreakenable,
0,
Opcode_rsr_ibreakenable_encode_fns, 0, 0 },
- { "wsr.ibreakenable", 175 /* xt_iclass_wsr.ibreakenable */,
+ { "wsr.ibreakenable", ICLASS_xt_iclass_wsr_ibreakenable,
0,
Opcode_wsr_ibreakenable_encode_fns, 0, 0 },
- { "xsr.ibreakenable", 176 /* xt_iclass_xsr.ibreakenable */,
+ { "xsr.ibreakenable", ICLASS_xt_iclass_xsr_ibreakenable,
0,
Opcode_xsr_ibreakenable_encode_fns, 0, 0 },
- { "rsr.debugcause", 177 /* xt_iclass_rsr.debugcause */,
+ { "rsr.debugcause", ICLASS_xt_iclass_rsr_debugcause,
0,
Opcode_rsr_debugcause_encode_fns, 0, 0 },
- { "wsr.debugcause", 178 /* xt_iclass_wsr.debugcause */,
+ { "wsr.debugcause", ICLASS_xt_iclass_wsr_debugcause,
0,
Opcode_wsr_debugcause_encode_fns, 0, 0 },
- { "xsr.debugcause", 179 /* xt_iclass_xsr.debugcause */,
+ { "xsr.debugcause", ICLASS_xt_iclass_xsr_debugcause,
0,
Opcode_xsr_debugcause_encode_fns, 0, 0 },
- { "rsr.icount", 180 /* xt_iclass_rsr.icount */,
+ { "rsr.icount", ICLASS_xt_iclass_rsr_icount,
0,
Opcode_rsr_icount_encode_fns, 0, 0 },
- { "wsr.icount", 181 /* xt_iclass_wsr.icount */,
+ { "wsr.icount", ICLASS_xt_iclass_wsr_icount,
0,
Opcode_wsr_icount_encode_fns, 0, 0 },
- { "xsr.icount", 182 /* xt_iclass_xsr.icount */,
+ { "xsr.icount", ICLASS_xt_iclass_xsr_icount,
0,
Opcode_xsr_icount_encode_fns, 0, 0 },
- { "rsr.icountlevel", 183 /* xt_iclass_rsr.icountlevel */,
+ { "rsr.icountlevel", ICLASS_xt_iclass_rsr_icountlevel,
0,
Opcode_rsr_icountlevel_encode_fns, 0, 0 },
- { "wsr.icountlevel", 184 /* xt_iclass_wsr.icountlevel */,
+ { "wsr.icountlevel", ICLASS_xt_iclass_wsr_icountlevel,
0,
Opcode_wsr_icountlevel_encode_fns, 0, 0 },
- { "xsr.icountlevel", 185 /* xt_iclass_xsr.icountlevel */,
+ { "xsr.icountlevel", ICLASS_xt_iclass_xsr_icountlevel,
0,
Opcode_xsr_icountlevel_encode_fns, 0, 0 },
- { "rsr.ddr", 186 /* xt_iclass_rsr.ddr */,
+ { "rsr.ddr", ICLASS_xt_iclass_rsr_ddr,
0,
Opcode_rsr_ddr_encode_fns, 0, 0 },
- { "wsr.ddr", 187 /* xt_iclass_wsr.ddr */,
+ { "wsr.ddr", ICLASS_xt_iclass_wsr_ddr,
0,
Opcode_wsr_ddr_encode_fns, 0, 0 },
- { "xsr.ddr", 188 /* xt_iclass_xsr.ddr */,
+ { "xsr.ddr", ICLASS_xt_iclass_xsr_ddr,
0,
Opcode_xsr_ddr_encode_fns, 0, 0 },
- { "rfdo", 189 /* xt_iclass_rfdo */,
+ { "rfdo", ICLASS_xt_iclass_rfdo,
XTENSA_OPCODE_IS_JUMP,
Opcode_rfdo_encode_fns, 0, 0 },
- { "rfdd", 190 /* xt_iclass_rfdd */,
+ { "rfdd", ICLASS_xt_iclass_rfdd,
XTENSA_OPCODE_IS_JUMP,
Opcode_rfdd_encode_fns, 0, 0 },
- { "rsr.ccount", 191 /* xt_iclass_rsr.ccount */,
+ { "wsr.mmid", ICLASS_xt_iclass_wsr_mmid,
+ 0,
+ Opcode_wsr_mmid_encode_fns, 0, 0 },
+ { "rsr.ccount", ICLASS_xt_iclass_rsr_ccount,
0,
Opcode_rsr_ccount_encode_fns, 0, 0 },
- { "wsr.ccount", 192 /* xt_iclass_wsr.ccount */,
+ { "wsr.ccount", ICLASS_xt_iclass_wsr_ccount,
0,
Opcode_wsr_ccount_encode_fns, 0, 0 },
- { "xsr.ccount", 193 /* xt_iclass_xsr.ccount */,
+ { "xsr.ccount", ICLASS_xt_iclass_xsr_ccount,
0,
Opcode_xsr_ccount_encode_fns, 0, 0 },
- { "rsr.ccompare0", 194 /* xt_iclass_rsr.ccompare0 */,
+ { "rsr.ccompare0", ICLASS_xt_iclass_rsr_ccompare0,
0,
Opcode_rsr_ccompare0_encode_fns, 0, 0 },
- { "wsr.ccompare0", 195 /* xt_iclass_wsr.ccompare0 */,
+ { "wsr.ccompare0", ICLASS_xt_iclass_wsr_ccompare0,
0,
Opcode_wsr_ccompare0_encode_fns, 0, 0 },
- { "xsr.ccompare0", 196 /* xt_iclass_xsr.ccompare0 */,
+ { "xsr.ccompare0", ICLASS_xt_iclass_xsr_ccompare0,
0,
Opcode_xsr_ccompare0_encode_fns, 0, 0 },
- { "rsr.ccompare1", 197 /* xt_iclass_rsr.ccompare1 */,
+ { "rsr.ccompare1", ICLASS_xt_iclass_rsr_ccompare1,
0,
Opcode_rsr_ccompare1_encode_fns, 0, 0 },
- { "wsr.ccompare1", 198 /* xt_iclass_wsr.ccompare1 */,
+ { "wsr.ccompare1", ICLASS_xt_iclass_wsr_ccompare1,
0,
Opcode_wsr_ccompare1_encode_fns, 0, 0 },
- { "xsr.ccompare1", 199 /* xt_iclass_xsr.ccompare1 */,
+ { "xsr.ccompare1", ICLASS_xt_iclass_xsr_ccompare1,
0,
Opcode_xsr_ccompare1_encode_fns, 0, 0 },
- { "rsr.ccompare2", 200 /* xt_iclass_rsr.ccompare2 */,
+ { "rsr.ccompare2", ICLASS_xt_iclass_rsr_ccompare2,
0,
Opcode_rsr_ccompare2_encode_fns, 0, 0 },
- { "wsr.ccompare2", 201 /* xt_iclass_wsr.ccompare2 */,
+ { "wsr.ccompare2", ICLASS_xt_iclass_wsr_ccompare2,
0,
Opcode_wsr_ccompare2_encode_fns, 0, 0 },
- { "xsr.ccompare2", 202 /* xt_iclass_xsr.ccompare2 */,
+ { "xsr.ccompare2", ICLASS_xt_iclass_xsr_ccompare2,
0,
Opcode_xsr_ccompare2_encode_fns, 0, 0 },
- { "ipf", 203 /* xt_iclass_icache */,
+ { "ipf", ICLASS_xt_iclass_icache,
0,
Opcode_ipf_encode_fns, 0, 0 },
- { "ihi", 203 /* xt_iclass_icache */,
+ { "ihi", ICLASS_xt_iclass_icache,
0,
Opcode_ihi_encode_fns, 0, 0 },
- { "iii", 204 /* xt_iclass_icache_inv */,
+ { "ipfl", ICLASS_xt_iclass_icache_lock,
+ 0,
+ Opcode_ipfl_encode_fns, 0, 0 },
+ { "ihu", ICLASS_xt_iclass_icache_lock,
+ 0,
+ Opcode_ihu_encode_fns, 0, 0 },
+ { "iiu", ICLASS_xt_iclass_icache_lock,
+ 0,
+ Opcode_iiu_encode_fns, 0, 0 },
+ { "iii", ICLASS_xt_iclass_icache_inv,
0,
Opcode_iii_encode_fns, 0, 0 },
- { "lict", 205 /* xt_iclass_licx */,
+ { "lict", ICLASS_xt_iclass_licx,
0,
Opcode_lict_encode_fns, 0, 0 },
- { "licw", 205 /* xt_iclass_licx */,
+ { "licw", ICLASS_xt_iclass_licx,
0,
Opcode_licw_encode_fns, 0, 0 },
- { "sict", 206 /* xt_iclass_sicx */,
+ { "sict", ICLASS_xt_iclass_sicx,
0,
Opcode_sict_encode_fns, 0, 0 },
- { "sicw", 206 /* xt_iclass_sicx */,
+ { "sicw", ICLASS_xt_iclass_sicx,
0,
Opcode_sicw_encode_fns, 0, 0 },
- { "dhwb", 207 /* xt_iclass_dcache */,
+ { "dhwb", ICLASS_xt_iclass_dcache,
0,
Opcode_dhwb_encode_fns, 0, 0 },
- { "dhwbi", 207 /* xt_iclass_dcache */,
+ { "dhwbi", ICLASS_xt_iclass_dcache,
0,
Opcode_dhwbi_encode_fns, 0, 0 },
- { "diwb", 208 /* xt_iclass_dcache_ind */,
+ { "diwb", ICLASS_xt_iclass_dcache_ind,
0,
Opcode_diwb_encode_fns, 0, 0 },
- { "diwbi", 208 /* xt_iclass_dcache_ind */,
+ { "diwbi", ICLASS_xt_iclass_dcache_ind,
0,
Opcode_diwbi_encode_fns, 0, 0 },
- { "dhi", 209 /* xt_iclass_dcache_inv */,
+ { "dhi", ICLASS_xt_iclass_dcache_inv,
0,
Opcode_dhi_encode_fns, 0, 0 },
- { "dii", 209 /* xt_iclass_dcache_inv */,
+ { "dii", ICLASS_xt_iclass_dcache_inv,
0,
Opcode_dii_encode_fns, 0, 0 },
- { "dpfr", 210 /* xt_iclass_dpf */,
+ { "dpfr", ICLASS_xt_iclass_dpf,
0,
Opcode_dpfr_encode_fns, 0, 0 },
- { "dpfw", 210 /* xt_iclass_dpf */,
+ { "dpfw", ICLASS_xt_iclass_dpf,
0,
Opcode_dpfw_encode_fns, 0, 0 },
- { "dpfro", 210 /* xt_iclass_dpf */,
+ { "dpfro", ICLASS_xt_iclass_dpf,
0,
Opcode_dpfro_encode_fns, 0, 0 },
- { "dpfwo", 210 /* xt_iclass_dpf */,
+ { "dpfwo", ICLASS_xt_iclass_dpf,
0,
Opcode_dpfwo_encode_fns, 0, 0 },
- { "sdct", 211 /* xt_iclass_sdct */,
+ { "dpfl", ICLASS_xt_iclass_dcache_lock,
+ 0,
+ Opcode_dpfl_encode_fns, 0, 0 },
+ { "dhu", ICLASS_xt_iclass_dcache_lock,
+ 0,
+ Opcode_dhu_encode_fns, 0, 0 },
+ { "diu", ICLASS_xt_iclass_dcache_lock,
+ 0,
+ Opcode_diu_encode_fns, 0, 0 },
+ { "sdct", ICLASS_xt_iclass_sdct,
0,
Opcode_sdct_encode_fns, 0, 0 },
- { "ldct", 212 /* xt_iclass_ldct */,
+ { "ldct", ICLASS_xt_iclass_ldct,
0,
Opcode_ldct_encode_fns, 0, 0 },
- { "wsr.ptevaddr", 213 /* xt_iclass_wsr.ptevaddr */,
+ { "wsr.ptevaddr", ICLASS_xt_iclass_wsr_ptevaddr,
0,
Opcode_wsr_ptevaddr_encode_fns, 0, 0 },
- { "rsr.ptevaddr", 214 /* xt_iclass_rsr.ptevaddr */,
+ { "rsr.ptevaddr", ICLASS_xt_iclass_rsr_ptevaddr,
0,
Opcode_rsr_ptevaddr_encode_fns, 0, 0 },
- { "xsr.ptevaddr", 215 /* xt_iclass_xsr.ptevaddr */,
+ { "xsr.ptevaddr", ICLASS_xt_iclass_xsr_ptevaddr,
0,
Opcode_xsr_ptevaddr_encode_fns, 0, 0 },
- { "rsr.rasid", 216 /* xt_iclass_rsr.rasid */,
+ { "rsr.rasid", ICLASS_xt_iclass_rsr_rasid,
0,
Opcode_rsr_rasid_encode_fns, 0, 0 },
- { "wsr.rasid", 217 /* xt_iclass_wsr.rasid */,
+ { "wsr.rasid", ICLASS_xt_iclass_wsr_rasid,
0,
Opcode_wsr_rasid_encode_fns, 0, 0 },
- { "xsr.rasid", 218 /* xt_iclass_xsr.rasid */,
+ { "xsr.rasid", ICLASS_xt_iclass_xsr_rasid,
0,
Opcode_xsr_rasid_encode_fns, 0, 0 },
- { "rsr.itlbcfg", 219 /* xt_iclass_rsr.itlbcfg */,
+ { "rsr.itlbcfg", ICLASS_xt_iclass_rsr_itlbcfg,
0,
Opcode_rsr_itlbcfg_encode_fns, 0, 0 },
- { "wsr.itlbcfg", 220 /* xt_iclass_wsr.itlbcfg */,
+ { "wsr.itlbcfg", ICLASS_xt_iclass_wsr_itlbcfg,
0,
Opcode_wsr_itlbcfg_encode_fns, 0, 0 },
- { "xsr.itlbcfg", 221 /* xt_iclass_xsr.itlbcfg */,
+ { "xsr.itlbcfg", ICLASS_xt_iclass_xsr_itlbcfg,
0,
Opcode_xsr_itlbcfg_encode_fns, 0, 0 },
- { "rsr.dtlbcfg", 222 /* xt_iclass_rsr.dtlbcfg */,
+ { "rsr.dtlbcfg", ICLASS_xt_iclass_rsr_dtlbcfg,
0,
Opcode_rsr_dtlbcfg_encode_fns, 0, 0 },
- { "wsr.dtlbcfg", 223 /* xt_iclass_wsr.dtlbcfg */,
+ { "wsr.dtlbcfg", ICLASS_xt_iclass_wsr_dtlbcfg,
0,
Opcode_wsr_dtlbcfg_encode_fns, 0, 0 },
- { "xsr.dtlbcfg", 224 /* xt_iclass_xsr.dtlbcfg */,
+ { "xsr.dtlbcfg", ICLASS_xt_iclass_xsr_dtlbcfg,
0,
Opcode_xsr_dtlbcfg_encode_fns, 0, 0 },
- { "idtlb", 225 /* xt_iclass_idtlb */,
+ { "idtlb", ICLASS_xt_iclass_idtlb,
0,
Opcode_idtlb_encode_fns, 0, 0 },
- { "pdtlb", 226 /* xt_iclass_rdtlb */,
+ { "pdtlb", ICLASS_xt_iclass_rdtlb,
0,
Opcode_pdtlb_encode_fns, 0, 0 },
- { "rdtlb0", 226 /* xt_iclass_rdtlb */,
+ { "rdtlb0", ICLASS_xt_iclass_rdtlb,
0,
Opcode_rdtlb0_encode_fns, 0, 0 },
- { "rdtlb1", 226 /* xt_iclass_rdtlb */,
+ { "rdtlb1", ICLASS_xt_iclass_rdtlb,
0,
Opcode_rdtlb1_encode_fns, 0, 0 },
- { "wdtlb", 227 /* xt_iclass_wdtlb */,
+ { "wdtlb", ICLASS_xt_iclass_wdtlb,
0,
Opcode_wdtlb_encode_fns, 0, 0 },
- { "iitlb", 228 /* xt_iclass_iitlb */,
+ { "iitlb", ICLASS_xt_iclass_iitlb,
0,
Opcode_iitlb_encode_fns, 0, 0 },
- { "pitlb", 229 /* xt_iclass_ritlb */,
+ { "pitlb", ICLASS_xt_iclass_ritlb,
0,
Opcode_pitlb_encode_fns, 0, 0 },
- { "ritlb0", 229 /* xt_iclass_ritlb */,
+ { "ritlb0", ICLASS_xt_iclass_ritlb,
0,
Opcode_ritlb0_encode_fns, 0, 0 },
- { "ritlb1", 229 /* xt_iclass_ritlb */,
+ { "ritlb1", ICLASS_xt_iclass_ritlb,
0,
Opcode_ritlb1_encode_fns, 0, 0 },
- { "witlb", 230 /* xt_iclass_witlb */,
+ { "witlb", ICLASS_xt_iclass_witlb,
0,
Opcode_witlb_encode_fns, 0, 0 },
- { "ldpte", 231 /* xt_iclass_ldpte */,
+ { "ldpte", ICLASS_xt_iclass_ldpte,
0,
Opcode_ldpte_encode_fns, 0, 0 },
- { "hwwitlba", 232 /* xt_iclass_hwwitlba */,
+ { "hwwitlba", ICLASS_xt_iclass_hwwitlba,
XTENSA_OPCODE_IS_BRANCH,
Opcode_hwwitlba_encode_fns, 0, 0 },
- { "hwwdtlba", 233 /* xt_iclass_hwwdtlba */,
+ { "hwwdtlba", ICLASS_xt_iclass_hwwdtlba,
0,
Opcode_hwwdtlba_encode_fns, 0, 0 },
- { "nsa", 234 /* xt_iclass_nsa */,
+ { "rsr.cpenable", ICLASS_xt_iclass_rsr_cpenable,
0,
- Opcode_nsa_encode_fns, 0, 0 },
- { "nsau", 234 /* xt_iclass_nsa */,
+ Opcode_rsr_cpenable_encode_fns, 0, 0 },
+ { "wsr.cpenable", ICLASS_xt_iclass_wsr_cpenable,
+ 0,
+ Opcode_wsr_cpenable_encode_fns, 0, 0 },
+ { "xsr.cpenable", ICLASS_xt_iclass_xsr_cpenable,
+ 0,
+ Opcode_xsr_cpenable_encode_fns, 0, 0 },
+ { "clamps", ICLASS_xt_iclass_clamp,
+ 0,
+ Opcode_clamps_encode_fns, 0, 0 },
+ { "min", ICLASS_xt_iclass_minmax,
0,
- Opcode_nsau_encode_fns, 0, 0 }
+ Opcode_min_encode_fns, 0, 0 },
+ { "max", ICLASS_xt_iclass_minmax,
+ 0,
+ Opcode_max_encode_fns, 0, 0 },
+ { "minu", ICLASS_xt_iclass_minmax,
+ 0,
+ Opcode_minu_encode_fns, 0, 0 },
+ { "maxu", ICLASS_xt_iclass_minmax,
+ 0,
+ Opcode_maxu_encode_fns, 0, 0 },
+ { "nsa", ICLASS_xt_iclass_nsa,
+ 0,
+ Opcode_nsa_encode_fns, 0, 0 },
+ { "nsau", ICLASS_xt_iclass_nsa,
+ 0,
+ Opcode_nsau_encode_fns, 0, 0 },
+ { "sext", ICLASS_xt_iclass_sx,
+ 0,
+ Opcode_sext_encode_fns, 0, 0 },
+ { "l32ai", ICLASS_xt_iclass_l32ai,
+ 0,
+ Opcode_l32ai_encode_fns, 0, 0 },
+ { "s32ri", ICLASS_xt_iclass_s32ri,
+ 0,
+ Opcode_s32ri_encode_fns, 0, 0 },
+ { "s32c1i", ICLASS_xt_iclass_s32c1i,
+ 0,
+ Opcode_s32c1i_encode_fns, 0, 0 },
+ { "rsr.scompare1", ICLASS_xt_iclass_rsr_scompare1,
+ 0,
+ Opcode_rsr_scompare1_encode_fns, 0, 0 },
+ { "wsr.scompare1", ICLASS_xt_iclass_wsr_scompare1,
+ 0,
+ Opcode_wsr_scompare1_encode_fns, 0, 0 },
+ { "xsr.scompare1", ICLASS_xt_iclass_xsr_scompare1,
+ 0,
+ Opcode_xsr_scompare1_encode_fns, 0, 0 },
+ { "quou", ICLASS_xt_iclass_div,
+ 0,
+ Opcode_quou_encode_fns, 0, 0 },
+ { "quos", ICLASS_xt_iclass_div,
+ 0,
+ Opcode_quos_encode_fns, 0, 0 },
+ { "remu", ICLASS_xt_iclass_div,
+ 0,
+ Opcode_remu_encode_fns, 0, 0 },
+ { "rems", ICLASS_xt_iclass_div,
+ 0,
+ Opcode_rems_encode_fns, 0, 0 },
+ { "mull", ICLASS_xt_mul32,
+ 0,
+ Opcode_mull_encode_fns, 0, 0 }
+};
+
+enum xtensa_opcode_id {
+ OPCODE_EXCW,
+ OPCODE_RFE,
+ OPCODE_RFDE,
+ OPCODE_SYSCALL,
+ OPCODE_SIMCALL,
+ OPCODE_CALL12,
+ OPCODE_CALL8,
+ OPCODE_CALL4,
+ OPCODE_CALLX12,
+ OPCODE_CALLX8,
+ OPCODE_CALLX4,
+ OPCODE_ENTRY,
+ OPCODE_MOVSP,
+ OPCODE_ROTW,
+ OPCODE_RETW,
+ OPCODE_RETW_N,
+ OPCODE_RFWO,
+ OPCODE_RFWU,
+ OPCODE_L32E,
+ OPCODE_S32E,
+ OPCODE_RSR_WINDOWBASE,
+ OPCODE_WSR_WINDOWBASE,
+ OPCODE_XSR_WINDOWBASE,
+ OPCODE_RSR_WINDOWSTART,
+ OPCODE_WSR_WINDOWSTART,
+ OPCODE_XSR_WINDOWSTART,
+ OPCODE_ADD_N,
+ OPCODE_ADDI_N,
+ OPCODE_BEQZ_N,
+ OPCODE_BNEZ_N,
+ OPCODE_ILL_N,
+ OPCODE_L32I_N,
+ OPCODE_MOV_N,
+ OPCODE_MOVI_N,
+ OPCODE_NOP_N,
+ OPCODE_RET_N,
+ OPCODE_S32I_N,
+ OPCODE_RUR_THREADPTR,
+ OPCODE_WUR_THREADPTR,
+ OPCODE_ADDI,
+ OPCODE_ADDMI,
+ OPCODE_ADD,
+ OPCODE_SUB,
+ OPCODE_ADDX2,
+ OPCODE_ADDX4,
+ OPCODE_ADDX8,
+ OPCODE_SUBX2,
+ OPCODE_SUBX4,
+ OPCODE_SUBX8,
+ OPCODE_AND,
+ OPCODE_OR,
+ OPCODE_XOR,
+ OPCODE_BEQI,
+ OPCODE_BNEI,
+ OPCODE_BGEI,
+ OPCODE_BLTI,
+ OPCODE_BBCI,
+ OPCODE_BBSI,
+ OPCODE_BGEUI,
+ OPCODE_BLTUI,
+ OPCODE_BEQ,
+ OPCODE_BNE,
+ OPCODE_BGE,
+ OPCODE_BLT,
+ OPCODE_BGEU,
+ OPCODE_BLTU,
+ OPCODE_BANY,
+ OPCODE_BNONE,
+ OPCODE_BALL,
+ OPCODE_BNALL,
+ OPCODE_BBC,
+ OPCODE_BBS,
+ OPCODE_BEQZ,
+ OPCODE_BNEZ,
+ OPCODE_BGEZ,
+ OPCODE_BLTZ,
+ OPCODE_CALL0,
+ OPCODE_CALLX0,
+ OPCODE_EXTUI,
+ OPCODE_ILL,
+ OPCODE_J,
+ OPCODE_JX,
+ OPCODE_L16UI,
+ OPCODE_L16SI,
+ OPCODE_L32I,
+ OPCODE_L32R,
+ OPCODE_L8UI,
+ OPCODE_LOOP,
+ OPCODE_LOOPNEZ,
+ OPCODE_LOOPGTZ,
+ OPCODE_MOVI,
+ OPCODE_MOVEQZ,
+ OPCODE_MOVNEZ,
+ OPCODE_MOVLTZ,
+ OPCODE_MOVGEZ,
+ OPCODE_NEG,
+ OPCODE_ABS,
+ OPCODE_NOP,
+ OPCODE_RET,
+ OPCODE_S16I,
+ OPCODE_S32I,
+ OPCODE_S8I,
+ OPCODE_SSR,
+ OPCODE_SSL,
+ OPCODE_SSA8L,
+ OPCODE_SSA8B,
+ OPCODE_SSAI,
+ OPCODE_SLL,
+ OPCODE_SRC,
+ OPCODE_SRL,
+ OPCODE_SRA,
+ OPCODE_SLLI,
+ OPCODE_SRAI,
+ OPCODE_SRLI,
+ OPCODE_MEMW,
+ OPCODE_EXTW,
+ OPCODE_ISYNC,
+ OPCODE_RSYNC,
+ OPCODE_ESYNC,
+ OPCODE_DSYNC,
+ OPCODE_RSIL,
+ OPCODE_RSR_LEND,
+ OPCODE_WSR_LEND,
+ OPCODE_XSR_LEND,
+ OPCODE_RSR_LCOUNT,
+ OPCODE_WSR_LCOUNT,
+ OPCODE_XSR_LCOUNT,
+ OPCODE_RSR_LBEG,
+ OPCODE_WSR_LBEG,
+ OPCODE_XSR_LBEG,
+ OPCODE_RSR_SAR,
+ OPCODE_WSR_SAR,
+ OPCODE_XSR_SAR,
+ OPCODE_RSR_LITBASE,
+ OPCODE_WSR_LITBASE,
+ OPCODE_XSR_LITBASE,
+ OPCODE_RSR_176,
+ OPCODE_WSR_176,
+ OPCODE_RSR_208,
+ OPCODE_RSR_PS,
+ OPCODE_WSR_PS,
+ OPCODE_XSR_PS,
+ OPCODE_RSR_EPC1,
+ OPCODE_WSR_EPC1,
+ OPCODE_XSR_EPC1,
+ OPCODE_RSR_EXCSAVE1,
+ OPCODE_WSR_EXCSAVE1,
+ OPCODE_XSR_EXCSAVE1,
+ OPCODE_RSR_EPC2,
+ OPCODE_WSR_EPC2,
+ OPCODE_XSR_EPC2,
+ OPCODE_RSR_EXCSAVE2,
+ OPCODE_WSR_EXCSAVE2,
+ OPCODE_XSR_EXCSAVE2,
+ OPCODE_RSR_EPC3,
+ OPCODE_WSR_EPC3,
+ OPCODE_XSR_EPC3,
+ OPCODE_RSR_EXCSAVE3,
+ OPCODE_WSR_EXCSAVE3,
+ OPCODE_XSR_EXCSAVE3,
+ OPCODE_RSR_EPC4,
+ OPCODE_WSR_EPC4,
+ OPCODE_XSR_EPC4,
+ OPCODE_RSR_EXCSAVE4,
+ OPCODE_WSR_EXCSAVE4,
+ OPCODE_XSR_EXCSAVE4,
+ OPCODE_RSR_EPC5,
+ OPCODE_WSR_EPC5,
+ OPCODE_XSR_EPC5,
+ OPCODE_RSR_EXCSAVE5,
+ OPCODE_WSR_EXCSAVE5,
+ OPCODE_XSR_EXCSAVE5,
+ OPCODE_RSR_EPC6,
+ OPCODE_WSR_EPC6,
+ OPCODE_XSR_EPC6,
+ OPCODE_RSR_EXCSAVE6,
+ OPCODE_WSR_EXCSAVE6,
+ OPCODE_XSR_EXCSAVE6,
+ OPCODE_RSR_EPC7,
+ OPCODE_WSR_EPC7,
+ OPCODE_XSR_EPC7,
+ OPCODE_RSR_EXCSAVE7,
+ OPCODE_WSR_EXCSAVE7,
+ OPCODE_XSR_EXCSAVE7,
+ OPCODE_RSR_EPS2,
+ OPCODE_WSR_EPS2,
+ OPCODE_XSR_EPS2,
+ OPCODE_RSR_EPS3,
+ OPCODE_WSR_EPS3,
+ OPCODE_XSR_EPS3,
+ OPCODE_RSR_EPS4,
+ OPCODE_WSR_EPS4,
+ OPCODE_XSR_EPS4,
+ OPCODE_RSR_EPS5,
+ OPCODE_WSR_EPS5,
+ OPCODE_XSR_EPS5,
+ OPCODE_RSR_EPS6,
+ OPCODE_WSR_EPS6,
+ OPCODE_XSR_EPS6,
+ OPCODE_RSR_EPS7,
+ OPCODE_WSR_EPS7,
+ OPCODE_XSR_EPS7,
+ OPCODE_RSR_EXCVADDR,
+ OPCODE_WSR_EXCVADDR,
+ OPCODE_XSR_EXCVADDR,
+ OPCODE_RSR_DEPC,
+ OPCODE_WSR_DEPC,
+ OPCODE_XSR_DEPC,
+ OPCODE_RSR_EXCCAUSE,
+ OPCODE_WSR_EXCCAUSE,
+ OPCODE_XSR_EXCCAUSE,
+ OPCODE_RSR_MISC0,
+ OPCODE_WSR_MISC0,
+ OPCODE_XSR_MISC0,
+ OPCODE_RSR_MISC1,
+ OPCODE_WSR_MISC1,
+ OPCODE_XSR_MISC1,
+ OPCODE_RSR_PRID,
+ OPCODE_RSR_VECBASE,
+ OPCODE_WSR_VECBASE,
+ OPCODE_XSR_VECBASE,
+ OPCODE_MUL16U,
+ OPCODE_MUL16S,
+ OPCODE_RFI,
+ OPCODE_WAITI,
+ OPCODE_RSR_INTERRUPT,
+ OPCODE_WSR_INTSET,
+ OPCODE_WSR_INTCLEAR,
+ OPCODE_RSR_INTENABLE,
+ OPCODE_WSR_INTENABLE,
+ OPCODE_XSR_INTENABLE,
+ OPCODE_BREAK,
+ OPCODE_BREAK_N,
+ OPCODE_RSR_DBREAKA0,
+ OPCODE_WSR_DBREAKA0,
+ OPCODE_XSR_DBREAKA0,
+ OPCODE_RSR_DBREAKC0,
+ OPCODE_WSR_DBREAKC0,
+ OPCODE_XSR_DBREAKC0,
+ OPCODE_RSR_DBREAKA1,
+ OPCODE_WSR_DBREAKA1,
+ OPCODE_XSR_DBREAKA1,
+ OPCODE_RSR_DBREAKC1,
+ OPCODE_WSR_DBREAKC1,
+ OPCODE_XSR_DBREAKC1,
+ OPCODE_RSR_IBREAKA0,
+ OPCODE_WSR_IBREAKA0,
+ OPCODE_XSR_IBREAKA0,
+ OPCODE_RSR_IBREAKA1,
+ OPCODE_WSR_IBREAKA1,
+ OPCODE_XSR_IBREAKA1,
+ OPCODE_RSR_IBREAKENABLE,
+ OPCODE_WSR_IBREAKENABLE,
+ OPCODE_XSR_IBREAKENABLE,
+ OPCODE_RSR_DEBUGCAUSE,
+ OPCODE_WSR_DEBUGCAUSE,
+ OPCODE_XSR_DEBUGCAUSE,
+ OPCODE_RSR_ICOUNT,
+ OPCODE_WSR_ICOUNT,
+ OPCODE_XSR_ICOUNT,
+ OPCODE_RSR_ICOUNTLEVEL,
+ OPCODE_WSR_ICOUNTLEVEL,
+ OPCODE_XSR_ICOUNTLEVEL,
+ OPCODE_RSR_DDR,
+ OPCODE_WSR_DDR,
+ OPCODE_XSR_DDR,
+ OPCODE_RFDO,
+ OPCODE_RFDD,
+ OPCODE_WSR_MMID,
+ OPCODE_RSR_CCOUNT,
+ OPCODE_WSR_CCOUNT,
+ OPCODE_XSR_CCOUNT,
+ OPCODE_RSR_CCOMPARE0,
+ OPCODE_WSR_CCOMPARE0,
+ OPCODE_XSR_CCOMPARE0,
+ OPCODE_RSR_CCOMPARE1,
+ OPCODE_WSR_CCOMPARE1,
+ OPCODE_XSR_CCOMPARE1,
+ OPCODE_RSR_CCOMPARE2,
+ OPCODE_WSR_CCOMPARE2,
+ OPCODE_XSR_CCOMPARE2,
+ OPCODE_IPF,
+ OPCODE_IHI,
+ OPCODE_IPFL,
+ OPCODE_IHU,
+ OPCODE_IIU,
+ OPCODE_III,
+ OPCODE_LICT,
+ OPCODE_LICW,
+ OPCODE_SICT,
+ OPCODE_SICW,
+ OPCODE_DHWB,
+ OPCODE_DHWBI,
+ OPCODE_DIWB,
+ OPCODE_DIWBI,
+ OPCODE_DHI,
+ OPCODE_DII,
+ OPCODE_DPFR,
+ OPCODE_DPFW,
+ OPCODE_DPFRO,
+ OPCODE_DPFWO,
+ OPCODE_DPFL,
+ OPCODE_DHU,
+ OPCODE_DIU,
+ OPCODE_SDCT,
+ OPCODE_LDCT,
+ OPCODE_WSR_PTEVADDR,
+ OPCODE_RSR_PTEVADDR,
+ OPCODE_XSR_PTEVADDR,
+ OPCODE_RSR_RASID,
+ OPCODE_WSR_RASID,
+ OPCODE_XSR_RASID,
+ OPCODE_RSR_ITLBCFG,
+ OPCODE_WSR_ITLBCFG,
+ OPCODE_XSR_ITLBCFG,
+ OPCODE_RSR_DTLBCFG,
+ OPCODE_WSR_DTLBCFG,
+ OPCODE_XSR_DTLBCFG,
+ OPCODE_IDTLB,
+ OPCODE_PDTLB,
+ OPCODE_RDTLB0,
+ OPCODE_RDTLB1,
+ OPCODE_WDTLB,
+ OPCODE_IITLB,
+ OPCODE_PITLB,
+ OPCODE_RITLB0,
+ OPCODE_RITLB1,
+ OPCODE_WITLB,
+ OPCODE_LDPTE,
+ OPCODE_HWWITLBA,
+ OPCODE_HWWDTLBA,
+ OPCODE_RSR_CPENABLE,
+ OPCODE_WSR_CPENABLE,
+ OPCODE_XSR_CPENABLE,
+ OPCODE_CLAMPS,
+ OPCODE_MIN,
+ OPCODE_MAX,
+ OPCODE_MINU,
+ OPCODE_MAXU,
+ OPCODE_NSA,
+ OPCODE_NSAU,
+ OPCODE_SEXT,
+ OPCODE_L32AI,
+ OPCODE_S32RI,
+ OPCODE_S32C1I,
+ OPCODE_RSR_SCOMPARE1,
+ OPCODE_WSR_SCOMPARE1,
+ OPCODE_XSR_SCOMPARE1,
+ OPCODE_QUOU,
+ OPCODE_QUOS,
+ OPCODE_REMU,
+ OPCODE_REMS,
+ OPCODE_MULL
};
@@ -8625,57 +10955,57 @@ Slot_inst_decode (const xtensa_insnbuf insn)
case 0:
if (Field_s_Slot_inst_get (insn) == 0 &&
Field_n_Slot_inst_get (insn) == 0)
- return 77; /* ill */
+ return OPCODE_ILL;
break;
case 2:
switch (Field_n_Slot_inst_get (insn))
{
case 0:
- return 96; /* ret */
+ return OPCODE_RET;
case 1:
- return 14; /* retw */
+ return OPCODE_RETW;
case 2:
- return 79; /* jx */
+ return OPCODE_JX;
}
break;
case 3:
switch (Field_n_Slot_inst_get (insn))
{
case 0:
- return 75; /* callx0 */
+ return OPCODE_CALLX0;
case 1:
- return 10; /* callx4 */
+ return OPCODE_CALLX4;
case 2:
- return 9; /* callx8 */
+ return OPCODE_CALLX8;
case 3:
- return 8; /* callx12 */
+ return OPCODE_CALLX12;
}
break;
}
break;
case 1:
- return 12; /* movsp */
+ return OPCODE_MOVSP;
case 2:
if (Field_s_Slot_inst_get (insn) == 0)
{
switch (Field_t_Slot_inst_get (insn))
{
case 0:
- return 114; /* isync */
+ return OPCODE_ISYNC;
case 1:
- return 115; /* rsync */
+ return OPCODE_RSYNC;
case 2:
- return 116; /* esync */
+ return OPCODE_ESYNC;
case 3:
- return 117; /* dsync */
+ return OPCODE_DSYNC;
case 8:
- return 0; /* excw */
+ return OPCODE_EXCW;
case 12:
- return 112; /* memw */
+ return OPCODE_MEMW;
case 13:
- return 113; /* extw */
+ return OPCODE_EXTW;
case 15:
- return 95; /* nop */
+ return OPCODE_NOP;
}
}
break;
@@ -8686,139 +11016,139 @@ Slot_inst_decode (const xtensa_insnbuf insn)
switch (Field_s_Slot_inst_get (insn))
{
case 0:
- return 1; /* rfe */
+ return OPCODE_RFE;
case 2:
- return 2; /* rfde */
+ return OPCODE_RFDE;
case 4:
- return 16; /* rfwo */
+ return OPCODE_RFWO;
case 5:
- return 17; /* rfwu */
+ return OPCODE_RFWU;
}
break;
case 1:
- return 188; /* rfi */
+ return OPCODE_RFI;
}
break;
case 4:
- return 196; /* break */
+ return OPCODE_BREAK;
case 5:
switch (Field_s_Slot_inst_get (insn))
{
case 0:
if (Field_t_Slot_inst_get (insn) == 0)
- return 3; /* syscall */
+ return OPCODE_SYSCALL;
break;
case 1:
if (Field_t_Slot_inst_get (insn) == 0)
- return 4; /* simcall */
+ return OPCODE_SIMCALL;
break;
}
break;
case 6:
- return 118; /* rsil */
+ return OPCODE_RSIL;
case 7:
if (Field_t_Slot_inst_get (insn) == 0)
- return 189; /* waiti */
+ return OPCODE_WAITI;
break;
}
break;
case 1:
- return 47; /* and */
+ return OPCODE_AND;
case 2:
- return 48; /* or */
+ return OPCODE_OR;
case 3:
- return 49; /* xor */
+ return OPCODE_XOR;
case 4:
switch (Field_r_Slot_inst_get (insn))
{
case 0:
if (Field_t_Slot_inst_get (insn) == 0)
- return 100; /* ssr */
+ return OPCODE_SSR;
break;
case 1:
if (Field_t_Slot_inst_get (insn) == 0)
- return 101; /* ssl */
+ return OPCODE_SSL;
break;
case 2:
if (Field_t_Slot_inst_get (insn) == 0)
- return 102; /* ssa8l */
+ return OPCODE_SSA8L;
break;
case 3:
if (Field_t_Slot_inst_get (insn) == 0)
- return 103; /* ssa8b */
+ return OPCODE_SSA8B;
break;
case 4:
if (Field_thi3_Slot_inst_get (insn) == 0)
- return 104; /* ssai */
+ return OPCODE_SSAI;
break;
case 8:
if (Field_s_Slot_inst_get (insn) == 0)
- return 13; /* rotw */
+ return OPCODE_ROTW;
break;
case 14:
- return 289; /* nsa */
+ return OPCODE_NSA;
case 15:
- return 290; /* nsau */
+ return OPCODE_NSAU;
}
break;
case 5:
switch (Field_r_Slot_inst_get (insn))
{
case 1:
- return 287; /* hwwitlba */
+ return OPCODE_HWWITLBA;
case 3:
- return 283; /* ritlb0 */
+ return OPCODE_RITLB0;
case 4:
if (Field_t_Slot_inst_get (insn) == 0)
- return 281; /* iitlb */
+ return OPCODE_IITLB;
break;
case 5:
- return 282; /* pitlb */
+ return OPCODE_PITLB;
case 6:
- return 285; /* witlb */
+ return OPCODE_WITLB;
case 7:
- return 284; /* ritlb1 */
+ return OPCODE_RITLB1;
case 9:
- return 288; /* hwwdtlba */
+ return OPCODE_HWWDTLBA;
case 11:
- return 278; /* rdtlb0 */
+ return OPCODE_RDTLB0;
case 12:
if (Field_t_Slot_inst_get (insn) == 0)
- return 276; /* idtlb */
+ return OPCODE_IDTLB;
break;
case 13:
- return 277; /* pdtlb */
+ return OPCODE_PDTLB;
case 14:
- return 280; /* wdtlb */
+ return OPCODE_WDTLB;
case 15:
- return 279; /* rdtlb1 */
+ return OPCODE_RDTLB1;
}
break;
case 6:
switch (Field_s_Slot_inst_get (insn))
{
case 0:
- return 93; /* neg */
+ return OPCODE_NEG;
case 1:
- return 94; /* abs */
+ return OPCODE_ABS;
}
break;
case 8:
- return 39; /* add */
+ return OPCODE_ADD;
case 9:
- return 41; /* addx2 */
+ return OPCODE_ADDX2;
case 10:
- return 42; /* addx4 */
+ return OPCODE_ADDX4;
case 11:
- return 43; /* addx8 */
+ return OPCODE_ADDX8;
case 12:
- return 40; /* sub */
+ return OPCODE_SUB;
case 13:
- return 44; /* subx2 */
+ return OPCODE_SUBX2;
case 14:
- return 45; /* subx4 */
+ return OPCODE_SUBX4;
case 15:
- return 46; /* subx8 */
+ return OPCODE_SUBX8;
}
break;
case 1:
@@ -8826,148 +11156,189 @@ Slot_inst_decode (const xtensa_insnbuf insn)
{
case 0:
case 1:
- return 109; /* slli */
+ return OPCODE_SLLI;
case 2:
case 3:
- return 110; /* srai */
+ return OPCODE_SRAI;
case 4:
- return 111; /* srli */
+ return OPCODE_SRLI;
case 6:
switch (Field_sr_Slot_inst_get (insn))
{
case 0:
- return 127; /* xsr.lbeg */
+ return OPCODE_XSR_LBEG;
case 1:
- return 121; /* xsr.lend */
+ return OPCODE_XSR_LEND;
case 2:
- return 124; /* xsr.lcount */
+ return OPCODE_XSR_LCOUNT;
case 3:
- return 130; /* xsr.sar */
+ return OPCODE_XSR_SAR;
case 5:
- return 133; /* xsr.litbase */
+ return OPCODE_XSR_LITBASE;
+ case 12:
+ return OPCODE_XSR_SCOMPARE1;
case 72:
- return 22; /* xsr.windowbase */
+ return OPCODE_XSR_WINDOWBASE;
case 73:
- return 25; /* xsr.windowstart */
+ return OPCODE_XSR_WINDOWSTART;
case 83:
- return 266; /* xsr.ptevaddr */
+ return OPCODE_XSR_PTEVADDR;
case 90:
- return 269; /* xsr.rasid */
+ return OPCODE_XSR_RASID;
case 91:
- return 272; /* xsr.itlbcfg */
+ return OPCODE_XSR_ITLBCFG;
case 92:
- return 275; /* xsr.dtlbcfg */
+ return OPCODE_XSR_DTLBCFG;
case 96:
- return 218; /* xsr.ibreakenable */
+ return OPCODE_XSR_IBREAKENABLE;
case 104:
- return 230; /* xsr.ddr */
+ return OPCODE_XSR_DDR;
case 128:
- return 212; /* xsr.ibreaka0 */
+ return OPCODE_XSR_IBREAKA0;
case 129:
- return 215; /* xsr.ibreaka1 */
+ return OPCODE_XSR_IBREAKA1;
case 144:
- return 200; /* xsr.dbreaka0 */
+ return OPCODE_XSR_DBREAKA0;
case 145:
- return 206; /* xsr.dbreaka1 */
+ return OPCODE_XSR_DBREAKA1;
case 160:
- return 203; /* xsr.dbreakc0 */
+ return OPCODE_XSR_DBREAKC0;
case 161:
- return 209; /* xsr.dbreakc1 */
+ return OPCODE_XSR_DBREAKC1;
case 177:
- return 141; /* xsr.epc1 */
+ return OPCODE_XSR_EPC1;
case 178:
- return 147; /* xsr.epc2 */
+ return OPCODE_XSR_EPC2;
case 179:
- return 153; /* xsr.epc3 */
+ return OPCODE_XSR_EPC3;
case 180:
- return 159; /* xsr.epc4 */
+ return OPCODE_XSR_EPC4;
+ case 181:
+ return OPCODE_XSR_EPC5;
+ case 182:
+ return OPCODE_XSR_EPC6;
+ case 183:
+ return OPCODE_XSR_EPC7;
case 192:
- return 177; /* xsr.depc */
+ return OPCODE_XSR_DEPC;
case 194:
- return 165; /* xsr.eps2 */
+ return OPCODE_XSR_EPS2;
case 195:
- return 168; /* xsr.eps3 */
+ return OPCODE_XSR_EPS3;
case 196:
- return 171; /* xsr.eps4 */
+ return OPCODE_XSR_EPS4;
+ case 197:
+ return OPCODE_XSR_EPS5;
+ case 198:
+ return OPCODE_XSR_EPS6;
+ case 199:
+ return OPCODE_XSR_EPS7;
case 209:
- return 144; /* xsr.excsave1 */
+ return OPCODE_XSR_EXCSAVE1;
case 210:
- return 150; /* xsr.excsave2 */
+ return OPCODE_XSR_EXCSAVE2;
case 211:
- return 156; /* xsr.excsave3 */
+ return OPCODE_XSR_EXCSAVE3;
case 212:
- return 162; /* xsr.excsave4 */
+ return OPCODE_XSR_EXCSAVE4;
+ case 213:
+ return OPCODE_XSR_EXCSAVE5;
+ case 214:
+ return OPCODE_XSR_EXCSAVE6;
+ case 215:
+ return OPCODE_XSR_EXCSAVE7;
+ case 224:
+ return OPCODE_XSR_CPENABLE;
case 228:
- return 195; /* xsr.intenable */
+ return OPCODE_XSR_INTENABLE;
case 230:
- return 138; /* xsr.ps */
+ return OPCODE_XSR_PS;
+ case 231:
+ return OPCODE_XSR_VECBASE;
case 232:
- return 180; /* xsr.exccause */
+ return OPCODE_XSR_EXCCAUSE;
case 233:
- return 221; /* xsr.debugcause */
+ return OPCODE_XSR_DEBUGCAUSE;
case 234:
- return 235; /* xsr.ccount */
+ return OPCODE_XSR_CCOUNT;
case 236:
- return 224; /* xsr.icount */
+ return OPCODE_XSR_ICOUNT;
case 237:
- return 227; /* xsr.icountlevel */
+ return OPCODE_XSR_ICOUNTLEVEL;
case 238:
- return 174; /* xsr.excvaddr */
+ return OPCODE_XSR_EXCVADDR;
case 240:
- return 238; /* xsr.ccompare0 */
+ return OPCODE_XSR_CCOMPARE0;
case 241:
- return 241; /* xsr.ccompare1 */
+ return OPCODE_XSR_CCOMPARE1;
case 242:
- return 244; /* xsr.ccompare2 */
+ return OPCODE_XSR_CCOMPARE2;
case 244:
- return 183; /* xsr.misc0 */
+ return OPCODE_XSR_MISC0;
case 245:
- return 186; /* xsr.misc1 */
+ return OPCODE_XSR_MISC1;
}
break;
case 8:
- return 106; /* src */
+ return OPCODE_SRC;
case 9:
if (Field_s_Slot_inst_get (insn) == 0)
- return 107; /* srl */
+ return OPCODE_SRL;
break;
case 10:
if (Field_t_Slot_inst_get (insn) == 0)
- return 105; /* sll */
+ return OPCODE_SLL;
break;
case 11:
if (Field_s_Slot_inst_get (insn) == 0)
- return 108; /* sra */
+ return OPCODE_SRA;
break;
+ case 12:
+ return OPCODE_MUL16U;
+ case 13:
+ return OPCODE_MUL16S;
case 15:
switch (Field_r_Slot_inst_get (insn))
{
case 0:
- return 248; /* lict */
+ return OPCODE_LICT;
case 1:
- return 250; /* sict */
+ return OPCODE_SICT;
case 2:
- return 249; /* licw */
+ return OPCODE_LICW;
case 3:
- return 251; /* sicw */
+ return OPCODE_SICW;
case 8:
- return 263; /* ldct */
+ return OPCODE_LDCT;
case 9:
- return 262; /* sdct */
+ return OPCODE_SDCT;
case 14:
- if (Field_t_Slot_inst_get (insn) == 0 &&
- Field_s_Slot_inst_get (insn) == 0)
- return 231; /* rfdo */
- if (Field_t_Slot_inst_get (insn) == 1 &&
- Field_s_Slot_inst_get (insn) == 0)
- return 232; /* rfdd */
+ if (Field_t_Slot_inst_get (insn) == 0)
+ return OPCODE_RFDO;
+ if (Field_t_Slot_inst_get (insn) == 1)
+ return OPCODE_RFDD;
break;
case 15:
- return 286; /* ldpte */
+ return OPCODE_LDPTE;
}
break;
}
break;
+ case 2:
+ switch (Field_op2_Slot_inst_get (insn))
+ {
+ case 8:
+ return OPCODE_MULL;
+ case 12:
+ return OPCODE_QUOU;
+ case 13:
+ return OPCODE_QUOS;
+ case 14:
+ return OPCODE_REMU;
+ case 15:
+ return OPCODE_REMS;
+ }
+ break;
case 3:
switch (Field_op2_Slot_inst_get (insn))
{
@@ -8975,351 +11346,446 @@ Slot_inst_decode (const xtensa_insnbuf insn)
switch (Field_sr_Slot_inst_get (insn))
{
case 0:
- return 125; /* rsr.lbeg */
+ return OPCODE_RSR_LBEG;
case 1:
- return 119; /* rsr.lend */
+ return OPCODE_RSR_LEND;
case 2:
- return 122; /* rsr.lcount */
+ return OPCODE_RSR_LCOUNT;
case 3:
- return 128; /* rsr.sar */
+ return OPCODE_RSR_SAR;
case 5:
- return 131; /* rsr.litbase */
+ return OPCODE_RSR_LITBASE;
+ case 12:
+ return OPCODE_RSR_SCOMPARE1;
case 72:
- return 20; /* rsr.windowbase */
+ return OPCODE_RSR_WINDOWBASE;
case 73:
- return 23; /* rsr.windowstart */
+ return OPCODE_RSR_WINDOWSTART;
case 83:
- return 265; /* rsr.ptevaddr */
+ return OPCODE_RSR_PTEVADDR;
case 90:
- return 267; /* rsr.rasid */
+ return OPCODE_RSR_RASID;
case 91:
- return 270; /* rsr.itlbcfg */
+ return OPCODE_RSR_ITLBCFG;
case 92:
- return 273; /* rsr.dtlbcfg */
+ return OPCODE_RSR_DTLBCFG;
case 96:
- return 216; /* rsr.ibreakenable */
+ return OPCODE_RSR_IBREAKENABLE;
case 104:
- return 228; /* rsr.ddr */
+ return OPCODE_RSR_DDR;
case 128:
- return 210; /* rsr.ibreaka0 */
+ return OPCODE_RSR_IBREAKA0;
case 129:
- return 213; /* rsr.ibreaka1 */
+ return OPCODE_RSR_IBREAKA1;
case 144:
- return 198; /* rsr.dbreaka0 */
+ return OPCODE_RSR_DBREAKA0;
case 145:
- return 204; /* rsr.dbreaka1 */
+ return OPCODE_RSR_DBREAKA1;
case 160:
- return 201; /* rsr.dbreakc0 */
+ return OPCODE_RSR_DBREAKC0;
case 161:
- return 207; /* rsr.dbreakc1 */
+ return OPCODE_RSR_DBREAKC1;
case 176:
- return 134; /* rsr.176 */
+ return OPCODE_RSR_176;
case 177:
- return 139; /* rsr.epc1 */
+ return OPCODE_RSR_EPC1;
case 178:
- return 145; /* rsr.epc2 */
+ return OPCODE_RSR_EPC2;
case 179:
- return 151; /* rsr.epc3 */
+ return OPCODE_RSR_EPC3;
case 180:
- return 157; /* rsr.epc4 */
+ return OPCODE_RSR_EPC4;
+ case 181:
+ return OPCODE_RSR_EPC5;
+ case 182:
+ return OPCODE_RSR_EPC6;
+ case 183:
+ return OPCODE_RSR_EPC7;
case 192:
- return 175; /* rsr.depc */
+ return OPCODE_RSR_DEPC;
case 194:
- return 163; /* rsr.eps2 */
+ return OPCODE_RSR_EPS2;
case 195:
- return 166; /* rsr.eps3 */
+ return OPCODE_RSR_EPS3;
case 196:
- return 169; /* rsr.eps4 */
+ return OPCODE_RSR_EPS4;
+ case 197:
+ return OPCODE_RSR_EPS5;
+ case 198:
+ return OPCODE_RSR_EPS6;
+ case 199:
+ return OPCODE_RSR_EPS7;
case 208:
- return 135; /* rsr.208 */
+ return OPCODE_RSR_208;
case 209:
- return 142; /* rsr.excsave1 */
+ return OPCODE_RSR_EXCSAVE1;
case 210:
- return 148; /* rsr.excsave2 */
+ return OPCODE_RSR_EXCSAVE2;
case 211:
- return 154; /* rsr.excsave3 */
+ return OPCODE_RSR_EXCSAVE3;
case 212:
- return 160; /* rsr.excsave4 */
+ return OPCODE_RSR_EXCSAVE4;
+ case 213:
+ return OPCODE_RSR_EXCSAVE5;
+ case 214:
+ return OPCODE_RSR_EXCSAVE6;
+ case 215:
+ return OPCODE_RSR_EXCSAVE7;
+ case 224:
+ return OPCODE_RSR_CPENABLE;
case 226:
- return 190; /* rsr.interrupt */
+ return OPCODE_RSR_INTERRUPT;
case 228:
- return 193; /* rsr.intenable */
+ return OPCODE_RSR_INTENABLE;
case 230:
- return 136; /* rsr.ps */
+ return OPCODE_RSR_PS;
+ case 231:
+ return OPCODE_RSR_VECBASE;
case 232:
- return 178; /* rsr.exccause */
+ return OPCODE_RSR_EXCCAUSE;
case 233:
- return 219; /* rsr.debugcause */
+ return OPCODE_RSR_DEBUGCAUSE;
case 234:
- return 233; /* rsr.ccount */
+ return OPCODE_RSR_CCOUNT;
case 235:
- return 187; /* rsr.prid */
+ return OPCODE_RSR_PRID;
case 236:
- return 222; /* rsr.icount */
+ return OPCODE_RSR_ICOUNT;
case 237:
- return 225; /* rsr.icountlevel */
+ return OPCODE_RSR_ICOUNTLEVEL;
case 238:
- return 172; /* rsr.excvaddr */
+ return OPCODE_RSR_EXCVADDR;
case 240:
- return 236; /* rsr.ccompare0 */
+ return OPCODE_RSR_CCOMPARE0;
case 241:
- return 239; /* rsr.ccompare1 */
+ return OPCODE_RSR_CCOMPARE1;
case 242:
- return 242; /* rsr.ccompare2 */
+ return OPCODE_RSR_CCOMPARE2;
case 244:
- return 181; /* rsr.misc0 */
+ return OPCODE_RSR_MISC0;
case 245:
- return 184; /* rsr.misc1 */
+ return OPCODE_RSR_MISC1;
}
break;
case 1:
switch (Field_sr_Slot_inst_get (insn))
{
case 0:
- return 126; /* wsr.lbeg */
+ return OPCODE_WSR_LBEG;
case 1:
- return 120; /* wsr.lend */
+ return OPCODE_WSR_LEND;
case 2:
- return 123; /* wsr.lcount */
+ return OPCODE_WSR_LCOUNT;
case 3:
- return 129; /* wsr.sar */
+ return OPCODE_WSR_SAR;
case 5:
- return 132; /* wsr.litbase */
+ return OPCODE_WSR_LITBASE;
+ case 12:
+ return OPCODE_WSR_SCOMPARE1;
case 72:
- return 21; /* wsr.windowbase */
+ return OPCODE_WSR_WINDOWBASE;
case 73:
- return 24; /* wsr.windowstart */
+ return OPCODE_WSR_WINDOWSTART;
case 83:
- return 264; /* wsr.ptevaddr */
+ return OPCODE_WSR_PTEVADDR;
+ case 89:
+ return OPCODE_WSR_MMID;
case 90:
- return 268; /* wsr.rasid */
+ return OPCODE_WSR_RASID;
case 91:
- return 271; /* wsr.itlbcfg */
+ return OPCODE_WSR_ITLBCFG;
case 92:
- return 274; /* wsr.dtlbcfg */
+ return OPCODE_WSR_DTLBCFG;
case 96:
- return 217; /* wsr.ibreakenable */
+ return OPCODE_WSR_IBREAKENABLE;
case 104:
- return 229; /* wsr.ddr */
+ return OPCODE_WSR_DDR;
case 128:
- return 211; /* wsr.ibreaka0 */
+ return OPCODE_WSR_IBREAKA0;
case 129:
- return 214; /* wsr.ibreaka1 */
+ return OPCODE_WSR_IBREAKA1;
case 144:
- return 199; /* wsr.dbreaka0 */
+ return OPCODE_WSR_DBREAKA0;
case 145:
- return 205; /* wsr.dbreaka1 */
+ return OPCODE_WSR_DBREAKA1;
case 160:
- return 202; /* wsr.dbreakc0 */
+ return OPCODE_WSR_DBREAKC0;
case 161:
- return 208; /* wsr.dbreakc1 */
+ return OPCODE_WSR_DBREAKC1;
+ case 176:
+ return OPCODE_WSR_176;
case 177:
- return 140; /* wsr.epc1 */
+ return OPCODE_WSR_EPC1;
case 178:
- return 146; /* wsr.epc2 */
+ return OPCODE_WSR_EPC2;
case 179:
- return 152; /* wsr.epc3 */
+ return OPCODE_WSR_EPC3;
case 180:
- return 158; /* wsr.epc4 */
+ return OPCODE_WSR_EPC4;
+ case 181:
+ return OPCODE_WSR_EPC5;
+ case 182:
+ return OPCODE_WSR_EPC6;
+ case 183:
+ return OPCODE_WSR_EPC7;
case 192:
- return 176; /* wsr.depc */
+ return OPCODE_WSR_DEPC;
case 194:
- return 164; /* wsr.eps2 */
+ return OPCODE_WSR_EPS2;
case 195:
- return 167; /* wsr.eps3 */
+ return OPCODE_WSR_EPS3;
case 196:
- return 170; /* wsr.eps4 */
+ return OPCODE_WSR_EPS4;
+ case 197:
+ return OPCODE_WSR_EPS5;
+ case 198:
+ return OPCODE_WSR_EPS6;
+ case 199:
+ return OPCODE_WSR_EPS7;
case 209:
- return 143; /* wsr.excsave1 */
+ return OPCODE_WSR_EXCSAVE1;
case 210:
- return 149; /* wsr.excsave2 */
+ return OPCODE_WSR_EXCSAVE2;
case 211:
- return 155; /* wsr.excsave3 */
+ return OPCODE_WSR_EXCSAVE3;
case 212:
- return 161; /* wsr.excsave4 */
+ return OPCODE_WSR_EXCSAVE4;
+ case 213:
+ return OPCODE_WSR_EXCSAVE5;
+ case 214:
+ return OPCODE_WSR_EXCSAVE6;
+ case 215:
+ return OPCODE_WSR_EXCSAVE7;
+ case 224:
+ return OPCODE_WSR_CPENABLE;
case 226:
- return 191; /* wsr.intset */
+ return OPCODE_WSR_INTSET;
case 227:
- return 192; /* wsr.intclear */
+ return OPCODE_WSR_INTCLEAR;
case 228:
- return 194; /* wsr.intenable */
+ return OPCODE_WSR_INTENABLE;
case 230:
- return 137; /* wsr.ps */
+ return OPCODE_WSR_PS;
+ case 231:
+ return OPCODE_WSR_VECBASE;
case 232:
- return 179; /* wsr.exccause */
+ return OPCODE_WSR_EXCCAUSE;
case 233:
- return 220; /* wsr.debugcause */
+ return OPCODE_WSR_DEBUGCAUSE;
case 234:
- return 234; /* wsr.ccount */
+ return OPCODE_WSR_CCOUNT;
case 236:
- return 223; /* wsr.icount */
+ return OPCODE_WSR_ICOUNT;
case 237:
- return 226; /* wsr.icountlevel */
+ return OPCODE_WSR_ICOUNTLEVEL;
case 238:
- return 173; /* wsr.excvaddr */
+ return OPCODE_WSR_EXCVADDR;
case 240:
- return 237; /* wsr.ccompare0 */
+ return OPCODE_WSR_CCOMPARE0;
case 241:
- return 240; /* wsr.ccompare1 */
+ return OPCODE_WSR_CCOMPARE1;
case 242:
- return 243; /* wsr.ccompare2 */
+ return OPCODE_WSR_CCOMPARE2;
case 244:
- return 182; /* wsr.misc0 */
+ return OPCODE_WSR_MISC0;
case 245:
- return 185; /* wsr.misc1 */
+ return OPCODE_WSR_MISC1;
}
break;
+ case 2:
+ return OPCODE_SEXT;
+ case 3:
+ return OPCODE_CLAMPS;
+ case 4:
+ return OPCODE_MIN;
+ case 5:
+ return OPCODE_MAX;
+ case 6:
+ return OPCODE_MINU;
+ case 7:
+ return OPCODE_MAXU;
case 8:
- return 89; /* moveqz */
+ return OPCODE_MOVEQZ;
case 9:
- return 90; /* movnez */
+ return OPCODE_MOVNEZ;
case 10:
- return 91; /* movltz */
+ return OPCODE_MOVLTZ;
case 11:
- return 92; /* movgez */
+ return OPCODE_MOVGEZ;
+ case 14:
+ if (Field_st_Slot_inst_get (insn) == 231)
+ return OPCODE_RUR_THREADPTR;
+ break;
+ case 15:
+ if (Field_sr_Slot_inst_get (insn) == 231)
+ return OPCODE_WUR_THREADPTR;
+ break;
}
break;
case 4:
case 5:
- return 76; /* extui */
+ return OPCODE_EXTUI;
case 9:
switch (Field_op2_Slot_inst_get (insn))
{
case 0:
- return 18; /* l32e */
+ return OPCODE_L32E;
case 4:
- return 19; /* s32e */
+ return OPCODE_S32E;
}
break;
}
break;
case 1:
- return 83; /* l32r */
+ return OPCODE_L32R;
case 2:
switch (Field_r_Slot_inst_get (insn))
{
case 0:
- return 84; /* l8ui */
+ return OPCODE_L8UI;
case 1:
- return 80; /* l16ui */
+ return OPCODE_L16UI;
case 2:
- return 82; /* l32i */
+ return OPCODE_L32I;
case 4:
- return 99; /* s8i */
+ return OPCODE_S8I;
case 5:
- return 97; /* s16i */
+ return OPCODE_S16I;
case 6:
- return 98; /* s32i */
+ return OPCODE_S32I;
case 7:
switch (Field_t_Slot_inst_get (insn))
{
case 0:
- return 258; /* dpfr */
+ return OPCODE_DPFR;
case 1:
- return 259; /* dpfw */
+ return OPCODE_DPFW;
case 2:
- return 260; /* dpfro */
+ return OPCODE_DPFRO;
case 3:
- return 261; /* dpfwo */
+ return OPCODE_DPFWO;
case 4:
- return 252; /* dhwb */
+ return OPCODE_DHWB;
case 5:
- return 253; /* dhwbi */
+ return OPCODE_DHWBI;
case 6:
- return 256; /* dhi */
+ return OPCODE_DHI;
case 7:
- return 257; /* dii */
+ return OPCODE_DII;
case 8:
switch (Field_op1_Slot_inst_get (insn))
{
+ case 0:
+ return OPCODE_DPFL;
+ case 2:
+ return OPCODE_DHU;
+ case 3:
+ return OPCODE_DIU;
case 4:
- return 254; /* diwb */
+ return OPCODE_DIWB;
case 5:
- return 255; /* diwbi */
+ return OPCODE_DIWBI;
}
break;
case 12:
- return 245; /* ipf */
+ return OPCODE_IPF;
+ case 13:
+ switch (Field_op1_Slot_inst_get (insn))
+ {
+ case 0:
+ return OPCODE_IPFL;
+ case 2:
+ return OPCODE_IHU;
+ case 3:
+ return OPCODE_IIU;
+ }
+ break;
case 14:
- return 246; /* ihi */
+ return OPCODE_IHI;
case 15:
- return 247; /* iii */
+ return OPCODE_III;
}
break;
case 9:
- return 81; /* l16si */
+ return OPCODE_L16SI;
case 10:
- return 88; /* movi */
+ return OPCODE_MOVI;
+ case 11:
+ return OPCODE_L32AI;
case 12:
- return 37; /* addi */
+ return OPCODE_ADDI;
case 13:
- return 38; /* addmi */
+ return OPCODE_ADDMI;
+ case 14:
+ return OPCODE_S32C1I;
+ case 15:
+ return OPCODE_S32RI;
}
break;
case 5:
switch (Field_n_Slot_inst_get (insn))
{
case 0:
- return 74; /* call0 */
+ return OPCODE_CALL0;
case 1:
- return 7; /* call4 */
+ return OPCODE_CALL4;
case 2:
- return 6; /* call8 */
+ return OPCODE_CALL8;
case 3:
- return 5; /* call12 */
+ return OPCODE_CALL12;
}
break;
case 6:
switch (Field_n_Slot_inst_get (insn))
{
case 0:
- return 78; /* j */
+ return OPCODE_J;
case 1:
switch (Field_m_Slot_inst_get (insn))
{
case 0:
- return 70; /* beqz */
+ return OPCODE_BEQZ;
case 1:
- return 71; /* bnez */
+ return OPCODE_BNEZ;
case 2:
- return 73; /* bltz */
+ return OPCODE_BLTZ;
case 3:
- return 72; /* bgez */
+ return OPCODE_BGEZ;
}
break;
case 2:
switch (Field_m_Slot_inst_get (insn))
{
case 0:
- return 50; /* beqi */
+ return OPCODE_BEQI;
case 1:
- return 51; /* bnei */
+ return OPCODE_BNEI;
case 2:
- return 53; /* blti */
+ return OPCODE_BLTI;
case 3:
- return 52; /* bgei */
+ return OPCODE_BGEI;
}
break;
case 3:
switch (Field_m_Slot_inst_get (insn))
{
case 0:
- return 11; /* entry */
+ return OPCODE_ENTRY;
case 1:
switch (Field_r_Slot_inst_get (insn))
{
case 8:
- return 85; /* loop */
+ return OPCODE_LOOP;
case 9:
- return 86; /* loopnez */
+ return OPCODE_LOOPNEZ;
case 10:
- return 87; /* loopgtz */
+ return OPCODE_LOOPGTZ;
}
break;
case 2:
- return 57; /* bltui */
+ return OPCODE_BLTUI;
case 3:
- return 56; /* bgeui */
+ return OPCODE_BGEUI;
}
break;
}
@@ -9328,35 +11794,35 @@ Slot_inst_decode (const xtensa_insnbuf insn)
switch (Field_r_Slot_inst_get (insn))
{
case 0:
- return 65; /* bnone */
+ return OPCODE_BNONE;
case 1:
- return 58; /* beq */
+ return OPCODE_BEQ;
case 2:
- return 61; /* blt */
+ return OPCODE_BLT;
case 3:
- return 63; /* bltu */
+ return OPCODE_BLTU;
case 4:
- return 66; /* ball */
+ return OPCODE_BALL;
case 5:
- return 68; /* bbc */
+ return OPCODE_BBC;
case 6:
case 7:
- return 54; /* bbci */
+ return OPCODE_BBCI;
case 8:
- return 64; /* bany */
+ return OPCODE_BANY;
case 9:
- return 59; /* bne */
+ return OPCODE_BNE;
case 10:
- return 60; /* bge */
+ return OPCODE_BGE;
case 11:
- return 62; /* bgeu */
+ return OPCODE_BGEU;
case 12:
- return 67; /* bnall */
+ return OPCODE_BNALL;
case 13:
- return 69; /* bbs */
+ return OPCODE_BBS;
case 14:
case 15:
- return 55; /* bbsi */
+ return OPCODE_BBSI;
}
break;
}
@@ -9372,14 +11838,14 @@ Slot_inst16b_decode (const xtensa_insnbuf insn)
switch (Field_i_Slot_inst16b_get (insn))
{
case 0:
- return 33; /* movi.n */
+ return OPCODE_MOVI_N;
case 1:
switch (Field_z_Slot_inst16b_get (insn))
{
case 0:
- return 28; /* beqz.n */
+ return OPCODE_BEQZ_N;
case 1:
- return 29; /* bnez.n */
+ return OPCODE_BNEZ_N;
}
break;
}
@@ -9388,23 +11854,23 @@ Slot_inst16b_decode (const xtensa_insnbuf insn)
switch (Field_r_Slot_inst16b_get (insn))
{
case 0:
- return 32; /* mov.n */
+ return OPCODE_MOV_N;
case 15:
switch (Field_t_Slot_inst16b_get (insn))
{
case 0:
- return 35; /* ret.n */
+ return OPCODE_RET_N;
case 1:
- return 15; /* retw.n */
+ return OPCODE_RETW_N;
case 2:
- return 197; /* break.n */
+ return OPCODE_BREAK_N;
case 3:
if (Field_s_Slot_inst16b_get (insn) == 0)
- return 34; /* nop.n */
+ return OPCODE_NOP_N;
break;
case 6:
if (Field_s_Slot_inst16b_get (insn) == 0)
- return 30; /* ill.n */
+ return OPCODE_ILL_N;
break;
}
break;
@@ -9420,13 +11886,13 @@ Slot_inst16a_decode (const xtensa_insnbuf insn)
switch (Field_op0_Slot_inst16a_get (insn))
{
case 8:
- return 31; /* l32i.n */
+ return OPCODE_L32I_N;
case 9:
- return 36; /* s32i.n */
+ return OPCODE_S32I_N;
case 10:
- return 26; /* add.n */
+ return OPCODE_ADD_N;
case 11:
- return 27; /* addi.n */
+ return OPCODE_ADDI_N;
}
return 0;
}
@@ -9513,6 +11979,8 @@ Slot_inst_get_field_fns[] = {
0,
0,
0,
+ Field_xt_wbr15_imm_Slot_inst_get,
+ Field_xt_wbr18_imm_Slot_inst_get,
Implicit_Field_ar0_get,
Implicit_Field_ar4_get,
Implicit_Field_ar8_get,
@@ -9556,6 +12024,8 @@ Slot_inst_set_field_fns[] = {
0,
0,
0,
+ Field_xt_wbr15_imm_Slot_inst_set,
+ Field_xt_wbr18_imm_Slot_inst_set,
Implicit_Field_set,
Implicit_Field_set,
Implicit_Field_set,
@@ -9599,6 +12069,8 @@ Slot_inst16a_get_field_fns[] = {
Field_z_Slot_inst16a_get,
Field_imm6_Slot_inst16a_get,
Field_imm7_Slot_inst16a_get,
+ 0,
+ 0,
Implicit_Field_ar0_get,
Implicit_Field_ar4_get,
Implicit_Field_ar8_get,
@@ -9642,6 +12114,8 @@ Slot_inst16a_set_field_fns[] = {
Field_z_Slot_inst16a_set,
Field_imm6_Slot_inst16a_set,
Field_imm7_Slot_inst16a_set,
+ 0,
+ 0,
Implicit_Field_set,
Implicit_Field_set,
Implicit_Field_set,
@@ -9685,6 +12159,8 @@ Slot_inst16b_get_field_fns[] = {
Field_z_Slot_inst16b_get,
Field_imm6_Slot_inst16b_get,
Field_imm7_Slot_inst16b_get,
+ 0,
+ 0,
Implicit_Field_ar0_get,
Implicit_Field_ar4_get,
Implicit_Field_ar8_get,
@@ -9728,6 +12204,8 @@ Slot_inst16b_set_field_fns[] = {
Field_z_Slot_inst16b_set,
Field_imm6_Slot_inst16b_set,
Field_imm7_Slot_inst16b_set,
+ 0,
+ 0,
Implicit_Field_set,
Implicit_Field_set,
Implicit_Field_set,
@@ -9829,10 +12307,10 @@ xtensa_isa_internal xtensa_modules = {
3 /* insn_size */, 0,
3, formats, format_decoder, length_decoder,
3, slots,
- 39 /* num_fields */,
- 70, operands,
- 235, iclasses,
- 291, opcodes, 0,
+ 41 /* num_fields */,
+ 75, operands,
+ 286, iclasses,
+ 353, opcodes, 0,
1, regfiles,
NUM_STATES, states, 0,
NUM_SYSREGS, sysregs, 0,
diff --git a/configure b/configure
index a8cf680..e052659 100755
--- a/configure
+++ b/configure
@@ -2643,7 +2643,6 @@ case "${target}" in
sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
;;
spu-*-*)
- skipdirs="target-libssp"
;;
v810-*-*)
noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
diff --git a/configure.ac b/configure.ac
index fb859c1..e7124f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -892,7 +892,6 @@ case "${target}" in
sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
;;
spu-*-*)
- skipdirs="target-libssp"
;;
v810-*-*)
noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
diff --git a/gdb/CONTRIBUTE b/gdb/CONTRIBUTE
index f1f3cb0..67a2ed4 100644
--- a/gdb/CONTRIBUTE
+++ b/gdb/CONTRIBUTE
@@ -115,19 +115,19 @@ o Please read your patch before submitting it.
to re-formatting / split it.
-o If ``gdb/configure.in'' is modified then you don't
+o If ``gdb/configure.ac'' is modified then you don't
need to include patches to the regenerated file
``configure''.
The maintainer will re-generate those files
- using autoconf (2.13 as of 2000-02-29).
+ using autoconf (2.59 as of 2005-01-07).
o If ``gdb/gdbarch.sh'' is modified, you don't
need to include patches to the generated files
``gdbarch.h'' and ``gdbarch.c''.
- See ``gdb/configure.in'' above.
+ See ``gdb/configure.ac'' above.
o When submitting a patch that fixes a bug
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f6d30f1..4eabe76 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,1554 @@
+2008-11-19 Doug Evans <dje@google.com>
+
+ * inferior.h (proceed_to_finish): Delete, unused.
+ (stop_registers): Tweak comment.
+ * infrun.c (stop_registers): Tweak comment.
+
+2008-11-19 Kevin Buettner <kevinb@redhat.com>
+
+ * frv-tdep.c (frv_skip_main_prologue): New function.
+ (frv_gdbarch_init): Register frv_skip_main_prologue.
+ * solib-frv.c (fetch_loadmap): Return early when no segments are
+ found.
+ (frv_relocate_main_executable): Return early when both interpreter
+ and executable loadmap addresses are zero.
+
+2008-11-19 Bob Wilson <bob.wilson@acm.org>
+
+ * xtensa-config.c (rmap): Remove entries for ar32 through ar63. Add
+ threadptr, scompare1, mmid, epc5, epc6, epc7, eps5, eps6, eps7,
+ excsave5, excsave6, excsave7, cpenable, and vecbase registers.
+ (xtensa_submask0, xtensa_submask1, xtensa_submask2)
+ (xtensa_submask3, xtensa_submask4, xtensa_submask5, xtensa_submask6)
+ (xtensa_submask7, xtensa_submask8, xtensa_submask9, xtensa_submask10)
+ (xtensa_submask11, xtensa_submask12, xtensa_submask13, xtensa_submask14)
+ (xtensa_submask15): Adjust register numbers.
+ * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
+ (xtensa_regmap_table): Add entry for scompare1.
+ * regformats/reg-xtensa.dat: Remove ar32 through ar63. Add threadptr
+ and scompare1.
+
+2008-11-19 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (escape_buffer): New.
+ (putpkt_binary, read_frame, getpkt_or_notif_sane_1): Use it. Make
+ sure debug output printing a packet buffer goes through a single
+ fprintf_unfiltered call.
+ * utils.c (vfprintf_unfiltered): If outputting timestamps, end
+ output with a newline if it wasn't going to already.
+
+2008-11-18 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * maint.c (maintenance_translate_address): Fix a buglet.
+
+2008-11-18 Thiago Jung Bauermann <bauerman@br.ibm.com>
+
+ * features/Makefile (rs6000/powerpc-isa205-32l-expedite,
+ rs6000/powerpc-isa205-altivec32l-expedite,
+ powerpc-isa205-vsx32l-expedite, rs6000/powerpc-isa205-64l-expedite,
+ rs6000/powerpc-isa205-altivec64l-expedite,
+ powerpc-isa205-vsx64l-expedite): New variables.
+ * regformats/rs6000/powerpc-isa205-32l.dat: Generate.
+ * regformats/rs6000/powerpc-isa205-altivec32l.dat: Generate.
+ * regformats/rs6000/powerpc-isa205-vsx32l.dat: Generate.
+ * regformats/rs6000/powerpc-isa205-64l.dat: Generate.
+ * regformats/rs6000/powerpc-isa205-altivec64l.dat: Generate.
+ * regformats/rs6000/powerpc-isa205-vsx64l.dat: Generate.
+
+2008-11-18 Thiago Jung Bauermann <bauerman@br.ibm.com>
+
+ * ppc-linux-nat.c (ppc_register_u_addr): Add special case to return
+ offset for full 64-bit slot of FPSCR when in 32-bits.
+ (ppc_linux_read_description): Return target description with 64-bit
+ FPSCR when inferior is running on an ISA 2.05 or later processor.
+ * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Call
+ initialize_tdec_powerpc_isa205_32l,
+ initialize_tdec_powerpc_isa205_altivec32l,
+ initialize_tdec_powerpc_isa205_vsx32l,
+ initialize_tdec_powerpc_isa205_64l,
+ initialize_tdec_powerpc_isa205_altivec64l and
+ initialize_tdec_powerpc_isa205_vsx64l.
+ * ppc-linux-tdep.h: Add external declaration for
+ tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l,
+ tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_isa205_64l,
+ tdesc_powerpc_isa205_altivec64l and tdesc_powerpc_isa205_vsx64l.
+ * features/rs600/powerpc-fpu-isa205.xml: New file.
+ * features/rs600/powerpc-isa205-32l.xml: New file.
+ * features/rs600/powerpc-isa205-64l.xml: New file.
+ * features/rs600/powerpc-isa205-altivec32l.xml: New file.
+ * features/rs600/powerpc-isa205-altivec64l.xml: New file.
+ * features/rs600/powerpc-isa205-vsx32l.xml: New file.
+ * features/rs600/powerpc-isa205-vsx64l.xml: New file.
+ * features/rs600/powerpc-isa205-32l.c: Generate.
+ * features/rs600/powerpc-isa205-64l.c: Generate.
+ * features/rs600/powerpc-isa205-altivec32l.c: Generate.
+ * features/rs600/powerpc-isa205-altivec64l.c: Generate.
+ * features/rs600/powerpc-isa205-vsx32l.c: Generate.
+ * features/rs600/powerpc-isa205-vsx64l.c: Generate.
+
+2008-11-18 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * objfiles.h: New MULTI_OBJFILE_P macro.
+ * printcmd.c (sym_info): Print object name.
+ * maint.c (maintenance_translate_address): Likewise.
+
+2008-11-18 Joel Brobecker <brobecker@adacore.com>
+
+ * NEWS: Document the removal of "catch load" and "catch unload".
+
+2008-11-17 Doug Evans <dje@google.com>
+
+ * infcall.c (call_function_by_hand): Fix punctuation and capitalization
+ on error messages.
+
+2008-11-17 Ulrich Weigand <uweigand@de.ibm.com>
+
+ PR gdb/2250
+ * infrun.c (clear_proceed_status_thread): New function.
+ (clear_proceed_status_callback): New function.
+ (clear_proceed_status): In all-stop mode, clear per-thread
+ proceed status of *all* threads, not only the current.
+ (handle_inferior_event): In all-stop mode, if we're stepping
+ one thread, but got some inferior event in another thread
+ that does not cause GDB to break to the user interface,
+ ensure the interrupted stepping operation continues in the
+ original thread.
+ (currently_stepping): Move thread-related tests to ...
+ (currently_stepping_thread): ... this new function.
+ (currently_stepping_callback): New function.
+
+2008-11-17 Vladimir Prus <vladimir@codesourcery.com>
+
+ Implement =thread-selected notification.
+
+ * mi/mi-common.h (struct mi_interp): New, moved from ...
+ * mi/mi-interp.c: ...here.
+ * mi/mi-main.c (mi_execute_command): If the thread changed
+ as result of command, report that.
+
+2008-11-17 Vladimir Prus <vladimir@codesourcery.com>
+
+ Implement continue/interrupt of thread groups.
+
+ * mi/mi-main.c (proceed_thread_callback): New.
+ (mi_cmd_exec_continue): If --thread-group is specified, resume all
+ threads in that group.
+ (interrupt_thread_callback): New.
+ (mi_cmd_exec_interrupt): If --thread-group is specified, interrupt
+ all threads in that group.
+
+2008-11-17 Vladimir Prus <vladimir@codesourcery.com>
+
+ Implement '-target-detach pid'.
+
+ * infcmd.c (detach_command): Make nonstatic.
+ * inferior.h (detach_command): Declare.
+ * mi/mi-cmds.c (mi_cmds): Don't route -target-detach via CLI.
+ * mi/mi-cmds.h (mi_cmd_target_detach): Declare.
+ * mi/mi-main.c (find_thread_of_process, mi_cmd_target_detach): New.
+
+2008-11-17 Vladimir Prus <vladimir@codesourcery.com>
+
+ Include group-id in thread-created notification.
+
+ * mi/mi-interp.c (mi_new_thread, mi_thread_exit): Include
+ group id in the output.
+
+2008-11-17 Vladimir Prus <vladimir@codesourcery.com>
+
+ Notification for attach/detach.
+
+ * inferior.c: Call the process observers.
+ * mi/mi-interp.c (mi_new_inferior, mi_inferior_exit): New.
+ (mi_interpreter_init): Register the above.
+
+2008-11-17 Vladimir Prus <vladimir@codesourcery.com>
+
+ Implement -list-thread-groups.
+
+ * thread.c (print_thread_info): New parameter pid, to print
+ threads of specific process.
+ * gdbthread.h (print_thread_info): New parameter pid.
+ * mi/mi-cmds.c (mi_cmds): Register -list-thread-groups.
+ * mi/mi-cmds.h (mi_cmd_list_thread_groups): New.
+ * mi/mi-main.c (mi_cmd_thread_info): Adjust.
+ (print_one_process, mi_cmd_list_thread_groups): New.
+
+2008-11-16 Joel Brobecker <brobecker@adacore.com>
+
+ Remove some unused macros related to the old load/unload catchpoints.
+
+ * breakpoint.c (SOLIB_LOADED_LIBRARY_PATHNAME)
+ (SOLIB_UNLOADED_LIBRARY_PATHNAME, SOLIB_CREATE_CATCH_LOAD_HOOK)
+ (SOLIB_CREATE_CATCH_UNLOAD_HOOK): Delete. No longer used.
+
+2008-11-16 Joel Brobecker <brobecker@adacore.com>
+
+ Remove support for catch load and catch unload commands.
+
+ * breakpoint.h (enum bptype): Remove bp_catch_load and bp_catch_unload.
+ (struct breakpoint): Remove fields dll_pathname and
+ triggered_dll_pathname.
+ (bpstat_get_triggered_catchpoints, ep_is_shlib_catchpoint): Delete.
+ * breakpoint.c (ep_is_catchpoint): Remove handling of
+ bp_catch_load and bp_catch_unload.
+ (print_it_typical, bpstat_check_location, bpstat_what)
+ (print_one_breakpoint_location, print_one_breakpoint_location)
+ (user_settable_breakpoint, allocate_bp_location)
+ (set_raw_breakpoint_without_location, mention, delete_breakpoint,
+ (breakpoint_re_set_one, disable_command, enable_command): Likewise.
+ (ep_is_shlib_catchpoint, bpstat_get_triggered_catchpoints)
+ (catch_load_command_1, catch_unload_command_1): Delete.
+ (_initialize_breakpoint): Remove the "catch load" and "catch unload"
+ command creation.
+ * infrun.c (handle_inferior_event): Remove the handling of
+ load/unload catchpoint events.
+
+2008-11-15 Joel Brobecker <brobecker@adacore.com>
+
+ From Jerome Guitton <guitton@adacore.com>
+ * dwarf2read.c (dwarf2_debug_line_missing_end_sequence_complaint):
+ New function.
+ (dwarf_decode_lines): Detect null file numbers. Detect the end of
+ the line program sequence when no end sequence is emitted.
+
+2008-11-15 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (ada_evaluate_subexp): Improve handling of integer
+ type dereferencing.
+
+2008-11-15 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * NEWS: Mention sparc64-linux-gnu gdbserver support.
+
+2008-11-14 Daniel Gutson <dgutson@codesourcery.com>
+
+ * configure.tgt (sparc64-*-linux*): Added gdbserver support.
+ * regformats/reg-sparc64.dat: New file.
+
+2008-11-14 Tom Tromey <tromey@redhat.com>
+
+ PR mi/2549:
+ * mi/mi-main.c (get_register): Use get_formatted_print_options.
+
+2008-11-13 Joel Brobecker <brobecker@adacore.com>
+
+ * printcmd.c: define PRINTF_HAS_LONG_LONG only if not yet defined.
+
+2008-11-13 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * auxv.c (fprint_target_auxv): Handle AT_BASE_PLATFORM and
+ AT_EXECFN. Re-sort AT_SECURE.
+
+2008-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * monitor.c (monitor_insert_breakpoint): Remove unused variable `bp'.
+
+2008-11-13 Joel Brobecker <brobecker@adacore.com>
+
+ * ia64-tdep.c: Remove commented out #define.
+
+2008-11-12 Joel Brobecker <brobecker@adacore.com>
+
+ From Joel Sherrill <joel.sherrill@oarcorp.com>
+ * remote-sim.c (gdbsim_mourn_inferior): Use "target" parameter
+ instead of the "gdbsim_ops" global.
+
+2008-11-11 Doug Evans <dje@google.com>
+
+ * infcall.c (call_function_by_hand): Handle inferior exit.
+
+2008-11-11 Thiago Jung Bauermann <bauerman@br.ibm.com>
+
+ * remote-sim.c (gdbsim_create_inferior, gdbsim_mourn_inferior): Add
+ missing struct target_ops argument.
+
+2008-11-11 Joel Sherrill <joel.sherrilL@oarcorp.com>
+
+ * MAINTAINERS: Add myself for write after approval privileges.
+
+2008-11-10 Tom Tromey <tromey@redhat.com>
+
+ * gdbtypes.c (copy_type_recursive): Clear new fields.
+
+2008-11-10 Tom Tromey <tromey@redhat.com>
+
+ * cli/cli-cmds.c (source_script): Clean up full_pathname. Run
+ cleanups on early return.
+
+2008-11-09 Vladimir Prus <vladimir@codesourcery.com>
+
+ Kill pthread_ops_hack
+
+ * target.h (struct target_ops): Make to_attach, to_detach,
+ to_create_inferior and to_mourn_inferior accept a pointer
+ to struct target_ops.
+ (target_attach, target_create_inferior, target_create_inferior):
+ Convert from macros to function. Find the right target to
+ invoke a method of.
+ (find_default_attach, find_default_create_inferior): New parameter
+ ops.
+ * corefile.c (core_file_command): Pass target to to_detach.
+ * corelow.c (core_detach): Add 'ops' parameter.
+ * fork-child.c (fork_inferior): Return the pid. Allow
+ init_trace_fun to be NULL.
+ * inf-ptrace (ptrace_ops_hack): Remove.
+ (inf_ptrace_him): Remove, moving all logic into....
+ (inf_ptrace_create_inferior): ... here. Push the target
+ passed as parameter.
+ (inf_ptrace_mourn_inferior, inf_ptrace_attach, inf_ptrace_detach):
+ Push/pop target passed as parameter, no ptrace_ops_hack.
+ (inf_ptrace_target): Don't remember result.
+ * inferior.h (fork_inferior): Adjust prototype.
+ * linux-nat.c (linux_nat_create_inferior, linux_nat_attach)
+ (linux_nat_detach, linux_nat_mourn_inferior): New parameter ops.
+ Pass it to linux_ops target.
+ * linux-thread-db.c (thread_db_detach, thread_db_mourn_inferior):
+ New parameter ops. Pass it to the target beneath.
+ * remote.c (remote_mourn, extended_remote_mourn, remote_detach)
+ (extended_remote_create_inferior): New parameter ops. Pass it
+ further.
+ * target.c (debug_to_attach, debug_to_detach)
+ (debug_to_mourn_inferior): New parameter ops.
+ (target_create_inferior): New.
+ (update_current_target): Do not inherit to_attach, to_detach,
+ to_create_inferiour, to_mourn_inferior. Do not default
+ to_detach and to_mourn_inferior.
+ (target_detach): Find the right target to use.
+ (target_mourn_inferior): New.
+ (find_default_attach, find_default_create_inferior): New parameter
+ ops. Pass the found target when calling its method.
+ (init_dummy_target): Provide fallback definition of to_detach.
+ (target_attach): New.
+ (debug_to_attach, debug_to_detach, debug_to_create_inferior)
+ (debug_to_mourn_inferiour): New parameter ops.
+ * aix-thread.c: Adjust.
+ * bsd-uthread.c: Adjust.
+ * gnu-nat.c: Adjust.
+ * go32-nat.c: Adjust.
+ * hpux-thread.c: Adjust.
+ * inf-ttrace.c: Ajust.
+ * monitor.c: Adjust.
+ * nto-procfs.c: Adjust.
+ * procfs.c: Adjust.
+ * remote-m32r-sdi.c: Adjust.
+ * remote-mips.c: Adjust.
+ * remote-sim.c: Adjust.
+ * rs6000-nat.c: Adjust.
+ * sol-thread.c: Adjust.
+ * win32-nat.c: Adjust.
+ * dec-thread.c: Adjust.
+
+2008-11-09 Vladimir Prus <vladimir@codesourcery.com>
+
+ * thread.c (print_thread_info): Eliminate now useless checks
+ for exited threads.
+
+2008-11-06 Pedro Alves <pedro@codesourcery.com>
+
+ * i386-dicos-tdep.c (i386_dicos_init_abi): Set decr_pc_after_break
+ to 0.
+
+2008-11-05 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (notice_new_inferiors): Add a new inferior only when
+ we're going to add a new thread.
+
+2008-11-05 Pedro Alves <pedro@codesourcery.com>
+
+ * defs.h (add_inferior_continuation)
+ (do_all_inferior_continuations)
+ (discard_all_inferior_continuations): Declare.
+ * utils.c (add_inferior_continuation)
+ (do_all_inferior_continuations)
+ (discard_all_inferior_continuations): New.
+ * inferior.h (struct inferior) <continuations>: New field.
+ * inferior.c (free_inferior): Discard all the inferior
+ continuations.
+ * inf-loop.c (inferior_event_handler): Do all current inferior
+ continuations.
+ * infcmd.c (attach_command): Register an inferior continuation
+ instead of a thread continuation.
+ * infrun.c (handle_inferior_event): If stop_soon is
+ STOP_QUIETLY_NO_SIGSTOP, also expect a TARGET_SIGNAL_0.
+
+2008-11-04 Pedro Alves <pedro@codesourcery.com>
+
+ * inf-loop.c (inferior_event_handler): On INF_ERROR and
+ INF_REG_EVENT throwing, don't call target_async or pop_target.
+ Call pop_all_targets_above.
+ * remote.c (remote_close): Call remote_terminal_ours. Don't call
+ signal or target_async.
+
+2008-11-04 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * eval.c (evaluate_subexp_standard): Assert that there is at
+ least one array dimension.
+
+2008-11-03 Vladimir Prus <vladimir@codesourcery.com>
+
+ Make attach_command exception-safe
+ * infcmd.c (attach_command): Call async_enable_stdin
+ if exception is thrown.
+
+2008-11-03 Pedro Alves <pedro@codesourcery.com>
+
+ * gdbarch.sh (has_global_solist): Mention global breakpoints.
+ * gdbarch.h: Regenerate.
+
+2008-11-03 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (remote_start_remote): If the solib list is global,
+ fetch libraries and insert breakpoints after connecting.
+ * infcmd.c (post_create_inferior): If the solist is shared between
+ inferiors, no need to refetch it on every new inferior.
+ (detach_command): If the shared library list is shared between
+ inferiors, then don't clear it on every inferior detach.
+ * gdbarch.sh (has_global_solist): New.
+ * i386-dicos-tdep.c (i386_dicos_init_abi): Set
+ gdbarch_has_global_solist.
+ * target.c (target_pre_inferior): If the shared library list is
+ shared between inferiors, then don't clear it here, neither
+ invalidate the memory regions or clear the target description.
+ (target_detach): If the shared library list is shared between
+ inferiors, then don't remove breakpoints from the target here.
+ (target_disconnect): Comment.
+ * solib.c (update_solib_list): Check for null_ptid.
+ * breakpoint.c (insert_breakpoints, update_global_location_list):
+ If the shared library list is shared between inferiors, insert
+ breakpoints even if there's no execution.
+ (breakpoint_init_inferior): If the shared library list is shared
+ between inferiors, don't delete breakpoints or mark them
+ uninserted here.
+
+ * gdbarch.c, gdbarch.h: Regenerate.
+
+2008-10-31 Pedro Alves <pedro@codesourcery.com>
+
+ * inferior.h (inferior_ignoring_leading_exec_events): Delete
+ declaration.
+
+2008-10-31 Pedro Alves <pedro@codesourcery.com>
+
+ * inferior.h (write_inferior_status_register): Delete.
+ * infrun.c (write_inferior_status_register): Delete.
+
+2008-10-30 Tom Tromey <tromey@redhat.com>
+
+ * value.c (coerce_array): Use check_typedef.
+
+2008-10-30 Tom Tromey <tromey@redhat.com>
+
+ * cli/cli-logging.c (handle_redirections): Make a cleanup.
+ * reggroups.c (maintenance_print_reggroups): Make a cleanup.
+ * regcache.c (regcache_print): Make a cleanup.
+ * maint.c (maintenance_print_architecture): Make a cleanup.
+ * dummy-frame.c (maintenance_print_dummy_frames): Make a cleanup.
+
+2008-10-30 Tom Tromey <tromey@redhat.com>
+
+ * utils.c (make_cleanup_close): Use make_cleanup_dtor.
+ (do_close_cleanup): Don't free 'fd'.
+
+2008-10-30 Tom Tromey <tromey@redhat.com>
+
+ * source.c (symtab_to_fullname): Test 'r >= 0'.
+ (psymtab_to_fullname): Likewise.
+ (get_filename_and_charpos): Make a cleanup.
+ (forward_search_command): Likewise.
+ (reverse_search_command): Likewise.
+ * exec.c (exec_file_attach): Close scratch_chan on failure.
+ * nto-procfs.c (procfs_open): Make a cleanup.
+ (procfs_pidlist): Likewise.
+ (do_closedir_cleanup): New function.
+
+2008-10-30 Andreas Schwab <schwab@suse.de>
+
+ * infcmd.c (construct_inferior_arguments): Handle newlines
+ specially.
+
+2008-10-30 Joel Brobecker <brobecker@adacore.com>
+
+ * breakpoint.h (enum bptype): Delete bp_catch_exec.
+ * breakpoint.c (insert_catchpoint): Remove handling for
+ bp_catch_exec breakpoint kinds.
+ (insert_bp_location, update_breakpoints_after_exec, remove_breakpoint)
+ (ep_is_catchpoint, print_it_typical, bpstat_check_location),
+ (bpstat_check_location, bpstat_what, print_one_breakpoint_location)
+ (print_one_breakpoint_location, user_settable_breakpoint)
+ (breakpoint_address_is_meaningful, adjust_breakpoint_address)
+ (allocate_bp_location, mention, breakpoint_re_set_one)
+ (disable_command, enable_command): Likewise.
+ (create_exec_event_catchpoint): Delete.
+ (insert_catch_exec, remove_catch_exec, breakpoint_hit_catch_exec)
+ (print_it_catch_exec, print_one_catch_exec, print_mention_catch_exec):
+ New functions.
+ (catch_exec_breakpoint_ops): New static global.
+ (catch_exec_command_1): Use create_catchpoint instead of
+ create_exec_event_catchpoint to create the exec catchpoint.
+
+2008-10-28 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in (SUBDIR_CLI_OBS): Don't mention cli-utils.o.
+ (SUBDIR_CLI_DEPS): Don't mention cli-utils.c.
+ (HFILES_NO_SRCDIR): Don't mention cli-utils.h.
+ (cli-utils.o): Remove.
+ * cli/cli-utils.c: Remove.
+ * cli/cli-utils.h: Remove.
+
+2008-10-28 Tom Tromey <tromey@redhat.com>
+
+ * varobj.c (value_get_print_value): Include valprint.h.
+ (value_get_print_value): Use get_formatted_print_options.
+ * value.h (struct value_print_options): Declare.
+ (value_print, val_print, common_val_print, val_print_string):
+ Update.
+ * value.c: Include valprint.h.
+ (show_values): Use get_user_print_options.
+ (show_convenience): Likewise.
+ * valprint.h (prettyprint_arrays, prettyprint_structs): Don't
+ declare.
+ (struct value_print_options): New type.
+ (vtblprint, unionprint, addressprint, objectprint, print_max,
+ inspect_it, repeat_count_threshold, output_format,
+ stop_print_at_null): Don't declare.
+ (user_print_options, get_user_print_options,
+ get_raw_print_options, get_formatted_print_options): Declare.
+ (print_array_indexes_p): Don't declare.
+ (maybe_print_array_index, val_print_array_elements): Update.
+ * valprint.c (print_max): Remove.
+ (user_print_options): New global.
+ (get_user_print_options, get_raw_print_options,
+ get_formatted_print_options): New functions.
+ (print_array_indexes, repeat_count_threshold, stop_print_at_null,
+ prettyprint_structs, prettyprint_arrays, unionprint,
+ addressprint): Remove.
+ (val_print): Remove format, deref_ref, pretty arguments; add
+ options. Update.
+ (common_val_print): Likewise.
+ (print_array_indexes_p): Remove.
+ (maybe_print_array_index): Remove format, pretty arguments; add
+ options. Update.
+ (val_print_array_elements): Remove format, deref_ref, pretty
+ arguments; add options. Update.
+ (val_print_string): Add options argument. Update.
+ (_initialize_valprint): Use user_print_options.
+ (output_format): Remove.
+ (set_output_radix_1): Use user_print_options.
+ * typeprint.c: Include valprint.h.
+ (objectprint): Don't declare.
+ (whatis_exp): Use get_user_print_options.
+ * tui/tui-regs.c: Include valprint.h.
+ (tui_register_format): Use get_formatted_print_options.
+ * tracepoint.c: Include valprint.h.
+ (addressprint): Don't declare.
+ (trace_mention): Use get_user_print_options.
+ (tracepoints_info): Likewise.
+ * stack.c (print_frame_args): Use get_raw_print_options.
+ (print_frame_info): Use get_user_print_options.
+ (print_frame): Likewise.
+ * sh64-tdep.c: Include valprint.h
+ (sh64_do_register): Use get_formatted_print_options.
+ * scm-valprint.c (scm_inferior_print): Remove format, deref_ref,
+ pretty arguments; add options.
+ (scm_scmlist_print): Likewise. Update.
+ (scm_scmval_print): Likewise.
+ (scm_val_print): Likewise.
+ (scm_value_print): Remove format, pretty arguments; add options.
+ Update.
+ * scm-lang.h (scm_value_print, scm_val_print, scm_scmval_print):
+ Update.
+ * scm-lang.c (scm_printstr): Add options argument.
+ * python/python-value.c: Include valprint.h.
+ (valpy_str): Use get_user_print_options.
+ * printcmd.c: Include valprint.h.
+ (addressprint): Don't declare.
+ (inspect_it): Remove.
+ (print_formatted): Remove format option; add options. Update.
+ (print_scalar_formatted): Likewise.
+ (print_address_demangle): Use get_user_print_options.
+ (do_examine): Use get_formatted_print_options.
+ (print_command_1): Likewise.
+ (output_command): Use get_formatted_print_options.
+ (do_one_display): Likewise.
+ (print_variable_value): Use get_user_print_options.
+ * p-valprint.c (pascal_val_print): Remove format, deref_ref,
+ pretty arguments; add options. Update.
+ (pascal_value_print): Remove format, pretty arguments; add
+ options. Update.
+ (vtblprint, objectprint): Don't declare.
+ (pascal_static_field_print): Remove.
+ (pascal_object_print_value_fields): Remove format, pretty
+ arguments; add options. Update.
+ (pascal_object_print_static_field): Likewise.
+ (_initialize_pascal_valprint): Use user_print_options. Update.
+ * p-lang.h (pascal_val_print, pascal_value_print,
+ pascal_printstr, pascal_object_print_value_fields): Update.
+ (vtblprint, static_field_print): Don't declare.
+ * p-lang.c (pascal_printstr): Add options argument. Update.
+ * objc-lang.c (objc_printstr): Add options argument. Update.
+ * mt-tdep.c: Include valprint.h.
+ (mt_registers_info): Use get_raw_print_options.
+ * mips-tdep.c: Include valprint.h.
+ (mips_print_fp_register): Use get_formatted_print_options.
+ (mips_print_register): Likewise.
+ * mi/mi-main.c: Include valprint.h.
+ (get_register): Use get_user_print_options.
+ (mi_cmd_data_evaluate_expression): Likewise.
+ (mi_cmd_data_read_memory): Use get_formatted_print_options.
+ * mi/mi-cmd-stack.c: Include valprint.h.
+ (list_args_or_locals): Use get_raw_print_options.
+ * m2-valprint.c (print_function_pointer_address): Add addressprint
+ argument.
+ (m2_print_long_set): Remove format, pretty arguments.
+ (m2_print_unbounded_array): Remove format, deref_ref, pretty
+ arguments; add options. Update.
+ (print_unpacked_pointer): Remove format argument; add options.
+ Now static. Update.
+ (print_variable_at_address): Remove format, deref_ref, pretty
+ arguments; add options. Update.
+ (m2_print_array_contents): Likewise.
+ (m2_val_print): Likewise.
+ * m2-lang.h (m2_val_print): Update.
+ * m2-lang.c (m2_printstr): Add options argument. Update.
+ * language.h (struct value_print_options): Declare.
+ (struct language_defn) <la_printstr>: Add options argument.
+ <la_val_print>: Remove format, deref_ref, pretty argument; add
+ options.
+ <la_value_print>: Remove format, pretty arguments; add options.
+ <la_print_array_index>: Likewise.
+ (LA_VAL_PRINT, LA_VALUE_PRINT, LA_PRINT_STRING,
+ LA_PRINT_ARRAY_INDEX): Update.
+ (default_print_array_index): Update.
+ * language.c (default_print_array_index): Remove format, pretty
+ arguments; add options. Update.
+ (unk_lang_printstr): Add options argument.
+ (unk_lang_val_print): Remove format, deref_ref, pretty arguments;
+ add options.
+ (unk_lang_value_print): Remove format, pretty arguments; add
+ options.
+ * jv-valprint.c (java_value_print): Remove format, pretty
+ arguments; add options. Update.
+ (java_print_value_fields): Likewise.
+ (java_val_print): Remove format, deref_ref, pretty arguments; add
+ options. Update.
+ * jv-lang.h (java_val_print, java_value_print): Declare.
+ * infcmd.c: Include valprint.h.
+ (print_return_value): Use get_raw_print_options.
+ (default_print_registers_info): Use get_user_print_options,
+ get_formatted_print_options.
+ (registers_info): Use get_formatted_print_options.
+ * gdbtypes.h (struct value_print_options): Declare.
+ (print_scalar_formatted): Update.
+ * f-valprint.c (f77_print_array_1): Remove format, deref_ref,
+ pretty arguments; add options. Update.
+ (f77_print_array): Likewise.
+ (f_val_print): Likewise.
+ * f-lang.h (f_val_print): Update.
+ * f-lang.c (f_printstr): Add options argument. Update.
+ (c_value_print): Update declaration.
+ * expprint.c: Include valprint.h.
+ (print_subexp_standard): Use get_raw_print_options,
+ get_user_print_options.
+ * eval.c: Include valprint.h.
+ (objectprint): Don't declare.
+ (evaluate_subexp_standard): Use get_user_print_options.
+ * cp-valprint.c (vtblprint, objectprint, static_field_print):
+ Remove.
+ (cp_print_value_fields): Remove format, pretty arguments; add
+ options. Update.
+ (cp_print_value): Likewise.
+ (cp_print_static_field): Likewise.
+ (_initialize_cp_valprint): Use user_print_options. Update.
+ * c-valprint.c (print_function_pointer_address): Add addressprint
+ argument.
+ (c_val_print): Remove format, deref_ref, pretty arguments; add
+ options. Update.
+ (c_value_print): Add options argument. Update.
+ * c-lang.h (c_val_print, c_value_print, c_printstr): Update.
+ (vtblprint, static_field_print): Don't declare.
+ (cp_print_value_fields): Update.
+ * c-lang.c (c_printstr): Add options argument. Update.
+ * breakpoint.c: Include valprint.h.
+ (addressprint): Don't declare.
+ (watchpoint_value_print): Use get_user_print_options.
+ (print_one_breakpoint_location): Likewise.
+ (breakpoint_1, print_it_catch_fork, print_it_catch_vfork, mention,
+ print_exception_catchpoint): Likewise.
+ * auxv.c (fprint_target_auxv): Don't declare addressprint. Use
+ get_user_print_options.
+ * ada-valprint.c (struct ada_val_print_args): Remove format,
+ deref_ref, and pretty; add options.
+ (print_optional_low_bound): Add options argument.
+ (val_print_packed_array_elements): Remove format and pretty
+ arguments; add options. Update.
+ (printstr): Add options argument. Update.
+ (ada_printstr): Likewise.
+ (ada_val_print): Remove format, deref_ref, pretty arguments; add
+ options argument. Update.
+ (ada_val_print_stub): Update.
+ (ada_val_print_array): Remove format, deref_ref, pretty arguments;
+ add options. Update.
+ (ada_val_print_1): Likewise.
+ (print_variant_part): Likewise.
+ (ada_value_print): Remove format, pretty arguments; add options.
+ Update.
+ (print_record): Likewise.
+ (print_field_values): Likewise.
+ * ada-lang.h (ada_val_print, ada_value_print, ada_printstr):
+ Update.
+ * ada-lang.c (ada_print_array_index): Add options argument; remove
+ format and pretty arguments.
+ (print_one_exception): Use get_user_print_options.
+
+2008-10-28 Tom Tromey <tromey@redhat.com>
+
+ * cli/cli-script.c (do_fclose_cleanup): Remove.
+ (script_from_file): Use make_cleanup_fclose.
+ * xml-tdesc.c (do_cleanup_fclose): Remove.
+ (fetch_xml_from_file): Use make_cleanup_fclose.
+ * tracepoint.c (tracepoint_save_command): Use
+ make_cleanup_fclose. Always free pathname.
+ * source.c (print_source_lines_base): Use make_cleanup_fclose.
+ * remote.c (fclose_cleanup): Remove.
+ (remote_file_put): Use make_cleanup_fclose.
+ (remote_file_get): Likewise.
+ * linux-nat.c (linux_nat_find_memory_regions): Use
+ make_cleanup_fclose.
+ (linux_nat_info_proc_cmd): Likewise.
+ (linux_proc_pending_signals): Likewise.
+ * fbsd-nat.c (fbsd_find_memory_regions): Use make_cleanup_fclose.
+ Free file name.
+ * cli/cli-dump.c (do_fclose_cleanup): Remove.
+ (make_cleanup_fclose): Remove.
+ * defs.h (make_cleanup_fclose): Declare.
+ * utils.c (do_fclose_cleanup): New function.
+ (make_cleanup_fclose): Likewise.
+
+2008-10-27 Pedro Alves <pedro@codesourcery.com>
+
+ * inflow.c (kill_command): If the target claims there is still
+ execution, don't clear the thread list.
+
+2008-10-27 Pedro Alves <pedro@codesourcery.com>
+
+ * cp-name-parser.y: Include defs.h instead of config.h.
+ (parse_escape): Rename to ...
+ (cp_parse_escape): ... this.
+ (yylex): Update.
+ (xfree) [TEST_CPNAMES]: New.
+
+2008-10-27 Pedro Alves <pedro@codesourcery.com>
+
+ * CONTRIBUTE: Mention autoconf 2.59 and configure.ac instead of
+ 2.13 and configure.in.
+
+2008-10-27 Pedro Alves <pedro@codesourcery.com>
+
+ * target.h (struct target_ops) <to_supports_multi_process>: New
+ field.
+ (target_supports_multi_process): New define.
+ * target.c (update_current_target): Inherit and de_fault
+ to_supports_multi_process.
+ * infcmd.c (attach_command): Allow attaching to multiple processes
+ if the target supports it.
+ (detach_command): If the target claims there is still execution,
+ don't clear the thread list.
+ * remote.c (remote_supports_multi_process): New.
+ (init_remote_ops): Register remote_supports_multi_process.
+
+2008-10-27 Pedro Alves <pedro@codesourcery.com>
+
+ * Makefile.in (.y.c, .l.c): sed free to xfree.
+
+2008-10-27 Pedro Alves <pedro@codesourcery.com>
+
+ * Makefile.in (INSTALLED_LIBS, CLIBS): Remove reference to
+ $(TM_CLIBS).
+ (CDEPS): Remove reference to $(TM_CDEPS).
+
+2008-10-26 Michael Snyder <msnyder@vmware.com>
+
+ * infrun.c (handle_inferior_event): Handle dynamic symbol
+ resolution in reverse.
+
+2008-10-25 Joel Brobecker <brobecker@adacore.com>
+
+ * infrun.c: Minor comment reformatting.
+
+2008-10-25 Pedro Alves <pedro@codesourcery.com>
+
+ * ada-exp.y (write_object_renaming): Use malloc instead of
+ xmalloc.
+ * p-exp.y (pop_current_type): Use free instead of xfree.
+
+2008-10-24 Pedro Alves <pedro@codesourcery.com>
+
+ * fork-child.c (startup_inferior): Only set threads not-executing
+ after getting all the pending execs. On TARGET_WAITKIND_IGNORE,
+ keep waiting, don't resume. On all other cases but
+ TARGET_WAITKIND_SIGNALLED and TARGET_WAITKIND_EXITED, switch to
+ the event ptid.
+
+2008-10-24 Pedro Alves <pedro@codesourcery.com>
+
+ Remote non-stop mode support.
+
+ * remote.c (pending_stop_reply): New.
+ (struct remote_state) <non_stop_aware, support_vCont_t>: New
+ fields.
+ (remote_async_inferior_event_token)
+ (remote_async_get_pending_events_token): New.
+ (notice_new_inferiors): New, abstracted out from record_currthread.
+ (record_currthread): Call it.
+ (remote_threads_info): Default threads to running in non-stop
+ mode. In non-stop mode, only qfThreadInfo is supported.
+ (remote_close): Discard all pending stop_replies. Close the event
+ sources.
+ (set_stop_requested_callback): New.
+ (remote_start_remote): Implement non-stop mode startup. In
+ all-stop, don't clear the thread list here.
+ (remote_non_stop_feature): New.
+ (remote_protocol_features): Add a "QNonStop" feature.
+ (remote_open_1): Clear cached_wait_status and non_stop_aware.
+ Clear the thread list here.
+ (remote_detach_1): Discard pending stop replies of the process we
+ detached from.
+ (extended_remote_attach_1): Implement non-stop mode.
+ (remote_vcont_probe): Recognize `vCont;t'.
+ (remote_vcont_resume): Implement non-stop mode.
+ (remote_resume): Don't set waiting_for_stop_reply in non-stop
+ mode.
+ (remote_stop_ns): New.
+ (remote_stop): Rename to ...
+ (remote_stop_as): ... this. If we have a cached wait status,
+ don't bother interrupting the remote.
+ (remote_stop): Reimplement as wrapper around remote_stop_as and
+ remote_stop_ns.
+ (interrupt_query): Don't query in async mode.
+ (struct cached_reg, cahed_reg_t): New.
+ (struct stop_reply): New.
+ (stop_reply_queue): New.
+ (stop_reply_xmalloc, stop_reply_xfree)
+ (discard_pending_stop_replies, do_stop_reply_xfree)
+ (queued_stop_reply, push_stop_reply, peek_stop_reply)
+ (remote_parse_stop_reply, remote_get_pending_stop_replies)
+ (process_stop_reply): New.
+ (remote_wait_ns): New.
+ (remote_wait_as): Use remote_parse_stop_reply. Invalidate the
+ notion of current general thread is a process exit was reported.
+ (remote_wait): Call remote_wait_ns in non-stop mode.
+ (handle_notification): New.
+ (putpkt_binary): Handle notifications. Don't care for
+ waiting_for_stop_reply in non-stop mode.
+ (getpkt_sane): Rename to ...
+ (getpkt_or_notif_sane_1): ... this. Add `expecting_notif'
+ argument. Handle it. Handle notifications.
+ (getpkt_sane): Reimplement as wrapper around getpkt_or_notif_sane_1.
+ (getpkt_or_notif_sane): New.
+ (select_new_thread_callback): Check for exited state instead of
+ comparing the ptid against minus_one_ptid.
+ (extended_remote_create_inferior_1): Query the remote about the
+ current thread.
+ (remote_supports_non_stop): New.
+ (init_remote_ops): Register it.
+ (remote_async_inferior_event_handler): New.
+ (remote_async_get_pending_events_handler): New.
+
+ * infcmd.c (proceed_thread_callback): Comment.
+ (proceed_after_attach_callback, proceed_after_attach): New.
+ (attach_command_post_wait): In background attach, resume all
+ threads, but only if they are unsignalled, and not explicitly
+ stopped. In foreground attach, in non-stop mode, make sure to
+ stop all threads of the just attached to process.
+ (attach_command): In non-stop mode: If doing a background attach,
+ stop at least one thread. If a foreground attach, stop all
+ threads.
+
+2008-10-24 Pedro Alves <pedro@codesourcery.com>
+
+ * event-loop.h: Mention async_event_handlers.
+ (async_event_handler): Forward declare.
+ (async_event_handler_func): New typedef.
+ (create_async_event_handler, delete_async_event_handler)
+ (mark_async_event_handler): Declare.
+ * event-loop.c (event_data): New.
+ (event_handler_func): Take an event_data instead of an integer.
+ (struct gdb_event): Replace the integer file descriptor by a
+ generic event_data.
+ (async_event_handler): New.
+ (async_handler_ready): Delete.
+ (async_event_handler_list): New.
+ (create_event): New.
+ (create_file_event): Use it.
+ (process_event): Adjust.
+ (gdb_do_one_event): Poll from the event sources in round-robin
+ fashion across calls. Be sure to consult all sources before
+ blocking.
+ (handle_file_event): Take an event_data instead of an integer.
+ Adjust.
+ (gdb_wait_for_event): Add `block' argument. Handle it.
+ (mark_async_signal_handler): Remove unneeded cast.
+ (invoke_async_signal_handler): Rename to ...
+ (invoke_async_signal_handlres): ... this. Return true if any was
+ handled.
+ (check_async_ready): Delete
+ (create_async_event_handler): New.
+ (mark_async_event_handler): New.
+ (struct async_event_handler_data): New.
+ (invoke_async_event_handler): New.
+ (check_async_event_handlers): New.
+ (delete_async_event_handler): New.
+ (handle_timer_event): Adjust.
+
+2008-10-24 Doug Evans <dje@google.com>
+
+ * dwarf2read.c (typename_concat): Don't segv if prefix or suffix
+ is NULL. Simplify obs == NULL case.
+
+2008-10-24 Hui Zhu <teawater@gmail.com>
+ Pedro Alves <pedro@codesourcery.com>
+
+ * infrun.c (can_use_displaced_stepping): Change type to
+ const char pointer.
+ (can_use_displaced_stepping_auto): New string.
+ (can_use_displaced_stepping_on): New string.
+ (can_use_displaced_stepping_off): New string.
+ (can_use_displaced_stepping_enum): New array.
+ (show_can_use_displaced_stepping): In auto mode, also show
+ the current effect of the option.
+ (use_displaced_stepping): Return non-zero if displaced
+ stepping is auto, and can be used with GDBARCH, and in
+ non-stop mode. Return non-zero if displaced stepping is on,
+ and can be used with GDBARCH. Return zero otherwise.
+ (_initialize_infrun): Make the "set displaced-stepping"
+ command an enum command. Change its class to class_run.
+ Place it in the top level set list. Extend help to describe
+ the auto mode.
+
+2008-10-23 Pedro Alves <pedro@codesourcery.com>
+
+ * defs.h: Mention ptid_is_pid.
+ * inferior.h (ptid_is_pid): Declare.
+ * gdbthread.h (struct thread_info) <stop_requested>: New field.
+ (set_stop_requested): Declare.
+ * infcmd.c (interrupt_target_1): Call set_stop_requested.
+ * infrun.c (clear_proceed_status): Clear stop_requested.
+ (infrun_thread_stop_requested_callback,
+ infrun_thread_stop_requested): New.
+ (handle_inferior_event): If a TARGET_SIGNAL_TRAP is reported on a
+ thread that had an explicit stop request, pretend we got a
+ TARGET_SIGNAL_0. Always stop if the thread had an explicit stop
+ request.
+ (print_stop_reason): In the SIGNAL_RECEIVED case, if we're not
+ outputting to MI, and we got a TARGET_SIGNAL_0, print "# Stopped",
+ instead of mentioning signal 0.
+ (ptid_is_pid): New.
+ * thread.c (set_stop_requested): New.
+
+ * linux-nat.c (queued_waitpid): Rename to ...
+ (queued_waitpid_1): ... this. Add `peek' argument. Handle it.
+ (queued_waitpid): New, as wrapper to queued_waitpid_1.
+ (push_waitpid): Push the SIGTRAP to the local event queue, to the
+ kernel's.
+ (send_sigint_callback): Delete.
+ (linux_nat_stop_lwp): New.
+ (linux_nat_stop): Use it.
+
+2008-10-23 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * python/python-value (valpy_getitem): Fix heap corruption.
+
+2008-10-23 Aleksandar Ristovski <aristovski@qnx.com>
+
+ * nto-procfs.c (do_attach): Form proper ptid including pid and tid.
+ (procfs_create_inferior): Fetch list of threads.
+
+2008-10-23 Aleksandar Ristovski <aristovski@qnx.com>
+
+ * nto-procfs.c (procfs_files_info): Fix a typo.
+ (procfs_create_inferior): Make attach_flag per-inferior.
+
+2008-10-23 Tom Tromey <tromey@redhat.com>
+
+ * python/python-value.c (value_to_value_object): Initialize
+ owned_by_gdb field.
+ (valpy_new): Likewise.
+
+2008-10-23 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Joel Brobecker <brobecker@adacore.com>
+
+ * ada-tasks.c (task_states, long_task_states): Use constant N_()
+ initializer. Define the strings as const.
+ (short_task_info, info_task): Translate the strings above.
+
+2008-10-22 Joel Brobecker <brobecker@adacore.com>
+
+ * NEWS: Add entry for new feature (Ada tasking support).
+
+2008-10-22 Joel Brobecker <brobecker@adacore.com>
+
+ * configure.ac: On alpha-osf, error out if enable_tui is set to
+ "yes", and set enable_tui to "no" if previously set to "auto".
+ Check for waddstr only if TUI support was requested. Move the
+ part of the configure script that updates various Makefile
+ variables up, together with the check for waddstr.
+ * configure: Regenerate.
+
+2008-10-22 Joel brobecker <brobecker@adacore.com>
+
+ * gdbtypes.c (copy_type): New function.
+ * gdbtypes.h (copy_type): Add declaration.
+ * ada-lang.c (ada_to_fixed_type_1): If there is a parallel XVZ
+ variable, then use it.
+
+2008-10-22 Joel Brobecker <brobecker@adacore.com>
+
+ * target.h (struct target_ops): Add new field to_get_ada_task_ptid.
+ (target_get_ada_task_ptid): New macro.
+ * target.c (default_get_ada_task_ptid): New function.
+ (update_current_target): Inherit field default_get_ada_task_ptid.
+ (update_current_target): Make default_get_ada_task_ptid the default
+ value for field to_get_ada_task_ptid.
+ * ada-lang.h (struct task_control_block): Delete. Never used.
+ (struct task_ptid, task_ptid_t, struct task_entry, task_list):
+ Likewise.
+ (struct ada_task_info): New.
+ (ada_task_is_alive, ada_find_printable_frame)
+ (ada_task_list_iterator_ftype, iterate_over_live_ada_tasks): Add
+ declarations.
+ (ada_build_task_list): Update prototype.
+ (init_task_list, ada_is_exception_breakpoint): Remove prototypes.
+ * ada-lang.c (ada_find_printable_frame): Make non-static.
+ * ada-tasks.c: New file.
+ * Makefile.in (SFILES): Add ada-tasks.c.
+ (COMMON_OBS): Add ada-tasks.o.
+ * linux-thread-db.c (thread_db_find_thread_from_tid)
+ (thread_db_get_ada_task_ptid): New functions.
+ (init_thread_db_ops): Set thread_db_ops.to_get_ada_task_ptid.
+
+2008-10-22 Tom Tromey <tromey@redhat.com>
+
+ PR gdb/2506:
+ * c-exp.y (string_exp): New production.
+ (exp): Use it.
+
+2008-10-21 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * mips-tdep.c (mips_n32n64_fp_arg_chunk_p): Update TYPE_FIELD_STATIC
+ removed before.
+
+2008-10-20 Joel Brobecker <brobecker@adacore.com>
+
+ * NEWS: Add entry mentioning thread-support on Tru64
+
+2008-10-19 Joel Brobecker <brobecker@adacore.com>
+
+ * dec-thread.c: New file.
+ * config/alpha/alpha-osf3.mh (NATDEPFILES): Add dec-thread.o.
+ (NAT_CLIBS): Define.
+
+2008-10-19 Hui Zhu <teawater@gmail.com>
+
+ * infrun.c (handle_inferior_event): Set "stop_pc" when
+ TARGET_WAITKIND_NO_HISTORY.
+
+2008-10-19 Pedro Alves <pedro@codesourcery.com>
+
+ * python/python-value.c (value_object_methods)
+ (value_object_as_number, value_object_as_mapping): Move to bottom
+ of file.
+ (valpy_dealloc, valpy_new, valpy_length, valpy_getitem)
+ (valpy_setitem, valpy_str, valpy_add, valpy_subtract)
+ (valpy_multiply, valpy_divide, valpy_remainder, valpy_power)
+ (valpy_negative, valpy_positive, valpy_absolute, valpy_nonzero)
+ (valpy_richcompare, valpy_dereference): Don't forward-declare.
+ (valpy_length) [HAVE_LIBPYTHON2_4]: Change return type to `int'.
+
+2008-10-18 Pedro Alves <pedro@codesourcery.com>
+
+ * infrun.c (adjust_pc_after_break): Do nothing if executing in
+ reverse.
+
+2008-10-17 Pedro Alves <pedro@codesourcery.com>
+
+ * infcmd.c (GO_USAGE): Delete.
+ (go_command): Adjust.
+
+2008-10-17 Michael Snyder <msnyder@vmware.com>
+ Target interface for reverse debugging.
+ * target.h (enum target_waitkind):
+ Add new wait event, TARGET_WAITKIND_NO_HISTORY.
+ (struct target_ops): New method to_can_execute_reverse.
+ (target_can_execute_reverse): New macro.
+ * target.c (update_current_target): Inherit to_can_execute_reverse.
+
+ Remote interface for reverse debugging.
+ * remote.c (remote_can_execute_reverse): New target method.
+ (remote_resume): Check for reverse exec direction, and send
+ appropriate command to target.
+ (remote_wait_as): Check target response for NO_HISTORY status.
+ Also check for empty reply (target doesn't understand "bs" or "bc).
+ (remote_vcont_resume): Jump out if attempting reverse execution.
+
+ Event handling interface for reverse debugging.
+ * infrun.c (execution_direction): New state variable.
+ (enum inferior_stop_reason): Add NO_HISTORY reason.
+ (handle_inferior_event): Handle TARGET_WAITKIND_NO_HISTORY.
+ Handle stepping over a function call in reverse.
+ Handle stepping thru a line range in reverse.
+ Handle setting a step-resume breakpoint in reverse.
+ Handle stepping into a function in reverse.
+ Handle stepping between line ranges in reverse.
+ (print_stop_reason): Print reason for NO_HISTORY.
+ (step_into_function): Rename to handle_step_into_function.
+ (handle_step_into_function_backward): New function.
+ (set_exec_direction_func, show_exec_direction_func): New funcs.
+ (proceed): No need to singlestep over a breakpoint
+ when resuming in reverse.
+
+ * inferior.h (enum exec_direction_kind): New enum.
+ (execution_direction): Export new execution state variable.
+
+ * breakpoint.c (make_breakpoint_silent): New function.
+ * breakpoint.h (make_breakpoint_silent): Export.
+ * infcmd.c (finish_command): Check for reverse exec direction.
+ (finish_backward): New function, handle finish cmd in reverse.
+
+ User interface for reverse execution.
+ * Makefile.in (reverse.c): New file.
+ * reverse.c: New file. User interface for reverse execution.
+
+2008-10-17 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (record_currthread): Add inferior before child threads.
+ (remote_threads_info): Check for exited threads. Mention
+ notification order.
+
+2008-10-16 Joel Brobecker <brobecker@adacore.com>
+
+ * breakpoint.h (enum bptype): New enum bp_catchpoint.
+ Delete bp_catch_fork and bp_catch_vfork.
+ (struct breakpoint_ops): Add new methods "insert", "remove"
+ and "breakpoint_hit".
+ * breakpoint.c (create_fork_vfork_event_catchpoint)
+ (create_fork_event_catchpoint, create_vfork_event_catchpoint): Remove.
+ (insert_catchpoint): Remove handling of bp_catch_fork and
+ bp_catch_vfork catchpoints, and handle them as bp_catchpoint
+ catchpoints instead.
+ (insert_bp_location, update_breakpoints_after_exec)
+ (remove_breakpoint, bpstat_check_location, bpstat_what)
+ (allocate_bp_location): Likewise.
+ (print_it_typical, print_one_breakpoint_location, mention): Remove
+ handling of bp_catch_fork and bp_catch_vfork breakpoints.
+ (ep_is_catchpoint, user_settable_breakpoint)
+ (breakpoint_address_is_meaningful, adjust_breakpoint_address)
+ (breakpoint_re_set_one, disable_command, enable_command):
+ Remove use of bp_catch_fork and bp_catch_vfork. Add handling of
+ bp_catchpoint breakpoints.
+ (insert_catch_fork, remove_catch_fork, breakpoint_hit_catch_fork)
+ (print_it_catch_fork, print_one_catch_fork, print_mention_catch_fork):
+ New functions.
+ (catch_fork_breakpoint_ops): New static constant.
+ (insert_catch_vfork, remove_catch_vfork, breakpoint_hit_catch_vfork)
+ (print_it_catch_vfork, print_one_catch_vfork)
+ (print_mention_catch_vfork): New functions.
+ (catch_vfork_breakpoint_ops): New static constant.
+ (create_catchpoint, create_fork_vfork_event_catchpoint): New functions.
+ (catch_fork_command_1): Use create_fork_vfork_event_catchpoint
+ to create the fork and vfork catchpoints.
+ (gnu_v3_exception_catchpoint_ops): Set new breakpoint_ops fields.
+ * ada-lang.c (catch_exception_breakpoint_ops): Set new breakpoint_ops
+ fields.
+ (catch_exception_unhandled_breakpoint_ops): Likewise.
+ (catch_assert_breakpoint_ops): Likewise.
+
+2008-10-16 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (set_general_process): New.
+ (remote_check_symbols): Use it.
+
+2008-10-16 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (push_remote_target): Delete.
+ * target.h (push_remote_target): Delete declaration.
+
+2008-10-15 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (remote_close): Unregister remote_desc from the event
+ loop. Always restore the SIGINT handler. Discard all inferiors
+ here.
+ (remote_detach_1, remote_disconnect): Don't unregister the file
+ descriptor from the event loop here.
+ (interrupt_query, readchar, getpkt_sane): Pop the target instead
+ of morning the current inferior.
+ (remote_kill): Don't unregister the file descriptor from the event
+ loop here.
+ (remote_mourn_1): Don't discard inferiors here.
+
+2008-10-15 Pedro Alves <pedro@codesourcery.com>
+
+ * breakpoint.c (breakpoint_init_inferior): Clean up the moribund
+ locations list.
+ (moribund_breakpoint_here_p): Record the moribund
+ location in the moribund_locations vector.
+ * breakpoint.h (moribund_breakpoint_here_p): Declare.
+ (displaced_step_fixup): Check if the breakpoint the thread was
+ trying to step over has been removed since having been placed in
+ the displaced stepping queue.
+ (adjust_pc_after_break): In non-stop mode, check for a moribund
+ breakpoint at the stop pc.
+ (handle_inferior_event): Don't retire moribund breakpoints on
+ TARGET_WAITKIND_IGNORE.
+
+2008-10-15 Pedro Alves <pedro@codesourcery.com>
+
+ * infrun.c (displaced_step_prepare): Switch thread temporarily
+ while we're here.
+ (displaced_step_fixup): Make sure target_resume sees ptid as
+ inferior_ptid. Add debug output.
+
+2008-10-14 Pedro Alves <pedro@codesourcery.com>
+
+ Remove dead code.
+
+ * breakpoint.c (show_breakpoint_hit_counts): Delete.
+ (print_one_breakpoint_location): Adjust.
+ (breakpoint_clear_ignore_counts): Delete.
+ * breakpoint.h (breakpoint_clear_ignore_counts): Remove
+ declaration.
+ * target.c (generic_mourn_inferior): Don't clear ignore
+ counts (never reached).
+
+2008-10-10 Doug Evans <dje@google.com>
+
+ * dwarf2read.c (comp_unit_head): Use unsigned int consistently
+ for dwarf section offsets and sizes.
+ (dwarf2_cu): Ditto.
+ (dwarf2_per_cu_data): Ditto.
+ (create_all_comp_units): Change offset to unsigned int.
+ (load_full_comp_unit,find_partial_die_in_comp_unit,find_partial_die,
+ dwarf2_find_containing_comp_unit,dwarf2_find_comp_unit): Ditto.
+
+ * dwarf2read.c (read_initial_length): Delete cu_header arg.
+ All callers updated.
+ (read_checked_initial_length_and_offset): New function.
+ (read_offset_1): New function.
+ (read_offset): Call it.
+ (dwarf_decode_line_header): Call read_checked_initial_length_and_offset
+ instead of read_initial_length. Call read_offset_1 instead of
+ read_offset.
+
+ * dwarf2read.c (dwarf2_get_ref_die_offset): Remove unused arg `cu'.
+ All callers updated.
+
+ * dwarf2read.c (dwarf_attr_name): Unconditionally support all
+ DW_AT_MIPS_* except DW_AT_MIPS_fde which collides with
+ DW_AT_HP_block_index.
+
+2008-10-10 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (remote_start_remote): Always tell the stub if we're in
+ extended-remote.
+
+2008-10-09 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (remote_wait): Rename to...
+ (remote_wait_as): ... this. Don't loop here. If the remote
+ didn't stop, return TARGET_WAITKIND_IGNORE.
+ (remote_wait): New, reimplemented on top of remote_wait_as.
+
+2008-10-09 Thomas Schwinge <tschwinge@gnu.org>
+
+ * Makefile.in (gnu-nat.o): Revert the 2008-09-10 change, as the problem
+ is fixed upstream.
+
+ * reply_mig_hack.awk: Use the `BAD_TYPECHECK' macro.
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2008-10-09 Pedro Alves <pedro@codesourcery.com>
+
+ Make it compile without warnings.
+
+ * procfs.c (create_procinfo): Initialize `parent'.
+ (dead_procinfo): Pass a constant string as format to error.
+ (procfs_address_to_host_pointer): Add cast to gdb_type *.
+ (procfs_find_LDT_entry): Adjust format string to long int
+ ptid.tid.
+ (procfs_xfer_partial): Adjust prototype. Add gdb_byte* cast.
+ (procfs_xfer_memory): Adjust prototype.
+ (info_mappings_callback, info_proc_mappings): Adjust to not pass a
+ variable as printf_filtered format.
+ (procfs_make_note_section): Change type of auxv local to gdb_byte.
+ * Makefile.in: Remove special rule.
+
+2008-10-09 Pedro Alves <pedro@codesourcery.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+
+ * remote.c (remote_open_1): Move acknowledging any pending ack,
+ querying supported features, activating noack mode, finding the
+ target description, enabling extended remote, and checking remote
+ symbols from here ...
+ (remote_start_remote): ... to here.
+ (remote_open_1): Don't pop the target if it is already gone.
+ * target.c (unpush_target): Check for the dummy target.
+
+2008-10-09 Pedro Alves <pedro@codesourcery.com>
+
+ * ser-mingw.c: Include "command.h".
+ (pipe_windows_open): Declare locals at the beginning of the scope.
+
+2008-10-08 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (struct remote_state) <waiting_for_stop_reply>: New
+ field.
+ (remote_open_1): Clear waiting_for_stop_reply.
+ (remote_resume): Set waiting_for_stop_reply.
+ (remote_wait): Clear or set waiting_for_stop_reply accordingly.
+ (putpkt_binary): If we're in async mode and waiting for a stop
+ reply, bail out with an error.
+ (extended_remote_mourn_1): Clear waiting_for_stop_reply.
+
+2008-10-08 Pedro Alves <pedro@codesourcery.com>
+
+ * remote.c (remote_get_thread_info): If the remote doesn't support
+ the query, bail out.
+
+2008-10-08 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Convert static_kind into loc_kind enum.
+ * gdbtypes.h (enum field_loc_kind): New.
+ (union field_location): New field dwarf_block.
+ (struct field): Rename static_kind as loc_kind.
+ (FIELD_STATIC_KIND): Rename to ...
+ (FIELD_LOC_KIND): ... here.
+ (TYPE_FIELD_STATIC_KIND): Rename to ...
+ (TYPE_FIELD_LOC_KIND): ... here and use there now new FIELD_LOC_KIND.
+ (TYPE_FIELD_STATIC_HAS_ADDR): Remove.
+ (TYPE_FIELD_STATIC): Remove.
+ (TYPE_FIELD_BITPOS): Reformat.
+ (SET_FIELD_BITPOS): New.
+ (FIELD_PHYSADDR): Rename to ...
+ (FIELD_STATIC_PHYSADDR): ... here.
+ (TYPE_FIELD_STATIC_PHYSADDR): Follow the FIELD_PHYSADDR rename.
+ (SET_FIELD_PHYSADDR): Use new FIELD_LOC_KIND.
+ (FIELD_PHYSNAME): Rename to ...
+ (FIELD_STATIC_PHYSNAME): ... here.
+ (TYPE_FIELD_STATIC_PHYSNAME): Follow the FIELD_PHYSNAME rename.
+ (SET_FIELD_PHYSNAME): Use new FIELD_LOC_KIND.
+ (FIELD_DWARF_BLOCK, TYPE_FIELD_DWARF_BLOCK, SET_FIELD_DWARF_BLOCK): New.
+ (field_is_static): New declaration.
+ * gdbtypes.c (field_is_static): New function.
+ (copy_type_recursive): Update throughout.
+ * amd64-tdep.c, c-typeprint.c, coffread.c, cp-valprint.c, dwarf2read.c,
+ eval.c, jv-typeprint.c, jv-valprint.c, mdebugread.c, p-typeprint.c,
+ p-valprint.c, valops.c, value.c, varobj.c: Update throughout.
+
+2008-10-07 Thomas Schwinge <tschwinge@gnu.org>
+ Pedro Alves <pedro@codesourcery.com>
+
+ * gnu-nat.h: Rename `current_inferior' to `gnu_current_inf' to
+ avoid a name collision.
+ * gnu-nat.c: Likewise.
+ * i386gnu-nat.c: Likewise.
+
+2008-10-07 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (ada_evaluate_subexp) [OP_ATR_SIZE]: Add handling
+ of arguments that are references.
+
+2008-10-06 Doug Evans <dje@google.com>
+
+ * dwarf2read.c (dwarf2_die_debug): New static global.
+ (dump_die_shallow): Renamed from dump_die, New args f, indent.
+ Print to specified file, indented by the specified amount.
+ (dump_die_for_error): New fn. Point all existing callers of
+ dump_die here.
+ (dump_die_die_1,dump_die): New fns, replaces ...
+ (dump_die_list): ... deleted.
+ (read_die_and_children_1): Old contents of read_die_and_children
+ moved here.
+ (read_die_and_children): Rewrite.
+ (read_die_and_siblings): Call read_die_and_children_1 instead of
+ read_die_and_children.
+ (_initialize_dwarf2_read): New option "debug dwarf2-die".
+ * gdbinit.in (pdie): New macro.
+
+ * dwarf2read.c (offset_in_cu_p): New function.
+ (find_partial_die,follow_die_ref): Use it.
+
+ * symmisc.c (maintenance_info_symtabs): Watch for ^c.
+ (maintenance_info_psymtabs): Ditto.
+
+2008-10-05 Michael Snyder <msnyder@vmware.com>
+
+ * infrun.c (handle_inferior_event): Fix typo in comment.
+
+2008-10-04 Vladimir Prus <vladimir@codesourcery.com>
+
+ * mi/mi-interp.c (mi_on_resume): Flush raw_stdout.
+
+2008-10-03 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ PR gdb/2384:
+ * gdbtypes.c (get_vptr_fieldno): baseclass and basetype may have
+ different lifetimes.
+
+2008-10-03 Joel Brobecker <brobecker@adacore.com>
+
+ * solib-osf.c: Include "solib.h".
+
+2008-10-03 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * utils.c, defs.h (gdb_buildargv): New fn. Wrap buildargv
+ and check for out-of-memory condition.
+ * exec.c (exec_file_command): Call it.
+ * infrun.c (handle_command, xdb_handle_command): Likewise.
+ * interps.c (interpreter_exec_cmd): Likewise.
+ * linux-nat.c (linux_nat_info_proc_cmd): Likewise.
+ * procfs.c (info_proc_cmd): Likewise.
+ * remote-mips.c (common_open): Likewise.
+ * remote-sim.c (gdbsim_kill, gdbsim_create_inferior)
+ (gdbsim_open): Likewise.
+ * remote.c (extended_remote_run, remote_put_command)
+ (remote_get_command, remote_delete_command): Likewise.
+ * ser-mingw.c (pipe_windows_open): Likesise.
+ * source.c (add_path, show_substitute_path_command)
+ (unset_substitute_path_command, set_substitute_path_command):
+ Likewise.
+ * stack.c (backtrace_command): Likewise.
+ * symfile.c (symbol_file_command, generic_load)
+ (add_symbol_file_command): Likesise.
+ * symmisc.c (maintenance_print_symbols, maintenance_print_psymbols)
+ (maintenance_print_msymbols): Likewise.
+
+2008-10-02 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Replace TYPE_ARRAY_{UPPER,LOWER}_BOUND_TYPE by a bit if {un,}defined.
+ * c-typeprint.c (c_type_print_varspec_suffix), m2-typeprint.c
+ (m2_array), p-typeprint.c (pascal_type_print_varspec_prefix),
+ valops.c (value_cast), varobj.c (c_number_of_children): Replace
+ TYPE_ARRAY_UPPER_BOUND_TYPE compared to BOUND_CANNOT_BE_DETERMINED by
+ TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED.
+ * parse.c (follow_types): Use TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED.
+ * f-valprint.c (f77_get_dynamic_upperbound): Replace with ...
+ (f77_get_upperbound): ... this function handling now only
+ TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED.
+ (f77_get_dynamic_lowerbound): Replace with ...
+ (f77_get_lowerbound): ... this function handling now only
+ TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED.
+ (f77_get_dynamic_length_of_aggregate, f77_create_arrayprint_offset_tbl):
+ Update their callers.
+ * eval.c (evaluate_subexp_standard): Update their callers.
+ * f-lang.h (f77_get_dynamic_upperbound, f77_get_upperbound)
+ (f77_get_dynamic_lowerbound, f77_get_lowerbound): Update their
+ prototypes.
+ (BOUND_FETCH_OK, BOUND_FETCH_ERROR): Remove.
+ * f-typeprint.c (f_type_print_varspec_suffix, f_type_print_base): Remove
+ the lower_bound_was_default variable. Update the
+ f77_get_dynamic_upperbound, f77_get_upperbound and
+ TYPE_ARRAY_UPPER_BOUND_TYPE calls.
+ * gdbtypes.c (print_bound_type): Remove the function.
+ (recursive_dump_type): Remove its calls printing UPPER_BOUND_TYPE and
+ LOWER_BOUND_TYPE.
+ * gdbtypes.h (enum array_bound_type): Remove.
+ (struct main_type): Remove the fields upper_bound_type and
+ lower_bound_type. Comment the new overload of the field artificial.
+ (TYPE_ARRAY_UPPER_BOUND_TYPE): Replace by ...
+ (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED): ... this macro.
+ (TYPE_ARRAY_LOWER_BOUND_TYPE): Replace by ...
+ (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED): ... this macro.
+
+2008-10-02 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in (HFILES_NO_SRCDIR): Remove gdb-events.h, gstdint.h.
+
+2008-10-02 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * mips-linux-tdep.c (mips_linux_in_dynsym_resolve_code): Update
+ comments.
+ (mips_linux_skip_resolver): Also use glibc_skip_solib_resolver.
+ (mips_linux_init_abi): Do not override skip_trampoline_code.
+ * configure.tgt (mips*-*-linux*): Add glibc-tdep.o.
+ * mips-tdep.c (mips32_scan_prologue): Stop scanning at branches.
+ (mips_stub_frame_sniffer): Use the stub frame sniffer for PIC stubs.
+ (mips_skip_mips16_trampoline_code): Rename from
+ mips_skip_trampoline_code.
+ (mips_skip_pic_trampoline_code, mips_skip_trampoline_code): New.
+ * infrun.c (handle_inferior_event): Do not pass zero to
+ in_solib_dynsym_resolve_code.
+
+2008-10-02 Pierre Muller <muller@ics.u-strasbg.fr>
+ Pedro Alves <pedro@codesourcery.com>
+
+ * win32-nat.c (do_initial_win32_stuff): Set inferior_ptid.
+
+
+2008-10-01 Tom Tromey <tromey@redhat.com>
+
+ * symtab.c (search_symbols): Update.
+ * symtab.h (domain_enum_tag) <METHODS_DOMAIN>: Remove.
+
+2008-10-01 Tom Tromey <tromey@redhat.com>
+
+ * symfile.c (syms_from_objfile): Update.
+ (reread_symbols): Update.
+ * objfiles.h (OBJF_SYMS): Remove.
+ (OBJF_REORDERED): Renumber.
+ (OBJF_SHARED): Likewise.
+ (OBJF_READNOW): Likewise.
+ (OBJF_USERLOADED): Likewise.
+
+2008-10-01 Tom Tromey <tromey@redhat.com>
+
+ * symtab.c (find_pc_sect_psymtab): Use MSYMBOL_TYPE.
+ (find_pc_sect_symtab): Likewise.
+ * symmisc.c (dump_msymbols): Use MSYMBOL_TYPE.
+ * solib-som.c (som_solib_desire_dynamic_linker_symbols): Use
+ MSYMBOL_TYPE, not SYMBOL_TYPE.
+ * parse.c (write_exp_msymbol): Use MSYMBOL_TYPE.
+ * objc-lang.c (find_methods): Use MSYMBOL_TYPE.
+ * minsyms.c (lookup_minimal_symbol_by_pc_section_1): Use
+ MSYMBOL_TYPE.
+ * m2-exp.y (yylex): Use SYMBOL_CLASS.
+
+2008-10-01 Tom Tromey <tromey@redhat.com>
+
+ * xcoffread.c (RECORD_MINIMAL_SYMBOL): Update.
+ (scan_xcoff_symtab): Update.
+ * mdebugread.c (record_minimal_symbol): Update.
+ (parse_partial_symbols): Update.
+ * elfread.c (record_minimal_symbol): Update.
+ * dbxread.c (record_minimal_symbol): Update.
+ * coffread.c (record_minimal_symbol): Update.
+ * sh64-tdep.c (MSYMBOL_IS_SPECIAL): Redefine.
+ (sh64_elf_make_msymbol_special): Update.
+ * mips-tdep.c (mips_elf_make_msymbol_special): Use
+ MSYMBOL_TARGET_FLAG_1.
+ (mips_elf_make_msymbol_special): Likewise.
+ (msymbol_is_special): Likewise.
+ * minsyms.c (prim_record_minimal_symbol_and_info): Update.
+ (install_minimal_symbols): Likewise.
+ (prim_record_minimal_symbol): Update.
+ (prim_record_minimal_symbol_and_info): Remove 'info' argument.
+ * m68hc11-tdep.c (MSYMBOL_SET_RTC): Redefine.
+ (MSYMBOL_SET_RTI): Redefine.
+ (MSYMBOL_IS_RTC): Redefine.
+ (MSYMBOL_IS_RTI): Redefine.
+ * arm-tdep.c (MSYMBOL_SET_SPECIAL): Redefine.
+ (MSYMBOL_IS_SPECIAL): Redefine.
+ * symtab.h (struct minimal_symbol) <info>: Remove.
+ <target_flag_1, target_flag_2>: New fields.
+ (MSYMBOL_INFO): Remove.
+ (MSYMBOL_TARGET_FLAG_1): New macro.
+ (MSYMBOL_TARGET_FLAG_2): Likewise.
+ (prim_record_minimal_symbol_and_info): Update.
+
+2008-09-30 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (is_digits_suffix): Delete unused function.
+
2008-09-30 Paul Hilfinger <hilfinger@adacore.com>
* ada-lang.c (ada_modulus): Correct to avoid sign problem with
@@ -7838,9 +9389,9 @@
* target.c (memory_xfer_partial): Call
breakpoint_restore_shadows.
(restore_show_memory_breakpoints)
- (make_show_memory_beakpoints_cleanup): New.
+ (make_show_memory_breakpoints_cleanup): New.
(show_memory_breakpoints): New.
- * target.h (make_show_memory_beakpoints_cleanup): Declare.
+ * target.h (make_show_memory_breakpoints_cleanup): Declare.
* ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint):
Make sure we see memory breakpoints when checking if
breakpoint is still there.
@@ -8047,7 +9598,7 @@
val_valid.
* NEWS: Mention watchpoints on inaccessible memory.
-2007-02-29 Daniel Jacobowitz <dan@codesourcery.com>
+2008-02-29 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (i386-nat.o): Update.
* amd64-linux-nat.c (_initialize_amd64_linux_nat): Call
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index cccd57a..150b6e4 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -564,9 +564,11 @@ Mark Salter msalter@redhat.com
Richard Sandiford richard@codesourcery.com
Peter Schauer Peter.Schauer@mytum.de
Andreas Schwab schwab@suse.de
+Thomas Schwinge tschwinge@gnu.org
Keith Seitz keiths@redhat.com
Carlos Eduardo Seo cseo@linux.vnet.ibm.com
Stan Shebs stan@codesourcery.com
+Joel Sherrill joel.sherrill@oarcorp.com
Mark Shinwell shinwell@codesourcery.com
Craig Silverstein csilvers@google.com
Aidan Skinner aidan@velvet.net
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 2cd5596..5432c88 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -185,15 +185,14 @@ GNULIB_H = gnulib/string.h @GNULIB_STDINT_H@
#
SUBDIR_CLI_OBS = \
cli-dump.o \
- cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-utils.o \
+ cli-decode.o cli-script.o cli-cmds.o cli-setshow.o \
cli-logging.o \
cli-interp.o
SUBDIR_CLI_SRCS = \
cli/cli-dump.c \
cli/cli-decode.c cli/cli-script.c cli/cli-cmds.c cli/cli-setshow.c \
cli/cli-logging.c \
- cli/cli-interp.c \
- cli/cli-utils.c
+ cli/cli-interp.c
SUBDIR_CLI_DEPS =
SUBDIR_CLI_LDFLAGS=
SUBDIR_CLI_CFLAGS=
@@ -271,10 +270,12 @@ SUBDIR_TUI_CFLAGS= \
#
SUBDIR_PYTHON_OBS = \
python.o \
- python-utils.o
+ python-utils.o \
+ python-value.o
SUBDIR_PYTHON_SRCS = \
python/python.c \
- python/python-utils.c
+ python/python-utils.c \
+ python/python-value.c
SUBDIR_PYTHON_DEPS =
SUBDIR_PYTHON_LDFLAGS=
SUBDIR_PYTHON_CFLAGS=
@@ -409,13 +410,13 @@ INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_
# If you have the Cygnus libraries installed,
# you can use 'CLIBS=$(INSTALLED_LIBS)' 'CDEPS='
INSTALLED_LIBS=-lbfd -lreadline -lopcodes -liberty -ldecnumber \
- $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
+ $(XM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
-lintl -liberty $(LIBGNU)
CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \
- $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
+ $(XM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
$(LIBICONV) $(LIBEXPAT) \
$(LIBIBERTY) $(WIN32LIBS) $(LIBGNU)
-CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
+CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
$(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
ADD_FILES = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
@@ -609,7 +610,7 @@ TARGET_FLAGS_TO_PASS = \
# Links made at configuration time should not be specified here, since
# SFILES is used in building the distribution archive.
-SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c \
+SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
addrmap.c \
auxv.c ax-general.c ax-gdb.c \
bcache.c \
@@ -639,7 +640,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c \
objfiles.c osabi.c observer.c \
p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c printcmd.c \
prologue-value.c \
- regcache.c reggroups.c remote.c remote-fileio.c \
+ regcache.c reggroups.c remote.c remote-fileio.c reverse.c \
scm-exp.c scm-lang.c scm-valprint.c \
sentinel-frame.c \
serial.c ser-base.c ser-unix.c \
@@ -676,11 +677,11 @@ osf-share/cma_stack_int.h osf-share/cma_init.h \
osf-share/cma_deb_core.h osf-share/AT386/cma_thread_io.h \
osf-share/cma_sched.h proc-utils.h arm-tdep.h ax-gdb.h ppcnbsd-tdep.h \
cli-out.h gdb_expat.h breakpoint.h infcall.h obsd-tdep.h gnu-v2-abi.h \
-exec.h m32r-tdep.h osabi.h gdb-events.h gdbcore.h solib-som.h \
+exec.h m32r-tdep.h osabi.h gdbcore.h solib-som.h \
i386bsd-nat.h xml-support.h xml-tdesc.h alphabsd-tdep.h gdb_obstack.h \
ia64-tdep.h ada-lang.h varobj.h frv-tdep.h nto-tdep.h serial.h \
c-lang.h frame.h event-loop.h block.h cli/cli-setshow.h \
-cli/cli-decode.h cli/cli-cmds.h cli/cli-utils.h cli/cli-dump.h \
+cli/cli-decode.h cli/cli-cmds.h cli/cli-dump.h \
cli/cli-script.h macrotab.h symtab.h version.h gnulib/wchar.in.h \
gnulib/string.in.h gnulib/str-two-way.h gnulib/extra/link-warning.h \
gnulib/stdint.in.h remote.h gdb.h sparc-nat.h gdbserver/win32-low.h \
@@ -693,7 +694,7 @@ gdbarch.h bsd-uthread.h gdb_thread_db.h gdb_stat.h memory-map.h \
mdebugread.h m88k-tdep.h stabsread.h hppa-linux-offsets.h linux-fork.h \
ser-unix.h scm-lang.h inf-ptrace.h terminal.h ui-out.h frame-base.h \
f-lang.h dwarf2loc.h value.h sparc-tdep.h defs.h target-descriptions.h \
-objfiles.h vec.h disasm.h mips-tdep.h gstdint.h ser-base.h \
+objfiles.h vec.h disasm.h mips-tdep.h ser-base.h \
gdb_curses.h bfd-target.h memattr.h inferior.h ax.h dummy-frame.h \
inflow.h fbsd-nat.h libunwind-frame.h completer.h inf-ttrace.h \
solib-target.h shnbsd-tdep.h gdb_vfork.h alpha-tdep.h dwarf2expr.h \
@@ -778,11 +779,13 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
findcmd.o \
std-regs.o \
signals.o \
- exec.o bcache.o objfiles.o observer.o minsyms.o maint.o demangle.o \
+ exec.o reverse.o \
+ bcache.o objfiles.o observer.o minsyms.o maint.o demangle.o \
dbxread.o coffread.o coff-pe-read.o \
dwarf2read.o mipsread.o stabsread.o corefile.o \
dwarf2expr.o dwarf2loc.o dwarf2-frame.o \
ada-lang.o c-lang.o f-lang.o objc-lang.o \
+ ada-tasks.o \
ui-out.o cli-out.o \
varobj.o vec.o wrapper.o \
jv-lang.o jv-valprint.o jv-typeprint.o \
@@ -1346,13 +1349,6 @@ ALLDEPFILES = \
# Some files need explicit build rules (due to -Werror problems) or due
# to sub-directory fun 'n' games.
-# "gnu-nat.c" gets "suggest parentheses around assignment used as
-# truth value" errors. It turns out that there is a system header
-# that does `if (a = b)'.
-gnu-nat.o: $(srcdir)/gnu-nat.c
- $(COMPILE.pre) $(INTERNAL_WARN_CFLAGS) $(COMPILE.post) $(srcdir)/gnu-nat.c
- $(POSTCOMPILE)
-
hpux-thread.o: $(srcdir)/hpux-thread.c
$(COMPILE) -I$(srcdir)/osf-share -I$(srcdir)/osf-share/HP800 \
-I/usr/include/dce $(srcdir)/hpux-thread.c
@@ -1380,12 +1376,6 @@ printcmd.o: $(srcdir)/printcmd.c
$(GDB_WERROR_CFLAGS) $(COMPILE.post) $(srcdir)/printcmd.c
$(POSTCOMPILE)
-# FIXME: Procfs.o gets -Wformat errors because things like pid_t don't
-# match output format strings.
-procfs.o: $(srcdir)/procfs.c
- $(COMPILE.pre) $(INTERNAL_WARN_CFLAGS) $(COMPILE.post) $(srcdir)/procfs.c
- $(POSTCOMPILE)
-
# Message files. Based on code in gcc/Makefile.in.
# Rules for generating translated message descriptions. Disabled by
@@ -1479,6 +1469,8 @@ po/$(PACKAGE).pot: force
-e '/include.*malloc.h/d' \
-e 's/\([^x]\)malloc/\1xmalloc/g' \
-e 's/\([^x]\)realloc/\1xrealloc/g' \
+ -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
+ -e 's/\([ \t;,(]\)free$$/\1xfree/g' \
-e '/^#line.*y.tab.c/d' \
< $@.tmp > $@.new
-rm $@.tmp
@@ -1493,6 +1485,8 @@ po/$(PACKAGE).pot: force
-e '/include.*malloc.h/d' \
-e 's/\([^x]\)malloc/\1xmalloc/g' \
-e 's/\([^x]\)realloc/\1xrealloc/g' \
+ -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
+ -e 's/\([ \t;,(]\)free$$/\1xfree/g' \
-e 's/yy_flex_xrealloc/yyxrealloc/g' \
< $@ > $@.new && \
rm -f $@ && \
@@ -1559,10 +1553,6 @@ cli-setshow.o: $(srcdir)/cli/cli-setshow.c
$(COMPILE) $(srcdir)/cli/cli-setshow.c
$(POSTCOMPILE)
-cli-utils.o: $(srcdir)/cli/cli-utils.c
- $(COMPILE) $(srcdir)/cli/cli-utils.c
- $(POSTCOMPILE)
-
#
# GDBTK sub-directory
@@ -1849,6 +1839,10 @@ python-utils.o: $(srcdir)/python/python-utils.c
$(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-utils.c
$(POSTCOMPILE)
+python-value.o: $(srcdir)/python/python-value.c
+ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/python-value.c
+ $(POSTCOMPILE)
+
#
# Dependency tracking. Most of this is conditional on GNU Make being
# found by configure; if GNU Make is not found, we fall back to a
diff --git a/gdb/NEWS b/gdb/NEWS
index 46aa1448..86125c9 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -57,6 +57,8 @@ with the --compress-debug-sections=zlib flag.
* 64-bit core files are now supported on AIX.
+* Thread switching is now supported on Tru64.
+
* Watchpoints can now be set on unreadable memory locations, e.g. addresses
which will be allocated using malloc later in program execution.
@@ -83,11 +85,28 @@ are treated as the standard definitions, regardless of context.
- gdbserver uses the new noack protocol mode for TCP connections to
reduce communications latency, if also supported and enabled in GDB.
+ - Support for the sparc64-linux-gnu target is now included in
+ gdbserver.
+
* Python scripting
GDB now has support for scripting using Python. Whether this is
available is determined at configure time.
+* Ada tasking support
+
+ Ada tasks can now be inspected in GDB. The following commands have
+ been introduced:
+
+ info tasks
+ Print the list of Ada tasks.
+ info task N
+ Print detailed information about task number N.
+ task
+ Print the task number of the current task.
+ task N
+ Switch the context of debugging to task number N.
+
* New commands
find [/size-char] [/max-count] start-address, end-address|+search-space-size,
@@ -157,6 +176,12 @@ macro undef
x86 DICOS i[34567]86-*-dicos*
+* Removed commands
+
+catch load
+catch unload
+ These commands were actually not implemented on any target.
+
*** Changes in GDB 6.8
* New native configurations
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index e440663..4b8bb93 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -987,7 +987,7 @@ write_object_renaming (struct block *orig_left_context,
if (end == NULL)
end = renaming_expr + strlen (renaming_expr);
field_name.length = end - renaming_expr;
- field_name.ptr = xmalloc (end - renaming_expr + 1);
+ field_name.ptr = malloc (end - renaming_expr + 1);
strncpy (field_name.ptr, renaming_expr, end - renaming_expr);
field_name.ptr[end - renaming_expr] = '\000';
renaming_expr = end;
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 3c4f05a..2ccba78 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -202,8 +202,6 @@ static int equiv_types (struct type *, struct type *);
static int is_name_suffix (const char *);
-static int is_digits_suffix (const char *str);
-
static int wild_match (const char *, int, const char *);
static struct value *ada_coerce_ref (struct value *);
@@ -355,9 +353,9 @@ ada_get_gdb_completer_word_break_characters (void)
static void
ada_print_array_index (struct value *index_value, struct ui_file *stream,
- int format, enum val_prettyprint pretty)
+ const struct value_print_options *options)
{
- LA_VALUE_PRINT (index_value, stream, format, pretty);
+ LA_VALUE_PRINT (index_value, stream, options);
fprintf_filtered (stream, " => ");
}
@@ -5022,17 +5020,6 @@ is_name_suffix (const char *str)
return 0;
}
-/* Return nonzero if the given string contains only digits.
- The empty string also matches. */
-
-static int
-is_digits_suffix (const char *str)
-{
- while (isdigit (str[0]))
- str++;
- return (str[0] == '\0');
-}
-
/* Return non-zero if the string starting at NAME and ending before
NAME_END contains no capital letters. */
@@ -7370,6 +7357,46 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr,
if (real_type != NULL)
return to_fixed_record_type (real_type, valaddr, address, NULL);
}
+
+ /* Check to see if there is a parallel ___XVZ variable.
+ If there is, then it provides the actual size of our type. */
+ else if (ada_type_name (fixed_record_type) != NULL)
+ {
+ char *name = ada_type_name (fixed_record_type);
+ char *xvz_name = alloca (strlen (name) + 7 /* "___XVZ\0" */);
+ int xvz_found = 0;
+ LONGEST size;
+
+ sprintf (xvz_name, "%s___XVZ", name);
+ size = get_int_var_value (xvz_name, &xvz_found);
+ if (xvz_found && TYPE_LENGTH (fixed_record_type) != size)
+ {
+ fixed_record_type = copy_type (fixed_record_type);
+ TYPE_LENGTH (fixed_record_type) = size;
+
+ /* The FIXED_RECORD_TYPE may have be a stub. We have
+ observed this when the debugging info is STABS, and
+ apparently it is something that is hard to fix.
+
+ In practice, we don't need the actual type definition
+ at all, because the presence of the XVZ variable allows us
+ to assume that there must be a XVS type as well, which we
+ should be able to use later, when we need the actual type
+ definition.
+
+ In the meantime, pretend that the "fixed" type we are
+ returning is NOT a stub, because this can cause trouble
+ when using this type to create new types targeting it.
+ Indeed, the associated creation routines often check
+ whether the target type is a stub and will try to replace
+ it, thus using a type with the wrong size. This, in turn,
+ might cause the new type to have the wrong size too.
+ Consider the case of an array, for instance, where the size
+ of the array is computed from the number of elements in
+ our array multiplied by the size of its element. */
+ TYPE_STUB (fixed_record_type) = 0;
+ }
+ }
return fixed_record_type;
}
case TYPE_CODE_ARRAY:
@@ -9069,14 +9096,21 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
case OP_ATR_SIZE:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ type = value_type (arg1);
+
+ /* If the argument is a reference, then dereference its type, since
+ the user is really asking for the size of the actual object,
+ not the size of the pointer. */
+ if (TYPE_CODE (type) == TYPE_CODE_REF)
+ type = TYPE_TARGET_TYPE (type);
+
if (noside == EVAL_SKIP)
goto nosideret;
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value_zero (builtin_type_int32, not_lval);
else
return value_from_longest (builtin_type_int32,
- TARGET_CHAR_BIT
- * TYPE_LENGTH (value_type (arg1)));
+ TARGET_CHAR_BIT * TYPE_LENGTH (type));
case OP_ATR_VAL:
evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
@@ -9170,12 +9204,18 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
arg1 = ada_coerce_ref (arg1); /* FIXME: What is this for?? */
type = ada_check_typedef (value_type (arg1));
- if (TYPE_CODE (type) == TYPE_CODE_INT && expect_type != NULL)
- /* GDB allows dereferencing an int. We give it the expected
- type (which will be set in the case of a coercion or
- qualification). */
- return ada_value_ind (value_cast (lookup_pointer_type (expect_type),
- arg1));
+ if (TYPE_CODE (type) == TYPE_CODE_INT)
+ /* GDB allows dereferencing an int. If we were given
+ the expect_type, then use that as the target type.
+ Otherwise, assume that the target type is an int. */
+ {
+ if (expect_type != NULL)
+ return ada_value_ind (value_cast (lookup_pointer_type (expect_type),
+ arg1));
+ else
+ return value_at_lazy (builtin_type (exp->gdbarch)->builtin_int,
+ (CORE_ADDR) value_as_address (arg1));
+ }
if (ada_is_array_descriptor_type (type))
/* GDB allows dereferencing GNAT array descriptors. */
@@ -9894,7 +9934,7 @@ is_known_support_routine (struct frame_info *frame)
/* Find the first frame that contains debugging information and that is not
part of the Ada run-time, starting from FI and moving upward. */
-static void
+void
ada_find_printable_frame (struct frame_info *fi)
{
for (; fi != NULL; fi = get_prev_frame (fi))
@@ -10066,7 +10106,10 @@ static void
print_one_exception (enum exception_catchpoint_kind ex,
struct breakpoint *b, CORE_ADDR *last_addr)
{
- if (addressprint)
+ struct value_print_options opts;
+
+ get_user_print_options (&opts);
+ if (opts.addressprint)
{
annotate_field (4);
ui_out_field_core_addr (uiout, "addr", b->loc->address);
@@ -10158,6 +10201,9 @@ print_mention_catch_exception (struct breakpoint *b)
static struct breakpoint_ops catch_exception_breakpoint_ops =
{
+ NULL, /* insert */
+ NULL, /* remove */
+ NULL, /* breakpoint_hit */
print_it_catch_exception,
print_one_catch_exception,
print_mention_catch_exception
@@ -10184,6 +10230,9 @@ print_mention_catch_exception_unhandled (struct breakpoint *b)
}
static struct breakpoint_ops catch_exception_unhandled_breakpoint_ops = {
+ NULL, /* insert */
+ NULL, /* remove */
+ NULL, /* breakpoint_hit */
print_it_catch_exception_unhandled,
print_one_catch_exception_unhandled,
print_mention_catch_exception_unhandled
@@ -10210,6 +10259,9 @@ print_mention_catch_assert (struct breakpoint *b)
}
static struct breakpoint_ops catch_assert_breakpoint_ops = {
+ NULL, /* insert */
+ NULL, /* remove */
+ NULL, /* breakpoint_hit */
print_it_catch_assert,
print_one_catch_assert,
print_mention_catch_assert
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index 2d13603..562a867 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -196,46 +196,37 @@ enum ada_renaming_category
/* Ada task structures. */
-/* Ada task control block, as defined in the GNAT runt-time library. */
-
-struct task_control_block
+struct ada_task_info
{
- char state;
- CORE_ADDR parent;
+ /* The PTID of the thread that this task runs on. This ptid is computed
+ in a target-dependent way from the associated Task Control Block. */
+ ptid_t ptid;
+
+ /* The ID of the task. */
+ CORE_ADDR task_id;
+
+ /* The name of the task. */
+ char name[257];
+
+ /* The current state of the task. */
+ int state;
+
+ /* The priority associated to the task. */
int priority;
- char image [32];
- int image_len; /* This field is not always present in the ATCB. */
- CORE_ADDR call;
- CORE_ADDR thread;
- CORE_ADDR lwp; /* This field is not always present in the ATCB. */
-
- /* If the task is waiting on a task entry, this field contains the
- task_id of the other task. */
- CORE_ADDR called_task;
-};
-struct task_ptid
-{
- int pid; /* The Process id */
- long lwp; /* The Light Weight Process id */
- long tid; /* The Thread id */
-};
-typedef struct task_ptid task_ptid_t;
+ /* If non-zero, the task ID of the parent task. */
+ CORE_ADDR parent;
-struct task_entry
-{
- CORE_ADDR task_id;
- struct task_control_block atcb;
- int task_num;
- int known_tasks_index;
- struct task_entry *next_task;
- task_ptid_t task_ptid;
- int stack_per;
-};
+ /* If the task is waiting on a task entry, this field contains
+ the ID of the other task. Zero otherwise. */
+ CORE_ADDR called_task;
-/* task entry list. */
-extern struct task_entry *task_list;
+ /* If the task is accepting a rendezvous with another task, this field
+ contains the ID of the calling task. Zero otherwise. */
+ CORE_ADDR caller_task;
+};
+int ada_task_is_alive (struct ada_task_info *task);
/* Assuming V points to an array of S objects, make sure that it contains at
least M objects, updating V and S as necessary. */
@@ -258,11 +249,11 @@ extern void ada_print_type (struct type *, char *, struct ui_file *, int,
int);
extern int ada_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
- struct ui_file *, int, int, int,
- enum val_prettyprint);
+ struct ui_file *, int,
+ const struct value_print_options *);
-extern int ada_value_print (struct value *, struct ui_file *, int,
- enum val_prettyprint);
+extern int ada_value_print (struct value *, struct ui_file *,
+ const struct value_print_options *);
/* Defined in ada-lang.c */
@@ -275,7 +266,8 @@ extern void ada_emit_char (int, struct ui_file *, int, int);
extern void ada_printchar (int, struct ui_file *);
extern void ada_printstr (struct ui_file *, const gdb_byte *,
- unsigned int, int, int);
+ unsigned int, int, int,
+ const struct value_print_options *);
struct value *ada_convert_actual (struct value *actual,
struct type *formal_type0,
@@ -465,6 +457,8 @@ extern enum ada_renaming_category ada_parse_renaming (struct symbol *,
const char **,
int *, const char **);
+extern void ada_find_printable_frame (struct frame_info *fi);
+
extern char *ada_breakpoint_rewrite (char *, int *);
extern char *ada_main_name (void);
@@ -473,9 +467,9 @@ extern char *ada_main_name (void);
extern int valid_task_id (int);
-extern void init_task_list (void);
-
-extern int ada_is_exception_breakpoint (bpstat bs);
+typedef void (ada_task_list_iterator_ftype) (struct ada_task_info *task);
+extern void iterate_over_live_ada_tasks
+ (ada_task_list_iterator_ftype *iterator);
extern void ada_adjust_exception_stop (bpstat bs);
@@ -491,7 +485,7 @@ extern void ada_print_exception_breakpoint_task (struct breakpoint *);
extern void ada_reset_thread_registers (void);
-extern int ada_build_task_list (void);
+extern int ada_build_task_list (int warn_if_null);
extern int ada_exception_catchpoint_p (struct breakpoint *b);
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
new file mode 100644
index 0000000..37e944b
--- /dev/null
+++ b/gdb/ada-tasks.c
@@ -0,0 +1,991 @@
+/* Copyright (C) 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003, 2004,
+ 2005, 2007, 2008 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "defs.h"
+#include "observer.h"
+#include "gdbcmd.h"
+#include "target.h"
+#include "ada-lang.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "gdbthread.h"
+
+/* The name of the array in the GNAT runtime where the Ada Task Control
+ Block of each task is stored. */
+#define KNOWN_TASKS_NAME "system__tasking__debug__known_tasks"
+
+/* The maximum number of tasks known to the Ada runtime */
+static const int MAX_NUMBER_OF_KNOWN_TASKS = 1000;
+
+enum task_states
+{
+ Unactivated,
+ Runnable,
+ Terminated,
+ Activator_Sleep,
+ Acceptor_Sleep,
+ Entry_Caller_Sleep,
+ Async_Select_Sleep,
+ Delay_Sleep,
+ Master_Completion_Sleep,
+ Master_Phase_2_Sleep,
+ Interrupt_Server_Idle_Sleep,
+ Interrupt_Server_Blocked_Interrupt_Sleep,
+ Timer_Server_Sleep,
+ AST_Server_Sleep,
+ Asynchronous_Hold,
+ Interrupt_Server_Blocked_On_Event_Flag
+};
+
+/* A short description corresponding to each possible task state. */
+static const char *task_states[] = {
+ N_("Unactivated"),
+ N_("Runnable"),
+ N_("Terminated"),
+ N_("Child Activation Wait"),
+ N_("Accept Statement"),
+ N_("Waiting on entry call"),
+ N_("Async Select Wait"),
+ N_("Delay Sleep"),
+ N_("Child Termination Wait"),
+ N_("Wait Child in Term Alt"),
+ "",
+ "",
+ "",
+ "",
+ N_("Asynchronous Hold"),
+ ""
+};
+
+/* A longer description corresponding to each possible task state. */
+static const char *long_task_states[] = {
+ N_("Unactivated"),
+ N_("Runnable"),
+ N_("Terminated"),
+ N_("Waiting for child activation"),
+ N_("Blocked in accept statement"),
+ N_("Waiting on entry call"),
+ N_("Asynchronous Selective Wait"),
+ N_("Delay Sleep"),
+ N_("Waiting for children termination"),
+ N_("Waiting for children in terminate alternative"),
+ "",
+ "",
+ "",
+ "",
+ N_("Asynchronous Hold"),
+ ""
+};
+
+/* The index of certain important fields in the Ada Task Control Block
+ record and sub-records. */
+
+struct tcb_fieldnos
+{
+ /* Fields in record Ada_Task_Control_Block. */
+ int common;
+ int entry_calls;
+ int atc_nesting_level;
+
+ /* Fields in record Common_ATCB. */
+ int state;
+ int parent;
+ int priority;
+ int image;
+ int image_len; /* This field may be missing. */
+ int call;
+ int ll;
+
+ /* Fields in Task_Primitives.Private_Data. */
+ int ll_thread;
+ int ll_lwp; /* This field may be missing. */
+
+ /* Fields in Common_ATCB.Call.all. */
+ int call_self;
+};
+
+/* The type description for the ATCB record and subrecords, and
+ the associated tcb_fieldnos. For efficiency reasons, these are made
+ static globals so that we can compute them only once the first time
+ and reuse them later. Set to NULL if the types haven't been computed
+ yet, or if they may be obsolete (for instance after having loaded
+ a new binary). */
+
+static struct type *atcb_type = NULL;
+static struct type *atcb_common_type = NULL;
+static struct type *atcb_ll_type = NULL;
+static struct type *atcb_call_type = NULL;
+static struct tcb_fieldnos fieldno;
+
+/* Set to 1 when the cached address of System.Tasking.Debug.Known_Tasks
+ might be stale and so needs to be recomputed. */
+static int ada_tasks_check_symbol_table = 1;
+
+/* The list of Ada tasks.
+
+ Note: To each task we associate a number that the user can use to
+ reference it - this number is printed beside each task in the tasks
+ info listing displayed by "info tasks". This number is equal to
+ its index in the vector + 1. Reciprocally, to compute the index
+ of a task in the vector, we need to substract 1 from its number. */
+typedef struct ada_task_info ada_task_info_s;
+DEF_VEC_O(ada_task_info_s);
+static VEC(ada_task_info_s) *task_list = NULL;
+
+/* When non-zero, this flag indicates that the current task_list
+ is obsolete, and should be recomputed before it is accessed. */
+static int stale_task_list_p = 1;
+
+/* Return the task number of the task whose ptid is PTID, or zero
+ if the task could not be found. */
+
+int
+ada_get_task_number (ptid_t ptid)
+{
+ int i;
+
+ for (i=0; i < VEC_length (ada_task_info_s, task_list); i++)
+ if (ptid_equal (VEC_index (ada_task_info_s, task_list, i)->ptid, ptid))
+ return i + 1;
+
+ return 0; /* No matching task found. */
+}
+
+/* Return the task number of the task that matches TASK_ID, or zero
+ if the task could not be found. */
+
+static int
+get_task_number_from_id (CORE_ADDR task_id)
+{
+ int i;
+
+ for (i = 0; i < VEC_length (ada_task_info_s, task_list); i++)
+ {
+ struct ada_task_info *task_info =
+ VEC_index (ada_task_info_s, task_list, i);
+
+ if (task_info->task_id == task_id)
+ return i + 1;
+ }
+
+ /* Task not found. Return 0. */
+ return 0;
+}
+
+/* Return non-zero if TASK_NUM is a valid task number. */
+
+int
+valid_task_id (int task_num)
+{
+ return (task_num > 0
+ && task_num <= VEC_length (ada_task_info_s, task_list));
+}
+
+/* Return the task info associated to the Environment Task.
+ This function assumes that the inferior does in fact use tasking. */
+
+struct ada_task_info *
+ada_get_environment_task (void)
+{
+ ada_build_task_list (0);
+ gdb_assert (VEC_length (ada_task_info_s, task_list) > 0);
+
+ /* We use a little bit of insider knowledge to determine which task
+ is the Environment Task: We know that this task is created first,
+ and thus should always be task #1, which is at index 0 of the
+ TASK_LIST. */
+ return (VEC_index (ada_task_info_s, task_list, 0));
+}
+
+/* Call the ITERATOR function once for each Ada task that hasn't been
+ terminated yet. */
+
+void
+iterate_over_live_ada_tasks (ada_task_list_iterator_ftype *iterator)
+{
+ int i, nb_tasks;
+ struct ada_task_info *task;
+
+ ada_build_task_list (0);
+ nb_tasks = VEC_length (ada_task_info_s, task_list);
+
+ for (i = 0; i < nb_tasks; i++)
+ {
+ task = VEC_index (ada_task_info_s, task_list, i);
+ if (!ada_task_is_alive (task))
+ continue;
+ iterator (task);
+ }
+}
+
+/* Extract the contents of the value as a string whose length is LENGTH,
+ and store the result in DEST. */
+
+static void
+value_as_string (char *dest, struct value *val, int length)
+{
+ memcpy (dest, value_contents (val), length);
+ dest[length] = '\0';
+}
+
+/* Extract the string image from the fat string corresponding to VAL,
+ and store it in DEST. If the string length is greater than MAX_LEN,
+ then truncate the result to the first MAX_LEN characters of the fat
+ string. */
+
+static void
+read_fat_string_value (char *dest, struct value *val, int max_len)
+{
+ struct value *array_val;
+ struct value *bounds_val;
+ int len;
+
+ /* The following variables are made static to avoid recomputing them
+ each time this function is called. */
+ static int initialize_fieldnos = 1;
+ static int array_fieldno;
+ static int bounds_fieldno;
+ static int upper_bound_fieldno;
+
+ /* Get the index of the fields that we will need to read in order
+ to extract the string from the fat string. */
+ if (initialize_fieldnos)
+ {
+ struct type *type = value_type (val);
+ struct type *bounds_type;
+
+ array_fieldno = ada_get_field_index (type, "P_ARRAY", 0);
+ bounds_fieldno = ada_get_field_index (type, "P_BOUNDS", 0);
+
+ bounds_type = TYPE_FIELD_TYPE (type, bounds_fieldno);
+ if (TYPE_CODE (bounds_type) == TYPE_CODE_PTR)
+ bounds_type = TYPE_TARGET_TYPE (bounds_type);
+ if (TYPE_CODE (bounds_type) != TYPE_CODE_STRUCT)
+ error (_("Unknown task name format. Aborting"));
+ upper_bound_fieldno = ada_get_field_index (bounds_type, "UB0", 0);
+
+ initialize_fieldnos = 0;
+ }
+
+ /* Get the size of the task image by checking the value of the bounds.
+ The lower bound is always 1, so we only need to read the upper bound. */
+ bounds_val = value_ind (value_field (val, bounds_fieldno));
+ len = value_as_long (value_field (bounds_val, upper_bound_fieldno));
+
+ /* Make sure that we do not read more than max_len characters... */
+ if (len > max_len)
+ len = max_len;
+
+ /* Extract LEN characters from the fat string. */
+ array_val = value_ind (value_field (val, array_fieldno));
+ read_memory (VALUE_ADDRESS (array_val), dest, len);
+
+ /* Add the NUL character to close the string. */
+ dest[len] = '\0';
+}
+
+/* Return the address of the Known_Tasks array maintained in
+ the Ada Runtime. Return NULL if the array could not be found,
+ meaning that the inferior program probably does not use tasking.
+
+ In order to provide a fast response time, this function caches
+ the Known_Tasks array address after the lookup during the first
+ call. Subsequent calls will simply return this cached address. */
+
+static CORE_ADDR
+get_known_tasks_addr (void)
+{
+ static CORE_ADDR known_tasks_addr = 0;
+
+ if (ada_tasks_check_symbol_table)
+ {
+ struct symbol *sym;
+ struct minimal_symbol *msym;
+
+ msym = lookup_minimal_symbol (KNOWN_TASKS_NAME, NULL, NULL);
+ if (msym != NULL)
+ known_tasks_addr = SYMBOL_VALUE_ADDRESS (msym);
+ else
+ {
+ if (target_lookup_symbol (KNOWN_TASKS_NAME, &known_tasks_addr) != 0)
+ return 0;
+ }
+
+ /* FIXME: brobecker 2003-03-05: Here would be a much better place
+ to attach the ada-tasks observers, instead of doing this
+ unconditionaly in _initialize_tasks. This would avoid an
+ unecessary notification when the inferior does not use tasking
+ or as long as the user does not use the ada-tasks commands.
+ Unfortunately, this is not possible for the moment: the current
+ code resets ada__tasks_check_symbol_table back to 1 whenever
+ symbols for a new program are being loaded. If we place the
+ observers intialization here, we will end up adding new observers
+ everytime we do the check for Ada tasking-related symbols
+ above. This would currently have benign effects, but is still
+ undesirable. The cleanest approach is probably to create a new
+ observer to notify us when the user is debugging a new program.
+ We would then reset ada__tasks_check_symbol_table back to 1
+ during the notification, but also detach all observers.
+ BTW: observers are probably not reentrant, so detaching during
+ a notification may not be the safest thing to do... Sigh...
+ But creating the new observer would be a good idea in any case,
+ since this allow us to make ada__tasks_check_symbol_table
+ static, which is a good bonus. */
+ ada_tasks_check_symbol_table = 0;
+ }
+
+ return known_tasks_addr;
+}
+
+/* Get from the debugging information the type description of all types
+ related to the Ada Task Control Block that will be needed in order to
+ read the list of known tasks in the Ada runtime. Also return the
+ associated ATCB_FIELDNOS.
+
+ Error handling: Any data missing from the debugging info will cause
+ an error to be raised, and none of the return values to be set.
+ Users of this function can depend on the fact that all or none of the
+ return values will be set. */
+
+static void
+get_tcb_types_info (struct type **atcb_type,
+ struct type **atcb_common_type,
+ struct type **atcb_ll_type,
+ struct type **atcb_call_type,
+ struct tcb_fieldnos *atcb_fieldnos)
+{
+ struct type *type;
+ struct type *common_type;
+ struct type *ll_type;
+ struct type *call_type;
+ struct tcb_fieldnos fieldnos;
+
+ const char *atcb_name = "system__tasking__ada_task_control_block___XVE";
+ const char *atcb_name_fixed = "system__tasking__ada_task_control_block";
+ const char *common_atcb_name = "system__tasking__common_atcb";
+ const char *private_data_name = "system__task_primitives__private_data";
+ const char *entry_call_record_name = "system__tasking__entry_call_record";
+
+ struct symbol *atcb_sym =
+ lookup_symbol (atcb_name, NULL, VAR_DOMAIN, NULL);
+ const struct symbol *common_atcb_sym =
+ lookup_symbol (common_atcb_name, NULL, VAR_DOMAIN, NULL);
+ const struct symbol *private_data_sym =
+ lookup_symbol (private_data_name, NULL, VAR_DOMAIN, NULL);
+ const struct symbol *entry_call_record_sym =
+ lookup_symbol (entry_call_record_name, NULL, VAR_DOMAIN, NULL);
+
+ if (atcb_sym == NULL || atcb_sym->type == NULL)
+ {
+ /* In Ravenscar run-time libs, the ATCB does not have a dynamic
+ size, so the symbol name differs. */
+ atcb_sym = lookup_symbol (atcb_name_fixed, NULL, VAR_DOMAIN, NULL);
+
+ if (atcb_sym == NULL || atcb_sym->type == NULL)
+ error (_("Cannot find Ada_Task_Control_Block type. Aborting"));
+
+ type = atcb_sym->type;
+ }
+ else
+ {
+ /* Get a static representation of the type record
+ Ada_Task_Control_Block. */
+ type = atcb_sym->type;
+ type = ada_template_to_fixed_record_type_1 (type, NULL, 0, NULL, 0);
+ }
+
+ if (common_atcb_sym == NULL || common_atcb_sym->type == NULL)
+ error (_("Cannot find Common_ATCB type. Aborting"));
+ if (private_data_sym == NULL || private_data_sym->type == NULL)
+ error (_("Cannot find Private_Data type. Aborting"));
+ if (entry_call_record_sym == NULL || entry_call_record_sym->type == NULL)
+ error (_("Cannot find Entry_Call_Record type. Aborting"));
+
+ /* Get the type for Ada_Task_Control_Block.Common. */
+ common_type = common_atcb_sym->type;
+
+ /* Get the type for Ada_Task_Control_Bloc.Common.Call.LL. */
+ ll_type = private_data_sym->type;
+
+ /* Get the type for Common_ATCB.Call.all. */
+ call_type = entry_call_record_sym->type;
+
+ /* Get the field indices. */
+ fieldnos.common = ada_get_field_index (type, "common", 0);
+ fieldnos.entry_calls = ada_get_field_index (type, "entry_calls", 1);
+ fieldnos.atc_nesting_level =
+ ada_get_field_index (type, "atc_nesting_level", 1);
+ fieldnos.state = ada_get_field_index (common_type, "state", 0);
+ fieldnos.parent = ada_get_field_index (common_type, "parent", 1);
+ fieldnos.priority = ada_get_field_index (common_type, "base_priority", 0);
+ fieldnos.image = ada_get_field_index (common_type, "task_image", 1);
+ fieldnos.image_len = ada_get_field_index (common_type, "task_image_len", 1);
+ fieldnos.call = ada_get_field_index (common_type, "call", 1);
+ fieldnos.ll = ada_get_field_index (common_type, "ll", 0);
+ fieldnos.ll_thread = ada_get_field_index (ll_type, "thread", 0);
+ fieldnos.ll_lwp = ada_get_field_index (ll_type, "lwp", 1);
+ fieldnos.call_self = ada_get_field_index (call_type, "self", 0);
+
+ /* On certain platforms such as x86-windows, the "lwp" field has been
+ named "thread_id". This field will likely be renamed in the future,
+ but we need to support both possibilities to avoid an unnecessary
+ dependency on a recent compiler. We therefore try locating the
+ "thread_id" field in place of the "lwp" field if we did not find
+ the latter. */
+ if (fieldnos.ll_lwp < 0)
+ fieldnos.ll_lwp = ada_get_field_index (ll_type, "thread_id", 1);
+
+ /* Set all the out parameters all at once, now that we are certain
+ that there are no potential error() anymore. */
+ *atcb_type = type;
+ *atcb_common_type = common_type;
+ *atcb_ll_type = ll_type;
+ *atcb_call_type = call_type;
+ *atcb_fieldnos = fieldnos;
+}
+
+/* Build the PTID of the task from its COMMON_VALUE, which is the "Common"
+ component of its ATCB record. This PTID needs to match the PTID used
+ by the thread layer. */
+
+static ptid_t
+ptid_from_atcb_common (struct value *common_value)
+{
+ long thread = 0;
+ CORE_ADDR lwp = 0;
+ struct value *ll_value;
+ ptid_t ptid;
+
+ ll_value = value_field (common_value, fieldno.ll);
+
+ if (fieldno.ll_lwp >= 0)
+ lwp = value_as_address (value_field (ll_value, fieldno.ll_lwp));
+ thread = value_as_long (value_field (ll_value, fieldno.ll_thread));
+
+ ptid = target_get_ada_task_ptid (lwp, thread);
+
+ return ptid;
+}
+
+/* Read the ATCB data of a given task given its TASK_ID (which is in practice
+ the address of its assocated ATCB record), and store the result inside
+ TASK_INFO. */
+
+static void
+read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info)
+{
+ struct value *tcb_value;
+ struct value *common_value;
+ struct value *atc_nesting_level_value;
+ struct value *entry_calls_value;
+ struct value *entry_calls_value_element;
+ int called_task_fieldno = -1;
+ const char ravenscar_task_name[] = "Ravenscar task";
+
+ if (atcb_type == NULL)
+ get_tcb_types_info (&atcb_type, &atcb_common_type, &atcb_ll_type,
+ &atcb_call_type, &fieldno);
+
+ tcb_value = value_from_contents_and_address (atcb_type, NULL, task_id);
+ common_value = value_field (tcb_value, fieldno.common);
+
+ /* Fill in the task_id. */
+
+ task_info->task_id = task_id;
+
+ /* Compute the name of the task.
+
+ Depending on the GNAT version used, the task image is either a fat
+ string, or a thin array of characters. Older versions of GNAT used
+ to use fat strings, and therefore did not need an extra field in
+ the ATCB to store the string length. For efficiency reasons, newer
+ versions of GNAT replaced the fat string by a static buffer, but this
+ also required the addition of a new field named "Image_Len" containing
+ the length of the task name. The method used to extract the task name
+ is selected depending on the existence of this field.
+
+ In some run-time libs (e.g. Ravenscar), the name is not in the ATCB;
+ we may want to get it from the first user frame of the stack. For now,
+ we just give a dummy name. */
+
+ if (fieldno.image_len == -1)
+ {
+ if (fieldno.image >= 0)
+ read_fat_string_value (task_info->name,
+ value_field (common_value, fieldno.image),
+ sizeof (task_info->name) - 1);
+ else
+ strcpy (task_info->name, ravenscar_task_name);
+ }
+ else
+ {
+ int len = value_as_long (value_field (common_value, fieldno.image_len));
+
+ value_as_string (task_info->name,
+ value_field (common_value, fieldno.image), len);
+ }
+
+ /* Compute the task state and priority. */
+
+ task_info->state = value_as_long (value_field (common_value, fieldno.state));
+ task_info->priority =
+ value_as_long (value_field (common_value, fieldno.priority));
+
+ /* If the ATCB contains some information about the parent task,
+ then compute it as well. Otherwise, zero. */
+
+ if (fieldno.parent >= 0)
+ task_info->parent =
+ value_as_address (value_field (common_value, fieldno.parent));
+ else
+ task_info->parent = 0;
+
+
+ /* If the ATCB contains some information about entry calls, then
+ compute the "called_task" as well. Otherwise, zero. */
+
+ if (fieldno.atc_nesting_level > 0 && fieldno.entry_calls > 0)
+ {
+ /* Let My_ATCB be the Ada task control block of a task calling the
+ entry of another task; then the Task_Id of the called task is
+ in My_ATCB.Entry_Calls (My_ATCB.ATC_Nesting_Level).Called_Task. */
+ atc_nesting_level_value = value_field (tcb_value,
+ fieldno.atc_nesting_level);
+ entry_calls_value =
+ ada_coerce_to_simple_array_ptr (value_field (tcb_value,
+ fieldno.entry_calls));
+ entry_calls_value_element =
+ value_subscript (entry_calls_value, atc_nesting_level_value);
+ called_task_fieldno =
+ ada_get_field_index (value_type (entry_calls_value_element),
+ "called_task", 0);
+ task_info->called_task =
+ value_as_address (value_field (entry_calls_value_element,
+ called_task_fieldno));
+ }
+ else
+ {
+ task_info->called_task = 0;
+ }
+
+ /* If the ATCB cotnains some information about RV callers,
+ then compute the "caller_task". Otherwise, zero. */
+
+ task_info->caller_task = 0;
+ if (fieldno.call >= 0)
+ {
+ /* Get the ID of the caller task from Common_ATCB.Call.all.Self.
+ If Common_ATCB.Call is null, then there is no caller. */
+ const CORE_ADDR call =
+ value_as_address (value_field (common_value, fieldno.call));
+ struct value *call_val;
+
+ if (call != 0)
+ {
+ call_val =
+ value_from_contents_and_address (atcb_call_type, NULL, call);
+ task_info->caller_task =
+ value_as_address (value_field (call_val, fieldno.call_self));
+ }
+ }
+
+ /* And finally, compute the task ptid. */
+
+ if (ada_task_is_alive (task_info))
+ task_info->ptid = ptid_from_atcb_common (common_value);
+ else
+ task_info->ptid = null_ptid;
+}
+
+/* Read the ATCB info of the given task (identified by TASK_ID), and
+ add the result to the TASK_LIST. */
+
+static void
+add_ada_task (CORE_ADDR task_id)
+{
+ struct ada_task_info task_info;
+
+ read_atcb (task_id, &task_info);
+ VEC_safe_push (ada_task_info_s, task_list, &task_info);
+}
+
+/* Read the Known_Tasks array from the inferior memory, and store
+ it in TASK_LIST. Return non-zero upon success. */
+
+static int
+read_known_tasks_array (void)
+{
+ const int target_ptr_byte =
+ gdbarch_ptr_bit (current_gdbarch) / TARGET_CHAR_BIT;
+ const CORE_ADDR known_tasks_addr = get_known_tasks_addr ();
+ const int known_tasks_size = target_ptr_byte * MAX_NUMBER_OF_KNOWN_TASKS;
+ gdb_byte *known_tasks = alloca (known_tasks_size);
+ int i;
+
+ /* Step 1: Clear the current list, if necessary. */
+ VEC_truncate (ada_task_info_s, task_list, 0);
+
+ /* If the application does not use task, then no more needs to be done.
+ It is important to have the task list cleared (see above) before we
+ return, as we don't want a stale task list to be used... This can
+ happen for instance when debugging a non-multitasking program after
+ having debugged a multitasking one. */
+ if (known_tasks_addr == 0)
+ return 0;
+
+ /* Step 2: Build a new list by reading the ATCBs from the Known_Tasks
+ array in the Ada runtime. */
+ read_memory (known_tasks_addr, known_tasks, known_tasks_size);
+ for (i = 0; i < MAX_NUMBER_OF_KNOWN_TASKS; i++)
+ {
+ struct type *data_ptr_type =
+ builtin_type (current_gdbarch)->builtin_data_ptr;
+ CORE_ADDR task_id =
+ extract_typed_address (known_tasks + i * target_ptr_byte,
+ data_ptr_type);
+
+ if (task_id != 0)
+ add_ada_task (task_id);
+ }
+
+ /* Step 3: Unset stale_task_list_p, to avoid re-reading the Known_Tasks
+ array unless needed. Then report a success. */
+ stale_task_list_p = 0;
+
+ return 1;
+}
+
+/* Builds the task_list by reading the Known_Tasks array from
+ the inferior. Prints an appropriate message and returns non-zero
+ if it failed to build this list. */
+
+int
+ada_build_task_list (int warn_if_null)
+{
+ if (!target_has_stack)
+ error (_("Cannot inspect Ada tasks when program is not running"));
+
+ if (stale_task_list_p)
+ read_known_tasks_array ();
+
+ if (task_list == NULL)
+ {
+ if (warn_if_null)
+ printf_filtered (_("Your application does not use any Ada tasks.\n"));
+ return 0;
+ }
+
+ return 1;
+}
+
+/* Return non-zero iff the task STATE corresponds to a non-terminated
+ task state. */
+
+int
+ada_task_is_alive (struct ada_task_info *task_info)
+{
+ return (task_info->state != Terminated);
+}
+
+/* Print a one-line description of the task whose number is TASKNO.
+ The formatting should fit the "info tasks" array. */
+
+static void
+short_task_info (int taskno)
+{
+ const struct ada_task_info *const task_info =
+ VEC_index (ada_task_info_s, task_list, taskno - 1);
+ int active_task_p;
+
+ gdb_assert (task_info != NULL);
+
+ /* Print a star if this task is the current task (or the task currently
+ selected). */
+
+ active_task_p = ptid_equal (task_info->ptid, inferior_ptid);
+ if (active_task_p)
+ printf_filtered ("*");
+ else
+ printf_filtered (" ");
+
+ /* Print the task number. */
+ printf_filtered ("%3d", taskno);
+
+ /* Print the Task ID. */
+ printf_filtered (" %9lx", (long) task_info->task_id);
+
+ /* Print the Task ID of the task parent. */
+ printf_filtered (" %4d", get_task_number_from_id (task_info->parent));
+
+ /* Print the base priority of the task. */
+ printf_filtered (" %3d", task_info->priority);
+
+ /* Print the task current state. */
+ if (task_info->caller_task)
+ printf_filtered (_(" Accepting RV with %-4d"),
+ get_task_number_from_id (task_info->caller_task));
+ else if (task_info->state == Entry_Caller_Sleep && task_info->called_task)
+ printf_filtered (_(" Waiting on RV with %-3d"),
+ get_task_number_from_id (task_info->called_task));
+ else if (task_info->state == Runnable && active_task_p)
+ /* Replace "Runnable" by "Running" since this is the active task. */
+ printf_filtered (" %-22s", _("Running"));
+ else
+ printf_filtered (" %-22s", _(task_states[task_info->state]));
+
+ /* Finally, print the task name. */
+ if (task_info->name[0] != '\0')
+ printf_filtered (" %s\n", task_info->name);
+ else
+ printf_filtered (_(" <no name>\n"));
+}
+
+/* Print a list containing a short description of all Ada tasks. */
+/* FIXME: Shouldn't we be using ui_out??? */
+
+static void
+info_tasks (int from_tty)
+{
+ int taskno;
+ const int nb_tasks = VEC_length (ada_task_info_s, task_list);
+
+ printf_filtered (_(" ID TID P-ID Pri State Name\n"));
+
+ for (taskno = 1; taskno <= nb_tasks; taskno++)
+ short_task_info (taskno);
+}
+
+/* Print a detailed description of the Ada task whose ID is TASKNO_STR. */
+
+static void
+info_task (char *taskno_str, int from_tty)
+{
+ const int taskno = value_as_long (parse_and_eval (taskno_str));
+ struct ada_task_info *task_info;
+ int parent_taskno = 0;
+
+ if (taskno <= 0 || taskno > VEC_length (ada_task_info_s, task_list))
+ error (_("Task ID %d not known. Use the \"info tasks\" command to\n"
+ "see the IDs of currently known tasks"), taskno);
+ task_info = VEC_index (ada_task_info_s, task_list, taskno - 1);
+
+ /* Print the Ada task ID. */
+ printf_filtered (_("Ada Task: %s\n"), paddr_nz (task_info->task_id));
+
+ /* Print the name of the task. */
+ if (task_info->name[0] != '\0')
+ printf_filtered (_("Name: %s\n"), task_info->name);
+ else
+ printf_filtered (_("<no name>\n"));
+
+ /* Print the TID and LWP. */
+ printf_filtered (_("Thread: %#lx\n"), ptid_get_tid (task_info->ptid));
+ printf_filtered (_("LWP: %#lx\n"), ptid_get_lwp (task_info->ptid));
+
+ /* Print who is the parent (if any). */
+ if (task_info->parent != 0)
+ parent_taskno = get_task_number_from_id (task_info->parent);
+ if (parent_taskno)
+ {
+ struct ada_task_info *parent =
+ VEC_index (ada_task_info_s, task_list, parent_taskno - 1);
+
+ printf_filtered (_("Parent: %d"), parent_taskno);
+ if (parent->name[0] != '\0')
+ printf_filtered (" (%s)", parent->name);
+ printf_filtered ("\n");
+ }
+ else
+ printf_filtered (_("No parent\n"));
+
+ /* Print the base priority. */
+ printf_filtered (_("Base Priority: %d\n"), task_info->priority);
+
+ /* print the task current state. */
+ {
+ int target_taskno = 0;
+
+ if (task_info->caller_task)
+ {
+ target_taskno = get_task_number_from_id (task_info->caller_task);
+ printf_filtered (_("State: Accepting rendezvous with %d"),
+ target_taskno);
+ }
+ else if (task_info->state == Entry_Caller_Sleep && task_info->called_task)
+ {
+ target_taskno = get_task_number_from_id (task_info->called_task);
+ printf_filtered (_("State: Waiting on task %d's entry"),
+ target_taskno);
+ }
+ else
+ printf_filtered (_("State: %s"), _(long_task_states[task_info->state]));
+
+ if (target_taskno)
+ {
+ struct ada_task_info *target_task_info =
+ VEC_index (ada_task_info_s, task_list, target_taskno - 1);
+
+ if (target_task_info->name[0] != '\0')
+ printf_filtered (" (%s)", target_task_info->name);
+ }
+
+ printf_filtered ("\n");
+ }
+}
+
+/* If ARG is empty or null, then print a list of all Ada tasks.
+ Otherwise, print detailed information about the task whose ID
+ is ARG.
+
+ Does nothing if the program doesn't use Ada tasking. */
+
+static void
+info_tasks_command (char *arg, int from_tty)
+{
+ const int task_list_built = ada_build_task_list (1);
+
+ if (!task_list_built)
+ return;
+
+ if (arg == NULL || *arg == '\0')
+ info_tasks (from_tty);
+ else
+ info_task (arg, from_tty);
+}
+
+/* Print a message telling the user id of the current task.
+ This function assumes that tasking is in use in the inferior. */
+
+static void
+display_current_task_id (void)
+{
+ const int current_task = ada_get_task_number (inferior_ptid);
+
+ if (current_task == 0)
+ printf_filtered (_("[Current task is unknown]\n"));
+ else
+ printf_filtered (_("[Current task is %d]\n"), current_task);
+}
+
+/* Parse and evaluate TIDSTR into a task id, and try to switch to
+ that task. Print an error message if the task switch failed. */
+
+static void
+task_command_1 (char *taskno_str, int from_tty)
+{
+ const int taskno = value_as_long (parse_and_eval (taskno_str));
+ struct ada_task_info *task_info;
+
+ if (taskno <= 0 || taskno > VEC_length (ada_task_info_s, task_list))
+ error (_("Task ID %d not known. Use the \"info tasks\" command to\n"
+ "see the IDs of currently known tasks"), taskno);
+ task_info = VEC_index (ada_task_info_s, task_list, taskno - 1);
+
+ if (!ada_task_is_alive (task_info))
+ error (_("Cannot switch to task %d: Task is no longer running"), taskno);
+
+ switch_to_thread (task_info->ptid);
+ ada_find_printable_frame (get_selected_frame (NULL));
+ printf_filtered (_("[Switching to task %d]\n"), taskno);
+ print_stack_frame (get_selected_frame (NULL),
+ frame_relative_level (get_selected_frame (NULL)), 1);
+}
+
+
+/* Print the ID of the current task if TASKNO_STR is empty or NULL.
+ Otherwise, switch to the task indicated by TASKNO_STR. */
+
+static void
+task_command (char *taskno_str, int from_tty)
+{
+ const int task_list_built = ada_build_task_list (1);
+
+ if (!task_list_built)
+ return;
+
+ if (taskno_str == NULL || taskno_str[0] == '\0')
+ display_current_task_id ();
+ else
+ {
+ /* Task switching in core files doesn't work, either because:
+ 1. Thread support is not implemented with core files
+ 2. Thread support is implemented, but the thread IDs created
+ after having read the core file are not the same as the ones
+ that were used during the program life, before the crash.
+ As a consequence, there is no longer a way for the debugger
+ to find the associated thead ID of any given Ada task.
+ So, instead of attempting a task switch without giving the user
+ any clue as to what might have happened, just error-out with
+ a message explaining that this feature is not supported. */
+ if (!target_has_execution)
+ error (_("\
+Task switching not supported when debugging from core files\n\
+(use thread support instead)"));
+ task_command_1 (taskno_str, from_tty);
+ }
+}
+
+/* Indicate that the task list may have changed, so invalidate the cache. */
+
+void
+ada_task_list_changed (void)
+{
+ stale_task_list_p = 1;
+}
+
+/* The 'normal_stop' observer notification callback. */
+
+static void
+ada_normal_stop_observer (struct bpstats *unused_args)
+{
+ /* The inferior has been resumed, and just stopped. This means that
+ our task_list needs to be recomputed before it can be used again. */
+ ada_task_list_changed ();
+}
+
+/* A routine to be called when the objfiles have changed. */
+
+void
+ada_new_objfile_observer (struct objfile *objfile)
+{
+ /* Invalidate all cached data that were extracted from an objfile. */
+
+ atcb_type = NULL;
+ atcb_common_type = NULL;
+ atcb_ll_type = NULL;
+ atcb_call_type = NULL;
+
+ ada_tasks_check_symbol_table = 1;
+}
+
+void
+_initialize_tasks (void)
+{
+ /* Attach various observers. */
+ observer_attach_normal_stop (ada_normal_stop_observer);
+ observer_attach_new_objfile (ada_new_objfile_observer);
+
+ /* Some new commands provided by this module. */
+ add_info ("tasks", info_tasks_command,
+ _("Provide information about all known Ada tasks"));
+ add_cmd ("task", class_run, task_command,
+ _("Use this command to switch between Ada tasks.\n\
+Without argument, this command simply prints the current task ID"),
+ &cmdlist);
+}
+
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index e2f7740..cc8352f 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -43,18 +43,17 @@ struct ada_val_print_args
int embedded_offset;
CORE_ADDR address;
struct ui_file *stream;
- int format;
- int deref_ref;
int recurse;
- enum val_prettyprint pretty;
+ const struct value_print_options *options;
};
static void print_record (struct type *, const gdb_byte *, struct ui_file *,
- int, int, enum val_prettyprint);
+ int, const struct value_print_options *);
static int print_field_values (struct type *, const gdb_byte *,
- struct ui_file *, int, int,
- enum val_prettyprint, int, struct type *,
+ struct ui_file *, int,
+ const struct value_print_options *,
+ int, struct type *,
const gdb_byte *);
static void adjust_type_signedness (struct type *);
@@ -62,8 +61,8 @@ static void adjust_type_signedness (struct type *);
static int ada_val_print_stub (void *args0);
static int ada_val_print_1 (struct type *, const gdb_byte *, int, CORE_ADDR,
- struct ui_file *, int, int, int,
- enum val_prettyprint);
+ struct ui_file *, int,
+ const struct value_print_options *);
/* Make TYPE unsigned if its range of values includes no negatives. */
@@ -81,13 +80,14 @@ adjust_type_signedness (struct type *type)
otherwise 0. */
static int
-print_optional_low_bound (struct ui_file *stream, struct type *type)
+print_optional_low_bound (struct ui_file *stream, struct type *type,
+ const struct value_print_options *options)
{
struct type *index_type;
long low_bound;
long high_bound;
- if (print_array_indexes_p ())
+ if (options->print_array_indexes)
return 0;
if (!get_array_bounds (type, &low_bound, &high_bound))
@@ -137,16 +137,15 @@ print_optional_low_bound (struct ui_file *stream, struct type *type)
/* Version of val_print_array_elements for GNAT-style packed arrays.
Prints elements of packed array of type TYPE at bit offset
- BITOFFSET from VALADDR on STREAM. Formats according to FORMAT and
+ BITOFFSET from VALADDR on STREAM. Formats according to OPTIONS and
separates with commas. RECURSE is the recursion (nesting) level.
- If PRETTY, uses "prettier" format. TYPE must have been decoded (as
- by ada_coerce_to_simple_array). */
+ TYPE must have been decoded (as by ada_coerce_to_simple_array). */
static void
val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
int bitoffset, struct ui_file *stream,
- int format, int recurse,
- enum val_prettyprint pretty)
+ int recurse,
+ const struct value_print_options *options)
{
unsigned int i;
unsigned int things_printed = 0;
@@ -172,14 +171,14 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
i = 0;
annotate_array_section_begin (i, elttype);
- while (i < len && things_printed < print_max)
+ while (i < len && things_printed < options->print_max)
{
struct value *v0, *v1;
int i0;
if (i != 0)
{
- if (prettyprint_arrays)
+ if (options->prettyprint_arrays)
{
fprintf_filtered (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -190,7 +189,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
}
}
wrap_here (n_spaces (2 + 2 * recurse));
- maybe_print_array_index (index_type, i + low, stream, format, pretty);
+ maybe_print_array_index (index_type, i + low, stream, options);
i0 = i;
v0 = ada_value_primitive_packed_val (NULL, valaddr,
@@ -210,10 +209,12 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
break;
}
- if (i - i0 > repeat_count_threshold)
+ if (i - i0 > options->repeat_count_threshold)
{
- val_print (elttype, value_contents (v0), 0, 0, stream, format,
- 0, recurse + 1, pretty, current_language);
+ struct value_print_options opts = *options;
+ opts.deref_ref = 0;
+ val_print (elttype, value_contents (v0), 0, 0, stream,
+ recurse + 1, &opts, current_language);
annotate_elt_rep (i - i0);
fprintf_filtered (stream, _(" <repeats %u times>"), i - i0);
annotate_elt_rep_end ();
@@ -222,11 +223,13 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
else
{
int j;
+ struct value_print_options opts = *options;
+ opts.deref_ref = 0;
for (j = i0; j < i; j += 1)
{
if (j > i0)
{
- if (prettyprint_arrays)
+ if (options->prettyprint_arrays)
{
fprintf_filtered (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -237,10 +240,10 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
}
wrap_here (n_spaces (2 + 2 * recurse));
maybe_print_array_index (index_type, j + low,
- stream, format, pretty);
+ stream, options);
}
- val_print (elttype, value_contents (v0), 0, 0, stream, format,
- 0, recurse + 1, pretty, current_language);
+ val_print (elttype, value_contents (v0), 0, 0, stream,
+ recurse + 1, &opts, current_language);
annotate_elt ();
}
}
@@ -452,7 +455,8 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
static void
printstr (struct ui_file *stream, const gdb_byte *string,
- unsigned int length, int force_ellipses, int type_len)
+ unsigned int length, int force_ellipses, int type_len,
+ const struct value_print_options *options)
{
unsigned int i;
unsigned int things_printed = 0;
@@ -465,7 +469,7 @@ printstr (struct ui_file *stream, const gdb_byte *string,
return;
}
- for (i = 0; i < length && things_printed < print_max; i += 1)
+ for (i = 0; i < length && things_printed < options->print_max; i += 1)
{
/* Position of the character we are examining
to see whether it is repeated. */
@@ -491,11 +495,11 @@ printstr (struct ui_file *stream, const gdb_byte *string,
reps += 1;
}
- if (reps > repeat_count_threshold)
+ if (reps > options->repeat_count_threshold)
{
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\", ", stream);
else
fputs_filtered ("\", ", stream);
@@ -507,14 +511,14 @@ printstr (struct ui_file *stream, const gdb_byte *string,
fputs_filtered ("'", stream);
fprintf_filtered (stream, _(" <repeats %u times>"), reps);
i = rep1 - 1;
- things_printed += repeat_count_threshold;
+ things_printed += options->repeat_count_threshold;
need_comma = 1;
}
else
{
if (!in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\"", stream);
else
fputs_filtered ("\"", stream);
@@ -529,7 +533,7 @@ printstr (struct ui_file *stream, const gdb_byte *string,
/* Terminate the quotes if necessary. */
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\"", stream);
else
fputs_filtered ("\"", stream);
@@ -541,36 +545,28 @@ printstr (struct ui_file *stream, const gdb_byte *string,
void
ada_printstr (struct ui_file *stream, const gdb_byte *string,
- unsigned int length, int width, int force_ellipses)
+ unsigned int length, int width, int force_ellipses,
+ const struct value_print_options *options)
{
- printstr (stream, string, length, force_ellipses, width);
+ printstr (stream, string, length, force_ellipses, width, options);
}
/* Print data of type TYPE located at VALADDR (within GDB), which came from
the inferior at address ADDRESS, onto stdio stream STREAM according to
- FORMAT (a letter as for the printf % codes or 0 for natural format).
- The data at VALADDR is in target byte order.
+ OPTIONS. The data at VALADDR is in target byte order.
If the data is printed as a string, returns the number of string characters
printed.
- If DEREF_REF is nonzero, then dereference references, otherwise just print
- them like pointers.
-
RECURSE indicates the amount of indentation to supply before
- continuation lines; this amount is roughly twice the value of RECURSE.
-
- When PRETTY is non-zero, prints record fields on separate lines.
- (For some reason, the current version of gdb instead uses a global
- variable---prettyprint_arrays--- to causes a similar effect on
- arrays.) */
+ continuation lines; this amount is roughly twice the value of RECURSE. */
int
ada_val_print (struct type *type, const gdb_byte *valaddr0,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format, int deref_ref,
- int recurse, enum val_prettyprint pretty)
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
struct ada_val_print_args args;
args.type = type;
@@ -578,10 +574,8 @@ ada_val_print (struct type *type, const gdb_byte *valaddr0,
args.embedded_offset = embedded_offset;
args.address = address;
args.stream = stream;
- args.format = format;
- args.deref_ref = deref_ref;
args.recurse = recurse;
- args.pretty = pretty;
+ args.options = options;
return catch_errors (ada_val_print_stub, &args, NULL, RETURN_MASK_ALL);
}
@@ -594,8 +588,7 @@ ada_val_print_stub (void *args0)
struct ada_val_print_args *argsp = (struct ada_val_print_args *) args0;
return ada_val_print_1 (argsp->type, argsp->valaddr0,
argsp->embedded_offset, argsp->address,
- argsp->stream, argsp->format, argsp->deref_ref,
- argsp->recurse, argsp->pretty);
+ argsp->stream, argsp->recurse, argsp->options);
}
/* Assuming TYPE is a simple array, print the value of this array located
@@ -605,8 +598,8 @@ ada_val_print_stub (void *args0)
static int
ada_val_print_array (struct type *type, const gdb_byte *valaddr,
- CORE_ADDR address, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
struct type *elttype = TYPE_TARGET_TYPE (type);
unsigned int eltlen;
@@ -623,40 +616,40 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr,
len = TYPE_LENGTH (type) / eltlen;
/* For an array of chars, print with string syntax. */
- if (ada_is_string_type (type) && (format == 0 || format == 's'))
+ if (ada_is_string_type (type)
+ && (options->format == 0 || options->format == 's'))
{
- if (prettyprint_arrays)
+ if (options->prettyprint_arrays)
print_spaces_filtered (2 + 2 * recurse, stream);
/* If requested, look for the first null char and only print
elements up to it. */
- if (stop_print_at_null)
+ if (options->stop_print_at_null)
{
int temp_len;
/* Look for a NULL char. */
for (temp_len = 0;
(temp_len < len
- && temp_len < print_max
+ && temp_len < options->print_max
&& char_at (valaddr, temp_len, eltlen) != 0);
temp_len += 1);
len = temp_len;
}
- printstr (stream, valaddr, len, 0, eltlen);
+ printstr (stream, valaddr, len, 0, eltlen, options);
result = len;
}
else
{
fprintf_filtered (stream, "(");
- print_optional_low_bound (stream, type);
+ print_optional_low_bound (stream, type, options);
if (TYPE_FIELD_BITSIZE (type, 0) > 0)
val_print_packed_array_elements (type, valaddr, 0, stream,
- format, recurse, pretty);
+ recurse, options);
else
val_print_array_elements (type, valaddr, address, stream,
- format, deref_ref, recurse,
- pretty, 0);
+ recurse, options, 0);
fprintf_filtered (stream, ")");
}
@@ -669,8 +662,8 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr,
static int
ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
unsigned int len;
int i;
@@ -695,8 +688,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
}
else
retn = ada_val_print_1 (value_type (val), value_contents (val), 0,
- VALUE_ADDRESS (val), stream, format,
- deref_ref, recurse, pretty);
+ VALUE_ADDRESS (val), stream, recurse, options);
value_free_to_mark (mark);
return retn;
}
@@ -709,12 +701,12 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
{
default:
return c_val_print (type, valaddr0, embedded_offset, address, stream,
- format, deref_ref, recurse, pretty);
+ recurse, options);
case TYPE_CODE_PTR:
{
int ret = c_val_print (type, valaddr0, embedded_offset, address,
- stream, format, deref_ref, recurse, pretty);
+ stream, recurse, options);
if (ada_is_tag_type (type))
{
struct value *val =
@@ -778,20 +770,22 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
value_from_contents_and_address
(type, valaddr, 0));
return ada_val_print_1 (target_type, value_contents (v), 0, 0,
- stream, format, 0, recurse + 1, pretty);
+ stream, recurse + 1, options);
}
else
return ada_val_print_1 (TYPE_TARGET_TYPE (type),
valaddr0, embedded_offset,
- address, stream, format, deref_ref,
- recurse, pretty);
+ address, stream, recurse, options);
}
else
{
- format = format ? format : output_format;
+ int format = (options->format ? options->format
+ : options->output_format);
if (format)
{
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ struct value_print_options opts = *options;
+ opts.format = format;
+ print_scalar_formatted (valaddr, type, &opts, 0, stream);
}
else if (ada_is_system_address_type (type)
&& TYPE_OBJFILE (type) != NULL)
@@ -830,9 +824,9 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
}
case TYPE_CODE_ENUM:
- if (format)
+ if (options->format)
{
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ print_scalar_formatted (valaddr, type, options, 0, stream);
break;
}
len = TYPE_NFIELDS (type);
@@ -860,16 +854,16 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
break;
case TYPE_CODE_FLAGS:
- if (format)
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ if (options->format)
+ print_scalar_formatted (valaddr, type, options, 0, stream);
else
val_print_type_code_flags (type, valaddr, stream);
break;
case TYPE_CODE_FLT:
- if (format)
+ if (options->format)
return c_val_print (type, valaddr0, embedded_offset, address, stream,
- format, deref_ref, recurse, pretty);
+ recurse, options);
else
ada_print_floating (valaddr0 + embedded_offset, type, stream);
break;
@@ -883,13 +877,13 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
}
else
{
- print_record (type, valaddr, stream, format, recurse, pretty);
+ print_record (type, valaddr, stream, recurse, options);
return 0;
}
case TYPE_CODE_ARRAY:
- return ada_val_print_array (type, valaddr, address, stream, format,
- deref_ref, recurse, pretty);
+ return ada_val_print_array (type, valaddr, address, stream,
+ recurse, options);
case TYPE_CODE_REF:
/* For references, the debugger is expected to print the value as
@@ -910,8 +904,8 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
deref_val_int));
val_print (value_type (deref_val),
value_contents (deref_val), 0,
- VALUE_ADDRESS (deref_val), stream, format,
- deref_ref, recurse + 1, pretty, current_language);
+ VALUE_ADDRESS (deref_val), stream, recurse + 1,
+ options, current_language);
}
else
fputs_filtered ("(null)", stream);
@@ -927,8 +921,8 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
static int
print_variant_part (struct type *type, int field_num, const gdb_byte *valaddr,
- struct ui_file *stream, int format, int recurse,
- enum val_prettyprint pretty, int comma_needed,
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options, int comma_needed,
struct type *outer_type, const gdb_byte *outer_valaddr)
{
struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
@@ -941,13 +935,13 @@ print_variant_part (struct type *type, int field_num, const gdb_byte *valaddr,
(TYPE_FIELD_TYPE (var_type, which),
valaddr + TYPE_FIELD_BITPOS (type, field_num) / HOST_CHAR_BIT
+ TYPE_FIELD_BITPOS (var_type, which) / HOST_CHAR_BIT,
- stream, format, recurse, pretty,
+ stream, recurse, options,
comma_needed, outer_type, outer_valaddr);
}
int
-ada_value_print (struct value *val0, struct ui_file *stream, int format,
- enum val_prettyprint pretty)
+ada_value_print (struct value *val0, struct ui_file *stream,
+ const struct value_print_options *options)
{
const gdb_byte *valaddr = value_contents (val0);
CORE_ADDR address = VALUE_ADDRESS (val0) + value_offset (val0);
@@ -955,6 +949,7 @@ ada_value_print (struct value *val0, struct ui_file *stream, int format,
ada_to_fixed_type (value_type (val0), valaddr, address, NULL, 1);
struct value *val =
value_from_contents_and_address (type, valaddr, address);
+ struct value_print_options opts;
/* If it is a pointer, indicate what it points to. */
if (TYPE_CODE (type) == TYPE_CODE_PTR)
@@ -984,21 +979,23 @@ ada_value_print (struct value *val0, struct ui_file *stream, int format,
return 0;
}
+ opts = *options;
+ opts.deref_ref = 1;
return (val_print (type, value_contents (val), 0, address,
- stream, format, 1, 0, pretty, current_language));
+ stream, 0, &opts, current_language));
}
static void
print_record (struct type *type, const gdb_byte *valaddr,
- struct ui_file *stream, int format, int recurse,
- enum val_prettyprint pretty)
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
type = ada_check_typedef (type);
fprintf_filtered (stream, "(");
- if (print_field_values (type, valaddr, stream, format, recurse, pretty,
- 0, type, valaddr) != 0 && pretty)
+ if (print_field_values (type, valaddr, stream, recurse, options,
+ 0, type, valaddr) != 0 && options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
@@ -1009,7 +1006,7 @@ print_record (struct type *type, const gdb_byte *valaddr,
/* Print out fields of value at VALADDR having structure type TYPE.
- TYPE, VALADDR, STREAM, FORMAT, RECURSE, and PRETTY have the
+ TYPE, VALADDR, STREAM, RECURSE, and OPTIONS have the
same meanings as in ada_print_value and ada_val_print.
OUTER_TYPE and OUTER_VALADDR give type and address of enclosing record
@@ -1023,8 +1020,9 @@ print_record (struct type *type, const gdb_byte *valaddr,
static int
print_field_values (struct type *type, const gdb_byte *valaddr,
- struct ui_file *stream, int format, int recurse,
- enum val_prettyprint pretty, int comma_needed,
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options,
+ int comma_needed,
struct type *outer_type, const gdb_byte *outer_valaddr)
{
int i, len;
@@ -1042,7 +1040,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
print_field_values (TYPE_FIELD_TYPE (type, i),
valaddr
+ TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT,
- stream, format, recurse, pretty,
+ stream, recurse, options,
comma_needed, type, valaddr);
continue;
}
@@ -1050,7 +1048,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
{
comma_needed =
print_variant_part (type, i, valaddr,
- stream, format, recurse, pretty, comma_needed,
+ stream, recurse, options, comma_needed,
outer_type, outer_valaddr);
continue;
}
@@ -1059,7 +1057,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
fprintf_filtered (stream, ", ");
comma_needed = 1;
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -1068,7 +1066,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
{
wrap_here (n_spaces (2 + 2 * recurse));
}
- if (inspect_it)
+ if (options->inspect_it)
{
if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_PTR)
fputs_filtered ("\"( ptr \"", stream);
@@ -1107,6 +1105,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
{
int bit_pos = TYPE_FIELD_BITPOS (type, i);
int bit_size = TYPE_FIELD_BITSIZE (type, i);
+ struct value_print_options opts;
adjust_type_signedness (TYPE_FIELD_TYPE (type, i));
v = ada_value_primitive_packed_val (NULL, valaddr,
@@ -1114,15 +1113,20 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
bit_pos % HOST_CHAR_BIT,
bit_size,
TYPE_FIELD_TYPE (type, i));
+ opts = *options;
+ opts.deref_ref = 0;
val_print (TYPE_FIELD_TYPE (type, i), value_contents (v), 0, 0,
- stream, format, 0, recurse + 1, pretty,
- current_language);
+ stream, recurse + 1, &opts, current_language);
}
}
else
- ada_val_print (TYPE_FIELD_TYPE (type, i),
- valaddr + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT,
- 0, 0, stream, format, 0, recurse + 1, pretty);
+ {
+ struct value_print_options opts = *options;
+ opts.deref_ref = 0;
+ ada_val_print (TYPE_FIELD_TYPE (type, i),
+ valaddr + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT,
+ 0, 0, stream, recurse + 1, &opts);
+ }
annotate_field_end ();
}
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 3377d50..5514094 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -938,19 +938,19 @@ new_objfile (struct objfile *objfile)
/* Attach to process specified by ARGS. */
static void
-aix_thread_attach (char *args, int from_tty)
+aix_thread_attach (struct target_ops *ops, char *args, int from_tty)
{
- base_target.to_attach (args, from_tty);
+ base_target.to_attach (&base_target, args, from_tty);
pd_activate (1);
}
/* Detach from the process attached to by aix_thread_attach(). */
static void
-aix_thread_detach (char *args, int from_tty)
+aix_thread_detach (struct target_ops *ops, char *args, int from_tty)
{
pd_disable ();
- base_target.to_detach (args, from_tty);
+ base_target.to_detach (&base_target, args, from_tty);
}
/* Tell the inferior process to continue running thread PID if != -1
@@ -1667,10 +1667,10 @@ aix_thread_kill (void)
/* Clean up after the inferior exits. */
static void
-aix_thread_mourn_inferior (void)
+aix_thread_mourn_inferior (struct target_ops *ops)
{
pd_deactivate ();
- base_target.to_mourn_inferior ();
+ base_target.to_mourn_inferior (&base_target);
}
/* Return whether thread PID is still valid. */
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 9b7c8a4..891c4d4 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -316,7 +316,7 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2])
enum amd64_reg_class subclass[2];
/* Ignore static fields. */
- if (TYPE_FIELD_STATIC (type, i))
+ if (field_is_static (&TYPE_FIELD (type, i)))
continue;
gdb_assert (pos == 0 || pos == 1);
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 7ffc885..4e85bed 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -63,11 +63,10 @@ static int arm_debug;
MSYMBOL_IS_SPECIAL Tests the "special" bit in a minimal symbol. */
#define MSYMBOL_SET_SPECIAL(msym) \
- MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) \
- | 0x80000000)
+ MSYMBOL_TARGET_FLAG_1 (msym) = 1
#define MSYMBOL_IS_SPECIAL(msym) \
- (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
+ MSYMBOL_TARGET_FLAG_1 (msym)
/* Macros for swapping shorts and ints. In the unlikely case that anybody else needs these,
move to a general header. (A better solution might be to define memory read routines that
diff --git a/gdb/auxv.c b/gdb/auxv.c
index afc7fdd..fd42949 100644
--- a/gdb/auxv.c
+++ b/gdb/auxv.c
@@ -172,7 +172,6 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
while (target_auxv_parse (ops, &ptr, data + len, &type, &val) > 0)
{
- extern int addressprint;
const char *name = "???";
const char *description = "";
enum { dec, hex, str } flavor = hex;
@@ -204,9 +203,11 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
TAG (AT_ICACHEBSIZE, _("Instruction cache block size"), dec);
TAG (AT_UCACHEBSIZE, _("Unified cache block size"), dec);
TAG (AT_IGNOREPPC, _("Entry should be ignored"), dec);
+ TAG (AT_BASE_PLATFORM, _("String identifying base platform"), str);
+ TAG (AT_EXECFN, _("File name of executable"), str);
+ TAG (AT_SECURE, _("Boolean, was exec setuid-like?"), dec);
TAG (AT_SYSINFO, _("Special system info/entry points"), hex);
TAG (AT_SYSINFO_EHDR, _("System-supplied DSO's ELF header"), hex);
- TAG (AT_SECURE, _("Boolean, was exec setuid-like?"), dec);
TAG (AT_SUN_UID, _("Effective user ID"), dec);
TAG (AT_SUN_RUID, _("Real user ID"), dec);
TAG (AT_SUN_GID, _("Effective group ID"), dec);
@@ -240,10 +241,14 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
fprintf_filtered (file, "0x%s\n", paddr_nz (val));
break;
case str:
- if (addressprint)
- fprintf_filtered (file, "0x%s", paddr_nz (val));
- val_print_string (val, -1, 1, file);
- fprintf_filtered (file, "\n");
+ {
+ struct value_print_options opts;
+ get_user_print_options (&opts);
+ if (opts.addressprint)
+ fprintf_filtered (file, "0x%s", paddr_nz (val));
+ val_print_string (val, -1, 1, file, &opts);
+ fprintf_filtered (file, "\n");
+ }
break;
}
++ents;
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 6e863d7..847dbdd 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -56,6 +56,7 @@
#include "ada-lang.h"
#include "top.h"
#include "wrapper.h"
+#include "valprint.h"
#include "mi/mi-common.h"
@@ -159,10 +160,6 @@ static void awatch_command (char *, int);
static void do_enable_breakpoint (struct breakpoint *, enum bpdisp);
-static void create_fork_vfork_event_catchpoint (int tempflag,
- char *cond_string,
- enum bptype bp_kind);
-
static void stop_command (char *arg, int from_tty);
static void stopin_command (char *arg, int from_tty);
@@ -287,8 +284,6 @@ breakpoints_always_inserted_mode (void)
void _initialize_breakpoint (void);
-extern int addressprint; /* Print machine addresses? */
-
/* Are we executing breakpoint commands? */
static int executing_breakpoint_commands;
@@ -315,10 +310,6 @@ static int overlay_events_enabled;
B ? (TMP=B->global_next, 1): 0; \
B = TMP)
-/* True if breakpoint hit counts should be displayed in breakpoint info. */
-
-int show_breakpoint_hit_counts = 1;
-
/* Chains of all breakpoints defined. */
struct breakpoint *breakpoint_chain;
@@ -334,59 +325,6 @@ VEC(bp_location_p) *moribund_locations = NULL;
int breakpoint_count;
-/* This function returns a pointer to the string representation of the
- pathname of the dynamically-linked library that has just been
- loaded.
-
- This function must be used only when SOLIB_HAVE_LOAD_EVENT is TRUE,
- or undefined results are guaranteed.
-
- This string's contents are only valid immediately after the
- inferior has stopped in the dynamic linker hook, and becomes
- invalid as soon as the inferior is continued. Clients should make
- a copy of this string if they wish to continue the inferior and
- then access the string. */
-
-#ifndef SOLIB_LOADED_LIBRARY_PATHNAME
-#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) ""
-#endif
-
-/* This function returns a pointer to the string representation of the
- pathname of the dynamically-linked library that has just been
- unloaded.
-
- This function must be used only when SOLIB_HAVE_UNLOAD_EVENT is
- TRUE, or undefined results are guaranteed.
-
- This string's contents are only valid immediately after the
- inferior has stopped in the dynamic linker hook, and becomes
- invalid as soon as the inferior is continued. Clients should make
- a copy of this string if they wish to continue the inferior and
- then access the string. */
-
-#ifndef SOLIB_UNLOADED_LIBRARY_PATHNAME
-#define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) ""
-#endif
-
-/* This function is called by the "catch load" command. It allows the
- debugger to be notified by the dynamic linker when a specified
- library file (or any library file, if filename is NULL) is loaded. */
-
-#ifndef SOLIB_CREATE_CATCH_LOAD_HOOK
-#define SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag,filename,cond_string) \
- error (_("catch of library loads not yet implemented on this platform"))
-#endif
-
-/* This function is called by the "catch unload" command. It allows
- the debugger to be notified by the dynamic linker when a specified
- library file (or any library file, if filename is NULL) is
- unloaded. */
-
-#ifndef SOLIB_CREATE_CATCH_UNLOAD_HOOK
-#define SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid, tempflag, filename, cond_string) \
- error (_("catch of library unloads not yet implemented on this platform"))
-#endif
-
/* Return whether a breakpoint is an active enabled breakpoint. */
static int
breakpoint_enabled (struct breakpoint *b)
@@ -799,21 +737,10 @@ insert_catchpoint (struct ui_out *uo, void *args)
struct breakpoint *b = (struct breakpoint *) args;
int val = -1;
- switch (b->type)
- {
- case bp_catch_fork:
- target_insert_fork_catchpoint (PIDGET (inferior_ptid));
- break;
- case bp_catch_vfork:
- target_insert_vfork_catchpoint (PIDGET (inferior_ptid));
- break;
- case bp_catch_exec:
- target_insert_exec_catchpoint (PIDGET (inferior_ptid));
- break;
- default:
- internal_error (__FILE__, __LINE__, _("unknown breakpoint type"));
- break;
- }
+ gdb_assert (b->type == bp_catchpoint);
+ gdb_assert (b->ops != NULL && b->ops->insert != NULL);
+
+ b->ops->insert (b);
}
static int
@@ -1248,9 +1175,7 @@ Note: automatically using hardware breakpoints for read-only addresses.\n"));
bpt->inserted = (val != -1);
}
- else if (bpt->owner->type == bp_catch_fork
- || bpt->owner->type == bp_catch_vfork
- || bpt->owner->type == bp_catch_exec)
+ else if (bpt->owner->type == bp_catchpoint)
{
struct gdb_exception e = catch_exception (uiout, insert_catchpoint,
bpt->owner, RETURN_MASK_ERROR);
@@ -1285,7 +1210,10 @@ insert_breakpoints (void)
update_global_location_list (1);
- if (!breakpoints_always_inserted_mode () && target_has_execution)
+ if (!breakpoints_always_inserted_mode ()
+ && (target_has_execution
+ || (gdbarch_has_global_solist (target_gdbarch)
+ && target_supports_multi_process ())))
/* update_global_location_list does not insert breakpoints
when always_inserted_mode is not enabled. Explicitly
insert them now. */
@@ -1505,19 +1433,13 @@ update_breakpoints_after_exec (void)
continue;
}
- /* Don't delete an exec catchpoint, because else the inferior
- won't stop when it ought!
-
- Similarly, we probably ought to keep vfork catchpoints, 'cause
- on this target, we may not be able to stop when the vfork is
- seen, but only when the subsequent exec is seen. (And because
- deleting fork catchpoints here but not vfork catchpoints will
- seem mysterious to users, keep those too.) */
- if ((b->type == bp_catch_exec) ||
- (b->type == bp_catch_vfork) ||
- (b->type == bp_catch_fork))
+ if (b->type == bp_catchpoint)
{
- continue;
+ /* For now, none of the bp_catchpoint breakpoints need to
+ do anything at this point. In the future, if some of
+ the catchpoints need to something, we will need to add
+ a new method, and call this method from here. */
+ continue;
}
/* bp_finish is a special case. The only way we ought to be able
@@ -1690,28 +1612,13 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is)
warning (_("Could not remove hardware watchpoint %d."),
b->owner->number);
}
- else if ((b->owner->type == bp_catch_fork ||
- b->owner->type == bp_catch_vfork ||
- b->owner->type == bp_catch_exec)
- && breakpoint_enabled (b->owner)
- && !b->duplicate)
+ else if (b->owner->type == bp_catchpoint
+ && breakpoint_enabled (b->owner)
+ && !b->duplicate)
{
- val = -1;
- switch (b->owner->type)
- {
- case bp_catch_fork:
- val = target_remove_fork_catchpoint (PIDGET (inferior_ptid));
- break;
- case bp_catch_vfork:
- val = target_remove_vfork_catchpoint (PIDGET (inferior_ptid));
- break;
- case bp_catch_exec:
- val = target_remove_exec_catchpoint (PIDGET (inferior_ptid));
- break;
- default:
- warning (_("Internal error, %s line %d."), __FILE__, __LINE__);
- break;
- }
+ gdb_assert (b->owner->ops != NULL && b->owner->ops->remove != NULL);
+
+ val = b->owner->ops->remove (b->owner);
if (val)
return val;
b->inserted = (is == mark_inserted);
@@ -1748,6 +1655,12 @@ breakpoint_init_inferior (enum inf_context context)
{
struct breakpoint *b, *temp;
struct bp_location *bpt;
+ int ix;
+
+ /* If breakpoint locations are shared across processes, then there's
+ nothing to do. */
+ if (gdbarch_has_global_solist (target_gdbarch))
+ return;
ALL_BP_LOCATIONS (bpt)
if (bpt->owner->enable_state != bp_permanent)
@@ -1790,6 +1703,11 @@ breakpoint_init_inferior (enum inf_context context)
break;
}
}
+
+ /* Get rid of the moribund locations. */
+ for (ix = 0; VEC_iterate (bp_location_p, moribund_locations, ix, bpt); ++ix)
+ free_bp_location (bpt);
+ VEC_free (bp_location_p, moribund_locations);
}
/* breakpoint_here_p (PC) returns non-zero if an enabled breakpoint
@@ -1832,6 +1750,20 @@ breakpoint_here_p (CORE_ADDR pc)
return any_breakpoint_here ? ordinary_breakpoint_here : 0;
}
+/* Return true if there's a moribund breakpoint at PC. */
+
+int
+moribund_breakpoint_here_p (CORE_ADDR pc)
+{
+ struct bp_location *loc;
+ int ix;
+
+ for (ix = 0; VEC_iterate (bp_location_p, moribund_locations, ix, loc); ++ix)
+ if (loc->address == pc)
+ return 1;
+
+ return 0;
+}
/* Returns non-zero if there's a breakpoint inserted at PC, which is
inserted using regular breakpoint_chain/bp_location_chain mechanism.
@@ -1952,22 +1884,7 @@ breakpoint_thread_match (CORE_ADDR pc, ptid_t ptid)
int
ep_is_catchpoint (struct breakpoint *ep)
{
- return
- (ep->type == bp_catch_load)
- || (ep->type == bp_catch_unload)
- || (ep->type == bp_catch_fork)
- || (ep->type == bp_catch_vfork)
- || (ep->type == bp_catch_exec);
-
- /* ??rehrauer: Add more kinds here, as are implemented... */
-}
-
-int
-ep_is_shlib_catchpoint (struct breakpoint *ep)
-{
- return
- (ep->type == bp_catch_load)
- || (ep->type == bp_catch_unload);
+ return (ep->type == bp_catchpoint);
}
void
@@ -2248,7 +2165,11 @@ watchpoint_value_print (struct value *val, struct ui_file *stream)
if (val == NULL)
fprintf_unfiltered (stream, _("<unreadable>"));
else
- value_print (val, stream, 0, Val_pretty_default);
+ {
+ struct value_print_options opts;
+ get_user_print_options (&opts);
+ value_print (val, stream, &opts);
+ }
}
/* This is the normal print function for a bpstat. In the future,
@@ -2335,46 +2256,6 @@ print_it_typical (bpstat bs)
return PRINT_NOTHING;
break;
- case bp_catch_load:
- annotate_catchpoint (b->number);
- printf_filtered (_("\nCatchpoint %d (loaded %s), "),
- b->number,
- b->triggered_dll_pathname);
- return PRINT_SRC_AND_LOC;
- break;
-
- case bp_catch_unload:
- annotate_catchpoint (b->number);
- printf_filtered (_("\nCatchpoint %d (unloaded %s), "),
- b->number,
- b->triggered_dll_pathname);
- return PRINT_SRC_AND_LOC;
- break;
-
- case bp_catch_fork:
- annotate_catchpoint (b->number);
- printf_filtered (_("\nCatchpoint %d (forked process %d), "),
- b->number,
- ptid_get_pid (b->forked_inferior_pid));
- return PRINT_SRC_AND_LOC;
- break;
-
- case bp_catch_vfork:
- annotate_catchpoint (b->number);
- printf_filtered (_("\nCatchpoint %d (vforked process %d), "),
- b->number,
- ptid_get_pid (b->forked_inferior_pid));
- return PRINT_SRC_AND_LOC;
- break;
-
- case bp_catch_exec:
- annotate_catchpoint (b->number);
- printf_filtered (_("\nCatchpoint %d (exec'd %s), "),
- b->number,
- b->exec_pathname);
- return PRINT_SRC_AND_LOC;
- break;
-
case bp_watchpoint:
case bp_hardware_watchpoint:
annotate_watchpoint (b->number);
@@ -2793,9 +2674,7 @@ bpstat_check_location (const struct bp_location *bl, CORE_ADDR bp_addr)
&& b->type != bp_read_watchpoint
&& b->type != bp_access_watchpoint
&& b->type != bp_hardware_breakpoint
- && b->type != bp_catch_fork
- && b->type != bp_catch_vfork
- && b->type != bp_catch_exec) /* a non-watchpoint bp */
+ && b->type != bp_catchpoint) /* a non-watchpoint bp */
{
if (bl->address != bp_addr) /* address doesn't match */
return 0;
@@ -2827,48 +2706,14 @@ bpstat_check_location (const struct bp_location *bl, CORE_ADDR bp_addr)
&& !section_is_mapped (bl->section))
return 0;
}
-
- /* Is this a catchpoint of a load or unload? If so, did we
- get a load or unload of the specified library? If not,
- ignore it. */
- if ((b->type == bp_catch_load)
-#if defined(SOLIB_HAVE_LOAD_EVENT)
- && (!SOLIB_HAVE_LOAD_EVENT (PIDGET (inferior_ptid))
- || ((b->dll_pathname != NULL)
- && (strcmp (b->dll_pathname,
- SOLIB_LOADED_LIBRARY_PATHNAME (
- PIDGET (inferior_ptid)))
- != 0)))
-#endif
- )
- return 0;
-
- if ((b->type == bp_catch_unload)
-#if defined(SOLIB_HAVE_UNLOAD_EVENT)
- && (!SOLIB_HAVE_UNLOAD_EVENT (PIDGET (inferior_ptid))
- || ((b->dll_pathname != NULL)
- && (strcmp (b->dll_pathname,
- SOLIB_UNLOADED_LIBRARY_PATHNAME (
- PIDGET (inferior_ptid)))
- != 0)))
-#endif
- )
- return 0;
-
- if ((b->type == bp_catch_fork)
- && !inferior_has_forked (inferior_ptid,
- &b->forked_inferior_pid))
- return 0;
-
- if ((b->type == bp_catch_vfork)
- && !inferior_has_vforked (inferior_ptid,
- &b->forked_inferior_pid))
- return 0;
-
- if ((b->type == bp_catch_exec)
- && !inferior_has_execd (inferior_ptid, &b->exec_pathname))
- return 0;
+ if (b->type == bp_catchpoint)
+ {
+ gdb_assert (b->ops != NULL && b->ops->breakpoint_hit != NULL);
+ if (!b->ops->breakpoint_hit (b))
+ return 0;
+ }
+
return 1;
}
@@ -3383,19 +3228,7 @@ bpstat_what (bpstat bs)
case bp_overlay_event:
bs_class = bp_nostop;
break;
- case bp_catch_load:
- case bp_catch_unload:
- /* Only if this catchpoint triggered should we cause the
- step-out-of-dld behaviour. Otherwise, we ignore this
- catchpoint. */
- if (bs->stop)
- bs_class = catch_shlib_event;
- else
- bs_class = no_effect;
- break;
- case bp_catch_fork:
- case bp_catch_vfork:
- case bp_catch_exec:
+ case bp_catchpoint:
if (bs->stop)
{
if (bs->print)
@@ -3437,67 +3270,6 @@ bpstat_should_step (void)
-/* Given a bpstat that records zero or more triggered eventpoints, this
- function returns another bpstat which contains only the catchpoints
- on that first list, if any. */
-void
-bpstat_get_triggered_catchpoints (bpstat ep_list, bpstat *cp_list)
-{
- struct bpstats root_bs[1];
- bpstat bs = root_bs;
- struct breakpoint *ep;
- char *dll_pathname;
-
- bpstat_clear (cp_list);
- root_bs->next = NULL;
-
- for (; ep_list != NULL; ep_list = ep_list->next)
- {
- /* Is this eventpoint a catchpoint? If not, ignore it. */
- ep = ep_list->breakpoint_at->owner;
- if (ep == NULL)
- break;
- if ((ep->type != bp_catch_load) &&
- (ep->type != bp_catch_unload))
- /* pai: (temp) ADD fork/vfork here!! */
- continue;
-
- /* Yes; add it to the list. */
- bs = bpstat_alloc (ep_list->breakpoint_at, bs);
- *bs = *ep_list;
- bs->next = NULL;
- bs = root_bs->next;
-
-#if defined(SOLIB_ADD)
- /* Also, for each triggered catchpoint, tag it with the name of
- the library that caused this trigger. (We copy the name now,
- because it's only guaranteed to be available NOW, when the
- catchpoint triggers. Clients who may wish to know the name
- later must get it from the catchpoint itself.) */
- if (ep->triggered_dll_pathname != NULL)
- xfree (ep->triggered_dll_pathname);
- if (ep->type == bp_catch_load)
- dll_pathname = SOLIB_LOADED_LIBRARY_PATHNAME (
- PIDGET (inferior_ptid));
- else
- dll_pathname = SOLIB_UNLOADED_LIBRARY_PATHNAME (
- PIDGET (inferior_ptid));
-#else
- dll_pathname = NULL;
-#endif
- if (dll_pathname)
- {
- ep->triggered_dll_pathname = (char *)
- xmalloc (strlen (dll_pathname) + 1);
- strcpy (ep->triggered_dll_pathname, dll_pathname);
- }
- else
- ep->triggered_dll_pathname = NULL;
- }
-
- *cp_list = bs;
-}
-
static void print_breakpoint_location (struct breakpoint *b,
struct bp_location *loc,
char *wrap_indent,
@@ -3573,11 +3345,7 @@ print_one_breakpoint_location (struct breakpoint *b,
{bp_shlib_event, "shlib events"},
{bp_thread_event, "thread events"},
{bp_overlay_event, "overlay events"},
- {bp_catch_load, "catch load"},
- {bp_catch_unload, "catch unload"},
- {bp_catch_fork, "catch fork"},
- {bp_catch_vfork, "catch vfork"},
- {bp_catch_exec, "catch exec"}
+ {bp_catchpoint, "catchpoint"},
};
static char bpenables[] = "nynny";
@@ -3588,6 +3356,9 @@ print_one_breakpoint_location (struct breakpoint *b,
int header_of_multiple = 0;
int part_of_multiple = (loc != NULL);
+ struct value_print_options opts;
+
+ get_user_print_options (&opts);
gdb_assert (!loc || loc_number != 0);
/* See comment in print_one_breakpoint concerning
@@ -3651,7 +3422,7 @@ print_one_breakpoint_location (struct breakpoint *b,
/* 5 and 6 */
strcpy (wrap_indent, " ");
- if (addressprint)
+ if (opts.addressprint)
{
if (gdbarch_addr_bit (current_gdbarch) <= 32)
strcat (wrap_indent, " ");
@@ -3683,66 +3454,13 @@ print_one_breakpoint_location (struct breakpoint *b,
/* Field 4, the address, is omitted (which makes the columns
not line up too nicely with the headers, but the effect
is relatively readable). */
- if (addressprint)
+ if (opts.addressprint)
ui_out_field_skip (uiout, "addr");
annotate_field (5);
print_expression (b->exp, stb->stream);
ui_out_field_stream (uiout, "what", stb);
break;
- case bp_catch_load:
- case bp_catch_unload:
- /* Field 4, the address, is omitted (which makes the columns
- not line up too nicely with the headers, but the effect
- is relatively readable). */
- if (addressprint)
- ui_out_field_skip (uiout, "addr");
- annotate_field (5);
- if (b->dll_pathname == NULL)
- {
- ui_out_field_string (uiout, "what", "<any library>");
- ui_out_spaces (uiout, 1);
- }
- else
- {
- ui_out_text (uiout, "library \"");
- ui_out_field_string (uiout, "what", b->dll_pathname);
- ui_out_text (uiout, "\" ");
- }
- break;
-
- case bp_catch_fork:
- case bp_catch_vfork:
- /* Field 4, the address, is omitted (which makes the columns
- not line up too nicely with the headers, but the effect
- is relatively readable). */
- if (addressprint)
- ui_out_field_skip (uiout, "addr");
- annotate_field (5);
- if (!ptid_equal (b->forked_inferior_pid, null_ptid))
- {
- ui_out_text (uiout, "process ");
- ui_out_field_int (uiout, "what",
- ptid_get_pid (b->forked_inferior_pid));
- ui_out_spaces (uiout, 1);
- }
- break;
-
- case bp_catch_exec:
- /* Field 4, the address, is omitted (which makes the columns
- not line up too nicely with the headers, but the effect
- is relatively readable). */
- if (addressprint)
- ui_out_field_skip (uiout, "addr");
- annotate_field (5);
- if (b->exec_pathname != NULL)
- {
- ui_out_text (uiout, "program \"");
- ui_out_field_string (uiout, "what", b->exec_pathname);
- ui_out_text (uiout, "\" ");
- }
- break;
-
case bp_breakpoint:
case bp_hardware_breakpoint:
case bp_until:
@@ -3755,7 +3473,7 @@ print_one_breakpoint_location (struct breakpoint *b,
case bp_shlib_event:
case bp_thread_event:
case bp_overlay_event:
- if (addressprint)
+ if (opts.addressprint)
{
annotate_field (4);
if (header_of_multiple)
@@ -3812,7 +3530,7 @@ print_one_breakpoint_location (struct breakpoint *b,
ui_out_text (uiout, "\n");
}
- if (!part_of_multiple && show_breakpoint_hit_counts && b->hit_count)
+ if (!part_of_multiple && b->hit_count)
{
/* FIXME should make an annotation for this */
if (ep_is_catchpoint (b))
@@ -3830,7 +3548,7 @@ print_one_breakpoint_location (struct breakpoint *b,
/* Output the count also if it is zero, but only if this is
mi. FIXME: Should have a better test for this. */
if (ui_out_is_mi_like_p (uiout))
- if (!part_of_multiple && show_breakpoint_hit_counts && b->hit_count == 0)
+ if (!part_of_multiple && b->hit_count == 0)
ui_out_field_int (uiout, "times", b->hit_count);
if (!part_of_multiple && b->ignore_count)
@@ -3939,11 +3657,7 @@ static int
user_settable_breakpoint (const struct breakpoint *b)
{
return (b->type == bp_breakpoint
- || b->type == bp_catch_load
- || b->type == bp_catch_unload
- || b->type == bp_catch_fork
- || b->type == bp_catch_vfork
- || b->type == bp_catch_exec
+ || b->type == bp_catchpoint
|| b->type == bp_hardware_breakpoint
|| b->type == bp_watchpoint
|| b->type == bp_read_watchpoint
@@ -3962,7 +3676,10 @@ breakpoint_1 (int bnum, int allflag)
CORE_ADDR last_addr = (CORE_ADDR) -1;
int nr_printable_breakpoints;
struct cleanup *bkpttbl_chain;
+ struct value_print_options opts;
+ get_user_print_options (&opts);
+
/* Compute the number of rows in the table. */
nr_printable_breakpoints = 0;
ALL_BREAKPOINTS (b)
@@ -3973,7 +3690,7 @@ breakpoint_1 (int bnum, int allflag)
nr_printable_breakpoints++;
}
- if (addressprint)
+ if (opts.addressprint)
bkpttbl_chain
= make_cleanup_ui_out_table_begin_end (uiout, 6, nr_printable_breakpoints,
"BreakpointTable");
@@ -3996,7 +3713,7 @@ breakpoint_1 (int bnum, int allflag)
if (nr_printable_breakpoints > 0)
annotate_field (3);
ui_out_table_header (uiout, 3, ui_left, "enabled", "Enb"); /* 4 */
- if (addressprint)
+ if (opts.addressprint)
{
if (nr_printable_breakpoints > 0)
annotate_field (4);
@@ -4150,9 +3867,7 @@ set_default_breakpoint (int valid, CORE_ADDR addr, struct symtab *symtab,
bp_hardware_watchpoint
bp_read_watchpoint
bp_access_watchpoint
- bp_catch_exec
- bp_catch_fork
- bp_catch_vork */
+ bp_catchpoint */
static int
breakpoint_address_is_meaningful (struct breakpoint *bpt)
@@ -4163,9 +3878,7 @@ breakpoint_address_is_meaningful (struct breakpoint *bpt)
&& type != bp_hardware_watchpoint
&& type != bp_read_watchpoint
&& type != bp_access_watchpoint
- && type != bp_catch_exec
- && type != bp_catch_fork
- && type != bp_catch_vfork);
+ && type != bp_catchpoint);
}
/* Rescan breakpoints at the same address and section as BPT,
@@ -4280,9 +3993,7 @@ adjust_breakpoint_address (CORE_ADDR bpaddr, enum bptype bptype)
|| bptype == bp_hardware_watchpoint
|| bptype == bp_read_watchpoint
|| bptype == bp_access_watchpoint
- || bptype == bp_catch_fork
- || bptype == bp_catch_vfork
- || bptype == bp_catch_exec)
+ || bptype == bp_catchpoint)
{
/* Watchpoints and the various bp_catch_* eventpoints should not
have their addresses modified. */
@@ -4335,8 +4046,6 @@ allocate_bp_location (struct breakpoint *bpt, enum bptype bp_type)
case bp_shlib_event:
case bp_thread_event:
case bp_overlay_event:
- case bp_catch_load:
- case bp_catch_unload:
loc->loc_type = bp_loc_software_breakpoint;
break;
case bp_hardware_breakpoint:
@@ -4348,9 +4057,7 @@ allocate_bp_location (struct breakpoint *bpt, enum bptype bp_type)
loc->loc_type = bp_loc_hardware_watchpoint;
break;
case bp_watchpoint:
- case bp_catch_fork:
- case bp_catch_vfork:
- case bp_catch_exec:
+ case bp_catchpoint:
loc->loc_type = bp_loc_other;
break;
default:
@@ -4392,8 +4099,6 @@ set_raw_breakpoint_without_location (enum bptype bptype)
b->ignore_count = 0;
b->commands = NULL;
b->frame_id = null_frame_id;
- b->dll_pathname = NULL;
- b->triggered_dll_pathname = NULL;
b->forked_inferior_pid = null_ptid;
b->exec_pathname = NULL;
b->ops = NULL;
@@ -4750,74 +4455,287 @@ disable_breakpoints_in_unloaded_shlib (struct so_list *solib)
}
}
+/* FORK & VFORK catchpoints. */
+
+/* Implement the "insert" breakpoint_ops method for fork catchpoints. */
+
static void
-create_fork_vfork_event_catchpoint (int tempflag, char *cond_string,
- enum bptype bp_kind)
+insert_catch_fork (struct breakpoint *b)
{
- struct symtab_and_line sal;
- struct breakpoint *b;
- int thread = -1; /* All threads. */
+ target_insert_fork_catchpoint (PIDGET (inferior_ptid));
+}
- init_sal (&sal);
- sal.pc = 0;
- sal.symtab = NULL;
- sal.line = 0;
+/* Implement the "remove" breakpoint_ops method for fork catchpoints. */
- b = set_raw_breakpoint (sal, bp_kind);
- set_breakpoint_count (breakpoint_count + 1);
- b->number = breakpoint_count;
- b->cond_string = (cond_string == NULL) ?
- NULL : savestring (cond_string, strlen (cond_string));
- b->thread = thread;
- b->addr_string = NULL;
- b->enable_state = bp_enabled;
- b->disposition = tempflag ? disp_del : disp_donttouch;
- b->forked_inferior_pid = null_ptid;
- update_global_location_list (1);
+static int
+remove_catch_fork (struct breakpoint *b)
+{
+ return target_remove_fork_catchpoint (PIDGET (inferior_ptid));
+}
+/* Implement the "breakpoint_hit" breakpoint_ops method for fork
+ catchpoints. */
- mention (b);
+static int
+breakpoint_hit_catch_fork (struct breakpoint *b)
+{
+ return inferior_has_forked (inferior_ptid, &b->forked_inferior_pid);
+}
+
+/* Implement the "print_it" breakpoint_ops method for fork catchpoints. */
+
+static enum print_stop_action
+print_it_catch_fork (struct breakpoint *b)
+{
+ annotate_catchpoint (b->number);
+ printf_filtered (_("\nCatchpoint %d (forked process %d), "),
+ b->number, ptid_get_pid (b->forked_inferior_pid));
+ return PRINT_SRC_AND_LOC;
+}
+
+/* Implement the "print_one" breakpoint_ops method for fork catchpoints. */
+
+static void
+print_one_catch_fork (struct breakpoint *b, CORE_ADDR *last_addr)
+{
+ struct value_print_options opts;
+
+ get_user_print_options (&opts);
+
+ /* Field 4, the address, is omitted (which makes the columns
+ not line up too nicely with the headers, but the effect
+ is relatively readable). */
+ if (opts.addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ ui_out_text (uiout, "fork");
+ if (!ptid_equal (b->forked_inferior_pid, null_ptid))
+ {
+ ui_out_text (uiout, ", process ");
+ ui_out_field_int (uiout, "what",
+ ptid_get_pid (b->forked_inferior_pid));
+ ui_out_spaces (uiout, 1);
+ }
}
+/* Implement the "print_mention" breakpoint_ops method for fork
+ catchpoints. */
+
+static void
+print_mention_catch_fork (struct breakpoint *b)
+{
+ printf_filtered (_("Catchpoint %d (fork)"), b->number);
+}
+
+/* The breakpoint_ops structure to be used in fork catchpoints. */
+
+static struct breakpoint_ops catch_fork_breakpoint_ops =
+{
+ insert_catch_fork,
+ remove_catch_fork,
+ breakpoint_hit_catch_fork,
+ print_it_catch_fork,
+ print_one_catch_fork,
+ print_mention_catch_fork
+};
+
+/* Implement the "insert" breakpoint_ops method for vfork catchpoints. */
+
static void
-create_fork_event_catchpoint (int tempflag, char *cond_string)
+insert_catch_vfork (struct breakpoint *b)
+{
+ target_insert_vfork_catchpoint (PIDGET (inferior_ptid));
+}
+
+/* Implement the "remove" breakpoint_ops method for vfork catchpoints. */
+
+static int
+remove_catch_vfork (struct breakpoint *b)
+{
+ return target_remove_vfork_catchpoint (PIDGET (inferior_ptid));
+}
+
+/* Implement the "breakpoint_hit" breakpoint_ops method for vfork
+ catchpoints. */
+
+static int
+breakpoint_hit_catch_vfork (struct breakpoint *b)
{
- create_fork_vfork_event_catchpoint (tempflag, cond_string, bp_catch_fork);
+ return inferior_has_vforked (inferior_ptid, &b->forked_inferior_pid);
}
+/* Implement the "print_it" breakpoint_ops method for vfork catchpoints. */
+
+static enum print_stop_action
+print_it_catch_vfork (struct breakpoint *b)
+{
+ annotate_catchpoint (b->number);
+ printf_filtered (_("\nCatchpoint %d (vforked process %d), "),
+ b->number, ptid_get_pid (b->forked_inferior_pid));
+ return PRINT_SRC_AND_LOC;
+}
+
+/* Implement the "print_one" breakpoint_ops method for vfork catchpoints. */
+
static void
-create_vfork_event_catchpoint (int tempflag, char *cond_string)
+print_one_catch_vfork (struct breakpoint *b, CORE_ADDR *last_addr)
{
- create_fork_vfork_event_catchpoint (tempflag, cond_string, bp_catch_vfork);
+ struct value_print_options opts;
+
+ get_user_print_options (&opts);
+ /* Field 4, the address, is omitted (which makes the columns
+ not line up too nicely with the headers, but the effect
+ is relatively readable). */
+ if (opts.addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ ui_out_text (uiout, "vfork");
+ if (!ptid_equal (b->forked_inferior_pid, null_ptid))
+ {
+ ui_out_text (uiout, ", process ");
+ ui_out_field_int (uiout, "what",
+ ptid_get_pid (b->forked_inferior_pid));
+ ui_out_spaces (uiout, 1);
+ }
}
+/* Implement the "print_mention" breakpoint_ops method for vfork
+ catchpoints. */
+
static void
-create_exec_event_catchpoint (int tempflag, char *cond_string)
+print_mention_catch_vfork (struct breakpoint *b)
+{
+ printf_filtered (_("Catchpoint %d (vfork)"), b->number);
+}
+
+/* The breakpoint_ops structure to be used in vfork catchpoints. */
+
+static struct breakpoint_ops catch_vfork_breakpoint_ops =
+{
+ insert_catch_vfork,
+ remove_catch_vfork,
+ breakpoint_hit_catch_vfork,
+ print_it_catch_vfork,
+ print_one_catch_vfork,
+ print_mention_catch_vfork
+};
+
+/* Create a new breakpoint of the bp_catchpoint kind and return it.
+
+ If TEMPFLAG is non-zero, then make the breakpoint temporary.
+ If COND_STRING is not NULL, then store it in the breakpoint.
+ OPS, if not NULL, is the breakpoint_ops structure associated
+ to the catchpoint. */
+
+static struct breakpoint *
+create_catchpoint (int tempflag, char *cond_string,
+ struct breakpoint_ops *ops)
{
struct symtab_and_line sal;
struct breakpoint *b;
- int thread = -1; /* All threads. */
init_sal (&sal);
sal.pc = 0;
sal.symtab = NULL;
sal.line = 0;
- b = set_raw_breakpoint (sal, bp_catch_exec);
+ b = set_raw_breakpoint (sal, bp_catchpoint);
set_breakpoint_count (breakpoint_count + 1);
b->number = breakpoint_count;
- b->cond_string = (cond_string == NULL) ?
+
+ b->cond_string = (cond_string == NULL) ?
NULL : savestring (cond_string, strlen (cond_string));
- b->thread = thread;
+ b->thread = -1;
b->addr_string = NULL;
b->enable_state = bp_enabled;
b->disposition = tempflag ? disp_del : disp_donttouch;
- update_global_location_list (1);
+ b->ops = ops;
mention (b);
+ update_global_location_list (1);
+
+ return b;
+}
+
+static void
+create_fork_vfork_event_catchpoint (int tempflag, char *cond_string,
+ struct breakpoint_ops *ops)
+{
+ struct breakpoint *b = create_catchpoint (tempflag, cond_string, ops);
+
+ /* FIXME: We should put this information in a breakpoint private data
+ area. */
+ b->forked_inferior_pid = null_ptid;
+}
+
+/* Exec catchpoints. */
+
+static void
+insert_catch_exec (struct breakpoint *b)
+{
+ target_insert_exec_catchpoint (PIDGET (inferior_ptid));
+}
+
+static int
+remove_catch_exec (struct breakpoint *b)
+{
+ return target_remove_exec_catchpoint (PIDGET (inferior_ptid));
}
static int
+breakpoint_hit_catch_exec (struct breakpoint *b)
+{
+ return inferior_has_execd (inferior_ptid, &b->exec_pathname);
+}
+
+static enum print_stop_action
+print_it_catch_exec (struct breakpoint *b)
+{
+ annotate_catchpoint (b->number);
+ printf_filtered (_("\nCatchpoint %d (exec'd %s), "), b->number,
+ b->exec_pathname);
+ return PRINT_SRC_AND_LOC;
+}
+
+static void
+print_one_catch_exec (struct breakpoint *b, CORE_ADDR *last_addr)
+{
+ struct value_print_options opts;
+
+ get_user_print_options (&opts);
+
+ /* Field 4, the address, is omitted (which makes the columns
+ not line up too nicely with the headers, but the effect
+ is relatively readable). */
+ if (opts.addressprint)
+ ui_out_field_skip (uiout, "addr");
+ annotate_field (5);
+ ui_out_text (uiout, "exec");
+ if (b->exec_pathname != NULL)
+ {
+ ui_out_text (uiout, ", program \"");
+ ui_out_field_string (uiout, "what", b->exec_pathname);
+ ui_out_text (uiout, "\" ");
+ }
+}
+
+static void
+print_mention_catch_exec (struct breakpoint *b)
+{
+ printf_filtered (_("Catchpoint %d (exec)"), b->number);
+}
+
+static struct breakpoint_ops catch_exec_breakpoint_ops =
+{
+ insert_catch_exec,
+ remove_catch_exec,
+ breakpoint_hit_catch_exec,
+ print_it_catch_exec,
+ print_one_catch_exec,
+ print_mention_catch_exec
+};
+
+static int
hw_breakpoint_used_count (void)
{
struct breakpoint *b;
@@ -4940,6 +4858,9 @@ mention (struct breakpoint *b)
int say_where = 0;
struct cleanup *old_chain, *ui_out_chain;
struct ui_stream *stb;
+ struct value_print_options opts;
+
+ get_user_print_options (&opts);
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
@@ -5016,24 +4937,6 @@ mention (struct breakpoint *b)
printf_filtered (_("Hardware assisted breakpoint %d"), b->number);
say_where = 1;
break;
- case bp_catch_load:
- case bp_catch_unload:
- printf_filtered (_("Catchpoint %d (%s %s)"),
- b->number,
- (b->type == bp_catch_load) ? "load" : "unload",
- (b->dll_pathname != NULL) ?
- b->dll_pathname : "<any library>");
- break;
- case bp_catch_fork:
- case bp_catch_vfork:
- printf_filtered (_("Catchpoint %d (%s)"),
- b->number,
- (b->type == bp_catch_fork) ? "fork" : "vfork");
- break;
- case bp_catch_exec:
- printf_filtered (_("Catchpoint %d (exec)"),
- b->number);
- break;
case bp_until:
case bp_finish:
@@ -5058,7 +4961,7 @@ mention (struct breakpoint *b)
}
else
{
- if (addressprint || b->source_file == NULL)
+ if (opts.addressprint || b->source_file == NULL)
{
printf_filtered (" at ");
fputs_filtered (paddress (b->loc->address), gdb_stdout);
@@ -6450,11 +6353,13 @@ catch_fork_command_1 (char *arg, int from_tty, struct cmd_list_element *command)
{
case catch_fork_temporary:
case catch_fork_permanent:
- create_fork_event_catchpoint (tempflag, cond_string);
+ create_fork_vfork_event_catchpoint (tempflag, cond_string,
+ &catch_fork_breakpoint_ops);
break;
case catch_vfork_temporary:
case catch_vfork_permanent:
- create_vfork_event_catchpoint (tempflag, cond_string);
+ create_fork_vfork_event_catchpoint (tempflag, cond_string,
+ &catch_vfork_breakpoint_ops);
break;
default:
error (_("unsupported or unknown fork kind; cannot catch it"));
@@ -6486,102 +6391,7 @@ catch_exec_command_1 (char *arg, int from_tty, struct cmd_list_element *command)
/* If this target supports it, create an exec catchpoint
and enable reporting of such events. */
- create_exec_event_catchpoint (tempflag, cond_string);
-}
-
-static void
-catch_load_command_1 (char *arg, int from_tty, struct cmd_list_element *command)
-{
- int tempflag;
- char *dll_pathname = NULL;
- char *cond_string = NULL;
-
- tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
-
- if (!arg)
- arg = "";
- ep_skip_leading_whitespace (&arg);
-
- /* The allowed syntax is:
- catch load
- catch load if <cond>
- catch load <filename>
- catch load <filename> if <cond>
-
- The user is not allowed to specify the <filename> after an
- if clause.
-
- We'll ignore the pathological case of a file named "if".
-
- First, check if there's an if clause. If so, then there
- cannot be a filename. */
- cond_string = ep_parse_optional_if_clause (&arg);
-
- /* If there was an if clause, then there cannot be a filename.
- Else, there might be a filename and an if clause. */
- if (cond_string == NULL)
- {
- dll_pathname = ep_parse_optional_filename (&arg);
- ep_skip_leading_whitespace (&arg);
- cond_string = ep_parse_optional_if_clause (&arg);
- }
-
- if ((*arg != '\0') && !isspace (*arg))
- error (_("Junk at end of arguments."));
-
- /* Create a load breakpoint that only triggers when a load of
- the specified dll (or any dll, if no pathname was specified)
- occurs. */
- SOLIB_CREATE_CATCH_LOAD_HOOK (PIDGET (inferior_ptid), tempflag,
- dll_pathname, cond_string);
-}
-
-static void
-catch_unload_command_1 (char *arg, int from_tty,
- struct cmd_list_element *command)
-{
- int tempflag;
- char *dll_pathname = NULL;
- char *cond_string = NULL;
-
- tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
-
- if (!arg)
- arg = "";
- ep_skip_leading_whitespace (&arg);
-
- /* The allowed syntax is:
- catch unload
- catch unload if <cond>
- catch unload <filename>
- catch unload <filename> if <cond>
-
- The user is not allowed to specify the <filename> after an
- if clause.
-
- We'll ignore the pathological case of a file named "if".
-
- First, check if there's an if clause. If so, then there
- cannot be a filename. */
- cond_string = ep_parse_optional_if_clause (&arg);
-
- /* If there was an if clause, then there cannot be a filename.
- Else, there might be a filename and an if clause. */
- if (cond_string == NULL)
- {
- dll_pathname = ep_parse_optional_filename (&arg);
- ep_skip_leading_whitespace (&arg);
- cond_string = ep_parse_optional_if_clause (&arg);
- }
-
- if ((*arg != '\0') && !isspace (*arg))
- error (_("Junk at end of arguments."));
-
- /* Create an unload breakpoint that only triggers when an unload of
- the specified dll (or any dll, if no pathname was specified)
- occurs. */
- SOLIB_CREATE_CATCH_UNLOAD_HOOK (PIDGET (inferior_ptid), tempflag,
- dll_pathname, cond_string);
+ create_catchpoint (tempflag, cond_string, &catch_exec_breakpoint_ops);
}
static enum print_stop_action
@@ -6618,7 +6428,9 @@ print_exception_catchpoint (struct breakpoint *b)
static void
print_one_exception_catchpoint (struct breakpoint *b, CORE_ADDR *last_addr)
{
- if (addressprint)
+ struct value_print_options opts;
+ get_user_print_options (&opts);
+ if (opts.addressprint)
{
annotate_field (4);
if (b->loc == NULL || b->loc->shlib_disabled)
@@ -6651,6 +6463,9 @@ print_mention_exception_catchpoint (struct breakpoint *b)
}
static struct breakpoint_ops gnu_v3_exception_catchpoint_ops = {
+ NULL, /* insert */
+ NULL, /* remove */
+ NULL, /* breakpoint_hit */
print_exception_catchpoint,
print_one_exception_catchpoint,
print_mention_exception_catchpoint
@@ -7111,8 +6926,8 @@ update_global_location_list (int should_insert)
}
if (!found_object)
- {
- if (removed)
+ {
+ if (removed && non_stop)
{
/* This location was removed from the targets. In non-stop mode,
a race condition is possible where we've removed a breakpoint,
@@ -7120,28 +6935,31 @@ update_global_location_list (int should_insert)
arrive later. To suppress spurious SIGTRAPs reported to user,
we keep this breakpoint location for a bit, and will retire it
after we see 3 * thread_count events.
- The theory here is that reporting of events should,
+ The theory here is that reporting of events should,
"on the average", be fair, so after that many event we'll see
events from all threads that have anything of interest, and no
- longer need to keep this breakpoint. This is just a
+ longer need to keep this breakpoint. This is just a
heuristic, but if it's wrong, we'll report unexpected SIGTRAP,
- which is usability issue, but not a correctness problem. */
+ which is usability issue, but not a correctness problem. */
loc->events_till_retirement = 3 * (thread_count () + 1);
loc->owner = NULL;
- }
- free_bp_location (loc);
+ VEC_safe_push (bp_location_p, moribund_locations, loc);
+ }
+ else
+ free_bp_location (loc);
}
}
-
+
ALL_BREAKPOINTS (b)
{
check_duplicates (b);
}
- if (breakpoints_always_inserted_mode ()
- && should_insert
- && target_has_execution)
+ if (breakpoints_always_inserted_mode () && should_insert
+ && (target_has_execution
+ || (gdbarch_has_global_solist (target_gdbarch)
+ && target_supports_multi_process ())))
insert_breakpoint_locations ();
}
@@ -7243,10 +7061,6 @@ delete_breakpoint (struct breakpoint *bpt)
value_free (bpt->val);
if (bpt->source_file != NULL)
xfree (bpt->source_file);
- if (bpt->dll_pathname != NULL)
- xfree (bpt->dll_pathname);
- if (bpt->triggered_dll_pathname != NULL)
- xfree (bpt->triggered_dll_pathname);
if (bpt->exec_pathname != NULL)
xfree (bpt->exec_pathname);
@@ -7516,8 +7330,6 @@ breakpoint_re_set_one (void *bint)
return 0;
case bp_breakpoint:
case bp_hardware_breakpoint:
- case bp_catch_load:
- case bp_catch_unload:
if (b->addr_string == NULL)
{
/* Anything without a string can't be re-set. */
@@ -7617,9 +7429,7 @@ breakpoint_re_set_one (void *bint)
/* We needn't really do anything to reset these, since the mask
that requests them is unaffected by e.g., new libraries being
loaded. */
- case bp_catch_fork:
- case bp_catch_vfork:
- case bp_catch_exec:
+ case bp_catchpoint:
break;
default:
@@ -7731,14 +7541,11 @@ set_ignore_count (int bptnum, int count, int from_tty)
error (_("No breakpoint number %d."), bptnum);
}
-/* Clear the ignore counts of all breakpoints. */
void
-breakpoint_clear_ignore_counts (void)
+make_breakpoint_silent (struct breakpoint *b)
{
- struct breakpoint *b;
-
- ALL_BREAKPOINTS (b)
- b->ignore_count = 0;
+ /* Silence the breakpoint. */
+ b->silent = 1;
}
/* Command to set ignore-count of breakpoint N to COUNT. */
@@ -7888,11 +7695,7 @@ disable_command (char *args, int from_tty)
bpt->number);
continue;
case bp_breakpoint:
- case bp_catch_load:
- case bp_catch_unload:
- case bp_catch_fork:
- case bp_catch_vfork:
- case bp_catch_exec:
+ case bp_catchpoint:
case bp_hardware_breakpoint:
case bp_watchpoint:
case bp_hardware_watchpoint:
@@ -8022,11 +7825,7 @@ enable_command (char *args, int from_tty)
bpt->number);
continue;
case bp_breakpoint:
- case bp_catch_load:
- case bp_catch_unload:
- case bp_catch_fork:
- case bp_catch_vfork:
- case bp_catch_exec:
+ case bp_catchpoint:
case bp_hardware_breakpoint:
case bp_watchpoint:
case bp_hardware_watchpoint:
@@ -8549,18 +8348,6 @@ With an argument, catch only exceptions with the given name."),
catch_exec_command_1,
CATCH_PERMANENT,
CATCH_TEMPORARY);
- add_catch_command ("load", _("\
-Catch library loads.\n\
-With an argument, catch only loads of that library."),
- catch_load_command_1,
- CATCH_PERMANENT,
- CATCH_TEMPORARY);
- add_catch_command ("unload", _("\
-Catch library unloads.\n\
-With an argument, catch only unloads of that library."),
- catch_unload_command_1,
- CATCH_PERMANENT,
- CATCH_TEMPORARY);
add_catch_command ("exception", _("\
Catch Ada exceptions, when raised.\n\
With an argument, catch only exceptions with the given name."),
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index db6e972..cff6c3f 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -110,23 +110,7 @@ enum bptype
bp_overlay_event,
- /* These breakpoints are used to implement the "catch load" command
- on platforms whose dynamic linkers support such functionality. */
- bp_catch_load,
-
- /* These breakpoints are used to implement the "catch unload" command
- on platforms whose dynamic linkers support such functionality. */
- bp_catch_unload,
-
- /* These are not really breakpoints, but are catchpoints that
- implement the "catch fork", "catch vfork" and "catch exec" commands
- on platforms whose kernel support such functionality. (I.e.,
- kernels which can raise an event when a fork or exec occurs, as
- opposed to the debugger setting breakpoints on functions named
- "fork" or "exec".) */
- bp_catch_fork,
- bp_catch_vfork,
- bp_catch_exec,
+ bp_catchpoint,
};
/* States of enablement of breakpoint. */
@@ -315,6 +299,19 @@ struct bp_location
struct breakpoint_ops
{
+ /* Insert the breakpoint or activate the catchpoint. Should raise
+ an exception if the operation failed. */
+ void (*insert) (struct breakpoint *);
+
+ /* Remove the breakpoint/catchpoint that was previously inserted
+ with the "insert" method above. Return non-zero if the operation
+ succeeded. */
+ int (*remove) (struct breakpoint *);
+
+ /* Return non-zero if the debugger should tell the user that this
+ breakpoint was hit. */
+ int (*breakpoint_hit) (struct breakpoint *);
+
/* The normal print routine for this breakpoint, called when we
hit it. */
enum print_stop_action (*print_it) (struct breakpoint *);
@@ -435,16 +432,6 @@ struct breakpoint
aborting, so you can back up to just before the abort. */
int hit_count;
- /* Filename of a dynamically-linked library (dll), used for
- bp_catch_load and bp_catch_unload (malloc'd), or NULL if any
- library is significant. */
- char *dll_pathname;
-
- /* Filename of a dll whose state change (e.g., load or unload)
- triggered this catchpoint. This field is only valid immediately
- after this catchpoint has triggered. */
- char *triggered_dll_pathname;
-
/* Process id of a child process whose forking triggered this
catchpoint. This field is only valid immediately after this
catchpoint has triggered. */
@@ -613,12 +600,6 @@ extern void bpstat_do_actions (void);
/* Modify BS so that the actions will not be performed. */
extern void bpstat_clear_actions (bpstat);
-/* Given a bpstat that records zero or more triggered eventpoints, this
- function returns another bpstat which contains only the catchpoints
- on that first list, if any.
- */
-extern void bpstat_get_triggered_catchpoints (bpstat, bpstat *);
-
/* Implementation: */
/* Values used to tell the printing routine how to behave for this bpstat. */
@@ -681,6 +662,8 @@ enum breakpoint_here
extern enum breakpoint_here breakpoint_here_p (CORE_ADDR);
+extern int moribund_breakpoint_here_p (CORE_ADDR);
+
extern int breakpoint_inserted_here_p (CORE_ADDR);
extern int regular_breakpoint_inserted_here_p (CORE_ADDR);
@@ -713,8 +696,6 @@ extern void delete_breakpoint (struct breakpoint *);
extern void breakpoint_auto_delete (bpstat);
-extern void breakpoint_clear_ignore_counts (void);
-
extern void break_command (char *, int);
extern void hbreak_command_wrapper (char *, int);
@@ -844,11 +825,6 @@ extern void disable_breakpoints_in_shlibs (void);
/* This function returns TRUE if ep is a catchpoint. */
extern int ep_is_catchpoint (struct breakpoint *);
-/* This function returns TRUE if ep is a catchpoint of a
- shared library (aka dynamically-linked library) event,
- such as a library load or unload. */
-extern int ep_is_shlib_catchpoint (struct breakpoint *);
-
/* Enable breakpoints and delete when hit. Called with ARG == NULL
deletes all breakpoints. */
extern void delete_command (char *arg, int from_tty);
@@ -884,4 +860,7 @@ extern int breakpoints_always_inserted_mode (void);
in our opinion won't ever trigger. */
extern void breakpoint_retire_moribund (void);
+/* Tell a breakpoint to be quiet. */
+extern void make_breakpoint_silent (struct breakpoint *);
+
#endif /* !defined (BREAKPOINT_H) */
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index 59853ce..f38c825 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -270,9 +270,10 @@ bsd_uthread_solib_unloaded (struct so_list *so)
}
static void
-bsd_uthread_mourn_inferior (void)
+bsd_uthread_mourn_inferior (struct target_ops *ops)
{
- find_target_beneath (bsd_uthread_ops_hack)->to_mourn_inferior ();
+ struct target_ops *beneath = find_target_beneath (bsd_uthread_ops_hack);
+ beneath->to_mourn_inferior (beneath);
bsd_uthread_deactivate ();
}
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 6d16940..153e2be 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -184,7 +184,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
%token <ssym> NAME /* BLOCKNAME defined below to give it higher precedence. */
%token <voidval> COMPLETE
%token <tsym> TYPENAME
-%type <sval> name
+%type <sval> name string_exp
%type <ssym> name_not_typename
%type <tsym> typename
@@ -562,7 +562,34 @@ exp : SIZEOF '(' type ')' %prec UNARY
write_exp_elt_opcode (OP_LONG); }
;
-exp : STRING
+string_exp:
+ STRING
+ {
+ /* We copy the string here, and not in the
+ lexer, to guarantee that we do not leak a
+ string. Note that we follow the
+ NUL-termination convention of the
+ lexer. */
+ $$.length = $1.length;
+ $$.ptr = malloc ($1.length + 1);
+ memcpy ($$.ptr, $1.ptr, $1.length + 1);
+ }
+
+ | string_exp STRING
+ {
+ /* Note that we NUL-terminate here, but just
+ for convenience. */
+ struct stoken t;
+ t.length = $1.length + $2.length;
+ t.ptr = malloc (t.length + 1);
+ memcpy (t.ptr, $1.ptr, $1.length);
+ memcpy (t.ptr + $1.length, $2.ptr, $2.length + 1);
+ free ($1.ptr);
+ $$ = t;
+ }
+ ;
+
+exp : string_exp
{ /* C strings are converted into array constants with
an explicit null byte added at the end. Thus
the array upper bound is the string length.
@@ -583,7 +610,9 @@ exp : STRING
write_exp_elt_opcode (OP_ARRAY);
write_exp_elt_longcst ((LONGEST) 0);
write_exp_elt_longcst ((LONGEST) ($1.length));
- write_exp_elt_opcode (OP_ARRAY); }
+ write_exp_elt_opcode (OP_ARRAY);
+ free ($1.ptr);
+ }
;
/* C++. */
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index a978b17..067e429 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -86,7 +86,8 @@ c_printchar (int c, struct ui_file *stream)
void
c_printstr (struct ui_file *stream, const gdb_byte *string,
- unsigned int length, int width, int force_ellipses)
+ unsigned int length, int width, int force_ellipses,
+ const struct value_print_options *options)
{
unsigned int i;
unsigned int things_printed = 0;
@@ -108,7 +109,7 @@ c_printstr (struct ui_file *stream, const gdb_byte *string,
return;
}
- for (i = 0; i < length && things_printed < print_max; ++i)
+ for (i = 0; i < length && things_printed < options->print_max; ++i)
{
/* Position of the character we are examining
to see whether it is repeated. */
@@ -137,11 +138,11 @@ c_printstr (struct ui_file *stream, const gdb_byte *string,
++reps;
}
- if (reps > repeat_count_threshold)
+ if (reps > options->repeat_count_threshold)
{
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\", ", stream);
else
fputs_filtered ("\", ", stream);
@@ -150,14 +151,14 @@ c_printstr (struct ui_file *stream, const gdb_byte *string,
LA_PRINT_CHAR (current_char, stream);
fprintf_filtered (stream, _(" <repeats %u times>"), reps);
i = rep1 - 1;
- things_printed += repeat_count_threshold;
+ things_printed += options->repeat_count_threshold;
need_comma = 1;
}
else
{
if (!in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\"", stream);
else
fputs_filtered ("\"", stream);
@@ -171,7 +172,7 @@ c_printstr (struct ui_file *stream, const gdb_byte *string,
/* Terminate the quotes if necessary. */
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\"", stream);
else
fputs_filtered ("\"", stream);
diff --git a/gdb/c-lang.h b/gdb/c-lang.h
index fe1939a..cc9abde 100644
--- a/gdb/c-lang.h
+++ b/gdb/c-lang.h
@@ -40,11 +40,11 @@ extern void c_print_type (struct type *, char *, struct ui_file *, int,
extern void c_print_typedef (struct type *, struct symbol *, struct ui_file *);
extern int c_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
- struct ui_file *, int, int, int,
- enum val_prettyprint);
+ struct ui_file *, int,
+ const struct value_print_options *);
-extern int c_value_print (struct value *, struct ui_file *, int,
- enum val_prettyprint);
+extern int c_value_print (struct value *, struct ui_file *,
+ const struct value_print_options *);
/* These are in c-lang.c: */
@@ -52,7 +52,8 @@ extern void c_printchar (int, struct ui_file *);
extern void c_printstr (struct ui_file * stream, const gdb_byte *string,
unsigned int length, int width,
- int force_ellipses);
+ int force_ellipses,
+ const struct value_print_options *options);
extern void scan_macro_expansion (char *expansion);
extern int scanning_macro_expansion (void);
@@ -70,17 +71,13 @@ extern void c_type_print_base (struct type *, struct ui_file *, int, int);
/* These are in cp-valprint.c */
-extern int vtblprint; /* Controls printing of vtbl's */
-
-extern int static_field_print;
-
extern void cp_print_class_member (const gdb_byte *, struct type *,
struct ui_file *, char *);
extern void cp_print_value_fields (struct type *, struct type *,
const gdb_byte *, int, CORE_ADDR,
struct ui_file *, int,
- int, enum val_prettyprint,
+ const struct value_print_options *,
struct type **, int);
extern int cp_is_vtbl_ptr_type (struct type *);
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 31a98ea..b18e437 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -560,7 +560,7 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
fprintf_filtered (stream, "[");
if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
- && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
+ && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
fprintf_filtered (stream, "%d",
(TYPE_LENGTH (type)
/ TYPE_LENGTH (TYPE_TARGET_TYPE (type))));
@@ -890,14 +890,12 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show,
}
print_spaces_filtered (level + 4, stream);
- if (TYPE_FIELD_STATIC (type, i))
- {
- fprintf_filtered (stream, "static ");
- }
+ if (field_is_static (&TYPE_FIELD (type, i)))
+ fprintf_filtered (stream, "static ");
c_print_type (TYPE_FIELD_TYPE (type, i),
TYPE_FIELD_NAME (type, i),
stream, show - 1, level + 4);
- if (!TYPE_FIELD_STATIC (type, i)
+ if (!field_is_static (&TYPE_FIELD (type, i))
&& TYPE_FIELD_PACKED (type, i))
{
/* It is a bitfield. This code does not attempt
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index 1dff6cb..b639e8b 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -36,7 +36,8 @@
stream STREAM. */
static void
-print_function_pointer_address (CORE_ADDR address, struct ui_file *stream)
+print_function_pointer_address (CORE_ADDR address, struct ui_file *stream,
+ int addressprint)
{
CORE_ADDR func_addr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
address,
@@ -102,21 +103,15 @@ textual_element_type (struct type *type, char format)
/* Print data of type TYPE located at VALADDR (within GDB), which came from
the inferior at address ADDRESS, onto stdio stream STREAM according to
- FORMAT (a letter or 0 for natural format). The data at VALADDR is in
- target byte order.
+ OPTIONS. The data at VALADDR is in target byte order.
If the data are a string pointer, returns the number of string characters
- printed.
-
- If DEREF_REF is nonzero, then dereference references, otherwise just print
- them like pointers.
-
- The PRETTY parameter controls prettyprinting. */
+ printed. */
int
c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
unsigned int i = 0; /* Number of characters printed */
unsigned len;
@@ -134,29 +129,29 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
{
eltlen = TYPE_LENGTH (elttype);
len = TYPE_LENGTH (type) / eltlen;
- if (prettyprint_arrays)
+ if (options->prettyprint_arrays)
{
print_spaces_filtered (2 + 2 * recurse, stream);
}
/* Print arrays of textual chars with a string syntax. */
- if (textual_element_type (elttype, format))
+ if (textual_element_type (elttype, options->format))
{
/* If requested, look for the first null char and only print
elements up to it. */
- if (stop_print_at_null)
+ if (options->stop_print_at_null)
{
unsigned int temp_len;
/* Look for a NULL char. */
for (temp_len = 0;
(valaddr + embedded_offset)[temp_len]
- && temp_len < len && temp_len < print_max;
+ && temp_len < len && temp_len < options->print_max;
temp_len++);
len = temp_len;
}
- LA_PRINT_STRING (stream, valaddr + embedded_offset, len, eltlen, 0);
+ LA_PRINT_STRING (stream, valaddr + embedded_offset, len, eltlen, 0, options);
i = len;
}
else
@@ -174,7 +169,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
i = 0;
}
val_print_array_elements (type, valaddr + embedded_offset, address, stream,
- format, deref_ref, recurse, pretty, i);
+ recurse, options, i);
fprintf_filtered (stream, "}");
}
break;
@@ -184,9 +179,10 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
goto print_unpacked_pointer;
case TYPE_CODE_MEMBERPTR:
- if (format)
+ if (options->format)
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
break;
}
cp_print_class_member (valaddr + embedded_offset, type, stream, "&");
@@ -197,19 +193,20 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_PTR:
- if (format && format != 's')
+ if (options->format && options->format != 's')
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
break;
}
- if (vtblprint && cp_is_vtbl_ptr_type (type))
+ if (options->vtblprint && cp_is_vtbl_ptr_type (type))
{
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if we ARE using
-fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
- print_function_pointer_address (addr, stream);
+ print_function_pointer_address (addr, stream, options->addressprint);
break;
}
elttype = check_typedef (TYPE_TARGET_TYPE (type));
@@ -220,21 +217,24 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_function_pointer_address (addr, stream);
+ print_function_pointer_address (addr, stream,
+ options->addressprint);
/* Return value is irrelevant except for string pointers. */
return (0);
}
- if (addressprint)
+ if (options->addressprint)
fputs_filtered (paddress (addr), stream);
/* For a pointer to a textual type, also print the string
pointed to, unless pointer is null. */
/* FIXME: need to handle wchar_t here... */
- if (textual_element_type (elttype, format) && addr != 0)
+ if (textual_element_type (elttype, options->format)
+ && addr != 0)
{
- i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
+ i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream,
+ options);
}
else if (cp_is_vtbl_member (type))
{
@@ -250,7 +250,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
fputs_filtered (SYMBOL_PRINT_NAME (msymbol), stream);
fputs_filtered (">", stream);
}
- if (vt_address && vtblprint)
+ if (vt_address && options->vtblprint)
{
struct value *vt_val;
struct symbol *wsym = (struct symbol *) NULL;
@@ -271,10 +271,9 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
wtype = TYPE_TARGET_TYPE (type);
}
vt_val = value_at (wtype, vt_address);
- common_val_print (vt_val, stream, format,
- deref_ref, recurse + 1, pretty,
+ common_val_print (vt_val, stream, recurse + 1, options,
current_language);
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -291,17 +290,17 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
case TYPE_CODE_REF:
elttype = check_typedef (TYPE_TARGET_TYPE (type));
- if (addressprint)
+ if (options->addressprint)
{
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
fprintf_filtered (stream, "@");
fputs_filtered (paddress (addr), stream);
- if (deref_ref)
+ if (options->deref_ref)
fputs_filtered (": ", stream);
}
/* De-reference the reference. */
- if (deref_ref)
+ if (options->deref_ref)
{
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
{
@@ -309,8 +308,8 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (type, valaddr + embedded_offset));
- common_val_print (deref_val, stream, format, deref_ref,
- recurse, pretty, current_language);
+ common_val_print (deref_val, stream, recurse, options,
+ current_language);
}
else
fputs_filtered ("???", stream);
@@ -318,7 +317,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_UNION:
- if (recurse && !unionprint)
+ if (recurse && !options->unionprint)
{
fprintf_filtered (stream, "{...}");
break;
@@ -326,7 +325,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
/* Fall through. */
case TYPE_CODE_STRUCT:
/*FIXME: Abstract this away */
- if (vtblprint && cp_is_vtbl_ptr_type (type))
+ if (options->vtblprint && cp_is_vtbl_ptr_type (type))
{
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if NOT using
@@ -337,17 +336,18 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
CORE_ADDR addr
= extract_typed_address (valaddr + offset, field_type);
- print_function_pointer_address (addr, stream);
+ print_function_pointer_address (addr, stream, options->addressprint);
}
else
- cp_print_value_fields (type, type, valaddr, embedded_offset, address, stream, format,
- recurse, pretty, NULL, 0);
+ cp_print_value_fields (type, type, valaddr, embedded_offset, address, stream,
+ recurse, options, NULL, 0);
break;
case TYPE_CODE_ENUM:
- if (format)
+ if (options->format)
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
break;
}
len = TYPE_NFIELDS (type);
@@ -371,17 +371,19 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_FLAGS:
- if (format)
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ if (options->format)
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
else
val_print_type_code_flags (type, valaddr + embedded_offset, stream);
break;
case TYPE_CODE_FUNC:
case TYPE_CODE_METHOD:
- if (format)
+ if (options->format)
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
break;
}
/* FIXME, we should consider, at least for ANSI C language, eliminating
@@ -394,9 +396,14 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_BOOL:
- format = format ? format : output_format;
- if (format)
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ if (options->format || options->output_format)
+ {
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ &opts, 0, stream);
+ }
else
{
val = unpack_long (type, valaddr + embedded_offset);
@@ -420,10 +427,13 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
/* FALLTHROUGH */
case TYPE_CODE_INT:
- format = format ? format : output_format;
- if (format)
+ if (options->format || options->output_format)
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ &opts, 0, stream);
}
else
{
@@ -432,7 +442,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
Since we don't know whether the value is really intended to
be used as an integer or a character, print the character
equivalent as well. */
- if (textual_element_type (type, format))
+ if (textual_element_type (type, options->format))
{
fputs_filtered (" ", stream);
LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr + embedded_offset),
@@ -442,10 +452,13 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_CHAR:
- format = format ? format : output_format;
- if (format)
+ if (options->format || options->output_format)
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ &opts, 0, stream);
}
else
{
@@ -460,9 +473,10 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_FLT:
- if (format)
+ if (options->format)
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
}
else
{
@@ -471,8 +485,9 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_DECFLOAT:
- if (format)
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ if (options->format)
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
else
print_decimal_floating (valaddr + embedded_offset, type, stream);
break;
@@ -493,19 +508,19 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_COMPLEX:
- if (format)
+ if (options->format)
print_scalar_formatted (valaddr + embedded_offset,
TYPE_TARGET_TYPE (type),
- format, 0, stream);
+ options, 0, stream);
else
print_floating (valaddr + embedded_offset, TYPE_TARGET_TYPE (type),
stream);
fprintf_filtered (stream, " + ");
- if (format)
+ if (options->format)
print_scalar_formatted (valaddr + embedded_offset
+ TYPE_LENGTH (TYPE_TARGET_TYPE (type)),
TYPE_TARGET_TYPE (type),
- format, 0, stream);
+ options, 0, stream);
else
print_floating (valaddr + embedded_offset
+ TYPE_LENGTH (TYPE_TARGET_TYPE (type)),
@@ -522,11 +537,14 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
}
int
-c_value_print (struct value *val, struct ui_file *stream, int format,
- enum val_prettyprint pretty)
+c_value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options)
{
struct type *type, *real_type;
int full, top, using_enc;
+ struct value_print_options opts = *options;
+
+ opts.deref_ref = 1;
/* If it is a pointer, indicate what it points to.
@@ -551,7 +569,8 @@ c_value_print (struct value *val, struct ui_file *stream, int format,
{
/* Print nothing */
}
- else if (objectprint && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
+ else if (options->objectprint
+ && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
{
if (TYPE_CODE(type) == TYPE_CODE_REF)
@@ -602,7 +621,7 @@ c_value_print (struct value *val, struct ui_file *stream, int format,
if (!value_initialized (val))
fprintf_filtered (stream, " [uninitialized] ");
- if (objectprint && (TYPE_CODE (type) == TYPE_CODE_CLASS))
+ if (options->objectprint && (TYPE_CODE (type) == TYPE_CODE_CLASS))
{
/* Attempt to determine real type of object */
real_type = value_rtti_type (val, &full, &top, &using_enc);
@@ -616,8 +635,8 @@ c_value_print (struct value *val, struct ui_file *stream, int format,
/* Print out object: enclosing type is same as real_type if full */
return val_print (value_enclosing_type (val),
value_contents_all (val), 0,
- VALUE_ADDRESS (val), stream, format, 1, 0,
- pretty, current_language);
+ VALUE_ADDRESS (val), stream, 0,
+ &opts, current_language);
/* Note: When we look up RTTI entries, we don't get any information on
const or volatile attributes */
}
@@ -628,8 +647,8 @@ c_value_print (struct value *val, struct ui_file *stream, int format,
TYPE_NAME (value_enclosing_type (val)));
return val_print (value_enclosing_type (val),
value_contents_all (val), 0,
- VALUE_ADDRESS (val), stream, format, 1, 0,
- pretty, current_language);
+ VALUE_ADDRESS (val), stream, 0,
+ &opts, current_language);
}
/* Otherwise, we end up at the return outside this "if" */
}
@@ -637,5 +656,5 @@ c_value_print (struct value *val, struct ui_file *stream, int format,
return val_print (type, value_contents_all (val),
value_embedded_offset (val),
VALUE_ADDRESS (val) + value_offset (val),
- stream, format, 1, 0, pretty, current_language);
+ stream, 0, &opts, current_language);
}
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index d9d2c56..21a64a0 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -450,6 +450,7 @@ source_script (char *file, int from_tty)
files. Put the full location in 'full_pathname'. */
fd = openp (source_path, OPF_TRY_CWD_FIRST,
file, O_RDONLY, 0, &full_pathname);
+ make_cleanup (xfree, full_pathname);
/* Use the full path name, if it is found. */
if (full_pathname != NULL && fd != -1)
@@ -462,7 +463,10 @@ source_script (char *file, int from_tty)
if (from_tty)
perror_with_name (file);
else
- return;
+ {
+ do_cleanups (old_cleanups);
+ return;
+ }
}
stream = fdopen (fd, FOPEN_RT);
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index 67a9fc5..d5dbc97 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -67,19 +67,6 @@ scan_expression_with_cleanup (char **cmd, const char *def)
}
-static void
-do_fclose_cleanup (void *arg)
-{
- FILE *file = arg;
- fclose (arg);
-}
-
-static struct cleanup *
-make_cleanup_fclose (FILE *file)
-{
- return make_cleanup (do_fclose_cleanup, file);
-}
-
char *
scan_filename_with_cleanup (char **cmd, const char *defname)
{
diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c
index 86f1bc0..1e941b1 100644
--- a/gdb/cli/cli-logging.c
+++ b/gdb/cli/cli-logging.c
@@ -85,6 +85,7 @@ pop_output_files (void)
static void
handle_redirections (int from_tty)
{
+ struct cleanup *cleanups;
struct ui_file *output;
if (saved_filename != NULL)
@@ -97,6 +98,7 @@ handle_redirections (int from_tty)
output = gdb_fopen (logging_filename, logging_overwrite ? "w" : "a");
if (output == NULL)
perror_with_name (_("set logging"));
+ cleanups = make_cleanup_ui_file_delete (output);
/* Redirects everything to gdb_stdout while this is running. */
if (!logging_redirect)
@@ -104,6 +106,8 @@ handle_redirections (int from_tty)
output = tee_file_new (gdb_stdout, 0, output, 1);
if (output == NULL)
perror_with_name (_("set logging"));
+ discard_cleanups (cleanups);
+ cleanups = make_cleanup_ui_file_delete (output);
if (from_tty)
fprintf_unfiltered (gdb_stdout, "Copying output to %s.\n",
logging_filename);
@@ -112,6 +116,8 @@ handle_redirections (int from_tty)
fprintf_unfiltered (gdb_stdout, "Redirecting output to %s.\n",
logging_filename);
+ discard_cleanups (cleanups);
+
saved_filename = xstrdup (logging_filename);
saved_output.out = gdb_stdout;
saved_output.err = gdb_stderr;
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 6bfff40..e65c29e 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -1446,12 +1446,6 @@ source_cleanup_lines (void *args)
source_file_name = p->old_file;
}
-static void
-do_fclose_cleanup (void *stream)
-{
- fclose (stream);
-}
-
struct wrapped_read_command_file_args
{
FILE *stream;
@@ -1476,7 +1470,7 @@ script_from_file (FILE *stream, char *file)
if (stream == NULL)
internal_error (__FILE__, __LINE__, _("called with NULL file pointer!"));
- old_cleanups = make_cleanup (do_fclose_cleanup, stream);
+ old_cleanups = make_cleanup_fclose (stream);
old_lines.old_line = source_line_number;
old_lines.old_file = source_file_name;
diff --git a/gdb/coffread.c b/gdb/coffread.c
index de81d47..8697554 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -421,7 +421,7 @@ record_minimal_symbol (struct coff_symbol *cs, CORE_ADDR address,
bfd_section = cs_to_bfd_section (cs, objfile);
return prim_record_minimal_symbol_and_info (cs->c_name, address, type,
- NULL, section, bfd_section, objfile);
+ section, bfd_section, objfile);
}
/* coff_symfile_init ()
@@ -1081,7 +1081,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
if ((nsyms == 0) && (pe_file))
{
- /* We've got no debugging symbols, but it's is a portable
+ /* We've got no debugging symbols, but it's a portable
executable, so try to read the export table */
read_pe_exported_syms (objfile);
}
@@ -1943,9 +1943,8 @@ coff_read_struct_type (int index, int length, int lastsym,
obsavestring (name, strlen (name), &objfile->objfile_obstack);
FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux,
objfile);
- FIELD_BITPOS (list->field) = 8 * ms->c_value;
+ SET_FIELD_BITPOS (list->field, 8 * ms->c_value);
FIELD_BITSIZE (list->field) = 0;
- FIELD_STATIC_KIND (list->field) = 0;
nfields++;
break;
@@ -1961,9 +1960,8 @@ coff_read_struct_type (int index, int length, int lastsym,
obsavestring (name, strlen (name), &objfile->objfile_obstack);
FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux,
objfile);
- FIELD_BITPOS (list->field) = ms->c_value;
+ SET_FIELD_BITPOS (list->field, ms->c_value);
FIELD_BITSIZE (list->field) = sub_aux.x_sym.x_misc.x_lnsz.x_size;
- FIELD_STATIC_KIND (list->field) = 0;
nfields++;
break;
@@ -2080,11 +2078,10 @@ coff_read_enum_type (int index, int length, int lastsym,
struct symbol *xsym = syms->symbol[j];
SYMBOL_TYPE (xsym) = type;
TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym);
- TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym);
+ SET_FIELD_BITPOS (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym));
if (SYMBOL_VALUE (xsym) < 0)
unsigned_enum = 0;
TYPE_FIELD_BITSIZE (type, n) = 0;
- TYPE_FIELD_STATIC_KIND (type, n) = 0;
}
if (syms == osyms)
break;
diff --git a/gdb/config/alpha/alpha-osf3.mh b/gdb/config/alpha/alpha-osf3.mh
index c534675..8dc6f80 100644
--- a/gdb/config/alpha/alpha-osf3.mh
+++ b/gdb/config/alpha/alpha-osf3.mh
@@ -2,4 +2,5 @@
NAT_FILE= nm-osf3.h
NATDEPFILES= corelow.o alpha-nat.o fork-child.o \
solib-osf.o solib.o procfs.o proc-api.o proc-events.o proc-flags.o \
- proc-why.o
+ proc-why.o dec-thread.o
+NAT_CLIBS= -lpthreaddebug
diff --git a/gdb/configure b/gdb/configure
index 7955569..c8fe9da 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -10134,22 +10134,14 @@ done
fi
-# For the TUI, we need enhanced curses functionality.
-#
-# FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied
-# curses library because the latter might not provide all the
-# functionality we need. However, this leads to problems on systems
-# where the linker searches /usr/local/lib, but the compiler doesn't
-# search /usr/local/include, if ncurses is installed in /usr/local. A
-# default installation of ncurses on alpha*-dec-osf* will lead to such
-# a situation.
-echo "$as_me:$LINENO: checking for library containing waddstr" >&5
-echo $ECHO_N "checking for library containing waddstr... $ECHO_C" >&6
-if test "${ac_cv_search_waddstr+set}" = set; then
+# On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
+echo "$as_me:$LINENO: checking for library containing dlgetmodinfo" >&5
+echo $ECHO_N "checking for library containing dlgetmodinfo... $ECHO_C" >&6
+if test "${ac_cv_search_dlgetmodinfo+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
-ac_cv_search_waddstr=no
+ac_cv_search_dlgetmodinfo=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10163,11 +10155,11 @@ 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 waddstr ();
+char dlgetmodinfo ();
int
main ()
{
-waddstr ();
+dlgetmodinfo ();
;
return 0;
}
@@ -10194,7 +10186,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_search_waddstr="none required"
+ ac_cv_search_dlgetmodinfo="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -10202,8 +10194,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_waddstr" = no; then
- for ac_lib in ncurses cursesX curses; do
+if test "$ac_cv_search_dlgetmodinfo" = no; then
+ for ac_lib in dl xpdl; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -10218,11 +10210,11 @@ 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 waddstr ();
+char dlgetmodinfo ();
int
main ()
{
-waddstr ();
+dlgetmodinfo ();
;
return 0;
}
@@ -10249,7 +10241,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_search_waddstr="-l$ac_lib"
+ ac_cv_search_dlgetmodinfo="-l$ac_lib"
break
else
echo "$as_me: failed program was:" >&5
@@ -10262,22 +10254,63 @@ rm -f conftest.err conftest.$ac_objext \
fi
LIBS=$ac_func_search_save_LIBS
fi
-echo "$as_me:$LINENO: result: $ac_cv_search_waddstr" >&5
-echo "${ECHO_T}$ac_cv_search_waddstr" >&6
-if test "$ac_cv_search_waddstr" != no; then
- test "$ac_cv_search_waddstr" = "none required" || LIBS="$ac_cv_search_waddstr $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_dlgetmodinfo" >&5
+echo "${ECHO_T}$ac_cv_search_dlgetmodinfo" >&6
+if test "$ac_cv_search_dlgetmodinfo" != no; then
+ test "$ac_cv_search_dlgetmodinfo" = "none required" || LIBS="$ac_cv_search_dlgetmodinfo $LIBS"
fi
-# On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
-echo "$as_me:$LINENO: checking for library containing dlgetmodinfo" >&5
-echo $ECHO_N "checking for library containing dlgetmodinfo... $ECHO_C" >&6
-if test "${ac_cv_search_dlgetmodinfo+set}" = set; then
+# On alpha-osf, it appears that libtermcap and libcurses are not compatible.
+# There is a very specific comment in /usr/include/curses.h explaining that
+# termcap routines built into libcurses must not be used.
+#
+# The symptoms we observed so far is GDB unexpectedly changing
+# the terminal settings when tgetent is called - this is particularly
+# visible as the output is missing carriage returns, and so rapidly
+# becomes very hard to read.
+#
+# The readline configure script has already decided that libtermcap
+# was enough for its purposes, and so decided to build readline using
+# libtermcap. Since the TUI mode requires curses, building GDB with
+# TUI enabled results in both libraries to be used at the same time,
+# which is not allowed. This basically means that GDB with TUI is
+# broken on alpha-osf.
+
+case $host_os in
+ alpha*-*-osf* )
+ if "$enable_tui" = "yes"; then
+ { { echo "$as_me:$LINENO: error: Building GDB with TUI mode is not supported on this host" >&5
+echo "$as_me: error: Building GDB with TUI mode is not supported on this host" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ if "$enable_tui" = "auto"; then
+ enable_tui=no
+ fi
+ ;;
+esac
+
+# Check whether we should enable the TUI, but only do so if we really
+# can.
+if test x"$enable_tui" != xno; then
+ if test -d $srcdir/tui; then
+ # For the TUI, we need enhanced curses functionality.
+ #
+ # FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied
+ # curses library because the latter might not provide all the
+ # functionality we need. However, this leads to problems on systems
+ # where the linker searches /usr/local/lib, but the compiler doesn't
+ # search /usr/local/include, if ncurses is installed in /usr/local. A
+ # default installation of ncurses on alpha*-dec-osf* will lead to such
+ # a situation.
+ echo "$as_me:$LINENO: checking for library containing waddstr" >&5
+echo $ECHO_N "checking for library containing waddstr... $ECHO_C" >&6
+if test "${ac_cv_search_waddstr+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
-ac_cv_search_dlgetmodinfo=no
+ac_cv_search_waddstr=no
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10291,11 +10324,11 @@ 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 dlgetmodinfo ();
+char waddstr ();
int
main ()
{
-dlgetmodinfo ();
+waddstr ();
;
return 0;
}
@@ -10322,7 +10355,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_search_dlgetmodinfo="none required"
+ ac_cv_search_waddstr="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -10330,8 +10363,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_dlgetmodinfo" = no; then
- for ac_lib in dl xpdl; do
+if test "$ac_cv_search_waddstr" = no; then
+ for ac_lib in ncurses cursesX curses; do
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -10346,11 +10379,11 @@ 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 dlgetmodinfo ();
+char waddstr ();
int
main ()
{
-dlgetmodinfo ();
+waddstr ();
;
return 0;
}
@@ -10377,7 +10410,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_search_dlgetmodinfo="-l$ac_lib"
+ ac_cv_search_waddstr="-l$ac_lib"
break
else
echo "$as_me: failed program was:" >&5
@@ -10390,14 +10423,36 @@ rm -f conftest.err conftest.$ac_objext \
fi
LIBS=$ac_func_search_save_LIBS
fi
-echo "$as_me:$LINENO: result: $ac_cv_search_dlgetmodinfo" >&5
-echo "${ECHO_T}$ac_cv_search_dlgetmodinfo" >&6
-if test "$ac_cv_search_dlgetmodinfo" != no; then
- test "$ac_cv_search_dlgetmodinfo" = "none required" || LIBS="$ac_cv_search_dlgetmodinfo $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_waddstr" >&5
+echo "${ECHO_T}$ac_cv_search_waddstr" >&6
+if test "$ac_cv_search_waddstr" != no; then
+ test "$ac_cv_search_waddstr" = "none required" || LIBS="$ac_cv_search_waddstr $LIBS"
fi
+ if test "$ac_cv_search_waddstr" != no; then
+ CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
+ CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
+ CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
+ ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
+ CONFIG_ALL="${CONFIG_ALL} all-tui"
+ CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
+ CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
+ else
+ if test x"$enable_tui" = xyes; then
+ { { echo "$as_me:$LINENO: error: no enhanced curses library found; disable TUI" >&5
+echo "$as_me: error: no enhanced curses library found; disable TUI" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me:$LINENO: WARNING: no enhanced curses library found; disabling TUI" >&5
+echo "$as_me: WARNING: no enhanced curses library found; disabling TUI" >&2;}
+ fi
+ fi
+ fi
+fi
+
# Since GDB uses Readline, we need termcap functionality. In many
# cases this will be provided by the curses library, but some systems
# have a seperate termcap library, or no curses library at all.
@@ -11704,10 +11759,10 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "${ECHO_T}${PYTHON_CFLAGS}" >&6
fi
else
- # Even if Python support is not compiled in, we need to have this file
+ # Even if Python support is not compiled in, we need to have these files
# included in order to recognize the GDB command "python".
- CONFIG_OBS="$CONFIG_OBS python.o"
- CONFIG_SRCS="$CONFIG_SRCS python/python.c"
+ CONFIG_OBS="$CONFIG_OBS python.o python-value.o"
+ CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c"
fi
@@ -25539,32 +25594,6 @@ echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
fi
-# Check whether we should enable the TUI, but only do so if we really
-# can.
-if test x"$enable_tui" != xno; then
- if test -d $srcdir/tui; then
- if test "$ac_cv_search_waddstr" != no; then
- CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
- CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
- CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
- ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
- CONFIG_ALL="${CONFIG_ALL} all-tui"
- CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
- CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
- CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
- else
- if test x"$enable_tui" = xyes; then
- { { echo "$as_me:$LINENO: error: no enhanced curses library found; disable TUI" >&5
-echo "$as_me: error: no enhanced curses library found; disable TUI" >&2;}
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me:$LINENO: WARNING: no enhanced curses library found; disabling TUI" >&5
-echo "$as_me: WARNING: no enhanced curses library found; disabling TUI" >&2;}
- fi
- fi
- fi
-fi
-
# Unlike the sim directory, whether a simulator is linked is controlled by
# presence of a gdb_sim definition in the target configure.tgt entry.
# This code just checks for a few cases where we'd like to ignore those
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 680fba0..054d5c2 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -429,20 +429,70 @@ AC_SEARCH_LIBS(socketpair, socket)
# Link in zlib if we can. This allows us to read compressed debug sections.
AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
-# For the TUI, we need enhanced curses functionality.
-#
-# FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied
-# curses library because the latter might not provide all the
-# functionality we need. However, this leads to problems on systems
-# where the linker searches /usr/local/lib, but the compiler doesn't
-# search /usr/local/include, if ncurses is installed in /usr/local. A
-# default installation of ncurses on alpha*-dec-osf* will lead to such
-# a situation.
-AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses])
-
# On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
AC_SEARCH_LIBS(dlgetmodinfo, [dl xpdl])
+# On alpha-osf, it appears that libtermcap and libcurses are not compatible.
+# There is a very specific comment in /usr/include/curses.h explaining that
+# termcap routines built into libcurses must not be used.
+#
+# The symptoms we observed so far is GDB unexpectedly changing
+# the terminal settings when tgetent is called - this is particularly
+# visible as the output is missing carriage returns, and so rapidly
+# becomes very hard to read.
+#
+# The readline configure script has already decided that libtermcap
+# was enough for its purposes, and so decided to build readline using
+# libtermcap. Since the TUI mode requires curses, building GDB with
+# TUI enabled results in both libraries to be used at the same time,
+# which is not allowed. This basically means that GDB with TUI is
+# broken on alpha-osf.
+
+case $host_os in
+ alpha*-*-osf* )
+ if "$enable_tui" = "yes"; then
+ AC_MSG_ERROR([Building GDB with TUI mode is not supported on this host])
+ fi
+ if "$enable_tui" = "auto"; then
+ enable_tui=no
+ fi
+ ;;
+esac
+
+# Check whether we should enable the TUI, but only do so if we really
+# can.
+if test x"$enable_tui" != xno; then
+ if test -d $srcdir/tui; then
+ # For the TUI, we need enhanced curses functionality.
+ #
+ # FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied
+ # curses library because the latter might not provide all the
+ # functionality we need. However, this leads to problems on systems
+ # where the linker searches /usr/local/lib, but the compiler doesn't
+ # search /usr/local/include, if ncurses is installed in /usr/local. A
+ # default installation of ncurses on alpha*-dec-osf* will lead to such
+ # a situation.
+ AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses])
+
+ if test "$ac_cv_search_waddstr" != no; then
+ CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
+ CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
+ CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
+ ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
+ CONFIG_ALL="${CONFIG_ALL} all-tui"
+ CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
+ CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
+ CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
+ else
+ if test x"$enable_tui" = xyes; then
+ AC_MSG_ERROR([no enhanced curses library found; disable TUI])
+ else
+ AC_MSG_WARN([no enhanced curses library found; disabling TUI])
+ fi
+ fi
+ fi
+fi
+
# Since GDB uses Readline, we need termcap functionality. In many
# cases this will be provided by the curses library, but some systems
# have a seperate termcap library, or no curses library at all.
@@ -624,10 +674,10 @@ if test "${have_libpython}" = yes; then
AC_MSG_RESULT(${PYTHON_CFLAGS})
fi
else
- # Even if Python support is not compiled in, we need to have this file
+ # Even if Python support is not compiled in, we need to have these files
# included in order to recognize the GDB command "python".
- CONFIG_OBS="$CONFIG_OBS python.o"
- CONFIG_SRCS="$CONFIG_SRCS python/python.c"
+ CONFIG_OBS="$CONFIG_OBS python.o python-value.o"
+ CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c"
fi
AC_SUBST(PYTHON_CFLAGS)
@@ -1748,29 +1798,6 @@ AC_SUBST(GDBTK_SRC_DIR)
AC_PATH_X
-# Check whether we should enable the TUI, but only do so if we really
-# can.
-if test x"$enable_tui" != xno; then
- if test -d $srcdir/tui; then
- if test "$ac_cv_search_waddstr" != no; then
- CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
- CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
- CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
- ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
- CONFIG_ALL="${CONFIG_ALL} all-tui"
- CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
- CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
- CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
- else
- if test x"$enable_tui" = xyes; then
- AC_MSG_ERROR([no enhanced curses library found; disable TUI])
- else
- AC_MSG_WARN([no enhanced curses library found; disabling TUI])
- fi
- fi
- fi
-fi
-
# Unlike the sim directory, whether a simulator is linked is controlled by
# presence of a gdb_sim definition in the target configure.tgt entry.
# This code just checks for a few cases where we'd like to ignore those
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 3b965fc..95556f8 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -297,7 +297,7 @@ mips*-sgi-irix6*)
;;
mips*-*-linux*)
# Target: Linux/MIPS
- gdb_target_obs="mips-tdep.o mips-linux-tdep.o \
+ gdb_target_obs="mips-tdep.o mips-linux-tdep.o glibc-tdep.o \
corelow.o solib.o solib-svr4.o symfile-mem.o"
gdb_sim=../sim/mips/libsim.a
build_gdbserver=yes
@@ -411,6 +411,7 @@ sparc64-*-linux*)
gdb_target_obs="sparc64-tdep.o sparc64-sol2-tdep.o sol2-tdep.o \
sparc64-linux-tdep.o sparc-tdep.o sparc-sol2-tdep.o \
sparc-linux-tdep.o solib.o solib-svr4.o"
+ build_gdbserver=yes
;;
sparc*-*-freebsd* | sparc*-*-kfreebsd*-gnu)
# Target: FreeBSD/sparc64
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 2be4e26..af2d1a3 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -74,7 +74,7 @@ core_file_command (char *filename, int from_tty)
error (_("GDB can't read core files on this machine."));
if (!filename)
- (t->to_detach) (filename, from_tty);
+ (t->to_detach) (t, filename, from_tty);
else
(t->to_open) (filename, from_tty);
}
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 14868e2..35c998c 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -75,7 +75,7 @@ static int gdb_check_format (bfd *);
static void core_open (char *, int);
-static void core_detach (char *, int);
+static void core_detach (struct target_ops *ops, char *, int);
static void core_close (int);
@@ -413,11 +413,11 @@ core_open (char *filename, int from_tty)
}
static void
-core_detach (char *args, int from_tty)
+core_detach (struct target_ops *ops, char *args, int from_tty)
{
if (args)
error (_("Too many arguments"));
- unpush_target (&core_ops);
+ unpush_target (ops);
reinit_frame_cache ();
if (from_tty)
printf_filtered (_("No core file now.\n"));
diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
index 023e306..e1641f4 100644
--- a/gdb/cp-name-parser.y
+++ b/gdb/cp-name-parser.y
@@ -31,7 +31,7 @@ Boston, MA 02110-1301, USA. */
%{
-#include "config.h"
+#include "defs.h"
#include <stdio.h>
#include <stdlib.h>
@@ -1462,7 +1462,7 @@ c_parse_backslash (int host_char, int *target_char)
after the zeros. A value of 0 does not mean end of string. */
static int
-parse_escape (const char **string_ptr)
+cp_parse_escape (const char **string_ptr)
{
int target_char;
int c = *(*string_ptr)++;
@@ -1483,7 +1483,7 @@ parse_escape (const char **string_ptr)
if (c == '?')
return 0177;
else if (c == '\\')
- target_char = parse_escape (string_ptr);
+ target_char = cp_parse_escape (string_ptr);
else
target_char = c;
@@ -1581,7 +1581,7 @@ yylex (void)
lexptr++;
c = *lexptr++;
if (c == '\\')
- c = parse_escape (&lexptr);
+ c = cp_parse_escape (&lexptr);
else if (c == '\'')
{
yyerror ("empty character constant");
@@ -2084,6 +2084,16 @@ trim_chars (char *lexptr, char **extra_chars)
return c;
}
+/* When this file is built as a standalone program, xmalloc comes from
+ libiberty --- in which case we have to provide xfree ourselves. */
+
+void
+xfree (void *ptr)
+{
+ if (ptr != NULL)
+ free (ptr);
+}
+
int
main (int argc, char **argv)
{
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 4d91319..2968953 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -38,7 +38,6 @@
#include "language.h"
/* Controls printing of vtbl's */
-int vtblprint;
static void
show_vtblprint (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -50,7 +49,6 @@ Printing of C++ virtual function tables is %s.\n"),
/* Controls looking up an object's derived type using what we find in
its vtables. */
-int objectprint;
static void
show_objectprint (struct ui_file *file, int from_tty,
struct cmd_list_element *c,
@@ -61,7 +59,6 @@ Printing of object's derived type based on vtable info is %s.\n"),
value);
}
-int static_field_print; /* Controls printing of static fields. */
static void
show_static_field_print (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -77,12 +74,12 @@ static struct obstack dont_print_statmem_obstack;
extern void _initialize_cp_valprint (void);
static void cp_print_static_field (struct type *, struct value *,
- struct ui_file *, int, int,
- enum val_prettyprint);
+ struct ui_file *, int,
+ const struct value_print_options *);
static void cp_print_value (struct type *, struct type *, const gdb_byte *,
- int, CORE_ADDR, struct ui_file *, int, int,
- enum val_prettyprint, struct type **);
+ int, CORE_ADDR, struct ui_file *, int,
+ const struct value_print_options *, struct type **);
/* GCC versions after 2.4.5 use this. */
@@ -139,7 +136,7 @@ cp_is_vtbl_member (struct type *type)
/* Mutually recursive subroutines of cp_print_value and c_val_print to
print out a structure's fields: cp_print_value_fields and cp_print_value.
- TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and PRETTY have the
+ TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and OPTIONS have the
same meanings as in cp_print_value and c_val_print.
2nd argument REAL_TYPE is used to carry over the type of the derived
@@ -151,9 +148,9 @@ cp_is_vtbl_member (struct type *type)
void
cp_print_value_fields (struct type *type, struct type *real_type,
const gdb_byte *valaddr, int offset, CORE_ADDR address,
- struct ui_file *stream, int format, int recurse,
- enum val_prettyprint pretty,
- struct type **dont_print_vb,int dont_print_statmem)
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options,
+ struct type **dont_print_vb, int dont_print_statmem)
{
int i, len, n_baseclasses;
char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
@@ -170,7 +167,7 @@ cp_print_value_fields (struct type *type, struct type *real_type,
if (n_baseclasses > 0)
cp_print_value (type, real_type, valaddr, offset, address, stream,
- format, recurse + 1, pretty, dont_print_vb);
+ recurse + 1, options, dont_print_vb);
/* Second, print out data fields */
@@ -192,14 +189,15 @@ cp_print_value_fields (struct type *type, struct type *real_type,
for (i = n_baseclasses; i < len; i++)
{
/* If requested, skip printing of static fields. */
- if (!static_field_print && TYPE_FIELD_STATIC (type, i))
+ if (!options->static_field_print
+ && field_is_static (&TYPE_FIELD (type, i)))
continue;
if (fields_seen)
fprintf_filtered (stream, ", ");
else if (n_baseclasses > 0)
{
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -210,7 +208,7 @@ cp_print_value_fields (struct type *type, struct type *real_type,
}
fields_seen = 1;
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -219,13 +217,13 @@ cp_print_value_fields (struct type *type, struct type *real_type,
{
wrap_here (n_spaces (2 + 2 * recurse));
}
- if (inspect_it)
+ if (options->inspect_it)
{
if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_PTR)
fputs_filtered ("\"( ptr \"", stream);
else
fputs_filtered ("\"( nodef \"", stream);
- if (TYPE_FIELD_STATIC (type, i))
+ if (field_is_static (&TYPE_FIELD (type, i)))
fputs_filtered ("static ", stream);
fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
current_language->la_language,
@@ -240,7 +238,7 @@ cp_print_value_fields (struct type *type, struct type *real_type,
{
annotate_field_begin (TYPE_FIELD_TYPE (type, i));
- if (TYPE_FIELD_STATIC (type, i))
+ if (field_is_static (&TYPE_FIELD (type, i)))
fputs_filtered ("static ", stream);
fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
current_language->la_language,
@@ -252,7 +250,8 @@ cp_print_value_fields (struct type *type, struct type *real_type,
annotate_field_value ();
}
- if (!TYPE_FIELD_STATIC (type, i) && TYPE_FIELD_PACKED (type, i))
+ if (!field_is_static (&TYPE_FIELD (type, i))
+ && TYPE_FIELD_PACKED (type, i))
{
struct value *v;
@@ -264,11 +263,13 @@ cp_print_value_fields (struct type *type, struct type *real_type,
}
else
{
+ struct value_print_options opts = *options;
+ opts.deref_ref = 0;
v = value_from_longest
(TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr + offset, i));
- common_val_print (v, stream, format, 0, recurse + 1, pretty,
+ common_val_print (v, stream, recurse + 1, &opts,
current_language);
}
}
@@ -278,22 +279,23 @@ cp_print_value_fields (struct type *type, struct type *real_type,
{
fputs_filtered ("<optimized out or zero length>", stream);
}
- else if (TYPE_FIELD_STATIC (type, i))
+ else if (field_is_static (&TYPE_FIELD (type, i)))
{
struct value *v = value_static_field (type, i);
if (v == NULL)
fputs_filtered ("<optimized out>", stream);
else
cp_print_static_field (TYPE_FIELD_TYPE (type, i), v,
- stream, format, recurse + 1,
- pretty);
+ stream, recurse + 1, options);
}
else
{
+ struct value_print_options opts = *options;
+ opts.deref_ref = 0;
val_print (TYPE_FIELD_TYPE (type, i),
valaddr, offset + TYPE_FIELD_BITPOS (type, i) / 8,
address + TYPE_FIELD_BITPOS (type, i) / 8,
- stream, format, 0, recurse + 1, pretty,
+ stream, recurse + 1, &opts,
current_language);
}
}
@@ -308,7 +310,7 @@ cp_print_value_fields (struct type *type, struct type *real_type,
dont_print_statmem_obstack = tmp_obstack;
}
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
@@ -324,8 +326,9 @@ cp_print_value_fields (struct type *type, struct type *real_type,
static void
cp_print_value (struct type *type, struct type *real_type,
const gdb_byte *valaddr, int offset, CORE_ADDR address,
- struct ui_file *stream, int format, int recurse,
- enum val_prettyprint pretty, struct type **dont_print_vb)
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options,
+ struct type **dont_print_vb)
{
struct type **last_dont_print
= (struct type **) obstack_next_free (&dont_print_vb_obstack);
@@ -400,7 +403,7 @@ cp_print_value (struct type *type, struct type *real_type,
base_valaddr = valaddr;
/* now do the printing */
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
@@ -417,8 +420,7 @@ cp_print_value (struct type *type, struct type *real_type,
else
cp_print_value_fields (baseclass, thistype, base_valaddr,
thisoffset + boffset, address + boffset,
- stream, format,
- recurse, pretty,
+ stream, recurse, options,
((struct type **)
obstack_base (&dont_print_vb_obstack)),
0);
@@ -445,17 +447,17 @@ cp_print_value (struct type *type, struct type *real_type,
static member classes in an obstack and refuse to print them more
than once.
- VAL contains the value to print, TYPE, STREAM, RECURSE, and PRETTY
+ VAL contains the value to print, TYPE, STREAM, RECURSE, and OPTIONS
have the same meanings as in c_val_print. */
static void
cp_print_static_field (struct type *type,
struct value *val,
struct ui_file *stream,
- int format,
int recurse,
- enum val_prettyprint pretty)
+ const struct value_print_options *options)
{
+ struct value_print_options opts;
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
CORE_ADDR *first_dont_print;
@@ -483,12 +485,15 @@ cp_print_static_field (struct type *type,
CHECK_TYPEDEF (type);
cp_print_value_fields (type, type, value_contents_all (val),
value_embedded_offset (val), VALUE_ADDRESS (val),
- stream, format, recurse, pretty, NULL, 1);
+ stream, recurse, options, NULL, 1);
return;
}
+
+ opts = *options;
+ opts.deref_ref = 0;
val_print (type, value_contents_all (val),
value_embedded_offset (val), VALUE_ADDRESS (val),
- stream, format, 0, recurse, pretty, current_language);
+ stream, recurse, &opts, current_language);
}
@@ -587,32 +592,29 @@ void
_initialize_cp_valprint (void)
{
add_setshow_boolean_cmd ("static-members", class_support,
- &static_field_print, _("\
+ &user_print_options.static_field_print, _("\
Set printing of C++ static members."), _("\
Show printing of C++ static members."), NULL,
NULL,
show_static_field_print,
&setprintlist, &showprintlist);
- /* Turn on printing of static fields. */
- static_field_print = 1;
- add_setshow_boolean_cmd ("vtbl", class_support, &vtblprint, _("\
+ add_setshow_boolean_cmd ("vtbl", class_support,
+ &user_print_options.vtblprint, _("\
Set printing of C++ virtual function tables."), _("\
Show printing of C++ virtual function tables."), NULL,
NULL,
show_vtblprint,
&setprintlist, &showprintlist);
- add_setshow_boolean_cmd ("object", class_support, &objectprint, _("\
+ add_setshow_boolean_cmd ("object", class_support,
+ &user_print_options.objectprint, _("\
Set printing of object's derived type based on vtable info."), _("\
Show printing of object's derived type based on vtable info."), NULL,
NULL,
show_objectprint,
&setprintlist, &showprintlist);
- /* Give people the defaults which they are used to. */
- objectprint = 0;
- vtblprint = 0;
obstack_begin (&dont_print_vb_obstack, 32 * sizeof (struct type *));
obstack_specify_allocation (&dont_print_statmem_obstack,
32 * sizeof (CORE_ADDR), sizeof (CORE_ADDR),
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 25ec313..dde922a 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -514,7 +514,7 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type,
lowest_text_address = address;
prim_record_minimal_symbol_and_info
- (name, address, ms_type, NULL, section, bfd_section, objfile);
+ (name, address, ms_type, section, bfd_section, objfile);
}
/* Scan and build partial symbols for a symbol file.
diff --git a/gdb/dec-thread.c b/gdb/dec-thread.c
new file mode 100644
index 0000000..3de06ed
--- /dev/null
+++ b/gdb/dec-thread.c
@@ -0,0 +1,683 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "defs.h"
+#include "command.h"
+#include "gdbcmd.h"
+#include "target.h"
+#include "observer.h"
+#include <sys/procfs.h>
+#include "gregset.h"
+#include "regcache.h"
+#include "inferior.h"
+#include "gdbthread.h"
+
+#include <pthread_debug.h>
+
+/* Print debugging traces if set to non-zero. */
+static int debug_dec_thread = 0;
+
+/* Non-zero if the dec-thread layer is active. */
+static int dec_thread_active = 0;
+
+/* The pthread_debug context. */
+pthreadDebugContext_t debug_context;
+
+/* The dec-thread target_ops structure. */
+static struct target_ops dec_thread_ops;
+
+/* A copy of the target_ops over which our dec_thread_ops is pushed. */
+static struct target_ops base_target;
+
+/* Print a debug trace if DEBUG_DEC_THREAD is set (its value is adjusted
+ by the user using "set debug dec-thread ..."). */
+
+static void
+debug (char *format, ...)
+{
+ if (debug_dec_thread)
+ {
+ va_list args;
+
+ va_start (args, format);
+ printf_unfiltered ("DEC Threads: ");
+ vprintf_unfiltered (format, args);
+ printf_unfiltered ("\n");
+ va_end (args);
+ }
+}
+
+/* pthread debug callbacks. */
+
+static int
+suspend_clbk (void *caller_context)
+{
+ return ESUCCESS;
+}
+
+static int
+resume_clbk (void *caller_context)
+{
+ return ESUCCESS;
+}
+
+static int
+hold_clbk (void *caller_context, pthreadDebugKId_t kernel_tid)
+{
+ return ESUCCESS;
+}
+
+static int
+unhold_clbk (void *caller_context, pthreadDebugKId_t kernel_tid)
+{
+ return ESUCCESS;
+}
+
+static int
+read_clbk (void *caller_context, void *address, void *buffer,
+ unsigned long size)
+{
+ int status = target_read_memory ((CORE_ADDR) address, buffer, size);
+
+ if (status != 0)
+ return EINVAL;
+
+ return ESUCCESS;
+}
+
+static int
+write_clbk (void *caller_context, void *address, void *buffer,
+ unsigned long size)
+{
+ int status = target_write_memory ((CORE_ADDR) address, buffer, size);
+
+ if (status != 0)
+ return EINVAL;
+
+ return ESUCCESS;
+}
+
+/* Get integer regs */
+
+static int
+get_reg_clbk(void *caller_context, pthreadDebugGetRegRtn_t regs,
+ pthreadDebugKId_t kernel_tid)
+{
+ debug ("get_reg_clbk");
+
+ /* Not sure that we actually need to do anything in this callback. */
+ return ESUCCESS;
+}
+
+/* Set integer regs */
+
+static int
+set_reg_clbk(void *caller_context, const pthreadDebugRegs_t *regs,
+ pthreadDebugKId_t kernel_tid)
+{
+ debug ("set_reg_clbk");
+
+ /* Not sure that we actually need to do anything in this callback. */
+ return ESUCCESS;
+}
+
+static int
+output_clbk (void *caller_context, char *line)
+{
+ printf_filtered ("%s\n", line);
+ return ESUCCESS;
+}
+
+static int
+error_clbk (void *caller_context, char *line)
+{
+ fprintf_filtered (gdb_stderr, "%s\n", line);
+ return ESUCCESS;
+}
+
+/* Get floating-point regs. */
+
+static int
+get_fpreg_clbk (void *caller_context, pthreadDebugFregs_p fregs,
+ pthreadDebugKId_t kernel_tid)
+{
+ debug ("get_fpreg_clbk");
+
+ /* Not sure that we actually need to do anything in this callback. */
+ return ESUCCESS;
+}
+
+/* Set floating-point regs. */
+
+static int
+set_fpreg_clbk (void *caller_context, const pthreadDebugFregs_t *fregs,
+ pthreadDebugKId_t kernel_tid)
+{
+ debug ("set_fpreg_clbk");
+
+ /* Not sure that we actually need to do anything in this callback. */
+ return ESUCCESS;
+}
+
+static void *
+malloc_clbk (void *caller_context, size_t size)
+{
+ return xmalloc (size);
+}
+
+static void
+free_clbk (void *caller_context, void *address)
+{
+ xfree (address);
+}
+
+static int
+kthdinfo_clbk (pthreadDebugClient_t caller_context,
+ pthreadDebugKId_t kernel_tid,
+ pthreadDebugKThreadInfo_p thread_info)
+{
+ return ENOTSUP;
+}
+
+static int
+speckthd_clbk (pthreadDebugClient_t caller_context,
+ pthreadDebugSpecialType_t type,
+ pthreadDebugKId_t *kernel_tid)
+{
+ return ENOTSUP;
+}
+
+static pthreadDebugCallbacks_t debug_callbacks =
+{
+ PTHREAD_DEBUG_VERSION,
+ (pthreadDebugGetMemRtn_t) read_clbk,
+ (pthreadDebugSetMemRtn_t) write_clbk,
+ suspend_clbk,
+ resume_clbk,
+ kthdinfo_clbk,
+ hold_clbk,
+ unhold_clbk,
+ (pthreadDebugGetFregRtn_t) get_fpreg_clbk,
+ (pthreadDebugSetFregRtn_t) set_fpreg_clbk,
+ (pthreadDebugGetRegRtn_t) get_reg_clbk,
+ (pthreadDebugSetRegRtn_t) set_reg_clbk,
+ (pthreadDebugOutputRtn_t) output_clbk,
+ (pthreadDebugOutputRtn_t) error_clbk,
+ malloc_clbk,
+ free_clbk,
+ speckthd_clbk
+};
+
+/* Activate thread support if appropriate. Do nothing if thread
+ support is already active. */
+
+static void
+enable_dec_thread (void)
+{
+ struct minimal_symbol *msym;
+ void* caller_context;
+ int status;
+
+ /* If already active, nothing more to do. */
+ if (dec_thread_active)
+ return;
+
+ msym = lookup_minimal_symbol ("__pthread_dbg_symtable", NULL, NULL);
+ if (msym == NULL)
+ {
+ debug ("enable_dec_thread: No __pthread_dbg_symtable");
+ return;
+ }
+
+ status = pthreadDebugContextInit (&caller_context, &debug_callbacks,
+ (void *) SYMBOL_VALUE_ADDRESS (msym),
+ &debug_context);
+ if (status != ESUCCESS)
+ {
+ debug ("enable_dec_thread: pthreadDebugContextInit -> %d",
+ status);
+ return;
+ }
+
+ base_target = current_target;
+ push_target (&dec_thread_ops);
+ dec_thread_active = 1;
+
+ debug ("enable_dec_thread: Thread support enabled.");
+}
+
+/* Deactivate thread support. Do nothing is thread support is
+ already inactive. */
+
+static void
+disable_dec_thread (void)
+{
+ if (!dec_thread_active)
+ return;
+
+ pthreadDebugContextDestroy (debug_context);
+ unpush_target (&dec_thread_ops);
+ dec_thread_active = 0;
+}
+
+/* A structure that contains a thread ID and is associated
+ pthreadDebugThreadInfo_t data. */
+
+struct dec_thread_info
+{
+ pthreadDebugId_t thread;
+ pthreadDebugThreadInfo_t info;
+};
+typedef struct dec_thread_info dec_thread_info_s;
+
+/* The list of user threads. */
+
+DEF_VEC_O (dec_thread_info_s);
+VEC(dec_thread_info_s) *dec_thread_list;
+
+/* Release the memory used by the given VECP thread list pointer.
+ Then set *VECP to NULL. */
+
+static void
+free_dec_thread_info_vec (VEC(dec_thread_info_s) **vecp)
+{
+ int i;
+ struct dec_thread_info *item;
+ VEC(dec_thread_info_s) *vec = *vecp;
+
+ for (i = 0; VEC_iterate (dec_thread_info_s, vec, i, item); i++)
+ xfree (item);
+ VEC_free (dec_thread_info_s, vec);
+ *vecp = NULL;
+}
+
+/* Return a thread's ptid given its associated INFO. */
+
+static ptid_t
+ptid_build_from_info (struct dec_thread_info info)
+{
+ int pid = ptid_get_pid (inferior_ptid);
+
+ return ptid_build (pid, 0, (long) info.thread);
+}
+
+/* Recompute the list of user threads and store the result in
+ DEC_THREAD_LIST. */
+
+static void
+update_dec_thread_list (void)
+{
+ pthreadDebugId_t thread;
+ pthreadDebugThreadInfo_t info;
+ int res;
+
+ free_dec_thread_info_vec (&dec_thread_list);
+ res = pthreadDebugThdSeqInit (debug_context, &thread);
+ while (res == ESUCCESS)
+ {
+
+ res = pthreadDebugThdGetInfo (debug_context, thread, &info);
+ if (res != ESUCCESS)
+ warning (_("unable to get thread info, ignoring thread %ld"),
+ thread);
+ else if (info.kind == PTHREAD_DEBUG_THD_KIND_INITIAL
+ || info.kind == PTHREAD_DEBUG_THD_KIND_NORMAL)
+ {
+ struct dec_thread_info *item =
+ xmalloc (sizeof (struct dec_thread_info));
+
+ item->thread = thread;
+ item->info = info;
+ VEC_safe_push (dec_thread_info_s, dec_thread_list, item);
+ }
+ res = pthreadDebugThdSeqNext (debug_context, &thread);
+ }
+ pthreadDebugThdSeqDestroy (debug_context);
+}
+
+/* A callback to count the number of threads known to GDB. */
+
+static int
+dec_thread_count_gdb_threads (struct thread_info *ignored, void *context)
+{
+ int *count = (int *) context;
+
+ *count++;
+ return 0;
+}
+
+/* A callback that saves the given thread INFO at the end of an
+ array. The end of the array is given in the CONTEXT and is
+ incremented once the info has been added. */
+
+static int
+dec_thread_add_gdb_thread (struct thread_info *info, void *context)
+{
+ struct thread_info ***listp = (struct thread_info ***) context;
+
+ **listp = info;
+ *listp++;
+ return 0;
+}
+
+/* Resynchronize the list of threads known by GDB with the actual
+ list of threads reported by libpthread_debug. */
+
+static void
+resync_thread_list (void)
+{
+ int i;
+ struct dec_thread_info *info;
+ int num_gdb_threads = 0;
+ struct thread_info **gdb_thread_list;
+ struct thread_info **next_thread_info;
+
+ update_dec_thread_list ();
+
+ /* Add new threads. */
+
+ for (i = 0; VEC_iterate (dec_thread_info_s, dec_thread_list, i, info);
+ i++)
+ {
+ ptid_t ptid = ptid_build_from_info (*info);
+
+ if (!in_thread_list (ptid))
+ add_thread (ptid);
+ }
+
+ /* Remove threads that no longer exist. To help with the search,
+ we build an array of GDB threads, and then iterate over this
+ array. */
+
+ iterate_over_threads (dec_thread_count_gdb_threads,
+ (void *) &num_gdb_threads);
+ gdb_thread_list = alloca (num_gdb_threads * sizeof (struct thread_info *));
+ next_thread_info = gdb_thread_list;
+ iterate_over_threads (dec_thread_add_gdb_thread, (void *) &next_thread_info);
+ for (i = 0; i < num_gdb_threads; i++)
+ {
+ int j;
+
+ for (j = 0; VEC_iterate (dec_thread_info_s, dec_thread_list, j, info);
+ j++)
+ if (ptid_equal (gdb_thread_list[i]->ptid,
+ ptid_build_from_info (*info)))
+ break;
+ delete_thread (gdb_thread_list[i]->ptid);
+ }
+}
+
+/* The "to_detach" method of the dec_thread_ops. */
+
+static void
+dec_thread_detach (char *args, int from_tty)
+{
+ debug ("dec_thread_detach");
+
+ disable_dec_thread ();
+ base_target.to_detach (&base_target, args, from_tty);
+}
+
+/* Return the ptid of the thread that is currently active. */
+
+static ptid_t
+get_active_ptid (void)
+{
+ int i;
+ struct dec_thread_info *info;
+
+ for (i = 0; VEC_iterate (dec_thread_info_s, dec_thread_list, i, info);
+ i++)
+ if (info->info.state == PTHREAD_DEBUG_STATE_RUNNING)
+ return ptid_build_from_info (*info);
+
+ /* No active thread found. This can happen when the program
+ has just exited. */
+ return null_ptid;
+}
+
+/* The "to_wait" method of the dec_thread_ops. */
+
+static ptid_t
+dec_thread_wait (ptid_t ptid, struct target_waitstatus *status)
+{
+ ptid_t active_ptid;
+
+ debug ("dec_thread_wait");
+
+ ptid = base_target.to_wait (ptid, status);
+
+ /* The ptid returned by the base_target is the ptid of the process.
+ We need to find which thread is currently active and return its
+ ptid. */
+ resync_thread_list ();
+ active_ptid = get_active_ptid ();
+ if (ptid_equal (active_ptid, null_ptid))
+ return ptid;
+ return active_ptid;
+}
+
+/* Fetch the general purpose and floating point registers for the given
+ thread TID, and store the result in GREGSET and FPREGSET. Return
+ zero if successful. */
+
+static int
+dec_thread_get_regsets (pthreadDebugId_t tid, gdb_gregset_t *gregset,
+ gdb_fpregset_t *fpregset)
+{
+ int res;
+ pthreadDebugRegs_t regs;
+ pthreadDebugFregs_t fregs;
+
+ res = pthreadDebugThdGetReg (debug_context, tid, &regs);
+ if (res != ESUCCESS)
+ {
+ debug ("dec_thread_fetch_registers: pthreadDebugThdGetReg -> %d", res);
+ return -1;
+ }
+ memcpy (gregset->regs, &regs, sizeof (regs));
+
+ res = pthreadDebugThdGetFreg (debug_context, tid, &fregs);
+ if (res != ESUCCESS)
+ {
+ debug ("dec_thread_fetch_registers: pthreadDebugThdGetFreg -> %d", res);
+ return -1;
+ }
+ memcpy (fpregset->regs, &fregs, sizeof (fregs));
+
+ return 0;
+}
+
+/* The "to_fetch_registers" method of the dec_thread_ops.
+
+ Because the dec-thread debug API doesn't allow us to fetch
+ only one register, we simply ignore regno and fetch+supply all
+ registers. */
+
+static void
+dec_thread_fetch_registers (struct regcache *regcache, int regno)
+{
+ pthreadDebugId_t tid = ptid_get_tid (inferior_ptid);
+ gregset_t gregset;
+ fpregset_t fpregset;
+ int res;
+
+ debug ("dec_thread_fetch_registers (tid=%ld, regno=%d)", tid, regno);
+
+
+ if (tid == 0 || ptid_equal (inferior_ptid, get_active_ptid ()))
+ {
+ base_target.to_fetch_registers (regcache, regno);
+ return;
+ }
+
+ res = dec_thread_get_regsets (tid, &gregset, &fpregset);
+ if (res != 0)
+ return;
+
+ supply_gregset (regcache, &gregset);
+ supply_fpregset (regcache, &fpregset);
+}
+
+/* Store the registers given in GREGSET and FPREGSET into the associated
+ general purpose and floating point registers of thread TID. Return
+ zero if successful. */
+
+static int
+dec_thread_set_regsets (pthreadDebugId_t tid, gdb_gregset_t gregset,
+ gdb_fpregset_t fpregset)
+{
+ int res;
+ pthreadDebugRegs_t regs;
+ pthreadDebugFregs_t fregs;
+
+ memcpy (&regs, gregset.regs, sizeof (regs));
+ res = pthreadDebugThdSetReg (debug_context, tid, &regs);
+ if (res != ESUCCESS)
+ {
+ debug ("dec_thread_fetch_registers: pthreadDebugThdSetReg -> %d", res);
+ return -1;
+ }
+
+ memcpy (&fregs, fpregset.regs, sizeof (fregs));
+ res = pthreadDebugThdSetFreg (debug_context, tid, &fregs);
+ if (res != ESUCCESS)
+ {
+ debug ("dec_thread_fetch_registers: pthreadDebugThdSetFreg -> %d", res);
+ return -1;
+ }
+
+ return 0;
+}
+
+/* The "to_store_registers" method of the dec_thread_ops.
+
+ Because the dec-thread debug API doesn't allow us to store
+ just one register, we store all the registers. */
+
+static void
+dec_thread_store_registers (struct regcache *regcache, int regno)
+{
+ pthreadDebugId_t tid = ptid_get_tid (inferior_ptid);
+ gregset_t gregset;
+ fpregset_t fpregset;
+ int res;
+
+ debug ("dec_thread_store_registers (tid=%ld, regno=%d)", tid, regno);
+
+ if (tid == 0 || ptid_equal (inferior_ptid, get_active_ptid ()))
+ {
+ base_target.to_store_registers (regcache, regno);
+ return;
+ }
+
+ /* FIXME: brobecker/2008-05-28: I wonder if we could simply check
+ in which register set the register is and then only store the
+ registers for that register set, instead of storing both register
+ sets. */
+ fill_gregset (regcache, &gregset, -1);
+ fill_fpregset (regcache, &fpregset, -1);
+
+ res = dec_thread_set_regsets (tid, gregset, fpregset);
+ if (res != 0)
+ warning (_("failed to store registers."));
+}
+
+/* The "to_mourn_inferior" method of the dec_thread_ops. */
+
+static void
+dec_thread_mourn_inferior (void)
+{
+ debug ("dec_thread_mourn_inferior");
+
+ disable_dec_thread ();
+ base_target.to_mourn_inferior (&base_target);
+}
+
+/* The "to_thread_alive" method of the dec_thread_ops. */
+static int
+dec_thread_thread_alive (ptid_t ptid)
+{
+ debug ("dec_thread_thread_alive (tid=%ld)", ptid_get_tid (ptid));
+
+ /* The thread list maintained by GDB is up to date, since we update
+ it everytime we stop. So check this list. */
+ return in_thread_list (ptid);
+}
+
+/* The "to_pid_to_str" method of the dec_thread_ops. */
+
+static char *
+dec_thread_pid_to_str (ptid_t ptid)
+{
+ static char *ret = NULL;
+
+ if (ptid_get_tid (ptid) == 0)
+ return base_target.to_pid_to_str (ptid);
+
+ /* Free previous return value; a new one will be allocated by
+ xstrprintf(). */
+ xfree (ret);
+
+ ret = xstrprintf (_("Thread %ld"), ptid_get_tid (ptid));
+ return ret;
+}
+
+/* A "new-objfile" observer. Used to activate/deactivate dec-thread
+ support. */
+
+static void
+dec_thread_new_objfile_observer (struct objfile *objfile)
+{
+ if (objfile != NULL)
+ enable_dec_thread ();
+ else
+ disable_dec_thread ();
+}
+
+static void
+init_dec_thread_ops (void)
+{
+ dec_thread_ops.to_shortname = "dec-threads";
+ dec_thread_ops.to_longname = _("DEC threads support");
+ dec_thread_ops.to_doc = _("DEC threads support");
+ dec_thread_ops.to_detach = dec_thread_detach;
+ dec_thread_ops.to_wait = dec_thread_wait;
+ dec_thread_ops.to_fetch_registers = dec_thread_fetch_registers;
+ dec_thread_ops.to_store_registers = dec_thread_store_registers;
+ dec_thread_ops.to_mourn_inferior = dec_thread_mourn_inferior;
+ dec_thread_ops.to_thread_alive = dec_thread_thread_alive;
+ dec_thread_ops.to_pid_to_str = dec_thread_pid_to_str;
+ dec_thread_ops.to_stratum = thread_stratum;
+ dec_thread_ops.to_magic = OPS_MAGIC;
+}
+
+void
+_initialize_dec_thread (void)
+{
+ init_dec_thread_ops ();
+ add_target (&dec_thread_ops);
+
+ observer_attach_new_objfile (dec_thread_new_objfile_observer);
+
+ add_setshow_boolean_cmd ("dec-thread", class_maintenance, &debug_dec_thread,
+ _("Set debugging of DEC threads module."),
+ _("Show debugging of DEC threads module."),
+ _("Enables debugging output (used to debug GDB)."),
+ NULL, NULL,
+ &setdebuglist, &showdebuglist);
+}
diff --git a/gdb/defs.h b/gdb/defs.h
index 23a6599..b047266 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -362,6 +362,8 @@ extern struct cleanup *(make_cleanup_free_section_addr_info
extern struct cleanup *make_cleanup_close (int fd);
+extern struct cleanup *make_cleanup_fclose (FILE *file);
+
extern struct cleanup *make_cleanup_bfd_close (bfd *abfd);
extern struct cleanup *make_cleanup_restore_integer (int *variable);
@@ -405,6 +407,8 @@ ULONGEST strtoulst (const char *num, const char **trailer, int base);
char *ldirname (const char *filename);
+char **gdb_buildargv (const char *);
+
/* From demangle.c */
extern void set_demangling_style (char *);
@@ -697,8 +701,12 @@ extern void free_command_lines (struct command_line **);
struct continuation;
struct thread_info;
+struct inferior;
/* From utils.c */
+
+/* Thread specific continuations. */
+
extern void add_continuation (struct thread_info *,
void (*)(void *), void *,
void (*)(void *));
@@ -715,6 +723,14 @@ extern void do_all_intermediate_continuations_thread (struct thread_info *);
extern void discard_all_intermediate_continuations (void);
extern void discard_all_intermediate_continuations_thread (struct thread_info *);
+/* Inferior specific (any thread) continuations. */
+
+extern void add_inferior_continuation (void (*) (void *),
+ void *,
+ void (*) (void *));
+extern void do_all_inferior_continuations (void);
+extern void discard_all_inferior_continuations (struct inferior *inf);
+
/* String containing the current directory (what getwd would return). */
extern char *current_directory;
@@ -750,6 +766,7 @@ enum val_prettyprint
ptid_get_lwp - Fetch the lwp component of a ptid.
ptid_get_tid - Fetch the tid component of a ptid.
ptid_equal - Test to see if two ptids are equal.
+ ptid_is_pid - Test to see if this ptid represents a process id.
Please do NOT access the struct ptid members directly (except, of
course, in the implementation of the above ptid manipulation
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 6d1c713..4cfc683 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,80 @@
+2008-11-18 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * gdb.texinfo (Symbols): Mention printing containing
+ image name in "info symbol".
+ (Maint translate-address): Likewise.
+
+2008-11-18 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.texinfo (Set Catchpoints): Remove the documentation of
+ commands "catch load" and "catch unload".
+
+2008-11-17 Vladimir Prus <vladimir@codesourcery.com>
+
+ * gdb.texinfo (GDB/MI Async Records): Document
+ =thread-selected.
+
+2008-11-17 Vladimir Prus <vladimir@codesourcery.com>
+
+ * observer.texi (new_inferior, inferior_exit): New observers.
+
+2008-10-27 Pedro Alves <pedro@codesourcery.com>
+
+ * gdbint.texinfo (Adding a New Target): Don't mention TDEPFILES,
+ .mt files, TM_CLIBS or TM_CDEPS.
+ (x86 Watchpoints): Don't mention TDEPFILES.
+
+2008-10-24 Sandra Loosemore <sandra@codesourcery.com>
+
+ * gdb.texinfo (Remote Protocol): Add new nodes to menu.
+ (Overview): Mention notifications and non-stop mode behavior.
+ (Packets): Update documentation of ?, vAttach, vCont, and vRun
+ with non-stop mode behavior. Add vStopped description.
+ (Stop Reply Packets): Update list of packets that return
+ stop replies. Mention non-stop behavior.
+ (General Query Packets): Document QNonStop packet and associated
+ qSupported query response.
+ (Interrupts): Clarify multi-threaded behavior. Mention non-stop
+ behavior.
+ (Notification Packets): New section.
+ (Remote Non-Stop): New section.
+ (File-I/O Overview): Mention non-stop behavior.
+
+2008-10-24 Hui Zhu <teawater@gmail.com>
+ Pedro Alves <pedro@codesourcery.com>
+
+ * gdb.texinfo (displaced-stepping): Describe the auto mode
+ setting, and say it's the default. This is now a mainstream
+ setting instead of a maintenance setting.
+
+2008-10-23 Pedro Alves <pedro@codesourcery.com>
+
+ * observer.texi (thread_stop_requested): New.
+
+2008-10-22 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.texinfo (Ada Tasks, Ada Tasks and Core Files): New nodes.
+ (Patching): Replace incorrect usage of @samp by @kbd.
+
+2008-10-17 Michael Snyder <msnyder@vmware.com>
+
+ * gdb.texinfo: Add documentation for reverse execution.
+
+2008-10-16 Thiago Jung Bauermann <bauerman@br.ibm.com>
+ Eli Zaretskii <eliz@gnu.org>
+
+ * gdb.texinfo. (Values From Inferior): New subsubsection.
+
+2008-10-06 Doug Evans <dje@google.com>
+
+ * gdb.texinfo (set debug dwarf2-die): Document it.
+
+2008-10-01 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.texinfo (catch) [exception]: Document how to insert
+ a breakpoint on user-defined exceptions when the exception
+ name is identical to one of the language-defined ones.
+
2008-09-27 Tom Tromey <tromey@redhat.com>
* gdb.texinfo (Macros): Remove text about stringification,
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 9db0ff8..aef5308 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -143,6 +143,7 @@ software in general. We will miss him.
* Commands:: @value{GDBN} commands
* Running:: Running programs under @value{GDBN}
* Stopping:: Stopping and continuing
+* Reverse Execution:: Running programs backward
* Stack:: Examining the stack
* Source:: Examining source files
* Data:: Examining data
@@ -3614,6 +3615,15 @@ at the end of the command (eg @code{catch exception Program_Error}),
the debugger will stop only when this specific exception is raised.
Otherwise, the debugger stops execution when any Ada exception is raised.
+When inserting an exception catchpoint on a user-defined exception whose
+name is identical to one of the exceptions defined by the language, the
+fully qualified name must be used as the exception name. Otherwise,
+@value{GDBN} will assume that it should stop on the pre-defined exception
+rather than the user-defined one. For instance, assuming an exception
+called @code{Constraint_Error} is defined in package @code{Pck}, then
+the command to use to catch such exceptions is @kbd{catch exception
+Pck.Constraint_Error}.
+
@item exception unhandled
An exception that was raised but is not handled by the program.
@@ -3633,16 +3643,6 @@ and @sc{gnu}/Linux.
A call to @code{vfork}. This is currently only available for HP-UX
and @sc{gnu}/Linux.
-@item load
-@itemx load @var{libname}
-@cindex break on load/unload of shared library
-The dynamic loading of any shared library, or the loading of the library
-@var{libname}. This is currently only available for HP-UX.
-
-@item unload
-@itemx unload @var{libname}
-The unloading of any dynamically loaded shared library, or the unloading
-of the library @var{libname}. This is currently only available for HP-UX.
@end table
@item tcatch @var{event}
@@ -4841,6 +4841,126 @@ When such an event happens, a system call in another thread may return
prematurely, even though your program does not appear to stop.
+@node Reverse Execution
+@chapter Running programs backward
+@cindex reverse execution
+@cindex running programs backward
+
+When you are debugging a program, it is not unusual to realize that
+you have gone too far, and some event of interest has already happened.
+If the target environment supports it, @value{GDBN} can allow you to
+``rewind'' the program by running it backward.
+
+A target environment that supports reverse execution should be able
+to ``undo'' the changes in machine state that have taken place as the
+program was executing normally. Variables, registers etc.@: should
+revert to their previous values. Obviously this requires a great
+deal of sophistication on the part of the target environment; not
+all target environments can support reverse execution.
+
+When a program is executed in reverse, the instructions that
+have most recently been executed are ``un-executed'', in reverse
+order. The program counter runs backward, following the previous
+thread of execution in reverse. As each instruction is ``un-executed'',
+the values of memory and/or registers that were changed by that
+instruction are reverted to their previous states. After executing
+a piece of source code in reverse, all side effects of that code
+should be ``undone'', and all variables should be returned to their
+prior values@footnote{
+Note that some side effects are easier to undo than others. For instance,
+memory and registers are relatively easy, but device I/O is hard. Some
+targets may be able undo things like device I/O, and some may not.
+
+The contract between @value{GDBN} and the reverse executing target
+requires only that the target do something reasonable when
+@value{GDBN} tells it to execute backwards, and then report the
+results back to @value{GDBN}. Whatever the target reports back to
+@value{GDBN}, @value{GDBN} will report back to the user. @value{GDBN}
+assumes that the memory and registers that the target reports are in a
+consistant state, but @value{GDBN} accepts whatever it is given.
+}.
+
+If you are debugging in a target environment that supports
+reverse execution, @value{GDBN} provides the following commands.
+
+@table @code
+@kindex reverse-continue
+@kindex rc @r{(@code{reverse-continue})}
+@item reverse-continue @r{[}@var{ignore-count}@r{]}
+@itemx rc @r{[}@var{ignore-count}@r{]}
+Beginning at the point where your program last stopped, start executing
+in reverse. Reverse execution will stop for breakpoints and synchronous
+exceptions (signals), just like normal execution. Behavior of
+asynchronous signals depends on the target environment.
+
+@kindex reverse-step
+@kindex rs @r{(@code{step})}
+@item reverse-step @r{[}@var{count}@r{]}
+Run the program backward until control reaches the start of a
+different source line; then stop it, and return control to @value{GDBN}.
+
+Like the @code{step} command, @code{reverse-step} will only stop
+at the beginning of a source line. It ``un-executes'' the previously
+executed source line. If the previous source line included calls to
+debuggable functions, @code{reverse-step} will step (backward) into
+the called function, stopping at the beginning of the @emph{last}
+statement in the called function (typically a return statement).
+
+Also, as with the @code{step} command, if non-debuggable functions are
+called, @code{reverse-step} will run thru them backward without stopping.
+
+@kindex reverse-stepi
+@kindex rsi @r{(@code{reverse-stepi})}
+@item reverse-stepi @r{[}@var{count}@r{]}
+Reverse-execute one machine instruction. Note that the instruction
+to be reverse-executed is @emph{not} the one pointed to by the program
+counter, but the instruction executed prior to that one. For instance,
+if the last instruction was a jump, @code{reverse-stepi} will take you
+back from the destination of the jump to the jump instruction itself.
+
+@kindex reverse-next
+@kindex rn @r{(@code{reverse-next})}
+@item reverse-next @r{[}@var{count}@r{]}
+Run backward to the beginning of the previous line executed in
+the current (innermost) stack frame. If the line contains function
+calls, they will be ``un-executed'' without stopping. Starting from
+the first line of a function, @code{reverse-next} will take you back
+to the caller of that function, @emph{before} the function was called,
+just as the normal @code{next} command would take you from the last
+line of a function back to its return to its caller
+@footnote{Unles the code is too heavily optimized.}.
+
+@kindex reverse-nexti
+@kindex rni @r{(@code{reverse-nexti})}
+@item reverse-nexti @r{[}@var{count}@r{]}
+Like @code{nexti}, @code{reverse-nexti} executes a single instruction
+in reverse, except that called functions are ``un-executed'' atomically.
+That is, if the previously executed instruction was a return from
+another instruction, @code{reverse-nexti} will continue to execute
+in reverse until the call to that function (from the current stack
+frame) is reached.
+
+@kindex reverse-finish
+@item reverse-finish
+Just as the @code{finish} command takes you to the point where the
+current function returns, @code{reverse-finish} takes you to the point
+where it was called. Instead of ending up at the end of the current
+function invocation, you end up at the beginning.
+
+@kindex set exec-direction
+@item set exec-direction
+Set the direction of target execution.
+@itemx set exec-direction reverse
+@cindex execute forward or backward in time
+@value{GDBN} will perform all execution commands in reverse, until the
+exec-direction mode is changed to ``forward''. Affected commands include
+@code{step, stepi, next, nexti, continue, and finish}. The @code{return}
+command cannot be used in reverse mode.
+@item set exec-direction forward
+@value{GDBN} will perform all execution commands in the normal fashion.
+This is the default.
+@end table
+
@node Stack
@chapter Examining the Stack
@@ -11085,6 +11205,8 @@ to be difficult.
* Omissions from Ada:: Restrictions on the Ada expression syntax.
* Additions to Ada:: Extensions of the Ada expression syntax.
* Stopping Before Main Program:: Debugging the program during elaboration.
+* Ada Tasks:: Listing and setting breakpoints in tasks.
+* Ada Tasks and Core Files:: Tasking Support when Debugging Core Files
* Ada Glitches:: Known peculiarities of Ada mode.
@end menu
@@ -11405,6 +11527,187 @@ Manual, the elaboration code is invoked from a procedure called
elaboration, simply use the following two commands:
@code{tbreak adainit} and @code{run}.
+@node Ada Tasks
+@subsubsection Extensions for Ada Tasks
+@cindex Ada, tasking
+
+Support for Ada tasks is analogous to that for threads (@pxref{Threads}).
+@value{GDBN} provides the following task-related commands:
+
+@table @code
+@kindex info tasks
+@item info tasks
+This command shows a list of current Ada tasks, as in the following example:
+
+
+@smallexample
+@iftex
+@leftskip=0.5cm
+@end iftex
+(@value{GDBP}) info tasks
+ ID TID P-ID Pri State Name
+ 1 8088000 0 15 Child Activation Wait main_task
+ 2 80a4000 1 15 Accept Statement b
+ 3 809a800 1 15 Child Activation Wait a
+* 4 80ae800 3 15 Running c
+
+@end smallexample
+
+@noindent
+In this listing, the asterisk before the last task indicates it to be the
+task currently being inspected.
+
+@table @asis
+@item ID
+Represents @value{GDBN}'s internal task number.
+
+@item TID
+The Ada task ID.
+
+@item P-ID
+The parent's task ID (@value{GDBN}'s internal task number).
+
+@item Pri
+The base priority of the task.
+
+@item State
+Current state of the task.
+
+@table @code
+@item Unactivated
+The task has been created but has not been activated. It cannot be
+executing.
+
+@item Running
+The task currently running.
+
+@item Runnable
+The task is not blocked for any reason known to Ada. (It may be waiting
+for a mutex, though.) It is conceptually "executing" in normal mode.
+
+@item Terminated
+The task is terminated, in the sense of ARM 9.3 (5). Any dependents
+that were waiting on terminate alternatives have been awakened and have
+terminated themselves.
+
+@item Child Activation Wait
+The task is waiting for created tasks to complete activation.
+
+@item Accept Statement
+The task is waiting on an accept or selective wait statement.
+
+@item Waiting on entry call
+The task is waiting on an entry call.
+
+@item Async Select Wait
+The task is waiting to start the abortable part of an asynchronous
+select statement.
+
+@item Delay Sleep
+The task is waiting on a select statement with only a delay
+alternative open.
+
+@item Child Termination Wait
+The task is sleeping having completed a master within itself, and is
+waiting for the tasks dependent on that master to become terminated or
+waiting on a terminate Phase.
+
+@item Wait Child in Term Alt
+The task is sleeping waiting for tasks on terminate alternatives to
+finish terminating.
+
+@item Accepting RV with @var{taskno}
+The task is accepting a rendez-vous with the task @var{taskno}.
+@end table
+
+@item Name
+Name of the task in the program.
+
+@end table
+
+@kindex info task @var{taskno}
+@item info task @var{taskno}
+This command shows detailled informations on the specified task, as in
+the following example:
+@smallexample
+@iftex
+@leftskip=0.5cm
+@end iftex
+(@value{GDBP}) info tasks
+ ID TID P-ID Pri State Name
+ 1 8077880 0 15 Child Activation Wait main_task
+* 2 807c468 1 15 Running task_1
+(@value{GDBP}) info task 2
+Ada Task: 0x807c468
+Name: task_1
+Thread: 0x807f378
+Parent: 1 (main_task)
+Base Priority: 15
+State: Runnable
+@end smallexample
+
+@item task
+@kindex task@r{ (Ada)}
+@cindex current Ada task ID
+This command prints the ID of the current task.
+
+@smallexample
+@iftex
+@leftskip=0.5cm
+@end iftex
+(@value{GDBP}) info tasks
+ ID TID P-ID Pri State Name
+ 1 8077870 0 15 Child Activation Wait main_task
+* 2 807c458 1 15 Running t
+(@value{GDBP}) task
+[Current task is 2]
+@end smallexample
+
+@item task @var{taskno}
+@cindex Ada task switching
+This command is like the @code{thread @var{threadno}}
+command (@pxref{Threads}). It switches the context of debugging
+from the current task to the given task.
+
+@smallexample
+@iftex
+@leftskip=0.5cm
+@end iftex
+(@value{GDBP}) info tasks
+ ID TID P-ID Pri State Name
+ 1 8077870 0 15 Child Activation Wait main_task
+* 2 807c458 1 15 Running t
+(@value{GDBP}) task 1
+[Switching to task 1]
+#0 0x8067726 in pthread_cond_wait ()
+(@value{GDBP}) bt
+#0 0x8067726 in pthread_cond_wait ()
+#1 0x8056714 in system.os_interface.pthread_cond_wait ()
+#2 0x805cb63 in system.task_primitives.operations.sleep ()
+#3 0x806153e in system.tasking.stages.activate_tasks ()
+#4 0x804aacc in un () at un.adb:5
+@end smallexample
+
+@end table
+
+@node Ada Tasks and Core Files
+@subsubsection Tasking Support when Debugging Core Files
+@cindex Ada tasking and core file debugging
+
+When inspecting a core file, as opposed to debugging a live program,
+tasking support may be limited or even unavailable, depending on
+the platform being used.
+For instance, on x86-linux, the list of tasks is available, but task
+switching is not supported. On Tru64, however, task switching will work
+as usual.
+
+On certain platforms, including Tru64, the debugger needs to perform some
+memory writes in order to provide Ada tasking support. When inspecting
+a core file, this means that the core file must be opened with read-write
+privileges, using the command @samp{"set write on"} (@pxref{Patching}).
+Under these circumstances, you should make a backup copy of the core
+file before inspecting it with @value{GDBN}.
+
@node Ada Glitches
@subsubsection Known Peculiarities of Ada Mode
@cindex Ada, problems
@@ -11553,6 +11856,16 @@ _initialize_vx + 396 in section .text
This is the opposite of the @code{info address} command. You can use
it to find out the name of a variable or a function given its address.
+For dynamically linked executables, the name of executable or shared
+library containing the symbol is also printed:
+
+@smallexample
+(@value{GDBP}) info symbol 0x400225
+_start + 5 in section .text of /tmp/a.out
+(@value{GDBP}) info symbol 0x2aaaac2811cf
+__read_nocancel + 6 in section .text of /usr/lib64/libc.so.6
+@end smallexample
+
@kindex whatis
@item whatis [@var{arg}]
Print the data type of @var{arg}, which can be either an expression or
@@ -12209,7 +12522,7 @@ repairs.
@item set write on
@itemx set write off
If you specify @samp{set write on}, @value{GDBN} opens executable and
-core files for both reading and writing; if you specify @samp{set write
+core files for both reading and writing; if you specify @kbd{set write
off} (the default), @value{GDBN} opens them read-only.
If you have already loaded a file, you must load it again (using the
@@ -17010,6 +17323,13 @@ Display debugging messages about inner workings of the AIX thread
module.
@item show debug aix-thread
Show the current state of AIX thread debugging info display.
+@item set debug dwarf2-die
+@cindex DWARF2 DIEs
+Dump DWARF2 DIEs after they are read in.
+The value is the number of nesting levels to print.
+A value of zero turns off the display.
+@item show debug dwarf2-die
+Show the current state of DWARF2 DIE debugging.
@item set debug displaced
@cindex displaced stepping debugging info
Turns on or off display of @value{GDBN} debugging info for the
@@ -17674,6 +17994,7 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown.
@menu
* Basic Python:: Basic Python Functions.
* Exception Handling::
+* Values From Inferior::
@end menu
@node Basic Python
@@ -17752,6 +18073,64 @@ message as its value, and the Python call stack backtrace at the
Python statement closest to where the @value{GDBN} error occured as the
traceback.
+@node Values From Inferior
+@subsubsection Values From Inferior
+@cindex values from inferior, with Python
+@cindex python, working with values from inferior
+
+@cindex @code{gdb.Value}
+@value{GDBN} provides values it obtains from the inferior program in
+an object of type @code{gdb.Value}. @value{GDBN} uses this object
+for its internal bookkeeping of the inferior's values, and for
+fetching values when necessary.
+
+Inferior values that are simple scalars can be used directly in
+Python expressions that are valid for the value's data type. Here's
+an example for an integer or floating-point value @code{some_val}:
+
+@smallexample
+bar = some_val + 2
+@end smallexample
+
+@noindent
+As result of this, @code{bar} will also be a @code{gdb.Value} object
+whose values are of the same type as those of @code{some_val}.
+
+Inferior values that are structures or instances of some class can
+be accessed using the Python @dfn{dictionary syntax}. For example, if
+@code{some_val} is a @code{gdb.Value} instance holding a structure, you
+can access its @code{foo} element with:
+
+@smallexample
+bar = some_val['foo']
+@end smallexample
+
+Again, @code{bar} will also be a @code{gdb.Value} object.
+
+For pointer data types, @code{gdb.Value} provides a method for
+dereferencing the pointer to obtain the object it points to.
+
+@defmethod Value dereference
+This method returns a new @code{gdb.Value} object whose contents is
+the object pointed to by the pointer. For example, if @code{foo} is
+a C pointer to an @code{int}, declared in your C program as
+
+@smallexample
+int *foo;
+@end smallexample
+
+@noindent
+then you can use the corresponding @code{gdb.Value} to access what
+@code{foo} points to like this:
+
+@smallexample
+bar = foo.dereference ()
+@end smallexample
+
+The result @code{bar} will be a @code{gdb.Value} object holding the
+value pointed to by @code{foo}.
+@end defmethod
+
@node Interpreters
@chapter Command Interpreters
@cindex command interpreters
@@ -18894,6 +19273,19 @@ A signal was received by the inferior.
@itemx =thread-exited,id="@var{id}"
A thread either was created, or has exited. The @var{id} field
contains the @value{GDBN} identifier of the thread.
+
+@item =thread-selected,id="@var{id}"
+Informs that the selected thread was changed as result of the last
+command. This notification is not emitted as result of @code{-thread-select}
+command but is emitted whenever an MI command that is not documented
+to change the selected thread actually changes it. In particular,
+invoking, directly or indirectly (via user-defined command), the CLI
+@code{thread} command, will generate this notification.
+
+We suggest that in response to this notification, front ends
+highlight the selected thread and cause subsequent commands to apply to
+that thread.
+
@end table
@@ -23917,18 +24309,33 @@ Shared library events.
@end table
-@kindex maint set can-use-displaced-stepping
-@kindex maint show can-use-displaced-stepping
+@kindex set displaced-stepping
+@kindex show displaced-stepping
@cindex displaced stepping support
@cindex out-of-line single-stepping
-@item maint set can-use-displaced-stepping
-@itemx maint show can-use-displaced-stepping
+@item set displaced-stepping
+@itemx show displaced-stepping
Control whether or not @value{GDBN} will do @dfn{displaced stepping}
-if the target supports it. The default is on. Displaced stepping is
-a way to single-step over breakpoints without removing them from the
-inferior, by executing an out-of-line copy of the instruction that was
-originally at the breakpoint location. It is also known as
-out-of-line single-stepping.
+if the target supports it. Displaced stepping is a way to single-step
+over breakpoints without removing them from the inferior, by executing
+an out-of-line copy of the instruction that was originally at the
+breakpoint location. It is also known as out-of-line single-stepping.
+
+@table @code
+@item set displaced-stepping on
+If the target architecture supports it, @value{GDBN} will use
+displaced stepping to step over breakpoints.
+
+@item set displaced-stepping off
+@value{GDBN} will not use displaced stepping to step over breakpoints,
+even if such is supported by the target architecture.
+
+@cindex non-stop mode, and @samp{set displaced-stepping}
+@item set displaced-stepping auto
+This is the default mode. @value{GDBN} will use displaced stepping
+only if non-stop mode is active (@pxref{Non-Stop Mode}) and the target
+architecture supports displaced stepping.
+@end table
@kindex maint check-symtabs
@item maint check-symtabs
@@ -24214,6 +24621,10 @@ the symbol's location to the specified address. This is similar to
the @code{info address} command (@pxref{Symbols}), except that this
command also allows to find symbols in other sections.
+If section was not specified, the section in which the symbol was found
+is also printed. For dynamically linked executables, the name of
+executable or shared library containing the symbol is printed as well.
+
@end table
The following command is useful for non-interactive invocations of
@@ -24244,6 +24655,8 @@ Show the current setting of the target wait timeout.
* Tracepoint Packets::
* Host I/O Packets::
* Interrupts::
+* Notification Packets::
+* Remote Non-Stop::
* Packet Acknowledgment::
* Examples::
* File-I/O Remote Protocol Extension::
@@ -24265,8 +24678,9 @@ transmitted and received data, respectively.
@cindex protocol, @value{GDBN} remote serial
@cindex serial protocol, @value{GDBN} remote
@cindex remote serial protocol
-All @value{GDBN} commands and responses (other than acknowledgments) are
-sent as a @var{packet}. A @var{packet} is introduced with the character
+All @value{GDBN} commands and responses (other than acknowledgments
+and notifications, see @ref{Notification Packets}) are sent as a
+@var{packet}. A @var{packet} is introduced with the character
@samp{$}, the actual @var{packet-data}, and the terminating character
@samp{#} followed by a two-digit @var{checksum}:
@@ -24312,7 +24726,10 @@ once a connection is established.
The host (@value{GDBN}) sends @var{command}s, and the target (the
debugging stub incorporated in your program) sends a @var{response}. In
the case of step and continue @var{command}s, the response is only sent
-when the operation has completed (the target has again stopped).
+when the operation has completed, and the target has again stopped all
+threads in all attached processes. This is the default all-stop mode
+behavior, but the remote protocol also supports @value{GDBN}'s non-stop
+execution mode; see @ref{Remote Non-Stop}, for details.
@var{packet-data} consists of a sequence of characters with the
exception of @samp{#} and @samp{$} (see @samp{X} packet for additional
@@ -24448,7 +24865,8 @@ The remote target both supports and has enabled extended mode.
@item ?
@cindex @samp{?} packet
Indicate the reason the target halted. The reply is the same as for
-step and continue.
+step and continue. This packet has a special interpretation when the
+target is in non-stop mode; see @ref{Remote Non-Stop}.
Reply:
@xref{Stop Reply Packets}, for the reply specifications.
@@ -24490,6 +24908,22 @@ breakpoint at @var{addr}.
Don't use this packet. Use the @samp{Z} and @samp{z} packets instead
(@pxref{insert breakpoint or watchpoint packet}).
+@item bc
+@cindex @samp{bc} packet
+Backward continue. Execute the target system in reverse. No parameter.
+@xref{Reverse Execution}, for more information.
+
+Reply:
+@xref{Stop Reply Packets}, for the reply specifications.
+
+@item bs
+@cindex @samp{bs} packet
+Backward single step. Execute one instruction in reverse. No parameter.
+@xref{Reverse Execution}, for more information.
+
+Reply:
+@xref{Stop Reply Packets}, for the reply specifications.
+
@item c @r{[}@var{addr}@r{]}
@cindex @samp{c} packet
Continue. @var{addr} is address to resume. If @var{addr} is omitted,
@@ -24752,9 +25186,20 @@ up to the first @samp{;} or @samp{?} (or the end of the packet).
@item vAttach;@var{pid}
@cindex @samp{vAttach} packet
-Attach to a new process with the specified process ID. @var{pid} is a
-hexadecimal integer identifying the process. The attached process is
-stopped.
+Attach to a new process with the specified process ID @var{pid}.
+The process ID is a
+hexadecimal integer identifying the process. In all-stop mode, all
+threads in the attached process are stopped; in non-stop mode, it may be
+attached without being stopped if that is supported by the target.
+
+@c In non-stop mode, on a successful vAttach, the stub should set the
+@c current thread to a thread of the newly-attached process. After
+@c attaching, GDB queries for the attached process's thread ID with qC.
+@c Also note that, from a user perspective, whether or not the
+@c target is stopped on attach in non-stop mode depends on whether you
+@c use the foreground or background version of the attach command, not
+@c on what vAttach does; GDB does the right thing with respect to either
+@c stopping or restarting threads.
This packet is only available in extended mode (@pxref{extended mode}).
@@ -24763,7 +25208,9 @@ Reply:
@item E @var{nn}
for an error
@item @r{Any stop packet}
-for success (@pxref{Stop Reply Packets})
+for success in all-stop mode (@pxref{Stop Reply Packets})
+@item OK
+for success in non-stop mode (@pxref{Remote Non-Stop})
@end table
@item vCont@r{[};@var{action}@r{[}:@var{thread-id}@r{]]}@dots{}
@@ -24771,7 +25218,9 @@ for success (@pxref{Stop Reply Packets})
Resume the inferior, specifying different actions for each thread.
If an action is specified with no @var{thread-id}, then it is applied to any
threads that don't have a specific action specified; if no default action is
-specified then other threads should remain stopped. Specifying multiple
+specified then other threads should remain stopped in all-stop mode and
+in their current state in non-stop mode.
+Specifying multiple
default actions is an error; specifying no actions is also an error.
Thread IDs are specified using the syntax described in @ref{thread-id syntax}.
@@ -24781,16 +25230,29 @@ Currently supported actions are:
@item c
Continue.
@item C @var{sig}
-Continue with signal @var{sig}. @var{sig} should be two hex digits.
+Continue with signal @var{sig}. The signal @var{sig} should be two hex digits.
@item s
Step.
@item S @var{sig}
-Step with signal @var{sig}. @var{sig} should be two hex digits.
+Step with signal @var{sig}. The signal @var{sig} should be two hex digits.
+@item t
+Stop.
+@item T @var{sig}
+Stop with signal @var{sig}. The signal @var{sig} should be two hex digits.
@end table
-The optional @var{addr} argument normally associated with these packets is
+The optional argument @var{addr} normally associated with the
+@samp{c}, @samp{C}, @samp{s}, and @samp{S} packets is
not supported in @samp{vCont}.
+The @samp{t} and @samp{T} actions are only relevant in non-stop mode
+(@pxref{Remote Non-Stop}) and may be ignored by the stub otherwise.
+A stop reply should be generated for any affected thread not already stopped.
+When a thread is stopped by means of a @samp{t} action,
+the corresponding stop reply should indicate that the thread has stopped with
+signal @samp{0}, regardless of whether the target uses some other signal
+as an implementation detail.
+
Reply:
@xref{Stop Reply Packets}, for the reply specifications.
@@ -24893,6 +25355,8 @@ command line. The file and arguments are hex-encoded strings. If
(e.g.@: the last program run). The program is created in the stopped
state.
+@c FIXME: What about non-stop mode?
+
This packet is only available in extended mode (@pxref{extended mode}).
Reply:
@@ -24903,6 +25367,21 @@ for an error
for success (@pxref{Stop Reply Packets})
@end table
+@item vStopped
+@anchor{vStopped packet}
+@cindex @samp{vStopped} packet
+
+In non-stop mode (@pxref{Remote Non-Stop}), acknowledge a previous stop
+reply and prompt for the stub to report another one.
+
+Reply:
+@table @samp
+@item @r{Any stop packet}
+if there is another unreported stop event (@pxref{Stop Reply Packets})
+@item OK
+if there are no unreported stop events
+@end table
+
@item X @var{addr},@var{length}:@var{XX@dots{}}
@anchor{X packet}
@cindex @samp{X} packet
@@ -25042,9 +25521,10 @@ for an error
@section Stop Reply Packets
@cindex stop reply packets
-The @samp{C}, @samp{c}, @samp{S}, @samp{s} and @samp{?} packets can
-receive any of the below as a reply. In the case of the @samp{C},
-@samp{c}, @samp{S} and @samp{s} packets, that reply is only returned
+The @samp{C}, @samp{c}, @samp{S}, @samp{s}, @samp{vCont},
+@samp{vAttach}, @samp{vRun}, @samp{vStopped}, and @samp{?} packets can
+receive any of the below as a reply. Except for @samp{?}
+and @samp{vStopped}, that reply is only returned
when the target halts. In the below the exact meaning of @dfn{signal
number} is defined by the header @file{include/gdb/signals.h} in the
@value{GDBN} source code.
@@ -25107,6 +25587,16 @@ hex.
The packet indicates that the loaded libraries have changed.
@value{GDBN} should use @samp{qXfer:libraries:read} to fetch a new
list of loaded libraries. @var{r} is ignored.
+
+@cindex replay log events, remote reply
+@item replaylog
+The packet indicates that the target cannot continue replaying
+logged execution events, because it has reached the end (or the
+beginning when executing backward) of the log. The value of @var{r}
+will be either @samp{begin} or @samp{end}. @xref{Reverse Execution},
+for more information.
+
+
@end table
@item W @var{AA}
@@ -25132,7 +25622,7 @@ extensions}. The @var{pid} is formatted as a big-endian hex string.
@samp{@var{XX}@dots{}} is hex encoding of @sc{ascii} data, to be
written as the program's console output. This can happen at any time
while the program is running and the debugger should continue to wait
-for @samp{W}, @samp{T}, etc.
+for @samp{W}, @samp{T}, etc. This reply is not permitted in non-stop mode.
@item F @var{call-id},@var{parameter}@dots{}
@var{call-id} is the identifier which says which host system call should
@@ -25357,6 +25847,32 @@ Don't use this packet; use the @samp{qThreadExtraInfo} query instead
Reply: see @code{remote.c:remote_unpack_thread_info_response()}.
+@item QNonStop:1
+@item QNonStop:0
+@cindex non-stop mode, remote request
+@cindex @samp{QNonStop} packet
+@anchor{QNonStop}
+Enter non-stop (@samp{QNonStop:1}) or all-stop (@samp{QNonStop:0}) mode.
+@xref{Remote Non-Stop}, for more information.
+
+Reply:
+@table @samp
+@item OK
+The request succeeded.
+
+@item E @var{nn}
+An error occurred. @var{nn} are hex digits.
+
+@item
+An empty reply indicates that @samp{QNonStop} is not supported by
+the stub.
+@end table
+
+This packet is not probed by default; the remote stub must request it,
+by supplying an appropriate @samp{qSupported} response (@pxref{qSupported}).
+Use of this packet is controlled by the @code{set non-stop} command;
+@pxref{Non-Stop Mode}.
+
@item QPassSignals: @var{signal} @r{[};@var{signal}@r{]}@dots{}
@cindex pass signals to inferior, remote request
@cindex @samp{QPassSignals} packet
@@ -25599,6 +26115,11 @@ These are the currently defined stub features and their properties:
@tab @samp{-}
@tab Yes
+@item @samp{QNonStop}
+@tab No
+@tab @samp{-}
+@tab Yes
+
@item @samp{QPassSignals}
@tab No
@tab @samp{-}
@@ -25654,6 +26175,10 @@ The remote stub understands the @samp{qXfer:spu:read} packet
The remote stub understands the @samp{qXfer:spu:write} packet
(@pxref{qXfer spu write}).
+@item QNonStop
+The remote stub understands the @samp{QNonStop} packet
+(@pxref{QNonStop}).
+
@item QPassSignals
The remote stub understands the @samp{QPassSignals} packet
(@pxref{QPassSignals}).
@@ -26215,11 +26740,148 @@ and does @emph{not} represent an interrupt. E.g., an @samp{X} packet
Stubs are not required to recognize these interrupt mechanisms and the
precise meaning associated with receipt of the interrupt is
-implementation defined. If the stub is successful at interrupting the
-running program, it is expected that it will send one of the Stop
-Reply Packets (@pxref{Stop Reply Packets}) to @value{GDBN} as a result
-of successfully stopping the program. Interrupts received while the
-program is stopped will be discarded.
+implementation defined. If the target supports debugging of multiple
+threads and/or processes, it should attempt to interrupt all
+currently-executing threads and processes.
+If the stub is successful at interrupting the
+running program, it should send one of the stop
+reply packets (@pxref{Stop Reply Packets}) to @value{GDBN} as a result
+of successfully stopping the program in all-stop mode, and a stop reply
+for each stopped thread in non-stop mode.
+Interrupts received while the
+program is stopped are discarded.
+
+@node Notification Packets
+@section Notification Packets
+@cindex notification packets
+@cindex packets, notification
+
+The @value{GDBN} remote serial protocol includes @dfn{notifications},
+packets that require no acknowledgment. Both the GDB and the stub
+may send notifications (although the only notifications defined at
+present are sent by the stub). Notifications carry information
+without incurring the round-trip latency of an acknowledgment, and so
+are useful for low-impact communications where occasional packet loss
+is not a problem.
+
+A notification packet has the form @samp{% @var{data} #
+@var{checksum}}, where @var{data} is the content of the notification,
+and @var{checksum} is a checksum of @var{data}, computed and formatted
+as for ordinary @value{GDBN} packets. A notification's @var{data}
+never contains @samp{$}, @samp{%} or @samp{#} characters. Upon
+receiving a notification, the recipient sends no @samp{+} or @samp{-}
+to acknowledge the notification's receipt or to report its corruption.
+
+Every notification's @var{data} begins with a name, which contains no
+colon characters, followed by a colon character.
+
+Recipients should silently ignore corrupted notifications and
+notifications they do not understand. Recipients should restart
+timeout periods on receipt of a well-formed notification, whether or
+not they understand it.
+
+Senders should only send the notifications described here when this
+protocol description specifies that they are permitted. In the
+future, we may extend the protocol to permit existing notifications in
+new contexts; this rule helps older senders avoid confusing newer
+recipients.
+
+(Older versions of @value{GDBN} ignore bytes received until they see
+the @samp{$} byte that begins an ordinary packet, so new stubs may
+transmit notifications without fear of confusing older clients. There
+are no notifications defined for @value{GDBN} to send at the moment, but we
+assume that most older stubs would ignore them, as well.)
+
+The following notification packets from the stub to @value{GDBN} are
+defined:
+
+@table @samp
+@item Stop: @var{reply}
+Report an asynchronous stop event in non-stop mode.
+The @var{reply} has the form of a stop reply, as
+described in @ref{Stop Reply Packets}. Refer to @ref{Remote Non-Stop},
+for information on how these notifications are acknowledged by
+@value{GDBN}.
+@end table
+
+@node Remote Non-Stop
+@section Remote Protocol Support for Non-Stop Mode
+
+@value{GDBN}'s remote protocol supports non-stop debugging of
+multi-threaded programs, as described in @ref{Non-Stop Mode}. If the stub
+supports non-stop mode, it should report that to @value{GDBN} by including
+@samp{QNonStop+} in its @samp{qSupported} response (@pxref{qSupported}).
+
+@value{GDBN} typically sends a @samp{QNonStop} packet only when
+establishing a new connection with the stub. Entering non-stop mode
+does not alter the state of any currently-running threads, but targets
+must stop all threads in any already-attached processes when entering
+all-stop mode. @value{GDBN} uses the @samp{?} packet as necessary to
+probe the target state after a mode change.
+
+In non-stop mode, when an attached process encounters an event that
+would otherwise be reported with a stop reply, it uses the
+asynchronous notification mechanism (@pxref{Notification Packets}) to
+inform @value{GDBN}. In contrast to all-stop mode, where all threads
+in all processes are stopped when a stop reply is sent, in non-stop
+mode only the thread reporting the stop event is stopped. That is,
+when reporting a @samp{S} or @samp{T} response to indicate completion
+of a step operation, hitting a breakpoint, or a fault, only the
+affected thread is stopped; any other still-running threads continue
+to run. When reporting a @samp{W} or @samp{X} response, all running
+threads belonging to other attached processes continue to run.
+
+Only one stop reply notification at a time may be pending; if
+additional stop events occur before @value{GDBN} has acknowledged the
+previous notification, they must be queued by the stub for later
+synchronous transmission in response to @samp{vStopped} packets from
+@value{GDBN}. Because the notification mechanism is unreliable,
+the stub is permitted to resend a stop reply notification
+if it believes @value{GDBN} may not have received it. @value{GDBN}
+ignores additional stop reply notifications received before it has
+finished processing a previous notification and the stub has completed
+sending any queued stop events.
+
+Otherwise, @value{GDBN} must be prepared to receive a stop reply
+notification at any time. Specifically, they may appear when
+@value{GDBN} is not otherwise reading input from the stub, or when
+@value{GDBN} is expecting to read a normal synchronous response or a
+@samp{+}/@samp{-} acknowledgment to a packet it has sent.
+Notification packets are distinct from any other communication from
+the stub so there is no ambiguity.
+
+After receiving a stop reply notification, @value{GDBN} shall
+acknowledge it by sending a @samp{vStopped} packet (@pxref{vStopped packet})
+as a regular, synchronous request to the stub. Such acknowledgment
+is not required to happen immediately, as @value{GDBN} is permitted to
+send other, unrelated packets to the stub first, which the stub should
+process normally.
+
+Upon receiving a @samp{vStopped} packet, if the stub has other queued
+stop events to report to @value{GDBN}, it shall respond by sending a
+normal stop reply response. @value{GDBN} shall then send another
+@samp{vStopped} packet to solicit further responses; again, it is
+permitted to send other, unrelated packets as well which the stub
+should process normally.
+
+If the stub receives a @samp{vStopped} packet and there are no
+additional stop events to report, the stub shall return an @samp{OK}
+response. At this point, if further stop events occur, the stub shall
+send a new stop reply notification, @value{GDBN} shall accept the
+notification, and the process shall be repeated.
+
+In non-stop mode, the target shall respond to the @samp{?} packet as
+follows. First, any incomplete stop reply notification/@samp{vStopped}
+sequence in progress is abandoned. The target must begin a new
+sequence reporting stop events for all stopped threads, whether or not
+it has previously reported those events to @value{GDBN}. The first
+stop reply is sent as a synchronous reply to the @samp{?} packet, and
+subsequent stop replies are sent as responses to @samp{vStopped} packets
+using the mechanism described above. The target must not send
+asynchronous stop reply notifications until the sequence is complete.
+If all threads are running when the target receives the @samp{?} packet,
+or if the target is not attached to any process, it shall respond
+@samp{OK}.
@node Packet Acknowledgment
@section Packet Acknowledgment
@@ -26264,7 +26926,6 @@ new connection is established,
there is also no protocol request to re-enable the acknowledgments
for the current connection, once disabled.
-
@node Examples
@section Examples
@@ -26359,6 +27020,8 @@ the host file system. Character or block special devices, pipes,
named pipes, sockets or any other communication method on the host
system are not supported by this protocol.
+File I/O is not supported in non-stop mode.
+
@node Protocol Basics
@subsection Protocol Basics
@cindex protocol basics, file-i/o
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 1edb444..9caff8f 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -821,8 +821,7 @@ defining @code{I386_USE_GENERIC_WATCHPOINTS}.
@item
Add @file{i386-nat.o} to the value of the Make variable
-@code{NATDEPFILES} (@pxref{Native Debugging, NATDEPFILES}) or
-@code{TDEPFILES} (@pxref{Target Architecture Definition, TDEPFILES}).
+@code{NATDEPFILES} (@pxref{Native Debugging, NATDEPFILES}).
@item
Provide implementations for the @code{I386_DR_LOW_*} macros described
@@ -4106,15 +4105,7 @@ Defaults to @code{1}.
The following files add a target to @value{GDBN}:
@table @file
-@vindex TDEPFILES
-@item gdb/config/@var{arch}/@var{ttt}.mt
-Contains a Makefile fragment specific to this target. Specifies what
-object files are needed for target @var{ttt}, by defining
-@samp{TDEPFILES=@dots{}} and @samp{TDEPLIBS=@dots{}}.
-
-You can also define @samp{TM_CLIBS} and @samp{TM_CDEPS}, but these are
-now deprecated, replaced by autoconf, and may go away in future
-versions of @value{GDBN}.
+@cindex target dependent files
@item gdb/@var{ttt}-tdep.c
Contains any miscellaneous code required for this target machine. On
diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi
index 3e10c5f..636658a 100644
--- a/gdb/doc/observer.texi
+++ b/gdb/doc/observer.texi
@@ -135,6 +135,14 @@ The thread specified by @var{t} has been created.
The thread specified by @var{t} has exited.
@end deftypefun
+@deftypefun void thread_stop_requested (ptid_t @var{ptid})
+An explicit stop request was issued to @var{ptid}. If @var{ptid}
+equals @var{minus_one_ptid}, the request applied to all threads. If
+@code{ptid_is_pid(ptid)} returns true, the request applied to all
+threads of the process pointed at by @var{ptid}. Otherwise, the
+request applied to the single thread pointed at by @var{ptid}.
+@end deftypefun
+
@deftypefun void target_resumed (ptid_t @var{ptid})
The target was resumed. The @var{ptid} parameter specifies which
thread was resume, and may be RESUME_ALL if all threads are resumed.
@@ -179,3 +187,13 @@ a pointer to the new architecture.
The thread's ptid has changed. The @var{old_ptid} parameter specifies
the old value, and @var{new_ptid} specifies the new value.
@end deftypefun
+
+@deftypefun void new_inferior (int @var{pid})
+@value{GDBN} has attached to a new inferior identified by @var{pid}.
+@end deftypefun
+
+@deftypefun void inferior_exit (int @var{pid})
+Either @value{GDBN} detached from the inferior, or the inferior
+exited. The argument @var{pid} identifies the inferior.
+@end deftypefun
+
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index a27de2e..9cc3da7 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -265,11 +265,13 @@ maintenance_print_dummy_frames (char *args, int from_tty)
fprint_dummy_frames (gdb_stdout);
else
{
+ struct cleanup *cleanups;
struct ui_file *file = gdb_fopen (args, "w");
if (file == NULL)
perror_with_name (_("maintenance print dummy-frames"));
+ cleanups = make_cleanup_ui_file_delete (file);
fprint_dummy_frames (file);
- ui_file_delete (file);
+ do_cleanups (cleanups);
}
}
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 5e4d15f..a6584c4 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -141,6 +141,9 @@ typedef struct statement_prologue
}
_STATEMENT_PROLOGUE;
+/* When non-zero, dump DIEs after they are read in. */
+static int dwarf2_die_debug = 0;
+
/* When set, the file that we're processing is known to have debugging
info for C++ namespaces. GCC 3.3.x did not produce this information,
but later versions do. */
@@ -231,7 +234,7 @@ asection *dwarf_eh_frame_section;
translation, looks like this. */
struct comp_unit_head
{
- unsigned long length;
+ unsigned int length;
short version;
unsigned char addr_size;
unsigned char signed_addr_p;
@@ -296,7 +299,7 @@ struct dwarf2_cu
htab_t partial_dies;
/* `.debug_ranges' offset for this `DW_TAG_compile_unit' DIE. */
- unsigned long ranges_offset;
+ unsigned int ranges_offset;
/* Storage for things with the same lifetime as this read-in compilation
unit, including partial DIEs. */
@@ -360,13 +363,15 @@ struct dwarf2_per_cu_data
{
/* The start offset and length of this compilation unit. 2**30-1
bytes should suffice to store the length of any compilation unit
- - if it doesn't, GDB will fall over anyway. */
- unsigned long offset;
- unsigned long length : 30;
+ - if it doesn't, GDB will fall over anyway.
+ NOTE: Unlike comp_unit_head.length, this length includes
+ initial_length_size. */
+ unsigned int offset;
+ unsigned int length : 30;
/* Flag indicating this compilation unit will be read in before
any of the current compilation units are processed. */
- unsigned long queued : 1;
+ unsigned int queued : 1;
/* This flag will be set if we need to load absolutely all DIEs
for this compilation unit, instead of just the ones we think
@@ -695,6 +700,13 @@ dwarf2_debug_line_missing_file_complaint (void)
}
static void
+dwarf2_debug_line_missing_end_sequence_complaint (void)
+{
+ complaint (&symfile_complaints,
+ _(".debug_line section has line program sequence without an end"));
+}
+
+static void
dwarf2_complex_location_expr_complaint (void)
{
complaint (&symfile_complaints, _("location expression too complex"));
@@ -796,7 +808,7 @@ static gdb_byte *read_partial_die (struct partial_die_info *,
struct abbrev_info *abbrev, unsigned int,
bfd *, gdb_byte *, struct dwarf2_cu *);
-static struct partial_die_info *find_partial_die (unsigned long,
+static struct partial_die_info *find_partial_die (unsigned int,
struct dwarf2_cu *);
static void fixup_partial_die (struct partial_die_info *,
@@ -824,11 +836,16 @@ static unsigned long read_8_bytes (bfd *, gdb_byte *);
static CORE_ADDR read_address (bfd *, gdb_byte *ptr, struct dwarf2_cu *,
unsigned int *);
-static LONGEST read_initial_length (bfd *, gdb_byte *,
- struct comp_unit_head *, unsigned int *);
+static LONGEST read_initial_length (bfd *, gdb_byte *, unsigned int *);
+
+static LONGEST read_checked_initial_length_and_offset
+ (bfd *, gdb_byte *, const struct comp_unit_head *,
+ unsigned int *, unsigned int *);
static LONGEST read_offset (bfd *, gdb_byte *, const struct comp_unit_head *,
- unsigned int *);
+ unsigned int *);
+
+static LONGEST read_offset_1 (bfd *, gdb_byte *, unsigned int);
static gdb_byte *read_n_bytes (bfd *, gdb_byte *, unsigned int);
@@ -950,6 +967,11 @@ static enum dwarf_array_dim_ordering read_array_order (struct die_info *,
static struct die_info *read_comp_unit (gdb_byte *, bfd *, struct dwarf2_cu *);
+static struct die_info *read_die_and_children_1 (gdb_byte *info_ptr, bfd *abfd,
+ struct dwarf2_cu *,
+ gdb_byte **new_info_ptr,
+ struct die_info *parent);
+
static struct die_info *read_die_and_children (gdb_byte *info_ptr, bfd *abfd,
struct dwarf2_cu *,
gdb_byte **new_info_ptr,
@@ -987,15 +1009,19 @@ static char *dwarf_cfi_name (unsigned int);
static struct die_info *sibling_die (struct die_info *);
-static void dump_die (struct die_info *);
+static void dump_die_shallow (struct ui_file *, int indent, struct die_info *);
+
+static void dump_die_for_error (struct die_info *);
-static void dump_die_list (struct die_info *);
+static void dump_die_1 (struct ui_file *, int level, int max_level,
+ struct die_info *);
+
+/*static*/ void dump_die (struct die_info *, int max_level);
static void store_in_ref_table (struct die_info *,
struct dwarf2_cu *);
-static unsigned int dwarf2_get_ref_die_offset (struct attribute *,
- struct dwarf2_cu *);
+static unsigned int dwarf2_get_ref_die_offset (struct attribute *);
static int dwarf2_get_attr_constant_value (struct attribute *, int);
@@ -1039,10 +1065,10 @@ static hashval_t partial_die_hash (const void *item);
static int partial_die_eq (const void *item_lhs, const void *item_rhs);
static struct dwarf2_per_cu_data *dwarf2_find_containing_comp_unit
- (unsigned long offset, struct objfile *objfile);
+ (unsigned int offset, struct objfile *objfile);
static struct dwarf2_per_cu_data *dwarf2_find_comp_unit
- (unsigned long offset, struct objfile *objfile);
+ (unsigned int offset, struct objfile *objfile);
static void free_one_comp_unit (void *);
@@ -1294,11 +1320,9 @@ dwarf2_build_psymtabs_easy (struct objfile *objfile, int mainline)
pubnames_ptr = pubnames_buffer;
while ((pubnames_ptr - pubnames_buffer) < dwarf2_per_objfile->pubnames_size)
{
- struct comp_unit_head cu_header;
unsigned int bytes_read;
- entry_length = read_initial_length (abfd, pubnames_ptr, &cu_header,
- &bytes_read);
+ entry_length = read_initial_length (abfd, pubnames_ptr, &bytes_read);
pubnames_ptr += bytes_read;
version = read_1_byte (abfd, pubnames_ptr);
pubnames_ptr += 1;
@@ -1314,6 +1338,18 @@ dwarf2_build_psymtabs_easy (struct objfile *objfile, int mainline)
}
#endif
+/* Return TRUE if OFFSET is within CU_HEADER. */
+
+static inline int
+offset_in_cu_p (const struct comp_unit_head *cu_header, unsigned int offset)
+{
+ unsigned int bottom = cu_header->offset;
+ unsigned int top = (cu_header->offset
+ + cu_header->length
+ + cu_header->initial_length_size);
+ return (offset >= bottom && offset < top);
+}
+
/* Read in the comp unit header information from the debug_info at
info_ptr. */
@@ -1323,13 +1359,15 @@ read_comp_unit_head (struct comp_unit_head *cu_header,
{
int signed_addr;
unsigned int bytes_read;
- cu_header->length = read_initial_length (abfd, info_ptr, cu_header,
- &bytes_read);
+
+ cu_header->length = read_initial_length (abfd, info_ptr, &bytes_read);
+ cu_header->initial_length_size = bytes_read;
+ cu_header->offset_size = (bytes_read == 4) ? 4 : 8;
info_ptr += bytes_read;
cu_header->version = read_2_bytes (abfd, info_ptr);
info_ptr += 2;
cu_header->abbrev_offset = read_offset (abfd, info_ptr, cu_header,
- &bytes_read);
+ &bytes_read);
info_ptr += bytes_read;
cu_header->addr_size = read_1_byte (abfd, info_ptr);
info_ptr += 1;
@@ -1338,6 +1376,7 @@ read_comp_unit_head (struct comp_unit_head *cu_header,
internal_error (__FILE__, __LINE__,
_("read_comp_unit_head: dwarf from non elf file"));
cu_header->signed_addr_p = signed_addr;
+
return info_ptr;
}
@@ -1708,26 +1747,24 @@ create_all_comp_units (struct objfile *objfile)
while (info_ptr < dwarf2_per_objfile->info_buffer + dwarf2_per_objfile->info_size)
{
- struct comp_unit_head cu_header;
+ unsigned int length, initial_length_size;
gdb_byte *beg_of_comp_unit;
struct dwarf2_per_cu_data *this_cu;
- unsigned long offset;
- unsigned int bytes_read;
+ unsigned int offset;
offset = info_ptr - dwarf2_per_objfile->info_buffer;
/* Read just enough information to find out where the next
compilation unit is. */
- cu_header.initial_length_size = 0;
- cu_header.length = read_initial_length (objfile->obfd, info_ptr,
- &cu_header, &bytes_read);
+ length = read_initial_length (objfile->obfd, info_ptr,
+ &initial_length_size);
/* Save the compilation unit for later lookup. */
this_cu = obstack_alloc (&objfile->objfile_obstack,
sizeof (struct dwarf2_per_cu_data));
memset (this_cu, 0, sizeof (*this_cu));
this_cu->offset = offset;
- this_cu->length = cu_header.length + cu_header.initial_length_size;
+ this_cu->length = length + initial_length_size;
if (n_comp_units == n_allocated)
{
@@ -2331,7 +2368,7 @@ skip_one_die (gdb_byte *info_ptr, struct abbrev_info *abbrev,
complaint (&symfile_complaints, _("ignoring absolute DW_AT_sibling"));
else
return dwarf2_per_objfile->info_buffer
- + dwarf2_get_ref_die_offset (&attr, cu);
+ + dwarf2_get_ref_die_offset (&attr);
}
/* If it isn't DW_AT_sibling, skip this attribute. */
@@ -2594,7 +2631,7 @@ load_full_comp_unit (struct dwarf2_per_cu_data *per_cu, struct objfile *objfile)
{
bfd *abfd = objfile->obfd;
struct dwarf2_cu *cu;
- unsigned long offset;
+ unsigned int offset;
gdb_byte *info_ptr;
struct cleanup *back_to, *free_cu_cleanup;
struct attribute *attr;
@@ -3561,7 +3598,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
/* Get type of field. */
fp->type = die_type (die, cu);
- FIELD_STATIC_KIND (*fp) = 0;
+ SET_FIELD_BITPOS (*fp, 0);
/* Get bit size of field (zero if none). */
attr = dwarf2_attr (die, DW_AT_bit_size, cu);
@@ -3590,10 +3627,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
else
byte_offset = decode_locdesc (DW_BLOCK (attr), cu);
- FIELD_BITPOS (*fp) = byte_offset * bits_per_byte;
+ SET_FIELD_BITPOS (*fp, byte_offset * bits_per_byte);
}
- else
- FIELD_BITPOS (*fp) = 0;
attr = dwarf2_attr (die, DW_AT_bit_offset, cu);
if (attr)
{
@@ -3685,10 +3720,9 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
/* C++ base class field. */
attr = dwarf2_attr (die, DW_AT_data_member_location, cu);
if (attr)
- FIELD_BITPOS (*fp) = (decode_locdesc (DW_BLOCK (attr), cu)
- * bits_per_byte);
+ SET_FIELD_BITPOS (*fp, decode_locdesc (DW_BLOCK (attr), cu)
+ * bits_per_byte);
FIELD_BITSIZE (*fp) = 0;
- FIELD_STATIC_KIND (*fp) = 0;
FIELD_TYPE (*fp) = die_type (die, cu);
FIELD_NAME (*fp) = type_name_no_tag (fp->type);
fip->nbaseclasses++;
@@ -4406,9 +4440,8 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu)
FIELD_NAME (fields[num_fields]) = SYMBOL_LINKAGE_NAME (sym);
FIELD_TYPE (fields[num_fields]) = NULL;
- FIELD_BITPOS (fields[num_fields]) = SYMBOL_VALUE (sym);
+ SET_FIELD_BITPOS (fields[num_fields], SYMBOL_VALUE (sym));
FIELD_BITSIZE (fields[num_fields]) = 0;
- FIELD_STATIC_KIND (fields[num_fields]) = 0;
num_fields++;
}
@@ -5193,6 +5226,27 @@ read_comp_unit (gdb_byte *info_ptr, bfd *abfd, struct dwarf2_cu *cu)
return read_die_and_children (info_ptr, abfd, cu, &info_ptr, NULL);
}
+/* Main entry point for reading a DIE and all children.
+ Read the DIE and dump it if requested. */
+
+static struct die_info *
+read_die_and_children (gdb_byte *info_ptr, bfd *abfd,
+ struct dwarf2_cu *cu,
+ gdb_byte **new_info_ptr,
+ struct die_info *parent)
+{
+ struct die_info *result = read_die_and_children_1 (info_ptr, abfd, cu,
+ new_info_ptr, parent);
+
+ if (dwarf2_die_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog, "Read die from .debug_info:\n");
+ dump_die (result, dwarf2_die_debug);
+ }
+
+ return result;
+}
+
/* Read a single die and all its descendents. Set the die's sibling
field to NULL; set other fields in the die correctly, and set all
of the descendents' fields correctly. Set *NEW_INFO_PTR to the
@@ -5200,10 +5254,10 @@ read_comp_unit (gdb_byte *info_ptr, bfd *abfd, struct dwarf2_cu *cu)
is the parent of the die in question. */
static struct die_info *
-read_die_and_children (gdb_byte *info_ptr, bfd *abfd,
- struct dwarf2_cu *cu,
- gdb_byte **new_info_ptr,
- struct die_info *parent)
+read_die_and_children_1 (gdb_byte *info_ptr, bfd *abfd,
+ struct dwarf2_cu *cu,
+ gdb_byte **new_info_ptr,
+ struct die_info *parent)
{
struct die_info *die;
gdb_byte *cur_ptr;
@@ -5252,7 +5306,7 @@ read_die_and_siblings (gdb_byte *info_ptr, bfd *abfd,
while (1)
{
struct die_info *die
- = read_die_and_children (cur_ptr, abfd, cu, &cur_ptr, parent);
+ = read_die_and_children_1 (cur_ptr, abfd, cu, &cur_ptr, parent);
if (die == NULL)
{
@@ -5902,7 +5956,7 @@ read_partial_die (struct partial_die_info *part_die,
case DW_AT_specification:
case DW_AT_extension:
part_die->has_specification = 1;
- part_die->spec_offset = dwarf2_get_ref_die_offset (&attr, cu);
+ part_die->spec_offset = dwarf2_get_ref_die_offset (&attr);
break;
case DW_AT_sibling:
/* Ignore absolute siblings, they might point outside of
@@ -5911,7 +5965,7 @@ read_partial_die (struct partial_die_info *part_die,
complaint (&symfile_complaints, _("ignoring absolute DW_AT_sibling"));
else
part_die->sibling = dwarf2_per_objfile->info_buffer
- + dwarf2_get_ref_die_offset (&attr, cu);
+ + dwarf2_get_ref_die_offset (&attr);
break;
case DW_AT_stmt_list:
part_die->has_stmt_list = 1;
@@ -5971,7 +6025,7 @@ read_partial_die (struct partial_die_info *part_die,
/* Find a cached partial DIE at OFFSET in CU. */
static struct partial_die_info *
-find_partial_die_in_comp_unit (unsigned long offset, struct dwarf2_cu *cu)
+find_partial_die_in_comp_unit (unsigned int offset, struct dwarf2_cu *cu)
{
struct partial_die_info *lookup_die = NULL;
struct partial_die_info part_die;
@@ -5985,13 +6039,12 @@ find_partial_die_in_comp_unit (unsigned long offset, struct dwarf2_cu *cu)
/* Find a partial DIE at OFFSET, which may or may not be in CU. */
static struct partial_die_info *
-find_partial_die (unsigned long offset, struct dwarf2_cu *cu)
+find_partial_die (unsigned int offset, struct dwarf2_cu *cu)
{
struct dwarf2_per_cu_data *per_cu = NULL;
struct partial_die_info *pd = NULL;
- if (offset >= cu->header.offset
- && offset < cu->header.offset + cu->header.length)
+ if (offset_in_cu_p (&cu->header, offset))
{
pd = find_partial_die_in_comp_unit (offset, cu);
if (pd != NULL)
@@ -6043,7 +6096,7 @@ find_partial_die (unsigned long offset, struct dwarf2_cu *cu)
if (pd == NULL)
internal_error (__FILE__, __LINE__,
- _("could not find partial DIE 0x%lx in cache [from module %s]\n"),
+ _("could not find partial DIE 0x%x in cache [from module %s]\n"),
offset, bfd_get_filename (cu->objfile->obfd));
return pd;
}
@@ -6401,12 +6454,7 @@ read_address (bfd *abfd, gdb_byte *buf, struct dwarf2_cu *cu,
The value returned via bytes_read should be used to increment the
relevant pointer after calling read_initial_length().
-
- As a side effect, this function sets the fields initial_length_size
- and offset_size in cu_header to the values appropriate for the
- length field. (The format of the initial length field determines
- the width of file offsets to be fetched later with read_offset().)
-
+
[ Note: read_initial_length() and read_offset() are based on the
document entitled "DWARF Debugging Information Format", revision
3, draft 8, dated November 19, 2001. This document was obtained
@@ -6424,8 +6472,7 @@ read_address (bfd *abfd, gdb_byte *buf, struct dwarf2_cu *cu,
] */
static LONGEST
-read_initial_length (bfd *abfd, gdb_byte *buf, struct comp_unit_head *cu_header,
- unsigned int *bytes_read)
+read_initial_length (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read)
{
LONGEST length = bfd_get_32 (abfd, buf);
@@ -6445,22 +6492,34 @@ read_initial_length (bfd *abfd, gdb_byte *buf, struct comp_unit_head *cu_header,
*bytes_read = 4;
}
- if (cu_header)
- {
- gdb_assert (cu_header->initial_length_size == 0
- || cu_header->initial_length_size == 4
- || cu_header->initial_length_size == 8
- || cu_header->initial_length_size == 12);
+ return length;
+}
- if (cu_header->initial_length_size != 0
- && cu_header->initial_length_size != *bytes_read)
- complaint (&symfile_complaints,
- _("intermixed 32-bit and 64-bit DWARF sections"));
+/* Cover function for read_initial_length.
+ Returns the length of the object at BUF, and stores the size of the
+ initial length in *BYTES_READ and stores the size that offsets will be in
+ *OFFSET_SIZE.
+ If the initial length size is not equivalent to that specified in
+ CU_HEADER then issue a complaint.
+ This is useful when reading non-comp-unit headers. */
- cu_header->initial_length_size = *bytes_read;
- cu_header->offset_size = (*bytes_read == 4) ? 4 : 8;
- }
+static LONGEST
+read_checked_initial_length_and_offset (bfd *abfd, gdb_byte *buf,
+ const struct comp_unit_head *cu_header,
+ unsigned int *bytes_read,
+ unsigned int *offset_size)
+{
+ LONGEST length = read_initial_length (abfd, buf, bytes_read);
+ gdb_assert (cu_header->initial_length_size == 4
+ || cu_header->initial_length_size == 8
+ || cu_header->initial_length_size == 12);
+
+ if (cu_header->initial_length_size != *bytes_read)
+ complaint (&symfile_complaints,
+ _("intermixed 32-bit and 64-bit DWARF sections"));
+
+ *offset_size = (*bytes_read == 4) ? 4 : 8;
return length;
}
@@ -6471,21 +6530,29 @@ static LONGEST
read_offset (bfd *abfd, gdb_byte *buf, const struct comp_unit_head *cu_header,
unsigned int *bytes_read)
{
+ LONGEST offset = read_offset_1 (abfd, buf, cu_header->offset_size);
+ *bytes_read = cu_header->offset_size;
+ return offset;
+}
+
+/* Read an offset from the data stream. */
+
+static LONGEST
+read_offset_1 (bfd *abfd, gdb_byte *buf, unsigned int offset_size)
+{
LONGEST retval = 0;
- switch (cu_header->offset_size)
+ switch (offset_size)
{
case 4:
retval = bfd_get_32 (abfd, buf);
- *bytes_read = 4;
break;
case 8:
retval = bfd_get_64 (abfd, buf);
- *bytes_read = 8;
break;
default:
internal_error (__FILE__, __LINE__,
- _("read_offset: bad switch [in module %s]"),
+ _("read_offset_1: bad switch [in module %s]"),
bfd_get_filename (abfd));
}
@@ -6523,8 +6590,7 @@ read_indirect_string (bfd *abfd, gdb_byte *buf,
const struct comp_unit_head *cu_header,
unsigned int *bytes_read_ptr)
{
- LONGEST str_offset = read_offset (abfd, buf, cu_header,
- bytes_read_ptr);
+ LONGEST str_offset = read_offset (abfd, buf, cu_header, bytes_read_ptr);
if (dwarf2_per_objfile->str_buffer == NULL)
{
@@ -6823,7 +6889,7 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd,
struct cleanup *back_to;
struct line_header *lh;
gdb_byte *line_ptr;
- unsigned int bytes_read;
+ unsigned int bytes_read, offset_size;
int i;
char *cur_dir, *cur_file;
@@ -6850,7 +6916,8 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd,
/* Read in the header. */
lh->total_length =
- read_initial_length (abfd, line_ptr, &cu->header, &bytes_read);
+ read_checked_initial_length_and_offset (abfd, line_ptr, &cu->header,
+ &bytes_read, &offset_size);
line_ptr += bytes_read;
if (line_ptr + lh->total_length > (dwarf2_per_objfile->line_buffer
+ dwarf2_per_objfile->line_size))
@@ -6861,8 +6928,8 @@ dwarf_decode_line_header (unsigned int offset, bfd *abfd,
lh->statement_program_end = line_ptr + lh->total_length;
lh->version = read_2_bytes (abfd, line_ptr);
line_ptr += 2;
- lh->header_length = read_offset (abfd, line_ptr, &cu->header, &bytes_read);
- line_ptr += bytes_read;
+ lh->header_length = read_offset_1 (abfd, line_ptr, offset_size);
+ line_ptr += offset_size;
lh->minimum_instruction_length = read_1_byte (abfd, line_ptr);
line_ptr += 1;
lh->default_is_stmt = read_1_byte (abfd, line_ptr);
@@ -7032,6 +7099,11 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
{
op_code = read_1_byte (abfd, line_ptr);
line_ptr += 1;
+ if (line_ptr > line_end)
+ {
+ dwarf2_debug_line_missing_end_sequence_complaint ();
+ break;
+ }
if (op_code >= lh->opcode_base)
{
@@ -7040,7 +7112,7 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
address += (adj_opcode / lh->line_range)
* lh->minimum_instruction_length;
line += lh->line_base + (adj_opcode % lh->line_range);
- if (lh->num_file_names < file)
+ if (lh->num_file_names < file || file == 0)
dwarf2_debug_line_missing_file_complaint ();
else
{
@@ -7072,15 +7144,6 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
{
case DW_LNE_end_sequence:
end_sequence = 1;
-
- if (lh->num_file_names < file)
- dwarf2_debug_line_missing_file_complaint ();
- else
- {
- lh->file_names[file - 1].included_p = 1;
- if (!decode_for_pst_p)
- record_line (current_subfile, 0, address);
- }
break;
case DW_LNE_set_address:
address = read_address (abfd, line_ptr, cu, &bytes_read);
@@ -7122,7 +7185,7 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
}
break;
case DW_LNS_copy:
- if (lh->num_file_names < file)
+ if (lh->num_file_names < file || file == 0)
dwarf2_debug_line_missing_file_complaint ();
else
{
@@ -7160,7 +7223,7 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
line_ptr += bytes_read;
- if (lh->num_file_names < file)
+ if (lh->num_file_names < file || file == 0)
dwarf2_debug_line_missing_file_complaint ();
else
{
@@ -7211,6 +7274,14 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
}
}
}
+ if (lh->num_file_names < file || file == 0)
+ dwarf2_debug_line_missing_file_complaint ();
+ else
+ {
+ lh->file_names[file - 1].included_p = 1;
+ if (!decode_for_pst_p)
+ record_line (current_subfile, 0, address);
+ }
}
if (decode_for_pst_p)
@@ -7798,7 +7869,7 @@ die_type (struct die_info *die, struct dwarf2_cu *cu)
type = tag_type_to_type (type_die, cu);
if (!type)
{
- dump_die (type_die);
+ dump_die_for_error (type_die);
error (_("Dwarf Error: Problem turning type die at offset into gdb type [in module %s]"),
cu->objfile->name);
}
@@ -7824,7 +7895,7 @@ die_containing_type (struct die_info *die, struct dwarf2_cu *cu)
if (!type)
{
if (type_die)
- dump_die (type_die);
+ dump_die_for_error (type_die);
error (_("Dwarf Error: Problem turning containing type into gdb type [in module %s]"),
cu->objfile->name);
}
@@ -7839,7 +7910,7 @@ tag_type_to_type (struct die_info *die, struct dwarf2_cu *cu)
this_type = read_type_die (die, cu);
if (!this_type)
{
- dump_die (die);
+ dump_die_for_error (die);
error (_("Dwarf Error: Cannot find type of die [in module %s]"),
cu->objfile->name);
}
@@ -8021,19 +8092,17 @@ typename_concat (struct obstack *obs, const char *prefix, const char *suffix,
else
sep = "::";
+ if (prefix == NULL)
+ prefix = "";
+ if (suffix == NULL)
+ suffix = "";
+
if (obs == NULL)
{
char *retval = xmalloc (strlen (prefix) + MAX_SEP_LEN + strlen (suffix) + 1);
- retval[0] = '\0';
-
- if (prefix)
- {
- strcpy (retval, prefix);
- strcat (retval, sep);
- }
- if (suffix)
- strcat (retval, suffix);
-
+ strcpy (retval, prefix);
+ strcat (retval, sep);
+ strcat (retval, suffix);
return retval;
}
else
@@ -8434,10 +8503,11 @@ dwarf_attr_name (unsigned attr)
return "DW_AT_pure";
case DW_AT_recursive:
return "DW_AT_recursive";
-#ifdef MIPS
/* SGI/MIPS extensions. */
+#ifdef MIPS /* collides with DW_AT_HP_block_index */
case DW_AT_MIPS_fde:
return "DW_AT_MIPS_fde";
+#endif
case DW_AT_MIPS_loop_begin:
return "DW_AT_MIPS_loop_begin";
case DW_AT_MIPS_tail_loop_begin:
@@ -8458,10 +8528,11 @@ dwarf_attr_name (unsigned attr)
return "DW_AT_MIPS_clone_origin";
case DW_AT_MIPS_has_inlines:
return "DW_AT_MIPS_has_inlines";
-#endif
/* HP extensions. */
+#ifndef MIPS /* collides with DW_AT_MIPS_fde */
case DW_AT_HP_block_index:
return "DW_AT_HP_block_index";
+#endif
case DW_AT_HP_unmodifiable:
return "DW_AT_HP_unmodifiable";
case DW_AT_HP_actuals_stmt_list:
@@ -9057,38 +9128,52 @@ dwarf_cfi_name (unsigned cfi_opc)
#endif
static void
-dump_die (struct die_info *die)
+dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
{
unsigned int i;
- fprintf_unfiltered (gdb_stderr, "Die: %s (abbrev = %d, offset = %d)\n",
+ print_spaces (indent, f);
+ fprintf_unfiltered (f, "Die: %s (abbrev %d, offset 0x%x)\n",
dwarf_tag_name (die->tag), die->abbrev, die->offset);
- fprintf_unfiltered (gdb_stderr, "\thas children: %s\n",
+
+ if (die->parent != NULL)
+ {
+ print_spaces (indent, f);
+ fprintf_unfiltered (f, " parent at offset: 0x%x\n",
+ die->parent->offset);
+ }
+
+ print_spaces (indent, f);
+ fprintf_unfiltered (f, " has children: %s\n",
dwarf_bool_name (die->child != NULL));
- fprintf_unfiltered (gdb_stderr, "\tattributes:\n");
+ print_spaces (indent, f);
+ fprintf_unfiltered (f, " attributes:\n");
+
for (i = 0; i < die->num_attrs; ++i)
{
- fprintf_unfiltered (gdb_stderr, "\t\t%s (%s) ",
+ print_spaces (indent, f);
+ fprintf_unfiltered (f, " %s (%s) ",
dwarf_attr_name (die->attrs[i].name),
dwarf_form_name (die->attrs[i].form));
+
switch (die->attrs[i].form)
{
case DW_FORM_ref_addr:
case DW_FORM_addr:
- fprintf_unfiltered (gdb_stderr, "address: ");
- fputs_filtered (paddress (DW_ADDR (&die->attrs[i])), gdb_stderr);
+ fprintf_unfiltered (f, "address: ");
+ fputs_filtered (paddress (DW_ADDR (&die->attrs[i])), f);
break;
case DW_FORM_block2:
case DW_FORM_block4:
case DW_FORM_block:
case DW_FORM_block1:
- fprintf_unfiltered (gdb_stderr, "block: size %d", DW_BLOCK (&die->attrs[i])->size);
+ fprintf_unfiltered (f, "block: size %d", DW_BLOCK (&die->attrs[i])->size);
break;
case DW_FORM_ref1:
case DW_FORM_ref2:
case DW_FORM_ref4:
- fprintf_unfiltered (gdb_stderr, "constant ref: %ld (adjusted)",
+ fprintf_unfiltered (f, "constant ref: 0x%lx (adjusted)",
(long) (DW_ADDR (&die->attrs[i])));
break;
case DW_FORM_data1:
@@ -9097,46 +9182,82 @@ dump_die (struct die_info *die)
case DW_FORM_data8:
case DW_FORM_udata:
case DW_FORM_sdata:
- fprintf_unfiltered (gdb_stderr, "constant: %ld", DW_UNSND (&die->attrs[i]));
+ fprintf_unfiltered (f, "constant: %ld", DW_UNSND (&die->attrs[i]));
break;
case DW_FORM_string:
case DW_FORM_strp:
- fprintf_unfiltered (gdb_stderr, "string: \"%s\"",
+ fprintf_unfiltered (f, "string: \"%s\"",
DW_STRING (&die->attrs[i])
? DW_STRING (&die->attrs[i]) : "");
break;
case DW_FORM_flag:
if (DW_UNSND (&die->attrs[i]))
- fprintf_unfiltered (gdb_stderr, "flag: TRUE");
+ fprintf_unfiltered (f, "flag: TRUE");
else
- fprintf_unfiltered (gdb_stderr, "flag: FALSE");
+ fprintf_unfiltered (f, "flag: FALSE");
break;
case DW_FORM_indirect:
/* the reader will have reduced the indirect form to
the "base form" so this form should not occur */
- fprintf_unfiltered (gdb_stderr, "unexpected attribute form: DW_FORM_indirect");
+ fprintf_unfiltered (f, "unexpected attribute form: DW_FORM_indirect");
break;
default:
- fprintf_unfiltered (gdb_stderr, "unsupported attribute form: %d.",
+ fprintf_unfiltered (f, "unsupported attribute form: %d.",
die->attrs[i].form);
+ break;
}
- fprintf_unfiltered (gdb_stderr, "\n");
+ fprintf_unfiltered (f, "\n");
}
}
static void
-dump_die_list (struct die_info *die)
+dump_die_for_error (struct die_info *die)
{
- while (die)
+ dump_die_shallow (gdb_stderr, 0, die);
+}
+
+static void
+dump_die_1 (struct ui_file *f, int level, int max_level, struct die_info *die)
+{
+ int indent = level * 4;
+
+ gdb_assert (die != NULL);
+
+ if (level >= max_level)
+ return;
+
+ dump_die_shallow (f, indent, die);
+
+ if (die->child != NULL)
+ {
+ print_spaces (indent, f);
+ fprintf_unfiltered (f, " Children:");
+ if (level + 1 < max_level)
+ {
+ fprintf_unfiltered (f, "\n");
+ dump_die_1 (f, level + 1, max_level, die->child);
+ }
+ else
+ {
+ fprintf_unfiltered (f, " [not printed, max nesting level reached]\n");
+ }
+ }
+
+ if (die->sibling != NULL && level > 0)
{
- dump_die (die);
- if (die->child != NULL)
- dump_die_list (die->child);
- if (die->sibling != NULL)
- dump_die_list (die->sibling);
+ dump_die_1 (f, level, max_level, die->sibling);
}
}
+/* This is called from the pdie macro in gdbinit.in.
+ It's not static so gcc will keep a copy callable from gdb. */
+
+void
+dump_die (struct die_info *die, int max_level)
+{
+ dump_die_1 (gdb_stdlog, 0, max_level, die);
+}
+
static void
store_in_ref_table (struct die_info *die, struct dwarf2_cu *cu)
{
@@ -9148,7 +9269,7 @@ store_in_ref_table (struct die_info *die, struct dwarf2_cu *cu)
}
static unsigned int
-dwarf2_get_ref_die_offset (struct attribute *attr, struct dwarf2_cu *cu)
+dwarf2_get_ref_die_offset (struct attribute *attr)
{
unsigned int result = 0;
@@ -9228,14 +9349,12 @@ follow_die_ref (struct die_info *src_die, struct attribute *attr,
struct die_info temp_die;
struct dwarf2_cu *target_cu, *cu = *ref_cu;
- offset = dwarf2_get_ref_die_offset (attr, cu);
+ offset = dwarf2_get_ref_die_offset (attr);
- if (DW_ADDR (attr) < cu->header.offset
- || DW_ADDR (attr) >= cu->header.offset + cu->header.length)
+ if (! offset_in_cu_p (&cu->header, offset))
{
struct dwarf2_per_cu_data *per_cu;
- per_cu = dwarf2_find_containing_comp_unit (DW_ADDR (attr),
- cu->objfile);
+ per_cu = dwarf2_find_containing_comp_unit (offset, cu->objfile);
/* If necessary, add it to the queue and load its DIEs. */
maybe_queue_comp_unit (cu, per_cu);
@@ -10071,7 +10190,7 @@ dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *per_cu)
DIE at OFFSET. Raises an error on failure. */
static struct dwarf2_per_cu_data *
-dwarf2_find_containing_comp_unit (unsigned long offset,
+dwarf2_find_containing_comp_unit (unsigned int offset,
struct objfile *objfile)
{
struct dwarf2_per_cu_data *this_cu;
@@ -10103,7 +10222,7 @@ dwarf2_find_containing_comp_unit (unsigned long offset,
this_cu = dwarf2_per_objfile->all_comp_units[low];
if (low == dwarf2_per_objfile->n_comp_units - 1
&& offset >= this_cu->offset + this_cu->length)
- error (_("invalid dwarf2 offset %ld"), offset);
+ error (_("invalid dwarf2 offset %u"), offset);
gdb_assert (offset < this_cu->offset + this_cu->length);
return this_cu;
}
@@ -10113,12 +10232,12 @@ dwarf2_find_containing_comp_unit (unsigned long offset,
OFFSET. Raises an error on failure. */
static struct dwarf2_per_cu_data *
-dwarf2_find_comp_unit (unsigned long offset, struct objfile *objfile)
+dwarf2_find_comp_unit (unsigned int offset, struct objfile *objfile)
{
struct dwarf2_per_cu_data *this_cu;
this_cu = dwarf2_find_containing_comp_unit (offset, objfile);
if (this_cu->offset != offset)
- error (_("no compilation unit with offset %ld."), offset);
+ error (_("no compilation unit with offset %u."), offset);
return this_cu;
}
@@ -10480,4 +10599,13 @@ caching, which can slow down startup."),
show_dwarf2_max_cache_age,
&set_dwarf2_cmdlist,
&show_dwarf2_cmdlist);
+
+ add_setshow_zinteger_cmd ("dwarf2-die", no_class, &dwarf2_die_debug, _("\
+Set debugging of the dwarf2 DIE reader."), _("\
+Show debugging of the dwarf2 DIE reader."), _("\
+When enabled (non-zero), DIEs are dumped after they are read in.\n\
+The value is the maximum depth to print."),
+ NULL,
+ NULL,
+ &setdebuglist, &showdebuglist);
}
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 17f86ba..22f4e5d 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -172,7 +172,7 @@ record_minimal_symbol (char *name, CORE_ADDR address,
address = gdbarch_smash_text_address (gdbarch, address);
return prim_record_minimal_symbol_and_info
- (name, address, ms_type, NULL, bfd_section->index, bfd_section, objfile);
+ (name, address, ms_type, bfd_section->index, bfd_section, objfile);
}
/*
diff --git a/gdb/eval.c b/gdb/eval.c
index 3366a06..ccb6b742 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -39,16 +39,13 @@
#include "exceptions.h"
#include "regcache.h"
#include "user-regs.h"
+#include "valprint.h"
#include "gdb_assert.h"
/* This is defined in valops.c */
extern int overload_resolution;
-/* JYG: lookup rtti type of STRUCTOP_PTR when this is set to continue
- on with successful lookup for member/method of the rtti type. */
-extern int objectprint;
-
/* Prototypes for local functions. */
static struct value *evaluate_subexp_for_sizeof (struct expression *, int *);
@@ -319,7 +316,8 @@ evaluate_struct_tuple (struct value *struct_val,
fieldno++;
/* Skip static fields. */
while (fieldno < TYPE_NFIELDS (struct_type)
- && TYPE_FIELD_STATIC_KIND (struct_type, fieldno))
+ && field_is_static (&TYPE_FIELD (struct_type,
+ fieldno)))
fieldno++;
subfieldno = fieldno;
if (fieldno >= TYPE_NFIELDS (struct_type))
@@ -1627,8 +1625,10 @@ evaluate_subexp_standard (struct type *expect_type,
struct type *type = value_type (arg1);
struct type *real_type;
int full, top, using_enc;
-
- if (objectprint && TYPE_TARGET_TYPE(type) &&
+ struct value_print_options opts;
+
+ get_user_print_options (&opts);
+ if (opts.objectprint && TYPE_TARGET_TYPE(type) &&
(TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
{
real_type = value_rtti_target_type (arg1, &full, &top, &using_enc);
@@ -1976,6 +1976,8 @@ evaluate_subexp_standard (struct type *expect_type,
if (nargs != ndimensions)
error (_("Wrong number of subscripts"));
+ gdb_assert (nargs > 0);
+
/* Now that we know we have a legal array subscript expression
let us actually find out where this element exists in the array. */
@@ -1994,13 +1996,8 @@ evaluate_subexp_standard (struct type *expect_type,
/* Internal type of array is arranged right to left */
for (i = 0; i < nargs; i++)
{
- retcode = f77_get_dynamic_upperbound (tmp_type, &upper);
- if (retcode == BOUND_FETCH_ERROR)
- error (_("Cannot obtain dynamic upper bound"));
-
- retcode = f77_get_dynamic_lowerbound (tmp_type, &lower);
- if (retcode == BOUND_FETCH_ERROR)
- error (_("Cannot obtain dynamic lower bound"));
+ upper = f77_get_upperbound (tmp_type);
+ lower = f77_get_lowerbound (tmp_type);
array_size_array[nargs - i - 1] = upper - lower + 1;
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index b36fefa..e9f2959 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -38,25 +38,40 @@
#include "gdb_assert.h"
#include "gdb_select.h"
+/* Data point to pass to the event handler. */
+typedef union event_data
+{
+ void *ptr;
+ int integer;
+} event_data;
+
typedef struct gdb_event gdb_event;
-typedef void (event_handler_func) (int);
+typedef void (event_handler_func) (event_data);
/* Event for the GDB event system. Events are queued by calling
async_queue_event and serviced later on by gdb_do_one_event. An
event can be, for instance, a file descriptor becoming ready to be
- read. Servicing an event simply means that the procedure PROC will
+ read. Servicing an event simply means that the procedure PROC will
be called. We have 2 queues, one for file handlers that we listen
to in the event loop, and one for the file handlers+events that are
- ready. The procedure PROC associated with each event is always the
- same (handle_file_event). Its duty is to invoke the handler
- associated with the file descriptor whose state change generated
- the event, plus doing other cleanups and such. */
+ ready. The procedure PROC associated with each event is dependant
+ of the event source. In the case of monitored file descriptors, it
+ is always the same (handle_file_event). Its duty is to invoke the
+ handler associated with the file descriptor whose state change
+ generated the event, plus doing other cleanups and such. In the
+ case of async signal handlers, it is
+ invoke_async_signal_handler. */
struct gdb_event
{
- event_handler_func *proc; /* Procedure to call to service this event. */
- int fd; /* File descriptor that is ready. */
- struct gdb_event *next_event; /* Next in list of events or NULL. */
+ /* Procedure to call to service this event. */
+ event_handler_func *proc;
+
+ /* Data to pass to the event handler. */
+ event_data data;
+
+ /* Next in list of events or NULL. */
+ struct gdb_event *next_event;
};
/* Information about each file descriptor we register with the event
@@ -82,7 +97,7 @@ file_handler;
be carried out by PROC at a later time, within process_event. This
provides a deferred execution of signal handlers.
Async_init_signals takes care of setting up such an
- asyn_signal_handler for each interesting signal. */
+ async_signal_handler for each interesting signal. */
typedef struct async_signal_handler
{
int ready; /* If ready, call this handler from the main event loop,
@@ -93,6 +108,29 @@ typedef struct async_signal_handler
}
async_signal_handler;
+/* PROC is a function to be invoked when the READY flag is set. This
+ happens when the event has been marked with
+ MARK_ASYNC_EVENT_HANDLER. The actual work to be done in response
+ to an event will be carried out by PROC at a later time, within
+ process_event. This provides a deferred execution of event
+ handlers. */
+typedef struct async_event_handler
+ {
+ /* If ready, call this handler from the main event loop, using
+ invoke_event_handler. */
+ int ready;
+
+ /* Point to next handler. */
+ struct async_event_handler *next_handler;
+
+ /* Function to call to do the work. */
+ async_event_handler_func *proc;
+
+ /* Argument to PROC. */
+ gdb_client_data client_data;
+ }
+async_event_handler;
+
/* Event queue:
- the first event in the queue is the head of the queue.
@@ -207,21 +245,25 @@ static struct
}
sighandler_list;
-/* Are any of the handlers ready? Check this variable using
- check_async_ready. This is used by process_event, to determine
- whether or not to invoke the invoke_async_signal_handler
- function. */
-static int async_handler_ready = 0;
-
-static void create_file_handler (int fd, int mask, handler_func * proc, gdb_client_data client_data);
-static void invoke_async_signal_handler (void);
-static void handle_file_event (int event_file_desc);
-static int gdb_wait_for_event (void);
-static int check_async_ready (void);
-static void async_queue_event (gdb_event * event_ptr, queue_position position);
-static gdb_event *create_file_event (int fd);
-static int process_event (void);
-static void handle_timer_event (int dummy);
+/* All the async_event_handlers gdb is interested in are kept onto
+ this list. */
+static struct
+ {
+ /* Pointer to first in handler list. */
+ async_event_handler *first_handler;
+
+ /* Pointer to last in handler list. */
+ async_event_handler *last_handler;
+ }
+async_event_handler_list;
+
+static int invoke_async_signal_handlers (void);
+static void create_file_handler (int fd, int mask, handler_func *proc,
+ gdb_client_data client_data);
+static void handle_file_event (event_data data);
+static void check_async_event_handlers (void);
+static void check_async_signal_handlers (void);
+static int gdb_wait_for_event (int);
static void poll_timers (void);
@@ -260,6 +302,22 @@ async_queue_event (gdb_event * event_ptr, queue_position position)
}
}
+/* Create a generic event, to be enqueued in the event queue for
+ processing. PROC is the procedure associated to the event. DATA
+ is passed to PROC upon PROC invocation. */
+
+static gdb_event *
+create_event (event_handler_func proc, event_data data)
+{
+ gdb_event *event;
+
+ event = xmalloc (sizeof (*event));
+ event->proc = proc;
+ event->data = data;
+
+ return event;
+}
+
/* Create a file event, to be enqueued in the event queue for
processing. The procedure associated to this event is always
handle_file_event, which will in turn invoke the one that was
@@ -267,12 +325,10 @@ async_queue_event (gdb_event * event_ptr, queue_position position)
static gdb_event *
create_file_event (int fd)
{
- gdb_event *file_event_ptr;
+ event_data data;
- file_event_ptr = (gdb_event *) xmalloc (sizeof (gdb_event));
- file_event_ptr->proc = handle_file_event;
- file_event_ptr->fd = fd;
- return (file_event_ptr);
+ data.integer = fd;
+ return create_event (handle_file_event, data);
}
/* Process one event.
@@ -280,7 +336,7 @@ create_file_event (int fd)
or an asynchronous event handler can be invoked in response to
the reception of a signal.
If an event was processed (either way), 1 is returned otherwise
- 0 is returned.
+ 0 is returned.
Scan the queue from head to tail, processing therefore the high
priority events first, by invoking the associated event handler
procedure. */
@@ -289,17 +345,14 @@ process_event (void)
{
gdb_event *event_ptr, *prev_ptr;
event_handler_func *proc;
- int fd;
+ event_data data;
/* First let's see if there are any asynchronous event handlers that
are ready. These would be the result of invoking any of the
signal handlers. */
- if (check_async_ready ())
- {
- invoke_async_signal_handler ();
- return 1;
- }
+ if (invoke_async_signal_handlers ())
+ return 1;
/* Look in the event queue to find an event that is ready
to be processed. */
@@ -310,7 +363,7 @@ process_event (void)
/* Call the handler for the event. */
proc = event_ptr->proc;
- fd = event_ptr->fd;
+ data = event_ptr->data;
/* Let's get rid of the event from the event queue. We need to
do this now because while processing the event, the proc
@@ -338,7 +391,7 @@ process_event (void)
xfree (event_ptr);
/* Now call the procedure associated with the event. */
- (*proc) (fd);
+ (*proc) (data);
return 1;
}
@@ -355,33 +408,59 @@ process_event (void)
int
gdb_do_one_event (void *data)
{
- /* Any events already waiting in the queue? */
+ static int event_source_head = 0;
+ const int number_of_sources = 3;
+ int current = 0;
+
+ /* Any events already waiting in the queue? */
if (process_event ())
+ return 1;
+
+ /* To level the fairness across event sources, we poll them in a
+ round-robin fashion. */
+ for (current = 0; current < number_of_sources; current++)
{
- return 1;
+ switch (event_source_head)
+ {
+ case 0:
+ /* Are any timers that are ready? If so, put an event on the
+ queue. */
+ poll_timers ();
+ break;
+ case 1:
+ /* Are there events already waiting to be collected on the
+ monitored file descriptors? */
+ gdb_wait_for_event (0);
+ break;
+ case 2:
+ /* Are there any asynchronous event handlers ready? */
+ check_async_event_handlers ();
+ break;
+ }
+
+ event_source_head++;
+ if (event_source_head == number_of_sources)
+ event_source_head = 0;
}
- /* Are any timers that are ready? If so, put an event on the queue. */
- poll_timers ();
+ /* Handle any new events collected. */
+ if (process_event ())
+ return 1;
- /* Wait for a new event. If gdb_wait_for_event returns -1,
- we should get out because this means that there are no
- event sources left. This will make the event loop stop,
- and the application exit. */
+ /* Block waiting for a new event. If gdb_wait_for_event returns -1,
+ we should get out because this means that there are no event
+ sources left. This will make the event loop stop, and the
+ application exit. */
- if (gdb_wait_for_event () < 0)
- {
- return -1;
- }
+ if (gdb_wait_for_event (1) < 0)
+ return -1;
- /* Handle any new events occurred while waiting. */
+ /* Handle any new events occurred while waiting. */
if (process_event ())
- {
- return 1;
- }
+ return 1;
- /* If gdb_wait_for_event has returned 1, it means that one
- event has been handled. We break out of the loop. */
+ /* If gdb_wait_for_event has returned 1, it means that one event has
+ been handled. We break out of the loop. */
return 1;
}
@@ -659,7 +738,7 @@ delete_file_handler (int fd)
through event_ptr->proc. EVENT_FILE_DESC is file descriptor of the
event in the front of the event queue. */
static void
-handle_file_event (int event_file_desc)
+handle_file_event (event_data data)
{
file_handler *file_ptr;
int mask;
@@ -667,6 +746,7 @@ handle_file_event (int event_file_desc)
int error_mask;
int error_mask_returned;
#endif
+ int event_file_desc = data.integer;
/* Search the file handler list to find one that matches the fd in
the event. */
@@ -735,15 +815,13 @@ handle_file_event (int event_file_desc)
}
}
-/* Called by gdb_do_one_event to wait for new events on the
- monitored file descriptors. Queue file events as they are
- detected by the poll.
- If there are no events, this function will block in the
- call to poll.
- Return -1 if there are no files descriptors to monitor,
- otherwise return 0. */
+/* Called by gdb_do_one_event to wait for new events on the monitored
+ file descriptors. Queue file events as they are detected by the
+ poll. If BLOCK and if there are no events, this function will
+ block in the call to poll. Return -1 if there are no files
+ descriptors to monitor, otherwise return 0. */
static int
-gdb_wait_for_event (void)
+gdb_wait_for_event (int block)
{
file_handler *file_ptr;
gdb_event *file_event_ptr;
@@ -760,13 +838,18 @@ gdb_wait_for_event (void)
if (use_poll)
{
#ifdef HAVE_POLL
- num_found =
- poll (gdb_notifier.poll_fds,
- (unsigned long) gdb_notifier.num_fds,
- gdb_notifier.timeout_valid ? gdb_notifier.poll_timeout : -1);
+ int timeout;
+
+ if (block)
+ timeout = gdb_notifier.timeout_valid ? gdb_notifier.poll_timeout : -1;
+ else
+ timeout = 0;
+
+ num_found = poll (gdb_notifier.poll_fds,
+ (unsigned long) gdb_notifier.num_fds, timeout);
/* Don't print anything if we get out of poll because of a
- signal. */
+ signal. */
if (num_found == -1 && errno != EINTR)
perror_with_name (("poll"));
#else
@@ -776,6 +859,18 @@ gdb_wait_for_event (void)
}
else
{
+ struct timeval select_timeout;
+
+ struct timeval *timeout_p;
+ if (block)
+ timeout_p = gdb_notifier.timeout_valid
+ ? &gdb_notifier.select_timeout : NULL;
+ else
+ {
+ memset (&select_timeout, 0, sizeof (select_timeout));
+ timeout_p = &select_timeout;
+ }
+
gdb_notifier.ready_masks[0] = gdb_notifier.check_masks[0];
gdb_notifier.ready_masks[1] = gdb_notifier.check_masks[1];
gdb_notifier.ready_masks[2] = gdb_notifier.check_masks[2];
@@ -783,8 +878,7 @@ gdb_wait_for_event (void)
&gdb_notifier.ready_masks[0],
&gdb_notifier.ready_masks[1],
&gdb_notifier.ready_masks[2],
- gdb_notifier.timeout_valid
- ? &gdb_notifier.select_timeout : NULL);
+ timeout_p);
/* Clear the masks after an error from select. */
if (num_found == -1)
@@ -792,7 +886,9 @@ gdb_wait_for_event (void)
FD_ZERO (&gdb_notifier.ready_masks[0]);
FD_ZERO (&gdb_notifier.ready_masks[1]);
FD_ZERO (&gdb_notifier.ready_masks[2]);
- /* Dont print anything is we got a signal, let gdb handle it. */
+
+ /* Dont print anything if we got a signal, let gdb handle
+ it. */
if (errno != EINTR)
perror_with_name (("select"));
}
@@ -911,21 +1007,18 @@ call_async_signal_handler (struct async_signal_handler *handler)
void
mark_async_signal_handler (async_signal_handler * async_handler_ptr)
{
- ((async_signal_handler *) async_handler_ptr)->ready = 1;
- async_handler_ready = 1;
+ async_handler_ptr->ready = 1;
}
-/* Call all the handlers that are ready. */
-static void
-invoke_async_signal_handler (void)
+/* Call all the handlers that are ready. Returns true if any was
+ indeed ready. */
+static int
+invoke_async_signal_handlers (void)
{
async_signal_handler *async_handler_ptr;
+ int any_ready = 0;
- if (async_handler_ready == 0)
- return;
- async_handler_ready = 0;
-
- /* Invoke ready handlers. */
+ /* Invoke ready handlers. */
while (1)
{
@@ -938,11 +1031,12 @@ invoke_async_signal_handler (void)
}
if (async_handler_ptr == NULL)
break;
+ any_ready = 1;
async_handler_ptr->ready = 0;
(*async_handler_ptr->proc) (async_handler_ptr->client_data);
}
- return;
+ return any_ready;
}
/* Delete an asynchronous handler (ASYNC_HANDLER_PTR).
@@ -971,11 +1065,111 @@ delete_async_signal_handler (async_signal_handler ** async_handler_ptr)
(*async_handler_ptr) = NULL;
}
-/* Is it necessary to call invoke_async_signal_handler? */
-static int
-check_async_ready (void)
+/* Create an asynchronous event handler, allocating memory for it.
+ Return a pointer to the newly created handler. PROC is the
+ function to call with CLIENT_DATA argument whenever the handler is
+ invoked. */
+async_event_handler *
+create_async_event_handler (async_event_handler_func *proc,
+ gdb_client_data client_data)
+{
+ async_event_handler *h;
+
+ h = xmalloc (sizeof (*h));
+ h->ready = 0;
+ h->next_handler = NULL;
+ h->proc = proc;
+ h->client_data = client_data;
+ if (async_event_handler_list.first_handler == NULL)
+ async_event_handler_list.first_handler = h;
+ else
+ async_event_handler_list.last_handler->next_handler = h;
+ async_event_handler_list.last_handler = h;
+ return h;
+}
+
+/* Mark the handler (ASYNC_HANDLER_PTR) as ready. This information
+ will be used by gdb_do_one_event. The caller will be whoever
+ created the event source, and wants to signal that the event is
+ ready to be handled. */
+void
+mark_async_event_handler (async_event_handler *async_handler_ptr)
+{
+ async_handler_ptr->ready = 1;
+}
+
+struct async_event_handler_data
+{
+ async_event_handler_func* proc;
+ gdb_client_data client_data;
+};
+
+static void
+invoke_async_event_handler (event_data data)
+{
+ struct async_event_handler_data *hdata = data.ptr;
+ async_event_handler_func* proc = hdata->proc;
+ gdb_client_data client_data = hdata->client_data;
+
+ xfree (hdata);
+ (*proc) (client_data);
+}
+
+/* Check if any asynchronous event handlers are ready, and queue
+ events in the ready queue for any that are. */
+static void
+check_async_event_handlers (void)
+{
+ async_event_handler *async_handler_ptr;
+ struct async_event_handler_data *hdata;
+ struct gdb_event *event_ptr;
+ event_data data;
+
+ for (async_handler_ptr = async_event_handler_list.first_handler;
+ async_handler_ptr != NULL;
+ async_handler_ptr = async_handler_ptr->next_handler)
+ {
+ if (async_handler_ptr->ready)
+ {
+ async_handler_ptr->ready = 0;
+
+ hdata = xmalloc (sizeof (*hdata));
+
+ hdata->proc = async_handler_ptr->proc;
+ hdata->client_data = async_handler_ptr->client_data;
+
+ data.ptr = hdata;
+
+ event_ptr = create_event (invoke_async_event_handler, data);
+ async_queue_event (event_ptr, TAIL);
+ }
+ }
+}
+
+/* Delete an asynchronous handler (ASYNC_HANDLER_PTR).
+ Free the space allocated for it. */
+void
+delete_async_event_handler (async_event_handler **async_handler_ptr)
{
- return async_handler_ready;
+ async_event_handler *prev_ptr;
+
+ if (async_event_handler_list.first_handler == *async_handler_ptr)
+ {
+ async_event_handler_list.first_handler = (*async_handler_ptr)->next_handler;
+ if (async_event_handler_list.first_handler == NULL)
+ async_event_handler_list.last_handler = NULL;
+ }
+ else
+ {
+ prev_ptr = async_event_handler_list.first_handler;
+ while (prev_ptr && prev_ptr->next_handler != *async_handler_ptr)
+ prev_ptr = prev_ptr->next_handler;
+ prev_ptr->next_handler = (*async_handler_ptr)->next_handler;
+ if (async_event_handler_list.last_handler == (*async_handler_ptr))
+ async_event_handler_list.last_handler = prev_ptr;
+ }
+ xfree (*async_handler_ptr);
+ *async_handler_ptr = NULL;
}
/* Create a timer that will expire in MILLISECONDS from now. When the
@@ -1080,11 +1274,11 @@ delete_timer (int id)
}
/* When a timer event is put on the event queue, it will be handled by
- this function. Just call the assiciated procedure and delete the
- timer event from the event queue. Repeat this for each timer that
- has expired. */
+ this function. Just call the associated procedure and delete the
+ timer event from the event queue. Repeat this for each timer that
+ has expired. */
static void
-handle_timer_event (int dummy)
+handle_timer_event (event_data dummy)
{
struct timeval time_now;
struct gdb_timer *timer_ptr, *saved_timer;
@@ -1150,7 +1344,7 @@ poll_timers (void)
{
event_ptr = (gdb_event *) xmalloc (sizeof (gdb_event));
event_ptr->proc = handle_timer_event;
- event_ptr->fd = timer_list.first_timer->timer_id;
+ event_ptr->data.integer = timer_list.first_timer->timer_id;
async_queue_event (event_ptr, TAIL);
}
diff --git a/gdb/event-loop.h b/gdb/event-loop.h
index fc813ca..2a75b81 100644
--- a/gdb/event-loop.h
+++ b/gdb/event-loop.h
@@ -24,21 +24,33 @@
sources to listen on. External event sources can be plugged into
the loop.
- There are 3 main components:
+ There are 4 main components:
- a list of file descriptors to be monitored, GDB_NOTIFIER.
+ - a list of asynchronous event sources to be monitored,
+ ASYNC_EVENT_HANDLER_LIST.
- a list of events that have occurred, EVENT_QUEUE.
- a list of signal handling functions, SIGHANDLER_LIST.
- GDB_NOTIFIER keeps track of the event sources. Event sources for
- gdb are currently the UI and the target. Gdb communicates with the
- command line user interface via the readline library and usually
- communicates with remote targets via a serial port. Serial ports
- are represented in GDB as file descriptors and select/poll calls.
- For native targets instead, the communication consists of calls to
- ptrace and waits (via signals) or calls to poll/select (via file
- descriptors). In the current gdb, the code handling events related
- to the target resides in the wait_for_inferior function and in
- various target specific files (*-tdep.c).
+ GDB_NOTIFIER keeps track of the file descriptor based event
+ sources. ASYNC_EVENT_HANDLER_LIST keeps track of asynchronous
+ event sources that are signalled by some component of gdb, usually
+ a target_ops instance. Event sources for gdb are currently the UI
+ and the target. Gdb communicates with the command line user
+ interface via the readline library and usually communicates with
+ remote targets via a serial port. Serial ports are represented in
+ GDB as file descriptors and select/poll calls. For native targets
+ instead, the communication varies across operating system debug
+ APIs, but usually consists of calls to ptrace and waits (via
+ signals) or calls to poll/select (via file descriptors). In the
+ current gdb, the code handling events related to the target resides
+ in wait_for_inferior for synchronous targets; or, for asynchronous
+ capable targets, by having the target register either a target
+ controlled file descriptor and/or an asynchronous event source in
+ the event loop, with the fetch_inferior_event function as the event
+ callback. In both the synchronous and asynchronous cases, usually
+ the target event is collected through the target_wait interface.
+ The target is free to install other event sources in the event loop
+ if it so requires.
EVENT_QUEUE keeps track of the events that have happened during the
last iteration of the event loop, and need to be processed. An
@@ -57,8 +69,10 @@
typedef void *gdb_client_data;
struct async_signal_handler;
+struct async_event_handler;
typedef void (handler_func) (int, gdb_client_data);
typedef void (sig_handler_func) (gdb_client_data);
+typedef void (async_event_handler_func) (gdb_client_data);
typedef void (timer_handler_func) (gdb_client_data);
/* Where to add an event onto the event queue, by queue_event. */
@@ -113,3 +127,21 @@ void mark_async_signal_handler (struct async_signal_handler *handler);
void gdb_call_async_signal_handler (struct async_signal_handler *handler,
int immediate_p);
+
+/* Create and register an asynchronous event source in the event loop,
+ and set PROC as its callback. CLIENT_DATA is passed as argument to
+ PROC upon its invocation. Returns a pointer to an opaque structure
+ used to mark as ready and to later delete this event source from
+ the event loop. */
+extern struct async_event_handler *
+ create_async_event_handler (async_event_handler_func *proc,
+ gdb_client_data client_data);
+
+/* Remove the event source pointed by HANDLER_PTR created by
+ CREATE_ASYNC_EVENT_HANDLER from the event loop, and release it. */
+extern void
+ delete_async_event_handler (struct async_event_handler **handler_ptr);
+
+/* Call the handler from HANDLER the next time through the event
+ loop. */
+extern void mark_async_event_handler (struct async_event_handler *handler);
diff --git a/gdb/exec.c b/gdb/exec.c
index 94e0a0d..92450e6 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -217,8 +217,11 @@ exec_file_attach (char *filename, int from_tty)
scratch_chan);
if (!exec_bfd)
- error (_("\"%s\": could not open as an executable file: %s"),
- scratch_pathname, bfd_errmsg (bfd_get_error ()));
+ {
+ close (scratch_chan);
+ error (_("\"%s\": could not open as an executable file: %s"),
+ scratch_pathname, bfd_errmsg (bfd_get_error ()));
+ }
/* At this point, scratch_pathname and exec_bfd->name both point to the
same malloc'd string. However exec_close() will attempt to free it
@@ -302,10 +305,7 @@ exec_file_command (char *args, int from_tty)
/* Scan through the args and pick up the first non option arg
as the filename. */
- argv = buildargv (args);
- if (argv == NULL)
- nomem (0);
-
+ argv = gdb_buildargv (args);
make_cleanup_freeargv (argv);
for (; (*argv != NULL) && (**argv == '-'); argv++)
diff --git a/gdb/expprint.c b/gdb/expprint.c
index 079f2a9..756a02e 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -31,6 +31,7 @@
#include "block.h"
#include "objfiles.h"
#include "gdb_assert.h"
+#include "valprint.h"
#ifdef HAVE_CTYPE_H
#include <ctype.h>
@@ -92,17 +93,25 @@ print_subexp_standard (struct expression *exp, int *pos,
return;
case OP_LONG:
- (*pos) += 3;
- value_print (value_from_longest (exp->elts[pc + 1].type,
- exp->elts[pc + 2].longconst),
- stream, 0, Val_no_prettyprint);
+ {
+ struct value_print_options opts;
+ get_raw_print_options (&opts);
+ (*pos) += 3;
+ value_print (value_from_longest (exp->elts[pc + 1].type,
+ exp->elts[pc + 2].longconst),
+ stream, &opts);
+ }
return;
case OP_DOUBLE:
- (*pos) += 3;
- value_print (value_from_double (exp->elts[pc + 1].type,
- exp->elts[pc + 2].doubleconst),
- stream, 0, Val_no_prettyprint);
+ {
+ struct value_print_options opts;
+ get_raw_print_options (&opts);
+ (*pos) += 3;
+ value_print (value_from_double (exp->elts[pc + 1].type,
+ exp->elts[pc + 2].doubleconst),
+ stream, &opts);
+ }
return;
case OP_VAR_VALUE:
@@ -169,12 +178,17 @@ print_subexp_standard (struct expression *exp, int *pos,
return;
case OP_STRING:
- nargs = longest_to_int (exp->elts[pc + 1].longconst);
- (*pos) += 3 + BYTES_TO_EXP_ELEM (nargs + 1);
- /* LA_PRINT_STRING will print using the current repeat count threshold.
- If necessary, we can temporarily set it to zero, or pass it as an
- additional parameter to LA_PRINT_STRING. -fnf */
- LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 1, 0);
+ {
+ struct value_print_options opts;
+ nargs = longest_to_int (exp->elts[pc + 1].longconst);
+ (*pos) += 3 + BYTES_TO_EXP_ELEM (nargs + 1);
+ /* LA_PRINT_STRING will print using the current repeat count threshold.
+ If necessary, we can temporarily set it to zero, or pass it as an
+ additional parameter to LA_PRINT_STRING. -fnf */
+ get_user_print_options (&opts);
+ LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 1, 0,
+ &opts);
+ }
return;
case OP_BITSTRING:
@@ -185,11 +199,16 @@ print_subexp_standard (struct expression *exp, int *pos,
return;
case OP_OBJC_NSSTRING: /* Objective-C Foundation Class NSString constant. */
- nargs = longest_to_int (exp->elts[pc + 1].longconst);
- (*pos) += 3 + BYTES_TO_EXP_ELEM (nargs + 1);
- fputs_filtered ("@\"", stream);
- LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 1, 0);
- fputs_filtered ("\"", stream);
+ {
+ struct value_print_options opts;
+ nargs = longest_to_int (exp->elts[pc + 1].longconst);
+ (*pos) += 3 + BYTES_TO_EXP_ELEM (nargs + 1);
+ fputs_filtered ("@\"", stream);
+ get_user_print_options (&opts);
+ LA_PRINT_STRING (stream, &exp->elts[pc + 2].string, nargs, 1, 0,
+ &opts);
+ fputs_filtered ("\"", stream);
+ }
return;
case OP_OBJC_MSGCALL:
@@ -270,7 +289,10 @@ print_subexp_standard (struct expression *exp, int *pos,
}
if (tem > 0)
{
- LA_PRINT_STRING (stream, tempstr, nargs - 1, 1, 0);
+ struct value_print_options opts;
+ get_user_print_options (&opts);
+ LA_PRINT_STRING (stream, tempstr, nargs - 1, 1, 0,
+ &opts);
(*pos) = pc;
}
else
@@ -394,6 +416,8 @@ print_subexp_standard (struct expression *exp, int *pos,
if (TYPE_CODE (exp->elts[pc + 1].type) == TYPE_CODE_FUNC &&
exp->elts[pc + 3].opcode == OP_LONG)
{
+ struct value_print_options opts;
+
/* We have a minimal symbol fn, probably. It's encoded
as a UNOP_MEMVAL (function-type) of an OP_LONG (int, address).
Swallow the OP_LONG (including both its opcodes); ignore
@@ -401,7 +425,8 @@ print_subexp_standard (struct expression *exp, int *pos,
(*pos) += 4;
val = value_at_lazy (exp->elts[pc + 1].type,
(CORE_ADDR) exp->elts[pc + 5].longconst);
- value_print (val, stream, 0, Val_no_prettyprint);
+ get_raw_print_options (&opts);
+ value_print (val, stream, &opts);
}
else
{
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 736d6c6..4d4d4d7 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -142,7 +142,8 @@ f_printchar (int c, struct ui_file *stream)
static void
f_printstr (struct ui_file *stream, const gdb_byte *string,
- unsigned int length, int width, int force_ellipses)
+ unsigned int length, int width, int force_ellipses,
+ const struct value_print_options *options)
{
unsigned int i;
unsigned int things_printed = 0;
@@ -155,7 +156,7 @@ f_printstr (struct ui_file *stream, const gdb_byte *string,
return;
}
- for (i = 0; i < length && things_printed < print_max; ++i)
+ for (i = 0; i < length && things_printed < options->print_max; ++i)
{
/* Position of the character we are examining
to see whether it is repeated. */
@@ -179,11 +180,11 @@ f_printstr (struct ui_file *stream, const gdb_byte *string,
++reps;
}
- if (reps > repeat_count_threshold)
+ if (reps > options->repeat_count_threshold)
{
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\', ", stream);
else
fputs_filtered ("', ", stream);
@@ -192,14 +193,14 @@ f_printstr (struct ui_file *stream, const gdb_byte *string,
f_printchar (string[i], stream);
fprintf_filtered (stream, " <repeats %u times>", reps);
i = rep1 - 1;
- things_printed += repeat_count_threshold;
+ things_printed += options->repeat_count_threshold;
need_comma = 1;
}
else
{
if (!in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\'", stream);
else
fputs_filtered ("'", stream);
@@ -213,7 +214,7 @@ f_printstr (struct ui_file *stream, const gdb_byte *string,
/* Terminate the quotes if necessary. */
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\'", stream);
else
fputs_filtered ("'", stream);
@@ -305,8 +306,8 @@ f_language_arch_info (struct gdbarch *gdbarch,
/* This is declared in c-lang.h but it is silly to import that file for what
is already just a hack. */
-extern int c_value_print (struct value *, struct ui_file *, int,
- enum val_prettyprint);
+extern int c_value_print (struct value *, struct ui_file *,
+ const struct value_print_options *);
const struct language_defn f_language_defn =
{
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
index 2c3e371..3b3487e 100644
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -29,8 +29,8 @@ extern void f_print_type (struct type *, char *, struct ui_file *, int,
int);
extern int f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
- struct ui_file *, int, int, int,
- enum val_prettyprint);
+ struct ui_file *, int,
+ const struct value_print_options *);
/* Language-specific data structures */
@@ -83,9 +83,6 @@ extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *);
#define BLANK_COMMON_NAME_MF77 "__BLNK__" /* MF77 assigned */
#define BLANK_COMMON_NAME_LOCAL "__BLANK" /* Local GDB */
-#define BOUND_FETCH_OK 1
-#define BOUND_FETCH_ERROR -999
-
/* When reasonable array bounds cannot be fetched, such as when
you ask to 'mt print symbols' and there is no stack frame and
therefore no way of knowing the bounds of stack-based arrays,
@@ -97,9 +94,9 @@ extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *);
extern char *real_main_name; /* Name of main function */
extern int real_main_c_value; /* C_value field of main function */
-extern int f77_get_dynamic_upperbound (struct type *, int *);
+extern int f77_get_upperbound (struct type *);
-extern int f77_get_dynamic_lowerbound (struct type *, int *);
+extern int f77_get_lowerbound (struct type *);
extern void f77_get_dynamic_array_length (struct type *);
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index ad93152..081d24a 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -153,7 +153,6 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
int show, int passed_a_ptr, int demangled_args)
{
int upper_bound, lower_bound;
- int lower_bound_was_default = 0;
static int arrayprint_recurse_level = 0;
int retcode;
@@ -176,35 +175,19 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY)
f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0);
- retcode = f77_get_dynamic_lowerbound (type, &lower_bound);
-
- lower_bound_was_default = 0;
-
- if (retcode == BOUND_FETCH_ERROR)
- fprintf_filtered (stream, "???");
- else if (lower_bound == 1) /* The default */
- lower_bound_was_default = 1;
- else
- fprintf_filtered (stream, "%d", lower_bound);
-
- if (lower_bound_was_default)
- lower_bound_was_default = 0;
- else
- fprintf_filtered (stream, ":");
+ lower_bound = f77_get_lowerbound (type);
+ if (lower_bound != 1) /* Not the default. */
+ fprintf_filtered (stream, "%d:", lower_bound);
/* Make sure that, if we have an assumed size array, we
print out a warning and print the upperbound as '*' */
- if (TYPE_ARRAY_UPPER_BOUND_TYPE (type) == BOUND_CANNOT_BE_DETERMINED)
+ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
fprintf_filtered (stream, "*");
else
{
- retcode = f77_get_dynamic_upperbound (type, &upper_bound);
-
- if (retcode == BOUND_FETCH_ERROR)
- fprintf_filtered (stream, "???");
- else
- fprintf_filtered (stream, "%d", upper_bound);
+ upper_bound = f77_get_upperbound (type);
+ fprintf_filtered (stream, "%d", upper_bound);
}
if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY)
@@ -354,16 +337,12 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
case TYPE_CODE_STRING:
/* Strings may have dynamic upperbounds (lengths) like arrays. */
- if (TYPE_ARRAY_UPPER_BOUND_TYPE (type) == BOUND_CANNOT_BE_DETERMINED)
+ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
fprintfi_filtered (level, stream, "character*(*)");
else
{
- retcode = f77_get_dynamic_upperbound (type, &upper_bound);
-
- if (retcode == BOUND_FETCH_ERROR)
- fprintf_filtered (stream, "character*???");
- else
- fprintf_filtered (stream, "character*%d", upper_bound);
+ upper_bound = f77_get_upperbound (type);
+ fprintf_filtered (stream, "character*%d", upper_bound);
}
break;
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index 26aa83b..f893b49 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -61,132 +61,28 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
#define F77_DIM_OFFSET(n) (f77_array_offset_tbl[n][0])
int
-f77_get_dynamic_lowerbound (struct type *type, int *lower_bound)
+f77_get_lowerbound (struct type *type)
{
- struct frame_info *frame;
- CORE_ADDR current_frame_addr;
- CORE_ADDR ptr_to_lower_bound;
+ if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type))
+ error (_("Lower bound may not be '*' in F77"));
- switch (TYPE_ARRAY_LOWER_BOUND_TYPE (type))
- {
- case BOUND_BY_VALUE_ON_STACK:
- frame = deprecated_safe_get_selected_frame ();
- current_frame_addr = get_frame_base (frame);
- if (current_frame_addr > 0)
- {
- *lower_bound =
- read_memory_integer (current_frame_addr +
- TYPE_ARRAY_LOWER_BOUND_VALUE (type),
- 4);
- }
- else
- {
- *lower_bound = DEFAULT_LOWER_BOUND;
- return BOUND_FETCH_ERROR;
- }
- break;
-
- case BOUND_SIMPLE:
- *lower_bound = TYPE_ARRAY_LOWER_BOUND_VALUE (type);
- break;
-
- case BOUND_CANNOT_BE_DETERMINED:
- error (_("Lower bound may not be '*' in F77"));
- break;
-
- case BOUND_BY_REF_ON_STACK:
- frame = deprecated_safe_get_selected_frame ();
- current_frame_addr = get_frame_base (frame);
- if (current_frame_addr > 0)
- {
- struct gdbarch *arch = get_frame_arch (frame);
- ptr_to_lower_bound =
- read_memory_typed_address (current_frame_addr +
- TYPE_ARRAY_LOWER_BOUND_VALUE (type),
- builtin_type (arch)->builtin_data_ptr);
- *lower_bound = read_memory_integer (ptr_to_lower_bound, 4);
- }
- else
- {
- *lower_bound = DEFAULT_LOWER_BOUND;
- return BOUND_FETCH_ERROR;
- }
- break;
-
- case BOUND_BY_REF_IN_REG:
- case BOUND_BY_VALUE_IN_REG:
- default:
- error (_("??? unhandled dynamic array bound type ???"));
- break;
- }
- return BOUND_FETCH_OK;
+ return TYPE_ARRAY_LOWER_BOUND_VALUE (type);
}
int
-f77_get_dynamic_upperbound (struct type *type, int *upper_bound)
+f77_get_upperbound (struct type *type)
{
- struct frame_info *frame;
- CORE_ADDR current_frame_addr = 0;
- CORE_ADDR ptr_to_upper_bound;
-
- switch (TYPE_ARRAY_UPPER_BOUND_TYPE (type))
+ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
{
- case BOUND_BY_VALUE_ON_STACK:
- frame = deprecated_safe_get_selected_frame ();
- current_frame_addr = get_frame_base (frame);
- if (current_frame_addr > 0)
- {
- *upper_bound =
- read_memory_integer (current_frame_addr +
- TYPE_ARRAY_UPPER_BOUND_VALUE (type),
- 4);
- }
- else
- {
- *upper_bound = DEFAULT_UPPER_BOUND;
- return BOUND_FETCH_ERROR;
- }
- break;
-
- case BOUND_SIMPLE:
- *upper_bound = TYPE_ARRAY_UPPER_BOUND_VALUE (type);
- break;
-
- case BOUND_CANNOT_BE_DETERMINED:
- /* we have an assumed size array on our hands. Assume that
- upper_bound == lower_bound so that we show at least
- 1 element.If the user wants to see more elements, let
- him manually ask for 'em and we'll subscript the
- array and show him */
- f77_get_dynamic_lowerbound (type, upper_bound);
- break;
-
- case BOUND_BY_REF_ON_STACK:
- frame = deprecated_safe_get_selected_frame ();
- current_frame_addr = get_frame_base (frame);
- if (current_frame_addr > 0)
- {
- struct gdbarch *arch = get_frame_arch (frame);
- ptr_to_upper_bound =
- read_memory_typed_address (current_frame_addr +
- TYPE_ARRAY_UPPER_BOUND_VALUE (type),
- builtin_type (arch)->builtin_data_ptr);
- *upper_bound = read_memory_integer (ptr_to_upper_bound, 4);
- }
- else
- {
- *upper_bound = DEFAULT_UPPER_BOUND;
- return BOUND_FETCH_ERROR;
- }
- break;
+ /* We have an assumed size array on our hands. Assume that
+ upper_bound == lower_bound so that we show at least 1 element.
+ If the user wants to see more elements, let him manually ask for 'em
+ and we'll subscript the array and show him. */
- case BOUND_BY_REF_IN_REG:
- case BOUND_BY_VALUE_IN_REG:
- default:
- error (_("??? unhandled dynamic array bound type ???"));
- break;
+ return f77_get_lowerbound (type);
}
- return BOUND_FETCH_OK;
+
+ return TYPE_ARRAY_UPPER_BOUND_VALUE (type);
}
/* Obtain F77 adjustable array dimensions */
@@ -212,13 +108,8 @@ f77_get_dynamic_length_of_aggregate (struct type *type)
f77_get_dynamic_length_of_aggregate (TYPE_TARGET_TYPE (type));
/* Recursion ends here, start setting up lengths. */
- retcode = f77_get_dynamic_lowerbound (type, &lower_bound);
- if (retcode == BOUND_FETCH_ERROR)
- error (_("Cannot obtain valid array lower bound"));
-
- retcode = f77_get_dynamic_upperbound (type, &upper_bound);
- if (retcode == BOUND_FETCH_ERROR)
- error (_("Cannot obtain valid array upper bound"));
+ lower_bound = f77_get_lowerbound (type);
+ upper_bound = f77_get_upperbound (type);
/* Patch in a valid length value. */
@@ -241,16 +132,8 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream)
while ((TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY))
{
- if (TYPE_ARRAY_UPPER_BOUND_TYPE (tmp_type) == BOUND_CANNOT_BE_DETERMINED)
- fprintf_filtered (stream, "<assumed size array> ");
-
- retcode = f77_get_dynamic_upperbound (tmp_type, &upper);
- if (retcode == BOUND_FETCH_ERROR)
- error (_("Cannot obtain dynamic upper bound"));
-
- retcode = f77_get_dynamic_lowerbound (tmp_type, &lower);
- if (retcode == BOUND_FETCH_ERROR)
- error (_("Cannot obtain dynamic lower bound"));
+ upper = f77_get_upperbound (tmp_type);
+ lower = f77_get_lowerbound (tmp_type);
F77_DIM_SIZE (ndimen) = upper - lower + 1;
@@ -281,42 +164,42 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream)
static void
f77_print_array_1 (int nss, int ndimensions, struct type *type,
const gdb_byte *valaddr, CORE_ADDR address,
- struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty,
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options,
int *elts)
{
int i;
if (nss != ndimensions)
{
- for (i = 0; (i < F77_DIM_SIZE (nss) && (*elts) < print_max); i++)
+ for (i = 0; (i < F77_DIM_SIZE (nss) && (*elts) < options->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, elts);
+ stream, recurse, options, elts);
fprintf_filtered (stream, ") ");
}
- if (*elts >= print_max && i < F77_DIM_SIZE (nss))
+ if (*elts >= options->print_max && i < F77_DIM_SIZE (nss))
fprintf_filtered (stream, "...");
}
else
{
- for (i = 0; i < F77_DIM_SIZE (nss) && (*elts) < print_max;
+ for (i = 0; i < F77_DIM_SIZE (nss) && (*elts) < options->print_max;
i++, (*elts)++)
{
val_print (TYPE_TARGET_TYPE (type),
valaddr + i * F77_DIM_OFFSET (ndimensions),
0,
address + i * F77_DIM_OFFSET (ndimensions),
- stream, format, deref_ref, recurse, pretty,
- current_language);
+ stream, recurse, options, current_language);
if (i != (F77_DIM_SIZE (nss) - 1))
fprintf_filtered (stream, ", ");
- if ((*elts == print_max - 1) && (i != (F77_DIM_SIZE (nss) - 1)))
+ if ((*elts == options->print_max - 1)
+ && (i != (F77_DIM_SIZE (nss) - 1)))
fprintf_filtered (stream, "...");
}
}
@@ -328,8 +211,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
static void
f77_print_array (struct type *type, const gdb_byte *valaddr,
CORE_ADDR address, struct ui_file *stream,
- int format, int deref_ref, int recurse,
- enum val_prettyprint pretty)
+ int recurse, const struct value_print_options *options)
{
int ndimensions;
int elts = 0;
@@ -346,28 +228,22 @@ f77_print_array (struct type *type, const gdb_byte *valaddr,
f77_create_arrayprint_offset_tbl (type, stream);
- f77_print_array_1 (1, ndimensions, type, valaddr, address, stream, format,
- deref_ref, recurse, pretty, &elts);
+ f77_print_array_1 (1, ndimensions, type, valaddr, address, stream,
+ recurse, options, &elts);
}
/* Print data of type TYPE located at VALADDR (within GDB), which came from
the inferior at address ADDRESS, onto stdio stream STREAM according to
- FORMAT (a letter or 0 for natural format). The data at VALADDR is in
- target byte order.
+ OPTIONS. The data at VALADDR is in target byte order.
If the data are a string pointer, returns the number of string characters
- printed.
-
- If DEREF_REF is nonzero, then dereference references, otherwise just print
- them like pointers.
-
- The PRETTY parameter controls prettyprinting. */
+ printed. */
int
f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
unsigned int i = 0; /* Number of characters printed */
struct type *elttype;
@@ -380,20 +256,19 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
{
case TYPE_CODE_STRING:
f77_get_dynamic_length_of_aggregate (type);
- LA_PRINT_STRING (stream, valaddr, TYPE_LENGTH (type), 1, 0);
+ LA_PRINT_STRING (stream, valaddr, TYPE_LENGTH (type), 1, 0, options);
break;
case TYPE_CODE_ARRAY:
fprintf_filtered (stream, "(");
- f77_print_array (type, valaddr, address, stream, format,
- deref_ref, recurse, pretty);
+ f77_print_array (type, valaddr, address, stream, recurse, options);
fprintf_filtered (stream, ")");
break;
case TYPE_CODE_PTR:
- if (format && format != 's')
+ if (options->format && options->format != 's')
{
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ print_scalar_formatted (valaddr, type, options, 0, stream);
break;
}
else
@@ -409,16 +284,17 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
return 0;
}
- if (addressprint && format != 's')
+ if (options->addressprint && options->format != 's')
fputs_filtered (paddress (addr), stream);
/* For a pointer to char or unsigned char, also print the string
pointed to, unless pointer is null. */
if (TYPE_LENGTH (elttype) == 1
&& TYPE_CODE (elttype) == TYPE_CODE_INT
- && (format == 0 || format == 's')
+ && (options->format == 0 || options->format == 's')
&& addr != 0)
- i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
+ i = val_print_string (addr, -1, TYPE_LENGTH (elttype), stream,
+ options);
/* Return number of characters printed, including the terminating
'\0' if we reached the end. val_print_string takes care including
@@ -429,17 +305,17 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
case TYPE_CODE_REF:
elttype = check_typedef (TYPE_TARGET_TYPE (type));
- if (addressprint)
+ if (options->addressprint)
{
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
fprintf_filtered (stream, "@");
fputs_filtered (paddress (addr), stream);
- if (deref_ref)
+ if (options->deref_ref)
fputs_filtered (": ", stream);
}
/* De-reference the reference. */
- if (deref_ref)
+ if (options->deref_ref)
{
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
{
@@ -447,8 +323,8 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (type, valaddr + embedded_offset));
- common_val_print (deref_val, stream, format, deref_ref, recurse,
- pretty, current_language);
+ common_val_print (deref_val, stream, recurse,
+ options, current_language);
}
else
fputs_filtered ("???", stream);
@@ -456,9 +332,9 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_FUNC:
- if (format)
+ if (options->format)
{
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ print_scalar_formatted (valaddr, type, options, 0, stream);
break;
}
/* FIXME, we should consider, at least for ANSI C language, eliminating
@@ -471,9 +347,13 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_INT:
- format = format ? format : output_format;
- if (format)
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ if (options->format || options->output_format)
+ {
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr, type, &opts, 0, stream);
+ }
else
{
val_print_type_code_int (type, valaddr, stream);
@@ -491,15 +371,15 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_FLAGS:
- if (format)
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ if (options->format)
+ print_scalar_formatted (valaddr, type, options, 0, stream);
else
val_print_type_code_flags (type, valaddr, stream);
break;
case TYPE_CODE_FLT:
- if (format)
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ if (options->format)
+ print_scalar_formatted (valaddr, type, options, 0, stream);
else
print_floating (valaddr, type, stream);
break;
@@ -518,9 +398,13 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_BOOL:
- format = format ? format : output_format;
- if (format)
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ if (options->format || options->output_format)
+ {
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr, type, &opts, 0, stream);
+ }
else
{
val = extract_unsigned_integer (valaddr, TYPE_LENGTH (type));
@@ -534,8 +418,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
{
/* Bash the type code temporarily. */
TYPE_CODE (type) = TYPE_CODE_INT;
- f_val_print (type, valaddr, 0, address, stream, format,
- deref_ref, recurse, pretty);
+ f_val_print (type, valaddr, 0, address, stream, recurse, options);
/* Restore the type code so later uses work as intended. */
TYPE_CODE (type) = TYPE_CODE_BOOL;
}
@@ -567,8 +450,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
{
int offset = TYPE_FIELD_BITPOS (type, index) / 8;
f_val_print (TYPE_FIELD_TYPE (type, index), valaddr + offset,
- embedded_offset, address, stream,
- format, deref_ref, recurse, pretty);
+ embedded_offset, address, stream, recurse, options);
if (index != TYPE_NFIELDS (type) - 1)
fputs_filtered (", ", stream);
}
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 215d2a7..9fed5bf 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -101,11 +101,14 @@ fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
unsigned long start, end, size;
char protection[4];
int read, write, exec;
+ struct cleanup *cleanup;
mapfilename = xstrprintf ("/proc/%ld/map", (long) pid);
+ cleanup = make_cleanup (xfree, mapfilename);
mapfile = fopen (mapfilename, "r");
if (mapfile == NULL)
error (_("Couldn't open %s."), mapfilename);
+ make_cleanup_fclose (mapfile);
if (info_verbose)
fprintf_filtered (gdb_stdout,
@@ -134,7 +137,7 @@ fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
func (start, size, read, write, exec, obfd);
}
- fclose (mapfile);
+ do_cleanups (cleanup);
return 0;
}
diff --git a/gdb/features/Makefile b/gdb/features/Makefile
index 9241e2a..d45ad62 100644
--- a/gdb/features/Makefile
+++ b/gdb/features/Makefile
@@ -43,10 +43,16 @@ mips64-linux-expedite = r29,pc
rs6000/powerpc-32l-expedite = r1,pc
rs6000/powerpc-altivec32l-expedite = r1,pc
rs6000/powerpc-vsx32l-expedite = r1,pc
+rs6000/powerpc-isa205-32l-expedite = r1,pc
+rs6000/powerpc-isa205-altivec32l-expedite = r1,pc
+rs6000/powerpc-isa205-vsx32l-expedite = r1,pc
rs6000/powerpc-e500l-expedite = r1,pc
rs6000/powerpc-64l-expedite = r1,pc
rs6000/powerpc-altivec64l-expedite = r1,pc
rs6000/powerpc-vsx64l-expedite = r1,pc
+rs6000/powerpc-isa205-64l-expedite = r1,pc
+rs6000/powerpc-isa205-altivec64l-expedite = r1,pc
+rs6000/powerpc-isa205-vsx64l-expedite = r1,pc
XSLTPROC = xsltproc
diff --git a/gdb/features/rs6000/power-fpu-isa205.xml b/gdb/features/rs6000/power-fpu-isa205.xml
new file mode 100644
index 0000000..4b99b15
--- /dev/null
+++ b/gdb/features/rs6000/power-fpu-isa205.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.power.fpu">
+ <reg name="f0" bitsize="64" type="ieee_double" regnum="32"/>
+ <reg name="f1" bitsize="64" type="ieee_double"/>
+ <reg name="f2" bitsize="64" type="ieee_double"/>
+ <reg name="f3" bitsize="64" type="ieee_double"/>
+ <reg name="f4" bitsize="64" type="ieee_double"/>
+ <reg name="f5" bitsize="64" type="ieee_double"/>
+ <reg name="f6" bitsize="64" type="ieee_double"/>
+ <reg name="f7" bitsize="64" type="ieee_double"/>
+ <reg name="f8" bitsize="64" type="ieee_double"/>
+ <reg name="f9" bitsize="64" type="ieee_double"/>
+ <reg name="f10" bitsize="64" type="ieee_double"/>
+ <reg name="f11" bitsize="64" type="ieee_double"/>
+ <reg name="f12" bitsize="64" type="ieee_double"/>
+ <reg name="f13" bitsize="64" type="ieee_double"/>
+ <reg name="f14" bitsize="64" type="ieee_double"/>
+ <reg name="f15" bitsize="64" type="ieee_double"/>
+ <reg name="f16" bitsize="64" type="ieee_double"/>
+ <reg name="f17" bitsize="64" type="ieee_double"/>
+ <reg name="f18" bitsize="64" type="ieee_double"/>
+ <reg name="f19" bitsize="64" type="ieee_double"/>
+ <reg name="f20" bitsize="64" type="ieee_double"/>
+ <reg name="f21" bitsize="64" type="ieee_double"/>
+ <reg name="f22" bitsize="64" type="ieee_double"/>
+ <reg name="f23" bitsize="64" type="ieee_double"/>
+ <reg name="f24" bitsize="64" type="ieee_double"/>
+ <reg name="f25" bitsize="64" type="ieee_double"/>
+ <reg name="f26" bitsize="64" type="ieee_double"/>
+ <reg name="f27" bitsize="64" type="ieee_double"/>
+ <reg name="f28" bitsize="64" type="ieee_double"/>
+ <reg name="f29" bitsize="64" type="ieee_double"/>
+ <reg name="f30" bitsize="64" type="ieee_double"/>
+ <reg name="f31" bitsize="64" type="ieee_double"/>
+
+ <reg name="fpscr" bitsize="64" group="float" regnum="70"/>
+</feature>
diff --git a/gdb/features/rs6000/powerpc-isa205-32l.c b/gdb/features/rs6000/powerpc-isa205-32l.c
new file mode 100644
index 0000000..934ee75
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-32l.c
@@ -0,0 +1,97 @@
+/* THIS FILE IS GENERATED. Original: powerpc-isa205-32l.xml */
+
+#include "defs.h"
+#include "gdbtypes.h"
+#include "target-descriptions.h"
+
+struct target_desc *tdesc_powerpc_isa205_32l;
+static void
+initialize_tdesc_powerpc_isa205_32l (void)
+{
+ struct target_desc *result = allocate_target_description ();
+ struct tdesc_feature *feature;
+ struct type *field_type, *type;
+
+ set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common"));
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.core");
+ tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "pc", 64, 1, NULL, 32, "code_ptr");
+ tdesc_create_reg (feature, "msr", 65, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "lr", 67, 1, NULL, 32, "code_ptr");
+ tdesc_create_reg (feature, "ctr", 68, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu");
+ tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "fpscr", 70, 1, "float", 64, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux");
+ tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "trap", 72, 1, NULL, 32, "int");
+
+ tdesc_powerpc_isa205_32l = result;
+}
diff --git a/gdb/features/rs6000/powerpc-isa205-32l.xml b/gdb/features/rs6000/powerpc-isa205-32l.xml
new file mode 100644
index 0000000..e03cf52
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-32l.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2008 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!-- PowerPC UISA - a PPC processor as viewed by user-level code. A UISA-only
+ view of the PowerPC. Includes Linux-only special "registers". -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+ <architecture>powerpc:common</architecture>
+ <xi:include href="power-core.xml"/>
+ <xi:include href="power-fpu-isa205.xml"/>
+ <xi:include href="power-linux.xml"/>
+</target>
diff --git a/gdb/features/rs6000/powerpc-isa205-64l.c b/gdb/features/rs6000/powerpc-isa205-64l.c
new file mode 100644
index 0000000..a8f8dfa
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-64l.c
@@ -0,0 +1,97 @@
+/* THIS FILE IS GENERATED. Original: powerpc-isa205-64l.xml */
+
+#include "defs.h"
+#include "gdbtypes.h"
+#include "target-descriptions.h"
+
+struct target_desc *tdesc_powerpc_isa205_64l;
+static void
+initialize_tdesc_powerpc_isa205_64l (void)
+{
+ struct target_desc *result = allocate_target_description ();
+ struct tdesc_feature *feature;
+ struct type *field_type, *type;
+
+ set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common64"));
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.core");
+ tdesc_create_reg (feature, "r0", 0, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r1", 1, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r2", 2, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r3", 3, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r4", 4, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r5", 5, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r6", 6, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r7", 7, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r16", 16, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r17", 17, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r18", 18, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r19", 19, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r20", 20, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r21", 21, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r22", 22, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r23", 23, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r24", 24, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r25", 25, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r26", 26, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r27", 27, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r28", 28, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r29", 29, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r30", 30, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r31", 31, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "pc", 64, 1, NULL, 64, "code_ptr");
+ tdesc_create_reg (feature, "msr", 65, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "lr", 67, 1, NULL, 64, "code_ptr");
+ tdesc_create_reg (feature, "ctr", 68, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu");
+ tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "fpscr", 70, 1, "float", 64, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux");
+ tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 64, "int");
+ tdesc_create_reg (feature, "trap", 72, 1, NULL, 64, "int");
+
+ tdesc_powerpc_isa205_64l = result;
+}
diff --git a/gdb/features/rs6000/powerpc-isa205-64l.xml b/gdb/features/rs6000/powerpc-isa205-64l.xml
new file mode 100644
index 0000000..f51c308
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-64l.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2008 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!-- PowerPC UISA - a PPC processor as viewed by user-level code. A UISA-only
+ view of the PowerPC. Includes Linux-only special "registers". -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+ <architecture>powerpc:common64</architecture>
+ <xi:include href="power64-core.xml"/>
+ <xi:include href="power-fpu-isa205.xml"/>
+ <xi:include href="power64-linux.xml"/>
+</target>
diff --git a/gdb/features/rs6000/powerpc-isa205-altivec32l.c b/gdb/features/rs6000/powerpc-isa205-altivec32l.c
new file mode 100644
index 0000000..48e0b33
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-altivec32l.c
@@ -0,0 +1,168 @@
+/* THIS FILE IS GENERATED. Original: powerpc-isa205-altivec32l.xml */
+
+#include "defs.h"
+#include "gdbtypes.h"
+#include "target-descriptions.h"
+
+struct target_desc *tdesc_powerpc_isa205_altivec32l;
+static void
+initialize_tdesc_powerpc_isa205_altivec32l (void)
+{
+ struct target_desc *result = allocate_target_description ();
+ struct tdesc_feature *feature;
+ struct type *field_type, *type;
+
+ set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common"));
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.core");
+ tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "pc", 64, 1, NULL, 32, "code_ptr");
+ tdesc_create_reg (feature, "msr", 65, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "lr", 67, 1, NULL, 32, "code_ptr");
+ tdesc_create_reg (feature, "ctr", 68, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu");
+ tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "fpscr", 70, 1, "float", 64, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux");
+ tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "trap", 72, 1, NULL, 32, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec");
+ field_type = tdesc_named_type (feature, "ieee_single");
+ type = init_vector_type (field_type, 4);
+ TYPE_NAME (type) = xstrdup ("v4f");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int32");
+ type = init_vector_type (field_type, 4);
+ TYPE_NAME (type) = xstrdup ("v4i32");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int16");
+ type = init_vector_type (field_type, 8);
+ TYPE_NAME (type) = xstrdup ("v8i16");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int8");
+ type = init_vector_type (field_type, 16);
+ TYPE_NAME (type) = xstrdup ("v16i8");
+ tdesc_record_type (feature, type);
+
+ type = init_composite_type (NULL, TYPE_CODE_UNION);
+ TYPE_NAME (type) = xstrdup ("vec128");
+ field_type = tdesc_named_type (feature, "uint128");
+ append_composite_type_field (type, xstrdup ("uint128"), field_type);
+ field_type = tdesc_named_type (feature, "v4f");
+ append_composite_type_field (type, xstrdup ("v4_float"), field_type);
+ field_type = tdesc_named_type (feature, "v4i32");
+ append_composite_type_field (type, xstrdup ("v4_int32"), field_type);
+ field_type = tdesc_named_type (feature, "v8i16");
+ append_composite_type_field (type, xstrdup ("v8_int16"), field_type);
+ field_type = tdesc_named_type (feature, "v16i8");
+ append_composite_type_field (type, xstrdup ("v16_int8"), field_type);
+ TYPE_VECTOR (type) = 1;
+ tdesc_record_type (feature, type);
+
+ tdesc_create_reg (feature, "vr0", 73, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr1", 74, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr2", 75, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr3", 76, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr4", 77, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr5", 78, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr6", 79, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr7", 80, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr8", 81, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr9", 82, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr10", 83, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr11", 84, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr12", 85, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr13", 86, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr14", 87, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr15", 88, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr16", 89, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr17", 90, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr18", 91, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr19", 92, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr20", 93, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr21", 94, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr22", 95, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr23", 96, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr24", 97, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr25", 98, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr26", 99, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr27", 100, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr28", 101, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr29", 102, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr30", 103, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr31", 104, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vscr", 105, 1, "vector", 32, "int");
+ tdesc_create_reg (feature, "vrsave", 106, 1, "vector", 32, "int");
+
+ tdesc_powerpc_isa205_altivec32l = result;
+}
diff --git a/gdb/features/rs6000/powerpc-isa205-altivec32l.xml b/gdb/features/rs6000/powerpc-isa205-altivec32l.xml
new file mode 100644
index 0000000..d28746b
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-altivec32l.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2008 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!-- PowerPC UISA - a PPC processor as viewed by user-level code. A UISA-only
+ view of the PowerPC. Includes Linux-only special "registers" and AltiVec
+ vector registers. -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+ <architecture>powerpc:common</architecture>
+ <xi:include href="power-core.xml"/>
+ <xi:include href="power-fpu-isa205.xml"/>
+ <xi:include href="power-linux.xml"/>
+ <xi:include href="power-altivec.xml"/>
+</target>
diff --git a/gdb/features/rs6000/powerpc-isa205-altivec64l.c b/gdb/features/rs6000/powerpc-isa205-altivec64l.c
new file mode 100644
index 0000000..eac9149
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-altivec64l.c
@@ -0,0 +1,168 @@
+/* THIS FILE IS GENERATED. Original: powerpc-isa205-altivec64l.xml */
+
+#include "defs.h"
+#include "gdbtypes.h"
+#include "target-descriptions.h"
+
+struct target_desc *tdesc_powerpc_isa205_altivec64l;
+static void
+initialize_tdesc_powerpc_isa205_altivec64l (void)
+{
+ struct target_desc *result = allocate_target_description ();
+ struct tdesc_feature *feature;
+ struct type *field_type, *type;
+
+ set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common64"));
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.core");
+ tdesc_create_reg (feature, "r0", 0, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r1", 1, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r2", 2, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r3", 3, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r4", 4, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r5", 5, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r6", 6, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r7", 7, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r16", 16, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r17", 17, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r18", 18, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r19", 19, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r20", 20, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r21", 21, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r22", 22, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r23", 23, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r24", 24, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r25", 25, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r26", 26, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r27", 27, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r28", 28, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r29", 29, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r30", 30, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r31", 31, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "pc", 64, 1, NULL, 64, "code_ptr");
+ tdesc_create_reg (feature, "msr", 65, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "lr", 67, 1, NULL, 64, "code_ptr");
+ tdesc_create_reg (feature, "ctr", 68, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu");
+ tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "fpscr", 70, 1, "float", 64, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux");
+ tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 64, "int");
+ tdesc_create_reg (feature, "trap", 72, 1, NULL, 64, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec");
+ field_type = tdesc_named_type (feature, "ieee_single");
+ type = init_vector_type (field_type, 4);
+ TYPE_NAME (type) = xstrdup ("v4f");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int32");
+ type = init_vector_type (field_type, 4);
+ TYPE_NAME (type) = xstrdup ("v4i32");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int16");
+ type = init_vector_type (field_type, 8);
+ TYPE_NAME (type) = xstrdup ("v8i16");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int8");
+ type = init_vector_type (field_type, 16);
+ TYPE_NAME (type) = xstrdup ("v16i8");
+ tdesc_record_type (feature, type);
+
+ type = init_composite_type (NULL, TYPE_CODE_UNION);
+ TYPE_NAME (type) = xstrdup ("vec128");
+ field_type = tdesc_named_type (feature, "uint128");
+ append_composite_type_field (type, xstrdup ("uint128"), field_type);
+ field_type = tdesc_named_type (feature, "v4f");
+ append_composite_type_field (type, xstrdup ("v4_float"), field_type);
+ field_type = tdesc_named_type (feature, "v4i32");
+ append_composite_type_field (type, xstrdup ("v4_int32"), field_type);
+ field_type = tdesc_named_type (feature, "v8i16");
+ append_composite_type_field (type, xstrdup ("v8_int16"), field_type);
+ field_type = tdesc_named_type (feature, "v16i8");
+ append_composite_type_field (type, xstrdup ("v16_int8"), field_type);
+ TYPE_VECTOR (type) = 1;
+ tdesc_record_type (feature, type);
+
+ tdesc_create_reg (feature, "vr0", 73, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr1", 74, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr2", 75, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr3", 76, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr4", 77, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr5", 78, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr6", 79, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr7", 80, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr8", 81, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr9", 82, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr10", 83, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr11", 84, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr12", 85, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr13", 86, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr14", 87, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr15", 88, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr16", 89, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr17", 90, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr18", 91, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr19", 92, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr20", 93, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr21", 94, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr22", 95, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr23", 96, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr24", 97, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr25", 98, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr26", 99, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr27", 100, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr28", 101, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr29", 102, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr30", 103, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr31", 104, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vscr", 105, 1, "vector", 32, "int");
+ tdesc_create_reg (feature, "vrsave", 106, 1, "vector", 32, "int");
+
+ tdesc_powerpc_isa205_altivec64l = result;
+}
diff --git a/gdb/features/rs6000/powerpc-isa205-altivec64l.xml b/gdb/features/rs6000/powerpc-isa205-altivec64l.xml
new file mode 100644
index 0000000..9453068
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-altivec64l.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2008 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!-- PowerPC UISA - a PPC processor as viewed by user-level code. A UISA-only
+ view of the PowerPC. Includes Linux-only special "registers" and AltiVec
+ vector registers. -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+ <architecture>powerpc:common64</architecture>
+ <xi:include href="power64-core.xml"/>
+ <xi:include href="power-fpu-isa205.xml"/>
+ <xi:include href="power64-linux.xml"/>
+ <xi:include href="power-altivec.xml"/>
+</target>
diff --git a/gdb/features/rs6000/powerpc-isa205-vsx32l.c b/gdb/features/rs6000/powerpc-isa205-vsx32l.c
new file mode 100644
index 0000000..a5eeed5
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-vsx32l.c
@@ -0,0 +1,202 @@
+/* THIS FILE IS GENERATED. Original: powerpc-isa205-vsx32l.xml */
+
+#include "defs.h"
+#include "gdbtypes.h"
+#include "target-descriptions.h"
+
+struct target_desc *tdesc_powerpc_isa205_vsx32l;
+static void
+initialize_tdesc_powerpc_isa205_vsx32l (void)
+{
+ struct target_desc *result = allocate_target_description ();
+ struct tdesc_feature *feature;
+ struct type *field_type, *type;
+
+ set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common"));
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.core");
+ tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "pc", 64, 1, NULL, 32, "code_ptr");
+ tdesc_create_reg (feature, "msr", 65, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "lr", 67, 1, NULL, 32, "code_ptr");
+ tdesc_create_reg (feature, "ctr", 68, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu");
+ tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "fpscr", 70, 1, "float", 64, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux");
+ tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 32, "int");
+ tdesc_create_reg (feature, "trap", 72, 1, NULL, 32, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec");
+ field_type = tdesc_named_type (feature, "ieee_single");
+ type = init_vector_type (field_type, 4);
+ TYPE_NAME (type) = xstrdup ("v4f");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int32");
+ type = init_vector_type (field_type, 4);
+ TYPE_NAME (type) = xstrdup ("v4i32");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int16");
+ type = init_vector_type (field_type, 8);
+ TYPE_NAME (type) = xstrdup ("v8i16");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int8");
+ type = init_vector_type (field_type, 16);
+ TYPE_NAME (type) = xstrdup ("v16i8");
+ tdesc_record_type (feature, type);
+
+ type = init_composite_type (NULL, TYPE_CODE_UNION);
+ TYPE_NAME (type) = xstrdup ("vec128");
+ field_type = tdesc_named_type (feature, "uint128");
+ append_composite_type_field (type, xstrdup ("uint128"), field_type);
+ field_type = tdesc_named_type (feature, "v4f");
+ append_composite_type_field (type, xstrdup ("v4_float"), field_type);
+ field_type = tdesc_named_type (feature, "v4i32");
+ append_composite_type_field (type, xstrdup ("v4_int32"), field_type);
+ field_type = tdesc_named_type (feature, "v8i16");
+ append_composite_type_field (type, xstrdup ("v8_int16"), field_type);
+ field_type = tdesc_named_type (feature, "v16i8");
+ append_composite_type_field (type, xstrdup ("v16_int8"), field_type);
+ TYPE_VECTOR (type) = 1;
+ tdesc_record_type (feature, type);
+
+ tdesc_create_reg (feature, "vr0", 73, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr1", 74, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr2", 75, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr3", 76, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr4", 77, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr5", 78, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr6", 79, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr7", 80, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr8", 81, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr9", 82, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr10", 83, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr11", 84, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr12", 85, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr13", 86, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr14", 87, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr15", 88, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr16", 89, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr17", 90, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr18", 91, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr19", 92, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr20", 93, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr21", 94, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr22", 95, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr23", 96, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr24", 97, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr25", 98, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr26", 99, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr27", 100, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr28", 101, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr29", 102, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr30", 103, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr31", 104, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vscr", 105, 1, "vector", 32, "int");
+ tdesc_create_reg (feature, "vrsave", 106, 1, "vector", 32, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.vsx");
+ tdesc_create_reg (feature, "vs0h", 107, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs1h", 108, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs2h", 109, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs3h", 110, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs4h", 111, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs5h", 112, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs6h", 113, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs7h", 114, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs8h", 115, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs9h", 116, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs10h", 117, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs11h", 118, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs12h", 119, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs13h", 120, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs14h", 121, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs15h", 122, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs16h", 123, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs17h", 124, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs18h", 125, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs19h", 126, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs20h", 127, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs21h", 128, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs22h", 129, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs23h", 130, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs24h", 131, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs25h", 132, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs26h", 133, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs27h", 134, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs28h", 135, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs29h", 136, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs30h", 137, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs31h", 138, 1, NULL, 64, "uint64");
+
+ tdesc_powerpc_isa205_vsx32l = result;
+}
diff --git a/gdb/features/rs6000/powerpc-isa205-vsx32l.xml b/gdb/features/rs6000/powerpc-isa205-vsx32l.xml
new file mode 100644
index 0000000..92fed0a
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-vsx32l.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2008 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!-- PowerPC UISA - a PPC processor as viewed by user-level code. A UISA-only
+ view of the PowerPC. Includes Linux-only special "registers", AltiVec
+ and VSX vector registers. -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+ <architecture>powerpc:common</architecture>
+ <xi:include href="power-core.xml"/>
+ <xi:include href="power-fpu-isa205.xml"/>
+ <xi:include href="power-linux.xml"/>
+ <xi:include href="power-altivec.xml"/>
+ <xi:include href="power-vsx.xml"/>
+</target>
diff --git a/gdb/features/rs6000/powerpc-isa205-vsx64l.c b/gdb/features/rs6000/powerpc-isa205-vsx64l.c
new file mode 100644
index 0000000..f7cfe8f
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-vsx64l.c
@@ -0,0 +1,202 @@
+/* THIS FILE IS GENERATED. Original: powerpc-isa205-vsx64l.xml */
+
+#include "defs.h"
+#include "gdbtypes.h"
+#include "target-descriptions.h"
+
+struct target_desc *tdesc_powerpc_isa205_vsx64l;
+static void
+initialize_tdesc_powerpc_isa205_vsx64l (void)
+{
+ struct target_desc *result = allocate_target_description ();
+ struct tdesc_feature *feature;
+ struct type *field_type, *type;
+
+ set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common64"));
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.core");
+ tdesc_create_reg (feature, "r0", 0, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r1", 1, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r2", 2, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r3", 3, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r4", 4, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r5", 5, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r6", 6, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r7", 7, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r16", 16, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r17", 17, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r18", 18, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r19", 19, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r20", 20, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r21", 21, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r22", 22, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r23", 23, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r24", 24, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r25", 25, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r26", 26, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r27", 27, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r28", 28, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r29", 29, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r30", 30, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "r31", 31, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "pc", 64, 1, NULL, 64, "code_ptr");
+ tdesc_create_reg (feature, "msr", 65, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32");
+ tdesc_create_reg (feature, "lr", 67, 1, NULL, 64, "code_ptr");
+ tdesc_create_reg (feature, "ctr", 68, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu");
+ tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double");
+ tdesc_create_reg (feature, "fpscr", 70, 1, "float", 64, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux");
+ tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 64, "int");
+ tdesc_create_reg (feature, "trap", 72, 1, NULL, 64, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec");
+ field_type = tdesc_named_type (feature, "ieee_single");
+ type = init_vector_type (field_type, 4);
+ TYPE_NAME (type) = xstrdup ("v4f");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int32");
+ type = init_vector_type (field_type, 4);
+ TYPE_NAME (type) = xstrdup ("v4i32");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int16");
+ type = init_vector_type (field_type, 8);
+ TYPE_NAME (type) = xstrdup ("v8i16");
+ tdesc_record_type (feature, type);
+
+ field_type = tdesc_named_type (feature, "int8");
+ type = init_vector_type (field_type, 16);
+ TYPE_NAME (type) = xstrdup ("v16i8");
+ tdesc_record_type (feature, type);
+
+ type = init_composite_type (NULL, TYPE_CODE_UNION);
+ TYPE_NAME (type) = xstrdup ("vec128");
+ field_type = tdesc_named_type (feature, "uint128");
+ append_composite_type_field (type, xstrdup ("uint128"), field_type);
+ field_type = tdesc_named_type (feature, "v4f");
+ append_composite_type_field (type, xstrdup ("v4_float"), field_type);
+ field_type = tdesc_named_type (feature, "v4i32");
+ append_composite_type_field (type, xstrdup ("v4_int32"), field_type);
+ field_type = tdesc_named_type (feature, "v8i16");
+ append_composite_type_field (type, xstrdup ("v8_int16"), field_type);
+ field_type = tdesc_named_type (feature, "v16i8");
+ append_composite_type_field (type, xstrdup ("v16_int8"), field_type);
+ TYPE_VECTOR (type) = 1;
+ tdesc_record_type (feature, type);
+
+ tdesc_create_reg (feature, "vr0", 73, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr1", 74, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr2", 75, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr3", 76, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr4", 77, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr5", 78, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr6", 79, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr7", 80, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr8", 81, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr9", 82, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr10", 83, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr11", 84, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr12", 85, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr13", 86, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr14", 87, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr15", 88, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr16", 89, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr17", 90, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr18", 91, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr19", 92, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr20", 93, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr21", 94, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr22", 95, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr23", 96, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr24", 97, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr25", 98, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr26", 99, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr27", 100, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr28", 101, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr29", 102, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr30", 103, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vr31", 104, 1, NULL, 128, "vec128");
+ tdesc_create_reg (feature, "vscr", 105, 1, "vector", 32, "int");
+ tdesc_create_reg (feature, "vrsave", 106, 1, "vector", 32, "int");
+
+ feature = tdesc_create_feature (result, "org.gnu.gdb.power.vsx");
+ tdesc_create_reg (feature, "vs0h", 107, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs1h", 108, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs2h", 109, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs3h", 110, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs4h", 111, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs5h", 112, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs6h", 113, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs7h", 114, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs8h", 115, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs9h", 116, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs10h", 117, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs11h", 118, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs12h", 119, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs13h", 120, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs14h", 121, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs15h", 122, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs16h", 123, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs17h", 124, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs18h", 125, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs19h", 126, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs20h", 127, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs21h", 128, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs22h", 129, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs23h", 130, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs24h", 131, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs25h", 132, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs26h", 133, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs27h", 134, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs28h", 135, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs29h", 136, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs30h", 137, 1, NULL, 64, "uint64");
+ tdesc_create_reg (feature, "vs31h", 138, 1, NULL, 64, "uint64");
+
+ tdesc_powerpc_isa205_vsx64l = result;
+}
diff --git a/gdb/features/rs6000/powerpc-isa205-vsx64l.xml b/gdb/features/rs6000/powerpc-isa205-vsx64l.xml
new file mode 100644
index 0000000..0436d51
--- /dev/null
+++ b/gdb/features/rs6000/powerpc-isa205-vsx64l.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2008 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!-- PowerPC UISA - a PPC processor as viewed by user-level code. A UISA-only
+ view of the PowerPC. Includes Linux-only special "registers", AltiVec
+ and VSX vector registers. -->
+
+<!DOCTYPE target SYSTEM "gdb-target.dtd">
+<target>
+ <architecture>powerpc:common64</architecture>
+ <xi:include href="power64-core.xml"/>
+ <xi:include href="power-fpu-isa205.xml"/>
+ <xi:include href="power64-linux.xml"/>
+ <xi:include href="power-altivec.xml"/>
+ <xi:include href="power-vsx.xml"/>
+</target>
diff --git a/gdb/fork-child.c b/gdb/fork-child.c
index 86c5e91..75b9d4e 100644
--- a/gdb/fork-child.c
+++ b/gdb/fork-child.c
@@ -118,7 +118,7 @@ escape_bang_in_quoted_argument (const char *shell_file)
/* This function is NOT reentrant. Some of the variables have been
made static to ensure that they survive the vfork call. */
-void
+int
fork_inferior (char *exec_file_arg, char *allargs, char **env,
void (*traceme_fun) (void), void (*init_trace_fun) (int),
void (*pre_trace_fun) (void), char *shell_file_arg)
@@ -408,11 +408,13 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
/* Now that we have a child process, make it our target, and
initialize anything target-vector-specific that needs
initializing. */
- (*init_trace_fun) (pid);
+ if (init_trace_fun)
+ (*init_trace_fun) (pid);
/* We are now in the child process of interest, having exec'd the
correct program, and are poised at the first instruction of the
new program. */
+ return pid;
}
/* Accept NTRAPS traps from the inferior. */
@@ -434,21 +436,18 @@ startup_inferior (int ntraps)
{
int resume_signal = TARGET_SIGNAL_0;
ptid_t resume_ptid;
+ ptid_t event_ptid;
struct target_waitstatus ws;
memset (&ws, 0, sizeof (ws));
- resume_ptid = target_wait (pid_to_ptid (-1), &ws);
-
- /* Mark all threads non-executing. */
- set_executing (pid_to_ptid (-1), 0);
+ event_ptid = target_wait (pid_to_ptid (-1), &ws);
- /* In all-stop mode, resume all threads. */
- if (!non_stop)
- resume_ptid = pid_to_ptid (-1);
+ if (ws.kind == TARGET_WAITKIND_IGNORE)
+ /* The inferior didn't really stop, keep waiting. */
+ continue;
switch (ws.kind)
{
- case TARGET_WAITKIND_IGNORE:
case TARGET_WAITKIND_SPURIOUS:
case TARGET_WAITKIND_LOADED:
case TARGET_WAITKIND_FORKED:
@@ -456,6 +455,7 @@ startup_inferior (int ntraps)
case TARGET_WAITKIND_SYSCALL_ENTRY:
case TARGET_WAITKIND_SYSCALL_RETURN:
/* Ignore gracefully during startup of the inferior. */
+ switch_to_thread (event_ptid);
break;
case TARGET_WAITKIND_SIGNALLED:
@@ -480,13 +480,21 @@ startup_inferior (int ntraps)
/* Handle EXEC signals as if they were SIGTRAP signals. */
xfree (ws.value.execd_pathname);
resume_signal = TARGET_SIGNAL_TRAP;
+ switch_to_thread (event_ptid);
break;
case TARGET_WAITKIND_STOPPED:
resume_signal = ws.value.sig;
+ switch_to_thread (event_ptid);
break;
}
+ /* In all-stop mode, resume all threads. */
+ if (!non_stop)
+ resume_ptid = pid_to_ptid (-1);
+ else
+ resume_ptid = event_ptid;
+
if (resume_signal != TARGET_SIGNAL_TRAP)
{
/* Let shell child handle its own signals in its own way. */
@@ -519,6 +527,11 @@ startup_inferior (int ntraps)
target_resume (resume_ptid, 0, TARGET_SIGNAL_0);
}
}
+
+ /* Mark all threads non-executing. */
+ set_executing (pid_to_ptid (-1), 0);
+
+ stop_pc = read_pc ();
}
/* Implement the "unset exec-wrapper" command. */
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index bf8f015..a9239fb 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -999,6 +999,85 @@ frv_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
}
+/* Examine the instruction pointed to by PC. If it corresponds to
+ a call to __main, return the address of the next instruction.
+ Otherwise, return PC. */
+
+static CORE_ADDR
+frv_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+ gdb_byte buf[4];
+ unsigned long op;
+ CORE_ADDR orig_pc = pc;
+
+ if (target_read_memory (pc, buf, 4))
+ return pc;
+ op = extract_unsigned_integer (buf, 4);
+
+ /* In PIC code, GR15 may be loaded from some offset off of FP prior
+ to the call instruction.
+
+ Skip over this instruction if present. It won't be present in
+ non-PIC code, and even in PIC code, it might not be present.
+ (This is due to the fact that GR15, the FDPIC register, already
+ contains the correct value.)
+
+ The general form of the LDI is given first, followed by the
+ specific instruction with the GRi and GRk filled in as FP and
+ GR15.
+
+ ldi @(GRi, d12), GRk
+ P KKKKKK 0110010 IIIIII SSSSSSSSSSSS = 0x00c80000
+ 0 000000 1111111 000000 000000000000 = 0x01fc0000
+ . . . . . . . .
+ ldi @(FP, d12), GR15
+ P KKKKKK 0110010 IIIIII SSSSSSSSSSSS = 0x1ec82000
+ 0 001111 1111111 000010 000000000000 = 0x7ffff000
+ . . . . . . . . */
+
+ if ((op & 0x7ffff000) == 0x1ec82000)
+ {
+ pc += 4;
+ if (target_read_memory (pc, buf, 4))
+ return orig_pc;
+ op = extract_unsigned_integer (buf, 4);
+ }
+
+ /* The format of an FRV CALL instruction is as follows:
+
+ call label24
+ P HHHHHH 0001111 LLLLLLLLLLLLLLLLLL = 0x003c0000
+ 0 000000 1111111 000000000000000000 = 0x01fc0000
+ . . . . . . . .
+
+ where label24 is constructed by concatenating the H bits with the
+ L bits. The call target is PC + (4 * sign_ext(label24)). */
+
+ if ((op & 0x01fc0000) == 0x003c0000)
+ {
+ LONGEST displ;
+ CORE_ADDR call_dest;
+ struct minimal_symbol *s;
+
+ displ = ((op & 0xfe000000) >> 7) | (op & 0x0003ffff);
+ if ((displ & 0x00800000) != 0)
+ displ |= ~((LONGEST) 0x00ffffff);
+
+ call_dest = pc + 4 * displ;
+ s = lookup_minimal_symbol_by_pc (call_dest);
+
+ if (s != NULL
+ && SYMBOL_LINKAGE_NAME (s) != NULL
+ && strcmp (SYMBOL_LINKAGE_NAME (s), "__main") == 0)
+ {
+ pc += 4;
+ return pc;
+ }
+ }
+ return orig_pc;
+}
+
+
static struct frv_unwind_cache *
frv_frame_unwind_cache (struct frame_info *this_frame,
void **this_prologue_cache)
@@ -1501,6 +1580,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pseudo_register_write (gdbarch, frv_pseudo_register_write);
set_gdbarch_skip_prologue (gdbarch, frv_skip_prologue);
+ set_gdbarch_skip_main_prologue (gdbarch, frv_skip_main_prologue);
set_gdbarch_breakpoint_from_pc (gdbarch, frv_breakpoint_from_pc);
set_gdbarch_adjust_breakpoint_address
(gdbarch, frv_adjust_breakpoint_address);
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index aa9a455..dd6ad7f 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -240,6 +240,7 @@ struct gdbarch
gdbarch_target_signal_from_host_ftype *target_signal_from_host;
gdbarch_target_signal_to_host_ftype *target_signal_to_host;
gdbarch_record_special_symbol_ftype *record_special_symbol;
+ int has_global_solist;
};
@@ -371,6 +372,7 @@ struct gdbarch startup_gdbarch =
default_target_signal_from_host, /* target_signal_from_host */
default_target_signal_to_host, /* target_signal_to_host */
0, /* record_special_symbol */
+ 0, /* has_global_solist */
/* startup_gdbarch() */
};
@@ -623,6 +625,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of target_signal_from_host, invalid_p == 0 */
/* Skip verify of target_signal_to_host, invalid_p == 0 */
/* Skip verify of record_special_symbol, has predicate */
+ /* Skip verify of has_global_solist, invalid_p == 0 */
buf = ui_file_xstrdup (log, &dummy);
make_cleanup (xfree, buf);
if (strlen (buf) > 0)
@@ -832,6 +835,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: get_longjmp_target = <0x%lx>\n",
(long) gdbarch->get_longjmp_target);
fprintf_unfiltered (file,
+ "gdbarch_dump: has_global_solist = %s\n",
+ plongest (gdbarch->has_global_solist));
+ fprintf_unfiltered (file,
"gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
plongest (gdbarch->have_nonsteppable_watchpoint));
fprintf_unfiltered (file,
@@ -3237,6 +3243,23 @@ set_gdbarch_record_special_symbol (struct gdbarch *gdbarch,
gdbarch->record_special_symbol = record_special_symbol;
}
+int
+gdbarch_has_global_solist (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of has_global_solist, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_solist called\n");
+ return gdbarch->has_global_solist;
+}
+
+void
+set_gdbarch_has_global_solist (struct gdbarch *gdbarch,
+ int has_global_solist)
+{
+ gdbarch->has_global_solist = has_global_solist;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index bc8298d..35f8a36 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -811,6 +811,15 @@ typedef void (gdbarch_record_special_symbol_ftype) (struct gdbarch *gdbarch, str
extern void gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym);
extern void set_gdbarch_record_special_symbol (struct gdbarch *gdbarch, gdbarch_record_special_symbol_ftype *record_special_symbol);
+/* True if the list of shared libraries is one and only for all
+ processes, as opposed to a list of shared libraries per inferior.
+ When this property is true, GDB assumes that since shared libraries
+ are shared across processes, so is all code. Hence, GDB further
+ assumes an inserted breakpoint location is visible to all processes. */
+
+extern int gdbarch_has_global_solist (struct gdbarch *gdbarch);
+extern void set_gdbarch_has_global_solist (struct gdbarch *gdbarch, int has_global_solist);
+
extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 0c513a5..79ca862 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -707,6 +707,13 @@ m:int:target_signal_to_host:enum target_signal ts:ts::default_target_signal_to_h
# Record architecture-specific information from the symbol table.
M:void:record_special_symbol:struct objfile *objfile, asymbol *sym:objfile, sym
+
+# True if the list of shared libraries is one and only for all
+# processes, as opposed to a list of shared libraries per inferior.
+# When this property is true, GDB assumes that since shared libraries
+# are shared across processes, so is all code. Hence, GDB further
+# assumes an inserted breakpoint location is visible to all processes.
+v:int:has_global_solist:::0:0::0
EOF
}
diff --git a/gdb/gdbinit.in b/gdb/gdbinit.in
index 1a080dc..ffb7f53 100644
--- a/gdb/gdbinit.in
+++ b/gdb/gdbinit.in
@@ -15,3 +15,20 @@ dir @srcdir@/../bfd
dir @srcdir@
dir .
set prompt (top-gdb)
+
+define pdie
+ if $argc == 1
+ call dump_die ($arg0, 1)
+ else
+ if $argc == 2
+ call dump_die ($arg0, $arg1)
+ else
+ printf "Syntax: pdie die [depth]\n"
+ end
+ end
+end
+
+document pdie
+Pretty print a DWARF DIE.
+Syntax: pdie die [depth]
+end
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 0b5d10b..6928840 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,45 @@
+2008-11-19 Bob Wilson <bob.wilson@acm.org>
+
+ * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
+ (xtensa_regmap_table): Add entry for scompare1.
+
+2008-11-18 Thiago Jung Bauermann <bauerman@br.ibm.com>
+
+ * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
+ powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
+ powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
+ powerpc-isa205-64l.o, powerpc-isa205-64l.c,
+ powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
+ powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
+ * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
+ XML target descriptions.
+ * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
+ when inferior is running on an ISA 2.05 or later processor. Add
+ special case to return offset for full 64-bit slot of FPSCR when
+ in 32-bits.
+
+2008-11-14 Daniel Gutson <dgutson@codesourcery.com>
+
+ * Makefile.in (SFILES, clean): Added sparc64 files.
+ (reg-sparc64.o, reg-sparc64.c): New.
+ * configure.srv (sparc*-*-linux*): New configuration.
+ * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
+ syscall arguments for SPARC.
+ (regsets_store_inferior_registers): Likewise.
+ * linux-sparc-low.c: New file.
+
+2008-10-21 Doug Evans <dje@google.com>
+
+ * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
+ (READLINE_DIR,READLINE_DEP): Delete.
+ (INTERNAL_CFLAGS): Update.
+ (LINTFLAGS): Update.
+
+2008-10-10 Pedro Alves <pedro@codesourcery.com>
+
+ * server.c (handle_v_run): If GDB didn't specify an argv, use the
+ whole argv from the last run, not just argv[0].
+
2008-09-08 Pedro Alves <pedro@codesourcery.com>
* regcache.c (new_register_cache): Return NULL if the register
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 6740060..641ebe2 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -70,17 +70,6 @@ CC-LD=${CC}
INCLUDE_DIR = ${srcdir}/../../include
INCLUDE_DEP = $$(INCLUDE_DIR)
-# Where are the BFD library?
-BFD_DIR = ../../bfd
-BFD = $(BFD_DIR)/libbfd.a
-BFD_SRC = $(srcdir)/$(BFD_DIR)
-BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC)
-
-# Where is the source dir for the READLINE library? Traditionally in .. or .
-# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
-READLINE_DIR = ${srcdir}/../readline
-READLINE_DEP = $$(READLINE_DIR)
-
# All the includes used for CFLAGS and for lint.
# -I. for config files.
# -I${srcdir} for our headers.
@@ -100,7 +89,7 @@ CFLAGS = @CFLAGS@
# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
INTERNAL_CFLAGS = $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \
- ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS}
+ ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS}
# LDFLAGS is specifically reserved for setting from the command line
# when running make.
@@ -112,7 +101,7 @@ VERSION = gdbserver-4.12.3
DIST=gdb
LINT=/usr/5bin/lint
-LINTFLAGS= $(BFD_CFLAGS)
+LINTFLAGS=
# All source files that go into linking GDB remote server.
@@ -128,7 +117,8 @@ SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c \
$(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \
$(srcdir)/linux-ppc-low.c \
$(srcdir)/linux-s390-low.c \
- $(srcdir)/linux-sh-low.c $(srcdir)/linux-x86-64-low.c \
+ $(srcdir)/linux-sh-low.c $(srcdir)/linux-sparc-low.c \
+ $(srcdir)/linux-x86-64-low.c \
$(srcdir)/linux-xtensa-low.c \
$(srcdir)/win32-arm-low.c $(srcdir)/win32-i386-low.c \
$(srcdir)/win32-low.c $(srcdir)/wincecompat.c \
@@ -220,12 +210,16 @@ clean:
rm -f version.c
rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m32r.c reg-m68k.c
- rm -f reg-sh.c reg-spu.c reg-x86-64.c reg-i386-linux.c
+ rm -f reg-sh.c reg-sparc.c reg-spu.c reg-x86-64.c reg-i386-linux.c
rm -f reg-cris.c reg-crisv32.c reg-x86-64-linux.c reg-xtensa.c
rm -f arm-with-iwmmxt.c mips-linux.c mips64-linux.c
rm -f powerpc-32l.c powerpc-64l.c powerpc-e500l.c
rm -f powerpc-altivec32l.c powerpc-vsx32l.c powerpc-altivec64l.c
- rm -f powerpc-vsx64l.c xml-builtin.c stamp-xml
+ rm -f powerpc-vsx64l.c
+ rm -f powerpc-isa205-32l.c powerpc-isa205-64l.c
+ rm -f powerpc-isa205-altivec32l.c powerpc-isa205-vsx32l.c powerpc-isa205-altivec64l.c
+ rm -f powerpc-isa205-vsx64l.c
+ rm -f xml-builtin.c stamp-xml
maintainer-clean realclean distclean: clean
rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log
@@ -372,6 +366,15 @@ powerpc-altivec32l.c : $(srcdir)/../regformats/rs6000/powerpc-altivec32l.dat $(r
powerpc-vsx32l.o : powerpc-vsx32l.c $(regdef_h)
powerpc-vsx32l.c : $(srcdir)/../regformats/rs6000/powerpc-vsx32l.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-vsx32l.dat powerpc-vsx32l.c
+powerpc-isa205-32l.o : powerpc-isa205-32l.c $(regdef_h)
+powerpc-isa205-32l.c : $(srcdir)/../regformats/rs6000/powerpc-isa205-32l.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-isa205-32l.dat powerpc-isa205-32l.c
+powerpc-isa205-altivec32l.o : powerpc-isa205-altivec32l.c $(regdef_h)
+powerpc-isa205-altivec32l.c : $(srcdir)/../regformats/rs6000/powerpc-isa205-altivec32l.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-isa205-altivec32l.dat powerpc-isa205-altivec32l.c
+powerpc-isa205-vsx32l.o : powerpc-isa205-vsx32l.c $(regdef_h)
+powerpc-isa205-vsx32l.c : $(srcdir)/../regformats/rs6000/powerpc-isa205-vsx32l.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-isa205-vsx32l.dat powerpc-isa205-vsx32l.c
powerpc-e500l.o : powerpc-e500l.c $(regdef_h)
powerpc-e500l.c : $(srcdir)/../regformats/rs6000/powerpc-e500l.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-e500l.dat powerpc-e500l.c
@@ -384,6 +387,15 @@ powerpc-altivec64l.c : $(srcdir)/../regformats/rs6000/powerpc-altivec64l.dat $(r
powerpc-vsx64l.o : powerpc-vsx64l.c $(regdef_h)
powerpc-vsx64l.c : $(srcdir)/../regformats/rs6000/powerpc-vsx64l.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-vsx64l.dat powerpc-vsx64l.c
+powerpc-isa205-64l.o : powerpc-isa205-64l.c $(regdef_h)
+powerpc-isa205-64l.c : $(srcdir)/../regformats/rs6000/powerpc-isa205-64l.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-isa205-64l.dat powerpc-isa205-64l.c
+powerpc-isa205-altivec64l.o : powerpc-isa205-altivec64l.c $(regdef_h)
+powerpc-isa205-altivec64l.c : $(srcdir)/../regformats/rs6000/powerpc-isa205-altivec64l.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-isa205-altivec64l.dat powerpc-isa205-altivec64l.c
+powerpc-isa205-vsx64l.o : powerpc-isa205-vsx64l.c $(regdef_h)
+powerpc-isa205-vsx64l.c : $(srcdir)/../regformats/rs6000/powerpc-isa205-vsx64l.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-isa205-vsx64l.dat powerpc-isa205-vsx64l.c
reg-s390.o : reg-s390.c $(regdef_h)
reg-s390.c : $(srcdir)/../regformats/reg-s390.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-s390.dat reg-s390.c
@@ -393,6 +405,9 @@ reg-s390x.c : $(srcdir)/../regformats/reg-s390x.dat $(regdat_sh)
reg-sh.o : reg-sh.c $(regdef_h)
reg-sh.c : $(srcdir)/../regformats/reg-sh.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-sh.dat reg-sh.c
+reg-sparc64.o : reg-sparc64.c $(regdef_h)
+reg-sparc64.c : $(srcdir)/../regformats/reg-sparc64.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-sparc64.dat reg-sparc64.c
reg-spu.o : reg-spu.c $(regdef_h)
reg-spu.c : $(srcdir)/../regformats/reg-spu.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-spu.dat reg-spu.c
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index ef7a8eb..624acce 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -103,24 +103,37 @@ case "${target}" in
powerpc*-*-linux*) srv_regobj="powerpc-32l.o"
srv_regobj="${srv_regobj} powerpc-altivec32l.o"
srv_regobj="${srv_regobj} powerpc-vsx32l.o"
+ srv_regobj="${srv_regobj} powerpc-isa205-32l.o"
+ srv_regobj="${srv_regobj} powerpc-isa205-altivec32l.o"
+ srv_regobj="${srv_regobj} powerpc-isa205-vsx32l.o"
srv_regobj="${srv_regobj} powerpc-e500l.o"
srv_regobj="${srv_regobj} powerpc-64l.o"
srv_regobj="${srv_regobj} powerpc-altivec64l.o"
srv_regobj="${srv_regobj} powerpc-vsx64l.o"
+ srv_regobj="${srv_regobj} powerpc-isa205-64l.o"
+ srv_regobj="${srv_regobj} powerpc-isa205-altivec64l.o"
+ srv_regobj="${srv_regobj} powerpc-isa205-vsx64l.o"
srv_tgtobj="linux-low.o linux-ppc-low.o"
srv_xmlfiles="rs6000/powerpc-32l.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-vsx32l.xml"
+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-32l.xml"
+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-altivec32l.xml"
+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-vsx32l.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/power-altivec.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/power-vsx.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/power-core.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/power-linux.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/power-fpu.xml"
+ srv_xmlfiles="${srv_xmlfiles} rs6000/power-fpu-isa205.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-e500l.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/power-spe.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-64l.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec64l.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-vsx64l.xml"
+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-64l.xml"
+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-altivec64l.xml"
+ srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-isa205-vsx64l.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/power64-core.xml"
srv_xmlfiles="${srv_xmlfiles} rs6000/power64-linux.xml"
srv_linux_usrregs=yes
@@ -139,6 +152,11 @@ case "${target}" in
srv_linux_regsets=yes
srv_linux_thread_db=yes
;;
+ sparc*-*-linux*) srv_regobj=reg-sparc64.o
+ srv_tgtobj="linux-low.o linux-sparc-low.o"
+ srv_linux_regsets=yes
+ srv_linux_thread_db=yes
+ ;;
spu*-*-*) srv_regobj=reg-spu.o
srv_tgtobj="spu-low.o"
;;
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 722953e..4766cc9 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -1523,7 +1523,11 @@ regsets_fetch_inferior_registers ()
}
buf = malloc (regset->size);
+#ifndef __sparc__
res = ptrace (regset->get_request, inferior_pid, 0, buf);
+#else
+ res = ptrace (regset->get_request, inferior_pid, buf, 0);
+#endif
if (res < 0)
{
if (errno == EIO)
@@ -1576,7 +1580,11 @@ regsets_store_inferior_registers ()
/* First fill the buffer with the current register set contents,
in case there are any items in the kernel's regset that are
not in gdbserver's regcache. */
+#ifndef __sparc__
res = ptrace (regset->get_request, inferior_pid, 0, buf);
+#else
+ res = ptrace (regset->get_request, inferior_pid, buf, 0);
+#endif
if (res == 0)
{
@@ -1584,7 +1592,11 @@ regsets_store_inferior_registers ()
regset->fill_function (buf);
/* Only now do we write the register set. */
- res = ptrace (regset->set_request, inferior_pid, 0, buf);
+#ifndef __sparc__
+ res = ptrace (regset->set_request, inferior_pid, 0, buf);
+#else
+ res = ptrace (regset->set_request, inferior_pid, buf, 0);
+#endif
}
if (res < 0)
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index a7bd83f..4b6ac30 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -28,6 +28,7 @@
#define PPC_FEATURE_HAS_VSX 0x00000080
#define PPC_FEATURE_HAS_ALTIVEC 0x10000000
#define PPC_FEATURE_HAS_SPE 0x00800000
+#define PPC_FEATURE_ARCH_2_05 0x00001000
static unsigned long ppc_hwcap;
@@ -38,6 +39,12 @@ void init_registers_powerpc_32l (void);
void init_registers_powerpc_altivec32l (void);
/* Defined in auto-generated file powerpc-vsx32l.c. */
void init_registers_powerpc_vsx32l (void);
+/* Defined in auto-generated file powerpc-isa205-32l.c. */
+void init_registers_powerpc_isa205_32l (void);
+/* Defined in auto-generated file powerpc-isa205-altivec32l.c. */
+void init_registers_powerpc_isa205_altivec32l (void);
+/* Defined in auto-generated file powerpc-isa205-vsx32l.c. */
+void init_registers_powerpc_isa205_vsx32l (void);
/* Defined in auto-generated file powerpc-e500l.c. */
void init_registers_powerpc_e500l (void);
/* Defined in auto-generated file powerpc-64l.c. */
@@ -46,6 +53,12 @@ void init_registers_powerpc_64l (void);
void init_registers_powerpc_altivec64l (void);
/* Defined in auto-generated file powerpc-vsx64l.c. */
void init_registers_powerpc_vsx64l (void);
+/* Defined in auto-generated file powerpc-isa205-64l.c. */
+void init_registers_powerpc_isa205_64l (void);
+/* Defined in auto-generated file powerpc-isa205-altivec64l.c. */
+void init_registers_powerpc_isa205_altivec64l (void);
+/* Defined in auto-generated file powerpc-isa205-vsx64l.c. */
+void init_registers_powerpc_isa205_vsx64l (void);
#define ppc_num_regs 73
@@ -260,9 +273,20 @@ ppc_arch_setup (void)
{
ppc_get_hwcap (&ppc_hwcap);
if (ppc_hwcap & PPC_FEATURE_HAS_VSX)
- init_registers_powerpc_vsx64l ();
+ {
+ if (ppc_hwcap & PPC_FEATURE_ARCH_2_05)
+ init_registers_powerpc_isa205_vsx64l ();
+ else
+ init_registers_powerpc_vsx64l ();
+ }
else if (ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC)
- init_registers_powerpc_altivec64l ();
+ {
+ if (ppc_hwcap & PPC_FEATURE_ARCH_2_05)
+ init_registers_powerpc_isa205_altivec64l ();
+ else
+ init_registers_powerpc_altivec64l ();
+ }
+
return;
}
#endif
@@ -272,10 +296,19 @@ ppc_arch_setup (void)
ppc_get_hwcap (&ppc_hwcap);
if (ppc_hwcap & PPC_FEATURE_HAS_VSX)
- init_registers_powerpc_vsx32l ();
+ {
+ if (ppc_hwcap & PPC_FEATURE_ARCH_2_05)
+ init_registers_powerpc_isa205_vsx32l ();
+ else
+ init_registers_powerpc_vsx32l ();
+ }
else if (ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC)
- init_registers_powerpc_altivec32l ();
-
+ {
+ if (ppc_hwcap & PPC_FEATURE_ARCH_2_05)
+ init_registers_powerpc_isa205_altivec32l ();
+ else
+ init_registers_powerpc_altivec32l ();
+ }
/* On 32-bit machines, check for SPE registers.
Set the low target's regmap field as appropriately. */
@@ -286,6 +319,12 @@ ppc_arch_setup (void)
init_registers_powerpc_e500l ();
the_low_target.regmap = ppc_regmap_e500;
}
+
+ /* If the FPSCR is 64-bit wide, we need to fetch the whole 64-bit
+ slot and not just its second word. The PT_FPSCR supplied in a
+ 32-bit GDB compilation doesn't reflect this. */
+ if (register_size (70) == 8)
+ ppc_regmap[70] = (48 + 2*32) * sizeof (long);
#endif
}
diff --git a/gdb/gdbserver/linux-sparc-low.c b/gdb/gdbserver/linux-sparc-low.c
new file mode 100644
index 0000000..bda274e
--- /dev/null
+++ b/gdb/gdbserver/linux-sparc-low.c
@@ -0,0 +1,287 @@
+/* Low level interface to ptrace, for the remote server for GDB.
+ Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ 2006, 2007, 2008 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "server.h"
+#include "linux-low.h"
+
+#include <sys/ptrace.h>
+
+#include "gdb_proc_service.h"
+
+/* 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
+
+#ifdef HAVE_SYS_REG_H
+#include <sys/reg.h>
+#endif
+
+#define INSN_SIZE 4
+
+#define SPARC_R_REGS_NUM 32
+#define SPARC_F_REGS_NUM 48
+#define SPARC_CONTROL_REGS_NUM 6
+
+#define sparc_num_regs (SPARC_R_REGS_NUM + SPARC_F_REGS_NUM + SPARC_CONTROL_REGS_NUM)
+
+/* Each offset is multiplied by 8, because of the register size.
+ These offsets apply to the buffer sent/filled by ptrace.
+ Additionally, the array elements order corresponds to the .dat file, and the
+ gdb's registers enumeration order. */
+
+static int sparc_regmap[] = {
+ /* These offsets correspond to GET/SETREGSET. */
+ -1, 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, /* g0 .. g7 */
+ 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, /* o0 .. o5, sp, o7 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* l0 .. l7 */
+ -1, -1, -1, -1, -1, -1, -1, -1, /* i0 .. i5, fp, i7 */
+
+ /* Floating point registers offsets correspond to GET/SETFPREGSET. */
+ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4, /* f0 .. f7 */
+ 8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4, /* f8 .. f15 */
+ 16*4, 17*4, 18*4, 19*4, 20*4, 21*4, 22*4, 23*4, /* f16 .. f23 */
+ 24*4, 25*4, 26*4, 27*4, 28*4, 29*4, 30*4, 31*4, /* f24 .. f31 */
+
+ /* F32 offset starts next to f31: 31*4+4 = 16 * 8. */
+ 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8, /* f32 .. f46 */
+ 24*8, 25*8, 26*8, 27*8, 28*8, 29*8, 30*8, 31*8, /* f48 .. f62 */
+
+ 17 *8, /* pc */
+ 18 *8, /* npc */
+ 16 *8, /* state */
+ /* FSR offset also corresponds to GET/SETFPREGSET, ans is placed next to f62. */
+ 32 *8, /* fsr */
+ -1, /* fprs */
+ /* Y register is 32-bits length, but gdb takes care of that. */
+ 19 *8, /* y */
+
+};
+
+
+struct regs_range_t
+{
+ int regno_start;
+ int regno_end;
+};
+
+static const struct regs_range_t gregs_ranges[] = {
+ { 0, 31 }, /* g0 .. i7 */
+ { 80, 82 }, /* pc .. state */
+ { 84, 85 } /* fprs .. y */
+};
+
+#define N_GREGS_RANGES (sizeof (gregs_ranges) / sizeof (struct regs_range_t))
+
+static const struct regs_range_t fpregs_ranges[] = {
+ { 32, 79 }, /* f0 .. f62 */
+ { 83, 83 } /* fsr */
+};
+
+#define N_FPREGS_RANGES (sizeof (fpregs_ranges) / sizeof (struct regs_range_t))
+
+/* Defined in auto-generated file reg-sparc64.c. */
+void init_registers_sparc64 (void);
+
+static int
+sparc_cannot_store_register (int regno)
+{
+ return (regno >= sparc_num_regs || sparc_regmap[regno] == -1);
+}
+
+static int
+sparc_cannot_fetch_register (int regno)
+{
+ return (regno >= sparc_num_regs || sparc_regmap[regno] == -1);
+}
+
+static void
+sparc_fill_gregset_to_stack (const void *buf)
+{
+ int i;
+ CORE_ADDR addr = 0;
+ unsigned char tmp_reg_buf[8];
+ const int l0_regno = find_regno("l0");
+ const int i7_regno = l0_regno + 15;
+
+ /* These registers have to be stored in the stack. */
+ memcpy(&addr, ((char *) buf) + sparc_regmap[find_regno("sp")], sizeof(addr));
+
+ addr += BIAS;
+
+ for (i = l0_regno; i <= i7_regno; i++)
+ {
+ collect_register (i, tmp_reg_buf);
+ (*the_target->write_memory) (addr, tmp_reg_buf, sizeof(tmp_reg_buf));
+ addr += sizeof(tmp_reg_buf);
+ }
+}
+
+static void
+sparc_fill_gregset (void *buf)
+{
+ int i;
+ int range;
+
+ for (range = 0; range < N_GREGS_RANGES; range++)
+ for (i = gregs_ranges[range].regno_start; i <= gregs_ranges[range].regno_end; i++)
+ if (sparc_regmap[i] != -1)
+ collect_register (i, ((char *) buf) + sparc_regmap[i]);
+
+ sparc_fill_gregset_to_stack (buf);
+}
+
+static void
+sparc_fill_fpregset (void *buf)
+{
+ int i;
+ int range;
+
+ for (range = 0; range < N_FPREGS_RANGES; range++)
+ for (i = fpregs_ranges[range].regno_start; i <= fpregs_ranges[range].regno_end; i++)
+ collect_register (i, ((char *) buf) + sparc_regmap[i]);
+
+}
+
+static void
+sparc_store_gregset_from_stack (const void *buf)
+{
+ int i;
+ CORE_ADDR addr = 0;
+ unsigned char tmp_reg_buf[8];
+ const int l0_regno = find_regno("l0");
+ const int i7_regno = l0_regno + 15;
+
+ /* These registers have to be obtained from the stack. */
+ memcpy(&addr, ((char *) buf) + sparc_regmap[find_regno("sp")], sizeof(addr));
+
+ addr += BIAS;
+
+ for (i = l0_regno; i <= i7_regno; i++)
+ {
+ (*the_target->read_memory) (addr, tmp_reg_buf, sizeof(tmp_reg_buf));
+ supply_register (i, tmp_reg_buf);
+ addr += sizeof(tmp_reg_buf);
+ }
+}
+
+static void
+sparc_store_gregset (const void *buf)
+{
+ int i;
+ char zerobuf[8];
+ int range;
+
+ memset (zerobuf, 0, sizeof(zerobuf));
+
+ for (range = 0; range < N_GREGS_RANGES; range++)
+ for (i = gregs_ranges[range].regno_start; i <= gregs_ranges[range].regno_end; i++)
+ if (sparc_regmap[i] != -1)
+ supply_register (i, ((char *) buf) + sparc_regmap[i]);
+ else
+ supply_register (i, zerobuf);
+
+ sparc_store_gregset_from_stack (buf);
+}
+
+static void
+sparc_store_fpregset (const void *buf)
+{
+ int i;
+ int range;
+
+ for (range = 0; range < N_FPREGS_RANGES; range++)
+ for (i = fpregs_ranges[range].regno_start; i <= fpregs_ranges[range].regno_end; i++)
+ supply_register (i, ((char *) buf) + sparc_regmap[i]);
+}
+
+extern int debug_threads;
+
+static CORE_ADDR
+sparc_get_pc ()
+{
+ CORE_ADDR pc;
+ collect_register_by_name ("pc", &pc);
+ if (debug_threads)
+ fprintf (stderr, "stop pc is %08lx\n", pc);
+ return pc;
+}
+
+static const unsigned char sparc_breakpoint[INSN_SIZE] = { 0x91, 0xd0, 0x20, 0x01 };
+#define sparc_breakpoint_len INSN_SIZE
+
+
+static int
+sparc_breakpoint_at (CORE_ADDR where)
+{
+ unsigned char insn[INSN_SIZE];
+
+ (*the_target->read_memory) (where, (unsigned char *) insn, sizeof(insn));
+
+ if (memcmp(sparc_breakpoint, insn, sizeof(insn)) == 0)
+ return 1;
+
+ /* If necessary, recognize more trap instructions here. GDB only uses TRAP Always. */
+
+ return 0;
+}
+
+/* We only place breakpoints in empty marker functions, and thread locking
+ is outside of the function. So rather than importing software single-step,
+ we can just run until exit. */
+static CORE_ADDR
+sparc_reinsert_addr ()
+{
+ CORE_ADDR lr;
+ /* O7 is the equivalent to the 'lr' of other archs. */
+ collect_register_by_name ("o7", &lr);
+ return lr;
+}
+
+
+struct regset_info target_regsets[] = {
+ { PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t),
+ GENERAL_REGS,
+ sparc_fill_gregset, sparc_store_gregset },
+ { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof (fpregset_t),
+ FP_REGS,
+ sparc_fill_fpregset, sparc_store_fpregset },
+ { 0, 0, -1, -1, NULL, NULL }
+};
+
+struct linux_target_ops the_low_target = {
+ init_registers_sparc64,
+ sparc_num_regs,
+ /* No regmap needs to be provided since this impl. doesn't use USRREGS. */
+ NULL,
+ sparc_cannot_fetch_register,
+ sparc_cannot_store_register,
+ sparc_get_pc,
+ /* No sparc_set_pc is needed. */
+ NULL,
+ (const unsigned char *) sparc_breakpoint,
+ sparc_breakpoint_len,
+ sparc_reinsert_addr,
+ 0,
+ sparc_breakpoint_at,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL
+};
+
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 60df3d8..4adbf51 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1096,23 +1096,31 @@ handle_v_run (char *own_buf, char *status, int *signal)
if (new_argv[0] == NULL)
{
+ /* GDB didn't specify a program to run. Try to use the argv
+ from the last run: either from the last vRun with a non-empty
+ argv, or from what the user specified if gdbserver was
+ started as: `gdbserver :1234 PROG ARGS'. */
+
if (program_argv == NULL)
{
write_enn (own_buf);
return 0;
}
- new_argv[0] = strdup (program_argv[0]);
+ /* We can reuse the old args. We don't need this then. */
+ free (new_argv);
}
-
- /* Free the old argv. */
- if (program_argv)
+ else
{
- for (pp = program_argv; *pp != NULL; pp++)
- free (*pp);
- free (program_argv);
+ /* Free the old argv. */
+ if (program_argv)
+ {
+ for (pp = program_argv; *pp != NULL; pp++)
+ free (*pp);
+ free (program_argv);
+ }
+ program_argv = new_argv;
}
- program_argv = new_argv;
*signal = start_inferior (program_argv, status);
if (*status == 'T')
diff --git a/gdb/gdbserver/xtensa-xtregs.c b/gdb/gdbserver/xtensa-xtregs.c
index 9faa50d..3371522 100644
--- a/gdb/gdbserver/xtensa-xtregs.c
+++ b/gdb/gdbserver/xtensa-xtregs.c
@@ -28,10 +28,11 @@ typedef struct {
char* name
;} xtensa_regtable_t;
-#define XTENSA_ELF_XTREG_SIZE 0
+#define XTENSA_ELF_XTREG_SIZE 4
const xtensa_regtable_t xtensa_regmap_table[] = {
/* gnum,gofs,cpofs,ofs,siz,cp, dbnum, name */
+ { 44, 176, 0, 0, 4, -1, 0x020c, "scompare1" },
{ 0 }
};
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 0fb53fb..cac20f7 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -168,6 +168,9 @@ struct thread_info
at. */
bpstat stop_bpstat;
+ /* True if this thread has been explicitly requested to stop. */
+ int stop_requested;
+
/* Private data used by the target vector implementation. */
struct private_thread_info *private;
};
@@ -239,6 +242,13 @@ extern void switch_to_thread (ptid_t ptid);
If PIDGET (PTID) is -1, marks all threads. */
extern void set_running (ptid_t ptid, int running);
+/* Marks or clears thread(s) PTID as having been requested to stop.
+ If PTID is MINUS_ONE_PTID, applies to all threads. If
+ ptid_is_pid(PTID) is true, applies to all threads of the process
+ pointed at by PTID. If STOP, then the THREAD_STOP_REQUESTED
+ observer is called with PTID as argument. */
+extern void set_stop_requested (ptid_t ptid, int stop);
+
/* NOTE: Since the thread state is not a boolean, most times, you do
not want to check it with negation. If you really want to check if
the thread is stopped,
@@ -285,7 +295,8 @@ extern struct cmd_list_element *thread_cmd_list;
`set print thread-events'. */
extern int print_thread_events;
-extern void print_thread_info (struct ui_out *uiout, int thread);
+extern void print_thread_info (struct ui_out *uiout, int thread,
+ int pid);
extern struct cleanup *make_cleanup_restore_current_thread (void);
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index c1bb765..5b9d0e8 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1324,7 +1324,7 @@ get_vptr_fieldno (struct type *type, struct type **basetypep)
{
/* If the type comes from a different objfile we can't cache
it, it may have a different lifetime. PR 2384 */
- if (TYPE_OBJFILE (type) == TYPE_OBJFILE (baseclass))
+ if (TYPE_OBJFILE (type) == TYPE_OBJFILE (basetype))
{
TYPE_VPTR_FIELDNO (type) = fieldno;
TYPE_VPTR_BASETYPE (type) = basetype;
@@ -2434,6 +2434,20 @@ print_arg_types (struct field *args, int nargs, int spaces)
}
}
+int
+field_is_static (struct field *f)
+{
+ /* "static" fields are the fields whose location is not relative
+ to the address of the enclosing struct. It would be nice to
+ have a dedicated flag that would be set for static fields when
+ the type is being created. But in practice, checking the field
+ loc_kind should give us an accurate answer (at least as long as
+ we assume that DWARF block locations are not going to be used
+ for static fields). FIXME? */
+ return (FIELD_LOC_KIND (*f) == FIELD_LOC_KIND_PHYSNAME
+ || FIELD_LOC_KIND (*f) == FIELD_LOC_KIND_PHYSADDR);
+}
+
static void
dump_fn_fieldlists (struct type *type, int spaces)
{
@@ -2556,35 +2570,6 @@ print_cplus_stuff (struct type *type, int spaces)
}
}
-static void
-print_bound_type (int bt)
-{
- switch (bt)
- {
- case BOUND_CANNOT_BE_DETERMINED:
- printf_filtered ("(BOUND_CANNOT_BE_DETERMINED)");
- break;
- case BOUND_BY_REF_ON_STACK:
- printf_filtered ("(BOUND_BY_REF_ON_STACK)");
- break;
- case BOUND_BY_VALUE_ON_STACK:
- printf_filtered ("(BOUND_BY_VALUE_ON_STACK)");
- break;
- case BOUND_BY_REF_IN_REG:
- printf_filtered ("(BOUND_BY_REF_IN_REG)");
- break;
- case BOUND_BY_VALUE_IN_REG:
- printf_filtered ("(BOUND_BY_VALUE_IN_REG)");
- break;
- case BOUND_SIMPLE:
- printf_filtered ("(BOUND_SIMPLE)");
- break;
- default:
- printf_filtered (_("(unknown bound type)"));
- break;
- }
-}
-
static struct obstack dont_print_type_obstack;
void
@@ -2719,14 +2704,6 @@ recursive_dump_type (struct type *type, int spaces)
}
puts_filtered ("\n");
printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type));
- printfi_filtered (spaces, "upper_bound_type 0x%x ",
- TYPE_ARRAY_UPPER_BOUND_TYPE (type));
- print_bound_type (TYPE_ARRAY_UPPER_BOUND_TYPE (type));
- puts_filtered ("\n");
- printfi_filtered (spaces, "lower_bound_type 0x%x ",
- TYPE_ARRAY_LOWER_BOUND_TYPE (type));
- print_bound_type (TYPE_ARRAY_LOWER_BOUND_TYPE (type));
- puts_filtered ("\n");
printfi_filtered (spaces, "objfile ");
gdb_print_host_address (TYPE_OBJFILE (type), gdb_stdout);
printf_filtered ("\n");
@@ -3000,6 +2977,7 @@ copy_type_recursive (struct objfile *objfile,
nfields = TYPE_NFIELDS (type);
TYPE_FIELDS (new_type) = xmalloc (sizeof (struct field) * nfields);
+ memset (TYPE_FIELDS (new_type), 0, sizeof (struct field) * nfields);
for (i = 0; i < nfields; i++)
{
TYPE_FIELD_ARTIFICIAL (new_type, i) =
@@ -3012,18 +2990,25 @@ copy_type_recursive (struct objfile *objfile,
if (TYPE_FIELD_NAME (type, i))
TYPE_FIELD_NAME (new_type, i) =
xstrdup (TYPE_FIELD_NAME (type, i));
- if (TYPE_FIELD_STATIC_HAS_ADDR (type, i))
- SET_FIELD_PHYSADDR (TYPE_FIELD (new_type, i),
- TYPE_FIELD_STATIC_PHYSADDR (type, i));
- else if (TYPE_FIELD_STATIC (type, i))
- SET_FIELD_PHYSNAME (TYPE_FIELD (new_type, i),
- xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type,
- i)));
- else
+ switch (TYPE_FIELD_LOC_KIND (type, i))
{
- TYPE_FIELD_BITPOS (new_type, i) =
- TYPE_FIELD_BITPOS (type, i);
- TYPE_FIELD_STATIC_KIND (new_type, i) = 0;
+ case FIELD_LOC_KIND_BITPOS:
+ SET_FIELD_BITPOS (TYPE_FIELD (new_type, i),
+ TYPE_FIELD_BITPOS (type, i));
+ break;
+ case FIELD_LOC_KIND_PHYSADDR:
+ SET_FIELD_PHYSADDR (TYPE_FIELD (new_type, i),
+ TYPE_FIELD_STATIC_PHYSADDR (type, i));
+ break;
+ case FIELD_LOC_KIND_PHYSNAME:
+ SET_FIELD_PHYSNAME (TYPE_FIELD (new_type, i),
+ xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type,
+ i)));
+ break;
+ default:
+ internal_error (__FILE__, __LINE__,
+ _("Unexpected type field location kind: %d"),
+ TYPE_FIELD_LOC_KIND (type, i));
}
}
}
@@ -3056,6 +3041,28 @@ copy_type_recursive (struct objfile *objfile,
return new_type;
}
+/* Make a copy of the given TYPE, except that the pointer & reference
+ types are not preserved.
+
+ This function assumes that the given type has an associated objfile.
+ This objfile is used to allocate the new type. */
+
+struct type *
+copy_type (const struct type *type)
+{
+ struct type *new_type;
+
+ gdb_assert (TYPE_OBJFILE (type) != NULL);
+
+ new_type = alloc_type (TYPE_OBJFILE (type));
+ TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type);
+ TYPE_LENGTH (new_type) = TYPE_LENGTH (type);
+ memcpy (TYPE_MAIN_TYPE (new_type), TYPE_MAIN_TYPE (type),
+ sizeof (struct main_type));
+
+ return new_type;
+}
+
static struct type *
build_flt (int bit, char *name, const struct floatformat **floatformats)
{
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 38b9a7a..333eb31 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -28,6 +28,7 @@
/* Forward declarations for prototypes. */
struct field;
struct block;
+struct value_print_options;
/* Some macros for char-based bitfields. */
@@ -316,17 +317,15 @@ enum type_instance_flag_value
#define TYPE_ADDRESS_CLASS_ALL(t) (TYPE_INSTANCE_FLAGS(t) \
& TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL)
+/* Determine which field of the union main_type.fields[x].loc is used. */
-/* 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
-};
+enum field_loc_kind
+ {
+ FIELD_LOC_KIND_BITPOS, /* bitpos */
+ FIELD_LOC_KIND_PHYSADDR, /* physaddr */
+ FIELD_LOC_KIND_PHYSNAME, /* physname */
+ FIELD_LOC_KIND_DWARF_BLOCK /* dwarf_block */
+ };
/* This structure is space-critical.
Its layout has been tweaked to reduce the space used. */
@@ -337,12 +336,6 @@ struct main_type
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;
-
/* Flags about this type. These fields appear at this location
because they packs nicely here. See the TYPE_* macros for
documentation about these fields. */
@@ -455,19 +448,23 @@ struct main_type
CORE_ADDR physaddr;
char *physname;
+
+ /* The field location can be computed by evaluating the following DWARF
+ block. This can be used in Fortran variable-length arrays, for
+ instance. */
+
+ struct dwarf2_locexpr_baton *dwarf_block;
}
loc;
/* For a function or member type, this is 1 if the argument is marked
artificial. Artificial arguments should not be shown to the
- user. */
+ user. For TYPE_CODE_RANGE it is set if the specific bound is not
+ defined. */
unsigned int artificial : 1;
- /* This flag is zero for non-static fields, 1 for fields whose location
- is specified by the label loc.physname, and 2 for fields whose location
- is specified by loc.physaddr. */
-
- unsigned int static_kind : 2;
+ /* Discriminant for union field_location. */
+ ENUM_BITFIELD(field_loc_kind) loc_kind : 2;
/* Size of this field, in bits, or zero if not packed.
For an unpacked field, the field's type's length
@@ -817,10 +814,10 @@ extern void allocate_cplus_struct_type (struct type *);
/* Moto-specific stuff for FORTRAN arrays */
-#define TYPE_ARRAY_UPPER_BOUND_TYPE(thistype) \
- TYPE_MAIN_TYPE(thistype)->upper_bound_type
-#define TYPE_ARRAY_LOWER_BOUND_TYPE(thistype) \
- TYPE_MAIN_TYPE(thistype)->lower_bound_type
+#define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \
+ (TYPE_FIELD_ARTIFICIAL((TYPE_FIELD_TYPE((arraytype),0)),1))
+#define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
+ (TYPE_FIELD_ARTIFICIAL((TYPE_FIELD_TYPE((arraytype),0)),0))
#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
(TYPE_FIELD_BITPOS((TYPE_FIELD_TYPE((arraytype),0)),1))
@@ -855,20 +852,34 @@ extern void allocate_cplus_struct_type (struct type *);
#define FIELD_TYPE(thisfld) ((thisfld).type)
#define FIELD_NAME(thisfld) ((thisfld).name)
+#define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind)
#define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos)
+#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
+#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
+#define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block)
+#define SET_FIELD_BITPOS(thisfld, bitpos) \
+ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \
+ FIELD_BITPOS (thisfld) = (bitpos))
+#define SET_FIELD_PHYSNAME(thisfld, name) \
+ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
+ FIELD_STATIC_PHYSNAME (thisfld) = (name))
+#define SET_FIELD_PHYSADDR(thisfld, addr) \
+ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
+ FIELD_STATIC_PHYSADDR (thisfld) = (addr))
+#define SET_FIELD_DWARF_BLOCK(thisfld, addr) \
+ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_DWARF_BLOCK, \
+ FIELD_DWARF_BLOCK (thisfld) = (addr))
#define FIELD_ARTIFICIAL(thisfld) ((thisfld).artificial)
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
-#define FIELD_STATIC_KIND(thisfld) ((thisfld).static_kind)
-#define FIELD_PHYSNAME(thisfld) ((thisfld).loc.physname)
-#define FIELD_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
-#define SET_FIELD_PHYSNAME(thisfld, name) \
- ((thisfld).static_kind = 1, FIELD_PHYSNAME(thisfld) = (name))
-#define SET_FIELD_PHYSADDR(thisfld, name) \
- ((thisfld).static_kind = 2, FIELD_PHYSADDR(thisfld) = (name))
+
#define TYPE_FIELD(thistype, n) TYPE_MAIN_TYPE(thistype)->fields[n]
#define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n))
#define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n))
-#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS(TYPE_FIELD(thistype,n))
+#define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n))
+#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
+#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
+#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
+#define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
#define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0)
@@ -903,12 +914,6 @@ extern void allocate_cplus_struct_type (struct type *);
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n)))
-#define TYPE_FIELD_STATIC(thistype, n) (TYPE_MAIN_TYPE (thistype)->fields[n].static_kind != 0)
-#define TYPE_FIELD_STATIC_KIND(thistype, n) TYPE_MAIN_TYPE (thistype)->fields[n].static_kind
-#define TYPE_FIELD_STATIC_HAS_ADDR(thistype, n) (TYPE_MAIN_TYPE (thistype)->fields[n].static_kind == 2)
-#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_PHYSNAME(TYPE_FIELD(thistype, n))
-#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_PHYSADDR(TYPE_FIELD(thistype, n))
-
#define TYPE_FN_FIELDLISTS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists
#define TYPE_FN_FIELDLIST(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists[n]
#define TYPE_FN_FIELDLIST1(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists[n].fn_fields
@@ -1238,10 +1243,13 @@ extern int rank_one_type (struct type *, struct type *);
extern void recursive_dump_type (struct type *, int);
+extern int field_is_static (struct field *);
+
/* printcmd.c */
-extern void print_scalar_formatted (const void *, struct type *, int, int,
- struct ui_file *);
+extern void print_scalar_formatted (const void *, struct type *,
+ const struct value_print_options *,
+ int, struct ui_file *);
extern int can_dereference (struct type *);
@@ -1255,4 +1263,6 @@ extern struct type *copy_type_recursive (struct objfile *objfile,
struct type *type,
htab_t copied_types);
+extern struct type *copy_type (const struct type *type);
+
#endif /* GDBTYPES_H */
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index f214abb..56a8b1f 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -1425,7 +1425,7 @@ inf_continue (struct inf *inf)
/* The inferior used for all gdb target ops. */
-struct inf *current_inferior = 0;
+struct inf *gnu_current_inf = 0;
/* The inferior being waited for by gnu_wait. Since GDB is decidely not
multi-threaded, we don't bother to lock this. */
@@ -1443,7 +1443,7 @@ gnu_wait (ptid_t ptid, struct target_waitstatus *status)
} msg;
error_t err;
struct proc *thread;
- struct inf *inf = current_inferior;
+ struct inf *inf = gnu_current_inf;
extern int exc_server (mach_msg_header_t *, mach_msg_header_t *);
extern int msg_reply_server (mach_msg_header_t *, mach_msg_header_t *);
@@ -1958,7 +1958,7 @@ gnu_resume (ptid_t ptid, int step, enum target_signal sig)
{
struct proc *step_thread = 0;
int resume_all;
- struct inf *inf = current_inferior;
+ struct inf *inf = gnu_current_inf;
inf_debug (inf, "ptid = %s, step = %d, sig = %d",
target_pid_to_str (ptid), step, sig);
@@ -2030,22 +2030,22 @@ gnu_resume (ptid_t ptid, int step, enum target_signal sig)
static void
gnu_kill_inferior (void)
{
- struct proc *task = current_inferior->task;
+ struct proc *task = gnu_current_inf->task;
if (task)
{
proc_debug (task, "terminating...");
task_terminate (task->port);
- inf_set_pid (current_inferior, -1);
+ inf_set_pid (gnu_current_inf, -1);
}
target_mourn_inferior ();
}
/* Clean up after the inferior dies. */
static void
-gnu_mourn_inferior (void)
+gnu_mourn_inferior (struct target_ops *ops)
{
- inf_debug (current_inferior, "rip");
- inf_detach (current_inferior);
+ inf_debug (gnu_current_inf, "rip");
+ inf_detach (gnu_current_inf);
unpush_target (&gnu_ops);
generic_mourn_inferior ();
}
@@ -2057,9 +2057,9 @@ gnu_mourn_inferior (void)
static int
inf_pick_first_thread (void)
{
- if (current_inferior->task && current_inferior->threads)
+ if (gnu_current_inf->task && gnu_current_inf->threads)
/* The first thread. */
- return current_inferior->threads->tid;
+ return gnu_current_inf->threads->tid;
else
/* What may be the next thread. */
return next_thread_id;
@@ -2068,13 +2068,14 @@ inf_pick_first_thread (void)
static struct inf *
cur_inf (void)
{
- if (!current_inferior)
- current_inferior = make_inf ();
- return current_inferior;
+ if (!gnu_current_inf)
+ gnu_current_inf = make_inf ();
+ return gnu_current_inf;
}
static void
-gnu_create_inferior (char *exec_file, char *allargs, char **env,
+gnu_create_inferior (struct target_ops *ops,
+ char *exec_file, char *allargs, char **env,
int from_tty)
{
struct inf *inf = cur_inf ();
@@ -2139,7 +2140,7 @@ gnu_can_run (void)
/* Attach to process PID, then initialize for debugging it
and wait for the trace-trap that results from attaching. */
static void
-gnu_attach (char *args, int from_tty)
+gnu_attach (struct target_ops *ops, char *args, int from_tty)
{
int pid;
char *exec_file;
@@ -2205,7 +2206,7 @@ gnu_attach (char *args, int from_tty)
previously attached. It *might* work if the program was
started via fork. */
static void
-gnu_detach (char *args, int from_tty)
+gnu_detach (struct target_ops *ops, char *args, int from_tty)
{
int pid;
@@ -2214,15 +2215,15 @@ gnu_detach (char *args, int from_tty)
char *exec_file = get_exec_file (0);
if (exec_file)
printf_unfiltered ("Detaching from program `%s' pid %d\n",
- exec_file, current_inferior->pid);
+ exec_file, gnu_current_inf->pid);
else
- printf_unfiltered ("Detaching from pid %d\n", current_inferior->pid);
+ printf_unfiltered ("Detaching from pid %d\n", gnu_current_inf->pid);
gdb_flush (gdb_stdout);
}
- pid = current_inferior->pid;
+ pid = gnu_current_inf->pid;
- inf_detach (current_inferior);
+ inf_detach (gnu_current_inf);
inferior_ptid = null_ptid;
detach_inferior (pid);
@@ -2233,8 +2234,8 @@ gnu_detach (char *args, int from_tty)
static void
gnu_terminal_init_inferior (void)
{
- gdb_assert (current_inferior);
- terminal_init_inferior_with_pgrp (current_inferior->pid);
+ gdb_assert (gnu_current_inf);
+ terminal_init_inferior_with_pgrp (gnu_current_inf->pid);
}
/* Get ready to modify the registers array. On machines which store
@@ -2262,8 +2263,8 @@ gnu_stop (ptid_t ptid)
static int
gnu_thread_alive (ptid_t ptid)
{
- inf_update_procs (current_inferior);
- return !!inf_tid_to_thread (current_inferior,
+ inf_update_procs (gnu_current_inf);
+ return !!inf_tid_to_thread (gnu_current_inf,
ptid_get_tid (ptid));
}
@@ -2478,16 +2479,16 @@ gnu_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
struct mem_attrib *attrib,
struct target_ops *target)
{
- task_t task = (current_inferior
- ? (current_inferior->task
- ? current_inferior->task->port : 0)
+ task_t task = (gnu_current_inf
+ ? (gnu_current_inf->task
+ ? gnu_current_inf->task->port : 0)
: 0);
if (task == MACH_PORT_NULL)
return 0;
else
{
- inf_debug (current_inferior, "%s %p[%d] %s %p",
+ inf_debug (gnu_current_inf, "%s %p[%d] %s %p",
write ? "writing" : "reading", (void *) memaddr, len,
write ? "<--" : "-->", myaddr);
if (write)
@@ -2510,9 +2511,9 @@ gnu_find_memory_regions (int (*func) (CORE_ADDR,
vm_address_t region_address, last_region_address, last_region_end;
vm_prot_t last_protection;
- if (current_inferior == 0 || current_inferior->task == 0)
+ if (gnu_current_inf == 0 || gnu_current_inf->task == 0)
return 0;
- task = current_inferior->task->port;
+ task = gnu_current_inf->task->port;
if (task == MACH_PORT_NULL)
return 0;
@@ -2595,7 +2596,7 @@ proc_string (struct proc *proc)
static char *
gnu_pid_to_str (ptid_t ptid)
{
- struct inf *inf = current_inferior;
+ struct inf *inf = gnu_current_inf;
int tid = ptid_get_tid (ptid);
struct proc *thread = inf_tid_to_thread (inf, tid);
@@ -3423,7 +3424,7 @@ flush_inferior_icache (CORE_ADDR pc, int amount)
vm_machine_attribute_val_t flush = MATTR_VAL_ICACHE_FLUSH;
error_t ret;
- ret = vm_machine_attribute (current_inferior->task->port,
+ ret = vm_machine_attribute (gnu_current_inf->task->port,
pc,
amount,
MATTR_CACHE,
diff --git a/gdb/gnu-nat.h b/gdb/gnu-nat.h
index d37cd35..855c273 100644
--- a/gdb/gnu-nat.h
+++ b/gdb/gnu-nat.h
@@ -25,7 +25,7 @@
struct inf;
-extern struct inf *current_inferior;
+extern struct inf *gnu_current_inf;
/* Converts a GDB pid to a struct proc. */
struct proc *inf_tid_to_thread (struct inf *inf, int tid);
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index d978303..a7ab137 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -184,8 +184,9 @@ static int go32_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
static void go32_files_info (struct target_ops *target);
static void go32_stop (ptid_t);
static void go32_kill_inferior (void);
-static void go32_create_inferior (char *exec_file, char *args, char **env, int from_tty);
-static void go32_mourn_inferior (void);
+static void go32_create_inferior (struct target_ops *ops, char *exec_file,
+ char *args, char **env, int from_tty);
+static void go32_mourn_inferior (struct target_ops *ops);
static int go32_can_run (void);
static struct target_ops go32_ops;
@@ -306,7 +307,7 @@ go32_close (int quitting)
}
static void
-go32_attach (char *args, int from_tty)
+go32_attach (struct target_ops *ops, char *args, int from_tty)
{
error (_("\
You cannot attach to a running program on this platform.\n\
@@ -314,7 +315,7 @@ Use the `run' command to run DJGPP programs."));
}
static void
-go32_detach (char *args, int from_tty)
+go32_detach (struct target_ops *ops, char *args, int from_tty)
{
}
@@ -674,7 +675,7 @@ go32_create_inferior (char *exec_file, char *args, char **env, int from_tty)
}
static void
-go32_mourn_inferior (void)
+go32_mourn_inferior (struct target_ops *ops)
{
/* We need to make sure all the breakpoint enable bits in the DR7
register are reset when the inferior exits. Otherwise, if they
diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c
index cd69e19..8d2e65b 100644
--- a/gdb/hpux-thread.c
+++ b/gdb/hpux-thread.c
@@ -144,9 +144,9 @@ hpux_thread_open (char *arg, int from_tty)
and wait for the trace-trap that results from attaching. */
static void
-hpux_thread_attach (char *args, int from_tty)
+hpux_thread_attach (struct target_ops *ops, char *args, int from_tty)
{
- deprecated_child_ops.to_attach (args, from_tty);
+ deprecated_child_ops.to_attach (&deprecated_child_ops, args, from_tty);
/* XXX - might want to iterate over all the threads and register them. */
}
@@ -160,9 +160,9 @@ hpux_thread_attach (char *args, int from_tty)
started via the normal ptrace (PTRACE_TRACEME). */
static void
-hpux_thread_detach (char *args, int from_tty)
+hpux_thread_detach (struct target_ops *ops, char *args, int from_tty)
{
- deprecated_child_ops.to_detach (args, from_tty);
+ deprecated_child_ops.to_detach (&deprecated_child_ops, args, from_tty);
}
/* Resume execution of process PID. If STEP is nozero, then
@@ -431,10 +431,11 @@ hpux_thread_notice_signals (ptid_t ptid)
/* Fork an inferior process, and start debugging it with /proc. */
static void
-hpux_thread_create_inferior (char *exec_file, char *allargs, char **env,
- int from_tty)
+hpux_thread_create_inferior (struct target_ops *ops, char *exec_file,
+ char *allargs, char **env, int from_tty)
{
- deprecated_child_ops.to_create_inferior (exec_file, allargs, env, from_tty);
+ deprecated_child_ops.to_create_inferior (&deprecated_child_ops,
+ exec_file, allargs, env, from_tty);
if (hpux_thread_active)
{
@@ -487,7 +488,7 @@ hpux_thread_new_objfile (struct objfile *objfile)
static void
hpux_thread_mourn_inferior (void)
{
- deprecated_child_ops.to_mourn_inferior ();
+ deprecated_child_ops.to_mourn_inferior (&deprecated_child_ops);
}
/* Mark our target-struct as eligible for stray "run" and "attach" commands. */
diff --git a/gdb/i386-dicos-tdep.c b/gdb/i386-dicos-tdep.c
index 99c3d6f..388972b 100644
--- a/gdb/i386-dicos-tdep.c
+++ b/gdb/i386-dicos-tdep.c
@@ -49,11 +49,19 @@ i386_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_solib_ops (gdbarch, &solib_target_so_ops);
+ /* Every process, although has its own address space, sees the same
+ list of shared libraries. */
+ set_gdbarch_has_global_solist (gdbarch, 1);
+
/* There's no (standard definition of) entry point or a guaranteed
text location we could find with a symbol where to place the call
dummy, so we put it on the stack. */
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
set_gdbarch_push_dummy_code (gdbarch, i386_dicos_push_dummy_code);
+
+ /* DICOS rewinds itself. Need to override the i386 default which is
+ to decrement the PC. */
+ set_gdbarch_decr_pc_after_break (gdbarch, 0);
}
/* Look in the elf symbol table of ABFD for a symbol named WANTED.
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index 6545d08..3d71047 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -116,9 +116,9 @@ gnu_fetch_registers (struct regcache *regcache, int regno)
struct proc *thread;
/* Make sure we know about new threads. */
- inf_update_procs (current_inferior);
+ inf_update_procs (gnu_current_inf);
- thread = inf_tid_to_thread (current_inferior,
+ thread = inf_tid_to_thread (gnu_current_inf,
ptid_get_tid (inferior_ptid));
if (!thread)
error (_("Can't fetch registers from thread %s: No such thread"),
@@ -208,9 +208,9 @@ gnu_store_registers (struct regcache *regcache, int regno)
struct gdbarch *gdbarch = get_regcache_arch (regcache);
/* Make sure we know about new threads. */
- inf_update_procs (current_inferior);
+ inf_update_procs (gnu_current_inf);
- thread = inf_tid_to_thread (current_inferior,
+ thread = inf_tid_to_thread (gnu_current_inf,
ptid_get_tid (inferior_ptid));
if (!thread)
error (_("Couldn't store registers into thread %s: No such thread"),
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 2f2e261..aeec169 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -547,9 +547,6 @@ fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr)
pattern was used by the simulator that I was using.) So I ended up
using the pattern seen below. */
-#if 0
-#define IA64_BREAKPOINT 0x00002000040LL
-#endif
#define IA64_BREAKPOINT 0x00003333300LL
static int
diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c
index 8c2c282..95355e8 100644
--- a/gdb/inf-loop.c
+++ b/gdb/inf-loop.c
@@ -50,8 +50,7 @@ inferior_event_handler (enum inferior_event_type event_type,
{
case INF_ERROR:
printf_unfiltered (_("error detected from target.\n"));
- target_async (NULL, 0);
- pop_target ();
+ pop_all_targets_above (file_stratum, 0);
discard_all_intermediate_continuations ();
discard_all_continuations ();
async_enable_stdin ();
@@ -65,8 +64,7 @@ inferior_event_handler (enum inferior_event_type event_type,
if (!catch_errors (fetch_inferior_event_wrapper,
client_data, "", RETURN_MASK_ALL))
{
- target_async (NULL, 0);
- pop_target ();
+ pop_all_targets_above (file_stratum, 0);
discard_all_intermediate_continuations ();
discard_all_continuations ();
async_enable_stdin ();
@@ -91,6 +89,11 @@ inferior_event_handler (enum inferior_event_type event_type,
was_sync = sync_execution;
async_enable_stdin ();
+ /* Do all continuations associated with the whole inferior (not
+ a particular thread). */
+ if (!ptid_equal (inferior_ptid, null_ptid))
+ do_all_inferior_continuations ();
+
/* If we were doing a multi-step (eg: step n, next n), but it
got interrupted by a breakpoint, still do the pending
continuations. The continuation itself is responsible for
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index 57af79a..bf3d0a8 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -35,8 +35,6 @@
#include "inf-child.h"
#include "gdbthread.h"
-/* HACK: Save the ptrace ops returned by inf_ptrace_target. */
-static struct target_ops *ptrace_ops_hack;
#ifdef PT_GET_PROCESS_STATE
@@ -132,12 +130,22 @@ inf_ptrace_me (void)
ptrace (PT_TRACE_ME, 0, (PTRACE_TYPE_ARG3)0, 0);
}
-/* Start tracing PID. */
+/* Start a new inferior Unix child process. EXEC_FILE is the file to
+ run, ALLARGS is a string containing the arguments to the program.
+ ENV is the environment vector to pass. If FROM_TTY is non-zero, be
+ chatty about it. */
static void
-inf_ptrace_him (int pid)
+inf_ptrace_create_inferior (struct target_ops *ops,
+ char *exec_file, char *allargs, char **env,
+ int from_tty)
{
- push_target (ptrace_ops_hack);
+ int pid;
+
+ pid = fork_inferior (exec_file, allargs, env, inf_ptrace_me, NULL,
+ NULL, NULL);
+
+ push_target (ops);
/* On some targets, there must be some explicit synchronization
between the parent and child processes after the debugger
@@ -156,19 +164,6 @@ inf_ptrace_him (int pid)
target_post_startup_inferior (pid_to_ptid (pid));
}
-/* Start a new inferior Unix child process. EXEC_FILE is the file to
- run, ALLARGS is a string containing the arguments to the program.
- ENV is the environment vector to pass. If FROM_TTY is non-zero, be
- chatty about it. */
-
-static void
-inf_ptrace_create_inferior (char *exec_file, char *allargs, char **env,
- int from_tty)
-{
- fork_inferior (exec_file, allargs, env, inf_ptrace_me, inf_ptrace_him,
- NULL, NULL);
-}
-
#ifdef PT_GET_PROCESS_STATE
static void
@@ -189,7 +184,7 @@ inf_ptrace_post_startup_inferior (ptid_t pid)
/* Clean up a rotting corpse of an inferior after it died. */
static void
-inf_ptrace_mourn_inferior (void)
+inf_ptrace_mourn_inferior (struct target_ops *ops)
{
int status;
@@ -199,7 +194,7 @@ inf_ptrace_mourn_inferior (void)
only report its exit status to its original parent. */
waitpid (ptid_get_pid (inferior_ptid), &status, 0);
- unpush_target (ptrace_ops_hack);
+ unpush_target (ops);
generic_mourn_inferior ();
}
@@ -207,7 +202,7 @@ inf_ptrace_mourn_inferior (void)
be chatty about it. */
static void
-inf_ptrace_attach (char *args, int from_tty)
+inf_ptrace_attach (struct target_ops *ops, char *args, int from_tty)
{
char *exec_file;
pid_t pid;
@@ -258,7 +253,7 @@ inf_ptrace_attach (char *args, int from_tty)
target, it should decorate the ptid later with more info. */
add_thread_silent (inferior_ptid);
- push_target (ptrace_ops_hack);
+ push_target(ops);
}
#ifdef PT_GET_PROCESS_STATE
@@ -282,7 +277,7 @@ inf_ptrace_post_attach (int pid)
specified by ARGS. If FROM_TTY is non-zero, be chatty about it. */
static void
-inf_ptrace_detach (char *args, int from_tty)
+inf_ptrace_detach (struct target_ops *ops, char *args, int from_tty)
{
pid_t pid = ptid_get_pid (inferior_ptid);
int sig = 0;
@@ -314,7 +309,7 @@ inf_ptrace_detach (char *args, int from_tty)
inferior_ptid = null_ptid;
detach_inferior (pid);
- unpush_target (ptrace_ops_hack);
+ unpush_target (ops);
}
/* Kill the inferior. */
@@ -644,7 +639,6 @@ inf_ptrace_target (void)
t->to_stop = inf_ptrace_stop;
t->to_xfer_partial = inf_ptrace_xfer_partial;
- ptrace_ops_hack = t;
return t;
}
diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c
index 643cfa2..e8b2971 100644
--- a/gdb/inf-ttrace.c
+++ b/gdb/inf-ttrace.c
@@ -662,8 +662,8 @@ inf_ttrace_him (int pid)
}
static void
-inf_ttrace_create_inferior (char *exec_file, char *allargs, char **env,
- int from_tty)
+inf_ttrace_create_inferior (struct target_ops *ops, char *exec_file,
+ char *allargs, char **env, int from_tty)
{
gdb_assert (inf_ttrace_num_lwps == 0);
gdb_assert (inf_ttrace_num_lwps_in_syscall == 0);
@@ -676,7 +676,7 @@ inf_ttrace_create_inferior (char *exec_file, char *allargs, char **env,
}
static void
-inf_ttrace_mourn_inferior (void)
+inf_ttrace_mourn_inferior (struct target_ops *ops)
{
const int num_buckets = ARRAY_SIZE (inf_ttrace_page_dict.buckets);
int bucket;
@@ -704,7 +704,7 @@ inf_ttrace_mourn_inferior (void)
}
static void
-inf_ttrace_attach (char *args, int from_tty)
+inf_ttrace_attach (struct target_ops *ops, char *args, int from_tty)
{
char *exec_file;
pid_t pid;
@@ -769,7 +769,7 @@ inf_ttrace_attach (char *args, int from_tty)
}
static void
-inf_ttrace_detach (char *args, int from_tty)
+inf_ttrace_detach (struct target_ops *ops, char *args, int from_tty)
{
pid_t pid = ptid_get_pid (inferior_ptid);
int sig = 0;
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 5cc068a..b2ca485 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -339,7 +339,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
gdbarch = get_frame_arch (frame);
if (!gdbarch_push_dummy_call_p (gdbarch))
- error (_("This target does not support function calls"));
+ error (_("This target does not support function calls."));
/* Create a cleanup chain that contains the retbuf (buffer
containing the register values). This chain is create BEFORE the
@@ -529,7 +529,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
}
if (nargs < TYPE_NFIELDS (ftype))
- error (_("too few arguments in function call"));
+ error (_("Too few arguments in function call."));
{
int i;
@@ -699,6 +699,16 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
discard_cleanups (old_cleanups);
}
+ if (! target_has_execution)
+ {
+ /* If we try to restore the inferior status (via the cleanup),
+ we'll crash as the inferior is no longer running. */
+ discard_cleanups (inf_status_cleanup);
+ discard_inferior_status (inf_status);
+ error (_("\
+The program being debugged exited while in a function called from GDB."));
+ }
+
if (stopped_by_random_signal || !stop_stack_dummy)
{
/* Find the name of the function we're about to complain about. */
@@ -744,7 +754,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
error (_("\
The program being debugged was signaled while in a function called from GDB.\n\
GDB has restored the context to what it was before the call.\n\
-To change this behavior use \"set unwindonsignal off\"\n\
+To change this behavior use \"set unwindonsignal off\".\n\
Evaluation of the expression containing the function (%s) will be abandoned."),
name);
}
@@ -764,7 +774,7 @@ Evaluation of the expression containing the function (%s) will be abandoned."),
error (_("\
The program being debugged was signaled while in a function called from GDB.\n\
GDB remains in the frame where the signal was received.\n\
-To change this behavior use \"set unwindonsignal on\"\n\
+To change this behavior use \"set unwindonsignal on\".\n\
Evaluation of the expression containing the function (%s) will be abandoned."),
name);
}
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 6ed6341..810b3b7 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -51,6 +51,7 @@
#include "exceptions.h"
#include "cli/cli-decode.h"
#include "gdbthread.h"
+#include "valprint.h"
/* Functions exported for general use, in inferior.h: */
@@ -85,8 +86,6 @@ static void unset_command (char *, int);
static void float_info (char *, int);
-static void detach_command (char *, int);
-
static void disconnect_command (char *, int);
static void unset_environment_command (char *, int);
@@ -120,8 +119,6 @@ static int strip_bg_char (char **);
void _initialize_infcmd (void);
-#define GO_USAGE "Usage: go <location>\n"
-
#define ERROR_NO_INFERIOR \
if (!target_has_execution) error (_("The program is not being run."));
@@ -271,7 +268,7 @@ construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
/* We over-compute the size. It shouldn't matter. */
for (i = 0; i < argc; ++i)
- length += 2 * strlen (argv[i]) + 1 + 2 * (argv[i][0] == '\0');
+ length += 3 * strlen (argv[i]) + 1 + 2 * (argv[i][0] == '\0');
result = (char *) xmalloc (length);
out = result;
@@ -291,9 +288,21 @@ construct_inferior_arguments (struct gdbarch *gdbarch, int argc, char **argv)
{
for (cp = argv[i]; *cp; ++cp)
{
- if (strchr (special, *cp) != NULL)
- *out++ = '\\';
- *out++ = *cp;
+ if (*cp == '\n')
+ {
+ /* A newline cannot be quoted with a backslash (it
+ just disappears), only by putting it inside
+ quotes. */
+ *out++ = '\'';
+ *out++ = '\n';
+ *out++ = '\'';
+ }
+ else
+ {
+ if (strchr (special, *cp) != NULL)
+ *out++ = '\\';
+ *out++ = *cp;
+ }
}
}
}
@@ -387,7 +396,9 @@ post_create_inferior (struct target_ops *target, int from_tty)
don't need to. */
target_find_description ();
- if (exec_bfd)
+ /* If the solist is global across processes, there's no need to
+ refetch it here. */
+ if (exec_bfd && !gdbarch_has_global_solist (target_gdbarch))
{
/* Sometimes the platform-specific hook loads initial shared
libraries, and sometimes it doesn't. Try to do so first, so
@@ -399,7 +410,10 @@ post_create_inferior (struct target_ops *target, int from_tty)
#else
solib_add (NULL, from_tty, target, auto_solib_add);
#endif
+ }
+ if (exec_bfd)
+ {
/* Create the hooks to handle shared library load and unload
events. */
#ifdef SOLIB_CREATE_INFERIOR_HOOK
@@ -572,6 +586,15 @@ start_command (char *args, int from_tty)
static int
proceed_thread_callback (struct thread_info *thread, void *arg)
{
+ /* We go through all threads individually instead of compressing
+ into a single target `resume_all' request, because some threads
+ may be stopped in internal breakpoints/events, or stopped waiting
+ for its turn in the displaced stepping queue (that is, they are
+ running && !executing). The target side has no idea about why
+ the thread is stopped, so a `resume_all' command would resume too
+ much. If/when GDB gains a way to tell the target `hold this
+ thread stopped until I say otherwise', then we can optimize
+ this. */
if (!is_stopped (thread->ptid))
return 0;
@@ -1055,7 +1078,7 @@ static void
go_command (char *line_no, int from_tty)
{
if (line_no == (char *) NULL || !*line_no)
- printf_filtered (GO_USAGE);
+ printf_filtered (_("Usage: go <location>\n"));
else
{
tbreak_command (line_no, from_tty);
@@ -1284,6 +1307,8 @@ print_return_value (struct type *func_type, struct type *value_type)
if (value)
{
+ struct value_print_options opts;
+
/* Print it. */
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
@@ -1291,7 +1316,8 @@ print_return_value (struct type *func_type, struct type *value_type)
ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
record_latest_value (value));
ui_out_text (uiout, " = ");
- value_print (value, stb->stream, 0, Val_no_prettyprint);
+ get_raw_print_options (&opts);
+ value_print (value, stb->stream, &opts);
ui_out_field_stream (uiout, "return-value", stb);
ui_out_text (uiout, "\n");
do_cleanups (old_chain);
@@ -1366,19 +1392,109 @@ finish_command_continuation_free_arg (void *arg)
xfree (arg);
}
+/* finish_backward -- helper function for finish_command. */
+
+static void
+finish_backward (struct symbol *function)
+{
+ struct symtab_and_line sal;
+ struct thread_info *tp = inferior_thread ();
+ struct breakpoint *breakpoint;
+ struct cleanup *old_chain;
+ CORE_ADDR func_addr;
+ int back_up;
+
+ if (find_pc_partial_function (get_frame_pc (get_current_frame ()),
+ NULL, &func_addr, NULL) == 0)
+ internal_error (__FILE__, __LINE__,
+ _("Finish: couldn't find function."));
+
+ sal = find_pc_line (func_addr, 0);
+
+ /* We don't need a return value. */
+ tp->proceed_to_finish = 0;
+ /* Special case: if we're sitting at the function entry point,
+ then all we need to do is take a reverse singlestep. We
+ don't need to set a breakpoint, and indeed it would do us
+ no good to do so.
+
+ Note that this can only happen at frame #0, since there's
+ no way that a function up the stack can have a return address
+ that's equal to its entry point. */
+
+ if (sal.pc != read_pc ())
+ {
+ /* Set breakpoint and continue. */
+ breakpoint =
+ set_momentary_breakpoint (sal,
+ get_frame_id (get_selected_frame (NULL)),
+ bp_breakpoint);
+ /* Tell the breakpoint to keep quiet. We won't be done
+ until we've done another reverse single-step. */
+ make_breakpoint_silent (breakpoint);
+ old_chain = make_cleanup_delete_breakpoint (breakpoint);
+ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
+ /* We will be stopped when proceed returns. */
+ back_up = bpstat_find_breakpoint (tp->stop_bpstat, breakpoint) != NULL;
+ do_cleanups (old_chain);
+ }
+ else
+ back_up = 1;
+ if (back_up)
+ {
+ /* If in fact we hit the step-resume breakpoint (and not
+ some other breakpoint), then we're almost there --
+ we just need to back up by one more single-step. */
+ tp->step_range_start = tp->step_range_end = 1;
+ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
+ }
+ return;
+}
+
+/* finish_forward -- helper function for finish_command. */
+
+static void
+finish_forward (struct symbol *function, struct frame_info *frame)
+{
+ struct symtab_and_line sal;
+ struct thread_info *tp = inferior_thread ();
+ struct breakpoint *breakpoint;
+ struct cleanup *old_chain;
+ struct finish_command_continuation_args *cargs;
+
+ sal = find_pc_line (get_frame_pc (frame), 0);
+ sal.pc = get_frame_pc (frame);
+
+ breakpoint = set_momentary_breakpoint (sal, get_frame_id (frame),
+ bp_finish);
+
+ old_chain = make_cleanup_delete_breakpoint (breakpoint);
+
+ tp->proceed_to_finish = 1; /* We want stop_registers, please... */
+ make_cleanup_restore_integer (&suppress_stop_observer);
+ suppress_stop_observer = 1;
+ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
+
+ cargs = xmalloc (sizeof (*cargs));
+
+ cargs->breakpoint = breakpoint;
+ cargs->function = function;
+ add_continuation (tp, finish_command_continuation, cargs,
+ finish_command_continuation_free_arg);
+
+ discard_cleanups (old_chain);
+ if (!target_can_async_p ())
+ do_all_continuations ();
+}
+
/* "finish": Set a temporary breakpoint at the place the selected
frame will return to, then continue. */
static void
finish_command (char *arg, int from_tty)
{
- struct symtab_and_line sal;
struct frame_info *frame;
struct symbol *function;
- struct breakpoint *breakpoint;
- struct cleanup *old_chain;
- struct finish_command_continuation_args *cargs;
- struct thread_info *tp;
int async_exec = 0;
@@ -1391,6 +1507,10 @@ finish_command (char *arg, int from_tty)
if (async_exec && !target_can_async_p ())
error (_("Asynchronous execution not supported on this target."));
+ /* Don't try to async in reverse. */
+ if (async_exec && execution_direction == EXEC_REVERSE)
+ error (_("Asynchronous 'finish' not supported in reverse."));
+
/* If we are not asked to run in the bg, then prepare to run in the
foreground, synchronously. */
if (!async_exec && target_can_async_p ())
@@ -1408,17 +1528,8 @@ finish_command (char *arg, int from_tty)
if (frame == 0)
error (_("\"finish\" not meaningful in the outermost frame."));
- tp = inferior_thread ();
-
clear_proceed_status ();
- sal = find_pc_line (get_frame_pc (frame), 0);
- sal.pc = get_frame_pc (frame);
-
- breakpoint = set_momentary_breakpoint (sal, get_frame_id (frame), bp_finish);
-
- old_chain = make_cleanup_delete_breakpoint (breakpoint);
-
/* Find the function we will return from. */
function = find_pc_function (get_frame_pc (get_selected_frame (NULL)));
@@ -1427,25 +1538,18 @@ finish_command (char *arg, int from_tty)
source. */
if (from_tty)
{
- printf_filtered (_("Run till exit from "));
+ if (execution_direction == EXEC_REVERSE)
+ printf_filtered (_("Run back to call of "));
+ else
+ printf_filtered (_("Run till exit from "));
+
print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
}
- tp->proceed_to_finish = 1; /* We want stop_registers, please... */
- make_cleanup_restore_integer (&suppress_stop_observer);
- suppress_stop_observer = 1;
- proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
-
- cargs = xmalloc (sizeof (*cargs));
-
- cargs->breakpoint = breakpoint;
- cargs->function = function;
- add_continuation (tp, finish_command_continuation, cargs,
- finish_command_continuation_free_arg);
-
- discard_cleanups (old_chain);
- if (!target_can_async_p ())
- do_all_continuations ();
+ if (execution_direction == EXEC_REVERSE)
+ finish_backward (function);
+ else
+ finish_forward (function, frame);
}
@@ -1727,9 +1831,12 @@ default_print_registers_info (struct gdbarch *gdbarch,
|| TYPE_CODE (register_type (gdbarch, i)) == TYPE_CODE_DECFLOAT)
{
int j;
+ struct value_print_options opts;
+ get_user_print_options (&opts);
+ opts.deref_ref = 1;
val_print (register_type (gdbarch, i), buffer, 0, 0,
- file, 0, 1, 0, Val_pretty_default, current_language);
+ file, 0, &opts, current_language);
fprintf_filtered (file, "\t(raw 0x");
for (j = 0; j < register_size (gdbarch, i); j++)
@@ -1745,16 +1852,23 @@ default_print_registers_info (struct gdbarch *gdbarch,
}
else
{
+ struct value_print_options opts;
+
/* Print the register in hex. */
+ get_formatted_print_options (&opts, 'x');
+ opts.deref_ref = 1;
val_print (register_type (gdbarch, i), buffer, 0, 0,
- file, 'x', 1, 0, Val_pretty_default, current_language);
+ file, 0, &opts,
+ current_language);
/* If not a vector register, print it also according to its
natural format. */
if (TYPE_VECTOR (register_type (gdbarch, i)) == 0)
{
+ get_user_print_options (&opts);
+ opts.deref_ref = 1;
fprintf_filtered (file, "\t");
val_print (register_type (gdbarch, i), buffer, 0, 0,
- file, 0, 1, 0, Val_pretty_default, current_language);
+ file, 0, &opts, current_language);
}
}
@@ -1820,12 +1934,14 @@ registers_info (char *addr_exp, int fpregs)
if (regnum >= gdbarch_num_regs (gdbarch)
+ gdbarch_num_pseudo_regs (gdbarch))
{
+ struct value_print_options opts;
struct value *val = value_of_user_reg (regnum, frame);
printf_filtered ("%s: ", start);
+ get_formatted_print_options (&opts, 'x');
print_scalar_formatted (value_contents (val),
check_typedef (value_type (val)),
- 'x', 0, gdb_stdout);
+ &opts, 0, gdb_stdout);
printf_filtered ("\n");
}
else
@@ -1935,6 +2051,48 @@ vector_info (char *args, int from_tty)
}
+/* Used in `attach&' command. ARG is a point to an integer
+ representing a process id. Proceed threads of this process iff
+ they stopped due to debugger request, and when they did, they
+ reported a clean stop (TARGET_SIGNAL_0). Do not proceed threads
+ that have been explicitly been told to stop. */
+
+static int
+proceed_after_attach_callback (struct thread_info *thread,
+ void *arg)
+{
+ int pid = * (int *) arg;
+
+ if (ptid_get_pid (thread->ptid) == pid
+ && !is_exited (thread->ptid)
+ && !is_executing (thread->ptid)
+ && !thread->stop_requested
+ && thread->stop_signal == TARGET_SIGNAL_0)
+ {
+ switch_to_thread (thread->ptid);
+ clear_proceed_status ();
+ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
+ }
+
+ return 0;
+}
+
+static void
+proceed_after_attach (int pid)
+{
+ /* Don't error out if the current thread is running, because
+ there may be other stopped threads. */
+ struct cleanup *old_chain;
+
+ /* Backup current thread and selected frame. */
+ old_chain = make_cleanup_restore_current_thread ();
+
+ iterate_over_threads (proceed_after_attach_callback, &pid);
+
+ /* Restore selected ptid. */
+ do_cleanups (old_chain);
+}
+
/*
* TODO:
* Should save/restore the tty state since it might be that the
@@ -1999,11 +2157,44 @@ attach_command_post_wait (char *args, int from_tty, int async_exec)
target_terminal_inferior ();
if (async_exec)
- proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
+ {
+ /* The user requested an `attach&', so be sure to leave threads
+ that didn't get a signal running. */
+
+ /* Immediatelly resume all suspended threads of this inferior,
+ and this inferior only. This should have no effect on
+ already running threads. If a thread has been stopped with a
+ signal, leave it be. */
+ if (non_stop)
+ proceed_after_attach (inferior->pid);
+ else
+ {
+ if (inferior_thread ()->stop_signal == TARGET_SIGNAL_0)
+ {
+ clear_proceed_status ();
+ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
+ }
+ }
+ }
else
{
+ /* The user requested a plain `attach', so be sure to leave
+ the inferior stopped. */
+
if (target_can_async_p ())
async_enable_stdin ();
+
+ /* At least the current thread is already stopped. */
+
+ /* In all-stop, by definition, all threads have to be already
+ stopped at this point. In non-stop, however, although the
+ selected thread is stopped, others may still be executing.
+ Be sure to explicitly stop all threads of the process. This
+ should have no effect on already stopped threads. */
+ if (non_stop)
+ target_stop (pid_to_ptid (inferior->pid));
+
+ /* Tell the user/frontend where we're stopped. */
normal_stop ();
if (deprecated_attach_hook)
deprecated_attach_hook ();
@@ -2038,10 +2229,14 @@ attach_command (char *args, int from_tty)
char *exec_file;
char *full_exec_path = NULL;
int async_exec = 0;
+ struct cleanup *back_to = make_cleanup (null_cleanup, NULL);
dont_repeat (); /* Not for the faint of heart */
- if (target_has_execution)
+ if (target_supports_multi_process ())
+ /* Don't complain if we can be attached to multiple processes. */
+ ;
+ else if (target_has_execution)
{
if (query ("A program is being debugged already. Kill it? "))
target_kill ();
@@ -2072,6 +2267,7 @@ attach_command (char *args, int from_tty)
{
/* Simulate synchronous execution */
async_disable_stdin ();
+ make_cleanup ((make_cleanup_ftype *)async_enable_stdin, NULL);
}
target_attach (args, from_tty);
@@ -2085,6 +2281,21 @@ attach_command (char *args, int from_tty)
init_wait_for_inferior ();
clear_proceed_status ();
+ if (non_stop)
+ {
+ /* If we find that the current thread isn't stopped, explicitly
+ do so now, because we're going to install breakpoints and
+ poke at memory. */
+
+ if (async_exec)
+ /* The user requested an `attach&'; stop just one thread. */
+ target_stop (inferior_ptid);
+ else
+ /* The user requested an `attach', so stop all threads of this
+ inferior. */
+ target_stop (pid_to_ptid (ptid_get_pid (inferior_ptid)));
+ }
+
/* Some system don't generate traps when attaching to inferior.
E.g. Mach 3 or GNU hurd. */
if (!target_attach_no_wait)
@@ -2107,9 +2318,9 @@ attach_command (char *args, int from_tty)
a->args = xstrdup (args);
a->from_tty = from_tty;
a->async_exec = async_exec;
- add_continuation (inferior_thread (),
- attach_command_continuation, a,
- attach_command_continuation_free_args);
+ add_inferior_continuation (attach_command_continuation, a,
+ attach_command_continuation_free_args);
+ discard_cleanups (back_to);
return;
}
@@ -2117,6 +2328,7 @@ attach_command (char *args, int from_tty)
}
attach_command_post_wait (args, from_tty, async_exec);
+ discard_cleanups (back_to);
}
/*
@@ -2130,13 +2342,22 @@ attach_command (char *args, int from_tty)
* started via the normal ptrace (PTRACE_TRACEME).
*/
-static void
+void
detach_command (char *args, int from_tty)
{
dont_repeat (); /* Not for the faint of heart. */
target_detach (args, from_tty);
- no_shared_libraries (NULL, from_tty);
- init_thread_list ();
+
+ /* If the solist is global across inferiors, don't clear it when we
+ detach from a single inferior. */
+ if (!gdbarch_has_global_solist (target_gdbarch))
+ no_shared_libraries (NULL, from_tty);
+
+ /* If the current target interface claims there's still execution,
+ then don't mess with threads of other processes. */
+ if (!target_has_execution)
+ init_thread_list ();
+
if (deprecated_detach_hook)
deprecated_detach_hook ();
}
@@ -2169,6 +2390,15 @@ interrupt_target_1 (int all_threads)
else
ptid = inferior_ptid;
target_stop (ptid);
+
+ /* Tag the thread as having been explicitly requested to stop, so
+ other parts of gdb know not to resume this thread automatically,
+ if it was stopped due to an internal event. Limit this to
+ non-stop mode, as when debugging a multi-threaded application in
+ all-stop mode, we will only get one stop event --- it's undefined
+ which thread will report the event. */
+ if (non_stop)
+ set_stop_requested (ptid, 1);
}
/* Stop the execution of the target while running in async mode, in
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 4233a51..24f8fa6 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -24,6 +24,7 @@
#include "gdbcmd.h"
#include "gdbthread.h"
#include "ui-out.h"
+#include "observer.h"
void _initialize_inferiors (void);
@@ -45,6 +46,7 @@ current_inferior (void)
static void
free_inferior (struct inferior *inf)
{
+ discard_all_inferior_continuations (inf);
xfree (inf->private);
xfree (inf);
}
@@ -90,6 +92,8 @@ add_inferior (int pid)
{
struct inferior *inf = add_inferior_silent (pid);
+ observer_notify_new_inferior (pid);
+
if (print_inferior_events)
printf_unfiltered (_("[New inferior %d]\n"), pid);
@@ -146,6 +150,8 @@ delete_inferior_1 (int pid, int silent)
arg.silent = silent;
iterate_over_threads (delete_thread_of_inferior, &arg);
+
+ observer_notify_inferior_exit (pid);
}
void
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 43f9022..aa582cb 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -58,10 +58,6 @@ extern struct cleanup *make_cleanup_restore_inferior_status (struct inferior_sta
extern void discard_inferior_status (struct inferior_status *);
-extern void write_inferior_status_register (struct inferior_status
- *inf_status, int regno,
- LONGEST val);
-
/* The -1 ptid, often used to indicate either an error condition
or a "don't care" condition, i.e, "run all threads." */
extern ptid_t minus_one_ptid;
@@ -89,6 +85,9 @@ long ptid_get_tid (ptid_t ptid);
/* Compare two ptids to see if they are equal */
extern int ptid_equal (ptid_t p1, ptid_t p2);
+/* Return true if PTID represents a process id. */
+extern int ptid_is_pid (ptid_t ptid);
+
/* Save value of inferior_ptid so that it may be restored by
a later call to do_cleanups(). Returns the struct cleanup
pointer needed for later doing the cleanup. */
@@ -117,14 +116,6 @@ extern ptid_t inferior_ptid;
redisplay the prompt until the execution is actually over. */
extern int sync_execution;
-/* Some targets (stupidly) report more than one exec event per actual
- call to an event() system call. If only the last such exec event
- need actually be noticed and responded to by the debugger (i.e.,
- be reported to the user), then this is the number of "leading"
- exec events which should be ignored.
- */
-extern int inferior_ignoring_leading_exec_events;
-
/* Inferior environment. */
extern struct gdb_environ *inferior_environ;
@@ -206,9 +197,9 @@ extern ptid_t procfs_first_available (void);
/* From fork-child.c */
-extern void fork_inferior (char *, char *, char **,
- void (*)(void),
- void (*)(int), void (*)(void), char *);
+extern int fork_inferior (char *, char *, char **,
+ void (*)(void),
+ void (*)(int), void (*)(void), char *);
extern void startup_inferior (int);
@@ -278,6 +269,8 @@ extern void interrupt_target_command (char *args, int from_tty);
extern void interrupt_target_1 (int all_threads);
+extern void detach_command (char *, int);
+
/* Address at which inferior stopped. */
extern CORE_ADDR stop_pc;
@@ -339,13 +332,18 @@ enum stop_kind
STOP_QUIETLY_NO_SIGSTOP
};
-/* Nonzero if proceed is being used for a "finish" command or a similar
- situation when stop_registers should be saved. */
+/* Reverse execution. */
+enum exec_direction_kind
+ {
+ EXEC_FORWARD,
+ EXEC_REVERSE,
+ EXEC_ERROR
+ };
-extern int proceed_to_finish;
+extern enum exec_direction_kind execution_direction;
-/* Save register contents here when about to pop a stack dummy frame,
- if-and-only-if proceed_to_finish is set.
+/* Save register contents here when executing a "finish" command or are
+ about to pop a stack dummy frame, if-and-only-if proceed_to_finish is set.
Thus this contains the return value from the called function (assuming
values are returned in a register). */
@@ -423,6 +421,11 @@ struct inferior
forked. */
int attach_flag;
+ /* What is left to do for an execution command after any thread of
+ this inferior stops. For continuations associated with a
+ specific thread, see `struct thread_info'. */
+ struct continuation *continuations;
+
/* Private data used by the target vector implementation. */
struct private_inferior *private;
};
diff --git a/gdb/inflow.c b/gdb/inflow.c
index 2ba2a34..e82514e 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -601,14 +601,19 @@ kill_command (char *arg, int from_tty)
error (_("Not confirmed."));
target_kill ();
- init_thread_list (); /* Destroy thread info */
-
- /* Killing off the inferior can leave us with a core file. If so,
- print the state we are left in. */
- if (target_has_stack)
+ /* If the current target interface claims there's still execution,
+ then don't mess with threads of other processes. */
+ if (!target_has_execution)
{
- printf_filtered (_("In %s,\n"), target_longname);
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
+ init_thread_list (); /* Destroy thread info */
+
+ /* Killing off the inferior can leave us with a core file. If
+ so, print the state we are left in. */
+ if (target_has_stack)
+ {
+ printf_filtered (_("In %s,\n"), target_longname);
+ print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
+ }
}
bfd_cache_close_all ();
}
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 4b4df8f..f218fa0 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -75,6 +75,8 @@ static void set_schedlock_func (char *args, int from_tty,
static int currently_stepping (struct thread_info *tp);
+static int currently_stepping_callback (struct thread_info *tp, void *data);
+
static void xdb_handle_command (char *args, int from_tty);
static int prepare_to_proceed (int);
@@ -230,8 +232,8 @@ show_stop_on_solib_events (struct ui_file *file, int from_tty,
int stop_after_trap;
-/* Save register contents here when about to pop a stack dummy frame,
- if-and-only-if proceed_to_finish is set.
+/* Save register contents here when executing a "finish" command or are
+ about to pop a stack dummy frame, if-and-only-if proceed_to_finish is set.
Thus this contains the return value from the called function (assuming
values are returned in a register). */
@@ -553,26 +555,55 @@ static CORE_ADDR displaced_step_original, displaced_step_copy;
/* Saved contents of copy area. */
static gdb_byte *displaced_step_saved_copy;
-/* When this is non-zero, we are allowed to use displaced stepping, if
- the architecture supports it. When this is zero, we use
- traditional the hold-and-step approach. */
-int can_use_displaced_stepping = 1;
+/* Enum strings for "set|show displaced-stepping". */
+
+static const char can_use_displaced_stepping_auto[] = "auto";
+static const char can_use_displaced_stepping_on[] = "on";
+static const char can_use_displaced_stepping_off[] = "off";
+static const char *can_use_displaced_stepping_enum[] =
+{
+ can_use_displaced_stepping_auto,
+ can_use_displaced_stepping_on,
+ can_use_displaced_stepping_off,
+ NULL,
+};
+
+/* If ON, and the architecture supports it, GDB will use displaced
+ stepping to step over breakpoints. If OFF, or if the architecture
+ doesn't support it, GDB will instead use the traditional
+ hold-and-step approach. If AUTO (which is the default), GDB will
+ decide which technique to use to step over breakpoints depending on
+ which of all-stop or non-stop mode is active --- displaced stepping
+ in non-stop mode; hold-and-step in all-stop mode. */
+
+static const char *can_use_displaced_stepping =
+ can_use_displaced_stepping_auto;
+
static void
show_can_use_displaced_stepping (struct ui_file *file, int from_tty,
struct cmd_list_element *c,
const char *value)
{
- fprintf_filtered (file, _("\
-Debugger's willingness to use displaced stepping to step over "
-"breakpoints is %s.\n"), value);
+ if (can_use_displaced_stepping == can_use_displaced_stepping_auto)
+ fprintf_filtered (file, _("\
+Debugger's willingness to use displaced stepping to step over \
+breakpoints is %s (currently %s).\n"),
+ value, non_stop ? "on" : "off");
+ else
+ fprintf_filtered (file, _("\
+Debugger's willingness to use displaced stepping to step over \
+breakpoints is %s.\n"), value);
}
-/* Return non-zero if displaced stepping is enabled, and can be used
- with GDBARCH. */
+/* Return non-zero if displaced stepping can/should be used to step
+ over breakpoints. */
+
static int
use_displaced_stepping (struct gdbarch *gdbarch)
{
- return (can_use_displaced_stepping
+ return (((can_use_displaced_stepping == can_use_displaced_stepping_auto
+ && non_stop)
+ || can_use_displaced_stepping == can_use_displaced_stepping_on)
&& gdbarch_displaced_step_copy_insn_p (gdbarch));
}
@@ -629,7 +660,7 @@ displaced_step_dump_bytes (struct ui_file *file,
static int
displaced_step_prepare (ptid_t ptid)
{
- struct cleanup *old_cleanups;
+ struct cleanup *old_cleanups, *ignore_cleanups;
struct regcache *regcache = get_thread_regcache (ptid);
struct gdbarch *gdbarch = get_regcache_arch (regcache);
CORE_ADDR original, copy;
@@ -681,6 +712,9 @@ displaced_step_prepare (ptid_t ptid)
displaced_step_clear ();
+ old_cleanups = save_inferior_ptid ();
+ inferior_ptid = ptid;
+
original = regcache_read_pc (regcache);
copy = gdbarch_displaced_step_location (gdbarch);
@@ -688,8 +722,8 @@ displaced_step_prepare (ptid_t ptid)
/* Save the original contents of the copy area. */
displaced_step_saved_copy = xmalloc (len);
- old_cleanups = make_cleanup (free_current_contents,
- &displaced_step_saved_copy);
+ ignore_cleanups = make_cleanup (free_current_contents,
+ &displaced_step_saved_copy);
read_memory (copy, displaced_step_saved_copy, len);
if (debug_displaced)
{
@@ -699,7 +733,7 @@ displaced_step_prepare (ptid_t ptid)
};
closure = gdbarch_displaced_step_copy_insn (gdbarch,
- original, copy, regcache);
+ original, copy, regcache);
/* We don't support the fully-simulated case at present. */
gdb_assert (closure);
@@ -709,11 +743,13 @@ displaced_step_prepare (ptid_t ptid)
/* Resume execution at the copy. */
regcache_write_pc (regcache, copy);
- discard_cleanups (old_cleanups);
+ discard_cleanups (ignore_cleanups);
+
+ do_cleanups (old_cleanups);
if (debug_displaced)
fprintf_unfiltered (gdb_stdlog, "displaced: displaced pc to 0x%s\n",
- paddr_nz (copy));
+ paddr_nz (copy));
/* Save the information we need to fix things up if the step
succeeds. */
@@ -784,27 +820,71 @@ displaced_step_fixup (ptid_t event_ptid, enum target_signal signal)
do_cleanups (old_cleanups);
+ displaced_step_ptid = null_ptid;
+
/* Are there any pending displaced stepping requests? If so, run
one now. */
- if (displaced_step_request_queue)
+ while (displaced_step_request_queue)
{
struct displaced_step_request *head;
ptid_t ptid;
+ CORE_ADDR actual_pc;
head = displaced_step_request_queue;
ptid = head->ptid;
displaced_step_request_queue = head->next;
xfree (head);
- if (debug_displaced)
- fprintf_unfiltered (gdb_stdlog,
- "displaced: stepping queued %s now\n",
- target_pid_to_str (ptid));
+ context_switch (ptid);
+
+ actual_pc = read_pc ();
+
+ if (breakpoint_here_p (actual_pc))
+ {
+ if (debug_displaced)
+ fprintf_unfiltered (gdb_stdlog,
+ "displaced: stepping queued %s now\n",
+ target_pid_to_str (ptid));
+
+ displaced_step_prepare (ptid);
+
+ if (debug_displaced)
+ {
+ gdb_byte buf[4];
+
+ fprintf_unfiltered (gdb_stdlog, "displaced: run 0x%s: ",
+ paddr_nz (actual_pc));
+ read_memory (actual_pc, buf, sizeof (buf));
+ displaced_step_dump_bytes (gdb_stdlog, buf, sizeof (buf));
+ }
+
+ target_resume (ptid, 1, TARGET_SIGNAL_0);
+
+ /* Done, we're stepping a thread. */
+ break;
+ }
+ else
+ {
+ int step;
+ struct thread_info *tp = inferior_thread ();
+
+ /* The breakpoint we were sitting under has since been
+ removed. */
+ tp->trap_expected = 0;
+
+ /* Go back to what we were trying to do. */
+ step = currently_stepping (tp);
+
+ if (debug_displaced)
+ fprintf_unfiltered (gdb_stdlog, "breakpoint is gone %s: step(%d)\n",
+ target_pid_to_str (tp->ptid), step);
+ target_resume (ptid, step, TARGET_SIGNAL_0);
+ tp->stop_signal = TARGET_SIGNAL_0;
- displaced_step_ptid = null_ptid;
- displaced_step_prepare (ptid);
- target_resume (ptid, 1, TARGET_SIGNAL_0);
+ /* This request was discarded. See if there's any other
+ thread waiting for its turn. */
+ }
}
}
@@ -1083,30 +1163,59 @@ a command like `return' or `jump' to continue execution."));
/* Clear out all variables saying what to do when inferior is continued.
First do this, then set the ones you want, then call `proceed'. */
-void
-clear_proceed_status (void)
+static void
+clear_proceed_status_thread (struct thread_info *tp)
{
- if (!ptid_equal (inferior_ptid, null_ptid))
- {
- struct thread_info *tp;
- struct inferior *inferior;
+ if (debug_infrun)
+ fprintf_unfiltered (gdb_stdlog,
+ "infrun: clear_proceed_status_thread (%s)\n",
+ target_pid_to_str (tp->ptid));
+
+ tp->trap_expected = 0;
+ tp->step_range_start = 0;
+ tp->step_range_end = 0;
+ tp->step_frame_id = null_frame_id;
+ tp->step_over_calls = STEP_OVER_UNDEBUGGABLE;
+ tp->stop_requested = 0;
+
+ tp->stop_step = 0;
- tp = inferior_thread ();
+ tp->proceed_to_finish = 0;
- tp->trap_expected = 0;
- tp->step_range_start = 0;
- tp->step_range_end = 0;
- tp->step_frame_id = null_frame_id;
- tp->step_over_calls = STEP_OVER_UNDEBUGGABLE;
+ /* Discard any remaining commands or status from previous stop. */
+ bpstat_clear (&tp->stop_bpstat);
+}
- tp->stop_step = 0;
+static int
+clear_proceed_status_callback (struct thread_info *tp, void *data)
+{
+ if (is_exited (tp->ptid))
+ return 0;
- tp->proceed_to_finish = 0;
+ clear_proceed_status_thread (tp);
+ return 0;
+}
- /* Discard any remaining commands or status from previous
- stop. */
- bpstat_clear (&tp->stop_bpstat);
+void
+clear_proceed_status (void)
+{
+ if (!ptid_equal (inferior_ptid, null_ptid))
+ {
+ struct inferior *inferior;
+ if (non_stop)
+ {
+ /* If in non-stop mode, only delete the per-thread status
+ of the current thread. */
+ clear_proceed_status_thread (inferior_thread ());
+ }
+ else
+ {
+ /* In all-stop mode, delete the per-thread status of
+ *all* threads. */
+ iterate_over_threads (clear_proceed_status_callback, NULL);
+ }
+
inferior = current_inferior ();
inferior->stop_soon = NO_STOP_QUIETLY;
}
@@ -1193,11 +1302,17 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step)
if (addr == (CORE_ADDR) -1)
{
- if (pc == stop_pc && breakpoint_here_p (pc))
+ if (pc == stop_pc && breakpoint_here_p (pc)
+ && execution_direction != EXEC_REVERSE)
/* There is a breakpoint at the address we will resume at,
step one instruction before inserting breakpoints so that
we do not stop right away (and report a second hit at this
- breakpoint). */
+ breakpoint).
+
+ Note, we don't do this in reverse, because we won't
+ actually be executing the breakpoint insn anyway.
+ We'll be (un-)executing the previous instruction. */
+
oneproc = 1;
else if (gdbarch_single_step_through_delay_p (gdbarch)
&& gdbarch_single_step_through_delay (gdbarch,
@@ -1426,7 +1541,9 @@ enum inferior_stop_reason
/* Inferior exited. */
EXITED,
/* Inferior received signal, and user asked to be notified. */
- SIGNAL_RECEIVED
+ SIGNAL_RECEIVED,
+ /* Reverse execution -- target ran out of history info. */
+ NO_HISTORY
};
/* The PTID we'll do a target_wait on.*/
@@ -1457,7 +1574,8 @@ void init_execution_control_state (struct execution_control_state *ecs);
void handle_inferior_event (struct execution_control_state *ecs);
-static void step_into_function (struct execution_control_state *ecs);
+static void handle_step_into_function (struct execution_control_state *ecs);
+static void handle_step_into_function_backward (struct execution_control_state *ecs);
static void insert_step_resume_breakpoint_at_frame (struct frame_info *step_frame);
static void insert_step_resume_breakpoint_at_caller (struct frame_info *);
static void insert_step_resume_breakpoint_at_sal (struct symtab_and_line sr_sal,
@@ -1470,6 +1588,100 @@ static void keep_going (struct execution_control_state *ecs);
static void print_stop_reason (enum inferior_stop_reason stop_reason,
int stop_info);
+/* Callback for iterate over threads. If the thread is stopped, but
+ the user/frontend doesn't know about that yet, go through
+ normal_stop, as if the thread had just stopped now. ARG points at
+ a ptid. If PTID is MINUS_ONE_PTID, applies to all threads. If
+ ptid_is_pid(PTID) is true, applies to all threads of the process
+ pointed at by PTID. Otherwise, apply only to the thread pointed by
+ PTID. */
+
+static int
+infrun_thread_stop_requested_callback (struct thread_info *info, void *arg)
+{
+ ptid_t ptid = * (ptid_t *) arg;
+
+ if ((ptid_equal (info->ptid, ptid)
+ || ptid_equal (minus_one_ptid, ptid)
+ || (ptid_is_pid (ptid)
+ && ptid_get_pid (ptid) == ptid_get_pid (info->ptid)))
+ && is_running (info->ptid)
+ && !is_executing (info->ptid))
+ {
+ struct cleanup *old_chain;
+ struct execution_control_state ecss;
+ struct execution_control_state *ecs = &ecss;
+
+ memset (ecs, 0, sizeof (*ecs));
+
+ old_chain = make_cleanup_restore_current_thread ();
+
+ switch_to_thread (info->ptid);
+
+ /* Go through handle_inferior_event/normal_stop, so we always
+ have consistent output as if the stop event had been
+ reported. */
+ ecs->ptid = info->ptid;
+ ecs->event_thread = find_thread_pid (info->ptid);
+ ecs->ws.kind = TARGET_WAITKIND_STOPPED;
+ ecs->ws.value.sig = TARGET_SIGNAL_0;
+
+ handle_inferior_event (ecs);
+
+ if (!ecs->wait_some_more)
+ {
+ struct thread_info *tp;
+
+ normal_stop ();
+
+ /* Finish off the continuations. The continations
+ themselves are responsible for realising the thread
+ didn't finish what it was supposed to do. */
+ tp = inferior_thread ();
+ do_all_intermediate_continuations_thread (tp);
+ do_all_continuations_thread (tp);
+ }
+
+ do_cleanups (old_chain);
+ }
+
+ return 0;
+}
+
+/* This function is attached as a "thread_stop_requested" observer.
+ Cleanup local state that assumed the PTID was to be resumed, and
+ report the stop to the frontend. */
+
+void
+infrun_thread_stop_requested (ptid_t ptid)
+{
+ struct displaced_step_request *it, *next, *prev = NULL;
+
+ /* PTID was requested to stop. Remove it from the displaced
+ stepping queue, so we don't try to resume it automatically. */
+ for (it = displaced_step_request_queue; it; it = next)
+ {
+ next = it->next;
+
+ if (ptid_equal (it->ptid, ptid)
+ || ptid_equal (minus_one_ptid, ptid)
+ || (ptid_is_pid (ptid)
+ && ptid_get_pid (ptid) == ptid_get_pid (it->ptid)))
+ {
+ if (displaced_step_request_queue == it)
+ displaced_step_request_queue = it->next;
+ else
+ prev->next = it->next;
+
+ xfree (it);
+ }
+ else
+ prev = it;
+ }
+
+ iterate_over_threads (infrun_thread_stop_requested_callback, &ptid);
+}
+
/* Callback for iterate_over_threads. */
static int
@@ -1768,6 +1980,35 @@ adjust_pc_after_break (struct execution_control_state *ecs)
if (ecs->ws.value.sig != TARGET_SIGNAL_TRAP)
return;
+ /* In reverse execution, when a breakpoint is hit, the instruction
+ under it has already been de-executed. The reported PC always
+ points at the breakpoint address, so adjusting it further would
+ be wrong. E.g., consider this case on a decr_pc_after_break == 1
+ architecture:
+
+ B1 0x08000000 : INSN1
+ B2 0x08000001 : INSN2
+ 0x08000002 : INSN3
+ PC -> 0x08000003 : INSN4
+
+ Say you're stopped at 0x08000003 as above. Reverse continuing
+ from that point should hit B2 as below. Reading the PC when the
+ SIGTRAP is reported should read 0x08000001 and INSN2 should have
+ been de-executed already.
+
+ B1 0x08000000 : INSN1
+ B2 PC -> 0x08000001 : INSN2
+ 0x08000002 : INSN3
+ 0x08000003 : INSN4
+
+ We can't apply the same logic as for forward execution, because
+ we would wrongly adjust the PC to 0x08000000, since there's a
+ breakpoint at PC - 1. We'd then report a hit on B1, although
+ INSN1 hadn't been de-executed yet. Doing nothing is the correct
+ behaviour. */
+ if (execution_direction == EXEC_REVERSE)
+ return;
+
/* If this target does not decrement the PC after breakpoints, then
we have nothing to do. */
regcache = get_thread_regcache (ecs->ptid);
@@ -1780,9 +2021,16 @@ adjust_pc_after_break (struct execution_control_state *ecs)
breakpoint_pc = regcache_read_pc (regcache)
- gdbarch_decr_pc_after_break (gdbarch);
- /* Check whether there actually is a software breakpoint inserted
- at that location. */
- if (software_breakpoint_inserted_here_p (breakpoint_pc))
+ /* Check whether there actually is a software breakpoint inserted at
+ that location.
+
+ If in non-stop mode, a race condition is possible where we've
+ removed a breakpoint, but stop events for that breakpoint were
+ already queued and arrive later. To suppress those spurious
+ SIGTRAPs, we keep a list of such breakpoint locations for a bit,
+ and retire them after a number of stop events are reported. */
+ if (software_breakpoint_inserted_here_p (breakpoint_pc)
+ || (non_stop && moribund_breakpoint_here_p (breakpoint_pc)))
{
/* When using hardware single-step, a SIGTRAP is reported for both
a completed single-step and a software breakpoint. Need to
@@ -1855,8 +2103,6 @@ handle_inferior_event (struct execution_control_state *ecs)
else
stop_soon = NO_STOP_QUIETLY;
- breakpoint_retire_moribund ();
-
/* Cache the last pid/waitstatus. */
target_last_wait_ptid = ecs->ptid;
target_last_waitstatus = ecs->ws;
@@ -1884,6 +2130,8 @@ handle_inferior_event (struct execution_control_state *ecs)
if (ecs->ws.kind != TARGET_WAITKIND_IGNORE)
{
+ breakpoint_retire_moribund ();
+
/* Mark the non-executing threads accordingly. */
if (!non_stop
|| ecs->ws.kind == TARGET_WAITKIND_EXITED
@@ -2141,6 +2389,13 @@ handle_inferior_event (struct execution_control_state *ecs)
ecs->event_thread->stop_signal = ecs->ws.value.sig;
break;
+ case TARGET_WAITKIND_NO_HISTORY:
+ /* Reverse execution: target ran out of history info. */
+ stop_pc = read_pc ();
+ print_stop_reason (NO_HISTORY, 0);
+ stop_stepping (ecs);
+ return;
+
/* We had an event in the inferior, but we are not interested
in handling it at this level. The lower layers have already
done what needs to be done, if anything.
@@ -2178,11 +2433,21 @@ targets should add new threads to the thread list themselves in non-stop mode.")
return;
}
- /* Do we need to clean up the state of a thread that has completed a
- displaced single-step? (Doing so usually affects the PC, so do
- it here, before we set stop_pc.) */
if (ecs->ws.kind == TARGET_WAITKIND_STOPPED)
- displaced_step_fixup (ecs->ptid, ecs->event_thread->stop_signal);
+ {
+ /* Do we need to clean up the state of a thread that has
+ completed a displaced single-step? (Doing so usually affects
+ the PC, so do it here, before we set stop_pc.) */
+ displaced_step_fixup (ecs->ptid, ecs->event_thread->stop_signal);
+
+ /* If we either finished a single-step or hit a breakpoint, but
+ the user wanted this thread to be stopped, pretend we got a
+ SIG0 (generic unsignaled stop). */
+
+ if (ecs->event_thread->stop_requested
+ && ecs->event_thread->stop_signal == TARGET_SIGNAL_TRAP)
+ ecs->event_thread->stop_signal = TARGET_SIGNAL_0;
+ }
stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid));
@@ -2599,10 +2864,19 @@ targets should add new threads to the thread list themselves in non-stop mode.")
SIGTRAP. Some systems (e.g. Windows), and stubs supporting
target extended-remote report it instead of a SIGSTOP
(e.g. gdbserver). We already rely on SIGTRAP being our
- signal, so this is no exception. */
+ signal, so this is no exception.
+
+ Also consider that the attach is complete when we see a
+ TARGET_SIGNAL_0. In non-stop mode, GDB will explicitly tell
+ the target to stop all threads of the inferior, in case the
+ low level attach operation doesn't stop them implicitly. If
+ they weren't stopped implicitly, then the stub will report a
+ TARGET_SIGNAL_0, meaning: stopped for no particular reason
+ other than GDB's request. */
if (stop_soon == STOP_QUIETLY_NO_SIGSTOP
&& (ecs->event_thread->stop_signal == TARGET_SIGNAL_STOP
- || ecs->event_thread->stop_signal == TARGET_SIGNAL_TRAP))
+ || ecs->event_thread->stop_signal == TARGET_SIGNAL_TRAP
+ || ecs->event_thread->stop_signal == TARGET_SIGNAL_0))
{
stop_stepping (ecs);
ecs->event_thread->stop_signal = TARGET_SIGNAL_0;
@@ -2625,7 +2899,7 @@ targets should add new threads to the thread list themselves in non-stop mode.")
another signal besides SIGTRAP, so check here as well as
above.''
- If someone ever tries to get get call dummys on a
+ If someone ever tries to get call dummys on a
non-executable stack to work (where the target would stop
with something like a SIGSEGV), then those tests might need
to be re-instated. Given, however, that the tests were only
@@ -2678,9 +2952,11 @@ process_event_stop_test:
target_terminal_ours_for_output ();
print_stop_reason (SIGNAL_RECEIVED, ecs->event_thread->stop_signal);
}
- /* Always stop on signals if we're just gaining control of the
- program. */
+ /* Always stop on signals if we're either just gaining control
+ of the program, or the user explicitly requested this thread
+ to remain stopped. */
if (stop_soon != NO_STOP_QUIETLY
+ || ecs->event_thread->stop_requested
|| signal_stop_state (ecs->event_thread->stop_signal))
{
stop_stepping (ecs);
@@ -2861,6 +3137,17 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
keep_going (ecs);
return;
}
+ if (stop_pc == ecs->stop_func_start
+ && execution_direction == EXEC_REVERSE)
+ {
+ /* We are stepping over a function call in reverse, and
+ just hit the step-resume breakpoint at the start
+ address of the function. Go back to single-stepping,
+ which should take us back to the function call. */
+ ecs->event_thread->stepping_over_breakpoint = 1;
+ keep_going (ecs);
+ return;
+ }
break;
case BPSTAT_WHAT_CHECK_SHLIBS:
@@ -2905,43 +3192,6 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
stop_stepping (ecs);
return;
}
-
- /* If we stopped due to an explicit catchpoint, then the
- (see above) call to SOLIB_ADD pulled in any symbols
- from a newly-loaded library, if appropriate.
-
- We do want the inferior to stop, but not where it is
- now, which is in the dynamic linker callback. Rather,
- we would like it stop in the user's program, just after
- the call that caused this catchpoint to trigger. That
- gives the user a more useful vantage from which to
- examine their program's state. */
- else if (what.main_action
- == BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK)
- {
- /* ??rehrauer: If I could figure out how to get the
- right return PC from here, we could just set a temp
- breakpoint and resume. I'm not sure we can without
- cracking open the dld's shared libraries and sniffing
- their unwind tables and text/data ranges, and that's
- not a terribly portable notion.
-
- Until that time, we must step the inferior out of the
- dld callback, and also out of the dld itself (and any
- code or stubs in libdld.sl, such as "shl_load" and
- friends) until we reach non-dld code. At that point,
- we can stop stepping. */
- bpstat_get_triggered_catchpoints (ecs->event_thread->stop_bpstat,
- &ecs->
- event_thread->
- stepping_through_solib_catchpoints);
- ecs->event_thread->stepping_through_solib_after_catch = 1;
-
- /* Be sure to lift all breakpoints, so the inferior does
- actually step past this point... */
- ecs->event_thread->stepping_over_breakpoint = 1;
- break;
- }
else
{
/* We want to step over this breakpoint, then keep going. */
@@ -2965,6 +3215,43 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
test for stepping. But, if not stepping,
do not stop. */
+ /* In all-stop mode, if we're currently stepping but have stopped in
+ some other thread, we need to switch back to the stepped thread. */
+ if (!non_stop)
+ {
+ struct thread_info *tp;
+ tp = iterate_over_threads (currently_stepping_callback,
+ ecs->event_thread);
+ if (tp)
+ {
+ /* However, if the current thread is blocked on some internal
+ breakpoint, and we simply need to step over that breakpoint
+ to get it going again, do that first. */
+ if ((ecs->event_thread->trap_expected
+ && ecs->event_thread->stop_signal != TARGET_SIGNAL_TRAP)
+ || ecs->event_thread->stepping_over_breakpoint)
+ {
+ keep_going (ecs);
+ return;
+ }
+
+ /* Otherwise, we no longer expect a trap in the current thread.
+ Clear the trap_expected flag before switching back -- this is
+ what keep_going would do as well, if we called it. */
+ ecs->event_thread->trap_expected = 0;
+
+ if (debug_infrun)
+ fprintf_unfiltered (gdb_stdlog,
+ "infrun: switching back to stepped thread\n");
+
+ ecs->event_thread = tp;
+ ecs->ptid = tp->ptid;
+ context_switch (ecs->ptid);
+ keep_going (ecs);
+ return;
+ }
+ }
+
/* Are we stepping to get the inferior out of the dynamic linker's
hook (and possibly the dld itself) after catching a shlib
event? */
@@ -3026,10 +3313,24 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
&& stop_pc < ecs->event_thread->step_range_end)
{
if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, "infrun: stepping inside range [0x%s-0x%s]\n",
+ fprintf_unfiltered (gdb_stdlog, "infrun: stepping inside range [0x%s-0x%s]\n",
paddr_nz (ecs->event_thread->step_range_start),
paddr_nz (ecs->event_thread->step_range_end));
- keep_going (ecs);
+
+ /* When stepping backward, stop at beginning of line range
+ (unless it's the function entry point, in which case
+ keep going back to the call point). */
+ if (stop_pc == ecs->event_thread->step_range_start
+ && stop_pc != ecs->stop_func_start
+ && execution_direction == EXEC_REVERSE)
+ {
+ ecs->event_thread->stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ }
+ else
+ keep_going (ecs);
+
return;
}
@@ -3089,8 +3390,9 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
previous frame must have valid frame IDs. */
if (!frame_id_eq (get_frame_id (get_current_frame ()),
ecs->event_thread->step_frame_id)
- && frame_id_eq (frame_unwind_id (get_current_frame ()),
- ecs->event_thread->step_frame_id))
+ && (frame_id_eq (frame_unwind_id (get_current_frame ()),
+ ecs->event_thread->step_frame_id)
+ || execution_direction == EXEC_REVERSE))
{
CORE_ADDR real_stop_pc;
@@ -3116,10 +3418,43 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
if (ecs->event_thread->step_over_calls == STEP_OVER_ALL)
{
- /* We're doing a "next", set a breakpoint at callee's return
- address (the address at which the caller will
- resume). */
- insert_step_resume_breakpoint_at_caller (get_current_frame ());
+ /* We're doing a "next".
+
+ Normal (forward) execution: set a breakpoint at the
+ callee's return address (the address at which the caller
+ will resume).
+
+ Reverse (backward) execution. set the step-resume
+ breakpoint at the start of the function that we just
+ stepped into (backwards), and continue to there. When we
+ get there, we'll need to single-step back to the caller. */
+
+ if (execution_direction == EXEC_REVERSE)
+ {
+ struct symtab_and_line sr_sal;
+
+ if (ecs->stop_func_start == 0
+ && in_solib_dynsym_resolve_code (stop_pc))
+ {
+ /* Stepped into runtime loader dynamic symbol
+ resolution code. Since we're in reverse,
+ we have already backed up through the runtime
+ loader and the dynamic function. This is just
+ the trampoline (jump table).
+
+ Just keep stepping, we'll soon be home.
+ */
+ keep_going (ecs);
+ return;
+ }
+ /* Normal (staticly linked) function call return. */
+ init_sal (&sr_sal);
+ sr_sal.pc = ecs->stop_func_start;
+ insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id);
+ }
+ else
+ insert_step_resume_breakpoint_at_caller (get_current_frame ());
+
keep_going (ecs);
return;
}
@@ -3136,7 +3471,7 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
if (real_stop_pc != 0)
ecs->stop_func_start = real_stop_pc;
- if (in_solib_dynsym_resolve_code (ecs->stop_func_start))
+ if (real_stop_pc != 0 && in_solib_dynsym_resolve_code (real_stop_pc))
{
struct symtab_and_line sr_sal;
init_sal (&sr_sal);
@@ -3159,7 +3494,10 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
tmp_sal = find_pc_line (ecs->stop_func_start, 0);
if (tmp_sal.line != 0)
{
- step_into_function (ecs);
+ if (execution_direction == EXEC_REVERSE)
+ handle_step_into_function_backward (ecs);
+ else
+ handle_step_into_function (ecs);
return;
}
}
@@ -3176,9 +3514,20 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
return;
}
- /* Set a breakpoint at callee's return address (the address at
- which the caller will resume). */
- insert_step_resume_breakpoint_at_caller (get_current_frame ());
+ if (execution_direction == EXEC_REVERSE)
+ {
+ /* Set a breakpoint at callee's start address.
+ From there we can step once and be back in the caller. */
+ struct symtab_and_line sr_sal;
+ init_sal (&sr_sal);
+ sr_sal.pc = ecs->stop_func_start;
+ insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id);
+ }
+ else
+ /* Set a breakpoint at callee's return address (the address
+ at which the caller will resume). */
+ insert_step_resume_breakpoint_at_caller (get_current_frame ());
+
keep_going (ecs);
return;
}
@@ -3322,27 +3671,41 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n");
/* Are we in the middle of stepping? */
static int
+currently_stepping_thread (struct thread_info *tp)
+{
+ return (tp->step_range_end && tp->step_resume_breakpoint == NULL)
+ || tp->trap_expected
+ || tp->stepping_through_solib_after_catch;
+}
+
+static int
+currently_stepping_callback (struct thread_info *tp, void *data)
+{
+ /* Return true if any thread *but* the one passed in "data" is
+ in the middle of stepping. */
+ return tp != data && currently_stepping_thread (tp);
+}
+
+static int
currently_stepping (struct thread_info *tp)
{
- return (((tp->step_range_end && tp->step_resume_breakpoint == NULL)
- || tp->trap_expected)
- || tp->stepping_through_solib_after_catch
- || bpstat_should_step ());
+ return currently_stepping_thread (tp) || bpstat_should_step ();
}
-/* Subroutine call with source code we should not step over. Do step
- to the first line of code in it. */
+/* Inferior has stepped into a subroutine call with source code that
+ we should not step over. Do step to the first line of code in
+ it. */
static void
-step_into_function (struct execution_control_state *ecs)
+handle_step_into_function (struct execution_control_state *ecs)
{
struct symtab *s;
struct symtab_and_line stop_func_sal, sr_sal;
s = find_pc_symtab (stop_pc);
if (s && s->language != language_asm)
- ecs->stop_func_start = gdbarch_skip_prologue
- (current_gdbarch, ecs->stop_func_start);
+ ecs->stop_func_start = gdbarch_skip_prologue (current_gdbarch,
+ ecs->stop_func_start);
stop_func_sal = find_pc_line (ecs->stop_func_start, 0);
/* Use the step_resume_break to step until the end of the prologue,
@@ -3405,6 +3768,43 @@ step_into_function (struct execution_control_state *ecs)
keep_going (ecs);
}
+/* Inferior has stepped backward into a subroutine call with source
+ code that we should not step over. Do step to the beginning of the
+ last line of code in it. */
+
+static void
+handle_step_into_function_backward (struct execution_control_state *ecs)
+{
+ struct symtab *s;
+ struct symtab_and_line stop_func_sal, sr_sal;
+
+ s = find_pc_symtab (stop_pc);
+ if (s && s->language != language_asm)
+ ecs->stop_func_start = gdbarch_skip_prologue (current_gdbarch,
+ ecs->stop_func_start);
+
+ stop_func_sal = find_pc_line (stop_pc, 0);
+
+ /* OK, we're just going to keep stepping here. */
+ if (stop_func_sal.pc == stop_pc)
+ {
+ /* We're there already. Just stop stepping now. */
+ ecs->event_thread->stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ }
+ else
+ {
+ /* Else just reset the step range and keep going.
+ No step-resume breakpoint, they don't work for
+ epilogues, which can have multiple entry paths. */
+ ecs->event_thread->step_range_start = stop_func_sal.pc;
+ ecs->event_thread->step_range_end = stop_func_sal.end;
+ keep_going (ecs);
+ }
+ return;
+}
+
/* Insert a "step-resume breakpoint" at SR_SAL with frame ID SR_ID.
This is used to both functions and to skip over code. */
@@ -3694,24 +4094,42 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info)
return_child_result_value = stop_info;
break;
case SIGNAL_RECEIVED:
- /* Signal received. The signal table tells us to print about
- it. */
+ /* Signal received. The signal table tells us to print about
+ it. */
annotate_signal ();
- ui_out_text (uiout, "\nProgram received signal ");
- annotate_signal_name ();
- if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string
- (uiout, "reason", async_reason_lookup (EXEC_ASYNC_SIGNAL_RECEIVED));
- ui_out_field_string (uiout, "signal-name",
- target_signal_to_name (stop_info));
- annotate_signal_name_end ();
- ui_out_text (uiout, ", ");
- annotate_signal_string ();
- ui_out_field_string (uiout, "signal-meaning",
- target_signal_to_string (stop_info));
- annotate_signal_string_end ();
+
+ if (stop_info == TARGET_SIGNAL_0 && !ui_out_is_mi_like_p (uiout))
+ {
+ struct thread_info *t = inferior_thread ();
+
+ ui_out_text (uiout, "\n[");
+ ui_out_field_string (uiout, "thread-name",
+ target_pid_to_str (t->ptid));
+ ui_out_field_fmt (uiout, "thread-id", "] #%d", t->num);
+ ui_out_text (uiout, " stopped");
+ }
+ else
+ {
+ ui_out_text (uiout, "\nProgram received signal ");
+ annotate_signal_name ();
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string
+ (uiout, "reason", async_reason_lookup (EXEC_ASYNC_SIGNAL_RECEIVED));
+ ui_out_field_string (uiout, "signal-name",
+ target_signal_to_name (stop_info));
+ annotate_signal_name_end ();
+ ui_out_text (uiout, ", ");
+ annotate_signal_string ();
+ ui_out_field_string (uiout, "signal-meaning",
+ target_signal_to_string (stop_info));
+ annotate_signal_string_end ();
+ }
ui_out_text (uiout, ".\n");
break;
+ case NO_HISTORY:
+ /* Reverse execution: target ran out of history info. */
+ ui_out_text (uiout, "\nNo more reverse-execution history.\n");
+ break;
default:
internal_error (__FILE__, __LINE__,
_("print_stop_reason: unrecognized enum value"));
@@ -4070,11 +4488,7 @@ handle_command (char *args, int from_tty)
/* Break the command line up into args. */
- argv = buildargv (args);
- if (argv == NULL)
- {
- nomem (0);
- }
+ argv = gdb_buildargv (args);
old_chain = make_cleanup_freeargv (argv);
/* Walk through the args, looking for signal oursigs, signal names, and
@@ -4231,13 +4645,12 @@ xdb_handle_command (char *args, int from_tty)
char **argv;
struct cleanup *old_chain;
+ if (args == NULL)
+ error_no_arg (_("xdb command"));
+
/* Break the command line up into args. */
- argv = buildargv (args);
- if (argv == NULL)
- {
- nomem (0);
- }
+ argv = gdb_buildargv (args);
old_chain = make_cleanup_freeargv (argv);
if (argv[1] != (char *) NULL)
{
@@ -4363,16 +4776,6 @@ struct inferior_status
int proceed_to_finish;
};
-void
-write_inferior_status_register (struct inferior_status *inf_status, int regno,
- LONGEST val)
-{
- int size = register_size (current_gdbarch, regno);
- void *buf = alloca (size);
- store_signed_integer (buf, size, val);
- regcache_raw_write (inf_status->registers, regno, buf);
-}
-
/* Save all of the information associated with the inferior<==>gdb
connection. INF_STATUS is a pointer to a "struct inferior_status"
(defined in inferior.h). */
@@ -4621,6 +5024,19 @@ ptid_equal (ptid_t ptid1, ptid_t ptid2)
&& ptid1.tid == ptid2.tid);
}
+/* Returns true if PTID represents a process. */
+
+int
+ptid_is_pid (ptid_t ptid)
+{
+ if (ptid_equal (minus_one_ptid, ptid))
+ return 0;
+ if (ptid_equal (null_ptid, ptid))
+ return 0;
+
+ return (ptid_get_lwp (ptid) == 0 && ptid_get_tid (ptid) == 0);
+}
+
/* restore_inferior_ptid() will be used by the cleanup machinery
to restore the inferior_ptid value saved in a call to
save_inferior_ptid(). */
@@ -4648,6 +5064,55 @@ save_inferior_ptid (void)
}
+/* User interface for reverse debugging:
+ Set exec-direction / show exec-direction commands
+ (returns error unless target implements to_set_exec_direction method). */
+
+enum exec_direction_kind execution_direction = EXEC_FORWARD;
+static const char exec_forward[] = "forward";
+static const char exec_reverse[] = "reverse";
+static const char *exec_direction = exec_forward;
+static const char *exec_direction_names[] = {
+ exec_forward,
+ exec_reverse,
+ NULL
+};
+
+static void
+set_exec_direction_func (char *args, int from_tty,
+ struct cmd_list_element *cmd)
+{
+ if (target_can_execute_reverse)
+ {
+ if (!strcmp (exec_direction, exec_forward))
+ execution_direction = EXEC_FORWARD;
+ else if (!strcmp (exec_direction, exec_reverse))
+ execution_direction = EXEC_REVERSE;
+ }
+}
+
+static void
+show_exec_direction_func (struct ui_file *out, int from_tty,
+ struct cmd_list_element *cmd, const char *value)
+{
+ switch (execution_direction) {
+ case EXEC_FORWARD:
+ fprintf_filtered (out, _("Forward.\n"));
+ break;
+ case EXEC_REVERSE:
+ fprintf_filtered (out, _("Reverse.\n"));
+ break;
+ case EXEC_ERROR:
+ default:
+ fprintf_filtered (out,
+ _("Forward (target `%s' does not support exec-direction).\n"),
+ target_shortname);
+ break;
+ }
+}
+
+/* User interface for non-stop mode. */
+
int non_stop = 0;
static int non_stop_1 = 0;
@@ -4862,16 +5327,28 @@ function is skipped and the step command stops at a different source line."),
show_step_stop_if_no_debug,
&setlist, &showlist);
- add_setshow_boolean_cmd ("can-use-displaced-stepping", class_maintenance,
- &can_use_displaced_stepping, _("\
+ add_setshow_enum_cmd ("displaced-stepping", class_run,
+ can_use_displaced_stepping_enum,
+ &can_use_displaced_stepping, _("\
Set debugger's willingness to use displaced stepping."), _("\
Show debugger's willingness to use displaced stepping."), _("\
-If zero, gdb will not use displaced stepping to step over\n\
-breakpoints, even if such is supported by the target."),
- NULL,
- show_can_use_displaced_stepping,
- &maintenance_set_cmdlist,
- &maintenance_show_cmdlist);
+If on, gdb will use displaced stepping to step over breakpoints if it is\n\
+supported by the target architecture. If off, gdb will not use displaced\n\
+stepping to step over breakpoints, even if such is supported by the target\n\
+architecture. If auto (which is the default), gdb will use displaced stepping\n\
+if the target architecture supports it and non-stop mode is active, but will not\n\
+use it in all-stop mode (see help set non-stop)."),
+ NULL,
+ show_can_use_displaced_stepping,
+ &setlist, &showlist);
+
+ add_setshow_enum_cmd ("exec-direction", class_run, exec_direction_names,
+ &exec_direction, _("Set direction of execution.\n\
+Options are 'forward' or 'reverse'."),
+ _("Show direction of execution (forward/reverse)."),
+ _("Tells gdb whether to execute forward or backward."),
+ set_exec_direction_func, show_exec_direction_func,
+ &setlist, &showlist);
/* ptid initializations */
null_ptid = ptid_build (0, 0, 0);
@@ -4881,4 +5358,5 @@ breakpoints, even if such is supported by the target."),
displaced_step_ptid = null_ptid;
observer_attach_thread_ptid_changed (infrun_thread_ptid_changed);
+ observer_attach_thread_stop_requested (infrun_thread_stop_requested);
}
diff --git a/gdb/interps.c b/gdb/interps.c
index 3bb7811..73bc51c 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -371,20 +371,15 @@ interpreter_exec_cmd (char *args, int from_tty)
unsigned int i;
int old_quiet, use_quiet;
- prules = buildargv (args);
- if (prules == NULL)
- {
- error (_("unable to parse arguments"));
- }
+ if (args == NULL)
+ error_no_arg (_("interpreter-exec command"));
+
+ prules = gdb_buildargv (args);
+ make_cleanup_freeargv (prules);
nrules = 0;
- if (prules != NULL)
- {
- for (trule = prules; *trule != NULL; trule++)
- {
- nrules++;
- }
- }
+ for (trule = prules; *trule != NULL; trule++)
+ nrules++;
if (nrules < 2)
error (_("usage: interpreter-exec <interpreter> [ <command> ... ]"));
diff --git a/gdb/jv-lang.h b/gdb/jv-lang.h
index 51bada2..04ba383 100644
--- a/gdb/jv-lang.h
+++ b/gdb/jv-lang.h
@@ -41,11 +41,11 @@ extern struct type *java_double_type;
extern struct type *java_void_type;
extern int java_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
- struct ui_file *, int, int, int,
- enum val_prettyprint);
+ struct ui_file *, int,
+ const struct value_print_options *);
-extern int java_value_print (struct value *, struct ui_file *, int,
- enum val_prettyprint);
+extern int java_value_print (struct value *, struct ui_file *,
+ const struct value_print_options *);
extern struct value *java_class_from_object (struct value *);
diff --git a/gdb/jv-typeprint.c b/gdb/jv-typeprint.c
index 404d02b..13fc958 100644
--- a/gdb/jv-typeprint.c
+++ b/gdb/jv-typeprint.c
@@ -185,7 +185,7 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
fprintf_filtered (stream, "public ");
}
- if (TYPE_FIELD_STATIC (type, i))
+ if (field_is_static (&TYPE_FIELD (type, i)))
fprintf_filtered (stream, "static ");
java_print_type (TYPE_FIELD_TYPE (type, i),
diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c
index 68dbdf8..0714e07 100644
--- a/gdb/jv-valprint.c
+++ b/gdb/jv-valprint.c
@@ -35,13 +35,14 @@
/* Local functions */
int
-java_value_print (struct value *val, struct ui_file *stream, int format,
- enum val_prettyprint pretty)
+java_value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options)
{
struct type *type;
CORE_ADDR address;
int i;
char *name;
+ struct value_print_options opts;
type = value_type (val);
address = VALUE_ADDRESS (val) + value_offset (val);
@@ -89,7 +90,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
address += JAVA_OBJECT_SIZE + 4; /* Skip object header and length. */
- while (i < length && things_printed < print_max)
+ while (i < length && things_printed < options->print_max)
{
gdb_byte *buf;
@@ -145,7 +146,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
VALUE_ADDRESS (v) = address + JAVA_OBJECT_SIZE + 4;
VALUE_ADDRESS (next_v) = VALUE_ADDRESS (v);
- while (i < length && things_printed < print_max)
+ while (i < length && things_printed < options->print_max)
{
fputs_filtered (", ", stream);
wrap_here (n_spaces (2));
@@ -180,8 +181,9 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
else
fprintf_filtered (stream, "%d..%d: ", i, i + reps - 1);
- common_val_print (v, stream, format, 2, 1, pretty,
- current_language);
+ opts = *options;
+ opts.deref_ref = 1;
+ common_val_print (v, stream, 1, &opts, current_language);
things_printed++;
i += reps;
@@ -203,7 +205,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
&& TYPE_TAG_NAME (TYPE_TARGET_TYPE (type))
&& strcmp (TYPE_TAG_NAME (TYPE_TARGET_TYPE (type)),
"java.lang.String") == 0
- && (format == 0 || format == 's')
+ && (options->format == 0 || options->format == 's')
&& address != 0
&& value_as_address (val) != 0)
{
@@ -228,16 +230,17 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
value_free_to_mark (mark); /* Release unnecessary values */
- val_print_string (data + boffset, count, 2, stream);
+ val_print_string (data + boffset, count, 2, stream, options);
return 0;
}
- return common_val_print (val, stream, format, 1, 0, pretty,
- current_language);
+ opts = *options;
+ opts.deref_ref = 1;
+ return common_val_print (val, stream, 0, &opts, current_language);
}
-/* TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and PRETTY have the
+/* TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and OPTIONS have the
same meanings as in cp_print_value and c_val_print.
DONT_PRINT is an array of baseclass types that we
@@ -246,7 +249,8 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
static void
java_print_value_fields (struct type *type, const gdb_byte *valaddr,
CORE_ADDR address, struct ui_file *stream,
- int format, int recurse, enum val_prettyprint pretty)
+ int recurse,
+ const struct value_print_options *options)
{
int i, len, n_baseclasses;
@@ -275,7 +279,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
boffset = 0;
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * (recurse + 1), stream);
@@ -289,7 +293,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
base_valaddr = valaddr;
java_print_value_fields (baseclass, base_valaddr, address + boffset,
- stream, format, recurse + 1, pretty);
+ stream, recurse + 1, options);
fputs_filtered (", ", stream);
}
@@ -304,10 +308,10 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
for (i = n_baseclasses; i < len; i++)
{
/* If requested, skip printing of static fields. */
- if (TYPE_FIELD_STATIC (type, i))
+ if (field_is_static (&TYPE_FIELD (type, i)))
{
char *name = TYPE_FIELD_NAME (type, i);
- if (!static_field_print)
+ if (!options->static_field_print)
continue;
if (name != NULL && strcmp (name, "class") == 0)
continue;
@@ -316,7 +320,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
fprintf_filtered (stream, ", ");
else if (n_baseclasses > 0)
{
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -327,7 +331,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
}
fields_seen = 1;
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -336,13 +340,13 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
{
wrap_here (n_spaces (2 + 2 * recurse));
}
- if (inspect_it)
+ if (options->inspect_it)
{
if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_PTR)
fputs_filtered ("\"( ptr \"", stream);
else
fputs_filtered ("\"( nodef \"", stream);
- if (TYPE_FIELD_STATIC (type, i))
+ if (field_is_static (&TYPE_FIELD (type, i)))
fputs_filtered ("static ", stream);
fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
language_cplus,
@@ -357,7 +361,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
{
annotate_field_begin (TYPE_FIELD_TYPE (type, i));
- if (TYPE_FIELD_STATIC (type, i))
+ if (field_is_static (&TYPE_FIELD (type, i)))
fputs_filtered ("static ", stream);
fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
language_cplus,
@@ -367,7 +371,8 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
annotate_field_value ();
}
- if (!TYPE_FIELD_STATIC (type, i) && TYPE_FIELD_PACKED (type, i))
+ if (!field_is_static (&TYPE_FIELD (type, i))
+ && TYPE_FIELD_PACKED (type, i))
{
struct value *v;
@@ -379,11 +384,15 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
}
else
{
+ struct value_print_options opts;
+
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
- common_val_print (v, stream, format, 0, recurse + 1,
- pretty, current_language);
+ opts = *options;
+ opts.deref_ref = 0;
+ common_val_print (v, stream, recurse + 1,
+ &opts, current_language);
}
}
else
@@ -392,35 +401,40 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
{
fputs_filtered ("<optimized out or zero length>", stream);
}
- else if (TYPE_FIELD_STATIC (type, i))
+ else if (field_is_static (&TYPE_FIELD (type, i)))
{
struct value *v = value_static_field (type, i);
if (v == NULL)
fputs_filtered ("<optimized out>", stream);
else
{
+ struct value_print_options opts;
struct type *t = check_typedef (value_type (v));
if (TYPE_CODE (t) == TYPE_CODE_STRUCT)
v = value_addr (v);
- common_val_print (v, stream, format, 0, recurse + 1,
- pretty, current_language);
+ opts = *options;
+ opts.deref_ref = 0;
+ common_val_print (v, stream, recurse + 1,
+ &opts, current_language);
}
}
else if (TYPE_FIELD_TYPE (type, i) == NULL)
fputs_filtered ("<unknown type>", stream);
else
{
+ struct value_print_options opts = *options;
+ opts.deref_ref = 0;
val_print (TYPE_FIELD_TYPE (type, i),
valaddr + TYPE_FIELD_BITPOS (type, i) / 8, 0,
address + TYPE_FIELD_BITPOS (type, i) / 8,
- stream, format, 0, recurse + 1, pretty,
+ stream, recurse + 1, &opts,
current_language);
}
}
annotate_field_end ();
}
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
@@ -431,22 +445,16 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
/* Print data of type TYPE located at VALADDR (within GDB), which came from
the inferior at address ADDRESS, onto stdio stream STREAM according to
- FORMAT (a letter or 0 for natural format). The data at VALADDR is in
- target byte order.
+ OPTIONS. The data at VALADDR is in target byte order.
If the data are a string pointer, returns the number of string characters
- printed.
-
- If DEREF_REF is nonzero, then dereference references, otherwise just print
- them like pointers.
-
- The PRETTY parameter controls prettyprinting. */
+ printed. */
int
java_val_print (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format, int deref_ref,
- int recurse, enum val_prettyprint pretty)
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
unsigned int i = 0; /* Number of characters printed */
struct type *target_type;
@@ -456,13 +464,13 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
switch (TYPE_CODE (type))
{
case TYPE_CODE_PTR:
- if (format && format != 's')
+ if (options->format && options->format != 's')
{
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ print_scalar_formatted (valaddr, type, options, 0, stream);
break;
}
#if 0
- if (vtblprint && cp_is_vtbl_ptr_type (type))
+ if (options->vtblprint && cp_is_vtbl_ptr_type (type))
{
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if we ARE using
@@ -489,7 +497,7 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
return (0);
}
- if (addressprint && format != 's')
+ if (options->addressprint && options->format != 's')
{
fputs_filtered ("@", stream);
print_longest (stream, 'x', 0, (ULONGEST) addr);
@@ -501,9 +509,13 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
case TYPE_CODE_INT:
/* Can't just call c_val_print because that prints bytes as C
chars. */
- format = format ? format : output_format;
- if (format)
- print_scalar_formatted (valaddr, type, format, 0, stream);
+ if (options->format || options->output_format)
+ {
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr, type, &opts, 0, stream);
+ }
else if (TYPE_CODE (type) == TYPE_CODE_CHAR
|| (TYPE_CODE (type) == TYPE_CODE_INT
&& TYPE_LENGTH (type) == 2
@@ -514,13 +526,13 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
break;
case TYPE_CODE_STRUCT:
- java_print_value_fields (type, valaddr, address, stream, format,
- recurse, pretty);
+ java_print_value_fields (type, valaddr, address, stream, recurse,
+ options);
break;
default:
return c_val_print (type, valaddr, embedded_offset, address, stream,
- format, deref_ref, recurse, pretty);
+ recurse, options);
}
return 0;
diff --git a/gdb/language.c b/gdb/language.c
index 121fc55..46e238d 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -72,7 +72,8 @@ static void unk_lang_printchar (int c, struct ui_file *stream);
static void unk_lang_print_type (struct type *, char *, struct ui_file *,
int, int);
-static int unk_lang_value_print (struct value *, struct ui_file *, int, enum val_prettyprint);
+static int unk_lang_value_print (struct value *, struct ui_file *,
+ const struct value_print_options *);
static CORE_ADDR unk_lang_trampoline (struct frame_info *, CORE_ADDR pc);
@@ -1035,10 +1036,10 @@ default_word_break_characters (void)
void
default_print_array_index (struct value *index_value, struct ui_file *stream,
- int format, enum val_prettyprint pretty)
+ const struct value_print_options *options)
{
fprintf_filtered (stream, "[");
- LA_VALUE_PRINT (index_value, stream, format, pretty);
+ LA_VALUE_PRINT (index_value, stream, options);
fprintf_filtered (stream, "] = ");
}
@@ -1070,7 +1071,8 @@ unk_lang_printchar (int c, struct ui_file *stream)
static void
unk_lang_printstr (struct ui_file *stream, const gdb_byte *string,
- unsigned int length, int width, int force_ellipses)
+ unsigned int length, int width, int force_ellipses,
+ const struct value_print_options *options)
{
error (_("internal error - unimplemented function unk_lang_printstr called."));
}
@@ -1085,15 +1087,15 @@ unk_lang_print_type (struct type *type, char *varstring, struct ui_file *stream,
static int
unk_lang_val_print (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
error (_("internal error - unimplemented function unk_lang_val_print called."));
}
static int
-unk_lang_value_print (struct value *val, struct ui_file *stream, int format,
- enum val_prettyprint pretty)
+unk_lang_value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options)
{
error (_("internal error - unimplemented function unk_lang_value_print called."));
}
diff --git a/gdb/language.h b/gdb/language.h
index cc10ff2..c92c57c 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -30,6 +30,7 @@ struct objfile;
struct frame_info;
struct expression;
struct ui_file;
+struct value_print_options;
#define MAX_FORTRAN_DIMS 7 /* Maximum number of F77 array dims */
@@ -189,7 +190,8 @@ struct language_defn
void (*la_printstr) (struct ui_file * stream, const gdb_byte *string,
unsigned int length, int width,
- int force_ellipses);
+ int force_ellipses,
+ const struct value_print_options *);
void (*la_emitchar) (int ch, struct ui_file * stream, int quoter);
@@ -208,13 +210,13 @@ struct language_defn
/* Print a value using syntax appropriate for this language. */
int (*la_val_print) (struct type *, const gdb_byte *, int, CORE_ADDR,
- struct ui_file *, int, int, int,
- enum val_prettyprint);
+ struct ui_file *, int,
+ const struct value_print_options *);
/* Print a top-level value using syntax appropriate for this language. */
int (*la_value_print) (struct value *, struct ui_file *,
- int, enum val_prettyprint);
+ const struct value_print_options *);
/* PC is possibly an unknown languages trampoline.
If that PC falls in a trampoline belonging to this language,
@@ -274,8 +276,7 @@ struct language_defn
/* Print the index of an element of an array. */
void (*la_print_array_index) (struct value *index_value,
struct ui_file *stream,
- int format,
- enum val_prettyprint pretty);
+ const struct value_print_options *options);
/* Return non-zero if TYPE should be passed (and returned) by
reference at the language level. */
@@ -366,21 +367,22 @@ extern enum language set_language (enum language);
#define LA_PRINT_TYPEDEF(type,new_symbol,stream) \
(current_language->la_print_typedef(type,new_symbol,stream))
-#define LA_VAL_PRINT(type,valaddr,offset,addr,stream,fmt,deref,recurse,pretty) \
- (current_language->la_val_print(type,valaddr,offset,addr,stream,fmt,deref, \
- recurse,pretty))
-#define LA_VALUE_PRINT(val,stream,fmt,pretty) \
- (current_language->la_value_print(val,stream,fmt,pretty))
+#define LA_VAL_PRINT(type,valaddr,offset,addr,stream,recurse,options) \
+ (current_language->la_val_print(type,valaddr,offset,addr,stream, \
+ recurse,options))
+#define LA_VALUE_PRINT(val,stream,options) \
+ (current_language->la_value_print(val,stream,options))
#define LA_PRINT_CHAR(ch, stream) \
(current_language->la_printchar(ch, stream))
-#define LA_PRINT_STRING(stream, string, length, width, force_ellipses) \
- (current_language->la_printstr(stream, string, length, width, force_ellipses))
+#define LA_PRINT_STRING(stream, string, length, width, force_ellipses,options) \
+ (current_language->la_printstr(stream, string, length, width, \
+ force_ellipses,options))
#define LA_EMIT_CHAR(ch, stream, quoter) \
(current_language->la_emitchar(ch, stream, quoter))
-#define LA_PRINT_ARRAY_INDEX(index_value, stream, format, pretty) \
- (current_language->la_print_array_index(index_value, stream, format, pretty))
+#define LA_PRINT_ARRAY_INDEX(index_value, stream, optins) \
+ (current_language->la_print_array_index(index_value, stream, options))
/* Test a character to decide whether it can be printed in literal form
or needs to be printed in another representation. For example,
@@ -472,8 +474,7 @@ extern char *default_word_break_characters (void);
/* Print the index of an array element using the C99 syntax. */
extern void default_print_array_index (struct value *index_value,
struct ui_file *stream,
- int format,
- enum val_prettyprint pretty);
+ const struct value_print_options *options);
/* Return non-zero if TYPE should be passed (and returned) by
reference at the language level. */
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index a0dc634..913bfec 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -316,7 +316,6 @@ static void linux_nat_async (void (*callback)
static int linux_nat_async_mask (int mask);
static int kill_lwp (int lwpid, int signo);
-static int send_sigint_callback (struct lwp_info *lp, void *data);
static int stop_callback (struct lwp_info *lp, void *data);
/* Captures the result of a successful waitpid call, along with the
@@ -333,8 +332,12 @@ struct waitpid_result
in the async SIGCHLD handler. */
static struct waitpid_result *waitpid_queue = NULL;
+/* Similarly to `waitpid', but check the local event queue instead of
+ querying the kernel queue. If PEEK, don't remove the event found
+ from the queue. */
+
static int
-queued_waitpid (int pid, int *status, int flags)
+queued_waitpid_1 (int pid, int *status, int flags, int peek)
{
struct waitpid_result *msg = waitpid_queue, *prev = NULL;
@@ -370,12 +373,6 @@ QWPID: linux_nat_async_events_state(%d), linux_nat_num_queued_events(%d)\n",
{
int pid;
- if (prev)
- prev->next = msg->next;
- else
- waitpid_queue = msg->next;
-
- msg->next = NULL;
if (status)
*status = msg->status;
pid = msg->pid;
@@ -383,7 +380,17 @@ QWPID: linux_nat_async_events_state(%d), linux_nat_num_queued_events(%d)\n",
if (debug_linux_nat_async)
fprintf_unfiltered (gdb_stdlog, "QWPID: pid(%d), status(%x)\n",
pid, msg->status);
- xfree (msg);
+
+ if (!peek)
+ {
+ if (prev)
+ prev->next = msg->next;
+ else
+ waitpid_queue = msg->next;
+
+ msg->next = NULL;
+ xfree (msg);
+ }
return pid;
}
@@ -396,6 +403,14 @@ QWPID: linux_nat_async_events_state(%d), linux_nat_num_queued_events(%d)\n",
return -1;
}
+/* Similarly to `waitpid', but check the local event queue. */
+
+static int
+queued_waitpid (int pid, int *status, int flags)
+{
+ return queued_waitpid_1 (pid, status, flags, 0);
+}
+
static void
push_waitpid (int pid, int status, int options)
{
@@ -1302,7 +1317,8 @@ lin_lwp_attach_lwp (ptid_t ptid)
}
static void
-linux_nat_create_inferior (char *exec_file, char *allargs, char **env,
+linux_nat_create_inferior (struct target_ops *ops,
+ char *exec_file, char *allargs, char **env,
int from_tty)
{
int saved_async = 0;
@@ -1349,7 +1365,7 @@ linux_nat_create_inferior (char *exec_file, char *allargs, char **env,
}
#endif /* HAVE_PERSONALITY */
- linux_ops->to_create_inferior (exec_file, allargs, env, from_tty);
+ linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty);
#ifdef HAVE_PERSONALITY
if (personality_set)
@@ -1367,7 +1383,7 @@ linux_nat_create_inferior (char *exec_file, char *allargs, char **env,
}
static void
-linux_nat_attach (char *args, int from_tty)
+linux_nat_attach (struct target_ops *ops, char *args, int from_tty)
{
struct lwp_info *lp;
int status;
@@ -1375,7 +1391,7 @@ linux_nat_attach (char *args, int from_tty)
/* FIXME: We should probably accept a list of process id's, and
attach all of them. */
- linux_ops->to_attach (args, from_tty);
+ linux_ops->to_attach (ops, args, from_tty);
if (!target_can_async_p ())
{
@@ -1556,7 +1572,7 @@ detach_callback (struct lwp_info *lp, void *data)
}
static void
-linux_nat_detach (char *args, int from_tty)
+linux_nat_detach (struct target_ops *ops, char *args, int from_tty)
{
int pid;
int status;
@@ -1597,7 +1613,7 @@ linux_nat_detach (char *args, int from_tty)
pid = GET_PID (inferior_ptid);
inferior_ptid = pid_to_ptid (pid);
- linux_ops->to_detach (args, from_tty);
+ linux_ops->to_detach (ops, args, from_tty);
if (target_can_async_p ())
drain_queued_events (pid);
@@ -2200,11 +2216,11 @@ stop_wait_callback (struct lwp_info *lp, void *data)
/* There was no gdb breakpoint set at pc. Put
the event back in the queue. */
if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "SWC: kill %s, %s\n",
- target_pid_to_str (lp->ptid),
- status_to_str ((int) status));
- kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (status));
+ fprintf_unfiltered (gdb_stdlog, "\
+SWC: leaving SIGTRAP in local queue of %s\n", target_pid_to_str (lp->ptid));
+ push_waitpid (GET_LWP (lp->ptid),
+ W_STOPCODE (SIGTRAP),
+ lp->cloned ? __WCLONE : 0);
}
}
else
@@ -3161,7 +3177,7 @@ linux_nat_kill (void)
}
static void
-linux_nat_mourn_inferior (void)
+linux_nat_mourn_inferior (struct target_ops *ops)
{
/* Destroy LWP info; it's no longer valid. */
init_lwp_list ();
@@ -3171,7 +3187,7 @@ linux_nat_mourn_inferior (void)
/* Normal case, no other forks available. */
if (target_can_async_p ())
linux_nat_async (NULL, 0);
- linux_ops->to_mourn_inferior ();
+ linux_ops->to_mourn_inferior (ops);
}
else
/* Multi-fork case. The current inferior_ptid has exited, but
@@ -3319,11 +3335,13 @@ linux_nat_find_memory_regions (int (*func) (CORE_ADDR,
char permissions[8], device[8], filename[MAXPATHLEN];
int read, write, exec;
int ret;
+ struct cleanup *cleanup;
/* Compose the filename for the /proc memory map, and open it. */
sprintf (mapsfilename, "/proc/%lld/maps", pid);
if ((mapsfile = fopen (mapsfilename, "r")) == NULL)
error (_("Could not open %s."), mapsfilename);
+ cleanup = make_cleanup_fclose (mapsfile);
if (info_verbose)
fprintf_filtered (gdb_stdout,
@@ -3356,7 +3374,7 @@ linux_nat_find_memory_regions (int (*func) (CORE_ADDR,
segment. */
func (addr, size, read, write, exec, obfd);
}
- fclose (mapsfile);
+ do_cleanups (cleanup);
return 0;
}
@@ -3591,10 +3609,8 @@ linux_nat_info_proc_cmd (char *args, int from_tty)
if (args)
{
/* Break up 'args' into an argv array. */
- if ((argv = buildargv (args)) == NULL)
- nomem (0);
- else
- make_cleanup_freeargv (argv);
+ argv = gdb_buildargv (args);
+ make_cleanup_freeargv (argv);
}
while (argv != NULL && *argv != NULL)
{
@@ -3649,9 +3665,10 @@ linux_nat_info_proc_cmd (char *args, int from_tty)
sprintf (fname1, "/proc/%lld/cmdline", pid);
if ((procfile = fopen (fname1, "r")) != NULL)
{
+ struct cleanup *cleanup = make_cleanup_fclose (procfile);
fgets (buffer, sizeof (buffer), procfile);
printf_filtered ("cmdline = '%s'\n", buffer);
- fclose (procfile);
+ do_cleanups (cleanup);
}
else
warning (_("unable to open /proc file '%s'"), fname1);
@@ -3681,7 +3698,9 @@ linux_nat_info_proc_cmd (char *args, int from_tty)
{
long long addr, endaddr, size, offset, inode;
char permissions[8], device[8], filename[MAXPATHLEN];
+ struct cleanup *cleanup;
+ cleanup = make_cleanup_fclose (procfile);
printf_filtered (_("Mapped address spaces:\n\n"));
if (gdbarch_addr_bit (current_gdbarch) == 32)
{
@@ -3729,7 +3748,7 @@ linux_nat_info_proc_cmd (char *args, int from_tty)
}
}
- fclose (procfile);
+ do_cleanups (cleanup);
}
else
warning (_("unable to open /proc file '%s'"), fname1);
@@ -3739,9 +3758,10 @@ linux_nat_info_proc_cmd (char *args, int from_tty)
sprintf (fname1, "/proc/%lld/status", pid);
if ((procfile = fopen (fname1, "r")) != NULL)
{
+ struct cleanup *cleanup = make_cleanup_fclose (procfile);
while (fgets (buffer, sizeof (buffer), procfile) != NULL)
puts_filtered (buffer);
- fclose (procfile);
+ do_cleanups (cleanup);
}
else
warning (_("unable to open /proc file '%s'"), fname1);
@@ -3754,6 +3774,7 @@ linux_nat_info_proc_cmd (char *args, int from_tty)
int itmp;
char ctmp;
long ltmp;
+ struct cleanup *cleanup = make_cleanup_fclose (procfile);
if (fscanf (procfile, "%d ", &itmp) > 0)
printf_filtered (_("Process: %d\n"), itmp);
@@ -3837,7 +3858,7 @@ linux_nat_info_proc_cmd (char *args, int from_tty)
if (fscanf (procfile, "%lu ", &ltmp) > 0) /* FIXME arch? */
printf_filtered (_("wchan (system call): 0x%lx\n"), ltmp);
#endif
- fclose (procfile);
+ do_cleanups (cleanup);
}
else
warning (_("unable to open /proc file '%s'"), fname1);
@@ -3939,6 +3960,7 @@ linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigse
FILE *procfile;
char buffer[MAXPATHLEN], fname[MAXPATHLEN];
int signum;
+ struct cleanup *cleanup;
sigemptyset (pending);
sigemptyset (blocked);
@@ -3947,6 +3969,7 @@ linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigse
procfile = fopen (fname, "r");
if (procfile == NULL)
error (_("Could not open %s"), fname);
+ cleanup = make_cleanup_fclose (procfile);
while (fgets (buffer, MAXPATHLEN, procfile) != NULL)
{
@@ -3968,7 +3991,7 @@ linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigse
add_line_to_sigset (buffer + 8, ignored);
}
- fclose (procfile);
+ do_cleanups (cleanup);
}
static LONGEST
@@ -4370,15 +4393,76 @@ linux_nat_async (void (*callback) (enum inferior_event_type event_type,
return;
}
+/* Stop an LWP, and push a TARGET_SIGNAL_0 stop status if no other
+ event came out. */
+
static int
-send_sigint_callback (struct lwp_info *lp, void *data)
+linux_nat_stop_lwp (struct lwp_info *lwp, void *data)
{
- /* Use is_running instead of !lp->stopped, because the lwp may be
- stopped due to an internal event, and we want to interrupt it in
- that case too. What we want is to check if the thread is stopped
- from the point of view of the user. */
- if (is_running (lp->ptid))
- kill_lwp (GET_LWP (lp->ptid), SIGINT);
+ ptid_t ptid = * (ptid_t *) data;
+
+ if (ptid_equal (lwp->ptid, ptid)
+ || ptid_equal (minus_one_ptid, ptid)
+ || (ptid_is_pid (ptid)
+ && ptid_get_pid (ptid) == ptid_get_pid (lwp->ptid)))
+ {
+ if (!lwp->stopped)
+ {
+ int pid, status;
+
+ if (debug_linux_nat)
+ fprintf_unfiltered (gdb_stdlog,
+ "LNSL: running -> suspending %s\n",
+ target_pid_to_str (lwp->ptid));
+
+ /* Peek once, to check if we've already waited for this
+ LWP. */
+ pid = queued_waitpid_1 (ptid_get_lwp (lwp->ptid), &status,
+ lwp->cloned ? __WCLONE : 0, 1 /* peek */);
+
+ if (pid == -1)
+ {
+ ptid_t ptid = lwp->ptid;
+
+ stop_callback (lwp, NULL);
+ stop_wait_callback (lwp, NULL);
+
+ /* If the lwp exits while we try to stop it, there's
+ nothing else to do. */
+ lwp = find_lwp_pid (ptid);
+ if (lwp == NULL)
+ return 0;
+
+ pid = queued_waitpid_1 (ptid_get_lwp (lwp->ptid), &status,
+ lwp->cloned ? __WCLONE : 0,
+ 1 /* peek */);
+ }
+
+ /* If we didn't collect any signal other than SIGSTOP while
+ stopping the LWP, push a SIGNAL_0 event. In either case,
+ the event-loop will end up calling target_wait which will
+ collect these. */
+ if (pid == -1)
+ push_waitpid (ptid_get_lwp (lwp->ptid), W_STOPCODE (0),
+ lwp->cloned ? __WCLONE : 0);
+ }
+ else
+ {
+ /* Already known to be stopped; do nothing. */
+
+ if (debug_linux_nat)
+ {
+ if (find_thread_pid (lwp->ptid)->stop_requested)
+ fprintf_unfiltered (gdb_stdlog, "\
+LNSL: already stopped/stop_requested %s\n",
+ target_pid_to_str (lwp->ptid));
+ else
+ fprintf_unfiltered (gdb_stdlog, "\
+LNSL: already stopped/no stop_requested yet %s\n",
+ target_pid_to_str (lwp->ptid));
+ }
+ }
+ }
return 0;
}
@@ -4387,13 +4471,9 @@ linux_nat_stop (ptid_t ptid)
{
if (non_stop)
{
- if (ptid_equal (ptid, minus_one_ptid))
- iterate_over_lwps (send_sigint_callback, &ptid);
- else
- {
- struct lwp_info *lp = find_lwp_pid (ptid);
- send_sigint_callback (lp, NULL);
- }
+ linux_nat_async_events (sigchld_sync);
+ iterate_over_lwps (linux_nat_stop_lwp, &ptid);
+ target_async (inferior_event_handler, 0);
}
else
linux_ops->to_stop (ptid);
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 650cbaa..5f98e99 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -780,11 +780,11 @@ detach_thread (ptid_t ptid)
}
static void
-thread_db_detach (char *args, int from_tty)
+thread_db_detach (struct target_ops *ops, char *args, int from_tty)
{
disable_thread_event_reporting ();
- target_beneath->to_detach (args, from_tty);
+ target_beneath->to_detach (target_beneath, args, from_tty);
/* Should this be done by detach_command? */
target_mourn_inferior ();
@@ -927,20 +927,20 @@ thread_db_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
}
static void
-thread_db_mourn_inferior (void)
+thread_db_mourn_inferior (struct target_ops *ops)
{
/* Forget about the child's process ID. We shouldn't need it
anymore. */
proc_handle.pid = 0;
- target_beneath->to_mourn_inferior ();
+ target_beneath->to_mourn_inferior (target_beneath);
/* Delete the old thread event breakpoints. Do this after mourning
the inferior, so that we don't try to uninsert them. */
remove_thread_event_breakpoints ();
/* Detach thread_db target ops. */
- unpush_target (&thread_db_ops);
+ unpush_target (ops);
using_thread_db = 0;
}
@@ -1143,6 +1143,35 @@ thread_db_get_thread_local_address (ptid_t ptid,
_("TLS not supported on this target"));
}
+/* Callback routine used to find a thread based on the TID part of
+ its PTID. */
+
+static int
+thread_db_find_thread_from_tid (struct thread_info *thread, void *data)
+{
+ long *tid = (long *) data;
+
+ if (thread->private->tid == *tid)
+ return 1;
+
+ return 0;
+}
+
+/* Implement the to_get_ada_task_ptid target method for this target. */
+
+static ptid_t
+thread_db_get_ada_task_ptid (long lwp, long thread)
+{
+ struct thread_info *thread_info;
+
+ thread_db_find_new_threads ();
+ thread_info = iterate_over_threads (thread_db_find_thread_from_tid, &thread);
+
+ gdb_assert (thread_info != NULL);
+
+ return (thread_info->ptid);
+}
+
static void
init_thread_db_ops (void)
{
@@ -1163,6 +1192,7 @@ init_thread_db_ops (void)
thread_db_ops.to_is_async_p = thread_db_is_async_p;
thread_db_ops.to_async = thread_db_async;
thread_db_ops.to_async_mask = thread_db_async_mask;
+ thread_db_ops.to_get_ada_task_ptid = thread_db_get_ada_task_ptid;
thread_db_ops.to_magic = OPS_MAGIC;
}
diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y
index b7b28fe..6230c20 100644
--- a/gdb/m2-exp.y
+++ b/gdb/m2-exp.y
@@ -1033,7 +1033,7 @@ yylex ()
if(sym)
{
- switch(sym->aclass)
+ switch(SYMBOL_CLASS (sym))
{
case LOC_STATIC:
case LOC_REGISTER:
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index ea59403..e09b64b 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -104,7 +104,8 @@ m2_printchar (int c, struct ui_file *stream)
static void
m2_printstr (struct ui_file *stream, const gdb_byte *string,
- unsigned int length, int width, int force_ellipses)
+ unsigned int length, int width, int force_ellipses,
+ const struct value_print_options *options)
{
unsigned int i;
unsigned int things_printed = 0;
@@ -117,7 +118,7 @@ m2_printstr (struct ui_file *stream, const gdb_byte *string,
return;
}
- for (i = 0; i < length && things_printed < print_max; ++i)
+ for (i = 0; i < length && things_printed < options->print_max; ++i)
{
/* Position of the character we are examining
to see whether it is repeated. */
@@ -141,11 +142,11 @@ m2_printstr (struct ui_file *stream, const gdb_byte *string,
++reps;
}
- if (reps > repeat_count_threshold)
+ if (reps > options->repeat_count_threshold)
{
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\", ", stream);
else
fputs_filtered ("\", ", stream);
@@ -154,14 +155,14 @@ m2_printstr (struct ui_file *stream, const gdb_byte *string,
m2_printchar (string[i], stream);
fprintf_filtered (stream, " <repeats %u times>", reps);
i = rep1 - 1;
- things_printed += repeat_count_threshold;
+ things_printed += options->repeat_count_threshold;
need_comma = 1;
}
else
{
if (!in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\"", stream);
else
fputs_filtered ("\"", stream);
@@ -175,7 +176,7 @@ m2_printstr (struct ui_file *stream, const gdb_byte *string,
/* Terminate the quotes if necessary. */
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\"", stream);
else
fputs_filtered ("\"", stream);
diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h
index 8ce458c..f99e31a 100644
--- a/gdb/m2-lang.h
+++ b/gdb/m2-lang.h
@@ -33,8 +33,8 @@ extern int m2_is_long_set (struct type *type);
extern int m2_is_unbounded_array (struct type *type);
extern int m2_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
- struct ui_file *, int, int, int,
- enum val_prettyprint);
+ struct ui_file *, int,
+ const struct value_print_options *);
extern int get_long_set_bounds (struct type *type, LONGEST *low,
LONGEST *high);
diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c
index e2970e2..c0b8138 100644
--- a/gdb/m2-typeprint.c
+++ b/gdb/m2-typeprint.c
@@ -222,7 +222,7 @@ static void m2_array (struct type *type, struct ui_file *stream,
{
fprintf_filtered (stream, "ARRAY [");
if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
- && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
+ && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
{
if (TYPE_INDEX_TYPE (type) != 0)
{
diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c
index 82ff30e..d48108f 100644
--- a/gdb/m2-valprint.c
+++ b/gdb/m2-valprint.c
@@ -30,22 +30,24 @@
#include "m2-lang.h"
#include "target.h"
-int print_unpacked_pointer (struct type *type,
- CORE_ADDR address, CORE_ADDR addr,
- int format, struct ui_file *stream);
+static int print_unpacked_pointer (struct type *type,
+ CORE_ADDR address, CORE_ADDR addr,
+ const struct value_print_options *options,
+ struct ui_file *stream);
static void
m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format,
- enum val_prettyprint pretty,
- int deref_ref, int recurse, int len);
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options,
+ int len);
/* Print function pointer with inferior address ADDRESS onto stdio
stream STREAM. */
static void
-print_function_pointer_address (CORE_ADDR address, struct ui_file *stream)
+print_function_pointer_address (CORE_ADDR address, struct ui_file *stream,
+ int addressprint)
{
CORE_ADDR func_addr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
address,
@@ -88,8 +90,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high)
static void
m2_print_long_set (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format,
- enum val_prettyprint pretty)
+ struct ui_file *stream)
{
int empty_set = 1;
int element_seen = 0;
@@ -184,9 +185,8 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr,
static void
m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format,
- int deref_ref, enum val_prettyprint pretty,
- int recurse)
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
struct type *content_type;
CORE_ADDR addr;
@@ -207,26 +207,27 @@ m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
fprintf_filtered (stream, "{");
m2_print_array_contents (value_type (val), value_contents(val),
value_embedded_offset (val), addr, stream,
- format, deref_ref, pretty, recurse, len);
+ recurse, options, len);
fprintf_filtered (stream, ", HIGH = %d}", (int) len);
}
-int
+static int
print_unpacked_pointer (struct type *type,
CORE_ADDR address, CORE_ADDR addr,
- int format, struct ui_file *stream)
+ const struct value_print_options *options,
+ struct ui_file *stream)
{
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
{
/* Try to print what function it points to. */
- print_function_pointer_address (addr, stream);
+ print_function_pointer_address (addr, stream, options->addressprint);
/* Return value is irrelevant except for string pointers. */
return 0;
}
- if (addressprint && format != 's')
+ if (options->addressprint && options->format != 's')
fputs_filtered (paddress (address), stream);
/* For a pointer to char or unsigned char, also print the string
@@ -234,9 +235,9 @@ print_unpacked_pointer (struct type *type,
if (TYPE_LENGTH (elttype) == 1
&& TYPE_CODE (elttype) == TYPE_CODE_INT
- && (format == 0 || format == 's')
+ && (options->format == 0 || options->format == 's')
&& addr != 0)
- return val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
+ return val_print_string (addr, -1, TYPE_LENGTH (elttype), stream, options);
return 0;
}
@@ -244,9 +245,9 @@ print_unpacked_pointer (struct type *type,
static void
print_variable_at_address (struct type *type,
const gdb_byte *valaddr,
- struct ui_file *stream, int format,
- int deref_ref, int recurse,
- enum val_prettyprint pretty)
+ struct ui_file *stream,
+ int recurse,
+ const struct value_print_options *options)
{
CORE_ADDR addr = unpack_pointer (type, valaddr);
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
@@ -259,8 +260,7 @@ print_variable_at_address (struct type *type,
{
struct value *deref_val =
value_at (TYPE_TARGET_TYPE (type), unpack_pointer (type, valaddr));
- common_val_print (deref_val, stream, format, deref_ref,
- recurse, pretty, current_language);
+ common_val_print (deref_val, stream, recurse, options, current_language);
}
else
fputs_filtered ("???", stream);
@@ -276,9 +276,9 @@ print_variable_at_address (struct type *type,
static void
m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format,
- enum val_prettyprint pretty,
- int deref_ref, int recurse, int len)
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options,
+ int len)
{
int eltlen;
CHECK_TYPEDEF (type);
@@ -286,21 +286,20 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
if (TYPE_LENGTH (type) > 0)
{
eltlen = TYPE_LENGTH (type);
- if (prettyprint_arrays)
+ if (options->prettyprint_arrays)
print_spaces_filtered (2 + 2 * recurse, stream);
/* For an array of chars, print with string syntax. */
if (eltlen == 1 &&
((TYPE_CODE (type) == TYPE_CODE_INT)
|| ((current_language->la_language == language_m2)
&& (TYPE_CODE (type) == TYPE_CODE_CHAR)))
- && (format == 0 || format == 's'))
- val_print_string (address, len+1, eltlen, stream);
+ && (options->format == 0 || options->format == 's'))
+ val_print_string (address, len+1, eltlen, stream, options);
else
{
fprintf_filtered (stream, "{");
val_print_array_elements (type, valaddr + embedded_offset,
- address, stream, format,
- deref_ref, recurse, pretty, 0);
+ address, stream, recurse, options, 0);
fprintf_filtered (stream, "}");
}
}
@@ -309,21 +308,15 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
/* Print data of type TYPE located at VALADDR (within GDB), which came from
the inferior at address ADDRESS, onto stdio stream STREAM according to
- FORMAT (a letter or 0 for natural format). The data at VALADDR is in
- target byte order.
+ OPTIONS. The data at VALADDR is in target byte order.
If the data are a string pointer, returns the number of string characters
- printed.
-
- If DEREF_REF is nonzero, then dereference references, otherwise just print
- them like pointers.
-
- The PRETTY parameter controls prettyprinting. */
+ printed. */
int
m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
unsigned int i = 0; /* Number of characters printed */
unsigned len;
@@ -343,74 +336,73 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
elttype = check_typedef (TYPE_TARGET_TYPE (type));
eltlen = TYPE_LENGTH (elttype);
len = TYPE_LENGTH (type) / eltlen;
- if (prettyprint_arrays)
+ if (options->prettyprint_arrays)
print_spaces_filtered (2 + 2 * recurse, stream);
/* For an array of chars, print with string syntax. */
if (eltlen == 1 &&
((TYPE_CODE (elttype) == TYPE_CODE_INT)
|| ((current_language->la_language == language_m2)
&& (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
- && (format == 0 || format == 's'))
+ && (options->format == 0 || options->format == 's'))
{
/* If requested, look for the first null char and only print
elements up to it. */
- if (stop_print_at_null)
+ if (options->stop_print_at_null)
{
unsigned int temp_len;
/* Look for a NULL char. */
for (temp_len = 0;
(valaddr + embedded_offset)[temp_len]
- && temp_len < len && temp_len < print_max;
+ && temp_len < len && temp_len < options->print_max;
temp_len++);
len = temp_len;
}
- LA_PRINT_STRING (stream, valaddr + embedded_offset, len, 1, 0);
+ LA_PRINT_STRING (stream, valaddr + embedded_offset, len, 1, 0,
+ options);
i = len;
}
else
{
fprintf_filtered (stream, "{");
val_print_array_elements (type, valaddr + embedded_offset,
- address, stream, format, deref_ref,
- recurse, pretty, 0);
+ address, stream, recurse, options, 0);
fprintf_filtered (stream, "}");
}
break;
}
/* Array of unspecified length: treat like pointer to first elt. */
- print_unpacked_pointer (type, address, address, format, stream);
+ print_unpacked_pointer (type, address, address, options, stream);
break;
case TYPE_CODE_PTR:
if (TYPE_CONST (type))
print_variable_at_address (type, valaddr + embedded_offset,
- stream, format, deref_ref, recurse,
- pretty);
- else if (format && format != 's')
- print_scalar_formatted (valaddr + embedded_offset, type, format,
- 0, stream);
+ stream, recurse, options);
+ else if (options->format && options->format != 's')
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
else
{
addr = unpack_pointer (type, valaddr + embedded_offset);
- print_unpacked_pointer (type, addr, address, format, stream);
+ print_unpacked_pointer (type, addr, address, options, stream);
}
break;
case TYPE_CODE_REF:
elttype = check_typedef (TYPE_TARGET_TYPE (type));
- if (addressprint)
+ if (options->addressprint)
{
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
fprintf_filtered (stream, "@");
fputs_filtered (paddress (addr), stream);
- if (deref_ref)
+ if (options->deref_ref)
fputs_filtered (": ", stream);
}
/* De-reference the reference. */
- if (deref_ref)
+ if (options->deref_ref)
{
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
{
@@ -418,8 +410,8 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (type, valaddr + embedded_offset));
- common_val_print (deref_val, stream, format, deref_ref,
- recurse, pretty, current_language);
+ common_val_print (deref_val, stream, recurse, options,
+ current_language);
}
else
fputs_filtered ("???", stream);
@@ -427,7 +419,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_UNION:
- if (recurse && !unionprint)
+ if (recurse && !options->unionprint)
{
fprintf_filtered (stream, "{...}");
break;
@@ -436,22 +428,20 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
case TYPE_CODE_STRUCT:
if (m2_is_long_set (type))
m2_print_long_set (type, valaddr, embedded_offset, address,
- stream, format, pretty);
+ stream);
else if (m2_is_unbounded_array (type))
m2_print_unbounded_array (type, valaddr, embedded_offset,
- address, stream, format, deref_ref,
- pretty, recurse);
+ address, stream, recurse, options);
else
cp_print_value_fields (type, type, valaddr, embedded_offset,
- address, stream, format,
- recurse, pretty, NULL, 0);
+ address, stream, recurse, options, NULL, 0);
break;
case TYPE_CODE_ENUM:
- if (format)
+ if (options->format)
{
print_scalar_formatted (valaddr + embedded_offset, type,
- format, 0, stream);
+ options, 0, stream);
break;
}
len = TYPE_NFIELDS (type);
@@ -475,10 +465,10 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_FUNC:
- if (format)
+ if (options->format)
{
print_scalar_formatted (valaddr + embedded_offset, type,
- format, 0, stream);
+ options, 0, stream);
break;
}
/* FIXME, we should consider, at least for ANSI C language, eliminating
@@ -491,10 +481,14 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_BOOL:
- format = format ? format : output_format;
- if (format)
- print_scalar_formatted (valaddr + embedded_offset, type,
- format, 0, stream);
+ if (options->format || options->output_format)
+ {
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ &opts, 0, stream);
+ }
else
{
val = unpack_long (type, valaddr + embedded_offset);
@@ -511,7 +505,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
if (TYPE_LENGTH (type) == TYPE_LENGTH (TYPE_TARGET_TYPE (type)))
{
m2_val_print (TYPE_TARGET_TYPE (type), valaddr, embedded_offset,
- address, stream, format, deref_ref, recurse, pretty);
+ address, stream, recurse, options);
break;
}
/* FIXME: create_range_type does not set the unsigned bit in a
@@ -524,19 +518,27 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
/* FALLTHROUGH */
case TYPE_CODE_INT:
- format = format ? format : output_format;
- if (format)
- print_scalar_formatted (valaddr + embedded_offset, type, format,
- 0, stream);
+ if (options->format || options->output_format)
+ {
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ &opts, 0, stream);
+ }
else
val_print_type_code_int (type, valaddr + embedded_offset, stream);
break;
case TYPE_CODE_CHAR:
- format = format ? format : output_format;
- if (format)
- print_scalar_formatted (valaddr + embedded_offset, type,
- format, 0, stream);
+ if (options->format || options->output_format)
+ {
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ &opts, 0, stream);
+ }
else
{
val = unpack_long (type, valaddr + embedded_offset);
@@ -550,9 +552,9 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
break;
case TYPE_CODE_FLT:
- if (format)
+ if (options->format)
print_scalar_formatted (valaddr + embedded_offset, type,
- format, 0, stream);
+ options, 0, stream);
else
print_floating (valaddr + embedded_offset, type, stream);
break;
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 7bd6e69..1913333 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -59,18 +59,16 @@
MSYMBOL_IS_RTI Tests the "RTC" bit in a minimal symbol. */
#define MSYMBOL_SET_RTC(msym) \
- MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) \
- | 0x80000000)
+ MSYMBOL_TARGET_FLAG_1 (msym) = 1
#define MSYMBOL_SET_RTI(msym) \
- MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) \
- | 0x40000000)
+ MSYMBOL_TARGET_FLAG_2 (msym) = 1
#define MSYMBOL_IS_RTC(msym) \
- (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
+ MSYMBOL_TARGET_FLAG_1 (msym)
#define MSYMBOL_IS_RTI(msym) \
- (((long) MSYMBOL_INFO (msym) & 0x40000000) != 0)
+ MSYMBOL_TARGET_FLAG_2 (msym)
enum insn_return_kind {
RETURN_RTS,
diff --git a/gdb/maint.c b/gdb/maint.c
index e64d4fe..c46bdc0 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -35,6 +35,7 @@
#include "symfile.h"
#include "objfiles.h"
#include "value.h"
+#include "gdb_assert.h"
#include "cli/cli-decode.h"
@@ -414,11 +415,13 @@ maintenance_print_architecture (char *args, int from_tty)
gdbarch_dump (current_gdbarch, gdb_stdout);
else
{
+ struct cleanup *cleanups;
struct ui_file *file = gdb_fopen (args, "w");
if (file == NULL)
perror_with_name (_("maintenance print architecture"));
+ cleanups = make_cleanup_ui_file_delete (file);
gdbarch_dump (current_gdbarch, file);
- ui_file_delete (file);
+ do_cleanups (cleanups);
}
}
@@ -470,7 +473,7 @@ maintenance_translate_address (char *arg, int from_tty)
break;
}
- if (!sect)
+ if (!objfile)
error (_("Unknown section %s."), arg);
}
@@ -482,9 +485,32 @@ maintenance_translate_address (char *arg, int from_tty)
sym = lookup_minimal_symbol_by_pc (address);
if (sym)
- printf_filtered ("%s+%s\n",
- SYMBOL_PRINT_NAME (sym),
- pulongest (address - SYMBOL_VALUE_ADDRESS (sym)));
+ {
+ const char *symbol_name = SYMBOL_PRINT_NAME (sym);
+ const char *symbol_offset = pulongest (address - SYMBOL_VALUE_ADDRESS (sym));
+
+ sect = SYMBOL_OBJ_SECTION(sym);
+ if (sect != NULL)
+ {
+ const char *section_name;
+ const char *obj_name;
+
+ gdb_assert (sect->the_bfd_section && sect->the_bfd_section->name);
+ section_name = sect->the_bfd_section->name;
+
+ gdb_assert (sect->objfile && sect->objfile->name);
+ obj_name = sect->objfile->name;
+
+ if (MULTI_OBJFILE_P ())
+ printf_filtered (_("%s + %s in section %s of %s\n"),
+ symbol_name, symbol_offset, section_name, obj_name);
+ else
+ printf_filtered (_("%s + %s in section %s\n"),
+ symbol_name, symbol_offset, section_name);
+ }
+ else
+ printf_filtered (_("%s + %s\n"), symbol_name, symbol_offset);
+ }
else if (sect)
printf_filtered (_("no symbol at %s:0x%s\n"),
sect->the_bfd_section->name, paddr (address));
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index ede6fce..3fa06e5 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -1054,11 +1054,10 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
if (tsym.st != stMember)
break;
- FIELD_BITPOS (*f) = tsym.value;
+ SET_FIELD_BITPOS (*f, tsym.value);
FIELD_TYPE (*f) = t;
FIELD_NAME (*f) = debug_info->ss + cur_fdr->issBase + tsym.iss;
FIELD_BITSIZE (*f) = 0;
- FIELD_STATIC_KIND (*f) = 0;
enum_sym = ((struct symbol *)
obstack_alloc (&current_objfile->objfile_obstack,
@@ -1241,11 +1240,10 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
case stMember: /* member of struct or union */
f = &TYPE_FIELDS (top_stack->cur_type)[top_stack->cur_field++];
FIELD_NAME (*f) = name;
- FIELD_BITPOS (*f) = sh->value;
+ SET_FIELD_BITPOS (*f, sh->value);
bitsize = 0;
FIELD_TYPE (*f) = parse_type (cur_fd, ax, sh->index, &bitsize, bigend, name);
FIELD_BITSIZE (*f) = bitsize;
- FIELD_STATIC_KIND (*f) = 0;
break;
case stIndirect: /* forward declaration on Irix5 */
@@ -1777,12 +1775,9 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
ignore the erroneous bitsize from the auxiliary entry safely.
dbx seems to ignore it too. */
- /* TYPE_FLAG_TARGET_STUB now takes care of the zero TYPE_LENGTH
- problem. */
+ /* TYPE_TARGET_STUB now takes care of the zero TYPE_LENGTH problem. */
if (TYPE_LENGTH (*tpp) == 0)
- {
- TYPE_TARGET_STUB (t) = 1;
- }
+ TYPE_TARGET_STUB (t) = 1;
*tpp = t;
return 4 + off;
@@ -2211,7 +2206,7 @@ record_minimal_symbol (const char *name, const CORE_ADDR address,
bfd_section = NULL;
}
- prim_record_minimal_symbol_and_info (name, address, ms_type, NULL,
+ prim_record_minimal_symbol_and_info (name, address, ms_type,
section, bfd_section, objfile);
}
@@ -3340,7 +3335,7 @@ parse_partial_symbols (struct objfile *objfile)
case stStaticProc:
prim_record_minimal_symbol_and_info (name, sh.value,
- mst_file_text, NULL,
+ mst_file_text,
SECT_OFF_TEXT (objfile), NULL,
objfile);
@@ -3426,13 +3421,13 @@ parse_partial_symbols (struct objfile *objfile)
case stStatic: /* Variable */
if (SC_IS_DATA (sh.sc))
prim_record_minimal_symbol_and_info (name, sh.value,
- mst_file_data, NULL,
+ mst_file_data,
SECT_OFF_DATA (objfile),
NULL,
objfile);
else
prim_record_minimal_symbol_and_info (name, sh.value,
- mst_file_bss, NULL,
+ mst_file_bss,
SECT_OFF_BSS (objfile),
NULL,
objfile);
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index baf9b6d..33cc890 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -30,6 +30,7 @@
#include "dictionary.h"
#include "gdb_string.h"
#include "language.h"
+#include "valprint.h"
static void list_args_or_locals (int locals, int values, struct frame_info *fi);
@@ -280,21 +281,29 @@ list_args_or_locals (int locals, int values, struct frame_info *fi)
&& TYPE_CODE (type) != TYPE_CODE_STRUCT
&& TYPE_CODE (type) != TYPE_CODE_UNION)
{
+ struct value_print_options opts;
val = read_var_value (sym2, fi);
+ get_raw_print_options (&opts);
+ opts.deref_ref = 1;
common_val_print
- (val, stb->stream, 0, 1, 0, Val_no_prettyprint,
+ (val, stb->stream, 0, &opts,
language_def (SYMBOL_LANGUAGE (sym2)));
ui_out_field_stream (uiout, "value", stb);
}
do_cleanups (cleanup_tuple);
break;
case PRINT_ALL_VALUES:
- val = read_var_value (sym2, fi);
- common_val_print
- (val, stb->stream, 0, 1, 0, Val_no_prettyprint,
- language_def (SYMBOL_LANGUAGE (sym2)));
- ui_out_field_stream (uiout, "value", stb);
- do_cleanups (cleanup_tuple);
+ {
+ struct value_print_options opts;
+ val = read_var_value (sym2, fi);
+ get_raw_print_options (&opts);
+ opts.deref_ref = 1;
+ common_val_print
+ (val, stb->stream, 0, &opts,
+ language_def (SYMBOL_LANGUAGE (sym2)));
+ ui_out_field_stream (uiout, "value", stb);
+ do_cleanups (cleanup_tuple);
+ }
break;
}
}
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index ca0f428..51c720e 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -90,6 +90,7 @@ struct mi_cmd mi_cmds[] =
{ "interpreter-exec", { NULL, 0 }, mi_cmd_interpreter_exec},
{ "list-features", { NULL, 0 }, mi_cmd_list_features},
{ "list-target-features", { NULL, 0 }, mi_cmd_list_target_features},
+ { "list-thread-groups", { NULL, 0 }, mi_cmd_list_thread_groups },
{ "overlay-auto", { NULL, 0 }, NULL },
{ "overlay-list-mapping-state", { NULL, 0 }, NULL },
{ "overlay-list-overlays", { NULL, 0 }, NULL },
@@ -120,7 +121,7 @@ struct mi_cmd mi_cmds[] =
{ "symbol-type", { NULL, 0 }, NULL },
{ "target-attach", { "attach", 1 }, NULL },
{ "target-compare-sections", { NULL, 0 }, NULL },
- { "target-detach", { "detach", 0 }, 0 },
+ { "target-detach", { NULL, 0 }, mi_cmd_target_detach },
{ "target-disconnect", { "disconnect", 0 }, 0 },
{ "target-download", { "load", 1 }, NULL},
{ "target-exec-status", { NULL, 0 }, NULL },
diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h
index 16887ae..a399b9e 100644
--- a/gdb/mi/mi-cmds.h
+++ b/gdb/mi/mi-cmds.h
@@ -67,6 +67,7 @@ extern mi_cmd_argv_ftype mi_cmd_inferior_tty_show;
extern mi_cmd_argv_ftype mi_cmd_interpreter_exec;
extern mi_cmd_argv_ftype mi_cmd_list_features;
extern mi_cmd_argv_ftype mi_cmd_list_target_features;
+extern mi_cmd_argv_ftype mi_cmd_list_thread_groups;
extern mi_cmd_argv_ftype mi_cmd_stack_info_depth;
extern mi_cmd_argv_ftype mi_cmd_stack_info_frame;
extern mi_cmd_argv_ftype mi_cmd_stack_list_args;
@@ -74,6 +75,7 @@ extern mi_cmd_argv_ftype mi_cmd_stack_list_frames;
extern mi_cmd_argv_ftype mi_cmd_stack_list_locals;
extern mi_cmd_argv_ftype mi_cmd_stack_select_frame;
extern mi_cmd_argv_ftype mi_cmd_symbol_list_lines;
+extern mi_cmd_argv_ftype mi_cmd_target_detach;
extern mi_cmd_argv_ftype mi_cmd_target_file_get;
extern mi_cmd_argv_ftype mi_cmd_target_file_put;
extern mi_cmd_argv_ftype mi_cmd_target_file_delete;
diff --git a/gdb/mi/mi-common.h b/gdb/mi/mi-common.h
index e47afd1..8778e74 100644
--- a/gdb/mi/mi-common.h
+++ b/gdb/mi/mi-common.h
@@ -41,4 +41,19 @@ enum async_reply_reason
const char *async_reason_lookup (enum async_reply_reason reason);
+struct mi_interp
+{
+ /* MI's output channels */
+ struct ui_file *out;
+ struct ui_file *err;
+ struct ui_file *log;
+ struct ui_file *targ;
+ struct ui_file *event_channel;
+
+ /* This is the interpreter for the mi... */
+ struct interp *mi2_interp;
+ struct interp *mi1_interp;
+ struct interp *mi_interp;
+};
+
#endif
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 361cf7f..5aa0e6c 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -31,24 +31,10 @@
#include "mi-cmds.h"
#include "mi-out.h"
#include "mi-console.h"
+#include "mi-common.h"
#include "observer.h"
#include "gdbthread.h"
-struct mi_interp
-{
- /* MI's output channels */
- struct ui_file *out;
- struct ui_file *err;
- struct ui_file *log;
- struct ui_file *targ;
- struct ui_file *event_channel;
-
- /* This is the interpreter for the mi... */
- struct interp *mi2_interp;
- struct interp *mi1_interp;
- struct interp *mi_interp;
-};
-
/* These are the interpreter setup, etc. functions for the MI interpreter */
static void mi_execute_command_wrapper (char *cmd);
static void mi_command_loop (int mi_version);
@@ -69,6 +55,8 @@ static void mi_on_normal_stop (struct bpstats *bs);
static void mi_new_thread (struct thread_info *t);
static void mi_thread_exit (struct thread_info *t);
+static void mi_new_inferior (int pid);
+static void mi_inferior_exit (int pid);
static void mi_on_resume (ptid_t ptid);
static void *
@@ -94,6 +82,8 @@ mi_interpreter_init (int top_level)
{
observer_attach_new_thread (mi_new_thread);
observer_attach_thread_exit (mi_thread_exit);
+ observer_attach_new_inferior (mi_new_inferior);
+ observer_attach_inferior_exit (mi_inferior_exit);
observer_attach_normal_stop (mi_on_normal_stop);
observer_attach_target_resumed (mi_on_resume);
}
@@ -289,7 +279,9 @@ mi_new_thread (struct thread_info *t)
{
struct mi_interp *mi = top_level_interpreter_data ();
- fprintf_unfiltered (mi->event_channel, "thread-created,id=\"%d\"", t->num);
+ fprintf_unfiltered (mi->event_channel,
+ "thread-created,id=\"%d\",group-id=\"%d\"",
+ t->num, t->ptid.pid);
gdb_flush (mi->event_channel);
}
@@ -298,11 +290,33 @@ mi_thread_exit (struct thread_info *t)
{
struct mi_interp *mi = top_level_interpreter_data ();
target_terminal_ours ();
- fprintf_unfiltered (mi->event_channel, "thread-exited,id=\"%d\"", t->num);
+ fprintf_unfiltered (mi->event_channel,
+ "thread-exited,id=\"%d\",group-id=\"%d\"",
+ t->num,t->ptid.pid);
+ gdb_flush (mi->event_channel);
+}
+
+static void
+mi_new_inferior (int pid)
+{
+ struct mi_interp *mi = top_level_interpreter_data ();
+ target_terminal_ours ();
+ fprintf_unfiltered (mi->event_channel, "thread-group-created,id=\"%d\"",
+ pid);
gdb_flush (mi->event_channel);
}
static void
+mi_inferior_exit (int pid)
+{
+ struct mi_interp *mi = top_level_interpreter_data ();
+ target_terminal_ours ();
+ fprintf_unfiltered (mi->event_channel, "thread-group-exited,id=\"%d\"",
+ pid);
+ gdb_flush (mi->event_channel);
+}
+
+static void
mi_on_normal_stop (struct bpstats *bs)
{
/* Since this can be called when CLI command is executing,
@@ -362,6 +376,7 @@ mi_on_resume (ptid_t ptid)
if (!target_is_async_p ())
fputs_unfiltered ("(gdb) \n", raw_stdout);
}
+ gdb_flush (raw_stdout);
}
extern initialize_file_ftype _initialize_mi_interp; /* -Wmissing-prototypes */
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 7780207..7f5ec2f 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -44,7 +44,10 @@
#include "gdb.h"
#include "frame.h"
#include "mi-main.h"
+#include "mi-common.h"
#include "language.h"
+#include "valprint.h"
+#include "inferior.h"
#include <ctype.h>
#include <sys/time.h>
@@ -160,6 +163,23 @@ mi_cmd_exec_return (char *command, char **argv, int argc)
print_stack_frame (get_selected_frame (NULL), 1, LOC_AND_ADDRESS);
}
+static int
+proceed_thread_callback (struct thread_info *thread, void *arg)
+{
+ int pid = *(int *)arg;
+
+ if (!is_stopped (thread->ptid))
+ return 0;
+
+ if (PIDGET (thread->ptid) != pid)
+ return 0;
+
+ switch_to_thread (thread->ptid);
+ clear_proceed_status ();
+ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
+ return 0;
+}
+
void
mi_cmd_exec_continue (char *command, char **argv, int argc)
{
@@ -167,8 +187,37 @@ mi_cmd_exec_continue (char *command, char **argv, int argc)
continue_1 (0);
else if (argc == 1 && strcmp (argv[0], "--all") == 0)
continue_1 (1);
+ else if (argc == 2 && strcmp (argv[0], "--thread-group") == 0)
+ {
+ struct cleanup *old_chain;
+ int pid;
+ if (argv[1] == NULL || argv[1] == '\0')
+ error ("Thread group id not specified");
+ pid = atoi (argv[1] + 1);
+ if (!in_inferior_list (pid))
+ error ("Invalid thread group id '%s'", argv[1]);
+
+ old_chain = make_cleanup_restore_current_thread ();
+ iterate_over_threads (proceed_thread_callback, &pid);
+ do_cleanups (old_chain);
+ }
else
- error ("Usage: -exec-continue [--all]");
+ error ("Usage: -exec-continue [--all|--thread-group id]");
+}
+
+static int
+interrupt_thread_callback (struct thread_info *thread, void *arg)
+{
+ int pid = *(int *)arg;
+
+ if (!is_running (thread->ptid))
+ return 0;
+
+ if (PIDGET (thread->ptid) != pid)
+ return 0;
+
+ target_stop (thread->ptid);
+ return 0;
}
/* Interrupt the execution of the target. Note how we must play around
@@ -190,11 +239,61 @@ mi_cmd_exec_interrupt (char *command, char **argv, int argc)
{
if (!any_running ())
error ("Inferior not running.");
-
+
interrupt_target_1 (1);
}
+ else if (argc == 2 && strcmp (argv[0], "--thread-group") == 0)
+ {
+ struct cleanup *old_chain;
+ int pid;
+ if (argv[1] == NULL || argv[1] == '\0')
+ error ("Thread group id not specified");
+ pid = atoi (argv[1] + 1);
+ if (!in_inferior_list (pid))
+ error ("Invalid thread group id '%s'", argv[1]);
+
+ old_chain = make_cleanup_restore_current_thread ();
+ iterate_over_threads (interrupt_thread_callback, &pid);
+ do_cleanups (old_chain);
+ }
else
- error ("Usage: -exec-interrupt [--all]");
+ error ("Usage: -exec-interrupt [--all|--thread-group id]");
+}
+
+static int
+find_thread_of_process (struct thread_info *ti, void *p)
+{
+ int pid = *(int *)p;
+ if (PIDGET (ti->ptid) == pid && !is_exited (ti->ptid))
+ return 1;
+
+ return 0;
+}
+
+void
+mi_cmd_target_detach (char *command, char **argv, int argc)
+{
+ if (argc != 0 && argc != 1)
+ error ("Usage: -target-detach [thread-group]");
+
+ if (argc == 1)
+ {
+ struct thread_info *tp;
+ char *end = argv[0];
+ int pid = strtol (argv[0], &end, 10);
+ if (*end != '\0')
+ error (_("Cannot parse thread group id '%s'"), argv[0]);
+
+ /* Pick any thread in the desired process. Current
+ target_detach deteches from the parent of inferior_ptid. */
+ tp = iterate_over_threads (find_thread_of_process, &pid);
+ if (!tp)
+ error (_("Thread group is empty"));
+
+ switch_to_thread (tp->ptid);
+ }
+
+ detach_command (NULL, 0);
}
void
@@ -244,7 +343,55 @@ mi_cmd_thread_info (char *command, char **argv, int argc)
if (argc == 1)
thread = atoi (argv[0]);
- print_thread_info (uiout, thread);
+ print_thread_info (uiout, thread, -1);
+}
+
+static int
+print_one_inferior (struct inferior *inferior, void *arg)
+{
+ struct cleanup *back_to = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+
+ ui_out_field_fmt (uiout, "id", "%d", inferior->pid);
+ ui_out_field_string (uiout, "type", "process");
+ ui_out_field_int (uiout, "pid", inferior->pid);
+
+ do_cleanups (back_to);
+ return 0;
+}
+
+void
+mi_cmd_list_thread_groups (char *command, char **argv, int argc)
+{
+ struct cleanup *back_to;
+ int available = 0;
+ char *id = NULL;
+
+ if (argc > 0 && strcmp (argv[0], "--available") == 0)
+ {
+ ++argv;
+ --argc;
+ available = 1;
+ }
+
+ if (argc > 0)
+ id = argv[0];
+
+ back_to = make_cleanup (&null_cleanup, NULL);
+
+ if (id)
+ {
+ int pid = atoi (id);
+ if (!in_inferior_list (pid))
+ error ("Invalid thread group id '%s'", id);
+ print_thread_info (uiout, -1, pid);
+ }
+ else
+ {
+ make_cleanup_ui_out_list_begin_end (uiout, "groups");
+ iterate_over_inferiors (print_one_inferior, NULL);
+ }
+
+ do_cleanups (back_to);
}
void
@@ -499,9 +646,11 @@ get_register (int regnum, int format)
}
else
{
+ struct value_print_options opts;
+ get_formatted_print_options (&opts, format);
+ opts.deref_ref = 1;
val_print (register_type (current_gdbarch, regnum), buffer, 0, 0,
- stb->stream, format, 1, 0, Val_pretty_default,
- current_language);
+ stb->stream, 0, &opts, current_language);
ui_out_field_stream (uiout, "value", stb);
ui_out_stream_delete (stb);
}
@@ -570,6 +719,7 @@ mi_cmd_data_evaluate_expression (char *command, char **argv, int argc)
struct cleanup *old_chain = NULL;
struct value *val;
struct ui_stream *stb = NULL;
+ struct value_print_options opts;
stb = ui_out_stream_new (uiout);
@@ -586,9 +736,11 @@ mi_cmd_data_evaluate_expression (char *command, char **argv, int argc)
val = evaluate_expression (expr);
/* Print the result of the expression evaluation. */
+ get_user_print_options (&opts);
+ opts.deref_ref = 0;
val_print (value_type (val), value_contents (val),
value_embedded_offset (val), VALUE_ADDRESS (val),
- stb->stream, 0, 0, 0, 0, current_language);
+ stb->stream, 0, &opts, current_language);
ui_out_field_stream (uiout, "value", stb);
ui_out_stream_delete (stb);
@@ -743,10 +895,13 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
int col_byte;
struct cleanup *cleanup_tuple;
struct cleanup *cleanup_list_data;
+ struct value_print_options opts;
+
cleanup_tuple = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
ui_out_field_core_addr (uiout, "addr", addr + row_byte);
/* ui_out_field_core_addr_symbolic (uiout, "saddr", addr + row_byte); */
cleanup_list_data = make_cleanup_ui_out_list_begin_end (uiout, "data");
+ get_formatted_print_options (&opts, word_format);
for (col = 0, col_byte = row_byte;
col < nr_cols;
col++, col_byte += word_size)
@@ -758,7 +913,7 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
else
{
ui_file_rewind (stream->stream);
- print_scalar_formatted (mbuf + col_byte, word_type, word_format,
+ print_scalar_formatted (mbuf + col_byte, word_type, &opts,
word_asize, stream->stream);
ui_out_field_stream (uiout, NULL, stream);
}
@@ -1049,6 +1204,7 @@ mi_execute_command (char *cmd, int from_tty)
if (command != NULL)
{
struct gdb_exception result;
+ ptid_t previous_ptid = inferior_ptid;
if (do_timings)
{
@@ -1073,6 +1229,41 @@ mi_execute_command (char *cmd, int from_tty)
mi_out_rewind (uiout);
}
+ if (/* The notifications are only output when the top-level
+ interpreter (specified on the command line) is MI. */
+ ui_out_is_mi_like_p (interp_ui_out (top_level_interpreter ()))
+ /* Don't try report anything if there are no threads --
+ the program is dead. */
+ && thread_count () != 0
+ /* -thread-select explicitly changes thread. If frontend uses that
+ internally, we don't want to emit =thread-selected, since
+ =thread-selected is supposed to indicate user's intentions. */
+ && strcmp (command->command, "thread-select") != 0)
+ {
+ struct mi_interp *mi = top_level_interpreter_data ();
+ struct thread_info *ti = inferior_thread ();
+ int report_change;
+
+ if (command->thread == -1)
+ {
+ report_change = !ptid_equal (previous_ptid, null_ptid)
+ && !ptid_equal (inferior_ptid, previous_ptid);
+ }
+ else
+ {
+ report_change = (ti->num != command->thread);
+ }
+
+ if (report_change)
+ {
+ target_terminal_ours ();
+ fprintf_unfiltered (mi->event_channel,
+ "thread-selected,id=\"%d\"",
+ ti->num);
+ gdb_flush (mi->event_channel);
+ }
+ }
+
mi_parse_free (command);
}
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 4069e6f..f020cb5 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -531,7 +531,7 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc,
triggered by a special mst_abs_or_lib or some
such. */
- if (msymbol[hi].type == mst_abs)
+ if (MSYMBOL_TYPE (&msymbol[hi]) == mst_abs)
{
hi--;
continue;
@@ -725,7 +725,7 @@ prim_record_minimal_symbol (const char *name, CORE_ADDR address,
}
prim_record_minimal_symbol_and_info (name, address, ms_type,
- NULL, section, NULL, objfile);
+ section, NULL, objfile);
}
/* Record a minimal symbol in the msym bunches. Returns the symbol
@@ -734,7 +734,7 @@ prim_record_minimal_symbol (const char *name, CORE_ADDR address,
struct minimal_symbol *
prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address,
enum minimal_symbol_type ms_type,
- char *info, int section,
+ int section,
asection *bfd_section,
struct objfile *objfile)
{
@@ -788,8 +788,8 @@ prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address,
}
MSYMBOL_TYPE (msymbol) = ms_type;
- /* FIXME: This info, if it remains, needs its own field. */
- MSYMBOL_INFO (msymbol) = info; /* FIXME! */
+ MSYMBOL_TARGET_FLAG_1 (msymbol) = 0;
+ MSYMBOL_TARGET_FLAG_2 (msymbol) = 0;
MSYMBOL_SIZE (msymbol) = 0;
/* The hash pointers must be cleared! If they're not,
@@ -1061,7 +1061,8 @@ install_minimal_symbols (struct objfile *objfile)
SYMBOL_LINKAGE_NAME (&msymbols[mcount]) = NULL;
SYMBOL_VALUE_ADDRESS (&msymbols[mcount]) = 0;
- MSYMBOL_INFO (&msymbols[mcount]) = NULL;
+ MSYMBOL_TARGET_FLAG_1 (&msymbols[mcount]) = 0;
+ MSYMBOL_TARGET_FLAG_2 (&msymbols[mcount]) = 0;
MSYMBOL_SIZE (&msymbols[mcount]) = 0;
MSYMBOL_TYPE (&msymbols[mcount]) = mst_unknown;
SYMBOL_INIT_LANGUAGE_SPECIFIC (&msymbols[mcount], language_unknown);
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 78f33a6..eb23228 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -37,6 +37,7 @@
#include "symtab.h"
#include "target-descriptions.h"
#include "mips-linux-tdep.h"
+#include "glibc-tdep.h"
static struct target_so_ops mips_svr4_so_ops;
@@ -666,13 +667,13 @@ mips_linux_in_dynsym_stub (CORE_ADDR pc, char *name)
}
/* Return non-zero iff PC belongs to the dynamic linker resolution
- code or to a stub. */
+ code, a PLT entry, or a lazy binding stub. */
static int
mips_linux_in_dynsym_resolve_code (CORE_ADDR pc)
{
/* Check whether PC is in the dynamic linker. This also checks
- whether it is in the .plt section, which MIPS does not use. */
+ whether it is in the .plt section, used by non-PIC executables. */
if (svr4_in_dynsym_resolve_code (pc))
return 1;
@@ -688,8 +689,8 @@ mips_linux_in_dynsym_resolve_code (CORE_ADDR pc)
and glibc_skip_solib_resolver in glibc-tdep.c. The normal glibc
implementation of this triggers at "fixup" from the same objfile as
"_dl_runtime_resolve"; MIPS GNU/Linux can trigger at
- "__dl_runtime_resolve" directly. An unresolved PLT entry will
- point to _dl_runtime_resolve, which will first call
+ "__dl_runtime_resolve" directly. An unresolved lazy binding
+ stub will point to _dl_runtime_resolve, which will first call
__dl_runtime_resolve, and then pass control to the resolved
function. */
@@ -703,7 +704,7 @@ mips_linux_skip_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
if (resolver && SYMBOL_VALUE_ADDRESS (resolver) == pc)
return frame_pc_unwind (get_current_frame ());
- return 0;
+ return glibc_skip_solib_resolver (gdbarch, pc);
}
/* Signal trampoline support. There are four supported layouts for a
@@ -1171,7 +1172,6 @@ mips_linux_init_abi (struct gdbarch_info info,
break;
}
- set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
set_gdbarch_skip_solib_resolver (gdbarch, mips_linux_skip_resolver);
set_gdbarch_software_single_step (gdbarch, mips_software_single_step);
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 2556e0e..0774266 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -57,6 +57,7 @@
#include "target-descriptions.h"
#include "dwarf2-frame.h"
#include "user-regs.h"
+#include "valprint.h"
static const struct objfile_data *mips_pdr_data;
@@ -253,8 +254,7 @@ mips_elf_make_msymbol_special (asymbol * sym, struct minimal_symbol *msym)
{
if (((elf_symbol_type *) (sym))->internal_elf_sym.st_other == STO_MIPS16)
{
- MSYMBOL_INFO (msym) = (char *)
- (((long) MSYMBOL_INFO (msym)) | 0x80000000);
+ MSYMBOL_TARGET_FLAG_1 (msym) = 1;
SYMBOL_VALUE_ADDRESS (msym) |= 1;
}
}
@@ -262,7 +262,7 @@ mips_elf_make_msymbol_special (asymbol * sym, struct minimal_symbol *msym)
static int
msymbol_is_special (struct minimal_symbol *msym)
{
- return (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0);
+ return MSYMBOL_TARGET_FLAG_1 (msym);
}
/* XFER a value from the big/little/left end of the register.
@@ -1898,6 +1898,7 @@ mips32_scan_prologue (CORE_ADDR start_pc, CORE_ADDR limit_pc,
CORE_ADDR end_prologue_addr = 0;
int seen_sp_adjust = 0;
int load_immediate_bytes = 0;
+ int in_delay_slot = 0;
struct gdbarch *gdbarch = get_frame_arch (this_frame);
int regsize_is_64_bits = (mips_abi_regsize (gdbarch) == 8);
@@ -2055,7 +2056,18 @@ restart:
instructions? */
if (end_prologue_addr == 0)
end_prologue_addr = cur_pc;
+
+ /* Check for branches and jumps. For now, only jump to
+ register are caught (i.e. returns). */
+ if ((itype_op (inst) & 0x07) == 0 && rtype_funct (inst) == 8)
+ in_delay_slot = 1;
}
+
+ /* If the previous instruction was a jump, we must have reached
+ the end of the prologue by now. Stop scanning so that we do
+ not go past the function return. */
+ if (in_delay_slot)
+ break;
}
if (this_cache != NULL)
@@ -2257,6 +2269,7 @@ mips_stub_frame_sniffer (const struct frame_unwind *self,
gdb_byte dummy[4];
struct obj_section *s;
CORE_ADDR pc = get_frame_address_in_block (this_frame);
+ struct minimal_symbol *msym;
/* Use the stub unwinder for unreadable code. */
if (target_read_memory (get_frame_pc (this_frame), dummy, 4) != 0)
@@ -2273,6 +2286,14 @@ mips_stub_frame_sniffer (const struct frame_unwind *self,
".MIPS.stubs") == 0)
return 1;
+ /* Calling a PIC function from a non-PIC function passes through a
+ stub. The stub for foo is named ".pic.foo". */
+ msym = lookup_minimal_symbol_by_pc (pc);
+ if (msym != NULL
+ && SYMBOL_LINKAGE_NAME (msym) != NULL
+ && strncmp (SYMBOL_LINKAGE_NAME (msym), ".pic.", 5) == 0)
+ return 1;
+
return 0;
}
@@ -3014,7 +3035,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type,
struct type *field_type;
/* We're only looking at normal fields. */
- if (TYPE_FIELD_STATIC (arg_type, i)
+ if (field_is_static (&TYPE_FIELD (arg_type, i))
|| (TYPE_FIELD_BITPOS (arg_type, i) % 8) != 0)
continue;
@@ -4358,12 +4379,15 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
if (register_size (gdbarch, regnum) == 4 || mips2_fp_compat (frame))
{
+ struct value_print_options opts;
+
/* 4-byte registers: Print hex and floating. Also print even
numbered registers as doubles. */
mips_read_fp_register_single (frame, regnum, raw_buffer);
flt1 = unpack_double (mips_float_register_type (), raw_buffer, &inv1);
- print_scalar_formatted (raw_buffer, builtin_type_uint32, 'x', 'w',
+ get_formatted_print_options (&opts, 'x');
+ print_scalar_formatted (raw_buffer, builtin_type_uint32, &opts, 'w',
file);
fprintf_filtered (file, " flt: ");
@@ -4387,6 +4411,8 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
}
else
{
+ struct value_print_options opts;
+
/* Eight byte registers: print each one as hex, float and double. */
mips_read_fp_register_single (frame, regnum, raw_buffer);
flt1 = unpack_double (mips_float_register_type (), raw_buffer, &inv1);
@@ -4394,8 +4420,8 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame,
mips_read_fp_register_double (frame, regnum, raw_buffer);
doub = unpack_double (mips_double_register_type (), raw_buffer, &inv2);
-
- print_scalar_formatted (raw_buffer, builtin_type_uint64, 'x', 'g',
+ get_formatted_print_options (&opts, 'x');
+ print_scalar_formatted (raw_buffer, builtin_type_uint64, &opts, 'g',
file);
fprintf_filtered (file, " flt: ");
@@ -4419,6 +4445,7 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
struct gdbarch *gdbarch = get_frame_arch (frame);
gdb_byte raw_buffer[MAX_REGISTER_SIZE];
int offset;
+ struct value_print_options opts;
if (TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
{
@@ -4451,8 +4478,9 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
else
offset = 0;
+ get_formatted_print_options (&opts, 'x');
print_scalar_formatted (raw_buffer + offset,
- register_type (gdbarch, regnum), 'x', 0,
+ register_type (gdbarch, regnum), &opts, 0,
file);
}
@@ -5046,7 +5074,7 @@ mips_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
gory details. */
static CORE_ADDR
-mips_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
+mips_skip_mips16_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
{
char *name;
CORE_ADDR start_addr;
@@ -5125,6 +5153,80 @@ mips_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
return 0; /* not a stub */
}
+/* If the current PC is the start of a non-PIC-to-PIC stub, return the
+ PC of the stub target. The stub just loads $t9 and jumps to it,
+ so that $t9 has the correct value at function entry. */
+
+static CORE_ADDR
+mips_skip_pic_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
+{
+ struct minimal_symbol *msym;
+ int i;
+ gdb_byte stub_code[16];
+ int32_t stub_words[4];
+
+ /* The stub for foo is named ".pic.foo", and is either two
+ instructions inserted before foo or a three instruction sequence
+ which jumps to foo. */
+ msym = lookup_minimal_symbol_by_pc (pc);
+ if (msym == NULL
+ || SYMBOL_VALUE_ADDRESS (msym) != pc
+ || SYMBOL_LINKAGE_NAME (msym) == NULL
+ || strncmp (SYMBOL_LINKAGE_NAME (msym), ".pic.", 5) != 0)
+ return 0;
+
+ /* A two-instruction header. */
+ if (MSYMBOL_SIZE (msym) == 8)
+ return pc + 8;
+
+ /* A three-instruction (plus delay slot) trampoline. */
+ if (MSYMBOL_SIZE (msym) == 16)
+ {
+ if (target_read_memory (pc, stub_code, 16) != 0)
+ return 0;
+ for (i = 0; i < 4; i++)
+ stub_words[i] = extract_unsigned_integer (stub_code + i * 4, 4);
+
+ /* A stub contains these instructions:
+ lui t9, %hi(target)
+ j target
+ addiu t9, t9, %lo(target)
+ nop
+
+ This works even for N64, since stubs are only generated with
+ -msym32. */
+ if ((stub_words[0] & 0xffff0000U) == 0x3c190000
+ && (stub_words[1] & 0xfc000000U) == 0x08000000
+ && (stub_words[2] & 0xffff0000U) == 0x27390000
+ && stub_words[3] == 0x00000000)
+ return (((stub_words[0] & 0x0000ffff) << 16)
+ + (stub_words[2] & 0x0000ffff));
+ }
+
+ /* Not a recognized stub. */
+ return 0;
+}
+
+static CORE_ADDR
+mips_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
+{
+ CORE_ADDR target_pc;
+
+ target_pc = mips_skip_mips16_trampoline_code (frame, pc);
+ if (target_pc)
+ return target_pc;
+
+ target_pc = find_solib_trampoline_target (frame, pc);
+ if (target_pc)
+ return target_pc;
+
+ target_pc = mips_skip_pic_trampoline_code (frame, pc);
+ if (target_pc)
+ return target_pc;
+
+ return 0;
+}
+
/* Convert a dbx stab register number (from `r' declaration) to a GDB
[1 * gdbarch_num_regs .. 2 * gdbarch_num_regs) REGNUM. */
diff --git a/gdb/monitor.c b/gdb/monitor.c
index c5b0ec6..4fff107 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -853,7 +853,7 @@ monitor_close (int quitting)
when you want to detach and do something else with your gdb. */
static void
-monitor_detach (char *args, int from_tty)
+monitor_detach (struct target_ops *ops, char *args, int from_tty)
{
pop_target (); /* calls monitor_close to do the real work */
if (from_tty)
@@ -1995,8 +1995,8 @@ monitor_kill (void)
/* All we actually do is set the PC to the start address of exec_bfd. */
static void
-monitor_create_inferior (char *exec_file, char *args, char **env,
- int from_tty)
+monitor_create_inferior (struct target_ops *ops, char *exec_file,
+ char *args, char **env, int from_tty)
{
if (args && (*args != '\000'))
error (_("Args are not supported by the monitor."));
@@ -2012,7 +2012,7 @@ monitor_create_inferior (char *exec_file, char *args, char **env,
instructions. */
static void
-monitor_mourn_inferior (void)
+monitor_mourn_inferior (struct target_ops *ops)
{
unpush_target (targ_ops);
generic_mourn_inferior (); /* Do all the proper things now */
@@ -2026,7 +2026,6 @@ monitor_insert_breakpoint (struct bp_target_info *bp_tgt)
{
CORE_ADDR addr = bp_tgt->placed_address;
int i;
- const unsigned char *bp;
int bplen;
monitor_debug ("MON inst bkpt %s\n", paddr (addr));
@@ -2037,7 +2036,7 @@ monitor_insert_breakpoint (struct bp_target_info *bp_tgt)
addr = gdbarch_addr_bits_remove (current_gdbarch, addr);
/* Determine appropriate breakpoint size for this address. */
- bp = gdbarch_breakpoint_from_pc (current_gdbarch, &addr, &bplen);
+ gdbarch_breakpoint_from_pc (current_gdbarch, &addr, &bplen);
bp_tgt->placed_address = addr;
bp_tgt->placed_size = bplen;
diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c
index da4afe3..db42e90 100644
--- a/gdb/mt-tdep.c
+++ b/gdb/mt-tdep.c
@@ -37,6 +37,7 @@
#include "infcall.h"
#include "gdb_assert.h"
#include "language.h"
+#include "valprint.h"
enum mt_arch_constants
{
@@ -675,6 +676,7 @@ mt_registers_info (struct gdbarch *gdbarch,
{
/* Special output handling for the 'coprocessor' register. */
gdb_byte *buf;
+ struct value_print_options opts;
buf = alloca (register_size (gdbarch, MT_COPRO_REGNUM));
frame_register_read (frame, MT_COPRO_REGNUM, buf);
@@ -685,8 +687,10 @@ mt_registers_info (struct gdbarch *gdbarch,
print_spaces_filtered (15 - strlen (gdbarch_register_name
(gdbarch, regnum)),
file);
+ get_raw_print_options (&opts);
+ opts.deref_ref = 1;
val_print (register_type (gdbarch, regnum), buf,
- 0, 0, file, 0, 1, 0, Val_no_prettyprint,
+ 0, 0, file, 0, &opts,
current_language);
fputs_filtered ("\n", file);
}
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index 6714239..9bcd2f8 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -125,6 +125,7 @@ procfs_open (char *arg, int from_tty)
char buffer[50];
int fd, total_size;
procfs_sysinfo *sysinfo;
+ struct cleanup *cleanups;
nto_is_nto_target = procfs_is_nto_target;
@@ -169,13 +170,13 @@ procfs_open (char *arg, int from_tty)
safe_strerror (errno));
error (_("Invalid procfs arg"));
}
+ cleanups = make_cleanup_close (fd);
sysinfo = (void *) buffer;
if (devctl (fd, DCMD_PROC_SYSINFO, sysinfo, sizeof buffer, 0) != EOK)
{
printf_filtered ("Error getting size: %d (%s)\n", errno,
safe_strerror (errno));
- close (fd);
error (_("Devctl failed."));
}
else
@@ -186,7 +187,6 @@ procfs_open (char *arg, int from_tty)
{
printf_filtered ("Memory error: %d (%s)\n", errno,
safe_strerror (errno));
- close (fd);
error (_("alloca failed."));
}
else
@@ -195,7 +195,6 @@ procfs_open (char *arg, int from_tty)
{
printf_filtered ("Error getting sysinfo: %d (%s)\n", errno,
safe_strerror (errno));
- close (fd);
error (_("Devctl failed."));
}
else
@@ -203,14 +202,11 @@ procfs_open (char *arg, int from_tty)
if (sysinfo->type !=
nto_map_arch_to_cputype (gdbarch_bfd_arch_info
(current_gdbarch)->arch_name))
- {
- close (fd);
- error (_("Invalid target CPU."));
- }
+ error (_("Invalid target CPU."));
}
}
}
- close (fd);
+ do_cleanups (cleanups);
printf_filtered ("Debugging using %s\n", nto_procfs_path);
}
@@ -259,12 +255,17 @@ procfs_find_new_threads (void)
return;
}
+static void
+do_closedir_cleanup (void *dir)
+{
+ closedir (dir);
+}
+
void
procfs_pidlist (char *args, int from_tty)
{
DIR *dp = NULL;
struct dirent *dirp = NULL;
- int fd = -1;
char buf[512];
procfs_info *pidinfo = NULL;
procfs_debuginfo *info = NULL;
@@ -272,6 +273,7 @@ procfs_pidlist (char *args, int from_tty)
pid_t num_threads = 0;
pid_t pid;
char name[512];
+ struct cleanup *cleanups;
dp = opendir (nto_procfs_path);
if (dp == NULL)
@@ -281,18 +283,23 @@ procfs_pidlist (char *args, int from_tty)
return;
}
+ cleanups = make_cleanup (do_closedir_cleanup, dp);
+
/* Start scan at first pid. */
rewinddir (dp);
do
{
+ int fd;
+ struct cleanup *inner_cleanup;
+
/* Get the right pid and procfs path for the pid. */
do
{
dirp = readdir (dp);
if (dirp == NULL)
{
- closedir (dp);
+ do_cleanups (cleanups);
return;
}
snprintf (buf, 511, "%s/%s/as", nto_procfs_path, dirp->d_name);
@@ -306,9 +313,10 @@ procfs_pidlist (char *args, int from_tty)
{
fprintf_unfiltered (gdb_stderr, "failed to open %s - %d (%s)\n",
buf, errno, safe_strerror (errno));
- closedir (dp);
+ do_cleanups (cleanups);
return;
}
+ inner_cleanup = make_cleanup_close (fd);
pidinfo = (procfs_info *) buf;
if (devctl (fd, DCMD_PROC_INFO, pidinfo, sizeof (buf), 0) != EOK)
@@ -336,12 +344,12 @@ procfs_pidlist (char *args, int from_tty)
if (status->tid != 0)
printf_filtered ("%s - %d/%d\n", name, pid, status->tid);
}
- close (fd);
+
+ do_cleanups (inner_cleanup);
}
while (dirp != NULL);
- close (fd);
- closedir (dp);
+ do_cleanups (cleanups);
return;
}
@@ -497,7 +505,7 @@ procfs_files_info (struct target_ops *ignore)
struct inferior *inf = current_inferior ();
printf_unfiltered ("\tUsing the running image of %s %s via %s.\n",
- pi->attach_flag ? "attached" : "child",
+ inf->attach_flag ? "attached" : "child",
target_pid_to_str (inferior_ptid), nto_procfs_path);
}
@@ -510,7 +518,7 @@ procfs_can_run (void)
/* Attach to process PID, then initialize for debugging it. */
static void
-procfs_attach (char *args, int from_tty)
+procfs_attach (struct target_ops *ops, char *args, int from_tty)
{
char *exec_file;
int pid;
@@ -580,7 +588,7 @@ do_attach (ptid_t ptid)
&& status.flags & _DEBUG_FLAG_STOPPED)
SignalKill (nto_node (), PIDGET (ptid), 0, SIGCONT, 0, 0);
nto_init_solib_absolute_prefix ();
- return ptid;
+ return ptid_build (PIDGET (ptid), 0, status.tid);
}
/* Ask the user what to do when an interrupt is received. */
@@ -773,7 +781,7 @@ procfs_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int dowrite,
on signals, etc. We'd better not have left any breakpoints
in the program or it'll die when it hits one. */
static void
-procfs_detach (char *args, int from_tty)
+procfs_detach (struct target_ops *ops, char *args, int from_tty)
{
int siggnal = 0;
int pid;
@@ -906,7 +914,7 @@ procfs_resume (ptid_t ptid, int step, enum target_signal signo)
}
static void
-procfs_mourn_inferior (void)
+procfs_mourn_inferior (struct target_ops *ops)
{
if (!ptid_equal (inferior_ptid, null_ptid))
{
@@ -980,8 +988,8 @@ breakup_args (char *scratch, char **argv)
}
static void
-procfs_create_inferior (char *exec_file, char *allargs, char **env,
- int from_tty)
+procfs_create_inferior (struct target_ops *ops, char *exec_file,
+ char *allargs, char **env, int from_tty)
{
struct inheritance inherit;
pid_t pid;
@@ -991,6 +999,7 @@ procfs_create_inferior (char *exec_file, char *allargs, char **env,
int fd, fds[3];
sigset_t set;
const char *inferior_io_terminal = get_inferior_io_terminal ();
+ struct inferior *inf;
argv = xmalloc (((strlen (allargs) + 1) / (unsigned) 2 + 2) *
sizeof (*argv));
@@ -1084,9 +1093,10 @@ procfs_create_inferior (char *exec_file, char *allargs, char **env,
close (fds[2]);
inferior_ptid = do_attach (pid_to_ptid (pid));
+ procfs_find_new_threads ();
- add_inferior (pid);
- attach_flag = 0;
+ inf = add_inferior (pid);
+ inf->attach_flag = 0;
flags = _DEBUG_FLAG_KLC; /* Kill-on-Last-Close flag. */
errn = devctl (ctl_fd, DCMD_PROC_SET_FLAG, &flags, sizeof (flags), 0);
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 553080a..3a952f5 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -341,7 +341,8 @@ objc_printchar (int c, struct ui_file *stream)
static void
objc_printstr (struct ui_file *stream, const gdb_byte *string,
- unsigned int length, int width, int force_ellipses)
+ unsigned int length, int width, int force_ellipses,
+ const struct value_print_options *options)
{
unsigned int i;
unsigned int things_printed = 0;
@@ -360,7 +361,7 @@ objc_printstr (struct ui_file *stream, const gdb_byte *string,
return;
}
- for (i = 0; i < length && things_printed < print_max; ++i)
+ for (i = 0; i < length && things_printed < options->print_max; ++i)
{
/* Position of the character we are examining to see whether it
is repeated. */
@@ -384,11 +385,11 @@ objc_printstr (struct ui_file *stream, const gdb_byte *string,
++reps;
}
- if (reps > repeat_count_threshold)
+ if (reps > options->repeat_count_threshold)
{
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\", ", stream);
else
fputs_filtered ("\", ", stream);
@@ -397,14 +398,14 @@ objc_printstr (struct ui_file *stream, const gdb_byte *string,
objc_printchar (string[i], stream);
fprintf_filtered (stream, " <repeats %u times>", reps);
i = rep1 - 1;
- things_printed += repeat_count_threshold;
+ things_printed += options->repeat_count_threshold;
need_comma = 1;
}
else
{
if (!in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\"", stream);
else
fputs_filtered ("\"", stream);
@@ -418,7 +419,7 @@ objc_printstr (struct ui_file *stream, const gdb_byte *string,
/* Terminate the quotes if necessary. */
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\\"", stream);
else
fputs_filtered ("\"", stream);
@@ -1154,7 +1155,8 @@ find_methods (struct symtab *symtab, char type,
{
QUIT;
- if ((msymbol->type != mst_text) && (msymbol->type != mst_file_text))
+ if ((MSYMBOL_TYPE (msymbol) != mst_text)
+ && (MSYMBOL_TYPE (msymbol) != mst_file_text))
/* Not a function or method. */
continue;
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index bd686fa..fe42f54 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -383,22 +383,13 @@ struct objfile
/* Defines for the objfile flag word. */
-/* When using mapped/remapped predigested gdb symbol information, we need
- a flag that indicates that we have previously done an initial symbol
- table read from this particular objfile. We can't just look for the
- absence of any of the three symbol tables (msymbols, psymtab, symtab)
- because if the file has no symbols for example, none of these will
- exist. */
-
-#define OBJF_SYMS (1 << 1) /* Have tried to read symbols */
-
/* When an object file has its functions reordered (currently Irix-5.2
shared libraries exhibit this behaviour), we will need an expensive
algorithm to locate a partial symtab or symtab via an address.
To avoid this penalty for normal object files, we use this flag,
whose setting is determined upon symbol table read in. */
-#define OBJF_REORDERED (1 << 2) /* Functions are reordered */
+#define OBJF_REORDERED (1 << 0) /* Functions are reordered */
/* Distinguish between an objfile for a shared library and a "vanilla"
objfile. (If not set, the objfile may still actually be a solib.
@@ -408,11 +399,11 @@ struct objfile
implementation of the solib interface is responsible for setting
this flag when noticing solibs used by an inferior.) */
-#define OBJF_SHARED (1 << 3) /* From a shared library */
+#define OBJF_SHARED (1 << 1) /* From a shared library */
/* User requested that this objfile be read in it's entirety. */
-#define OBJF_READNOW (1 << 4) /* Immediate full read */
+#define OBJF_READNOW (1 << 2) /* Immediate full read */
/* This objfile was created because the user explicitly caused it
(e.g., used the add-symbol-file command). This bit offers a way
@@ -421,7 +412,7 @@ struct objfile
ones that the user explicitly loaded via the add-symbol-file
command. */
-#define OBJF_USERLOADED (1 << 5) /* User loaded */
+#define OBJF_USERLOADED (1 << 3) /* User loaded */
/* The object file that the main symbol table was loaded from (e.g. the
argument to the "symbol-file" or "file" command). */
@@ -592,4 +583,8 @@ extern void *objfile_data (struct objfile *objfile,
uninitialized section index. */
#define SECT_OFF_BSS(objfile) (objfile)->sect_index_bss
+/* Answer whether there is more than one object file loaded. */
+
+#define MULTI_OBJFILE_P() (object_files && object_files->next)
+
#endif /* !defined (OBJFILES_H) */
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 4b5ceb2..e86cf89 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -1023,7 +1023,7 @@ pop_current_type (void)
{
current_type = tp->stored;
tp_top = tp->next;
- xfree (tp);
+ free (tp);
}
}
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 7ecdd8d..cd4285d 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -207,7 +207,8 @@ pascal_printchar (int c, struct ui_file *stream)
void
pascal_printstr (struct ui_file *stream, const gdb_byte *string,
- unsigned int length, int width, int force_ellipses)
+ unsigned int length, int width, int force_ellipses,
+ const struct value_print_options *options)
{
unsigned int i;
unsigned int things_printed = 0;
@@ -226,7 +227,7 @@ pascal_printstr (struct ui_file *stream, const gdb_byte *string,
return;
}
- for (i = 0; i < length && things_printed < print_max; ++i)
+ for (i = 0; i < length && things_printed < options->print_max; ++i)
{
/* Position of the character we are examining
to see whether it is repeated. */
@@ -250,11 +251,11 @@ pascal_printstr (struct ui_file *stream, const gdb_byte *string,
++reps;
}
- if (reps > repeat_count_threshold)
+ if (reps > options->repeat_count_threshold)
{
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\', ", stream);
else
fputs_filtered ("', ", stream);
@@ -263,7 +264,7 @@ pascal_printstr (struct ui_file *stream, const gdb_byte *string,
pascal_printchar (string[i], stream);
fprintf_filtered (stream, " <repeats %u times>", reps);
i = rep1 - 1;
- things_printed += repeat_count_threshold;
+ things_printed += options->repeat_count_threshold;
need_comma = 1;
}
else
@@ -271,7 +272,7 @@ pascal_printstr (struct ui_file *stream, const gdb_byte *string,
int c = string[i];
if ((!in_quotes) && (PRINT_LITERAL_FORM (c)))
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\'", stream);
else
fputs_filtered ("'", stream);
@@ -285,7 +286,7 @@ pascal_printstr (struct ui_file *stream, const gdb_byte *string,
/* Terminate the quotes if necessary. */
if (in_quotes)
{
- if (inspect_it)
+ if (options->inspect_it)
fputs_filtered ("\\'", stream);
else
fputs_filtered ("'", stream);
diff --git a/gdb/p-lang.h b/gdb/p-lang.h
index a4f878f..4ebfbc1 100644
--- a/gdb/p-lang.h
+++ b/gdb/p-lang.h
@@ -35,10 +35,11 @@ extern void pascal_print_typedef (struct type *, struct symbol *,
struct ui_file *);
extern int pascal_val_print (struct type *, const gdb_byte *, int,
- CORE_ADDR, struct ui_file *, int, int,
- int, enum val_prettyprint);
+ CORE_ADDR, struct ui_file *, int,
+ const struct value_print_options *);
-extern int pascal_value_print (struct value *, struct ui_file *, int, enum val_prettyprint);
+extern int pascal_value_print (struct value *, struct ui_file *,
+ const struct value_print_options *);
extern void pascal_type_print_method_args (char *, char *,
struct ui_file *);
@@ -51,7 +52,8 @@ extern int
extern void pascal_printchar (int, struct ui_file *);
extern void pascal_printstr (struct ui_file *, const gdb_byte *,
- unsigned int, int, int);
+ unsigned int, int, int,
+ const struct value_print_options *);
extern struct type **const (pascal_builtin_types[]);
@@ -63,15 +65,10 @@ extern void
extern void
pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int);
-/* These are in cp-valprint.c */
-
-extern int vtblprint; /* Controls printing of vtbl's */
-
-extern int static_field_print;
-
extern void pascal_object_print_value_fields (struct type *, const gdb_byte *,
CORE_ADDR, struct ui_file *,
- int, int, enum val_prettyprint,
+ int,
+ const struct value_print_options *,
struct type **, int);
extern int pascal_object_is_vtbl_ptr_type (struct type *);
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index afc831c..328ac84 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -266,7 +266,7 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
fprintf_filtered (stream, "(");
fprintf_filtered (stream, "array ");
if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
- && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
+ && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
fprintf_filtered (stream, "[%d..%d] ",
TYPE_ARRAY_LOWER_BOUND_VALUE (type),
TYPE_ARRAY_UPPER_BOUND_VALUE (type)
@@ -590,14 +590,12 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
}
print_spaces_filtered (level + 4, stream);
- if (TYPE_FIELD_STATIC (type, i))
- {
- fprintf_filtered (stream, "static ");
- }
+ if (field_is_static (&TYPE_FIELD (type, i)))
+ fprintf_filtered (stream, "static ");
pascal_print_type (TYPE_FIELD_TYPE (type, i),
TYPE_FIELD_NAME (type, i),
stream, show - 1, level + 4);
- if (!TYPE_FIELD_STATIC (type, i)
+ if (!field_is_static (&TYPE_FIELD (type, i))
&& TYPE_FIELD_PACKED (type, i))
{
/* It is a bitfield. This code does not attempt
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index f76bf56..65ab8a1 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -44,23 +44,17 @@
/* Print data of type TYPE located at VALADDR (within GDB), which came from
the inferior at address ADDRESS, onto stdio stream STREAM according to
- FORMAT (a letter or 0 for natural format). The data at VALADDR is in
- target byte order.
+ OPTIONS. The data at VALADDR is in target byte order.
If the data are a string pointer, returns the number of string characters
- printed.
-
- If DEREF_REF is nonzero, then dereference references, otherwise just print
- them like pointers.
-
- The PRETTY parameter controls prettyprinting. */
+ printed. */
int
pascal_val_print (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format, int deref_ref,
- int recurse, enum val_prettyprint pretty)
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
unsigned int i = 0; /* Number of characters printed */
unsigned len;
@@ -80,7 +74,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
elttype = check_typedef (TYPE_TARGET_TYPE (type));
eltlen = TYPE_LENGTH (elttype);
len = TYPE_LENGTH (type) / eltlen;
- if (prettyprint_arrays)
+ if (options->prettyprint_arrays)
{
print_spaces_filtered (2 + 2 * recurse, stream);
}
@@ -89,23 +83,24 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
&& ((TYPE_CODE (elttype) == TYPE_CODE_INT)
|| ((current_language->la_language == language_pascal)
&& (TYPE_CODE (elttype) == TYPE_CODE_CHAR)))
- && (format == 0 || format == 's'))
+ && (options->format == 0 || options->format == 's'))
{
/* If requested, look for the first null char and only print
elements up to it. */
- if (stop_print_at_null)
+ if (options->stop_print_at_null)
{
unsigned int temp_len;
/* Look for a NULL char. */
for (temp_len = 0;
(valaddr + embedded_offset)[temp_len]
- && temp_len < len && temp_len < print_max;
+ && temp_len < len && temp_len < options->print_max;
temp_len++);
len = temp_len;
}
- LA_PRINT_STRING (stream, valaddr + embedded_offset, len, 1, 0);
+ LA_PRINT_STRING (stream, valaddr + embedded_offset, len, 1, 0,
+ options);
i = len;
}
else
@@ -123,7 +118,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
i = 0;
}
val_print_array_elements (type, valaddr + embedded_offset, address, stream,
- format, deref_ref, recurse, pretty, i);
+ recurse, options, i);
fprintf_filtered (stream, "}");
}
break;
@@ -133,12 +128,13 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
goto print_unpacked_pointer;
case TYPE_CODE_PTR:
- if (format && format != 's')
+ if (options->format && options->format != 's')
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
break;
}
- if (vtblprint && pascal_object_is_vtbl_ptr_type (type))
+ if (options->vtblprint && pascal_object_is_vtbl_ptr_type (type))
{
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if we ARE using
@@ -162,7 +158,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
return (0);
}
- if (addressprint && format != 's')
+ if (options->addressprint && options->format != 's')
{
fputs_filtered (paddress (addr), stream);
}
@@ -172,11 +168,11 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
if (TYPE_LENGTH (elttype) == 1
&& (TYPE_CODE (elttype) == TYPE_CODE_INT
|| TYPE_CODE(elttype) == TYPE_CODE_CHAR)
- && (format == 0 || format == 's')
+ && (options->format == 0 || options->format == 's')
&& addr != 0)
{
/* no wide string yet */
- i = val_print_string (addr, -1, 1, stream);
+ i = val_print_string (addr, -1, 1, stream, options);
}
/* also for pointers to pascal strings */
/* Note: this is Free Pascal specific:
@@ -193,7 +189,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
read_memory (addr + length_pos, buffer, length_size);
string_length = extract_unsigned_integer (buffer, length_size);
xfree (buffer);
- i = val_print_string (addr + string_pos, string_length, char_size, stream);
+ i = val_print_string (addr + string_pos, string_length, char_size, stream, options);
}
else if (pascal_object_is_vtbl_member (type))
{
@@ -209,7 +205,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
fputs_filtered (SYMBOL_PRINT_NAME (msymbol), stream);
fputs_filtered (">", stream);
}
- if (vt_address && vtblprint)
+ if (vt_address && options->vtblprint)
{
struct value *vt_val;
struct symbol *wsym = (struct symbol *) NULL;
@@ -230,9 +226,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
wtype = TYPE_TARGET_TYPE (type);
}
vt_val = value_at (wtype, vt_address);
- common_val_print (vt_val, stream, format, deref_ref,
- recurse + 1, pretty, current_language);
- if (pretty)
+ common_val_print (vt_val, stream, recurse + 1, options,
+ current_language);
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -249,18 +245,18 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
case TYPE_CODE_REF:
elttype = check_typedef (TYPE_TARGET_TYPE (type));
- if (addressprint)
+ if (options->addressprint)
{
fprintf_filtered (stream, "@");
/* Extract the address, assume that it is unsigned. */
fputs_filtered (paddress (
extract_unsigned_integer (valaddr + embedded_offset,
gdbarch_ptr_bit (current_gdbarch) / HOST_CHAR_BIT)), stream);
- if (deref_ref)
+ if (options->deref_ref)
fputs_filtered (": ", stream);
}
/* De-reference the reference. */
- if (deref_ref)
+ if (options->deref_ref)
{
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
{
@@ -268,8 +264,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (type, valaddr + embedded_offset));
- common_val_print (deref_val, stream, format, deref_ref,
- recurse + 1, pretty, current_language);
+ common_val_print (deref_val, stream, recurse + 1, options,
+ current_language);
}
else
fputs_filtered ("???", stream);
@@ -277,14 +273,14 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
break;
case TYPE_CODE_UNION:
- if (recurse && !unionprint)
+ if (recurse && !options->unionprint)
{
fprintf_filtered (stream, "{...}");
break;
}
/* Fall through. */
case TYPE_CODE_STRUCT:
- if (vtblprint && pascal_object_is_vtbl_ptr_type (type))
+ if (options->vtblprint && pascal_object_is_vtbl_ptr_type (type))
{
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if NOT using
@@ -301,18 +297,19 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
&string_pos, &char_size, NULL))
{
len = extract_unsigned_integer (valaddr + embedded_offset + length_pos, length_size);
- LA_PRINT_STRING (stream, valaddr + embedded_offset + string_pos, len, char_size, 0);
+ LA_PRINT_STRING (stream, valaddr + embedded_offset + string_pos, len, char_size, 0, options);
}
else
- pascal_object_print_value_fields (type, valaddr + embedded_offset, address, stream, format,
- recurse, pretty, NULL, 0);
+ pascal_object_print_value_fields (type, valaddr + embedded_offset, address, stream,
+ recurse, options, NULL, 0);
}
break;
case TYPE_CODE_ENUM:
- if (format)
+ if (options->format)
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
break;
}
len = TYPE_NFIELDS (type);
@@ -336,16 +333,18 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
break;
case TYPE_CODE_FLAGS:
- if (format)
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ if (options->format)
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
else
val_print_type_code_flags (type, valaddr + embedded_offset, stream);
break;
case TYPE_CODE_FUNC:
- if (format)
+ if (options->format)
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
break;
}
/* FIXME, we should consider, at least for ANSI C language, eliminating
@@ -358,9 +357,14 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
break;
case TYPE_CODE_BOOL:
- format = format ? format : output_format;
- if (format)
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ if (options->format || options->output_format)
+ {
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ &opts, 0, stream);
+ }
else
{
val = unpack_long (type, valaddr + embedded_offset);
@@ -387,10 +391,13 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
/* FALLTHROUGH */
case TYPE_CODE_INT:
- format = format ? format : output_format;
- if (format)
+ if (options->format || options->output_format)
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ &opts, 0, stream);
}
else
{
@@ -399,10 +406,13 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
break;
case TYPE_CODE_CHAR:
- format = format ? format : output_format;
- if (format)
+ if (options->format || options->output_format)
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ struct value_print_options opts = *options;
+ opts.format = (options->format ? options->format
+ : options->output_format);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ &opts, 0, stream);
}
else
{
@@ -417,9 +427,10 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
break;
case TYPE_CODE_FLT:
- if (format)
+ if (options->format)
{
- print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream);
+ print_scalar_formatted (valaddr + embedded_offset, type,
+ options, 0, stream);
}
else
{
@@ -517,8 +528,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
}
int
-pascal_value_print (struct value *val, struct ui_file *stream, int format,
- enum val_prettyprint pretty)
+pascal_value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options)
{
struct type *type = value_type (val);
@@ -547,19 +558,10 @@ pascal_value_print (struct value *val, struct ui_file *stream, int format,
fprintf_filtered (stream, ") ");
}
}
- return common_val_print (val, stream, format, 1, 0, pretty,
- current_language);
+ return common_val_print (val, stream, 0, options, current_language);
}
-/******************************************************************************
- Inserted from cp-valprint
-******************************************************************************/
-
-extern int vtblprint; /* Controls printing of vtbl's */
-extern int objectprint; /* Controls looking up an object's derived type
- using what we find in its vtables. */
-static int pascal_static_field_print; /* Controls printing of static fields. */
static void
show_pascal_static_field_print (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -572,12 +574,12 @@ static struct obstack dont_print_vb_obstack;
static struct obstack dont_print_statmem_obstack;
static void pascal_object_print_static_field (struct value *,
- struct ui_file *, int, int,
- enum val_prettyprint);
+ struct ui_file *, int,
+ const struct value_print_options *);
static void pascal_object_print_value (struct type *, const gdb_byte *,
- CORE_ADDR, struct ui_file *,
- int, int, enum val_prettyprint,
+ CORE_ADDR, struct ui_file *, int,
+ const struct value_print_options *,
struct type **);
/* It was changed to this after 2.4.5. */
@@ -624,7 +626,7 @@ pascal_object_is_vtbl_member (struct type *type)
c_val_print to print out a structure's fields:
pascal_object_print_value_fields and pascal_object_print_value.
- TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and PRETTY have the
+ TYPE, VALADDR, ADDRESS, STREAM, RECURSE, and OPTIONS have the
same meanings as in pascal_object_print_value and c_val_print.
DONT_PRINT is an array of baseclass types that we
@@ -633,8 +635,8 @@ pascal_object_is_vtbl_member (struct type *type)
void
pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
CORE_ADDR address, struct ui_file *stream,
- int format, int recurse,
- enum val_prettyprint pretty,
+ int recurse,
+ const struct value_print_options *options,
struct type **dont_print_vb,
int dont_print_statmem)
{
@@ -651,7 +653,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
duplicates of virtual baseclasses. */
if (n_baseclasses > 0)
pascal_object_print_value (type, valaddr, address, stream,
- format, recurse + 1, pretty, dont_print_vb);
+ recurse + 1, options, dont_print_vb);
if (!len && n_baseclasses == 1)
fprintf_filtered (stream, "<No data fields>");
@@ -671,13 +673,14 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
for (i = n_baseclasses; i < len; i++)
{
/* If requested, skip printing of static fields. */
- if (!pascal_static_field_print && TYPE_FIELD_STATIC (type, i))
+ if (!options->pascal_static_field_print
+ && field_is_static (&TYPE_FIELD (type, i)))
continue;
if (fields_seen)
fprintf_filtered (stream, ", ");
else if (n_baseclasses > 0)
{
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -688,7 +691,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
}
fields_seen = 1;
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -697,13 +700,13 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
{
wrap_here (n_spaces (2 + 2 * recurse));
}
- if (inspect_it)
+ if (options->inspect_it)
{
if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_PTR)
fputs_filtered ("\"( ptr \"", stream);
else
fputs_filtered ("\"( nodef \"", stream);
- if (TYPE_FIELD_STATIC (type, i))
+ if (field_is_static (&TYPE_FIELD (type, i)))
fputs_filtered ("static ", stream);
fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
language_cplus,
@@ -718,7 +721,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
{
annotate_field_begin (TYPE_FIELD_TYPE (type, i));
- if (TYPE_FIELD_STATIC (type, i))
+ if (field_is_static (&TYPE_FIELD (type, i)))
fputs_filtered ("static ", stream);
fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
language_cplus,
@@ -728,7 +731,8 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
annotate_field_value ();
}
- if (!TYPE_FIELD_STATIC (type, i) && TYPE_FIELD_PACKED (type, i))
+ if (!field_is_static (&TYPE_FIELD (type, i))
+ && TYPE_FIELD_PACKED (type, i))
{
struct value *v;
@@ -740,11 +744,13 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
}
else
{
+ struct value_print_options opts = *options;
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
- common_val_print (v, stream, format, 0, recurse + 1,
- pretty, current_language);
+ opts.deref_ref = 0;
+ common_val_print (v, stream, recurse + 1, &opts,
+ current_language);
}
}
else
@@ -753,7 +759,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
{
fputs_filtered ("<optimized out or zero length>", stream);
}
- else if (TYPE_FIELD_STATIC (type, i))
+ else if (field_is_static (&TYPE_FIELD (type, i)))
{
/* struct value *v = value_static_field (type, i); v4.17 specific */
struct value *v;
@@ -763,11 +769,13 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
if (v == NULL)
fputs_filtered ("<optimized out>", stream);
else
- pascal_object_print_static_field (v, stream, format,
- recurse + 1, pretty);
+ pascal_object_print_static_field (v, stream, recurse + 1,
+ options);
}
else
{
+ struct value_print_options opts = *options;
+ opts.deref_ref = 0;
/* val_print (TYPE_FIELD_TYPE (type, i),
valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
address + TYPE_FIELD_BITPOS (type, i) / 8, 0,
@@ -775,7 +783,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
val_print (TYPE_FIELD_TYPE (type, i),
valaddr, TYPE_FIELD_BITPOS (type, i) / 8,
address + TYPE_FIELD_BITPOS (type, i) / 8,
- stream, format, 0, recurse + 1, pretty,
+ stream, recurse + 1, &opts,
current_language);
}
}
@@ -790,7 +798,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
dont_print_statmem_obstack = tmp_obstack;
}
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
@@ -805,8 +813,8 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
static void
pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
CORE_ADDR address, struct ui_file *stream,
- int format, int recurse,
- enum val_prettyprint pretty,
+ int recurse,
+ const struct value_print_options *options,
struct type **dont_print_vb)
{
struct type **last_dont_print
@@ -847,7 +855,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
boffset = baseclass_offset (type, i, valaddr, address);
- if (pretty)
+ if (options->pretty)
{
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 * recurse, stream);
@@ -879,7 +887,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
fprintf_filtered (stream, "<invalid address>");
else
pascal_object_print_value_fields (baseclass, base_valaddr, address + boffset,
- stream, format, recurse, pretty,
+ stream, recurse, options,
(struct type **) obstack_base (&dont_print_vb_obstack),
0);
fputs_filtered (", ", stream);
@@ -905,15 +913,17 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
static member classes in an obstack and refuse to print them more
than once.
- VAL contains the value to print, STREAM, RECURSE, and PRETTY
+ VAL contains the value to print, STREAM, RECURSE, and OPTIONS
have the same meanings as in c_val_print. */
static void
pascal_object_print_static_field (struct value *val,
- struct ui_file *stream, int format,
- int recurse, enum val_prettyprint pretty)
+ struct ui_file *stream,
+ int recurse,
+ const struct value_print_options *options)
{
struct type *type = value_type (val);
+ struct value_print_options opts;
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
@@ -940,11 +950,13 @@ pascal_object_print_static_field (struct value *val,
CHECK_TYPEDEF (type);
pascal_object_print_value_fields (type, value_contents (val), VALUE_ADDRESS (val),
- stream, format, recurse, pretty, NULL, 1);
+ stream, recurse, options, NULL, 1);
return;
}
- common_val_print (val, stream, format, 0, recurse, pretty,
- current_language);
+
+ opts = *options;
+ opts.deref_ref = 0;
+ common_val_print (val, stream, recurse, &opts, current_language);
}
extern initialize_file_ftype _initialize_pascal_valprint; /* -Wmissing-prototypes */
@@ -953,13 +965,10 @@ void
_initialize_pascal_valprint (void)
{
add_setshow_boolean_cmd ("pascal_static-members", class_support,
- &pascal_static_field_print, _("\
+ &user_print_options.pascal_static_field_print, _("\
Set printing of pascal static members."), _("\
Show printing of pascal static members."), NULL,
NULL,
show_pascal_static_field_print,
&setprintlist, &showprintlist);
- /* Turn on printing of static fields. */
- pascal_static_field_print = 1;
-
}
diff --git a/gdb/parse.c b/gdb/parse.c
index 75853ff..6200e81 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -410,7 +410,7 @@ write_exp_msymbol (struct minimal_symbol *msymbol)
CORE_ADDR addr = SYMBOL_VALUE_ADDRESS (msymbol);
struct obj_section *section = SYMBOL_OBJ_SECTION (msymbol);
- enum minimal_symbol_type type = msymbol->type;
+ enum minimal_symbol_type type = MSYMBOL_TYPE (msymbol);
CORE_ADDR pc;
/* The minimal symbol might point to a function descriptor;
@@ -1268,8 +1268,7 @@ follow_types (struct type *follow_type)
create_array_type ((struct type *) NULL,
follow_type, range_type);
if (array_size < 0)
- TYPE_ARRAY_UPPER_BOUND_TYPE (follow_type)
- = BOUND_CANNOT_BE_DETERMINED;
+ TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (follow_type) = 1;
break;
case tp_function:
/* FIXME-type-allocation: need a way to free this type when we are
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index ed197f1..2e04828 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -56,9 +56,16 @@
#define PT_TRAP 40
#endif
+/* The PPC_FEATURE_* defines should be provided by <asm/cputable.h>.
+ If they aren't, we can provide them ourselves (their values are fixed
+ because they are part of the kernel ABI). They are used in the AT_HWCAP
+ entry of the AUXV. */
#ifndef PPC_FEATURE_BOOKE
#define PPC_FEATURE_BOOKE 0x00008000
#endif
+#ifndef PPC_FEATURE_ARCH_2_05
+#define PPC_FEATURE_ARCH_2_05 0x00001000 /* ISA 2.05 */
+#endif
/* Glibc's headers don't define PTRACE_GETVRREGS so we cannot use a
configure time check. Some older glibc's (for instance 2.2.1)
@@ -274,11 +281,17 @@ ppc_register_u_addr (struct gdbarch *gdbarch, int regno)
kernel headers incorrectly contained the 32-bit definition of
PT_FPSCR. For the 32-bit definition, floating-point
registers occupy two 32-bit "slots", and the FPSCR lives in
- the secondhalf of such a slot-pair (hence +1). For 64-bit,
+ the second half of such a slot-pair (hence +1). For 64-bit,
the FPSCR instead occupies the full 64-bit 2-word-slot and
hence no adjustment is necessary. Hack around this. */
if (wordsize == 8 && PT_FPSCR == (48 + 32 + 1))
u_addr = (48 + 32) * wordsize;
+ /* If the FPSCR is 64-bit wide, we need to fetch the whole 64-bit
+ slot and not just its second word. The PT_FPSCR supplied when
+ GDB is compiled as a 32-bit app doesn't reflect this. */
+ else if (wordsize == 4 && register_size (gdbarch, regno) == 8
+ && PT_FPSCR == (48 + 2*32 + 1))
+ u_addr = (48 + 2*32) * wordsize;
else
u_addr = PT_FPSCR * wordsize;
}
@@ -1230,6 +1243,7 @@ ppc_linux_read_description (struct target_ops *ops)
{
int altivec = 0;
int vsx = 0;
+ int isa205 = 0;
int tid = TIDGET (inferior_ptid);
if (tid == 0)
@@ -1274,6 +1288,9 @@ ppc_linux_read_description (struct target_ops *ops)
perror_with_name (_("Unable to fetch AltiVec registers"));
}
+ if (ppc_linux_get_hwcap () & PPC_FEATURE_ARCH_2_05)
+ isa205 = 1;
+
/* Check for 64-bit inferior process. This is the case when the host is
64-bit, and in addition the top bit of the MSR register is set. */
#ifdef __powerpc64__
@@ -1284,21 +1301,21 @@ ppc_linux_read_description (struct target_ops *ops)
if (errno == 0 && msr < 0)
{
if (vsx)
- return tdesc_powerpc_vsx64l;
+ return isa205? tdesc_powerpc_isa205_vsx64l : tdesc_powerpc_vsx64l;
else if (altivec)
- return tdesc_powerpc_altivec64l;
+ return isa205? tdesc_powerpc_isa205_altivec64l : tdesc_powerpc_altivec64l;
- return tdesc_powerpc_64l;
+ return isa205? tdesc_powerpc_isa205_64l : tdesc_powerpc_64l;
}
}
#endif
if (vsx)
- return tdesc_powerpc_vsx32l;
+ return isa205? tdesc_powerpc_isa205_vsx32l : tdesc_powerpc_vsx32l;
else if (altivec)
- return tdesc_powerpc_altivec32l;
+ return isa205? tdesc_powerpc_isa205_altivec32l : tdesc_powerpc_altivec32l;
- return tdesc_powerpc_32l;
+ return isa205? tdesc_powerpc_isa205_32l : tdesc_powerpc_32l;
}
void _initialize_ppc_linux_nat (void);
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 2804857..b4adb34 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -42,9 +42,15 @@
#include "features/rs6000/powerpc-32l.c"
#include "features/rs6000/powerpc-altivec32l.c"
#include "features/rs6000/powerpc-vsx32l.c"
+#include "features/rs6000/powerpc-isa205-32l.c"
+#include "features/rs6000/powerpc-isa205-altivec32l.c"
+#include "features/rs6000/powerpc-isa205-vsx32l.c"
#include "features/rs6000/powerpc-64l.c"
#include "features/rs6000/powerpc-altivec64l.c"
#include "features/rs6000/powerpc-vsx64l.c"
+#include "features/rs6000/powerpc-isa205-64l.c"
+#include "features/rs6000/powerpc-isa205-altivec64l.c"
+#include "features/rs6000/powerpc-isa205-vsx64l.c"
#include "features/rs6000/powerpc-e500l.c"
@@ -1170,8 +1176,14 @@ _initialize_ppc_linux_tdep (void)
initialize_tdesc_powerpc_32l ();
initialize_tdesc_powerpc_altivec32l ();
initialize_tdesc_powerpc_vsx32l ();
+ initialize_tdesc_powerpc_isa205_32l ();
+ initialize_tdesc_powerpc_isa205_altivec32l ();
+ initialize_tdesc_powerpc_isa205_vsx32l ();
initialize_tdesc_powerpc_64l ();
initialize_tdesc_powerpc_altivec64l ();
initialize_tdesc_powerpc_vsx64l ();
+ initialize_tdesc_powerpc_isa205_64l ();
+ initialize_tdesc_powerpc_isa205_altivec64l ();
+ initialize_tdesc_powerpc_isa205_vsx64l ();
initialize_tdesc_powerpc_e500l ();
}
diff --git a/gdb/ppc-linux-tdep.h b/gdb/ppc-linux-tdep.h
index ccfb902..3552c89 100644
--- a/gdb/ppc-linux-tdep.h
+++ b/gdb/ppc-linux-tdep.h
@@ -42,9 +42,15 @@ int ppc_linux_trap_reg_p (struct gdbarch *gdbarch);
extern struct target_desc *tdesc_powerpc_32l;
extern struct target_desc *tdesc_powerpc_altivec32l;
extern struct target_desc *tdesc_powerpc_vsx32l;
+extern struct target_desc *tdesc_powerpc_isa205_32l;
+extern struct target_desc *tdesc_powerpc_isa205_altivec32l;
+extern struct target_desc *tdesc_powerpc_isa205_vsx32l;
extern struct target_desc *tdesc_powerpc_e500l;
extern struct target_desc *tdesc_powerpc_64l;
extern struct target_desc *tdesc_powerpc_altivec64l;
extern struct target_desc *tdesc_powerpc_vsx64l;
+extern struct target_desc *tdesc_powerpc_isa205_64l;
+extern struct target_desc *tdesc_powerpc_isa205_altivec64l;
+extern struct target_desc *tdesc_powerpc_isa205_vsx64l;
#endif /* PPC_LINUX_TDEP_H */
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 021e191..fec81d9 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -42,12 +42,13 @@
#include "block.h"
#include "disasm.h"
#include "dfp.h"
+#include "valprint.h"
#ifdef TUI
#include "tui/tui.h" /* For tui_active et.al. */
#endif
-#if defined(__MINGW32__)
+#if defined(__MINGW32__) && !defined(PRINTF_HAS_LONG_LONG)
# define USE_PRINTF_I64 1
# define PRINTF_HAS_LONG_LONG
#else
@@ -55,7 +56,6 @@
#endif
extern int asm_demangle; /* Whether to demangle syms in asm printouts */
-extern int addressprint; /* Whether to print hex addresses in HLL " */
struct format_data
{
@@ -120,13 +120,6 @@ Printing of source filename and line number with <symbol> is %s.\n"),
int current_display_number;
-/* Flag to low-level print routines that this value is being printed
- in an epoch window. We'd like to pass this as a parameter, but
- every routine would need to take it. Perhaps we can encapsulate
- this in the I/O stream once we have GNU stdio. */
-
-int inspect_it = 0;
-
struct display
{
/* Chain link to next auto-display item. */
@@ -254,15 +247,15 @@ decode_format (char **string_ptr, int oformat, int osize)
return val;
}
-/* Print value VAL on stream according to FORMAT, a letter or 0.
+/* Print value VAL on stream according to OPTIONS.
Do not end with a newline.
- 0 means print VAL according to its own type.
SIZE is the letter for the size of datum being printed.
This is used to pad hex numbers so they line up. SIZE is 0
for print / output and set for examine. */
static void
-print_formatted (struct value *val, int format, int size,
+print_formatted (struct value *val, int size,
+ const struct value_print_options *options,
struct ui_file *stream)
{
struct type *type = check_typedef (value_type (val));
@@ -273,12 +266,13 @@ print_formatted (struct value *val, int format, int size,
if (size)
{
- switch (format)
+ switch (options->format)
{
case 's':
/* FIXME: Need to handle wchar_t's here... */
next_address = VALUE_ADDRESS (val)
- + val_print_string (VALUE_ADDRESS (val), -1, 1, stream);
+ + val_print_string (VALUE_ADDRESS (val), -1, 1, stream,
+ options);
return;
case 'i':
@@ -291,22 +285,19 @@ print_formatted (struct value *val, int format, int size,
}
}
- if (format == 0 || format == 's'
+ if (options->format == 0 || options->format == 's'
|| TYPE_CODE (type) == TYPE_CODE_REF
|| TYPE_CODE (type) == TYPE_CODE_ARRAY
|| TYPE_CODE (type) == TYPE_CODE_STRING
|| TYPE_CODE (type) == TYPE_CODE_STRUCT
|| TYPE_CODE (type) == TYPE_CODE_UNION
|| TYPE_CODE (type) == TYPE_CODE_NAMESPACE)
- /* If format is 0, use the 'natural' format for that type of
- value. If the type is non-scalar, we have to use language
- rules to print it as a series of scalars. */
- value_print (val, stream, format, Val_pretty_default);
+ value_print (val, stream, options);
else
/* User specified format, so don't look to the the type to
tell us what to do. */
print_scalar_formatted (value_contents (val), type,
- format, size, stream);
+ options, size, stream);
}
/* Return builtin floating point type of same length as TYPE.
@@ -328,15 +319,16 @@ float_type_from_length (struct gdbarch *gdbarch, struct type *type)
}
/* Print a scalar of data of type TYPE, pointed to in GDB by VALADDR,
- according to letters FORMAT and SIZE on STREAM.
- FORMAT may not be zero. Formats s and i are not supported at this level.
+ according to OPTIONS and SIZE on STREAM.
+ Formats s and i are not supported at this level.
This is how the elements of an array or structure are printed
with a format. */
void
print_scalar_formatted (const void *valaddr, struct type *type,
- int format, int size, struct ui_file *stream)
+ const struct value_print_options *options,
+ int size, struct ui_file *stream)
{
LONGEST val_long = 0;
unsigned int len = TYPE_LENGTH (type);
@@ -345,9 +337,12 @@ print_scalar_formatted (const void *valaddr, struct type *type,
/* If we get here with a string format, try again without it. Go
all the way back to the language printers, which may call us
again. */
- if (format == 's')
+ if (options->format == 's')
{
- val_print (type, valaddr, 0, 0, stream, 0, 0, 0, Val_pretty_default,
+ struct value_print_options opts = *options;
+ opts.format = 0;
+ opts.deref_ref = 0;
+ val_print (type, valaddr, 0, 0, stream, 0, &opts,
current_language);
return;
}
@@ -356,7 +351,7 @@ print_scalar_formatted (const void *valaddr, struct type *type,
(TYPE_CODE (type) == TYPE_CODE_INT
|| TYPE_CODE (type) == TYPE_CODE_ENUM))
{
- switch (format)
+ switch (options->format)
{
case 'o':
print_octal_chars (stream, valaddr, len, byte_order);
@@ -379,7 +374,7 @@ print_scalar_formatted (const void *valaddr, struct type *type,
};
}
- if (format != 'f')
+ if (options->format != 'f')
val_long = unpack_long (type, valaddr);
/* If the value is a pointer, and pointers and addresses are not the
@@ -391,13 +386,13 @@ print_scalar_formatted (const void *valaddr, struct type *type,
/* If we are printing it as unsigned, truncate it in case it is actually
a negative signed value (e.g. "print/u (short)-1" should print 65535
(if shorts are 16 bits) instead of 4294967295). */
- if (format != 'd')
+ if (options->format != 'd')
{
if (len < sizeof (LONGEST))
val_long &= ((LONGEST) 1 << HOST_CHAR_BIT * len) - 1;
}
- switch (format)
+ switch (options->format)
{
case 'x':
if (!size)
@@ -442,13 +437,17 @@ print_scalar_formatted (const void *valaddr, struct type *type,
break;
case 'c':
- if (TYPE_UNSIGNED (type))
- value_print (value_from_longest (builtin_type_true_unsigned_char,
- val_long),
- stream, 0, Val_pretty_default);
- else
- value_print (value_from_longest (builtin_type_true_char, val_long),
- stream, 0, Val_pretty_default);
+ {
+ struct value_print_options opts = *options;
+ opts.format = 0;
+ if (TYPE_UNSIGNED (type))
+ value_print (value_from_longest (builtin_type_true_unsigned_char,
+ val_long),
+ stream, &opts);
+ else
+ value_print (value_from_longest (builtin_type_true_char, val_long),
+ stream, &opts);
+ }
break;
case 'f':
@@ -508,7 +507,7 @@ print_scalar_formatted (const void *valaddr, struct type *type,
break;
default:
- error (_("Undefined output format \"%c\"."), format);
+ error (_("Undefined output format \"%c\"."), options->format);
}
}
@@ -707,11 +706,13 @@ void
print_address_demangle (CORE_ADDR addr, struct ui_file *stream,
int do_demangle)
{
+ struct value_print_options opts;
+ get_user_print_options (&opts);
if (addr == 0)
{
fprintf_filtered (stream, "0");
}
- else if (addressprint)
+ else if (opts.addressprint)
{
fputs_filtered (paddress (addr), stream);
print_address_symbolic (addr, stream, do_demangle, " ");
@@ -745,6 +746,7 @@ do_examine (struct format_data fmt, CORE_ADDR addr)
struct type *val_type = NULL;
int i;
int maxelts;
+ struct value_print_options opts;
format = fmt.format;
size = fmt.size;
@@ -775,6 +777,8 @@ do_examine (struct format_data fmt, CORE_ADDR addr)
if (format == 's' || format == 'i')
maxelts = 1;
+ get_formatted_print_options (&opts, format);
+
/* Print as many objects as specified in COUNT, at most maxelts per line,
with the address of the next one at the start of each line. */
@@ -809,7 +813,7 @@ do_examine (struct format_data fmt, CORE_ADDR addr)
if (last_examine_value)
release_value (last_examine_value);
- print_formatted (last_examine_value, format, size, gdb_stdout);
+ print_formatted (last_examine_value, size, &opts, gdb_stdout);
/* Display any branch delay slots following the final insn. */
if (format == 'i' && count == 1)
@@ -847,10 +851,6 @@ print_command_1 (char *exp, int inspect, int voidprint)
struct format_data fmt;
int cleanup = 0;
- /* Pass inspect flag to the rest of the print routines in a global
- (sigh). */
- inspect_it = inspect;
-
if (exp && *exp == '/')
{
exp++;
@@ -879,6 +879,7 @@ print_command_1 (char *exp, int inspect, int voidprint)
if (voidprint || (val && value_type (val) &&
TYPE_CODE (value_type (val)) != TYPE_CODE_VOID))
{
+ struct value_print_options opts;
int histindex = record_latest_value (val);
if (histindex >= 0)
@@ -895,7 +896,10 @@ print_command_1 (char *exp, int inspect, int voidprint)
if (histindex >= 0)
annotate_value_history_value ();
- print_formatted (val, format, fmt.size, gdb_stdout);
+ get_formatted_print_options (&opts, format);
+ opts.inspect_it = inspect;
+
+ print_formatted (val, fmt.size, &opts, gdb_stdout);
printf_filtered ("\n");
if (histindex >= 0)
@@ -909,7 +913,6 @@ print_command_1 (char *exp, int inspect, int voidprint)
if (cleanup)
do_cleanups (old_chain);
- inspect_it = 0; /* Reset print routines to normal. */
}
static void
@@ -942,6 +945,7 @@ output_command (char *exp, int from_tty)
char format = 0;
struct value *val;
struct format_data fmt;
+ struct value_print_options opts;
fmt.size = 0;
@@ -960,7 +964,8 @@ output_command (char *exp, int from_tty)
annotate_value_begin (value_type (val));
- print_formatted (val, format, fmt.size, gdb_stdout);
+ get_formatted_print_options (&opts, format);
+ print_formatted (val, fmt.size, &opts, gdb_stdout);
annotate_value_end ();
@@ -1007,21 +1012,51 @@ sym_info (char *arg, int from_tty)
&& sect_addr < obj_section_endaddr (osect)
&& (msymbol = lookup_minimal_symbol_by_pc_section (sect_addr, osect)))
{
+ const char *obj_name, *mapped, *sec_name, *msym_name;
+
matches = 1;
offset = sect_addr - SYMBOL_VALUE_ADDRESS (msymbol);
- if (offset)
- printf_filtered ("%s + %u in ",
- SYMBOL_PRINT_NAME (msymbol), offset);
+ mapped = section_is_mapped (osect) ? _("mapped") : _("unmapped");
+ sec_name = osect->the_bfd_section->name;
+ msym_name = SYMBOL_PRINT_NAME (msymbol);
+
+ gdb_assert (osect->objfile && osect->objfile->name);
+ obj_name = osect->objfile->name;
+
+ if (MULTI_OBJFILE_P ())
+ if (pc_in_unmapped_range (addr, osect))
+ if (section_is_overlay (osect))
+ printf_filtered (_("%s + %u in load address range of "
+ "%s overlay section %s of %s\n"),
+ msym_name, offset,
+ mapped, sec_name, obj_name);
+ else
+ printf_filtered (_("%s + %u in load address range of "
+ "section %s of %s\n"),
+ msym_name, offset, sec_name, obj_name);
+ else
+ if (section_is_overlay (osect))
+ printf_filtered (_("%s + %u in %s overlay section %s of %s\n"),
+ msym_name, offset, mapped, sec_name, obj_name);
+ else
+ printf_filtered (_("%s + %u in section %s of %s\n"),
+ msym_name, offset, sec_name, obj_name);
else
- printf_filtered ("%s in ",
- SYMBOL_PRINT_NAME (msymbol));
- if (pc_in_unmapped_range (addr, osect))
- printf_filtered (_("load address range of "));
- if (section_is_overlay (osect))
- printf_filtered (_("%s overlay "),
- section_is_mapped (osect) ? "mapped" : "unmapped");
- printf_filtered (_("section %s"), osect->the_bfd_section->name);
- printf_filtered ("\n");
+ if (pc_in_unmapped_range (addr, osect))
+ if (section_is_overlay (osect))
+ printf_filtered (_("%s + %u in load address range of %s overlay "
+ "section %s\n"),
+ msym_name, offset, mapped, sec_name);
+ else
+ printf_filtered (_("%s + %u in load address range of section %s\n"),
+ msym_name, offset, sec_name);
+ else
+ if (section_is_overlay (osect))
+ printf_filtered (_("%s + %u in %s overlay section %s\n"),
+ msym_name, offset, mapped, sec_name);
+ else
+ printf_filtered (_("%s + %u in section %s\n"),
+ msym_name, offset, sec_name);
}
}
if (matches == 0)
@@ -1507,6 +1542,8 @@ do_one_display (struct display *d)
}
else
{
+ struct value_print_options opts;
+
annotate_display_format ();
if (d->format.format)
@@ -1521,8 +1558,9 @@ do_one_display (struct display *d)
annotate_display_expression ();
+ get_formatted_print_options (&opts, d->format.format);
print_formatted (evaluate_expression (d->exp),
- d->format.format, d->format.size, gdb_stdout);
+ d->format.size, &opts, gdb_stdout);
printf_filtered ("\n");
}
@@ -1677,8 +1715,10 @@ print_variable_value (struct symbol *var, struct frame_info *frame,
struct ui_file *stream)
{
struct value *val = read_var_value (var, frame);
+ struct value_print_options opts;
- value_print (val, stream, 0, Val_pretty_default);
+ get_user_print_options (&opts);
+ value_print (val, stream, &opts);
}
static void
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 7529146..f1f4d96 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -112,8 +112,8 @@
*/
static void procfs_open (char *, int);
-static void procfs_attach (char *, int);
-static void procfs_detach (char *, int);
+static void procfs_attach (struct target_ops *, char *, int);
+static void procfs_detach (struct target_ops *, char *, int);
static void procfs_resume (ptid_t, int, enum target_signal);
static int procfs_can_run (void);
static void procfs_stop (ptid_t);
@@ -123,16 +123,17 @@ static void procfs_store_registers (struct regcache *, int);
static void procfs_notice_signals (ptid_t);
static void procfs_prepare_to_store (struct regcache *);
static void procfs_kill_inferior (void);
-static void procfs_mourn_inferior (void);
-static void procfs_create_inferior (char *, char *, char **, int);
+static void procfs_mourn_inferior (struct target_ops *ops);
+static void procfs_create_inferior (struct target_ops *, char *,
+ char *, char **, int);
static ptid_t procfs_wait (ptid_t, struct target_waitstatus *);
-static int procfs_xfer_memory (CORE_ADDR, char *, int, int,
+static int procfs_xfer_memory (CORE_ADDR, gdb_byte *, int, int,
struct mem_attrib *attrib,
struct target_ops *);
static LONGEST procfs_xfer_partial (struct target_ops *ops,
enum target_object object,
const char *annex,
- void *readbuf, const void *writebuf,
+ gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len);
static int procfs_thread_alive (ptid_t);
@@ -715,7 +716,7 @@ open_procinfo_files (procinfo *pi, int which)
static procinfo *
create_procinfo (int pid, int tid)
{
- procinfo *pi, *parent;
+ procinfo *pi, *parent = NULL;
if ((pi = find_procinfo (pid, tid)))
return pi; /* Already exists, nothing to do. */
@@ -866,7 +867,7 @@ dead_procinfo (procinfo *pi, char *msg, int kill_p)
kill (pi->pid, SIGKILL);
destroy_procinfo (pi);
- error ((msg));
+ error ("%s", msg);
}
/*
@@ -2902,7 +2903,8 @@ procfs_address_to_host_pointer (CORE_ADDR addr)
void *ptr;
gdb_assert (sizeof (ptr) == TYPE_LENGTH (ptr_type));
- gdbarch_address_to_pointer (target_gdbarch, ptr_type, &ptr, addr);
+ gdbarch_address_to_pointer (target_gdbarch, ptr_type,
+ (gdb_byte *) &ptr, addr);
return ptr;
}
@@ -3064,14 +3066,14 @@ procfs_find_LDT_entry (ptid_t ptid)
/* Find procinfo for the lwp. */
if ((pi = find_procinfo (PIDGET (ptid), TIDGET (ptid))) == NULL)
{
- warning (_("procfs_find_LDT_entry: could not find procinfo for %d:%d."),
+ warning (_("procfs_find_LDT_entry: could not find procinfo for %d:%ld."),
PIDGET (ptid), TIDGET (ptid));
return NULL;
}
/* get its general registers. */
if ((gregs = proc_get_gregs (pi)) == NULL)
{
- warning (_("procfs_find_LDT_entry: could not read gregs for %d:%d."),
+ warning (_("procfs_find_LDT_entry: could not read gregs for %d:%ld."),
PIDGET (ptid), TIDGET (ptid));
return NULL;
}
@@ -3601,7 +3603,7 @@ procfs_debug_inferior (procinfo *pi)
}
static void
-procfs_attach (char *args, int from_tty)
+procfs_attach (struct target_ops *ops, char *args, int from_tty)
{
char *exec_file;
int pid;
@@ -3631,7 +3633,7 @@ procfs_attach (char *args, int from_tty)
}
static void
-procfs_detach (char *args, int from_tty)
+procfs_detach (struct target_ops *ops, char *args, int from_tty)
{
int sig = 0;
int pid = PIDGET (inferior_ptid);
@@ -4375,18 +4377,18 @@ wait_again:
static LONGEST
procfs_xfer_partial (struct target_ops *ops, enum target_object object,
- const char *annex, void *readbuf,
- const void *writebuf, ULONGEST offset, LONGEST len)
+ const char *annex, gdb_byte *readbuf,
+ const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
{
switch (object)
{
case TARGET_OBJECT_MEMORY:
if (readbuf)
- return (*ops->deprecated_xfer_memory) (offset, readbuf, len,
- 0/*read*/, NULL, ops);
+ return (*ops->deprecated_xfer_memory) (offset, readbuf,
+ len, 0/*read*/, NULL, ops);
if (writebuf)
- return (*ops->deprecated_xfer_memory) (offset, writebuf, len,
- 1/*write*/, NULL, ops);
+ return (*ops->deprecated_xfer_memory) (offset, (gdb_byte *) writebuf,
+ len, 1/*write*/, NULL, ops);
return -1;
#ifdef NEW_PROC_API
@@ -4415,7 +4417,7 @@ procfs_xfer_partial (struct target_ops *ops, enum target_object object,
negative values, but this capability isn't implemented here.) */
static int
-procfs_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite,
+procfs_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int dowrite,
struct mem_attrib *attrib, struct target_ops *target)
{
procinfo *pi;
@@ -4841,7 +4843,7 @@ procfs_kill_inferior (void)
*/
static void
-procfs_mourn_inferior (void)
+procfs_mourn_inferior (struct target_ops *ops)
{
procinfo *pi;
@@ -5110,8 +5112,8 @@ procfs_set_exec_trap (void)
*/
static void
-procfs_create_inferior (char *exec_file, char *allargs, char **env,
- int from_tty)
+procfs_create_inferior (struct target_ops *ops, char *exec_file,
+ char *allargs, char **env, int from_tty)
{
char *shell_file = getenv ("SHELL");
char *tryname;
@@ -5780,23 +5782,28 @@ mappingflags (long flags)
static int
info_mappings_callback (struct prmap *map, int (*ignore) (), void *unused)
{
- char *data_fmt_string;
+ unsigned int pr_off;
- if (gdbarch_addr_bit (current_gdbarch) == 32)
- data_fmt_string = "\t%#10lx %#10lx %#10x %#10x %7s\n";
- else
- data_fmt_string = " %#18lx %#18lx %#10x %#10x %7s\n";
-
- printf_filtered (data_fmt_string,
- (unsigned long) map->pr_vaddr,
- (unsigned long) map->pr_vaddr + map->pr_size - 1,
- map->pr_size,
#ifdef PCAGENT /* Horrible hack: only defined on Solaris 2.6+ */
- (unsigned int) map->pr_offset,
+ pr_off = (unsigned int) map->pr_offset;
#else
- map->pr_off,
+ pr_off = map->pr_off;
#endif
- mappingflags (map->pr_mflags));
+
+ if (gdbarch_addr_bit (current_gdbarch) == 32)
+ printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n",
+ (unsigned long) map->pr_vaddr,
+ (unsigned long) map->pr_vaddr + map->pr_size - 1,
+ map->pr_size,
+ pr_off,
+ mappingflags (map->pr_mflags));
+ else
+ printf_filtered (" %#18lx %#18lx %#10x %#10x %7s\n",
+ (unsigned long) map->pr_vaddr,
+ (unsigned long) map->pr_vaddr + map->pr_size - 1,
+ map->pr_size,
+ pr_off,
+ mappingflags (map->pr_mflags));
return 0;
}
@@ -5810,23 +5817,24 @@ info_mappings_callback (struct prmap *map, int (*ignore) (), void *unused)
static void
info_proc_mappings (procinfo *pi, int summary)
{
- char *header_fmt_string;
-
- if (gdbarch_ptr_bit (current_gdbarch) == 32)
- header_fmt_string = "\t%10s %10s %10s %10s %7s\n";
- else
- header_fmt_string = " %18s %18s %10s %10s %7s\n";
-
if (summary)
return; /* No output for summary mode. */
printf_filtered (_("Mapped address spaces:\n\n"));
- printf_filtered (header_fmt_string,
- "Start Addr",
- " End Addr",
- " Size",
- " Offset",
- "Flags");
+ if (gdbarch_ptr_bit (current_gdbarch) == 32)
+ printf_filtered ("\t%10s %10s %10s %10s %7s\n",
+ "Start Addr",
+ " End Addr",
+ " Size",
+ " Offset",
+ "Flags");
+ else
+ printf_filtered (" %18s %18s %10s %10s %7s\n",
+ "Start Addr",
+ " End Addr",
+ " Size",
+ " Offset",
+ "Flags");
iterate_over_mappings (pi, NULL, NULL, info_mappings_callback);
printf_filtered ("\n");
@@ -5853,10 +5861,8 @@ info_proc_cmd (char *args, int from_tty)
old_chain = make_cleanup (null_cleanup, 0);
if (args)
{
- if ((argv = buildargv (args)) == NULL)
- nomem (0);
- else
- make_cleanup_freeargv (argv);
+ argv = gdb_buildargv (args);
+ make_cleanup_freeargv (argv);
}
while (argv != NULL && *argv != NULL)
{
@@ -6152,7 +6158,7 @@ procfs_make_note_section (bfd *obfd, int *note_size)
char *note_data = NULL;
char *inf_args;
struct procfs_corefile_thread_data thread_args;
- char *auxv;
+ gdb_byte *auxv;
int auxv_len;
if (get_exec_file (0))
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index f850448..72f7a5f 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -43,11 +43,18 @@ typedef Py_intptr_t Py_ssize_t;
#error "Unable to find usable Python.h"
#endif
-struct block;
-struct symbol;
-struct symtab_and_line;
+struct value;
extern PyObject *gdb_module;
+extern PyTypeObject value_object_type;
+
+PyObject *gdbpy_get_value_from_history (PyObject *self, PyObject *args);
+
+PyObject *value_to_value_object (struct value *v);
+
+struct value *convert_value_from_python (PyObject *obj);
+
+void gdbpy_initialize_values (void);
struct cleanup *make_cleanup_py_decref (PyObject *py);
diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c
new file mode 100644
index 0000000..8bf4ec8
--- /dev/null
+++ b/gdb/python/python-value.c
@@ -0,0 +1,680 @@
+/* Python interface to values.
+
+ Copyright (C) 2008 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "defs.h"
+#include "charset.h"
+#include "value.h"
+#include "exceptions.h"
+#include "language.h"
+#include "dfp.h"
+#include "valprint.h"
+
+/* List of all values which are currently exposed to Python. It is
+ maintained so that when an objfile is discarded, preserve_values
+ can copy the values' types if needed. This is declared
+ unconditionally to reduce the number of uses of HAVE_PYTHON in the
+ generic code. */
+struct value *values_in_python;
+
+#ifdef HAVE_PYTHON
+
+#include "python-internal.h"
+
+/* Even though Python scalar types directly map to host types, we use
+ target types here to remain consistent with the the values system in
+ GDB (which uses target arithmetic). */
+
+/* Python's integer type corresponds to C's long type. */
+#define builtin_type_pyint builtin_type (current_gdbarch)->builtin_long
+
+/* Python's float type corresponds to C's double type. */
+#define builtin_type_pyfloat builtin_type (current_gdbarch)->builtin_double
+
+/* Python's long type corresponds to C's long long type. */
+#define builtin_type_pylong builtin_type (current_gdbarch)->builtin_long_long
+
+#define builtin_type_pybool \
+ language_bool_type (current_language, current_gdbarch)
+
+typedef struct {
+ PyObject_HEAD
+ struct value *value;
+ int owned_by_gdb;
+} value_object;
+
+/* Called by the Python interpreter when deallocating a value object. */
+static void
+valpy_dealloc (PyObject *obj)
+{
+ value_object *self = (value_object *) obj;
+
+ value_remove_from_list (&values_in_python, self->value);
+
+ if (!self->owned_by_gdb)
+ value_free (self->value);
+ self->ob_type->tp_free (self);
+}
+
+/* Called when a new gdb.Value object needs to be allocated. */
+static PyObject *
+valpy_new (PyTypeObject *subtype, PyObject *args, PyObject *keywords)
+{
+ struct value *value = NULL; /* Initialize to appease gcc warning. */
+ value_object *value_obj;
+ volatile struct gdb_exception except;
+
+ if (PyTuple_Size (args) != 1)
+ {
+ PyErr_SetString (PyExc_TypeError, _("Value object creation takes only "
+ "1 argument"));
+ return NULL;
+ }
+
+ value_obj = (value_object *) subtype->tp_alloc (subtype, 1);
+ if (value_obj == NULL)
+ {
+ PyErr_SetString (PyExc_MemoryError, _("Could not allocate memory to "
+ "create Value object."));
+ return NULL;
+ }
+
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ {
+ value = convert_value_from_python (PyTuple_GetItem (args, 0));
+ }
+ if (except.reason < 0)
+ {
+ subtype->tp_free (value_obj);
+ return PyErr_Format (except.reason == RETURN_QUIT
+ ? PyExc_KeyboardInterrupt : PyExc_TypeError,
+ "%s", except.message);
+ }
+
+ value_obj->value = value;
+ value_obj->owned_by_gdb = 0;
+ release_value (value);
+ value_prepend_to_list (&values_in_python, value);
+
+ return (PyObject *) value_obj;
+}
+
+/* Given a value of a pointer type, apply the C unary * operator to it. */
+static PyObject *
+valpy_dereference (PyObject *self, PyObject *args)
+{
+ struct value *res_val = NULL; /* Initialize to appease gcc warning. */
+ volatile struct gdb_exception except;
+
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ {
+ res_val = value_ind (((value_object *) self)->value);
+ }
+ GDB_PY_HANDLE_EXCEPTION (except);
+
+ return value_to_value_object (res_val);
+}
+
+#ifdef HAVE_LIBPYTHON2_4
+static int
+#else
+static Py_ssize_t
+#endif
+valpy_length (PyObject *self)
+{
+ /* We don't support getting the number of elements in a struct / class. */
+ PyErr_SetString (PyExc_NotImplementedError,
+ "Invalid operation on gdb.Value.");
+ return -1;
+}
+
+/* Given string name of an element inside structure, return its value
+ object. */
+static PyObject *
+valpy_getitem (PyObject *self, PyObject *key)
+{
+ value_object *self_value = (value_object *) self;
+ char *field;
+ struct value *res_val = NULL; /* Initialize to appease gcc warning. */
+ struct cleanup *old;
+ volatile struct gdb_exception except;
+
+ field = python_string_to_target_string (key);
+ if (field == NULL)
+ return NULL;
+
+ old = make_cleanup (xfree, field);
+
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ {
+ struct value *tmp = self_value->value;
+ res_val = value_struct_elt (&tmp, NULL, field, 0, NULL);
+ }
+ GDB_PY_HANDLE_EXCEPTION (except);
+
+ do_cleanups (old);
+
+ return value_to_value_object (res_val);
+}
+
+static int
+valpy_setitem (PyObject *self, PyObject *key, PyObject *value)
+{
+ PyErr_Format (PyExc_NotImplementedError,
+ _("Setting of struct elements is not currently supported."));
+ return -1;
+}
+
+/* Called by the Python interpreter to obtain string representation
+ of the object. */
+static PyObject *
+valpy_str (PyObject *self)
+{
+ char *s = NULL;
+ long dummy;
+ struct ui_file *stb;
+ struct cleanup *old_chain;
+ PyObject *result;
+ struct value_print_options opts;
+ volatile struct gdb_exception except;
+
+ get_user_print_options (&opts);
+ opts.deref_ref = 0;
+
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
+
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ {
+ common_val_print (((value_object *) self)->value, stb, 0,
+ &opts, current_language);
+ s = ui_file_xstrdup (stb, &dummy);
+ }
+ GDB_PY_HANDLE_EXCEPTION (except);
+
+ do_cleanups (old_chain);
+
+ result = PyUnicode_Decode (s, strlen (s), host_charset (), NULL);
+ xfree (s);
+
+ return result;
+}
+
+enum valpy_opcode
+{
+ VALPY_ADD,
+ VALPY_SUB,
+ VALPY_MUL,
+ VALPY_DIV,
+ VALPY_REM,
+ VALPY_POW
+};
+
+/* If TYPE is a reference, return the target; otherwise return TYPE. */
+#define STRIP_REFERENCE(TYPE) \
+ ((TYPE_CODE (TYPE) == TYPE_CODE_REF) ? (TYPE_TARGET_TYPE (TYPE)) : (TYPE))
+
+/* Returns a value object which is the result of applying the operation
+ specified by OPCODE to the given arguments. */
+static PyObject *
+valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other)
+{
+ struct value *res_val = NULL; /* Initialize to appease gcc warning. */
+ volatile struct gdb_exception except;
+
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ {
+ struct value *arg1, *arg2;
+
+ /* If the gdb.Value object is the second operand, then it will be passed
+ to us as the OTHER argument, and SELF will be an entirely different
+ kind of object, altogether. Because of this, we can't assume self is
+ a gdb.Value object and need to convert it from python as well. */
+ arg1 = convert_value_from_python (self);
+ arg2 = convert_value_from_python (other);
+
+ switch (opcode)
+ {
+ case VALPY_ADD:
+ {
+ struct type *ltype = value_type (arg1);
+ struct type *rtype = value_type (arg2);
+
+ CHECK_TYPEDEF (ltype);
+ ltype = STRIP_REFERENCE (ltype);
+ CHECK_TYPEDEF (rtype);
+ rtype = STRIP_REFERENCE (rtype);
+
+ if (TYPE_CODE (ltype) == TYPE_CODE_PTR)
+ res_val = value_ptradd (arg1, arg2);
+ else if (TYPE_CODE (rtype) == TYPE_CODE_PTR)
+ res_val = value_ptradd (arg2, arg1);
+ else
+ res_val = value_binop (arg1, arg2, BINOP_ADD);
+ }
+ break;
+ case VALPY_SUB:
+ {
+ struct type *ltype = value_type (arg1);
+ struct type *rtype = value_type (arg2);
+
+ CHECK_TYPEDEF (ltype);
+ ltype = STRIP_REFERENCE (ltype);
+ CHECK_TYPEDEF (rtype);
+ rtype = STRIP_REFERENCE (rtype);
+
+ if (TYPE_CODE (ltype) == TYPE_CODE_PTR)
+ {
+ if (TYPE_CODE (rtype) == TYPE_CODE_PTR)
+ /* A ptrdiff_t for the target would be preferable
+ here. */
+ res_val = value_from_longest (builtin_type_pyint,
+ value_ptrdiff (arg1, arg2));
+ else
+ res_val = value_ptrsub (arg1, arg2);
+ }
+ else
+ res_val = value_binop (arg1, arg2, BINOP_SUB);
+ }
+ break;
+ case VALPY_MUL:
+ res_val = value_binop (arg1, arg2, BINOP_MUL);
+ break;
+ case VALPY_DIV:
+ res_val = value_binop (arg1, arg2, BINOP_DIV);
+ break;
+ case VALPY_REM:
+ res_val = value_binop (arg1, arg2, BINOP_REM);
+ break;
+ case VALPY_POW:
+ res_val = value_binop (arg1, arg2, BINOP_EXP);
+ break;
+ }
+ }
+ GDB_PY_HANDLE_EXCEPTION (except);
+
+ return value_to_value_object (res_val);
+}
+
+static PyObject *
+valpy_add (PyObject *self, PyObject *other)
+{
+ return valpy_binop (VALPY_ADD, self, other);
+}
+
+static PyObject *
+valpy_subtract (PyObject *self, PyObject *other)
+{
+ return valpy_binop (VALPY_SUB, self, other);
+}
+
+static PyObject *
+valpy_multiply (PyObject *self, PyObject *other)
+{
+ return valpy_binop (VALPY_MUL, self, other);
+}
+
+static PyObject *
+valpy_divide (PyObject *self, PyObject *other)
+{
+ return valpy_binop (VALPY_DIV, self, other);
+}
+
+static PyObject *
+valpy_remainder (PyObject *self, PyObject *other)
+{
+ return valpy_binop (VALPY_REM, self, other);
+}
+
+static PyObject *
+valpy_power (PyObject *self, PyObject *other, PyObject *unused)
+{
+ /* We don't support the ternary form of pow. I don't know how to express
+ that, so let's just throw NotImplementedError to at least do something
+ about it. */
+ if (unused != Py_None)
+ {
+ PyErr_SetString (PyExc_NotImplementedError,
+ "Invalid operation on gdb.Value.");
+ return NULL;
+ }
+
+ return valpy_binop (VALPY_POW, self, other);
+}
+
+static PyObject *
+valpy_negative (PyObject *self)
+{
+ struct value *val = NULL;
+ volatile struct gdb_exception except;
+
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ {
+ val = value_neg (((value_object *) self)->value);
+ }
+ GDB_PY_HANDLE_EXCEPTION (except);
+
+ return value_to_value_object (val);
+}
+
+static PyObject *
+valpy_positive (PyObject *self)
+{
+ struct value *copy = value_copy (((value_object *) self)->value);
+
+ return value_to_value_object (copy);
+}
+
+static PyObject *
+valpy_absolute (PyObject *self)
+{
+ if (value_less (((value_object *) self)->value,
+ value_from_longest (builtin_type_int8, 0)))
+ return valpy_negative (self);
+ else
+ return valpy_positive (self);
+}
+
+/* Implements boolean evaluation of gdb.Value. */
+static int
+valpy_nonzero (PyObject *self)
+{
+ value_object *self_value = (value_object *) self;
+ struct type *type;
+
+ type = check_typedef (value_type (self_value->value));
+
+ if (is_integral_type (type) || TYPE_CODE (type) == TYPE_CODE_PTR)
+ return !!value_as_long (self_value->value);
+ else if (TYPE_CODE (type) == TYPE_CODE_FLT)
+ return value_as_double (self_value->value) != 0;
+ else if (TYPE_CODE (type) == TYPE_CODE_DECFLOAT)
+ return !decimal_is_zero (value_contents (self_value->value),
+ TYPE_LENGTH (type));
+ else
+ {
+ PyErr_SetString (PyExc_TypeError, _("Attempted truth testing on invalid "
+ "gdb.Value type."));
+ return 0;
+ }
+}
+
+/* Implements comparison operations for value objects. */
+static PyObject *
+valpy_richcompare (PyObject *self, PyObject *other, int op)
+{
+ int result = 0;
+ struct value *value_self, *value_other;
+ volatile struct gdb_exception except;
+
+ if (PyObject_TypeCheck (other, &value_object_type))
+ value_other = ((value_object *) other)->value;
+ else if (PyInt_Check (other))
+ {
+ LONGEST l;
+
+ l = PyInt_AsLong (other);
+ if (PyErr_Occurred ())
+ return NULL;
+
+ value_other = value_from_longest (builtin_type_pyint, l);
+ }
+ else if (PyFloat_Check (other))
+ {
+ DOUBLEST d;
+
+ d = PyFloat_AsDouble (other);
+ if (PyErr_Occurred ())
+ return NULL;
+
+ value_other = value_from_double (builtin_type_pyfloat, d);
+ }
+ else if (PyString_Check (other) || PyUnicode_Check (other))
+ {
+ char *str;
+
+ str = python_string_to_target_string (other);
+ value_other = value_from_string (str);
+ xfree (str);
+ }
+ else if (other == Py_None)
+ /* Comparing with None is special. From what I can tell, in Python
+ None is smaller than anything else. */
+ switch (op) {
+ case Py_LT:
+ case Py_LE:
+ case Py_EQ:
+ Py_RETURN_FALSE;
+ case Py_NE:
+ case Py_GT:
+ case Py_GE:
+ Py_RETURN_TRUE;
+ default:
+ /* Can't happen. */
+ PyErr_SetString (PyExc_NotImplementedError,
+ "Invalid operation on gdb.Value.");
+ return NULL;
+ }
+ else
+ {
+ PyErr_SetString (PyExc_NotImplementedError,
+ "Operation not supported on gdb.Value of this type.");
+ return NULL;
+ }
+
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ {
+ switch (op) {
+ case Py_LT:
+ result = value_less (((value_object *) self)->value, value_other);
+ break;
+ case Py_LE:
+ result = value_less (((value_object *) self)->value, value_other)
+ || value_equal (((value_object *) self)->value, value_other);
+ break;
+ case Py_EQ:
+ result = value_equal (((value_object *) self)->value, value_other);
+ break;
+ case Py_NE:
+ result = !value_equal (((value_object *) self)->value, value_other);
+ break;
+ case Py_GT:
+ result = value_less (value_other, ((value_object *) self)->value);
+ break;
+ case Py_GE:
+ result = value_less (value_other, ((value_object *) self)->value)
+ || value_equal (((value_object *) self)->value, value_other);
+ break;
+ default:
+ /* Can't happen. */
+ PyErr_SetString (PyExc_NotImplementedError,
+ "Invalid operation on gdb.Value.");
+ return NULL;
+ }
+ }
+ GDB_PY_HANDLE_EXCEPTION (except);
+
+ if (result == 1)
+ Py_RETURN_TRUE;
+
+ Py_RETURN_FALSE;
+}
+
+/* Returns an object for a value which is released from the all_values chain,
+ so its lifetime is not bound to the execution of a command. */
+PyObject *
+value_to_value_object (struct value *val)
+{
+ value_object *val_obj;
+
+ val_obj = PyObject_New (value_object, &value_object_type);
+ if (val_obj != NULL)
+ {
+ val_obj->value = val;
+ val_obj->owned_by_gdb = 0;
+ release_value (val);
+ value_prepend_to_list (&values_in_python, val);
+ }
+
+ return (PyObject *) val_obj;
+}
+
+/* Try to convert a Python value to a gdb value. If the value cannot
+ be converted, throw a gdb exception. */
+
+struct value *
+convert_value_from_python (PyObject *obj)
+{
+ struct value *value = NULL; /* -Wall */
+ PyObject *target_str, *unicode_str;
+ struct cleanup *old;
+
+ if (! obj)
+ error (_("Internal error while converting Python value."));
+
+ if (PyBool_Check (obj))
+ value = value_from_longest (builtin_type_pybool, obj == Py_True);
+ else if (PyInt_Check (obj))
+ value = value_from_longest (builtin_type_pyint, PyInt_AsLong (obj));
+ else if (PyLong_Check (obj))
+ {
+ LONGEST l = PyLong_AsLongLong (obj);
+ if (! PyErr_Occurred ())
+ value = value_from_longest (builtin_type_pylong, l);
+ }
+ else if (PyFloat_Check (obj))
+ {
+ double d = PyFloat_AsDouble (obj);
+ if (! PyErr_Occurred ())
+ value = value_from_double (builtin_type_pyfloat, d);
+ }
+ else if (PyString_Check (obj) || PyUnicode_Check (obj))
+ {
+ char *s;
+
+ s = python_string_to_target_string (obj);
+ if (s == NULL)
+ return NULL;
+
+ old = make_cleanup (xfree, s);
+ value = value_from_string (s);
+ do_cleanups (old);
+ }
+ else if (PyObject_TypeCheck (obj, &value_object_type))
+ value = ((value_object *) obj)->value;
+ else
+ error (_("Could not convert Python object: %s"),
+ PyString_AsString (PyObject_Str (obj)));
+
+ if (PyErr_Occurred ())
+ error (_("Error converting Python value."));
+
+ return value;
+}
+
+/* Returns value object in the ARGth position in GDB's history. */
+PyObject *
+gdbpy_get_value_from_history (PyObject *self, PyObject *args)
+{
+ int i;
+ struct value *res_val = NULL; /* Initialize to appease gcc warning. */
+ volatile struct gdb_exception except;
+
+ if (!PyArg_ParseTuple (args, "i", &i))
+ return NULL;
+
+ TRY_CATCH (except, RETURN_MASK_ALL)
+ {
+ res_val = access_value_history (i);
+ }
+ GDB_PY_HANDLE_EXCEPTION (except);
+
+ return value_to_value_object (res_val);
+}
+
+void
+gdbpy_initialize_values (void)
+{
+ value_object_type.tp_new = valpy_new;
+ if (PyType_Ready (&value_object_type) < 0)
+ return;
+
+ Py_INCREF (&value_object_type);
+ PyModule_AddObject (gdb_module, "Value", (PyObject *) &value_object_type);
+
+ values_in_python = NULL;
+}
+
+static PyMethodDef value_object_methods[] = {
+ { "dereference", valpy_dereference, METH_NOARGS, "Dereferences the value." },
+ {NULL} /* Sentinel */
+};
+
+static PyNumberMethods value_object_as_number = {
+ valpy_add,
+ valpy_subtract,
+ valpy_multiply,
+ valpy_divide,
+ valpy_remainder,
+ NULL, /* nb_divmod */
+ valpy_power, /* nb_power */
+ valpy_negative, /* nb_negative */
+ valpy_positive, /* nb_positive */
+ valpy_absolute, /* nb_absolute */
+ valpy_nonzero /* nb_nonzero */
+};
+
+static PyMappingMethods value_object_as_mapping = {
+ valpy_length,
+ valpy_getitem,
+ valpy_setitem
+};
+
+PyTypeObject value_object_type = {
+ PyObject_HEAD_INIT (NULL)
+ 0, /*ob_size*/
+ "gdb.Value", /*tp_name*/
+ sizeof (value_object), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ valpy_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ 0, /*tp_compare*/
+ 0, /*tp_repr*/
+ &value_object_as_number, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ &value_object_as_mapping, /*tp_as_mapping*/
+ 0, /*tp_hash */
+ 0, /*tp_call*/
+ valpy_str, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES, /*tp_flags*/
+ "GDB value object", /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ valpy_richcompare, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ value_object_methods /* tp_methods */
+};
+
+#endif /* HAVE_PYTHON */
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 8bc24c2..77d8774 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -52,6 +52,8 @@ static PyObject *gdbpy_flush (PyObject *, PyObject *);
static PyMethodDef GdbMethods[] =
{
+ { "get_value_from_history", gdbpy_get_value_from_history, METH_VARARGS,
+ "Get a value from history" },
{ "execute", execute_gdb_command, METH_VARARGS,
"Execute a gdb command" },
{ "get_parameter", get_parameter, METH_VARARGS,
@@ -398,6 +400,8 @@ Enables or disables printing of Python stack traces."),
PyModule_AddStringConstant (gdb_module, "HOST_CONFIG", (char*) host_name);
PyModule_AddStringConstant (gdb_module, "TARGET_CONFIG", (char*) target_name);
+ gdbpy_initialize_values ();
+
PyRun_SimpleString ("import gdb");
/* Create a couple objects which are used for Python's stdout and
diff --git a/gdb/python/python.h b/gdb/python/python.h
index 00ff159..102fef6 100644
--- a/gdb/python/python.h
+++ b/gdb/python/python.h
@@ -22,6 +22,8 @@
#include "value.h"
+extern struct value *values_in_python;
+
void eval_python_from_control_command (struct command_line *);
#endif /* GDB_PYTHON_H */
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 616a6f7..74ca6f0 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1104,11 +1104,13 @@ regcache_print (char *args, enum regcache_dump_what what_to_dump)
regcache_dump (get_current_regcache (), gdb_stdout, what_to_dump);
else
{
+ struct cleanup *cleanups;
struct ui_file *file = gdb_fopen (args, "w");
if (file == NULL)
perror_with_name (_("maintenance print architecture"));
+ cleanups = make_cleanup_ui_file_delete (file);
regcache_dump (get_current_regcache (), file, what_to_dump);
- ui_file_delete (file);
+ do_cleanups (cleanups);
}
}
diff --git a/gdb/regformats/reg-sparc64.dat b/gdb/regformats/reg-sparc64.dat
new file mode 100644
index 0000000..58d990f
--- /dev/null
+++ b/gdb/regformats/reg-sparc64.dat
@@ -0,0 +1,91 @@
+name:sparc64
+expedite:sp,fp,pc,npc,o7
+64:g0
+64:g1
+64:g2
+64:g3
+64:g4
+64:g5
+64:g6
+64:g7
+64:o0
+64:o1
+64:o2
+64:o3
+64:o4
+64:o5
+64:sp
+64:o7
+64:l0
+64:l1
+64:l2
+64:l3
+64:l4
+64:l5
+64:l6
+64:l7
+64:i0
+64:i1
+64:i2
+64:i3
+64:i4
+64:i5
+64:fp
+64:i7
+
+32:f0
+32:f1
+32:f2
+32:f3
+32:f4
+32:f5
+32:f6
+32:f7
+32:f8
+32:f9
+32:f10
+32:f11
+32:f12
+32:f13
+32:f14
+32:f15
+32:f16
+32:f17
+32:f18
+32:f19
+32:f20
+32:f21
+32:f22
+32:f23
+32:f24
+32:f25
+32:f26
+32:f27
+32:f28
+32:f29
+32:f30
+32:f31
+
+64:f32
+64:f34
+64:f36
+64:f38
+64:f40
+64:f42
+64:f44
+64:f46
+64:f48
+64:f50
+64:f52
+64:f54
+64:f56
+64:f58
+64:f60
+64:f62
+
+64:pc
+64:npc
+64:state
+64:fsr
+64:fprs
+64:y
diff --git a/gdb/regformats/reg-xtensa.dat b/gdb/regformats/reg-xtensa.dat
index e5a8b69..c0c1a39 100644
--- a/gdb/regformats/reg-xtensa.dat
+++ b/gdb/regformats/reg-xtensa.dat
@@ -33,38 +33,6 @@ expedite:pc,windowbase,windowstart
32:ar29
32:ar30
32:ar31
-32:ar32
-32:ar33
-32:ar34
-32:ar35
-32:ar36
-32:ar37
-32:ar38
-32:ar39
-32:ar40
-32:ar41
-32:ar42
-32:ar43
-32:ar44
-32:ar45
-32:ar46
-32:ar47
-32:ar48
-32:ar49
-32:ar50
-32:ar51
-32:ar52
-32:ar53
-32:ar54
-32:ar55
-32:ar56
-32:ar57
-32:ar58
-32:ar59
-32:ar60
-32:ar61
-32:ar62
-32:ar63
32:lbeg
32:lend
32:lcount
@@ -75,3 +43,5 @@ expedite:pc,windowbase,windowstart
32:sr176
32:sr208
32:ps
+32:threadptr
+32:scompare1
diff --git a/gdb/regformats/rs6000/powerpc-isa205-32l.dat b/gdb/regformats/rs6000/powerpc-isa205-32l.dat
new file mode 100644
index 0000000..d72ccd7
--- /dev/null
+++ b/gdb/regformats/rs6000/powerpc-isa205-32l.dat
@@ -0,0 +1,77 @@
+# DO NOT EDIT: generated from rs6000/powerpc-isa205-32l.xml
+name:powerpc_isa205_32l
+xmltarget:powerpc-isa205-32l.xml
+expedite:r1,pc
+32:r0
+32:r1
+32:r2
+32:r3
+32:r4
+32:r5
+32:r6
+32:r7
+32:r8
+32:r9
+32:r10
+32:r11
+32:r12
+32:r13
+32:r14
+32:r15
+32:r16
+32:r17
+32:r18
+32:r19
+32:r20
+32:r21
+32:r22
+32:r23
+32:r24
+32:r25
+32:r26
+32:r27
+32:r28
+32:r29
+32:r30
+32:r31
+64:f0
+64:f1
+64:f2
+64:f3
+64:f4
+64:f5
+64:f6
+64:f7
+64:f8
+64:f9
+64:f10
+64:f11
+64:f12
+64:f13
+64:f14
+64:f15
+64:f16
+64:f17
+64:f18
+64:f19
+64:f20
+64:f21
+64:f22
+64:f23
+64:f24
+64:f25
+64:f26
+64:f27
+64:f28
+64:f29
+64:f30
+64:f31
+32:pc
+32:msr
+32:cr
+32:lr
+32:ctr
+32:xer
+64:fpscr
+32:orig_r3
+32:trap
diff --git a/gdb/regformats/rs6000/powerpc-isa205-64l.dat b/gdb/regformats/rs6000/powerpc-isa205-64l.dat
new file mode 100644
index 0000000..5e4d694
--- /dev/null
+++ b/gdb/regformats/rs6000/powerpc-isa205-64l.dat
@@ -0,0 +1,77 @@
+# DO NOT EDIT: generated from rs6000/powerpc-isa205-64l.xml
+name:powerpc_isa205_64l
+xmltarget:powerpc-isa205-64l.xml
+expedite:r1,pc
+64:r0
+64:r1
+64:r2
+64:r3
+64:r4
+64:r5
+64:r6
+64:r7
+64:r8
+64:r9
+64:r10
+64:r11
+64:r12
+64:r13
+64:r14
+64:r15
+64:r16
+64:r17
+64:r18
+64:r19
+64:r20
+64:r21
+64:r22
+64:r23
+64:r24
+64:r25
+64:r26
+64:r27
+64:r28
+64:r29
+64:r30
+64:r31
+64:f0
+64:f1
+64:f2
+64:f3
+64:f4
+64:f5
+64:f6
+64:f7
+64:f8
+64:f9
+64:f10
+64:f11
+64:f12
+64:f13
+64:f14
+64:f15
+64:f16
+64:f17
+64:f18
+64:f19
+64:f20
+64:f21
+64:f22
+64:f23
+64:f24
+64:f25
+64:f26
+64:f27
+64:f28
+64:f29
+64:f30
+64:f31
+64:pc
+64:msr
+32:cr
+64:lr
+64:ctr
+32:xer
+64:fpscr
+64:orig_r3
+64:trap
diff --git a/gdb/regformats/rs6000/powerpc-isa205-altivec32l.dat b/gdb/regformats/rs6000/powerpc-isa205-altivec32l.dat
new file mode 100644
index 0000000..4824756
--- /dev/null
+++ b/gdb/regformats/rs6000/powerpc-isa205-altivec32l.dat
@@ -0,0 +1,111 @@
+# DO NOT EDIT: generated from rs6000/powerpc-isa205-altivec32l.xml
+name:powerpc_isa205_altivec32l
+xmltarget:powerpc-isa205-altivec32l.xml
+expedite:r1,pc
+32:r0
+32:r1
+32:r2
+32:r3
+32:r4
+32:r5
+32:r6
+32:r7
+32:r8
+32:r9
+32:r10
+32:r11
+32:r12
+32:r13
+32:r14
+32:r15
+32:r16
+32:r17
+32:r18
+32:r19
+32:r20
+32:r21
+32:r22
+32:r23
+32:r24
+32:r25
+32:r26
+32:r27
+32:r28
+32:r29
+32:r30
+32:r31
+64:f0
+64:f1
+64:f2
+64:f3
+64:f4
+64:f5
+64:f6
+64:f7
+64:f8
+64:f9
+64:f10
+64:f11
+64:f12
+64:f13
+64:f14
+64:f15
+64:f16
+64:f17
+64:f18
+64:f19
+64:f20
+64:f21
+64:f22
+64:f23
+64:f24
+64:f25
+64:f26
+64:f27
+64:f28
+64:f29
+64:f30
+64:f31
+32:pc
+32:msr
+32:cr
+32:lr
+32:ctr
+32:xer
+64:fpscr
+32:orig_r3
+32:trap
+128:vr0
+128:vr1
+128:vr2
+128:vr3
+128:vr4
+128:vr5
+128:vr6
+128:vr7
+128:vr8
+128:vr9
+128:vr10
+128:vr11
+128:vr12
+128:vr13
+128:vr14
+128:vr15
+128:vr16
+128:vr17
+128:vr18
+128:vr19
+128:vr20
+128:vr21
+128:vr22
+128:vr23
+128:vr24
+128:vr25
+128:vr26
+128:vr27
+128:vr28
+128:vr29
+128:vr30
+128:vr31
+32:vscr
+32:vrsave
diff --git a/gdb/regformats/rs6000/powerpc-isa205-altivec64l.dat b/gdb/regformats/rs6000/powerpc-isa205-altivec64l.dat
new file mode 100644
index 0000000..964e953
--- /dev/null
+++ b/gdb/regformats/rs6000/powerpc-isa205-altivec64l.dat
@@ -0,0 +1,111 @@
+# DO NOT EDIT: generated from rs6000/powerpc-isa205-altivec64l.xml
+name:powerpc_isa205_altivec64l
+xmltarget:powerpc-isa205-altivec64l.xml
+expedite:r1,pc
+64:r0
+64:r1
+64:r2
+64:r3
+64:r4
+64:r5
+64:r6
+64:r7
+64:r8
+64:r9
+64:r10
+64:r11
+64:r12
+64:r13
+64:r14
+64:r15
+64:r16
+64:r17
+64:r18
+64:r19
+64:r20
+64:r21
+64:r22
+64:r23
+64:r24
+64:r25
+64:r26
+64:r27
+64:r28
+64:r29
+64:r30
+64:r31
+64:f0
+64:f1
+64:f2
+64:f3
+64:f4
+64:f5
+64:f6
+64:f7
+64:f8
+64:f9
+64:f10
+64:f11
+64:f12
+64:f13
+64:f14
+64:f15
+64:f16
+64:f17
+64:f18
+64:f19
+64:f20
+64:f21
+64:f22
+64:f23
+64:f24
+64:f25
+64:f26
+64:f27
+64:f28
+64:f29
+64:f30
+64:f31
+64:pc
+64:msr
+32:cr
+64:lr
+64:ctr
+32:xer
+64:fpscr
+64:orig_r3
+64:trap
+128:vr0
+128:vr1
+128:vr2
+128:vr3
+128:vr4
+128:vr5
+128:vr6
+128:vr7
+128:vr8
+128:vr9
+128:vr10
+128:vr11
+128:vr12
+128:vr13
+128:vr14
+128:vr15
+128:vr16
+128:vr17
+128:vr18
+128:vr19
+128:vr20
+128:vr21
+128:vr22
+128:vr23
+128:vr24
+128:vr25
+128:vr26
+128:vr27
+128:vr28
+128:vr29
+128:vr30
+128:vr31
+32:vscr
+32:vrsave
diff --git a/gdb/regformats/rs6000/powerpc-isa205-vsx32l.dat b/gdb/regformats/rs6000/powerpc-isa205-vsx32l.dat
new file mode 100644
index 0000000..6c18ca3
--- /dev/null
+++ b/gdb/regformats/rs6000/powerpc-isa205-vsx32l.dat
@@ -0,0 +1,143 @@
+# DO NOT EDIT: generated from rs6000/powerpc-isa205-vsx32l.xml
+name:powerpc_isa205_vsx32l
+xmltarget:powerpc-isa205-vsx32l.xml
+expedite:r1,pc
+32:r0
+32:r1
+32:r2
+32:r3
+32:r4
+32:r5
+32:r6
+32:r7
+32:r8
+32:r9
+32:r10
+32:r11
+32:r12
+32:r13
+32:r14
+32:r15
+32:r16
+32:r17
+32:r18
+32:r19
+32:r20
+32:r21
+32:r22
+32:r23
+32:r24
+32:r25
+32:r26
+32:r27
+32:r28
+32:r29
+32:r30
+32:r31
+64:f0
+64:f1
+64:f2
+64:f3
+64:f4
+64:f5
+64:f6
+64:f7
+64:f8
+64:f9
+64:f10
+64:f11
+64:f12
+64:f13
+64:f14
+64:f15
+64:f16
+64:f17
+64:f18
+64:f19
+64:f20
+64:f21
+64:f22
+64:f23
+64:f24
+64:f25
+64:f26
+64:f27
+64:f28
+64:f29
+64:f30
+64:f31
+32:pc
+32:msr
+32:cr
+32:lr
+32:ctr
+32:xer
+64:fpscr
+32:orig_r3
+32:trap
+128:vr0
+128:vr1
+128:vr2
+128:vr3
+128:vr4
+128:vr5
+128:vr6
+128:vr7
+128:vr8
+128:vr9
+128:vr10
+128:vr11
+128:vr12
+128:vr13
+128:vr14
+128:vr15
+128:vr16
+128:vr17
+128:vr18
+128:vr19
+128:vr20
+128:vr21
+128:vr22
+128:vr23
+128:vr24
+128:vr25
+128:vr26
+128:vr27
+128:vr28
+128:vr29
+128:vr30
+128:vr31
+32:vscr
+32:vrsave
+64:vs0h
+64:vs1h
+64:vs2h
+64:vs3h
+64:vs4h
+64:vs5h
+64:vs6h
+64:vs7h
+64:vs8h
+64:vs9h
+64:vs10h
+64:vs11h
+64:vs12h
+64:vs13h
+64:vs14h
+64:vs15h
+64:vs16h
+64:vs17h
+64:vs18h
+64:vs19h
+64:vs20h
+64:vs21h
+64:vs22h
+64:vs23h
+64:vs24h
+64:vs25h
+64:vs26h
+64:vs27h
+64:vs28h
+64:vs29h
+64:vs30h
+64:vs31h
diff --git a/gdb/regformats/rs6000/powerpc-isa205-vsx64l.dat b/gdb/regformats/rs6000/powerpc-isa205-vsx64l.dat
new file mode 100644
index 0000000..c9c1b8e
--- /dev/null
+++ b/gdb/regformats/rs6000/powerpc-isa205-vsx64l.dat
@@ -0,0 +1,143 @@
+# DO NOT EDIT: generated from rs6000/powerpc-isa205-vsx64l.xml
+name:powerpc_isa205_vsx64l
+xmltarget:powerpc-isa205-vsx64l.xml
+expedite:r1,pc
+64:r0
+64:r1
+64:r2
+64:r3
+64:r4
+64:r5
+64:r6
+64:r7
+64:r8
+64:r9
+64:r10
+64:r11
+64:r12
+64:r13
+64:r14
+64:r15
+64:r16
+64:r17
+64:r18
+64:r19
+64:r20
+64:r21
+64:r22
+64:r23
+64:r24
+64:r25
+64:r26
+64:r27
+64:r28
+64:r29
+64:r30
+64:r31
+64:f0
+64:f1
+64:f2
+64:f3
+64:f4
+64:f5
+64:f6
+64:f7
+64:f8
+64:f9
+64:f10
+64:f11
+64:f12
+64:f13
+64:f14
+64:f15
+64:f16
+64:f17
+64:f18
+64:f19
+64:f20
+64:f21
+64:f22
+64:f23
+64:f24
+64:f25
+64:f26
+64:f27
+64:f28
+64:f29
+64:f30
+64:f31
+64:pc
+64:msr
+32:cr
+64:lr
+64:ctr
+32:xer
+64:fpscr
+64:orig_r3
+64:trap
+128:vr0
+128:vr1
+128:vr2
+128:vr3
+128:vr4
+128:vr5
+128:vr6
+128:vr7
+128:vr8
+128:vr9
+128:vr10
+128:vr11
+128:vr12
+128:vr13
+128:vr14
+128:vr15
+128:vr16
+128:vr17
+128:vr18
+128:vr19
+128:vr20
+128:vr21
+128:vr22
+128:vr23
+128:vr24
+128:vr25
+128:vr26
+128:vr27
+128:vr28
+128:vr29
+128:vr30
+128:vr31
+32:vscr
+32:vrsave
+64:vs0h
+64:vs1h
+64:vs2h
+64:vs3h
+64:vs4h
+64:vs5h
+64:vs6h
+64:vs7h
+64:vs8h
+64:vs9h
+64:vs10h
+64:vs11h
+64:vs12h
+64:vs13h
+64:vs14h
+64:vs15h
+64:vs16h
+64:vs17h
+64:vs18h
+64:vs19h
+64:vs20h
+64:vs21h
+64:vs22h
+64:vs23h
+64:vs24h
+64:vs25h
+64:vs26h
+64:vs27h
+64:vs28h
+64:vs29h
+64:vs30h
+64:vs31h
diff --git a/gdb/reggroups.c b/gdb/reggroups.c
index ea2451e..a4e1d31 100644
--- a/gdb/reggroups.c
+++ b/gdb/reggroups.c
@@ -234,11 +234,13 @@ maintenance_print_reggroups (char *args, int from_tty)
reggroups_dump (current_gdbarch, gdb_stdout);
else
{
+ struct cleanup *cleanups;
struct ui_file *file = gdb_fopen (args, "w");
if (file == NULL)
perror_with_name (_("maintenance print reggroups"));
+ cleanups = make_cleanup_ui_file_delete (file);
reggroups_dump (current_gdbarch, file);
- ui_file_delete (file);
+ do_cleanups (cleanups);
}
}
diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c
index 5ac6e38..302e063 100644
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -316,7 +316,8 @@ check_mmu_status (void)
/* This is called not only when we first attach, but also when the
user types "run" after having attached. */
static void
-m32r_create_inferior (char *execfile, char *args, char **env, int from_tty)
+m32r_create_inferior (struct target_ops *ops, char *execfile,
+ char *args, char **env, int from_tty)
{
CORE_ADDR entry_pt;
@@ -872,7 +873,7 @@ m32r_wait (ptid_t ptid, struct target_waitstatus *status)
Use this when you want to detach and do something else
with your gdb. */
static void
-m32r_detach (char *args, int from_tty)
+m32r_detach (struct target_ops *ops, char *args, int from_tty)
{
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "m32r_detach(%d)\n", from_tty);
@@ -1147,7 +1148,7 @@ m32r_kill (void)
instructions. */
static void
-m32r_mourn_inferior (void)
+m32r_mourn_inferior (struct target_ops *ops)
{
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "m32r_mourn_inferior()\n");
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index bde8614..b4423d5 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -84,7 +84,7 @@ static void lsi_open (char *name, int from_tty);
static void mips_close (int quitting);
-static void mips_detach (char *args, int from_tty);
+static void mips_detach (struct target_ops *ops, char *args, int from_tty);
static void mips_resume (ptid_t ptid, int step,
enum target_signal siggnal);
@@ -1490,8 +1490,7 @@ device is attached to the target board (e.g., /dev/ttya).\n"
/* Parse the serial port name, the optional TFTP name, and the
optional local TFTP name. */
- if ((argv = buildargv (name)) == NULL)
- nomem (0);
+ argv = gdb_buildargv (name);
make_cleanup_freeargv (argv);
serial_port_name = xstrdup (argv[0]);
@@ -1653,7 +1652,7 @@ mips_close (int quitting)
/* Detach from the remote board. */
static void
-mips_detach (char *args, int from_tty)
+mips_detach (struct target_ops *ops, char *args, int from_tty)
{
if (args)
error ("Argument given to \"detach\" when remotely debugging.");
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index b337769..db26c93 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -84,7 +84,7 @@ static void gdbsim_open (char *args, int from_tty);
static void gdbsim_close (int quitting);
-static void gdbsim_detach (char *args, int from_tty);
+static void gdbsim_detach (struct target_ops *ops, char *args, int from_tty);
static void gdbsim_resume (ptid_t ptid, int step, enum target_signal siggnal);
@@ -94,7 +94,7 @@ static void gdbsim_prepare_to_store (struct regcache *regcache);
static void gdbsim_files_info (struct target_ops *target);
-static void gdbsim_mourn_inferior (void);
+static void gdbsim_mourn_inferior (struct target_ops *target);
static void gdbsim_stop (ptid_t ptid);
@@ -406,12 +406,13 @@ gdbsim_kill (void)
static void
gdbsim_load (char *args, int fromtty)
{
- char **argv = buildargv (args);
+ char **argv;
char *prog;
- if (argv == NULL)
- nomem (0);
+ if (args == NULL)
+ error_no_arg (_("program to load"));
+ argv = gdb_buildargv (args);
make_cleanup_freeargv (argv);
prog = tilde_expand (argv[0]);
@@ -444,7 +445,8 @@ gdbsim_load (char *args, int fromtty)
user types "run" after having attached. */
static void
-gdbsim_create_inferior (char *exec_file, char *args, char **env, int from_tty)
+gdbsim_create_inferior (struct target_ops *target, char *exec_file, char *args,
+ char **env, int from_tty)
{
int len;
char *arg_buf, **argv;
@@ -472,7 +474,7 @@ gdbsim_create_inferior (char *exec_file, char *args, char **env, int from_tty)
strcat (arg_buf, exec_file);
strcat (arg_buf, " ");
strcat (arg_buf, args);
- argv = buildargv (arg_buf);
+ argv = gdb_buildargv (arg_buf);
make_cleanup_freeargv (argv);
}
else
@@ -546,9 +548,7 @@ gdbsim_open (char *args, int from_tty)
strcat (arg_buf, " "); /* 1 */
strcat (arg_buf, args);
}
- argv = buildargv (arg_buf);
- if (argv == NULL)
- error (_("Insufficient memory available to allocate simulator arg list."));
+ argv = gdb_buildargv (arg_buf);
make_cleanup_freeargv (argv);
init_callbacks ();
@@ -605,7 +605,7 @@ gdbsim_close (int quitting)
Use this when you want to detach and do something else with your gdb. */
static void
-gdbsim_detach (char *args, int from_tty)
+gdbsim_detach (struct target_ops *ops, char *args, int from_tty)
{
if (remote_debug)
printf_filtered ("gdbsim_detach: args \"%s\"\n", args);
@@ -823,13 +823,13 @@ gdbsim_files_info (struct target_ops *target)
/* Clear the simulator's notion of what the break points are. */
static void
-gdbsim_mourn_inferior (void)
+gdbsim_mourn_inferior (struct target_ops *target)
{
if (remote_debug)
printf_filtered ("gdbsim_mourn_inferior:\n");
remove_breakpoints ();
- target_mark_exited (&gdbsim_ops);
+ target_mark_exited (target);
generic_mourn_inferior ();
delete_thread_silent (remote_sim_ptid);
}
diff --git a/gdb/remote.c b/gdb/remote.c
index 9dacd17..4580c77 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -79,6 +79,8 @@ enum { REMOTE_ALIGN_WRITES = 16 };
static void cleanup_sigint_signal_handler (void *dummy);
static void initialize_sigint_signal_handler (void);
static int getpkt_sane (char **buf, long *sizeof_buf, int forever);
+static int getpkt_or_notif_sane (char **buf, long *sizeof_buf,
+ int forever);
static void handle_remote_sigint (int);
static void handle_remote_sigint_twice (int);
@@ -103,11 +105,11 @@ static void remote_close (int quitting);
static void remote_store_registers (struct regcache *regcache, int regno);
-static void remote_mourn (void);
+static void remote_mourn (struct target_ops *ops);
static void extended_remote_restart (void);
-static void extended_remote_mourn (void);
+static void extended_remote_mourn (struct target_ops *);
static void remote_mourn_1 (struct target_ops *);
@@ -131,7 +133,7 @@ static void remote_async (void (*callback) (enum inferior_event_type event_type,
static int remote_async_mask (int new_mask);
-static void remote_detach (char *args, int from_tty);
+static void remote_detach (struct target_ops *ops, char *args, int from_tty);
static void remote_interrupt (int signo);
@@ -211,8 +213,32 @@ static void show_remote_protocol_packet_cmd (struct ui_file *file,
static char *write_ptid (char *buf, const char *endbuf, ptid_t ptid);
static ptid_t read_ptid (char *buf, char **obuf);
+static void remote_query_supported (void);
+
+static void remote_check_symbols (struct objfile *objfile);
+
void _initialize_remote (void);
+struct stop_reply;
+static struct stop_reply *stop_reply_xmalloc (void);
+static void stop_reply_xfree (struct stop_reply *);
+static void do_stop_reply_xfree (void *arg);
+static void remote_parse_stop_reply (char *buf, struct stop_reply *);
+static void push_stop_reply (struct stop_reply *);
+static void remote_get_pending_stop_replies (void);
+static void discard_pending_stop_replies (int pid);
+static int peek_stop_reply (ptid_t ptid);
+
+static void remote_async_inferior_event_handler (gdb_client_data);
+static void remote_async_get_pending_events_handler (gdb_client_data);
+
+static void remote_terminal_ours (void);
+
+/* The non-stop remote protocol provisions for one pending stop reply.
+ This is where we keep it until it is acknowledged. */
+
+static struct stop_reply *pending_stop_reply = NULL;
+
/* For "remote". */
static struct cmd_list_element *remote_cmdlist;
@@ -263,6 +289,20 @@ struct remote_state
/* True if the stub reported support for multi-process
extensions. */
int multi_process_aware;
+
+ /* True if we resumed the target and we're waiting for the target to
+ stop. In the mean time, we can't start another command/query.
+ The remote server wouldn't be ready to process it, so we'd
+ timeout waiting for a reply that would never come and eventually
+ we'd close the connection. This can happen in asynchronous mode
+ because we allow GDB commands while the target is running. */
+ int waiting_for_stop_reply;
+
+ /* True if the stub reports support for non-stop mode. */
+ int non_stop_aware;
+
+ /* True if the stub reports support for vCont;t. */
+ int support_vCont_t;
};
/* Returns true if the multi-process extensions are in effect. */
@@ -1061,6 +1101,18 @@ static struct async_signal_handler *sigint_remote_twice_token;
static struct async_signal_handler *sigint_remote_token;
+/* Asynchronous signal handle registered as event loop source for
+ when we have pending events ready to be passed to the core. */
+
+static struct async_event_handler *remote_async_inferior_event_token;
+
+/* Asynchronous signal handle registered as event loop source for when
+ the remote sent us a %Stop notification. The registered callback
+ will do a vStopped sequence to pull the rest of the events out of
+ the remote side into our event queue. */
+
+static struct async_event_handler *remote_async_get_pending_events_token;
+
static ptid_t magic_null_ptid;
static ptid_t not_sent_ptid;
@@ -1072,18 +1124,9 @@ static ptid_t any_thread_ptid;
static ptid_t general_thread;
static ptid_t continue_thread;
-
-/* Call this function as a result of
- 1) A halt indication (T packet) containing a thread id
- 2) A direct query of currthread
- 3) Successful execution of set thread
- */
-
static void
-record_currthread (ptid_t currthread)
+notice_new_inferiors (ptid_t currthread)
{
- general_thread = currthread;
-
/* If this is a new thread, add it to GDB's thread list.
If we leave it up to WFI to do this, bad things will happen. */
@@ -1119,15 +1162,34 @@ record_currthread (ptid_t currthread)
return;
}
+ /* When connecting to a target remote, or to a target
+ extended-remote which already was debugging an inferior, we
+ may not know about it yet. Add it before adding its child
+ thread, so notifications are emitted in a sensible order. */
+ if (!in_inferior_list (ptid_get_pid (currthread)))
+ add_inferior (ptid_get_pid (currthread));
+
/* This is really a new thread. Add it. */
add_thread (currthread);
}
+}
+
+/* Call this function as a result of
+ 1) A halt indication (T packet) containing a thread id
+ 2) A direct query of currthread
+ 3) Successful execution of set thread
+ */
+
+static void
+record_currthread (ptid_t currthread)
+{
+ general_thread = currthread;
+
+ if (ptid_equal (currthread, minus_one_ptid))
+ /* We're just invalidating the local thread mirror. */
+ return;
- if (!in_inferior_list (ptid_get_pid (currthread)))
- /* When connecting to a target remote, or to a target
- extended-remote which already was debugging an inferior, we may
- not know about it yet --- add it. */
- add_inferior (ptid_get_pid (currthread));
+ notice_new_inferiors (currthread);
}
static char *last_pass_packet;
@@ -1234,6 +1296,30 @@ set_continue_thread (struct ptid ptid)
set_thread (ptid, 0);
}
+/* Change the remote current process. Which thread within the process
+ ends up selected isn't important, as long as it is the same process
+ as what INFERIOR_PTID points to.
+
+ This comes from that fact that there is no explicit notion of
+ "selected process" in the protocol. The selected process for
+ general operations is the process the selected general thread
+ belongs to. */
+
+static void
+set_general_process (void)
+{
+ struct remote_state *rs = get_remote_state ();
+
+ /* If the remote can't handle multiple processes, don't bother. */
+ if (!remote_multi_process_p (rs))
+ return;
+
+ /* We only need to change the remote current thread if it's pointing
+ at some other process. */
+ if (ptid_get_pid (general_thread) != ptid_get_pid (inferior_ptid))
+ set_general_thread (inferior_ptid);
+}
+
/* Return nonzero if the thread PTID is still alive on the remote
system. */
@@ -1831,6 +1917,10 @@ remote_get_threadinfo (threadref *threadid, int fieldset, /* TAG mask */
pack_threadinfo_request (rs->buf, fieldset, threadid);
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
+
+ if (rs->buf[0] == '\0')
+ return 0;
+
result = remote_unpack_thread_info_response (rs->buf + 2,
threadid, info);
return result;
@@ -2058,16 +2148,26 @@ remote_threads_info (void)
{
new_thread = read_ptid (bufp, &bufp);
if (!ptid_equal (new_thread, null_ptid)
- && !in_thread_list (new_thread))
+ && (!in_thread_list (new_thread)
+ || is_exited (new_thread)))
{
+ /* When connected to a multi-process aware stub,
+ "info threads" may show up threads of
+ inferiors we didn't know about yet. Add them
+ now, and before adding any of its child
+ threads, so notifications are emitted in a
+ sensible order. */
if (!in_inferior_list (ptid_get_pid (new_thread)))
- /* When connected to a multi-process aware
- stub, "info threads" may show up threads of
- inferiors we didn't know about yet. Add
- them. */
add_inferior (ptid_get_pid (new_thread));
add_thread (new_thread);
+
+ /* In non-stop mode, we assume new found threads
+ are running until we proven otherwise with a
+ stop reply. In all-stop, we can only get
+ here if all threads are stopped. */
+ set_executing (new_thread, non_stop ? 1 : 0);
+ set_running (new_thread, non_stop ? 1 : 0);
}
}
while (*bufp++ == ','); /* comma-separated list */
@@ -2079,6 +2179,10 @@ remote_threads_info (void)
}
}
+ /* Only qfThreadInfo is supported in non-stop mode. */
+ if (non_stop)
+ return;
+
/* Else fall back to old method based on jmetzler protocol. */
use_threadinfo_query = 0;
remote_find_new_threads ();
@@ -2185,9 +2289,29 @@ extended_remote_restart (void)
static void
remote_close (int quitting)
{
- if (remote_desc)
- serial_close (remote_desc);
+ if (remote_desc == NULL)
+ return; /* already closed */
+
+ /* Make sure we leave stdin registered in the event loop, and we
+ don't leave the async SIGINT signal handler installed. */
+ remote_terminal_ours ();
+
+ serial_close (remote_desc);
remote_desc = NULL;
+
+ /* We don't have a connection to the remote stub anymore. Get rid
+ of all the inferiors and their threads we were controlling. */
+ discard_all_inferiors ();
+
+ /* We're no longer interested in any of these events. */
+ discard_pending_stop_replies (-1);
+
+ if (remote_async_inferior_event_token)
+ delete_async_event_handler (&remote_async_inferior_event_token);
+ if (remote_async_get_pending_events_token)
+ delete_async_event_handler (&remote_async_get_pending_events_token);
+
+ generic_mourn_inferior ();
}
/* Query the remote side for the text, data and bss offsets. */
@@ -2347,6 +2471,21 @@ get_offsets (void)
objfile_relocate (symfile_objfile, offs);
}
+/* Callback for iterate_over_threads. Set the STOP_REQUESTED flags in
+ threads we know are stopped already. This is used during the
+ initial remote connection in non-stop mode --- threads that are
+ reported as already being stopped are left stopped. */
+
+static int
+set_stop_requested_callback (struct thread_info *thread, void *data)
+{
+ /* If we have a stop reply for this thread, it must be stopped. */
+ if (peek_stop_reply (thread->ptid))
+ set_stop_requested (thread->ptid, 1);
+
+ return 0;
+}
+
/* Stub for catch_exception. */
struct start_remote_args
@@ -2363,70 +2502,231 @@ struct start_remote_args
static void
remote_start_remote (struct ui_out *uiout, void *opaque)
{
- struct remote_state *rs = get_remote_state ();
struct start_remote_args *args = opaque;
+ struct remote_state *rs = get_remote_state ();
+ struct packet_config *noack_config;
char *wait_status = NULL;
immediate_quit++; /* Allow user to interrupt it. */
+ /* Ack any packet which the remote side has already sent. */
+ serial_write (remote_desc, "+", 1);
+
+ /* The first packet we send to the target is the optional "supported
+ packets" request. If the target can answer this, it will tell us
+ which later probes to skip. */
+ remote_query_supported ();
+
+ /* Next, we possibly activate noack mode.
+
+ If the QStartNoAckMode packet configuration is set to AUTO,
+ enable noack mode if the stub reported a wish for it with
+ qSupported.
+
+ If set to TRUE, then enable noack mode even if the stub didn't
+ report it in qSupported. If the stub doesn't reply OK, the
+ session ends with an error.
+
+ If FALSE, then don't activate noack mode, regardless of what the
+ stub claimed should be the default with qSupported. */
+
+ noack_config = &remote_protocol_packets[PACKET_QStartNoAckMode];
+
+ if (noack_config->detect == AUTO_BOOLEAN_TRUE
+ || (noack_config->detect == AUTO_BOOLEAN_AUTO
+ && noack_config->support == PACKET_ENABLE))
+ {
+ putpkt ("QStartNoAckMode");
+ getpkt (&rs->buf, &rs->buf_size, 0);
+ if (packet_ok (rs->buf, noack_config) == PACKET_OK)
+ rs->noack_mode = 1;
+ }
+
+ if (args->extended_p)
+ {
+ /* Tell the remote that we are using the extended protocol. */
+ putpkt ("!");
+ getpkt (&rs->buf, &rs->buf_size, 0);
+ }
+
+ /* On OSs where the list of libraries is global to all
+ processes, we fetch them early. */
+ if (gdbarch_has_global_solist (target_gdbarch))
+ solib_add (NULL, args->from_tty, args->target, auto_solib_add);
+
+ /* Next, if the target can specify a description, read it. We do
+ this before anything involving memory or registers. */
+ target_find_description ();
+
+ if (non_stop)
+ {
+ if (!rs->non_stop_aware)
+ error (_("Non-stop mode requested, but remote does not support non-stop"));
+
+ putpkt ("QNonStop:1");
+ getpkt (&rs->buf, &rs->buf_size, 0);
+
+ if (strcmp (rs->buf, "OK") != 0)
+ error ("Remote refused setting non-stop mode with: %s", rs->buf);
+
+ /* Find about threads and processes the stub is already
+ controlling. We default to adding them in the running state.
+ The '?' query below will then tell us about which threads are
+ stopped. */
+
+ /* If we're not using the multi-process extensions, there's no
+ way to know the pid of the reported threads; use the magic
+ number. */
+ if (!remote_multi_process_p (rs))
+ inferior_ptid = magic_null_ptid;
+
+ remote_threads_info ();
+ }
+ else if (rs->non_stop_aware)
+ {
+ /* Don't assume that the stub can operate in all-stop mode.
+ Request it explicitely. */
+ putpkt ("QNonStop:0");
+ getpkt (&rs->buf, &rs->buf_size, 0);
+
+ if (strcmp (rs->buf, "OK") != 0)
+ error ("Remote refused setting all-stop mode with: %s", rs->buf);
+ }
+
/* Check whether the target is running now. */
putpkt ("?");
getpkt (&rs->buf, &rs->buf_size, 0);
- if (rs->buf[0] == 'W' || rs->buf[0] == 'X')
+ if (!non_stop)
{
- if (args->extended_p)
+ if (rs->buf[0] == 'W' || rs->buf[0] == 'X')
{
- /* We're connected, but not running. Drop out before we
- call start_remote. */
- target_mark_exited (args->target);
- return;
+ if (args->extended_p)
+ {
+ /* We're connected, but not running. Drop out before we
+ call start_remote. */
+ target_mark_exited (args->target);
+ return;
+ }
+ else
+ error (_("The target is not running (try extended-remote?)"));
}
else
- error (_("The target is not running (try extended-remote?)"));
+ {
+ if (args->extended_p)
+ target_mark_running (args->target);
+
+ /* Save the reply for later. */
+ wait_status = alloca (strlen (rs->buf) + 1);
+ strcpy (wait_status, rs->buf);
+ }
+
+ /* Let the stub know that we want it to return the thread. */
+ set_continue_thread (minus_one_ptid);
+
+ /* Without this, some commands which require an active target
+ (such as kill) won't work. This variable serves (at least)
+ double duty as both the pid of the target process (if it has
+ such), and as a flag indicating that a target is active.
+ These functions should be split out into seperate variables,
+ especially since GDB will someday have a notion of debugging
+ several processes. */
+ inferior_ptid = magic_null_ptid;
+
+ /* Now, if we have thread information, update inferior_ptid. */
+ inferior_ptid = remote_current_thread (inferior_ptid);
+
+ add_inferior (ptid_get_pid (inferior_ptid));
+
+ /* Always add the main thread. */
+ add_thread_silent (inferior_ptid);
+
+ get_offsets (); /* Get text, data & bss offsets. */
+
+ /* Use the previously fetched status. */
+ gdb_assert (wait_status != NULL);
+ strcpy (rs->buf, wait_status);
+ rs->cached_wait_status = 1;
+
+ immediate_quit--;
+ start_remote (args->from_tty); /* Initialize gdb process mechanisms. */
}
else
{
- if (args->extended_p)
- target_mark_running (args->target);
+ /* In non-stop, we will either get an "OK", meaning that there
+ are no stopped threads at this time; or, a regular stop
+ reply. In the latter case, there may be more than one thread
+ stopped --- we pull them all out using the vStopped
+ mechanism. */
+ if (strcmp (rs->buf, "OK") != 0)
+ {
+ struct stop_reply *stop_reply;
+ struct cleanup *old_chain;
- /* Save the reply for later. */
- wait_status = alloca (strlen (rs->buf) + 1);
- strcpy (wait_status, rs->buf);
- }
+ stop_reply = stop_reply_xmalloc ();
+ old_chain = make_cleanup (do_stop_reply_xfree, stop_reply);
- /* Start afresh. */
- init_thread_list ();
+ remote_parse_stop_reply (rs->buf, stop_reply);
+ discard_cleanups (old_chain);
- /* Let the stub know that we want it to return the thread. */
- set_continue_thread (minus_one_ptid);
+ /* get_pending_stop_replies acks this one, and gets the rest
+ out. */
+ pending_stop_reply = stop_reply;
+ remote_get_pending_stop_replies ();
- /* Without this, some commands which require an active target
- (such as kill) won't work. This variable serves (at least)
- double duty as both the pid of the target process (if it has
- such), and as a flag indicating that a target is active.
- These functions should be split out into seperate variables,
- especially since GDB will someday have a notion of debugging
- several processes. */
- inferior_ptid = magic_null_ptid;
+ /* Make sure that threads that were stopped remain
+ stopped. */
+ iterate_over_threads (set_stop_requested_callback, NULL);
+ }
- /* Now, if we have thread information, update inferior_ptid. */
- inferior_ptid = remote_current_thread (inferior_ptid);
+ if (target_can_async_p ())
+ target_async (inferior_event_handler, 0);
- add_inferior (ptid_get_pid (inferior_ptid));
+ if (thread_count () == 0)
+ {
+ if (args->extended_p)
+ {
+ /* We're connected, but not running. Drop out before we
+ call start_remote. */
+ target_mark_exited (args->target);
+ return;
+ }
+ else
+ error (_("The target is not running (try extended-remote?)"));
+ }
- /* Always add the main thread. */
- add_thread_silent (inferior_ptid);
+ if (args->extended_p)
+ target_mark_running (args->target);
- get_offsets (); /* Get text, data & bss offsets. */
+ /* Let the stub know that we want it to return the thread. */
- /* Use the previously fetched status. */
- gdb_assert (wait_status != NULL);
- strcpy (rs->buf, wait_status);
- rs->cached_wait_status = 1;
+ /* Force the stub to choose a thread. */
+ set_general_thread (null_ptid);
- immediate_quit--;
- start_remote (args->from_tty); /* Initialize gdb process mechanisms. */
+ /* Query it. */
+ inferior_ptid = remote_current_thread (minus_one_ptid);
+ if (ptid_equal (inferior_ptid, minus_one_ptid))
+ error (_("remote didn't report the current thread in non-stop mode"));
+
+ get_offsets (); /* Get text, data & bss offsets. */
+
+ /* In non-stop mode, any cached wait status will be stored in
+ the stop reply queue. */
+ gdb_assert (wait_status == NULL);
+ }
+
+ /* If we connected to a live target, do some additional setup. */
+ if (target_has_execution)
+ {
+ if (exec_bfd) /* No use without an exec file. */
+ remote_check_symbols (symfile_objfile);
+ }
+
+ /* If code is shared between processes, then breakpoints are global
+ too; Insert them now. */
+ if (gdbarch_has_global_solist (target_gdbarch)
+ && breakpoints_always_inserted_mode ())
+ insert_breakpoints ();
}
/* Open a connection to a remote debugger.
@@ -2470,6 +2770,9 @@ remote_check_symbols (struct objfile *objfile)
if (remote_protocol_packets[PACKET_qSymbol].support == PACKET_DISABLE)
return;
+ /* Make sure the remote is pointing at the right process. */
+ set_general_process ();
+
/* Allocate a message buffer. We can't reuse the input buffer in RS,
because we need both at the same time. */
msg = alloca (get_remote_packet_size ());
@@ -2620,6 +2923,14 @@ remote_multi_process_feature (const struct protocol_feature *feature,
rs->multi_process_aware = (support == PACKET_ENABLE);
}
+static void
+remote_non_stop_feature (const struct protocol_feature *feature,
+ enum packet_support support, const char *value)
+{
+ struct remote_state *rs = get_remote_state ();
+ rs->non_stop_aware = (support == PACKET_ENABLE);
+}
+
static struct protocol_feature remote_protocol_features[] = {
{ "PacketSize", PACKET_DISABLE, remote_packet_size, -1 },
{ "qXfer:auxv:read", PACKET_DISABLE, remote_supported_packet,
@@ -2639,6 +2950,7 @@ static struct protocol_feature remote_protocol_features[] = {
{ "QStartNoAckMode", PACKET_DISABLE, remote_supported_packet,
PACKET_QStartNoAckMode },
{ "multiprocess", PACKET_DISABLE, remote_multi_process_feature, -1 },
+ { "QNonStop", PACKET_DISABLE, remote_non_stop_feature, -1 },
};
static void
@@ -2776,7 +3088,6 @@ static void
remote_open_1 (char *name, int from_tty, struct target_ops *target, int extended_p)
{
struct remote_state *rs = get_remote_state ();
- struct packet_config *noack_config;
if (name == 0)
error (_("To open a remote debug connection, you need to specify what\n"
@@ -2855,13 +3166,24 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, int extended
/* Assume that the target is running, unless we learn otherwise. */
target_mark_running (target);
+ /* Register extra event sources in the event loop. */
+ remote_async_inferior_event_token
+ = create_async_event_handler (remote_async_inferior_event_handler,
+ NULL);
+ remote_async_get_pending_events_token
+ = create_async_event_handler (remote_async_get_pending_events_handler,
+ NULL);
+
/* Reset the target state; these things will be queried either by
remote_query_supported or as they are needed. */
init_all_packet_configs ();
+ rs->cached_wait_status = 0;
rs->explicit_packet_size = 0;
rs->noack_mode = 0;
rs->multi_process_aware = 0;
rs->extended = extended_p;
+ rs->non_stop_aware = 0;
+ rs->waiting_for_stop_reply = 0;
general_thread = not_sent_ptid;
continue_thread = not_sent_ptid;
@@ -2870,43 +3192,6 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, int extended
use_threadinfo_query = 1;
use_threadextra_query = 1;
- /* Ack any packet which the remote side has already sent. */
- serial_write (remote_desc, "+", 1);
-
- /* The first packet we send to the target is the optional "supported
- packets" request. If the target can answer this, it will tell us
- which later probes to skip. */
- remote_query_supported ();
-
- /* Next, we possibly activate noack mode.
-
- If the QStartNoAckMode packet configuration is set to AUTO,
- enable noack mode if the stub reported a wish for it with
- qSupported.
-
- If set to TRUE, then enable noack mode even if the stub didn't
- report it in qSupported. If the stub doesn't reply OK, the
- session ends with an error.
-
- If FALSE, then don't activate noack mode, regardless of what the
- stub claimed should be the default with qSupported. */
-
- noack_config = &remote_protocol_packets[PACKET_QStartNoAckMode];
-
- if (noack_config->detect == AUTO_BOOLEAN_TRUE
- || (noack_config->detect == AUTO_BOOLEAN_AUTO
- && noack_config->support == PACKET_ENABLE))
- {
- putpkt ("QStartNoAckMode");
- getpkt (&rs->buf, &rs->buf_size, 0);
- if (packet_ok (rs->buf, noack_config) == PACKET_OK)
- rs->noack_mode = 1;
- }
-
- /* Next, if the target can specify a description, read it. We do
- this before anything involving memory or registers. */
- target_find_description ();
-
if (target_async_permitted)
{
/* With this target we start out by owning the terminal. */
@@ -2925,6 +3210,9 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, int extended
/* First delete any symbols previously loaded from shared libraries. */
no_shared_libraries (NULL, 0);
+ /* Start afresh. */
+ init_thread_list ();
+
/* Start the remote connection. If error() or QUIT, discard this
target (we'd otherwise be in an inconsistent state) and then
propogate the error on up the exception chain. This ensures that
@@ -2951,7 +3239,10 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, int extended
ex = catch_exception (uiout, remote_start_remote, &args, RETURN_MASK_ALL);
if (ex.reason < 0)
{
- pop_target ();
+ /* Pop the partially set up target - unless something else did
+ already before throwing the exception. */
+ if (remote_desc != NULL)
+ pop_target ();
if (target_async_permitted)
wait_forever_enabled_p = 1;
throw_exception (ex);
@@ -2960,20 +3251,6 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, int extended
if (target_async_permitted)
wait_forever_enabled_p = 1;
-
- if (extended_p)
- {
- /* Tell the remote that we are using the extended protocol. */
- putpkt ("!");
- getpkt (&rs->buf, &rs->buf_size, 0);
- }
-
- /* If we connected to a live target, do some additional setup. */
- if (target_has_execution)
- {
- if (exec_bfd) /* No use without an exec file. */
- remote_check_symbols (symfile_objfile);
- }
}
/* This takes a program previously attached to and detaches it. After
@@ -3009,10 +3286,6 @@ remote_detach_1 (char *args, int from_tty, int extended)
else
error (_("Can't detach process."));
- /* Unregister the file descriptor from the event loop. */
- if (target_is_async_p ())
- serial_async (remote_desc, NULL, 0);
-
if (from_tty)
{
if (remote_multi_process_p (rs))
@@ -3027,18 +3300,19 @@ remote_detach_1 (char *args, int from_tty, int extended)
}
}
+ discard_pending_stop_replies (pid);
detach_inferior (pid);
target_mourn_inferior ();
}
static void
-remote_detach (char *args, int from_tty)
+remote_detach (struct target_ops *ops, char *args, int from_tty)
{
remote_detach_1 (args, from_tty, 0);
}
static void
-extended_remote_detach (char *args, int from_tty)
+extended_remote_detach (struct target_ops *ops, char *args, int from_tty)
{
remote_detach_1 (args, from_tty, 1);
}
@@ -3051,10 +3325,6 @@ remote_disconnect (struct target_ops *target, char *args, int from_tty)
if (args)
error (_("Argument given to \"disconnect\" when remotely debugging."));
- /* Unregister the file descriptor from the event loop. */
- if (target_is_async_p ())
- serial_async (remote_desc, NULL, 0);
-
/* Make sure we unpush even the extended remote targets; mourn
won't do it. So call remote_mourn_1 directly instead of
target_mourn_inferior. */
@@ -3098,9 +3368,16 @@ extended_remote_attach_1 (struct target_ops *target, char *args, int from_tty)
printf_unfiltered (_("Attached to %s\n"),
target_pid_to_str (pid_to_ptid (pid)));
- /* Save the reply for later. */
- wait_status = alloca (strlen (rs->buf) + 1);
- strcpy (wait_status, rs->buf);
+ if (!non_stop)
+ {
+ /* Save the reply for later. */
+ wait_status = alloca (strlen (rs->buf) + 1);
+ strcpy (wait_status, rs->buf);
+ }
+ else if (strcmp (rs->buf, "OK") != 0)
+ error (_("Attaching to %s failed with: %s"),
+ target_pid_to_str (pid_to_ptid (pid)),
+ rs->buf);
}
else if (remote_protocol_packets[PACKET_vAttach].support == PACKET_DISABLE)
error (_("This target does not support attaching to a process"));
@@ -3117,23 +3394,50 @@ extended_remote_attach_1 (struct target_ops *target, char *args, int from_tty)
inf = add_inferior (pid);
inf->attach_flag = 1;
- /* Now, add the main thread to the thread list. */
- add_thread_silent (inferior_ptid);
+ if (non_stop)
+ /* Get list of threads. */
+ remote_threads_info ();
+ else
+ /* Add the main thread to the thread list. */
+ add_thread_silent (inferior_ptid);
/* Next, if the target can specify a description, read it. We do
this before anything involving memory or registers. */
target_find_description ();
- /* Use the previously fetched status. */
- gdb_assert (wait_status != NULL);
- strcpy (rs->buf, wait_status);
- rs->cached_wait_status = 1;
+ if (!non_stop)
+ {
+ /* Use the previously fetched status. */
+ gdb_assert (wait_status != NULL);
+
+ if (target_can_async_p ())
+ {
+ struct stop_reply *stop_reply;
+ struct cleanup *old_chain;
+
+ stop_reply = stop_reply_xmalloc ();
+ old_chain = make_cleanup (do_stop_reply_xfree, stop_reply);
+ remote_parse_stop_reply (wait_status, stop_reply);
+ discard_cleanups (old_chain);
+ push_stop_reply (stop_reply);
+
+ target_async (inferior_event_handler, 0);
+ }
+ else
+ {
+ gdb_assert (wait_status != NULL);
+ strcpy (rs->buf, wait_status);
+ rs->cached_wait_status = 1;
+ }
+ }
+ else
+ gdb_assert (wait_status == NULL);
}
static void
-extended_remote_attach (char *args, int from_tty)
+extended_remote_attach (struct target_ops *ops, char *args, int from_tty)
{
- extended_remote_attach_1 (&extended_remote_ops, args, from_tty);
+ extended_remote_attach_1 (ops, args, from_tty);
}
/* Convert hex digit A to a number. */
@@ -3221,6 +3525,7 @@ remote_vcont_probe (struct remote_state *rs)
support_S = 0;
support_c = 0;
support_C = 0;
+ rs->support_vCont_t = 0;
while (p && *p == ';')
{
p++;
@@ -3232,6 +3537,8 @@ remote_vcont_probe (struct remote_state *rs)
support_c = 1;
else if (*p == 'C' && (*(p + 1) == ';' || *(p + 1) == 0))
support_C = 1;
+ else if (*p == 't' && (*(p + 1) == ';' || *(p + 1) == 0))
+ rs->support_vCont_t = 1;
p = strchr (p, ';');
}
@@ -3352,6 +3659,16 @@ remote_vcont_resume (ptid_t ptid, int step, enum target_signal siggnal)
gdb_assert (strlen (rs->buf) < get_remote_packet_size ());
putpkt (rs->buf);
+ if (non_stop)
+ {
+ /* In non-stop, the stub replies to vCont with "OK". The stop
+ reply will be reported asynchronously by means of a `%Stop'
+ notification. */
+ getpkt (&rs->buf, &rs->buf_size, 0);
+ if (strcmp (rs->buf, "OK") != 0)
+ error (_("Unexpected vCont reply in non-stop mode: %s"), rs->buf);
+ }
+
return 1;
}
@@ -3385,7 +3702,15 @@ remote_resume (ptid_t ptid, int step, enum target_signal siggnal)
set_continue_thread (ptid);
buf = rs->buf;
- if (siggnal != TARGET_SIGNAL_0)
+ if (execution_direction == EXEC_REVERSE)
+ {
+ /* We don't pass signals to the target in reverse exec mode. */
+ if (info_verbose && siggnal != TARGET_SIGNAL_0)
+ warning (" - Can't pass signal %d to target in reverse: ignored.\n",
+ siggnal);
+ strcpy (buf, step ? "bs" : "bc");
+ }
+ else if (siggnal != TARGET_SIGNAL_0)
{
buf[0] = step ? 'S' : 'C';
buf[1] = tohex (((int) siggnal >> 4) & 0xf);
@@ -3407,6 +3732,16 @@ remote_resume (ptid_t ptid, int step, enum target_signal siggnal)
NOT asynchronously. */
if (target_can_async_p ())
target_async (inferior_event_handler, 0);
+
+ /* We've just told the target to resume. The remote server will
+ wait for the inferior to stop, and then send a stop reply. In
+ the mean time, we can't start another command/query ourselves
+ because the stub wouldn't be ready to process it. This applies
+ only to the base all-stop protocol, however. In non-stop (which
+ only supports vCont), the stub replies with an "OK", and is
+ immediate able to process further serial input. */
+ if (!non_stop)
+ rs->waiting_for_stop_reply = 1;
}
@@ -3494,20 +3829,95 @@ remote_interrupt_twice (int signo)
signal (signo, remote_interrupt);
}
+/* Non-stop version of target_stop. Uses `vCont;t' to stop a remote
+ thread, all threads of a remote process, or all threads of all
+ processes. */
+
+static void
+remote_stop_ns (ptid_t ptid)
+{
+ struct remote_state *rs = get_remote_state ();
+ char *p = rs->buf;
+ char *endp = rs->buf + get_remote_packet_size ();
+ struct stop_reply *reply, *next;
+
+ if (remote_protocol_packets[PACKET_vCont].support == PACKET_SUPPORT_UNKNOWN)
+ remote_vcont_probe (rs);
+
+ if (!rs->support_vCont_t)
+ error (_("Remote server does not support stopping threads"));
+
+ if (ptid_equal (ptid, minus_one_ptid))
+ p += xsnprintf (p, endp - p, "vCont;t");
+ else
+ {
+ ptid_t nptid;
+
+ /* Step inferior_ptid. */
+ p += xsnprintf (p, endp - p, "vCont;t:");
+
+ if (ptid_is_pid (ptid))
+ /* All (-1) threads of process. */
+ nptid = ptid_build (ptid_get_pid (ptid), 0, -1);
+ else
+ {
+ /* Small optimization: if we already have a stop reply for
+ this thread, no use in telling the stub we want this
+ stopped. */
+ if (peek_stop_reply (ptid))
+ return;
+
+ nptid = ptid;
+ }
+
+ p = write_ptid (p, endp, nptid);
+ }
+
+ /* In non-stop, we get an immediate OK reply. The stop reply will
+ come in asynchronously by notification. */
+ putpkt (rs->buf);
+ getpkt (&rs->buf, &rs->buf_size, 0);
+ if (strcmp (rs->buf, "OK") != 0)
+ error (_("Stopping %s failed: %s"), target_pid_to_str (ptid), rs->buf);
+}
+
+/* All-stop version of target_stop. Sends a break or a ^C to stop the
+ remote target. It is undefined which thread of which process
+ reports the stop. */
+
+static void
+remote_stop_as (ptid_t ptid)
+{
+ struct remote_state *rs = get_remote_state ();
+
+ /* If the inferior is stopped already, but the core didn't know
+ about it yet, just ignore the request. The cached wait status
+ will be collected in remote_wait. */
+ if (rs->cached_wait_status)
+ return;
+
+ /* Send a break or a ^C, depending on user preference. */
+
+ if (remote_break)
+ serial_send_break (remote_desc);
+ else
+ serial_write (remote_desc, "\003", 1);
+}
+
/* This is the generic stop called via the target vector. When a target
interrupt is requested, either by the command line or the GUI, we
will eventually end up here. */
+
static void
remote_stop (ptid_t ptid)
{
- /* Send a break or a ^C, depending on user preference. */
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "remote_stop called\n");
- if (remote_break)
- serial_send_break (remote_desc);
+ if (non_stop)
+ remote_stop_ns (ptid);
else
- serial_write (remote_desc, "\003", 1);
+ remote_stop_as (ptid);
}
/* Ask the user what to do when an interrupt is received. */
@@ -3517,13 +3927,20 @@ interrupt_query (void)
{
target_terminal_ours ();
- if (query ("Interrupted while waiting for the program.\n\
-Give up (and stop debugging it)? "))
+ if (target_can_async_p ())
{
- target_mourn_inferior ();
signal (SIGINT, handle_sigint);
deprecated_throw_reason (RETURN_QUIT);
}
+ else
+ {
+ if (query ("Interrupted while waiting for the program.\n\
+Give up (and stop debugging it)? "))
+ {
+ pop_target ();
+ deprecated_throw_reason (RETURN_QUIT);
+ }
+ }
target_terminal_inferior ();
}
@@ -3594,281 +4011,743 @@ remote_console_output (char *msg)
tb[1] = 0;
fputs_unfiltered (tb, gdb_stdtarg);
}
- gdb_flush (gdb_stdtarg);
-}
+ gdb_flush (gdb_stdtarg);
+ }
-/* Wait until the remote machine stops, then return,
- storing status in STATUS just as `wait' would. */
+typedef struct cached_reg
+{
+ int num;
+ gdb_byte data[MAX_REGISTER_SIZE];
+} cached_reg_t;
-static ptid_t
-remote_wait (ptid_t ptid, struct target_waitstatus *status)
+DEF_VEC_O(cached_reg_t);
+
+struct stop_reply
{
- struct remote_state *rs = get_remote_state ();
- struct remote_arch_state *rsa = get_remote_arch_state ();
- ptid_t event_ptid = null_ptid;
- ULONGEST addr;
- int solibs_changed = 0;
+ struct stop_reply *next;
- status->kind = TARGET_WAITKIND_EXITED;
- status->value.integer = 0;
+ ptid_t ptid;
- while (1)
+ struct target_waitstatus ws;
+
+ VEC(cached_reg_t) *regcache;
+
+ int stopped_by_watchpoint_p;
+ CORE_ADDR watch_data_address;
+
+ int solibs_changed;
+ int replay_event;
+};
+
+/* The list of already fetched and acknowledged stop events. */
+static struct stop_reply *stop_reply_queue;
+
+static struct stop_reply *
+stop_reply_xmalloc (void)
+{
+ struct stop_reply *r = XMALLOC (struct stop_reply);
+ r->next = NULL;
+ return r;
+}
+
+static void
+stop_reply_xfree (struct stop_reply *r)
+{
+ if (r != NULL)
{
- char *buf, *p;
+ VEC_free (cached_reg_t, r->regcache);
+ xfree (r);
+ }
+}
- if (rs->cached_wait_status)
- /* Use the cached wait status, but only once. */
- rs->cached_wait_status = 0;
- else
+/* Discard all pending stop replies of inferior PID. If PID is -1,
+ discard everything. */
+
+static void
+discard_pending_stop_replies (int pid)
+{
+ struct stop_reply *prev = NULL, *reply, *next;
+
+ /* Discard the in-flight notification. */
+ if (pending_stop_reply != NULL
+ && (pid == -1
+ || ptid_get_pid (pending_stop_reply->ptid) == pid))
+ {
+ stop_reply_xfree (pending_stop_reply);
+ pending_stop_reply = NULL;
+ }
+
+ /* Discard the stop replies we have already pulled with
+ vStopped. */
+ for (reply = stop_reply_queue; reply; reply = next)
+ {
+ next = reply->next;
+ if (pid == -1
+ || ptid_get_pid (reply->ptid) == pid)
{
- if (!target_is_async_p ())
- {
- ofunc = signal (SIGINT, remote_interrupt);
- /* If the user hit C-c before this packet, or between packets,
- pretend that it was hit right here. */
- if (quit_flag)
- {
- quit_flag = 0;
- remote_interrupt (SIGINT);
- }
- }
- /* FIXME: cagney/1999-09-27: If we're in async mode we should
- _never_ wait for ever -> test on target_is_async_p().
- However, before we do that we need to ensure that the caller
- knows how to take the target into/out of async mode. */
- getpkt (&rs->buf, &rs->buf_size, wait_forever_enabled_p);
- if (!target_is_async_p ())
- signal (SIGINT, ofunc);
+ if (reply == stop_reply_queue)
+ stop_reply_queue = reply->next;
+ else
+ prev->next = reply->next;
+
+ stop_reply_xfree (reply);
}
+ else
+ prev = reply;
+ }
+}
- buf = rs->buf;
+/* Cleanup wrapper. */
- remote_stopped_by_watchpoint_p = 0;
+static void
+do_stop_reply_xfree (void *arg)
+{
+ struct stop_reply *r = arg;
+ stop_reply_xfree (r);
+}
- switch (buf[0])
- {
- case 'E': /* Error of some sort. */
- /* We're out of sync with the target now. Did it continue or not?
- Not is more likely, so report a stop. */
- warning (_("Remote failure reply: %s"), buf);
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = TARGET_SIGNAL_0;
- goto got_status;
- case 'F': /* File-I/O request. */
- remote_fileio_request (buf);
- continue;
- case 'T': /* Status with PC, SP, FP, ... */
- {
- gdb_byte regs[MAX_REGISTER_SIZE];
+/* Look for a queued stop reply belonging to PTID. If one is found,
+ remove it from the queue, and return it. Returns NULL if none is
+ found. If there are still queued events left to process, tell the
+ event loop to get back to target_wait soon. */
- /* Expedited reply, containing Signal, {regno, reg} repeat. */
- /* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
- ss = signal number
- n... = register number
- r... = register contents
- */
- p = &buf[3]; /* after Txx */
+static struct stop_reply *
+queued_stop_reply (ptid_t ptid)
+{
+ struct stop_reply *it, *prev;
+ struct stop_reply head;
- while (*p)
- {
- char *p1;
- char *p_temp;
- int fieldsize;
- LONGEST pnum = 0;
+ head.next = stop_reply_queue;
+ prev = &head;
- /* If the packet contains a register number, save it
- in pnum and set p1 to point to the character
- following it. Otherwise p1 points to p. */
+ it = head.next;
- /* If this packet is an awatch packet, don't parse the
- 'a' as a register number. */
+ if (!ptid_equal (ptid, minus_one_ptid))
+ for (; it; prev = it, it = it->next)
+ if (ptid_equal (ptid, it->ptid))
+ break;
- if (strncmp (p, "awatch", strlen("awatch")) != 0)
+ if (it)
+ {
+ prev->next = it->next;
+ it->next = NULL;
+ }
+
+ stop_reply_queue = head.next;
+
+ if (stop_reply_queue)
+ /* There's still at least an event left. */
+ mark_async_event_handler (remote_async_inferior_event_token);
+
+ return it;
+}
+
+/* Push a fully parsed stop reply in the stop reply queue. Since we
+ know that we now have at least one queued event left to pass to the
+ core side, tell the event loop to get back to target_wait soon. */
+
+static void
+push_stop_reply (struct stop_reply *new_event)
+{
+ struct stop_reply *event;
+
+ if (stop_reply_queue)
+ {
+ for (event = stop_reply_queue;
+ event && event->next;
+ event = event->next)
+ ;
+
+ event->next = new_event;
+ }
+ else
+ stop_reply_queue = new_event;
+
+ mark_async_event_handler (remote_async_inferior_event_token);
+}
+
+/* Returns true if we have a stop reply for PTID. */
+
+static int
+peek_stop_reply (ptid_t ptid)
+{
+ struct stop_reply *it;
+
+ for (it = stop_reply_queue; it; it = it->next)
+ if (ptid_equal (ptid, it->ptid))
+ {
+ if (it->ws.kind == TARGET_WAITKIND_STOPPED)
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Parse the stop reply in BUF. Either the function succeeds, and the
+ result is stored in EVENT, or throws an error. */
+
+static void
+remote_parse_stop_reply (char *buf, struct stop_reply *event)
+{
+ struct remote_arch_state *rsa = get_remote_arch_state ();
+ ULONGEST addr;
+ char *p;
+
+ event->ptid = null_ptid;
+ event->ws.kind = TARGET_WAITKIND_IGNORE;
+ event->ws.value.integer = 0;
+ event->solibs_changed = 0;
+ event->replay_event = 0;
+ event->stopped_by_watchpoint_p = 0;
+ event->regcache = NULL;
+
+ switch (buf[0])
+ {
+ case 'T': /* Status with PC, SP, FP, ... */
+ {
+ gdb_byte regs[MAX_REGISTER_SIZE];
+
+ /* Expedited reply, containing Signal, {regno, reg} repeat. */
+ /* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
+ ss = signal number
+ n... = register number
+ r... = register contents
+ */
+
+ p = &buf[3]; /* after Txx */
+ while (*p)
+ {
+ char *p1;
+ char *p_temp;
+ int fieldsize;
+ LONGEST pnum = 0;
+
+ /* If the packet contains a register number, save it in
+ pnum and set p1 to point to the character following it.
+ Otherwise p1 points to p. */
+
+ /* If this packet is an awatch packet, don't parse the 'a'
+ as a register number. */
+
+ if (strncmp (p, "awatch", strlen("awatch")) != 0)
+ {
+ /* Read the ``P'' register number. */
+ pnum = strtol (p, &p_temp, 16);
+ p1 = p_temp;
+ }
+ else
+ p1 = p;
+
+ if (p1 == p) /* No register number present here. */
+ {
+ p1 = strchr (p, ':');
+ if (p1 == NULL)
+ error (_("Malformed packet(a) (missing colon): %s\n\
+Packet: '%s'\n"),
+ p, buf);
+ if (strncmp (p, "thread", p1 - p) == 0)
+ event->ptid = read_ptid (++p1, &p);
+ else if ((strncmp (p, "watch", p1 - p) == 0)
+ || (strncmp (p, "rwatch", p1 - p) == 0)
+ || (strncmp (p, "awatch", p1 - p) == 0))
{
- /* Read the ``P'' register number. */
- pnum = strtol (p, &p_temp, 16);
- p1 = p_temp;
+ event->stopped_by_watchpoint_p = 1;
+ p = unpack_varlen_hex (++p1, &addr);
+ event->watch_data_address = (CORE_ADDR) addr;
}
- else
- p1 = p;
-
- if (p1 == p) /* No register number present here. */
+ else if (strncmp (p, "library", p1 - p) == 0)
{
- p1 = strchr (p, ':');
- if (p1 == NULL)
- error (_("Malformed packet(a) (missing colon): %s\n\
-Packet: '%s'\n"),
- p, buf);
- if (strncmp (p, "thread", p1 - p) == 0)
- event_ptid = read_ptid (++p1, &p);
- else if ((strncmp (p, "watch", p1 - p) == 0)
- || (strncmp (p, "rwatch", p1 - p) == 0)
- || (strncmp (p, "awatch", p1 - p) == 0))
- {
- remote_stopped_by_watchpoint_p = 1;
- p = unpack_varlen_hex (++p1, &addr);
- remote_watch_data_address = (CORE_ADDR)addr;
- }
- else if (strncmp (p, "library", p1 - p) == 0)
- {
- p1++;
- p_temp = p1;
- while (*p_temp && *p_temp != ';')
- p_temp++;
+ p1++;
+ p_temp = p1;
+ while (*p_temp && *p_temp != ';')
+ p_temp++;
- solibs_changed = 1;
- p = p_temp;
- }
- else
- {
- /* Silently skip unknown optional info. */
- p_temp = strchr (p1 + 1, ';');
- if (p_temp)
- p = p_temp;
- }
+ event->solibs_changed = 1;
+ p = p_temp;
+ }
+ else if (strncmp (p, "replaylog", p1 - p) == 0)
+ {
+ /* NO_HISTORY event.
+ p1 will indicate "begin" or "end", but
+ it makes no difference for now, so ignore it. */
+ event->replay_event = 1;
+ p_temp = strchr (p1 + 1, ';');
+ if (p_temp)
+ p = p_temp;
}
else
{
- struct packet_reg *reg = packet_reg_from_pnum (rsa, pnum);
- p = p1;
+ /* Silently skip unknown optional info. */
+ p_temp = strchr (p1 + 1, ';');
+ if (p_temp)
+ p = p_temp;
+ }
+ }
+ else
+ {
+ struct packet_reg *reg = packet_reg_from_pnum (rsa, pnum);
+ cached_reg_t cached_reg;
+
+ cached_reg.num = reg->regnum;
- if (*p != ':')
- error (_("Malformed packet(b) (missing colon): %s\n\
+ p = p1;
+
+ if (*p != ':')
+ error (_("Malformed packet(b) (missing colon): %s\n\
Packet: '%s'\n"),
- p, buf);
- ++p;
+ p, buf);
+ ++p;
- if (reg == NULL)
- error (_("Remote sent bad register number %s: %s\n\
+ if (reg == NULL)
+ error (_("Remote sent bad register number %s: %s\n\
Packet: '%s'\n"),
- phex_nz (pnum, 0), p, buf);
-
- fieldsize = hex2bin (p, regs,
- register_size (target_gdbarch,
- reg->regnum));
- p += 2 * fieldsize;
- if (fieldsize < register_size (target_gdbarch,
- reg->regnum))
- warning (_("Remote reply is too short: %s"), buf);
- regcache_raw_supply (get_current_regcache (),
- reg->regnum, regs);
- }
+ phex_nz (pnum, 0), p, buf);
+
+ fieldsize = hex2bin (p, cached_reg.data,
+ register_size (target_gdbarch,
+ reg->regnum));
+ p += 2 * fieldsize;
+ if (fieldsize < register_size (target_gdbarch,
+ reg->regnum))
+ warning (_("Remote reply is too short: %s"), buf);
- if (*p != ';')
- error (_("Remote register badly formatted: %s\nhere: %s"),
- buf, p);
- ++p;
+ VEC_safe_push (cached_reg_t, event->regcache, &cached_reg);
}
+
+ if (*p != ';')
+ error (_("Remote register badly formatted: %s\nhere: %s"),
+ buf, p);
+ ++p;
}
- /* fall through */
- case 'S': /* Old style status, just signal only. */
- if (solibs_changed)
- status->kind = TARGET_WAITKIND_LOADED;
- else
- {
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.sig = (enum target_signal)
- (((fromhex (buf[1])) << 4) + (fromhex (buf[2])));
- }
- goto got_status;
- case 'W': /* Target exited. */
- case 'X':
- {
- char *p;
- int pid;
- ULONGEST value;
+ }
+ /* fall through */
+ case 'S': /* Old style status, just signal only. */
+ if (event->solibs_changed)
+ event->ws.kind = TARGET_WAITKIND_LOADED;
+ else if (event->replay_event)
+ event->ws.kind = TARGET_WAITKIND_NO_HISTORY;
+ else
+ {
+ event->ws.kind = TARGET_WAITKIND_STOPPED;
+ event->ws.value.sig = (enum target_signal)
+ (((fromhex (buf[1])) << 4) + (fromhex (buf[2])));
+ }
+ break;
+ case 'W': /* Target exited. */
+ case 'X':
+ {
+ char *p;
+ int pid;
+ ULONGEST value;
- /* GDB used to accept only 2 hex chars here. Stubs should
- only send more if they detect GDB supports
- multi-process support. */
- p = unpack_varlen_hex (&buf[1], &value);
+ /* GDB used to accept only 2 hex chars here. Stubs should
+ only send more if they detect GDB supports multi-process
+ support. */
+ p = unpack_varlen_hex (&buf[1], &value);
- if (buf[0] == 'W')
- {
- /* The remote process exited. */
- status->kind = TARGET_WAITKIND_EXITED;
- status->value.integer = value;
- }
- else
- {
- /* The remote process exited with a signal. */
- status->kind = TARGET_WAITKIND_SIGNALLED;
- status->value.sig = (enum target_signal) value;
- }
+ if (buf[0] == 'W')
+ {
+ /* The remote process exited. */
+ event->ws.kind = TARGET_WAITKIND_EXITED;
+ event->ws.value.integer = value;
+ }
+ else
+ {
+ /* The remote process exited with a signal. */
+ event->ws.kind = TARGET_WAITKIND_SIGNALLED;
+ event->ws.value.sig = (enum target_signal) value;
+ }
+
+ /* If no process is specified, assume inferior_ptid. */
+ pid = ptid_get_pid (inferior_ptid);
+ if (*p == '\0')
+ ;
+ else if (*p == ';')
+ {
+ p++;
- /* If no process is specified, assume inferior_ptid. */
- pid = ptid_get_pid (inferior_ptid);
- if (*p == '\0')
+ if (p == '\0')
;
- else if (*p == ';')
+ else if (strncmp (p,
+ "process:", sizeof ("process:") - 1) == 0)
{
- p++;
-
- if (p == '\0')
- ;
- else if (strncmp (p,
- "process:", sizeof ("process:") - 1) == 0)
- {
- ULONGEST upid;
- p += sizeof ("process:") - 1;
- unpack_varlen_hex (p, &upid);
- pid = upid;
- }
- else
- error (_("unknown stop reply packet: %s"), buf);
+ ULONGEST upid;
+ p += sizeof ("process:") - 1;
+ unpack_varlen_hex (p, &upid);
+ pid = upid;
}
else
error (_("unknown stop reply packet: %s"), buf);
- event_ptid = ptid_build (pid, 0, 0);
- goto got_status;
}
- case 'O': /* Console output. */
- remote_console_output (buf + 1);
- if (target_can_async_p ())
- {
- /* Return immediately to the event loop. The event loop
- will still be waiting on the inferior afterwards. */
- status->kind = TARGET_WAITKIND_IGNORE;
- goto got_status;
- }
+ else
+ error (_("unknown stop reply packet: %s"), buf);
+ event->ptid = pid_to_ptid (pid);
+ }
+ break;
+ }
+
+ if (non_stop && ptid_equal (event->ptid, null_ptid))
+ error (_("No process or thread specified in stop reply: %s"), buf);
+}
+
+/* When the stub wants to tell GDB about a new stop reply, it sends a
+ stop notification (%Stop). Those can come it at any time, hence,
+ we have to make sure that any pending putpkt/getpkt sequence we're
+ making is finished, before querying the stub for more events with
+ vStopped. E.g., if we started a vStopped sequence immediatelly
+ upon receiving the %Stop notification, something like this could
+ happen:
+
+ 1.1) --> Hg 1
+ 1.2) <-- OK
+ 1.3) --> g
+ 1.4) <-- %Stop
+ 1.5) --> vStopped
+ 1.6) <-- (registers reply to step #1.3)
+
+ Obviously, the reply in step #1.6 would be unexpected to a vStopped
+ query.
+
+ To solve this, whenever we parse a %Stop notification sucessfully,
+ we mark the REMOTE_ASYNC_GET_PENDING_EVENTS_TOKEN, and carry on
+ doing whatever we were doing:
+
+ 2.1) --> Hg 1
+ 2.2) <-- OK
+ 2.3) --> g
+ 2.4) <-- %Stop
+ <GDB marks the REMOTE_ASYNC_GET_PENDING_EVENTS_TOKEN>
+ 2.5) <-- (registers reply to step #2.3)
+
+ Eventualy after step #2.5, we return to the event loop, which
+ notices there's an event on the
+ REMOTE_ASYNC_GET_PENDING_EVENTS_TOKEN event and calls the
+ associated callback --- the function below. At this point, we're
+ always safe to start a vStopped sequence. :
+
+ 2.6) --> vStopped
+ 2.7) <-- T05 thread:2
+ 2.8) --> vStopped
+ 2.9) --> OK
+*/
+
+static void
+remote_get_pending_stop_replies (void)
+{
+ struct remote_state *rs = get_remote_state ();
+ int ret;
+
+ if (pending_stop_reply)
+ {
+ /* acknowledge */
+ putpkt ("vStopped");
+
+ /* Now we can rely on it. */
+ push_stop_reply (pending_stop_reply);
+ pending_stop_reply = NULL;
+
+ while (1)
+ {
+ getpkt (&rs->buf, &rs->buf_size, 0);
+ if (strcmp (rs->buf, "OK") == 0)
+ break;
else
- continue;
- case '\0':
- if (last_sent_signal != TARGET_SIGNAL_0)
{
- /* Zero length reply means that we tried 'S' or 'C' and
- the remote system doesn't support it. */
- target_terminal_ours_for_output ();
- printf_filtered
- ("Can't send signals to this remote system. %s not sent.\n",
- target_signal_to_name (last_sent_signal));
- last_sent_signal = TARGET_SIGNAL_0;
- target_terminal_inferior ();
-
- strcpy ((char *) buf, last_sent_step ? "s" : "c");
- putpkt ((char *) buf);
- continue;
+ struct cleanup *old_chain;
+ struct stop_reply *stop_reply = stop_reply_xmalloc ();
+
+ old_chain = make_cleanup (do_stop_reply_xfree, stop_reply);
+ remote_parse_stop_reply (rs->buf, stop_reply);
+
+ /* acknowledge */
+ putpkt ("vStopped");
+
+ if (stop_reply->ws.kind != TARGET_WAITKIND_IGNORE)
+ {
+ /* Now we can rely on it. */
+ discard_cleanups (old_chain);
+ push_stop_reply (stop_reply);
+ }
+ else
+ /* We got an unknown stop reply. */
+ do_cleanups (old_chain);
}
- /* else fallthrough */
- default:
- warning (_("Invalid remote reply: %s"), buf);
- continue;
}
}
-got_status:
+}
+
+
+/* Called when it is decided that STOP_REPLY holds the info of the
+ event that is to be returned to the core. This function always
+ destroys STOP_REPLY. */
+
+static ptid_t
+process_stop_reply (struct stop_reply *stop_reply,
+ struct target_waitstatus *status)
+{
+ ptid_t ptid;
+
+ *status = stop_reply->ws;
+ ptid = stop_reply->ptid;
+
+ /* If no thread/process was reported by the stub, assume the current
+ inferior. */
+ if (ptid_equal (ptid, null_ptid))
+ ptid = inferior_ptid;
+
if (status->kind == TARGET_WAITKIND_EXITED
|| status->kind == TARGET_WAITKIND_SIGNALLED)
{
- int pid = ptid_get_pid (event_ptid);
+ int pid = ptid_get_pid (ptid);
delete_inferior (pid);
}
else
+ notice_new_inferiors (ptid);
+
+ /* Expedited registers. */
+ if (stop_reply->regcache)
+ {
+ cached_reg_t *reg;
+ int ix;
+
+ for (ix = 0;
+ VEC_iterate(cached_reg_t, stop_reply->regcache, ix, reg);
+ ix++)
+ regcache_raw_supply (get_thread_regcache (ptid),
+ reg->num, reg->data);
+ VEC_free (cached_reg_t, stop_reply->regcache);
+ }
+
+ remote_stopped_by_watchpoint_p = stop_reply->stopped_by_watchpoint_p;
+ remote_watch_data_address = stop_reply->watch_data_address;
+
+ stop_reply_xfree (stop_reply);
+ return ptid;
+}
+
+/* The non-stop mode version of target_wait. */
+
+static ptid_t
+remote_wait_ns (ptid_t ptid, struct target_waitstatus *status)
+{
+ struct remote_state *rs = get_remote_state ();
+ struct remote_arch_state *rsa = get_remote_arch_state ();
+ ptid_t event_ptid = null_ptid;
+ struct stop_reply *stop_reply;
+ int ret;
+
+ /* If in non-stop mode, get out of getpkt even if a
+ notification is received. */
+
+ ret = getpkt_or_notif_sane (&rs->buf, &rs->buf_size,
+ 0 /* forever */);
+ while (1)
+ {
+ if (ret != -1)
+ switch (rs->buf[0])
+ {
+ case 'E': /* Error of some sort. */
+ /* We're out of sync with the target now. Did it continue
+ or not? We can't tell which thread it was in non-stop,
+ so just ignore this. */
+ warning (_("Remote failure reply: %s"), rs->buf);
+ break;
+ case 'O': /* Console output. */
+ remote_console_output (rs->buf + 1);
+ break;
+ default:
+ warning (_("Invalid remote reply: %s"), rs->buf);
+ break;
+ }
+
+ /* Acknowledge a pending stop reply that may have arrived in the
+ mean time. */
+ if (pending_stop_reply != NULL)
+ remote_get_pending_stop_replies ();
+
+ /* If indeed we noticed a stop reply, we're done. */
+ stop_reply = queued_stop_reply (ptid);
+ if (stop_reply != NULL)
+ return process_stop_reply (stop_reply, status);
+
+ /* Still no event. If we're in asynchronous mode, then just
+ return to the event loop. */
+ if (remote_is_async_p ())
+ {
+ status->kind = TARGET_WAITKIND_IGNORE;
+ return minus_one_ptid;
+ }
+
+ /* Otherwise, asynchronous mode is masked, so do a blocking
+ wait. */
+ ret = getpkt_or_notif_sane (&rs->buf, &rs->buf_size,
+ 1 /* forever */);
+ }
+}
+
+/* Wait until the remote machine stops, then return, storing status in
+ STATUS just as `wait' would. */
+
+static ptid_t
+remote_wait_as (ptid_t ptid, struct target_waitstatus *status)
+{
+ struct remote_state *rs = get_remote_state ();
+ struct remote_arch_state *rsa = get_remote_arch_state ();
+ ptid_t event_ptid = null_ptid;
+ ULONGEST addr;
+ int solibs_changed = 0;
+ char *buf, *p;
+ struct stop_reply *stop_reply;
+
+ status->kind = TARGET_WAITKIND_IGNORE;
+ status->value.integer = 0;
+
+ stop_reply = queued_stop_reply (ptid);
+ if (stop_reply != NULL)
+ return process_stop_reply (stop_reply, status);
+
+ if (rs->cached_wait_status)
+ /* Use the cached wait status, but only once. */
+ rs->cached_wait_status = 0;
+ else
+ {
+ int ret;
+
+ if (!target_is_async_p ())
+ {
+ ofunc = signal (SIGINT, remote_interrupt);
+ /* If the user hit C-c before this packet, or between packets,
+ pretend that it was hit right here. */
+ if (quit_flag)
+ {
+ quit_flag = 0;
+ remote_interrupt (SIGINT);
+ }
+ }
+
+ /* FIXME: cagney/1999-09-27: If we're in async mode we should
+ _never_ wait for ever -> test on target_is_async_p().
+ However, before we do that we need to ensure that the caller
+ knows how to take the target into/out of async mode. */
+ ret = getpkt_sane (&rs->buf, &rs->buf_size, wait_forever_enabled_p);
+ if (!target_is_async_p ())
+ signal (SIGINT, ofunc);
+ }
+
+ buf = rs->buf;
+
+ remote_stopped_by_watchpoint_p = 0;
+
+ /* We got something. */
+ rs->waiting_for_stop_reply = 0;
+
+ switch (buf[0])
+ {
+ case 'E': /* Error of some sort. */
+ /* We're out of sync with the target now. Did it continue or
+ not? Not is more likely, so report a stop. */
+ warning (_("Remote failure reply: %s"), buf);
+ status->kind = TARGET_WAITKIND_STOPPED;
+ status->value.sig = TARGET_SIGNAL_0;
+ break;
+ case 'F': /* File-I/O request. */
+ remote_fileio_request (buf);
+ break;
+ case 'T': case 'S': case 'X': case 'W':
+ {
+ struct stop_reply *stop_reply;
+ struct cleanup *old_chain;
+
+ stop_reply = stop_reply_xmalloc ();
+ old_chain = make_cleanup (do_stop_reply_xfree, stop_reply);
+ remote_parse_stop_reply (buf, stop_reply);
+ discard_cleanups (old_chain);
+ event_ptid = process_stop_reply (stop_reply, status);
+ break;
+ }
+ case 'O': /* Console output. */
+ remote_console_output (buf + 1);
+
+ /* The target didn't really stop; keep waiting. */
+ rs->waiting_for_stop_reply = 1;
+
+ break;
+ case '\0':
+ if (last_sent_signal != TARGET_SIGNAL_0)
+ {
+ /* Zero length reply means that we tried 'S' or 'C' and the
+ remote system doesn't support it. */
+ target_terminal_ours_for_output ();
+ printf_filtered
+ ("Can't send signals to this remote system. %s not sent.\n",
+ target_signal_to_name (last_sent_signal));
+ last_sent_signal = TARGET_SIGNAL_0;
+ target_terminal_inferior ();
+
+ strcpy ((char *) buf, last_sent_step ? "s" : "c");
+ putpkt ((char *) buf);
+
+ /* We just told the target to resume, so a stop reply is in
+ order. */
+ rs->waiting_for_stop_reply = 1;
+ break;
+ }
+ /* else fallthrough */
+ default:
+ warning (_("Invalid remote reply: %s"), buf);
+ /* Keep waiting. */
+ rs->waiting_for_stop_reply = 1;
+ break;
+ }
+
+ if (status->kind == TARGET_WAITKIND_IGNORE)
+ /* Nothing interesting happened. */
+ return minus_one_ptid;
+ else if (status->kind != TARGET_WAITKIND_EXITED
+ && status->kind != TARGET_WAITKIND_SIGNALLED)
{
if (!ptid_equal (event_ptid, null_ptid))
record_currthread (event_ptid);
else
event_ptid = inferior_ptid;
}
+ else
+ /* A process exit. Invalidate our notion of current thread. */
+ record_currthread (minus_one_ptid);
+
+ return event_ptid;
+}
+
+/* Wait until the remote machine stops, then return, storing status in
+ STATUS just as `wait' would. */
+
+static ptid_t
+remote_wait (ptid_t ptid, struct target_waitstatus *status)
+{
+ ptid_t event_ptid;
+
+ if (non_stop)
+ event_ptid = remote_wait_ns (ptid, status);
+ else
+ {
+ /* In synchronous mode, keep waiting until the target stops. In
+ asynchronous mode, always return to the event loop. */
+
+ do
+ {
+ event_ptid = remote_wait_as (ptid, status);
+ }
+ while (status->kind == TARGET_WAITKIND_IGNORE
+ && !target_can_async_p ());
+ }
+
+ if (target_can_async_p ())
+ {
+ /* If there are are events left in the queue tell the event loop
+ to return here. */
+ if (stop_reply_queue)
+ mark_async_event_handler (remote_async_inferior_event_token);
+ }
return event_ptid;
}
@@ -4750,6 +5629,45 @@ remote_read_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
return origlen;
}
+
+/* Remote notification handler. */
+
+static void
+handle_notification (char *buf, size_t length)
+{
+ if (strncmp (buf, "Stop:", 5) == 0)
+ {
+ if (pending_stop_reply)
+ /* We've already parsed the in-flight stop-reply, but the stub
+ for some reason thought we didn't, possibly due to timeout
+ on its side. Just ignore it. */
+ ;
+ else
+ {
+ struct cleanup *old_chain;
+ struct stop_reply *reply = stop_reply_xmalloc ();
+ old_chain = make_cleanup (do_stop_reply_xfree, reply);
+
+ remote_parse_stop_reply (buf + 5, reply);
+
+ discard_cleanups (old_chain);
+
+ /* Be careful to only set it after parsing, since an error
+ may be thrown then. */
+ pending_stop_reply = reply;
+
+ /* Notify the event loop there's a stop reply to acknowledge
+ and that there may be more events to fetch. */
+ mark_async_event_handler (remote_async_get_pending_events_token);
+ }
+ }
+ else
+ /* We ignore notifications we don't recognize, for compatibility
+ with newer stubs. */
+ ;
+}
+
+
/* Read or write LEN bytes from inferior memory at MEMADDR,
transferring to or from debugger address BUFFER. Write to inferior
if SHOULD_WRITE is nonzero. Returns length of data written or
@@ -4901,7 +5819,7 @@ readchar (int timeout)
switch ((enum serial_rc) ch)
{
case SERIAL_EOF:
- target_mourn_inferior ();
+ pop_target ();
error (_("Remote connection closed"));
/* no return */
case SERIAL_ERROR:
@@ -4929,6 +5847,28 @@ remote_send (char **buf,
error (_("Remote failure reply: %s"), *buf);
}
+/* Return a pointer to an xmalloc'ed string representing an escaped
+ version of BUF, of len N. E.g. \n is converted to \\n, \t to \\t,
+ etc. The caller is responsible for releasing the returned
+ memory. */
+
+static char *
+escape_buffer (const char *buf, int n)
+{
+ struct cleanup *old_chain;
+ struct ui_file *stb;
+ char *str;
+ long length;
+
+ stb = mem_fileopen ();
+ old_chain = make_cleanup_ui_file_delete (stb);
+
+ fputstrn_unfiltered (buf, n, 0, stb);
+ str = ui_file_xstrdup (stb, &length);
+ do_cleanups (old_chain);
+ return str;
+}
+
/* Display a null-terminated packet on stdout, for debugging, using C
string notation. */
@@ -4964,6 +5904,16 @@ putpkt_binary (char *buf, int cnt)
int tcount = 0;
char *p;
+ /* Catch cases like trying to read memory or listing threads while
+ we're waiting for a stop reply. The remote server wouldn't be
+ ready to handle this request, so we'd hang and timeout. We don't
+ have to worry about this in synchronous mode, because in that
+ case it's not possible to issue a command while the target is
+ running. This is not a problem in non-stop mode, because in that
+ case, the stub is always ready to process serial input. */
+ if (!non_stop && target_can_async_p () && rs->waiting_for_stop_reply)
+ error (_("Cannot execute this command while the target is running."));
+
/* We're sending out a new packet. Make sure we don't look at a
stale cached response. */
rs->cached_wait_status = 0;
@@ -4991,11 +5941,15 @@ putpkt_binary (char *buf, int cnt)
if (remote_debug)
{
+ struct cleanup *old_chain;
+ char *str;
+
*p = '\0';
- fprintf_unfiltered (gdb_stdlog, "Sending packet: ");
- fputstrn_unfiltered (buf2, p - buf2, 0, gdb_stdlog);
- fprintf_unfiltered (gdb_stdlog, "...");
+ str = escape_buffer (buf2, p - buf2);
+ old_chain = make_cleanup (xfree, str);
+ fprintf_unfiltered (gdb_stdlog, "Sending packet: %s...", str);
gdb_flush (gdb_stdlog);
+ do_cleanups (old_chain);
}
if (serial_write (remote_desc, buf2, p - buf2))
perror_with_name (_("putpkt: write failed"));
@@ -5005,7 +5959,8 @@ putpkt_binary (char *buf, int cnt)
if (rs->noack_mode)
break;
- /* Read until either a timeout occurs (-2) or '+' is read. */
+ /* Read until either a timeout occurs (-2) or '+' is read.
+ Handle any notification that arrives in the mean time. */
while (1)
{
ch = readchar (remote_timeout);
@@ -5018,6 +5973,7 @@ putpkt_binary (char *buf, int cnt)
case '-':
case SERIAL_TIMEOUT:
case '$':
+ case '%':
if (started_error_output)
{
putchar_unfiltered ('\n');
@@ -5053,6 +6009,50 @@ putpkt_binary (char *buf, int cnt)
serial_write (remote_desc, "+", 1);
continue; /* Now, go look for +. */
}
+
+ case '%':
+ {
+ int val;
+
+ /* If we got a notification, handle it, and go back to looking
+ for an ack. */
+ /* We've found the start of a notification. Now
+ collect the data. */
+ val = read_frame (&rs->buf, &rs->buf_size);
+ if (val >= 0)
+ {
+ if (remote_debug)
+ {
+ struct cleanup *old_chain;
+ char *str;
+
+ str = escape_buffer (rs->buf, val);
+ old_chain = make_cleanup (xfree, str);
+ fprintf_unfiltered (gdb_stdlog,
+ " Notification received: %s\n",
+ str);
+ do_cleanups (old_chain);
+ }
+ handle_notification (rs->buf, val);
+ /* We're in sync now, rewait for the ack. */
+ tcount = 0;
+ }
+ else
+ {
+ if (remote_debug)
+ {
+ if (!started_error_output)
+ {
+ started_error_output = 1;
+ fprintf_unfiltered (gdb_stdlog, "putpkt: Junk: ");
+ }
+ fputc_unfiltered (ch & 0177, gdb_stdlog);
+ fprintf_unfiltered (gdb_stdlog, "%s", rs->buf);
+ }
+ }
+ continue;
+ }
+ /* fall-through */
default:
if (remote_debug)
{
@@ -5195,11 +6195,16 @@ read_frame (char **buf_p,
if (remote_debug)
{
- fprintf_filtered (gdb_stdlog,
- "Bad checksum, sentsum=0x%x, csum=0x%x, buf=",
- pktcsum, csum);
- fputstrn_filtered (buf, bc, 0, gdb_stdlog);
- fputs_filtered ("\n", gdb_stdlog);
+ struct cleanup *old_chain;
+ char *str;
+
+ str = escape_buffer (buf, bc);
+ old_chain = make_cleanup (xfree, str);
+ fprintf_unfiltered (gdb_stdlog,
+ "\
+Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n",
+ pktcsum, csum, str);
+ do_cleanups (old_chain);
}
/* Number of characters in buffer ignoring trailing
NULL. */
@@ -5277,10 +6282,13 @@ getpkt (char **buf,
rather than timing out; this is used (in synchronous mode) to wait
for a target that is is executing user code to stop. If FOREVER ==
0, this function is allowed to time out gracefully and return an
- indication of this to the caller. Otherwise return the number
- of bytes read. */
+ indication of this to the caller. Otherwise return the number of
+ bytes read. If EXPECTING_NOTIF, consider receiving a notification
+ enough reason to return to the caller. */
+
static int
-getpkt_sane (char **buf, long *sizeof_buf, int forever)
+getpkt_or_notif_sane_1 (char **buf, long *sizeof_buf, int forever,
+ int expecting_notif)
{
struct remote_state *rs = get_remote_state ();
int c;
@@ -5295,57 +6303,87 @@ getpkt_sane (char **buf, long *sizeof_buf, int forever)
strcpy (*buf, "timeout");
if (forever)
- {
- timeout = watchdog > 0 ? watchdog : -1;
- }
-
+ timeout = watchdog > 0 ? watchdog : -1;
+ else if (expecting_notif)
+ timeout = 0; /* There should already be a char in the buffer. If
+ not, bail out. */
else
timeout = remote_timeout;
#define MAX_TRIES 3
- for (tries = 1; tries <= MAX_TRIES; tries++)
+ /* Process any number of notifications, and then return when
+ we get a packet. */
+ for (;;)
{
- /* This can loop forever if the remote side sends us characters
- continuously, but if it pauses, we'll get a zero from
- readchar because of timeout. Then we'll count that as a
- retry. */
-
- /* Note that we will only wait forever prior to the start of a
- packet. After that, we expect characters to arrive at a
- brisk pace. They should show up within remote_timeout
- intervals. */
-
- do
+ /* If we get a timeout or bad checksm, retry up to MAX_TRIES
+ times. */
+ for (tries = 1; tries <= MAX_TRIES; tries++)
{
- c = readchar (timeout);
+ /* This can loop forever if the remote side sends us
+ characters continuously, but if it pauses, we'll get
+ SERIAL_TIMEOUT from readchar because of timeout. Then
+ we'll count that as a retry.
+
+ Note that even when forever is set, we will only wait
+ forever prior to the start of a packet. After that, we
+ expect characters to arrive at a brisk pace. They should
+ show up within remote_timeout intervals. */
+ do
+ c = readchar (timeout);
+ while (c != SERIAL_TIMEOUT && c != '$' && c != '%');
if (c == SERIAL_TIMEOUT)
{
+ if (expecting_notif)
+ return -1; /* Don't complain, it's normal to not get
+ anything in this case. */
+
if (forever) /* Watchdog went off? Kill the target. */
{
QUIT;
- target_mourn_inferior ();
+ pop_target ();
error (_("Watchdog timeout has expired. Target detached."));
}
if (remote_debug)
fputs_filtered ("Timed out.\n", gdb_stdlog);
- goto retry;
}
+ else
+ {
+ /* We've found the start of a packet or notification.
+ Now collect the data. */
+ val = read_frame (buf, sizeof_buf);
+ if (val >= 0)
+ break;
+ }
+
+ serial_write (remote_desc, "-", 1);
}
- while (c != '$');
- /* We've found the start of a packet, now collect the data. */
+ if (tries > MAX_TRIES)
+ {
+ /* We have tried hard enough, and just can't receive the
+ packet/notification. Give up. */
+ printf_unfiltered (_("Ignoring packet error, continuing...\n"));
- val = read_frame (buf, sizeof_buf);
+ /* Skip the ack char if we're in no-ack mode. */
+ if (!rs->noack_mode)
+ serial_write (remote_desc, "+", 1);
+ return -1;
+ }
- if (val >= 0)
+ /* If we got an ordinary packet, return that to our caller. */
+ if (c == '$')
{
if (remote_debug)
{
- fprintf_unfiltered (gdb_stdlog, "Packet received: ");
- fputstrn_unfiltered (*buf, val, 0, gdb_stdlog);
- fprintf_unfiltered (gdb_stdlog, "\n");
+ struct cleanup *old_chain;
+ char *str;
+
+ str = escape_buffer (*buf, val);
+ old_chain = make_cleanup (xfree, str);
+ fprintf_unfiltered (gdb_stdlog, "Packet received: %s\n", str);
+ do_cleanups (old_chain);
}
/* Skip the ack char if we're in no-ack mode. */
@@ -5354,31 +6392,51 @@ getpkt_sane (char **buf, long *sizeof_buf, int forever)
return val;
}
- /* Try the whole thing again. */
- retry:
- /* Skip the nack char if we're in no-ack mode. */
- if (!rs->noack_mode)
- serial_write (remote_desc, "-", 1);
- }
+ /* If we got a notification, handle it, and go back to looking
+ for a packet. */
+ else
+ {
+ gdb_assert (c == '%');
- /* We have tried hard enough, and just can't receive the packet.
- Give up. */
+ if (remote_debug)
+ {
+ struct cleanup *old_chain;
+ char *str;
- printf_unfiltered (_("Ignoring packet error, continuing...\n"));
+ str = escape_buffer (*buf, val);
+ old_chain = make_cleanup (xfree, str);
+ fprintf_unfiltered (gdb_stdlog,
+ " Notification received: %s\n",
+ str);
+ do_cleanups (old_chain);
+ }
- /* Skip the ack char if we're in no-ack mode. */
- if (!rs->noack_mode)
- serial_write (remote_desc, "+", 1);
- return -1;
+ handle_notification (*buf, val);
+
+ /* Notifications require no acknowledgement. */
+
+ if (expecting_notif)
+ return -1;
+ }
+ }
}
+
+static int
+getpkt_sane (char **buf, long *sizeof_buf, int forever)
+{
+ return getpkt_or_notif_sane_1 (buf, sizeof_buf, forever, 0);
+}
+
+static int
+getpkt_or_notif_sane (char **buf, long *sizeof_buf, int forever)
+{
+ return getpkt_or_notif_sane_1 (buf, sizeof_buf, forever, 1);
+}
+
static void
remote_kill (void)
{
- /* Unregister the file descriptor from the event loop. */
- if (target_is_async_p ())
- serial_async (remote_desc, NULL, 0);
-
/* Use catch_errors so the user can quit from gdb even when we
aren't on speaking terms with the remote system. */
catch_errors ((catch_errors_ftype *) putpkt, "k", "", RETURN_MASK_ERROR);
@@ -5441,27 +6499,24 @@ extended_remote_kill (void)
}
static void
-remote_mourn (void)
+remote_mourn (struct target_ops *ops)
{
- remote_mourn_1 (&remote_ops);
+ remote_mourn_1 (ops);
}
/* Worker function for remote_mourn. */
static void
remote_mourn_1 (struct target_ops *target)
{
- /* Get rid of all the inferiors and their threads we were
- controlling. */
- discard_all_inferiors ();
-
unpush_target (target);
- generic_mourn_inferior ();
+
+ /* remote_close takes care of cleaning up. */
}
static int
select_new_thread_callback (struct thread_info *th, void* data)
{
- if (!ptid_equal (th->ptid, minus_one_ptid))
+ if (!is_exited (th->ptid))
{
switch_to_thread (th->ptid);
printf_filtered (_("[Switching to %s]\n"),
@@ -5476,6 +6531,13 @@ extended_remote_mourn_1 (struct target_ops *target)
{
struct remote_state *rs = get_remote_state ();
+ /* In case we got here due to an error, but we're going to stay
+ connected. */
+ rs->waiting_for_stop_reply = 0;
+
+ /* We're no longer interested in these events. */
+ discard_pending_stop_replies (ptid_get_pid (inferior_ptid));
+
/* Unlike "target remote", we do not want to unpush the target; then
the next time the user says "run", we won't be connected. */
@@ -5522,9 +6584,9 @@ extended_remote_mourn_1 (struct target_ops *target)
}
static void
-extended_remote_mourn (void)
+extended_remote_mourn (struct target_ops *ops)
{
- extended_remote_mourn_1 (&extended_remote_ops);
+ extended_remote_mourn_1 (ops);
}
static int
@@ -5546,13 +6608,14 @@ extended_remote_run (char *args)
error (_("Remote file name too long for run packet"));
len += 2 * bin2hex ((gdb_byte *) remote_exec_file, rs->buf + len, 0);
+ gdb_assert (args != NULL);
if (*args)
{
struct cleanup *back_to;
int i;
char **argv;
- argv = buildargv (args);
+ argv = gdb_buildargv (args);
back_to = make_cleanup ((void (*) (void *)) freeargv, argv);
for (i = 0; argv[i] != NULL; i++)
{
@@ -5626,6 +6689,9 @@ extended_remote_create_inferior_1 (char *exec_file, char *args,
/* Now mark the inferior as running before we do anything else. */
inferior_ptid = magic_null_ptid;
+ /* Now, if we have thread information, update inferior_ptid. */
+ inferior_ptid = remote_current_thread (inferior_ptid);
+
add_inferior (ptid_get_pid (inferior_ptid));
add_thread_silent (inferior_ptid);
@@ -5636,7 +6702,8 @@ extended_remote_create_inferior_1 (char *exec_file, char *args,
}
static void
-extended_remote_create_inferior (char *exec_file, char *args,
+extended_remote_create_inferior (struct target_ops *ops,
+ char *exec_file, char *args,
char **env, int from_tty)
{
extended_remote_create_inferior_1 (exec_file, args, env, from_tty);
@@ -5929,23 +6996,6 @@ remote_remove_hw_breakpoint (struct bp_target_info *bp_tgt)
_("remote_remove_hw_breakpoint: reached end of function"));
}
-/* Some targets are only capable of doing downloads, and afterwards
- they switch to the remote serial protocol. This function provides
- a clean way to get from the download target to the remote target.
- It's basically just a wrapper so that we don't have to expose any
- of the internal workings of remote.c.
-
- Prior to calling this routine, you should shutdown the current
- target code, else you will get the "A program is being debugged
- already..." message. Usually a call to pop_target() suffices. */
-
-void
-push_remote_target (char *name, int from_tty)
-{
- printf_filtered (_("Switching to remote protocol\n"));
- remote_open (name, from_tty);
-}
-
/* Table used by the crc32 function to calcuate the checksum. */
static unsigned long crc32_table[256] =
@@ -7221,12 +8271,6 @@ remote_hostio_error (int errnum)
}
static void
-fclose_cleanup (void *file)
-{
- fclose (file);
-}
-
-static void
remote_hostio_close_cleanup (void *opaque)
{
int fd = *(int *) opaque;
@@ -7343,7 +8387,7 @@ remote_file_put (const char *local_file, const char *remote_file, int from_tty)
file = fopen (local_file, "rb");
if (file == NULL)
perror_with_name (local_file);
- back_to = make_cleanup (fclose_cleanup, file);
+ back_to = make_cleanup_fclose (file);
fd = remote_hostio_open (remote_file, (FILEIO_O_WRONLY | FILEIO_O_CREAT
| FILEIO_O_TRUNC),
@@ -7433,7 +8477,7 @@ remote_file_get (const char *remote_file, const char *local_file, int from_tty)
file = fopen (local_file, "wb");
if (file == NULL)
perror_with_name (local_file);
- back_to = make_cleanup (fclose_cleanup, file);
+ back_to = make_cleanup_fclose (file);
/* Send up to this many bytes at once. They won't all fit in the
remote packet limit, so we'll transfer slightly fewer. */
@@ -7491,9 +8535,10 @@ remote_put_command (char *args, int from_tty)
struct cleanup *back_to;
char **argv;
- argv = buildargv (args);
- if (argv == NULL)
- nomem (0);
+ if (args == NULL)
+ error_no_arg (_("file to put"));
+
+ argv = gdb_buildargv (args);
back_to = make_cleanup_freeargv (argv);
if (argv[0] == NULL || argv[1] == NULL || argv[2] != NULL)
error (_("Invalid parameters to remote put"));
@@ -7509,9 +8554,10 @@ remote_get_command (char *args, int from_tty)
struct cleanup *back_to;
char **argv;
- argv = buildargv (args);
- if (argv == NULL)
- nomem (0);
+ if (args == NULL)
+ error_no_arg (_("file to get"));
+
+ argv = gdb_buildargv (args);
back_to = make_cleanup_freeargv (argv);
if (argv[0] == NULL || argv[1] == NULL || argv[2] != NULL)
error (_("Invalid parameters to remote get"));
@@ -7527,9 +8573,10 @@ remote_delete_command (char *args, int from_tty)
struct cleanup *back_to;
char **argv;
- argv = buildargv (args);
- if (argv == NULL)
- nomem (0);
+ if (args == NULL)
+ error_no_arg (_("file to delete"));
+
+ argv = gdb_buildargv (args);
back_to = make_cleanup_freeargv (argv);
if (argv[0] == NULL || argv[1] != NULL)
error (_("Invalid parameters to remote delete"));
@@ -7545,6 +8592,27 @@ remote_command (char *args, int from_tty)
help_list (remote_cmdlist, "remote ", -1, gdb_stdout);
}
+static int remote_target_can_reverse = 1;
+
+static int
+remote_can_execute_reverse (void)
+{
+ return remote_target_can_reverse;
+}
+
+static int
+remote_supports_non_stop (void)
+{
+ return 1;
+}
+
+static int
+remote_supports_multi_process (void)
+{
+ struct remote_state *rs = get_remote_state ();
+ return remote_multi_process_p (rs);
+}
+
static void
init_remote_ops (void)
{
@@ -7593,6 +8661,7 @@ Specify the serial device it is connected to\n\
remote_ops.to_has_registers = 1;
remote_ops.to_has_execution = 1;
remote_ops.to_has_thread_control = tc_schedlock; /* can lock scheduler */
+ remote_ops.to_can_execute_reverse = remote_can_execute_reverse;
remote_ops.to_magic = OPS_MAGIC;
remote_ops.to_memory_map = remote_memory_map;
remote_ops.to_flash_erase = remote_flash_erase;
@@ -7605,6 +8674,8 @@ Specify the serial device it is connected to\n\
remote_ops.to_async_mask = remote_async_mask;
remote_ops.to_terminal_inferior = remote_terminal_inferior;
remote_ops.to_terminal_ours = remote_terminal_ours;
+ remote_ops.to_supports_non_stop = remote_supports_non_stop;
+ remote_ops.to_supports_multi_process = remote_supports_multi_process;
}
/* Set up the extended remote vector by making a copy of the standard
@@ -7669,6 +8740,18 @@ remote_async_serial_handler (struct serial *scb, void *context)
}
static void
+remote_async_inferior_event_handler (gdb_client_data data)
+{
+ inferior_event_handler (INF_REG_EVENT, NULL);
+}
+
+static void
+remote_async_get_pending_events_handler (gdb_client_data data)
+{
+ remote_get_pending_stop_replies ();
+}
+
+static void
remote_async (void (*callback) (enum inferior_event_type event_type,
void *context), void *context)
{
diff --git a/gdb/reply_mig_hack.awk b/gdb/reply_mig_hack.awk
index a201d06..4d8f6c1 100644
--- a/gdb/reply_mig_hack.awk
+++ b/gdb/reply_mig_hack.awk
@@ -101,7 +101,7 @@ parse_phase == 5 && /^#if[ \t]TypeCheck/ {
# structure that we want to check for.
print "\tif (In0P->Head.msgh_size == sizeof (Reply)";
print "\t && ! (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)";
- print "\t && *(int *)&In0P->" arg_type_code_name[0] " == *(int *)&" arg_check_name[0];
+ print "\t && ! BAD_TYPECHECK(&In0P->" arg_type_code_name[0] ", &" arg_check_name[0] ")";
print "\t && In0P->" arg_name[0] " != 0)";
print "\t /* Error return, only the error code argument is passed. */";
print "\t {";
diff --git a/gdb/reverse.c b/gdb/reverse.c
new file mode 100644
index 0000000..a37d1e3
--- /dev/null
+++ b/gdb/reverse.c
@@ -0,0 +1,144 @@
+/* Reverse execution and reverse debugging.
+
+ Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+#include "defs.h"
+#include "gdb_string.h"
+#include "target.h"
+#include "top.h"
+#include "cli/cli-cmds.h"
+#include "cli/cli-decode.h"
+#include "inferior.h"
+
+/* User interface:
+ reverse-step, reverse-next etc. */
+
+static void
+exec_direction_default (void *notused)
+{
+ /* Return execution direction to default state. */
+ execution_direction = EXEC_FORWARD;
+}
+
+/* exec_reverse_once -- accepts an arbitrary gdb command (string),
+ and executes it with exec-direction set to 'reverse'.
+
+ Used to implement reverse-next etc. commands. */
+
+static void
+exec_reverse_once (char *cmd, char *args, int from_tty)
+{
+ char *reverse_command;
+ enum exec_direction_kind dir = execution_direction;
+ struct cleanup *old_chain;
+
+ if (dir == EXEC_ERROR)
+ error (_("Target %s does not support this command."), target_shortname);
+
+ if (dir == EXEC_REVERSE)
+ error (_("Already in reverse mode. Use '%s' or 'set exec-dir forward'."),
+ cmd);
+
+ if (!target_can_execute_reverse)
+ error (_("Target %s does not support this command."), target_shortname);
+
+ reverse_command = xstrprintf ("%s %s", cmd, args ? args : "");
+ old_chain = make_cleanup (exec_direction_default, NULL);
+ make_cleanup (xfree, reverse_command);
+ execution_direction = EXEC_REVERSE;
+ execute_command (reverse_command, from_tty);
+ do_cleanups (old_chain);
+}
+
+static void
+reverse_step (char *args, int from_tty)
+{
+ exec_reverse_once ("step", args, from_tty);
+}
+
+static void
+reverse_stepi (char *args, int from_tty)
+{
+ exec_reverse_once ("stepi", args, from_tty);
+}
+
+static void
+reverse_next (char *args, int from_tty)
+{
+ exec_reverse_once ("next", args, from_tty);
+}
+
+static void
+reverse_nexti (char *args, int from_tty)
+{
+ exec_reverse_once ("nexti", args, from_tty);
+}
+
+static void
+reverse_continue (char *args, int from_tty)
+{
+ exec_reverse_once ("continue", args, from_tty);
+}
+
+static void
+reverse_finish (char *args, int from_tty)
+{
+ exec_reverse_once ("finish", args, from_tty);
+}
+
+void
+_initialize_reverse (void)
+{
+ add_com ("reverse-step", class_run, reverse_step, _("\
+Step program backward until it reaches the beginning of another source line.\n\
+Argument N means do this N times (or till program stops for another reason).")
+ );
+ add_com_alias ("rs", "reverse-step", class_alias, 1);
+
+ add_com ("reverse-next", class_run, reverse_next, _("\
+Step program backward, proceeding through subroutine calls.\n\
+Like the \"reverse-step\" command as long as subroutine calls do not happen;\n\
+when they do, the call is treated as one instruction.\n\
+Argument N means do this N times (or till program stops for another reason).")
+ );
+ add_com_alias ("rn", "reverse-next", class_alias, 1);
+
+ add_com ("reverse-stepi", class_run, reverse_stepi, _("\
+Step backward exactly one instruction.\n\
+Argument N means do this N times (or till program stops for another reason).")
+ );
+ add_com_alias ("rsi", "reverse-stepi", class_alias, 0);
+
+ add_com ("reverse-nexti", class_run, reverse_nexti, _("\
+Step backward one instruction, but proceed through called subroutines.\n\
+Argument N means do this N times (or till program stops for another reason).")
+ );
+ add_com_alias ("rni", "reverse-nexti", class_alias, 0);
+
+ add_com ("reverse-continue", class_run, reverse_continue, _("\
+Continue program being debugged but run it in reverse.\n\
+If proceeding from breakpoint, a number N may be used as an argument,\n\
+which means to set the ignore count of that breakpoint to N - 1 (so that\n\
+the breakpoint won't break until the Nth time it is reached)."));
+ add_com_alias ("rc", "reverse-continue", class_alias, 0);
+
+ add_com ("reverse-finish", class_run, reverse_finish, _("\
+Execute backward until just before selected stack frame is called."));
+}
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 27632d3..6501def 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -966,17 +966,18 @@ vmap_exec (void)
/* Set the current architecture from the host running GDB. Called when
starting a child process. */
-static void (*super_create_inferior) (char *exec_file, char *allargs,
- char **env, int from_tty);
+static void (*super_create_inferior) (struct target_ops *,char *exec_file,
+ char *allargs, char **env, int from_tty);
static void
-rs6000_create_inferior (char *exec_file, char *allargs, char **env, int from_tty)
+rs6000_create_inferior (struct target_ops * ops, char *exec_file,
+ char *allargs, char **env, int from_tty)
{
enum bfd_architecture arch;
unsigned long mach;
bfd abfd;
struct gdbarch_info info;
- super_create_inferior (exec_file, allargs, env, from_tty);
+ super_create_inferior (ops, exec_file, allargs, env, from_tty);
if (__power_rs ())
{
diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c
index 42d2502..0b25590 100644
--- a/gdb/scm-lang.c
+++ b/gdb/scm-lang.c
@@ -50,7 +50,8 @@ scm_printchar (int c, struct ui_file *stream)
static void
scm_printstr (struct ui_file *stream, const gdb_byte *string,
- unsigned int length, int width, int force_ellipses)
+ unsigned int length, int width, int force_ellipses,
+ const struct value_print_options *options)
{
fprintf_filtered (stream, "\"%s\"", string);
}
diff --git a/gdb/scm-lang.h b/gdb/scm-lang.h
index 654095c..369905b 100644
--- a/gdb/scm-lang.h
+++ b/gdb/scm-lang.h
@@ -46,16 +46,16 @@
struct value;
extern int scm_value_print (struct value *, struct ui_file *,
- int, enum val_prettyprint);
+ const struct value_print_options *);
extern int scm_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
- struct ui_file *, int, int, int,
- enum val_prettyprint);
+ struct ui_file *, int,
+ const struct value_print_options *);
extern LONGEST scm_get_field (LONGEST, int);
-extern void scm_scmval_print (LONGEST, struct ui_file *, int, int, int,
- enum val_prettyprint);
+extern void scm_scmval_print (LONGEST, struct ui_file *, int,
+ const struct value_print_options *);
extern int is_scmvalue_type (struct type *);
diff --git a/gdb/scm-valprint.c b/gdb/scm-valprint.c
index feb43dd..006f280 100644
--- a/gdb/scm-valprint.c
+++ b/gdb/scm-valprint.c
@@ -33,18 +33,18 @@
#include "objfiles.h"
static void scm_ipruk (char *, LONGEST, struct ui_file *);
-static void scm_scmlist_print (LONGEST, struct ui_file *, int, int,
- int, enum val_prettyprint);
-static int scm_inferior_print (LONGEST, struct ui_file *, int, int,
- int, enum val_prettyprint);
+static void scm_scmlist_print (LONGEST, struct ui_file *, int,
+ const struct value_print_options *);
+static int scm_inferior_print (LONGEST, struct ui_file *, int,
+ const struct value_print_options *);
/* Prints the SCM value VALUE by invoking the inferior, if appropraite.
Returns >= 0 on success; return -1 if the inferior cannot/should not
print VALUE. */
static int
-scm_inferior_print (LONGEST value, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
+scm_inferior_print (LONGEST value, struct ui_file *stream,
+ int recurse, const struct value_print_options *options)
{
struct objfile *objf;
struct gdbarch *gdbarch;
@@ -129,17 +129,16 @@ static char *scm_isymnames[] =
};
static void
-scm_scmlist_print (LONGEST svalue, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
+scm_scmlist_print (LONGEST svalue, struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
- unsigned int more = print_max;
+ unsigned int more = options->print_max;
if (recurse > 6)
{
fputs_filtered ("...", stream);
return;
}
- scm_scmval_print (SCM_CAR (svalue), stream, format,
- deref_ref, recurse + 1, pretty);
+ scm_scmval_print (SCM_CAR (svalue), stream, recurse + 1, options);
svalue = SCM_CDR (svalue);
for (; SCM_NIMP (svalue); svalue = SCM_CDR (svalue))
{
@@ -151,14 +150,12 @@ scm_scmlist_print (LONGEST svalue, struct ui_file *stream, int format,
fputs_filtered ("...", stream);
return;
}
- scm_scmval_print (SCM_CAR (svalue), stream, format,
- deref_ref, recurse + 1, pretty);
+ scm_scmval_print (SCM_CAR (svalue), stream, recurse + 1, options);
}
if (SCM_NNULLP (svalue))
{
fputs_filtered (" . ", stream);
- scm_scmval_print (svalue, stream, format,
- deref_ref, recurse + 1, pretty);
+ scm_scmval_print (svalue, stream, recurse + 1, options);
}
}
@@ -174,15 +171,17 @@ scm_ipruk (char *hdr, LONGEST ptr, struct ui_file *stream)
}
void
-scm_scmval_print (LONGEST svalue, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty)
+scm_scmval_print (LONGEST svalue, struct ui_file *stream,
+ int recurse, const struct value_print_options *options)
{
taloop:
switch (7 & (int) svalue)
{
case 2:
case 6:
- print_longest (stream, format ? format : 'd', 1, svalue >> 2);
+ print_longest (stream,
+ options->format ? options->format : 'd',
+ 1, svalue >> 2);
break;
case 4:
if (SCM_ICHRP (svalue))
@@ -243,14 +242,12 @@ taloop:
case scm_tcs_cons_imcar:
case scm_tcs_cons_nimcar:
fputs_filtered ("(", stream);
- scm_scmlist_print (svalue, stream, format,
- deref_ref, recurse + 1, pretty);
+ scm_scmlist_print (svalue, stream, recurse + 1, options);
fputs_filtered (")", stream);
break;
case scm_tcs_closures:
fputs_filtered ("#<CLOSURE ", stream);
- scm_scmlist_print (SCM_CODE (svalue), stream, format,
- deref_ref, recurse + 1, pretty);
+ scm_scmlist_print (SCM_CODE (svalue), stream, recurse + 1, options);
fputs_filtered (">", stream);
break;
case scm_tc7_string:
@@ -261,9 +258,9 @@ taloop:
int done = 0;
int buf_size;
gdb_byte buffer[64];
- int truncate = print_max && len > (int) print_max;
+ int truncate = options->print_max && len > (int) options->print_max;
if (truncate)
- len = print_max;
+ len = options->print_max;
fputs_filtered ("\"", stream);
for (; done < len; done += buf_size)
{
@@ -305,8 +302,8 @@ taloop:
{
if (i > 0)
fputs_filtered (" ", stream);
- scm_scmval_print (scm_get_field (elements, i), stream, format,
- deref_ref, recurse + 1, pretty);
+ scm_scmval_print (scm_get_field (elements, i), stream,
+ recurse + 1, options);
}
fputs_filtered (")", stream);
}
@@ -401,21 +398,19 @@ taloop:
int
scm_val_print (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format, int deref_ref,
- int recurse, enum val_prettyprint pretty)
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
if (is_scmvalue_type (type))
{
LONGEST svalue = extract_signed_integer (valaddr, TYPE_LENGTH (type));
- if (scm_inferior_print (svalue, stream, format,
- deref_ref, recurse, pretty) >= 0)
+ if (scm_inferior_print (svalue, stream, recurse, options) >= 0)
{
}
else
{
- scm_scmval_print (svalue, stream, format,
- deref_ref, recurse, pretty);
+ scm_scmval_print (svalue, stream, recurse, options);
}
gdb_flush (stream);
@@ -423,15 +418,15 @@ scm_val_print (struct type *type, const gdb_byte *valaddr,
}
else
{
- return c_val_print (type, valaddr, 0, address, stream, format,
- deref_ref, recurse, pretty);
+ return c_val_print (type, valaddr, 0, address, stream, recurse, options);
}
}
int
-scm_value_print (struct value *val, struct ui_file *stream, int format,
- enum val_prettyprint pretty)
+scm_value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options)
{
- return (common_val_print (val, stream, format, 1, 0, pretty,
- current_language));
+ struct value_print_options opts = *options;
+ opts.deref_ref = 1;
+ return (common_val_print (val, stream, 0, &opts, current_language));
}
diff --git a/gdb/ser-mingw.c b/gdb/ser-mingw.c
index 98b8368..99612df 100644
--- a/gdb/ser-mingw.c
+++ b/gdb/ser-mingw.c
@@ -32,6 +32,8 @@
#include "gdb_assert.h"
#include "gdb_string.h"
+#include "command.h"
+
void _initialize_ser_windows (void);
struct ser_windows_state
@@ -817,13 +819,18 @@ pipe_windows_open (struct serial *scb, const char *name)
{
struct pipe_state *ps;
FILE *pex_stderr;
+ char **argv;
+ struct cleanup *back_to;
+
+ if (name == NULL)
+ error_no_arg (_("child command"));
+
+ argv = gdb_buildargv (name);
+ back_to = make_cleanup_freeargv (argv);
- char **argv = buildargv (name);
- struct cleanup *back_to = make_cleanup_freeargv (argv);
if (! argv[0] || argv[0][0] == '\0')
error ("missing child command");
-
ps = make_pipe_state ();
make_cleanup (cleanup_pipe_state, ps);
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index 7fd9c94..988e8cb 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -40,6 +40,7 @@
#include "arch-utils.h"
#include "regcache.h"
#include "osabi.h"
+#include "valprint.h"
#include "elf-bfd.h"
@@ -211,7 +212,7 @@ sh64_register_name (struct gdbarch *gdbarch, int reg_nr)
MSYMBOL_IS_SPECIAL tests the "special" bit in a minimal symbol */
#define MSYMBOL_IS_SPECIAL(msym) \
- (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0)
+ MSYMBOL_TARGET_FLAG_1 (msym)
static void
sh64_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
@@ -221,7 +222,7 @@ sh64_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym)
if (((elf_symbol_type *)(sym))->internal_elf_sym.st_other == STO_SH5_ISA32)
{
- MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) | 0x80000000);
+ MSYMBOL_TARGET_FLAG_1 (msym) = 1;
SYMBOL_VALUE_ADDRESS (msym) |= 1;
}
}
@@ -2092,6 +2093,7 @@ sh64_do_register (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, int regnum)
{
unsigned char raw_buffer[MAX_REGISTER_SIZE];
+ struct value_print_options opts;
fputs_filtered (gdbarch_register_name (gdbarch, regnum), file);
print_spaces_filtered (15 - strlen (gdbarch_register_name
@@ -2100,12 +2102,16 @@ sh64_do_register (struct gdbarch *gdbarch, struct ui_file *file,
/* Get the data in raw format. */
if (!frame_register_read (frame, regnum, raw_buffer))
fprintf_filtered (file, "*value not available*\n");
-
+
+ get_formatted_print_options (&opts, 'x');
+ opts.deref_ref = 1;
val_print (register_type (gdbarch, regnum), raw_buffer, 0, 0,
- file, 'x', 1, 0, Val_pretty_default, current_language);
+ file, 0, &opts, current_language);
fprintf_filtered (file, "\t");
+ get_formatted_print_options (&opts, 0);
+ opts.deref_ref = 1;
val_print (register_type (gdbarch, regnum), raw_buffer, 0, 0,
- file, 0, 1, 0, Val_pretty_default, current_language);
+ file, 0, &opts, current_language);
fprintf_filtered (file, "\n");
}
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 8f99ac1..103a697 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -348,10 +348,10 @@ sol_thread_open (char *arg, int from_tty)
for the trace-trap that results from attaching. */
static void
-sol_thread_attach (char *args, int from_tty)
+sol_thread_attach (struct target_ops *ops, char *args, int from_tty)
{
sol_thread_active = 0;
- procfs_ops.to_attach (args, from_tty);
+ procfs_ops.to_attach (&procfs_ops, args, from_tty);
/* Must get symbols from shared libraries before libthread_db can run! */
solib_add (NULL, from_tty, (struct target_ops *) 0, auto_solib_add);
@@ -379,12 +379,12 @@ sol_thread_attach (char *args, int from_tty)
program was started via the normal ptrace (PTRACE_TRACEME). */
static void
-sol_thread_detach (char *args, int from_tty)
+sol_thread_detach (struct target_ops *ops, char *args, int from_tty)
{
sol_thread_active = 0;
inferior_ptid = pid_to_ptid (PIDGET (main_ph.ptid));
unpush_target (&sol_thread_ops);
- procfs_ops.to_detach (args, from_tty);
+ procfs_ops.to_detach (&procfs_ops, args, from_tty);
}
/* Resume execution of process PTID. If STEP is nozero, then just
@@ -753,11 +753,11 @@ sol_thread_notice_signals (ptid_t ptid)
/* Fork an inferior process, and start debugging it with /proc. */
static void
-sol_thread_create_inferior (char *exec_file, char *allargs, char **env,
- int from_tty)
+sol_thread_create_inferior (struct target_ops *ops, char *exec_file,
+ char *allargs, char **env, int from_tty)
{
sol_thread_active = 0;
- procfs_ops.to_create_inferior (exec_file, allargs, env, from_tty);
+ procfs_ops.to_create_inferior (&procfs_ops, exec_file, allargs, env, from_tty);
if (sol_thread_active && !ptid_equal (inferior_ptid, null_ptid))
{
@@ -822,11 +822,11 @@ sol_thread_new_objfile (struct objfile *objfile)
/* Clean up after the inferior dies. */
static void
-sol_thread_mourn_inferior (void)
+sol_thread_mourn_inferior (struct target_ops *ops)
{
sol_thread_active = 0;
unpush_target (&sol_thread_ops);
- procfs_ops.to_mourn_inferior ();
+ procfs_ops.to_mourn_inferior (&procfs_ops);
}
/* Mark our target-struct as eligible for stray "run" and "attach"
@@ -1411,10 +1411,10 @@ sol_core_close (int quitting)
}
static void
-sol_core_detach (char *args, int from_tty)
+sol_core_detach (struct target_ops *ops, char *args, int from_tty)
{
unpush_target (&core_ops);
- orig_core_ops.to_detach (args, from_tty);
+ orig_core_ops.to_detach (&orig_core_ops, args, from_tty);
}
static void
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index 189fbe0..a8ef73b 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -124,6 +124,9 @@ fetch_loadmap (CORE_ADDR ldmaddr)
nsegs = extract_unsigned_integer (ext_ldmbuf_partial.nsegs,
sizeof ext_ldmbuf_partial.nsegs);
+ if (nsegs <= 0)
+ return NULL;
+
/* Allocate space for the complete (external) loadmap. */
ext_ldmbuf_size = sizeof (struct ext_elf32_fdpic_loadmap)
+ (nsegs - 1) * sizeof (struct ext_elf32_fdpic_loadseg);
@@ -860,16 +863,17 @@ static void
frv_relocate_main_executable (void)
{
int status;
- CORE_ADDR exec_addr;
+ CORE_ADDR exec_addr, interp_addr;
struct int_elf32_fdpic_loadmap *ldm;
struct cleanup *old_chain;
struct section_offsets *new_offsets;
int changed;
struct obj_section *osect;
- status = frv_fdpic_loadmap_addresses (target_gdbarch, 0, &exec_addr);
+ status = frv_fdpic_loadmap_addresses (target_gdbarch,
+ &interp_addr, &exec_addr);
- if (status < 0)
+ if (status < 0 || (exec_addr == 0 && interp_addr == 0))
{
/* Not using FDPIC ABI, so do nothing. */
return;
diff --git a/gdb/solib-osf.c b/gdb/solib-osf.c
index efb8cf8..df04f3a 100644
--- a/gdb/solib-osf.c
+++ b/gdb/solib-osf.c
@@ -55,6 +55,7 @@
#include "inferior.h"
#include "gdbthread.h"
#include "solist.h"
+#include "solib.h"
#ifdef USE_LDR_ROUTINES
# include <loader.h>
diff --git a/gdb/solib-som.c b/gdb/solib-som.c
index 4d876ff..529bd75 100644
--- a/gdb/solib-som.c
+++ b/gdb/solib-som.c
@@ -391,7 +391,7 @@ som_solib_desire_dynamic_linker_symbols (void)
objfile);
if (dld_msymbol != NULL)
{
- if (SYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline)
+ if (MSYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline)
{
u = find_unwind_entry (SYMBOL_VALUE (dld_msymbol));
if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT))
@@ -430,7 +430,7 @@ som_solib_desire_dynamic_linker_symbols (void)
objfile);
if (dld_msymbol != NULL)
{
- if (SYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline)
+ if (MSYMBOL_TYPE (dld_msymbol) == mst_solib_trampoline)
{
u = find_unwind_entry (SYMBOL_VALUE (dld_msymbol));
if ((u != NULL) && (u->stub_unwind.stub_type == EXPORT))
diff --git a/gdb/solib.c b/gdb/solib.c
index d40e70e..d04a907 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -510,7 +510,7 @@ update_solib_list (int from_tty, struct target_ops *target)
/* We can reach here due to changing solib-search-path or the
sysroot, before having any inferior. */
- if (target_has_execution)
+ if (target_has_execution && !ptid_equal (inferior_ptid, null_ptid))
{
struct inferior *inf = current_inferior ();
diff --git a/gdb/source.c b/gdb/source.c
index 9493fd1..c41c193 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -428,12 +428,9 @@ add_path (char *dirname, char **which_path, int parse_separators)
/* This will properly parse the space and tab separators
and any quotes that may exist. DIRNAME_SEPARATOR will
be dealt with later. */
- argv = buildargv (dirname);
+ argv = gdb_buildargv (dirname);
make_cleanup_freeargv (argv);
- if (argv == NULL)
- nomem (0);
-
arg = argv[0];
}
else
@@ -1067,7 +1064,7 @@ symtab_to_fullname (struct symtab *s)
r = find_and_open_source (s->objfile, s->filename, s->dirname,
&s->fullname);
- if (r)
+ if (r >= 0)
{
close (r);
return s->fullname;
@@ -1096,7 +1093,7 @@ psymtab_to_fullname (struct partial_symtab *ps)
r = find_and_open_source (ps->objfile, ps->filename, ps->dirname,
&ps->fullname);
- if (r)
+ if (r >= 0)
{
close (r);
return ps->fullname;
@@ -1254,6 +1251,7 @@ static int
get_filename_and_charpos (struct symtab *s, char **fullname)
{
int desc, linenums_changed = 0;
+ struct cleanup *cleanups;
desc = open_source_file (s);
if (desc < 0)
@@ -1262,13 +1260,14 @@ get_filename_and_charpos (struct symtab *s, char **fullname)
*fullname = NULL;
return 0;
}
+ cleanups = make_cleanup_close (desc);
if (fullname)
*fullname = s->fullname;
if (s->line_charpos == 0)
linenums_changed = 1;
if (linenums_changed)
find_source_lines (s, desc);
- close (desc);
+ do_cleanups (cleanups);
return linenums_changed;
}
@@ -1315,6 +1314,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
int desc;
FILE *stream;
int nlines = stopline - line;
+ struct cleanup *cleanup;
/* Regardless of whether we can open the file, set current_source_symtab. */
current_source_symtab = s;
@@ -1381,6 +1381,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
stream = fdopen (desc, FDOPEN_MODE);
clearerr (stream);
+ cleanup = make_cleanup_fclose (stream);
while (nlines-- > 0)
{
@@ -1420,7 +1421,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
while (c != '\n' && (c = fgetc (stream)) >= 0);
}
- fclose (stream);
+ do_cleanups (cleanup);
}
/* Show source lines from the file of symtab S, starting with line
@@ -1541,6 +1542,7 @@ forward_search_command (char *regex, int from_tty)
FILE *stream;
int line;
char *msg;
+ struct cleanup *cleanups;
line = last_line_listed + 1;
@@ -1554,24 +1556,21 @@ forward_search_command (char *regex, int from_tty)
desc = open_source_file (current_source_symtab);
if (desc < 0)
perror_with_name (current_source_symtab->filename);
+ cleanups = make_cleanup_close (desc);
if (current_source_symtab->line_charpos == 0)
find_source_lines (current_source_symtab, desc);
if (line < 1 || line > current_source_symtab->nlines)
- {
- close (desc);
- error (_("Expression not found"));
- }
+ error (_("Expression not found"));
if (lseek (desc, current_source_symtab->line_charpos[line - 1], 0) < 0)
- {
- close (desc);
- perror_with_name (current_source_symtab->filename);
- }
+ perror_with_name (current_source_symtab->filename);
+ discard_cleanups (cleanups);
stream = fdopen (desc, FDOPEN_MODE);
clearerr (stream);
+ cleanups = make_cleanup_fclose (stream);
while (1)
{
static char *buf = NULL;
@@ -1623,7 +1622,7 @@ forward_search_command (char *regex, int from_tty)
}
printf_filtered (_("Expression not found\n"));
- fclose (stream);
+ do_cleanups (cleanups);
}
static void
@@ -1634,6 +1633,7 @@ reverse_search_command (char *regex, int from_tty)
FILE *stream;
int line;
char *msg;
+ struct cleanup *cleanups;
line = last_line_listed - 1;
@@ -1647,24 +1647,21 @@ reverse_search_command (char *regex, int from_tty)
desc = open_source_file (current_source_symtab);
if (desc < 0)
perror_with_name (current_source_symtab->filename);
+ cleanups = make_cleanup_close (desc);
if (current_source_symtab->line_charpos == 0)
find_source_lines (current_source_symtab, desc);
if (line < 1 || line > current_source_symtab->nlines)
- {
- close (desc);
- error (_("Expression not found"));
- }
+ error (_("Expression not found"));
if (lseek (desc, current_source_symtab->line_charpos[line - 1], 0) < 0)
- {
- close (desc);
- perror_with_name (current_source_symtab->filename);
- }
+ perror_with_name (current_source_symtab->filename);
+ discard_cleanups (cleanups);
stream = fdopen (desc, FDOPEN_MODE);
clearerr (stream);
+ cleanups = make_cleanup_fclose (stream);
while (line > 1)
{
/* FIXME!!! We walk right off the end of buf if we get a long line!!! */
@@ -1710,7 +1707,7 @@ reverse_search_command (char *regex, int from_tty)
}
printf_filtered (_("Expression not found\n"));
- fclose (stream);
+ do_cleanups (cleanups);
return;
}
@@ -1813,7 +1810,7 @@ show_substitute_path_command (char *args, int from_tty)
char **argv;
char *from = NULL;
- argv = buildargv (args);
+ argv = gdb_buildargv (args);
make_cleanup_freeargv (argv);
/* We expect zero or one argument. */
@@ -1846,7 +1843,7 @@ static void
unset_substitute_path_command (char *args, int from_tty)
{
struct substitute_path_rule *rule = substitute_path_rules;
- char **argv = buildargv (args);
+ char **argv = gdb_buildargv (args);
char *from = NULL;
int rule_found = 0;
@@ -1899,7 +1896,7 @@ set_substitute_path_command (char *args, int from_tty)
char **argv;
struct substitute_path_rule *rule;
- argv = buildargv (args);
+ argv = gdb_buildargv (args);
make_cleanup_freeargv (argv);
if (argv == NULL || argv[0] == NULL || argv [1] == NULL)
diff --git a/gdb/stack.c b/gdb/stack.c
index 2efe3e5..3c1019b 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -368,6 +368,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
if (val)
{
const struct language_defn *language;
+ struct value_print_options opts;
/* Use the appropriate language to display our symbol,
unless the user forced the language to a specific
@@ -377,8 +378,10 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
else
language = current_language;
- common_val_print (val, stb->stream, 0, 0, 2,
- Val_no_prettyprint, language);
+ get_raw_print_options (&opts);
+ opts.deref_ref = 0;
+ common_val_print (val, stb->stream, 2,
+ &opts, language);
ui_out_field_stream (uiout, "value", stb);
}
else
@@ -547,6 +550,8 @@ print_frame_info (struct frame_info *frame, int print_level,
sal.line + 1, 0);
else
{
+ struct value_print_options opts;
+ get_user_print_options (&opts);
/* We used to do this earlier, but that is clearly
wrong. This function is used by many different
parts of gdb, including normal_stop in infrun.c,
@@ -555,7 +560,7 @@ print_frame_info (struct frame_info *frame, int print_level,
line. Only the command line really wants this
behavior. Other UIs probably would like the
ability to decide for themselves if it is desired. */
- if (addressprint && mid_statement)
+ if (opts.addressprint && mid_statement)
{
ui_out_field_core_addr (uiout, "addr", get_frame_pc (frame));
ui_out_text (uiout, "\t");
@@ -584,6 +589,7 @@ print_frame (struct frame_info *frame, int print_level,
enum language funlang = language_unknown;
struct ui_stream *stb;
struct cleanup *old_chain, *list_chain;
+ struct value_print_options opts;
stb = ui_out_stream_new (uiout);
old_chain = make_cleanup_ui_out_stream_delete (stb);
@@ -665,7 +671,8 @@ print_frame (struct frame_info *frame, int print_level,
ui_out_field_fmt_int (uiout, 2, ui_left, "level",
frame_relative_level (frame));
}
- if (addressprint)
+ get_user_print_options (&opts);
+ if (opts.addressprint)
if (get_frame_pc (frame) != sal.pc || !sal.symtab
|| print_what == LOC_AND_ADDRESS)
{
@@ -1282,7 +1289,7 @@ backtrace_command (char *arg, int from_tty)
char **argv;
int i;
- argv = buildargv (arg);
+ argv = gdb_buildargv (arg);
old_chain = make_cleanup_freeargv (argv);
argc = 0;
for (i = 0; argv[i]; i++)
@@ -1405,10 +1412,12 @@ print_block_frame_labels (struct block *b, int *have_default,
if (SYMBOL_CLASS (sym) == LOC_LABEL)
{
struct symtab_and_line sal;
+ struct value_print_options opts;
sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0);
values_printed = 1;
fputs_filtered (SYMBOL_PRINT_NAME (sym), stream);
- if (addressprint)
+ get_user_print_options (&opts);
+ if (opts.addressprint)
{
fprintf_filtered (stream, " ");
fputs_filtered (paddress (SYMBOL_VALUE_ADDRESS (sym)), stream);
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 5964b84..d9aff2f 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -896,11 +896,6 @@ syms_from_objfile (struct objfile *objfile,
(*objfile->sf->sym_read) (objfile, mainline);
- /* Mark the objfile has having had initial symbol read attempted. Note
- that this does not mean we found any symbols... */
-
- objfile->flags |= OBJF_SYMS;
-
/* Discard cleanups as symbol reading was successful. */
discard_cleanups (old_chain);
@@ -1488,14 +1483,11 @@ symbol_file_command (char *args, int from_tty)
}
else
{
- char **argv = buildargv (args);
+ char **argv = gdb_buildargv (args);
int flags = OBJF_USERLOADED;
struct cleanup *cleanups;
char *name = NULL;
- if (argv == NULL)
- nomem (0);
-
cleanups = make_cleanup_freeargv (argv);
while (*argv != NULL)
{
@@ -1929,11 +1921,10 @@ generic_load (char *args, int from_tty)
make_cleanup (clear_memory_write_data, &cbdata.requests);
- argv = buildargv (args);
-
- if (argv == NULL)
- nomem(0);
+ if (args == NULL)
+ error_no_arg (_("file to load"));
+ argv = gdb_buildargv (args);
make_cleanup_freeargv (argv);
filename = tilde_expand (argv[0]);
@@ -2122,12 +2113,9 @@ add_symbol_file_command (char *args, int from_tty)
if (args == NULL)
error (_("add-symbol-file takes a file name and an address"));
- argv = buildargv (args);
+ argv = gdb_buildargv (args);
make_cleanup_freeargv (argv);
- if (argv == NULL)
- nomem (0);
-
for (arg = argv[0], argcnt = 0; arg != NULL; arg = argv[++argcnt])
{
/* Process the argument. */
@@ -2440,7 +2428,6 @@ reread_symbols (void)
printf_unfiltered (_("(no debugging symbols found)\n"));
wrap_here ("");
}
- objfile->flags |= OBJF_SYMS;
/* We're done reading the symbol file; finish off complaints. */
clear_complaints (&symfile_complaints, 0, 1);
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index af65497..ae52448 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -276,7 +276,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
{
struct obj_section *section = SYMBOL_OBJ_SECTION (msymbol);
- switch (msymbol->type)
+ switch (MSYMBOL_TYPE (msymbol))
{
case mst_unknown:
ms_type = 'u';
@@ -526,10 +526,7 @@ maintenance_print_symbols (char *args, int from_tty)
error (_("\
Arguments missing: an output file name and an optional symbol file name"));
}
- else if ((argv = buildargv (args)) == NULL)
- {
- nomem (0);
- }
+ argv = gdb_buildargv (args);
cleanups = make_cleanup_freeargv (argv);
if (argv[0] != NULL)
@@ -739,10 +736,7 @@ maintenance_print_psymbols (char *args, int from_tty)
{
error (_("print-psymbols takes an output file name and optional symbol file name"));
}
- else if ((argv = buildargv (args)) == NULL)
- {
- nomem (0);
- }
+ argv = gdb_buildargv (args);
cleanups = make_cleanup_freeargv (argv);
if (argv[0] != NULL)
@@ -878,10 +872,7 @@ maintenance_print_msymbols (char *args, int from_tty)
{
error (_("print-msymbols takes an output file name and optional symbol file name"));
}
- else if ((argv = buildargv (args)) == NULL)
- {
- nomem (0);
- }
+ argv = gdb_buildargv (args);
cleanups = make_cleanup_freeargv (argv);
if (argv[0] != NULL)
@@ -947,32 +938,36 @@ maintenance_info_symtabs (char *regexp, int from_tty)
int printed_objfile_start = 0;
ALL_OBJFILE_SYMTABS (objfile, symtab)
- if (! regexp
- || re_exec (symtab->filename))
- {
- if (! printed_objfile_start)
- {
- printf_filtered ("{ objfile %s ", objfile->name);
- wrap_here (" ");
- printf_filtered ("((struct objfile *) %p)\n", objfile);
- printed_objfile_start = 1;
- }
-
- printf_filtered (" { symtab %s ", symtab->filename);
- wrap_here (" ");
- printf_filtered ("((struct symtab *) %p)\n", symtab);
- printf_filtered (" dirname %s\n",
- symtab->dirname ? symtab->dirname : "(null)");
- printf_filtered (" fullname %s\n",
- symtab->fullname ? symtab->fullname : "(null)");
- printf_filtered (" blockvector ((struct blockvector *) %p)%s\n",
- symtab->blockvector,
- symtab->primary ? " (primary)" : "");
- printf_filtered (" linetable ((struct linetable *) %p)\n",
- symtab->linetable);
- printf_filtered (" debugformat %s\n", symtab->debugformat);
- printf_filtered (" }\n");
- }
+ {
+ QUIT;
+
+ if (! regexp
+ || re_exec (symtab->filename))
+ {
+ if (! printed_objfile_start)
+ {
+ printf_filtered ("{ objfile %s ", objfile->name);
+ wrap_here (" ");
+ printf_filtered ("((struct objfile *) %p)\n", objfile);
+ printed_objfile_start = 1;
+ }
+
+ printf_filtered (" { symtab %s ", symtab->filename);
+ wrap_here (" ");
+ printf_filtered ("((struct symtab *) %p)\n", symtab);
+ printf_filtered (" dirname %s\n",
+ symtab->dirname ? symtab->dirname : "(null)");
+ printf_filtered (" fullname %s\n",
+ symtab->fullname ? symtab->fullname : "(null)");
+ printf_filtered (" blockvector ((struct blockvector *) %p)%s\n",
+ symtab->blockvector,
+ symtab->primary ? " (primary)" : "");
+ printf_filtered (" linetable ((struct linetable *) %p)\n",
+ symtab->linetable);
+ printf_filtered (" debugformat %s\n", symtab->debugformat);
+ printf_filtered (" }\n");
+ }
+ }
if (printed_objfile_start)
printf_filtered ("}\n");
@@ -998,70 +993,74 @@ maintenance_info_psymtabs (char *regexp, int from_tty)
int printed_objfile_start = 0;
ALL_OBJFILE_PSYMTABS (objfile, psymtab)
- if (! regexp
- || re_exec (psymtab->filename))
- {
- if (! printed_objfile_start)
- {
- printf_filtered ("{ objfile %s ", objfile->name);
- wrap_here (" ");
- printf_filtered ("((struct objfile *) %p)\n", objfile);
- printed_objfile_start = 1;
- }
-
- printf_filtered (" { psymtab %s ", psymtab->filename);
- wrap_here (" ");
- printf_filtered ("((struct partial_symtab *) %p)\n", psymtab);
- printf_filtered (" readin %s\n",
- psymtab->readin ? "yes" : "no");
- printf_filtered (" fullname %s\n",
- psymtab->fullname ? psymtab->fullname : "(null)");
- printf_filtered (" text addresses ");
- fputs_filtered (paddress (psymtab->textlow), gdb_stdout);
- printf_filtered (" -- ");
- fputs_filtered (paddress (psymtab->texthigh), gdb_stdout);
- printf_filtered ("\n");
- printf_filtered (" globals ");
- if (psymtab->n_global_syms)
- {
- printf_filtered ("(* (struct partial_symbol **) %p @ %d)\n",
- (psymtab->objfile->global_psymbols.list
- + psymtab->globals_offset),
- psymtab->n_global_syms);
- }
- else
- printf_filtered ("(none)\n");
- printf_filtered (" statics ");
- if (psymtab->n_static_syms)
- {
- printf_filtered ("(* (struct partial_symbol **) %p @ %d)\n",
- (psymtab->objfile->static_psymbols.list
- + psymtab->statics_offset),
- psymtab->n_static_syms);
- }
- else
- printf_filtered ("(none)\n");
- printf_filtered (" dependencies ");
- if (psymtab->number_of_dependencies)
- {
- int i;
-
- printf_filtered ("{\n");
- for (i = 0; i < psymtab->number_of_dependencies; i++)
- {
- struct partial_symtab *dep = psymtab->dependencies[i];
-
- /* Note the string concatenation there --- no comma. */
- printf_filtered (" psymtab %s "
- "((struct partial_symtab *) %p)\n",
- dep->filename, dep);
- }
- printf_filtered (" }\n");
- }
- else
- printf_filtered ("(none)\n");
- printf_filtered (" }\n");
- }
+ {
+ QUIT;
+
+ if (! regexp
+ || re_exec (psymtab->filename))
+ {
+ if (! printed_objfile_start)
+ {
+ printf_filtered ("{ objfile %s ", objfile->name);
+ wrap_here (" ");
+ printf_filtered ("((struct objfile *) %p)\n", objfile);
+ printed_objfile_start = 1;
+ }
+
+ printf_filtered (" { psymtab %s ", psymtab->filename);
+ wrap_here (" ");
+ printf_filtered ("((struct partial_symtab *) %p)\n", psymtab);
+ printf_filtered (" readin %s\n",
+ psymtab->readin ? "yes" : "no");
+ printf_filtered (" fullname %s\n",
+ psymtab->fullname ? psymtab->fullname : "(null)");
+ printf_filtered (" text addresses ");
+ fputs_filtered (paddress (psymtab->textlow), gdb_stdout);
+ printf_filtered (" -- ");
+ fputs_filtered (paddress (psymtab->texthigh), gdb_stdout);
+ printf_filtered ("\n");
+ printf_filtered (" globals ");
+ if (psymtab->n_global_syms)
+ {
+ printf_filtered ("(* (struct partial_symbol **) %p @ %d)\n",
+ (psymtab->objfile->global_psymbols.list
+ + psymtab->globals_offset),
+ psymtab->n_global_syms);
+ }
+ else
+ printf_filtered ("(none)\n");
+ printf_filtered (" statics ");
+ if (psymtab->n_static_syms)
+ {
+ printf_filtered ("(* (struct partial_symbol **) %p @ %d)\n",
+ (psymtab->objfile->static_psymbols.list
+ + psymtab->statics_offset),
+ psymtab->n_static_syms);
+ }
+ else
+ printf_filtered ("(none)\n");
+ printf_filtered (" dependencies ");
+ if (psymtab->number_of_dependencies)
+ {
+ int i;
+
+ printf_filtered ("{\n");
+ for (i = 0; i < psymtab->number_of_dependencies; i++)
+ {
+ struct partial_symtab *dep = psymtab->dependencies[i];
+
+ /* Note the string concatenation there --- no comma. */
+ printf_filtered (" psymtab %s "
+ "((struct partial_symtab *) %p)\n",
+ dep->filename, dep);
+ }
+ printf_filtered (" }\n");
+ }
+ else
+ printf_filtered ("(none)\n");
+ printf_filtered (" }\n");
+ }
+ }
if (printed_objfile_start)
printf_filtered ("}\n");
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 437d414..3af3e8a 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -859,11 +859,11 @@ find_pc_sect_psymtab (CORE_ADDR pc, struct obj_section *section)
not include the data ranges. */
msymbol = lookup_minimal_symbol_by_pc_section (pc, section);
if (msymbol
- && (msymbol->type == mst_data
- || msymbol->type == mst_bss
- || msymbol->type == mst_abs
- || msymbol->type == mst_file_data
- || msymbol->type == mst_file_bss))
+ && (MSYMBOL_TYPE (msymbol) == mst_data
+ || MSYMBOL_TYPE (msymbol) == mst_bss
+ || MSYMBOL_TYPE (msymbol) == mst_abs
+ || MSYMBOL_TYPE (msymbol) == mst_file_data
+ || MSYMBOL_TYPE (msymbol) == mst_file_bss))
return NULL;
/* Try just the PSYMTABS_ADDRMAP mapping first as it has better granularity
@@ -1993,11 +1993,11 @@ find_pc_sect_symtab (CORE_ADDR pc, struct obj_section *section)
on the partial_symtab's texthigh and textlow. */
msymbol = lookup_minimal_symbol_by_pc_section (pc, section);
if (msymbol
- && (msymbol->type == mst_data
- || msymbol->type == mst_bss
- || msymbol->type == mst_abs
- || msymbol->type == mst_file_data
- || msymbol->type == mst_file_bss))
+ && (MSYMBOL_TYPE (msymbol) == mst_data
+ || MSYMBOL_TYPE (msymbol) == mst_bss
+ || MSYMBOL_TYPE (msymbol) == mst_abs
+ || MSYMBOL_TYPE (msymbol) == mst_file_data
+ || MSYMBOL_TYPE (msymbol) == mst_file_bss))
return NULL;
/* Search all symtabs for the one whose file contains our address, and which
@@ -2989,7 +2989,6 @@ sort_search_symbols (struct symbol_search *prevtail, int nfound)
Only symbols of KIND are searched:
FUNCTIONS_DOMAIN - search all functions
TYPES_DOMAIN - search all type names
- METHODS_DOMAIN - search all methods NOT IMPLEMENTED
VARIABLES_DOMAIN - search all symbols, excluding functions, type names,
and constants (enums)
@@ -3130,8 +3129,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
&& ((kind == VARIABLES_DOMAIN && SYMBOL_CLASS (*psym) != LOC_TYPEDEF
&& SYMBOL_CLASS (*psym) != LOC_BLOCK)
|| (kind == FUNCTIONS_DOMAIN && SYMBOL_CLASS (*psym) == LOC_BLOCK)
- || (kind == TYPES_DOMAIN && SYMBOL_CLASS (*psym) == LOC_TYPEDEF)
- || (kind == METHODS_DOMAIN && SYMBOL_CLASS (*psym) == LOC_BLOCK))))
+ || (kind == TYPES_DOMAIN && SYMBOL_CLASS (*psym) == LOC_TYPEDEF))))
{
PSYMTAB_TO_SYMTAB (ps);
keep_going = 0;
@@ -3206,8 +3204,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
&& SYMBOL_CLASS (sym) != LOC_BLOCK
&& SYMBOL_CLASS (sym) != LOC_CONST)
|| (kind == FUNCTIONS_DOMAIN && SYMBOL_CLASS (sym) == LOC_BLOCK)
- || (kind == TYPES_DOMAIN && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
- || (kind == METHODS_DOMAIN && SYMBOL_CLASS (sym) == LOC_BLOCK))))
+ || (kind == TYPES_DOMAIN && SYMBOL_CLASS (sym) == LOC_TYPEDEF))))
{
/* match */
psr = (struct symbol_search *) xmalloc (sizeof (struct symbol_search));
diff --git a/gdb/symtab.h b/gdb/symtab.h
index c124242..a1dee4f 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -319,21 +319,6 @@ struct minimal_symbol
struct general_symbol_info ginfo;
- /* The info field is available for caching machine-specific
- information so it doesn't have to rederive the info constantly
- (over a serial line). It is initialized to zero and stays that
- way until target-dependent code sets it. Storage for any data
- pointed to by this field should be allocated on the
- objfile_obstack for the associated objfile. The type would be
- "void *" except for reasons of compatibility with older
- compilers. This field is optional.
-
- Currently, the AMD 29000 tdep.c uses it to remember things it has decoded
- from the instructions in the function header, and the MIPS-16 code uses
- it to identify 16-bit procedures. */
-
- char *info;
-
/* Size of this symbol. end_psymtab in dbxread.c uses this
information to calculate the end of the partial symtab based on the
address of the last symbol plus the size of the last symbol. */
@@ -347,6 +332,10 @@ struct minimal_symbol
ENUM_BITFIELD(minimal_symbol_type) type : 8;
+ /* Two flag bits provided for the use of the target. */
+ unsigned int target_flag_1 : 1;
+ unsigned int target_flag_2 : 1;
+
/* Minimal symbols with the same hash key are kept on a linked
list. This is the link. */
@@ -358,7 +347,8 @@ struct minimal_symbol
struct minimal_symbol *demangled_hash_next;
};
-#define MSYMBOL_INFO(msymbol) (msymbol)->info
+#define MSYMBOL_TARGET_FLAG_1(msymbol) (msymbol)->target_flag_1
+#define MSYMBOL_TARGET_FLAG_2(msymbol) (msymbol)->target_flag_2
#define MSYMBOL_SIZE(msymbol) (msymbol)->size
#define MSYMBOL_TYPE(msymbol) (msymbol)->type
@@ -396,18 +386,15 @@ typedef enum domain_enum_tag
/* Searching domains. These overlap with VAR_DOMAIN, providing
some granularity with the search_symbols function. */
- /* Everything in VAR_DOMAIN minus FUNCTIONS_-, TYPES_-, and
- METHODS_DOMAIN */
+ /* Everything in VAR_DOMAIN minus FUNCTIONS_DOMAIN and
+ TYPES_DOMAIN. */
VARIABLES_DOMAIN,
/* All functions -- for some reason not methods, though. */
FUNCTIONS_DOMAIN,
/* All defined types */
- TYPES_DOMAIN,
-
- /* All class methods -- why is this separated out? */
- METHODS_DOMAIN
+ TYPES_DOMAIN
}
domain_enum;
@@ -1100,7 +1087,7 @@ extern void prim_record_minimal_symbol (const char *, CORE_ADDR,
extern struct minimal_symbol *prim_record_minimal_symbol_and_info
(const char *, CORE_ADDR,
enum minimal_symbol_type,
- char *info, int section, asection * bfd_section, struct objfile *);
+ int section, asection * bfd_section, struct objfile *);
extern unsigned int msymbol_hash_iw (const char *);
diff --git a/gdb/target.c b/gdb/target.c
index a509c17..3901ee7 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -99,9 +99,9 @@ static void debug_to_open (char *, int);
static void debug_to_close (int);
-static void debug_to_attach (char *, int);
+static void debug_to_attach (struct target_ops *ops, char *, int);
-static void debug_to_detach (char *, int);
+static void debug_to_detach (struct target_ops *ops, char *, int);
static void debug_to_resume (ptid_t, int, enum target_signal);
@@ -156,7 +156,7 @@ static void debug_to_load (char *, int);
static int debug_to_lookup_symbol (char *, CORE_ADDR *);
-static void debug_to_mourn_inferior (void);
+static void debug_to_mourn_inferior (struct target_ops *);
static int debug_to_can_run (void);
@@ -281,6 +281,24 @@ target_load (char *arg, int from_tty)
(*current_target.to_load) (arg, from_tty);
}
+void target_create_inferior (char *exec_file, char *args,
+ char **env, int from_tty)
+{
+ struct target_ops *t;
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ {
+ if (t->to_create_inferior != NULL)
+ {
+ t->to_create_inferior (t, exec_file, args, env, from_tty);
+ return;
+ }
+ }
+
+ internal_error (__FILE__, __LINE__,
+ "could not find a target to create inferior");
+}
+
+
static int
nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct target_ops *t)
@@ -351,6 +369,18 @@ kill_or_be_killed (int from_tty)
tcomplain ();
}
+/* A default implementation for the to_get_ada_task_ptid target method.
+
+ This function builds the PTID by using both LWP and TID as part of
+ the PTID lwp and tid elements. The pid used is the pid of the
+ inferior_ptid. */
+
+ptid_t
+default_get_ada_task_ptid (long lwp, long tid)
+{
+ return ptid_build (ptid_get_pid (inferior_ptid), lwp, tid);
+}
+
/* Go through the target stack from top to bottom, copying over zero
entries in current_target, then filling in still empty entries. In
effect, we are doing class inheritance through the pushed target
@@ -382,10 +412,10 @@ update_current_target (void)
INHERIT (to_doc, t);
/* Do not inherit to_open. */
/* Do not inherit to_close. */
- INHERIT (to_attach, t);
+ /* Do not inherit to_attach. */
INHERIT (to_post_attach, t);
INHERIT (to_attach_no_wait, t);
- INHERIT (to_detach, t);
+ /* Do not inherit to_detach. */
/* Do not inherit to_disconnect. */
INHERIT (to_resume, t);
INHERIT (to_wait, t);
@@ -416,7 +446,7 @@ update_current_target (void)
INHERIT (to_kill, t);
INHERIT (to_load, t);
INHERIT (to_lookup_symbol, t);
- INHERIT (to_create_inferior, t);
+ /* Do no inherit to_create_inferior. */
INHERIT (to_post_startup_inferior, t);
INHERIT (to_acknowledge_created_inferior, t);
INHERIT (to_insert_fork_catchpoint, t);
@@ -427,7 +457,7 @@ update_current_target (void)
INHERIT (to_insert_exec_catchpoint, t);
INHERIT (to_remove_exec_catchpoint, t);
INHERIT (to_has_exited, t);
- INHERIT (to_mourn_inferior, t);
+ /* Do no inherit to_mourn_inferiour. */
INHERIT (to_can_run, t);
INHERIT (to_notice_signals, t);
INHERIT (to_thread_alive, t);
@@ -455,8 +485,11 @@ update_current_target (void)
INHERIT (to_find_memory_regions, t);
INHERIT (to_make_corefile_notes, t);
INHERIT (to_get_thread_local_address, t);
+ INHERIT (to_can_execute_reverse, t);
/* Do not inherit to_read_description. */
+ INHERIT (to_get_ada_task_ptid, t);
/* Do not inherit to_search_memory. */
+ INHERIT (to_supports_multi_process, t);
INHERIT (to_magic, t);
/* Do not inherit to_memory_map. */
/* Do not inherit to_flash_erase. */
@@ -481,9 +514,6 @@ update_current_target (void)
de_fault (to_post_attach,
(void (*) (int))
target_ignore);
- de_fault (to_detach,
- (void (*) (char *, int))
- target_ignore);
de_fault (to_resume,
(void (*) (ptid_t, int, enum target_signal))
noprocess);
@@ -587,9 +617,6 @@ update_current_target (void)
de_fault (to_has_exited,
(int (*) (int, int, int *))
return_zero);
- de_fault (to_mourn_inferior,
- (void (*) (void))
- noprocess);
de_fault (to_can_run,
return_zero);
de_fault (to_notice_signals,
@@ -621,6 +648,12 @@ update_current_target (void)
(int (*) (int))
return_one);
current_target.to_read_description = NULL;
+ de_fault (to_get_ada_task_ptid,
+ (ptid_t (*) (long, long))
+ default_get_ada_task_ptid);
+ de_fault (to_supports_multi_process,
+ (int (*) (void))
+ return_zero);
#undef de_fault
/* Finally, position the target-stack beneath the squashed
@@ -746,6 +779,10 @@ unpush_target (struct target_ops *t)
struct target_ops **cur;
struct target_ops *tmp;
+ if (t->to_stratum == dummy_stratum)
+ internal_error (__FILE__, __LINE__,
+ "Attempt to unpush the dummy target");
+
/* Look for the specified target. Note that we assume that a target
can only occur once in the target stack. */
@@ -1727,11 +1764,18 @@ target_pre_inferior (int from_tty)
(gdb) attach 4712
Cannot access memory at address 0xdeadbeef
*/
- no_shared_libraries (NULL, from_tty);
- invalidate_target_mem_regions ();
+ /* In some OSs, the shared library list is the same/global/shared
+ across inferiors. If code is shared between processes, so are
+ memory regions and features. */
+ if (!gdbarch_has_global_solist (target_gdbarch))
+ {
+ no_shared_libraries (NULL, from_tty);
+
+ invalidate_target_mem_regions ();
- target_clear_description ();
+ target_clear_description ();
+ }
}
/* This is to be called by the open routine before it does
@@ -1765,11 +1809,27 @@ target_preopen (int from_tty)
void
target_detach (char *args, int from_tty)
{
- /* If we're in breakpoints-always-inserted mode, have to
- remove them before detaching. */
- remove_breakpoints ();
+ struct target_ops* t;
+
+ if (gdbarch_has_global_solist (target_gdbarch))
+ /* Don't remove global breakpoints here. They're removed on
+ disconnection from the target. */
+ ;
+ else
+ /* If we're in breakpoints-always-inserted mode, have to remove
+ them before detaching. */
+ remove_breakpoints ();
+
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ {
+ if (t->to_detach != NULL)
+ {
+ t->to_detach (t, args, from_tty);
+ return;
+ }
+ }
- (current_target.to_detach) (args, from_tty);
+ internal_error (__FILE__, __LINE__, "could not find a target to detach");
}
void
@@ -1777,8 +1837,9 @@ target_disconnect (char *args, int from_tty)
{
struct target_ops *t;
- /* If we're in breakpoints-always-inserted mode, have to
- remove them before disconnecting. */
+ /* If we're in breakpoints-always-inserted mode or if breakpoints
+ are global across processes, we have to remove them before
+ disconnecting. */
remove_breakpoints ();
for (t = current_target.beneath; t != NULL; t = t->beneath)
@@ -1827,6 +1888,23 @@ target_follow_fork (int follow_child)
"could not find a target to follow fork");
}
+void
+target_mourn_inferior (void)
+{
+ struct target_ops *t;
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ {
+ if (t->to_mourn_inferior != NULL)
+ {
+ t->to_mourn_inferior (t);
+ return;
+ }
+ }
+
+ internal_error (__FILE__, __LINE__,
+ "could not find a target to follow mourn inferiour");
+}
+
/* Look for a target which can describe architectural features, starting
from TARGET. If we find one, return its description. */
@@ -2072,23 +2150,24 @@ find_default_run_target (char *do_mesg)
}
void
-find_default_attach (char *args, int from_tty)
+find_default_attach (struct target_ops *ops, char *args, int from_tty)
{
struct target_ops *t;
t = find_default_run_target ("attach");
- (t->to_attach) (args, from_tty);
+ (t->to_attach) (t, args, from_tty);
return;
}
void
-find_default_create_inferior (char *exec_file, char *allargs, char **env,
+find_default_create_inferior (struct target_ops *ops,
+ char *exec_file, char *allargs, char **env,
int from_tty)
{
struct target_ops *t;
t = find_default_run_target ("run");
- (t->to_create_inferior) (exec_file, allargs, env, from_tty);
+ (t->to_create_inferior) (t, exec_file, allargs, env, from_tty);
return;
}
@@ -2332,7 +2411,6 @@ find_target_beneath (struct target_ops *t)
void
generic_mourn_inferior (void)
{
- extern int show_breakpoint_hit_counts;
ptid_t ptid;
ptid = inferior_ptid;
@@ -2350,13 +2428,6 @@ generic_mourn_inferior (void)
reopen_exec_file ();
reinit_frame_cache ();
- /* It is confusing to the user for ignore counts to stick around
- from previous runs of the inferior. So clear them. */
- /* However, it is more confusing for the ignore counts to disappear when
- using hit counts. So don't clear them if we're counting hits. */
- if (!show_breakpoint_hit_counts)
- breakpoint_clear_ignore_counts ();
-
if (deprecated_detach_hook)
deprecated_detach_hook ();
}
@@ -2424,6 +2495,8 @@ init_dummy_target (void)
dummy_target.to_longname = "None";
dummy_target.to_doc = "";
dummy_target.to_attach = find_default_attach;
+ dummy_target.to_detach =
+ (void (*)(struct target_ops *, char *, int))target_ignore;
dummy_target.to_create_inferior = find_default_create_inferior;
dummy_target.to_can_async_p = find_default_can_async_p;
dummy_target.to_is_async_p = find_default_is_async_p;
@@ -2460,10 +2533,28 @@ target_close (struct target_ops *targ, int quitting)
targ->to_close (quitting);
}
+void
+target_attach (char *args, int from_tty)
+{
+ struct target_ops *t;
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ {
+ if (t->to_attach != NULL)
+ {
+ t->to_attach (t, args, from_tty);
+ return;
+ }
+ }
+
+ internal_error (__FILE__, __LINE__,
+ "could not find a target to attach");
+}
+
+
static void
-debug_to_attach (char *args, int from_tty)
+debug_to_attach (struct target_ops *ops, char *args, int from_tty)
{
- debug_target.to_attach (args, from_tty);
+ debug_target.to_attach (&debug_target, args, from_tty);
fprintf_unfiltered (gdb_stdlog, "target_attach (%s, %d)\n", args, from_tty);
}
@@ -2478,9 +2569,9 @@ debug_to_post_attach (int pid)
}
static void
-debug_to_detach (char *args, int from_tty)
+debug_to_detach (struct target_ops *ops, char *args, int from_tty)
{
- debug_target.to_detach (args, from_tty);
+ debug_target.to_detach (&debug_target, args, from_tty);
fprintf_unfiltered (gdb_stdlog, "target_detach (%s, %d)\n", args, from_tty);
}
@@ -2883,10 +2974,11 @@ debug_to_lookup_symbol (char *name, CORE_ADDR *addrp)
}
static void
-debug_to_create_inferior (char *exec_file, char *args, char **env,
+debug_to_create_inferior (struct target_ops *ops,
+ char *exec_file, char *args, char **env,
int from_tty)
{
- debug_target.to_create_inferior (exec_file, args, env, from_tty);
+ debug_target.to_create_inferior (ops, exec_file, args, env, from_tty);
fprintf_unfiltered (gdb_stdlog, "target_create_inferior (%s, %s, xxx, %d)\n",
exec_file, args, from_tty);
@@ -2990,9 +3082,9 @@ debug_to_has_exited (int pid, int wait_status, int *exit_status)
}
static void
-debug_to_mourn_inferior (void)
+debug_to_mourn_inferior (struct target_ops *ops)
{
- debug_target.to_mourn_inferior ();
+ debug_target.to_mourn_inferior (&debug_target);
fprintf_unfiltered (gdb_stdlog, "target_mourn_inferior ()\n");
}
diff --git a/gdb/target.h b/gdb/target.h
index 067c031..05b681d 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -128,7 +128,11 @@ enum target_waitkind
inferior, rather than being stuck in the remote_async_wait()
function. This way the event loop is responsive to other events,
like for instance the user typing. */
- TARGET_WAITKIND_IGNORE
+ TARGET_WAITKIND_IGNORE,
+
+ /* The target has run out of history information,
+ and cannot run backward any further. */
+ TARGET_WAITKIND_NO_HISTORY
};
struct target_waitstatus
@@ -323,9 +327,9 @@ struct target_ops
to xfree everything (including the "struct target_ops"). */
void (*to_xclose) (struct target_ops *targ, int quitting);
void (*to_close) (int);
- void (*to_attach) (char *, int);
+ void (*to_attach) (struct target_ops *ops, char *, int);
void (*to_post_attach) (int);
- void (*to_detach) (char *, int);
+ void (*to_detach) (struct target_ops *ops, char *, int);
void (*to_disconnect) (struct target_ops *, char *, int);
void (*to_resume) (ptid_t, int, enum target_signal);
ptid_t (*to_wait) (ptid_t, struct target_waitstatus *);
@@ -383,7 +387,8 @@ struct target_ops
void (*to_kill) (void);
void (*to_load) (char *, int);
int (*to_lookup_symbol) (char *, CORE_ADDR *);
- void (*to_create_inferior) (char *, char *, char **, int);
+ void (*to_create_inferior) (struct target_ops *,
+ char *, char *, char **, int);
void (*to_post_startup_inferior) (ptid_t);
void (*to_acknowledge_created_inferior) (int);
void (*to_insert_fork_catchpoint) (int);
@@ -394,7 +399,7 @@ struct target_ops
void (*to_insert_exec_catchpoint) (int);
int (*to_remove_exec_catchpoint) (int);
int (*to_has_exited) (int, int, int *);
- void (*to_mourn_inferior) (void);
+ void (*to_mourn_inferior) (struct target_ops *);
int (*to_can_run) (void);
void (*to_notice_signals) (ptid_t ptid);
int (*to_thread_alive) (ptid_t ptid);
@@ -505,6 +510,12 @@ struct target_ops
was available. */
const struct target_desc *(*to_read_description) (struct target_ops *ops);
+ /* Build the PTID of the thread on which a given task is running,
+ based on LWP and THREAD. These values are extracted from the
+ task Private_Data section of the Ada Task Control Block, and
+ their interpretation depends on the target. */
+ ptid_t (*to_get_ada_task_ptid) (long lwp, long thread);
+
/* Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
Return 0 if *READPTR is already at the end of the buffer.
Return -1 if there is insufficient buffer for a whole entry.
@@ -523,6 +534,13 @@ struct target_ops
const gdb_byte *pattern, ULONGEST pattern_len,
CORE_ADDR *found_addrp);
+ /* Can target execute in reverse? */
+ int (*to_can_execute_reverse) ();
+
+ /* Does this target support debugging multiple processes
+ simultaneously? */
+ int (*to_supports_multi_process) (void);
+
int to_magic;
/* Need sub-structure for target machine related rather than comm related?
*/
@@ -563,8 +581,7 @@ void target_close (struct target_ops *targ, int quitting);
should be ready to deliver the status of the process immediately
(without waiting) to an upcoming target_wait call. */
-#define target_attach(args, from_tty) \
- (*current_target.to_attach) (args, from_tty)
+void target_attach (char *, int);
/* Some targets don't generate traps when attaching to the inferior,
or their target_attach implementation takes care of the waiting.
@@ -634,6 +651,12 @@ extern void target_resume (ptid_t ptid, int step, enum target_signal signal);
#define target_prepare_to_store(regcache) \
(*current_target.to_prepare_to_store) (regcache)
+/* Returns true if this target can debug multiple processes
+ simultaneously. */
+
+#define target_supports_multi_process() \
+ (*current_target.to_supports_multi_process) ()
+
extern DCACHE *target_dcache;
extern int target_read_string (CORE_ADDR, char **, int, int *);
@@ -808,9 +831,8 @@ extern void target_load (char *arg, int from_tty);
ENV is the environment vector to pass. Errors reported with error().
On VxWorks and various standalone systems, we ignore exec_file. */
-#define target_create_inferior(exec_file, args, env, FROM_TTY) \
- (*current_target.to_create_inferior) (exec_file, args, env, (FROM_TTY))
-
+void target_create_inferior (char *exec_file, char *args,
+ char **env, int from_tty);
/* Some targets (such as ttrace-based HPUX) don't allow us to request
notification of inferior events such as fork and vork immediately
@@ -880,8 +902,7 @@ int target_follow_fork (int follow_child);
/* The inferior process has died. Do what is right. */
-#define target_mourn_inferior() \
- (*current_target.to_mourn_inferior) ()
+void target_mourn_inferior (void);
/* Does target have enough data to do a run or attach command? */
@@ -1127,8 +1148,16 @@ extern int target_stopped_data_address_p (struct target_ops *);
#define target_watchpoint_addr_within_range(target, addr, start, length) \
(*target.to_watchpoint_addr_within_range) (target, addr, start, length)
+/* Target can execute in reverse? */
+#define target_can_execute_reverse \
+ (current_target.to_can_execute_reverse ? \
+ current_target.to_can_execute_reverse () : 0)
+
extern const struct target_desc *target_read_description (struct target_ops *);
+#define target_get_ada_task_ptid(lwp, tid) \
+ (*current_target.to_get_ada_task_ptid) (lwp,tid)
+
/* Utility implementation of searching memory. */
extern int simple_search_memory (struct target_ops* ops,
CORE_ADDR start_addr,
@@ -1238,9 +1267,10 @@ extern void noprocess (void);
extern void target_require_runnable (void);
-extern void find_default_attach (char *, int);
+extern void find_default_attach (struct target_ops *, char *, int);
-extern void find_default_create_inferior (char *, char *, char **, int);
+extern void find_default_create_inferior (struct target_ops *,
+ char *, char *, char **, int);
extern struct target_ops *find_run_target (void);
@@ -1301,9 +1331,6 @@ extern int default_target_signal_to_host (struct gdbarch *,
/* Convert from a number used in a GDB command to an enum target_signal. */
extern enum target_signal target_signal_from_command (int);
-/* Any target can call this to switch to remote protocol (in remote.c). */
-extern void push_remote_target (char *name, int from_tty);
-
/* Set the show memory breakpoints mode to show, and installs a cleanup
to restore it back to the current value. */
extern struct cleanup *make_show_memory_breakpoints_cleanup (int show);
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index d4d0811..a737872 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,165 @@
+2008-11-18 Thiago Jung Bauermann <bauerman@br.ibm.com>
+
+ * gdb.arch/ppc-dfp.exp: New file.
+ * gdb.arch/ppc-dfp.c: New file.
+
+2008-11-18 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * gdb.base/sepsymtab.exp: Update for new 'info sym' format.
+
+2008-11-17 Doug Evans <dje@google.com>
+
+ * gdb.mi/mi-syn-frame.exp: Update expected output.
+ * gdb.mi/mi2-syn-frame.exp: Update expected output.
+
+2008-11-17 Vladimir Prus <vladimir@codesourcery.com>
+
+ * gdb.mi/mi-pthreads.exp (check_mi_thread_command_set): Make sure
+ "thread N" results in =thread-selected.
+ * lib/mi-support (mi_run_cmd, mi_expect_stop)
+ (mi_send_resuming_command_raw): Be prepared for
+ =thread-selected.
+
+2008-11-17 Vladimir Prus <vladimir@codesourcery.com>
+
+ * gdb.mi/mi-nonstop.exp: Expect 'group-id' field.
+ * lib/mi-support.exp: Likewise.
+
+2008-11-16 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.base/help.exp: Remove the "catch load" and "catch unload"
+ commands from the expected output for "help catch".
+
+2008-11-15 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.ada/int_deref.exp: New testcase.
+
+2008-11-14 Nick Roberts <nickrob@snap.net.nz>
+
+ * gdb.mi/gdb2549.exp: New file.
+
+2008-11-11 Doug Evans <dje@google.com>
+
+ * gdb.base/callexit.exp: New file.
+ * gdb.base/callexit.c: New file.
+
+2008-11-10 Doug Evans <dje@google.com>
+
+ * lib/gdb.exp (GDBFLAGS): Move -nx ...
+ (INTERNAL_GDBFLAGS): ... to here. Move -nw to here as well.
+ (default_gdb_version): Add $INTERNAL_GDBFLAGS to gdb invocations.
+ (default_gdb_start,default_gdb_exit): Ditto.
+ * lib/mi-support.exp (default_mi_gdb_start): Ditto.
+ (mi_uncatched_gdb_exit): Add $INTERNAL_GDBFLAGS to log message.
+ * gdb.base/corefile.exp: Add $INTERNAL_GDBFLAGS to gdb invocations.
+ * gdb.base/dbx.exp (dbx_gdb_start): Ditto.
+ * gdb.base/args.exp (GDBFLAGS): Don't overwrite, append.
+ * gdb.base/remotetimeout.exp (GDBFLAGS): Ditto.
+
+2008-11-03 Andreas Schwab <schwab@suse.de>
+
+ * gdb.base/hashline2.exp: Fix typo.
+ * gdb.base/hashline3.exp: Likewise.
+
+2008-10-30 Tom Tromey <tromey@redhat.com>
+
+ * gdb.base/pointers.exp: Add test.
+ * gdb.base/pointers.c (k, S): New typedefs.
+ (instance): New global.
+
+2008-10-30 Andreas Schwab <schwab@suse.de>
+
+ * gdb.base/args.exp: Add tests for newlines.
+
+2008-10-30 Joel Brobecker <brobecker@adacore.com>
+
+ gdb.base/foll-exec.exp: Update the expected output of a couple
+ of "info breakpoints" tests.
+
+2008-10-28 Tom Tromey <tromey@redhat.com>
+
+ * gdb.base/exprs.exp (test_expr): Add enum formatting tests.
+
+2008-10-24 Pedro Alves <pedro@codesourcery.com>
+
+ * gdb.python/python-value.exp (test_value_in_inferior): Don't use
+ gdb_start_cmd.
+ Use runto_main before any test that requires execution.
+
+2008-10-23 Pedro Alves <pedro@codesourcery.com>
+
+ * lib/mi-support.exp (mi_expect_interrupt): Expect signal 0
+ instead of SIGINT.
+
+2008-10-22 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.base/completion.exp: Update expected output following
+ the addition of the "info tasks" command.
+
+2008-10-22 Tom Tromey <tromey@redhat.com>
+
+ * gdb.base/exprs.exp (test_expr): Add test for string
+ concatenation.
+
+2008-10-19 Pedro Alves <pedro@codesourcery.com>
+
+ * configure.ac: Output gdb.python/Makefile.
+ * configure: Regenerate.
+ * gdb.python/Makefile.in: New.
+
+2008-10-16 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.base/foll-fork.exp: Adjust the expected output to match
+ the new description for fork/vfork catchpoints in the "info
+ breakpoints" output.
+
+2008-10-16 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * Makefile.in: Add gdb.python to ALL_SUBDIRS.
+
+2008-10-16 Thiago Jung Bauermann <bauerman@br.ibm.com>
+
+ * gdb.python/python-value.c: New file.
+ * gdb.python/python-value.exp: New file.
+
+2008-10-15 Pedro Alves <pedro@codesourcery.com>
+
+ * gdb.mi/mi-nsmoribund.exp, gdb.mi/nsmoribund.c: New test.
+
+2008-10-15 Denis Pilat <denis.pilat@st.com>
+
+ * gdb.cp/mb-ctor.exp: Fix a typo.
+
+2008-10-09 Tom Tromey <tromey@redhat.com>
+
+ * gdb.base/macscp.exp: Use 'vafunc' and 'fixedarg' rather than
+ 'fprintf' and 'stderr'.
+
+2008-10-07 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.ada/ref_tick_size.exp: New testcase.
+
+2008-10-06 Doug Evans <dje@google.com>
+
+ * gdb.dwarf2/dw2-cu-size.exp: New file.
+ * gdb.dwarf2/dw2-cu-size.S: New file.
+
+ * gdb.dwarf2/dw2-intercu.S (.Ltype_int_in_cu2): Renamed from
+ .Ltype_int for clarity.
+
+2008-10-03 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ PR gdb/2384:
+ * gdb.cp/gdb2384.exp: Extended to test more cases.
+ * gdb.cp/gdb2384.cc: Likewise.
+ * gdb.cp/gdb2384-base.h: Likewise.
+ * gdb.cp/gdb2384-base.cc: Likewise.
+
+2008-10-02 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.base/maint.exp (maint print type): Remove printing
+ UPPER_BOUND_TYPE and LOWER_BOUND_TYPE.
+
2008-09-30 Tom Tromey <tromey@redhat.com>
* gdb.base/macscp.exp: Add completion tests.
diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index b97f860..11fc26e 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -36,7 +36,7 @@ RPATH_ENVVAR = @RPATH_ENVVAR@
ALL_SUBDIRS = gdb.ada gdb.arch gdb.asm gdb.base gdb.cp gdb.disasm \
gdb.dwarf2 \
gdb.fortran gdb.server gdb.java gdb.mi \
- gdb.objc gdb.opt gdb.pascal gdb.threads gdb.trace \
+ gdb.objc gdb.opt gdb.pascal gdb.python gdb.threads gdb.trace \
gdb.xml \
$(SUBDIRS)
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index 1a3e813..ef35b13 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -314,6 +314,7 @@ ac_includes_default="\
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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical subdirs RPATH_ENVVAR CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBOBJS LTLIBOBJS'
ac_subst_files=''
+ac_pwd=`pwd`
# Initialize some variables set by options.
ac_init_help=
@@ -1281,6 +1282,8 @@ echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi
done
if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ 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
@@ -1313,6 +1316,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
@@ -1850,11 +1856,13 @@ fi
fi
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { 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; }; }
+ { (exit 1); exit 1; }; }; }
# Provide some information about the compiler.
echo "$as_me:$LINENO:" \
@@ -1940,11 +1948,13 @@ else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { 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; }; }
+ { (exit 77); exit 77; }; }; }
fi
ac_exeext=$ac_cv_exeext
@@ -1969,13 +1979,15 @@ if test "$cross_compiling" != yes; then
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+ { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { 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; }; }
+ { (exit 1); exit 1; }; }; }
fi
fi
fi
@@ -2013,11 +2025,13 @@ for ac_file in conftest.exe conftest conftest.*; do
esac
done
else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+ { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { 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; }; }
+ { (exit 1); exit 1; }; }; }
fi
rm -f conftest$ac_cv_exeext
@@ -2064,11 +2078,13 @@ else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { 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; }; }
+ { (exit 1); exit 1; }; }; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
@@ -2693,11 +2709,13 @@ rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
:
else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+ { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { 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; }; }
+ { (exit 1); exit 1; }; }; }
fi
ac_ext=c
@@ -3113,7 +3131,7 @@ done
- ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
+ ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
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
@@ -3680,6 +3698,7 @@ do
"gdb.objc/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;;
"gdb.opt/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;;
"gdb.pascal/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;;
+ "gdb.python/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;;
"gdb.threads/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;;
"gdb.trace/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.trace/Makefile" ;;
"gdb.xml/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.xml/Makefile" ;;
diff --git a/gdb/testsuite/configure.ac b/gdb/testsuite/configure.ac
index 04d8773..3d8fae4 100644
--- a/gdb/testsuite/configure.ac
+++ b/gdb/testsuite/configure.ac
@@ -117,4 +117,5 @@ AC_OUTPUT([Makefile \
gdb.fortran/Makefile gdb.server/Makefile \
gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile \
gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile \
+ gdb.python/Makefile \
gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile])
diff --git a/gdb/testsuite/gdb.ada/int_deref.exp b/gdb/testsuite/gdb.ada/int_deref.exp
new file mode 100644
index 0000000..f0bba3a
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/int_deref.exp
@@ -0,0 +1,45 @@
+# Copyright 2008 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+load_lib "ada.exp"
+
+set testdir "int_deref"
+set testfile "${testdir}/foo"
+set srcfile ${srcdir}/${subdir}/${testfile}.adb
+set binfile ${objdir}/${subdir}/${testfile}
+
+file mkdir ${objdir}/${subdir}/${testdir}
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set bp_location [gdb_get_line_number "Pck.Watch" ${testdir}/foo.adb]
+runto "foo.adb:$bp_location"
+
+gdb_test "print *integer(watch'address)" \
+ " = 4874"
+
+gdb_test "print integer(watch'address).all" \
+ " = 4874"
+
diff --git a/gdb/testsuite/gdb.ada/int_deref/foo.adb b/gdb/testsuite/gdb.ada/int_deref/foo.adb
new file mode 100644
index 0000000..62cc983
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/int_deref/foo.adb
@@ -0,0 +1,21 @@
+-- Copyright 2008 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 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+with Pck;
+
+procedure Foo is
+begin
+ Pck.Watch := Pck.Watch + 1;
+end Foo;
diff --git a/gdb/testsuite/gdb.ada/int_deref/pck.ads b/gdb/testsuite/gdb.ada/int_deref/pck.ads
new file mode 100644
index 0000000..562ec84
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/int_deref/pck.ads
@@ -0,0 +1,20 @@
+-- Copyright 2008 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 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+package Pck is
+
+ Watch : Integer := 4874;
+
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/ref_tick_size.exp b/gdb/testsuite/gdb.ada/ref_tick_size.exp
new file mode 100644
index 0000000..ea4db3b
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/ref_tick_size.exp
@@ -0,0 +1,48 @@
+# Copyright 2008 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+load_lib "ada.exp"
+
+set testdir "ref_tick_size"
+set testfile "${testdir}/p"
+set srcfile ${srcdir}/${subdir}/${testfile}.adb
+set binfile ${objdir}/${subdir}/${testfile}
+
+file mkdir ${objdir}/${subdir}/${testdir}
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set bp_location [gdb_get_line_number "START" ${testdir}/p.adb]
+runto "p.adb:$bp_location"
+
+# Verify that the debugger computes the correct value for d2'size
+# (due to how this variable is declared, it is sometimes implemented
+# as a reference). We know it should be correct if it is equal to
+# the size of d1.
+
+gdb_test "print d1'size = d2'size" \
+ "= true" \
+ "print d1'size = d2'size"
+
diff --git a/gdb/testsuite/gdb.ada/ref_tick_size/p.adb b/gdb/testsuite/gdb.ada/ref_tick_size/p.adb
new file mode 100644
index 0000000..816bc02
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/ref_tick_size/p.adb
@@ -0,0 +1,29 @@
+-- Copyright 2008 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 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+with Interfaces;
+with Pck; use Pck;
+
+procedure P is
+ subtype Double is Interfaces.IEEE_Float_64;
+ D1 : Double := 123.0;
+ D2 : Double;
+ pragma Import (Ada, D2);
+ for D2'Address use D1'Address;
+begin
+ Do_Nothing (D1'Address); -- START
+ Do_Nothing (D2'Address);
+end P;
+
diff --git a/gdb/testsuite/gdb.ada/ref_tick_size/pck.adb b/gdb/testsuite/gdb.ada/ref_tick_size/pck.adb
new file mode 100644
index 0000000..efd828b
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/ref_tick_size/pck.adb
@@ -0,0 +1,25 @@
+-- Copyright 2008 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 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+with System;
+
+package body Pck is
+
+ procedure Do_Nothing (A : System.Address) is
+ begin
+ null;
+ end Do_Nothing;
+
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/ref_tick_size/pck.ads b/gdb/testsuite/gdb.ada/ref_tick_size/pck.ads
new file mode 100644
index 0000000..1dab958
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/ref_tick_size/pck.ads
@@ -0,0 +1,22 @@
+-- Copyright 2008 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 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+with System;
+
+package Pck is
+
+ procedure Do_Nothing (A : System.Address);
+
+end Pck;
diff --git a/gdb/testsuite/gdb.arch/ppc-dfp.c b/gdb/testsuite/gdb.arch/ppc-dfp.c
new file mode 100644
index 0000000..da0e44e
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/ppc-dfp.c
@@ -0,0 +1,46 @@
+/* Copyright 2008 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <elf.h>
+
+#ifdef __powerpc64__
+typedef Elf64_auxv_t auxv_t;
+#else
+typedef Elf32_auxv_t auxv_t;
+#endif
+
+#ifndef PPC_FEATURE_HAS_DFP
+#define PPC_FEATURE_HAS_DFP 0x00000400
+#endif
+
+int
+main (int argc, char *argv[], char *envp[], auxv_t auxv[])
+{
+ int i;
+
+ for (i = 0; auxv[i].a_type != AT_NULL; i++)
+ if (auxv[i].a_type == AT_HWCAP) {
+ if (!(auxv[i].a_un.a_val & PPC_FEATURE_HAS_DFP))
+ return 1;
+
+ break;
+ }
+
+ asm ("mtfsfi 7, 5, 1\n"); /* Set DFP rounding mode. */
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.arch/ppc-dfp.exp b/gdb/testsuite/gdb.arch/ppc-dfp.exp
new file mode 100644
index 0000000..3d87998
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/ppc-dfp.exp
@@ -0,0 +1,79 @@
+# Copyright (C) 2008 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# Tests for Powerpc Decimal Floating Point registers setting and fetching
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if ![istarget "powerpc*"] then {
+ verbose "Skipping powerpc decimal floating point register tests."
+ return
+}
+
+set testfile "ppc-dfp"
+set binfile ${objdir}/${subdir}/${testfile}
+set srcfile ${testfile}.c
+
+if [get_compiler_info $binfile] {
+ warning "get_compiler failed"
+ return -1
+}
+
+if ![test_compiler_info gcc*] {
+ # We use GCC's extended asm syntax
+ warning "unknown compiler"
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {quiet debug}] != "" } {
+ unsupported "This machine doesn't support Decimal Floating Point."
+ return -1
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_breakpoint [gdb_get_line_number "Set DFP rounding mode."]
+
+gdb_run_cmd
+
+# When the prompt comes back we'll be at the Set DFP rounding mode breakpoint.
+# Unless the program bails out after checking AT_HWCAP.
+gdb_expect {
+ -re "Program exited with code 01.\[\r\n\]+$gdb_prompt $" {
+ unsupported "This machine doesn't support Decimal Floating Point."
+ return -1
+ }
+
+ -re ".*$gdb_prompt $" {}
+}
+
+# First, verify if FPSCR is all zeroes.
+gdb_test "print \$fpscr" " = 0" "FPSCR is all zeroes"
+
+# Step over "set rounding mode" instruction.
+gdb_test "next" "" ""
+
+# Verify that the following bits are set (See Power ISA for details):
+#
+# 29:31 - DFP Rounding Control
+gdb_test "print/t \$fpscr" " = 10100000000000000000000000000000000" "FPSCR for round to nearest, ties toward zero rounding mode"
diff --git a/gdb/testsuite/gdb.base/args.exp b/gdb/testsuite/gdb.base/args.exp
index 544fca7..230b0eb 100644
--- a/gdb/testsuite/gdb.base/args.exp
+++ b/gdb/testsuite/gdb.base/args.exp
@@ -71,7 +71,8 @@ proc args_test { name arglist } {
# Test that the --args are processed correctly.
#
set old_gdbflags $GDBFLAGS
-set GDBFLAGS "-nx --args $binfile 1 3"
+
+set GDBFLAGS "$old_gdbflags --args $binfile 1 3"
args_test basic {{1} {3}}
#
@@ -79,21 +80,29 @@ args_test basic {{1} {3}}
# The syntax needed is a little peculiar; DejaGNU treats the arguments as a
# list and expands them itself, since no shell redirection is involved.
#
-set GDBFLAGS "-nx --args $binfile 1 {} 3"
+set GDBFLAGS "$old_gdbflags --args $binfile 1 {} 3"
args_test "one empty" {{1} {} {3}}
#
# try with 2 empty args
#
-set GDBFLAGS "-nx --args $binfile 1 {} {} 3"
+set GDBFLAGS "$old_gdbflags --args $binfile 1 {} {} 3"
args_test "two empty" {{1} {} {} 3}
# Try with arguments containing literal single quotes.
-set GDBFLAGS "-nx --args $binfile 1 '' 3"
+set GDBFLAGS "$old_gdbflags --args $binfile 1 '' 3"
args_test "one empty (with single quotes)" {{1} {''} {3}}
-set GDBFLAGS "-nx --args $binfile 1 '' '' 3"
+set GDBFLAGS "$old_gdbflags --args $binfile 1 '' '' 3"
args_test "two empty (with single quotes)" {{1} {''} {''} {3}}
+# try with arguments containing literal newlines.
+
+set GDBFLAGS "-nx --args $binfile 1 {\n} 3"
+args_test "one newline" {{1} {\\n} {3}}
+
+set GDBFLAGS "-nx --args $binfile 1 {\n} {\n} 3"
+args_test "two newlines" {{1} {\\n} {\\n} {3}}
+
set GDBFLAGS $old_gdbflags
diff --git a/gdb/cli/cli-utils.c b/gdb/testsuite/gdb.base/callexit.c
index adb8a6e..f08d800 100644
--- a/gdb/cli/cli-utils.c
+++ b/gdb/testsuite/gdb.base/callexit.c
@@ -1,5 +1,6 @@
-/* GDB CLI utility library.
- Copyright (c) 2001, 2007, 2008 Free Software Foundation, Inc.
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008 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
@@ -14,6 +15,19 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "defs.h"
-#include "cli/cli-utils.h"
+/* Support program for testing gdb's ability to handle an
+ inferior function call that terminates the program. */
+
+#include <stdlib.h>
+
+void
+callexit ()
+{
+ exit (0);
+}
+int
+main ()
+{
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/callexit.exp b/gdb/testsuite/gdb.base/callexit.exp
new file mode 100644
index 0000000..a794b83
--- /dev/null
+++ b/gdb/testsuite/gdb.base/callexit.exp
@@ -0,0 +1,58 @@
+# Copyright 2008 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "callexit"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested callexit.exp
+ return -1
+}
+
+# Some targets can't do function calls, so don't even bother with this
+# test.
+if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ continue
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if { ![runto_main] } {
+ fail "Can't run to main"
+ return 0
+}
+
+# Call function (causing the program to exit), and see if gdb handles
+# it properly.
+gdb_test "call callexit()" \
+ "The program being debugged exited.*" \
+ "inferior function call terminated program"
+
+return 0
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 387719a..d0d0dd6 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -223,7 +223,7 @@ gdb_expect {
-re "^info t foo\\\x07$"\
{ send_gdb "\n"
gdb_expect {
- -re "Ambiguous info command \"t foo\": target, terminal, threads, tp, tracepoints, types\\..*$gdb_prompt $"\
+ -re "Ambiguous info command \"t foo\": target, tasks, terminal, threads, tp, tracepoints, types\\..*$gdb_prompt $"\
{ pass "complete 'info t foo'"}
-re ".*$gdb_prompt $" { fail "complete 'info t foo'"}
timeout {fail "(timeout) complete 'info t foo'"}
@@ -239,7 +239,7 @@ gdb_expect {
-re "^info t\\\x07$"\
{ send_gdb "\n"
gdb_expect {
- -re "Ambiguous info command \"t\": target, terminal, threads, tp, tracepoints, types\\..
+ -re "Ambiguous info command \"t\": target, tasks, terminal, threads, tp, tracepoints, types\\..
*$gdb_prompt $"\
{ pass "complete 'info t'"}
-re ".*$gdb_prompt $" { fail "complete 'info t'"}
@@ -257,7 +257,7 @@ gdb_expect {
-re "^info t \\\x07$"\
{ send_gdb "\n"
gdb_expect {
- -re "Ambiguous info command \"t \": target, terminal, threads, tp, tracepoints, types\\..
+ -re "Ambiguous info command \"t \": target, tasks, terminal, threads, tp, tracepoints, types\\..
*$gdb_prompt $"\
{ pass "complete 'info t '"}
-re ".*$gdb_prompt $" { fail "complete 'info t '"}
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
index 3e6c3ee..401e0c0 100644
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -105,10 +105,7 @@ if { $found == 0 } {
# To do this, we must shutdown the currently running gdb and restart
# with the -core args. We can't use gdb_start because it looks for
# the first gdb prompt, and the message we are looking for occurs
-# before the first prompt. Also, we can't include GDBFLAGS because
-# if it is empty, this confuses gdb with an empty argument that it
-# grumbles about (said grumbling currently being ignored in gdb_start).
-# **FIXME**
+# before the first prompt.
#
# Another problem is that on some systems (solaris for example), there
# is apparently a limit on the length of a fully specified path to
@@ -117,13 +114,13 @@ if { $found == 0 } {
gdb_exit
if $verbose>1 then {
- send_user "Spawning $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile\n"
+ send_user "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS -core=$objdir/$subdir/corefile\n"
}
set oldtimeout $timeout
set timeout [expr "$timeout + 60"]
verbose "Timeout is now $timeout seconds" 2
-eval "spawn $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile"
+eval "spawn $GDB $INTERNAL_GDBFLAGS $GDBFLAGS -core=$objdir/$subdir/corefile"
expect {
-re "Couldn't find .* registers in core file.*$gdb_prompt $" {
fail "args: -core=corefile (couldn't find regs)"
@@ -150,11 +147,11 @@ expect {
close;
if $verbose>1 then {
- send_user "Spawning $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n"
+ send_user "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n"
}
-eval "spawn $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile";
+eval "spawn $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=$objdir/$subdir/corefile";
expect {
-re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
pass "args: execfile -core=corefile"
diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp
index f9b32d4..63f92c2 100644
--- a/gdb/testsuite/gdb.base/dbx.exp
+++ b/gdb/testsuite/gdb.base/dbx.exp
@@ -48,11 +48,11 @@ if { [gdb_compile "${binfile1}.o ${binfile2}.o" ${binfile} executable {debug}]
proc dbx_gdb_start { } {
global verbose
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global prompt
global spawn_id
global timeout
- verbose "Spawning $GDB -nw $GDBFLAGS"
+ verbose "Spawning $GDB -dbx $INTERNAL_GDBFLAGS $GDBFLAGS"
if { [which $GDB] == 0 } then {
perror "$GDB does not exist."
@@ -61,7 +61,7 @@ proc dbx_gdb_start { } {
set oldtimeout $timeout
set timeout [expr "$timeout + 60"]
- eval "spawn $GDB -nw -dbx $GDBFLAGS"
+ eval "spawn $GDB -dbx $INTERNAL_GDBFLAGS $GDBFLAGS"
gdb_expect {
-re ".*\r\n$gdb_prompt $" {
verbose "GDB initialized."
diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp
index e25de77..f12a234 100644
--- a/gdb/testsuite/gdb.base/exprs.exp
+++ b/gdb/testsuite/gdb.base/exprs.exp
@@ -248,3 +248,14 @@ gdb_test "print (void*) ((long long) (unsigned long) -1 + 1)" \
if [expr ! $ok] { setup_xfail "*-*-*" }
gdb_test "print (void*) (~((long long)(unsigned long) -1) - 1)" \
"warning: value truncated.*" "truncate (void*) 0xffffffff00000000 - 1"
+
+# String concatentation.
+test_expr "print \"x\" \"y\"" "\\$\[0-9\]* = \"xy\""
+test_expr "print \"x\" \"y\" \"z\"" "\\$\[0-9\]* = \"xyz\""
+
+# Enum formatting tests.
+test_expr "print red" "\\$\[0-9\]* = red"
+gdb_test "set output-radix 8" ""
+test_expr "print red" "\\$\[0-9\]* = red"
+test_expr "print/d red" "\\$\[0-9\]* = 0"
+gdb_test "set output-radix 10" ""
diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/foll-exec.exp
index 861cf97d..358c84c 100644
--- a/gdb/testsuite/gdb.base/foll-exec.exp
+++ b/gdb/testsuite/gdb.base/foll-exec.exp
@@ -217,14 +217,11 @@ proc do_exec_tests {} {
# Verify that the catchpoint is mentioned in an "info breakpoints",
# and further that the catchpoint mentions no program name.
#
- send_gdb "info breakpoints\n"
- gdb_expect {
- -re ".*catch exec.*keep y.*$gdb_prompt $"\
- {pass "info shows catchpoint without exec pathname"}
- -re ".*catch exec.*program \"\".*$gdb_prompt $"\
- {fail "info shows catchpoint without exec pathname"}
- -re "$gdb_prompt $" {fail "info shows catchpoint without exec pathname"}
- timeout {fail "(timeout) info shows catchpoint without exec pathname"}
+ set msg "info shows catchpoint without exec pathname"
+ gdb_test_multiple "info breakpoints" $msg {
+ -re ".*catchpoint.*keep y.*exec\[\n\r\]+$gdb_prompt $" {
+ pass $msg
+ }
}
# DTS CLLbs16760
@@ -248,12 +245,11 @@ proc do_exec_tests {} {
# and further that the catchpoint managed to capture the exec'd
# program's name.
#
- send_gdb "info breakpoints\n"
- gdb_expect {
- -re ".*catch exec .*program \".*${testfile2}\".*$gdb_prompt $"\
- {pass "info shows catchpoint exec pathname"}
- -re "$gdb_prompt $" {fail "info shows catchpoint exec pathname"}
- timeout {fail "(timeout) info shows catchpoint exec pathname"}
+ set msg "info shows catchpoint exec pathname"
+ gdb_test_multiple "info breakpoints" $msg {
+ -re ".*catchpoint.*keep y.*exec, program \".*${testfile2}\".*$gdb_prompt $" {
+ pass $msg
+ }
}
# Verify that we can continue from the catchpoint, and land in the
diff --git a/gdb/testsuite/gdb.base/foll-fork.exp b/gdb/testsuite/gdb.base/foll-fork.exp
index b946cb3..79a9a01 100644
--- a/gdb/testsuite/gdb.base/foll-fork.exp
+++ b/gdb/testsuite/gdb.base/foll-fork.exp
@@ -158,14 +158,11 @@ proc catch_fork_child_follow {} {
# Verify that the catchpoint is mentioned in an "info breakpoints",
# and further that the catchpoint mentions no process id.
#
- send_gdb "info breakpoints\n"
- gdb_expect {
- -re ".*catch fork.*keep y.*$gdb_prompt $"\
- {pass "info shows catchpoint without pid"}
- -re ".*catch fork.*process .*$gdb_prompt $"\
- {fail "info shows catchpoint without pid"}
- -re "$gdb_prompt $" {fail "info shows catchpoint without pid"}
- timeout {fail "(timeout) info shows catchpoint without pid"}
+ set test_name "info shows catchpoint without pid"
+ gdb_test_multiple "info breakpoints" "$test_name" {
+ -re ".*catchpoint.*keep y.*fork\[\r\n\]+$gdb_prompt $" {
+ pass "$test_name"
+ }
}
send_gdb "continue\n"
@@ -179,12 +176,11 @@ proc catch_fork_child_follow {} {
# Verify that the catchpoint is mentioned in an "info breakpoints",
# and further that the catchpoint managed to capture a process id.
#
- send_gdb "info breakpoints\n"
- gdb_expect {
- -re ".*catch fork .*process \[0-9\]+.*$gdb_prompt $"\
- {pass "info shows catchpoint pid"}
- -re "$gdb_prompt $" {fail "info shows catchpoint pid"}
- timeout {fail "(timeout) info shows catchpoint pid"}
+ set test_name "info shows catchpoint without pid"
+ gdb_test_multiple "info breakpoints" "$test_name" {
+ -re ".*catchpoint.*keep y.*fork, process.*$gdb_prompt $" {
+ pass "$test_name"
+ }
}
send_gdb "set follow child\n"
diff --git a/gdb/testsuite/gdb.base/hashline2.exp b/gdb/testsuite/gdb.base/hashline2.exp
index 22d051e..defce6e 100644
--- a/gdb/testsuite/gdb.base/hashline2.exp
+++ b/gdb/testsuite/gdb.base/hashline2.exp
@@ -38,7 +38,7 @@ puts $fd "int main () { return 0; } /* set breakpoint here */"
close $fd
if { [gdb_compile "${objdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested hashline1.exp
+ untested hashline2.exp
return -1
}
diff --git a/gdb/testsuite/gdb.base/hashline3.exp b/gdb/testsuite/gdb.base/hashline3.exp
index 34582b1..2aa12dc 100644
--- a/gdb/testsuite/gdb.base/hashline3.exp
+++ b/gdb/testsuite/gdb.base/hashline3.exp
@@ -37,7 +37,7 @@ puts $fd "int main () { return 0; } /* set breakpoint here */"
close $fd
if { [gdb_compile "${objdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested hashline1.exp
+ untested hashline3.exp
return -1
}
diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
index bd2f9a6..65cb546 100644
--- a/gdb/testsuite/gdb.base/help.exp
+++ b/gdb/testsuite/gdb.base/help.exp
@@ -68,7 +68,7 @@ gdb_test "help continue" "Continue program being debugged.*" "help continue"
# test help call
gdb_test "help call" "Call a function.*" "help call"
# test help catch
-gdb_test "help catch" "Set catchpoints to catch events.*List of catch subcommands:.*catch assert -- Catch failed Ada assertions.*catch catch -- Catch an exception.*catch exception -- Catch Ada exceptions.*catch exec -- Catch calls to exec.*catch fork -- Catch calls to fork.*catch load -- Catch library loads.*catch throw -- Catch an exception.*catch unload -- Catch library unloads.*catch vfork -- Catch calls to vfork.*Type .help catch. followed by catch subcommand name for full documentation.*Type .apropos word. to search for commands related to .word..*Command name abbreviations are allowed if unambiguous.*" "help catch"
+gdb_test "help catch" "Set catchpoints to catch events.*List of catch subcommands:.*catch assert -- Catch failed Ada assertions.*catch catch -- Catch an exception.*catch exception -- Catch Ada exceptions.*catch exec -- Catch calls to exec.*catch fork -- Catch calls to fork.*catch vfork -- Catch calls to vfork.*Type .help catch. followed by catch subcommand name for full documentation.*Type .apropos word. to search for commands related to .word..*Command name abbreviations are allowed if unambiguous.*" "help catch"
# test help cd
gdb_test "help cd" "Set working directory to DIR for debugger and program being debugged\.\[\r\n\]+The change does not take effect for the program being debugged\[\r\n\]+until the next time it is started\." "help cd"
# test help clear
diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
index 2a43a28..40546f9 100644
--- a/gdb/testsuite/gdb.base/macscp.exp
+++ b/gdb/testsuite/gdb.base/macscp.exp
@@ -566,44 +566,44 @@ gdb_test "macro expand SPLICE(robot, invasion)" \
# Varargs tests.
-gdb_test "macro define va_c99(...) fprintf (stderr, __VA_ARGS__)" \
+gdb_test "macro define va_c99(...) varfunc (fixedarg, __VA_ARGS__)" \
"" \
"define first varargs helper"
-gdb_test "macro define va2_c99(x, y, ...) fprintf (stderr, x, y, __VA_ARGS__)" \
+gdb_test "macro define va2_c99(x, y, ...) varfunc (fixedarg, x, y, __VA_ARGS__)" \
"" \
"define second varargs helper"
-gdb_test "macro define va_gnu(args...) fprintf (stderr, args)" \
+gdb_test "macro define va_gnu(args...) varfunc (fixedarg, args)" \
"" \
"define third varargs helper"
-gdb_test "macro define va2_gnu(args...) fprintf (stderr, ## args)" \
+gdb_test "macro define va2_gnu(args...) varfunc (fixedarg, ## args)" \
"" \
"define fourth varargs helper"
gdb_test "macro expand va_c99(one, two, three)" \
- "expands to: *fprintf \\(stderr, *one, two, three\\)" \
+ "expands to: *varfunc \\(fixedarg, *one, two, three\\)" \
"c99 varargs expansion"
gdb_test "macro expand va_c99()" \
- "expands to: *fprintf \\(stderr, *\\)" \
+ "expands to: *varfunc \\(fixedarg, *\\)" \
"c99 varargs expansion without an argument"
gdb_test "macro expand va2_c99(one, two, three, four)" \
- "expands to: *fprintf \\(stderr, *one, two, three, four\\)" \
+ "expands to: *varfunc \\(fixedarg, *one, two, three, four\\)" \
"c99 varargs expansion, multiple formal arguments"
gdb_test "macro expand va_gnu(one, two, three, four)" \
- "expands to: *fprintf \\(stderr, *one, two, three, four\\)" \
+ "expands to: *varfunc \\(fixedarg, *one, two, three, four\\)" \
"gnu varargs expansion"
gdb_test "macro expand va_gnu()" \
- "expands to: *fprintf \\(stderr, *\\)" \
+ "expands to: *varfunc \\(fixedarg, *\\)" \
"gnu varargs expansion without an argument"
gdb_test "macro expand va2_gnu()" \
- "expands to: *fprintf \\(stderr\\)" \
+ "expands to: *varfunc \\(fixedarg\\)" \
"gnu varargs expansion special splicing without an argument"
# Stringification tests.
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 05786e7..ecab15f 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -401,7 +401,7 @@ gdb_expect {
send_gdb "maint print type argc\n"
gdb_expect {
- -re "type node $hex\r\nname .int. \\($hex\\)\r\ntagname .<NULL>. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength \[24\]\r\nupper_bound_type $hex \\(BOUND_SIMPLE\\)\r\nlower_bound_type $hex \\(BOUND_SIMPLE\\)\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\ntype_chain $hex\r\ninstance_flags $hex\r\nflags\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\ntype_specific $hex\r\n$gdb_prompt $"\
+ -re "type node $hex\r\nname .int. \\($hex\\)\r\ntagname .<NULL>. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength \[24\]\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\ntype_chain $hex\r\ninstance_flags $hex\r\nflags\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\ntype_specific $hex\r\n$gdb_prompt $"\
{ pass "maint print type" }
-re ".*$gdb_prompt $" { fail "maint print type" }
timeout { fail "(timeout) maint print type" }
diff --git a/gdb/testsuite/gdb.base/pointers.c b/gdb/testsuite/gdb.base/pointers.c
index 85bfdc9..4ee5e78 100644
--- a/gdb/testsuite/gdb.base/pointers.c
+++ b/gdb/testsuite/gdb.base/pointers.c
@@ -71,6 +71,15 @@ float ** ptr_to_ptr_to_float;
int y;
+
+typedef long k[5];
+
+typedef struct {
+ k array_variable;
+} S;
+
+S instance;
+
/* Do nothing function used for forcing some of the above variables to
be referenced by the program source. If the variables are not
referenced, some linkers will remove the symbol from the symbol
diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
index 5532140..d7d17e7 100644
--- a/gdb/testsuite/gdb.base/pointers.exp
+++ b/gdb/testsuite/gdb.base/pointers.exp
@@ -596,3 +596,7 @@ gdb_expect {
timeout { fail "(timeout) ptype ppppppC" }
}
+# Regression test for a crash.
+
+gdb_test "p instance.array_variable + 0" \
+ " = \\(long int \\*\\) 0x\[0-9a-f\]*"
diff --git a/gdb/testsuite/gdb.base/remotetimeout.exp b/gdb/testsuite/gdb.base/remotetimeout.exp
index e6661b4..c7056ce 100644
--- a/gdb/testsuite/gdb.base/remotetimeout.exp
+++ b/gdb/testsuite/gdb.base/remotetimeout.exp
@@ -34,7 +34,7 @@ if [target_info exists noargs] {
# Test that -l is processed correctly.
#
set old_gdbflags $GDBFLAGS
-set GDBFLAGS "-l 42"
+set GDBFLAGS "$GDBFLAGS -l 42"
gdb_exit
gdb_start
gdb_test "show remotetimeout" \
diff --git a/gdb/testsuite/gdb.base/sepsymtab.exp b/gdb/testsuite/gdb.base/sepsymtab.exp
index ce0ea7d..3192701 100644
--- a/gdb/testsuite/gdb.base/sepsymtab.exp
+++ b/gdb/testsuite/gdb.base/sepsymtab.exp
@@ -45,7 +45,7 @@ gdb_load ${binfile}
set command "info sym main"
set command_regex [string_to_regexp $command]
gdb_test_multiple "$command" "$command" {
- -re "^${command_regex}\[\r\n\]+main in section \[^\r\n\]+\[\r\n\]+$gdb_prompt \$" {
+ -re "^${command_regex}\[\r\n\]+main \\+ 0 in section \[^\r\n\]+\[\r\n\]+$gdb_prompt \$" {
pass "$command"
}
}
diff --git a/gdb/testsuite/gdb.cp/gdb2384-base.cc b/gdb/testsuite/gdb.cp/gdb2384-base.cc
index 76b24db..44a133d 100644
--- a/gdb/testsuite/gdb.cp/gdb2384-base.cc
+++ b/gdb/testsuite/gdb.cp/gdb2384-base.cc
@@ -28,3 +28,8 @@ base::meth ()
{
return x;
}
+
+derived::derived (int _x)
+ : base (_x)
+{
+}
diff --git a/gdb/testsuite/gdb.cp/gdb2384-base.h b/gdb/testsuite/gdb.cp/gdb2384-base.h
index 945ca81..f32cff4 100644
--- a/gdb/testsuite/gdb.cp/gdb2384-base.h
+++ b/gdb/testsuite/gdb.cp/gdb2384-base.h
@@ -23,3 +23,9 @@ class base
int x;
virtual int meth ();
};
+
+class derived : public base
+{
+ public:
+ derived (int _x);
+};
diff --git a/gdb/testsuite/gdb.cp/gdb2384.cc b/gdb/testsuite/gdb.cp/gdb2384.cc
index 74e725d..d7d5928 100644
--- a/gdb/testsuite/gdb.cp/gdb2384.cc
+++ b/gdb/testsuite/gdb.cp/gdb2384.cc
@@ -18,23 +18,36 @@
#include "gdb2384-base.h"
-class derived : public base
+class derived1 : public base
{
public:
- derived (int);
+ derived1 (int);
};
-derived::derived (int _x)
+derived1::derived1 (int _x)
: base (_x)
{
}
+class derived2 : public derived
+{
+ public:
+ derived2 (int);
+};
+
+derived2::derived2 (int _x)
+ : derived (_x)
+{
+}
+
int g;
int
main ()
{
- derived d (42);
- g = d.meth (); // set breakpoint here
+ derived1 d1 (42);
+ derived2 d2 (24);
+ g = d1.meth (); // set breakpoint here
+ g = d2.meth (); // set breakpoint here (second)
return 0;
}
diff --git a/gdb/testsuite/gdb.cp/gdb2384.exp b/gdb/testsuite/gdb.cp/gdb2384.exp
index 370c65b..3ae7957 100644
--- a/gdb/testsuite/gdb.cp/gdb2384.exp
+++ b/gdb/testsuite/gdb.cp/gdb2384.exp
@@ -55,46 +55,41 @@ gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_load_shlibs ${sofile}
-set bp_location [gdb_get_line_number "set breakpoint here"]
-
-# Set a breakpoint with multiple locations.
-
-gdb_test "break $srcfile:$bp_location" \
- "Breakpoint.*at.* file .*$srcfile, line.*" \
- "set breakpoint"
-
-gdb_run_cmd
-gdb_expect {
- -re "Breakpoint \[0-9\]+,.*main \\(.*\\).*$gdb_prompt $" {
- pass "run to breakpoint"
- }
- -re "$gdb_prompt $" {
- fail "run to breakpoint"
- }
- timeout {
- fail "run to breakpoint (timeout)"
- }
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ return -1
}
-gdb_test "print d.meth ()" \
+gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
+gdb_continue_to_breakpoint "set breakpoint here"
+
+gdb_test "print d1.meth ()" \
".*42.*" \
- "print d.meth ()"
+ "print d1.meth ()"
# Now try again. gdb's without the fix will hopefully segv here
-gdb_run_cmd
-gdb_expect {
- -re "Breakpoint \[0-9\]+,.*main \\(.*\\).*$gdb_prompt $" {
- pass "run to breakpoint #2"
- }
- -re "$gdb_prompt $" {
- fail "run to breakpoint #2"
- }
- timeout {
- fail "run to breakpoint #2 (timeout)"
- }
-}
-
-gdb_test "print d.meth ()" \
+runto_main
+gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
+gdb_continue_to_breakpoint "set breakpoint here"
+gdb_test "print d1.meth ()" \
".*42.*" \
"gdb2384"
+
+# second case
+
+runto_main
+gdb_breakpoint [gdb_get_line_number "set breakpoint here (second)"]
+gdb_continue_to_breakpoint "set breakpoint here (second)"
+gdb_test "print d2.meth ()" \
+ ".*24.*" \
+ "print d2.meth()"
+
+runto_main
+gdb_breakpoint [gdb_get_line_number "set breakpoint here (second)"]
+gdb_continue_to_breakpoint "set breakpoint here (second)"
+gdb_test "print d2.meth ()" \
+ ".*24.*" \
+ "gdb2384 (second)"
+
diff --git a/gdb/testsuite/gdb.cp/mb-ctor.exp b/gdb/testsuite/gdb.cp/mb-ctor.exp
index 9282279..41c61f2 100644
--- a/gdb/testsuite/gdb.cp/mb-ctor.exp
+++ b/gdb/testsuite/gdb.cp/mb-ctor.exp
@@ -52,7 +52,7 @@ gdb_test "break 'Derived::Derived(int)'" \
gdb_test "break 'Derived::~Derived()'" \
"Breakpoint.*at.* file .*$srcfile, line.*\\(2 locations\\).*" \
- "set-breakpoint at ctor"
+ "set-breakpoint at dtor"
gdb_run_cmd
gdb_expect {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S
new file mode 100644
index 0000000..30fb616
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.S
@@ -0,0 +1,106 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008 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 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Test inter-cu reference support where the referenced DIE is within
+ initial_length_size bytes of the end of the CU, but GDB doesn't take
+ into account initial_length_size.
+ GDB still gets the correct answer because it goes looking for the
+ correct CU, but the search is unnecessary. */
+
+/* Debug information */
+
+ .section .debug_info
+.Lcu1_begin:
+ /* CU header */
+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
+.Lcu1_start:
+ .2byte 2 /* DWARF Version */
+ .4byte .Labbrev1_begin /* Offset into abbrev section */
+ .byte 4 /* Pointer size */
+
+ /* CU die */
+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
+ .ascii "file1.txt\0" /* DW_AT_name */
+ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
+ .byte 1 /* DW_AT_language (C) */
+
+ .uleb128 2 /* Abbrev: DW_TAG_variable */
+ .ascii "noloc\0" /* DW_AT_name */
+ .4byte .Ltype_const_int-.Lcu1_begin /* DW_AT_type */
+ .byte 1 /* DW_AT_external */
+
+.Ltype_int:
+ .uleb128 3 /* Abbrev: DW_TAG_base_type */
+ .ascii "int\0" /* DW_AT_name */
+ .byte 4 /* DW_AT_byte_size */
+ .byte 5 /* DW_AT_encoding */
+
+.Ltype_const_int:
+ .uleb128 4 /* Abbrev: DW_TAG_const_type */
+ .uleb128 .Ltype_int - .Lcu1_begin /* DW_AT_type */
+
+ .byte 0 /* End of children of CU */
+
+.Lcu1_end:
+
+/* Abbrev table */
+ .section .debug_abbrev
+.Labbrev1_begin:
+ .uleb128 1 /* Abbrev code */
+ .uleb128 0x11 /* DW_TAG_compile_unit */
+ .byte 1 /* has_children */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x25 /* DW_AT_producer */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x13 /* DW_AT_language */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+ .uleb128 2 /* Abbrev code */
+ .uleb128 0x34 /* DW_TAG_variable */
+ .byte 0 /* has_children */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .uleb128 0x3f /* DW_AT_external */
+ .uleb128 0xc /* DW_FORM_flag */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+ .uleb128 3 /* Abbrev code */
+ .uleb128 0x24 /* DW_TAG_base_type */
+ .byte 0 /* has_children */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0xb /* DW_AT_byte_size */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .uleb128 0x3e /* DW_AT_encoding */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+ .uleb128 4 /* Abbrev code */
+ .uleb128 0x26 /* DW_TAG_const_type */
+ .byte 0 /* has_children */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x15 /* DW_FORM_ref_udata */
+
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp
new file mode 100644
index 0000000..7819806
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp
@@ -0,0 +1,53 @@
+# Copyright 2004, 2005, 2007, 2008 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test inter-cu references where the referenced DIE is within
+# initial_length_size bytes of the end of the CU.
+# This catches cases where the code doesn't include initial_length_size
+# in the length of the CU. */
+
+# This test can only be run on targets which support DWARF-2 and use gas.
+# For now pick a sampling of likely targets.
+if {![istarget *-*-linux*]
+ && ![istarget *-*-gnu*]
+ && ![istarget *-*-elf*]
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+}
+
+set testfile "dw2-cu-size"
+set srcfile ${testfile}.S
+set binfile ${objdir}/${subdir}/${testfile}.x
+
+if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" } {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {nodebug}] != "" } {
+ return -1
+}
+
+if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != "" } {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "ptype noloc" "type = const int"
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-intercu.S b/gdb/testsuite/gdb.dwarf2/dw2-intercu.S
index 781dadb..a58da47 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-intercu.S
+++ b/gdb/testsuite/gdb.dwarf2/dw2-intercu.S
@@ -58,7 +58,7 @@ func_cu1:
.byte 1 /* DW_AT_decl_file */
.byte 2 /* DW_AT_decl_line */
.ascii "func_cu1\0" /* DW_AT_name */
- .4byte .Ltype_int /* DW_AT_type */
+ .4byte .Ltype_int_in_cu2 /* DW_AT_type */
.4byte .Lbegin_func_cu1 /* DW_AT_low_pc */
.4byte .Lend_func_cu1 /* DW_AT_high_pc */
.byte 1 /* DW_AT_frame_base: length */
@@ -83,7 +83,7 @@ func_cu1:
.ascii "GNU C 3.3.3\0" /* DW_AT_producer */
.byte 1 /* DW_AT_language (C) */
-.Ltype_int:
+.Ltype_int_in_cu2:
.uleb128 2 /* Abbrev: DW_TAG_base_type */
.ascii "int\0" /* DW_AT_name */
.byte 4 /* DW_AT_byte_size */
diff --git a/gdb/testsuite/gdb.mi/gdb2549.exp b/gdb/testsuite/gdb.mi/gdb2549.exp
new file mode 100644
index 0000000..bba7964
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/gdb2549.exp
@@ -0,0 +1,85 @@
+# Copyright 2008 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# 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=mi"
+
+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}] != "" } {
+ untested mi-regs.exp
+ return -1
+}
+
+proc 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=\"No registers\.\"" \
+ "no executable"
+}
+
+proc 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\\)))"
+
+ mi_gdb_test "222-data-list-register-values x" \
+ "222\\^done,register-values=\\\[\{number=\"0\",value=\"$hex\"\}.*\\\]" \
+ "register values x"
+
+ mi_gdb_test "333-data-list-register-values f" \
+ "333\\^done,register-values=\\\[\{number=\"0\",value=\"$float\"\}.*\\\]" \
+ "register values f"
+
+ mi_gdb_test "444-data-list-register-values d" \
+ "444\\^done,register-values=\\\[\{number=\"0\",value=\"-?$decimal\"\}.*\\\]" \
+ "register values d"
+
+ mi_gdb_test "555-data-list-register-values o" \
+ "555\\^done,register-values=\\\[\{number=\"0\",value=\"$octal\"\}.*\\\]" \
+ "register values o"
+
+ mi_gdb_test "666-data-list-register-values t" \
+ "666\\^done,register-values=\\\[\{number=\"0\",value=\"$binary\"\}.*\\\]" \
+ "register values t"
+}
+
+register_tests_no_exec
+mi_run_to_main
+register_tests
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-nonstop.exp b/gdb/testsuite/gdb.mi/mi-nonstop.exp
index 0e6e130..4bf0d44 100644
--- a/gdb/testsuite/gdb.mi/mi-nonstop.exp
+++ b/gdb/testsuite/gdb.mi/mi-nonstop.exp
@@ -172,7 +172,7 @@ mi_gdb_test "-thread-select 2" "\\^done.*" "select first worker thread"
# Since thread 2 is running, we need to set variable via another thread.
mi_gdb_test "-gdb-set --thread 3 variable exit_first_thread=1" ".*\\^done" "ask the second thread to exit"
gdb_expect {
- -re ".*=thread-exited,id=\"2\"\r\n$" {
+ -re ".*=thread-exited,id=\"2\",group-id=\"\[0-9\]+\"\r\n$" {
pass "wait for thread exit"
}
timeout {
diff --git a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
new file mode 100644
index 0000000..85e5138
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
@@ -0,0 +1,177 @@
+# Copyright 2008 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This only works with native configurations
+if {![isnative]} {
+ return
+}
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if {[mi_gdb_start]} {
+ continue
+}
+
+#
+# Start here
+#
+set testfile "nsmoribund"
+set srcfile "$testfile.c"
+set binfile "$objdir/$subdir/mi-$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
+
+set supported 0
+send_gdb "-gdb-show non-stop\n"
+gdb_expect {
+ -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" {
+ if { $expect_out(1,string) == "1" } {
+ set supported 1
+ }
+ }
+ -re ".$mi_gdb_prompt$" {
+ }
+}
+
+mi_gdb_test "-gdb-set non-stop 1" ".*"
+mi_gdb_test "-gdb-set target-async 1" ".*"
+detect_async
+
+mi_gdb_test "200-break-insert -t main" ".*"
+
+set created "=thread-created,id=\"$decimal\"\r\n"
+set running "\\*running,thread-id=\"$decimal\"\r\n"
+
+set notifs "($created)*($running)*"
+
+# Note: presently, we skip this test on non-native targets,
+# so 'run' is OK. As soon as we start to run this on remote
+# target, the logic from mi_run_cmd will have to be refactored.
+send_gdb "-exec-run\n"
+gdb_expect {
+ -re "\\^running\r\n$notifs$mi_gdb_prompt" {
+ }
+ -re "\\^error,msg=\"The target does not support running in non-stop mode.\"" {
+ verbose -log "Non-stop mode not supported, skipping all tests"
+ return
+ }
+ -re "\r\n$mi_gdb_prompt" {
+ perror "Cannot start target (unknown output after running)"
+ return -1
+ }
+ timeout {
+ perror "Cannot start target (timeout)"
+ return -1
+ }
+}
+mi_expect_stop "breakpoint-hit" main ".*" ".*" "\[0-9\]+" \
+ { "" "disp=\"del\"" } "run to main"
+
+# Keep this in sync with THREADS in the the $srcfile.
+set nthreads 10
+
+# Set a breakpoint and let all threads hit it (except the main
+# thread).
+
+set bkpt_line [gdb_get_line_number "set breakpoint here"]
+
+mi_create_breakpoint "$srcfile:$bkpt_line" 2 keep thread_function .* .* .* \
+ "breakpoint at thread_function"
+
+mi_send_resuming_command "exec-continue --all" "resume all"
+for {set i 0} {$i < $nthreads} {incr i} {
+ mi_expect_stop "breakpoint-hit" "thread_function" "\[^\n\]*" "$srcfile" \
+ "\[0-9\]*" {"" "disp=\"keep\""} "stop $i"
+}
+
+# All but the main thread should have hit it.
+
+mi_check_thread_states \
+ {"running" "stopped" "stopped" "stopped" "stopped" "stopped" "stopped" "stopped" "stopped" "stopped" "stopped"} \
+ "thread state: all stopped except the main thread"
+
+# Select a stopped thread to make sure we're able to delete
+# breakpoints
+mi_gdb_test "-thread-select 5" "\\^done.*" "select thread 5"
+
+# Now that we know about all the threads, we can get rid of
+# breakpoint.
+mi_delete_breakpoints
+
+# Recreate the same breakpoint, but this time, specific to thread 5.
+mi_create_breakpoint "-p 5 $srcfile:$bkpt_line" 3 keep thread_function .* .* .* \
+ "thread specific breakpoint at thread_function"
+
+# Resume all threads. Only thread 5 should report a stop.
+
+set running_re ""
+for {set i $nthreads} {$i > 0} {incr i -1} {
+ set running_re "$running_re\\*running,thread-id=\"$decimal\"\r\n"
+}
+
+send_gdb "-exec-continue --all\n"
+gdb_expect {
+ -re ".*$running_re$mi_gdb_prompt" {
+ pass "resume all, thread specific breakpoint"
+ }
+ timeout {
+ fail "resume all, thread specific breakpoint (timeout)"
+ }
+}
+
+mi_expect_stop "breakpoint-hit" "thread_function" "\[^\n\]*" "$srcfile" \
+ "\[0-9\]*" {"" "disp=\"keep\""} "hit thread specific breakpoint"
+
+# All threads except both thread 5 (and the main thread) should now be
+# repeatedly hitting the thread specific breakpoint and stepping over
+# it transparently. These are internal events, so the frontend should
+# see those threads as running.
+
+mi_check_thread_states \
+ {"running" "running" "running" "running" "stopped" "running" "running" "running" "running"} \
+ "thread state: all running except the breakpoint thread"
+
+# Get rid of the breakpoint while the other threads are stepping over
+# it, and tell all threads to exit. The program should exit
+# gracefully shortly. Send all commands in a row, since if something
+# goes wrong with moribund locations support or displaced stepping (or
+# a target bug if it can step over breakpoints itself), a spurious
+# SIGTRAP/SIGSEGV can come at any time after deleting the breakpoint.
+
+send_gdb "102-break-delete\n"
+send_gdb "print done = 1\n"
+send_gdb "103-exec-continue --all\n"
+
+gdb_expect {
+ -re "\\*stopped,reason=\"exited-normally\"" {
+ pass "resume all, program exited normally"
+ }
+ -re "\\*stopped" {
+ fail "unexpected stop"
+ }
+ timeout {
+ fail "resume all, waiting for program exit (timeout)"
+ }
+}
+
+mi_gdb_exit
diff --git a/gdb/testsuite/gdb.mi/mi-pthreads.exp b/gdb/testsuite/gdb.mi/mi-pthreads.exp
index dbb3ece..0ab5715 100644
--- a/gdb/testsuite/gdb.mi/mi-pthreads.exp
+++ b/gdb/testsuite/gdb.mi/mi-pthreads.exp
@@ -55,6 +55,12 @@ proc check_mi_thread_command_set {} {
"\\^done,new-thread-id=\"$thread\",frame={.*}(,line=\"(-)?\[0-9\]+\",file=\".*\")?" \
"check_mi_thread_command_set: -thread-select $thread"
}
+
+ foreach thread $thread_list {
+ mi_gdb_test "-interpreter-exec console \"thread $thread\"" \
+ ".*\\^done\r\n=thread-selected,id=\"$thread\"" \
+ "check =thread-selected: thread $thread"
+ }
}
#
diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
index ad0c439..4beb88c 100644
--- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp
+++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp
@@ -92,7 +92,7 @@ mi_gdb_test "409-stack-list-frames 0 0" \
#
mi_gdb_test "410-data-evaluate-expression bar()" \
- ".*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.\"" \
+ ".*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,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
diff --git a/gdb/testsuite/gdb.mi/mi2-syn-frame.exp b/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
index 8345c6a..9348446 100644
--- a/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
+++ b/gdb/testsuite/gdb.mi/mi2-syn-frame.exp
@@ -92,7 +92,7 @@ mi_gdb_test "409-stack-list-frames 0 0" \
# Call bar() by hand, which should get an exception while running.
#
-mi_gdb_test "410-data-evaluate-expression bar()" ".*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 "410-data-evaluate-expression bar()" ".*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,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"bar\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"},frame=\{level=\"1\",addr=\"$hex\",func=\"<function called from gdb>\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"}.*\\\]" "backtrace from inferior function at exception"
diff --git a/gdb/testsuite/gdb.mi/nsmoribund.c b/gdb/testsuite/gdb.mi/nsmoribund.c
new file mode 100644
index 0000000..aa41dbd
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/nsmoribund.c
@@ -0,0 +1,72 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2002, 2003, 2004, 2007, 2008 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 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ This file is based on schedlock.c. */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+int THREADS = 10;
+unsigned int *args;
+volatile int done = 0;
+
+void *
+thread_function (void *arg)
+{
+ int my_number = (long) arg;
+ volatile int *myp = (volatile int *) &args[my_number];
+
+ /* Don't run forever. Run just short of it :) */
+ while (*myp > 0 && !done)
+ {
+ (*myp)++; /* set breakpoint here */
+ }
+
+ if (done)
+ usleep (100); /* Some time to make sure we don't mask any bad
+ SIGTRAP handling. */
+
+ pthread_exit (NULL);
+}
+
+int
+main (int argc, char **argv)
+{
+ int res;
+ pthread_t *threads;
+ void *thread_result;
+ long i = 0;
+
+ threads = malloc (THREADS * sizeof (pthread_t));
+ args = malloc (THREADS * sizeof (unsigned int));
+
+ for (i = 0; i < THREADS; i++)
+ {
+ args[i] = 1; /* Init value. */
+ res = pthread_create (&threads[i],
+ NULL,
+ thread_function,
+ (void *) i);
+ }
+
+ for (i = 0; i < THREADS; i++)
+ pthread_join (threads[i], &thread_result);
+
+ exit(EXIT_SUCCESS);
+}
diff --git a/gdb/testsuite/gdb.python/Makefile.in b/gdb/testsuite/gdb.python/Makefile.in
new file mode 100644
index 0000000..79be9e7
--- /dev/null
+++ b/gdb/testsuite/gdb.python/Makefile.in
@@ -0,0 +1,14 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = python-value
+
+all info install-info dvi install uninstall installcheck check:
+ @echo "Nothing to be done for $@..."
+
+clean mostlyclean:
+ -rm -f *~ *.o *.ci
+ -rm -f core $(EXECUTABLES)
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
diff --git a/gdb/cli/cli-utils.h b/gdb/testsuite/gdb.python/python-value.c
index 303b768..82cfd9a 100644
--- a/gdb/cli/cli-utils.h
+++ b/gdb/testsuite/gdb.python/python-value.c
@@ -1,5 +1,6 @@
-/* Header file for GDB CLI utility library.
- Copyright (c) 2001, 2007, 2008 Free Software Foundation, Inc.
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008 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
@@ -14,7 +15,27 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#if !defined (CLI_UTILS_H)
-# define CLI_UTILS_H 1
+struct s
+{
+ int a;
+ int b;
+};
+
+union u
+{
+ int a;
+ float b;
+};
+
+int
+main (int argc, char *argv[])
+{
+ struct s s;
+ union u u;
+
+ s.a = 3;
+ s.b = 5;
+ u.a = 7;
-#endif /* !defined (CLI_UTILS_H) */
+ return 0; /* break to inspect struct and union */
+}
diff --git a/gdb/testsuite/gdb.python/python-value.exp b/gdb/testsuite/gdb.python/python-value.exp
new file mode 100644
index 0000000..99b576a
--- /dev/null
+++ b/gdb/testsuite/gdb.python/python-value.exp
@@ -0,0 +1,253 @@
+# Copyright (C) 2008 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# This file is part of the GDB testsuite. It tests the mechanism
+# exposing values to Python.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile "python-value"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}...
+# Run a test named NAME, consisting of multiple lines of input.
+# After each input line INPUT, search for result line RESULT.
+# Succeed if all results are seen; fail otherwise.
+proc gdb_py_test_multiple {name args} {
+ global gdb_prompt
+ foreach {input result} $args {
+ if {[gdb_test_multiple $input "$name - $input" {
+ -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" {
+ pass "$name - $input"
+ }
+ }]} {
+ return 1
+ }
+ }
+ return 0
+}
+
+# Run a command in GDB, and report a failure if a Python exception is thrown.
+# If report_pass is true, report a pass if no exception is thrown.
+proc gdb_py_test_silent_cmd {cmd name report_pass} {
+ global gdb_prompt
+
+ gdb_test_multiple $cmd $name {
+ -re "Traceback.*$gdb_prompt $" { fail $name }
+ -re "$gdb_prompt $" { if $report_pass { pass $name } }
+ }
+}
+
+proc test_value_creation {} {
+ global gdb_prompt
+
+ gdb_py_test_silent_cmd "python i = gdb.Value (True)" "create boolean value" 1
+ gdb_py_test_silent_cmd "python i = gdb.Value (5)" "create integer value" 1
+ gdb_py_test_silent_cmd "python i = gdb.Value (5L)" "create long value" 1
+ gdb_py_test_silent_cmd "python f = gdb.Value (1.25)" "create double value" 1
+ gdb_py_test_silent_cmd "python a = gdb.Value ('string test')" "create 8-bit string value" 1
+ gdb_test "python print a" "\"string test\"" "print 8-bit string"
+ gdb_test "python print a.__class__" "<type 'gdb.Value'>" "verify type of 8-bit string"
+ gdb_py_test_silent_cmd "python a = gdb.Value (u'unicode test')" "create unicode value" 1
+ gdb_test "python print a" "\"unicode test\"" "print Unicode string"
+ gdb_test "python print a.__class__" "<type 'gdb.Value'>" "verify type of unicode string"
+}
+
+proc test_value_numeric_ops {} {
+ global gdb_prompt
+
+ gdb_py_test_silent_cmd "python i = gdb.Value (5)" "create first integer value" 0
+ gdb_py_test_silent_cmd "python j = gdb.Value (2)" "create second integer value" 0
+ gdb_py_test_silent_cmd "python f = gdb.Value (1.25)" "create first double value" 0
+ gdb_py_test_silent_cmd "python g = gdb.Value (2.5)" "create second double value" 0
+ gdb_test "python print 'result = ' + str(i+j)" " = 7" "add two integer values"
+ gdb_test "python print (i+j).__class__" "<type 'gdb.Value'>" "verify type of integer add result"
+
+ gdb_test "python print 'result = ' + str(f+g)" " = 3.75" "add two double values"
+ gdb_test "python print 'result = ' + str(i-j)" " = 3" "subtract two integer values"
+ gdb_test "python print 'result = ' + str(f-g)" " = -1.25" "subtract two double values"
+ gdb_test "python print 'result = ' + str(i*j)" " = 10" "multiply two integer values"
+ gdb_test "python print 'result = ' + str(f*g)" " = 3.125" "multiply two double values"
+ gdb_test "python print 'result = ' + str(i/j)" " = 2" "divide two integer values"
+ gdb_test "python print 'result = ' + str(f/g)" " = 0.5" "divide two double values"
+ gdb_test "python print 'result = ' + str(i%j)" " = 1" "take remainder of two integer values"
+ # Remainder of float is implemented in Python but not in GDB's value system.
+
+ gdb_test "python print 'result = ' + str(i**j)" " = 25" "integer value raised to the power of another integer value"
+ gdb_test "python print 'result = ' + str(g**j)" " = 6.25" "double value raised to the power of integer value"
+
+ gdb_test "python print 'result = ' + str(-i)" " = -5" "negated integer value"
+ gdb_test "python print 'result = ' + str(+i)" " = 5" "positive integer value"
+ gdb_test "python print 'result = ' + str(-f)" " = -1.25" "negated double value"
+ gdb_test "python print 'result = ' + str(+f)" " = 1.25" "positive double value"
+ gdb_test "python print 'result = ' + str(abs(j-i))" " = 3" "absolute of integer value"
+ gdb_test "python print 'result = ' + str(abs(f-g))" " = 1.25" "absolute of double value"
+
+ # Test gdb.Value mixed with Python types.
+
+ gdb_test "python print 'result = ' + str(i-1)" " = 4" "subtract integer value from python integer"
+ gdb_test "python print (i-1).__class__" "<type 'gdb.Value'>" "verify type of mixed integer subtraction result"
+ gdb_test "python print 'result = ' + str(f+1.5)" " = 2.75" "add double value with python float"
+
+ gdb_test "python print 'result = ' + str(1-i)" " = -4" "subtract python integer from integer value"
+ gdb_test "python print 'result = ' + str(1.5+f)" " = 2.75" "add python float with double value"
+
+ # Test pointer arithmethic
+
+ # First, obtain the pointers
+ gdb_test "print (void *) 2" "" ""
+ gdb_test "python a = gdb.get_value_from_history (0)" "" ""
+ gdb_test "print (void *) 5" "" ""
+ gdb_test "python b = gdb.get_value_from_history (0)" "" ""
+
+ gdb_test "python print 'result = ' + str(a+5)" " = 0x7" "add pointer value with python integer"
+ gdb_test "python print 'result = ' + str(b-2)" " = 0x3" "subtract python integer from pointer value"
+ gdb_test "python print 'result = ' + str(b-a)" " = 3" "subtract two pointer values"
+
+ # Test some invalid operations.
+
+ gdb_test_multiple "python print 'result = ' + str(i+'foo')" "catch error in python type conversion" {
+ -re "Argument to arithmetic operation not a number or boolean.*$gdb_prompt $" {pass "catch error in python type conversion"}
+ -re "result = .*$gdb_prompt $" {fail "catch error in python type conversion"}
+ -re "$gdb_prompt $" {fail "catch error in python type conversion"}
+ }
+
+ gdb_test_multiple "python print 'result = ' + str(i+gdb.Value('foo'))" "catch throw of GDB error" {
+ -re "Traceback.*$gdb_prompt $" {pass "catch throw of GDB error"}
+ -re "result = .*$gdb_prompt $" {fail "catch throw of GDB error"}
+ -re "$gdb_prompt $" {fail "catch throw of GDB error"}
+ }
+}
+
+proc test_value_boolean {} {
+ # First, define a useful function to test booleans.
+ gdb_py_test_multiple "define function to test booleans" \
+ "python" "" \
+ "def test_bool (val):" "" \
+ " if val:" "" \
+ " print 'yay'" "" \
+ " else:" "" \
+ " print 'nay'" "" \
+ "end" ""
+
+ gdb_test "py test_bool (gdb.Value (True))" "yay" "check evaluation of true boolean value in expression"
+
+ gdb_test "py test_bool (gdb.Value (False))" "nay" "check evaluation of false boolean value in expression"
+
+ gdb_test "py test_bool (gdb.Value (5))" "yay" "check evaluation of true integer value in expression"
+
+ gdb_test "py test_bool (gdb.Value (0))" "nay" "check evaluation of false integer value in expression"
+
+ gdb_test "py test_bool (gdb.Value (5.2))" "yay" "check evaluation of true integer value in expression"
+
+ gdb_test "py test_bool (gdb.Value (0.0))" "nay" "check evaluation of false integer value in expression"
+}
+
+proc test_value_compare {} {
+ gdb_test "py print gdb.Value (1) < gdb.Value (1)" "False" "less than, equal"
+ gdb_test "py print gdb.Value (1) < gdb.Value (2)" "True" "less than, less"
+ gdb_test "py print gdb.Value (2) < gdb.Value (1)" "False" "less than, greater"
+ gdb_test "py print gdb.Value (2) < None" "False" "less than, None"
+
+ gdb_test "py print gdb.Value (1) <= gdb.Value (1)" "True" "less or equal, equal"
+ gdb_test "py print gdb.Value (1) <= gdb.Value (2)" "True" "less or equal, less"
+ gdb_test "py print gdb.Value (2) <= gdb.Value (1)" "False" "less or equal, greater"
+ gdb_test "py print gdb.Value (2) <= None" "False" "less or equal, None"
+
+ gdb_test "py print gdb.Value (1) == gdb.Value (1)" "True" "equality of gdb.Values"
+ gdb_test "py print gdb.Value (1) == gdb.Value (2)" "False" "inequality of gdb.Values"
+ gdb_test "py print gdb.Value (1) == 1.0" "True" "equality of gdb.Value with Python value"
+ gdb_test "py print gdb.Value (1) == 2" "False" "inequality of gdb.Value with Python value"
+ gdb_test "py print gdb.Value (1) == None" "False" "inequality of gdb.Value with None"
+
+ gdb_test "py print gdb.Value (1) != gdb.Value (1)" "False" "inequality, false"
+ gdb_test "py print gdb.Value (1) != gdb.Value (2)" "True" "inequality, true"
+ gdb_test "py print gdb.Value (1) != None" "True" "inequality, None"
+
+ gdb_test "py print gdb.Value (1) > gdb.Value (1)" "False" "greater than, equal"
+ gdb_test "py print gdb.Value (1) > gdb.Value (2)" "False" "greater than, less"
+ gdb_test "py print gdb.Value (2) > gdb.Value (1)" "True" "greater than, greater"
+ gdb_test "py print gdb.Value (2) > None" "True" "greater than, None"
+
+ gdb_test "py print gdb.Value (1) >= gdb.Value (1)" "True" "greater or equal, equal"
+ gdb_test "py print gdb.Value (1) >= gdb.Value (2)" "False" "greater or equal, less"
+ gdb_test "py print gdb.Value (2) >= gdb.Value (1)" "True" "greater or equal, greater"
+ gdb_test "py print gdb.Value (2) >= None" "True" "greater or equal, None"
+}
+
+proc test_value_in_inferior {} {
+ global gdb_prompt
+ global testfile
+
+ gdb_breakpoint [gdb_get_line_number "break to inspect struct and union"]
+
+ gdb_continue_to_breakpoint "break to inspect struct and union"
+
+ # Just get inferior variable s in the value history, available to python.
+ gdb_test "print s" " = {a = 3, b = 5}" ""
+
+ gdb_py_test_silent_cmd "python s = gdb.get_value_from_history (0)" "get value from history" 1
+
+ gdb_test "python print 'result = ' + str(s\['a'\])" " = 3" "access element inside struct using 8-bit string name"
+ gdb_test "python print 'result = ' + str(s\[u'a'\])" " = 3" "access element inside struct using unicode name"
+
+ # Test dereferencing the argv pointer
+
+ # Just get inferior variable argv the value history, available to python.
+ gdb_test "print argv" " = \\(char \\*\\*\\) 0x.*" ""
+
+ gdb_py_test_silent_cmd "python argv = gdb.get_value_from_history (0)" "" 0
+ gdb_py_test_silent_cmd "python arg0 = argv.dereference ()" "dereference value" 1
+
+ # Check that the dereferenced value is sane
+ gdb_test "python print arg0" "0x.*$testfile\"" "verify dereferenced value"
+}
+
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test_multiple "python print 'hello, world!'" "verify python support" {
+ -re "not supported.*$gdb_prompt $" {
+ unsupported "python support is disabled"
+ return -1
+ }
+ -re "$gdb_prompt $" {}
+}
+
+test_value_creation
+test_value_numeric_ops
+test_value_boolean
+test_value_compare
+
+# The following tests require execution.
+
+if ![runto_main] then {
+ fail "Can't run to main"
+ return 0
+}
+
+test_value_in_inferior
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 0a87668..72448cd 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -42,12 +42,20 @@ if ![info exists GDB] {
}
verbose "using GDB = $GDB" 2
+# GDBFLAGS is available for the user to set on the command line.
+# E.g. make check RUNTESTFLAGS=GDBFLAGS=mumble
+# Testcases may use it to add additional flags, but they must:
+# - append new flags, not overwrite
+# - restore the original value when done
global GDBFLAGS
if ![info exists GDBFLAGS] {
- set GDBFLAGS "-nx"
+ set GDBFLAGS ""
}
verbose "using GDBFLAGS = $GDBFLAGS" 2
+# INTERNAL_GDBFLAGS contains flags that the testsuite requires.
+set INTERNAL_GDBFLAGS "-nw -nx"
+
# The variable gdb_prompt is a regexp which matches the gdb prompt.
# Set it if it is not already set.
global gdb_prompt
@@ -94,22 +102,22 @@ set octal "\[0-7\]+"
#
proc default_gdb_version {} {
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global gdb_prompt
set fileid [open "gdb_cmd" w];
puts $fileid "q";
close $fileid;
set cmdfile [remote_download host "gdb_cmd"];
- set output [remote_exec host "$GDB -nw --command $cmdfile"]
+ set output [remote_exec host "$GDB $INTERNAL_GDBFLAGS --command $cmdfile"]
remote_file build delete "gdb_cmd";
remote_file host delete "$cmdfile";
set tmp [lindex $output 1];
set version ""
regexp " \[0-9\]\[^ \t\n\r\]+" "$tmp" version
if ![is_remote host] {
- clone_output "[which $GDB] version $version $GDBFLAGS\n"
+ clone_output "[which $GDB] version $version $INTERNAL_GDBFLAGS $GDBFLAGS\n"
} else {
- clone_output "$GDB on remote host version $version $GDBFLAGS\n"
+ clone_output "$GDB on remote host version $version $INTERNAL_GDBFLAGS $GDBFLAGS\n"
}
}
@@ -1010,7 +1018,7 @@ proc gdb_reinitialize_dir { subdir } {
#
proc default_gdb_exit {} {
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global verbose
global gdb_spawn_id;
@@ -1020,7 +1028,7 @@ proc default_gdb_exit {} {
return;
}
- verbose "Quitting $GDB $GDBFLAGS"
+ verbose "Quitting $GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
if { [is_remote host] && [board_info host exists fileid] } {
send_gdb "quit\n";
@@ -1150,14 +1158,14 @@ proc gdb_file_cmd { arg } {
proc default_gdb_start { } {
global verbose
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global gdb_prompt
global timeout
global gdb_spawn_id;
gdb_stop_suppressing_tests;
- verbose "Spawning $GDB -nw $GDBFLAGS"
+ verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
if [info exists gdb_spawn_id] {
return 0;
@@ -1169,7 +1177,7 @@ proc default_gdb_start { } {
exit 1
}
}
- set res [remote_spawn host "$GDB -nw $GDBFLAGS [host_info gdb_opts]"];
+ set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS [host_info gdb_opts]"];
if { $res < 0 || $res == "" } {
perror "Spawning $GDB failed."
return 1;
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 71c0f59..56c1b9f 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -30,6 +30,8 @@ global mi_inferior_tty_name
set MIFLAGS "-i=mi"
+set thread_selected_re "=thread-selected,id=\"\[0-9+\]\"\r\n"
+
#
# mi_gdb_exit -- exit the GDB, killing the target program if necessary
#
@@ -39,7 +41,7 @@ proc mi_gdb_exit {} {
proc mi_uncatched_gdb_exit {} {
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global verbose
global gdb_spawn_id;
global gdb_prompt
@@ -56,7 +58,7 @@ proc mi_uncatched_gdb_exit {} {
return;
}
- verbose "Quitting $GDB $GDBFLAGS $MIFLAGS"
+ verbose "Quitting $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS"
if { [is_remote host] && [board_info host exists fileid] } {
send_gdb "999-gdb-exit\n";
@@ -94,7 +96,7 @@ proc mi_uncatched_gdb_exit {} {
proc default_mi_gdb_start { args } {
global verbose
global GDB
- global GDBFLAGS
+ global INTERNAL_GDBFLAGS GDBFLAGS
global gdb_prompt
global mi_gdb_prompt
global timeout
@@ -116,7 +118,7 @@ proc default_mi_gdb_start { args } {
sid_start
}
- verbose "Spawning $GDB -nw $GDBFLAGS $MIFLAGS"
+ verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS"
if [info exists gdb_spawn_id] {
return 0;
@@ -138,7 +140,7 @@ proc default_mi_gdb_start { args } {
set mi_inferior_tty_name $spawn_out(slave,name)
}
- set res [remote_spawn host "$GDB -nw $GDBFLAGS $MIFLAGS [host_info gdb_opts]"];
+ set res [remote_spawn host "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS $MIFLAGS [host_info gdb_opts]"];
if { $res < 0 || $res == "" } {
perror "Spawning $GDB failed."
return 1;
@@ -775,6 +777,7 @@ proc mi_run_cmd {args} {
return -1
}
global mi_gdb_prompt
+ global thread_selected_re
if [target_info exists gdb_init_command] {
send_gdb "[target_info gdb_init_command]\n";
@@ -816,7 +819,7 @@ proc mi_run_cmd {args} {
send_gdb "220-exec-run $args\n"
gdb_expect {
- -re "220\\^running\r\n(\\*running,thread-id=\"\[^\"\]+\"\r\n|=thread-created,id=\"1\"\r\n)*${mi_gdb_prompt}" {
+ -re "220\\^running\r\n(\\*running,thread-id=\"\[^\"\]+\"\r\n|=thread-created,id=\"1\",group-id=\"\[0-9\]+\"\r\n)*(${thread_selected_re})?${mi_gdb_prompt}" {
}
timeout {
perror "Unable to start target"
@@ -954,6 +957,7 @@ proc mi_expect_stop { reason func args file line extra test } {
global decimal
global fullname_syntax
global async
+ global thread_selected_re
set after_stopped ""
set after_reason ""
@@ -1014,9 +1018,9 @@ proc mi_expect_stop { reason func args file line extra test } {
set any "\[^\n\]*"
- verbose -log "mi_expect_stop: expecting: \\*stopped,${r}${a}${bn}thread-id=\"$decimal\",stopped-threads=$any,frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\"$any$file\",fullname=\"${fullname_syntax}$file\",line=\"$line\"\}\r\n$after_stopped$prompt_re"
+ verbose -log "mi_expect_stop: expecting: \\*stopped,${r}${a}${bn}thread-id=\"$decimal\",stopped-threads=$any,frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\"$any$file\",fullname=\"${fullname_syntax}$file\",line=\"$line\"\}$after_stopped\r\n($thread_selected_re)?$prompt_re"
gdb_expect {
- -re "\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",stopped-threads=$any,frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\"$any$file\",fullname=\"${fullname_syntax}$file\",line=\"($line)\"\}$after_stopped\r\n$prompt_re" {
+ -re "\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",stopped-threads=$any,frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\"$any$file\",fullname=\"${fullname_syntax}$file\",line=\"($line)\"\}$after_stopped\r\n($thread_selected_re)?$prompt_re" {
pass "$test"
return $expect_out(2,string)
}
@@ -1050,7 +1054,7 @@ proc mi_expect_interrupt { test } {
set prompt_re "$mi_gdb_prompt$"
}
- set r "reason=\"signal-received\",signal-name=\"SIGINT\",signal-meaning=\"Interrupt\""
+ set r "reason=\"signal-received\",signal-name=\"0\",signal-meaning=\"Signal 0\""
set any "\[^\n\]*"
@@ -1430,10 +1434,11 @@ proc mi_tbreak {location} {
proc mi_send_resuming_command_raw {command test} {
global mi_gdb_prompt
+ global thread_selected_re
send_gdb "$command\n"
gdb_expect {
- -re "\\^running\r\n\\*running,thread-id=\"\[^\"\]+\"\r\n${mi_gdb_prompt}" {
+ -re "\\^running\r\n\\*running,thread-id=\"\[^\"\]+\"\r\n($thread_selected_re)?${mi_gdb_prompt}" {
# Note that lack of 'pass' call here -- this works around limitation
# in DejaGNU xfail mechanism. mi-until.exp has this:
#
diff --git a/gdb/thread.c b/gdb/thread.c
index 94e1873..1f50e6a 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -606,14 +606,44 @@ set_executing (ptid_t ptid, int executing)
}
}
+void
+set_stop_requested (ptid_t ptid, int stop)
+{
+ struct thread_info *tp;
+ int all = ptid_equal (ptid, minus_one_ptid);
+
+ if (all || ptid_is_pid (ptid))
+ {
+ for (tp = thread_list; tp; tp = tp->next)
+ if (all || ptid_get_pid (tp->ptid) == ptid_get_pid (ptid))
+ tp->stop_requested = stop;
+ }
+ else
+ {
+ tp = find_thread_pid (ptid);
+ gdb_assert (tp);
+ tp->stop_requested = stop;
+ }
+
+ /* Call the stop requested observer so other components of GDB can
+ react to this request. */
+ if (stop)
+ observer_notify_thread_stop_requested (ptid);
+}
+
/* Prints the list of threads and their details on UIOUT.
This is a version of 'info_thread_command' suitable for
use from MI.
If REQUESTED_THREAD is not -1, it's the GDB id of the thread
that should be printed. Otherwise, all threads are
- printed. */
+ printed.
+ If PID is not -1, only print threads from the process PID.
+ Otherwise, threads from all attached PIDs are printed.
+ If both REQUESTED_THREAD and PID are not -1, then the thread
+ is printed if it belongs to the specified process. Otherwise,
+ an error is raised. */
void
-print_thread_info (struct ui_out *uiout, int requested_thread)
+print_thread_info (struct ui_out *uiout, int requested_thread, int pid)
{
struct thread_info *tp;
ptid_t current_ptid;
@@ -636,6 +666,13 @@ print_thread_info (struct ui_out *uiout, int requested_thread)
if (requested_thread != -1 && tp->num != requested_thread)
continue;
+ if (pid != -1 && PIDGET (tp->ptid) != pid)
+ {
+ if (requested_thread != -1)
+ error (_("Requested thread not found in requested process"));
+ continue;
+ }
+
if (ptid_equal (tp->ptid, current_ptid))
current_thread = tp->num;
@@ -653,17 +690,14 @@ print_thread_info (struct ui_out *uiout, int requested_thread)
ui_out_text (uiout, " ");
ui_out_field_string (uiout, "target-id", target_tid_to_str (tp->ptid));
- if (tp->state_ != THREAD_EXITED)
+ extra_info = target_extra_thread_info (tp);
+ if (extra_info)
{
- extra_info = target_extra_thread_info (tp);
- if (extra_info)
- {
- ui_out_text (uiout, " (");
- ui_out_field_string (uiout, "details", extra_info);
- ui_out_text (uiout, ")");
- }
- ui_out_text (uiout, " ");
+ ui_out_text (uiout, " (");
+ ui_out_field_string (uiout, "details", extra_info);
+ ui_out_text (uiout, ")");
}
+ ui_out_text (uiout, " ");
if (tp->state_ == THREAD_RUNNING)
ui_out_text (uiout, "(running)\n");
@@ -681,9 +715,7 @@ print_thread_info (struct ui_out *uiout, int requested_thread)
if (ui_out_is_mi_like_p (uiout))
{
char *state = "stopped";
- if (tp->state_ == THREAD_EXITED)
- state = "exited";
- else if (tp->state_ == THREAD_RUNNING)
+ if (tp->state_ == THREAD_RUNNING)
state = "running";
ui_out_field_string (uiout, "state", state);
}
@@ -695,7 +727,7 @@ print_thread_info (struct ui_out *uiout, int requested_thread)
the "info threads" command. */
do_cleanups (old_chain);
- if (requested_thread == -1)
+ if (pid == -1 && requested_thread == -1 )
{
gdb_assert (current_thread != -1
|| !thread_list);
@@ -720,7 +752,7 @@ The current thread <Thread ID %d> has terminated. See `help thread'.\n",
static void
info_threads_command (char *arg, int from_tty)
{
- print_thread_info (uiout, -1);
+ print_thread_info (uiout, -1, -1);
}
/* Switch from one thread to another. */
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 4f5c56a..5c8c205 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -38,6 +38,7 @@
#include "dictionary.h"
#include "observer.h"
#include "user-regs.h"
+#include "valprint.h"
#include "ax.h"
#include "ax-gdb.h"
@@ -67,7 +68,6 @@
extern void (*deprecated_readline_begin_hook) (char *, ...);
extern char *(*deprecated_readline_hook) (char *);
extern void (*deprecated_readline_end_hook) (void);
-extern int addressprint; /* Print machine addresses? */
/* GDB commands implemented in other modules:
*/
@@ -434,9 +434,11 @@ trace_command (char *arg, int from_tty)
static void
trace_mention (struct tracepoint *tp)
{
+ struct value_print_options opts;
printf_filtered ("Tracepoint %d", tp->number);
- if (addressprint || (tp->source_file == NULL))
+ get_user_print_options (&opts);
+ if (opts.addressprint || (tp->source_file == NULL))
{
printf_filtered (" at ");
printf_filtered ("%s", paddress (tp->address));
@@ -467,12 +469,12 @@ tracepoints_info (char *tpnum_exp, int from_tty)
ALL_TRACEPOINTS (t)
if (tpnum == -1 || tpnum == t->number)
{
- extern int addressprint; /* Print machine addresses? */
-
+ struct value_print_options opts;
+ get_user_print_options (&opts);
if (!found_a_tracepoint++)
{
printf_filtered ("Num Enb ");
- if (addressprint)
+ if (opts.addressprint)
{
if (gdbarch_addr_bit (current_gdbarch) <= 32)
printf_filtered ("Address ");
@@ -482,7 +484,7 @@ tracepoints_info (char *tpnum_exp, int from_tty)
printf_filtered ("PassC StepC What\n");
}
strcpy (wrap_indent, " ");
- if (addressprint)
+ if (opts.addressprint)
{
if (gdbarch_addr_bit (current_gdbarch) <= 32)
strcat (wrap_indent, " ");
@@ -492,7 +494,7 @@ tracepoints_info (char *tpnum_exp, int from_tty)
printf_filtered ("%-3d %-3s ", t->number,
t->enabled_p ? "y" : "n");
- if (addressprint)
+ if (opts.addressprint)
{
char *tmp;
@@ -2292,6 +2294,7 @@ tracepoint_save_command (char *args, int from_tty)
char *i1 = " ", *i2 = " ";
char *indent, *actionline, *pathname;
char tmp[40];
+ struct cleanup *cleanup;
if (args == 0 || *args == 0)
error (_("Argument required (file name in which to save tracepoints)"));
@@ -2303,10 +2306,11 @@ tracepoint_save_command (char *args, int from_tty)
}
pathname = tilde_expand (args);
+ cleanup = make_cleanup (xfree, pathname);
if (!(fp = fopen (pathname, "w")))
error (_("Unable to open file '%s' for saving tracepoints (%s)"),
args, safe_strerror (errno));
- xfree (pathname);
+ make_cleanup_fclose (fp);
ALL_TRACEPOINTS (tp)
{
@@ -2348,7 +2352,7 @@ tracepoint_save_command (char *args, int from_tty)
}
}
}
- fclose (fp);
+ do_cleanups (cleanup);
if (from_tty)
printf_filtered ("Tracepoints saved to file '%s'.\n", args);
return;
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 39580e6..b2428ef 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -37,6 +37,7 @@
#include "tui/tui-wingeneral.h"
#include "tui/tui-file.h"
#include "reggroups.h"
+#include "valprint.h"
#include "gdb_curses.h"
@@ -689,11 +690,13 @@ tui_register_format (struct gdbarch *gdbarch,
{
gdb_byte buf[MAX_REGISTER_SIZE];
int len;
+ struct value_print_options opts;
len = register_size (current_gdbarch, regnum);
fprintf_filtered (stream, "%-14s ", name);
get_frame_register (frame, regnum, buf);
- print_scalar_formatted (buf, type, 'f', len, stream);
+ get_formatted_print_options (&opts, 'f');
+ print_scalar_formatted (buf, type, &opts, len, stream);
}
else
{
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index 44f1a77..edf87cd 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -33,12 +33,9 @@
#include "cp-abi.h"
#include "typeprint.h"
#include "gdb_string.h"
+#include "valprint.h"
#include <errno.h>
-/* For real-type printing in whatis_exp() */
-extern int objectprint; /* Controls looking up an object's derived type
- using what we find in its vtables. */
-
extern void _initialize_typeprint (void);
static void ptype_command (char *, int);
@@ -95,6 +92,7 @@ whatis_exp (char *exp, int show)
int full = 0;
int top = -1;
int using_enc = 0;
+ struct value_print_options opts;
if (exp)
{
@@ -107,7 +105,8 @@ whatis_exp (char *exp, int show)
type = value_type (val);
- if (objectprint)
+ get_user_print_options (&opts);
+ if (opts.objectprint)
{
if (((TYPE_CODE (type) == TYPE_CODE_PTR)
|| (TYPE_CODE (type) == TYPE_CODE_REF))
diff --git a/gdb/utils.c b/gdb/utils.c
index ce05909..d14009f 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -244,7 +244,6 @@ do_close_cleanup (void *arg)
{
int *fd = arg;
close (*fd);
- xfree (fd);
}
struct cleanup *
@@ -252,7 +251,24 @@ make_cleanup_close (int fd)
{
int *saved_fd = xmalloc (sizeof (fd));
*saved_fd = fd;
- return make_cleanup (do_close_cleanup, saved_fd);
+ return make_cleanup_dtor (do_close_cleanup, saved_fd, xfree);
+}
+
+/* Helper function which does the work for make_cleanup_fclose. */
+
+static void
+do_fclose_cleanup (void *arg)
+{
+ FILE *file = arg;
+ fclose (arg);
+}
+
+/* Return a new cleanup that closes FILE. */
+
+struct cleanup *
+make_cleanup_fclose (FILE *file)
+{
+ return make_cleanup (do_fclose_cleanup, file);
}
static void
@@ -489,6 +505,59 @@ add_continuation (struct thread_info *thread,
thread->continuations = (struct continuation *) as_cleanup;
}
+/* Add a continuation to the continuation list of INFERIOR. The new
+ continuation will be added at the front. */
+
+void
+add_inferior_continuation (void (*continuation_hook) (void *), void *args,
+ void (*continuation_free_args) (void *))
+{
+ struct inferior *inf = current_inferior ();
+ struct cleanup *as_cleanup = &inf->continuations->base;
+ make_cleanup_ftype *continuation_hook_fn = continuation_hook;
+
+ make_my_cleanup2 (&as_cleanup,
+ continuation_hook_fn,
+ args,
+ continuation_free_args);
+
+ inf->continuations = (struct continuation *) as_cleanup;
+}
+
+/* Do all continuations of the current inferior. */
+
+void
+do_all_inferior_continuations (void)
+{
+ struct cleanup *old_chain;
+ struct cleanup *as_cleanup;
+ struct inferior *inf = current_inferior ();
+
+ if (inf->continuations == NULL)
+ return;
+
+ /* Copy the list header into another pointer, and set the global
+ list header to null, so that the global list can change as a side
+ effect of invoking the continuations and the processing of the
+ preexisting continuations will not be affected. */
+
+ as_cleanup = &inf->continuations->base;
+ inf->continuations = NULL;
+
+ /* Work now on the list we have set aside. */
+ do_my_cleanups (&as_cleanup, NULL);
+}
+
+/* Get rid of all the inferior-wide continuations of INF. */
+
+void
+discard_all_inferior_continuations (struct inferior *inf)
+{
+ struct cleanup *continuation_ptr = &inf->continuations->base;
+ discard_my_cleanups (&continuation_ptr, NULL);
+ inf->continuations = NULL;
+}
+
static void
restore_thread_cleanup (void *arg)
{
@@ -2217,13 +2286,22 @@ vfprintf_unfiltered (struct ui_file *stream, const char *format, va_list args)
{
struct timeval tm;
char *timestamp;
+ int len, need_nl;
gettimeofday (&tm, NULL);
- timestamp = xstrprintf ("%ld:%ld ", (long) tm.tv_sec, (long) tm.tv_usec);
+
+ len = strlen (linebuffer);
+ need_nl = (len > 0 && linebuffer[len - 1] != '\n');
+
+ timestamp = xstrprintf ("%ld:%ld %s%s",
+ (long) tm.tv_sec, (long) tm.tv_usec,
+ linebuffer,
+ need_nl ? "\n": "");
make_cleanup (xfree, timestamp);
fputs_unfiltered (timestamp, stream);
}
- fputs_unfiltered (linebuffer, stream);
+ else
+ fputs_unfiltered (linebuffer, stream);
do_cleanups (old_cleanups);
}
@@ -3349,3 +3427,17 @@ ldirname (const char *filename)
dirname[base - filename] = '\0';
return dirname;
}
+
+/* Call libiberty's buildargv, and return the result.
+ If buildargv fails due to out-of-memory, call nomem.
+ Therefore, the returned value is guaranteed to be non-NULL,
+ unless the parameter itself is NULL. */
+
+char **
+gdb_buildargv (const char *s)
+{
+ char **argv = buildargv (s);
+ if (s != NULL && argv == NULL)
+ nomem (0);
+ return argv;
+}
diff --git a/gdb/valops.c b/gdb/valops.c
index 5232e3f..0c539c1 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -361,8 +361,7 @@ value_cast (struct type *type, struct value *arg2)
{
struct type *element_type = TYPE_TARGET_TYPE (type);
unsigned element_length = TYPE_LENGTH (check_typedef (element_type));
- if (element_length > 0
- && TYPE_ARRAY_UPPER_BOUND_TYPE (type) == BOUND_CANNOT_BE_DETERMINED)
+ if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
{
struct type *range_type = TYPE_INDEX_TYPE (type);
int val_length = TYPE_LENGTH (type2);
@@ -1460,7 +1459,7 @@ search_struct_field (char *name, struct value *arg1, int offset,
if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
{
struct value *v;
- if (TYPE_FIELD_STATIC (type, i))
+ if (field_is_static (&TYPE_FIELD (type, i)))
{
v = value_static_field (type, i);
if (v == 0)
@@ -2541,7 +2540,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
if (t_field_name && strcmp (t_field_name, name) == 0)
{
- if (TYPE_FIELD_STATIC (t, i))
+ if (field_is_static (&TYPE_FIELD (t, i)))
{
v = value_static_field (t, i);
if (v == NULL)
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 99c376f..5086a70 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -60,13 +60,55 @@ static void set_output_radix_1 (int, unsigned);
void _initialize_valprint (void);
-/* Maximum number of chars to print for a string pointer value or vector
- contents, or UINT_MAX for no limit. Note that "set print elements 0"
- stores UINT_MAX in print_max, which displays in a show command as
- "unlimited". */
-
-unsigned int print_max;
#define PRINT_MAX_DEFAULT 200 /* Start print_max off at this value. */
+
+struct value_print_options user_print_options =
+{
+ Val_pretty_default, /* pretty */
+ 0, /* prettyprint_arrays */
+ 0, /* prettyprint_structs */
+ 0, /* vtblprint */
+ 1, /* unionprint */
+ 1, /* addressprint */
+ 0, /* objectprint */
+ PRINT_MAX_DEFAULT, /* print_max */
+ 10, /* repeat_count_threshold */
+ 0, /* output_format */
+ 0, /* format */
+ 0, /* stop_print_at_null */
+ 0, /* inspect_it */
+ 0, /* print_array_indexes */
+ 0, /* deref_ref */
+ 1, /* static_field_print */
+ 1 /* pascal_static_field_print */
+};
+
+/* Initialize *OPTS to be a copy of the user print options. */
+void
+get_user_print_options (struct value_print_options *opts)
+{
+ *opts = user_print_options;
+}
+
+/* Initialize *OPTS to be a copy of the user print options, but with
+ pretty-printing disabled. */
+void
+get_raw_print_options (struct value_print_options *opts)
+{
+ *opts = user_print_options;
+ opts->pretty = Val_no_prettyprint;
+}
+
+/* Initialize *OPTS to be a copy of the user print options, but using
+ FORMAT as the formatting option. */
+void
+get_formatted_print_options (struct value_print_options *opts,
+ char format)
+{
+ *opts = user_print_options;
+ opts->format = format;
+}
+
static void
show_print_max (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -98,12 +140,10 @@ show_output_radix (struct ui_file *file, int from_tty,
Default output radix for printing of values is %s.\n"),
value);
}
-int output_format = 0;
/* By default we print arrays without printing the index of each element in
the array. This behavior can be changed by setting PRINT_ARRAY_INDEXES. */
-static int print_array_indexes = 0;
static void
show_print_array_indexes (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -115,7 +155,6 @@ show_print_array_indexes (struct ui_file *file, int from_tty,
element in an array. Referenced by the low level language dependent
print routines. */
-unsigned int repeat_count_threshold = 10;
static void
show_repeat_count_threshold (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -126,7 +165,6 @@ show_repeat_count_threshold (struct ui_file *file, int from_tty,
/* If nonzero, stops printing of char arrays at first null. */
-int stop_print_at_null;
static void
show_stop_print_at_null (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -138,7 +176,6 @@ Printing of char arrays to stop at first null char is %s.\n"),
/* Controls pretty printing of structures. */
-int prettyprint_structs;
static void
show_prettyprint_structs (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -148,7 +185,6 @@ show_prettyprint_structs (struct ui_file *file, int from_tty,
/* Controls pretty printing of arrays. */
-int prettyprint_arrays;
static void
show_prettyprint_arrays (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -159,7 +195,6 @@ show_prettyprint_arrays (struct ui_file *file, int from_tty,
/* If nonzero, causes unions inside structures or other unions to be
printed. */
-int unionprint; /* Controls printing of nested unions. */
static void
show_unionprint (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -171,7 +206,6 @@ Printing of unions interior to structures is %s.\n"),
/* If nonzero, causes machine addresses to be printed in certain contexts. */
-int addressprint; /* Controls printing of machine addresses */
static void
show_addressprint (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -182,13 +216,7 @@ show_addressprint (struct ui_file *file, int from_tty,
/* Print using the given LANGUAGE the data of type TYPE located at VALADDR
(within GDB), which came from the inferior at address ADDRESS, onto
- stdio stream STREAM according to FORMAT (a letter, or 0 for natural
- format using TYPE).
-
- If DEREF_REF is nonzero, then dereference references, otherwise just print
- them like pointers.
-
- The PRETTY parameter controls prettyprinting.
+ stdio stream STREAM according to OPTIONS.
If the data are a string pointer, returns the number of string characters
printed.
@@ -203,17 +231,18 @@ show_addressprint (struct ui_file *file, int from_tty,
int
val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
- CORE_ADDR address, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty,
+ CORE_ADDR address, struct ui_file *stream, int recurse,
+ const struct value_print_options *options,
const struct language_defn *language)
{
volatile struct gdb_exception except;
- volatile enum val_prettyprint real_pretty = pretty;
int ret = 0;
-
+ struct value_print_options local_opts = *options;
struct type *real_type = check_typedef (type);
- if (pretty == Val_pretty_default)
- real_pretty = prettyprint_structs ? Val_prettyprint : Val_no_prettyprint;
+
+ if (local_opts.pretty == Val_pretty_default)
+ local_opts.pretty = (local_opts.prettyprint_structs
+ ? Val_prettyprint : Val_no_prettyprint);
QUIT;
@@ -231,8 +260,7 @@ val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
TRY_CATCH (except, RETURN_MASK_ERROR)
{
ret = language->la_val_print (type, valaddr, embedded_offset, address,
- stream, format, deref_ref, recurse,
- real_pretty);
+ stream, recurse, &local_opts);
}
if (except.reason < 0)
fprintf_filtered (stream, _("<error reading variable>"));
@@ -263,12 +291,7 @@ value_check_printable (struct value *val, struct ui_file *stream)
}
/* Print using the given LANGUAGE the value VAL onto stream STREAM according
- to FORMAT (a letter, or 0 for natural format using TYPE).
-
- If DEREF_REF is nonzero, then dereference references, otherwise just print
- them like pointers.
-
- The PRETTY parameter controls prettyprinting.
+ to OPTIONS.
If the data are a string pointer, returns the number of string characters
printed.
@@ -277,8 +300,8 @@ value_check_printable (struct value *val, struct ui_file *stream)
GDB's value mechanism. */
int
-common_val_print (struct value *val, struct ui_file *stream, int format,
- int deref_ref, int recurse, enum val_prettyprint pretty,
+common_val_print (struct value *val, struct ui_file *stream, int recurse,
+ const struct value_print_options *options,
const struct language_defn *language)
{
if (!value_check_printable (val, stream))
@@ -286,23 +309,22 @@ common_val_print (struct value *val, struct ui_file *stream, int format,
return val_print (value_type (val), value_contents_all (val),
value_embedded_offset (val), VALUE_ADDRESS (val),
- stream, format, deref_ref, recurse, pretty,
- language);
+ stream, recurse, options, language);
}
-/* Print the value VAL in C-ish syntax on stream STREAM.
- FORMAT is a format-letter, or 0 for print in natural format of data type.
+/* Print the value VAL in C-ish syntax on stream STREAM according to
+ OPTIONS.
If the object printed is a string pointer, returns
the number of string bytes printed. */
int
-value_print (struct value *val, struct ui_file *stream, int format,
- enum val_prettyprint pretty)
+value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options)
{
if (!value_check_printable (val, stream))
return 0;
- return LA_VALUE_PRINT (val, stream, format, pretty);
+ return LA_VALUE_PRINT (val, stream, options);
}
/* Called by various <lang>_val_print routines to print
@@ -928,15 +950,6 @@ print_char_chars (struct ui_file *stream, const gdb_byte *valaddr,
}
}
-/* Return non-zero if the debugger should print the index of each element
- when printing array values. */
-
-int
-print_array_indexes_p (void)
-{
- return print_array_indexes;
-}
-
/* Assuming TYPE is a simple, non-empty array type, compute its upper
and lower bound. Save the low bound into LOW_BOUND if not NULL.
Save the high bound into HIGH_BOUND if not NULL.
@@ -992,23 +1005,23 @@ get_array_bounds (struct type *type, long *low_bound, long *high_bound)
return 1;
}
-/* Print on STREAM using the given FORMAT the index for the element
+/* Print on STREAM using the given OPTIONS the index for the element
at INDEX of an array whose index type is INDEX_TYPE. */
void
maybe_print_array_index (struct type *index_type, LONGEST index,
- struct ui_file *stream, int format,
- enum val_prettyprint pretty)
+ struct ui_file *stream,
+ const struct value_print_options *options)
{
struct value *index_value;
- if (!print_array_indexes)
+ if (!options->print_array_indexes)
return;
index_value = value_from_longest (index_type, index);
- LA_PRINT_ARRAY_INDEX (index_value, stream, format, pretty);
-}
+ LA_PRINT_ARRAY_INDEX (index_value, stream, options);
+}
/* Called by various <lang>_val_print routines to print elements of an
array in the form "<elem1>, <elem2>, <elem3>, ...".
@@ -1022,8 +1035,8 @@ maybe_print_array_index (struct type *index_type, LONGEST index,
void
val_print_array_elements (struct type *type, const gdb_byte *valaddr,
CORE_ADDR address, struct ui_file *stream,
- int format, int deref_ref,
- int recurse, enum val_prettyprint pretty,
+ int recurse,
+ const struct value_print_options *options,
unsigned int i)
{
unsigned int things_printed = 0;
@@ -1070,11 +1083,11 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
annotate_array_section_begin (i, elttype);
- for (; i < len && things_printed < print_max; i++)
+ for (; i < len && things_printed < options->print_max; i++)
{
if (i != 0)
{
- if (prettyprint_arrays)
+ if (options->prettyprint_arrays)
{
fprintf_filtered (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream);
@@ -1086,7 +1099,7 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
}
wrap_here (n_spaces (2 + 2 * recurse));
maybe_print_array_index (index_type, i + low_bound_index,
- stream, format, pretty);
+ stream, options);
rep1 = i + 1;
reps = 1;
@@ -1097,21 +1110,21 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
++rep1;
}
- if (reps > repeat_count_threshold)
+ if (reps > options->repeat_count_threshold)
{
- val_print (elttype, valaddr + i * eltlen, 0, 0, stream, format,
- deref_ref, recurse + 1, pretty, current_language);
+ val_print (elttype, valaddr + i * eltlen, 0, 0, stream,
+ recurse + 1, options, current_language);
annotate_elt_rep (reps);
fprintf_filtered (stream, " <repeats %u times>", reps);
annotate_elt_rep_end ();
i = rep1 - 1;
- things_printed += repeat_count_threshold;
+ things_printed += options->repeat_count_threshold;
}
else
{
- val_print (elttype, valaddr + i * eltlen, 0, 0, stream, format,
- deref_ref, recurse + 1, pretty, current_language);
+ val_print (elttype, valaddr + i * eltlen, 0, 0, stream,
+ recurse + 1, options, current_language);
annotate_elt ();
things_printed++;
}
@@ -1173,7 +1186,8 @@ partial_memory_read (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int *errnoptr
/* FIXME: Use target_read_string. */
int
-val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream)
+val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream,
+ const struct value_print_options *options)
{
int force_ellipsis = 0; /* Force ellipsis to be printed if nonzero. */
int errcode; /* Errno returned from bad reads. */
@@ -1194,7 +1208,7 @@ val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream)
because finding the null byte (or available memory) is what actually
limits the fetch. */
- fetchlimit = (len == -1 ? print_max : min (len, print_max));
+ fetchlimit = (len == -1 ? options->print_max : min (len, options->print_max));
/* Now decide how large of chunks to try to read in one operation. This
is also pretty simple. If LEN >= zero, then we want fetchlimit chars,
@@ -1317,11 +1331,11 @@ val_print_string (CORE_ADDR addr, int len, int width, struct ui_file *stream)
and then the error message. */
if (errcode == 0 || bufptr > buffer)
{
- if (addressprint)
+ if (options->addressprint)
{
fputs_filtered (" ", stream);
}
- LA_PRINT_STRING (stream, buffer, (bufptr - buffer) / width, width, force_ellipsis);
+ LA_PRINT_STRING (stream, buffer, (bufptr - buffer) / width, width, force_ellipsis, options);
}
if (errcode != 0)
@@ -1394,13 +1408,13 @@ set_output_radix_1 (int from_tty, unsigned radix)
switch (radix)
{
case 16:
- output_format = 'x'; /* hex */
+ user_print_options.output_format = 'x'; /* hex */
break;
case 10:
- output_format = 0; /* decimal */
+ user_print_options.output_format = 0; /* decimal */
break;
case 8:
- output_format = 'o'; /* octal */
+ user_print_options.output_format = 'o'; /* octal */
break;
default:
/* FIXME: cagney/2002-03-17: This needs to revert the bad radix
@@ -1494,7 +1508,8 @@ _initialize_valprint (void)
add_alias_cmd ("p", "print", no_class, 1, &showlist);
add_alias_cmd ("pr", "print", no_class, 1, &showlist);
- add_setshow_uinteger_cmd ("elements", no_class, &print_max, _("\
+ add_setshow_uinteger_cmd ("elements", no_class,
+ &user_print_options.print_max, _("\
Set limit on string chars or array elements to print."), _("\
Show limit on string chars or array elements to print."), _("\
\"set print elements 0\" causes there to be no limit."),
@@ -1502,7 +1517,8 @@ Show limit on string chars or array elements to print."), _("\
show_print_max,
&setprintlist, &showprintlist);
- add_setshow_boolean_cmd ("null-stop", no_class, &stop_print_at_null, _("\
+ add_setshow_boolean_cmd ("null-stop", no_class,
+ &user_print_options.stop_print_at_null, _("\
Set printing of char arrays to stop at first null char."), _("\
Show printing of char arrays to stop at first null char."), NULL,
NULL,
@@ -1510,7 +1526,7 @@ Show printing of char arrays to stop at first null char."), NULL,
&setprintlist, &showprintlist);
add_setshow_uinteger_cmd ("repeats", no_class,
- &repeat_count_threshold, _("\
+ &user_print_options.repeat_count_threshold, _("\
Set threshold for repeated print elements."), _("\
Show threshold for repeated print elements."), _("\
\"set print repeats 0\" causes all elements to be individually printed."),
@@ -1518,28 +1534,32 @@ Show threshold for repeated print elements."), _("\
show_repeat_count_threshold,
&setprintlist, &showprintlist);
- add_setshow_boolean_cmd ("pretty", class_support, &prettyprint_structs, _("\
+ add_setshow_boolean_cmd ("pretty", class_support,
+ &user_print_options.prettyprint_structs, _("\
Set prettyprinting of structures."), _("\
Show prettyprinting of structures."), NULL,
NULL,
show_prettyprint_structs,
&setprintlist, &showprintlist);
- add_setshow_boolean_cmd ("union", class_support, &unionprint, _("\
+ add_setshow_boolean_cmd ("union", class_support,
+ &user_print_options.unionprint, _("\
Set printing of unions interior to structures."), _("\
Show printing of unions interior to structures."), NULL,
NULL,
show_unionprint,
&setprintlist, &showprintlist);
- add_setshow_boolean_cmd ("array", class_support, &prettyprint_arrays, _("\
+ add_setshow_boolean_cmd ("array", class_support,
+ &user_print_options.prettyprint_arrays, _("\
Set prettyprinting of arrays."), _("\
Show prettyprinting of arrays."), NULL,
NULL,
show_prettyprint_arrays,
&setprintlist, &showprintlist);
- add_setshow_boolean_cmd ("address", class_support, &addressprint, _("\
+ add_setshow_boolean_cmd ("address", class_support,
+ &user_print_options.addressprint, _("\
Set printing of addresses."), _("\
Show printing of addresses."), NULL,
NULL,
@@ -1578,15 +1598,8 @@ Use 'show input-radix' or 'show output-radix' to independently show each."),
&showlist);
add_setshow_boolean_cmd ("array-indexes", class_support,
- &print_array_indexes, _("\
+ &user_print_options.print_array_indexes, _("\
Set printing of array indexes."), _("\
Show printing of array indexes"), NULL, NULL, show_print_array_indexes,
&setprintlist, &showprintlist);
-
- /* Give people the defaults which they are used to. */
- prettyprint_structs = 0;
- prettyprint_arrays = 0;
- unionprint = 1;
- addressprint = 1;
- print_max = PRINT_MAX_DEFAULT;
}
diff --git a/gdb/valprint.h b/gdb/valprint.h
index 3b20516..47a2c4f 100644
--- a/gdb/valprint.h
+++ b/gdb/valprint.h
@@ -21,45 +21,98 @@
#ifndef VALPRINT_H
#define VALPRINT_H
-extern int prettyprint_arrays; /* Controls pretty printing of arrays. */
-extern int prettyprint_structs; /* Controls pretty printing of structures */
-extern int prettyprint_arrays; /* Controls pretty printing of arrays. */
+/* This is used to pass formatting options to various value-printing
+ functions. */
+struct value_print_options
+{
+ /* Pretty-printing control. */
+ enum val_prettyprint pretty;
-extern int vtblprint; /* Controls printing of vtbl's */
-extern int unionprint; /* Controls printing of nested unions. */
-extern int addressprint; /* Controls pretty printing of addresses. */
-extern int objectprint; /* Controls looking up an object's derived type
- using what we find in its vtables. */
+ /* Controls pretty printing of arrays. */
+ int prettyprint_arrays;
-extern unsigned int print_max; /* Max # of chars for strings/vectors */
+ /* Controls pretty printing of structures. */
+ int prettyprint_structs;
-/* Flag to low-level print routines that this value is being printed
- in an epoch window. We'd like to pass this as a parameter, but
- every routine would need to take it. Perhaps we can encapsulate
- this in the I/O stream once we have GNU stdio. */
-extern int inspect_it;
+ /* Controls printing of virtual tables. */
+ int vtblprint;
-/* Print repeat counts if there are more than this many repetitions of an
- element in an array. Referenced by the low level language dependent
- print routines. */
-extern unsigned int repeat_count_threshold;
+ /* Controls printing of nested unions. */
+ int unionprint;
-extern int output_format;
+ /* Controls printing of addresses. */
+ int addressprint;
-extern int stop_print_at_null; /* Stop printing at null char? */
+ /* Controls looking up an object's derived type using what we find
+ in its vtables. */
+ int objectprint;
+
+ /* Maximum number of chars to print for a string pointer value or vector
+ contents, or UINT_MAX for no limit. Note that "set print elements 0"
+ stores UINT_MAX in print_max, which displays in a show command as
+ "unlimited". */
+ unsigned int print_max;
+
+ /* Print repeat counts if there are more than this many repetitions
+ of an element in an array. */
+ unsigned int repeat_count_threshold;
+
+ /* The global output format letter. */
+ int output_format;
+
+ /* The current format letter. This is set locally for a given call,
+ e.g. when the user passes a format to "print". */
+ int format;
+
+ /* Stop printing at null character? */
+ int stop_print_at_null;
+
+ /* True if this value is being printed in an epoch window. */
+ int inspect_it;
+
+ /* True if we should print the index of each element when printing
+ an array. */
+ int print_array_indexes;
+
+ /* If nonzero, then dereference references, otherwise just print
+ them like pointers. */
+ int deref_ref;
+
+ /* If nonzero, print static fields. */
+ int static_field_print;
+
+ /* If nonzero, print static fields for Pascal. FIXME: C++ and Java
+ share one flag, why not Pascal too? */
+ int pascal_static_field_print;
+};
+
+/* The global print options set by the user. In general this should
+ not be directly accessed, except by set/show commands. Ordinary
+ code should call get_user_print_options instead. */
+extern struct value_print_options user_print_options;
+
+/* Initialize *OPTS to be a copy of the user print options. */
+extern void get_user_print_options (struct value_print_options *opts);
+
+/* Initialize *OPTS to be a copy of the user print options, but with
+ pretty-printing disabled. */
+extern void get_raw_print_options (struct value_print_options *opts);
+
+/* Initialize *OPTS to be a copy of the user print options, but using
+ FORMAT as the formatting option. */
+extern void get_formatted_print_options (struct value_print_options *opts,
+ char format);
-extern int print_array_indexes_p (void);
-
extern int get_array_bounds (struct type *type, long *low_bound,
long *high_bound);
extern void maybe_print_array_index (struct type *index_type, LONGEST index,
- struct ui_file *stream, int format,
- enum val_prettyprint pretty);
+ struct ui_file *stream,
+ const struct value_print_options *options);
extern void val_print_array_elements (struct type *, const gdb_byte *,
CORE_ADDR, struct ui_file *, int,
- int, int, enum val_prettyprint,
+ const struct value_print_options *,
unsigned int);
extern void val_print_type_code_int (struct type *, const gdb_byte *,
diff --git a/gdb/value.c b/gdb/value.c
index f3f2c72..695aa33 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -36,6 +36,9 @@
#include "block.h"
#include "dfp.h"
#include "objfiles.h"
+#include "valprint.h"
+
+#include "python/python.h"
/* Prototypes for exported functions. */
@@ -130,8 +133,8 @@ struct value
/* Values are stored in a chain, so that they can be deleted easily
over calls to the inferior. Values assigned to internal
- variables or put into the value history are taken off this
- list. */
+ variables, put into the value history or exposed to Python are
+ taken off this list. */
struct value *next;
/* Register number if the value is from a register. */
@@ -257,6 +260,31 @@ allocate_repeat_value (struct type *type, int count)
type, range_type));
}
+/* Needed if another module needs to maintain its on list of values. */
+void
+value_prepend_to_list (struct value **head, struct value *val)
+{
+ val->next = *head;
+ *head = val;
+}
+
+/* Needed if another module needs to maintain its on list of values. */
+void
+value_remove_from_list (struct value **head, struct value *val)
+{
+ struct value *prev;
+
+ if (*head == val)
+ *head = (*head)->next;
+ else
+ for (prev = *head; prev->next; prev = prev->next)
+ if (prev->next == val)
+ {
+ prev->next = val->next;
+ break;
+ }
+}
+
/* Accessor methods. */
struct value *
@@ -681,9 +709,11 @@ show_values (char *num_exp, int from_tty)
for (i = num; i < num + 10 && i <= value_history_count; i++)
{
+ struct value_print_options opts;
val = access_value_history (i);
printf_filtered (("$%d = "), i);
- value_print (val, gdb_stdout, 0, Val_pretty_default);
+ get_user_print_options (&opts);
+ value_print (val, gdb_stdout, &opts);
printf_filtered (("\n"));
}
@@ -916,6 +946,7 @@ preserve_values (struct objfile *objfile)
htab_t copied_types;
struct value_history_chunk *cur;
struct internalvar *var;
+ struct value *val;
int i;
/* Create the hash table. We allocate on the objfile's obstack, since
@@ -930,6 +961,9 @@ preserve_values (struct objfile *objfile)
for (var = internalvars; var; var = var->next)
preserve_one_value (var->value, objfile, copied_types);
+ for (val = values_in_python; val; val = val->next)
+ preserve_one_value (val, objfile, copied_types);
+
htab_delete (copied_types);
}
@@ -938,7 +972,9 @@ show_convenience (char *ignore, int from_tty)
{
struct internalvar *var;
int varseen = 0;
+ struct value_print_options opts;
+ get_user_print_options (&opts);
for (var = internalvars; var; var = var->next)
{
if (!varseen)
@@ -947,7 +983,7 @@ show_convenience (char *ignore, int from_tty)
}
printf_filtered (("$%s = "), var->name);
value_print (value_of_internalvar (var), gdb_stdout,
- 0, Val_pretty_default);
+ &opts);
printf_filtered (("\n"));
}
if (!varseen)
@@ -1236,7 +1272,7 @@ value_static_field (struct type *type, int fieldno)
{
struct value *retval;
- if (TYPE_FIELD_STATIC_HAS_ADDR (type, fieldno))
+ if (TYPE_FIELD_LOC_KIND (type, fieldno) == FIELD_LOC_KIND_PHYSADDR)
{
retval = value_at (TYPE_FIELD_TYPE (type, fieldno),
TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
@@ -1692,12 +1728,21 @@ coerce_ref (struct value *arg)
struct value *
coerce_array (struct value *arg)
{
+ struct type *type;
+
arg = coerce_ref (arg);
- if (current_language->c_style_arrays
- && TYPE_CODE (value_type (arg)) == TYPE_CODE_ARRAY)
- arg = value_coerce_array (arg);
- if (TYPE_CODE (value_type (arg)) == TYPE_CODE_FUNC)
- arg = value_coerce_function (arg);
+ type = check_typedef (value_type (arg));
+
+ switch (TYPE_CODE (type))
+ {
+ case TYPE_CODE_ARRAY:
+ if (current_language->c_style_arrays)
+ arg = value_coerce_array (arg);
+ break;
+ case TYPE_CODE_FUNC:
+ arg = value_coerce_function (arg);
+ break;
+ }
return arg;
}
diff --git a/gdb/value.h b/gdb/value.h
index deb2629..65fea99 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -32,6 +32,7 @@ struct symbol;
struct type;
struct ui_file;
struct language_defn;
+struct value_print_options;
/* The structure which defines the type of a value. It should never
be possible for a program lval value to survive over a call to the
@@ -40,9 +41,15 @@ struct language_defn;
struct value;
+/* Needed if another module needs to maintain its own list of values. */
+
+void value_prepend_to_list (struct value **head, struct value *val);
+void value_remove_from_list (struct value **head, struct value *val);
+
/* Values are stored in a chain, so that they can be deleted easily
- over calls to the inferior. Values assigned to internal variables
- or put into the value history are taken off this list. */
+ over calls to the inferior. Values assigned to internal variables,
+ put into the value history or exposed to Python are taken off this
+ list. */
struct value *value_next (struct value *);
@@ -520,8 +527,8 @@ extern void print_floating (const gdb_byte *valaddr, struct type *type,
extern void print_decimal_floating (const gdb_byte *valaddr, struct type *type,
struct ui_file *stream);
-extern int value_print (struct value *val, struct ui_file *stream, int format,
- enum val_prettyprint pretty);
+extern int value_print (struct value *val, struct ui_file *stream,
+ const struct value_print_options *options);
extern void value_print_array_elements (struct value *val,
struct ui_file *stream, int format,
@@ -531,19 +538,18 @@ extern struct value *value_release_to_mark (struct value *mark);
extern int val_print (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format,
- int deref_ref, int recurse,
- enum val_prettyprint pretty,
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options,
const struct language_defn *language);
extern int common_val_print (struct value *val,
- struct ui_file *stream, int format,
- int deref_ref, int recurse,
- enum val_prettyprint pretty,
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options,
const struct language_defn *language);
extern int val_print_string (CORE_ADDR addr, int len, int width,
- struct ui_file *stream);
+ struct ui_file *stream,
+ const struct value_print_options *options);
extern void print_variable_value (struct symbol *var,
struct frame_info *frame,
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 5b44eef..ab369a2 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -25,6 +25,7 @@
#include "wrapper.h"
#include "gdbcmd.h"
#include "block.h"
+#include "valprint.h"
#include "gdb_assert.h"
#include "gdb_string.h"
@@ -1791,6 +1792,7 @@ value_get_print_value (struct value *value, enum varobj_display_formats format)
struct ui_file *stb;
struct cleanup *old_chain;
char *thevalue;
+ struct value_print_options opts;
if (value == NULL)
return NULL;
@@ -1798,8 +1800,9 @@ value_get_print_value (struct value *value, enum varobj_display_formats format)
stb = mem_fileopen ();
old_chain = make_cleanup_ui_file_delete (stb);
- common_val_print (value, stb, format_code[(int) format], 1, 0, 0,
- current_language);
+ get_formatted_print_options (&opts, format_code[(int) format]);
+ opts.deref_ref = 0;
+ common_val_print (value, stb, 0, &opts, current_language);
thevalue = ui_file_xstrdup (stb, &dummy);
do_cleanups (old_chain);
@@ -1951,7 +1954,7 @@ c_number_of_children (struct varobj *var)
{
case TYPE_CODE_ARRAY:
if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (target) > 0
- && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED)
+ && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
children = TYPE_LENGTH (type) / TYPE_LENGTH (target);
else
/* If we don't know how many elements there are, don't display
@@ -2013,7 +2016,7 @@ value_struct_element_index (struct value *value, int type_index)
TRY_CATCH (e, RETURN_MASK_ERROR)
{
- if (TYPE_FIELD_STATIC (type, type_index))
+ if (field_is_static (&TYPE_FIELD (type, type_index)))
result = value_static_field (type, type_index);
else
result = value_primitive_field (value, 0, type_index, type);
diff --git a/gdb/version.in b/gdb/version.in
index d5946e7..8a63961 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-6.8.50.20080930-cvs
+6.8.50.20081120-cvs
diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c
index 03b2f52..5350be6 100644
--- a/gdb/win32-nat.c
+++ b/gdb/win32-nat.c
@@ -1550,6 +1550,12 @@ do_initial_win32_stuff (DWORD pid, int attaching)
inf = add_inferior (pid);
inf->attach_flag = attaching;
+ /* Make the new process the current inferior, so terminal handling
+ can rely on it. When attaching, we don't know about any thread
+ id here, but that's OK --- nothing should be referencing the
+ current thread until we report an event out of win32_wait. */
+ inferior_ptid = pid_to_ptid (pid);
+
terminal_init_inferior_with_pgrp (pid);
target_terminal_inferior ();
@@ -1678,7 +1684,7 @@ out:
/* Attach to process PID, then initialize for debugging it. */
static void
-win32_attach (char *args, int from_tty)
+win32_attach (struct target_ops *ops, char *args, int from_tty)
{
BOOL ok;
DWORD pid;
@@ -1734,7 +1740,7 @@ win32_attach (char *args, int from_tty)
}
static void
-win32_detach (char *args, int from_tty)
+win32_detach (struct target_ops *ops, char *args, int from_tty)
{
int detached = 1;
@@ -1817,8 +1823,8 @@ win32_open (char *arg, int from_tty)
ENV is the environment vector to pass. Errors reported with error(). */
static void
-win32_create_inferior (char *exec_file, char *allargs, char **in_env,
- int from_tty)
+win32_create_inferior (struct target_ops *ops, char *exec_file,
+ char *allargs, char **in_env, int from_tty)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
@@ -1945,7 +1951,7 @@ win32_create_inferior (char *exec_file, char *allargs, char **in_env,
}
static void
-win32_mourn_inferior (void)
+win32_mourn_inferior (struct target_ops *ops)
{
(void) win32_continue (DBG_CONTINUE, -1);
i386_cleanup_dregs();
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 54e2aba..e7941ac 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -834,7 +834,7 @@ enter_line_range (struct subfile *subfile, unsigned beginoffset, unsigned endoff
namestr = (NAME); \
if (namestr[0] == '.') ++namestr; \
prim_record_minimal_symbol_and_info (namestr, (ADDR), (TYPE), \
- (char *)NULL, (SECTION), (asection *)NULL, (OBJFILE)); \
+ (SECTION), (asection *)NULL, (OBJFILE)); \
misc_func_recorded = 1; \
}
@@ -2285,7 +2285,7 @@ scan_xcoff_symtab (struct objfile *objfile)
prim_record_minimal_symbol_and_info
(namestring, symbol.n_value,
sclass == C_HIDEXT ? mst_file_data : mst_data,
- NULL, secnum_to_section (symbol.n_scnum, objfile),
+ secnum_to_section (symbol.n_scnum, objfile),
NULL, objfile);
break;
@@ -2360,7 +2360,7 @@ scan_xcoff_symtab (struct objfile *objfile)
prim_record_minimal_symbol_and_info
(namestring, symbol.n_value,
sclass == C_HIDEXT ? mst_file_data : mst_data,
- NULL, secnum_to_section (symbol.n_scnum, objfile),
+ secnum_to_section (symbol.n_scnum, objfile),
NULL, objfile);
break;
}
@@ -2377,7 +2377,7 @@ scan_xcoff_symtab (struct objfile *objfile)
prim_record_minimal_symbol_and_info
(namestring, symbol.n_value,
sclass == C_HIDEXT ? mst_file_bss : mst_bss,
- NULL, secnum_to_section (symbol.n_scnum, objfile),
+ secnum_to_section (symbol.n_scnum, objfile),
NULL, objfile);
break;
}
diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c
index 42bc4a0..2e8c1f5 100644
--- a/gdb/xml-tdesc.c
+++ b/gdb/xml-tdesc.c
@@ -421,14 +421,6 @@ tdesc_parse_xml (const char *document, xml_fetch_another fetcher,
#endif /* HAVE_LIBEXPAT */
-/* Close FILE. */
-
-static void
-do_cleanup_fclose (void *file)
-{
- fclose (file);
-}
-
/* Open FILENAME, read all its text into memory, close it, and return
the text. If something goes wrong, return NULL and warn. */
@@ -455,7 +447,7 @@ fetch_xml_from_file (const char *filename, void *baton)
if (file == NULL)
return NULL;
- back_to = make_cleanup (do_cleanup_fclose, file);
+ back_to = make_cleanup_fclose (file);
/* Read in the whole file, one chunk at a time. */
len = 4096;
diff --git a/gdb/xtensa-config.c b/gdb/xtensa-config.c
index ce47540..2ee84a0 100644
--- a/gdb/xtensa-config.c
+++ b/gdb/xtensa-config.c
@@ -25,37 +25,37 @@
/* Masked registers. */
-xtensa_reg_mask_t xtensa_submask0[] = { { 74, 0, 4 } };
+xtensa_reg_mask_t xtensa_submask0[] = { { 42, 0, 4 } };
const xtensa_mask_t xtensa_mask0 = { 1, xtensa_submask0 };
-xtensa_reg_mask_t xtensa_submask1[] = { { 74, 5, 1 } };
+xtensa_reg_mask_t xtensa_submask1[] = { { 42, 5, 1 } };
const xtensa_mask_t xtensa_mask1 = { 1, xtensa_submask1 };
-xtensa_reg_mask_t xtensa_submask2[] = { { 74, 18, 1 } };
+xtensa_reg_mask_t xtensa_submask2[] = { { 42, 18, 1 } };
const xtensa_mask_t xtensa_mask2 = { 1, xtensa_submask2 };
-xtensa_reg_mask_t xtensa_submask3[] = { { 74, 6, 2 } };
+xtensa_reg_mask_t xtensa_submask3[] = { { 42, 6, 2 } };
const xtensa_mask_t xtensa_mask3 = { 1, xtensa_submask3 };
-xtensa_reg_mask_t xtensa_submask4[] = { { 74, 4, 1 } };
+xtensa_reg_mask_t xtensa_submask4[] = { { 42, 4, 1 } };
const xtensa_mask_t xtensa_mask4 = { 1, xtensa_submask4 };
-xtensa_reg_mask_t xtensa_submask5[] = { { 74, 16, 2 } };
+xtensa_reg_mask_t xtensa_submask5[] = { { 42, 16, 2 } };
const xtensa_mask_t xtensa_mask5 = { 1, xtensa_submask5 };
-xtensa_reg_mask_t xtensa_submask6[] = { { 74, 8, 4 } };
+xtensa_reg_mask_t xtensa_submask6[] = { { 42, 8, 4 } };
const xtensa_mask_t xtensa_mask6 = { 1, xtensa_submask6 };
-xtensa_reg_mask_t xtensa_submask7[] = { { 69, 12, 20 } };
+xtensa_reg_mask_t xtensa_submask7[] = { { 37, 12, 20 } };
const xtensa_mask_t xtensa_mask7 = { 1, xtensa_submask7 };
-xtensa_reg_mask_t xtensa_submask8[] = { { 69, 0, 1 } };
+xtensa_reg_mask_t xtensa_submask8[] = { { 37, 0, 1 } };
const xtensa_mask_t xtensa_mask8 = { 1, xtensa_submask8 };
-xtensa_reg_mask_t xtensa_submask9[] = { { 104, 8, 4 } };
+xtensa_reg_mask_t xtensa_submask9[] = { { 86, 8, 4 } };
const xtensa_mask_t xtensa_mask9 = { 1, xtensa_submask9 };
-xtensa_reg_mask_t xtensa_submask10[] = { { 76, 24, 8 } };
+xtensa_reg_mask_t xtensa_submask10[] = { { 47, 24, 8 } };
const xtensa_mask_t xtensa_mask10 = { 1, xtensa_submask10 };
-xtensa_reg_mask_t xtensa_submask11[] = { { 76, 16, 8 } };
+xtensa_reg_mask_t xtensa_submask11[] = { { 47, 16, 8 } };
const xtensa_mask_t xtensa_mask11 = { 1, xtensa_submask11 };
-xtensa_reg_mask_t xtensa_submask12[] = { { 76, 8, 8 } };
+xtensa_reg_mask_t xtensa_submask12[] = { { 47, 8, 8 } };
const xtensa_mask_t xtensa_mask12 = { 1, xtensa_submask12 };
-xtensa_reg_mask_t xtensa_submask13[] = { { 77, 16, 2 } };
+xtensa_reg_mask_t xtensa_submask13[] = { { 48, 16, 2 } };
const xtensa_mask_t xtensa_mask13 = { 1, xtensa_submask13 };
-xtensa_reg_mask_t xtensa_submask14[] = { { 78, 16, 2 } };
+xtensa_reg_mask_t xtensa_submask14[] = { { 49, 16, 2 } };
const xtensa_mask_t xtensa_mask14 = { 1, xtensa_submask14 };
-xtensa_reg_mask_t xtensa_submask15[] = { { 75, 22, 10 } };
+xtensa_reg_mask_t xtensa_submask15[] = { { 45, 22, 10 } };
const xtensa_mask_t xtensa_mask15 = { 1, xtensa_submask15 };
@@ -96,135 +96,117 @@ xtensa_register_t rmap[] =
XTREG( 30,120,32, 4, 4,0x011d,0x0006,-2, 1,0x0002,ar29, 0,0,0,0,0,0)
XTREG( 31,124,32, 4, 4,0x011e,0x0006,-2, 1,0x0002,ar30, 0,0,0,0,0,0)
XTREG( 32,128,32, 4, 4,0x011f,0x0006,-2, 1,0x0002,ar31, 0,0,0,0,0,0)
- XTREG( 33,132,32, 4, 4,0x0120,0x0006,-2, 1,0x0002,ar32, 0,0,0,0,0,0)
- XTREG( 34,136,32, 4, 4,0x0121,0x0006,-2, 1,0x0002,ar33, 0,0,0,0,0,0)
- XTREG( 35,140,32, 4, 4,0x0122,0x0006,-2, 1,0x0002,ar34, 0,0,0,0,0,0)
- XTREG( 36,144,32, 4, 4,0x0123,0x0006,-2, 1,0x0002,ar35, 0,0,0,0,0,0)
- XTREG( 37,148,32, 4, 4,0x0124,0x0006,-2, 1,0x0002,ar36, 0,0,0,0,0,0)
- XTREG( 38,152,32, 4, 4,0x0125,0x0006,-2, 1,0x0002,ar37, 0,0,0,0,0,0)
- XTREG( 39,156,32, 4, 4,0x0126,0x0006,-2, 1,0x0002,ar38, 0,0,0,0,0,0)
- XTREG( 40,160,32, 4, 4,0x0127,0x0006,-2, 1,0x0002,ar39, 0,0,0,0,0,0)
- XTREG( 41,164,32, 4, 4,0x0128,0x0006,-2, 1,0x0002,ar40, 0,0,0,0,0,0)
- XTREG( 42,168,32, 4, 4,0x0129,0x0006,-2, 1,0x0002,ar41, 0,0,0,0,0,0)
- XTREG( 43,172,32, 4, 4,0x012a,0x0006,-2, 1,0x0002,ar42, 0,0,0,0,0,0)
- XTREG( 44,176,32, 4, 4,0x012b,0x0006,-2, 1,0x0002,ar43, 0,0,0,0,0,0)
- XTREG( 45,180,32, 4, 4,0x012c,0x0006,-2, 1,0x0002,ar44, 0,0,0,0,0,0)
- XTREG( 46,184,32, 4, 4,0x012d,0x0006,-2, 1,0x0002,ar45, 0,0,0,0,0,0)
- XTREG( 47,188,32, 4, 4,0x012e,0x0006,-2, 1,0x0002,ar46, 0,0,0,0,0,0)
- XTREG( 48,192,32, 4, 4,0x012f,0x0006,-2, 1,0x0002,ar47, 0,0,0,0,0,0)
- XTREG( 49,196,32, 4, 4,0x0130,0x0006,-2, 1,0x0002,ar48, 0,0,0,0,0,0)
- XTREG( 50,200,32, 4, 4,0x0131,0x0006,-2, 1,0x0002,ar49, 0,0,0,0,0,0)
- XTREG( 51,204,32, 4, 4,0x0132,0x0006,-2, 1,0x0002,ar50, 0,0,0,0,0,0)
- XTREG( 52,208,32, 4, 4,0x0133,0x0006,-2, 1,0x0002,ar51, 0,0,0,0,0,0)
- XTREG( 53,212,32, 4, 4,0x0134,0x0006,-2, 1,0x0002,ar52, 0,0,0,0,0,0)
- XTREG( 54,216,32, 4, 4,0x0135,0x0006,-2, 1,0x0002,ar53, 0,0,0,0,0,0)
- XTREG( 55,220,32, 4, 4,0x0136,0x0006,-2, 1,0x0002,ar54, 0,0,0,0,0,0)
- XTREG( 56,224,32, 4, 4,0x0137,0x0006,-2, 1,0x0002,ar55, 0,0,0,0,0,0)
- XTREG( 57,228,32, 4, 4,0x0138,0x0006,-2, 1,0x0002,ar56, 0,0,0,0,0,0)
- XTREG( 58,232,32, 4, 4,0x0139,0x0006,-2, 1,0x0002,ar57, 0,0,0,0,0,0)
- XTREG( 59,236,32, 4, 4,0x013a,0x0006,-2, 1,0x0002,ar58, 0,0,0,0,0,0)
- XTREG( 60,240,32, 4, 4,0x013b,0x0006,-2, 1,0x0002,ar59, 0,0,0,0,0,0)
- XTREG( 61,244,32, 4, 4,0x013c,0x0006,-2, 1,0x0002,ar60, 0,0,0,0,0,0)
- XTREG( 62,248,32, 4, 4,0x013d,0x0006,-2, 1,0x0002,ar61, 0,0,0,0,0,0)
- XTREG( 63,252,32, 4, 4,0x013e,0x0006,-2, 1,0x0002,ar62, 0,0,0,0,0,0)
- XTREG( 64,256,32, 4, 4,0x013f,0x0006,-2, 1,0x0002,ar63, 0,0,0,0,0,0)
- XTREG( 65,260,32, 4, 4,0x0200,0x0006,-2, 2,0x1100,lbeg, 0,0,0,0,0,0)
- XTREG( 66,264,32, 4, 4,0x0201,0x0006,-2, 2,0x1100,lend, 0,0,0,0,0,0)
- XTREG( 67,268,32, 4, 4,0x0202,0x0006,-2, 2,0x1100,lcount, 0,0,0,0,0,0)
- XTREG( 68,272, 6, 4, 4,0x0203,0x0006,-2, 2,0x1100,sar, 0,0,0,0,0,0)
- XTREG( 69,276,32, 4, 4,0x0205,0x0006,-2, 2,0x1100,litbase, 0,0,0,0,0,0)
- XTREG( 70,280, 4, 4, 4,0x0248,0x0006,-2, 2,0x1002,windowbase, 0,0,0,0,0,0)
- XTREG( 71,284,16, 4, 4,0x0249,0x0006,-2, 2,0x1002,windowstart, 0,0,0,0,0,0)
- XTREG( 72,288,32, 4, 4,0x02b0,0x0002,-2, 2,0x1000,sr176, 0,0,0,0,0,0)
- XTREG( 73,292,32, 4, 4,0x02d0,0x0002,-2, 2,0x1000,sr208, 0,0,0,0,0,0)
- XTREG( 74,296,19, 4, 4,0x02e6,0x0006,-2, 2,0x1100,ps, 0,0,0,0,0,0)
- XTREG( 75,300,32, 4, 4,0x0253,0x0007,-2, 2,0x1000,ptevaddr, 0,0,0,0,0,0)
- XTREG( 76,304,32, 4, 4,0x025a,0x0007,-2, 2,0x1000,rasid, 0,0,0,0,0,0)
- XTREG( 77,308,18, 4, 4,0x025b,0x0007,-2, 2,0x1000,itlbcfg, 0,0,0,0,0,0)
- XTREG( 78,312,18, 4, 4,0x025c,0x0007,-2, 2,0x1000,dtlbcfg, 0,0,0,0,0,0)
- XTREG( 79,316, 2, 4, 4,0x0260,0x0007,-2, 2,0x1000,ibreakenable,0,0,0,0,0,0)
- XTREG( 80,320,32, 4, 4,0x0268,0x0007,-2, 2,0x1000,ddr, 0,0,0,0,0,0)
- XTREG( 81,324,32, 4, 4,0x0280,0x0007,-2, 2,0x1000,ibreaka0, 0,0,0,0,0,0)
- XTREG( 82,328,32, 4, 4,0x0281,0x0007,-2, 2,0x1000,ibreaka1, 0,0,0,0,0,0)
- XTREG( 83,332,32, 4, 4,0x0290,0x0007,-2, 2,0x1000,dbreaka0, 0,0,0,0,0,0)
- XTREG( 84,336,32, 4, 4,0x0291,0x0007,-2, 2,0x1000,dbreaka1, 0,0,0,0,0,0)
- XTREG( 85,340,32, 4, 4,0x02a0,0x0007,-2, 2,0x1000,dbreakc0, 0,0,0,0,0,0)
- XTREG( 86,344,32, 4, 4,0x02a1,0x0007,-2, 2,0x1000,dbreakc1, 0,0,0,0,0,0)
- XTREG( 87,348,32, 4, 4,0x02b1,0x0007,-2, 2,0x1000,epc1, 0,0,0,0,0,0)
- XTREG( 88,352,32, 4, 4,0x02b2,0x0007,-2, 2,0x1000,epc2, 0,0,0,0,0,0)
- XTREG( 89,356,32, 4, 4,0x02b3,0x0007,-2, 2,0x1000,epc3, 0,0,0,0,0,0)
- XTREG( 90,360,32, 4, 4,0x02b4,0x0007,-2, 2,0x1000,epc4, 0,0,0,0,0,0)
- XTREG( 91,364,32, 4, 4,0x02c0,0x0007,-2, 2,0x1000,depc, 0,0,0,0,0,0)
- XTREG( 92,368,19, 4, 4,0x02c2,0x0007,-2, 2,0x1000,eps2, 0,0,0,0,0,0)
- XTREG( 93,372,19, 4, 4,0x02c3,0x0007,-2, 2,0x1000,eps3, 0,0,0,0,0,0)
- XTREG( 94,376,19, 4, 4,0x02c4,0x0007,-2, 2,0x1000,eps4, 0,0,0,0,0,0)
- XTREG( 95,380,32, 4, 4,0x02d1,0x0007,-2, 2,0x1000,excsave1, 0,0,0,0,0,0)
- XTREG( 96,384,32, 4, 4,0x02d2,0x0007,-2, 2,0x1000,excsave2, 0,0,0,0,0,0)
- XTREG( 97,388,32, 4, 4,0x02d3,0x0007,-2, 2,0x1000,excsave3, 0,0,0,0,0,0)
- XTREG( 98,392,32, 4, 4,0x02d4,0x0007,-2, 2,0x1000,excsave4, 0,0,0,0,0,0)
- XTREG( 99,396,17, 4, 4,0x02e2,0x000b,-2, 2,0x1000,interrupt, 0,0,0,0,0,0)
- XTREG(100,400,17, 4, 4,0x02e2,0x000d,-2, 2,0x1000,intset, 0,0,0,0,0,0)
- XTREG(101,404,17, 4, 4,0x02e3,0x000d,-2, 2,0x1000,intclear, 0,0,0,0,0,0)
- XTREG(102,408,17, 4, 4,0x02e4,0x0007,-2, 2,0x1000,intenable, 0,0,0,0,0,0)
- XTREG(103,412, 6, 4, 4,0x02e8,0x0007,-2, 2,0x1000,exccause, 0,0,0,0,0,0)
- XTREG(104,416,12, 4, 4,0x02e9,0x0003,-2, 2,0x1000,debugcause, 0,0,0,0,0,0)
- XTREG(105,420,32, 4, 4,0x02ea,0x000f,-2, 2,0x1000,ccount, 0,0,0,0,0,0)
- XTREG(106,424,32, 4, 4,0x02eb,0x0003,-2, 2,0x1000,prid, 0,0,0,0,0,0)
- XTREG(107,428,32, 4, 4,0x02ec,0x000f,-2, 2,0x1000,icount, 0,0,0,0,0,0)
- XTREG(108,432, 4, 4, 4,0x02ed,0x0007,-2, 2,0x1000,icountlevel, 0,0,0,0,0,0)
- XTREG(109,436,32, 4, 4,0x02ee,0x0007,-2, 2,0x1000,excvaddr, 0,0,0,0,0,0)
- XTREG(110,440,32, 4, 4,0x02f0,0x000f,-2, 2,0x1000,ccompare0, 0,0,0,0,0,0)
- XTREG(111,444,32, 4, 4,0x02f1,0x000f,-2, 2,0x1000,ccompare1, 0,0,0,0,0,0)
- XTREG(112,448,32, 4, 4,0x02f2,0x000f,-2, 2,0x1000,ccompare2, 0,0,0,0,0,0)
- XTREG(113,452,32, 4, 4,0x02f4,0x0007,-2, 2,0x1000,misc0, 0,0,0,0,0,0)
- XTREG(114,456,32, 4, 4,0x02f5,0x0007,-2, 2,0x1000,misc1, 0,0,0,0,0,0)
- XTREG(115,460,32, 4, 4,0x0000,0x0006,-2, 8,0x0100,a0, 0,0,0,0,0,0)
- XTREG(116,464,32, 4, 4,0x0001,0x0006,-2, 8,0x0100,a1, 0,0,0,0,0,0)
- XTREG(117,468,32, 4, 4,0x0002,0x0006,-2, 8,0x0100,a2, 0,0,0,0,0,0)
- XTREG(118,472,32, 4, 4,0x0003,0x0006,-2, 8,0x0100,a3, 0,0,0,0,0,0)
- XTREG(119,476,32, 4, 4,0x0004,0x0006,-2, 8,0x0100,a4, 0,0,0,0,0,0)
- XTREG(120,480,32, 4, 4,0x0005,0x0006,-2, 8,0x0100,a5, 0,0,0,0,0,0)
- XTREG(121,484,32, 4, 4,0x0006,0x0006,-2, 8,0x0100,a6, 0,0,0,0,0,0)
- XTREG(122,488,32, 4, 4,0x0007,0x0006,-2, 8,0x0100,a7, 0,0,0,0,0,0)
- XTREG(123,492,32, 4, 4,0x0008,0x0006,-2, 8,0x0100,a8, 0,0,0,0,0,0)
- XTREG(124,496,32, 4, 4,0x0009,0x0006,-2, 8,0x0100,a9, 0,0,0,0,0,0)
- XTREG(125,500,32, 4, 4,0x000a,0x0006,-2, 8,0x0100,a10, 0,0,0,0,0,0)
- XTREG(126,504,32, 4, 4,0x000b,0x0006,-2, 8,0x0100,a11, 0,0,0,0,0,0)
- XTREG(127,508,32, 4, 4,0x000c,0x0006,-2, 8,0x0100,a12, 0,0,0,0,0,0)
- XTREG(128,512,32, 4, 4,0x000d,0x0006,-2, 8,0x0100,a13, 0,0,0,0,0,0)
- XTREG(129,516,32, 4, 4,0x000e,0x0006,-2, 8,0x0100,a14, 0,0,0,0,0,0)
- XTREG(130,520,32, 4, 4,0x000f,0x0006,-2, 8,0x0100,a15, 0,0,0,0,0,0)
- XTREG(131,524, 4, 4, 4,0x2004,0x0006,-2, 6,0x1010,psintlevel,
+ XTREG( 33,132,32, 4, 4,0x0200,0x0006,-2, 2,0x1100,lbeg, 0,0,0,0,0,0)
+ XTREG( 34,136,32, 4, 4,0x0201,0x0006,-2, 2,0x1100,lend, 0,0,0,0,0,0)
+ XTREG( 35,140,32, 4, 4,0x0202,0x0006,-2, 2,0x1100,lcount, 0,0,0,0,0,0)
+ XTREG( 36,144, 6, 4, 4,0x0203,0x0006,-2, 2,0x1100,sar, 0,0,0,0,0,0)
+ XTREG( 37,148,32, 4, 4,0x0205,0x0006,-2, 2,0x1100,litbase, 0,0,0,0,0,0)
+ XTREG( 38,152, 3, 4, 4,0x0248,0x0006,-2, 2,0x1002,windowbase, 0,0,0,0,0,0)
+ XTREG( 39,156, 8, 4, 4,0x0249,0x0006,-2, 2,0x1002,windowstart, 0,0,0,0,0,0)
+ XTREG( 40,160,32, 4, 4,0x02b0,0x0002,-2, 2,0x1000,sr176, 0,0,0,0,0,0)
+ XTREG( 41,164,32, 4, 4,0x02d0,0x0002,-2, 2,0x1000,sr208, 0,0,0,0,0,0)
+ XTREG( 42,168,19, 4, 4,0x02e6,0x0006,-2, 2,0x1100,ps, 0,0,0,0,0,0)
+ XTREG( 43,172,32, 4, 4,0x03e7,0x0006,-2, 3,0x0110,threadptr, 0,0,0,0,0,0)
+ XTREG( 44,176,32, 4, 4,0x020c,0x0006,-1, 2,0x1100,scompare1, 0,0,0,0,0,0)
+ XTREG( 45,180,32, 4, 4,0x0253,0x0007,-2, 2,0x1000,ptevaddr, 0,0,0,0,0,0)
+ XTREG( 46,184,32, 4, 4,0x0259,0x000d,-2, 2,0x1000,mmid, 0,0,0,0,0,0)
+ XTREG( 47,188,32, 4, 4,0x025a,0x0007,-2, 2,0x1000,rasid, 0,0,0,0,0,0)
+ XTREG( 48,192,18, 4, 4,0x025b,0x0007,-2, 2,0x1000,itlbcfg, 0,0,0,0,0,0)
+ XTREG( 49,196,18, 4, 4,0x025c,0x0007,-2, 2,0x1000,dtlbcfg, 0,0,0,0,0,0)
+ XTREG( 50,200, 2, 4, 4,0x0260,0x0007,-2, 2,0x1000,ibreakenable,0,0,0,0,0,0)
+ XTREG( 51,204,32, 4, 4,0x0268,0x0007,-2, 2,0x1000,ddr, 0,0,0,0,0,0)
+ XTREG( 52,208,32, 4, 4,0x0280,0x0007,-2, 2,0x1000,ibreaka0, 0,0,0,0,0,0)
+ XTREG( 53,212,32, 4, 4,0x0281,0x0007,-2, 2,0x1000,ibreaka1, 0,0,0,0,0,0)
+ XTREG( 54,216,32, 4, 4,0x0290,0x0007,-2, 2,0x1000,dbreaka0, 0,0,0,0,0,0)
+ XTREG( 55,220,32, 4, 4,0x0291,0x0007,-2, 2,0x1000,dbreaka1, 0,0,0,0,0,0)
+ XTREG( 56,224,32, 4, 4,0x02a0,0x0007,-2, 2,0x1000,dbreakc0, 0,0,0,0,0,0)
+ XTREG( 57,228,32, 4, 4,0x02a1,0x0007,-2, 2,0x1000,dbreakc1, 0,0,0,0,0,0)
+ XTREG( 58,232,32, 4, 4,0x02b1,0x0007,-2, 2,0x1000,epc1, 0,0,0,0,0,0)
+ XTREG( 59,236,32, 4, 4,0x02b2,0x0007,-2, 2,0x1000,epc2, 0,0,0,0,0,0)
+ XTREG( 60,240,32, 4, 4,0x02b3,0x0007,-2, 2,0x1000,epc3, 0,0,0,0,0,0)
+ XTREG( 61,244,32, 4, 4,0x02b4,0x0007,-2, 2,0x1000,epc4, 0,0,0,0,0,0)
+ XTREG( 62,248,32, 4, 4,0x02b5,0x0007,-2, 2,0x1000,epc5, 0,0,0,0,0,0)
+ XTREG( 63,252,32, 4, 4,0x02b6,0x0007,-2, 2,0x1000,epc6, 0,0,0,0,0,0)
+ XTREG( 64,256,32, 4, 4,0x02b7,0x0007,-2, 2,0x1000,epc7, 0,0,0,0,0,0)
+ XTREG( 65,260,32, 4, 4,0x02c0,0x0007,-2, 2,0x1000,depc, 0,0,0,0,0,0)
+ XTREG( 66,264,19, 4, 4,0x02c2,0x0007,-2, 2,0x1000,eps2, 0,0,0,0,0,0)
+ XTREG( 67,268,19, 4, 4,0x02c3,0x0007,-2, 2,0x1000,eps3, 0,0,0,0,0,0)
+ XTREG( 68,272,19, 4, 4,0x02c4,0x0007,-2, 2,0x1000,eps4, 0,0,0,0,0,0)
+ XTREG( 69,276,19, 4, 4,0x02c5,0x0007,-2, 2,0x1000,eps5, 0,0,0,0,0,0)
+ XTREG( 70,280,19, 4, 4,0x02c6,0x0007,-2, 2,0x1000,eps6, 0,0,0,0,0,0)
+ XTREG( 71,284,19, 4, 4,0x02c7,0x0007,-2, 2,0x1000,eps7, 0,0,0,0,0,0)
+ XTREG( 72,288,32, 4, 4,0x02d1,0x0007,-2, 2,0x1000,excsave1, 0,0,0,0,0,0)
+ XTREG( 73,292,32, 4, 4,0x02d2,0x0007,-2, 2,0x1000,excsave2, 0,0,0,0,0,0)
+ XTREG( 74,296,32, 4, 4,0x02d3,0x0007,-2, 2,0x1000,excsave3, 0,0,0,0,0,0)
+ XTREG( 75,300,32, 4, 4,0x02d4,0x0007,-2, 2,0x1000,excsave4, 0,0,0,0,0,0)
+ XTREG( 76,304,32, 4, 4,0x02d5,0x0007,-2, 2,0x1000,excsave5, 0,0,0,0,0,0)
+ XTREG( 77,308,32, 4, 4,0x02d6,0x0007,-2, 2,0x1000,excsave6, 0,0,0,0,0,0)
+ XTREG( 78,312,32, 4, 4,0x02d7,0x0007,-2, 2,0x1000,excsave7, 0,0,0,0,0,0)
+ XTREG( 79,316, 8, 4, 4,0x02e0,0x0007,-2, 2,0x1000,cpenable, 0,0,0,0,0,0)
+ XTREG( 80,320,22, 4, 4,0x02e2,0x000b,-2, 2,0x1000,interrupt, 0,0,0,0,0,0)
+ XTREG( 81,324,22, 4, 4,0x02e2,0x000d,-2, 2,0x1000,intset, 0,0,0,0,0,0)
+ XTREG( 82,328,22, 4, 4,0x02e3,0x000d,-2, 2,0x1000,intclear, 0,0,0,0,0,0)
+ XTREG( 83,332,22, 4, 4,0x02e4,0x0007,-2, 2,0x1000,intenable, 0,0,0,0,0,0)
+ XTREG( 84,336,32, 4, 4,0x02e7,0x0007,-2, 2,0x1000,vecbase, 0,0,0,0,0,0)
+ XTREG( 85,340, 6, 4, 4,0x02e8,0x0007,-2, 2,0x1000,exccause, 0,0,0,0,0,0)
+ XTREG( 86,344,12, 4, 4,0x02e9,0x0003,-2, 2,0x1000,debugcause, 0,0,0,0,0,0)
+ XTREG( 87,348,32, 4, 4,0x02ea,0x000f,-2, 2,0x1000,ccount, 0,0,0,0,0,0)
+ XTREG( 88,352,32, 4, 4,0x02eb,0x0003,-2, 2,0x1000,prid, 0,0,0,0,0,0)
+ XTREG( 89,356,32, 4, 4,0x02ec,0x000f,-2, 2,0x1000,icount, 0,0,0,0,0,0)
+ XTREG( 90,360, 4, 4, 4,0x02ed,0x0007,-2, 2,0x1000,icountlevel, 0,0,0,0,0,0)
+ XTREG( 91,364,32, 4, 4,0x02ee,0x0007,-2, 2,0x1000,excvaddr, 0,0,0,0,0,0)
+ XTREG( 92,368,32, 4, 4,0x02f0,0x000f,-2, 2,0x1000,ccompare0, 0,0,0,0,0,0)
+ XTREG( 93,372,32, 4, 4,0x02f1,0x000f,-2, 2,0x1000,ccompare1, 0,0,0,0,0,0)
+ XTREG( 94,376,32, 4, 4,0x02f2,0x000f,-2, 2,0x1000,ccompare2, 0,0,0,0,0,0)
+ XTREG( 95,380,32, 4, 4,0x02f4,0x0007,-2, 2,0x1000,misc0, 0,0,0,0,0,0)
+ XTREG( 96,384,32, 4, 4,0x02f5,0x0007,-2, 2,0x1000,misc1, 0,0,0,0,0,0)
+ XTREG( 97,388,32, 4, 4,0x0000,0x0006,-2, 8,0x0100,a0, 0,0,0,0,0,0)
+ XTREG( 98,392,32, 4, 4,0x0001,0x0006,-2, 8,0x0100,a1, 0,0,0,0,0,0)
+ XTREG( 99,396,32, 4, 4,0x0002,0x0006,-2, 8,0x0100,a2, 0,0,0,0,0,0)
+ XTREG(100,400,32, 4, 4,0x0003,0x0006,-2, 8,0x0100,a3, 0,0,0,0,0,0)
+ XTREG(101,404,32, 4, 4,0x0004,0x0006,-2, 8,0x0100,a4, 0,0,0,0,0,0)
+ XTREG(102,408,32, 4, 4,0x0005,0x0006,-2, 8,0x0100,a5, 0,0,0,0,0,0)
+ XTREG(103,412,32, 4, 4,0x0006,0x0006,-2, 8,0x0100,a6, 0,0,0,0,0,0)
+ XTREG(104,416,32, 4, 4,0x0007,0x0006,-2, 8,0x0100,a7, 0,0,0,0,0,0)
+ XTREG(105,420,32, 4, 4,0x0008,0x0006,-2, 8,0x0100,a8, 0,0,0,0,0,0)
+ XTREG(106,424,32, 4, 4,0x0009,0x0006,-2, 8,0x0100,a9, 0,0,0,0,0,0)
+ XTREG(107,428,32, 4, 4,0x000a,0x0006,-2, 8,0x0100,a10, 0,0,0,0,0,0)
+ XTREG(108,432,32, 4, 4,0x000b,0x0006,-2, 8,0x0100,a11, 0,0,0,0,0,0)
+ XTREG(109,436,32, 4, 4,0x000c,0x0006,-2, 8,0x0100,a12, 0,0,0,0,0,0)
+ XTREG(110,440,32, 4, 4,0x000d,0x0006,-2, 8,0x0100,a13, 0,0,0,0,0,0)
+ XTREG(111,444,32, 4, 4,0x000e,0x0006,-2, 8,0x0100,a14, 0,0,0,0,0,0)
+ XTREG(112,448,32, 4, 4,0x000f,0x0006,-2, 8,0x0100,a15, 0,0,0,0,0,0)
+ XTREG(113,452, 4, 4, 4,0x2008,0x0006,-2, 6,0x1010,psintlevel,
0,0,&xtensa_mask0,0,0,0)
- XTREG(132,528, 1, 4, 4,0x2005,0x0006,-2, 6,0x1010,psum,
+ XTREG(114,456, 1, 4, 4,0x2009,0x0006,-2, 6,0x1010,psum,
0,0,&xtensa_mask1,0,0,0)
- XTREG(133,532, 1, 4, 4,0x2006,0x0006,-2, 6,0x1010,pswoe,
+ XTREG(115,460, 1, 4, 4,0x200a,0x0006,-2, 6,0x1010,pswoe,
0,0,&xtensa_mask2,0,0,0)
- XTREG(134,536, 2, 4, 4,0x2007,0x0006,-2, 6,0x1010,psring,
+ XTREG(116,464, 2, 4, 4,0x200b,0x0006,-2, 6,0x1010,psring,
0,0,&xtensa_mask3,0,0,0)
- XTREG(135,540, 1, 4, 4,0x2008,0x0006,-2, 6,0x1010,psexcm,
+ XTREG(117,468, 1, 4, 4,0x200c,0x0006,-2, 6,0x1010,psexcm,
0,0,&xtensa_mask4,0,0,0)
- XTREG(136,544, 2, 4, 4,0x2009,0x0006,-2, 6,0x1010,pscallinc,
+ XTREG(118,472, 2, 4, 4,0x200d,0x0006,-2, 6,0x1010,pscallinc,
0,0,&xtensa_mask5,0,0,0)
- XTREG(137,548, 4, 4, 4,0x200a,0x0006,-2, 6,0x1010,psowb,
+ XTREG(119,476, 4, 4, 4,0x200e,0x0006,-2, 6,0x1010,psowb,
0,0,&xtensa_mask6,0,0,0)
- XTREG(138,552,20, 4, 4,0x200b,0x0006,-2, 6,0x1010,litbaddr,
+ XTREG(120,480,20, 4, 4,0x200f,0x0006,-2, 6,0x1010,litbaddr,
0,0,&xtensa_mask7,0,0,0)
- XTREG(139,556, 1, 4, 4,0x200c,0x0006,-2, 6,0x1010,litben,
+ XTREG(121,484, 1, 4, 4,0x2010,0x0006,-2, 6,0x1010,litben,
0,0,&xtensa_mask8,0,0,0)
- XTREG(140,560, 4, 4, 4,0x2011,0x0006,-2, 6,0x1010,dbnum,
+ XTREG(122,488, 4, 4, 4,0x2015,0x0006,-2, 6,0x1010,dbnum,
0,0,&xtensa_mask9,0,0,0)
- XTREG(141,564, 8, 4, 4,0x2012,0x0006,-2, 6,0x1010,asid3,
+ XTREG(123,492, 8, 4, 4,0x2016,0x0006,-2, 6,0x1010,asid3,
0,0,&xtensa_mask10,0,0,0)
- XTREG(142,568, 8, 4, 4,0x2013,0x0006,-2, 6,0x1010,asid2,
+ XTREG(124,496, 8, 4, 4,0x2017,0x0006,-2, 6,0x1010,asid2,
0,0,&xtensa_mask11,0,0,0)
- XTREG(143,572, 8, 4, 4,0x2014,0x0006,-2, 6,0x1010,asid1,
+ XTREG(125,500, 8, 4, 4,0x2018,0x0006,-2, 6,0x1010,asid1,
0,0,&xtensa_mask12,0,0,0)
- XTREG(144,576, 2, 4, 4,0x2015,0x0006,-2, 6,0x1010,instpgszid4,
+ XTREG(126,504, 2, 4, 4,0x2019,0x0006,-2, 6,0x1010,instpgszid4,
0,0,&xtensa_mask13,0,0,0)
- XTREG(145,580, 2, 4, 4,0x2016,0x0006,-2, 6,0x1010,datapgszid4,
+ XTREG(127,508, 2, 4, 4,0x201a,0x0006,-2, 6,0x1010,datapgszid4,
0,0,&xtensa_mask14,0,0,0)
- XTREG(146,584,10, 4, 4,0x2017,0x0006,-2, 6,0x1010,ptbase,
+ XTREG(128,512,10, 4, 4,0x201b,0x0006,-2, 6,0x1010,ptbase,
0,0,&xtensa_mask15,0,0,0)
XTREG_END
};
diff --git a/gdb/xtensa-xtregs.c b/gdb/xtensa-xtregs.c
index 9faa50d..3371522 100644
--- a/gdb/xtensa-xtregs.c
+++ b/gdb/xtensa-xtregs.c
@@ -28,10 +28,11 @@ typedef struct {
char* name
;} xtensa_regtable_t;
-#define XTENSA_ELF_XTREG_SIZE 0
+#define XTENSA_ELF_XTREG_SIZE 4
const xtensa_regtable_t xtensa_regmap_table[] = {
/* gnum,gofs,cpofs,ofs,siz,cp, dbnum, name */
+ { 44, 176, 0, 0, 4, -1, 0x020c, "scompare1" },
{ 0 }
};
diff --git a/include/ChangeLog b/include/ChangeLog
index e8d9a02..082147b 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,34 @@
+2008-11-19 Bob Wilson <bob.wilson@acm.org>
+
+ * xtensa-config.h (XCHAL_HAVE_MUL16, XCHAL_HAVE_MUL32, XCHAL_HAVE_DIV32)
+ (XCHAL_HAVE_MINMAX, XCHAL_HAVE_SEXT, XCHAL_HAVE_THREADPTR)
+ (XCHAL_HAVE_RELEASE_SYNC, XCHAL_HAVE_S32C1I): Change to 1.
+ (XCHAL_NUM_AREGS): Change to 32.
+ (XCHAL_ICACHE_SIZE, XCHAL_DCACHE_SIZE): Change to 16K.
+ (XCHAL_ICACHE_LINESIZE, XCHAL_DCACHE_LINESIZE): Change to 32.
+ (XCHAL_ICACHE_LINEWIDTH, XCHAL_DCACHE_LINEWIDTH): Change to 5.
+ (XCHAL_DCACHE_IS_WRITEBACK): Change to 1.
+ (XCHAL_DEBUGLEVEL): Change to 6.
+
+2008-11-14 Tristan Gingold <gingold@adacore.com>
+
+ * fopen-vms.h (FOPEN_RB): Use a single string to match the
+ standard prototype.
+ (FOPEN_WB): Ditto.
+ (FOPEN_AB): Ditto.
+ (FOPEN_RUB): Ditto.
+ (FOPEN_WUB): Ditto.
+ (FOPEN_AUB): Ditto.
+
+2008-10-21 Alan Modra <amodra@bigpond.net.au>
+
+ * obstack.h (obstack_finish <!__GNUC__>): Cast result to void *.
+
+2008-10-06 Jason Merrill <jason@redhat.com>
+
+ * demangle.h (enum demangle_component_type): Add
+ DEMANGLE_COMPONENT_PACK_EXPANSION.
+
2008-09-24 Richard Henderson <rth@redhat.com>
* elf/dwarf2.h (DW_OP_GNU_encoded_addr): New.
diff --git a/include/demangle.h b/include/demangle.h
index 146d778..0ea639d 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -372,7 +372,9 @@ enum demangle_component_type
/* A name formed by a single character. */
DEMANGLE_COMPONENT_CHARACTER,
/* A decltype type. */
- DEMANGLE_COMPONENT_DECLTYPE
+ DEMANGLE_COMPONENT_DECLTYPE,
+ /* A pack expansion. */
+ DEMANGLE_COMPONENT_PACK_EXPANSION
};
/* Types which are only used internally. */
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index ae259dc..c9aa86d 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,26 @@
+2008-11-18 Catherine Moore <clm@codesourcery.com>
+
+ * arm.h (Tag_ABI_FP_16bit_format): Define.
+
+2008-11-14 Nathan Sidwell <nathan@codesourcery.com>
+
+ * internal.h (struct elf_segment_map): Add header_size field.
+
+2008-10-13 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * common.h (AT_BASE_PLATFORM, AT_EXECFN): Define.
+
+2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
+
+ * ppc.h: Add Tag_GNU_Power_ABI_Struct_Return.
+
+2008-10-04 Hans-Peter Nilsson <hp@axis.com>
+
+ * cris.h (R_CRIS_32_GOT_GD, R_CRIS_16_GOT_GD, R_CRIS_32_GD)
+ (R_CRIS_DTP, R_CRIS_32_DTPREL, R_CRIS_16_DTPREL, R_CRIS_DTPMOD)
+ (R_CRIS_32_GOT_TPREL, R_CRIS_16_GOT_TPREL, R_CRIS_32_TPREL)
+ (R_CRIS_16_TPREL): New relocations.
+
2008-08-20 Bob Wilson <bob.wilson@acm.org>
* xtensa.h (R_XTENSA_TLSDESC_FN, R_XTENSA_TLSDESC_ARG)
diff --git a/include/elf/arm.h b/include/elf/arm.h
index af623f1..ade479c 100644
--- a/include/elf/arm.h
+++ b/include/elf/arm.h
@@ -272,6 +272,12 @@ enum
Tag_ABI_optimization_goals,
Tag_ABI_FP_optimization_goals,
/* 32 is generic. */
+ Tag_undefined33 = 33,
+ Tag_CPU_unaligned_access,
+ Tag_undefined35,
+ Tag_VFP_HP_extension,
+ Tag_undefined37,
+ Tag_ABI_FP_16bit_format = 38,
};
#endif
diff --git a/include/elf/common.h b/include/elf/common.h
index 995edbc..5a0c322 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -798,6 +798,9 @@
#define AT_UCACHEBSIZE 21 /* Unified cache block size. */
#define AT_IGNOREPPC 22 /* Entry should be ignored */
#define AT_SECURE 23 /* Boolean, was exec setuid-like? */
+#define AT_BASE_PLATFORM 24 /* String identifying real platform,
+ may differ from AT_PLATFORM. */
+#define AT_EXECFN 31 /* Filename of executable. */
/* Pointer to the global system page used for system calls and other
nice things. */
#define AT_SYSINFO 32
diff --git a/include/elf/cris.h b/include/elf/cris.h
index 8225baa..550955d 100644
--- a/include/elf/cris.h
+++ b/include/elf/cris.h
@@ -91,6 +91,82 @@ START_RELOC_NUMBERS (elf_cris_reloc_type)
The BFD equivalent is BFD_RELOC_CRIS_32_PLT_PCREL. */
RELOC_NUMBER (R_CRIS_32_PLT_PCREL, 19)
+ /* An assembler-generated-only relocation, instructing the linker to
+ reserve two GOT slots, carrying the R_CRIS_DTP relocation for the
+ symbol (pointing to the first slot, the relocation fills in
+ both). The value is a 32-bit-value, relative to the start of the
+ GOT. Assembly syntax: "sym:GDGOTREL". */
+ RELOC_NUMBER (R_CRIS_32_GOT_GD, 20)
+
+ /* Similar to R_CRIS_32_GOT_GD, but the value is a 16-bit unsigned
+ number, limiting access to 65536/4 global symbols per module (or
+ 65536/8 thread variables; loosely speaking G*4+T*8 < 65536, where
+ T is the number of thread variables and G is the number of other
+ external global variables and functions). Assembly syntax:
+ "sym:GDGOTREL16". */
+ RELOC_NUMBER (R_CRIS_16_GOT_GD, 21)
+
+ /* Similar to R_CRIS_32_GOT_GD, but the value is the absolute
+ address of the GOT entry. Disallowed in DSOs created with
+ -shared. Assembly syntax: "sym:GD". */
+ RELOC_NUMBER (R_CRIS_32_GD, 22)
+
+ /* A linker-generated-only relocation, instructing the dynamic
+ linker to fill in the module ID and module-relative-TLS-block
+ offset of the symbol in question, used for GOT entries. Note
+ that this relocation instructs to fill in two 32-bit values. */
+ RELOC_NUMBER (R_CRIS_DTP, 23)
+
+ /* An assembler-generated-only relocation, instructing the linker to
+ reserve the first two GOT slots, and attach the R_CRIS_DTPMOD
+ relocation(*) for the module to the first slot, the second
+ containing zero. The value is 32 bits, the offset from the start
+ of the TLS block of the module to the thread-local symbol
+ mentioned in the relocation. This relocation must only be applied
+ to module-local symbols. Assembly syntax: "expr:DTPREL". */
+ RELOC_NUMBER (R_CRIS_32_DTPREL, 24)
+
+ /* Similar to R_CRIS_32_DTPREL, but the value is a 16-bit signed
+ number, limiting the size of thread-variables of the DSO to 32768
+ bytes. (Note: matches both model 1 and 2 and allows use of addo.w
+ as the instruction where this relocation is used.) Assembly
+ syntax: "expr:DTPREL16". */
+ RELOC_NUMBER (R_CRIS_16_DTPREL, 25)
+
+ /* An assembler-generated-only relocation, instructing the linker to
+ reserve a GOT slot and attach the R_CRIS_32_TPREL relocation for
+ the symbol in question. The value is 32 bits, which is the
+ GOT-relative offset of the slot. Assembly syntax:
+ "sym:TPOFFGOT". */
+ RELOC_NUMBER (R_CRIS_32_GOT_TPREL, 26)
+
+ /* Similar to R_CRIS_32_TPREL, but the value is a 16-bit positive
+ number, limiting the number of thread- and global variables of
+ the DSO to 32768/4. Assembly syntax: "sym:TPOFFGOT16". */
+ RELOC_NUMBER (R_CRIS_16_GOT_TPREL, 27)
+
+ /* An assembler- and linker-generated relocation, instructing to
+ resolve the symbol in question yielding the TLS offset of the
+ thread variable; relative to the module's TLS data if in a DSO,
+ but relative to the executable's thread data if in an
+ executable. Not allowed as input when generating a DSO. Assembly
+ syntax: "expr:TPOFF". */
+ RELOC_NUMBER (R_CRIS_32_TPREL, 28)
+
+ /* Similar to R_CRIS_32_TPREL, but only applicable to executables
+ compiled with -msmall-tls. Not allowed in a DSO. The value is a
+ 16-bit signed number, limiting the size of thread-variables of
+ the executable to 32768 bytes. (Note: being signed makes it match
+ both model 1 and 2 and allows use of addo.w as the instruction
+ where this relocation is applied.) Assembly syntax:
+ "expr:TPOFF16". */
+ RELOC_NUMBER (R_CRIS_16_TPREL, 29)
+
+ /* A linker-generated-only relocation, instructing the dynamic
+ linker to fill in the current module ID, used for GOT entries
+ (always the fourth one). */
+ RELOC_NUMBER (R_CRIS_DTPMOD, 30)
+
/* No other relocs must be visible outside the assembler. */
END_RELOC_NUMBERS (R_CRIS_max)
diff --git a/include/elf/internal.h b/include/elf/internal.h
index 513f676..9ea175c 100644
--- a/include/elf/internal.h
+++ b/include/elf/internal.h
@@ -266,6 +266,8 @@ struct elf_segment_map
bfd_vma p_align;
/* Segment size in file and memory */
bfd_vma p_size;
+ /* Required size of filehdr + phdrs, if non-zero */
+ bfd_vma header_size;
/* Whether the p_flags field is valid; if not, the flags are based
on the section flags. */
unsigned int p_flags_valid : 1;
diff --git a/include/elf/ppc.h b/include/elf/ppc.h
index 95cccce..a0c16f1 100644
--- a/include/elf/ppc.h
+++ b/include/elf/ppc.h
@@ -186,6 +186,11 @@ enum
registers, 3 for SPE registers; 0 for not tagged or not using any
ABIs affected by the differences. */
Tag_GNU_Power_ABI_Vector = 8,
+
+ /* Value 1 for ABIs using r3/r4 for returning structures <= 8 bytes,
+ 2 for ABIs using memory; 0 for not tagged or not using any ABIs
+ affected by the differences. */
+ Tag_GNU_Power_ABI_Struct_Return = 12
};
#endif /* _ELF_PPC_H */
diff --git a/include/fopen-vms.h b/include/fopen-vms.h
index da76b7f..dde22ba 100644
--- a/include/fopen-vms.h
+++ b/include/fopen-vms.h
@@ -9,12 +9,12 @@
the application unable to be configured for both "same" and "binary"
variant systems. */
-#define FOPEN_RB "rb","rfm=var"
-#define FOPEN_WB "wb","rfm=var"
-#define FOPEN_AB "ab","rfm=var"
-#define FOPEN_RUB "r+b","rfm=var"
-#define FOPEN_WUB "w+b","rfm=var"
-#define FOPEN_AUB "a+b","rfm=var"
+#define FOPEN_RB "rb,rfm=var"
+#define FOPEN_WB "wb,rfm=var"
+#define FOPEN_AB "ab,rfm=var"
+#define FOPEN_RUB "r+b,rfm=var"
+#define FOPEN_WUB "w+b,rfm=var"
+#define FOPEN_AUB "a+b,rfm=var"
#define FOPEN_RT "r"
#define FOPEN_WT "w"
diff --git a/include/obstack.h b/include/obstack.h
index 88c2a26..4aec3a4 100644
--- a/include/obstack.h
+++ b/include/obstack.h
@@ -1,6 +1,6 @@
/* obstack.h - object stack macros
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
Free Software Foundation, Inc.
@@ -527,7 +527,7 @@ __extension__ \
> (h)->chunk_limit - (char *) (h)->chunk) \
? ((h)->next_free = (h)->chunk_limit) : 0), \
(h)->object_base = (h)->next_free, \
- __INT_TO_PTR ((h)->temp))
+ (void *) __INT_TO_PTR ((h)->temp))
# define obstack_free(h,obj) \
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index 9a97ab6..b64a8b6 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,12 @@
+2008-11-18 Catherine Moore <clm@codesourcery.com>
+
+ * arm.h (FPU_NEON_FP16): New.
+ (FPU_ARCH_NEON_FP16): New.
+
+2008-11-06 Chao-ying Fu <fu@mips.com>
+
+ * mips.h: Doucument '1' for 5-bit sync type.
+
2008-08-28 H.J. Lu <hongjiu.lu@intel.com>
* ia64.h (ia64_resource_specifier): Add IA64_RS_CR_IIB. Update
diff --git a/include/opcode/arm.h b/include/opcode/arm.h
index 11cab3e..a639a8b 100644
--- a/include/opcode/arm.h
+++ b/include/opcode/arm.h
@@ -65,6 +65,7 @@
#define FPU_VFP_EXT_V3 0x01000000 /* VFPv3 insns. */
#define FPU_NEON_EXT_V1 0x00800000 /* Neon (SIMD) insns. */
#define FPU_VFP_EXT_D32 0x00400000 /* Registers D16-D31. */
+#define FPU_NEON_FP16 0x00200000 /* Half-precision extensions. */
/* Architectures are the sum of the base and extensions. The ARM ARM (rev E)
defines the following: ARMv3, ARMv3M, ARMv4xM, ARMv4, ARMv4TxM, ARMv4T,
@@ -139,6 +140,8 @@
#define FPU_ARCH_NEON_V1 ARM_FEATURE (0, FPU_NEON_EXT_V1)
#define FPU_ARCH_VFP_V3_PLUS_NEON_V1 \
ARM_FEATURE (0, FPU_VFP_V3 | FPU_NEON_EXT_V1)
+#define FPU_ARCH_NEON_FP16 \
+ ARM_FEATURE (0, FPU_VFP_V3 | FPU_NEON_EXT_V1 | FPU_NEON_FP16)
#define FPU_ARCH_VFP_HARD ARM_FEATURE (0, FPU_VFP_HARD)
#define FPU_ARCH_ENDIAN_PURE ARM_FEATURE (0, FPU_ENDIAN_PURE)
diff --git a/include/opcode/mips.h b/include/opcode/mips.h
index 8d201f6..9af9ea1 100644
--- a/include/opcode/mips.h
+++ b/include/opcode/mips.h
@@ -262,6 +262,7 @@ struct mips_opcode
Each of these characters corresponds to a mask field defined above.
+ "1" 5 bit sync type (OP_*_SHAMT)
"<" 5 bit shift amount (OP_*_SHAMT)
">" shift amount between 32 and 63, stored after subtracting 32 (OP_*_SHAMT)
"a" 26 bit target address (OP_*_TARGET)
@@ -401,7 +402,7 @@ struct mips_opcode
"+" Start of extension sequence.
Characters used so far, for quick reference when adding more:
- "234567890"
+ "1234567890"
"%[]<>(),+:'@!$*&"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklopqrstuvwxz"
diff --git a/include/xtensa-config.h b/include/xtensa-config.h
index 768ff90..bc99815 100644
--- a/include/xtensa-config.h
+++ b/include/xtensa-config.h
@@ -1,5 +1,5 @@
/* Xtensa configuration settings.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
@@ -50,37 +50,37 @@
#define XCHAL_HAVE_MAC16 0
#undef XCHAL_HAVE_MUL16
-#define XCHAL_HAVE_MUL16 0
+#define XCHAL_HAVE_MUL16 1
#undef XCHAL_HAVE_MUL32
-#define XCHAL_HAVE_MUL32 0
+#define XCHAL_HAVE_MUL32 1
#undef XCHAL_HAVE_MUL32_HIGH
#define XCHAL_HAVE_MUL32_HIGH 0
#undef XCHAL_HAVE_DIV32
-#define XCHAL_HAVE_DIV32 0
+#define XCHAL_HAVE_DIV32 1
#undef XCHAL_HAVE_NSA
#define XCHAL_HAVE_NSA 1
#undef XCHAL_HAVE_MINMAX
-#define XCHAL_HAVE_MINMAX 0
+#define XCHAL_HAVE_MINMAX 1
#undef XCHAL_HAVE_SEXT
-#define XCHAL_HAVE_SEXT 0
+#define XCHAL_HAVE_SEXT 1
#undef XCHAL_HAVE_LOOPS
#define XCHAL_HAVE_LOOPS 1
#undef XCHAL_HAVE_THREADPTR
-#define XCHAL_HAVE_THREADPTR 0
+#define XCHAL_HAVE_THREADPTR 1
#undef XCHAL_HAVE_RELEASE_SYNC
-#define XCHAL_HAVE_RELEASE_SYNC 0
+#define XCHAL_HAVE_RELEASE_SYNC 1
#undef XCHAL_HAVE_S32C1I
-#define XCHAL_HAVE_S32C1I 0
+#define XCHAL_HAVE_S32C1I 1
#undef XCHAL_HAVE_BOOLEANS
#define XCHAL_HAVE_BOOLEANS 0
@@ -104,7 +104,7 @@
#define XCHAL_HAVE_WINDOWED 1
#undef XCHAL_NUM_AREGS
-#define XCHAL_NUM_AREGS 64
+#define XCHAL_NUM_AREGS 32
#undef XCHAL_HAVE_WIDE_BRANCHES
#define XCHAL_HAVE_WIDE_BRANCHES 0
@@ -114,25 +114,25 @@
#undef XCHAL_ICACHE_SIZE
-#define XCHAL_ICACHE_SIZE 8192
+#define XCHAL_ICACHE_SIZE 16384
#undef XCHAL_DCACHE_SIZE
-#define XCHAL_DCACHE_SIZE 8192
+#define XCHAL_DCACHE_SIZE 16384
#undef XCHAL_ICACHE_LINESIZE
-#define XCHAL_ICACHE_LINESIZE 16
+#define XCHAL_ICACHE_LINESIZE 32
#undef XCHAL_DCACHE_LINESIZE
-#define XCHAL_DCACHE_LINESIZE 16
+#define XCHAL_DCACHE_LINESIZE 32
#undef XCHAL_ICACHE_LINEWIDTH
-#define XCHAL_ICACHE_LINEWIDTH 4
+#define XCHAL_ICACHE_LINEWIDTH 5
#undef XCHAL_DCACHE_LINEWIDTH
-#define XCHAL_DCACHE_LINEWIDTH 4
+#define XCHAL_DCACHE_LINEWIDTH 5
#undef XCHAL_DCACHE_IS_WRITEBACK
-#define XCHAL_DCACHE_IS_WRITEBACK 0
+#define XCHAL_DCACHE_IS_WRITEBACK 1
#undef XCHAL_HAVE_MMU
@@ -152,7 +152,7 @@
#define XCHAL_NUM_DBREAK 2
#undef XCHAL_DEBUGLEVEL
-#define XCHAL_DEBUGLEVEL 4
+#define XCHAL_DEBUGLEVEL 6
#undef XCHAL_MAX_INSTRUCTION_SIZE
diff --git a/libdecnumber/ChangeLog b/libdecnumber/ChangeLog
index a89179b..eec0866 100644
--- a/libdecnumber/ChangeLog
+++ b/libdecnumber/ChangeLog
@@ -1,3 +1,15 @@
+2008-10-27 Janis Johnson <janis187@us.ibm.com>
+
+ PR other/37897
+ * decDouble.h (decDouble): Replace struct with union accessible
+ by more types.
+ * decSingle.h (decSingle): Ditto.
+ * decQuad.h (decQuad): Ditto.
+ * decNumberLocal.h (DFWORD, DFBYTE, DFWWORD): access decFloat via
+ new members.
+ * decBasic.c (decFloatCompareTotal): Avoid type-pun violation.
+ (decNumberCompare): Ditto.
+
2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
diff --git a/libdecnumber/decBasic.c b/libdecnumber/decBasic.c
index 9ce277d..fddba97 100644
--- a/libdecnumber/decBasic.c
+++ b/libdecnumber/decBasic.c
@@ -1660,8 +1660,10 @@ decFloat * decFloatCompareTotal(decFloat *result,
/* decode the coefficients */
/* (shift both right two if Quad to make a multiple of four) */
#if QUAD
- USHORTAT(bufl)=0;
- USHORTAT(bufr)=0;
+ ub = bufl; /* avoid type-pun violation */
+ USHORTAT(ub)=0;
+ uc = bufr; /* avoid type-pun violation */
+ USHORTAT(uc)=0;
#endif
GETCOEFF(dfl, bufl+QUAD*2); /* decode from decFloat */
GETCOEFF(dfr, bufr+QUAD*2); /* .. */
@@ -3542,8 +3544,10 @@ static Int decNumCompare(const decFloat *dfl, const decFloat *dfr, Flag tot) {
/* decode the coefficients */
/* (shift both right two if Quad to make a multiple of four) */
#if QUAD
- UINTAT(bufl)=0;
- UINTAT(bufr)=0;
+ ub=bufl; /* avoid type-pun violation */
+ UINTAT(ub)=0;
+ uc=bufr; /* avoid type-pun violation */
+ UINTAT(uc)=0;
#endif
GETCOEFF(dfl, bufl+QUAD*2); /* decode from decFloat */
GETCOEFF(dfr, bufr+QUAD*2); /* .. */
diff --git a/libdecnumber/decDouble.h b/libdecnumber/decDouble.h
index 32eba39..53fcf40 100644
--- a/libdecnumber/decDouble.h
+++ b/libdecnumber/decDouble.h
@@ -58,9 +58,11 @@
#include "decContext.h"
#include "decQuad.h"
- /* The decDouble decimal 64-bit type, accessible by bytes */
- typedef struct {
+ /* The decDouble decimal 64-bit type, accessible by various types */
+ typedef union {
uint8_t bytes[DECDOUBLE_Bytes]; /* fields: 1, 5, 8, 50 bits */
+ uint16_t shorts[DECDOUBLE_Bytes/2];
+ uint32_t words[DECDOUBLE_Bytes/4];
} decDouble;
/* ---------------------------------------------------------------- */
diff --git a/libdecnumber/decNumberLocal.h b/libdecnumber/decNumberLocal.h
index 809eaa4..f1568f7 100644
--- a/libdecnumber/decNumberLocal.h
+++ b/libdecnumber/decNumberLocal.h
@@ -308,13 +308,13 @@
#define DECWORDS (DECBYTES/4)
#define DECWWORDS (DECWBYTES/4)
#if DECLITEND
- #define DFWORD(df, off) UINTAT((df)->bytes+(DECWORDS-1-(off))*4)
- #define DFBYTE(df, off) UBYTEAT((df)->bytes+(DECBYTES-1-(off)))
- #define DFWWORD(dfw, off) UINTAT((dfw)->bytes+(DECWWORDS-1-(off))*4)
+ #define DFWORD(df, off) ((df)->words[DECWORDS-1-(off)])
+ #define DFBYTE(df, off) ((df)->bytes[DECBYTES-1-(off)])
+ #define DFWWORD(dfw, off) ((dfw)->words[DECWWORDS-1-(off)])
#else
- #define DFWORD(df, off) UINTAT((df)->bytes+(off)*4)
- #define DFBYTE(df, off) UBYTEAT((df)->bytes+(off))
- #define DFWWORD(dfw, off) UINTAT((dfw)->bytes+(off)*4)
+ #define DFWORD(df, off) ((df)->words[off])
+ #define DFBYTE(df, off) ((df)->bytes[off])
+ #define DFWWORD(dfw, off) ((dfw)->words[off])
#endif
/* Tests for sign or specials, directly on DECFLOATs */
diff --git a/libdecnumber/decQuad.h b/libdecnumber/decQuad.h
index 39f75d3..af9bc24 100644
--- a/libdecnumber/decQuad.h
+++ b/libdecnumber/decQuad.h
@@ -59,9 +59,11 @@
/* Required include */
#include "decContext.h"
- /* The decQuad decimal 128-bit type, accessible by bytes */
- typedef struct {
+ /* The decQuad decimal 128-bit type, accessible by various types */
+ typedef union {
uint8_t bytes[DECQUAD_Bytes]; /* fields: 1, 5, 12, 110 bits */
+ uint16_t shorts[DECQUAD_Bytes/2];
+ uint32_t words[DECQUAD_Bytes/4];
} decQuad;
/* ---------------------------------------------------------------- */
diff --git a/libdecnumber/decSingle.h b/libdecnumber/decSingle.h
index 8dd1bd3..bae3984 100644
--- a/libdecnumber/decSingle.h
+++ b/libdecnumber/decSingle.h
@@ -59,9 +59,11 @@
#include "decQuad.h"
#include "decDouble.h"
- /* The decSingle decimal 32-bit type, accessible by bytes */
- typedef struct {
+ /* The decSingle decimal 32-bit type, accessible by various types */
+ typedef union {
uint8_t bytes[DECSINGLE_Bytes]; /* fields: 1, 5, 6, 20 bits */
+ uint16_t shorts[DECSINGLE_Bytes/2];
+ uint32_t words[DECSINGLE_Bytes/4];
} decSingle;
/* ---------------------------------------------------------------- */
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index d3f9d60..fd9d300 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,8 +1,43 @@
-2008-09-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+2008-10-22 Daniel Jacobowitz <dan@codesourcery.com>
- * configure.in: Call AC_SYS_LARGEFILE.
- * config.in: Regenerate.
- * configure: Regenerate.
+ * Makefile.in (CPPFLAGS): Define.
+ (FLAGS_TO_PASS, COMPILE.c): Add CPPFLAGS.
+
+2008-10-15 Paolo Bonzini <bonzini@gnu.org>
+
+ PR bootstrap/37137
+ * Makefile.in (LIBCFLAGS): Remove.
+ (FLAGS_TO_PASS): Don't mention it.
+ (COMPILE.c, MULTIOSDIR): Replace it with CFLAGS.
+
+2008-10-08 David Edelsohn <edelsohn@gnu.org>
+
+ * xstrdup.c: Include <sys/types.h> after "config.h"
+
+2008-10-07 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * configure.ac: Call AC_SYS_LARGEFILE.
+ * config.in: Regenerated.
+ * configure: Likewise.
+
+2008-10-06 Jason Merrill <jason@redhat.com>
+
+ * cp-demangle.c (struct d_print_info): Add pack_index.
+ (d_dump): Add DEMANGLE_COMPONENT_PACK_EXPANSION.
+ (d_make_comp): Likewise. DEMANGLE_COMPONENT_ARGLIST and
+ DEMANGLE_COMPONENT_TEMPLATE_ARGLIST can have two null args.
+ (cplus_demangle_builtin_types): Add char16/32_t.
+ (cplus_demangle_type): Recognize them.
+ (d_template_args): Handle empty argument packs.
+ (d_template_arg): Handle argument packs.
+ (d_expression): Handle dependent name.
+ (d_index_template_argument): New fn.
+ (d_lookup_template_argument): New fn.
+ (d_find_pack, d_pack_length): New fn.
+ (d_print_subexpr): Split out...
+ (d_print_comp): ...from here. Use d_*_template_argument.
+ Handle empty arg lists. Support pack expansions.
+ * cp-demangle.h (D_BUILTIN_TYPE_COUNT): Increase to 32.
2008-09-09 Jason Merrill <jason@redhat.com>
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index e18aff7..41a71f5 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -55,7 +55,7 @@ AR_FLAGS = rc
CC = @CC@
CFLAGS = @CFLAGS@
-LIBCFLAGS = $(CFLAGS)
+CPPFLAGS = @CPPFLAGS@
RANLIB = @RANLIB@
MAKEINFO = @MAKEINFO@
PERL = @PERL@
@@ -79,8 +79,8 @@ FLAGS_TO_PASS = \
"AR_FLAGS=$(AR_FLAGS)" \
"CC=$(CC)" \
"CFLAGS=$(CFLAGS)" \
+ "CPPFLAGS=$(CPPFLAGS)" \
"DESTDIR=$(DESTDIR)" \
- "LIBCFLAGS=$(LIBCFLAGS)" \
"EXTRA_OFILES=$(EXTRA_OFILES)" \
"HDEFINES=$(HDEFINES)" \
"INSTALL=$(INSTALL)" \
@@ -111,7 +111,7 @@ installcheck: installcheck-subdir
INCDIR=$(srcdir)/$(MULTISRCTOP)../include
-COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES) @ac_libiberty_warn_cflags@
+COMPILE.c = $(CC) -c @DEFS@ $(CFLAGS) $(CPPFLAGS) -I. -I$(INCDIR) $(HDEFINES) @ac_libiberty_warn_cflags@
# Just to make sure we don't use a built-in rule with VPATH
.c.o:
@@ -350,9 +350,9 @@ install: install_to_$(INSTALL_DEST) install-subdir
# This is tricky. Even though CC in the Makefile contains
# multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
-# default multilib, so we have to take LIBCFLAGS into account as well,
+# default multilib, so we have to take CFLAGS into account as well,
# since it will be passed the multilib flags.
-MULTIOSDIR = `$(CC) $(LIBCFLAGS) -print-multi-os-directory`
+MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
install_to_libdir: all
${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
$(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
diff --git a/libiberty/configure b/libiberty/configure
index 62f274f..71b6ccd 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -3346,7 +3346,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_c_preproc_warn_flag=yes
-
ac_libiberty_warn_cflags=
save_CFLAGS="$CFLAGS"
for option in -W -Wall -Wwrite-strings -Wc++-compat \
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 3d292f0..3fa5f1f 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -299,6 +299,9 @@ struct d_print_info
struct d_print_mod *modifiers;
/* Set to 1 if we saw a demangling error. */
int demangle_failure;
+ /* The current index into any template argument packs we are using
+ for printing. */
+ int pack_index;
};
#ifdef CP_DEMANGLE_DEBUG
@@ -663,6 +666,9 @@ d_dump (struct demangle_component *dc, int indent)
case DEMANGLE_COMPONENT_DECLTYPE:
printf ("decltype\n");
break;
+ case DEMANGLE_COMPONENT_PACK_EXPANSION:
+ printf ("pack expansion\n");
+ break;
}
d_dump (d_left (dc), indent + 2);
@@ -806,11 +812,10 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
case DEMANGLE_COMPONENT_COMPLEX:
case DEMANGLE_COMPONENT_IMAGINARY:
case DEMANGLE_COMPONENT_VENDOR_TYPE:
- case DEMANGLE_COMPONENT_ARGLIST:
- case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST:
case DEMANGLE_COMPONENT_CAST:
case DEMANGLE_COMPONENT_JAVA_RESOURCE:
case DEMANGLE_COMPONENT_DECLTYPE:
+ case DEMANGLE_COMPONENT_PACK_EXPANSION:
if (left == NULL)
return NULL;
break;
@@ -831,6 +836,8 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
case DEMANGLE_COMPONENT_RESTRICT_THIS:
case DEMANGLE_COMPONENT_VOLATILE_THIS:
case DEMANGLE_COMPONENT_CONST_THIS:
+ case DEMANGLE_COMPONENT_ARGLIST:
+ case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST:
break;
/* Other types should not be seen here. */
@@ -1433,6 +1440,7 @@ const struct demangle_operator_info cplus_demangle_operators[] =
{ "da", NL ("delete[]"), 1 },
{ "de", NL ("*"), 1 },
{ "dl", NL ("delete"), 1 },
+ { "dt", NL ("."), 2 },
{ "dv", NL ("/"), 2 },
{ "eO", NL ("^="), 2 },
{ "eo", NL ("^"), 2 },
@@ -1875,21 +1883,24 @@ cplus_demangle_builtin_types[D_BUILTIN_TYPE_COUNT] =
/* n */ { NL ("__int128"), NL ("__int128"), D_PRINT_DEFAULT },
/* o */ { NL ("unsigned __int128"), NL ("unsigned __int128"),
D_PRINT_DEFAULT },
- /* The decimal floating point and half-precision floating point types
- don't use the normal builtin type encoding, they're just stuck into
- holes in the table for convenience. */
- /* p */ { NL ("decimal32"), NL ("decimal32"), D_PRINT_DEFAULT },
- /* q */ { NL ("decimal64"), NL ("decimal64"), D_PRINT_DEFAULT },
- /* r */ { NL ("decimal128"), NL ("decimal128"), D_PRINT_DEFAULT },
+ /* p */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
+ /* q */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
+ /* r */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
/* s */ { NL ("short"), NL ("short"), D_PRINT_DEFAULT },
/* t */ { NL ("unsigned short"), NL ("unsigned short"), D_PRINT_DEFAULT },
- /* u */ { NL ("half"), NL ("half"), D_PRINT_FLOAT },
+ /* u */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
/* v */ { NL ("void"), NL ("void"), D_PRINT_VOID },
/* w */ { NL ("wchar_t"), NL ("char"), D_PRINT_DEFAULT },
/* x */ { NL ("long long"), NL ("long"), D_PRINT_LONG_LONG },
/* y */ { NL ("unsigned long long"), NL ("unsigned long long"),
D_PRINT_UNSIGNED_LONG_LONG },
/* z */ { NL ("..."), NL ("..."), D_PRINT_DEFAULT },
+ /* 26 */ { NL ("decimal32"), NL ("decimal32"), D_PRINT_DEFAULT },
+ /* 27 */ { NL ("decimal64"), NL ("decimal64"), D_PRINT_DEFAULT },
+ /* 28 */ { NL ("decimal128"), NL ("decimal128"), D_PRINT_DEFAULT },
+ /* 29 */ { NL ("half"), NL ("half"), D_PRINT_FLOAT },
+ /* 30 */ { NL ("char16_t"), NL ("char16_t"), D_PRINT_DEFAULT },
+ /* 31 */ { NL ("char32_t"), NL ("char32_t"), D_PRINT_DEFAULT },
};
CP_STATIC_IF_GLIBCPP_V3
@@ -2070,30 +2081,38 @@ cplus_demangle_type (struct d_info *di)
case 'p':
/* Pack expansion. */
- return NULL;
+ ret = d_make_comp (di, DEMANGLE_COMPONENT_PACK_EXPANSION,
+ cplus_demangle_type (di), NULL);
+ break;
case 'f':
- /* 32-bit DFP */
- ret = d_make_builtin_type (di,
- &cplus_demangle_builtin_types['p' - 'a']);
+ /* 32-bit decimal floating point */
+ ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[26]);
di->expansion += ret->u.s_builtin.type->len;
break;
case 'd':
- /* 64-bit decimal floating point */
- ret = d_make_builtin_type (di,
- &cplus_demangle_builtin_types['q' - 'a']);
+ /* 64-bit DFP */
+ ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[27]);
di->expansion += ret->u.s_builtin.type->len;
break;
case 'e':
/* 128-bit DFP */
- ret = d_make_builtin_type (di,
- &cplus_demangle_builtin_types['r' - 'a']);
+ ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[28]);
di->expansion += ret->u.s_builtin.type->len;
break;
case 'h':
/* 16-bit half-precision FP */
- ret = d_make_builtin_type (di,
- &cplus_demangle_builtin_types['u' - 'a']);
+ ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[29]);
+ di->expansion += ret->u.s_builtin.type->len;
+ break;
+ case 's':
+ /* char16_t */
+ ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[30]);
+ di->expansion += ret->u.s_builtin.type->len;
+ break;
+ case 'i':
+ /* char32_t */
+ ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[31]);
di->expansion += ret->u.s_builtin.type->len;
break;
}
@@ -2390,6 +2409,13 @@ d_template_args (struct d_info *di)
if (! d_check_char (di, 'I'))
return NULL;
+ if (d_peek_char (di) == 'E')
+ {
+ /* An argument pack can be empty. */
+ d_advance (di, 1);
+ return d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE_ARGLIST, NULL, NULL);
+ }
+
al = NULL;
pal = &al;
while (1)
@@ -2439,6 +2465,10 @@ d_template_arg (struct d_info *di)
case 'L':
return d_expr_primary (di);
+ case 'I':
+ /* An argument pack. */
+ return d_template_args (di);
+
default:
return cplus_demangle_type (di);
}
@@ -2452,6 +2482,12 @@ d_exprlist (struct d_info *di)
struct demangle_component *list = NULL;
struct demangle_component **p = &list;
+ if (d_peek_char (di) == 'E')
+ {
+ d_advance (di, 1);
+ return d_make_comp (di, DEMANGLE_COMPONENT_ARGLIST, NULL, NULL);
+ }
+
while (1)
{
struct demangle_component *arg = d_expression (di);
@@ -2515,6 +2551,19 @@ d_expression (struct d_info *di)
d_advance (di, 2);
return cplus_demangle_type (di);
}
+ else if (IS_DIGIT (peek))
+ {
+ /* We can get an unqualified name as an expression in the case of
+ a dependent member access, i.e. decltype(T().i). */
+ struct demangle_component *name = d_unqualified_name (di);
+ if (name == NULL)
+ return NULL;
+ if (d_peek_char (di) == 'I')
+ return d_make_comp (di, DEMANGLE_COMPONENT_TEMPLATE, name,
+ d_template_args (di));
+ else
+ return name;
+ }
else
{
struct demangle_component *op;
@@ -3067,6 +3116,123 @@ cplus_demangle_print (int options, const struct demangle_component *dc,
return dgs.buf;
}
+/* Returns the I'th element of the template arglist ARGS, or NULL on
+ failure. */
+
+static struct demangle_component *
+d_index_template_argument (struct demangle_component *args, int i)
+{
+ struct demangle_component *a;
+
+ for (a = args;
+ a != NULL;
+ a = d_right (a))
+ {
+ if (a->type != DEMANGLE_COMPONENT_TEMPLATE_ARGLIST)
+ return NULL;
+ if (i <= 0)
+ break;
+ --i;
+ }
+ if (i != 0 || a == NULL)
+ return NULL;
+
+ return d_left (a);
+}
+
+/* Returns the template argument from the current context indicated by DC,
+ which is a DEMANGLE_COMPONENT_TEMPLATE_PARAM, or NULL. */
+
+static struct demangle_component *
+d_lookup_template_argument (struct d_print_info *dpi,
+ const struct demangle_component *dc)
+{
+ if (dpi->templates == NULL)
+ {
+ d_print_error (dpi);
+ return NULL;
+ }
+
+ return d_index_template_argument
+ (d_right (dpi->templates->template_decl),
+ dc->u.s_number.number);
+}
+
+/* Returns a template argument pack used in DC (any will do), or NULL. */
+
+static struct demangle_component *
+d_find_pack (struct d_print_info *dpi,
+ const struct demangle_component *dc)
+{
+ struct demangle_component *a;
+ if (dc == NULL)
+ return NULL;
+
+ switch (dc->type)
+ {
+ case DEMANGLE_COMPONENT_TEMPLATE_PARAM:
+ a = d_lookup_template_argument (dpi, dc);
+ if (a && a->type == DEMANGLE_COMPONENT_TEMPLATE_ARGLIST)
+ return a;
+ return NULL;
+
+ case DEMANGLE_COMPONENT_PACK_EXPANSION:
+ return NULL;
+
+ case DEMANGLE_COMPONENT_NAME:
+ case DEMANGLE_COMPONENT_OPERATOR:
+ case DEMANGLE_COMPONENT_BUILTIN_TYPE:
+ case DEMANGLE_COMPONENT_SUB_STD:
+ case DEMANGLE_COMPONENT_CHARACTER:
+ return NULL;
+
+ case DEMANGLE_COMPONENT_EXTENDED_OPERATOR:
+ return d_find_pack (dpi, dc->u.s_extended_operator.name);
+ case DEMANGLE_COMPONENT_CTOR:
+ return d_find_pack (dpi, dc->u.s_ctor.name);
+ case DEMANGLE_COMPONENT_DTOR:
+ return d_find_pack (dpi, dc->u.s_dtor.name);
+
+ default:
+ a = d_find_pack (dpi, d_left (dc));
+ if (a)
+ return a;
+ return d_find_pack (dpi, d_right (dc));
+ }
+}
+
+/* Returns the length of the template argument pack DC. */
+
+static int
+d_pack_length (const struct demangle_component *dc)
+{
+ int count = 0;
+ while (dc && dc->type == DEMANGLE_COMPONENT_TEMPLATE_ARGLIST
+ && d_left (dc) != NULL)
+ {
+ ++count;
+ dc = d_right (dc);
+ }
+ return count;
+}
+
+/* DC is a component of a mangled expression. Print it, wrapped in parens
+ if needed. */
+
+static void
+d_print_subexpr (struct d_print_info *dpi,
+ const struct demangle_component *dc)
+{
+ int simple = 0;
+ if (dc->type == DEMANGLE_COMPONENT_NAME)
+ simple = 1;
+ if (!simple)
+ d_append_char (dpi, '(');
+ d_print_comp (dpi, dc);
+ if (!simple)
+ d_append_char (dpi, ')');
+}
+
/* Subroutine to handle components. */
static void
@@ -3252,30 +3418,13 @@ d_print_comp (struct d_print_info *dpi,
case DEMANGLE_COMPONENT_TEMPLATE_PARAM:
{
- long i;
- struct demangle_component *a;
struct d_print_template *hold_dpt;
+ struct demangle_component *a = d_lookup_template_argument (dpi, dc);
- if (dpi->templates == NULL)
- {
- d_print_error (dpi);
- return;
- }
- i = dc->u.s_number.number;
- for (a = d_right (dpi->templates->template_decl);
- a != NULL;
- a = d_right (a))
- {
- if (a->type != DEMANGLE_COMPONENT_TEMPLATE_ARGLIST)
- {
- d_print_error (dpi);
- return;
- }
- if (i <= 0)
- break;
- --i;
- }
- if (i != 0 || a == NULL)
+ if (a && a->type == DEMANGLE_COMPONENT_TEMPLATE_ARGLIST)
+ a = d_index_template_argument (a, dpi->pack_index);
+
+ if (a == NULL)
{
d_print_error (dpi);
return;
@@ -3289,7 +3438,7 @@ d_print_comp (struct d_print_info *dpi,
hold_dpt = dpi->templates;
dpi->templates = hold_dpt->next;
- d_print_comp (dpi, d_left (a));
+ d_print_comp (dpi, a);
dpi->templates = hold_dpt;
@@ -3578,7 +3727,8 @@ d_print_comp (struct d_print_info *dpi,
case DEMANGLE_COMPONENT_ARGLIST:
case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST:
- d_print_comp (dpi, d_left (dc));
+ if (d_left (dc) != NULL)
+ d_print_comp (dpi, d_left (dc));
if (d_right (dc) != NULL)
{
d_append_string (dpi, ", ");
@@ -3618,11 +3768,12 @@ d_print_comp (struct d_print_info *dpi,
d_print_cast (dpi, d_left (dc));
d_append_char (dpi, ')');
}
- d_append_char (dpi, '(');
- if (d_left (dc)->type != DEMANGLE_COMPONENT_CAST
- || d_right (dc)->type != DEMANGLE_COMPONENT_BUILTIN_TYPE)
- d_print_comp (dpi, d_right (dc));
- d_append_char (dpi, ')');
+ if (d_left (dc)->type == DEMANGLE_COMPONENT_CAST
+ && d_right (dc)->type == DEMANGLE_COMPONENT_BUILTIN_TYPE)
+ /* type() -- FIXME what about type(multiple,args) */
+ d_append_string (dpi, "()");
+ else
+ d_print_subexpr (dpi, d_right (dc));
return;
case DEMANGLE_COMPONENT_BINARY:
@@ -3632,15 +3783,6 @@ d_print_comp (struct d_print_info *dpi,
return;
}
- if (!strcmp (d_left (dc)->u.s_operator.op->code, "cl"))
- {
- d_print_comp (dpi, d_left (d_right (dc)));
- d_append_string (dpi, " (");
- d_print_comp (dpi, d_right (d_right (dc)));
- d_append_char (dpi, ')');
- return;
- }
-
/* We wrap an expression which uses the greater-than operator in
an extra layer of parens so that it does not get confused
with the '>' which ends the template parameters. */
@@ -3649,13 +3791,10 @@ d_print_comp (struct d_print_info *dpi,
&& d_left (dc)->u.s_operator.op->name[0] == '>')
d_append_char (dpi, '(');
- d_append_char (dpi, '(');
- d_print_comp (dpi, d_left (d_right (dc)));
- d_append_string (dpi, ") ");
- d_print_expr_op (dpi, d_left (dc));
- d_append_string (dpi, " (");
- d_print_comp (dpi, d_right (d_right (dc)));
- d_append_char (dpi, ')');
+ d_print_subexpr (dpi, d_left (d_right (dc)));
+ if (strcmp (d_left (dc)->u.s_operator.op->code, "cl") != 0)
+ d_print_expr_op (dpi, d_left (dc));
+ d_print_subexpr (dpi, d_right (d_right (dc)));
if (d_left (dc)->type == DEMANGLE_COMPONENT_OPERATOR
&& d_left (dc)->u.s_operator.op->len == 1
@@ -3676,15 +3815,11 @@ d_print_comp (struct d_print_info *dpi,
d_print_error (dpi);
return;
}
- d_append_char (dpi, '(');
- d_print_comp (dpi, d_left (d_right (dc)));
- d_append_string (dpi, ") ");
+ d_print_subexpr (dpi, d_left (d_right (dc)));
d_print_expr_op (dpi, d_left (dc));
- d_append_string (dpi, " (");
- d_print_comp (dpi, d_left (d_right (d_right (dc))));
- d_append_string (dpi, ") : (");
- d_print_comp (dpi, d_right (d_right (d_right (dc))));
- d_append_char (dpi, ')');
+ d_print_subexpr (dpi, d_left (d_right (d_right (dc))));
+ d_append_string (dpi, " : ");
+ d_print_subexpr (dpi, d_right (d_right (d_right (dc))));
return;
case DEMANGLE_COMPONENT_TRINARY_ARG1:
@@ -3797,6 +3932,23 @@ d_print_comp (struct d_print_info *dpi,
d_append_char (dpi, ')');
return;
+ case DEMANGLE_COMPONENT_PACK_EXPANSION:
+ {
+ struct demangle_component *a = d_find_pack (dpi, d_left (dc));
+ int len = d_pack_length (a);
+ int i;
+
+ dc = d_left (dc);
+ for (i = 0; i < len; ++i)
+ {
+ dpi->pack_index = i;
+ d_print_comp (dpi, dc);
+ if (i < len-1)
+ d_append_string (dpi, ", ");
+ }
+ }
+ return;
+
default:
d_print_error (dpi);
return;
diff --git a/libiberty/cp-demangle.h b/libiberty/cp-demangle.h
index 8622f29..aad3743 100644
--- a/libiberty/cp-demangle.h
+++ b/libiberty/cp-demangle.h
@@ -147,7 +147,7 @@ struct d_info
extern const struct demangle_operator_info cplus_demangle_operators[];
#endif
-#define D_BUILTIN_TYPE_COUNT (26)
+#define D_BUILTIN_TYPE_COUNT (32)
CP_STATIC_IF_GLIBCPP_V3
const struct demangle_builtin_type_info
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 9358204..d9efbc0 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -3345,7 +3345,7 @@ f<X>
#
--format=gnu-v3 --no-params
_ZngILi42EEvN1AIXplT_Li2EEE1TE
-void operator-<42>(A<(42) + (2)>::T)
+void operator-<42>(A<(42)+(2)>::T)
operator-<42>
#
--format=gnu-v3 --no-params
@@ -3385,7 +3385,7 @@ int* const volatile restrict _far
#
--format=gnu-v3 --no-params
_Z3fooILi2EEvRAplT_Li1E_i
-void foo<2>(int (&) [(2) + (1)])
+void foo<2>(int (&) [(2)+(1)])
foo<2>
#
--format=gnu-v3 --no-params
@@ -3612,13 +3612,13 @@ hairyfunc5
# This is from gcc PR 8861
--format=gnu-v3 --no-params
_Z1fILi1ELc120EEv1AIXplT_cviLd810000000000000000703DAD7A370C5EEE
-void f<1, (char)120>(A<(1) + ((int)((double)[810000000000000000703DAD7A370C5]))>)
+void f<1, (char)120>(A<(1)+((int)((double)[810000000000000000703DAD7A370C5]))>)
f<1, (char)120>
#
# This is also from gcc PR 8861
--format=gnu-v3 --no-params
_Z1fILi1EEv1AIXplT_cvingLf3f800000EEE
-void f<1>(A<(1) + ((int)(-((float)[3f800000])))>)
+void f<1>(A<(1)+((int)(-((float)[3f800000])))>)
f<1>
#
# This is from a libstdc++ debug mode patch.
@@ -3643,7 +3643,7 @@ f
# confusion with the '>' which ends the template parameters.
--format=gnu-v3 --no-params
_Z4dep9ILi3EEvP3fooIXgtT_Li2EEE
-void dep9<3>(foo<((3) > (2))>*)
+void dep9<3>(foo<((3)>(2))>*)
dep9<3>
#
# Watch out for templated version of `operator<'--it needs an extra
@@ -3885,16 +3885,20 @@ java resource java/util/iso4217.properties
# decltype/param placeholder test
--format=gnu-v3
_Z3addIidEDTplsTT_sTT0_ES0_S1_
-decltype ((int) + (double)) add<int, double>(int, double)
-# decltype/T() test
---format=gnu-v3
-_Z4add2IidEDTplcvT_vcvT0_vES0_S1_
-decltype (((int)()) + ((double)())) add2<int, double>(int, double)
+decltype ((int)+(double)) add<int, double>(int, double)
# decltype/fn call test
--format=gnu-v3
_Z4add3IidEDTclL_Z1gEsTT_sTT0_EES0_S1_
-decltype (g (int, double)) add3<int, double>(int, double)
-# Extended floating point types test
+decltype (g(int, double)) add3<int, double>(int, double)
+# new (2008) built in types test
+--format=gnu-v3
+_Z1fDfDdDeDhDsDi
+f(decimal32, decimal64, decimal128, half, char16_t, char32_t)
+# pack expansion test
+--format=gnu-v3
+_Z1fIIPiPfPdEEvDpT_
+void f<int*, float*, double*>(int*, float*, double*)
+# '.' test
--format=gnu-v3
-_Z1fDfDdDeDh
-f(decimal32, decimal64, decimal128, half)
+_Z1hI1AIiEdEDTcldtsTT_1gIT0_EEES2_S3_
+decltype (((A<int>).(g<double>))()) h<A<int>, double>(A<int>, double)
diff --git a/libiberty/xstrdup.c b/libiberty/xstrdup.c
index 9ac2ea0..fa12c96 100644
--- a/libiberty/xstrdup.c
+++ b/libiberty/xstrdup.c
@@ -13,10 +13,10 @@ obtain memory.
*/
-#include <sys/types.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include <sys/types.h>
#ifdef HAVE_STRING_H
#include <string.h>
#else
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index d691664..2d8f214 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,48 @@
+2008-11-18 Catherine Moore <clm@codesourcery.com>
+
+ * arm-dis.c (coprocessor_opcodes): Add half-precision vcvt
+ instructions.
+ (neon_opcodes): Likewise.
+ (print_insn_coprocessor): Print 't' or 'b' for vcvt
+ instructions.
+
+2008-11-14 Tristan Gingold <gingold@adacore.com>
+
+ * makefile.vms (OBJS): Update list of objects.
+ (DEFS): Update
+ (CFLAGS): Update.
+
+2008-11-06 Chao-ying Fu <fu@mips.com>
+
+ * mips-opc.c (synciobdma, syncs, syncw, syncws): Move these
+ before sync.
+ (sync): New instruction with 5-bit sync type.
+ * mips-dis.c (print_insn_args: Add case '1' to print 5-bit values.
+
+2008-11-06 Nick Clifton <nickc@redhat.com>
+
+ * avr-dis.c: Replace uses of sprintf without a format string with
+ calls to strcpy.
+
+2008-11-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ * i386-opc.tbl: Add cmovpe and cmovpo.
+ * i386-tbl.h: Regenerated.
+
+2008-10-22 Nick Clifton <nickc@redhat.com>
+
+ PR 6937
+ * configure.in (SHARED_LIBADD): Revert previous change.
+ Add a comment explaining why.
+ (SHARED_DEPENDENCIES): Revert previous change.
+ * configure: Regenerate.
+
+2008-10-10 Nick Clifton <nickc@redhat.com>
+
+ PR 6937
+ * configure.in (SHARED_LIBADD): Add libiberty.a.
+ (SHARED_DEPENDENCIES): Add libiberty.a.
+
2008-09-30 H.J. Lu <hongjiu.lu@intel.com>
* i386-gen.c: Include "hashtab.h".
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index 155e495..1be7bbc 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -264,6 +264,9 @@ static const struct opcode32 coprocessor_opcodes[] =
{FPU_NEON_EXT_V1, 0x0e100b30, 0x0f500f30, "vmov%c.%23?us16\t%12-15r, %16-19,7D[%6,21d]"},
{FPU_NEON_EXT_V1, 0x0e400b10, 0x0fd00f10, "vmov%c.8\t%16-19,7D[%5,6,21d], %12-15r"},
{FPU_NEON_EXT_V1, 0x0e500b10, 0x0f500f10, "vmov%c.%23?us8\t%12-15r, %16-19,7D[%5,6,21d]"},
+ /* Half-precision conversion instructions. */
+ {FPU_NEON_FP16, 0x0eb20a40, 0x0fbf0f50, "vcvt%7?tb%c.f32.f16\t%y1, %y0"},
+ {FPU_NEON_FP16, 0x0eb30a40, 0x0fbf0f50, "vcvt%7?tb%c.f16.f32\t%y1, %y0"},
/* Floating point coprocessor (VFP) instructions */
{FPU_VFP_EXT_V1xD, 0x0ef1fa10, 0x0fffffff, "fmstat%c"},
@@ -504,6 +507,10 @@ static const struct opcode32 neon_opcodes[] =
{FPU_NEON_EXT_V1, 0xf3b00800, 0xffb00c50, "vtbl%c.8\t%12-15,22D, %F, %0-3,5D"},
{FPU_NEON_EXT_V1, 0xf3b00840, 0xffb00c50, "vtbx%c.8\t%12-15,22D, %F, %0-3,5D"},
+ /* Half-precision conversions. */
+ {FPU_NEON_FP16, 0xf3b60600, 0xffbf0fd0, "vcvt%c.f16.f32\t%12-15,22D, %0-3,5Q"},
+ {FPU_NEON_FP16, 0xf3b60700, 0xffbf0fd0, "vcvt%c.f32.f16\t%12-15,22Q, %0-3,5D"},
+
/* Two registers, miscellaneous */
{FPU_NEON_EXT_V1, 0xf2880a10, 0xfebf0fd0, "vmovl%c.%24?us8\t%12-15,22Q, %0-3,5D"},
{FPU_NEON_EXT_V1, 0xf2900a10, 0xfebf0fd0, "vmovl%c.%24?us16\t%12-15,22Q, %0-3,5D"},
diff --git a/opcodes/avr-dis.c b/opcodes/avr-dis.c
index 17f9eb1..976c371 100644
--- a/opcodes/avr-dis.c
+++ b/opcodes/avr-dis.c
@@ -1,5 +1,5 @@
/* Disassemble AVR instructions.
- Copyright 1999, 2000, 2002, 2004, 2005, 2006, 2007
+ Copyright 1999, 2000, 2002, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Denis Chertykov <denisc@overta.ru>
@@ -109,7 +109,7 @@ avr_operand (unsigned int insn, unsigned int insn2, unsigned int pc, int constra
case 0x100e: xyz = "-X"; break;
default: xyz = "??"; ok = 0;
}
- sprintf (buf, xyz);
+ strcpy (buf, xyz);
if (AVR_UNDEF_P (insn))
sprintf (comment, _("undefined"));
@@ -149,7 +149,7 @@ avr_operand (unsigned int insn, unsigned int insn2, unsigned int pc, int constra
value of the address only once, but this would mean recoding
objdump_print_address() which would affect many targets. */
sprintf (buf, "%#lx", (unsigned long) *sym_addr);
- sprintf (comment, comment_start);
+ strcpy (comment, comment_start);
break;
case 'L':
@@ -158,7 +158,7 @@ avr_operand (unsigned int insn, unsigned int insn2, unsigned int pc, int constra
sprintf (buf, ".%+-8d", rel_addr);
*sym = 1;
*sym_addr = pc + 2 + rel_addr;
- sprintf (comment, comment_start);
+ strcpy (comment, comment_start);
}
break;
@@ -169,7 +169,7 @@ avr_operand (unsigned int insn, unsigned int insn2, unsigned int pc, int constra
sprintf (buf, ".%+-8d", rel_addr);
*sym = 1;
*sym_addr = pc + 2 + rel_addr;
- sprintf (comment, comment_start);
+ strcpy (comment, comment_start);
}
break;
diff --git a/opcodes/configure b/opcodes/configure
index 62750de..90291a9 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -12436,6 +12436,10 @@ if test "$enable_shared" = "yes"; then
SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl"
;;
*)
+ # It is tempting to include libiberty here as well, but
+ # that library is only built as a static version.
+ # Including it here would insert text relocations into
+ # the opcodes library, which is undesirable.
SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so"
;;
esac
diff --git a/opcodes/configure.in b/opcodes/configure.in
index 2800eed..1efeb3f 100644
--- a/opcodes/configure.in
+++ b/opcodes/configure.in
@@ -118,6 +118,10 @@ if test "$enable_shared" = "yes"; then
SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl"
;;
*)
+ # It is tempting to include libiberty here as well, but
+ # that library is only built as a static version.
+ # Including it here would insert text relocations into
+ # the opcodes library, which is undesirable.
SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so"
;;
esac
diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl
index e898300..6482dc4 100644
--- a/opcodes/i386-opc.tbl
+++ b/opcodes/i386-opc.tbl
@@ -876,6 +876,8 @@ cmovle, 2, 0xf4e, None, 2, Cpu686, Modrm|No_bSuf|No_sSuf|No_ldSuf, { Reg16|Reg32
cmovng, 2, 0xf4e, None, 2, Cpu686, Modrm|No_bSuf|No_sSuf|No_ldSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg16|Reg32|Reg64 }
cmovg, 2, 0xf4f, None, 2, Cpu686, Modrm|No_bSuf|No_sSuf|No_ldSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg16|Reg32|Reg64 }
cmovnle, 2, 0xf4f, None, 2, Cpu686, Modrm|No_bSuf|No_sSuf|No_ldSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg16|Reg32|Reg64 }
+cmovpe, 2, 0xf4a, None, 2, Cpu686, Modrm|No_bSuf|No_sSuf|No_ldSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg16|Reg32|Reg64 }
+cmovpo, 2, 0xf4b, None, 2, Cpu686, Modrm|No_bSuf|No_sSuf|No_ldSuf, { Reg16|Reg32|Reg64|Word|Dword|Qword|Unspecified|BaseIndex|Disp8|Disp16|Disp32|Disp32S, Reg16|Reg32|Reg64 }
fcmovb, 2, 0xdac0, None, 2, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { FloatReg, FloatAcc }
fcmovnae, 2, 0xdac0, None, 2, Cpu686, ShortForm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { FloatReg, FloatAcc }
diff --git a/opcodes/i386-tbl.h b/opcodes/i386-tbl.h
index f9ddc40..2295cdd 100644
--- a/opcodes/i386-tbl.h
+++ b/opcodes/i386-tbl.h
@@ -6592,6 +6592,30 @@ const template i386_optab[] =
{ { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0 } } } },
+ { "cmovpe", 2, 0xf4a, None, 2,
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
+ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { { { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0,
+ 0, 0, 1, 0, 0, 0 } },
+ { { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0 } } } },
+ { "cmovpo", 2, 0xf4b, None, 2,
+ { { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
+ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { { { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0,
+ 0, 0, 1, 0, 0, 0 } },
+ { { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0 } } } },
{ "fcmovb", 2, 0xdac0, None, 2,
{ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
diff --git a/opcodes/makefile.vms b/opcodes/makefile.vms
index fc87048..6cd8ec2 100644
--- a/opcodes/makefile.vms
+++ b/opcodes/makefile.vms
@@ -6,8 +6,8 @@
# Created by Klaus K"ampf, kkaempf@progis.de
#
#
-ifeq ($(ARCH),alpha)
-OBJS=alpha-dis.obj,alpha-opc.obj,dis-buf.obj,disassemble.obj
+ifeq ($(ARCH),ALPHA)
+OBJS=alpha-dis.obj,alpha-opc.obj,dis-init.obj,dis-buf.obj,disassemble.obj
FORMAT=OBJ_EVAX
ARCHDEF="ARCH_alpha"
else
@@ -20,9 +20,9 @@ ifeq ($(CC),gcc)
DEFS=/define=($(FORMAT))
CFLAGS=/include=([],[-.include],[-.bfd])$(DEFS)
else
-DEFS=/define=($(FORMAT),"const=")
+DEFS=/define=($(FORMAT))
CFLAGS=/noopt/debug/include=([],[-.include],[-.bfd])$(DEFS)\
-/warnings=disable=(missingreturn,implicitfunc,longextern)
+/name=(as_is,shortened)/warnings=disable=(missingreturn,longextern)
endif
libopcodes.olb: sysdep.h $(OBJS)
diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
index 744d5a9..7c38589 100644
--- a/opcodes/mips-dis.c
+++ b/opcodes/mips-dis.c
@@ -1104,6 +1104,7 @@ print_insn_args (const char *d,
break;
case '<':
+ case '1':
(*info->fprintf_func) (info->stream, "0x%lx",
(l >> OP_SH_SHAMT) & OP_MASK_SHAMT);
break;
diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
index 82a01f8..c233542 100644
--- a/opcodes/mips-opc.c
+++ b/opcodes/mips-opc.c
@@ -1319,14 +1319,15 @@ const struct mips_opcode mips_builtin_opcodes[] =
{"invalidate", "t,o(b)",0xb8000000, 0xfc000000, RD_t|RD_b, 0, I2 }, /* same */
{"invalidate", "t,A(b)",0, (int) M_SWR_AB, INSN_MACRO, 0, I2 }, /* as swr */
{"swxc1", "S,t(b)", 0x4c000008, 0xfc0007ff, SM|RD_S|RD_t|RD_b|FP_S, 0, I4_33 },
-{"sync", "", 0x0000000f, 0xffffffff, INSN_SYNC, 0, I2|G1 },
-{"sync.p", "", 0x0000040f, 0xffffffff, INSN_SYNC, 0, I2 },
-{"sync.l", "", 0x0000000f, 0xffffffff, INSN_SYNC, 0, I2 },
-{"synci", "o(b)", 0x041f0000, 0xfc1f0000, SM|RD_b, 0, I33 },
{"synciobdma", "", 0x0000008f, 0xffffffff, INSN_SYNC, 0, IOCT },
{"syncs", "", 0x0000018f, 0xffffffff, INSN_SYNC, 0, IOCT },
{"syncw", "", 0x0000010f, 0xffffffff, INSN_SYNC, 0, IOCT },
{"syncws", "", 0x0000014f, 0xffffffff, INSN_SYNC, 0, IOCT },
+{"sync", "", 0x0000000f, 0xffffffff, INSN_SYNC, 0, I2|G1 },
+{"sync", "1", 0x0000000f, 0xfffff83f, INSN_SYNC, 0, I32 },
+{"sync.p", "", 0x0000040f, 0xffffffff, INSN_SYNC, 0, I2 },
+{"sync.l", "", 0x0000000f, 0xffffffff, INSN_SYNC, 0, I2 },
+{"synci", "o(b)", 0x041f0000, 0xfc1f0000, SM|RD_b, 0, I33 },
{"syscall", "", 0x0000000c, 0xffffffff, TRAP, 0, I1 },
{"syscall", "B", 0x0000000c, 0xfc00003f, TRAP, 0, I1 },
{"teqi", "s,j", 0x040c0000, 0xfc1f0000, RD_s|TRAP, 0, I2 },
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 5b8b192..4ecc04b 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,11 @@
+2008-11-12 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * aclocal.m4: Fix underquoting of function names.
+
+2008-10-21 Julian Brown <julian@codesourcery.com>
+
+ * Make-common.in (run$(EXEEXT)): Add LDFLAGS.
+
2008-07-11 Hans-Peter Nilsson <hp@axis.com>
* common.m4: Add test for libz and zlib.h.
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index e516583..bcadfc1 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -260,7 +260,7 @@ libsim.a: $(LIB_OBJS)
$(RANLIB) libsim.a
run$(EXEEXT): $(SIM_RUN_OBJS) libsim.a $(LIBDEPS)
- $(CC) $(ALL_CFLAGS) -o run$(EXEEXT) \
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o run$(EXEEXT) \
$(SIM_RUN_OBJS) libsim.a $(EXTRA_LIBS)
run.o: $(srccom)/run.c config.h tconfig.h $(remote_sim_h) $(callback_h)
diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4
index d916e62..e8fd147 100644
--- a/sim/common/aclocal.m4
+++ b/sim/common/aclocal.m4
@@ -18,7 +18,7 @@
#
# SIM_AC_OUTPUT
-AC_DEFUN(SIM_AC_COMMON,
+AC_DEFUN([SIM_AC_COMMON],
[
# autoconf.info says this should be called right after AC_INIT.
AC_CONFIG_HEADER(ifelse([$1],,config.h,[$1]):config.in)
@@ -245,7 +245,7 @@ dnl If the simulator doesn't invoke this, only the user environment is
dnl supported.
dnl ??? Until there is demonstrable value in doing something more complicated,
dnl let's not.
-AC_DEFUN(SIM_AC_OPTION_ENVIRONMENT,
+AC_DEFUN([SIM_AC_OPTION_ENVIRONMENT],
[
AC_ARG_ENABLE(sim-environment,
[ --enable-sim-environment=environment Specify mixed, user, virtual or operating environment.],
@@ -269,7 +269,7 @@ dnl Specify the alignment restrictions of the target architecture.
dnl Without this option all possible alignment restrictions are accommodated.
dnl arg[1] is hardwired target alignment
dnl arg[2] is default target alignment
-AC_DEFUN(SIM_AC_OPTION_ALIGNMENT,
+AC_DEFUN([SIM_AC_OPTION_ALIGNMENT],
wire_alignment="[$1]"
default_alignment="[$2]"
[
@@ -318,7 +318,7 @@ AC_SUBST(sim_alignment)
dnl Conditionally compile in assertion statements.
-AC_DEFUN(SIM_AC_OPTION_ASSERT,
+AC_DEFUN([SIM_AC_OPTION_ASSERT],
[
AC_ARG_ENABLE(sim-assert,
[ --enable-sim-assert Specify whether to perform random assertions.],
@@ -342,7 +342,7 @@ dnl arg[2] is the number assigned to the most significant bit
dnl arg[3] is the number of bits in an address
dnl arg[4] is the number of bits in an OpenFirmware cell.
dnl FIXME: this information should be obtained from bfd/archure
-AC_DEFUN(SIM_AC_OPTION_BITSIZE,
+AC_DEFUN([SIM_AC_OPTION_BITSIZE],
wire_word_bitsize="[$1]"
wire_word_msb="[$2]"
wire_address_bitsize="[$3]"
@@ -408,7 +408,7 @@ dnl --enable-sim-endian={yes,no,big,little} is for simulators
dnl that support both big and little endian targets.
dnl arg[1] is hardwired target endianness.
dnl arg[2] is default target endianness.
-AC_DEFUN(SIM_AC_OPTION_ENDIAN,
+AC_DEFUN([SIM_AC_OPTION_ENDIAN],
[
wire_endian="[$1]"
default_endian="[$2]"
@@ -458,7 +458,7 @@ AC_SUBST(sim_endian)
dnl --enable-sim-hostendian is for users of the simulator when
dnl they find that AC_C_BIGENDIAN does not function correctly
dnl (for instance in a canadian cross)
-AC_DEFUN(SIM_AC_OPTION_HOSTENDIAN,
+AC_DEFUN([SIM_AC_OPTION_HOSTENDIAN],
[
AC_ARG_ENABLE(sim-hostendian,
[ --enable-sim-hostendian=end Specify host byte endian orientation.],
@@ -490,7 +490,7 @@ dnl It specifies the presence of hardware floating point
dnl And optionally the bitsize of the floating point register.
dnl arg[1] specifies the presence (or absence) of floating point hardware
dnl arg[2] specifies the number of bits in a floating point register
-AC_DEFUN(SIM_AC_OPTION_FLOAT,
+AC_DEFUN([SIM_AC_OPTION_FLOAT],
[
default_sim_float="[$1]"
default_sim_float_bitsize="[$2]"
@@ -519,7 +519,7 @@ AC_SUBST(sim_float)
dnl The argument is the default cache size if none is specified.
-AC_DEFUN(SIM_AC_OPTION_SCACHE,
+AC_DEFUN([SIM_AC_OPTION_SCACHE],
[
default_sim_scache="ifelse([$1],,0,[$1])"
AC_ARG_ENABLE(sim-scache,
@@ -539,7 +539,7 @@ AC_SUBST(sim_scache)
dnl The argument is the default model if none is specified.
-AC_DEFUN(SIM_AC_OPTION_DEFAULT_MODEL,
+AC_DEFUN([SIM_AC_OPTION_DEFAULT_MODEL],
[
default_sim_default_model="ifelse([$1],,0,[$1])"
AC_ARG_ENABLE(sim-default-model,
@@ -559,7 +559,7 @@ dnl --enable-sim-hardware is for users of the simulator
dnl arg[1] Enable sim-hw by default? ("yes" or "no")
dnl arg[2] is a space separated list of devices that override the defaults
dnl arg[3] is a space separated list of extra target specific devices.
-AC_DEFUN(SIM_AC_OPTION_HARDWARE,
+AC_DEFUN([SIM_AC_OPTION_HARDWARE],
[
if test x"[$1]" = x"yes"; then
sim_hw_p=yes
@@ -621,7 +621,7 @@ dnl --enable-sim-inline is for users that wish to ramp up the simulator's
dnl performance by inlining functions.
dnl Guarantee that unconfigured simulators do not do any inlining
sim_inline="-DDEFAULT_INLINE=0"
-AC_DEFUN(SIM_AC_OPTION_INLINE,
+AC_DEFUN([SIM_AC_OPTION_INLINE],
[
default_sim_inline="ifelse([$1],,,-DDEFAULT_INLINE=[$1])"
AC_ARG_ENABLE(sim-inline,
@@ -666,7 +666,7 @@ fi])dnl
AC_SUBST(sim_inline)
-AC_DEFUN(SIM_AC_OPTION_PACKAGES,
+AC_DEFUN([SIM_AC_OPTION_PACKAGES],
[
AC_ARG_ENABLE(sim-packages,
[ --enable-sim-packages=list Specify the packages to be included in the build.],
@@ -692,7 +692,7 @@ fi])dnl
AC_SUBST(sim_packages)
-AC_DEFUN(SIM_AC_OPTION_REGPARM,
+AC_DEFUN([SIM_AC_OPTION_REGPARM],
[
AC_ARG_ENABLE(sim-regparm,
[ --enable-sim-regparm=nr-parm Pass parameters in registers instead of on the stack - x86/GCC specific.],
@@ -709,7 +709,7 @@ fi],[sim_regparm=""])dnl
AC_SUBST(sim_regparm)
-AC_DEFUN(SIM_AC_OPTION_RESERVED_BITS,
+AC_DEFUN([SIM_AC_OPTION_RESERVED_BITS],
[
default_sim_reserved_bits="ifelse([$1],,1,[$1])"
AC_ARG_ENABLE(sim-reserved-bits,
@@ -726,7 +726,7 @@ fi],[sim_reserved_bits="-DWITH_RESERVED_BITS=${default_sim_reserved_bits}"])dnl
AC_SUBST(sim_reserved_bits)
-AC_DEFUN(SIM_AC_OPTION_SMP,
+AC_DEFUN([SIM_AC_OPTION_SMP],
[
default_sim_smp="ifelse([$1],,5,[$1])"
AC_ARG_ENABLE(sim-smp,
@@ -746,7 +746,7 @@ fi])dnl
AC_SUBST(sim_smp)
-AC_DEFUN(SIM_AC_OPTION_STDCALL,
+AC_DEFUN([SIM_AC_OPTION_STDCALL],
[
AC_ARG_ENABLE(sim-stdcall,
[ --enable-sim-stdcall=type Use an alternative function call/return mechanism - x86/GCC specific.],
@@ -763,7 +763,7 @@ fi],[sim_stdcall=""])dnl
AC_SUBST(sim_stdcall)
-AC_DEFUN(SIM_AC_OPTION_XOR_ENDIAN,
+AC_DEFUN([SIM_AC_OPTION_XOR_ENDIAN],
[
default_sim_xor_endian="ifelse([$1],,8,[$1])"
AC_ARG_ENABLE(sim-xor-endian,
@@ -782,7 +782,7 @@ AC_SUBST(sim_xor_endian)
dnl --enable-build-warnings is for developers of the simulator.
dnl it enables extra GCC specific warnings.
-AC_DEFUN(SIM_AC_OPTION_WARNINGS,
+AC_DEFUN([SIM_AC_OPTION_WARNINGS],
[
# NOTE: Don't add -Wall or -Wunused, they both include
# -Wunused-parameter which reports bogus warnings.
@@ -866,7 +866,7 @@ dnl We cope by having autoconf generate two files and then merge them into
dnl one afterwards. The two pieces of the common fragment are inserted into
dnl the target's fragment at the appropriate points.
-AC_DEFUN(SIM_AC_OUTPUT,
+AC_DEFUN([SIM_AC_OUTPUT],
[
AC_LINK_FILES($sim_link_files, $sim_link_links)
dnl Make @cgen_breaks@ non-null only if the sim uses CGEN.
@@ -896,7 +896,7 @@ sinclude(../../config/gettext-sister.m4)
sinclude(../../config/acx.m4)
dnl --enable-cgen-maint support
-AC_DEFUN(SIM_AC_OPTION_CGEN_MAINT,
+AC_DEFUN([SIM_AC_OPTION_CGEN_MAINT],
[
cgen_maint=no
dnl Default is to use one in build tree.
diff --git a/sim/erc32/ChangeLog b/sim/erc32/ChangeLog
index 27d99f5..c4a3db5 100644
--- a/sim/erc32/ChangeLog
+++ b/sim/erc32/ChangeLog
@@ -1,3 +1,7 @@
+2008-11-10 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * erc32.c, exec.c: Fix warnings.
+
2008-07-11 Hans-Peter Nilsson <hp@axis.com>
* configure: Regenerate to track ../common/common.m4 changes.
diff --git a/sim/erc32/erc32.c b/sim/erc32/erc32.c
index 0b3f3ac..c79dfd6 100644
--- a/sim/erc32/erc32.c
+++ b/sim/erc32/erc32.c
@@ -24,6 +24,7 @@
#include <sys/types.h>
#include <stdio.h>
+#include <string.h>
#include <termios.h>
#include <sys/fcntl.h>
#include <sys/file.h>
@@ -1659,7 +1660,7 @@ memory_read(asi, addr, data, sz, ws)
errmec = 0;
return(1);
}
-#endif;
+#endif
if ((addr >= mem_ramstart) && (addr < (mem_ramstart + mem_ramsz))) {
fetch_bytes (asi, &ramb[addr & mem_rammask], data, sz);
@@ -1736,7 +1737,7 @@ memory_write(asi, addr, data, sz, ws)
errmec = 0;
return(1);
}
-#endif;
+#endif
if ((addr >= mem_ramstart) && (addr < (mem_ramstart + mem_ramsz))) {
if (mem_accprot) {
diff --git a/sim/erc32/exec.c b/sim/erc32/exec.c
index c9765d9..0aca49e 100644
--- a/sim/erc32/exec.c
+++ b/sim/erc32/exec.c
@@ -1713,7 +1713,7 @@ fpexec(op3, rd, rs1, rs2, sregs)
sregs->fdp[rs2 | 1] = sregs->fs[rs2 & ~1];
sregs->fdp[rs2 & ~1] = sregs->fs[rs2 | 1];
default:
- ;
+ break;
}
#endif
@@ -1886,7 +1886,7 @@ fpexec(op3, rd, rs1, rs2, sregs)
sregs->fs[rd & ~1] = sregs->fdp[rd | 1];
sregs->fs[rd | 1] = sregs->fdp[rd & ~1];
default:
- ;
+ break;
}
#endif
if (sregs->fpstate == FP_EXC_PE) {
diff --git a/sim/m32c/ChangeLog b/sim/m32c/ChangeLog
index c77bf25..5512d69 100644
--- a/sim/m32c/ChangeLog
+++ b/sim/m32c/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-01 DJ Delorie <dj@redhat.com>
+
+ * int.c (trigger_peripheral_interrupt): Clear interrupt pending
+ bit when peripheral interrupts are serviced.
+
2008-07-11 Hans-Peter Nilsson <hp@axis.com>
* configure: Regenerate to track ../common/common.m4 changes.
diff --git a/sim/m32c/int.c b/sim/m32c/int.c
index 5556a12..ac7ac97 100644
--- a/sim/m32c/int.c
+++ b/sim/m32c/int.c
@@ -72,4 +72,5 @@ trigger_peripheral_interrupt (int vector, int icaddr)
int addr = get_reg (intb) + vector * 4;
trigger_interrupt (addr, 1);
put_reg (flags, (get_reg (flags) & 0x8fff) | ((old_ic & 7) << 12));
+ mem_put_qi (icaddr, old_ic & ~ 0x08);
}
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 7517c86..17f50cf 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,11 @@
+2008-11-18 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * configure: Regenerated.
+ * configure.ac: Add test for System V shared memory and semaphore.
+ * debug.c, debug.h: Add trace support for new devices.
+ * hw_sem.c, hw_shm.c: New files.
+ * Makefile.in: Add hw_sem.c and hw_shm.c.
+
2008-07-11 Hans-Peter Nilsson <hp@axis.com>
* configure.ac: Add test for libz and zlib.h.
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 86fc8e62..911bed4 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -843,6 +843,8 @@ hw_opic.o: hw_opic.c $(DEVICE_TABLE_H)
hw_pal.o: hw_pal.c $(DEVICE_TABLE_H) $(CPU_H)
hw_phb.o: hw_phb.c $(DEVICE_TABLE_H) $(HW_PHB_H) $(COREFILE_H)
hw_register.o: hw_register.c $(DEVICE_TABLE_H) $(PSIM_H)
+hw_sem.o: hw_sem.c $(DEVICE_TABLE_H) $(PSIM_H)
+hw_shm.o: hw_shm.c $(DEVICE_TABLE_H) $(PSIM_H)
hw_trace.o: hw_trace.c $(DEVICE_TABLE_H)
hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) $(CPU_H)
# ignore this line, it stops make from getting confused
diff --git a/sim/ppc/configure b/sim/ppc/configure
index e96bf3b..6ac9104 100755
--- a/sim/ppc/configure
+++ b/sim/ppc/configure
@@ -2715,10 +2715,263 @@ esac
fi;
+echo "$as_me:$LINENO: checking if union semun defined" >&5
+echo $ECHO_N "checking if union semun defined... $ECHO_C" >&6
+if test "${ac_cv_HAS_UNION_SEMUN+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+int
+main ()
+{
+union semun arg ;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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_has_union_semun="yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_has_union_semun="no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_cv_has_union_semun" >&5
+echo "${ECHO_T}$ac_cv_has_union_semun" >&6
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_HAS_UNION_SEMUN" >&5
+echo "${ECHO_T}$ac_cv_HAS_UNION_SEMUN" >&6
+
+
+if test "$ac_cv_has_union_semun" = "yes"; then
+ echo "$as_me:$LINENO: checking whether System V semaphores are supported" >&5
+echo $ECHO_N "checking whether System V semaphores are supported... $ECHO_C" >&6
+if test "${ac_cv_sysv_sem+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/sem.h>
+ int main () {
+ union semun arg ;
+
+ int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ arg.val = 0; /* avoid implicit type cast to union */
+ if (semctl(id, 0, IPC_RMID, arg) == -1)
+ 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_sysv_sem="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_sysv_sem="no"
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sysv_sem" >&5
+echo "${ECHO_T}$ac_cv_sysv_sem" >&6
+else # semun is not defined
+ echo "$as_me:$LINENO: checking whether System V semaphores are supported" >&5
+echo $ECHO_N "checking whether System V semaphores are supported... $ECHO_C" >&6
+if test "${ac_cv_sysv_sem+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/sem.h>
+ union semun {
+ int val;
+ struct semid_ds *buf;
+ ushort *array;
+ };
+ int main () {
+ union semun arg ;
+
+ int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ arg.val = 0; /* avoid implicit type cast to union */
+ if (semctl(id, 0, IPC_RMID, arg) == -1)
+ 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_sysv_sem="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_sysv_sem="no"
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sysv_sem" >&5
+echo "${ECHO_T}$ac_cv_sysv_sem" >&6
+fi
+
+echo "$as_me:$LINENO: checking whether System V shared memory is supported" >&5
+echo $ECHO_N "checking whether System V shared memory is supported... $ECHO_C" >&6
+if test "${ac_cv_sysv_shm+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+int main () {
+ int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ if (shmctl(id, IPC_RMID, 0) == -1)
+ 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_sysv_shm="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_sysv_shm="no"
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sysv_shm" >&5
+echo "${ECHO_T}$ac_cv_sysv_shm" >&6
+
+if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
+ sim_sysv_ipc_hw=",sem,shm";
+else
+ sim_sysv_ipc_hw="";
+fi
+
+if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
+ sim_hwflags="-DHAS_UNION_SEMUN";
+fi
+
+
# Check whether --enable-sim-hardware or --disable-sim-hardware was given.
if test "${enable_sim_hardware+set}" = set; then
enableval="$enable_sim_hardware"
- hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
+ hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
case "${enableval}" in
yes) ;;
no) { { echo "$as_me:$LINENO: error: \"List of hardware must be specified for --enable-sim-hardware\"" >&5
@@ -2734,14 +2987,13 @@ if test x"$silent" != x"yes" && test x"$hardware" != x""; then
echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
fi
else
- hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
+ hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
if test x"$silent" != x"yes"; then
echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
fi
fi;
-
# Check whether --enable-sim-hostbitsize or --disable-sim-hostbitsize was given.
if test "${enable_sim_hostbitsize+set}" = set; then
enableval="$enable_sim_hostbitsize"
@@ -2758,7 +3010,6 @@ else
sim_hostbitsize=""
fi;
-
# Check whether --enable-sim-hostendian or --disable-sim-hostendian was given.
if test "${enable_sim_hostendian+set}" = set; then
enableval="$enable_sim_hostendian"
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 730091b..8a580c8 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -209,10 +209,105 @@ case "${target}" in
esac
])dnl
+AC_CACHE_CHECK([if union semun defined],
+ ac_cv_HAS_UNION_SEMUN,
+ [AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>],
+[union semun arg ;],
+[ac_cv_has_union_semun="yes"],
+[ac_cv_has_union_semun="no"])
+AC_MSG_RESULT($ac_cv_has_union_semun)
+])
+
+
+if test "$ac_cv_has_union_semun" = "yes"; then
+ AC_CACHE_CHECK(whether System V semaphores are supported,
+ ac_cv_sysv_sem,
+ [
+ AC_TRY_RUN(
+ [
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/sem.h>
+ int main () {
+ union semun arg ;
+
+ int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ arg.val = 0; /* avoid implicit type cast to union */
+ if (semctl(id, 0, IPC_RMID, arg) == -1)
+ exit(1);
+ exit(0);
+ }
+ ],
+ ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
+ ])
+else # semun is not defined
+ AC_CACHE_CHECK(whether System V semaphores are supported,
+ ac_cv_sysv_sem,
+ [
+ AC_TRY_RUN(
+ [
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/sem.h>
+ union semun {
+ int val;
+ struct semid_ds *buf;
+ ushort *array;
+ };
+ int main () {
+ union semun arg ;
+
+ int id=semget(IPC_PRIVATE,1,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ arg.val = 0; /* avoid implicit type cast to union */
+ if (semctl(id, 0, IPC_RMID, arg) == -1)
+ exit(1);
+ exit(0);
+ }
+ ],
+ ac_cv_sysv_sem="yes", ac_cv_sysv_sem="no", :)
+ ])
+fi
+
+AC_CACHE_CHECK(whether System V shared memory is supported,
+ac_cv_sysv_shm,
+[
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+int main () {
+ int id=shmget(IPC_PRIVATE,1,IPC_CREAT|0400);
+ if (id == -1)
+ exit(1);
+ if (shmctl(id, IPC_RMID, 0) == -1)
+ exit(1);
+ exit(0);
+}
+],
+ac_cv_sysv_shm="yes", ac_cv_sysv_shm="no", :)
+])
+
+if test x"$ac_cv_sysv_shm" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
+ sim_sysv_ipc_hw=",sem,shm";
+else
+ sim_sysv_ipc_hw="";
+fi
+
+if test x"$ac_cv_has_union_semun" = x"yes" -a x"$ac_cv_sysv_sem" = x"yes" ; then
+ sim_hwflags="-DHAS_UNION_SEMUN";
+fi
+
AC_ARG_ENABLE(sim-hardware,
[ --enable-sim-hardware=list Specify the hardware to be included in the build.],
-[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
+[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
case "${enableval}" in
yes) ;;
no) AC_MSG_ERROR("List of hardware must be specified for --enable-sim-hardware"); hardware="";;
@@ -224,14 +319,13 @@ sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
if test x"$silent" != x"yes" && test x"$hardware" != x""; then
echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
-fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide"
+fi],[hardware="cpu,memory,nvram,iobus,htab,disk,trace,register,vm,init,core,pal,com,eeprom,opic,glue,phb,ide${sim_sysv_ipc_hw}"
sim_hw_src=`echo $hardware | sed -e 's/,/.c hw_/g' -e 's/^/hw_/' -e s'/$/.c/'`
sim_hw_obj=`echo $sim_hw_src | sed -e 's/\.c/.o/g'`
if test x"$silent" != x"yes"; then
echo "Setting hardware to $sim_hw_src, $sim_hw_obj"
fi])dnl
-
AC_ARG_ENABLE(sim-hostbitsize,
[ --enable-sim-hostbitsize=32|64 Specify host bitsize (32 or 64).],
[case "${enableval}" in
diff --git a/sim/ppc/debug.c b/sim/ppc/debug.c
index 5931d1e..79dd47b 100644
--- a/sim/ppc/debug.c
+++ b/sim/ppc/debug.c
@@ -28,6 +28,9 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
int ppc_trace[nr_trace_options];
@@ -70,6 +73,8 @@ static trace_option_descriptor trace_description[] = {
{ trace_pass_device, "pass-device" },
{ trace_phb_device, "phb-device" },
{ trace_register_device, "register-device", "Device initializing registers" },
+ { trace_sem_device, "sem-device" },
+ { trace_shm_device, "shm-device" },
{ trace_stack_device, "stack-device" },
{ trace_vm_device, "vm-device" },
/* packages */
diff --git a/sim/ppc/debug.h b/sim/ppc/debug.h
index 1fdb36e..e49b795 100644
--- a/sim/ppc/debug.h
+++ b/sim/ppc/debug.h
@@ -51,6 +51,8 @@ typedef enum {
trace_pal_device,
trace_pass_device,
trace_phb_device,
+ trace_sem_device,
+ trace_shm_device,
trace_stack_device,
trace_register_device,
trace_vm_device,
diff --git a/sim/ppc/hw_sem.c b/sim/ppc/hw_sem.c
new file mode 100644
index 0000000..28e0c17
--- /dev/null
+++ b/sim/ppc/hw_sem.c
@@ -0,0 +1,289 @@
+/* This file is part of the program psim.
+
+ Copyright (C) 1997,2008, Joel Sherrill <joel@OARcorp.com>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public 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 _HW_SEM_C_
+#define _HW_SEM_C_
+
+#include "device_table.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+
+#include <sys/ipc.h>
+#include <sys/sem.h>
+
+#include <errno.h>
+
+/* DEVICE
+
+
+ sem - provide access to a unix semaphore
+
+
+ DESCRIPTION
+
+
+ This device implements an interface to a unix semaphore.
+
+
+ PROPERTIES
+
+
+ reg = <address> <size> (required)
+
+ Determine where the memory lives in the parents address space.
+
+ key = <integer> (required)
+
+ This is the key of the unix semaphore.
+
+ EXAMPLES
+
+
+ Enable tracing of the sem:
+
+ | bash$ psim -t sem-device \
+
+
+ Configure a UNIX semaphore using key 0x12345678 mapped into psim
+ address space at 0xfff00000:
+
+ | -o '/sem@0xfff00000/reg 0xfff00000 0x80000' \
+ | -o '/sem@0xfff00000/key 0x12345678' \
+
+ sim/ppc/run -o '/#address-cells 1' \
+ -o '/sem@0xfff00000/reg 0xfff00000 12' \
+ -o '/sem@0xfff00000/key 0x12345678' ../psim-hello/hello
+
+ REGISTERS
+
+ offset 0 - lock count
+ offset 4 - lock operation
+ offset 8 - unlock operation
+
+ All reads return the current or resulting count.
+
+ BUGS
+
+ None known.
+
+ */
+
+typedef struct _hw_sem_device {
+ unsigned_word physical_address;
+ key_t key;
+ int id;
+ int initial;
+ int count;
+} hw_sem_device;
+
+#if !HAS_UNION_SEMUN
+union semun {
+ int val;
+ struct semid_ds *buf;
+ unsigned short int *array;
+#if defined(__linux__)
+ struct seminfo *__buf;
+#endif
+};
+#endif
+
+static void
+hw_sem_init_data(device *me)
+{
+ hw_sem_device *sem = (hw_sem_device*)device_data(me);
+ const device_unit *d;
+ int status;
+ union semun help;
+
+ /* initialize the properties of the sem */
+
+ if (device_find_property(me, "key") == NULL)
+ error("sem_init_data() required key property is missing\n");
+
+ if (device_find_property(me, "value") == NULL)
+ error("sem_init_data() required value property is missing\n");
+
+ sem->key = (key_t) device_find_integer_property(me, "key");
+ DTRACE(sem, ("semaphore key (%d)\n", sem->key) );
+
+ sem->initial = (int) device_find_integer_property(me, "value");
+ DTRACE(sem, ("semaphore initial value (%d)\n", sem->initial) );
+
+ d = device_unit_address(me);
+ sem->physical_address = d->cells[ d->nr_cells-1 ];
+ DTRACE(sem, ("semaphore physical_address=0x%x\n", sem->physical_address));
+
+ /* Now to initialize the semaphore */
+
+ if ( sem->initial != -1 ) {
+
+ sem->id = semget(sem->key, 1, IPC_CREAT | 0660);
+ if (sem->id == -1)
+ error("hw_sem_init_data() semget failed\n");
+
+ help.val = sem->initial;
+ status = semctl( sem->id, 0, SETVAL, help );
+ if (status == -1)
+ error("hw_sem_init_data() semctl -- set value failed\n");
+
+ } else {
+ sem->id = semget(sem->key, 1, 0660);
+ if (sem->id == -1)
+ error("hw_sem_init_data() semget failed\n");
+ }
+
+ sem->count = semctl( sem->id, 0, GETVAL, help );
+ if (sem->count == -1)
+ error("hw_sem_init_data() semctl -- get value failed\n");
+ DTRACE(sem, ("semaphore OS value (%d)\n", sem->count) );
+}
+
+static void
+hw_sem_attach_address_callback(device *me,
+ attach_type attach,
+ int space,
+ unsigned_word addr,
+ unsigned nr_bytes,
+ access_type access,
+ device *client) /*callback/default*/
+{
+ hw_sem_device *sem = (hw_sem_device*)device_data(me);
+
+ if (space != 0)
+ error("sem_attach_address_callback() invalid address space\n");
+
+ if (nr_bytes == 12)
+ error("sem_attach_address_callback() invalid size\n");
+
+ sem->physical_address = addr;
+ DTRACE(sem, ("semaphore physical_address=0x%x\n", addr));
+}
+
+static unsigned
+hw_sem_io_read_buffer(device *me,
+ void *dest,
+ int space,
+ unsigned_word addr,
+ unsigned nr_bytes,
+ cpu *processor,
+ unsigned_word cia)
+{
+ hw_sem_device *sem = (hw_sem_device*)device_data(me);
+ struct sembuf sb;
+ int status;
+ unsigned32 u32;
+ union semun help;
+
+ /* do we need to worry about out of range addresses? */
+
+ DTRACE(sem, ("semaphore read addr=0x%x length=%d\n", addr, nr_bytes));
+
+ if (!(addr >= sem->physical_address && addr <= sem->physical_address + 11))
+ error("hw_sem_io_read_buffer() invalid address - out of range\n");
+
+ if ((addr % 4) != 0)
+ error("hw_sem_io_read_buffer() invalid address - alignment\n");
+
+ if (nr_bytes != 4)
+ error("hw_sem_io_read_buffer() invalid length\n");
+
+ switch ( (addr - sem->physical_address) / 4 ) {
+
+ case 0: /* OBTAIN CURRENT VALUE */
+ break;
+
+ case 1: /* LOCK */
+ sb.sem_num = 0;
+ sb.sem_op = -1;
+ sb.sem_flg = 0;
+
+ status = semop(sem->id, &sb, 1);
+ if (status == -1) {
+ perror( "hw_sem.c: lock" );
+ error("hw_sem_io_read_buffer() sem lock\n");
+ }
+
+ DTRACE(sem, ("semaphore lock %d\n", sem->count));
+ break;
+
+ case 2: /* UNLOCK */
+ sb.sem_num = 0;
+ sb.sem_op = 1;
+ sb.sem_flg = 0;
+
+ status = semop(sem->id, &sb, 1);
+ if (status == -1) {
+ perror( "hw_sem.c: unlock" );
+ error("hw_sem_io_read_buffer() sem unlock\n");
+ }
+ DTRACE(sem, ("semaphore unlock %d\n", sem->count));
+ break;
+
+ default:
+ error("hw_sem_io_read_buffer() invalid address - unknown error\n");
+ break;
+ }
+
+ /* assume target is big endian */
+ u32 = H2T_4(semctl( sem->id, 0, GETVAL, help ));
+
+ DTRACE(sem, ("semaphore OS value (%d)\n", u32) );
+ if (u32 == 0xffffffff) {
+ perror( "hw_sem.c: getval" );
+ error("hw_sem_io_read_buffer() semctl -- get value failed\n");
+ }
+
+ memcpy(dest, &u32, nr_bytes);
+ return nr_bytes;
+
+}
+
+static device_callbacks const hw_sem_callbacks = {
+ { generic_device_init_address, hw_sem_init_data },
+ { hw_sem_attach_address_callback, }, /* address */
+ { hw_sem_io_read_buffer, NULL }, /* IO */
+ { NULL, }, /* DMA */
+ { NULL, }, /* interrupt */
+ { NULL, }, /* unit */
+ NULL,
+};
+
+static void *
+hw_sem_create(const char *name,
+ const device_unit *unit_address,
+ const char *args)
+{
+ hw_sem_device *sem = ZALLOC(hw_sem_device);
+ return sem;
+}
+
+const device_descriptor hw_sem_device_descriptor[] = {
+ { "sem", hw_sem_create, &hw_sem_callbacks },
+ { NULL },
+};
+
+#endif /* _HW_SEM_C_ */
diff --git a/sim/ppc/hw_shm.c b/sim/ppc/hw_shm.c
new file mode 100644
index 0000000..01a4a9a
--- /dev/null
+++ b/sim/ppc/hw_shm.c
@@ -0,0 +1,236 @@
+/* This file is part of the program psim.
+
+ Copyright (C) 1997,2008, Joel Sherrill <joel@OARcorp.com>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public 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 _HW_SHM_C_
+#define _HW_SHM_C_
+
+#include "device_table.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+
+#include <sys/ipc.h>
+#include <sys/shm.h>
+
+
+/* DEVICE
+
+
+ shm - map unix shared memory into psim address space
+
+
+ DESCRIPTION
+
+
+ This device implements an area of memory which is mapped into UNIX
+ shared memory.
+
+
+ PROPERTIES
+
+
+ reg = <address> <size> (required)
+
+ Determine where the memory lives in the parents address space.
+ The SHM area is assumed to be of the same length.
+
+ key = <integer> (required)
+
+ This is the key of the unix shared memory area.
+
+ EXAMPLES
+
+
+ Enable tracing of the shm:
+
+ | bash$ psim -t shm-device \
+
+
+ Configure a 512 kilobytes of UNIX shared memory with the key 0x12345678
+ mapped into psim address space at 0x0c000000.
+
+ | -o '/shm@0x0c000000/reg 0x0c000000 0x80000' \
+ | -o '/shm@0x0c000000/key 0x12345678' \
+
+ sim/ppc/run -o '/#address-cells 1' \
+ -o '/shm@0x0c000000/reg 0x0c000000 0x80000' \
+ -o '/shm@0x0c000000/key 0x12345678' ../psim-hello/hello
+
+ BUGS
+
+ None known.
+
+ */
+
+typedef struct _hw_shm_device {
+ unsigned_word physical_address;
+ char *shm_address;
+ unsigned sizeof_memory;
+ key_t key;
+ int id;
+} hw_shm_device;
+
+static void
+hw_shm_init_data(device *me)
+{
+ hw_shm_device *shm = (hw_shm_device*)device_data(me);
+ const device_unit *d;
+ reg_property_spec reg;
+ int i;
+
+ /* Obtain the Key Value */
+ if (device_find_property(me, "key") == NULL)
+ error("shm_init_data() required key property is missing\n");
+
+ shm->key = (key_t) device_find_integer_property(me, "key");
+ DTRACE(shm, ("shm key (0x%08x)\n", shm->key) );
+
+ /* Figure out where this memory is in address space and how long it is */
+ if ( !device_find_reg_array_property(me, "reg", 0, &reg) )
+ error("hw_shm_init_data() no address registered\n");
+
+ /* Determine the address and length being as paranoid as possible */
+ shm->physical_address = 0xffffffff;
+ shm->sizeof_memory = 0xffffffff;
+
+ for ( i=0 ; i<reg.address.nr_cells; i++ ) {
+ if (reg.address.cells[0] == 0 && reg.size.cells[0] == 0)
+ continue;
+
+ if ( shm->physical_address != 0xffffffff )
+ device_error(me, "Only single celled address ranges supported\n");
+
+ shm->physical_address = reg.address.cells[i];
+ DTRACE(shm, ("shm physical_address=0x%x\n", shm->physical_address));
+
+ shm->sizeof_memory = reg.size.cells[i];
+ DTRACE(shm, ("shm length=0x%x\n", shm->sizeof_memory));
+ }
+
+ if ( shm->physical_address == 0xffffffff )
+ device_error(me, "Address not specified\n" );
+
+ if ( shm->sizeof_memory == 0xffffffff )
+ device_error(me, "Length not specified\n" );
+
+ /* Now actually attach to or create the shared memory area */
+ shm->id = shmget(shm->key, shm->sizeof_memory, IPC_CREAT | 0660);
+ if (shm->id == -1)
+ error("hw_shm_init_data() shmget failed\n");
+
+ shm->shm_address = shmat(shm->id, (char *)0, SHM_RND);
+ if (shm->shm_address == (void *)-1)
+ error("hw_shm_init_data() shmat failed\n");
+}
+
+static void
+hw_shm_attach_address_callback(device *me,
+ attach_type attach,
+ int space,
+ unsigned_word addr,
+ unsigned nr_bytes,
+ access_type access,
+ device *client) /*callback/default*/
+{
+ hw_shm_device *shm = (hw_shm_device*)device_data(me);
+
+ if (space != 0)
+ error("shm_attach_address_callback() invalid address space\n");
+
+ if (nr_bytes == 0)
+ error("shm_attach_address_callback() invalid size\n");
+}
+
+
+static unsigned
+hw_shm_io_read_buffer(device *me,
+ void *dest,
+ int space,
+ unsigned_word addr,
+ unsigned nr_bytes,
+ cpu *processor,
+ unsigned_word cia)
+{
+ hw_shm_device *shm = (hw_shm_device*)device_data(me);
+
+ /* do we need to worry about out of range addresses? */
+
+ DTRACE(shm, ("read %p %x %x %x\n", \
+ shm->shm_address, shm->physical_address, addr, nr_bytes) );
+
+ memcpy(dest, &shm->shm_address[addr - shm->physical_address], nr_bytes);
+ return nr_bytes;
+}
+
+
+static unsigned
+hw_shm_io_write_buffer(device *me,
+ const void *source,
+ int space,
+ unsigned_word addr,
+ unsigned nr_bytes,
+ cpu *processor,
+ unsigned_word cia)
+{
+ hw_shm_device *shm = (hw_shm_device*)device_data(me);
+
+ /* do we need to worry about out of range addresses? */
+
+ DTRACE(shm, ("write %p %x %x %x\n", \
+ shm->shm_address, shm->physical_address, addr, nr_bytes) );
+
+ memcpy(&shm->shm_address[addr - shm->physical_address], source, nr_bytes);
+ return nr_bytes;
+}
+
+static device_callbacks const hw_shm_callbacks = {
+ { generic_device_init_address, hw_shm_init_data },
+ { hw_shm_attach_address_callback, }, /* address */
+ { hw_shm_io_read_buffer,
+ hw_shm_io_write_buffer }, /* IO */
+ { NULL, }, /* DMA */
+ { NULL, }, /* interrupt */
+ { NULL, }, /* unit */
+ NULL,
+};
+
+static void *
+hw_shm_create(const char *name,
+ const device_unit *unit_address,
+ const char *args)
+{
+ hw_shm_device *shm = ZALLOC(hw_shm_device);
+ return shm;
+}
+
+
+
+const device_descriptor hw_shm_device_descriptor[] = {
+ { "shm", hw_shm_create, &hw_shm_callbacks },
+ { NULL },
+};
+
+#endif /* _HW_SHM_C_ */