diff options
author | nobody <> | 2011-09-22 08:11:17 +0000 |
---|---|---|
committer | nobody <> | 2011-09-22 08:11:17 +0000 |
commit | 8a943440a8d26df3c5626837790f009ad37bfc63 (patch) | |
tree | 70ca5e03722fcc5df8d1344c9722607387cee0d3 /gdb/gdbserver | |
parent | a7142d9403250494101a893054aa4a23e0fe3a42 (diff) | |
download | binutils-gdb-8a943440a8d26df3c5626837790f009ad37bfc63.tar.gz |
This commit was manufactured by cvs2svn to create branch 'binutils-binutils-2_22-branchpoint
2_22-branch'.
Sprout from master 2011-09-22 08:11:16 UTC Tristan Gingold <gingold@adacore.com> 'binutils/'
Cherrypick from cygnus 1999-05-03 07:29:11 UTC Richard Henderson <rth@redhat.com> '19990502 sourceware import':
README
bfd/PORTING
bfd/TODO
bfd/doc/doc.str
bfd/doc/makefile.vms
bfd/stamp-h.in
binutils/stamp-h.in
binutils/testsuite/binutils-all/bintest.s
binutils/testsuite/binutils-all/hppa/addendbug.s
config/mt-d30v
config/mt-ospace
etc/add-log.el
etc/add-log.vi
etc/configbuild.ein
etc/configbuild.fig
etc/configbuild.jin
etc/configbuild.tin
etc/configdev.ein
etc/configdev.fig
etc/configdev.jin
etc/configdev.tin
gas/stamp-h.in
gas/testsuite/gas/all/align.s
gas/testsuite/gas/all/comment.s
gas/testsuite/gas/all/diff1.s
gas/testsuite/gas/all/float.s
gas/testsuite/gas/all/itbl
gas/testsuite/gas/all/itbl.s
gas/testsuite/gas/all/p1480.s
gas/testsuite/gas/all/struct.d
gas/testsuite/gas/all/struct.s
gas/testsuite/gas/all/x930509.s
gas/testsuite/gas/arc/alias.d
gas/testsuite/gas/arc/alias.s
gas/testsuite/gas/arc/branch.d
gas/testsuite/gas/arc/branch.s
gas/testsuite/gas/arc/flag.s
gas/testsuite/gas/arc/insn3.d
gas/testsuite/gas/arc/insn3.s
gas/testsuite/gas/arc/math.d
gas/testsuite/gas/arc/math.s
gas/testsuite/gas/arc/sshift.d
gas/testsuite/gas/arc/sshift.s
gas/testsuite/gas/arm/le-fpconst.s
gas/testsuite/gas/d30v/align.d
gas/testsuite/gas/d30v/align.s
gas/testsuite/gas/d30v/array.d
gas/testsuite/gas/d30v/array.s
gas/testsuite/gas/d30v/bittest.d
gas/testsuite/gas/d30v/bittest.s
gas/testsuite/gas/d30v/guard-debug.s
gas/testsuite/gas/d30v/guard.d
gas/testsuite/gas/d30v/guard.s
gas/testsuite/gas/d30v/inst.s
gas/testsuite/gas/d30v/label-debug.d
gas/testsuite/gas/d30v/label-debug.s
gas/testsuite/gas/d30v/label.d
gas/testsuite/gas/d30v/label.s
gas/testsuite/gas/d30v/mul.d
gas/testsuite/gas/d30v/mul.s
gas/testsuite/gas/d30v/opt.d
gas/testsuite/gas/d30v/opt.s
gas/testsuite/gas/d30v/reloc.d
gas/testsuite/gas/d30v/reloc.s
gas/testsuite/gas/d30v/serial.s
gas/testsuite/gas/d30v/serial2.s
gas/testsuite/gas/d30v/serial2O.s
gas/testsuite/gas/d30v/warn_oddreg.l
gas/testsuite/gas/d30v/warn_oddreg.s
gas/testsuite/gas/fr30/allinsn.d
gas/testsuite/gas/fr30/allinsn.exp
gas/testsuite/gas/fr30/allinsn.s
gas/testsuite/gas/fr30/fr30.exp
gas/testsuite/gas/h8300/addsub.s
gas/testsuite/gas/h8300/addsubh.s
gas/testsuite/gas/h8300/addsubs.s
gas/testsuite/gas/h8300/bitops1.s
gas/testsuite/gas/h8300/bitops1h.s
gas/testsuite/gas/h8300/bitops1s.s
gas/testsuite/gas/h8300/bitops2.s
gas/testsuite/gas/h8300/bitops2h.s
gas/testsuite/gas/h8300/bitops2s.s
gas/testsuite/gas/h8300/bitops3.s
gas/testsuite/gas/h8300/bitops3h.s
gas/testsuite/gas/h8300/bitops3s.s
gas/testsuite/gas/h8300/bitops4.s
gas/testsuite/gas/h8300/bitops4h.s
gas/testsuite/gas/h8300/bitops4s.s
gas/testsuite/gas/h8300/cbranch.s
gas/testsuite/gas/h8300/cbranchh.s
gas/testsuite/gas/h8300/cbranchs.s
gas/testsuite/gas/h8300/compare.s
gas/testsuite/gas/h8300/compareh.s
gas/testsuite/gas/h8300/compares.s
gas/testsuite/gas/h8300/decimal.s
gas/testsuite/gas/h8300/decimalh.s
gas/testsuite/gas/h8300/decimals.s
gas/testsuite/gas/h8300/divmul.s
gas/testsuite/gas/h8300/divmulh.s
gas/testsuite/gas/h8300/divmuls.s
gas/testsuite/gas/h8300/extendh.s
gas/testsuite/gas/h8300/extends.s
gas/testsuite/gas/h8300/incdec.s
gas/testsuite/gas/h8300/incdech.s
gas/testsuite/gas/h8300/incdecs.s
gas/testsuite/gas/h8300/logical.s
gas/testsuite/gas/h8300/logicalh.s
gas/testsuite/gas/h8300/logicals.s
gas/testsuite/gas/h8300/misc.s
gas/testsuite/gas/h8300/misch.s
gas/testsuite/gas/h8300/miscs.s
gas/testsuite/gas/h8300/mov32bug.s
gas/testsuite/gas/h8300/movb.s
gas/testsuite/gas/h8300/movbh.s
gas/testsuite/gas/h8300/movbs.s
gas/testsuite/gas/h8300/movlh.s
gas/testsuite/gas/h8300/movls.s
gas/testsuite/gas/h8300/movw.s
gas/testsuite/gas/h8300/movwh.s
gas/testsuite/gas/h8300/movws.s
gas/testsuite/gas/h8300/pushpop.s
gas/testsuite/gas/h8300/pushpoph.s
gas/testsuite/gas/h8300/pushpops.s
gas/testsuite/gas/h8300/rotsh.s
gas/testsuite/gas/h8300/rotshh.s
gas/testsuite/gas/h8300/rotshs.s
gas/testsuite/gas/hppa/README
gas/testsuite/gas/hppa/basic/weird.s
gas/testsuite/gas/hppa/parse/appbug.s
gas/testsuite/gas/hppa/parse/nosubspace.s
gas/testsuite/gas/hppa/parse/spacebug.s
gas/testsuite/gas/hppa/parse/ssbug.s
gas/testsuite/gas/hppa/reloc/reduce2.s
gas/testsuite/gas/hppa/unsorted/align3.s
gas/testsuite/gas/hppa/unsorted/align4.s
gas/testsuite/gas/hppa/unsorted/globalbug.s
gas/testsuite/gas/hppa/unsorted/ss_align.s
gas/testsuite/gas/ieee-fp/x930509a.s
gas/testsuite/gas/m32r/allinsn.exp
gas/testsuite/gas/m32r/allinsn.s
gas/testsuite/gas/m32r/fslot.d
gas/testsuite/gas/m32r/fslot.s
gas/testsuite/gas/m32r/high-1.s
gas/testsuite/gas/m32r/outofrange.s
gas/testsuite/gas/m32r/relax-1.s
gas/testsuite/gas/m32r/uppercase.s
gas/testsuite/gas/m68k-coff/gas.exp
gas/testsuite/gas/m68k-coff/p2389.s
gas/testsuite/gas/m68k-coff/p2389a.s
gas/testsuite/gas/m68k-coff/p2430.s
gas/testsuite/gas/m68k-coff/p2430a.s
gas/testsuite/gas/m68k-coff/t1.s
gas/testsuite/gas/m68k/bitfield.d
gas/testsuite/gas/m68k/bitfield.s
gas/testsuite/gas/m68k/cas.d
gas/testsuite/gas/m68k/cas.s
gas/testsuite/gas/m68k/disperr.s
gas/testsuite/gas/m68k/fmoveml.d
gas/testsuite/gas/m68k/fmoveml.s
gas/testsuite/gas/m68k/link.d
gas/testsuite/gas/m68k/link.s
gas/testsuite/gas/m68k/op68000.d
gas/testsuite/gas/m68k/operands.d
gas/testsuite/gas/m68k/operands.s
gas/testsuite/gas/m68k/p2410.s
gas/testsuite/gas/m68k/p2663.s
gas/testsuite/gas/m68k/pic1.s
gas/testsuite/gas/m68k/t2.d
gas/testsuite/gas/m68k/t2.s
gas/testsuite/gas/macros/err.s
gas/testsuite/gas/mcore/allinsn.exp
gas/testsuite/gas/mips/abs.s
gas/testsuite/gas/mips/add.s
gas/testsuite/gas/mips/break20.s
gas/testsuite/gas/mips/div.s
gas/testsuite/gas/mips/itbl
gas/testsuite/gas/mips/itbl.s
gas/testsuite/gas/mips/lb.s
gas/testsuite/gas/mips/mips16.s
gas/testsuite/gas/mips/mul.s
gas/testsuite/gas/mips/sb.s
gas/testsuite/gas/mips/trap20.s
gas/testsuite/gas/mips/trunc.s
gas/testsuite/gas/mips/uld.s
gas/testsuite/gas/mips/ulh-pic.s
gas/testsuite/gas/mips/ulh.s
gas/testsuite/gas/mips/ulw.s
gas/testsuite/gas/mips/usd.s
gas/testsuite/gas/mips/ush.s
gas/testsuite/gas/mips/usw.s
gas/testsuite/gas/mn10200/add.s
gas/testsuite/gas/mn10200/bcc.s
gas/testsuite/gas/mn10200/bccx.s
gas/testsuite/gas/mn10200/bit.s
gas/testsuite/gas/mn10200/cmp.s
gas/testsuite/gas/mn10200/ext.s
gas/testsuite/gas/mn10200/logical.s
gas/testsuite/gas/mn10200/mov1.s
gas/testsuite/gas/mn10200/mov2.s
gas/testsuite/gas/mn10200/mov3.s
gas/testsuite/gas/mn10200/mov4.s
gas/testsuite/gas/mn10200/movb.s
gas/testsuite/gas/mn10200/movbu.s
gas/testsuite/gas/mn10200/movx.s
gas/testsuite/gas/mn10200/muldiv.s
gas/testsuite/gas/mn10200/other.s
gas/testsuite/gas/mn10200/shift.s
gas/testsuite/gas/mn10200/sub.s
gas/testsuite/gas/mn10300/add.s
gas/testsuite/gas/mn10300/bcc.s
gas/testsuite/gas/mn10300/bit.s
gas/testsuite/gas/mn10300/cmp.s
gas/testsuite/gas/mn10300/ext.s
gas/testsuite/gas/mn10300/extend.s
gas/testsuite/gas/mn10300/logical.s
gas/testsuite/gas/mn10300/loop.s
gas/testsuite/gas/mn10300/mov1.s
gas/testsuite/gas/mn10300/mov2.s
gas/testsuite/gas/mn10300/mov3.s
gas/testsuite/gas/mn10300/mov4.s
gas/testsuite/gas/mn10300/movbu.s
gas/testsuite/gas/mn10300/movhu.s
gas/testsuite/gas/mn10300/movm.s
gas/testsuite/gas/mn10300/muldiv.s
gas/testsuite/gas/mn10300/other.s
gas/testsuite/gas/mn10300/shift.s
gas/testsuite/gas/mn10300/sub.s
gas/testsuite/gas/mn10300/udf.s
gas/testsuite/gas/mri/char.d
gas/testsuite/gas/mri/char.s
gas/testsuite/gas/mri/comment.d
gas/testsuite/gas/mri/comment.s
gas/testsuite/gas/mri/common.d
gas/testsuite/gas/mri/common.s
gas/testsuite/gas/mri/constants.d
gas/testsuite/gas/mri/constants.s
gas/testsuite/gas/mri/empty.s
gas/testsuite/gas/mri/equ.d
gas/testsuite/gas/mri/equ.s
gas/testsuite/gas/mri/expr.d
gas/testsuite/gas/mri/expr.s
gas/testsuite/gas/mri/float.s
gas/testsuite/gas/mri/for.s
gas/testsuite/gas/mri/if.s
gas/testsuite/gas/mri/immconst.d
gas/testsuite/gas/mri/label.d
gas/testsuite/gas/mri/label.s
gas/testsuite/gas/mri/moveml.s
gas/testsuite/gas/mri/repeat.s
gas/testsuite/gas/mri/semi.d
gas/testsuite/gas/mri/semi.s
gas/testsuite/gas/mri/while.s
gas/testsuite/gas/ppc/astest.s
gas/testsuite/gas/ppc/simpshft.d
gas/testsuite/gas/sh/fp.s
gas/testsuite/gas/sparc-solaris/addend.exp
gas/testsuite/gas/sparc-solaris/addend.s
gas/testsuite/gas/sparc-solaris/gas.exp
gas/testsuite/gas/sparc-solaris/sol-cc.s
gas/testsuite/gas/sparc-solaris/sol-gcc.s
gas/testsuite/gas/sparc/asi.d
gas/testsuite/gas/sparc/asi.s
gas/testsuite/gas/sparc/membar.d
gas/testsuite/gas/sparc/membar.s
gas/testsuite/gas/sparc/mism-1.s
gas/testsuite/gas/sparc/mismatch.exp
gas/testsuite/gas/sparc/prefetch.s
gas/testsuite/gas/sparc/reloc64.s
gas/testsuite/gas/sparc/splet-2.d
gas/testsuite/gas/sparc/splet-2.s
gas/testsuite/gas/sparc/splet.d
gas/testsuite/gas/sparc/splet.s
gas/testsuite/gas/sparc/synth.d
gas/testsuite/gas/sparc/synth.s
gas/testsuite/gas/sun4/addend.d
gas/testsuite/gas/sun4/addend.exp
gas/testsuite/gas/sun4/addend.s
gas/testsuite/gas/template
gas/testsuite/gas/v850/arith.s
gas/testsuite/gas/v850/bit.s
gas/testsuite/gas/v850/branch.s
gas/testsuite/gas/v850/compare.s
gas/testsuite/gas/v850/fepsw.s
gas/testsuite/gas/v850/hilo.s
gas/testsuite/gas/v850/hilo2.s
gas/testsuite/gas/v850/jumps.s
gas/testsuite/gas/v850/logical.s
gas/testsuite/gas/v850/mem.s
gas/testsuite/gas/v850/misc.s
gas/testsuite/gas/v850/move.s
gas/testsuite/gas/v850/range.s
gas/testsuite/gas/v850/reloc.s
gas/testsuite/lib/doboth
gas/testsuite/lib/doobjcmp
gas/testsuite/lib/dostriptest
gas/testsuite/lib/dotest
gas/testsuite/lib/dounsreloc
gas/testsuite/lib/dounssym
gprof/.gdbinit
gprof/TEST
gprof/bsd_callg_bl.m
gprof/flat_bl.m
gprof/fsf_callg_bl.m
gprof/stamp-h.in
include/aout/hppa.h
include/coff/sym.h
include/fopen-bin.h
include/fopen-same.h
include/opcode/tahoe.h
ld/TODO
ld/emulparams/README
ld/emulparams/alpha.sh
ld/emulparams/armcoff.sh
ld/emulparams/delta68.sh
ld/emulparams/h8300h.sh
ld/emulparams/h8300s.sh
ld/emulparams/h8500.sh
ld/emulparams/h8500b.sh
ld/emulparams/h8500c.sh
ld/emulparams/h8500m.sh
ld/emulparams/h8500s.sh
ld/emulparams/hp300bsd.sh
ld/emulparams/hp3hpux.sh
ld/emulparams/i386beos.sh
ld/emulparams/i386coff.sh
ld/emulparams/i386nbsd.sh
ld/emulparams/m68kaux.sh
ld/emulparams/mipsbig.sh
ld/emulparams/mipsbsd.sh
ld/emulparams/mipslit.sh
ld/emulparams/mipslnews.sh
ld/emulparams/news.sh
ld/emulparams/riscix.sh
ld/emulparams/sparcnbsd.sh
ld/emulparams/st2000.sh
ld/emulparams/tic30aout.sh
ld/emulparams/tic30coff.sh
ld/emulparams/w65.sh
ld/emulparams/z8001.sh
ld/emulparams/z8002.sh
ld/emultempl/README
ld/scripttempl/README
ld/scripttempl/aout.sc
ld/scripttempl/i386msdos.sc
ld/scripttempl/i960.sc
ld/scripttempl/m68kcoff.sc
ld/scripttempl/mipsbsd.sc
ld/scripttempl/riscix.sc
ld/scripttempl/st2000.sc
ld/scripttempl/tic30aout.sc
ld/scripttempl/tic30coff.sc
ld/scripttempl/vanilla.sc
ld/stamp-h.in
ld/testsuite/ld-cdtest/cdtest-bar.cc
ld/testsuite/ld-cdtest/cdtest.dat
ld/testsuite/ld-checks/script
ld/testsuite/ld-elfvers/vers13.asym
ld/testsuite/ld-elfvers/vers16.c
ld/testsuite/ld-elfvers/vers16.map
ld/testsuite/ld-elfvers/vers16a.c
ld/testsuite/ld-elfvers/vers2.map
ld/testsuite/ld-elfvers/vers7.map
ld/testsuite/ld-elfvers/vers8.c
ld/testsuite/ld-scripts/cross1.c
ld/testsuite/ld-scripts/cross2.c
ld/testsuite/ld-scripts/cross3.c
ld/testsuite/ld-scripts/defined.t
ld/testsuite/ld-scripts/phdrs.s
ld/testsuite/ld-scripts/script.s
ld/testsuite/ld-scripts/script.t
ld/testsuite/ld-scripts/scriptm.t
ld/testsuite/ld-scripts/sizeof.s
ld/testsuite/ld-scripts/sizeof.t
ld/testsuite/ld-scripts/weak.t
ld/testsuite/ld-selective/1.c
ld/testsuite/ld-selective/2.c
ld/testsuite/ld-sh/sh1.s
ld/testsuite/ld-sh/sh2.c
ld/testsuite/ld-sh/start.s
ld/testsuite/ld-shared/shared.dat
ld/testsuite/ld-shared/sun4.dat
ld/testsuite/ld-shared/xcoff.dat
ld/testsuite/ld-srec/sr1.c
ld/testsuite/ld-srec/sr2.c
ld/testsuite/ld-undefined/undefined.c
ld/testsuite/ld-versados/t1-1.ro
ld/testsuite/ld-versados/t1-2.ro
ld/testsuite/ld-versados/t1.ld
ld/testsuite/ld-versados/t1.ook
ld/testsuite/ld-versados/t2-1.ro
ld/testsuite/ld-versados/t2-2.ro
ld/testsuite/ld-versados/t2-3.ro
ld/testsuite/ld-versados/t2.ld
ld/testsuite/ld-versados/t2.ook
libiberty/config/mh-aix
libiberty/config/mh-cxux7
libiberty/config/mh-fbsd21
libiberty/config/mh-windows
libiberty/msdos.c
makefile.vms
opcodes/stamp-h.in
Delete:
.gitignore
djunpack.bat
gdb/.gitignore
gdb/CONTRIBUTE
gdb/COPYING
gdb/ChangeLog
gdb/ChangeLog-1990
gdb/ChangeLog-1991
gdb/ChangeLog-1992
gdb/ChangeLog-1993
gdb/ChangeLog-1994
gdb/ChangeLog-1995
gdb/ChangeLog-1996
gdb/ChangeLog-1997
gdb/ChangeLog-1998
gdb/ChangeLog-1999
gdb/ChangeLog-2000
gdb/ChangeLog-2001
gdb/ChangeLog-2002
gdb/ChangeLog-2003
gdb/ChangeLog-2004
gdb/ChangeLog-2005
gdb/ChangeLog-2006
gdb/ChangeLog-2007
gdb/ChangeLog-2008
gdb/ChangeLog-2009
gdb/ChangeLog-2010
gdb/ChangeLog-3.x
gdb/MAINTAINERS
gdb/Makefile.in
gdb/NEWS
gdb/PROBLEMS
gdb/README
gdb/acinclude.m4
gdb/aclocal.m4
gdb/ada-exp.y
gdb/ada-lang.c
gdb/ada-lang.h
gdb/ada-lex.l
gdb/ada-operator.def
gdb/ada-tasks.c
gdb/ada-typeprint.c
gdb/ada-valprint.c
gdb/addrmap.c
gdb/addrmap.h
gdb/aix-thread.c
gdb/alpha-linux-nat.c
gdb/alpha-linux-tdep.c
gdb/alpha-mdebug-tdep.c
gdb/alpha-nat.c
gdb/alpha-osf1-tdep.c
gdb/alpha-tdep.c
gdb/alpha-tdep.h
gdb/alphabsd-nat.c
gdb/alphabsd-tdep.c
gdb/alphabsd-tdep.h
gdb/alphafbsd-tdep.c
gdb/alphanbsd-tdep.c
gdb/alphaobsd-tdep.c
gdb/amd64-darwin-tdep.c
gdb/amd64-darwin-tdep.h
gdb/amd64-dicos-tdep.c
gdb/amd64-linux-nat.c
gdb/amd64-linux-tdep.c
gdb/amd64-linux-tdep.h
gdb/amd64-nat.c
gdb/amd64-nat.h
gdb/amd64-sol2-tdep.c
gdb/amd64-tdep.c
gdb/amd64-tdep.h
gdb/amd64-windows-nat.c
gdb/amd64-windows-tdep.c
gdb/amd64bsd-nat.c
gdb/amd64fbsd-nat.c
gdb/amd64fbsd-tdep.c
gdb/amd64nbsd-nat.c
gdb/amd64nbsd-tdep.c
gdb/amd64obsd-nat.c
gdb/amd64obsd-tdep.c
gdb/annotate.c
gdb/annotate.h
gdb/arch-utils.c
gdb/arch-utils.h
gdb/arm-linux-nat.c
gdb/arm-linux-tdep.c
gdb/arm-linux-tdep.h
gdb/arm-symbian-tdep.c
gdb/arm-tdep.c
gdb/arm-tdep.h
gdb/arm-wince-tdep.c
gdb/armbsd-tdep.c
gdb/armnbsd-nat.c
gdb/armnbsd-tdep.c
gdb/armobsd-tdep.c
gdb/auxv.c
gdb/auxv.h
gdb/avr-tdep.c
gdb/ax-gdb.c
gdb/ax-gdb.h
gdb/ax-general.c
gdb/ax.h
gdb/bcache.c
gdb/bcache.h
gdb/bfd-target.c
gdb/bfd-target.h
gdb/bfin-linux-tdep.c
gdb/bfin-tdep.c
gdb/bfin-tdep.h
gdb/block.c
gdb/block.h
gdb/blockframe.c
gdb/breakpoint.c
gdb/breakpoint.h
gdb/bsd-kvm.c
gdb/bsd-kvm.h
gdb/bsd-uthread.c
gdb/bsd-uthread.h
gdb/buildsym.c
gdb/buildsym.h
gdb/c-exp.y
gdb/c-lang.c
gdb/c-lang.h
gdb/c-typeprint.c
gdb/c-valprint.c
gdb/call-cmds.h
gdb/cc-with-index.sh
gdb/charset-list.h
gdb/charset.c
gdb/charset.h
gdb/cli-out.c
gdb/cli-out.h
gdb/cli/cli-cmds.c
gdb/cli/cli-cmds.h
gdb/cli/cli-decode.c
gdb/cli/cli-decode.h
gdb/cli/cli-dump.c
gdb/cli/cli-dump.h
gdb/cli/cli-interp.c
gdb/cli/cli-logging.c
gdb/cli/cli-script.c
gdb/cli/cli-script.h
gdb/cli/cli-setshow.c
gdb/cli/cli-setshow.h
gdb/cli/cli-utils.c
gdb/cli/cli-utils.h
gdb/coff-pe-read.c
gdb/coff-pe-read.h
gdb/coffread.c
gdb/command.h
gdb/common/ax.def
gdb/common/buffer.c
gdb/common/buffer.h
gdb/common/common-utils.c
gdb/common/common-utils.h
gdb/common/gdb_assert.h
gdb/common/gdb_dirent.h
gdb/common/gdb_locale.h
gdb/common/gdb_signals.h
gdb/common/gdb_thread_db.h
gdb/common/i386-xstate.h
gdb/common/linux-osdata.c
gdb/common/linux-osdata.h
gdb/common/linux-procfs.c
gdb/common/linux-procfs.h
gdb/common/linux-ptrace.h
gdb/common/ptid.c
gdb/common/ptid.h
gdb/common/signals.c
gdb/common/xml-utils.c
gdb/common/xml-utils.h
gdb/complaints.c
gdb/complaints.h
gdb/completer.c
gdb/completer.h
gdb/config.in
gdb/config/alpha/alpha-linux.mh
gdb/config/alpha/alpha-osf3.mh
gdb/config/alpha/fbsd.mh
gdb/config/alpha/nbsd.mh
gdb/config/alpha/nm-osf3.h
gdb/config/arm/linux.mh
gdb/config/arm/nbsdaout.mh
gdb/config/arm/nbsdelf.mh
gdb/config/djgpp/README
gdb/config/djgpp/config.sed
gdb/config/djgpp/djcheck.sh
gdb/config/djgpp/djconfig.sh
gdb/config/djgpp/fnchange.lst
gdb/config/djgpp/langinfo.h
gdb/config/djgpp/nl_types.h
gdb/config/i386/cygwin.mh
gdb/config/i386/darwin.mh
gdb/config/i386/fbsd.mh
gdb/config/i386/fbsd64.mh
gdb/config/i386/go32.mh
gdb/config/i386/i386gnu.mh
gdb/config/i386/i386sol2.mh
gdb/config/i386/linux.mh
gdb/config/i386/linux64.mh
gdb/config/i386/mingw.mh
gdb/config/i386/mingw64.mh
gdb/config/i386/nbsd64.mh
gdb/config/i386/nbsdaout.mh
gdb/config/i386/nbsdelf.mh
gdb/config/i386/nm-fbsd.h
gdb/config/i386/nm-i386gnu.h
gdb/config/i386/nto.mh
gdb/config/i386/obsd.mh
gdb/config/i386/obsd64.mh
gdb/config/i386/obsdaout.mh
gdb/config/i386/sol2-64.mh
gdb/config/ia64/hpux.mh
gdb/config/ia64/linux.mh
gdb/config/m32r/linux.mh
gdb/config/m68k/linux.mh
gdb/config/m68k/nbsdaout.mh
gdb/config/m68k/nbsdelf.mh
gdb/config/m68k/obsd.mh
gdb/config/m88k/obsd.mh
gdb/config/mips/irix5.mh
gdb/config/mips/irix6.mh
gdb/config/mips/linux.mh
gdb/config/mips/nbsd.mh
gdb/config/mips/obsd64.mh
gdb/config/nm-linux.h
gdb/config/nm-nto.h
gdb/config/pa/hpux.mh
gdb/config/pa/linux.mh
gdb/config/pa/nbsd.mh
gdb/config/pa/obsd.mh
gdb/config/powerpc/aix.mh
gdb/config/powerpc/linux.mh
gdb/config/powerpc/nbsd.mh
gdb/config/powerpc/obsd.mh
gdb/config/powerpc/ppc64-linux.mh
gdb/config/powerpc/spu-linux.mh
gdb/config/rs6000/nm-rs6000.h
gdb/config/s390/s390.mh
gdb/config/sh/nbsd.mh
gdb/config/sparc/fbsd.mh
gdb/config/sparc/linux.mh
gdb/config/sparc/linux64.mh
gdb/config/sparc/nbsd64.mh
gdb/config/sparc/nbsdaout.mh
gdb/config/sparc/nbsdelf.mh
gdb/config/sparc/nm-sol2.h
gdb/config/sparc/sol2.mh
gdb/config/vax/nbsdaout.mh
gdb/config/vax/nbsdelf.mh
gdb/config/vax/obsd.mh
gdb/config/vax/vax.mh
gdb/config/xtensa/linux.mh
gdb/configure
gdb/configure.ac
gdb/configure.host
gdb/configure.tgt
gdb/continuations.c
gdb/continuations.h
gdb/copying.awk
gdb/copying.c
gdb/copyright.py
gdb/copyright.sh
gdb/core-regset.c
gdb/corefile.c
gdb/corelow.c
gdb/cp-abi.c
gdb/cp-abi.h
gdb/cp-name-parser.y
gdb/cp-namespace.c
gdb/cp-support.c
gdb/cp-support.h
gdb/cp-valprint.c
gdb/cris-tdep.c
gdb/d-lang.c
gdb/d-lang.h
gdb/d-valprint.c
gdb/darwin-nat-info.c
gdb/darwin-nat.c
gdb/darwin-nat.h
gdb/data-directory/Makefile.in
gdb/dbug-rom.c
gdb/dbxread.c
gdb/dcache.c
gdb/dcache.h
gdb/dec-thread.c
gdb/defs.h
gdb/demangle.c
gdb/dfp.c
gdb/dfp.h
gdb/dicos-tdep.c
gdb/dicos-tdep.h
gdb/dictionary.c
gdb/dictionary.h
gdb/dink32-rom.c
gdb/disasm.c
gdb/disasm.h
gdb/doc/ChangeLog
gdb/doc/LRS
gdb/doc/Makefile.in
gdb/doc/a4rc.sed
gdb/doc/agentexpr.texi
gdb/doc/all-cfg.texi
gdb/doc/annotate.texinfo
gdb/doc/fdl.texi
gdb/doc/gdb.texinfo
gdb/doc/gdbint.texinfo
gdb/doc/gpl.texi
gdb/doc/lpsrc.sed
gdb/doc/observer.texi
gdb/doc/psrc.sed
gdb/doc/refcard.tex
gdb/doc/stabs.texinfo
gdb/doc/stack_frame.eps
gdb/doc/stack_frame.pdf
gdb/doc/stack_frame.png
gdb/doc/stack_frame.svg
gdb/doc/stack_frame.txt
gdb/doublest.c
gdb/doublest.h
gdb/dsrec.c
gdb/dummy-frame.c
gdb/dummy-frame.h
gdb/dwarf2-frame.c
gdb/dwarf2-frame.h
gdb/dwarf2expr.c
gdb/dwarf2expr.h
gdb/dwarf2loc.c
gdb/dwarf2loc.h
gdb/dwarf2read.c
gdb/elfread.c
gdb/environ.c
gdb/environ.h
gdb/eval.c
gdb/event-loop.c
gdb/event-loop.h
gdb/event-top.c
gdb/event-top.h
gdb/exc_request.defs
gdb/exceptions.c
gdb/exceptions.h
gdb/exec.c
gdb/exec.h
gdb/expprint.c
gdb/expression.h
gdb/f-exp.y
gdb/f-lang.c
gdb/f-lang.h
gdb/f-typeprint.c
gdb/f-valprint.c
gdb/fbsd-nat.c
gdb/fbsd-nat.h
gdb/features/Makefile
gdb/features/arm-core.xml
gdb/features/arm-fpa.xml
gdb/features/arm-m-profile.xml
gdb/features/arm-vfpv2.xml
gdb/features/arm-vfpv3.xml
gdb/features/arm-with-iwmmxt.c
gdb/features/arm-with-iwmmxt.xml
gdb/features/arm-with-m.c
gdb/features/arm-with-m.xml
gdb/features/arm-with-neon.c
gdb/features/arm-with-neon.xml
gdb/features/arm-with-vfpv2.c
gdb/features/arm-with-vfpv2.xml
gdb/features/arm-with-vfpv3.c
gdb/features/arm-with-vfpv3.xml
gdb/features/feature_to_c.sh
gdb/features/gdb-target.dtd
gdb/features/gdbserver-regs.xsl
gdb/features/i386/32bit-avx.xml
gdb/features/i386/32bit-core.xml
gdb/features/i386/32bit-linux.xml
gdb/features/i386/32bit-sse.xml
gdb/features/i386/64bit-avx.xml
gdb/features/i386/64bit-core.xml
gdb/features/i386/64bit-linux.xml
gdb/features/i386/64bit-sse.xml
gdb/features/i386/amd64-avx-linux.c
gdb/features/i386/amd64-avx-linux.xml
gdb/features/i386/amd64-avx.c
gdb/features/i386/amd64-avx.xml
gdb/features/i386/amd64-linux.c
gdb/features/i386/amd64-linux.xml
gdb/features/i386/amd64.c
gdb/features/i386/amd64.xml
gdb/features/i386/i386-avx-linux.c
gdb/features/i386/i386-avx-linux.xml
gdb/features/i386/i386-avx.c
gdb/features/i386/i386-avx.xml
gdb/features/i386/i386-linux.c
gdb/features/i386/i386-linux.xml
gdb/features/i386/i386-mmx-linux.c
gdb/features/i386/i386-mmx-linux.xml
gdb/features/i386/i386-mmx.c
gdb/features/i386/i386-mmx.xml
gdb/features/i386/i386.c
gdb/features/i386/i386.xml
gdb/features/library-list.dtd
gdb/features/m68k-core.xml
gdb/features/mips-cp0.xml
gdb/features/mips-cpu.xml
gdb/features/mips-fpu.xml
gdb/features/mips-linux.c
gdb/features/mips-linux.xml
gdb/features/mips64-cp0.xml
gdb/features/mips64-cpu.xml
gdb/features/mips64-fpu.xml
gdb/features/mips64-linux.c
gdb/features/mips64-linux.xml
gdb/features/number-regs.xsl
gdb/features/osdata.dtd
gdb/features/rs6000/power-altivec.xml
gdb/features/rs6000/power-core.xml
gdb/features/rs6000/power-fpu-isa205.xml
gdb/features/rs6000/power-fpu.xml
gdb/features/rs6000/power-linux.xml
gdb/features/rs6000/power-oea.xml
gdb/features/rs6000/power-spe.xml
gdb/features/rs6000/power-vsx.xml
gdb/features/rs6000/power64-core.xml
gdb/features/rs6000/power64-linux.xml
gdb/features/rs6000/powerpc-32.c
gdb/features/rs6000/powerpc-32.xml
gdb/features/rs6000/powerpc-32l.c
gdb/features/rs6000/powerpc-32l.xml
gdb/features/rs6000/powerpc-403.c
gdb/features/rs6000/powerpc-403.xml
gdb/features/rs6000/powerpc-403gc.c
gdb/features/rs6000/powerpc-403gc.xml
gdb/features/rs6000/powerpc-405.c
gdb/features/rs6000/powerpc-405.xml
gdb/features/rs6000/powerpc-505.c
gdb/features/rs6000/powerpc-505.xml
gdb/features/rs6000/powerpc-601.c
gdb/features/rs6000/powerpc-601.xml
gdb/features/rs6000/powerpc-602.c
gdb/features/rs6000/powerpc-602.xml
gdb/features/rs6000/powerpc-603.c
gdb/features/rs6000/powerpc-603.xml
gdb/features/rs6000/powerpc-604.c
gdb/features/rs6000/powerpc-604.xml
gdb/features/rs6000/powerpc-64.c
gdb/features/rs6000/powerpc-64.xml
gdb/features/rs6000/powerpc-64l.c
gdb/features/rs6000/powerpc-64l.xml
gdb/features/rs6000/powerpc-7400.c
gdb/features/rs6000/powerpc-7400.xml
gdb/features/rs6000/powerpc-750.c
gdb/features/rs6000/powerpc-750.xml
gdb/features/rs6000/powerpc-860.c
gdb/features/rs6000/powerpc-860.xml
gdb/features/rs6000/powerpc-altivec32.c
gdb/features/rs6000/powerpc-altivec32.xml
gdb/features/rs6000/powerpc-altivec32l.c
gdb/features/rs6000/powerpc-altivec32l.xml
gdb/features/rs6000/powerpc-altivec64.c
gdb/features/rs6000/powerpc-altivec64.xml
gdb/features/rs6000/powerpc-altivec64l.c
gdb/features/rs6000/powerpc-altivec64l.xml
gdb/features/rs6000/powerpc-cell32l.c
gdb/features/rs6000/powerpc-cell32l.xml
gdb/features/rs6000/powerpc-cell64l.c
gdb/features/rs6000/powerpc-cell64l.xml
gdb/features/rs6000/powerpc-e500.c
gdb/features/rs6000/powerpc-e500.xml
gdb/features/rs6000/powerpc-e500l.c
gdb/features/rs6000/powerpc-e500l.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/features/rs6000/powerpc-vsx32.c
gdb/features/rs6000/powerpc-vsx32.xml
gdb/features/rs6000/powerpc-vsx32l.c
gdb/features/rs6000/powerpc-vsx32l.xml
gdb/features/rs6000/powerpc-vsx64.c
gdb/features/rs6000/powerpc-vsx64.xml
gdb/features/rs6000/powerpc-vsx64l.c
gdb/features/rs6000/powerpc-vsx64l.xml
gdb/features/rs6000/rs6000.c
gdb/features/rs6000/rs6000.xml
gdb/features/s390-acr.xml
gdb/features/s390-core32.xml
gdb/features/s390-core64.xml
gdb/features/s390-fpr.xml
gdb/features/s390-linux32.c
gdb/features/s390-linux32.xml
gdb/features/s390-linux64.c
gdb/features/s390-linux64.xml
gdb/features/s390x-core64.xml
gdb/features/s390x-linux64.c
gdb/features/s390x-linux64.xml
gdb/features/sort-regs.xsl
gdb/features/threads.dtd
gdb/features/tic6x-c62x-linux.c
gdb/features/tic6x-c62x-linux.xml
gdb/features/tic6x-c62x.c
gdb/features/tic6x-c62x.xml
gdb/features/tic6x-c64x-linux.c
gdb/features/tic6x-c64x-linux.xml
gdb/features/tic6x-c64x.c
gdb/features/tic6x-c64x.xml
gdb/features/tic6x-c64xp-linux.c
gdb/features/tic6x-c64xp-linux.xml
gdb/features/tic6x-c64xp.c
gdb/features/tic6x-c64xp.xml
gdb/features/tic6x-c6xp.xml
gdb/features/tic6x-core.xml
gdb/features/tic6x-gp.xml
gdb/features/traceframe-info.dtd
gdb/features/xinclude.dtd
gdb/features/xscale-iwmmxt.xml
gdb/filesystem.c
gdb/filesystem.h
gdb/findcmd.c
gdb/findvar.c
gdb/fork-child.c
gdb/frame-base.c
gdb/frame-base.h
gdb/frame-unwind.c
gdb/frame-unwind.h
gdb/frame.c
gdb/frame.h
gdb/frv-linux-tdep.c
gdb/frv-tdep.c
gdb/frv-tdep.h
gdb/gcore.c
gdb/gcore.h
gdb/gdb-gdb.py
gdb/gdb-stabs.h
gdb/gdb.1
gdb/gdb.c
gdb/gdb.gdb
gdb/gdb.h
gdb/gdb_buildall.sh
gdb/gdb_curses.h
gdb/gdb_expat.h
gdb/gdb_gcore.sh
gdb/gdb_indent.sh
gdb/gdb_mbuild.sh
gdb/gdb_obstack.h
gdb/gdb_proc_service.h
gdb/gdb_ptrace.h
gdb/gdb_regex.h
gdb/gdb_select.h
gdb/gdb_stat.h
gdb/gdb_string.h
gdb/gdb_usleep.c
gdb/gdb_usleep.h
gdb/gdb_vfork.h
gdb/gdb_wait.h
gdb/gdb_wchar.h
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/gdbcmd.h
gdb/gdbcore.h
gdb/gdbinit.in
gdb/gdbserver/.gitignore
gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in
gdb/gdbserver/README
gdb/gdbserver/acinclude.m4
gdb/gdbserver/aclocal.m4
gdb/gdbserver/config.in
gdb/gdbserver/configure
gdb/gdbserver/configure.ac
gdb/gdbserver/configure.srv
gdb/gdbserver/event-loop.c
gdb/gdbserver/gdb_proc_service.h
gdb/gdbserver/gdbreplay.c
gdb/gdbserver/gdbserver.1
gdb/gdbserver/hostio-errno.c
gdb/gdbserver/hostio.c
gdb/gdbserver/i386-low.c
gdb/gdbserver/i386-low.h
gdb/gdbserver/i387-fp.c
gdb/gdbserver/i387-fp.h
gdb/gdbserver/inferiors.c
gdb/gdbserver/linux-amd64-ipa.c
gdb/gdbserver/linux-arm-low.c
gdb/gdbserver/linux-bfin-low.c
gdb/gdbserver/linux-cris-low.c
gdb/gdbserver/linux-crisv32-low.c
gdb/gdbserver/linux-i386-ipa.c
gdb/gdbserver/linux-ia64-low.c
gdb/gdbserver/linux-low.c
gdb/gdbserver/linux-low.h
gdb/gdbserver/linux-m32r-low.c
gdb/gdbserver/linux-m68k-low.c
gdb/gdbserver/linux-mips-low.c
gdb/gdbserver/linux-ppc-low.c
gdb/gdbserver/linux-s390-low.c
gdb/gdbserver/linux-sh-low.c
gdb/gdbserver/linux-sparc-low.c
gdb/gdbserver/linux-tic6x-low.c
gdb/gdbserver/linux-x86-low.c
gdb/gdbserver/linux-xtensa-low.c
gdb/gdbserver/lynx-i386-low.c
gdb/gdbserver/lynx-low.c
gdb/gdbserver/lynx-low.h
gdb/gdbserver/lynx-ppc-low.c
gdb/gdbserver/mem-break.c
gdb/gdbserver/mem-break.h
gdb/gdbserver/nto-low.c
gdb/gdbserver/nto-low.h
gdb/gdbserver/nto-x86-low.c
gdb/gdbserver/proc-service.c
gdb/gdbserver/proc-service.list
gdb/gdbserver/regcache.c
gdb/gdbserver/regcache.h
gdb/gdbserver/remote-utils.c
gdb/gdbserver/server.c
gdb/gdbserver/server.h
gdb/gdbserver/spu-low.c
gdb/gdbserver/target.c
gdb/gdbserver/target.h
gdb/gdbserver/terminal.h
gdb/gdbserver/thread-db.c
gdb/gdbserver/tracepoint.c
gdb/gdbserver/utils.c
gdb/gdbserver/win32-arm-low.c
gdb/gdbserver/win32-i386-low.c
gdb/gdbserver/win32-low.c
gdb/gdbserver/win32-low.h
gdb/gdbserver/wincecompat.c
gdb/gdbserver/wincecompat.h
gdb/gdbserver/xtensa-xtregs.c
gdb/gdbthread.h
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/glibc-tdep.c
gdb/glibc-tdep.h
gdb/gnu-nat.c
gdb/gnu-nat.h
gdb/gnu-v2-abi.c
gdb/gnu-v3-abi.c
gdb/gnulib/Makefile.am
gdb/gnulib/Makefile.in
gdb/gnulib/dummy.c
gdb/gnulib/extra/arg-nonnull.h
gdb/gnulib/extra/c++defs.h
gdb/gnulib/extra/warn-on-use.h
gdb/gnulib/m4/00gnulib.m4
gdb/gnulib/m4/extensions.m4
gdb/gnulib/m4/gnulib-cache.m4
gdb/gnulib/m4/gnulib-common.m4
gdb/gnulib/m4/gnulib-comp.m4
gdb/gnulib/m4/gnulib-tool.m4
gdb/gnulib/m4/include_next.m4
gdb/gnulib/m4/longlong.m4
gdb/gnulib/m4/memchr.m4
gdb/gnulib/m4/memmem.m4
gdb/gnulib/m4/mmap-anon.m4
gdb/gnulib/m4/multiarch.m4
gdb/gnulib/m4/onceonly.m4
gdb/gnulib/m4/stddef_h.m4
gdb/gnulib/m4/stdint.m4
gdb/gnulib/m4/string_h.m4
gdb/gnulib/m4/warn-on-use.m4
gdb/gnulib/m4/wchar_h.m4
gdb/gnulib/m4/wchar_t.m4
gdb/gnulib/m4/wint_t.m4
gdb/gnulib/memchr.c
gdb/gnulib/memchr.valgrind
gdb/gnulib/memmem.c
gdb/gnulib/stddef.in.h
gdb/gnulib/stdint.in.h
gdb/gnulib/str-two-way.h
gdb/gnulib/string.in.h
gdb/gnulib/wchar.in.h
gdb/go32-nat.c
gdb/gregset.h
gdb/h8300-tdep.c
gdb/hppa-hpux-nat.c
gdb/hppa-hpux-tdep.c
gdb/hppa-linux-nat.c
gdb/hppa-linux-offsets.h
gdb/hppa-linux-tdep.c
gdb/hppa-tdep.c
gdb/hppa-tdep.h
gdb/hppabsd-nat.c
gdb/hppabsd-tdep.c
gdb/hppabsd-tdep.h
gdb/hppanbsd-nat.c
gdb/hppanbsd-tdep.c
gdb/hppaobsd-tdep.c
gdb/i386-cygwin-tdep.c
gdb/i386-darwin-nat.c
gdb/i386-darwin-tdep.c
gdb/i386-darwin-tdep.h
gdb/i386-dicos-tdep.c
gdb/i386-linux-nat.c
gdb/i386-linux-tdep.c
gdb/i386-linux-tdep.h
gdb/i386-nat.c
gdb/i386-nat.h
gdb/i386-nto-tdep.c
gdb/i386-sol2-nat.c
gdb/i386-sol2-tdep.c
gdb/i386-stub.c
gdb/i386-tdep.c
gdb/i386-tdep.h
gdb/i386-windows-nat.c
gdb/i386bsd-nat.c
gdb/i386bsd-nat.h
gdb/i386bsd-tdep.c
gdb/i386fbsd-nat.c
gdb/i386fbsd-tdep.c
gdb/i386gnu-nat.c
gdb/i386gnu-tdep.c
gdb/i386nbsd-nat.c
gdb/i386nbsd-tdep.c
gdb/i386obsd-nat.c
gdb/i386obsd-tdep.c
gdb/i386v4-nat.c
gdb/i387-tdep.c
gdb/i387-tdep.h
gdb/ia64-hpux-nat.c
gdb/ia64-hpux-tdep.c
gdb/ia64-hpux-tdep.h
gdb/ia64-linux-nat.c
gdb/ia64-linux-tdep.c
gdb/ia64-tdep.c
gdb/ia64-tdep.h
gdb/inf-child.c
gdb/inf-child.h
gdb/inf-loop.c
gdb/inf-loop.h
gdb/inf-ptrace.c
gdb/inf-ptrace.h
gdb/inf-ttrace.c
gdb/inf-ttrace.h
gdb/infcall.c
gdb/infcall.h
gdb/infcmd.c
gdb/inferior.c
gdb/inferior.h
gdb/inflow.c
gdb/inflow.h
gdb/infrun.c
gdb/inline-frame.c
gdb/inline-frame.h
gdb/interps.c
gdb/interps.h
gdb/iq2000-tdep.c
gdb/irix5-nat.c
gdb/jit.c
gdb/jit.h
gdb/jv-exp.y
gdb/jv-lang.c
gdb/jv-lang.h
gdb/jv-typeprint.c
gdb/jv-valprint.c
gdb/language.c
gdb/language.h
gdb/libunwind-frame.c
gdb/libunwind-frame.h
gdb/linespec.c
gdb/linespec.h
gdb/linux-fork.c
gdb/linux-fork.h
gdb/linux-nat.c
gdb/linux-nat.h
gdb/linux-record.c
gdb/linux-record.h
gdb/linux-tdep.c
gdb/linux-tdep.h
gdb/linux-thread-db.c
gdb/lm32-tdep.c
gdb/m2-exp.y
gdb/m2-lang.c
gdb/m2-lang.h
gdb/m2-typeprint.c
gdb/m2-valprint.c
gdb/m32c-tdep.c
gdb/m32r-linux-nat.c
gdb/m32r-linux-tdep.c
gdb/m32r-rom.c
gdb/m32r-stub.c
gdb/m32r-tdep.c
gdb/m32r-tdep.h
gdb/m68hc11-tdep.c
gdb/m68k-stub.c
gdb/m68k-tdep.c
gdb/m68k-tdep.h
gdb/m68kbsd-nat.c
gdb/m68kbsd-tdep.c
gdb/m68klinux-nat.c
gdb/m68klinux-tdep.c
gdb/m88k-tdep.c
gdb/m88k-tdep.h
gdb/m88kbsd-nat.c
gdb/machoread.c
gdb/macrocmd.c
gdb/macroexp.c
gdb/macroexp.h
gdb/macroscope.c
gdb/macroscope.h
gdb/macrotab.c
gdb/macrotab.h
gdb/main.c
gdb/main.h
gdb/maint.c
gdb/mdebugread.c
gdb/mdebugread.h
gdb/mem-break.c
gdb/memattr.c
gdb/memattr.h
gdb/memory-map.c
gdb/memory-map.h
gdb/memrange.c
gdb/memrange.h
gdb/mep-tdep.c
gdb/mi/ChangeLog-1999-2003
gdb/mi/mi-cmd-break.c
gdb/mi/mi-cmd-disas.c
gdb/mi/mi-cmd-env.c
gdb/mi/mi-cmd-file.c
gdb/mi/mi-cmd-stack.c
gdb/mi/mi-cmd-target.c
gdb/mi/mi-cmd-var.c
gdb/mi/mi-cmds.c
gdb/mi/mi-cmds.h
gdb/mi/mi-common.c
gdb/mi/mi-common.h
gdb/mi/mi-console.c
gdb/mi/mi-console.h
gdb/mi/mi-getopt.c
gdb/mi/mi-getopt.h
gdb/mi/mi-interp.c
gdb/mi/mi-main.c
gdb/mi/mi-main.h
gdb/mi/mi-out.c
gdb/mi/mi-out.h
gdb/mi/mi-parse.c
gdb/mi/mi-parse.h
gdb/mi/mi-symbol-cmds.c
gdb/microblaze-linux-tdep.c
gdb/microblaze-rom.c
gdb/microblaze-tdep.c
gdb/microblaze-tdep.h
gdb/mingw-hdep.c
gdb/minsyms.c
gdb/mips-irix-tdep.c
gdb/mips-linux-nat.c
gdb/mips-linux-tdep.c
gdb/mips-linux-tdep.h
gdb/mips-tdep.c
gdb/mips-tdep.h
gdb/mips64obsd-nat.c
gdb/mips64obsd-tdep.c
gdb/mipsnbsd-nat.c
gdb/mipsnbsd-tdep.c
gdb/mipsnbsd-tdep.h
gdb/mipsread.c
gdb/mn10300-linux-tdep.c
gdb/mn10300-tdep.c
gdb/mn10300-tdep.h
gdb/monitor.c
gdb/monitor.h
gdb/moxie-tdep.c
gdb/moxie-tdep.h
gdb/msg.defs
gdb/msg_reply.defs
gdb/mt-tdep.c
gdb/nbsd-nat.c
gdb/nbsd-nat.h
gdb/nbsd-tdep.c
gdb/nbsd-tdep.h
gdb/notify.defs
gdb/nto-procfs.c
gdb/nto-tdep.c
gdb/nto-tdep.h
gdb/objc-exp.y
gdb/objc-lang.c
gdb/objc-lang.h
gdb/objfiles.c
gdb/objfiles.h
gdb/obsd-tdep.c
gdb/obsd-tdep.h
gdb/observer.c
gdb/observer.sh
gdb/opencl-lang.c
gdb/osabi.c
gdb/osabi.h
gdb/osdata.c
gdb/osdata.h
gdb/osf-share/AT386/cma_thread_io.h
gdb/osf-share/HP800/cma_thread_io.h
gdb/osf-share/README
gdb/osf-share/RIOS/cma_thread_io.h
gdb/osf-share/cma_attr.h
gdb/osf-share/cma_deb_core.h
gdb/osf-share/cma_debug_client.h
gdb/osf-share/cma_errors.h
gdb/osf-share/cma_handle.h
gdb/osf-share/cma_init.h
gdb/osf-share/cma_list.h
gdb/osf-share/cma_mutex.h
gdb/osf-share/cma_sched.h
gdb/osf-share/cma_semaphore_defs.h
gdb/osf-share/cma_sequence.h
gdb/osf-share/cma_stack.h
gdb/osf-share/cma_stack_int.h
gdb/osf-share/cma_tcb_defs.h
gdb/osf-share/cma_util.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/parser-defs.h
gdb/po/gdbtext
gdb/posix-hdep.c
gdb/ppc-linux-nat.c
gdb/ppc-linux-tdep.c
gdb/ppc-linux-tdep.h
gdb/ppc-sysv-tdep.c
gdb/ppc-tdep.h
gdb/ppcbug-rom.c
gdb/ppcnbsd-nat.c
gdb/ppcnbsd-tdep.c
gdb/ppcnbsd-tdep.h
gdb/ppcobsd-nat.c
gdb/ppcobsd-tdep.c
gdb/ppcobsd-tdep.h
gdb/printcmd.c
gdb/proc-api.c
gdb/proc-events.c
gdb/proc-flags.c
gdb/proc-service.c
gdb/proc-service.list
gdb/proc-utils.h
gdb/proc-why.c
gdb/process_reply.defs
gdb/procfs.c
gdb/procfs.h
gdb/progspace.c
gdb/progspace.h
gdb/prologue-value.c
gdb/prologue-value.h
gdb/psympriv.h
gdb/psymtab.c
gdb/psymtab.h
gdb/python/lib/gdb/__init__.py
gdb/python/lib/gdb/command/__init__.py
gdb/python/lib/gdb/command/pretty_printers.py
gdb/python/lib/gdb/command/prompt.py
gdb/python/lib/gdb/printing.py
gdb/python/lib/gdb/prompt.py
gdb/python/lib/gdb/types.py
gdb/python/py-auto-load.c
gdb/python/py-block.c
gdb/python/py-bpevent.c
gdb/python/py-breakpoint.c
gdb/python/py-cmd.c
gdb/python/py-continueevent.c
gdb/python/py-event.c
gdb/python/py-event.h
gdb/python/py-events.h
gdb/python/py-evtregistry.c
gdb/python/py-evts.c
gdb/python/py-exitedevent.c
gdb/python/py-frame.c
gdb/python/py-function.c
gdb/python/py-inferior.c
gdb/python/py-infthread.c
gdb/python/py-lazy-string.c
gdb/python/py-objfile.c
gdb/python/py-param.c
gdb/python/py-prettyprint.c
gdb/python/py-progspace.c
gdb/python/py-signalevent.c
gdb/python/py-stopevent.c
gdb/python/py-stopevent.h
gdb/python/py-symbol.c
gdb/python/py-symtab.c
gdb/python/py-threadevent.c
gdb/python/py-type.c
gdb/python/py-utils.c
gdb/python/py-value.c
gdb/python/python-config.py
gdb/python/python-internal.h
gdb/python/python.c
gdb/python/python.h
gdb/ravenscar-sparc-thread.c
gdb/ravenscar-thread.c
gdb/ravenscar-thread.h
gdb/record.c
gdb/record.h
gdb/regcache.c
gdb/regcache.h
gdb/regformats/arm-with-iwmmxt.dat
gdb/regformats/arm-with-neon.dat
gdb/regformats/arm-with-vfpv2.dat
gdb/regformats/arm-with-vfpv3.dat
gdb/regformats/i386/amd64-avx-linux.dat
gdb/regformats/i386/amd64-avx.dat
gdb/regformats/i386/amd64-linux.dat
gdb/regformats/i386/amd64.dat
gdb/regformats/i386/i386-avx-linux.dat
gdb/regformats/i386/i386-avx.dat
gdb/regformats/i386/i386-linux.dat
gdb/regformats/i386/i386-mmx-linux.dat
gdb/regformats/i386/i386-mmx.dat
gdb/regformats/i386/i386.dat
gdb/regformats/mips-linux.dat
gdb/regformats/mips64-linux.dat
gdb/regformats/reg-arm.dat
gdb/regformats/reg-bfin.dat
gdb/regformats/reg-cf.dat
gdb/regformats/reg-cris.dat
gdb/regformats/reg-crisv32.dat
gdb/regformats/reg-ia64.dat
gdb/regformats/reg-m32r.dat
gdb/regformats/reg-m68k.dat
gdb/regformats/reg-sh.dat
gdb/regformats/reg-sparc64.dat
gdb/regformats/reg-spu.dat
gdb/regformats/reg-xtensa.dat
gdb/regformats/regdat.sh
gdb/regformats/regdef.h
gdb/regformats/rs6000/powerpc-32.dat
gdb/regformats/rs6000/powerpc-32l.dat
gdb/regformats/rs6000/powerpc-64l.dat
gdb/regformats/rs6000/powerpc-altivec32l.dat
gdb/regformats/rs6000/powerpc-altivec64l.dat
gdb/regformats/rs6000/powerpc-cell32l.dat
gdb/regformats/rs6000/powerpc-cell64l.dat
gdb/regformats/rs6000/powerpc-e500l.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/regformats/rs6000/powerpc-vsx32l.dat
gdb/regformats/rs6000/powerpc-vsx64l.dat
gdb/regformats/s390-linux32.dat
gdb/regformats/s390-linux64.dat
gdb/regformats/s390x-linux64.dat
gdb/regformats/tic6x-c62x-linux.dat
gdb/regformats/tic6x-c62x.dat
gdb/regformats/tic6x-c64x-linux.dat
gdb/regformats/tic6x-c64x.dat
gdb/regformats/tic6x-c64xp-linux.dat
gdb/regformats/tic6x-c64xp.dat
gdb/reggroups.c
gdb/reggroups.h
gdb/regset.c
gdb/regset.h
gdb/remote-fileio.c
gdb/remote-fileio.h
gdb/remote-m32r-sdi.c
gdb/remote-mips.c
gdb/remote-sim.c
gdb/remote.c
gdb/remote.h
gdb/reply_mig_hack.awk
gdb/reverse.c
gdb/rs6000-aix-tdep.c
gdb/rs6000-nat.c
gdb/rs6000-tdep.c
gdb/rs6000-tdep.h
gdb/rx-tdep.c
gdb/s390-nat.c
gdb/s390-tdep.c
gdb/s390-tdep.h
gdb/score-tdep.c
gdb/score-tdep.h
gdb/sentinel-frame.c
gdb/sentinel-frame.h
gdb/ser-base.c
gdb/ser-base.h
gdb/ser-go32.c
gdb/ser-mingw.c
gdb/ser-pipe.c
gdb/ser-tcp.c
gdb/ser-tcp.h
gdb/ser-unix.c
gdb/ser-unix.h
gdb/serial.c
gdb/serial.h
gdb/sh-linux-tdep.c
gdb/sh-stub.c
gdb/sh-tdep.c
gdb/sh-tdep.h
gdb/sh64-tdep.c
gdb/shnbsd-nat.c
gdb/shnbsd-tdep.c
gdb/sim-regno.h
gdb/sol-thread.c
gdb/sol2-tdep.c
gdb/sol2-tdep.h
gdb/solib-darwin.c
gdb/solib-darwin.h
gdb/solib-dsbt.c
gdb/solib-frv.c
gdb/solib-ia64-hpux.c
gdb/solib-ia64-hpux.h
gdb/solib-irix.c
gdb/solib-irix.h
gdb/solib-osf.c
gdb/solib-pa64.c
gdb/solib-pa64.h
gdb/solib-som.c
gdb/solib-som.h
gdb/solib-spu.c
gdb/solib-spu.h
gdb/solib-sunos.c
gdb/solib-svr4.c
gdb/solib-svr4.h
gdb/solib-target.c
gdb/solib-target.h
gdb/solib.c
gdb/solib.h
gdb/solist.h
gdb/somread.c
gdb/source.c
gdb/source.h
gdb/sparc-linux-nat.c
gdb/sparc-linux-tdep.c
gdb/sparc-nat.c
gdb/sparc-nat.h
gdb/sparc-sol2-nat.c
gdb/sparc-sol2-tdep.c
gdb/sparc-stub.c
gdb/sparc-tdep.c
gdb/sparc-tdep.h
gdb/sparc64-linux-nat.c
gdb/sparc64-linux-tdep.c
gdb/sparc64-nat.c
gdb/sparc64-sol2-tdep.c
gdb/sparc64-tdep.c
gdb/sparc64-tdep.h
gdb/sparc64fbsd-nat.c
gdb/sparc64fbsd-tdep.c
gdb/sparc64nbsd-nat.c
gdb/sparc64nbsd-tdep.c
gdb/sparc64obsd-tdep.c
gdb/sparcnbsd-nat.c
gdb/sparcnbsd-tdep.c
gdb/sparcobsd-tdep.c
gdb/spu-linux-nat.c
gdb/spu-multiarch.c
gdb/spu-tdep.c
gdb/spu-tdep.h
gdb/srec.h
gdb/stabsread.c
gdb/stabsread.h
gdb/stack.c
gdb/stack.h
gdb/std-operator.def
gdb/std-regs.c
gdb/symfile-mem.c
gdb/symfile.c
gdb/symfile.h
gdb/symmisc.c
gdb/symtab.c
gdb/symtab.h
gdb/syscalls/amd64-linux.xml
gdb/syscalls/bfin-linux.xml
gdb/syscalls/gdb-syscalls.dtd
gdb/syscalls/i386-linux.xml
gdb/syscalls/mips-n32-linux.xml
gdb/syscalls/mips-n64-linux.xml
gdb/syscalls/mips-o32-linux.xml
gdb/syscalls/ppc-linux.xml
gdb/syscalls/ppc64-linux.xml
gdb/syscalls/sparc-linux.xml
gdb/syscalls/sparc64-linux.xml
gdb/target-descriptions.c
gdb/target-descriptions.h
gdb/target-memory.c
gdb/target.c
gdb/target.h
gdb/terminal.h
gdb/testsuite/.gdbinit
gdb/testsuite/ChangeLog
gdb/testsuite/Makefile.in
gdb/testsuite/TODO
gdb/testsuite/aclocal.m4
gdb/testsuite/config/arm-ice.exp
gdb/testsuite/config/bfin.exp
gdb/testsuite/config/cfdbug.exp
gdb/testsuite/config/cygmon.exp
gdb/testsuite/config/d10v.exp
gdb/testsuite/config/default.exp
gdb/testsuite/config/dve.exp
gdb/testsuite/config/gdbserver.exp
gdb/testsuite/config/h8300.exp
gdb/testsuite/config/i386-bozo.exp
gdb/testsuite/config/i960.exp
gdb/testsuite/config/m32r-stub.exp
gdb/testsuite/config/m32r.exp
gdb/testsuite/config/mips-idt.exp
gdb/testsuite/config/mips.exp
gdb/testsuite/config/mn10300-eval.exp
gdb/testsuite/config/monitor.exp
gdb/testsuite/config/proelf.exp
gdb/testsuite/config/rom68k.exp
gdb/testsuite/config/sh.exp
gdb/testsuite/config/sid.exp
gdb/testsuite/config/sim.exp
gdb/testsuite/config/slite.exp
gdb/testsuite/config/unix.exp
gdb/testsuite/config/vr4300.exp
gdb/testsuite/config/vr5000.exp
gdb/testsuite/config/vx.exp
gdb/testsuite/config/vxworks.exp
gdb/testsuite/config/vxworks29k.exp
gdb/testsuite/configure
gdb/testsuite/configure.ac
gdb/testsuite/dg-extract-results.sh
gdb/testsuite/gdb.ada/Makefile.in
gdb/testsuite/gdb.ada/array_bounds.exp
gdb/testsuite/gdb.ada/array_bounds/bar.adb
gdb/testsuite/gdb.ada/array_return.exp
gdb/testsuite/gdb.ada/array_return/p.adb
gdb/testsuite/gdb.ada/array_return/pck.adb
gdb/testsuite/gdb.ada/array_return/pck.ads
gdb/testsuite/gdb.ada/array_subscript_addr.exp
gdb/testsuite/gdb.ada/array_subscript_addr/p.adb
gdb/testsuite/gdb.ada/arrayidx.exp
gdb/testsuite/gdb.ada/arrayidx/p.adb
gdb/testsuite/gdb.ada/arrayparam.exp
gdb/testsuite/gdb.ada/arrayparam/foo.adb
gdb/testsuite/gdb.ada/arrayparam/pck.adb
gdb/testsuite/gdb.ada/arrayparam/pck.ads
gdb/testsuite/gdb.ada/arrayptr.exp
gdb/testsuite/gdb.ada/arrayptr/foo.adb
gdb/testsuite/gdb.ada/arrayptr/pck.adb
gdb/testsuite/gdb.ada/arrayptr/pck.ads
gdb/testsuite/gdb.ada/assign_1.exp
gdb/testsuite/gdb.ada/atomic_enum.exp
gdb/testsuite/gdb.ada/atomic_enum/foo.adb
gdb/testsuite/gdb.ada/atomic_enum/pck.adb
gdb/testsuite/gdb.ada/atomic_enum/pck.ads
gdb/testsuite/gdb.ada/boolean_expr.exp
gdb/testsuite/gdb.ada/call_pn.exp
gdb/testsuite/gdb.ada/call_pn/foo.adb
gdb/testsuite/gdb.ada/call_pn/pck.adb
gdb/testsuite/gdb.ada/call_pn/pck.ads
gdb/testsuite/gdb.ada/catch_ex.exp
gdb/testsuite/gdb.ada/catch_ex/foo.adb
gdb/testsuite/gdb.ada/char_enum.exp
gdb/testsuite/gdb.ada/char_enum/foo.adb
gdb/testsuite/gdb.ada/char_enum/pck.adb
gdb/testsuite/gdb.ada/char_enum/pck.ads
gdb/testsuite/gdb.ada/char_param.exp
gdb/testsuite/gdb.ada/char_param/foo.adb
gdb/testsuite/gdb.ada/char_param/pck.adb
gdb/testsuite/gdb.ada/char_param/pck.ads
gdb/testsuite/gdb.ada/complete.exp
gdb/testsuite/gdb.ada/complete/foo.adb
gdb/testsuite/gdb.ada/complete/pck.adb
gdb/testsuite/gdb.ada/complete/pck.ads
gdb/testsuite/gdb.ada/cond_lang.exp
gdb/testsuite/gdb.ada/cond_lang/a.adb
gdb/testsuite/gdb.ada/cond_lang/foo.c
gdb/testsuite/gdb.ada/cond_lang/mixed.adb
gdb/testsuite/gdb.ada/cond_lang/mixed.ads
gdb/testsuite/gdb.ada/cond_lang/pck.adb
gdb/testsuite/gdb.ada/cond_lang/pck.ads
gdb/testsuite/gdb.ada/dyn_loc.exp
gdb/testsuite/gdb.ada/dyn_loc/p.adb
gdb/testsuite/gdb.ada/dyn_loc/pack.adb
gdb/testsuite/gdb.ada/dyn_loc/pack.ads
gdb/testsuite/gdb.ada/exec_changed.exp
gdb/testsuite/gdb.ada/exec_changed/first.adb
gdb/testsuite/gdb.ada/exec_changed/second.adb
gdb/testsuite/gdb.ada/exprs.exp
gdb/testsuite/gdb.ada/exprs/p.adb
gdb/testsuite/gdb.ada/fixed_cmp.exp
gdb/testsuite/gdb.ada/fixed_cmp/fixed.adb
gdb/testsuite/gdb.ada/fixed_cmp/pck.adb
gdb/testsuite/gdb.ada/fixed_cmp/pck.ads
gdb/testsuite/gdb.ada/fixed_points.exp
gdb/testsuite/gdb.ada/fixed_points/fixed_points.adb
gdb/testsuite/gdb.ada/formatted_ref.exp
gdb/testsuite/gdb.ada/formatted_ref/defs.adb
gdb/testsuite/gdb.ada/formatted_ref/defs.ads
gdb/testsuite/gdb.ada/formatted_ref/formatted_ref.adb
gdb/testsuite/gdb.ada/frame_args.exp
gdb/testsuite/gdb.ada/frame_args/foo.adb
gdb/testsuite/gdb.ada/frame_args/pck.adb
gdb/testsuite/gdb.ada/frame_args/pck.ads
gdb/testsuite/gdb.ada/fun_addr.exp
gdb/testsuite/gdb.ada/fun_addr/foo.adb
gdb/testsuite/gdb.ada/fun_in_declare.exp
gdb/testsuite/gdb.ada/fun_in_declare/foo.adb
gdb/testsuite/gdb.ada/fun_in_declare/pck.adb
gdb/testsuite/gdb.ada/fun_in_declare/pck.ads
gdb/testsuite/gdb.ada/funcall_param.exp
gdb/testsuite/gdb.ada/funcall_param/foo.adb
gdb/testsuite/gdb.ada/funcall_param/pck.adb
gdb/testsuite/gdb.ada/funcall_param/pck.ads
gdb/testsuite/gdb.ada/gnat_ada.gpr
gdb/testsuite/gdb.ada/homonym.exp
gdb/testsuite/gdb.ada/homonym/homonym.adb
gdb/testsuite/gdb.ada/homonym/homonym.ads
gdb/testsuite/gdb.ada/homonym/homonym_main.adb
gdb/testsuite/gdb.ada/info_types.c
gdb/testsuite/gdb.ada/info_types.exp
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/interface.exp
gdb/testsuite/gdb.ada/interface/foo.adb
gdb/testsuite/gdb.ada/interface/types.adb
gdb/testsuite/gdb.ada/interface/types.ads
gdb/testsuite/gdb.ada/lang_switch.exp
gdb/testsuite/gdb.ada/lang_switch/foo.c
gdb/testsuite/gdb.ada/lang_switch/lang_switch.adb
gdb/testsuite/gdb.ada/mi_catch_ex.exp
gdb/testsuite/gdb.ada/mi_catch_ex/foo.adb
gdb/testsuite/gdb.ada/mod_from_name.exp
gdb/testsuite/gdb.ada/mod_from_name/foo.adb
gdb/testsuite/gdb.ada/nested.exp
gdb/testsuite/gdb.ada/nested/hello.adb
gdb/testsuite/gdb.ada/null_array.exp
gdb/testsuite/gdb.ada/null_array/foo.adb
gdb/testsuite/gdb.ada/null_array/pck.adb
gdb/testsuite/gdb.ada/null_array/pck.ads
gdb/testsuite/gdb.ada/null_record.exp
gdb/testsuite/gdb.ada/null_record/bar.adb
gdb/testsuite/gdb.ada/null_record/bar.ads
gdb/testsuite/gdb.ada/null_record/null_record.adb
gdb/testsuite/gdb.ada/packed_array.exp
gdb/testsuite/gdb.ada/packed_array/pa.adb
gdb/testsuite/gdb.ada/packed_array/pck.adb
gdb/testsuite/gdb.ada/packed_array/pck.ads
gdb/testsuite/gdb.ada/packed_tagged.exp
gdb/testsuite/gdb.ada/packed_tagged/comp_bug.adb
gdb/testsuite/gdb.ada/print_chars.exp
gdb/testsuite/gdb.ada/print_chars/foo.adb
gdb/testsuite/gdb.ada/print_chars/pck.adb
gdb/testsuite/gdb.ada/print_chars/pck.ads
gdb/testsuite/gdb.ada/print_pc.exp
gdb/testsuite/gdb.ada/ptr_typedef.exp
gdb/testsuite/gdb.ada/ptr_typedef/foo.adb
gdb/testsuite/gdb.ada/ptr_typedef/pck.adb
gdb/testsuite/gdb.ada/ptr_typedef/pck.ads
gdb/testsuite/gdb.ada/ptype_arith_binop.exp
gdb/testsuite/gdb.ada/ptype_field.exp
gdb/testsuite/gdb.ada/ptype_field/foo.adb
gdb/testsuite/gdb.ada/ptype_field/pck.adb
gdb/testsuite/gdb.ada/ptype_field/pck.ads
gdb/testsuite/gdb.ada/ptype_tagged_param.exp
gdb/testsuite/gdb.ada/ptype_tagged_param/foo.adb
gdb/testsuite/gdb.ada/ptype_tagged_param/pck.adb
gdb/testsuite/gdb.ada/ptype_tagged_param/pck.ads
gdb/testsuite/gdb.ada/rec_return.exp
gdb/testsuite/gdb.ada/rec_return/foo.adb
gdb/testsuite/gdb.ada/rec_return/pck.adb
gdb/testsuite/gdb.ada/rec_return/pck.ads
gdb/testsuite/gdb.ada/ref_param.exp
gdb/testsuite/gdb.ada/ref_param/foo.adb
gdb/testsuite/gdb.ada/ref_param/pck.adb
gdb/testsuite/gdb.ada/ref_param/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.ada/same_enum.exp
gdb/testsuite/gdb.ada/same_enum/a.adb
gdb/testsuite/gdb.ada/same_enum/pck.adb
gdb/testsuite/gdb.ada/same_enum/pck.ads
gdb/testsuite/gdb.ada/start.exp
gdb/testsuite/gdb.ada/start/dummy.adb
gdb/testsuite/gdb.ada/str_ref_cmp.exp
gdb/testsuite/gdb.ada/str_ref_cmp/foo.adb
gdb/testsuite/gdb.ada/str_ref_cmp/pck.ads
gdb/testsuite/gdb.ada/sym_print_name.exp
gdb/testsuite/gdb.ada/sym_print_name/foo.adb
gdb/testsuite/gdb.ada/sym_print_name/pck.adb
gdb/testsuite/gdb.ada/sym_print_name/pck.ads
gdb/testsuite/gdb.ada/taft_type.exp
gdb/testsuite/gdb.ada/taft_type/p.adb
gdb/testsuite/gdb.ada/taft_type/pck.adb
gdb/testsuite/gdb.ada/taft_type/pck.ads
gdb/testsuite/gdb.ada/tagged.exp
gdb/testsuite/gdb.ada/tagged/foo.adb
gdb/testsuite/gdb.ada/tagged/pck.adb
gdb/testsuite/gdb.ada/tagged/pck.ads
gdb/testsuite/gdb.ada/tasks.exp
gdb/testsuite/gdb.ada/tasks/foo.adb
gdb/testsuite/gdb.ada/tick_last_segv.exp
gdb/testsuite/gdb.ada/tick_last_segv/foo.adb
gdb/testsuite/gdb.ada/type_coercion.exp
gdb/testsuite/gdb.ada/type_coercion/assign.adb
gdb/testsuite/gdb.ada/type_coercion/ident.adb
gdb/testsuite/gdb.ada/uninitialized_vars.exp
gdb/testsuite/gdb.ada/uninitialized_vars/parse.adb
gdb/testsuite/gdb.ada/uninitialized_vars/parse_controlled.ads
gdb/testsuite/gdb.ada/variant_record_packed_array.exp
gdb/testsuite/gdb.ada/variant_record_packed_array/foo.adb
gdb/testsuite/gdb.ada/variant_record_packed_array/pck.adb
gdb/testsuite/gdb.ada/variant_record_packed_array/pck.ads
gdb/testsuite/gdb.ada/watch_arg.exp
gdb/testsuite/gdb.ada/watch_arg/watch.adb
gdb/testsuite/gdb.ada/widewide.exp
gdb/testsuite/gdb.ada/widewide/foo.adb
gdb/testsuite/gdb.ada/widewide/pck.adb
gdb/testsuite/gdb.ada/widewide/pck.ads
gdb/testsuite/gdb.arch/Makefile.in
gdb/testsuite/gdb.arch/alpha-step.c
gdb/testsuite/gdb.arch/alpha-step.exp
gdb/testsuite/gdb.arch/altivec-abi.c
gdb/testsuite/gdb.arch/altivec-abi.exp
gdb/testsuite/gdb.arch/altivec-regs.c
gdb/testsuite/gdb.arch/altivec-regs.exp
gdb/testsuite/gdb.arch/amd64-byte.exp
gdb/testsuite/gdb.arch/amd64-disp-step.S
gdb/testsuite/gdb.arch/amd64-disp-step.exp
gdb/testsuite/gdb.arch/amd64-dword.exp
gdb/testsuite/gdb.arch/amd64-i386-address.S
gdb/testsuite/gdb.arch/amd64-i386-address.exp
gdb/testsuite/gdb.arch/amd64-prologue-xmm.c
gdb/testsuite/gdb.arch/amd64-prologue-xmm.exp
gdb/testsuite/gdb.arch/amd64-prologue-xmm.s
gdb/testsuite/gdb.arch/amd64-pseudo.c
gdb/testsuite/gdb.arch/amd64-word.exp
gdb/testsuite/gdb.arch/arm-disp-step.S
gdb/testsuite/gdb.arch/arm-disp-step.exp
gdb/testsuite/gdb.arch/e500-abi.c
gdb/testsuite/gdb.arch/e500-abi.exp
gdb/testsuite/gdb.arch/e500-prologue.c
gdb/testsuite/gdb.arch/e500-prologue.exp
gdb/testsuite/gdb.arch/e500-regs.c
gdb/testsuite/gdb.arch/e500-regs.exp
gdb/testsuite/gdb.arch/gcore.c
gdb/testsuite/gdb.arch/gdb1291.exp
gdb/testsuite/gdb.arch/gdb1291.s
gdb/testsuite/gdb.arch/gdb1431.exp
gdb/testsuite/gdb.arch/gdb1431.s
gdb/testsuite/gdb.arch/gdb1558.c
gdb/testsuite/gdb.arch/gdb1558.exp
gdb/testsuite/gdb.arch/i386-avx.c
gdb/testsuite/gdb.arch/i386-avx.exp
gdb/testsuite/gdb.arch/i386-bp_permanent.exp
gdb/testsuite/gdb.arch/i386-byte.exp
gdb/testsuite/gdb.arch/i386-cpuid.h
gdb/testsuite/gdb.arch/i386-disp-step.S
gdb/testsuite/gdb.arch/i386-disp-step.exp
gdb/testsuite/gdb.arch/i386-dr3-watch.c
gdb/testsuite/gdb.arch/i386-dr3-watch.exp
gdb/testsuite/gdb.arch/i386-gnu-cfi-asm.S
gdb/testsuite/gdb.arch/i386-gnu-cfi.c
gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
gdb/testsuite/gdb.arch/i386-permbkpt.S
gdb/testsuite/gdb.arch/i386-permbkpt.exp
gdb/testsuite/gdb.arch/i386-prologue.c
gdb/testsuite/gdb.arch/i386-prologue.exp
gdb/testsuite/gdb.arch/i386-pseudo.c
gdb/testsuite/gdb.arch/i386-signal.c
gdb/testsuite/gdb.arch/i386-signal.exp
gdb/testsuite/gdb.arch/i386-size-overlap.c
gdb/testsuite/gdb.arch/i386-size-overlap.exp
gdb/testsuite/gdb.arch/i386-size.c
gdb/testsuite/gdb.arch/i386-size.exp
gdb/testsuite/gdb.arch/i386-sse.c
gdb/testsuite/gdb.arch/i386-sse.exp
gdb/testsuite/gdb.arch/i386-unwind.c
gdb/testsuite/gdb.arch/i386-unwind.exp
gdb/testsuite/gdb.arch/i386-word.exp
gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.S
gdb/testsuite/gdb.arch/ia64-breakpoint-shadow.exp
gdb/testsuite/gdb.arch/iwmmxt-regs.c
gdb/testsuite/gdb.arch/iwmmxt-regs.exp
gdb/testsuite/gdb.arch/pa-nullify.exp
gdb/testsuite/gdb.arch/pa-nullify.s
gdb/testsuite/gdb.arch/pa64-nullify.s
gdb/testsuite/gdb.arch/powerpc-aix-prologue.c
gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp
gdb/testsuite/gdb.arch/powerpc-d128-regs.c
gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
gdb/testsuite/gdb.arch/powerpc-prologue.c
gdb/testsuite/gdb.arch/powerpc-prologue.exp
gdb/testsuite/gdb.arch/ppc-dfp.c
gdb/testsuite/gdb.arch/ppc-dfp.exp
gdb/testsuite/gdb.arch/ppc-fp.c
gdb/testsuite/gdb.arch/ppc-fp.exp
gdb/testsuite/gdb.arch/ppc64-atomic-inst.c
gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp
gdb/testsuite/gdb.arch/spu-info.c
gdb/testsuite/gdb.arch/spu-info.exp
gdb/testsuite/gdb.arch/spu-ls.c
gdb/testsuite/gdb.arch/spu-ls.exp
gdb/testsuite/gdb.arch/system-gcore.exp
gdb/testsuite/gdb.arch/thumb-prologue.c
gdb/testsuite/gdb.arch/thumb-prologue.exp
gdb/testsuite/gdb.arch/thumb-singlestep.S
gdb/testsuite/gdb.arch/thumb-singlestep.exp
gdb/testsuite/gdb.arch/thumb2-it.S
gdb/testsuite/gdb.arch/thumb2-it.exp
gdb/testsuite/gdb.arch/vsx-regs.c
gdb/testsuite/gdb.arch/vsx-regs.exp
gdb/testsuite/gdb.asm/Makefile.in
gdb/testsuite/gdb.asm/alpha.inc
gdb/testsuite/gdb.asm/arm.inc
gdb/testsuite/gdb.asm/asm-source.exp
gdb/testsuite/gdb.asm/asmsrc1.s
gdb/testsuite/gdb.asm/asmsrc2.s
gdb/testsuite/gdb.asm/bfin.inc
gdb/testsuite/gdb.asm/common.inc
gdb/testsuite/gdb.asm/empty.inc
gdb/testsuite/gdb.asm/frv.inc
gdb/testsuite/gdb.asm/h8300.inc
gdb/testsuite/gdb.asm/i386.inc
gdb/testsuite/gdb.asm/ia64.inc
gdb/testsuite/gdb.asm/iq2000.inc
gdb/testsuite/gdb.asm/m32c.inc
gdb/testsuite/gdb.asm/m32r-linux.inc
gdb/testsuite/gdb.asm/m32r.inc
gdb/testsuite/gdb.asm/m68hc11.inc
gdb/testsuite/gdb.asm/m68k.inc
gdb/testsuite/gdb.asm/mips.inc
gdb/testsuite/gdb.asm/netbsd.inc
gdb/testsuite/gdb.asm/openbsd.inc
gdb/testsuite/gdb.asm/pa.inc
gdb/testsuite/gdb.asm/pa64.inc
gdb/testsuite/gdb.asm/powerpc.inc
gdb/testsuite/gdb.asm/powerpc64.inc
gdb/testsuite/gdb.asm/s390.inc
gdb/testsuite/gdb.asm/s390x.inc
gdb/testsuite/gdb.asm/sh.inc
gdb/testsuite/gdb.asm/sparc.inc
gdb/testsuite/gdb.asm/sparc64.inc
gdb/testsuite/gdb.asm/spu.inc
gdb/testsuite/gdb.asm/v850.inc
gdb/testsuite/gdb.asm/x86_64.inc
gdb/testsuite/gdb.asm/xstormy16.inc
gdb/testsuite/gdb.base/Makefile.in
gdb/testsuite/gdb.base/a2-run.exp
gdb/testsuite/gdb.base/advance.c
gdb/testsuite/gdb.base/advance.exp
gdb/testsuite/gdb.base/all-bin.exp
gdb/testsuite/gdb.base/all-types.c
gdb/testsuite/gdb.base/annota1.c
gdb/testsuite/gdb.base/annota1.exp
gdb/testsuite/gdb.base/annota3.c
gdb/testsuite/gdb.base/annota3.exp
gdb/testsuite/gdb.base/anon.c
gdb/testsuite/gdb.base/anon.exp
gdb/testsuite/gdb.base/args.c
gdb/testsuite/gdb.base/args.exp
gdb/testsuite/gdb.base/arithmet.exp
gdb/testsuite/gdb.base/arrayidx.c
gdb/testsuite/gdb.base/arrayidx.exp
gdb/testsuite/gdb.base/assign.exp
gdb/testsuite/gdb.base/async-shell.c
gdb/testsuite/gdb.base/async-shell.exp
gdb/testsuite/gdb.base/async.c
gdb/testsuite/gdb.base/async.exp
gdb/testsuite/gdb.base/attach-pie-misread.c
gdb/testsuite/gdb.base/attach-pie-misread.exp
gdb/testsuite/gdb.base/attach.c
gdb/testsuite/gdb.base/attach.exp
gdb/testsuite/gdb.base/attach2.c
gdb/testsuite/gdb.base/auxv.c
gdb/testsuite/gdb.base/auxv.exp
gdb/testsuite/gdb.base/average.c
gdb/testsuite/gdb.base/bang.exp
gdb/testsuite/gdb.base/bar.c
gdb/testsuite/gdb.base/baz.c
gdb/testsuite/gdb.base/bfp-test.c
gdb/testsuite/gdb.base/bfp-test.exp
gdb/testsuite/gdb.base/bigcore.c
gdb/testsuite/gdb.base/bigcore.exp
gdb/testsuite/gdb.base/bitfields.c
gdb/testsuite/gdb.base/bitfields.exp
gdb/testsuite/gdb.base/bitfields2.c
gdb/testsuite/gdb.base/bitfields2.exp
gdb/testsuite/gdb.base/bitops.exp
gdb/testsuite/gdb.base/branches.c
gdb/testsuite/gdb.base/break-always.c
gdb/testsuite/gdb.base/break-always.exp
gdb/testsuite/gdb.base/break-entry.exp
gdb/testsuite/gdb.base/break-interp-lib.c
gdb/testsuite/gdb.base/break-interp-main.c
gdb/testsuite/gdb.base/break-interp.exp
gdb/testsuite/gdb.base/break-on-linker-gcd-function.cc
gdb/testsuite/gdb.base/break-on-linker-gcd-function.exp
gdb/testsuite/gdb.base/break.c
gdb/testsuite/gdb.base/break.exp
gdb/testsuite/gdb.base/break1.c
gdb/testsuite/gdb.base/breakpoint-shadow.c
gdb/testsuite/gdb.base/breakpoint-shadow.exp
gdb/testsuite/gdb.base/call-ar-st.c
gdb/testsuite/gdb.base/call-ar-st.exp
gdb/testsuite/gdb.base/call-rt-st.c
gdb/testsuite/gdb.base/call-rt-st.exp
gdb/testsuite/gdb.base/call-sc.c
gdb/testsuite/gdb.base/call-sc.exp
gdb/testsuite/gdb.base/call-signal-resume.exp
gdb/testsuite/gdb.base/call-signals.c
gdb/testsuite/gdb.base/call-strs.c
gdb/testsuite/gdb.base/call-strs.exp
gdb/testsuite/gdb.base/callexit.c
gdb/testsuite/gdb.base/callexit.exp
gdb/testsuite/gdb.base/callfuncs.c
gdb/testsuite/gdb.base/callfuncs.exp
gdb/testsuite/gdb.base/catch-syscall.c
gdb/testsuite/gdb.base/catch-syscall.exp
gdb/testsuite/gdb.base/charset-malloc.c
gdb/testsuite/gdb.base/charset.c
gdb/testsuite/gdb.base/charset.exp
gdb/testsuite/gdb.base/checkpoint.c
gdb/testsuite/gdb.base/checkpoint.exp
gdb/testsuite/gdb.base/chng-syms.c
gdb/testsuite/gdb.base/chng-syms.exp
gdb/testsuite/gdb.base/code-expr.exp
gdb/testsuite/gdb.base/code_elim.exp
gdb/testsuite/gdb.base/code_elim1.c
gdb/testsuite/gdb.base/code_elim2.c
gdb/testsuite/gdb.base/commands.exp
gdb/testsuite/gdb.base/comp-dir/subdir/dummy.txt
gdb/testsuite/gdb.base/completion.exp
gdb/testsuite/gdb.base/complex.c
gdb/testsuite/gdb.base/complex.exp
gdb/testsuite/gdb.base/cond-expr.exp
gdb/testsuite/gdb.base/condbreak.exp
gdb/testsuite/gdb.base/consecutive.c
gdb/testsuite/gdb.base/consecutive.exp
gdb/testsuite/gdb.base/constvars.c
gdb/testsuite/gdb.base/constvars.exp
gdb/testsuite/gdb.base/corefile.exp
gdb/testsuite/gdb.base/coremaker.c
gdb/testsuite/gdb.base/coremaker2.c
gdb/testsuite/gdb.base/cursal.c
gdb/testsuite/gdb.base/cursal.exp
gdb/testsuite/gdb.base/cvexpr.c
gdb/testsuite/gdb.base/cvexpr.exp
gdb/testsuite/gdb.base/d10v.ld
gdb/testsuite/gdb.base/d10vovly.c
gdb/testsuite/gdb.base/dbx.exp
gdb/testsuite/gdb.base/default.exp
gdb/testsuite/gdb.base/define.exp
gdb/testsuite/gdb.base/del.c
gdb/testsuite/gdb.base/del.exp
gdb/testsuite/gdb.base/detach.exp
gdb/testsuite/gdb.base/dfp-exprs.exp
gdb/testsuite/gdb.base/dfp-test.c
gdb/testsuite/gdb.base/dfp-test.exp
gdb/testsuite/gdb.base/disasm-end-cu-1.c
gdb/testsuite/gdb.base/disasm-end-cu-2.c
gdb/testsuite/gdb.base/disasm-end-cu.exp
gdb/testsuite/gdb.base/disp-step-fork.c
gdb/testsuite/gdb.base/disp-step-syscall.exp
gdb/testsuite/gdb.base/disp-step-vfork.c
gdb/testsuite/gdb.base/display.c
gdb/testsuite/gdb.base/display.exp
gdb/testsuite/gdb.base/dump.c
gdb/testsuite/gdb.base/dump.exp
gdb/testsuite/gdb.base/dup-sect.S
gdb/testsuite/gdb.base/dup-sect.exp
gdb/testsuite/gdb.base/echo.exp
gdb/testsuite/gdb.base/ena-dis-br.exp
gdb/testsuite/gdb.base/ending-run.c
gdb/testsuite/gdb.base/ending-run.exp
gdb/testsuite/gdb.base/environ.exp
gdb/testsuite/gdb.base/eu-strip-infcall.c
gdb/testsuite/gdb.base/eu-strip-infcall.exp
gdb/testsuite/gdb.base/eval-skip.exp
gdb/testsuite/gdb.base/eval.exp
gdb/testsuite/gdb.base/exe-lock.exp
gdb/testsuite/gdb.base/execd-prog.c
gdb/testsuite/gdb.base/expand-psymtabs.c
gdb/testsuite/gdb.base/expand-psymtabs.exp
gdb/testsuite/gdb.base/exprs.c
gdb/testsuite/gdb.base/exprs.exp
gdb/testsuite/gdb.base/fileio.c
gdb/testsuite/gdb.base/fileio.exp
gdb/testsuite/gdb.base/find.c
gdb/testsuite/gdb.base/find.exp
gdb/testsuite/gdb.base/finish.exp
gdb/testsuite/gdb.base/fixsection.c
gdb/testsuite/gdb.base/fixsection.exp
gdb/testsuite/gdb.base/fixsectshr.c
gdb/testsuite/gdb.base/float.c
gdb/testsuite/gdb.base/float.exp
gdb/testsuite/gdb.base/foll-exec.c
gdb/testsuite/gdb.base/foll-exec.exp
gdb/testsuite/gdb.base/foll-fork.c
gdb/testsuite/gdb.base/foll-fork.exp
gdb/testsuite/gdb.base/foll-vfork.c
gdb/testsuite/gdb.base/foll-vfork.exp
gdb/testsuite/gdb.base/foo.c
gdb/testsuite/gdb.base/fortran-sym-case.c
gdb/testsuite/gdb.base/fortran-sym-case.exp
gdb/testsuite/gdb.base/frame-args.c
gdb/testsuite/gdb.base/frame-args.exp
gdb/testsuite/gdb.base/freebpcmd.c
gdb/testsuite/gdb.base/freebpcmd.exp
gdb/testsuite/gdb.base/fullname.c
gdb/testsuite/gdb.base/fullname.exp
gdb/testsuite/gdb.base/funcargs.c
gdb/testsuite/gdb.base/funcargs.exp
gdb/testsuite/gdb.base/gcore-buffer-overflow.c
gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
gdb/testsuite/gdb.base/gcore.c
gdb/testsuite/gdb.base/gcore.exp
gdb/testsuite/gdb.base/gdb1056.exp
gdb/testsuite/gdb.base/gdb1090.c
gdb/testsuite/gdb.base/gdb1090.exp
gdb/testsuite/gdb.base/gdb11530.c
gdb/testsuite/gdb.base/gdb11530.exp
gdb/testsuite/gdb.base/gdb11531.c
gdb/testsuite/gdb.base/gdb11531.exp
gdb/testsuite/gdb.base/gdb1250.c
gdb/testsuite/gdb.base/gdb1250.exp
gdb/testsuite/gdb.base/gdb1555-main.c
gdb/testsuite/gdb.base/gdb1555.c
gdb/testsuite/gdb.base/gdb1555.exp
gdb/testsuite/gdb.base/gdb1821.c
gdb/testsuite/gdb.base/gdb1821.exp
gdb/testsuite/gdb.base/gdb_history
gdb/testsuite/gdb.base/gdbindex-stabs-dwarf.c
gdb/testsuite/gdb.base/gdbindex-stabs.c
gdb/testsuite/gdb.base/gdbindex-stabs.exp
gdb/testsuite/gdb.base/gdbvars.c
gdb/testsuite/gdb.base/gdbvars.exp
gdb/testsuite/gdb.base/gnu-ifunc-lib.c
gdb/testsuite/gdb.base/gnu-ifunc.c
gdb/testsuite/gdb.base/gnu-ifunc.exp
gdb/testsuite/gdb.base/gnu_vector.c
gdb/testsuite/gdb.base/gnu_vector.exp
gdb/testsuite/gdb.base/grbx.c
gdb/testsuite/gdb.base/hashline1.exp
gdb/testsuite/gdb.base/hashline2.exp
gdb/testsuite/gdb.base/hashline3.exp
gdb/testsuite/gdb.base/hbreak.c
gdb/testsuite/gdb.base/hbreak.exp
gdb/testsuite/gdb.base/help.exp
gdb/testsuite/gdb.base/hook-stop-continue.c
gdb/testsuite/gdb.base/hook-stop-continue.exp
gdb/testsuite/gdb.base/hook-stop-frame.c
gdb/testsuite/gdb.base/hook-stop-frame.exp
gdb/testsuite/gdb.base/huge.c
gdb/testsuite/gdb.base/huge.exp
gdb/testsuite/gdb.base/ifelse.exp
gdb/testsuite/gdb.base/included.c
gdb/testsuite/gdb.base/included.exp
gdb/testsuite/gdb.base/included.h
gdb/testsuite/gdb.base/infnan.c
gdb/testsuite/gdb.base/infnan.exp
gdb/testsuite/gdb.base/info-macros.c
gdb/testsuite/gdb.base/info-macros.exp
gdb/testsuite/gdb.base/info-proc.exp
gdb/testsuite/gdb.base/info-target.exp
gdb/testsuite/gdb.base/int-type.c
gdb/testsuite/gdb.base/interact.exp
gdb/testsuite/gdb.base/interp.c
gdb/testsuite/gdb.base/interp.exp
gdb/testsuite/gdb.base/interrupt.c
gdb/testsuite/gdb.base/interrupt.exp
gdb/testsuite/gdb.base/jit-dlmain.c
gdb/testsuite/gdb.base/jit-main.c
gdb/testsuite/gdb.base/jit-so.exp
gdb/testsuite/gdb.base/jit-solib.c
gdb/testsuite/gdb.base/jit.exp
gdb/testsuite/gdb.base/jump.c
gdb/testsuite/gdb.base/jump.exp
gdb/testsuite/gdb.base/kill-after-signal.c
gdb/testsuite/gdb.base/kill-after-signal.exp
gdb/testsuite/gdb.base/label.c
gdb/testsuite/gdb.base/label.exp
gdb/testsuite/gdb.base/langs.exp
gdb/testsuite/gdb.base/langs0.c
gdb/testsuite/gdb.base/langs1.c
gdb/testsuite/gdb.base/langs1.f
gdb/testsuite/gdb.base/langs2.c
gdb/testsuite/gdb.base/langs2.cxx
gdb/testsuite/gdb.base/lineinc.c
gdb/testsuite/gdb.base/lineinc.exp
gdb/testsuite/gdb.base/lineinc1.h
gdb/testsuite/gdb.base/lineinc2.h
gdb/testsuite/gdb.base/lineinc3.h
gdb/testsuite/gdb.base/list.exp
gdb/testsuite/gdb.base/list0.c
gdb/testsuite/gdb.base/list0.h
gdb/testsuite/gdb.base/list1.c
gdb/testsuite/gdb.base/logical.exp
gdb/testsuite/gdb.base/long_long.c
gdb/testsuite/gdb.base/long_long.exp
gdb/testsuite/gdb.base/longjmp.c
gdb/testsuite/gdb.base/longjmp.exp
gdb/testsuite/gdb.base/m32r.ld
gdb/testsuite/gdb.base/m32rovly.c
gdb/testsuite/gdb.base/macscp.exp
gdb/testsuite/gdb.base/macscp1.c
gdb/testsuite/gdb.base/macscp2.h
gdb/testsuite/gdb.base/macscp3.h
gdb/testsuite/gdb.base/macscp4.h
gdb/testsuite/gdb.base/maint.exp
gdb/testsuite/gdb.base/memattr.c
gdb/testsuite/gdb.base/memattr.exp
gdb/testsuite/gdb.base/mips_pro.c
gdb/testsuite/gdb.base/mips_pro.exp
gdb/testsuite/gdb.base/miscexprs.c
gdb/testsuite/gdb.base/miscexprs.exp
gdb/testsuite/gdb.base/morestack.c
gdb/testsuite/gdb.base/morestack.exp
gdb/testsuite/gdb.base/moribund-step.exp
gdb/testsuite/gdb.base/multi-forks.c
gdb/testsuite/gdb.base/multi-forks.exp
gdb/testsuite/gdb.base/nodebug.c
gdb/testsuite/gdb.base/nodebug.exp
gdb/testsuite/gdb.base/nofield.c
gdb/testsuite/gdb.base/nofield.exp
gdb/testsuite/gdb.base/nostdlib.c
gdb/testsuite/gdb.base/nostdlib.exp
gdb/testsuite/gdb.base/opaque.exp
gdb/testsuite/gdb.base/opaque0.c
gdb/testsuite/gdb.base/opaque1.c
gdb/testsuite/gdb.base/overlays.c
gdb/testsuite/gdb.base/overlays.exp
gdb/testsuite/gdb.base/ovlymgr.c
gdb/testsuite/gdb.base/ovlymgr.h
gdb/testsuite/gdb.base/page.exp
gdb/testsuite/gdb.base/pc-fp.c
gdb/testsuite/gdb.base/pc-fp.exp
gdb/testsuite/gdb.base/pending.c
gdb/testsuite/gdb.base/pending.exp
gdb/testsuite/gdb.base/pendshr.c
gdb/testsuite/gdb.base/permissions.exp
gdb/testsuite/gdb.base/pi.txt
gdb/testsuite/gdb.base/pie-execl.c
gdb/testsuite/gdb.base/pie-execl.exp
gdb/testsuite/gdb.base/pointers.c
gdb/testsuite/gdb.base/pointers.exp
gdb/testsuite/gdb.base/pr10179-a.c
gdb/testsuite/gdb.base/pr10179-b.c
gdb/testsuite/gdb.base/pr10179.exp
gdb/testsuite/gdb.base/pr11022.c
gdb/testsuite/gdb.base/pr11022.exp
gdb/testsuite/gdb.base/prelink-lib.c
gdb/testsuite/gdb.base/prelink.c
gdb/testsuite/gdb.base/prelink.exp
gdb/testsuite/gdb.base/printcmds.c
gdb/testsuite/gdb.base/printcmds.exp
gdb/testsuite/gdb.base/prologue.c
gdb/testsuite/gdb.base/prologue.exp
gdb/testsuite/gdb.base/psymtab.exp
gdb/testsuite/gdb.base/psymtab1.c
gdb/testsuite/gdb.base/psymtab2.c
gdb/testsuite/gdb.base/ptr-typedef.c
gdb/testsuite/gdb.base/ptr-typedef.exp
gdb/testsuite/gdb.base/ptype.c
gdb/testsuite/gdb.base/ptype.exp
gdb/testsuite/gdb.base/ptype1.c
gdb/testsuite/gdb.base/radix.exp
gdb/testsuite/gdb.base/randomize.c
gdb/testsuite/gdb.base/randomize.exp
gdb/testsuite/gdb.base/readline-ask.c
gdb/testsuite/gdb.base/readline-ask.exp
gdb/testsuite/gdb.base/readline-ask.inputrc
gdb/testsuite/gdb.base/readline.exp
gdb/testsuite/gdb.base/recurse.c
gdb/testsuite/gdb.base/recurse.exp
gdb/testsuite/gdb.base/regs.exp
gdb/testsuite/gdb.base/relational.exp
gdb/testsuite/gdb.base/relativedebug.c
gdb/testsuite/gdb.base/relativedebug.exp
gdb/testsuite/gdb.base/relocate.c
gdb/testsuite/gdb.base/relocate.exp
gdb/testsuite/gdb.base/remote.c
gdb/testsuite/gdb.base/remote.exp
gdb/testsuite/gdb.base/remotetimeout.exp
gdb/testsuite/gdb.base/reread.exp
gdb/testsuite/gdb.base/reread1.c
gdb/testsuite/gdb.base/reread2.c
gdb/testsuite/gdb.base/restore.c
gdb/testsuite/gdb.base/restore.exp
gdb/testsuite/gdb.base/return-nodebug.c
gdb/testsuite/gdb.base/return-nodebug.exp
gdb/testsuite/gdb.base/return-nodebug1.c
gdb/testsuite/gdb.base/return.c
gdb/testsuite/gdb.base/return.exp
gdb/testsuite/gdb.base/return2.c
gdb/testsuite/gdb.base/return2.exp
gdb/testsuite/gdb.base/run.c
gdb/testsuite/gdb.base/savedregs.c
gdb/testsuite/gdb.base/savedregs.exp
gdb/testsuite/gdb.base/scope.exp
gdb/testsuite/gdb.base/scope0.c
gdb/testsuite/gdb.base/scope1.c
gdb/testsuite/gdb.base/sect-cmd.exp
gdb/testsuite/gdb.base/sep-proc.c
gdb/testsuite/gdb.base/sep.c
gdb/testsuite/gdb.base/sep.exp
gdb/testsuite/gdb.base/sepdebug.c
gdb/testsuite/gdb.base/sepdebug.exp
gdb/testsuite/gdb.base/sepdebug2.c
gdb/testsuite/gdb.base/sepsymtab.c
gdb/testsuite/gdb.base/sepsymtab.exp
gdb/testsuite/gdb.base/set-lang-auto.exp
gdb/testsuite/gdb.base/setshow.c
gdb/testsuite/gdb.base/setshow.exp
gdb/testsuite/gdb.base/setvar.c
gdb/testsuite/gdb.base/setvar.exp
gdb/testsuite/gdb.base/shlib-call.exp
gdb/testsuite/gdb.base/shmain.c
gdb/testsuite/gdb.base/shr1.c
gdb/testsuite/gdb.base/shr2.c
gdb/testsuite/gdb.base/shreloc.c
gdb/testsuite/gdb.base/shreloc.exp
gdb/testsuite/gdb.base/shreloc1.c
gdb/testsuite/gdb.base/shreloc2.c
gdb/testsuite/gdb.base/sigall.c
gdb/testsuite/gdb.base/sigall.exp
gdb/testsuite/gdb.base/sigaltstack.c
gdb/testsuite/gdb.base/sigaltstack.exp
gdb/testsuite/gdb.base/sigbpt.c
gdb/testsuite/gdb.base/sigbpt.exp
gdb/testsuite/gdb.base/sigchld.c
gdb/testsuite/gdb.base/sigchld.exp
gdb/testsuite/gdb.base/siginfo-addr.c
gdb/testsuite/gdb.base/siginfo-addr.exp
gdb/testsuite/gdb.base/siginfo-infcall.c
gdb/testsuite/gdb.base/siginfo-infcall.exp
gdb/testsuite/gdb.base/siginfo-obj.c
gdb/testsuite/gdb.base/siginfo-obj.exp
gdb/testsuite/gdb.base/siginfo.c
gdb/testsuite/gdb.base/siginfo.exp
gdb/testsuite/gdb.base/signals.c
gdb/testsuite/gdb.base/signals.exp
gdb/testsuite/gdb.base/signest.c
gdb/testsuite/gdb.base/signest.exp
gdb/testsuite/gdb.base/signull.c
gdb/testsuite/gdb.base/signull.exp
gdb/testsuite/gdb.base/sigrepeat.c
gdb/testsuite/gdb.base/sigrepeat.exp
gdb/testsuite/gdb.base/sigstep.c
gdb/testsuite/gdb.base/sigstep.exp
gdb/testsuite/gdb.base/sizeof.c
gdb/testsuite/gdb.base/sizeof.exp
gdb/testsuite/gdb.base/so-disc-shr.c
gdb/testsuite/gdb.base/so-impl-ld.c
gdb/testsuite/gdb.base/so-impl-ld.exp
gdb/testsuite/gdb.base/so-indr-cl.c
gdb/testsuite/gdb.base/so-indr-cl.exp
gdb/testsuite/gdb.base/solib-corrupted.exp
gdb/testsuite/gdb.base/solib-disc.c
gdb/testsuite/gdb.base/solib-disc.exp
gdb/testsuite/gdb.base/solib-display-lib.c
gdb/testsuite/gdb.base/solib-display-main.c
gdb/testsuite/gdb.base/solib-display.exp
gdb/testsuite/gdb.base/solib-nodir.exp
gdb/testsuite/gdb.base/solib-overlap-lib.c
gdb/testsuite/gdb.base/solib-overlap-main.c
gdb/testsuite/gdb.base/solib-overlap.exp
gdb/testsuite/gdb.base/solib-symbol-lib.c
gdb/testsuite/gdb.base/solib-symbol-main.c
gdb/testsuite/gdb.base/solib-symbol.exp
gdb/testsuite/gdb.base/solib-weak.c
gdb/testsuite/gdb.base/solib-weak.exp
gdb/testsuite/gdb.base/solib.c
gdb/testsuite/gdb.base/solib.exp
gdb/testsuite/gdb.base/solib1.c
gdb/testsuite/gdb.base/solib2.c
gdb/testsuite/gdb.base/source-error.gdb
gdb/testsuite/gdb.base/source-test.gdb
gdb/testsuite/gdb.base/source.exp
gdb/testsuite/gdb.base/spu.ld
gdb/testsuite/gdb.base/ss.h
gdb/testsuite/gdb.base/stack-checking.c
gdb/testsuite/gdb.base/stack-checking.exp
gdb/testsuite/gdb.base/start.c
gdb/testsuite/gdb.base/start.exp
gdb/testsuite/gdb.base/step-break.c
gdb/testsuite/gdb.base/step-break.exp
gdb/testsuite/gdb.base/step-bt.c
gdb/testsuite/gdb.base/step-bt.exp
gdb/testsuite/gdb.base/step-line.c
gdb/testsuite/gdb.base/step-line.exp
gdb/testsuite/gdb.base/step-line.inp
gdb/testsuite/gdb.base/step-resume-infcall.c
gdb/testsuite/gdb.base/step-resume-infcall.exp
gdb/testsuite/gdb.base/step-test.c
gdb/testsuite/gdb.base/step-test.exp
gdb/testsuite/gdb.base/store.c
gdb/testsuite/gdb.base/store.exp
gdb/testsuite/gdb.base/structs.c
gdb/testsuite/gdb.base/structs.exp
gdb/testsuite/gdb.base/structs2.c
gdb/testsuite/gdb.base/structs2.exp
gdb/testsuite/gdb.base/structs3.c
gdb/testsuite/gdb.base/structs3.exp
gdb/testsuite/gdb.base/subst.exp
gdb/testsuite/gdb.base/sum.c
gdb/testsuite/gdb.base/symbol-without-target_section.c
gdb/testsuite/gdb.base/symbol-without-target_section.exp
gdb/testsuite/gdb.base/term.exp
gdb/testsuite/gdb.base/trace-commands.exp
gdb/testsuite/gdb.base/tui-layout.exp
gdb/testsuite/gdb.base/twice.c
gdb/testsuite/gdb.base/twice.exp
gdb/testsuite/gdb.base/type-opaque-lib.c
gdb/testsuite/gdb.base/type-opaque-main.c
gdb/testsuite/gdb.base/type-opaque.exp
gdb/testsuite/gdb.base/ui-redirect.exp
gdb/testsuite/gdb.base/unload.c
gdb/testsuite/gdb.base/unload.exp
gdb/testsuite/gdb.base/unloadshr.c
gdb/testsuite/gdb.base/unloadshr2.c
gdb/testsuite/gdb.base/until.exp
gdb/testsuite/gdb.base/unwindonsignal.c
gdb/testsuite/gdb.base/unwindonsignal.exp
gdb/testsuite/gdb.base/valgrind-db-attach.c
gdb/testsuite/gdb.base/valgrind-db-attach.exp
gdb/testsuite/gdb.base/value-double-free.c
gdb/testsuite/gdb.base/value-double-free.exp
gdb/testsuite/gdb.base/varargs.c
gdb/testsuite/gdb.base/varargs.exp
gdb/testsuite/gdb.base/vforked-prog.c
gdb/testsuite/gdb.base/volatile.exp
gdb/testsuite/gdb.base/watch-cond-infcall.c
gdb/testsuite/gdb.base/watch-cond-infcall.exp
gdb/testsuite/gdb.base/watch-cond.c
gdb/testsuite/gdb.base/watch-cond.exp
gdb/testsuite/gdb.base/watch-non-mem.c
gdb/testsuite/gdb.base/watch-non-mem.exp
gdb/testsuite/gdb.base/watch-read.c
gdb/testsuite/gdb.base/watch-read.exp
gdb/testsuite/gdb.base/watch-vfork.c
gdb/testsuite/gdb.base/watch-vfork.exp
gdb/testsuite/gdb.base/watch_thread_num.c
gdb/testsuite/gdb.base/watch_thread_num.exp
gdb/testsuite/gdb.base/watchpoint-cond-gone-stripped.c
gdb/testsuite/gdb.base/watchpoint-cond-gone.c
gdb/testsuite/gdb.base/watchpoint-cond-gone.exp
gdb/testsuite/gdb.base/watchpoint-delete.c
gdb/testsuite/gdb.base/watchpoint-delete.exp
gdb/testsuite/gdb.base/watchpoint-hw-hit-once.c
gdb/testsuite/gdb.base/watchpoint-hw-hit-once.exp
gdb/testsuite/gdb.base/watchpoint-hw.c
gdb/testsuite/gdb.base/watchpoint-hw.exp
gdb/testsuite/gdb.base/watchpoint-solib-shr.c
gdb/testsuite/gdb.base/watchpoint-solib.c
gdb/testsuite/gdb.base/watchpoint-solib.exp
gdb/testsuite/gdb.base/watchpoint.c
gdb/testsuite/gdb.base/watchpoint.exp
gdb/testsuite/gdb.base/watchpoints.c
gdb/testsuite/gdb.base/watchpoints.exp
gdb/testsuite/gdb.base/wchar.c
gdb/testsuite/gdb.base/wchar.exp
gdb/testsuite/gdb.base/weaklib1.c
gdb/testsuite/gdb.base/weaklib2.c
gdb/testsuite/gdb.base/whatis-exp.exp
gdb/testsuite/gdb.base/whatis.c
gdb/testsuite/gdb.base/whatis.exp
gdb/testsuite/gdb.cell/Makefile.in
gdb/testsuite/gdb.cell/arch.exp
gdb/testsuite/gdb.cell/break-spu.c
gdb/testsuite/gdb.cell/break.c
gdb/testsuite/gdb.cell/break.exp
gdb/testsuite/gdb.cell/bt-spu.c
gdb/testsuite/gdb.cell/bt.c
gdb/testsuite/gdb.cell/bt.exp
gdb/testsuite/gdb.cell/bt2-spu.c
gdb/testsuite/gdb.cell/core.exp
gdb/testsuite/gdb.cell/coremaker-spu.c
gdb/testsuite/gdb.cell/coremaker.c
gdb/testsuite/gdb.cell/data-spu.c
gdb/testsuite/gdb.cell/data.c
gdb/testsuite/gdb.cell/data.exp
gdb/testsuite/gdb.cell/dwarfaddr.S
gdb/testsuite/gdb.cell/dwarfaddr.exp
gdb/testsuite/gdb.cell/ea-cache-spu.c
gdb/testsuite/gdb.cell/ea-cache.c
gdb/testsuite/gdb.cell/ea-cache.exp
gdb/testsuite/gdb.cell/ea-standalone.c
gdb/testsuite/gdb.cell/ea-standalone.exp
gdb/testsuite/gdb.cell/ea-test.c
gdb/testsuite/gdb.cell/ea-test.exp
gdb/testsuite/gdb.cell/f-regs.exp
gdb/testsuite/gdb.cell/fork-spu.c
gdb/testsuite/gdb.cell/fork.c
gdb/testsuite/gdb.cell/fork.exp
gdb/testsuite/gdb.cell/gcore.exp
gdb/testsuite/gdb.cell/mem-access-spu.c
gdb/testsuite/gdb.cell/mem-access.c
gdb/testsuite/gdb.cell/mem-access.exp
gdb/testsuite/gdb.cell/ptype.exp
gdb/testsuite/gdb.cell/registers.exp
gdb/testsuite/gdb.cell/size-spu.c
gdb/testsuite/gdb.cell/size.c
gdb/testsuite/gdb.cell/sizeof.exp
gdb/testsuite/gdb.cell/solib-symbol.exp
gdb/testsuite/gdb.cell/solib.exp
gdb/testsuite/gdb.cp/Makefile.in
gdb/testsuite/gdb.cp/abstract-origin.cc
gdb/testsuite/gdb.cp/abstract-origin.exp
gdb/testsuite/gdb.cp/ambiguous.cc
gdb/testsuite/gdb.cp/ambiguous.exp
gdb/testsuite/gdb.cp/annota2.cc
gdb/testsuite/gdb.cp/annota2.exp
gdb/testsuite/gdb.cp/annota3.cc
gdb/testsuite/gdb.cp/annota3.exp
gdb/testsuite/gdb.cp/anon-ns.cc
gdb/testsuite/gdb.cp/anon-ns.exp
gdb/testsuite/gdb.cp/anon-struct.cc
gdb/testsuite/gdb.cp/anon-struct.exp
gdb/testsuite/gdb.cp/anon-union.cc
gdb/testsuite/gdb.cp/anon-union.exp
gdb/testsuite/gdb.cp/arg-reference.cc
gdb/testsuite/gdb.cp/arg-reference.exp
gdb/testsuite/gdb.cp/bool.cc
gdb/testsuite/gdb.cp/bool.exp
gdb/testsuite/gdb.cp/breakpoint.cc
gdb/testsuite/gdb.cp/breakpoint.exp
gdb/testsuite/gdb.cp/bs15503.cc
gdb/testsuite/gdb.cp/bs15503.exp
gdb/testsuite/gdb.cp/call-c-1.c
gdb/testsuite/gdb.cp/call-c.cc
gdb/testsuite/gdb.cp/call-c.exp
gdb/testsuite/gdb.cp/casts.cc
gdb/testsuite/gdb.cp/casts.exp
gdb/testsuite/gdb.cp/class2.cc
gdb/testsuite/gdb.cp/class2.exp
gdb/testsuite/gdb.cp/classes.cc
gdb/testsuite/gdb.cp/classes.exp
gdb/testsuite/gdb.cp/cmpd-minsyms.cc
gdb/testsuite/gdb.cp/cmpd-minsyms.exp
gdb/testsuite/gdb.cp/converts.cc
gdb/testsuite/gdb.cp/converts.exp
gdb/testsuite/gdb.cp/cp-relocate.cc
gdb/testsuite/gdb.cp/cp-relocate.exp
gdb/testsuite/gdb.cp/cpcompletion.exp
gdb/testsuite/gdb.cp/cpexprs.cc
gdb/testsuite/gdb.cp/cpexprs.exp
gdb/testsuite/gdb.cp/cplusfuncs.cc
gdb/testsuite/gdb.cp/cplusfuncs.exp
gdb/testsuite/gdb.cp/ctti.exp
gdb/testsuite/gdb.cp/cttiadd.cc
gdb/testsuite/gdb.cp/cttiadd1.cc
gdb/testsuite/gdb.cp/cttiadd2.cc
gdb/testsuite/gdb.cp/cttiadd3.cc
gdb/testsuite/gdb.cp/demangle.exp
gdb/testsuite/gdb.cp/derivation.cc
gdb/testsuite/gdb.cp/derivation.exp
gdb/testsuite/gdb.cp/exception.cc
gdb/testsuite/gdb.cp/exception.exp
gdb/testsuite/gdb.cp/expand-sals.cc
gdb/testsuite/gdb.cp/expand-sals.exp
gdb/testsuite/gdb.cp/extern-c.cc
gdb/testsuite/gdb.cp/extern-c.exp
gdb/testsuite/gdb.cp/formatted-ref.cc
gdb/testsuite/gdb.cp/formatted-ref.exp
gdb/testsuite/gdb.cp/fpointer.cc
gdb/testsuite/gdb.cp/fpointer.exp
gdb/testsuite/gdb.cp/gdb1355.cc
gdb/testsuite/gdb.cp/gdb1355.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/gdb2495.cc
gdb/testsuite/gdb.cp/gdb2495.exp
gdb/testsuite/gdb.cp/hang.H
gdb/testsuite/gdb.cp/hang.exp
gdb/testsuite/gdb.cp/hang1.cc
gdb/testsuite/gdb.cp/hang2.cc
gdb/testsuite/gdb.cp/hang3.cc
gdb/testsuite/gdb.cp/infcall-dlopen-lib.cc
gdb/testsuite/gdb.cp/infcall-dlopen.cc
gdb/testsuite/gdb.cp/infcall-dlopen.exp
gdb/testsuite/gdb.cp/inherit.exp
gdb/testsuite/gdb.cp/koenig.cc
gdb/testsuite/gdb.cp/koenig.exp
gdb/testsuite/gdb.cp/local.cc
gdb/testsuite/gdb.cp/local.exp
gdb/testsuite/gdb.cp/m-data.cc
gdb/testsuite/gdb.cp/m-data.exp
gdb/testsuite/gdb.cp/m-static.cc
gdb/testsuite/gdb.cp/m-static.exp
gdb/testsuite/gdb.cp/m-static.h
gdb/testsuite/gdb.cp/m-static1.cc
gdb/testsuite/gdb.cp/maint.exp
gdb/testsuite/gdb.cp/mb-ctor.cc
gdb/testsuite/gdb.cp/mb-ctor.exp
gdb/testsuite/gdb.cp/mb-inline.exp
gdb/testsuite/gdb.cp/mb-inline.h
gdb/testsuite/gdb.cp/mb-inline1.cc
gdb/testsuite/gdb.cp/mb-inline2.cc
gdb/testsuite/gdb.cp/mb-templates.cc
gdb/testsuite/gdb.cp/mb-templates.exp
gdb/testsuite/gdb.cp/member-ptr.cc
gdb/testsuite/gdb.cp/member-ptr.exp
gdb/testsuite/gdb.cp/meth-typedefs.cc
gdb/testsuite/gdb.cp/meth-typedefs.exp
gdb/testsuite/gdb.cp/method.cc
gdb/testsuite/gdb.cp/method.exp
gdb/testsuite/gdb.cp/method2.cc
gdb/testsuite/gdb.cp/method2.exp
gdb/testsuite/gdb.cp/minsym-fallback-main.cc
gdb/testsuite/gdb.cp/minsym-fallback.cc
gdb/testsuite/gdb.cp/minsym-fallback.exp
gdb/testsuite/gdb.cp/minsym-fallback.h
gdb/testsuite/gdb.cp/misc.cc
gdb/testsuite/gdb.cp/misc.exp
gdb/testsuite/gdb.cp/namespace-nested-import.cc
gdb/testsuite/gdb.cp/namespace-nested-import.exp
gdb/testsuite/gdb.cp/namespace.cc
gdb/testsuite/gdb.cp/namespace.exp
gdb/testsuite/gdb.cp/namespace1.cc
gdb/testsuite/gdb.cp/nextoverthrow.cc
gdb/testsuite/gdb.cp/nextoverthrow.exp
gdb/testsuite/gdb.cp/no-dmgl-verbose.cc
gdb/testsuite/gdb.cp/no-dmgl-verbose.exp
gdb/testsuite/gdb.cp/noparam.cc
gdb/testsuite/gdb.cp/noparam.exp
gdb/testsuite/gdb.cp/nsdecl.cc
gdb/testsuite/gdb.cp/nsdecl.exp
gdb/testsuite/gdb.cp/nsimport.cc
gdb/testsuite/gdb.cp/nsimport.exp
gdb/testsuite/gdb.cp/nsnested.cc
gdb/testsuite/gdb.cp/nsnested.exp
gdb/testsuite/gdb.cp/nsnoimports.cc
gdb/testsuite/gdb.cp/nsnoimports.exp
gdb/testsuite/gdb.cp/nsrecurs.cc
gdb/testsuite/gdb.cp/nsrecurs.exp
gdb/testsuite/gdb.cp/nsstress.cc
gdb/testsuite/gdb.cp/nsstress.exp
gdb/testsuite/gdb.cp/nsusing.cc
gdb/testsuite/gdb.cp/nsusing.exp
gdb/testsuite/gdb.cp/operator.cc
gdb/testsuite/gdb.cp/operator.exp
gdb/testsuite/gdb.cp/oranking.cc
gdb/testsuite/gdb.cp/oranking.exp
gdb/testsuite/gdb.cp/overload-const.cc
gdb/testsuite/gdb.cp/overload-const.exp
gdb/testsuite/gdb.cp/overload.cc
gdb/testsuite/gdb.cp/overload.exp
gdb/testsuite/gdb.cp/ovldbreak.cc
gdb/testsuite/gdb.cp/ovldbreak.exp
gdb/testsuite/gdb.cp/ovsrch.exp
gdb/testsuite/gdb.cp/ovsrch.h
gdb/testsuite/gdb.cp/ovsrch1.cc
gdb/testsuite/gdb.cp/ovsrch2.cc
gdb/testsuite/gdb.cp/ovsrch3.cc
gdb/testsuite/gdb.cp/ovsrch4.cc
gdb/testsuite/gdb.cp/paren-type.cc
gdb/testsuite/gdb.cp/paren-type.exp
gdb/testsuite/gdb.cp/pass-by-ref.cc
gdb/testsuite/gdb.cp/pass-by-ref.exp
gdb/testsuite/gdb.cp/pr-1023.cc
gdb/testsuite/gdb.cp/pr-1023.exp
gdb/testsuite/gdb.cp/pr-1210.cc
gdb/testsuite/gdb.cp/pr-1210.exp
gdb/testsuite/gdb.cp/pr-574.cc
gdb/testsuite/gdb.cp/pr-574.exp
gdb/testsuite/gdb.cp/pr10687.cc
gdb/testsuite/gdb.cp/pr10687.exp
gdb/testsuite/gdb.cp/pr10728-x.cc
gdb/testsuite/gdb.cp/pr10728-x.h
gdb/testsuite/gdb.cp/pr10728-y.cc
gdb/testsuite/gdb.cp/pr10728.exp
gdb/testsuite/gdb.cp/pr12028.cc
gdb/testsuite/gdb.cp/pr12028.exp
gdb/testsuite/gdb.cp/pr9067.cc
gdb/testsuite/gdb.cp/pr9067.exp
gdb/testsuite/gdb.cp/pr9167.cc
gdb/testsuite/gdb.cp/pr9167.exp
gdb/testsuite/gdb.cp/pr9594.cc
gdb/testsuite/gdb.cp/pr9631.cc
gdb/testsuite/gdb.cp/pr9631.exp
gdb/testsuite/gdb.cp/printmethod.cc
gdb/testsuite/gdb.cp/printmethod.exp
gdb/testsuite/gdb.cp/psmang.exp
gdb/testsuite/gdb.cp/psmang1.cc
gdb/testsuite/gdb.cp/psmang2.cc
gdb/testsuite/gdb.cp/psymtab-parameter.cc
gdb/testsuite/gdb.cp/psymtab-parameter.exp
gdb/testsuite/gdb.cp/ptype-cv-cp.cc
gdb/testsuite/gdb.cp/ptype-cv-cp.exp
gdb/testsuite/gdb.cp/punctuator.exp
gdb/testsuite/gdb.cp/re-set-overloaded.cc
gdb/testsuite/gdb.cp/re-set-overloaded.exp
gdb/testsuite/gdb.cp/ref-params.cc
gdb/testsuite/gdb.cp/ref-params.exp
gdb/testsuite/gdb.cp/ref-types.cc
gdb/testsuite/gdb.cp/ref-types.exp
gdb/testsuite/gdb.cp/rtti.exp
gdb/testsuite/gdb.cp/rtti.h
gdb/testsuite/gdb.cp/rtti1.cc
gdb/testsuite/gdb.cp/rtti2.cc
gdb/testsuite/gdb.cp/shadow.cc
gdb/testsuite/gdb.cp/shadow.exp
gdb/testsuite/gdb.cp/smartp.cc
gdb/testsuite/gdb.cp/smartp.exp
gdb/testsuite/gdb.cp/static-method.cc
gdb/testsuite/gdb.cp/static-method.exp
gdb/testsuite/gdb.cp/static-print-quit.cc
gdb/testsuite/gdb.cp/static-print-quit.exp
gdb/testsuite/gdb.cp/temargs.cc
gdb/testsuite/gdb.cp/temargs.exp
gdb/testsuite/gdb.cp/templates.cc
gdb/testsuite/gdb.cp/templates.exp
gdb/testsuite/gdb.cp/try_catch.cc
gdb/testsuite/gdb.cp/try_catch.exp
gdb/testsuite/gdb.cp/typedef-operator.cc
gdb/testsuite/gdb.cp/typedef-operator.exp
gdb/testsuite/gdb.cp/userdef.cc
gdb/testsuite/gdb.cp/userdef.exp
gdb/testsuite/gdb.cp/virtbase.cc
gdb/testsuite/gdb.cp/virtbase.exp
gdb/testsuite/gdb.cp/virtfunc.cc
gdb/testsuite/gdb.cp/virtfunc.exp
gdb/testsuite/gdb.cp/virtfunc2.cc
gdb/testsuite/gdb.cp/virtfunc2.exp
gdb/testsuite/gdb.disasm/Makefile.in
gdb/testsuite/gdb.disasm/am33.exp
gdb/testsuite/gdb.disasm/am33.s
gdb/testsuite/gdb.disasm/h8300s.exp
gdb/testsuite/gdb.disasm/h8300s.s
gdb/testsuite/gdb.disasm/hppa.exp
gdb/testsuite/gdb.disasm/hppa.s
gdb/testsuite/gdb.disasm/mn10200.s
gdb/testsuite/gdb.disasm/mn10300.exp
gdb/testsuite/gdb.disasm/mn10300.s
gdb/testsuite/gdb.disasm/sh3.exp
gdb/testsuite/gdb.disasm/sh3.s
gdb/testsuite/gdb.disasm/t01_mov.exp
gdb/testsuite/gdb.disasm/t01_mov.s
gdb/testsuite/gdb.disasm/t02_mova.exp
gdb/testsuite/gdb.disasm/t02_mova.s
gdb/testsuite/gdb.disasm/t03_add.exp
gdb/testsuite/gdb.disasm/t03_add.s
gdb/testsuite/gdb.disasm/t04_sub.exp
gdb/testsuite/gdb.disasm/t04_sub.s
gdb/testsuite/gdb.disasm/t05_cmp.exp
gdb/testsuite/gdb.disasm/t05_cmp.s
gdb/testsuite/gdb.disasm/t06_ari2.exp
gdb/testsuite/gdb.disasm/t06_ari2.s
gdb/testsuite/gdb.disasm/t07_ari3.exp
gdb/testsuite/gdb.disasm/t07_ari3.s
gdb/testsuite/gdb.disasm/t08_or.exp
gdb/testsuite/gdb.disasm/t08_or.s
gdb/testsuite/gdb.disasm/t09_xor.exp
gdb/testsuite/gdb.disasm/t09_xor.s
gdb/testsuite/gdb.disasm/t10_and.exp
gdb/testsuite/gdb.disasm/t10_and.s
gdb/testsuite/gdb.disasm/t11_logs.exp
gdb/testsuite/gdb.disasm/t11_logs.s
gdb/testsuite/gdb.disasm/t12_bit.exp
gdb/testsuite/gdb.disasm/t12_bit.s
gdb/testsuite/gdb.disasm/t13_otr.exp
gdb/testsuite/gdb.disasm/t13_otr.s
gdb/testsuite/gdb.dwarf2/Makefile.in
gdb/testsuite/gdb.dwarf2/callframecfa.S
gdb/testsuite/gdb.dwarf2/callframecfa.exp
gdb/testsuite/gdb.dwarf2/clztest.S
gdb/testsuite/gdb.dwarf2/clztest.c
gdb/testsuite/gdb.dwarf2/clztest.exp
gdb/testsuite/gdb.dwarf2/dup-psym.S
gdb/testsuite/gdb.dwarf2/dup-psym.exp
gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.S
gdb/testsuite/gdb.dwarf2/dw2-ada-ffffffff.exp
gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.S
gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp
gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.S
gdb/testsuite/gdb.dwarf2/dw2-bad-parameter-type.exp
gdb/testsuite/gdb.dwarf2/dw2-basic.S
gdb/testsuite/gdb.dwarf2/dw2-basic.exp
gdb/testsuite/gdb.dwarf2/dw2-case-insensitive-debug.S
gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.c
gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp
gdb/testsuite/gdb.dwarf2/dw2-compressed.S
gdb/testsuite/gdb.dwarf2/dw2-compressed.exp
gdb/testsuite/gdb.dwarf2/dw2-const.S
gdb/testsuite/gdb.dwarf2/dw2-const.exp
gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static-main.c
gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.S
gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
gdb/testsuite/gdb.dwarf2/dw2-cu-size.S
gdb/testsuite/gdb.dwarf2/dw2-cu-size.exp
gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.S
gdb/testsuite/gdb.dwarf2/dw2-double-set-die-type.exp
gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S
gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.exp
gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.S
gdb/testsuite/gdb.dwarf2/dw2-empty-pc-range.exp
gdb/testsuite/gdb.dwarf2/dw2-entry-value-main.c
gdb/testsuite/gdb.dwarf2/dw2-entry-value.S
gdb/testsuite/gdb.dwarf2/dw2-entry-value.exp
gdb/testsuite/gdb.dwarf2/dw2-filename.S
gdb/testsuite/gdb.dwarf2/dw2-filename.exp
gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S
gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c
gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
gdb/testsuite/gdb.dwarf2/dw2-inheritance.S
gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp
gdb/testsuite/gdb.dwarf2/dw2-inline-param-main.c
gdb/testsuite/gdb.dwarf2/dw2-inline-param.S
gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
gdb/testsuite/gdb.dwarf2/dw2-intercu.S
gdb/testsuite/gdb.dwarf2/dw2-intercu.exp
gdb/testsuite/gdb.dwarf2/dw2-intermix.S
gdb/testsuite/gdb.dwarf2/dw2-intermix.exp
gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust-main.cc
gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.S
gdb/testsuite/gdb.dwarf2/dw2-linkage-name-trust.exp
gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.S
gdb/testsuite/gdb.dwarf2/dw2-modula2-self-type.exp
gdb/testsuite/gdb.dwarf2/dw2-noloc-main.c
gdb/testsuite/gdb.dwarf2/dw2-noloc.S
gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
gdb/testsuite/gdb.dwarf2/dw2-op-call.S
gdb/testsuite/gdb.dwarf2/dw2-op-call.exp
gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.S
gdb/testsuite/gdb.dwarf2/dw2-op-stack-value.exp
gdb/testsuite/gdb.dwarf2/dw2-param-error-main.c
gdb/testsuite/gdb.dwarf2/dw2-param-error.S
gdb/testsuite/gdb.dwarf2/dw2-param-error.exp
gdb/testsuite/gdb.dwarf2/dw2-producer.S
gdb/testsuite/gdb.dwarf2/dw2-producer.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges.c
gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges2.c
gdb/testsuite/gdb.dwarf2/dw2-ranges3.c
gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-func.c
gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-main.c
gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S
gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
gdb/testsuite/gdb.dwarf2/dw2-restore.S
gdb/testsuite/gdb.dwarf2/dw2-restore.exp
gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.S
gdb/testsuite/gdb.dwarf2/dw2-simple-locdesc.exp
gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S
gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.c
gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp
gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.S
gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp
gdb/testsuite/gdb.dwarf2/dw2-strp.S
gdb/testsuite/gdb.dwarf2/dw2-strp.exp
gdb/testsuite/gdb.dwarf2/dw2-unresolved-main.c
gdb/testsuite/gdb.dwarf2/dw2-unresolved.S
gdb/testsuite/gdb.dwarf2/dw2-unresolved.exp
gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.S
gdb/testsuite/gdb.dwarf2/dw4-sig-type-unused.exp
gdb/testsuite/gdb.dwarf2/dw4-sig-types-b.cc
gdb/testsuite/gdb.dwarf2/dw4-sig-types.cc
gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp
gdb/testsuite/gdb.dwarf2/dw4-sig-types.h
gdb/testsuite/gdb.dwarf2/file1.txt
gdb/testsuite/gdb.dwarf2/implptr.S
gdb/testsuite/gdb.dwarf2/implptr.c
gdb/testsuite/gdb.dwarf2/implptr.exp
gdb/testsuite/gdb.dwarf2/mac-fileno.S
gdb/testsuite/gdb.dwarf2/mac-fileno.exp
gdb/testsuite/gdb.dwarf2/main.c
gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.S
gdb/testsuite/gdb.dwarf2/member-ptr-forwardref.exp
gdb/testsuite/gdb.dwarf2/pieces.S
gdb/testsuite/gdb.dwarf2/pieces.c
gdb/testsuite/gdb.dwarf2/pieces.exp
gdb/testsuite/gdb.dwarf2/pr10770.c
gdb/testsuite/gdb.dwarf2/pr10770.exp
gdb/testsuite/gdb.dwarf2/pr11465.S
gdb/testsuite/gdb.dwarf2/pr11465.exp
gdb/testsuite/gdb.dwarf2/typeddwarf-amd64.S
gdb/testsuite/gdb.dwarf2/typeddwarf.S
gdb/testsuite/gdb.dwarf2/typeddwarf.c
gdb/testsuite/gdb.dwarf2/typeddwarf.exp
gdb/testsuite/gdb.dwarf2/valop.S
gdb/testsuite/gdb.dwarf2/valop.exp
gdb/testsuite/gdb.dwarf2/watch-notconst.c
gdb/testsuite/gdb.dwarf2/watch-notconst.exp
gdb/testsuite/gdb.dwarf2/watch-notconst2.S
gdb/testsuite/gdb.dwarf2/watch-notconst2.c
gdb/testsuite/gdb.fortran/Makefile.in
gdb/testsuite/gdb.fortran/array-element.exp
gdb/testsuite/gdb.fortran/array-element.f
gdb/testsuite/gdb.fortran/charset.exp
gdb/testsuite/gdb.fortran/charset.f90
gdb/testsuite/gdb.fortran/complex.exp
gdb/testsuite/gdb.fortran/complex.f
gdb/testsuite/gdb.fortran/derived-type.exp
gdb/testsuite/gdb.fortran/derived-type.f90
gdb/testsuite/gdb.fortran/exprs.exp
gdb/testsuite/gdb.fortran/library-module-lib.f90
gdb/testsuite/gdb.fortran/library-module-main.f90
gdb/testsuite/gdb.fortran/library-module.exp
gdb/testsuite/gdb.fortran/logical.exp
gdb/testsuite/gdb.fortran/logical.f90
gdb/testsuite/gdb.fortran/module.exp
gdb/testsuite/gdb.fortran/module.f90
gdb/testsuite/gdb.fortran/multi-dim.exp
gdb/testsuite/gdb.fortran/multi-dim.f90
gdb/testsuite/gdb.fortran/subarray.exp
gdb/testsuite/gdb.fortran/subarray.f
gdb/testsuite/gdb.fortran/types.exp
gdb/testsuite/gdb.gdb/complaints.exp
gdb/testsuite/gdb.gdb/observer.exp
gdb/testsuite/gdb.gdb/selftest.exp
gdb/testsuite/gdb.gdb/xfullpath.exp
gdb/testsuite/gdb.hp/Makefile.in
gdb/testsuite/gdb.hp/gdb.aCC/Makefile.in
gdb/testsuite/gdb.hp/gdb.aCC/exception.exp
gdb/testsuite/gdb.hp/gdb.aCC/optimize.c
gdb/testsuite/gdb.hp/gdb.aCC/optimize.exp
gdb/testsuite/gdb.hp/gdb.aCC/run.c
gdb/testsuite/gdb.hp/gdb.aCC/watch-cmd.exp
gdb/testsuite/gdb.hp/gdb.base-hp/Makefile.in
gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c
gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.exp
gdb/testsuite/gdb.hp/gdb.base-hp/dollar.c
gdb/testsuite/gdb.hp/gdb.base-hp/dollar.exp
gdb/testsuite/gdb.hp/gdb.base-hp/genso-thresh.c
gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.c
gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.exp
gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.c
gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.exp
gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.exp
gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.s
gdb/testsuite/gdb.hp/gdb.base-hp/reg.exp
gdb/testsuite/gdb.hp/gdb.base-hp/reg.s
gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.c
gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.exp
gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.exp
gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.mk
gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.sh
gdb/testsuite/gdb.hp/gdb.compat/Makefile.in
gdb/testsuite/gdb.hp/gdb.compat/average.c
gdb/testsuite/gdb.hp/gdb.compat/sum.c
gdb/testsuite/gdb.hp/gdb.compat/xdb.c
gdb/testsuite/gdb.hp/gdb.compat/xdb0.c
gdb/testsuite/gdb.hp/gdb.compat/xdb0.h
gdb/testsuite/gdb.hp/gdb.compat/xdb1.c
gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp
gdb/testsuite/gdb.hp/gdb.compat/xdb2.exp
gdb/testsuite/gdb.hp/gdb.compat/xdb3.exp
gdb/testsuite/gdb.hp/gdb.defects/Makefile.in
gdb/testsuite/gdb.hp/gdb.defects/bs14602.c
gdb/testsuite/gdb.hp/gdb.defects/bs14602.exp
gdb/testsuite/gdb.hp/gdb.defects/solib-d.c
gdb/testsuite/gdb.hp/gdb.defects/solib-d.exp
gdb/testsuite/gdb.hp/gdb.defects/solib-d1.c
gdb/testsuite/gdb.hp/gdb.defects/solib-d2.c
gdb/testsuite/gdb.hp/gdb.objdbg/Makefile.in
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01.exp
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x1.cc
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x2.cc
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.cc
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.h
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02.exp
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x1.cc
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x2.cc
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x3.cc
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03.exp
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x1.cc
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x2.cc
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x3.cc
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04.exp
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x.h
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x1.cc
gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x2.cc
gdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr
gdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr.pa64
gdb/testsuite/gdb.hp/gdb.objdbg/tools/test-objdbg.cc
gdb/testsuite/gdb.hp/tools/odump
gdb/testsuite/gdb.java/Makefile.in
gdb/testsuite/gdb.java/jmain.exp
gdb/testsuite/gdb.java/jmain.java
gdb/testsuite/gdb.java/jmisc.exp
gdb/testsuite/gdb.java/jmisc.java
gdb/testsuite/gdb.java/jnpe.exp
gdb/testsuite/gdb.java/jnpe.java
gdb/testsuite/gdb.java/jprint.exp
gdb/testsuite/gdb.java/jprint.java
gdb/testsuite/gdb.java/jv-exp.exp
gdb/testsuite/gdb.java/jv-print.exp
gdb/testsuite/gdb.mi/ChangeLog-1999-2003
gdb/testsuite/gdb.mi/Makefile.in
gdb/testsuite/gdb.mi/array.f
gdb/testsuite/gdb.mi/basics.c
gdb/testsuite/gdb.mi/dw2-ref-missing-frame-func.c
gdb/testsuite/gdb.mi/dw2-ref-missing-frame-main.c
gdb/testsuite/gdb.mi/dw2-ref-missing-frame.S
gdb/testsuite/gdb.mi/dw2-ref-missing-frame.exp
gdb/testsuite/gdb.mi/gdb2549.exp
gdb/testsuite/gdb.mi/gdb669.exp
gdb/testsuite/gdb.mi/gdb680.exp
gdb/testsuite/gdb.mi/gdb701.c
gdb/testsuite/gdb.mi/gdb701.exp
gdb/testsuite/gdb.mi/gdb792.cc
gdb/testsuite/gdb.mi/gdb792.exp
gdb/testsuite/gdb.mi/mi-async.exp
gdb/testsuite/gdb.mi/mi-basics.exp
gdb/testsuite/gdb.mi/mi-break.exp
gdb/testsuite/gdb.mi/mi-cli.exp
gdb/testsuite/gdb.mi/mi-console.c
gdb/testsuite/gdb.mi/mi-console.exp
gdb/testsuite/gdb.mi/mi-disassemble.exp
gdb/testsuite/gdb.mi/mi-eval.exp
gdb/testsuite/gdb.mi/mi-file-transfer.exp
gdb/testsuite/gdb.mi/mi-file.exp
gdb/testsuite/gdb.mi/mi-hack-cli.exp
gdb/testsuite/gdb.mi/mi-inheritance-syntax-error.cc
gdb/testsuite/gdb.mi/mi-inheritance-syntax-error.exp
gdb/testsuite/gdb.mi/mi-nonstop-exit.exp
gdb/testsuite/gdb.mi/mi-nonstop.exp
gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp
gdb/testsuite/gdb.mi/mi-nsintrall.exp
gdb/testsuite/gdb.mi/mi-nsmoribund.exp
gdb/testsuite/gdb.mi/mi-nsthrexec.exp
gdb/testsuite/gdb.mi/mi-pending.c
gdb/testsuite/gdb.mi/mi-pending.exp
gdb/testsuite/gdb.mi/mi-pendshr.c
gdb/testsuite/gdb.mi/mi-pthreads.exp
gdb/testsuite/gdb.mi/mi-read-memory.c
gdb/testsuite/gdb.mi/mi-read-memory.exp
gdb/testsuite/gdb.mi/mi-regs.exp
gdb/testsuite/gdb.mi/mi-return.exp
gdb/testsuite/gdb.mi/mi-reverse.exp
gdb/testsuite/gdb.mi/mi-simplerun.exp
gdb/testsuite/gdb.mi/mi-stack.c
gdb/testsuite/gdb.mi/mi-stack.exp
gdb/testsuite/gdb.mi/mi-stepi.exp
gdb/testsuite/gdb.mi/mi-syn-frame.c
gdb/testsuite/gdb.mi/mi-syn-frame.exp
gdb/testsuite/gdb.mi/mi-until.exp
gdb/testsuite/gdb.mi/mi-var-block.exp
gdb/testsuite/gdb.mi/mi-var-child-f.exp
gdb/testsuite/gdb.mi/mi-var-child.c
gdb/testsuite/gdb.mi/mi-var-child.exp
gdb/testsuite/gdb.mi/mi-var-cmd.exp
gdb/testsuite/gdb.mi/mi-var-cp.cc
gdb/testsuite/gdb.mi/mi-var-cp.exp
gdb/testsuite/gdb.mi/mi-var-display.exp
gdb/testsuite/gdb.mi/mi-var-invalidate.exp
gdb/testsuite/gdb.mi/mi-watch.exp
gdb/testsuite/gdb.mi/mi2-basics.exp
gdb/testsuite/gdb.mi/mi2-break.exp
gdb/testsuite/gdb.mi/mi2-cli.exp
gdb/testsuite/gdb.mi/mi2-console.exp
gdb/testsuite/gdb.mi/mi2-disassemble.exp
gdb/testsuite/gdb.mi/mi2-eval.exp
gdb/testsuite/gdb.mi/mi2-file.exp
gdb/testsuite/gdb.mi/mi2-hack-cli.exp
gdb/testsuite/gdb.mi/mi2-pthreads.exp
gdb/testsuite/gdb.mi/mi2-read-memory.exp
gdb/testsuite/gdb.mi/mi2-regs.exp
gdb/testsuite/gdb.mi/mi2-return.exp
gdb/testsuite/gdb.mi/mi2-simplerun.exp
gdb/testsuite/gdb.mi/mi2-stack.exp
gdb/testsuite/gdb.mi/mi2-stepi.exp
gdb/testsuite/gdb.mi/mi2-syn-frame.exp
gdb/testsuite/gdb.mi/mi2-until.exp
gdb/testsuite/gdb.mi/mi2-var-block.exp
gdb/testsuite/gdb.mi/mi2-var-child.exp
gdb/testsuite/gdb.mi/mi2-var-cmd.exp
gdb/testsuite/gdb.mi/mi2-var-display.exp
gdb/testsuite/gdb.mi/mi2-watch.exp
gdb/testsuite/gdb.mi/non-stop-exit.c
gdb/testsuite/gdb.mi/non-stop.c
gdb/testsuite/gdb.mi/ns-stale-regcache.c
gdb/testsuite/gdb.mi/nsintrall.c
gdb/testsuite/gdb.mi/nsmoribund.c
gdb/testsuite/gdb.mi/nsthrexec.c
gdb/testsuite/gdb.mi/pthreads.c
gdb/testsuite/gdb.mi/testcmds
gdb/testsuite/gdb.mi/until.c
gdb/testsuite/gdb.mi/var-cmd.c
gdb/testsuite/gdb.modula2/Makefile.in
gdb/testsuite/gdb.modula2/unbounded-array.exp
gdb/testsuite/gdb.modula2/unbounded1.c
gdb/testsuite/gdb.multi/Makefile.in
gdb/testsuite/gdb.multi/base.exp
gdb/testsuite/gdb.multi/bkpt-multi-exec.c
gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
gdb/testsuite/gdb.multi/crashme.c
gdb/testsuite/gdb.multi/goodbye.c
gdb/testsuite/gdb.multi/hangout.c
gdb/testsuite/gdb.multi/hello.c
gdb/testsuite/gdb.objc/Makefile.in
gdb/testsuite/gdb.objc/basicclass.exp
gdb/testsuite/gdb.objc/basicclass.m
gdb/testsuite/gdb.objc/nondebug.exp
gdb/testsuite/gdb.objc/nondebug.m
gdb/testsuite/gdb.objc/objcdecode.exp
gdb/testsuite/gdb.objc/objcdecode.m
gdb/testsuite/gdb.objc/print.exp
gdb/testsuite/gdb.opencl/Makefile.in
gdb/testsuite/gdb.opencl/callfuncs.cl
gdb/testsuite/gdb.opencl/callfuncs.exp
gdb/testsuite/gdb.opencl/convs_casts.cl
gdb/testsuite/gdb.opencl/convs_casts.exp
gdb/testsuite/gdb.opencl/datatypes.cl
gdb/testsuite/gdb.opencl/datatypes.exp
gdb/testsuite/gdb.opencl/operators.cl
gdb/testsuite/gdb.opencl/operators.exp
gdb/testsuite/gdb.opencl/vec_comps.cl
gdb/testsuite/gdb.opencl/vec_comps.exp
gdb/testsuite/gdb.opt/Makefile.in
gdb/testsuite/gdb.opt/clobbered-registers-O2.c
gdb/testsuite/gdb.opt/clobbered-registers-O2.exp
gdb/testsuite/gdb.opt/inline-bt.c
gdb/testsuite/gdb.opt/inline-bt.exp
gdb/testsuite/gdb.opt/inline-cmds.c
gdb/testsuite/gdb.opt/inline-cmds.exp
gdb/testsuite/gdb.opt/inline-locals.c
gdb/testsuite/gdb.opt/inline-locals.exp
gdb/testsuite/gdb.opt/inline-markers.c
gdb/testsuite/gdb.pascal/Makefile.in
gdb/testsuite/gdb.pascal/floats.exp
gdb/testsuite/gdb.pascal/floats.pas
gdb/testsuite/gdb.pascal/gdb11492.exp
gdb/testsuite/gdb.pascal/gdb11492.pas
gdb/testsuite/gdb.pascal/hello.exp
gdb/testsuite/gdb.pascal/hello.pas
gdb/testsuite/gdb.pascal/integers.exp
gdb/testsuite/gdb.pascal/integers.pas
gdb/testsuite/gdb.pascal/print.exp
gdb/testsuite/gdb.pascal/types.exp
gdb/testsuite/gdb.python/Makefile.in
gdb/testsuite/gdb.python/lib-types.cc
gdb/testsuite/gdb.python/lib-types.exp
gdb/testsuite/gdb.python/py-block.c
gdb/testsuite/gdb.python/py-block.exp
gdb/testsuite/gdb.python/py-breakpoint.c
gdb/testsuite/gdb.python/py-breakpoint.exp
gdb/testsuite/gdb.python/py-cmd.exp
gdb/testsuite/gdb.python/py-error.exp
gdb/testsuite/gdb.python/py-error.py
gdb/testsuite/gdb.python/py-events.c
gdb/testsuite/gdb.python/py-events.exp
gdb/testsuite/gdb.python/py-events.py
gdb/testsuite/gdb.python/py-evsignal.exp
gdb/testsuite/gdb.python/py-evthreads.c
gdb/testsuite/gdb.python/py-evthreads.exp
gdb/testsuite/gdb.python/py-frame-inline.c
gdb/testsuite/gdb.python/py-frame-inline.exp
gdb/testsuite/gdb.python/py-frame.c
gdb/testsuite/gdb.python/py-frame.exp
gdb/testsuite/gdb.python/py-function.exp
gdb/testsuite/gdb.python/py-inferior.c
gdb/testsuite/gdb.python/py-inferior.exp
gdb/testsuite/gdb.python/py-infthread.c
gdb/testsuite/gdb.python/py-infthread.exp
gdb/testsuite/gdb.python/py-mi.exp
gdb/testsuite/gdb.python/py-objfile-script-gdb.py.in
gdb/testsuite/gdb.python/py-objfile-script.c
gdb/testsuite/gdb.python/py-objfile-script.exp
gdb/testsuite/gdb.python/py-objfile.c
gdb/testsuite/gdb.python/py-objfile.exp
gdb/testsuite/gdb.python/py-parameter.exp
gdb/testsuite/gdb.python/py-pp-maint.c
gdb/testsuite/gdb.python/py-pp-maint.exp
gdb/testsuite/gdb.python/py-pp-maint.py
gdb/testsuite/gdb.python/py-prettyprint.c
gdb/testsuite/gdb.python/py-prettyprint.exp
gdb/testsuite/gdb.python/py-prettyprint.py
gdb/testsuite/gdb.python/py-progspace.c
gdb/testsuite/gdb.python/py-progspace.exp
gdb/testsuite/gdb.python/py-prompt.c
gdb/testsuite/gdb.python/py-prompt.exp
gdb/testsuite/gdb.python/py-section-script.c
gdb/testsuite/gdb.python/py-section-script.exp
gdb/testsuite/gdb.python/py-section-script.py
gdb/testsuite/gdb.python/py-shared-sl.c
gdb/testsuite/gdb.python/py-shared.c
gdb/testsuite/gdb.python/py-shared.exp
gdb/testsuite/gdb.python/py-symbol.c
gdb/testsuite/gdb.python/py-symbol.exp
gdb/testsuite/gdb.python/py-symtab.exp
gdb/testsuite/gdb.python/py-template.cc
gdb/testsuite/gdb.python/py-template.exp
gdb/testsuite/gdb.python/py-type.c
gdb/testsuite/gdb.python/py-type.exp
gdb/testsuite/gdb.python/py-value.c
gdb/testsuite/gdb.python/py-value.exp
gdb/testsuite/gdb.python/python-1.c
gdb/testsuite/gdb.python/python.c
gdb/testsuite/gdb.python/python.exp
gdb/testsuite/gdb.python/source1
gdb/testsuite/gdb.python/source2.py
gdb/testsuite/gdb.reverse/Makefile.in
gdb/testsuite/gdb.reverse/break-precsave.exp
gdb/testsuite/gdb.reverse/break-reverse.c
gdb/testsuite/gdb.reverse/break-reverse.exp
gdb/testsuite/gdb.reverse/consecutive-precsave.exp
gdb/testsuite/gdb.reverse/consecutive-reverse.c
gdb/testsuite/gdb.reverse/consecutive-reverse.exp
gdb/testsuite/gdb.reverse/finish-precsave.exp
gdb/testsuite/gdb.reverse/finish-reverse-bkpt.exp
gdb/testsuite/gdb.reverse/finish-reverse.c
gdb/testsuite/gdb.reverse/finish-reverse.exp
gdb/testsuite/gdb.reverse/i386-precsave.exp
gdb/testsuite/gdb.reverse/i386-reverse.c
gdb/testsuite/gdb.reverse/i386-reverse.exp
gdb/testsuite/gdb.reverse/i386-sse-reverse.c
gdb/testsuite/gdb.reverse/i386-sse-reverse.exp
gdb/testsuite/gdb.reverse/i387-env-reverse.c
gdb/testsuite/gdb.reverse/i387-env-reverse.exp
gdb/testsuite/gdb.reverse/i387-stack-reverse.c
gdb/testsuite/gdb.reverse/i387-stack-reverse.exp
gdb/testsuite/gdb.reverse/machinestate-precsave.exp
gdb/testsuite/gdb.reverse/machinestate.c
gdb/testsuite/gdb.reverse/machinestate.exp
gdb/testsuite/gdb.reverse/ms1.c
gdb/testsuite/gdb.reverse/next-reverse-bkpt-over-sr.exp
gdb/testsuite/gdb.reverse/shr2.c
gdb/testsuite/gdb.reverse/sigall-precsave.exp
gdb/testsuite/gdb.reverse/sigall-reverse.c
gdb/testsuite/gdb.reverse/sigall-reverse.exp
gdb/testsuite/gdb.reverse/solib-precsave.exp
gdb/testsuite/gdb.reverse/solib-reverse.c
gdb/testsuite/gdb.reverse/solib-reverse.exp
gdb/testsuite/gdb.reverse/step-precsave.exp
gdb/testsuite/gdb.reverse/step-reverse.c
gdb/testsuite/gdb.reverse/step-reverse.exp
gdb/testsuite/gdb.reverse/until-precsave.exp
gdb/testsuite/gdb.reverse/until-reverse.c
gdb/testsuite/gdb.reverse/until-reverse.exp
gdb/testsuite/gdb.reverse/ur1.c
gdb/testsuite/gdb.reverse/watch-precsave.exp
gdb/testsuite/gdb.reverse/watch-reverse.c
gdb/testsuite/gdb.reverse/watch-reverse.exp
gdb/testsuite/gdb.server/Makefile.in
gdb/testsuite/gdb.server/ext-attach.c
gdb/testsuite/gdb.server/ext-attach.exp
gdb/testsuite/gdb.server/ext-run.exp
gdb/testsuite/gdb.server/file-transfer.exp
gdb/testsuite/gdb.server/server-mon.exp
gdb/testsuite/gdb.server/server-run.exp
gdb/testsuite/gdb.server/server.c
gdb/testsuite/gdb.server/transfer.txt
gdb/testsuite/gdb.stabs/Makefile.in
gdb/testsuite/gdb.stabs/aout.sed
gdb/testsuite/gdb.stabs/ecoff.sed
gdb/testsuite/gdb.stabs/exclfwd.exp
gdb/testsuite/gdb.stabs/exclfwd.h
gdb/testsuite/gdb.stabs/exclfwd1.c
gdb/testsuite/gdb.stabs/exclfwd2.c
gdb/testsuite/gdb.stabs/gdb11479.c
gdb/testsuite/gdb.stabs/gdb11479.exp
gdb/testsuite/gdb.stabs/hppa.sed
gdb/testsuite/gdb.stabs/weird.def
gdb/testsuite/gdb.stabs/weird.exp
gdb/testsuite/gdb.stabs/xcoff.sed
gdb/testsuite/gdb.threads/Makefile.in
gdb/testsuite/gdb.threads/attach-into-signal.c
gdb/testsuite/gdb.threads/attach-into-signal.exp
gdb/testsuite/gdb.threads/attach-stopped.c
gdb/testsuite/gdb.threads/attach-stopped.exp
gdb/testsuite/gdb.threads/attachstop-mt.c
gdb/testsuite/gdb.threads/attachstop-mt.exp
gdb/testsuite/gdb.threads/bp_in_thread.c
gdb/testsuite/gdb.threads/bp_in_thread.exp
gdb/testsuite/gdb.threads/corethreads.c
gdb/testsuite/gdb.threads/corethreads.exp
gdb/testsuite/gdb.threads/current-lwp-dead.c
gdb/testsuite/gdb.threads/current-lwp-dead.exp
gdb/testsuite/gdb.threads/execl.c
gdb/testsuite/gdb.threads/execl.exp
gdb/testsuite/gdb.threads/execl1.c
gdb/testsuite/gdb.threads/fork-child-threads.c
gdb/testsuite/gdb.threads/fork-child-threads.exp
gdb/testsuite/gdb.threads/fork-thread-pending.c
gdb/testsuite/gdb.threads/fork-thread-pending.exp
gdb/testsuite/gdb.threads/gcore-thread.exp
gdb/testsuite/gdb.threads/hand-call-in-threads.c
gdb/testsuite/gdb.threads/hand-call-in-threads.exp
gdb/testsuite/gdb.threads/ia64-sigill.c
gdb/testsuite/gdb.threads/ia64-sigill.exp
gdb/testsuite/gdb.threads/interrupted-hand-call.c
gdb/testsuite/gdb.threads/interrupted-hand-call.exp
gdb/testsuite/gdb.threads/killed.c
gdb/testsuite/gdb.threads/killed.exp
gdb/testsuite/gdb.threads/leader-exit.c
gdb/testsuite/gdb.threads/leader-exit.exp
gdb/testsuite/gdb.threads/linux-dp.c
gdb/testsuite/gdb.threads/linux-dp.exp
gdb/testsuite/gdb.threads/local-watch-wrong-thread.c
gdb/testsuite/gdb.threads/local-watch-wrong-thread.exp
gdb/testsuite/gdb.threads/manythreads.c
gdb/testsuite/gdb.threads/manythreads.exp
gdb/testsuite/gdb.threads/multi-create.c
gdb/testsuite/gdb.threads/multi-create.exp
gdb/testsuite/gdb.threads/pending-step.c
gdb/testsuite/gdb.threads/pending-step.exp
gdb/testsuite/gdb.threads/print-threads.c
gdb/testsuite/gdb.threads/print-threads.exp
gdb/testsuite/gdb.threads/pthread_cond_wait.c
gdb/testsuite/gdb.threads/pthread_cond_wait.exp
gdb/testsuite/gdb.threads/pthreads.c
gdb/testsuite/gdb.threads/pthreads.exp
gdb/testsuite/gdb.threads/schedlock.c
gdb/testsuite/gdb.threads/schedlock.exp
gdb/testsuite/gdb.threads/sigthread.c
gdb/testsuite/gdb.threads/sigthread.exp
gdb/testsuite/gdb.threads/staticthreads.c
gdb/testsuite/gdb.threads/staticthreads.exp
gdb/testsuite/gdb.threads/step.c
gdb/testsuite/gdb.threads/step.exp
gdb/testsuite/gdb.threads/step2.exp
gdb/testsuite/gdb.threads/switch-threads.c
gdb/testsuite/gdb.threads/switch-threads.exp
gdb/testsuite/gdb.threads/thread-execl.c
gdb/testsuite/gdb.threads/thread-execl.exp
gdb/testsuite/gdb.threads/thread-find.exp
gdb/testsuite/gdb.threads/thread-specific.c
gdb/testsuite/gdb.threads/thread-specific.exp
gdb/testsuite/gdb.threads/thread-unwindonsignal.exp
gdb/testsuite/gdb.threads/thread_check.c
gdb/testsuite/gdb.threads/thread_check.exp
gdb/testsuite/gdb.threads/thread_events.c
gdb/testsuite/gdb.threads/thread_events.exp
gdb/testsuite/gdb.threads/threadapply.c
gdb/testsuite/gdb.threads/threadapply.exp
gdb/testsuite/gdb.threads/threxit-hop-specific.c
gdb/testsuite/gdb.threads/threxit-hop-specific.exp
gdb/testsuite/gdb.threads/tls-main.c
gdb/testsuite/gdb.threads/tls-nodebug.c
gdb/testsuite/gdb.threads/tls-nodebug.exp
gdb/testsuite/gdb.threads/tls-shared.c
gdb/testsuite/gdb.threads/tls-shared.exp
gdb/testsuite/gdb.threads/tls.c
gdb/testsuite/gdb.threads/tls.exp
gdb/testsuite/gdb.threads/tls2.c
gdb/testsuite/gdb.threads/watchthreads-reorder.c
gdb/testsuite/gdb.threads/watchthreads-reorder.exp
gdb/testsuite/gdb.threads/watchthreads.c
gdb/testsuite/gdb.threads/watchthreads.exp
gdb/testsuite/gdb.threads/watchthreads2.c
gdb/testsuite/gdb.threads/watchthreads2.exp
gdb/testsuite/gdb.trace/Makefile.in
gdb/testsuite/gdb.trace/actions.c
gdb/testsuite/gdb.trace/actions.exp
gdb/testsuite/gdb.trace/ax.exp
gdb/testsuite/gdb.trace/backtrace.exp
gdb/testsuite/gdb.trace/circ.c
gdb/testsuite/gdb.trace/circ.exp
gdb/testsuite/gdb.trace/collection.c
gdb/testsuite/gdb.trace/collection.exp
gdb/testsuite/gdb.trace/deltrace.exp
gdb/testsuite/gdb.trace/infotrace.exp
gdb/testsuite/gdb.trace/packetlen.exp
gdb/testsuite/gdb.trace/passc-dyn.exp
gdb/testsuite/gdb.trace/passcount.exp
gdb/testsuite/gdb.trace/report.exp
gdb/testsuite/gdb.trace/save-trace.exp
gdb/testsuite/gdb.trace/tfile.c
gdb/testsuite/gdb.trace/tfile.exp
gdb/testsuite/gdb.trace/tfind.exp
gdb/testsuite/gdb.trace/tracecmd.exp
gdb/testsuite/gdb.trace/tspeed.c
gdb/testsuite/gdb.trace/tspeed.exp
gdb/testsuite/gdb.trace/tsv.exp
gdb/testsuite/gdb.trace/unavailable.cc
gdb/testsuite/gdb.trace/unavailable.exp
gdb/testsuite/gdb.trace/while-dyn.exp
gdb/testsuite/gdb.trace/while-stepping.exp
gdb/testsuite/gdb.xml/Makefile.in
gdb/testsuite/gdb.xml/bad-include.xml
gdb/testsuite/gdb.xml/core-only.xml
gdb/testsuite/gdb.xml/extra-regs.xml
gdb/testsuite/gdb.xml/inc-2.xml
gdb/testsuite/gdb.xml/inc-body.xml
gdb/testsuite/gdb.xml/includes.xml
gdb/testsuite/gdb.xml/loop.xml
gdb/testsuite/gdb.xml/single-reg.xml
gdb/testsuite/gdb.xml/tdesc-arch.exp
gdb/testsuite/gdb.xml/tdesc-bogus.xml
gdb/testsuite/gdb.xml/tdesc-errors.exp
gdb/testsuite/gdb.xml/tdesc-regs.exp
gdb/testsuite/gdb.xml/tdesc-unknown.xml
gdb/testsuite/gdb.xml/tdesc-xinclude.exp
gdb/testsuite/gdb.xml/trivial.xml
gdb/testsuite/lib/ada.exp
gdb/testsuite/lib/cell.exp
gdb/testsuite/lib/cl_util.c
gdb/testsuite/lib/cl_util.h
gdb/testsuite/lib/compiler.c
gdb/testsuite/lib/compiler.cc
gdb/testsuite/lib/cp-support.exp
gdb/testsuite/lib/dwarf.exp
gdb/testsuite/lib/fortran.exp
gdb/testsuite/lib/future.exp
gdb/testsuite/lib/gdb-python.exp
gdb/testsuite/lib/gdb.exp
gdb/testsuite/lib/gdbserver-support.exp
gdb/testsuite/lib/java.exp
gdb/testsuite/lib/mi-support.exp
gdb/testsuite/lib/objc.exp
gdb/testsuite/lib/opencl.exp
gdb/testsuite/lib/opencl_hostapp.c
gdb/testsuite/lib/opencl_kernel.cl
gdb/testsuite/lib/pascal.exp
gdb/testsuite/lib/prelink-support.exp
gdb/testsuite/lib/prompt.exp
gdb/testsuite/lib/set_unbuffered_mode.c
gdb/testsuite/lib/trace-support.exp
gdb/thread.c
gdb/tic6x-linux-tdep.c
gdb/tic6x-tdep.c
gdb/tic6x-tdep.h
gdb/top.c
gdb/top.h
gdb/tracepoint.c
gdb/tracepoint.h
gdb/trad-frame.c
gdb/trad-frame.h
gdb/tramp-frame.c
gdb/tramp-frame.h
gdb/tui/ChangeLog-1998-2003
gdb/tui/tui-command.c
gdb/tui/tui-command.h
gdb/tui/tui-data.c
gdb/tui/tui-data.h
gdb/tui/tui-disasm.c
gdb/tui/tui-disasm.h
gdb/tui/tui-file.c
gdb/tui/tui-file.h
gdb/tui/tui-hooks.c
gdb/tui/tui-hooks.h
gdb/tui/tui-interp.c
gdb/tui/tui-io.c
gdb/tui/tui-io.h
gdb/tui/tui-layout.c
gdb/tui/tui-layout.h
gdb/tui/tui-main.c
gdb/tui/tui-out.c
gdb/tui/tui-regs.c
gdb/tui/tui-regs.h
gdb/tui/tui-source.c
gdb/tui/tui-source.h
gdb/tui/tui-stack.c
gdb/tui/tui-stack.h
gdb/tui/tui-win.c
gdb/tui/tui-win.h
gdb/tui/tui-windata.c
gdb/tui/tui-windata.h
gdb/tui/tui-wingeneral.c
gdb/tui/tui-wingeneral.h
gdb/tui/tui-winsource.c
gdb/tui/tui-winsource.h
gdb/tui/tui.c
gdb/tui/tui.h
gdb/typeprint.c
gdb/typeprint.h
gdb/ui-file.c
gdb/ui-file.h
gdb/ui-out.c
gdb/ui-out.h
gdb/user-regs.c
gdb/user-regs.h
gdb/utils.c
gdb/v850-tdep.c
gdb/valarith.c
gdb/valops.c
gdb/valprint.c
gdb/valprint.h
gdb/value.c
gdb/value.h
gdb/varobj.c
gdb/varobj.h
gdb/vax-nat.c
gdb/vax-tdep.c
gdb/vax-tdep.h
gdb/vaxbsd-nat.c
gdb/vaxnbsd-tdep.c
gdb/vaxobsd-tdep.c
gdb/vec.c
gdb/vec.h
gdb/version.h
gdb/version.in
gdb/windows-nat.c
gdb/windows-nat.h
gdb/windows-tdep.c
gdb/windows-tdep.h
gdb/windows-termcap.c
gdb/wrapper.c
gdb/wrapper.h
gdb/xcoffread.c
gdb/xcoffread.h
gdb/xcoffsolib.c
gdb/xcoffsolib.h
gdb/xml-support.c
gdb/xml-support.h
gdb/xml-syscall.c
gdb/xml-syscall.h
gdb/xml-tdesc.c
gdb/xml-tdesc.h
gdb/xstormy16-tdep.c
gdb/xtensa-config.c
gdb/xtensa-linux-nat.c
gdb/xtensa-linux-tdep.c
gdb/xtensa-tdep.c
gdb/xtensa-tdep.h
gdb/xtensa-xtregs.c
libdecnumber/.gitignore
libdecnumber/ChangeLog
libdecnumber/Makefile.in
libdecnumber/aclocal.m4
libdecnumber/bid/bid-dpd.h
libdecnumber/bid/bid2dpd_dpd2bid.c
libdecnumber/bid/bid2dpd_dpd2bid.h
libdecnumber/bid/decimal128.c
libdecnumber/bid/decimal128.h
libdecnumber/bid/decimal128Local.h
libdecnumber/bid/decimal128Symbols.h
libdecnumber/bid/decimal32.c
libdecnumber/bid/decimal32.h
libdecnumber/bid/decimal32Symbols.h
libdecnumber/bid/decimal64.c
libdecnumber/bid/decimal64.h
libdecnumber/bid/decimal64Symbols.h
libdecnumber/bid/host-ieee128.c
libdecnumber/bid/host-ieee32.c
libdecnumber/bid/host-ieee64.c
libdecnumber/config.in
libdecnumber/configure
libdecnumber/configure.ac
libdecnumber/dconfig.h
libdecnumber/decBasic.c
libdecnumber/decCommon.c
libdecnumber/decCommonSymbols.h
libdecnumber/decContext.c
libdecnumber/decContext.h
libdecnumber/decContextSymbols.h
libdecnumber/decDPD.h
libdecnumber/decDPDSymbols.h
libdecnumber/decDouble.c
libdecnumber/decDouble.h
libdecnumber/decDoubleSymbols.h
libdecnumber/decExcept.c
libdecnumber/decExcept.h
libdecnumber/decLibrary.c
libdecnumber/decNumber.c
libdecnumber/decNumber.h
libdecnumber/decNumberLocal.h
libdecnumber/decNumberSymbols.h
libdecnumber/decPacked.c
libdecnumber/decPacked.h
libdecnumber/decPackedSymbols.h
libdecnumber/decQuad.c
libdecnumber/decQuad.h
libdecnumber/decQuadSymbols.h
libdecnumber/decRound.c
libdecnumber/decRound.h
libdecnumber/decSingle.c
libdecnumber/decSingle.h
libdecnumber/decSingleSymbols.h
libdecnumber/dpd/decimal128.c
libdecnumber/dpd/decimal128.h
libdecnumber/dpd/decimal128Local.h
libdecnumber/dpd/decimal128Symbols.h
libdecnumber/dpd/decimal32.c
libdecnumber/dpd/decimal32.h
libdecnumber/dpd/decimal32Symbols.h
libdecnumber/dpd/decimal64.c
libdecnumber/dpd/decimal64.h
libdecnumber/dpd/decimal64Symbols.h
readline/CHANGELOG
readline/CHANGES
readline/COPYING
readline/ChangeLog.gdb
readline/INSTALL
readline/MANIFEST
readline/Makefile.in
readline/NEWS
readline/README
readline/USAGE
readline/aclocal.m4
readline/ansi_stdlib.h
readline/bind.c
readline/callback.c
readline/chardefs.h
readline/compat.c
readline/complete.c
readline/config.h.in
readline/configure
readline/configure.in
readline/cross-build/cygwin.cache
readline/display.c
readline/doc/ChangeLog.gdb
readline/doc/Makefile.in
readline/doc/fdl.texi
readline/doc/history.3
readline/doc/history.texi
readline/doc/hstech.texi
readline/doc/hsuser.texi
readline/doc/readline.3
readline/doc/rlman.texi
readline/doc/rltech.texi
readline/doc/rluser.texi
readline/doc/rluserman.texi
readline/doc/texi2dvi
readline/doc/texi2html
readline/doc/version.texi
readline/emacs_keymap.c
readline/examples/ChangeLog.gdb
readline/examples/Inputrc
readline/examples/Makefile.in
readline/examples/autoconf/BASH_CHECK_LIB_TERMCAP
readline/examples/autoconf/RL_LIB_READLINE_VERSION
readline/examples/autoconf/wi_LIB_READLINE
readline/examples/excallback.c
readline/examples/fileman.c
readline/examples/histexamp.c
readline/examples/manexamp.c
readline/examples/readlinebuf.h
readline/examples/rl-fgets.c
readline/examples/rl.c
readline/examples/rlcat.c
readline/examples/rlevent.c
readline/examples/rlfe/ChangeLog
readline/examples/rlfe/ChangeLog.gdb
readline/examples/rlfe/Makefile.in
readline/examples/rlfe/README
readline/examples/rlfe/config.h.in
readline/examples/rlfe/configure
readline/examples/rlfe/configure.in
readline/examples/rlfe/extern.h
readline/examples/rlfe/os.h
readline/examples/rlfe/pty.c
readline/examples/rlfe/rlfe.c
readline/examples/rlfe/screen.h
readline/examples/rlptytest.c
readline/examples/rltest.c
readline/examples/rlversion.c
readline/funmap.c
readline/histexpand.c
readline/histfile.c
readline/histlib.h
readline/history.c
readline/history.h
readline/histsearch.c
readline/input.c
readline/isearch.c
readline/keymaps.c
readline/keymaps.h
readline/kill.c
readline/macro.c
readline/mbutil.c
readline/misc.c
readline/nls.c
readline/parens.c
readline/patchlevel
readline/posixdir.h
readline/posixjmp.h
readline/posixselect.h
readline/posixstat.h
readline/readline.c
readline/readline.h
readline/rlconf.h
readline/rldefs.h
readline/rlmbutil.h
readline/rlprivate.h
readline/rlshell.h
readline/rlstdc.h
readline/rltty.c
readline/rltty.h
readline/rltypedefs.h
readline/rlwinsize.h
readline/savestring.c
readline/search.c
readline/shell.c
readline/shlib/Makefile.in
readline/signals.c
readline/support/config.guess
readline/support/config.rpath
readline/support/config.sub
readline/support/install.sh
readline/support/mkdirs
readline/support/mkdist
readline/support/mkinstalldirs
readline/support/shlib-install
readline/support/shobj-conf
readline/support/wcwidth.c
readline/tcap.h
readline/terminal.c
readline/text.c
readline/tilde.c
readline/tilde.h
readline/undo.c
readline/util.c
readline/vi_keymap.c
readline/vi_mode.c
readline/xfree.c
readline/xmalloc.c
readline/xmalloc.h
sim/.gitignore
sim/ChangeLog
sim/MAINTAINERS
sim/Makefile.in
sim/README-HACKING
sim/arm/COPYING
sim/arm/ChangeLog
sim/arm/Makefile.in
sim/arm/README
sim/arm/armcopro.c
sim/arm/armdefs.h
sim/arm/armemu.c
sim/arm/armemu.h
sim/arm/armfpe.h
sim/arm/arminit.c
sim/arm/armopts.h
sim/arm/armos.c
sim/arm/armos.h
sim/arm/armrdi.c
sim/arm/armsupp.c
sim/arm/armvirt.c
sim/arm/bag.c
sim/arm/bag.h
sim/arm/communicate.c
sim/arm/communicate.h
sim/arm/config.in
sim/arm/configure
sim/arm/configure.ac
sim/arm/dbg_conf.h
sim/arm/dbg_cp.h
sim/arm/dbg_hif.h
sim/arm/dbg_rdi.h
sim/arm/gdbhost.c
sim/arm/gdbhost.h
sim/arm/iwmmxt.c
sim/arm/iwmmxt.h
sim/arm/kid.c
sim/arm/main.c
sim/arm/maverick.c
sim/arm/parent.c
sim/arm/tconfig.in
sim/arm/thumbemu.c
sim/arm/wrapper.c
sim/avr/ChangeLog
sim/avr/Makefile.in
sim/avr/config.in
sim/avr/configure
sim/avr/configure.ac
sim/avr/interp.c
sim/bfin/ChangeLog
sim/bfin/Makefile.in
sim/bfin/TODO
sim/bfin/aclocal.m4
sim/bfin/bfin-sim.c
sim/bfin/bfin-sim.h
sim/bfin/bfroms/all.h
sim/bfin/bfroms/bf50x-0.0.h
sim/bfin/bfroms/bf51x-0.0.h
sim/bfin/bfroms/bf51x-0.1.h
sim/bfin/bfroms/bf51x-0.2.h
sim/bfin/bfroms/bf526-0.0.h
sim/bfin/bfroms/bf526-0.1.h
sim/bfin/bfroms/bf526-0.2.h
sim/bfin/bfroms/bf527-0.0.h
sim/bfin/bfroms/bf527-0.1.h
sim/bfin/bfroms/bf527-0.2.h
sim/bfin/bfroms/bf533-0.1.h
sim/bfin/bfroms/bf533-0.2.h
sim/bfin/bfroms/bf533-0.3.h
sim/bfin/bfroms/bf537-0.0.h
sim/bfin/bfroms/bf537-0.1.h
sim/bfin/bfroms/bf537-0.3.h
sim/bfin/bfroms/bf538-0.0.h
sim/bfin/bfroms/bf54x-0.0.h
sim/bfin/bfroms/bf54x-0.1.h
sim/bfin/bfroms/bf54x-0.2.h
sim/bfin/bfroms/bf54x-0.4.h
sim/bfin/bfroms/bf54x_l1-0.0.h
sim/bfin/bfroms/bf54x_l1-0.1.h
sim/bfin/bfroms/bf54x_l1-0.2.h
sim/bfin/bfroms/bf54x_l1-0.4.h
sim/bfin/bfroms/bf561-0.5.h
sim/bfin/bfroms/bf59x-0.0.h
sim/bfin/bfroms/bf59x_l1-0.1.h
sim/bfin/config.in
sim/bfin/configure
sim/bfin/configure.ac
sim/bfin/devices.c
sim/bfin/devices.h
sim/bfin/dv-bfin_cec.c
sim/bfin/dv-bfin_cec.h
sim/bfin/dv-bfin_ctimer.c
sim/bfin/dv-bfin_ctimer.h
sim/bfin/dv-bfin_dma.c
sim/bfin/dv-bfin_dma.h
sim/bfin/dv-bfin_dmac.c
sim/bfin/dv-bfin_dmac.h
sim/bfin/dv-bfin_ebiu_amc.c
sim/bfin/dv-bfin_ebiu_amc.h
sim/bfin/dv-bfin_ebiu_ddrc.c
sim/bfin/dv-bfin_ebiu_ddrc.h
sim/bfin/dv-bfin_ebiu_sdc.c
sim/bfin/dv-bfin_ebiu_sdc.h
sim/bfin/dv-bfin_emac.c
sim/bfin/dv-bfin_emac.h
sim/bfin/dv-bfin_eppi.c
sim/bfin/dv-bfin_eppi.h
sim/bfin/dv-bfin_evt.c
sim/bfin/dv-bfin_evt.h
sim/bfin/dv-bfin_gpio.c
sim/bfin/dv-bfin_gpio.h
sim/bfin/dv-bfin_gptimer.c
sim/bfin/dv-bfin_gptimer.h
sim/bfin/dv-bfin_jtag.c
sim/bfin/dv-bfin_jtag.h
sim/bfin/dv-bfin_mmu.c
sim/bfin/dv-bfin_mmu.h
sim/bfin/dv-bfin_nfc.c
sim/bfin/dv-bfin_nfc.h
sim/bfin/dv-bfin_otp.c
sim/bfin/dv-bfin_otp.h
sim/bfin/dv-bfin_pfmon.c
sim/bfin/dv-bfin_pfmon.h
sim/bfin/dv-bfin_pll.c
sim/bfin/dv-bfin_pll.h
sim/bfin/dv-bfin_ppi.c
sim/bfin/dv-bfin_ppi.h
sim/bfin/dv-bfin_rtc.c
sim/bfin/dv-bfin_rtc.h
sim/bfin/dv-bfin_sic.c
sim/bfin/dv-bfin_sic.h
sim/bfin/dv-bfin_spi.c
sim/bfin/dv-bfin_spi.h
sim/bfin/dv-bfin_trace.c
sim/bfin/dv-bfin_trace.h
sim/bfin/dv-bfin_twi.c
sim/bfin/dv-bfin_twi.h
sim/bfin/dv-bfin_uart.c
sim/bfin/dv-bfin_uart.h
sim/bfin/dv-bfin_uart2.c
sim/bfin/dv-bfin_uart2.h
sim/bfin/dv-bfin_wdog.c
sim/bfin/dv-bfin_wdog.h
sim/bfin/dv-bfin_wp.c
sim/bfin/dv-bfin_wp.h
sim/bfin/dv-eth_phy.c
sim/bfin/gui.c
sim/bfin/gui.h
sim/bfin/insn_list.def
sim/bfin/interp.c
sim/bfin/linux-fixed-code.h
sim/bfin/linux-fixed-code.s
sim/bfin/linux-targ-map.h
sim/bfin/machs.c
sim/bfin/machs.h
sim/bfin/proc_list.def
sim/bfin/sim-main.h
sim/bfin/tconfig.in
sim/common/ChangeLog
sim/common/Make-common.in
sim/common/Makefile.in
sim/common/aclocal.m4
sim/common/callback.c
sim/common/cgen-accfp.c
sim/common/cgen-cpu.h
sim/common/cgen-defs.h
sim/common/cgen-engine.h
sim/common/cgen-fpu.c
sim/common/cgen-fpu.h
sim/common/cgen-mem.h
sim/common/cgen-ops.h
sim/common/cgen-par.c
sim/common/cgen-par.h
sim/common/cgen-run.c
sim/common/cgen-scache.c
sim/common/cgen-scache.h
sim/common/cgen-sim.h
sim/common/cgen-trace.c
sim/common/cgen-trace.h
sim/common/cgen-types.h
sim/common/cgen-utils.c
sim/common/cgen.sh
sim/common/common.m4
sim/common/config.in
sim/common/configure
sim/common/configure.ac
sim/common/dv-cfi.c
sim/common/dv-cfi.h
sim/common/dv-core.c
sim/common/dv-glue.c
sim/common/dv-pal.c
sim/common/dv-sockser.c
sim/common/dv-sockser.h
sim/common/gdbinit.in
sim/common/genmloop.sh
sim/common/gennltvals.sh
sim/common/gentmap.c
sim/common/gentvals.sh
sim/common/hw-alloc.c
sim/common/hw-alloc.h
sim/common/hw-base.c
sim/common/hw-base.h
sim/common/hw-device.c
sim/common/hw-device.h
sim/common/hw-events.c
sim/common/hw-events.h
sim/common/hw-handles.c
sim/common/hw-handles.h
sim/common/hw-instances.c
sim/common/hw-instances.h
sim/common/hw-main.h
sim/common/hw-ports.c
sim/common/hw-ports.h
sim/common/hw-properties.c
sim/common/hw-properties.h
sim/common/hw-tree.c
sim/common/hw-tree.h
sim/common/nltvals.def
sim/common/nrun.c
sim/common/run-sim.h
sim/common/run.1
sim/common/run.c
sim/common/sim-abort.c
sim/common/sim-alu.h
sim/common/sim-arange.c
sim/common/sim-arange.h
sim/common/sim-assert.h
sim/common/sim-base.h
sim/common/sim-basics.h
sim/common/sim-bits.c
sim/common/sim-bits.h
sim/common/sim-command.c
sim/common/sim-config.c
sim/common/sim-config.h
sim/common/sim-core.c
sim/common/sim-core.h
sim/common/sim-cpu.c
sim/common/sim-cpu.h
sim/common/sim-endian.c
sim/common/sim-endian.h
sim/common/sim-engine.c
sim/common/sim-engine.h
sim/common/sim-events.c
sim/common/sim-events.h
sim/common/sim-fpu.c
sim/common/sim-fpu.h
sim/common/sim-hload.c
sim/common/sim-hrw.c
sim/common/sim-hw.c
sim/common/sim-hw.h
sim/common/sim-info.c
sim/common/sim-inline.c
sim/common/sim-inline.h
sim/common/sim-io.c
sim/common/sim-io.h
sim/common/sim-load.c
sim/common/sim-memopt.c
sim/common/sim-memopt.h
sim/common/sim-model.c
sim/common/sim-model.h
sim/common/sim-module.c
sim/common/sim-module.h
sim/common/sim-n-bits.h
sim/common/sim-n-core.h
sim/common/sim-n-endian.h
sim/common/sim-options.c
sim/common/sim-options.h
sim/common/sim-profile.c
sim/common/sim-profile.h
sim/common/sim-reason.c
sim/common/sim-reg.c
sim/common/sim-resume.c
sim/common/sim-run.c
sim/common/sim-signal.c
sim/common/sim-signal.h
sim/common/sim-stop.c
sim/common/sim-trace.c
sim/common/sim-trace.h
sim/common/sim-types.h
sim/common/sim-utils.c
sim/common/sim-utils.h
sim/common/sim-watch.c
sim/common/sim-watch.h
sim/common/syscall.c
sim/common/tconfig.in
sim/common/version.h
sim/configure
sim/configure.ac
sim/configure.tgt
sim/cr16/ChangeLog
sim/cr16/Makefile.in
sim/cr16/config.in
sim/cr16/configure
sim/cr16/configure.ac
sim/cr16/cr16_sim.h
sim/cr16/endian.c
sim/cr16/gencode.c
sim/cr16/interp.c
sim/cr16/simops.c
sim/cris/ChangeLog
sim/cris/Makefile.in
sim/cris/arch.c
sim/cris/arch.h
sim/cris/config.in
sim/cris/configure
sim/cris/configure.ac
sim/cris/cpuall.h
sim/cris/cpuv10.c
sim/cris/cpuv10.h
sim/cris/cpuv32.c
sim/cris/cpuv32.h
sim/cris/cris-desc.c
sim/cris/cris-desc.h
sim/cris/cris-opc.h
sim/cris/cris-sim.h
sim/cris/cris-tmpl.c
sim/cris/crisv10f.c
sim/cris/crisv32f.c
sim/cris/decodev10.c
sim/cris/decodev10.h
sim/cris/decodev32.c
sim/cris/decodev32.h
sim/cris/devices.c
sim/cris/dv-cris.c
sim/cris/dv-rv.c
sim/cris/mloop.in
sim/cris/modelv10.c
sim/cris/modelv32.c
sim/cris/rvdummy.c
sim/cris/semcrisv10f-switch.c
sim/cris/semcrisv32f-switch.c
sim/cris/sim-if.c
sim/cris/sim-main.h
sim/cris/tconfig.in
sim/cris/traps.c
sim/d10v/ChangeLog
sim/d10v/Makefile.in
sim/d10v/config.in
sim/d10v/configure
sim/d10v/configure.ac
sim/d10v/d10v_sim.h
sim/d10v/endian.c
sim/d10v/gencode.c
sim/d10v/interp.c
sim/d10v/simops.c
sim/erc32/ChangeLog
sim/erc32/Makefile.in
sim/erc32/NEWS
sim/erc32/README.erc32
sim/erc32/README.gdb
sim/erc32/README.sis
sim/erc32/config.in
sim/erc32/configure
sim/erc32/configure.ac
sim/erc32/end.c
sim/erc32/erc32.c
sim/erc32/exec.c
sim/erc32/float.c
sim/erc32/func.c
sim/erc32/help.c
sim/erc32/interf.c
sim/erc32/sis.c
sim/erc32/sis.h
sim/erc32/startsim
sim/frv/ChangeLog
sim/frv/Makefile.in
sim/frv/README
sim/frv/TODO
sim/frv/arch.c
sim/frv/arch.h
sim/frv/cache.c
sim/frv/cache.h
sim/frv/config.in
sim/frv/configure
sim/frv/configure.ac
sim/frv/cpu.c
sim/frv/cpu.h
sim/frv/cpuall.h
sim/frv/decode.c
sim/frv/decode.h
sim/frv/devices.c
sim/frv/frv-sim.h
sim/frv/frv.c
sim/frv/interrupts.c
sim/frv/memory.c
sim/frv/mloop.in
sim/frv/model.c
sim/frv/options.c
sim/frv/pipeline.c
sim/frv/profile-fr400.c
sim/frv/profile-fr400.h
sim/frv/profile-fr450.c
sim/frv/profile-fr500.c
sim/frv/profile-fr500.h
sim/frv/profile-fr550.c
sim/frv/profile-fr550.h
sim/frv/profile.c
sim/frv/profile.h
sim/frv/registers.c
sim/frv/registers.h
sim/frv/reset.c
sim/frv/sem.c
sim/frv/sim-if.c
sim/frv/sim-main.h
sim/frv/tconfig.in
sim/frv/traps.c
sim/h8300/ChangeLog
sim/h8300/Makefile.in
sim/h8300/compile.c
sim/h8300/config.in
sim/h8300/configure
sim/h8300/configure.ac
sim/h8300/inst.h
sim/h8300/sim-main.h
sim/h8300/tconfig.in
sim/h8300/writecode.c
sim/igen/ChangeLog
sim/igen/Makefile.in
sim/igen/compare_igen_models
sim/igen/config.in
sim/igen/configure
sim/igen/configure.ac
sim/igen/filter.c
sim/igen/filter.h
sim/igen/filter_host.c
sim/igen/filter_host.h
sim/igen/gen-engine.c
sim/igen/gen-engine.h
sim/igen/gen-icache.c
sim/igen/gen-icache.h
sim/igen/gen-idecode.c
sim/igen/gen-idecode.h
sim/igen/gen-itable.c
sim/igen/gen-itable.h
sim/igen/gen-model.c
sim/igen/gen-model.h
sim/igen/gen-semantics.c
sim/igen/gen-semantics.h
sim/igen/gen-support.c
sim/igen/gen-support.h
sim/igen/gen.c
sim/igen/gen.h
sim/igen/igen.c
sim/igen/igen.h
sim/igen/ld-cache.c
sim/igen/ld-cache.h
sim/igen/ld-decode.c
sim/igen/ld-decode.h
sim/igen/ld-insn.c
sim/igen/ld-insn.h
sim/igen/lf.c
sim/igen/lf.h
sim/igen/misc.c
sim/igen/misc.h
sim/igen/table.c
sim/igen/table.h
sim/iq2000/ChangeLog
sim/iq2000/Makefile.in
sim/iq2000/arch.c
sim/iq2000/arch.h
sim/iq2000/config.in
sim/iq2000/configure
sim/iq2000/configure.ac
sim/iq2000/cpu.c
sim/iq2000/cpu.h
sim/iq2000/cpuall.h
sim/iq2000/decode.c
sim/iq2000/decode.h
sim/iq2000/iq2000-sim.h
sim/iq2000/iq2000.c
sim/iq2000/mloop.in
sim/iq2000/model.c
sim/iq2000/sem-switch.c
sim/iq2000/sem.c
sim/iq2000/sim-if.c
sim/iq2000/sim-main.h
sim/iq2000/tconfig.in
sim/lm32/ChangeLog
sim/lm32/Makefile.in
sim/lm32/arch.c
sim/lm32/arch.h
sim/lm32/config.in
sim/lm32/configure
sim/lm32/configure.ac
sim/lm32/cpu.c
sim/lm32/cpu.h
sim/lm32/cpuall.h
sim/lm32/decode.c
sim/lm32/decode.h
sim/lm32/dv-lm32cpu.c
sim/lm32/dv-lm32timer.c
sim/lm32/dv-lm32uart.c
sim/lm32/lm32-sim.h
sim/lm32/lm32.c
sim/lm32/mloop.in
sim/lm32/model.c
sim/lm32/sem-switch.c
sim/lm32/sem.c
sim/lm32/sim-if.c
sim/lm32/sim-main.h
sim/lm32/tconfig.in
sim/lm32/traps.c
sim/lm32/user.c
sim/m32c/ChangeLog
sim/m32c/Makefile.in
sim/m32c/blinky.S
sim/m32c/config.in
sim/m32c/configure
sim/m32c/configure.ac
sim/m32c/cpu.h
sim/m32c/gdb-if.c
sim/m32c/gloss.S
sim/m32c/int.c
sim/m32c/int.h
sim/m32c/load.c
sim/m32c/load.h
sim/m32c/m32c.opc
sim/m32c/main.c
sim/m32c/mem.c
sim/m32c/mem.h
sim/m32c/misc.c
sim/m32c/misc.h
sim/m32c/opc2c.c
sim/m32c/r8c.opc
sim/m32c/reg.c
sim/m32c/safe-fgets.c
sim/m32c/safe-fgets.h
sim/m32c/sample.S
sim/m32c/sample.ld
sim/m32c/sample2.c
sim/m32c/srcdest.c
sim/m32c/syscall.h
sim/m32c/syscalls.c
sim/m32c/syscalls.h
sim/m32c/timer_a.h
sim/m32c/trace.c
sim/m32c/trace.h
sim/m32r/ChangeLog
sim/m32r/Makefile.in
sim/m32r/README
sim/m32r/TODO
sim/m32r/arch.c
sim/m32r/arch.h
sim/m32r/config.in
sim/m32r/configure
sim/m32r/configure.ac
sim/m32r/cpu.c
sim/m32r/cpu.h
sim/m32r/cpu2.c
sim/m32r/cpu2.h
sim/m32r/cpuall.h
sim/m32r/cpux.c
sim/m32r/cpux.h
sim/m32r/decode.c
sim/m32r/decode.h
sim/m32r/decode2.c
sim/m32r/decode2.h
sim/m32r/decodex.c
sim/m32r/decodex.h
sim/m32r/devices.c
sim/m32r/m32r-sim.h
sim/m32r/m32r.c
sim/m32r/m32r2.c
sim/m32r/m32rx.c
sim/m32r/mloop.in
sim/m32r/mloop2.in
sim/m32r/mloopx.in
sim/m32r/model.c
sim/m32r/model2.c
sim/m32r/modelx.c
sim/m32r/sem-switch.c
sim/m32r/sem.c
sim/m32r/sem2-switch.c
sim/m32r/semx-switch.c
sim/m32r/sim-if.c
sim/m32r/sim-main.h
sim/m32r/syscall.h
sim/m32r/tconfig.in
sim/m32r/traps-linux.c
sim/m32r/traps.c
sim/m68hc11/ChangeLog
sim/m68hc11/Makefile.in
sim/m68hc11/config.in
sim/m68hc11/configure
sim/m68hc11/configure.ac
sim/m68hc11/dv-m68hc11.c
sim/m68hc11/dv-m68hc11eepr.c
sim/m68hc11/dv-m68hc11sio.c
sim/m68hc11/dv-m68hc11spi.c
sim/m68hc11/dv-m68hc11tim.c
sim/m68hc11/dv-nvram.c
sim/m68hc11/emulos.c
sim/m68hc11/gencode.c
sim/m68hc11/interp.c
sim/m68hc11/interrupts.c
sim/m68hc11/interrupts.h
sim/m68hc11/m68hc11_sim.c
sim/m68hc11/sim-main.h
sim/mcore/ChangeLog
sim/mcore/Makefile.in
sim/mcore/config.in
sim/mcore/configure
sim/mcore/configure.ac
sim/mcore/interp.c
sim/mcore/sysdep.h
sim/microblaze/ChangeLog
sim/microblaze/Makefile.in
sim/microblaze/config.in
sim/microblaze/configure
sim/microblaze/configure.ac
sim/microblaze/interp.c
sim/microblaze/microblaze.h
sim/microblaze/microblaze.isa
sim/microblaze/sim-main.h
sim/microblaze/sysdep.h
sim/mips/ChangeLog
sim/mips/Makefile.in
sim/mips/config.in
sim/mips/configure
sim/mips/configure.ac
sim/mips/cp1.c
sim/mips/cp1.h
sim/mips/dsp.c
sim/mips/dsp.igen
sim/mips/dsp2.igen
sim/mips/dv-tx3904cpu.c
sim/mips/dv-tx3904irc.c
sim/mips/dv-tx3904sio.c
sim/mips/dv-tx3904tmr.c
sim/mips/interp.c
sim/mips/m16.dc
sim/mips/m16.igen
sim/mips/m16e.igen
sim/mips/m16run.c
sim/mips/mdmx.c
sim/mips/mdmx.igen
sim/mips/mips.dc
sim/mips/mips.igen
sim/mips/mips3264r2.igen
sim/mips/mips3d.igen
sim/mips/sb1.igen
sim/mips/sim-main.c
sim/mips/sim-main.h
sim/mips/smartmips.igen
sim/mips/tconfig.in
sim/mips/tx.igen
sim/mips/vr.igen
sim/mn10300/ChangeLog
sim/mn10300/Makefile.in
sim/mn10300/am33-2.igen
sim/mn10300/am33.igen
sim/mn10300/config.in
sim/mn10300/configure
sim/mn10300/configure.ac
sim/mn10300/dv-mn103cpu.c
sim/mn10300/dv-mn103int.c
sim/mn10300/dv-mn103iop.c
sim/mn10300/dv-mn103ser.c
sim/mn10300/dv-mn103tim.c
sim/mn10300/interp.c
sim/mn10300/mn10300.dc
sim/mn10300/mn10300.igen
sim/mn10300/mn10300_sim.h
sim/mn10300/op_utils.c
sim/mn10300/sim-main.c
sim/mn10300/sim-main.h
sim/mn10300/tconfig.in
sim/moxie/ChangeLog
sim/moxie/Makefile.in
sim/moxie/config.in
sim/moxie/configure
sim/moxie/configure.ac
sim/moxie/interp.c
sim/moxie/moxie-gdb.dts
sim/moxie/sim-main.h
sim/moxie/sysdep.h
sim/ppc/.gdbinit
sim/ppc/BUGS
sim/ppc/COPYING
sim/ppc/COPYING.LIB
sim/ppc/ChangeLog
sim/ppc/ChangeLog.00
sim/ppc/INSTALL
sim/ppc/Makefile.in
sim/ppc/README
sim/ppc/RUN
sim/ppc/aclocal.m4
sim/ppc/altivec.igen
sim/ppc/altivec_expression.h
sim/ppc/altivec_registers.h
sim/ppc/basics.h
sim/ppc/bits.c
sim/ppc/bits.h
sim/ppc/cap.c
sim/ppc/cap.h
sim/ppc/config.in
sim/ppc/configure
sim/ppc/configure.ac
sim/ppc/corefile-n.h
sim/ppc/corefile.c
sim/ppc/corefile.h
sim/ppc/cpu.c
sim/ppc/cpu.h
sim/ppc/dc-complex
sim/ppc/dc-simple
sim/ppc/dc-stupid
sim/ppc/dc-test.01
sim/ppc/dc-test.02
sim/ppc/debug.c
sim/ppc/debug.h
sim/ppc/device.c
sim/ppc/device.h
sim/ppc/device_table.c
sim/ppc/device_table.h
sim/ppc/dgen.c
sim/ppc/double.c
sim/ppc/dp-bit.c
sim/ppc/e500.igen
sim/ppc/e500_expression.h
sim/ppc/e500_registers.h
sim/ppc/emul_bugapi.c
sim/ppc/emul_bugapi.h
sim/ppc/emul_chirp.c
sim/ppc/emul_chirp.h
sim/ppc/emul_generic.c
sim/ppc/emul_generic.h
sim/ppc/emul_netbsd.c
sim/ppc/emul_netbsd.h
sim/ppc/emul_unix.c
sim/ppc/emul_unix.h
sim/ppc/events.c
sim/ppc/events.h
sim/ppc/filter.c
sim/ppc/filter.h
sim/ppc/filter_filename.c
sim/ppc/filter_filename.h
sim/ppc/gdb-sim.c
sim/ppc/gen-icache.c
sim/ppc/gen-icache.h
sim/ppc/gen-idecode.c
sim/ppc/gen-idecode.h
sim/ppc/gen-itable.c
sim/ppc/gen-itable.h
sim/ppc/gen-model.c
sim/ppc/gen-model.h
sim/ppc/gen-semantics.c
sim/ppc/gen-semantics.h
sim/ppc/gen-support.c
sim/ppc/gen-support.h
sim/ppc/hw_com.c
sim/ppc/hw_core.c
sim/ppc/hw_cpu.c
sim/ppc/hw_cpu.h
sim/ppc/hw_disk.c
sim/ppc/hw_eeprom.c
sim/ppc/hw_glue.c
sim/ppc/hw_htab.c
sim/ppc/hw_ide.c
sim/ppc/hw_init.c
sim/ppc/hw_iobus.c
sim/ppc/hw_memory.c
sim/ppc/hw_nvram.c
sim/ppc/hw_opic.c
sim/ppc/hw_pal.c
sim/ppc/hw_phb.c
sim/ppc/hw_phb.h
sim/ppc/hw_register.c
sim/ppc/hw_sem.c
sim/ppc/hw_shm.c
sim/ppc/hw_trace.c
sim/ppc/hw_vm.c
sim/ppc/idecode_branch.h
sim/ppc/idecode_expression.h
sim/ppc/idecode_fields.h
sim/ppc/igen.c
sim/ppc/igen.h
sim/ppc/inline.c
sim/ppc/inline.h
sim/ppc/interrupts.c
sim/ppc/interrupts.h
sim/ppc/ld-cache.c
sim/ppc/ld-cache.h
sim/ppc/ld-decode.c
sim/ppc/ld-decode.h
sim/ppc/ld-insn.c
sim/ppc/ld-insn.h
sim/ppc/lf.c
sim/ppc/lf.h
sim/ppc/main.c
sim/ppc/misc.c
sim/ppc/misc.h
sim/ppc/mon.c
sim/ppc/mon.h
sim/ppc/options.c
sim/ppc/options.h
sim/ppc/os_emul.c
sim/ppc/os_emul.h
sim/ppc/pk_disklabel.c
sim/ppc/ppc-instructions
sim/ppc/ppc-spr-table
sim/ppc/ppc.mt
sim/ppc/psim.c
sim/ppc/psim.h
sim/ppc/psim.texinfo
sim/ppc/registers.c
sim/ppc/registers.h
sim/ppc/sim-endian-n.h
sim/ppc/sim-endian.c
sim/ppc/sim-endian.h
sim/ppc/sim-main.h
sim/ppc/sim_callbacks.h
sim/ppc/sim_calls.c
sim/ppc/std-config.h
sim/ppc/table.c
sim/ppc/table.h
sim/ppc/tree.c
sim/ppc/tree.h
sim/ppc/vm.c
sim/ppc/vm.h
sim/ppc/vm_n.h
sim/ppc/words.h
sim/rx/ChangeLog
sim/rx/Makefile.in
sim/rx/README.txt
sim/rx/config.in
sim/rx/configure
sim/rx/configure.ac
sim/rx/cpu.h
sim/rx/err.c
sim/rx/err.h
sim/rx/fpu.c
sim/rx/fpu.h
sim/rx/gdb-if.c
sim/rx/load.c
sim/rx/load.h
sim/rx/main.c
sim/rx/mem.c
sim/rx/mem.h
sim/rx/misc.c
sim/rx/misc.h
sim/rx/reg.c
sim/rx/rx.c
sim/rx/syscall.h
sim/rx/syscalls.c
sim/rx/syscalls.h
sim/rx/trace.c
sim/rx/trace.h
sim/sh/ChangeLog
sim/sh/Makefile.in
sim/sh/config.in
sim/sh/configure
sim/sh/configure.ac
sim/sh/gencode.c
sim/sh/interp.c
sim/sh/syscall.h
sim/sh/tconfig.in
sim/sh64/ChangeLog
sim/sh64/Makefile.in
sim/sh64/arch.c
sim/sh64/arch.h
sim/sh64/config.in
sim/sh64/configure
sim/sh64/configure.ac
sim/sh64/cpu.c
sim/sh64/cpu.h
sim/sh64/cpuall.h
sim/sh64/decode-compact.c
sim/sh64/decode-compact.h
sim/sh64/decode-media.c
sim/sh64/decode-media.h
sim/sh64/decode.h
sim/sh64/defs-compact.h
sim/sh64/defs-media.h
sim/sh64/eng-compact.h
sim/sh64/eng-media.h
sim/sh64/eng.h
sim/sh64/mloop-compact.c
sim/sh64/mloop-media.c
sim/sh64/sem-compact-switch.c
sim/sh64/sem-compact.c
sim/sh64/sem-media-switch.c
sim/sh64/sem-media.c
sim/sh64/sh-desc.c
sim/sh64/sh-desc.h
sim/sh64/sh-opc.h
sim/sh64/sh64-sim.h
sim/sh64/sh64.c
sim/sh64/sim-if.c
sim/sh64/sim-main.h
sim/sh64/tconfig.in
sim/testsuite/ChangeLog
sim/testsuite/Makefile.in
sim/testsuite/common/Make-common.in
sim/testsuite/common/Makefile.in
sim/testsuite/common/alu-n-tst.h
sim/testsuite/common/alu-tst.c
sim/testsuite/common/bits-gen.c
sim/testsuite/common/bits-tst.c
sim/testsuite/common/fpu-tst.c
sim/testsuite/config/default.exp
sim/testsuite/configure
sim/testsuite/configure.ac
sim/testsuite/d10v-elf/ChangeLog
sim/testsuite/d10v-elf/Makefile.in
sim/testsuite/d10v-elf/configure
sim/testsuite/d10v-elf/configure.ac
sim/testsuite/d10v-elf/exit47.s
sim/testsuite/d10v-elf/hello.s
sim/testsuite/d10v-elf/loop.s
sim/testsuite/d10v-elf/t-ae-ld-d.s
sim/testsuite/d10v-elf/t-ae-ld-i.s
sim/testsuite/d10v-elf/t-ae-ld-id.s
sim/testsuite/d10v-elf/t-ae-ld-im.s
sim/testsuite/d10v-elf/t-ae-ld-ip.s
sim/testsuite/d10v-elf/t-ae-ld2w-d.s
sim/testsuite/d10v-elf/t-ae-ld2w-i.s
sim/testsuite/d10v-elf/t-ae-ld2w-id.s
sim/testsuite/d10v-elf/t-ae-ld2w-im.s
sim/testsuite/d10v-elf/t-ae-ld2w-ip.s
sim/testsuite/d10v-elf/t-ae-st-d.s
sim/testsuite/d10v-elf/t-ae-st-i.s
sim/testsuite/d10v-elf/t-ae-st-id.s
sim/testsuite/d10v-elf/t-ae-st-im.s
sim/testsuite/d10v-elf/t-ae-st-ip.s
sim/testsuite/d10v-elf/t-ae-st-is.s
sim/testsuite/d10v-elf/t-ae-st2w-d.s
sim/testsuite/d10v-elf/t-ae-st2w-i.s
sim/testsuite/d10v-elf/t-ae-st2w-id.s
sim/testsuite/d10v-elf/t-ae-st2w-im.s
sim/testsuite/d10v-elf/t-ae-st2w-ip.s
sim/testsuite/d10v-elf/t-ae-st2w-is.s
sim/testsuite/d10v-elf/t-dbt.s
sim/testsuite/d10v-elf/t-ld-st.s
sim/testsuite/d10v-elf/t-mac.s
sim/testsuite/d10v-elf/t-macros.i
sim/testsuite/d10v-elf/t-mod-ld-pre.s
sim/testsuite/d10v-elf/t-msbu.s
sim/testsuite/d10v-elf/t-mulxu.s
sim/testsuite/d10v-elf/t-mvtac.s
sim/testsuite/d10v-elf/t-mvtc.s
sim/testsuite/d10v-elf/t-rac.s
sim/testsuite/d10v-elf/t-rachi.s
sim/testsuite/d10v-elf/t-rdt.s
sim/testsuite/d10v-elf/t-rep.s
sim/testsuite/d10v-elf/t-rie-xx.s
sim/testsuite/d10v-elf/t-rte.s
sim/testsuite/d10v-elf/t-sac.s
sim/testsuite/d10v-elf/t-sachi.s
sim/testsuite/d10v-elf/t-sadd.s
sim/testsuite/d10v-elf/t-slae.s
sim/testsuite/d10v-elf/t-sp.s
sim/testsuite/d10v-elf/t-sub.s
sim/testsuite/d10v-elf/t-sub2w.s
sim/testsuite/d10v-elf/t-subi.s
sim/testsuite/d10v-elf/t-trap.s
sim/testsuite/frv-elf/ChangeLog
sim/testsuite/frv-elf/Makefile.in
sim/testsuite/frv-elf/cache.s
sim/testsuite/frv-elf/configure
sim/testsuite/frv-elf/configure.ac
sim/testsuite/frv-elf/exit47.s
sim/testsuite/frv-elf/grloop.s
sim/testsuite/frv-elf/hello.s
sim/testsuite/frv-elf/loop.s
sim/testsuite/lib/sim-defs.exp
sim/testsuite/m32r-elf/ChangeLog
sim/testsuite/m32r-elf/Makefile.in
sim/testsuite/m32r-elf/configure
sim/testsuite/m32r-elf/configure.ac
sim/testsuite/m32r-elf/exit47.s
sim/testsuite/m32r-elf/hello.s
sim/testsuite/m32r-elf/loop.s
sim/testsuite/mips64el-elf/ChangeLog
sim/testsuite/mips64el-elf/Makefile.in
sim/testsuite/mips64el-elf/configure
sim/testsuite/mips64el-elf/configure.ac
sim/testsuite/sim/arm/adc.cgs
sim/testsuite/sim/arm/add.cgs
sim/testsuite/sim/arm/allinsn.exp
sim/testsuite/sim/arm/and.cgs
sim/testsuite/sim/arm/b.cgs
sim/testsuite/sim/arm/bic.cgs
sim/testsuite/sim/arm/bl.cgs
sim/testsuite/sim/arm/bx.cgs
sim/testsuite/sim/arm/cmn.cgs
sim/testsuite/sim/arm/cmp.cgs
sim/testsuite/sim/arm/eor.cgs
sim/testsuite/sim/arm/hello.ms
sim/testsuite/sim/arm/iwmmxt/iwmmxt.exp
sim/testsuite/sim/arm/iwmmxt/tbcst.cgs
sim/testsuite/sim/arm/iwmmxt/testutils.inc
sim/testsuite/sim/arm/iwmmxt/textrm.cgs
sim/testsuite/sim/arm/iwmmxt/tinsr.cgs
sim/testsuite/sim/arm/iwmmxt/tmia.cgs
sim/testsuite/sim/arm/iwmmxt/tmiaph.cgs
sim/testsuite/sim/arm/iwmmxt/tmiaxy.cgs
sim/testsuite/sim/arm/iwmmxt/tmovmsk.cgs
sim/testsuite/sim/arm/iwmmxt/wacc.cgs
sim/testsuite/sim/arm/iwmmxt/wadd.cgs
sim/testsuite/sim/arm/iwmmxt/waligni.cgs
sim/testsuite/sim/arm/iwmmxt/walignr.cgs
sim/testsuite/sim/arm/iwmmxt/wand.cgs
sim/testsuite/sim/arm/iwmmxt/wandn.cgs
sim/testsuite/sim/arm/iwmmxt/wavg2.cgs
sim/testsuite/sim/arm/iwmmxt/wcmpeq.cgs
sim/testsuite/sim/arm/iwmmxt/wcmpgt.cgs
sim/testsuite/sim/arm/iwmmxt/wmac.cgs
sim/testsuite/sim/arm/iwmmxt/wmadd.cgs
sim/testsuite/sim/arm/iwmmxt/wmax.cgs
sim/testsuite/sim/arm/iwmmxt/wmin.cgs
sim/testsuite/sim/arm/iwmmxt/wmov.cgs
sim/testsuite/sim/arm/iwmmxt/wmul.cgs
sim/testsuite/sim/arm/iwmmxt/wor.cgs
sim/testsuite/sim/arm/iwmmxt/wpack.cgs
sim/testsuite/sim/arm/iwmmxt/wror.cgs
sim/testsuite/sim/arm/iwmmxt/wsad.cgs
sim/testsuite/sim/arm/iwmmxt/wshufh.cgs
sim/testsuite/sim/arm/iwmmxt/wsll.cgs
sim/testsuite/sim/arm/iwmmxt/wsra.cgs
sim/testsuite/sim/arm/iwmmxt/wsrl.cgs
sim/testsuite/sim/arm/iwmmxt/wsub.cgs
sim/testsuite/sim/arm/iwmmxt/wunpckeh.cgs
sim/testsuite/sim/arm/iwmmxt/wunpckel.cgs
sim/testsuite/sim/arm/iwmmxt/wunpckih.cgs
sim/testsuite/sim/arm/iwmmxt/wunpckil.cgs
sim/testsuite/sim/arm/iwmmxt/wxor.cgs
sim/testsuite/sim/arm/iwmmxt/wzero.cgs
sim/testsuite/sim/arm/ldm.cgs
sim/testsuite/sim/arm/ldr.cgs
sim/testsuite/sim/arm/ldrb.cgs
sim/testsuite/sim/arm/ldrh.cgs
sim/testsuite/sim/arm/ldrsb.cgs
sim/testsuite/sim/arm/ldrsh.cgs
sim/testsuite/sim/arm/misaligned1.ms
sim/testsuite/sim/arm/misaligned2.ms
sim/testsuite/sim/arm/misaligned3.ms
sim/testsuite/sim/arm/misc.exp
sim/testsuite/sim/arm/mla.cgs
sim/testsuite/sim/arm/mov.cgs
sim/testsuite/sim/arm/mrs.cgs
sim/testsuite/sim/arm/msr.cgs
sim/testsuite/sim/arm/mul.cgs
sim/testsuite/sim/arm/mvn.cgs
sim/testsuite/sim/arm/orr.cgs
sim/testsuite/sim/arm/rsb.cgs
sim/testsuite/sim/arm/rsc.cgs
sim/testsuite/sim/arm/sbc.cgs
sim/testsuite/sim/arm/smlal.cgs
sim/testsuite/sim/arm/smull.cgs
sim/testsuite/sim/arm/stm.cgs
sim/testsuite/sim/arm/str.cgs
sim/testsuite/sim/arm/strb.cgs
sim/testsuite/sim/arm/strh.cgs
sim/testsuite/sim/arm/sub.cgs
sim/testsuite/sim/arm/swi.cgs
sim/testsuite/sim/arm/swp.cgs
sim/testsuite/sim/arm/swpb.cgs
sim/testsuite/sim/arm/teq.cgs
sim/testsuite/sim/arm/testutils.inc
sim/testsuite/sim/arm/thumb/adc.cgs
sim/testsuite/sim/arm/thumb/add-hd-hs.cgs
sim/testsuite/sim/arm/thumb/add-hd-rs.cgs
sim/testsuite/sim/arm/thumb/add-rd-hs.cgs
sim/testsuite/sim/arm/thumb/add-sp.cgs
sim/testsuite/sim/arm/thumb/add.cgs
sim/testsuite/sim/arm/thumb/addi.cgs
sim/testsuite/sim/arm/thumb/addi8.cgs
sim/testsuite/sim/arm/thumb/allthumb.exp
sim/testsuite/sim/arm/thumb/and.cgs
sim/testsuite/sim/arm/thumb/asr.cgs
sim/testsuite/sim/arm/thumb/b.cgs
sim/testsuite/sim/arm/thumb/bcc.cgs
sim/testsuite/sim/arm/thumb/bcs.cgs
sim/testsuite/sim/arm/thumb/beq.cgs
sim/testsuite/sim/arm/thumb/bge.cgs
sim/testsuite/sim/arm/thumb/bgt.cgs
sim/testsuite/sim/arm/thumb/bhi.cgs
sim/testsuite/sim/arm/thumb/bic.cgs
sim/testsuite/sim/arm/thumb/bl-hi.cgs
sim/testsuite/sim/arm/thumb/bl-lo.cgs
sim/testsuite/sim/arm/thumb/ble.cgs
sim/testsuite/sim/arm/thumb/bls.cgs
sim/testsuite/sim/arm/thumb/blt.cgs
sim/testsuite/sim/arm/thumb/bmi.cgs
sim/testsuite/sim/arm/thumb/bne.cgs
sim/testsuite/sim/arm/thumb/bpl.cgs
sim/testsuite/sim/arm/thumb/bvc.cgs
sim/testsuite/sim/arm/thumb/bvs.cgs
sim/testsuite/sim/arm/thumb/bx-hs.cgs
sim/testsuite/sim/arm/thumb/bx-rs.cgs
sim/testsuite/sim/arm/thumb/cmn.cgs
sim/testsuite/sim/arm/thumb/cmp-hd-hs.cgs
sim/testsuite/sim/arm/thumb/cmp-hd-rs.cgs
sim/testsuite/sim/arm/thumb/cmp-rd-hs.cgs
sim/testsuite/sim/arm/thumb/cmp.cgs
sim/testsuite/sim/arm/thumb/eor.cgs
sim/testsuite/sim/arm/thumb/lda-pc.cgs
sim/testsuite/sim/arm/thumb/lda-sp.cgs
sim/testsuite/sim/arm/thumb/ldmia.cgs
sim/testsuite/sim/arm/thumb/ldr-imm.cgs
sim/testsuite/sim/arm/thumb/ldr-pc.cgs
sim/testsuite/sim/arm/thumb/ldr-sprel.cgs
sim/testsuite/sim/arm/thumb/ldr.cgs
sim/testsuite/sim/arm/thumb/ldrb-imm.cgs
sim/testsuite/sim/arm/thumb/ldrb.cgs
sim/testsuite/sim/arm/thumb/ldrh-imm.cgs
sim/testsuite/sim/arm/thumb/ldrh.cgs
sim/testsuite/sim/arm/thumb/ldsb.cgs
sim/testsuite/sim/arm/thumb/ldsh.cgs
sim/testsuite/sim/arm/thumb/lsl.cgs
sim/testsuite/sim/arm/thumb/lsr.cgs
sim/testsuite/sim/arm/thumb/mov-hd-hs.cgs
sim/testsuite/sim/arm/thumb/mov-hd-rs.cgs
sim/testsuite/sim/arm/thumb/mov-rd-hs.cgs
sim/testsuite/sim/arm/thumb/mov.cgs
sim/testsuite/sim/arm/thumb/mul.cgs
sim/testsuite/sim/arm/thumb/mvn.cgs
sim/testsuite/sim/arm/thumb/neg.cgs
sim/testsuite/sim/arm/thumb/orr.cgs
sim/testsuite/sim/arm/thumb/pop-pc.cgs
sim/testsuite/sim/arm/thumb/pop.cgs
sim/testsuite/sim/arm/thumb/push-lr.cgs
sim/testsuite/sim/arm/thumb/push.cgs
sim/testsuite/sim/arm/thumb/ror.cgs
sim/testsuite/sim/arm/thumb/sbc.cgs
sim/testsuite/sim/arm/thumb/stmia.cgs
sim/testsuite/sim/arm/thumb/str-imm.cgs
sim/testsuite/sim/arm/thumb/str-sprel.cgs
sim/testsuite/sim/arm/thumb/str.cgs
sim/testsuite/sim/arm/thumb/strb-imm.cgs
sim/testsuite/sim/arm/thumb/strb.cgs
sim/testsuite/sim/arm/thumb/strh-imm.cgs
sim/testsuite/sim/arm/thumb/strh.cgs
sim/testsuite/sim/arm/thumb/sub-sp.cgs
sim/testsuite/sim/arm/thumb/sub.cgs
sim/testsuite/sim/arm/thumb/subi.cgs
sim/testsuite/sim/arm/thumb/subi8.cgs
sim/testsuite/sim/arm/thumb/swi.cgs
sim/testsuite/sim/arm/thumb/testutils.inc
sim/testsuite/sim/arm/thumb/tst.cgs
sim/testsuite/sim/arm/tst.cgs
sim/testsuite/sim/arm/umlal.cgs
sim/testsuite/sim/arm/umull.cgs
sim/testsuite/sim/arm/xscale/blx.cgs
sim/testsuite/sim/arm/xscale/mia.cgs
sim/testsuite/sim/arm/xscale/miaph.cgs
sim/testsuite/sim/arm/xscale/miaxy.cgs
sim/testsuite/sim/arm/xscale/mra.cgs
sim/testsuite/sim/arm/xscale/testutils.inc
sim/testsuite/sim/arm/xscale/xscale.exp
sim/testsuite/sim/bfin/.gitignore
sim/testsuite/sim/bfin/10272_small.s
sim/testsuite/sim/bfin/10436.s
sim/testsuite/sim/bfin/10622.s
sim/testsuite/sim/bfin/10742.s
sim/testsuite/sim/bfin/10799.s
sim/testsuite/sim/bfin/11080.s
sim/testsuite/sim/bfin/7641.s
sim/testsuite/sim/bfin/ChangeLog
sim/testsuite/sim/bfin/PN_generator.s
sim/testsuite/sim/bfin/a0.s
sim/testsuite/sim/bfin/a0shift.S
sim/testsuite/sim/bfin/a1.s
sim/testsuite/sim/bfin/a10.s
sim/testsuite/sim/bfin/a11.S
sim/testsuite/sim/bfin/a12.s
sim/testsuite/sim/bfin/a2.s
sim/testsuite/sim/bfin/a20.S
sim/testsuite/sim/bfin/a21.s
sim/testsuite/sim/bfin/a22.s
sim/testsuite/sim/bfin/a23.s
sim/testsuite/sim/bfin/a24.s
sim/testsuite/sim/bfin/a25.s
sim/testsuite/sim/bfin/a26.s
sim/testsuite/sim/bfin/a3.s
sim/testsuite/sim/bfin/a30.s
sim/testsuite/sim/bfin/a4.s
sim/testsuite/sim/bfin/a5.s
sim/testsuite/sim/bfin/a6.s
sim/testsuite/sim/bfin/a7.s
sim/testsuite/sim/bfin/a8.s
sim/testsuite/sim/bfin/a9.s
sim/testsuite/sim/bfin/abs-2.S
sim/testsuite/sim/bfin/abs-3.S
sim/testsuite/sim/bfin/abs-4.S
sim/testsuite/sim/bfin/abs.S
sim/testsuite/sim/bfin/abs_acc.s
sim/testsuite/sim/bfin/acc-rot.s
sim/testsuite/sim/bfin/acp5_19.s
sim/testsuite/sim/bfin/acp5_4.s
sim/testsuite/sim/bfin/add_imm7.s
sim/testsuite/sim/bfin/add_shift.S
sim/testsuite/sim/bfin/add_sub_acc.s
sim/testsuite/sim/bfin/addsub_flags.S
sim/testsuite/sim/bfin/algnbug1.s
sim/testsuite/sim/bfin/algnbug2.s
sim/testsuite/sim/bfin/allinsn.exp
sim/testsuite/sim/bfin/argc.c
sim/testsuite/sim/bfin/ashift.s
sim/testsuite/sim/bfin/ashift_flags.s
sim/testsuite/sim/bfin/b0.S
sim/testsuite/sim/bfin/b1.s
sim/testsuite/sim/bfin/b2.S
sim/testsuite/sim/bfin/brcc.s
sim/testsuite/sim/bfin/brevadd.s
sim/testsuite/sim/bfin/byteop16m.s
sim/testsuite/sim/bfin/byteop16p.s
sim/testsuite/sim/bfin/byteop1p.s
sim/testsuite/sim/bfin/byteop2p.s
sim/testsuite/sim/bfin/byteop3p.s
sim/testsuite/sim/bfin/byteunpack.s
sim/testsuite/sim/bfin/c_alu2op_arith_r_sft.s
sim/testsuite/sim/bfin/c_alu2op_conv_b.s
sim/testsuite/sim/bfin/c_alu2op_conv_h.s
sim/testsuite/sim/bfin/c_alu2op_conv_mix.s
sim/testsuite/sim/bfin/c_alu2op_conv_neg.s
sim/testsuite/sim/bfin/c_alu2op_conv_toggle.s
sim/testsuite/sim/bfin/c_alu2op_conv_xb.s
sim/testsuite/sim/bfin/c_alu2op_conv_xh.s
sim/testsuite/sim/bfin/c_alu2op_divq.s
sim/testsuite/sim/bfin/c_alu2op_divs.s
sim/testsuite/sim/bfin/c_alu2op_log_l_sft.s
sim/testsuite/sim/bfin/c_alu2op_log_r_sft.s
sim/testsuite/sim/bfin/c_alu2op_shadd_1.s
sim/testsuite/sim/bfin/c_alu2op_shadd_2.s
sim/testsuite/sim/bfin/c_br_preg_killed_ac.s
sim/testsuite/sim/bfin/c_br_preg_killed_ex1.s
sim/testsuite/sim/bfin/c_br_preg_stall_ac.s
sim/testsuite/sim/bfin/c_br_preg_stall_ex1.s
sim/testsuite/sim/bfin/c_brcc_bp1.s
sim/testsuite/sim/bfin/c_brcc_bp2.s
sim/testsuite/sim/bfin/c_brcc_bp3.s
sim/testsuite/sim/bfin/c_brcc_bp4.s
sim/testsuite/sim/bfin/c_brcc_brf_bp.s
sim/testsuite/sim/bfin/c_brcc_brf_brt_bp.s
sim/testsuite/sim/bfin/c_brcc_brf_brt_nbp.s
sim/testsuite/sim/bfin/c_brcc_brf_fbkwd.s
sim/testsuite/sim/bfin/c_brcc_brf_nbp.s
sim/testsuite/sim/bfin/c_brcc_brt_bp.s
sim/testsuite/sim/bfin/c_brcc_brt_nbp.s
sim/testsuite/sim/bfin/c_brcc_kills_dhits.s
sim/testsuite/sim/bfin/c_brcc_kills_dmiss.s
sim/testsuite/sim/bfin/c_cactrl_iflush_pr.s
sim/testsuite/sim/bfin/c_cactrl_iflush_pr_pp.s
sim/testsuite/sim/bfin/c_calla_ljump.s
sim/testsuite/sim/bfin/c_calla_subr.s
sim/testsuite/sim/bfin/c_cc2dreg.s
sim/testsuite/sim/bfin/c_cc2stat_cc_ac.S
sim/testsuite/sim/bfin/c_cc2stat_cc_an.s
sim/testsuite/sim/bfin/c_cc2stat_cc_aq.s
sim/testsuite/sim/bfin/c_cc2stat_cc_av0.S
sim/testsuite/sim/bfin/c_cc2stat_cc_av1.S
sim/testsuite/sim/bfin/c_cc2stat_cc_az.s
sim/testsuite/sim/bfin/c_cc_flag_ccmv_depend.S
sim/testsuite/sim/bfin/c_cc_flagdreg_mvbrsft.s
sim/testsuite/sim/bfin/c_cc_flagdreg_mvbrsft_s1.s
sim/testsuite/sim/bfin/c_cc_flagdreg_mvbrsft_sn.s
sim/testsuite/sim/bfin/c_cc_regmvlogi_mvbrsft.s
sim/testsuite/sim/bfin/c_cc_regmvlogi_mvbrsft_s1.s
sim/testsuite/sim/bfin/c_cc_regmvlogi_mvbrsft_sn.S
sim/testsuite/sim/bfin/c_ccflag_a0a1.S
sim/testsuite/sim/bfin/c_ccflag_dr_dr.s
sim/testsuite/sim/bfin/c_ccflag_dr_dr_uu.s
sim/testsuite/sim/bfin/c_ccflag_dr_imm3.s
sim/testsuite/sim/bfin/c_ccflag_dr_imm3_uu.s
sim/testsuite/sim/bfin/c_ccflag_pr_imm3.s
sim/testsuite/sim/bfin/c_ccflag_pr_imm3_uu.s
sim/testsuite/sim/bfin/c_ccflag_pr_pr.s
sim/testsuite/sim/bfin/c_ccflag_pr_pr_uu.s
sim/testsuite/sim/bfin/c_ccmv_cc_dr_dr.s
sim/testsuite/sim/bfin/c_ccmv_cc_dr_pr.s
sim/testsuite/sim/bfin/c_ccmv_cc_pr_pr.s
sim/testsuite/sim/bfin/c_ccmv_ncc_dr_dr.s
sim/testsuite/sim/bfin/c_ccmv_ncc_dr_pr.s
sim/testsuite/sim/bfin/c_ccmv_ncc_pr_pr.s
sim/testsuite/sim/bfin/c_comp3op_dr_and_dr.s
sim/testsuite/sim/bfin/c_comp3op_dr_minus_dr.s
sim/testsuite/sim/bfin/c_comp3op_dr_mix.s
sim/testsuite/sim/bfin/c_comp3op_dr_or_dr.s
sim/testsuite/sim/bfin/c_comp3op_dr_plus_dr.s
sim/testsuite/sim/bfin/c_comp3op_dr_xor_dr.s
sim/testsuite/sim/bfin/c_comp3op_pr_plus_pr_sh1.s
sim/testsuite/sim/bfin/c_comp3op_pr_plus_pr_sh2.s
sim/testsuite/sim/bfin/c_compi2opd_dr_add_i7_n.s
sim/testsuite/sim/bfin/c_compi2opd_dr_add_i7_p.s
sim/testsuite/sim/bfin/c_compi2opd_dr_eq_i7_n.s
sim/testsuite/sim/bfin/c_compi2opd_dr_eq_i7_p.s
sim/testsuite/sim/bfin/c_compi2opd_flags.S
sim/testsuite/sim/bfin/c_compi2opd_flags_2.S
sim/testsuite/sim/bfin/c_compi2opp_pr_add_i7_n.s
sim/testsuite/sim/bfin/c_compi2opp_pr_add_i7_p.s
sim/testsuite/sim/bfin/c_compi2opp_pr_eq_i7_n.s
sim/testsuite/sim/bfin/c_compi2opp_pr_eq_i7_p.s
sim/testsuite/sim/bfin/c_dagmodik_lnz_imgebl.s
sim/testsuite/sim/bfin/c_dagmodik_lnz_imltbl.s
sim/testsuite/sim/bfin/c_dagmodik_lz_inc_dec.s
sim/testsuite/sim/bfin/c_dagmodim_lnz_imgebl.s
sim/testsuite/sim/bfin/c_dagmodim_lnz_imltbl.s
sim/testsuite/sim/bfin/c_dagmodim_lz_inc_dec.s
sim/testsuite/sim/bfin/c_dsp32alu_a0_pm_a1.s
sim/testsuite/sim/bfin/c_dsp32alu_a0a1s.s
sim/testsuite/sim/bfin/c_dsp32alu_a_abs_a.s
sim/testsuite/sim/bfin/c_dsp32alu_a_neg_a.s
sim/testsuite/sim/bfin/c_dsp32alu_aa_absabs.s
sim/testsuite/sim/bfin/c_dsp32alu_aa_negneg.s
sim/testsuite/sim/bfin/c_dsp32alu_abs.s
sim/testsuite/sim/bfin/c_dsp32alu_absabs.s
sim/testsuite/sim/bfin/c_dsp32alu_alhwx.s
sim/testsuite/sim/bfin/c_dsp32alu_awx.s
sim/testsuite/sim/bfin/c_dsp32alu_byteop1ew.s
sim/testsuite/sim/bfin/c_dsp32alu_byteop2.s
sim/testsuite/sim/bfin/c_dsp32alu_byteop3.s
sim/testsuite/sim/bfin/c_dsp32alu_bytepack.s
sim/testsuite/sim/bfin/c_dsp32alu_byteunpack.s
sim/testsuite/sim/bfin/c_dsp32alu_disalnexcpt.s
sim/testsuite/sim/bfin/c_dsp32alu_max.s
sim/testsuite/sim/bfin/c_dsp32alu_maxmax.s
sim/testsuite/sim/bfin/c_dsp32alu_min.s
sim/testsuite/sim/bfin/c_dsp32alu_minmin.s
sim/testsuite/sim/bfin/c_dsp32alu_mix.s
sim/testsuite/sim/bfin/c_dsp32alu_r_lh_a0pa1.s
sim/testsuite/sim/bfin/c_dsp32alu_r_negneg.s
sim/testsuite/sim/bfin/c_dsp32alu_rh_m.s
sim/testsuite/sim/bfin/c_dsp32alu_rh_p.s
sim/testsuite/sim/bfin/c_dsp32alu_rh_rnd12_m.s
sim/testsuite/sim/bfin/c_dsp32alu_rh_rnd12_p.s
sim/testsuite/sim/bfin/c_dsp32alu_rh_rnd20_m.s
sim/testsuite/sim/bfin/c_dsp32alu_rh_rnd20_p.s
sim/testsuite/sim/bfin/c_dsp32alu_rl_m.s
sim/testsuite/sim/bfin/c_dsp32alu_rl_p.s
sim/testsuite/sim/bfin/c_dsp32alu_rl_rnd12_m.s
sim/testsuite/sim/bfin/c_dsp32alu_rl_rnd12_p.s
sim/testsuite/sim/bfin/c_dsp32alu_rl_rnd20_m.s
sim/testsuite/sim/bfin/c_dsp32alu_rl_rnd20_p.s
sim/testsuite/sim/bfin/c_dsp32alu_rlh_rnd.s
sim/testsuite/sim/bfin/c_dsp32alu_rm.s
sim/testsuite/sim/bfin/c_dsp32alu_rmm.s
sim/testsuite/sim/bfin/c_dsp32alu_rmp.s
sim/testsuite/sim/bfin/c_dsp32alu_rp.s
sim/testsuite/sim/bfin/c_dsp32alu_rpm.s
sim/testsuite/sim/bfin/c_dsp32alu_rpp.s
sim/testsuite/sim/bfin/c_dsp32alu_rr_lph_a1a0.s
sim/testsuite/sim/bfin/c_dsp32alu_rrpm.s
sim/testsuite/sim/bfin/c_dsp32alu_rrpm_aa.s
sim/testsuite/sim/bfin/c_dsp32alu_rrpmmp.s
sim/testsuite/sim/bfin/c_dsp32alu_rrpmmp_sft.s
sim/testsuite/sim/bfin/c_dsp32alu_rrpmmp_sft_x.s
sim/testsuite/sim/bfin/c_dsp32alu_rrppmm.s
sim/testsuite/sim/bfin/c_dsp32alu_rrppmm_sft.s
sim/testsuite/sim/bfin/c_dsp32alu_rrppmm_sft_x.s
sim/testsuite/sim/bfin/c_dsp32alu_saa.s
sim/testsuite/sim/bfin/c_dsp32alu_sat_aa.S
sim/testsuite/sim/bfin/c_dsp32alu_search.s
sim/testsuite/sim/bfin/c_dsp32alu_sgn.s
sim/testsuite/sim/bfin/c_dsp32mac_a1a0.s
sim/testsuite/sim/bfin/c_dsp32mac_a1a0_iuw32.s
sim/testsuite/sim/bfin/c_dsp32mac_a1a0_m.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a0.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a0_i.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a0_ih.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a0_is.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a0_iu.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a0_m.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a0_s.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a0_t.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a0_tu.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a0_u.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1_i.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1_ih.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1_is.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1_iu.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1_m.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1_s.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1_t.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1_tu.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1_u.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1a0.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1a0_iutsh.s
sim/testsuite/sim/bfin/c_dsp32mac_dr_a1a0_m.s
sim/testsuite/sim/bfin/c_dsp32mac_mix.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a0.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a0_i.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a0_is.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a0_m.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a0_s.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a0_u.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1_i.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1_is.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1_m.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1_s.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1_u.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1a0.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1a0_i.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1a0_is.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1a0_m.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1a0_s.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_a1a0_u.s
sim/testsuite/sim/bfin/c_dsp32mac_pair_mix.s
sim/testsuite/sim/bfin/c_dsp32mult_dr.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_i.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_ih.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_is.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_iu.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_m.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_m_i.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_m_iutsh.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_m_s.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_m_t.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_m_u.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_mix.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_s.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_t.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_tu.s
sim/testsuite/sim/bfin/c_dsp32mult_dr_u.s
sim/testsuite/sim/bfin/c_dsp32mult_pair.s
sim/testsuite/sim/bfin/c_dsp32mult_pair_i.s
sim/testsuite/sim/bfin/c_dsp32mult_pair_is.s
sim/testsuite/sim/bfin/c_dsp32mult_pair_m.s
sim/testsuite/sim/bfin/c_dsp32mult_pair_m_i.s
sim/testsuite/sim/bfin/c_dsp32mult_pair_m_is.s
sim/testsuite/sim/bfin/c_dsp32mult_pair_m_s.s
sim/testsuite/sim/bfin/c_dsp32mult_pair_m_u.s
sim/testsuite/sim/bfin/c_dsp32mult_pair_s.s
sim/testsuite/sim/bfin/c_dsp32mult_pair_u.s
sim/testsuite/sim/bfin/c_dsp32shift_a0alr.s
sim/testsuite/sim/bfin/c_dsp32shift_af.s
sim/testsuite/sim/bfin/c_dsp32shift_af_s.s
sim/testsuite/sim/bfin/c_dsp32shift_ahalf_ln.s
sim/testsuite/sim/bfin/c_dsp32shift_ahalf_ln_s.s
sim/testsuite/sim/bfin/c_dsp32shift_ahalf_lp.s
sim/testsuite/sim/bfin/c_dsp32shift_ahalf_lp_s.s
sim/testsuite/sim/bfin/c_dsp32shift_ahalf_rn.s
sim/testsuite/sim/bfin/c_dsp32shift_ahalf_rn_s.s
sim/testsuite/sim/bfin/c_dsp32shift_ahalf_rp.s
sim/testsuite/sim/bfin/c_dsp32shift_ahalf_rp_s.s
sim/testsuite/sim/bfin/c_dsp32shift_ahh.s
sim/testsuite/sim/bfin/c_dsp32shift_ahh_s.s
sim/testsuite/sim/bfin/c_dsp32shift_align16.s
sim/testsuite/sim/bfin/c_dsp32shift_align24.s
sim/testsuite/sim/bfin/c_dsp32shift_align8.s
sim/testsuite/sim/bfin/c_dsp32shift_amix.s
sim/testsuite/sim/bfin/c_dsp32shift_bitmux.s
sim/testsuite/sim/bfin/c_dsp32shift_bxor.s
sim/testsuite/sim/bfin/c_dsp32shift_expadj_h.s
sim/testsuite/sim/bfin/c_dsp32shift_expadj_l.s
sim/testsuite/sim/bfin/c_dsp32shift_expadj_r.s
sim/testsuite/sim/bfin/c_dsp32shift_expexp_r.s
sim/testsuite/sim/bfin/c_dsp32shift_fdepx.s
sim/testsuite/sim/bfin/c_dsp32shift_fextx.s
sim/testsuite/sim/bfin/c_dsp32shift_lf.s
sim/testsuite/sim/bfin/c_dsp32shift_lhalf_ln.s
sim/testsuite/sim/bfin/c_dsp32shift_lhalf_lp.s
sim/testsuite/sim/bfin/c_dsp32shift_lhalf_rn.s
sim/testsuite/sim/bfin/c_dsp32shift_lhalf_rp.s
sim/testsuite/sim/bfin/c_dsp32shift_lhh.s
sim/testsuite/sim/bfin/c_dsp32shift_lmix.s
sim/testsuite/sim/bfin/c_dsp32shift_ones.s
sim/testsuite/sim/bfin/c_dsp32shift_pack.s
sim/testsuite/sim/bfin/c_dsp32shift_rot.s
sim/testsuite/sim/bfin/c_dsp32shift_rot_mix.s
sim/testsuite/sim/bfin/c_dsp32shift_signbits_r.s
sim/testsuite/sim/bfin/c_dsp32shift_signbits_rh.s
sim/testsuite/sim/bfin/c_dsp32shift_signbits_rl.s
sim/testsuite/sim/bfin/c_dsp32shift_vmax.s
sim/testsuite/sim/bfin/c_dsp32shift_vmaxvmax.s
sim/testsuite/sim/bfin/c_dsp32shiftim_a0alr.s
sim/testsuite/sim/bfin/c_dsp32shiftim_af.s
sim/testsuite/sim/bfin/c_dsp32shiftim_af_s.s
sim/testsuite/sim/bfin/c_dsp32shiftim_ahalf_ln.s
sim/testsuite/sim/bfin/c_dsp32shiftim_ahalf_ln_s.s
sim/testsuite/sim/bfin/c_dsp32shiftim_ahalf_lp.s
sim/testsuite/sim/bfin/c_dsp32shiftim_ahalf_lp_s.s
sim/testsuite/sim/bfin/c_dsp32shiftim_ahalf_rn.s
sim/testsuite/sim/bfin/c_dsp32shiftim_ahalf_rn_s.s
sim/testsuite/sim/bfin/c_dsp32shiftim_ahalf_rp.s
sim/testsuite/sim/bfin/c_dsp32shiftim_ahalf_rp_s.s
sim/testsuite/sim/bfin/c_dsp32shiftim_ahh.s
sim/testsuite/sim/bfin/c_dsp32shiftim_ahh_s.s
sim/testsuite/sim/bfin/c_dsp32shiftim_amix.s
sim/testsuite/sim/bfin/c_dsp32shiftim_lf.s
sim/testsuite/sim/bfin/c_dsp32shiftim_lhalf_ln.s
sim/testsuite/sim/bfin/c_dsp32shiftim_lhalf_lp.s
sim/testsuite/sim/bfin/c_dsp32shiftim_lhalf_rn.s
sim/testsuite/sim/bfin/c_dsp32shiftim_lhalf_rp.s
sim/testsuite/sim/bfin/c_dsp32shiftim_lhh.s
sim/testsuite/sim/bfin/c_dsp32shiftim_lmix.s
sim/testsuite/sim/bfin/c_dsp32shiftim_rot.s
sim/testsuite/sim/bfin/c_dspldst_ld_dr_i.s
sim/testsuite/sim/bfin/c_dspldst_ld_dr_ipp.s
sim/testsuite/sim/bfin/c_dspldst_ld_dr_ippm.s
sim/testsuite/sim/bfin/c_dspldst_ld_drhi_i.s
sim/testsuite/sim/bfin/c_dspldst_ld_drhi_ipp.s
sim/testsuite/sim/bfin/c_dspldst_ld_drlo_i.s
sim/testsuite/sim/bfin/c_dspldst_ld_drlo_ipp.s
sim/testsuite/sim/bfin/c_dspldst_st_dr_i.s
sim/testsuite/sim/bfin/c_dspldst_st_dr_ipp.s
sim/testsuite/sim/bfin/c_dspldst_st_dr_ippm.s
sim/testsuite/sim/bfin/c_dspldst_st_drhi_i.s
sim/testsuite/sim/bfin/c_dspldst_st_drhi_ipp.s
sim/testsuite/sim/bfin/c_dspldst_st_drlo_i.s
sim/testsuite/sim/bfin/c_dspldst_st_drlo_ipp.s
sim/testsuite/sim/bfin/c_except_illopcode.S
sim/testsuite/sim/bfin/c_except_sys_sstep.S
sim/testsuite/sim/bfin/c_except_user_mode.S
sim/testsuite/sim/bfin/c_interr_disable.S
sim/testsuite/sim/bfin/c_interr_disable_enable.S
sim/testsuite/sim/bfin/c_interr_excpt.S
sim/testsuite/sim/bfin/c_interr_loopsetup_stld.S
sim/testsuite/sim/bfin/c_interr_nested.S
sim/testsuite/sim/bfin/c_interr_nmi.S
sim/testsuite/sim/bfin/c_interr_pending.S
sim/testsuite/sim/bfin/c_interr_pending_2.S
sim/testsuite/sim/bfin/c_interr_timer.S
sim/testsuite/sim/bfin/c_interr_timer_reload.S
sim/testsuite/sim/bfin/c_interr_timer_tcount.S
sim/testsuite/sim/bfin/c_interr_timer_tscale.S
sim/testsuite/sim/bfin/c_ldimmhalf_dreg.s
sim/testsuite/sim/bfin/c_ldimmhalf_drhi.s
sim/testsuite/sim/bfin/c_ldimmhalf_drlo.s
sim/testsuite/sim/bfin/c_ldimmhalf_h_dr.s
sim/testsuite/sim/bfin/c_ldimmhalf_h_ibml.s
sim/testsuite/sim/bfin/c_ldimmhalf_h_pr.s
sim/testsuite/sim/bfin/c_ldimmhalf_l_dr.s
sim/testsuite/sim/bfin/c_ldimmhalf_l_ibml.s
sim/testsuite/sim/bfin/c_ldimmhalf_l_pr.s
sim/testsuite/sim/bfin/c_ldimmhalf_lz_dr.s
sim/testsuite/sim/bfin/c_ldimmhalf_lz_ibml.s
sim/testsuite/sim/bfin/c_ldimmhalf_lz_pr.s
sim/testsuite/sim/bfin/c_ldimmhalf_lzhi_dr.s
sim/testsuite/sim/bfin/c_ldimmhalf_lzhi_ibml.s
sim/testsuite/sim/bfin/c_ldimmhalf_lzhi_pr.s
sim/testsuite/sim/bfin/c_ldimmhalf_pibml.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_b.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_h.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_mm.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_mm_b.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_mm_h.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_mm_xb.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_mm_xh.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_pp.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_pp_b.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_pp_h.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_pp_xb.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_pp_xh.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_ppmm_hbx.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_xb.s
sim/testsuite/sim/bfin/c_ldst_ld_d_p_xh.s
sim/testsuite/sim/bfin/c_ldst_ld_p_p.s
sim/testsuite/sim/bfin/c_ldst_ld_p_p_mm.s
sim/testsuite/sim/bfin/c_ldst_ld_p_p_pp.s
sim/testsuite/sim/bfin/c_ldst_st_p_d.s
sim/testsuite/sim/bfin/c_ldst_st_p_d_b.s
sim/testsuite/sim/bfin/c_ldst_st_p_d_h.s
sim/testsuite/sim/bfin/c_ldst_st_p_d_mm.s
sim/testsuite/sim/bfin/c_ldst_st_p_d_mm_b.s
sim/testsuite/sim/bfin/c_ldst_st_p_d_mm_h.s
sim/testsuite/sim/bfin/c_ldst_st_p_d_pp.s
sim/testsuite/sim/bfin/c_ldst_st_p_d_pp_b.s
sim/testsuite/sim/bfin/c_ldst_st_p_d_pp_h.s
sim/testsuite/sim/bfin/c_ldst_st_p_p.s
sim/testsuite/sim/bfin/c_ldst_st_p_p_mm.s
sim/testsuite/sim/bfin/c_ldst_st_p_p_pp.s
sim/testsuite/sim/bfin/c_ldstidxl_ld_dr_b.s
sim/testsuite/sim/bfin/c_ldstidxl_ld_dr_h.s
sim/testsuite/sim/bfin/c_ldstidxl_ld_dr_xb.s
sim/testsuite/sim/bfin/c_ldstidxl_ld_dr_xh.s
sim/testsuite/sim/bfin/c_ldstidxl_ld_dreg.s
sim/testsuite/sim/bfin/c_ldstidxl_ld_preg.s
sim/testsuite/sim/bfin/c_ldstidxl_st_dr_b.s
sim/testsuite/sim/bfin/c_ldstidxl_st_dr_h.s
sim/testsuite/sim/bfin/c_ldstidxl_st_dreg.s
sim/testsuite/sim/bfin/c_ldstidxl_st_preg.s
sim/testsuite/sim/bfin/c_ldstii_ld_dr_h.s
sim/testsuite/sim/bfin/c_ldstii_ld_dr_xh.s
sim/testsuite/sim/bfin/c_ldstii_ld_dreg.s
sim/testsuite/sim/bfin/c_ldstii_ld_preg.s
sim/testsuite/sim/bfin/c_ldstii_st_dr_h.s
sim/testsuite/sim/bfin/c_ldstii_st_dreg.s
sim/testsuite/sim/bfin/c_ldstii_st_preg.s
sim/testsuite/sim/bfin/c_ldstiifp_ld_dreg.s
sim/testsuite/sim/bfin/c_ldstiifp_ld_preg.s
sim/testsuite/sim/bfin/c_ldstiifp_st_dreg.s
sim/testsuite/sim/bfin/c_ldstiifp_st_preg.s
sim/testsuite/sim/bfin/c_ldstpmod_ld_dr_hi.s
sim/testsuite/sim/bfin/c_ldstpmod_ld_dr_lo.s
sim/testsuite/sim/bfin/c_ldstpmod_ld_dreg.s
sim/testsuite/sim/bfin/c_ldstpmod_ld_h_xh.s
sim/testsuite/sim/bfin/c_ldstpmod_ld_lohi.s
sim/testsuite/sim/bfin/c_ldstpmod_st_dr_hi.s
sim/testsuite/sim/bfin/c_ldstpmod_st_dr_lo.s
sim/testsuite/sim/bfin/c_ldstpmod_st_dreg.s
sim/testsuite/sim/bfin/c_ldstpmod_st_lohi.s
sim/testsuite/sim/bfin/c_linkage.s
sim/testsuite/sim/bfin/c_logi2op_alshft_mix.s
sim/testsuite/sim/bfin/c_logi2op_arith_shft.s
sim/testsuite/sim/bfin/c_logi2op_bitclr.s
sim/testsuite/sim/bfin/c_logi2op_bitset.s
sim/testsuite/sim/bfin/c_logi2op_bittgl.s
sim/testsuite/sim/bfin/c_logi2op_bittst.s
sim/testsuite/sim/bfin/c_logi2op_log_l_shft.s
sim/testsuite/sim/bfin/c_logi2op_log_l_shft_astat.S
sim/testsuite/sim/bfin/c_logi2op_log_r_shft.s
sim/testsuite/sim/bfin/c_logi2op_log_r_shft_astat.S
sim/testsuite/sim/bfin/c_logi2op_nbittst.s
sim/testsuite/sim/bfin/c_loopsetup_nested.s
sim/testsuite/sim/bfin/c_loopsetup_nested_bot.s
sim/testsuite/sim/bfin/c_loopsetup_nested_prelc.s
sim/testsuite/sim/bfin/c_loopsetup_nested_top.s
sim/testsuite/sim/bfin/c_loopsetup_overlap.s
sim/testsuite/sim/bfin/c_loopsetup_preg_div2_lc0.s
sim/testsuite/sim/bfin/c_loopsetup_preg_div2_lc1.s
sim/testsuite/sim/bfin/c_loopsetup_preg_lc0.s
sim/testsuite/sim/bfin/c_loopsetup_preg_lc1.s
sim/testsuite/sim/bfin/c_loopsetup_preg_stld.s
sim/testsuite/sim/bfin/c_loopsetup_prelc.s
sim/testsuite/sim/bfin/c_loopsetup_topbotcntr.s
sim/testsuite/sim/bfin/c_mmr_interr_ctl.s
sim/testsuite/sim/bfin/c_mmr_loop.S
sim/testsuite/sim/bfin/c_mmr_loop_user_except.S
sim/testsuite/sim/bfin/c_mmr_ppop_illegal_adr.S
sim/testsuite/sim/bfin/c_mmr_ppopm_illegal_adr.S
sim/testsuite/sim/bfin/c_mmr_timer.S
sim/testsuite/sim/bfin/c_mode_supervisor.S
sim/testsuite/sim/bfin/c_mode_user.S
sim/testsuite/sim/bfin/c_mode_user_superivsor.S
sim/testsuite/sim/bfin/c_multi_issue_dsp_ld_ld.s
sim/testsuite/sim/bfin/c_multi_issue_dsp_ldst_1.s
sim/testsuite/sim/bfin/c_multi_issue_dsp_ldst_2.s
sim/testsuite/sim/bfin/c_progctrl_call_pcpr.s
sim/testsuite/sim/bfin/c_progctrl_call_pr.s
sim/testsuite/sim/bfin/c_progctrl_clisti_interr.S
sim/testsuite/sim/bfin/c_progctrl_csync_mmr.S
sim/testsuite/sim/bfin/c_progctrl_except_rtx.S
sim/testsuite/sim/bfin/c_progctrl_excpt.S
sim/testsuite/sim/bfin/c_progctrl_jump_pcpr.s
sim/testsuite/sim/bfin/c_progctrl_jump_pr.s
sim/testsuite/sim/bfin/c_progctrl_nop.s
sim/testsuite/sim/bfin/c_progctrl_raise_rt_i_n.S
sim/testsuite/sim/bfin/c_progctrl_rts.s
sim/testsuite/sim/bfin/c_ptr2op_pr_neg_pr.s
sim/testsuite/sim/bfin/c_ptr2op_pr_sft_2_1.s
sim/testsuite/sim/bfin/c_ptr2op_pr_shadd_1_2.s
sim/testsuite/sim/bfin/c_pushpopmultiple_dp.s
sim/testsuite/sim/bfin/c_pushpopmultiple_dp_pair.s
sim/testsuite/sim/bfin/c_pushpopmultiple_dreg.s
sim/testsuite/sim/bfin/c_pushpopmultiple_preg.s
sim/testsuite/sim/bfin/c_regmv_acc_acc.s
sim/testsuite/sim/bfin/c_regmv_dag_lz_dep.s
sim/testsuite/sim/bfin/c_regmv_dr_acc_acc.s
sim/testsuite/sim/bfin/c_regmv_dr_dep_nostall.s
sim/testsuite/sim/bfin/c_regmv_dr_dr.s
sim/testsuite/sim/bfin/c_regmv_dr_imlb.s
sim/testsuite/sim/bfin/c_regmv_dr_pr.s
sim/testsuite/sim/bfin/c_regmv_imlb_dep_nostall.s
sim/testsuite/sim/bfin/c_regmv_imlb_dep_stall.s
sim/testsuite/sim/bfin/c_regmv_imlb_dr.s
sim/testsuite/sim/bfin/c_regmv_imlb_imlb.s
sim/testsuite/sim/bfin/c_regmv_imlb_pr.s
sim/testsuite/sim/bfin/c_regmv_pr_dep_nostall.s
sim/testsuite/sim/bfin/c_regmv_pr_dep_stall.s
sim/testsuite/sim/bfin/c_regmv_pr_dr.s
sim/testsuite/sim/bfin/c_regmv_pr_imlb.s
sim/testsuite/sim/bfin/c_regmv_pr_pr.s
sim/testsuite/sim/bfin/c_seq_ac_raise_mv.S
sim/testsuite/sim/bfin/c_seq_ac_raise_mv_ppop.S
sim/testsuite/sim/bfin/c_seq_ac_regmv_pushpop.S
sim/testsuite/sim/bfin/c_seq_dec_raise_pushpop.S
sim/testsuite/sim/bfin/c_seq_ex1_brcc_mv_pop.S
sim/testsuite/sim/bfin/c_seq_ex1_call_mv_pop.S
sim/testsuite/sim/bfin/c_seq_ex1_j_mv_pop.S
sim/testsuite/sim/bfin/c_seq_ex1_raise_brcc_mv_pop.S
sim/testsuite/sim/bfin/c_seq_ex1_raise_call_mv_pop.S
sim/testsuite/sim/bfin/c_seq_ex1_raise_j_mv_pop.S
sim/testsuite/sim/bfin/c_seq_ex2_brcc_mp_mv_pop.S
sim/testsuite/sim/bfin/c_seq_ex2_mmr_mvpop.S
sim/testsuite/sim/bfin/c_seq_ex2_mmrj_mvpop.S
sim/testsuite/sim/bfin/c_seq_ex2_raise_mmr_mvpop.S
sim/testsuite/sim/bfin/c_seq_ex2_raise_mmrj_mvpop.S
sim/testsuite/sim/bfin/c_seq_ex3_ls_brcc_mvp.S
sim/testsuite/sim/bfin/c_seq_ex3_ls_mmr_mvp.S
sim/testsuite/sim/bfin/c_seq_ex3_ls_mmrj_mvp.S
sim/testsuite/sim/bfin/c_seq_ex3_raise_ls_mmrj_mvp.S
sim/testsuite/sim/bfin/c_seq_wb_cs_lsmmrj_mvp.S
sim/testsuite/sim/bfin/c_seq_wb_raisecs_lsmmrj_mvp.S
sim/testsuite/sim/bfin/c_seq_wb_rti_lsmmrj_mvp.S
sim/testsuite/sim/bfin/c_seq_wb_rtn_lsmmrj_mvp.S
sim/testsuite/sim/bfin/c_seq_wb_rtx_lsmmrj_mvp.S
sim/testsuite/sim/bfin/c_ujump.s
sim/testsuite/sim/bfin/cc-alu.S
sim/testsuite/sim/bfin/cc-astat-bits.s
sim/testsuite/sim/bfin/cc0.s
sim/testsuite/sim/bfin/cc1.s
sim/testsuite/sim/bfin/cc5.S
sim/testsuite/sim/bfin/cec-exact-exception.S
sim/testsuite/sim/bfin/cec-ifetch.S
sim/testsuite/sim/bfin/cec-multi-pending.S
sim/testsuite/sim/bfin/cec-no-snen-reti.S
sim/testsuite/sim/bfin/cec-non-operating-env.s
sim/testsuite/sim/bfin/cec-raise-reti.S
sim/testsuite/sim/bfin/cec-snen-reti.S
sim/testsuite/sim/bfin/cec-syscfg-ssstep.S
sim/testsuite/sim/bfin/cec-system-call.S
sim/testsuite/sim/bfin/cir.s
sim/testsuite/sim/bfin/cir1.s
sim/testsuite/sim/bfin/cli-sti.s
sim/testsuite/sim/bfin/cmpacc.s
sim/testsuite/sim/bfin/cmpdreg.S
sim/testsuite/sim/bfin/compare.s
sim/testsuite/sim/bfin/conv_enc_gen.s
sim/testsuite/sim/bfin/cycles.s
sim/testsuite/sim/bfin/d0.s
sim/testsuite/sim/bfin/d1.s
sim/testsuite/sim/bfin/d2.s
sim/testsuite/sim/bfin/dbg_brprd_ntkn_src_kill.S
sim/testsuite/sim/bfin/dbg_brtkn_nprd_src_kill.S
sim/testsuite/sim/bfin/dbg_jmp_src_kill.S
sim/testsuite/sim/bfin/dbg_tr_basic.S
sim/testsuite/sim/bfin/dbg_tr_simplejp.S
sim/testsuite/sim/bfin/dbg_tr_tbuf0.S
sim/testsuite/sim/bfin/dbg_tr_umode.S
sim/testsuite/sim/bfin/disalnexcpt_implicit.S
sim/testsuite/sim/bfin/div0.s
sim/testsuite/sim/bfin/divq.s
sim/testsuite/sim/bfin/dotproduct.s
sim/testsuite/sim/bfin/dotproduct2.s
sim/testsuite/sim/bfin/double_prec_mult.s
sim/testsuite/sim/bfin/dsp_a4.s
sim/testsuite/sim/bfin/dsp_a7.s
sim/testsuite/sim/bfin/dsp_a8.s
sim/testsuite/sim/bfin/dsp_d0.s
sim/testsuite/sim/bfin/dsp_d1.s
sim/testsuite/sim/bfin/dsp_neg.S
sim/testsuite/sim/bfin/dsp_s1.s
sim/testsuite/sim/bfin/e0.s
sim/testsuite/sim/bfin/edn_snafu.s
sim/testsuite/sim/bfin/eu_dsp32mac_s.s
sim/testsuite/sim/bfin/events.s
sim/testsuite/sim/bfin/f221.s
sim/testsuite/sim/bfin/fact.s
sim/testsuite/sim/bfin/fir.s
sim/testsuite/sim/bfin/fsm.s
sim/testsuite/sim/bfin/greg2.s
sim/testsuite/sim/bfin/hwloop-bits.S
sim/testsuite/sim/bfin/hwloop-branch-in.s
sim/testsuite/sim/bfin/hwloop-branch-out.s
sim/testsuite/sim/bfin/hwloop-lt-bits.s
sim/testsuite/sim/bfin/hwloop-nested.s
sim/testsuite/sim/bfin/i0.s
sim/testsuite/sim/bfin/iir.s
sim/testsuite/sim/bfin/issue103.s
sim/testsuite/sim/bfin/issue109.s
sim/testsuite/sim/bfin/issue112.s
sim/testsuite/sim/bfin/issue113.s
sim/testsuite/sim/bfin/issue117.s
sim/testsuite/sim/bfin/issue118.s
sim/testsuite/sim/bfin/issue119.s
sim/testsuite/sim/bfin/issue121.s
sim/testsuite/sim/bfin/issue123.s
sim/testsuite/sim/bfin/issue124.s
sim/testsuite/sim/bfin/issue125.s
sim/testsuite/sim/bfin/issue126.s
sim/testsuite/sim/bfin/issue127.s
sim/testsuite/sim/bfin/issue129.s
sim/testsuite/sim/bfin/issue139.S
sim/testsuite/sim/bfin/issue140.S
sim/testsuite/sim/bfin/issue142.s
sim/testsuite/sim/bfin/issue144.s
sim/testsuite/sim/bfin/issue146.S
sim/testsuite/sim/bfin/issue175.s
sim/testsuite/sim/bfin/issue205.s
sim/testsuite/sim/bfin/issue257.s
sim/testsuite/sim/bfin/issue272.S
sim/testsuite/sim/bfin/issue83.s
sim/testsuite/sim/bfin/issue89.s
sim/testsuite/sim/bfin/l0.s
sim/testsuite/sim/bfin/l0shift.s
sim/testsuite/sim/bfin/l2_loop.s
sim/testsuite/sim/bfin/link-2.s
sim/testsuite/sim/bfin/link.s
sim/testsuite/sim/bfin/lmu_cplb_multiple0.S
sim/testsuite/sim/bfin/lmu_cplb_multiple1.S
sim/testsuite/sim/bfin/lmu_excpt_align.S
sim/testsuite/sim/bfin/lmu_excpt_default.S
sim/testsuite/sim/bfin/lmu_excpt_illaddr.S
sim/testsuite/sim/bfin/lmu_excpt_prot0.S
sim/testsuite/sim/bfin/lmu_excpt_prot1.S
sim/testsuite/sim/bfin/load.s
sim/testsuite/sim/bfin/logic.s
sim/testsuite/sim/bfin/loop_snafu.s
sim/testsuite/sim/bfin/loop_strncpy.s
sim/testsuite/sim/bfin/lp0.s
sim/testsuite/sim/bfin/lp1.s
sim/testsuite/sim/bfin/lsetup.s
sim/testsuite/sim/bfin/m0boundary.s
sim/testsuite/sim/bfin/m1.S
sim/testsuite/sim/bfin/m10.s
sim/testsuite/sim/bfin/m11.s
sim/testsuite/sim/bfin/m12.s
sim/testsuite/sim/bfin/m13.s
sim/testsuite/sim/bfin/m14.s
sim/testsuite/sim/bfin/m15.s
sim/testsuite/sim/bfin/m16.s
sim/testsuite/sim/bfin/m17.s
sim/testsuite/sim/bfin/m2.s
sim/testsuite/sim/bfin/m3.s
sim/testsuite/sim/bfin/m4.s
sim/testsuite/sim/bfin/m5.s
sim/testsuite/sim/bfin/m6.s
sim/testsuite/sim/bfin/m7.s
sim/testsuite/sim/bfin/m8.s
sim/testsuite/sim/bfin/m9.s
sim/testsuite/sim/bfin/mac2halfreg.S
sim/testsuite/sim/bfin/math.s
sim/testsuite/sim/bfin/max_min_flags.s
sim/testsuite/sim/bfin/mc_s2.s
sim/testsuite/sim/bfin/mdma-32bit-1d-neg-count.c
sim/testsuite/sim/bfin/mdma-32bit-1d.c
sim/testsuite/sim/bfin/mdma-8bit-1d-neg-count.c
sim/testsuite/sim/bfin/mdma-8bit-1d.c
sim/testsuite/sim/bfin/mdma-skel.h
sim/testsuite/sim/bfin/mem3.s
sim/testsuite/sim/bfin/mmr-exception.s
sim/testsuite/sim/bfin/move.s
sim/testsuite/sim/bfin/msa_acp_5.10.S
sim/testsuite/sim/bfin/msa_acp_5.12_1.S
sim/testsuite/sim/bfin/msa_acp_5.12_2.S
sim/testsuite/sim/bfin/msa_acp_5_10.s
sim/testsuite/sim/bfin/mult.s
sim/testsuite/sim/bfin/neg-2.S
sim/testsuite/sim/bfin/neg-3.S
sim/testsuite/sim/bfin/neg.S
sim/testsuite/sim/bfin/nshift.s
sim/testsuite/sim/bfin/pr.s
sim/testsuite/sim/bfin/push-pop-multiple.s
sim/testsuite/sim/bfin/push-pop.s
sim/testsuite/sim/bfin/pushpopreg_1.s
sim/testsuite/sim/bfin/quadaddsub.s
sim/testsuite/sim/bfin/random_0001.s
sim/testsuite/sim/bfin/random_0002.S
sim/testsuite/sim/bfin/random_0003.S
sim/testsuite/sim/bfin/random_0004.S
sim/testsuite/sim/bfin/random_0005.S
sim/testsuite/sim/bfin/random_0006.S
sim/testsuite/sim/bfin/random_0007.S
sim/testsuite/sim/bfin/random_0008.S
sim/testsuite/sim/bfin/random_0009.S
sim/testsuite/sim/bfin/random_0010.S
sim/testsuite/sim/bfin/random_0011.S
sim/testsuite/sim/bfin/random_0012.S
sim/testsuite/sim/bfin/random_0013.S
sim/testsuite/sim/bfin/random_0019.S
sim/testsuite/sim/bfin/random_0020.S
sim/testsuite/sim/bfin/random_0021.S
sim/testsuite/sim/bfin/random_0022.S
sim/testsuite/sim/bfin/random_0023.S
sim/testsuite/sim/bfin/random_0024.S
sim/testsuite/sim/bfin/random_0026.S
sim/testsuite/sim/bfin/random_0027.S
sim/testsuite/sim/bfin/random_0028.S
sim/testsuite/sim/bfin/random_0029.S
sim/testsuite/sim/bfin/random_0030.S
sim/testsuite/sim/bfin/random_0031.S
sim/testsuite/sim/bfin/random_0032.S
sim/testsuite/sim/bfin/random_0033.S
sim/testsuite/sim/bfin/random_0034.S
sim/testsuite/sim/bfin/random_0035.S
sim/testsuite/sim/bfin/run-tests.sh
sim/testsuite/sim/bfin/s0.s
sim/testsuite/sim/bfin/s1.s
sim/testsuite/sim/bfin/s10.s
sim/testsuite/sim/bfin/s11.s
sim/testsuite/sim/bfin/s12.s
sim/testsuite/sim/bfin/s13.s
sim/testsuite/sim/bfin/s14.s
sim/testsuite/sim/bfin/s15.s
sim/testsuite/sim/bfin/s16.s
sim/testsuite/sim/bfin/s17.s
sim/testsuite/sim/bfin/s18.s
sim/testsuite/sim/bfin/s19.s
sim/testsuite/sim/bfin/s2.s
sim/testsuite/sim/bfin/s20.s
sim/testsuite/sim/bfin/s21.s
sim/testsuite/sim/bfin/s3.s
sim/testsuite/sim/bfin/s30.s
sim/testsuite/sim/bfin/s4.s
sim/testsuite/sim/bfin/s5.s
sim/testsuite/sim/bfin/s6.s
sim/testsuite/sim/bfin/s7.s
sim/testsuite/sim/bfin/s8.s
sim/testsuite/sim/bfin/s9.s
sim/testsuite/sim/bfin/saatest.s
sim/testsuite/sim/bfin/se_all16bitopcodes.S
sim/testsuite/sim/bfin/se_all32bitopcodes.S
sim/testsuite/sim/bfin/se_all32bitopcodes.lds
sim/testsuite/sim/bfin/se_brtarget_stall.S
sim/testsuite/sim/bfin/se_bug_ui.S
sim/testsuite/sim/bfin/se_bug_ui2.S
sim/testsuite/sim/bfin/se_bug_ui3.S
sim/testsuite/sim/bfin/se_cc2stat_haz.S
sim/testsuite/sim/bfin/se_cc_kill.S
sim/testsuite/sim/bfin/se_cof.S
sim/testsuite/sim/bfin/se_event_quad.S
sim/testsuite/sim/bfin/se_excpt_dagprotviol.S
sim/testsuite/sim/bfin/se_excpt_ifprotviol.S
sim/testsuite/sim/bfin/se_excpt_ssstep.S
sim/testsuite/sim/bfin/se_illegalcombination.S
sim/testsuite/sim/bfin/se_kill_wbbr.S
sim/testsuite/sim/bfin/se_kills2.S
sim/testsuite/sim/bfin/se_loop_disable.S
sim/testsuite/sim/bfin/se_loop_kill.S
sim/testsuite/sim/bfin/se_loop_kill_01.S
sim/testsuite/sim/bfin/se_loop_kill_dcr.S
sim/testsuite/sim/bfin/se_loop_kill_dcr_01.S
sim/testsuite/sim/bfin/se_loop_lr.S
sim/testsuite/sim/bfin/se_loop_mv2lb_stall.S
sim/testsuite/sim/bfin/se_loop_mv2lc.S
sim/testsuite/sim/bfin/se_loop_mv2lc_stall.S
sim/testsuite/sim/bfin/se_loop_mv2lt_stall.S
sim/testsuite/sim/bfin/se_loop_nest_ppm.S
sim/testsuite/sim/bfin/se_loop_nest_ppm_1.S
sim/testsuite/sim/bfin/se_loop_nest_ppm_2.S
sim/testsuite/sim/bfin/se_loop_ppm.S
sim/testsuite/sim/bfin/se_loop_ppm_1.S
sim/testsuite/sim/bfin/se_loop_ppm_int.S
sim/testsuite/sim/bfin/se_lsetup_kill.S
sim/testsuite/sim/bfin/se_misaligned_fetch.S
sim/testsuite/sim/bfin/se_more_ret_haz.S
sim/testsuite/sim/bfin/se_mv2lp.S
sim/testsuite/sim/bfin/se_oneins_zoff.S
sim/testsuite/sim/bfin/se_popkill.S
sim/testsuite/sim/bfin/se_regmv_usp_sysreg.S
sim/testsuite/sim/bfin/se_rets_hazard.s
sim/testsuite/sim/bfin/se_rts_rti.S
sim/testsuite/sim/bfin/se_ssstep_dagprotviol.S
sim/testsuite/sim/bfin/se_ssync.S
sim/testsuite/sim/bfin/se_stall_if2.S
sim/testsuite/sim/bfin/se_undefinedinstruction1.S
sim/testsuite/sim/bfin/se_undefinedinstruction2.S
sim/testsuite/sim/bfin/se_undefinedinstruction3.S
sim/testsuite/sim/bfin/se_undefinedinstruction4.S
sim/testsuite/sim/bfin/se_usermode_protviol.S
sim/testsuite/sim/bfin/seqstat.s
sim/testsuite/sim/bfin/sign.s
sim/testsuite/sim/bfin/simple0.s
sim/testsuite/sim/bfin/sri.s
sim/testsuite/sim/bfin/stk.s
sim/testsuite/sim/bfin/stk2.s
sim/testsuite/sim/bfin/stk3.s
sim/testsuite/sim/bfin/stk4.s
sim/testsuite/sim/bfin/stk5.s
sim/testsuite/sim/bfin/stk6.s
sim/testsuite/sim/bfin/syscfg.s
sim/testsuite/sim/bfin/tar10622.s
sim/testsuite/sim/bfin/test-dma.h
sim/testsuite/sim/bfin/test.h
sim/testsuite/sim/bfin/testset.s
sim/testsuite/sim/bfin/testset2.s
sim/testsuite/sim/bfin/testutils.inc
sim/testsuite/sim/bfin/unlink.S
sim/testsuite/sim/bfin/up0.s
sim/testsuite/sim/bfin/usp.S
sim/testsuite/sim/bfin/vec-abs-2.S
sim/testsuite/sim/bfin/vec-abs-3.S
sim/testsuite/sim/bfin/vec-abs.S
sim/testsuite/sim/bfin/vec-neg-2.S
sim/testsuite/sim/bfin/vec-neg-3.S
sim/testsuite/sim/bfin/vec-neg.S
sim/testsuite/sim/bfin/vecadd.s
sim/testsuite/sim/bfin/vit_max.s
sim/testsuite/sim/bfin/viterbi2.s
sim/testsuite/sim/bfin/wtf.s
sim/testsuite/sim/bfin/x1.s
sim/testsuite/sim/bfin/zcall.s
sim/testsuite/sim/bfin/zeroflagrnd.s
sim/testsuite/sim/cr16/ChangeLog
sim/testsuite/sim/cr16/addb.cgs
sim/testsuite/sim/cr16/addd.cgs
sim/testsuite/sim/cr16/addi.cgs
sim/testsuite/sim/cr16/addw.cgs
sim/testsuite/sim/cr16/allinsn.exp
sim/testsuite/sim/cr16/andb.cgs
sim/testsuite/sim/cr16/andd.cgs
sim/testsuite/sim/cr16/andw.cgs
sim/testsuite/sim/cr16/ashub.cgs
sim/testsuite/sim/cr16/ashub_i.cgs
sim/testsuite/sim/cr16/ashud.cgs
sim/testsuite/sim/cr16/ashud_i.cgs
sim/testsuite/sim/cr16/ashuw.cgs
sim/testsuite/sim/cr16/ashuw_i.cgs
sim/testsuite/sim/cr16/bal1_24.cgs
sim/testsuite/sim/cr16/bal2_24.cgs
sim/testsuite/sim/cr16/bcc.cgs
sim/testsuite/sim/cr16/bcs.cgs
sim/testsuite/sim/cr16/beq.cgs
sim/testsuite/sim/cr16/beq0b.cgs
sim/testsuite/sim/cr16/beq0w.cgs
sim/testsuite/sim/cr16/bge.cgs
sim/testsuite/sim/cr16/bgt.cgs
sim/testsuite/sim/cr16/bhi.cgs
sim/testsuite/sim/cr16/bhs.cgs
sim/testsuite/sim/cr16/bht.cgs
sim/testsuite/sim/cr16/blo.cgs
sim/testsuite/sim/cr16/bls.cgs
sim/testsuite/sim/cr16/blt.cgs
sim/testsuite/sim/cr16/bne.cgs
sim/testsuite/sim/cr16/bne0b.cgs
sim/testsuite/sim/cr16/bne0w.cgs
sim/testsuite/sim/cr16/br.cgs
sim/testsuite/sim/cr16/cbitb.cgs
sim/testsuite/sim/cr16/cbitw.cgs
sim/testsuite/sim/cr16/cmpb.cgs
sim/testsuite/sim/cr16/cmpb_i.cgs
sim/testsuite/sim/cr16/cmpd.cgs
sim/testsuite/sim/cr16/cmpd_i.cgs
sim/testsuite/sim/cr16/cmpi.cgs
sim/testsuite/sim/cr16/cmpw.cgs
sim/testsuite/sim/cr16/cmpw_i.cgs
sim/testsuite/sim/cr16/excp.cgs
sim/testsuite/sim/cr16/hello.ms
sim/testsuite/sim/cr16/hw-trap.ms
sim/testsuite/sim/cr16/jal.cgs
sim/testsuite/sim/cr16/jcc.cgs
sim/testsuite/sim/cr16/jcs.cgs
sim/testsuite/sim/cr16/jeq.cgs
sim/testsuite/sim/cr16/jfc.cgs
sim/testsuite/sim/cr16/jfs.cgs
sim/testsuite/sim/cr16/jge.cgs
sim/testsuite/sim/cr16/jgt.cgs
sim/testsuite/sim/cr16/jhi.cgs
sim/testsuite/sim/cr16/jhs.cgs
sim/testsuite/sim/cr16/jlo.cgs
sim/testsuite/sim/cr16/jls.cgs
sim/testsuite/sim/cr16/jlt.cgs
sim/testsuite/sim/cr16/jne.cgs
sim/testsuite/sim/cr16/jump.cgs
sim/testsuite/sim/cr16/loadb.cgs
sim/testsuite/sim/cr16/loadd.cgs
sim/testsuite/sim/cr16/loadm.cgs
sim/testsuite/sim/cr16/loadmp.cgs
sim/testsuite/sim/cr16/loadw.cgs
sim/testsuite/sim/cr16/lpr-spr.cgs
sim/testsuite/sim/cr16/lprd-sprd.cgs
sim/testsuite/sim/cr16/lshb.cgs
sim/testsuite/sim/cr16/lshb_i.cgs
sim/testsuite/sim/cr16/lshd.cgs
sim/testsuite/sim/cr16/lshd_i.cgs
sim/testsuite/sim/cr16/lshw.cgs
sim/testsuite/sim/cr16/lshw_i.cgs
sim/testsuite/sim/cr16/macqw.cgs
sim/testsuite/sim/cr16/macsw.cgs
sim/testsuite/sim/cr16/macuw.cgs
sim/testsuite/sim/cr16/misc.exp
sim/testsuite/sim/cr16/movb.cgs
sim/testsuite/sim/cr16/movd.cgs
sim/testsuite/sim/cr16/movw.cgs
sim/testsuite/sim/cr16/movxb.cgs
sim/testsuite/sim/cr16/movxw.cgs
sim/testsuite/sim/cr16/movzb.cgs
sim/testsuite/sim/cr16/movzw.cgs
sim/testsuite/sim/cr16/mulb.cgs
sim/testsuite/sim/cr16/mulsb.cgs
sim/testsuite/sim/cr16/mulsw.cgs
sim/testsuite/sim/cr16/muluw.cgs
sim/testsuite/sim/cr16/mulw.cgs
sim/testsuite/sim/cr16/nop.cgs
sim/testsuite/sim/cr16/orb.cgs
sim/testsuite/sim/cr16/ord.cgs
sim/testsuite/sim/cr16/orw.cgs
sim/testsuite/sim/cr16/pop1.cgs
sim/testsuite/sim/cr16/pop2.cgs
sim/testsuite/sim/cr16/pop3.cgs
sim/testsuite/sim/cr16/popret1.cgs
sim/testsuite/sim/cr16/popret2.cgs
sim/testsuite/sim/cr16/popret3.cgs
sim/testsuite/sim/cr16/push1.cgs
sim/testsuite/sim/cr16/push2.cgs
sim/testsuite/sim/cr16/push3.cgs
sim/testsuite/sim/cr16/sbitb.cgs
sim/testsuite/sim/cr16/sbitw.cgs
sim/testsuite/sim/cr16/scc.cgs
sim/testsuite/sim/cr16/scs.cgs
sim/testsuite/sim/cr16/seq.cgs
sim/testsuite/sim/cr16/sfc.cgs
sim/testsuite/sim/cr16/sfs.cgs
sim/testsuite/sim/cr16/sge.cgs
sim/testsuite/sim/cr16/sgt.cgs
sim/testsuite/sim/cr16/shi.cgs
sim/testsuite/sim/cr16/shs.cgs
sim/testsuite/sim/cr16/slo.cgs
sim/testsuite/sim/cr16/sls.cgs
sim/testsuite/sim/cr16/slt.cgs
sim/testsuite/sim/cr16/sne.cgs
sim/testsuite/sim/cr16/storb.cgs
sim/testsuite/sim/cr16/stord.cgs
sim/testsuite/sim/cr16/storw.cgs
sim/testsuite/sim/cr16/subb.cgs
sim/testsuite/sim/cr16/subd.cgs
sim/testsuite/sim/cr16/subi.cgs
sim/testsuite/sim/cr16/subw.cgs
sim/testsuite/sim/cr16/tbit.cgs
sim/testsuite/sim/cr16/tbitb.cgs
sim/testsuite/sim/cr16/tbitw.cgs
sim/testsuite/sim/cr16/testutils.inc
sim/testsuite/sim/cr16/uread16.ms
sim/testsuite/sim/cr16/uread32.ms
sim/testsuite/sim/cr16/xorb.cgs
sim/testsuite/sim/cr16/xord.cgs
sim/testsuite/sim/cr16/xorw.cgs
sim/testsuite/sim/cris/asm/abs.ms
sim/testsuite/sim/cris/asm/addc.ms
sim/testsuite/sim/cris/asm/addcpc.ms
sim/testsuite/sim/cris/asm/addcv32c.ms
sim/testsuite/sim/cris/asm/addcv32m.ms
sim/testsuite/sim/cris/asm/addcv32r.ms
sim/testsuite/sim/cris/asm/addi.ms
sim/testsuite/sim/cris/asm/addiv32.ms
sim/testsuite/sim/cris/asm/addm.ms
sim/testsuite/sim/cris/asm/addoc.ms
sim/testsuite/sim/cris/asm/addom.ms
sim/testsuite/sim/cris/asm/addoq.ms
sim/testsuite/sim/cris/asm/addq.ms
sim/testsuite/sim/cris/asm/addqpc.ms
sim/testsuite/sim/cris/asm/addr.ms
sim/testsuite/sim/cris/asm/addswpc.ms
sim/testsuite/sim/cris/asm/addxc.ms
sim/testsuite/sim/cris/asm/addxm.ms
sim/testsuite/sim/cris/asm/addxr.ms
sim/testsuite/sim/cris/asm/andc.ms
sim/testsuite/sim/cris/asm/andm.ms
sim/testsuite/sim/cris/asm/andq.ms
sim/testsuite/sim/cris/asm/andr.ms
sim/testsuite/sim/cris/asm/asm.exp
sim/testsuite/sim/cris/asm/asr.ms
sim/testsuite/sim/cris/asm/ba.ms
sim/testsuite/sim/cris/asm/badarch1.ms
sim/testsuite/sim/cris/asm/bare1.ms
sim/testsuite/sim/cris/asm/bare2.ms
sim/testsuite/sim/cris/asm/bare3.ms
sim/testsuite/sim/cris/asm/bas.ms
sim/testsuite/sim/cris/asm/bccb.ms
sim/testsuite/sim/cris/asm/bdapc.ms
sim/testsuite/sim/cris/asm/bdapm.ms
sim/testsuite/sim/cris/asm/bdapq.ms
sim/testsuite/sim/cris/asm/bdapqpc.ms
sim/testsuite/sim/cris/asm/biap.ms
sim/testsuite/sim/cris/asm/boundc.ms
sim/testsuite/sim/cris/asm/boundm.ms
sim/testsuite/sim/cris/asm/boundmv32.ms
sim/testsuite/sim/cris/asm/boundr.ms
sim/testsuite/sim/cris/asm/break.ms
sim/testsuite/sim/cris/asm/btst.ms
sim/testsuite/sim/cris/asm/ccr-v10.ms
sim/testsuite/sim/cris/asm/ccs-v32.ms
sim/testsuite/sim/cris/asm/clearfv10.ms
sim/testsuite/sim/cris/asm/clearfv32.ms
sim/testsuite/sim/cris/asm/clrjmp1.ms
sim/testsuite/sim/cris/asm/cmpc.ms
sim/testsuite/sim/cris/asm/cmpm.ms
sim/testsuite/sim/cris/asm/cmpq.ms
sim/testsuite/sim/cris/asm/cmpr.ms
sim/testsuite/sim/cris/asm/cmpxc.ms
sim/testsuite/sim/cris/asm/cmpxm.ms
sim/testsuite/sim/cris/asm/dflags.ms
sim/testsuite/sim/cris/asm/dip.ms
sim/testsuite/sim/cris/asm/dstep.ms
sim/testsuite/sim/cris/asm/fidxd.ms
sim/testsuite/sim/cris/asm/fidxi.ms
sim/testsuite/sim/cris/asm/ftagd.ms
sim/testsuite/sim/cris/asm/ftagi.ms
sim/testsuite/sim/cris/asm/halt.ms
sim/testsuite/sim/cris/asm/io1.ms
sim/testsuite/sim/cris/asm/io2.ms
sim/testsuite/sim/cris/asm/io3.ms
sim/testsuite/sim/cris/asm/io4.ms
sim/testsuite/sim/cris/asm/io5.ms
sim/testsuite/sim/cris/asm/io6.ms
sim/testsuite/sim/cris/asm/io7.ms
sim/testsuite/sim/cris/asm/io8.ms
sim/testsuite/sim/cris/asm/io9.ms
sim/testsuite/sim/cris/asm/jsr.ms
sim/testsuite/sim/cris/asm/jsrmv10.ms
sim/testsuite/sim/cris/asm/jumpmp.ms
sim/testsuite/sim/cris/asm/jumppv32.ms
sim/testsuite/sim/cris/asm/lapc.ms
sim/testsuite/sim/cris/asm/lsl.ms
sim/testsuite/sim/cris/asm/lsr.ms
sim/testsuite/sim/cris/asm/lz.ms
sim/testsuite/sim/cris/asm/mcp.ms
sim/testsuite/sim/cris/asm/movdelsr1.ms
sim/testsuite/sim/cris/asm/movecpc.ms
sim/testsuite/sim/cris/asm/movecr.ms
sim/testsuite/sim/cris/asm/movecrt10.ms
sim/testsuite/sim/cris/asm/movecrt32.ms
sim/testsuite/sim/cris/asm/movect10.ms
sim/testsuite/sim/cris/asm/movei.ms
sim/testsuite/sim/cris/asm/movempc.ms
sim/testsuite/sim/cris/asm/movemr.ms
sim/testsuite/sim/cris/asm/movemrv10.ms
sim/testsuite/sim/cris/asm/movemrv32.ms
sim/testsuite/sim/cris/asm/movepcb.ms
sim/testsuite/sim/cris/asm/movepcd.ms
sim/testsuite/sim/cris/asm/movepcw.ms
sim/testsuite/sim/cris/asm/moveq.ms
sim/testsuite/sim/cris/asm/moveqpc.ms
sim/testsuite/sim/cris/asm/mover.ms
sim/testsuite/sim/cris/asm/moverbpc.ms
sim/testsuite/sim/cris/asm/moverdpc.ms
sim/testsuite/sim/cris/asm/moverm.ms
sim/testsuite/sim/cris/asm/moverpcb.ms
sim/testsuite/sim/cris/asm/moverpcd.ms
sim/testsuite/sim/cris/asm/moverpcw.ms
sim/testsuite/sim/cris/asm/moverwpc.ms
sim/testsuite/sim/cris/asm/movesmp.ms
sim/testsuite/sim/cris/asm/movmp.ms
sim/testsuite/sim/cris/asm/movmp8.ms
sim/testsuite/sim/cris/asm/movpmv10.ms
sim/testsuite/sim/cris/asm/movpmv32.ms
sim/testsuite/sim/cris/asm/movppc.ms
sim/testsuite/sim/cris/asm/movpr.ms
sim/testsuite/sim/cris/asm/movprv10.ms
sim/testsuite/sim/cris/asm/movprv32.ms
sim/testsuite/sim/cris/asm/movrss.ms
sim/testsuite/sim/cris/asm/movscpc.ms
sim/testsuite/sim/cris/asm/movscr.ms
sim/testsuite/sim/cris/asm/movsm.ms
sim/testsuite/sim/cris/asm/movsmpc.ms
sim/testsuite/sim/cris/asm/movsr.ms
sim/testsuite/sim/cris/asm/movsrpc.ms
sim/testsuite/sim/cris/asm/movssr.ms
sim/testsuite/sim/cris/asm/movucpc.ms
sim/testsuite/sim/cris/asm/movucr.ms
sim/testsuite/sim/cris/asm/movum.ms
sim/testsuite/sim/cris/asm/movumpc.ms
sim/testsuite/sim/cris/asm/movur.ms
sim/testsuite/sim/cris/asm/movurpc.ms
sim/testsuite/sim/cris/asm/mstep.ms
sim/testsuite/sim/cris/asm/msteppc1.ms
sim/testsuite/sim/cris/asm/msteppc2.ms
sim/testsuite/sim/cris/asm/msteppc3.ms
sim/testsuite/sim/cris/asm/mulv10.ms
sim/testsuite/sim/cris/asm/mulv32.ms
sim/testsuite/sim/cris/asm/mulx.ms
sim/testsuite/sim/cris/asm/neg.ms
sim/testsuite/sim/cris/asm/nonvcv32.ms
sim/testsuite/sim/cris/asm/nopv10t.ms
sim/testsuite/sim/cris/asm/nopv32t.ms
sim/testsuite/sim/cris/asm/nopv32t2.ms
sim/testsuite/sim/cris/asm/nopv32t3.ms
sim/testsuite/sim/cris/asm/nopv32t4.ms
sim/testsuite/sim/cris/asm/not.ms
sim/testsuite/sim/cris/asm/op3.ms
sim/testsuite/sim/cris/asm/opterr1.ms
sim/testsuite/sim/cris/asm/opterr2.ms
sim/testsuite/sim/cris/asm/opterr3.ms
sim/testsuite/sim/cris/asm/opterr4.ms
sim/testsuite/sim/cris/asm/opterr5.ms
sim/testsuite/sim/cris/asm/option1.ms
sim/testsuite/sim/cris/asm/option2.ms
sim/testsuite/sim/cris/asm/option3.ms
sim/testsuite/sim/cris/asm/option4.ms
sim/testsuite/sim/cris/asm/orc.ms
sim/testsuite/sim/cris/asm/orm.ms
sim/testsuite/sim/cris/asm/orq.ms
sim/testsuite/sim/cris/asm/orr.ms
sim/testsuite/sim/cris/asm/pcplus.ms
sim/testsuite/sim/cris/asm/pid1.ms
sim/testsuite/sim/cris/asm/raw1.ms
sim/testsuite/sim/cris/asm/raw10.ms
sim/testsuite/sim/cris/asm/raw11.ms
sim/testsuite/sim/cris/asm/raw12.ms
sim/testsuite/sim/cris/asm/raw13.ms
sim/testsuite/sim/cris/asm/raw14.ms
sim/testsuite/sim/cris/asm/raw15.ms
sim/testsuite/sim/cris/asm/raw16.ms
sim/testsuite/sim/cris/asm/raw17.ms
sim/testsuite/sim/cris/asm/raw2.ms
sim/testsuite/sim/cris/asm/raw3.ms
sim/testsuite/sim/cris/asm/raw4.ms
sim/testsuite/sim/cris/asm/raw5.ms
sim/testsuite/sim/cris/asm/raw6.ms
sim/testsuite/sim/cris/asm/raw7.ms
sim/testsuite/sim/cris/asm/raw8.ms
sim/testsuite/sim/cris/asm/raw9.ms
sim/testsuite/sim/cris/asm/ret.ms
sim/testsuite/sim/cris/asm/rfe.ms
sim/testsuite/sim/cris/asm/rfg.ms
sim/testsuite/sim/cris/asm/rfn.ms
sim/testsuite/sim/cris/asm/sbfs.ms
sim/testsuite/sim/cris/asm/scc.ms
sim/testsuite/sim/cris/asm/sfe.ms
sim/testsuite/sim/cris/asm/subc.ms
sim/testsuite/sim/cris/asm/subm.ms
sim/testsuite/sim/cris/asm/subq.ms
sim/testsuite/sim/cris/asm/subqpc.ms
sim/testsuite/sim/cris/asm/subr.ms
sim/testsuite/sim/cris/asm/subxc.ms
sim/testsuite/sim/cris/asm/subxm.ms
sim/testsuite/sim/cris/asm/subxr.ms
sim/testsuite/sim/cris/asm/swap.ms
sim/testsuite/sim/cris/asm/tb.ms
sim/testsuite/sim/cris/asm/test.ms
sim/testsuite/sim/cris/asm/testutils.inc
sim/testsuite/sim/cris/asm/tjmpsrv32-2.ms
sim/testsuite/sim/cris/asm/tjmpsrv32.ms
sim/testsuite/sim/cris/asm/tjsrcv10.ms
sim/testsuite/sim/cris/asm/tjsrcv32.ms
sim/testsuite/sim/cris/asm/tmemv10.ms
sim/testsuite/sim/cris/asm/tmemv32.ms
sim/testsuite/sim/cris/asm/tmulv10.ms
sim/testsuite/sim/cris/asm/tmulv32.ms
sim/testsuite/sim/cris/asm/tmvm1.ms
sim/testsuite/sim/cris/asm/tmvm2.ms
sim/testsuite/sim/cris/asm/tmvmrv10.ms
sim/testsuite/sim/cris/asm/tmvmrv32.ms
sim/testsuite/sim/cris/asm/tmvrmv10.ms
sim/testsuite/sim/cris/asm/tmvrmv32.ms
sim/testsuite/sim/cris/asm/user.ms
sim/testsuite/sim/cris/asm/x0-v10.ms
sim/testsuite/sim/cris/asm/x0-v32.ms
sim/testsuite/sim/cris/asm/x1-v10.ms
sim/testsuite/sim/cris/asm/x1-v32.ms
sim/testsuite/sim/cris/asm/x10-v10.ms
sim/testsuite/sim/cris/asm/x2-v10.ms
sim/testsuite/sim/cris/asm/x2-v32.ms
sim/testsuite/sim/cris/asm/x3-v10.ms
sim/testsuite/sim/cris/asm/x3-v32.ms
sim/testsuite/sim/cris/asm/x4-v32.ms
sim/testsuite/sim/cris/asm/x5-v10.ms
sim/testsuite/sim/cris/asm/x5-v32.ms
sim/testsuite/sim/cris/asm/x6-v10.ms
sim/testsuite/sim/cris/asm/x6-v32.ms
sim/testsuite/sim/cris/asm/x7-v10.ms
sim/testsuite/sim/cris/asm/x7-v32.ms
sim/testsuite/sim/cris/asm/x8-v10.ms
sim/testsuite/sim/cris/asm/x9-v10.ms
sim/testsuite/sim/cris/asm/xor.ms
sim/testsuite/sim/cris/c/access1.c
sim/testsuite/sim/cris/c/append1.c
sim/testsuite/sim/cris/c/badldso1.c
sim/testsuite/sim/cris/c/badldso2.c
sim/testsuite/sim/cris/c/badldso3.c
sim/testsuite/sim/cris/c/c.exp
sim/testsuite/sim/cris/c/clone1.c
sim/testsuite/sim/cris/c/clone2.c
sim/testsuite/sim/cris/c/clone3.c
sim/testsuite/sim/cris/c/clone4.c
sim/testsuite/sim/cris/c/clone5.c
sim/testsuite/sim/cris/c/clone6.c
sim/testsuite/sim/cris/c/ex1.c
sim/testsuite/sim/cris/c/exitg1.c
sim/testsuite/sim/cris/c/exitg2.c
sim/testsuite/sim/cris/c/fcntl1.c
sim/testsuite/sim/cris/c/fcntl2.c
sim/testsuite/sim/cris/c/fdopen1.c
sim/testsuite/sim/cris/c/fdopen2.c
sim/testsuite/sim/cris/c/freopen1.c
sim/testsuite/sim/cris/c/freopen2.c
sim/testsuite/sim/cris/c/ftruncate1.c
sim/testsuite/sim/cris/c/ftruncate2.c
sim/testsuite/sim/cris/c/getcwd1.c
sim/testsuite/sim/cris/c/gettod.c
sim/testsuite/sim/cris/c/hello.c
sim/testsuite/sim/cris/c/helloaout.c
sim/testsuite/sim/cris/c/hellodyn.c
sim/testsuite/sim/cris/c/hellodyn2.c
sim/testsuite/sim/cris/c/hellodyn3.c
sim/testsuite/sim/cris/c/kill1.c
sim/testsuite/sim/cris/c/kill2.c
sim/testsuite/sim/cris/c/kill3.c
sim/testsuite/sim/cris/c/mapbrk.c
sim/testsuite/sim/cris/c/mmap1.c
sim/testsuite/sim/cris/c/mmap2.c
sim/testsuite/sim/cris/c/mmap3.c
sim/testsuite/sim/cris/c/mmap4.c
sim/testsuite/sim/cris/c/mmap5.c
sim/testsuite/sim/cris/c/mmap6.c
sim/testsuite/sim/cris/c/mmap7.c
sim/testsuite/sim/cris/c/mmap8.c
sim/testsuite/sim/cris/c/mprotect1.c
sim/testsuite/sim/cris/c/mprotect2.c
sim/testsuite/sim/cris/c/mremap.c
sim/testsuite/sim/cris/c/openpf1.c
sim/testsuite/sim/cris/c/openpf2.c
sim/testsuite/sim/cris/c/openpf3.c
sim/testsuite/sim/cris/c/openpf4.c
sim/testsuite/sim/cris/c/openpf5.c
sim/testsuite/sim/cris/c/pipe1.c
sim/testsuite/sim/cris/c/pipe2.c
sim/testsuite/sim/cris/c/pipe3.c
sim/testsuite/sim/cris/c/pipe4.c
sim/testsuite/sim/cris/c/pipe5.c
sim/testsuite/sim/cris/c/pipe6.c
sim/testsuite/sim/cris/c/pipe7.c
sim/testsuite/sim/cris/c/readlink1.c
sim/testsuite/sim/cris/c/readlink10.c
sim/testsuite/sim/cris/c/readlink11.c
sim/testsuite/sim/cris/c/readlink2.c
sim/testsuite/sim/cris/c/readlink3.c
sim/testsuite/sim/cris/c/readlink4.c
sim/testsuite/sim/cris/c/readlink5.c
sim/testsuite/sim/cris/c/readlink6.c
sim/testsuite/sim/cris/c/readlink7.c
sim/testsuite/sim/cris/c/readlink8.c
sim/testsuite/sim/cris/c/readlink9.c
sim/testsuite/sim/cris/c/rename2.c
sim/testsuite/sim/cris/c/rtsigprocmask1.c
sim/testsuite/sim/cris/c/rtsigprocmask2.c
sim/testsuite/sim/cris/c/rtsigsuspend1.c
sim/testsuite/sim/cris/c/rtsigsuspend2.c
sim/testsuite/sim/cris/c/sched1.c
sim/testsuite/sim/cris/c/sched2.c
sim/testsuite/sim/cris/c/sched3.c
sim/testsuite/sim/cris/c/sched4.c
sim/testsuite/sim/cris/c/sched5.c
sim/testsuite/sim/cris/c/sched6.c
sim/testsuite/sim/cris/c/sched7.c
sim/testsuite/sim/cris/c/sched8.c
sim/testsuite/sim/cris/c/sched9.c
sim/testsuite/sim/cris/c/seek1.c
sim/testsuite/sim/cris/c/seek2.c
sim/testsuite/sim/cris/c/seek3.c
sim/testsuite/sim/cris/c/seek4.c
sim/testsuite/sim/cris/c/setrlimit1.c
sim/testsuite/sim/cris/c/settls1.c
sim/testsuite/sim/cris/c/sig1.c
sim/testsuite/sim/cris/c/sig10.c
sim/testsuite/sim/cris/c/sig11.c
sim/testsuite/sim/cris/c/sig12.c
sim/testsuite/sim/cris/c/sig13.c
sim/testsuite/sim/cris/c/sig2.c
sim/testsuite/sim/cris/c/sig3.c
sim/testsuite/sim/cris/c/sig4.c
sim/testsuite/sim/cris/c/sig5.c
sim/testsuite/sim/cris/c/sig6.c
sim/testsuite/sim/cris/c/sig7.c
sim/testsuite/sim/cris/c/sig8.c
sim/testsuite/sim/cris/c/sig9.c
sim/testsuite/sim/cris/c/sigreturn1.c
sim/testsuite/sim/cris/c/sigreturn2.c
sim/testsuite/sim/cris/c/sigreturn3.c
sim/testsuite/sim/cris/c/sigreturn4.c
sim/testsuite/sim/cris/c/sjlj.c
sim/testsuite/sim/cris/c/sock1.c
sim/testsuite/sim/cris/c/stat1.c
sim/testsuite/sim/cris/c/stat2.c
sim/testsuite/sim/cris/c/stat3.c
sim/testsuite/sim/cris/c/stat4.c
sim/testsuite/sim/cris/c/stat5.c
sim/testsuite/sim/cris/c/stat7.c
sim/testsuite/sim/cris/c/stat8.c
sim/testsuite/sim/cris/c/syscall1.c
sim/testsuite/sim/cris/c/syscall2.c
sim/testsuite/sim/cris/c/syscall3.c
sim/testsuite/sim/cris/c/syscall4.c
sim/testsuite/sim/cris/c/syscall5.c
sim/testsuite/sim/cris/c/syscall6.c
sim/testsuite/sim/cris/c/syscall7.c
sim/testsuite/sim/cris/c/syscall8.c
sim/testsuite/sim/cris/c/sysctl1.c
sim/testsuite/sim/cris/c/sysctl2.c
sim/testsuite/sim/cris/c/sysctl3.c
sim/testsuite/sim/cris/c/thread2.c
sim/testsuite/sim/cris/c/thread3.c
sim/testsuite/sim/cris/c/thread4.c
sim/testsuite/sim/cris/c/thread5.c
sim/testsuite/sim/cris/c/time1.c
sim/testsuite/sim/cris/c/time2.c
sim/testsuite/sim/cris/c/truncate1.c
sim/testsuite/sim/cris/c/truncate2.c
sim/testsuite/sim/cris/c/ugetrlimit1.c
sim/testsuite/sim/cris/c/uname1.c
sim/testsuite/sim/cris/c/writev1.c
sim/testsuite/sim/cris/c/writev2.c
sim/testsuite/sim/cris/hw/rv-n-cris/host1.ms
sim/testsuite/sim/cris/hw/rv-n-cris/irq1.ms
sim/testsuite/sim/cris/hw/rv-n-cris/irq2.ms
sim/testsuite/sim/cris/hw/rv-n-cris/irq3.ms
sim/testsuite/sim/cris/hw/rv-n-cris/irq4.ms
sim/testsuite/sim/cris/hw/rv-n-cris/irq5.ms
sim/testsuite/sim/cris/hw/rv-n-cris/irq6.ms
sim/testsuite/sim/cris/hw/rv-n-cris/mbox1.ms
sim/testsuite/sim/cris/hw/rv-n-cris/mem1.ms
sim/testsuite/sim/cris/hw/rv-n-cris/mem2.ms
sim/testsuite/sim/cris/hw/rv-n-cris/poll1.ms
sim/testsuite/sim/cris/hw/rv-n-cris/quit.s
sim/testsuite/sim/cris/hw/rv-n-cris/rvc.exp
sim/testsuite/sim/cris/hw/rv-n-cris/std.dev
sim/testsuite/sim/cris/hw/rv-n-cris/testutils.inc
sim/testsuite/sim/cris/hw/rv-n-cris/trivial1.ms
sim/testsuite/sim/cris/hw/rv-n-cris/trivial2.ms
sim/testsuite/sim/cris/hw/rv-n-cris/trivial3.ms
sim/testsuite/sim/cris/hw/rv-n-cris/trivial4.ms
sim/testsuite/sim/cris/hw/rv-n-cris/trivial4.r
sim/testsuite/sim/cris/hw/rv-n-cris/trivial5.ms
sim/testsuite/sim/cris/hw/rv-n-cris/wd1.ms
sim/testsuite/sim/fr30/add.cgs
sim/testsuite/sim/fr30/add.ms
sim/testsuite/sim/fr30/add2.cgs
sim/testsuite/sim/fr30/addc.cgs
sim/testsuite/sim/fr30/addn.cgs
sim/testsuite/sim/fr30/addn2.cgs
sim/testsuite/sim/fr30/addsp.cgs
sim/testsuite/sim/fr30/allinsn.exp
sim/testsuite/sim/fr30/and.cgs
sim/testsuite/sim/fr30/andb.cgs
sim/testsuite/sim/fr30/andccr.cgs
sim/testsuite/sim/fr30/andh.cgs
sim/testsuite/sim/fr30/asr.cgs
sim/testsuite/sim/fr30/asr2.cgs
sim/testsuite/sim/fr30/bandh.cgs
sim/testsuite/sim/fr30/bandl.cgs
sim/testsuite/sim/fr30/bc.cgs
sim/testsuite/sim/fr30/beorh.cgs
sim/testsuite/sim/fr30/beorl.cgs
sim/testsuite/sim/fr30/beq.cgs
sim/testsuite/sim/fr30/bge.cgs
sim/testsuite/sim/fr30/bgt.cgs
sim/testsuite/sim/fr30/bhi.cgs
sim/testsuite/sim/fr30/ble.cgs
sim/testsuite/sim/fr30/bls.cgs
sim/testsuite/sim/fr30/blt.cgs
sim/testsuite/sim/fr30/bn.cgs
sim/testsuite/sim/fr30/bnc.cgs
sim/testsuite/sim/fr30/bne.cgs
sim/testsuite/sim/fr30/bno.cgs
sim/testsuite/sim/fr30/bnv.cgs
sim/testsuite/sim/fr30/borh.cgs
sim/testsuite/sim/fr30/borl.cgs
sim/testsuite/sim/fr30/bp.cgs
sim/testsuite/sim/fr30/bra.cgs
sim/testsuite/sim/fr30/btsth.cgs
sim/testsuite/sim/fr30/btstl.cgs
sim/testsuite/sim/fr30/bv.cgs
sim/testsuite/sim/fr30/call.cgs
sim/testsuite/sim/fr30/cmp.cgs
sim/testsuite/sim/fr30/cmp2.cgs
sim/testsuite/sim/fr30/copld.cgs
sim/testsuite/sim/fr30/copop.cgs
sim/testsuite/sim/fr30/copst.cgs
sim/testsuite/sim/fr30/copsv.cgs
sim/testsuite/sim/fr30/div.ms
sim/testsuite/sim/fr30/div0s.cgs
sim/testsuite/sim/fr30/div0u.cgs
sim/testsuite/sim/fr30/div1.cgs
sim/testsuite/sim/fr30/div2.cgs
sim/testsuite/sim/fr30/div3.cgs
sim/testsuite/sim/fr30/div4s.cgs
sim/testsuite/sim/fr30/dmov.cgs
sim/testsuite/sim/fr30/dmovb.cgs
sim/testsuite/sim/fr30/dmovh.cgs
sim/testsuite/sim/fr30/enter.cgs
sim/testsuite/sim/fr30/eor.cgs
sim/testsuite/sim/fr30/eorb.cgs
sim/testsuite/sim/fr30/eorh.cgs
sim/testsuite/sim/fr30/extsb.cgs
sim/testsuite/sim/fr30/extsh.cgs
sim/testsuite/sim/fr30/extub.cgs
sim/testsuite/sim/fr30/extuh.cgs
sim/testsuite/sim/fr30/hello.ms
sim/testsuite/sim/fr30/int.cgs
sim/testsuite/sim/fr30/inte.cgs
sim/testsuite/sim/fr30/jmp.cgs
sim/testsuite/sim/fr30/ld.cgs
sim/testsuite/sim/fr30/ldi20.cgs
sim/testsuite/sim/fr30/ldi32.cgs
sim/testsuite/sim/fr30/ldi8.cgs
sim/testsuite/sim/fr30/ldm0.cgs
sim/testsuite/sim/fr30/ldm1.cgs
sim/testsuite/sim/fr30/ldres.cgs
sim/testsuite/sim/fr30/ldub.cgs
sim/testsuite/sim/fr30/lduh.cgs
sim/testsuite/sim/fr30/leave.cgs
sim/testsuite/sim/fr30/lsl.cgs
sim/testsuite/sim/fr30/lsl2.cgs
sim/testsuite/sim/fr30/lsr.cgs
sim/testsuite/sim/fr30/lsr2.cgs
sim/testsuite/sim/fr30/misc.exp
sim/testsuite/sim/fr30/mov.cgs
sim/testsuite/sim/fr30/mul.cgs
sim/testsuite/sim/fr30/mulh.cgs
sim/testsuite/sim/fr30/mulu.cgs
sim/testsuite/sim/fr30/muluh.cgs
sim/testsuite/sim/fr30/nop.cgs
sim/testsuite/sim/fr30/or.cgs
sim/testsuite/sim/fr30/orb.cgs
sim/testsuite/sim/fr30/orccr.cgs
sim/testsuite/sim/fr30/orh.cgs
sim/testsuite/sim/fr30/ret.cgs
sim/testsuite/sim/fr30/reti.cgs
sim/testsuite/sim/fr30/st.cgs
sim/testsuite/sim/fr30/stb.cgs
sim/testsuite/sim/fr30/sth.cgs
sim/testsuite/sim/fr30/stilm.cgs
sim/testsuite/sim/fr30/stm0.cgs
sim/testsuite/sim/fr30/stm1.cgs
sim/testsuite/sim/fr30/stres.cgs
sim/testsuite/sim/fr30/sub.cgs
sim/testsuite/sim/fr30/subc.cgs
sim/testsuite/sim/fr30/subn.cgs
sim/testsuite/sim/fr30/testutils.inc
sim/testsuite/sim/fr30/xchb.cgs
sim/testsuite/sim/frv/add.cgs
sim/testsuite/sim/frv/add.pcgs
sim/testsuite/sim/frv/addcc.cgs
sim/testsuite/sim/frv/addi.cgs
sim/testsuite/sim/frv/addicc.cgs
sim/testsuite/sim/frv/addx.cgs
sim/testsuite/sim/frv/addxcc.cgs
sim/testsuite/sim/frv/addxi.cgs
sim/testsuite/sim/frv/addxicc.cgs
sim/testsuite/sim/frv/allinsn.exp
sim/testsuite/sim/frv/and.cgs
sim/testsuite/sim/frv/andcc.cgs
sim/testsuite/sim/frv/andcr.cgs
sim/testsuite/sim/frv/andi.cgs
sim/testsuite/sim/frv/andicc.cgs
sim/testsuite/sim/frv/andncr.cgs
sim/testsuite/sim/frv/bar.cgs
sim/testsuite/sim/frv/bc.cgs
sim/testsuite/sim/frv/bcclr.cgs
sim/testsuite/sim/frv/bceqlr.cgs
sim/testsuite/sim/frv/bcgelr.cgs
sim/testsuite/sim/frv/bcgtlr.cgs
sim/testsuite/sim/frv/bchilr.cgs
sim/testsuite/sim/frv/bclelr.cgs
sim/testsuite/sim/frv/bclr.cgs
sim/testsuite/sim/frv/bclslr.cgs
sim/testsuite/sim/frv/bcltlr.cgs
sim/testsuite/sim/frv/bcnclr.cgs
sim/testsuite/sim/frv/bcnelr.cgs
sim/testsuite/sim/frv/bcnlr.cgs
sim/testsuite/sim/frv/bcnolr.cgs
sim/testsuite/sim/frv/bcnvlr.cgs
sim/testsuite/sim/frv/bcplr.cgs
sim/testsuite/sim/frv/bcralr.cgs
sim/testsuite/sim/frv/bctrlr.cgs
sim/testsuite/sim/frv/bcvlr.cgs
sim/testsuite/sim/frv/beq.cgs
sim/testsuite/sim/frv/beqlr.cgs
sim/testsuite/sim/frv/bge.cgs
sim/testsuite/sim/frv/bgelr.cgs
sim/testsuite/sim/frv/bgt.cgs
sim/testsuite/sim/frv/bgtlr.cgs
sim/testsuite/sim/frv/bhi.cgs
sim/testsuite/sim/frv/bhilr.cgs
sim/testsuite/sim/frv/ble.cgs
sim/testsuite/sim/frv/blelr.cgs
sim/testsuite/sim/frv/bls.cgs
sim/testsuite/sim/frv/blslr.cgs
sim/testsuite/sim/frv/blt.cgs
sim/testsuite/sim/frv/bltlr.cgs
sim/testsuite/sim/frv/bn.cgs
sim/testsuite/sim/frv/bnc.cgs
sim/testsuite/sim/frv/bnclr.cgs
sim/testsuite/sim/frv/bne.cgs
sim/testsuite/sim/frv/bnelr.cgs
sim/testsuite/sim/frv/bnlr.cgs
sim/testsuite/sim/frv/bno.cgs
sim/testsuite/sim/frv/bnolr.cgs
sim/testsuite/sim/frv/bnv.cgs
sim/testsuite/sim/frv/bnvlr.cgs
sim/testsuite/sim/frv/bp.cgs
sim/testsuite/sim/frv/bplr.cgs
sim/testsuite/sim/frv/bra.cgs
sim/testsuite/sim/frv/bralr.cgs
sim/testsuite/sim/frv/branch.pcgs
sim/testsuite/sim/frv/break.cgs
sim/testsuite/sim/frv/bv.cgs
sim/testsuite/sim/frv/bvlr.cgs
sim/testsuite/sim/frv/cadd.cgs
sim/testsuite/sim/frv/caddcc.cgs
sim/testsuite/sim/frv/call.cgs
sim/testsuite/sim/frv/call.pcgs
sim/testsuite/sim/frv/callil.cgs
sim/testsuite/sim/frv/calll.cgs
sim/testsuite/sim/frv/cand.cgs
sim/testsuite/sim/frv/candcc.cgs
sim/testsuite/sim/frv/ccalll.cgs
sim/testsuite/sim/frv/cckc.cgs
sim/testsuite/sim/frv/cckeq.cgs
sim/testsuite/sim/frv/cckge.cgs
sim/testsuite/sim/frv/cckgt.cgs
sim/testsuite/sim/frv/cckhi.cgs
sim/testsuite/sim/frv/cckle.cgs
sim/testsuite/sim/frv/cckls.cgs
sim/testsuite/sim/frv/ccklt.cgs
sim/testsuite/sim/frv/cckn.cgs
sim/testsuite/sim/frv/ccknc.cgs
sim/testsuite/sim/frv/cckne.cgs
sim/testsuite/sim/frv/cckno.cgs
sim/testsuite/sim/frv/ccknv.cgs
sim/testsuite/sim/frv/cckp.cgs
sim/testsuite/sim/frv/cckra.cgs
sim/testsuite/sim/frv/cckv.cgs
sim/testsuite/sim/frv/ccmp.cgs
sim/testsuite/sim/frv/cfabss.cgs
sim/testsuite/sim/frv/cfadds.cgs
sim/testsuite/sim/frv/cfckeq.cgs
sim/testsuite/sim/frv/cfckge.cgs
sim/testsuite/sim/frv/cfckgt.cgs
sim/testsuite/sim/frv/cfckle.cgs
sim/testsuite/sim/frv/cfcklg.cgs
sim/testsuite/sim/frv/cfcklt.cgs
sim/testsuite/sim/frv/cfckne.cgs
sim/testsuite/sim/frv/cfckno.cgs
sim/testsuite/sim/frv/cfcko.cgs
sim/testsuite/sim/frv/cfckra.cgs
sim/testsuite/sim/frv/cfcku.cgs
sim/testsuite/sim/frv/cfckue.cgs
sim/testsuite/sim/frv/cfckug.cgs
sim/testsuite/sim/frv/cfckuge.cgs
sim/testsuite/sim/frv/cfckul.cgs
sim/testsuite/sim/frv/cfckule.cgs
sim/testsuite/sim/frv/cfcmps.cgs
sim/testsuite/sim/frv/cfdivs.cgs
sim/testsuite/sim/frv/cfitos.cgs
sim/testsuite/sim/frv/cfmadds.cgs
sim/testsuite/sim/frv/cfmas.cgs
sim/testsuite/sim/frv/cfmovs.cgs
sim/testsuite/sim/frv/cfmss.cgs
sim/testsuite/sim/frv/cfmsubs.cgs
sim/testsuite/sim/frv/cfmuls.cgs
sim/testsuite/sim/frv/cfnegs.cgs
sim/testsuite/sim/frv/cfsqrts.cgs
sim/testsuite/sim/frv/cfstoi.cgs
sim/testsuite/sim/frv/cfsubs.cgs
sim/testsuite/sim/frv/cjmpl.cgs
sim/testsuite/sim/frv/ckc.cgs
sim/testsuite/sim/frv/ckeq.cgs
sim/testsuite/sim/frv/ckge.cgs
sim/testsuite/sim/frv/ckgt.cgs
sim/testsuite/sim/frv/ckhi.cgs
sim/testsuite/sim/frv/ckle.cgs
sim/testsuite/sim/frv/ckls.cgs
sim/testsuite/sim/frv/cklt.cgs
sim/testsuite/sim/frv/ckn.cgs
sim/testsuite/sim/frv/cknc.cgs
sim/testsuite/sim/frv/ckne.cgs
sim/testsuite/sim/frv/ckno.cgs
sim/testsuite/sim/frv/cknv.cgs
sim/testsuite/sim/frv/ckp.cgs
sim/testsuite/sim/frv/ckra.cgs
sim/testsuite/sim/frv/ckv.cgs
sim/testsuite/sim/frv/cld.cgs
sim/testsuite/sim/frv/cldbf.cgs
sim/testsuite/sim/frv/cldbfu.cgs
sim/testsuite/sim/frv/cldd.cgs
sim/testsuite/sim/frv/clddf.cgs
sim/testsuite/sim/frv/clddfu.cgs
sim/testsuite/sim/frv/clddu.cgs
sim/testsuite/sim/frv/cldf.cgs
sim/testsuite/sim/frv/cldfu.cgs
sim/testsuite/sim/frv/cldhf.cgs
sim/testsuite/sim/frv/cldhfu.cgs
sim/testsuite/sim/frv/cldq.cgs
sim/testsuite/sim/frv/cldqu.cgs
sim/testsuite/sim/frv/cldsb.cgs
sim/testsuite/sim/frv/cldsbu.cgs
sim/testsuite/sim/frv/cldsh.cgs
sim/testsuite/sim/frv/cldshu.cgs
sim/testsuite/sim/frv/cldu.cgs
sim/testsuite/sim/frv/cldub.cgs
sim/testsuite/sim/frv/cldubu.cgs
sim/testsuite/sim/frv/clduh.cgs
sim/testsuite/sim/frv/clduhu.cgs
sim/testsuite/sim/frv/clrfa.cgs
sim/testsuite/sim/frv/clrfr.cgs
sim/testsuite/sim/frv/clrga.cgs
sim/testsuite/sim/frv/clrgr.cgs
sim/testsuite/sim/frv/cmaddhss.cgs
sim/testsuite/sim/frv/cmaddhus.cgs
sim/testsuite/sim/frv/cmand.cgs
sim/testsuite/sim/frv/cmbtoh.cgs
sim/testsuite/sim/frv/cmbtohe.cgs
sim/testsuite/sim/frv/cmcpxis.cgs
sim/testsuite/sim/frv/cmcpxiu.cgs
sim/testsuite/sim/frv/cmcpxrs.cgs
sim/testsuite/sim/frv/cmcpxru.cgs
sim/testsuite/sim/frv/cmexpdhd.cgs
sim/testsuite/sim/frv/cmexpdhw.cgs
sim/testsuite/sim/frv/cmhtob.cgs
sim/testsuite/sim/frv/cmmachs.cgs
sim/testsuite/sim/frv/cmmachu.cgs
sim/testsuite/sim/frv/cmmulhs.cgs
sim/testsuite/sim/frv/cmmulhu.cgs
sim/testsuite/sim/frv/cmnot.cgs
sim/testsuite/sim/frv/cmor.cgs
sim/testsuite/sim/frv/cmov.cgs
sim/testsuite/sim/frv/cmovfg.cgs
sim/testsuite/sim/frv/cmovfgd.cgs
sim/testsuite/sim/frv/cmovgf.cgs
sim/testsuite/sim/frv/cmovgfd.cgs
sim/testsuite/sim/frv/cmp.cgs
sim/testsuite/sim/frv/cmpb.cgs
sim/testsuite/sim/frv/cmpba.cgs
sim/testsuite/sim/frv/cmpi.cgs
sim/testsuite/sim/frv/cmqmachs.cgs
sim/testsuite/sim/frv/cmqmachu.cgs
sim/testsuite/sim/frv/cmqmulhs.cgs
sim/testsuite/sim/frv/cmqmulhu.cgs
sim/testsuite/sim/frv/cmsubhss.cgs
sim/testsuite/sim/frv/cmsubhus.cgs
sim/testsuite/sim/frv/cmxor.cgs
sim/testsuite/sim/frv/cnot.cgs
sim/testsuite/sim/frv/commitfa.cgs
sim/testsuite/sim/frv/commitfr.cgs
sim/testsuite/sim/frv/commitga.cgs
sim/testsuite/sim/frv/commitgr.cgs
sim/testsuite/sim/frv/cop1.cgs
sim/testsuite/sim/frv/cop2.cgs
sim/testsuite/sim/frv/cor.cgs
sim/testsuite/sim/frv/corcc.cgs
sim/testsuite/sim/frv/cscan.cgs
sim/testsuite/sim/frv/csdiv.cgs
sim/testsuite/sim/frv/csll.cgs
sim/testsuite/sim/frv/csllcc.cgs
sim/testsuite/sim/frv/csmul.cgs
sim/testsuite/sim/frv/csmulcc.cgs
sim/testsuite/sim/frv/csra.cgs
sim/testsuite/sim/frv/csracc.cgs
sim/testsuite/sim/frv/csrl.cgs
sim/testsuite/sim/frv/csrlcc.cgs
sim/testsuite/sim/frv/cst.cgs
sim/testsuite/sim/frv/cstb.cgs
sim/testsuite/sim/frv/cstbf.cgs
sim/testsuite/sim/frv/cstbfu.cgs
sim/testsuite/sim/frv/cstbu.cgs
sim/testsuite/sim/frv/cstd.cgs
sim/testsuite/sim/frv/cstdf.cgs
sim/testsuite/sim/frv/cstdfu.cgs
sim/testsuite/sim/frv/cstdu.cgs
sim/testsuite/sim/frv/cstf.cgs
sim/testsuite/sim/frv/cstfu.cgs
sim/testsuite/sim/frv/csth.cgs
sim/testsuite/sim/frv/csthf.cgs
sim/testsuite/sim/frv/csthfu.cgs
sim/testsuite/sim/frv/csthu.cgs
sim/testsuite/sim/frv/cstq.cgs
sim/testsuite/sim/frv/cstu.cgs
sim/testsuite/sim/frv/csub.cgs
sim/testsuite/sim/frv/csubcc.cgs
sim/testsuite/sim/frv/cswap.cgs
sim/testsuite/sim/frv/cudiv.cgs
sim/testsuite/sim/frv/cxor.cgs
sim/testsuite/sim/frv/cxorcc.cgs
sim/testsuite/sim/frv/dcef.cgs
sim/testsuite/sim/frv/dcei.cgs
sim/testsuite/sim/frv/dcf.cgs
sim/testsuite/sim/frv/dci.cgs
sim/testsuite/sim/frv/fabsd.cgs
sim/testsuite/sim/frv/fabss.cgs
sim/testsuite/sim/frv/faddd.cgs
sim/testsuite/sim/frv/fadds.cgs
sim/testsuite/sim/frv/fbeq.cgs
sim/testsuite/sim/frv/fbeqlr.cgs
sim/testsuite/sim/frv/fbge.cgs
sim/testsuite/sim/frv/fbgelr.cgs
sim/testsuite/sim/frv/fbgt.cgs
sim/testsuite/sim/frv/fbgtlr.cgs
sim/testsuite/sim/frv/fble.cgs
sim/testsuite/sim/frv/fblelr.cgs
sim/testsuite/sim/frv/fblg.cgs
sim/testsuite/sim/frv/fblglr.cgs
sim/testsuite/sim/frv/fblt.cgs
sim/testsuite/sim/frv/fbltlr.cgs
sim/testsuite/sim/frv/fbne.cgs
sim/testsuite/sim/frv/fbnelr.cgs
sim/testsuite/sim/frv/fbno.cgs
sim/testsuite/sim/frv/fbnolr.cgs
sim/testsuite/sim/frv/fbo.cgs
sim/testsuite/sim/frv/fbolr.cgs
sim/testsuite/sim/frv/fbra.cgs
sim/testsuite/sim/frv/fbralr.cgs
sim/testsuite/sim/frv/fbu.cgs
sim/testsuite/sim/frv/fbue.cgs
sim/testsuite/sim/frv/fbuelr.cgs
sim/testsuite/sim/frv/fbug.cgs
sim/testsuite/sim/frv/fbuge.cgs
sim/testsuite/sim/frv/fbugelr.cgs
sim/testsuite/sim/frv/fbuglr.cgs
sim/testsuite/sim/frv/fbul.cgs
sim/testsuite/sim/frv/fbule.cgs
sim/testsuite/sim/frv/fbulelr.cgs
sim/testsuite/sim/frv/fbullr.cgs
sim/testsuite/sim/frv/fbulr.cgs
sim/testsuite/sim/frv/fcbeqlr.cgs
sim/testsuite/sim/frv/fcbgelr.cgs
sim/testsuite/sim/frv/fcbgtlr.cgs
sim/testsuite/sim/frv/fcblelr.cgs
sim/testsuite/sim/frv/fcblglr.cgs
sim/testsuite/sim/frv/fcbltlr.cgs
sim/testsuite/sim/frv/fcbnelr.cgs
sim/testsuite/sim/frv/fcbnolr.cgs
sim/testsuite/sim/frv/fcbolr.cgs
sim/testsuite/sim/frv/fcbralr.cgs
sim/testsuite/sim/frv/fcbuelr.cgs
sim/testsuite/sim/frv/fcbugelr.cgs
sim/testsuite/sim/frv/fcbuglr.cgs
sim/testsuite/sim/frv/fcbulelr.cgs
sim/testsuite/sim/frv/fcbullr.cgs
sim/testsuite/sim/frv/fcbulr.cgs
sim/testsuite/sim/frv/fckeq.cgs
sim/testsuite/sim/frv/fckge.cgs
sim/testsuite/sim/frv/fckgt.cgs
sim/testsuite/sim/frv/fckle.cgs
sim/testsuite/sim/frv/fcklg.cgs
sim/testsuite/sim/frv/fcklt.cgs
sim/testsuite/sim/frv/fckne.cgs
sim/testsuite/sim/frv/fckno.cgs
sim/testsuite/sim/frv/fcko.cgs
sim/testsuite/sim/frv/fckra.cgs
sim/testsuite/sim/frv/fcku.cgs
sim/testsuite/sim/frv/fckue.cgs
sim/testsuite/sim/frv/fckug.cgs
sim/testsuite/sim/frv/fckuge.cgs
sim/testsuite/sim/frv/fckul.cgs
sim/testsuite/sim/frv/fckule.cgs
sim/testsuite/sim/frv/fcmpd.cgs
sim/testsuite/sim/frv/fcmps.cgs
sim/testsuite/sim/frv/fdabss.cgs
sim/testsuite/sim/frv/fdadds.cgs
sim/testsuite/sim/frv/fdcmps.cgs
sim/testsuite/sim/frv/fddivs.cgs
sim/testsuite/sim/frv/fditos.cgs
sim/testsuite/sim/frv/fdivd.cgs
sim/testsuite/sim/frv/fdivs.cgs
sim/testsuite/sim/frv/fdmadds.cgs
sim/testsuite/sim/frv/fdmas.cgs
sim/testsuite/sim/frv/fdmovs.cgs
sim/testsuite/sim/frv/fdmss.cgs
sim/testsuite/sim/frv/fdmulcs.cgs
sim/testsuite/sim/frv/fdmuls.cgs
sim/testsuite/sim/frv/fdnegs.cgs
sim/testsuite/sim/frv/fdsads.cgs
sim/testsuite/sim/frv/fdsqrts.cgs
sim/testsuite/sim/frv/fdstoi.cgs
sim/testsuite/sim/frv/fdsubs.cgs
sim/testsuite/sim/frv/fdtoi.cgs
sim/testsuite/sim/frv/fitod.cgs
sim/testsuite/sim/frv/fitos.cgs
sim/testsuite/sim/frv/fmad.cgs
sim/testsuite/sim/frv/fmaddd.cgs
sim/testsuite/sim/frv/fmadds.cgs
sim/testsuite/sim/frv/fmas.cgs
sim/testsuite/sim/frv/fmovd.cgs
sim/testsuite/sim/frv/fmovs.cgs
sim/testsuite/sim/frv/fmsd.cgs
sim/testsuite/sim/frv/fmss.cgs
sim/testsuite/sim/frv/fmsubd.cgs
sim/testsuite/sim/frv/fmsubs.cgs
sim/testsuite/sim/frv/fmuld.cgs
sim/testsuite/sim/frv/fmuls.cgs
sim/testsuite/sim/frv/fnegd.cgs
sim/testsuite/sim/frv/fnegs.cgs
sim/testsuite/sim/frv/fnop.cgs
sim/testsuite/sim/frv/fr400/addss.cgs
sim/testsuite/sim/frv/fr400/allinsn.exp
sim/testsuite/sim/frv/fr400/csdiv.cgs
sim/testsuite/sim/frv/fr400/maddaccs.cgs
sim/testsuite/sim/frv/fr400/masaccs.cgs
sim/testsuite/sim/frv/fr400/maveh.cgs
sim/testsuite/sim/frv/fr400/mclracc.cgs
sim/testsuite/sim/frv/fr400/mhdseth.cgs
sim/testsuite/sim/frv/fr400/mhdsets.cgs
sim/testsuite/sim/frv/fr400/mhsethih.cgs
sim/testsuite/sim/frv/fr400/mhsethis.cgs
sim/testsuite/sim/frv/fr400/mhsetloh.cgs
sim/testsuite/sim/frv/fr400/mhsetlos.cgs
sim/testsuite/sim/frv/fr400/movgs.cgs
sim/testsuite/sim/frv/fr400/movsg.cgs
sim/testsuite/sim/frv/fr400/msubaccs.cgs
sim/testsuite/sim/frv/fr400/scutss.cgs
sim/testsuite/sim/frv/fr400/sdiv.cgs
sim/testsuite/sim/frv/fr400/sdivi.cgs
sim/testsuite/sim/frv/fr400/slass.cgs
sim/testsuite/sim/frv/fr400/smass.cgs
sim/testsuite/sim/frv/fr400/smsss.cgs
sim/testsuite/sim/frv/fr400/smu.cgs
sim/testsuite/sim/frv/fr400/subss.cgs
sim/testsuite/sim/frv/fr400/udiv.cgs
sim/testsuite/sim/frv/fr400/udivi.cgs
sim/testsuite/sim/frv/fr500/allinsn.exp
sim/testsuite/sim/frv/fr500/cmqaddhss.cgs
sim/testsuite/sim/frv/fr500/cmqaddhus.cgs
sim/testsuite/sim/frv/fr500/cmqsubhss.cgs
sim/testsuite/sim/frv/fr500/cmqsubhus.cgs
sim/testsuite/sim/frv/fr500/dcpl.cgs
sim/testsuite/sim/frv/fr500/dcul.cgs
sim/testsuite/sim/frv/fr500/mclracc.cgs
sim/testsuite/sim/frv/fr500/mqaddhss.cgs
sim/testsuite/sim/frv/fr500/mqaddhus.cgs
sim/testsuite/sim/frv/fr500/mqsubhss.cgs
sim/testsuite/sim/frv/fr500/mqsubhus.cgs
sim/testsuite/sim/frv/fr550/allinsn.exp
sim/testsuite/sim/frv/fr550/cmaddhss.cgs
sim/testsuite/sim/frv/fr550/cmaddhus.cgs
sim/testsuite/sim/frv/fr550/cmcpxiu.cgs
sim/testsuite/sim/frv/fr550/cmcpxru.cgs
sim/testsuite/sim/frv/fr550/cmmachs.cgs
sim/testsuite/sim/frv/fr550/cmmachu.cgs
sim/testsuite/sim/frv/fr550/cmqaddhss.cgs
sim/testsuite/sim/frv/fr550/cmqaddhus.cgs
sim/testsuite/sim/frv/fr550/cmqmachs.cgs
sim/testsuite/sim/frv/fr550/cmqmachu.cgs
sim/testsuite/sim/frv/fr550/cmqsubhss.cgs
sim/testsuite/sim/frv/fr550/cmqsubhus.cgs
sim/testsuite/sim/frv/fr550/cmsubhss.cgs
sim/testsuite/sim/frv/fr550/cmsubhus.cgs
sim/testsuite/sim/frv/fr550/dcpl.cgs
sim/testsuite/sim/frv/fr550/dcul.cgs
sim/testsuite/sim/frv/fr550/mabshs.cgs
sim/testsuite/sim/frv/fr550/maddaccs.cgs
sim/testsuite/sim/frv/fr550/maddhss.cgs
sim/testsuite/sim/frv/fr550/maddhus.cgs
sim/testsuite/sim/frv/fr550/masaccs.cgs
sim/testsuite/sim/frv/fr550/mdaddaccs.cgs
sim/testsuite/sim/frv/fr550/mdasaccs.cgs
sim/testsuite/sim/frv/fr550/mdsubaccs.cgs
sim/testsuite/sim/frv/fr550/mmachs.cgs
sim/testsuite/sim/frv/fr550/mmachu.cgs
sim/testsuite/sim/frv/fr550/mmrdhs.cgs
sim/testsuite/sim/frv/fr550/mmrdhu.cgs
sim/testsuite/sim/frv/fr550/mqaddhss.cgs
sim/testsuite/sim/frv/fr550/mqaddhus.cgs
sim/testsuite/sim/frv/fr550/mqmachs.cgs
sim/testsuite/sim/frv/fr550/mqmachu.cgs
sim/testsuite/sim/frv/fr550/mqmacxhs.cgs
sim/testsuite/sim/frv/fr550/mqsubhss.cgs
sim/testsuite/sim/frv/fr550/mqsubhus.cgs
sim/testsuite/sim/frv/fr550/mqxmachs.cgs
sim/testsuite/sim/frv/fr550/mqxmacxhs.cgs
sim/testsuite/sim/frv/fr550/msubaccs.cgs
sim/testsuite/sim/frv/fr550/msubhss.cgs
sim/testsuite/sim/frv/fr550/msubhus.cgs
sim/testsuite/sim/frv/fr550/mtrap.cgs
sim/testsuite/sim/frv/fr550/udiv.cgs
sim/testsuite/sim/frv/fr550/udivi.cgs
sim/testsuite/sim/frv/fsqrtd.cgs
sim/testsuite/sim/frv/fsqrts.cgs
sim/testsuite/sim/frv/fstoi.cgs
sim/testsuite/sim/frv/fsubd.cgs
sim/testsuite/sim/frv/fsubs.cgs
sim/testsuite/sim/frv/fteq.cgs
sim/testsuite/sim/frv/ftge.cgs
sim/testsuite/sim/frv/ftgt.cgs
sim/testsuite/sim/frv/ftieq.cgs
sim/testsuite/sim/frv/ftige.cgs
sim/testsuite/sim/frv/ftigt.cgs
sim/testsuite/sim/frv/ftile.cgs
sim/testsuite/sim/frv/ftilg.cgs
sim/testsuite/sim/frv/ftilt.cgs
sim/testsuite/sim/frv/ftine.cgs
sim/testsuite/sim/frv/ftino.cgs
sim/testsuite/sim/frv/ftio.cgs
sim/testsuite/sim/frv/ftira.cgs
sim/testsuite/sim/frv/ftiu.cgs
sim/testsuite/sim/frv/ftiue.cgs
sim/testsuite/sim/frv/ftiug.cgs
sim/testsuite/sim/frv/ftiuge.cgs
sim/testsuite/sim/frv/ftiul.cgs
sim/testsuite/sim/frv/ftle.cgs
sim/testsuite/sim/frv/ftlg.cgs
sim/testsuite/sim/frv/ftlt.cgs
sim/testsuite/sim/frv/ftne.cgs
sim/testsuite/sim/frv/ftno.cgs
sim/testsuite/sim/frv/fto.cgs
sim/testsuite/sim/frv/ftra.cgs
sim/testsuite/sim/frv/ftu.cgs
sim/testsuite/sim/frv/ftue.cgs
sim/testsuite/sim/frv/ftug.cgs
sim/testsuite/sim/frv/ftuge.cgs
sim/testsuite/sim/frv/ftul.cgs
sim/testsuite/sim/frv/ftule.cgs
sim/testsuite/sim/frv/icei.cgs
sim/testsuite/sim/frv/ici.cgs
sim/testsuite/sim/frv/icpl.cgs
sim/testsuite/sim/frv/icul.cgs
sim/testsuite/sim/frv/interrupts.exp
sim/testsuite/sim/frv/interrupts/Ipipe-fr400.cgs
sim/testsuite/sim/frv/interrupts/Ipipe-fr500.cgs
sim/testsuite/sim/frv/interrupts/badalign-fr550.cgs
sim/testsuite/sim/frv/interrupts/badalign.cgs
sim/testsuite/sim/frv/interrupts/compound-fr550.cgs
sim/testsuite/sim/frv/interrupts/compound.cgs
sim/testsuite/sim/frv/interrupts/data_store_error-fr550.cgs
sim/testsuite/sim/frv/interrupts/data_store_error.cgs
sim/testsuite/sim/frv/interrupts/fp_exception-fr550.cgs
sim/testsuite/sim/frv/interrupts/fp_exception.cgs
sim/testsuite/sim/frv/interrupts/illinsn.cgs
sim/testsuite/sim/frv/interrupts/insn_access_error-fr550.cgs
sim/testsuite/sim/frv/interrupts/insn_access_error.cgs
sim/testsuite/sim/frv/interrupts/mp_exception.cgs
sim/testsuite/sim/frv/interrupts/privileged_instruction.cgs
sim/testsuite/sim/frv/interrupts/regalign.cgs
sim/testsuite/sim/frv/interrupts/reset.cgs
sim/testsuite/sim/frv/interrupts/shadow_regs.cgs
sim/testsuite/sim/frv/interrupts/timer.cgs
sim/testsuite/sim/frv/jmpil.cgs
sim/testsuite/sim/frv/jmpl.cgs
sim/testsuite/sim/frv/jmpl.pcgs
sim/testsuite/sim/frv/ld.cgs
sim/testsuite/sim/frv/ldbf.cgs
sim/testsuite/sim/frv/ldbfi.cgs
sim/testsuite/sim/frv/ldbfu.cgs
sim/testsuite/sim/frv/ldc.cgs
sim/testsuite/sim/frv/ldcu.cgs
sim/testsuite/sim/frv/ldd.cgs
sim/testsuite/sim/frv/lddc.cgs
sim/testsuite/sim/frv/lddcu.cgs
sim/testsuite/sim/frv/lddf.cgs
sim/testsuite/sim/frv/lddfi.cgs
sim/testsuite/sim/frv/lddfu.cgs
sim/testsuite/sim/frv/lddi.cgs
sim/testsuite/sim/frv/lddu.cgs
sim/testsuite/sim/frv/ldf.cgs
sim/testsuite/sim/frv/ldfi.cgs
sim/testsuite/sim/frv/ldfu.cgs
sim/testsuite/sim/frv/ldhf.cgs
sim/testsuite/sim/frv/ldhfi.cgs
sim/testsuite/sim/frv/ldhfu.cgs
sim/testsuite/sim/frv/ldi.cgs
sim/testsuite/sim/frv/ldq.cgs
sim/testsuite/sim/frv/ldqc.cgs
sim/testsuite/sim/frv/ldqcu.cgs
sim/testsuite/sim/frv/ldqf.cgs
sim/testsuite/sim/frv/ldqfi.cgs
sim/testsuite/sim/frv/ldqfu.cgs
sim/testsuite/sim/frv/ldqi.cgs
sim/testsuite/sim/frv/ldqu.cgs
sim/testsuite/sim/frv/ldsb.cgs
sim/testsuite/sim/frv/ldsbi.cgs
sim/testsuite/sim/frv/ldsbu.cgs
sim/testsuite/sim/frv/ldsh.cgs
sim/testsuite/sim/frv/ldshi.cgs
sim/testsuite/sim/frv/ldshu.cgs
sim/testsuite/sim/frv/ldu.cgs
sim/testsuite/sim/frv/ldub.cgs
sim/testsuite/sim/frv/ldubi.cgs
sim/testsuite/sim/frv/ldubu.cgs
sim/testsuite/sim/frv/lduh.cgs
sim/testsuite/sim/frv/lduhi.cgs
sim/testsuite/sim/frv/lduhu.cgs
sim/testsuite/sim/frv/lrbranch.pcgs
sim/testsuite/sim/frv/mabshs.cgs
sim/testsuite/sim/frv/maddhss.cgs
sim/testsuite/sim/frv/maddhus.cgs
sim/testsuite/sim/frv/mand.cgs
sim/testsuite/sim/frv/maveh.cgs
sim/testsuite/sim/frv/mbtoh.cgs
sim/testsuite/sim/frv/mbtohe.cgs
sim/testsuite/sim/frv/mclracc.cgs
sim/testsuite/sim/frv/mcmpsh.cgs
sim/testsuite/sim/frv/mcmpuh.cgs
sim/testsuite/sim/frv/mcop1.cgs
sim/testsuite/sim/frv/mcop2.cgs
sim/testsuite/sim/frv/mcplhi.cgs
sim/testsuite/sim/frv/mcpli.cgs
sim/testsuite/sim/frv/mcpxis.cgs
sim/testsuite/sim/frv/mcpxiu.cgs
sim/testsuite/sim/frv/mcpxrs.cgs
sim/testsuite/sim/frv/mcpxru.cgs
sim/testsuite/sim/frv/mcut.cgs
sim/testsuite/sim/frv/mcuti.cgs
sim/testsuite/sim/frv/mcutss.cgs
sim/testsuite/sim/frv/mcutssi.cgs
sim/testsuite/sim/frv/mdaddaccs.cgs
sim/testsuite/sim/frv/mdasaccs.cgs
sim/testsuite/sim/frv/mdcutssi.cgs
sim/testsuite/sim/frv/mdpackh.cgs
sim/testsuite/sim/frv/mdrotli.cgs
sim/testsuite/sim/frv/mdsubaccs.cgs
sim/testsuite/sim/frv/mdunpackh.cgs
sim/testsuite/sim/frv/membar.cgs
sim/testsuite/sim/frv/mexpdhd.cgs
sim/testsuite/sim/frv/mexpdhw.cgs
sim/testsuite/sim/frv/mhdseth.cgs
sim/testsuite/sim/frv/mhdsets.cgs
sim/testsuite/sim/frv/mhsethih.cgs
sim/testsuite/sim/frv/mhsethis.cgs
sim/testsuite/sim/frv/mhsetloh.cgs
sim/testsuite/sim/frv/mhsetlos.cgs
sim/testsuite/sim/frv/mhtob.cgs
sim/testsuite/sim/frv/mmachs.cgs
sim/testsuite/sim/frv/mmachu.cgs
sim/testsuite/sim/frv/mmrdhs.cgs
sim/testsuite/sim/frv/mmrdhu.cgs
sim/testsuite/sim/frv/mmulhs.cgs
sim/testsuite/sim/frv/mmulhu.cgs
sim/testsuite/sim/frv/mmulxhs.cgs
sim/testsuite/sim/frv/mmulxhu.cgs
sim/testsuite/sim/frv/mnop.cgs
sim/testsuite/sim/frv/mnot.cgs
sim/testsuite/sim/frv/mor.cgs
sim/testsuite/sim/frv/mov.cgs
sim/testsuite/sim/frv/movfg.cgs
sim/testsuite/sim/frv/movfgd.cgs
sim/testsuite/sim/frv/movfgq.cgs
sim/testsuite/sim/frv/movgf.cgs
sim/testsuite/sim/frv/movgfd.cgs
sim/testsuite/sim/frv/movgfq.cgs
sim/testsuite/sim/frv/movgs.cgs
sim/testsuite/sim/frv/movsg.cgs
sim/testsuite/sim/frv/mpackh.cgs
sim/testsuite/sim/frv/mqcpxis.cgs
sim/testsuite/sim/frv/mqcpxiu.cgs
sim/testsuite/sim/frv/mqcpxrs.cgs
sim/testsuite/sim/frv/mqcpxru.cgs
sim/testsuite/sim/frv/mqlclrhs.cgs
sim/testsuite/sim/frv/mqlmths.cgs
sim/testsuite/sim/frv/mqmachs.cgs
sim/testsuite/sim/frv/mqmachu.cgs
sim/testsuite/sim/frv/mqmacxhs.cgs
sim/testsuite/sim/frv/mqmulhs.cgs
sim/testsuite/sim/frv/mqmulhu.cgs
sim/testsuite/sim/frv/mqmulxhs.cgs
sim/testsuite/sim/frv/mqmulxhu.cgs
sim/testsuite/sim/frv/mqsaths.cgs
sim/testsuite/sim/frv/mqsllhi.cgs
sim/testsuite/sim/frv/mqsrahi.cgs
sim/testsuite/sim/frv/mqxmachs.cgs
sim/testsuite/sim/frv/mqxmacxhs.cgs
sim/testsuite/sim/frv/mrdacc.cgs
sim/testsuite/sim/frv/mrdaccg.cgs
sim/testsuite/sim/frv/mrotli.cgs
sim/testsuite/sim/frv/mrotri.cgs
sim/testsuite/sim/frv/msaths.cgs
sim/testsuite/sim/frv/msathu.cgs
sim/testsuite/sim/frv/msllhi.cgs
sim/testsuite/sim/frv/msrahi.cgs
sim/testsuite/sim/frv/msrlhi.cgs
sim/testsuite/sim/frv/msubhss.cgs
sim/testsuite/sim/frv/msubhus.cgs
sim/testsuite/sim/frv/mtrap.cgs
sim/testsuite/sim/frv/munpackh.cgs
sim/testsuite/sim/frv/mwcut.cgs
sim/testsuite/sim/frv/mwcuti.cgs
sim/testsuite/sim/frv/mwtacc.cgs
sim/testsuite/sim/frv/mwtaccg.cgs
sim/testsuite/sim/frv/mxor.cgs
sim/testsuite/sim/frv/nandcr.cgs
sim/testsuite/sim/frv/nandncr.cgs
sim/testsuite/sim/frv/nfadds.cgs
sim/testsuite/sim/frv/nfdadds.cgs
sim/testsuite/sim/frv/nfdcmps.cgs
sim/testsuite/sim/frv/nfddivs.cgs
sim/testsuite/sim/frv/nfditos.cgs
sim/testsuite/sim/frv/nfdivs.cgs
sim/testsuite/sim/frv/nfdmadds.cgs
sim/testsuite/sim/frv/nfdmas.cgs
sim/testsuite/sim/frv/nfdmss.cgs
sim/testsuite/sim/frv/nfdmulcs.cgs
sim/testsuite/sim/frv/nfdmuls.cgs
sim/testsuite/sim/frv/nfdsads.cgs
sim/testsuite/sim/frv/nfdsqrts.cgs
sim/testsuite/sim/frv/nfdstoi.cgs
sim/testsuite/sim/frv/nfdsubs.cgs
sim/testsuite/sim/frv/nfitos.cgs
sim/testsuite/sim/frv/nfmadds.cgs
sim/testsuite/sim/frv/nfmas.cgs
sim/testsuite/sim/frv/nfmss.cgs
sim/testsuite/sim/frv/nfmsubs.cgs
sim/testsuite/sim/frv/nfmuls.cgs
sim/testsuite/sim/frv/nfsqrts.cgs
sim/testsuite/sim/frv/nfstoi.cgs
sim/testsuite/sim/frv/nfsubs.cgs
sim/testsuite/sim/frv/nld.cgs
sim/testsuite/sim/frv/nldbf.cgs
sim/testsuite/sim/frv/nldbfi.cgs
sim/testsuite/sim/frv/nldbfu.cgs
sim/testsuite/sim/frv/nldd.cgs
sim/testsuite/sim/frv/nlddf.cgs
sim/testsuite/sim/frv/nlddfi.cgs
sim/testsuite/sim/frv/nlddfu.cgs
sim/testsuite/sim/frv/nlddi.cgs
sim/testsuite/sim/frv/nlddu.cgs
sim/testsuite/sim/frv/nldf.cgs
sim/testsuite/sim/frv/nldfi.cgs
sim/testsuite/sim/frv/nldfu.cgs
sim/testsuite/sim/frv/nldhf.cgs
sim/testsuite/sim/frv/nldhfi.cgs
sim/testsuite/sim/frv/nldhfu.cgs
sim/testsuite/sim/frv/nldi.cgs
sim/testsuite/sim/frv/nldq.cgs
sim/testsuite/sim/frv/nldqf.cgs
sim/testsuite/sim/frv/nldqfi.cgs
sim/testsuite/sim/frv/nldqfu.cgs
sim/testsuite/sim/frv/nldqu.cgs
sim/testsuite/sim/frv/nldsb.cgs
sim/testsuite/sim/frv/nldsbi.cgs
sim/testsuite/sim/frv/nldsbu.cgs
sim/testsuite/sim/frv/nldsh.cgs
sim/testsuite/sim/frv/nldshi.cgs
sim/testsuite/sim/frv/nldshu.cgs
sim/testsuite/sim/frv/nldu.cgs
sim/testsuite/sim/frv/nldub.cgs
sim/testsuite/sim/frv/nldubi.cgs
sim/testsuite/sim/frv/nldubu.cgs
sim/testsuite/sim/frv/nlduh.cgs
sim/testsuite/sim/frv/nlduhi.cgs
sim/testsuite/sim/frv/nlduhu.cgs
sim/testsuite/sim/frv/nop.cgs
sim/testsuite/sim/frv/norcr.cgs
sim/testsuite/sim/frv/norncr.cgs
sim/testsuite/sim/frv/not.cgs
sim/testsuite/sim/frv/notcr.cgs
sim/testsuite/sim/frv/nsdiv.cgs
sim/testsuite/sim/frv/nsdivi.cgs
sim/testsuite/sim/frv/nudiv.cgs
sim/testsuite/sim/frv/nudivi.cgs
sim/testsuite/sim/frv/or.cgs
sim/testsuite/sim/frv/orcc.cgs
sim/testsuite/sim/frv/orcr.cgs
sim/testsuite/sim/frv/ori.cgs
sim/testsuite/sim/frv/oricc.cgs
sim/testsuite/sim/frv/orncr.cgs
sim/testsuite/sim/frv/parallel.exp
sim/testsuite/sim/frv/ret.cgs
sim/testsuite/sim/frv/rett.cgs
sim/testsuite/sim/frv/scan.cgs
sim/testsuite/sim/frv/scani.cgs
sim/testsuite/sim/frv/sdiv.cgs
sim/testsuite/sim/frv/sdivi.cgs
sim/testsuite/sim/frv/sethi.cgs
sim/testsuite/sim/frv/sethilo.pcgs
sim/testsuite/sim/frv/setlo.cgs
sim/testsuite/sim/frv/setlos.cgs
sim/testsuite/sim/frv/sll.cgs
sim/testsuite/sim/frv/sllcc.cgs
sim/testsuite/sim/frv/slli.cgs
sim/testsuite/sim/frv/sllicc.cgs
sim/testsuite/sim/frv/smul.cgs
sim/testsuite/sim/frv/smulcc.cgs
sim/testsuite/sim/frv/smuli.cgs
sim/testsuite/sim/frv/smulicc.cgs
sim/testsuite/sim/frv/sra.cgs
sim/testsuite/sim/frv/sracc.cgs
sim/testsuite/sim/frv/srai.cgs
sim/testsuite/sim/frv/sraicc.cgs
sim/testsuite/sim/frv/srl.cgs
sim/testsuite/sim/frv/srlcc.cgs
sim/testsuite/sim/frv/srli.cgs
sim/testsuite/sim/frv/srlicc.cgs
sim/testsuite/sim/frv/st.cgs
sim/testsuite/sim/frv/stb.cgs
sim/testsuite/sim/frv/stbf.cgs
sim/testsuite/sim/frv/stbfi.cgs
sim/testsuite/sim/frv/stbfu.cgs
sim/testsuite/sim/frv/stbi.cgs
sim/testsuite/sim/frv/stbu.cgs
sim/testsuite/sim/frv/stc.cgs
sim/testsuite/sim/frv/stcu.cgs
sim/testsuite/sim/frv/std.cgs
sim/testsuite/sim/frv/std.pcgs
sim/testsuite/sim/frv/stdc.cgs
sim/testsuite/sim/frv/stdc.pcgs
sim/testsuite/sim/frv/stdcu.cgs
sim/testsuite/sim/frv/stdf.cgs
sim/testsuite/sim/frv/stdf.pcgs
sim/testsuite/sim/frv/stdfi.cgs
sim/testsuite/sim/frv/stdfu.cgs
sim/testsuite/sim/frv/stdi.cgs
sim/testsuite/sim/frv/stdu.cgs
sim/testsuite/sim/frv/stf.cgs
sim/testsuite/sim/frv/stfi.cgs
sim/testsuite/sim/frv/stfu.cgs
sim/testsuite/sim/frv/sth.cgs
sim/testsuite/sim/frv/sthf.cgs
sim/testsuite/sim/frv/sthfi.cgs
sim/testsuite/sim/frv/sthfu.cgs
sim/testsuite/sim/frv/sthi.cgs
sim/testsuite/sim/frv/sthu.cgs
sim/testsuite/sim/frv/sti.cgs
sim/testsuite/sim/frv/stq.cgs
sim/testsuite/sim/frv/stq.pcgs
sim/testsuite/sim/frv/stqc.cgs
sim/testsuite/sim/frv/stqc.pcgs
sim/testsuite/sim/frv/stqcu.cgs
sim/testsuite/sim/frv/stqf.cgs
sim/testsuite/sim/frv/stqf.pcgs
sim/testsuite/sim/frv/stqfi.cgs
sim/testsuite/sim/frv/stqfu.cgs
sim/testsuite/sim/frv/stqi.cgs
sim/testsuite/sim/frv/stqu.cgs
sim/testsuite/sim/frv/stu.cgs
sim/testsuite/sim/frv/sub.cgs
sim/testsuite/sim/frv/subcc.cgs
sim/testsuite/sim/frv/subi.cgs
sim/testsuite/sim/frv/subicc.cgs
sim/testsuite/sim/frv/subx.cgs
sim/testsuite/sim/frv/subxcc.cgs
sim/testsuite/sim/frv/subxi.cgs
sim/testsuite/sim/frv/subxicc.cgs
sim/testsuite/sim/frv/swap.cgs
sim/testsuite/sim/frv/swapi.cgs
sim/testsuite/sim/frv/tc.cgs
sim/testsuite/sim/frv/teq.cgs
sim/testsuite/sim/frv/testutils.inc
sim/testsuite/sim/frv/tge.cgs
sim/testsuite/sim/frv/tgt.cgs
sim/testsuite/sim/frv/thi.cgs
sim/testsuite/sim/frv/tic.cgs
sim/testsuite/sim/frv/tieq.cgs
sim/testsuite/sim/frv/tige.cgs
sim/testsuite/sim/frv/tigt.cgs
sim/testsuite/sim/frv/tihi.cgs
sim/testsuite/sim/frv/tile.cgs
sim/testsuite/sim/frv/tils.cgs
sim/testsuite/sim/frv/tilt.cgs
sim/testsuite/sim/frv/tin.cgs
sim/testsuite/sim/frv/tinc.cgs
sim/testsuite/sim/frv/tine.cgs
sim/testsuite/sim/frv/tino.cgs
sim/testsuite/sim/frv/tinv.cgs
sim/testsuite/sim/frv/tip.cgs
sim/testsuite/sim/frv/tira.cgs
sim/testsuite/sim/frv/tiv.cgs
sim/testsuite/sim/frv/tle.cgs
sim/testsuite/sim/frv/tls.cgs
sim/testsuite/sim/frv/tlt.cgs
sim/testsuite/sim/frv/tn.cgs
sim/testsuite/sim/frv/tnc.cgs
sim/testsuite/sim/frv/tne.cgs
sim/testsuite/sim/frv/tno.cgs
sim/testsuite/sim/frv/tnv.cgs
sim/testsuite/sim/frv/tp.cgs
sim/testsuite/sim/frv/tra.cgs
sim/testsuite/sim/frv/tv.cgs
sim/testsuite/sim/frv/udiv.cgs
sim/testsuite/sim/frv/udivi.cgs
sim/testsuite/sim/frv/umul.cgs
sim/testsuite/sim/frv/umulcc.cgs
sim/testsuite/sim/frv/umuli.cgs
sim/testsuite/sim/frv/umulicc.cgs
sim/testsuite/sim/frv/xor.cgs
sim/testsuite/sim/frv/xorcc.cgs
sim/testsuite/sim/frv/xorcr.cgs
sim/testsuite/sim/frv/xori.cgs
sim/testsuite/sim/frv/xoricc.cgs
sim/testsuite/sim/h8300/ChangeLog
sim/testsuite/sim/h8300/addb.s
sim/testsuite/sim/h8300/addl.s
sim/testsuite/sim/h8300/adds.s
sim/testsuite/sim/h8300/addw.s
sim/testsuite/sim/h8300/addx.s
sim/testsuite/sim/h8300/allinsn.exp
sim/testsuite/sim/h8300/andb.s
sim/testsuite/sim/h8300/andl.s
sim/testsuite/sim/h8300/andw.s
sim/testsuite/sim/h8300/band.s
sim/testsuite/sim/h8300/bfld.s
sim/testsuite/sim/h8300/biand.s
sim/testsuite/sim/h8300/bra.s
sim/testsuite/sim/h8300/brabc.s
sim/testsuite/sim/h8300/bset.s
sim/testsuite/sim/h8300/cmpb.s
sim/testsuite/sim/h8300/cmpl.s
sim/testsuite/sim/h8300/cmpw.s
sim/testsuite/sim/h8300/daa.s
sim/testsuite/sim/h8300/das.s
sim/testsuite/sim/h8300/dec.s
sim/testsuite/sim/h8300/div.s
sim/testsuite/sim/h8300/extl.s
sim/testsuite/sim/h8300/extw.s
sim/testsuite/sim/h8300/inc.s
sim/testsuite/sim/h8300/jmp.s
sim/testsuite/sim/h8300/ldc.s
sim/testsuite/sim/h8300/ldm.s
sim/testsuite/sim/h8300/mac.s
sim/testsuite/sim/h8300/mova.s
sim/testsuite/sim/h8300/movb.s
sim/testsuite/sim/h8300/movl.s
sim/testsuite/sim/h8300/movmd.s
sim/testsuite/sim/h8300/movsd.s
sim/testsuite/sim/h8300/movw.s
sim/testsuite/sim/h8300/mul.s
sim/testsuite/sim/h8300/neg.s
sim/testsuite/sim/h8300/nop.s
sim/testsuite/sim/h8300/not.s
sim/testsuite/sim/h8300/orb.s
sim/testsuite/sim/h8300/orl.s
sim/testsuite/sim/h8300/orw.s
sim/testsuite/sim/h8300/rotl.s
sim/testsuite/sim/h8300/rotr.s
sim/testsuite/sim/h8300/rotxl.s
sim/testsuite/sim/h8300/rotxr.s
sim/testsuite/sim/h8300/shal.s
sim/testsuite/sim/h8300/shar.s
sim/testsuite/sim/h8300/shll.s
sim/testsuite/sim/h8300/shlr.s
sim/testsuite/sim/h8300/stack.s
sim/testsuite/sim/h8300/stc.s
sim/testsuite/sim/h8300/subb.s
sim/testsuite/sim/h8300/subl.s
sim/testsuite/sim/h8300/subs.s
sim/testsuite/sim/h8300/subw.s
sim/testsuite/sim/h8300/subx.s
sim/testsuite/sim/h8300/tas.s
sim/testsuite/sim/h8300/testutils.inc
sim/testsuite/sim/h8300/xorb.s
sim/testsuite/sim/h8300/xorl.s
sim/testsuite/sim/h8300/xorw.s
sim/testsuite/sim/m32r/add.cgs
sim/testsuite/sim/m32r/add3.cgs
sim/testsuite/sim/m32r/addi.cgs
sim/testsuite/sim/m32r/addv.cgs
sim/testsuite/sim/m32r/addv3.cgs
sim/testsuite/sim/m32r/addx.cgs
sim/testsuite/sim/m32r/allinsn.exp
sim/testsuite/sim/m32r/and.cgs
sim/testsuite/sim/m32r/and3.cgs
sim/testsuite/sim/m32r/bc24.cgs
sim/testsuite/sim/m32r/bc8.cgs
sim/testsuite/sim/m32r/beq.cgs
sim/testsuite/sim/m32r/beqz.cgs
sim/testsuite/sim/m32r/bgez.cgs
sim/testsuite/sim/m32r/bgtz.cgs
sim/testsuite/sim/m32r/bl24.cgs
sim/testsuite/sim/m32r/bl8.cgs
sim/testsuite/sim/m32r/blez.cgs
sim/testsuite/sim/m32r/bltz.cgs
sim/testsuite/sim/m32r/bnc24.cgs
sim/testsuite/sim/m32r/bnc8.cgs
sim/testsuite/sim/m32r/bne.cgs
sim/testsuite/sim/m32r/bnez.cgs
sim/testsuite/sim/m32r/bra24.cgs
sim/testsuite/sim/m32r/bra8.cgs
sim/testsuite/sim/m32r/cmp.cgs
sim/testsuite/sim/m32r/cmpi.cgs
sim/testsuite/sim/m32r/cmpu.cgs
sim/testsuite/sim/m32r/cmpui.cgs
sim/testsuite/sim/m32r/div.cgs
sim/testsuite/sim/m32r/divu.cgs
sim/testsuite/sim/m32r/hello.ms
sim/testsuite/sim/m32r/hw-trap.ms
sim/testsuite/sim/m32r/jl.cgs
sim/testsuite/sim/m32r/jmp.cgs
sim/testsuite/sim/m32r/ld-d.cgs
sim/testsuite/sim/m32r/ld-plus.cgs
sim/testsuite/sim/m32r/ld.cgs
sim/testsuite/sim/m32r/ld24.cgs
sim/testsuite/sim/m32r/ldb-d.cgs
sim/testsuite/sim/m32r/ldb.cgs
sim/testsuite/sim/m32r/ldh-d.cgs
sim/testsuite/sim/m32r/ldh.cgs
sim/testsuite/sim/m32r/ldi16.cgs
sim/testsuite/sim/m32r/ldi8.cgs
sim/testsuite/sim/m32r/ldub-d.cgs
sim/testsuite/sim/m32r/ldub.cgs
sim/testsuite/sim/m32r/lduh-d.cgs
sim/testsuite/sim/m32r/lduh.cgs
sim/testsuite/sim/m32r/lock.cgs
sim/testsuite/sim/m32r/machi.cgs
sim/testsuite/sim/m32r/maclo.cgs
sim/testsuite/sim/m32r/macwhi.cgs
sim/testsuite/sim/m32r/macwlo.cgs
sim/testsuite/sim/m32r/misc.exp
sim/testsuite/sim/m32r/mul.cgs
sim/testsuite/sim/m32r/mulhi.cgs
sim/testsuite/sim/m32r/mullo.cgs
sim/testsuite/sim/m32r/mulwhi.cgs
sim/testsuite/sim/m32r/mulwlo.cgs
sim/testsuite/sim/m32r/mv.cgs
sim/testsuite/sim/m32r/mvfachi.cgs
sim/testsuite/sim/m32r/mvfaclo.cgs
sim/testsuite/sim/m32r/mvfacmi.cgs
sim/testsuite/sim/m32r/mvfc.cgs
sim/testsuite/sim/m32r/mvtachi.cgs
sim/testsuite/sim/m32r/mvtaclo.cgs
sim/testsuite/sim/m32r/mvtc.cgs
sim/testsuite/sim/m32r/neg.cgs
sim/testsuite/sim/m32r/nop.cgs
sim/testsuite/sim/m32r/not.cgs
sim/testsuite/sim/m32r/or.cgs
sim/testsuite/sim/m32r/or3.cgs
sim/testsuite/sim/m32r/rac.cgs
sim/testsuite/sim/m32r/rach.cgs
sim/testsuite/sim/m32r/rem.cgs
sim/testsuite/sim/m32r/remu.cgs
sim/testsuite/sim/m32r/rte.cgs
sim/testsuite/sim/m32r/seth.cgs
sim/testsuite/sim/m32r/sll.cgs
sim/testsuite/sim/m32r/sll3.cgs
sim/testsuite/sim/m32r/slli.cgs
sim/testsuite/sim/m32r/sra.cgs
sim/testsuite/sim/m32r/sra3.cgs
sim/testsuite/sim/m32r/srai.cgs
sim/testsuite/sim/m32r/srl.cgs
sim/testsuite/sim/m32r/srl3.cgs
sim/testsuite/sim/m32r/srli.cgs
sim/testsuite/sim/m32r/st-d.cgs
sim/testsuite/sim/m32r/st-minus.cgs
sim/testsuite/sim/m32r/st-plus.cgs
sim/testsuite/sim/m32r/st.cgs
sim/testsuite/sim/m32r/stb-d.cgs
sim/testsuite/sim/m32r/stb.cgs
sim/testsuite/sim/m32r/sth-d.cgs
sim/testsuite/sim/m32r/sth.cgs
sim/testsuite/sim/m32r/sub.cgs
sim/testsuite/sim/m32r/subv.cgs
sim/testsuite/sim/m32r/subx.cgs
sim/testsuite/sim/m32r/testutils.inc
sim/testsuite/sim/m32r/trap.cgs
sim/testsuite/sim/m32r/unlock.cgs
sim/testsuite/sim/m32r/uread16.ms
sim/testsuite/sim/m32r/uread32.ms
sim/testsuite/sim/m32r/uwrite16.ms
sim/testsuite/sim/m32r/uwrite32.ms
sim/testsuite/sim/m32r/xor.cgs
sim/testsuite/sim/m32r/xor3.cgs
sim/testsuite/sim/mips/ChangeLog
sim/testsuite/sim/mips/basic.exp
sim/testsuite/sim/mips/fpu64-ps-sb1.s
sim/testsuite/sim/mips/fpu64-ps.s
sim/testsuite/sim/mips/hilo-hazard-1.s
sim/testsuite/sim/mips/hilo-hazard-2.s
sim/testsuite/sim/mips/hilo-hazard-3.s
sim/testsuite/sim/mips/mdmx-ob-sb1.s
sim/testsuite/sim/mips/mdmx-ob.s
sim/testsuite/sim/mips/mips32-dsp.s
sim/testsuite/sim/mips/mips32-dsp2.s
sim/testsuite/sim/mips/sanity.s
sim/testsuite/sim/mips/testutils.inc
sim/testsuite/sim/mips/utils-dsp.inc
sim/testsuite/sim/mips/utils-fpu.inc
sim/testsuite/sim/mips/utils-mdmx.inc
sim/testsuite/sim/sh/ChangeLog
sim/testsuite/sim/sh/add.s
sim/testsuite/sim/sh/allinsn.exp
sim/testsuite/sim/sh/and.s
sim/testsuite/sim/sh/bandor.s
sim/testsuite/sim/sh/bandornot.s
sim/testsuite/sim/sh/bclr.s
sim/testsuite/sim/sh/bld.s
sim/testsuite/sim/sh/bldnot.s
sim/testsuite/sim/sh/bset.s
sim/testsuite/sim/sh/bst.s
sim/testsuite/sim/sh/bxor.s
sim/testsuite/sim/sh/clip.s
sim/testsuite/sim/sh/div.s
sim/testsuite/sim/sh/dmxy.s
sim/testsuite/sim/sh/fabs.s
sim/testsuite/sim/sh/fadd.s
sim/testsuite/sim/sh/fail.s
sim/testsuite/sim/sh/fcmpeq.s
sim/testsuite/sim/sh/fcmpgt.s
sim/testsuite/sim/sh/fcnvds.s
sim/testsuite/sim/sh/fcnvsd.s
sim/testsuite/sim/sh/fdiv.s
sim/testsuite/sim/sh/fipr.s
sim/testsuite/sim/sh/fldi0.s
sim/testsuite/sim/sh/fldi1.s
sim/testsuite/sim/sh/flds.s
sim/testsuite/sim/sh/float.s
sim/testsuite/sim/sh/fmac.s
sim/testsuite/sim/sh/fmov.s
sim/testsuite/sim/sh/fmul.s
sim/testsuite/sim/sh/fneg.s
sim/testsuite/sim/sh/fpchg.s
sim/testsuite/sim/sh/frchg.s
sim/testsuite/sim/sh/fsca.s
sim/testsuite/sim/sh/fschg.s
sim/testsuite/sim/sh/fsqrt.s
sim/testsuite/sim/sh/fsrra.s
sim/testsuite/sim/sh/fsub.s
sim/testsuite/sim/sh/ftrc.s
sim/testsuite/sim/sh/ldrc.s
sim/testsuite/sim/sh/loop.s
sim/testsuite/sim/sh/macl.s
sim/testsuite/sim/sh/macw.s
sim/testsuite/sim/sh/mov.s
sim/testsuite/sim/sh/movi.s
sim/testsuite/sim/sh/movli.s
sim/testsuite/sim/sh/movua.s
sim/testsuite/sim/sh/movxy.s
sim/testsuite/sim/sh/mulr.s
sim/testsuite/sim/sh/pabs.s
sim/testsuite/sim/sh/padd.s
sim/testsuite/sim/sh/paddc.s
sim/testsuite/sim/sh/pand.s
sim/testsuite/sim/sh/pass.s
sim/testsuite/sim/sh/pclr.s
sim/testsuite/sim/sh/pdec.s
sim/testsuite/sim/sh/pdmsb.s
sim/testsuite/sim/sh/pinc.s
sim/testsuite/sim/sh/pmuls.s
sim/testsuite/sim/sh/prnd.s
sim/testsuite/sim/sh/pshai.s
sim/testsuite/sim/sh/pshar.s
sim/testsuite/sim/sh/pshli.s
sim/testsuite/sim/sh/pshlr.s
sim/testsuite/sim/sh/psub.s
sim/testsuite/sim/sh/pswap.s
sim/testsuite/sim/sh/pushpop.s
sim/testsuite/sim/sh/resbank.s
sim/testsuite/sim/sh/sett.s
sim/testsuite/sim/sh/shll.s
sim/testsuite/sim/sh/shll16.s
sim/testsuite/sim/sh/shll2.s
sim/testsuite/sim/sh/shll8.s
sim/testsuite/sim/sh/shlr.s
sim/testsuite/sim/sh/shlr16.s
sim/testsuite/sim/sh/shlr2.s
sim/testsuite/sim/sh/shlr8.s
sim/testsuite/sim/sh/swap.s
sim/testsuite/sim/sh/testutils.inc
sim/testsuite/sim/sh64/ChangeLog
sim/testsuite/sim/sh64/compact.exp
sim/testsuite/sim/sh64/compact/ChangeLog
sim/testsuite/sim/sh64/compact/add.cgs
sim/testsuite/sim/sh64/compact/addc.cgs
sim/testsuite/sim/sh64/compact/addi.cgs
sim/testsuite/sim/sh64/compact/addv.cgs
sim/testsuite/sim/sh64/compact/and.cgs
sim/testsuite/sim/sh64/compact/andb.cgs
sim/testsuite/sim/sh64/compact/andi.cgs
sim/testsuite/sim/sh64/compact/bf.cgs
sim/testsuite/sim/sh64/compact/bfs.cgs
sim/testsuite/sim/sh64/compact/bra.cgs
sim/testsuite/sim/sh64/compact/braf.cgs
sim/testsuite/sim/sh64/compact/brk.cgs
sim/testsuite/sim/sh64/compact/bsr.cgs
sim/testsuite/sim/sh64/compact/bsrf.cgs
sim/testsuite/sim/sh64/compact/bt.cgs
sim/testsuite/sim/sh64/compact/bts.cgs
sim/testsuite/sim/sh64/compact/clrmac.cgs
sim/testsuite/sim/sh64/compact/clrs.cgs
sim/testsuite/sim/sh64/compact/clrt.cgs
sim/testsuite/sim/sh64/compact/cmpeq.cgs
sim/testsuite/sim/sh64/compact/cmpeqi.cgs
sim/testsuite/sim/sh64/compact/cmpge.cgs
sim/testsuite/sim/sh64/compact/cmpgt.cgs
sim/testsuite/sim/sh64/compact/cmphi.cgs
sim/testsuite/sim/sh64/compact/cmphs.cgs
sim/testsuite/sim/sh64/compact/cmppl.cgs
sim/testsuite/sim/sh64/compact/cmppz.cgs
sim/testsuite/sim/sh64/compact/cmpstr.cgs
sim/testsuite/sim/sh64/compact/div0s.cgs
sim/testsuite/sim/sh64/compact/div0u.cgs
sim/testsuite/sim/sh64/compact/div1.cgs
sim/testsuite/sim/sh64/compact/dmulsl.cgs
sim/testsuite/sim/sh64/compact/dmulul.cgs
sim/testsuite/sim/sh64/compact/dt.cgs
sim/testsuite/sim/sh64/compact/extsb.cgs
sim/testsuite/sim/sh64/compact/extsw.cgs
sim/testsuite/sim/sh64/compact/extub.cgs
sim/testsuite/sim/sh64/compact/extuw.cgs
sim/testsuite/sim/sh64/compact/fabs.cgs
sim/testsuite/sim/sh64/compact/fadd.cgs
sim/testsuite/sim/sh64/compact/fcmpeq.cgs
sim/testsuite/sim/sh64/compact/fcmpgt.cgs
sim/testsuite/sim/sh64/compact/fcnvds.cgs
sim/testsuite/sim/sh64/compact/fcnvsd.cgs
sim/testsuite/sim/sh64/compact/fdiv.cgs
sim/testsuite/sim/sh64/compact/fipr.cgs
sim/testsuite/sim/sh64/compact/fldi0.cgs
sim/testsuite/sim/sh64/compact/fldi1.cgs
sim/testsuite/sim/sh64/compact/flds.cgs
sim/testsuite/sim/sh64/compact/float.cgs
sim/testsuite/sim/sh64/compact/fmac.cgs
sim/testsuite/sim/sh64/compact/fmov.cgs
sim/testsuite/sim/sh64/compact/fmul.cgs
sim/testsuite/sim/sh64/compact/fneg.cgs
sim/testsuite/sim/sh64/compact/frchg.cgs
sim/testsuite/sim/sh64/compact/fschg.cgs
sim/testsuite/sim/sh64/compact/fsqrt.cgs
sim/testsuite/sim/sh64/compact/fsts.cgs
sim/testsuite/sim/sh64/compact/fsub.cgs
sim/testsuite/sim/sh64/compact/ftrc.cgs
sim/testsuite/sim/sh64/compact/ftrv.cgs
sim/testsuite/sim/sh64/compact/jmp.cgs
sim/testsuite/sim/sh64/compact/jsr.cgs
sim/testsuite/sim/sh64/compact/ldc-gbr.cgs
sim/testsuite/sim/sh64/compact/ldcl-gbr.cgs
sim/testsuite/sim/sh64/compact/lds-fpscr.cgs
sim/testsuite/sim/sh64/compact/lds-fpul.cgs
sim/testsuite/sim/sh64/compact/lds-mach.cgs
sim/testsuite/sim/sh64/compact/lds-macl.cgs
sim/testsuite/sim/sh64/compact/lds-pr.cgs
sim/testsuite/sim/sh64/compact/ldsl-fpscr.cgs
sim/testsuite/sim/sh64/compact/ldsl-fpul.cgs
sim/testsuite/sim/sh64/compact/ldsl-mach.cgs
sim/testsuite/sim/sh64/compact/ldsl-macl.cgs
sim/testsuite/sim/sh64/compact/ldsl-pr.cgs
sim/testsuite/sim/sh64/compact/macl.cgs
sim/testsuite/sim/sh64/compact/macw.cgs
sim/testsuite/sim/sh64/compact/mov.cgs
sim/testsuite/sim/sh64/compact/mova.cgs
sim/testsuite/sim/sh64/compact/movb1.cgs
sim/testsuite/sim/sh64/compact/movb10.cgs
sim/testsuite/sim/sh64/compact/movb2.cgs
sim/testsuite/sim/sh64/compact/movb3.cgs
sim/testsuite/sim/sh64/compact/movb4.cgs
sim/testsuite/sim/sh64/compact/movb5.cgs
sim/testsuite/sim/sh64/compact/movb6.cgs
sim/testsuite/sim/sh64/compact/movb7.cgs
sim/testsuite/sim/sh64/compact/movb8.cgs
sim/testsuite/sim/sh64/compact/movb9.cgs
sim/testsuite/sim/sh64/compact/movcal.cgs
sim/testsuite/sim/sh64/compact/movi.cgs
sim/testsuite/sim/sh64/compact/movl1.cgs
sim/testsuite/sim/sh64/compact/movl10.cgs
sim/testsuite/sim/sh64/compact/movl11.cgs
sim/testsuite/sim/sh64/compact/movl2.cgs
sim/testsuite/sim/sh64/compact/movl3.cgs
sim/testsuite/sim/sh64/compact/movl4.cgs
sim/testsuite/sim/sh64/compact/movl5.cgs
sim/testsuite/sim/sh64/compact/movl6.cgs
sim/testsuite/sim/sh64/compact/movl7.cgs
sim/testsuite/sim/sh64/compact/movl8.cgs
sim/testsuite/sim/sh64/compact/movl9.cgs
sim/testsuite/sim/sh64/compact/movt.cgs
sim/testsuite/sim/sh64/compact/movw1.cgs
sim/testsuite/sim/sh64/compact/movw10.cgs
sim/testsuite/sim/sh64/compact/movw11.cgs
sim/testsuite/sim/sh64/compact/movw2.cgs
sim/testsuite/sim/sh64/compact/movw3.cgs
sim/testsuite/sim/sh64/compact/movw4.cgs
sim/testsuite/sim/sh64/compact/movw5.cgs
sim/testsuite/sim/sh64/compact/movw6.cgs
sim/testsuite/sim/sh64/compact/movw7.cgs
sim/testsuite/sim/sh64/compact/movw8.cgs
sim/testsuite/sim/sh64/compact/movw9.cgs
sim/testsuite/sim/sh64/compact/mull.cgs
sim/testsuite/sim/sh64/compact/mulsw.cgs
sim/testsuite/sim/sh64/compact/muluw.cgs
sim/testsuite/sim/sh64/compact/neg.cgs
sim/testsuite/sim/sh64/compact/negc.cgs
sim/testsuite/sim/sh64/compact/nop.cgs
sim/testsuite/sim/sh64/compact/not.cgs
sim/testsuite/sim/sh64/compact/ocbi.cgs
sim/testsuite/sim/sh64/compact/ocbp.cgs
sim/testsuite/sim/sh64/compact/ocbwb.cgs
sim/testsuite/sim/sh64/compact/or.cgs
sim/testsuite/sim/sh64/compact/orb.cgs
sim/testsuite/sim/sh64/compact/ori.cgs
sim/testsuite/sim/sh64/compact/pref.cgs
sim/testsuite/sim/sh64/compact/rotcl.cgs
sim/testsuite/sim/sh64/compact/rotcr.cgs
sim/testsuite/sim/sh64/compact/rotl.cgs
sim/testsuite/sim/sh64/compact/rotr.cgs
sim/testsuite/sim/sh64/compact/rts.cgs
sim/testsuite/sim/sh64/compact/sets.cgs
sim/testsuite/sim/sh64/compact/sett.cgs
sim/testsuite/sim/sh64/compact/shad.cgs
sim/testsuite/sim/sh64/compact/shal.cgs
sim/testsuite/sim/sh64/compact/shar.cgs
sim/testsuite/sim/sh64/compact/shld.cgs
sim/testsuite/sim/sh64/compact/shll.cgs
sim/testsuite/sim/sh64/compact/shll16.cgs
sim/testsuite/sim/sh64/compact/shll2.cgs
sim/testsuite/sim/sh64/compact/shll8.cgs
sim/testsuite/sim/sh64/compact/shlr.cgs
sim/testsuite/sim/sh64/compact/shlr16.cgs
sim/testsuite/sim/sh64/compact/shlr2.cgs
sim/testsuite/sim/sh64/compact/shlr8.cgs
sim/testsuite/sim/sh64/compact/stc-gbr.cgs
sim/testsuite/sim/sh64/compact/stcl-gbr.cgs
sim/testsuite/sim/sh64/compact/sts-fpscr.cgs
sim/testsuite/sim/sh64/compact/sts-fpul.cgs
sim/testsuite/sim/sh64/compact/sts-mach.cgs
sim/testsuite/sim/sh64/compact/sts-macl.cgs
sim/testsuite/sim/sh64/compact/sts-pr.cgs
sim/testsuite/sim/sh64/compact/stsl-fpscr.cgs
sim/testsuite/sim/sh64/compact/stsl-fpul.cgs
sim/testsuite/sim/sh64/compact/stsl-mach.cgs
sim/testsuite/sim/sh64/compact/stsl-macl.cgs
sim/testsuite/sim/sh64/compact/stsl-pr.cgs
sim/testsuite/sim/sh64/compact/sub.cgs
sim/testsuite/sim/sh64/compact/subc.cgs
sim/testsuite/sim/sh64/compact/subv.cgs
sim/testsuite/sim/sh64/compact/swapb.cgs
sim/testsuite/sim/sh64/compact/swapw.cgs
sim/testsuite/sim/sh64/compact/tasb.cgs
sim/testsuite/sim/sh64/compact/testutils.inc
sim/testsuite/sim/sh64/compact/trapa.cgs
sim/testsuite/sim/sh64/compact/tst.cgs
sim/testsuite/sim/sh64/compact/tstb.cgs
sim/testsuite/sim/sh64/compact/tsti.cgs
sim/testsuite/sim/sh64/compact/xor.cgs
sim/testsuite/sim/sh64/compact/xorb.cgs
sim/testsuite/sim/sh64/compact/xori.cgs
sim/testsuite/sim/sh64/compact/xtrct.cgs
sim/testsuite/sim/sh64/interwork.exp
sim/testsuite/sim/sh64/media.exp
sim/testsuite/sim/sh64/media/ChangeLog
sim/testsuite/sim/sh64/media/add.cgs
sim/testsuite/sim/sh64/media/addi.cgs
sim/testsuite/sim/sh64/media/addil.cgs
sim/testsuite/sim/sh64/media/addl.cgs
sim/testsuite/sim/sh64/media/addzl.cgs
sim/testsuite/sim/sh64/media/alloco.cgs
sim/testsuite/sim/sh64/media/and.cgs
sim/testsuite/sim/sh64/media/andc.cgs
sim/testsuite/sim/sh64/media/andi.cgs
sim/testsuite/sim/sh64/media/beq.cgs
sim/testsuite/sim/sh64/media/beqi.cgs
sim/testsuite/sim/sh64/media/bge.cgs
sim/testsuite/sim/sh64/media/bgeu.cgs
sim/testsuite/sim/sh64/media/bgt.cgs
sim/testsuite/sim/sh64/media/bgtu.cgs
sim/testsuite/sim/sh64/media/blink.cgs
sim/testsuite/sim/sh64/media/bne.cgs
sim/testsuite/sim/sh64/media/bnei.cgs
sim/testsuite/sim/sh64/media/brk.cgs
sim/testsuite/sim/sh64/media/byterev.cgs
sim/testsuite/sim/sh64/media/cmpeq.cgs
sim/testsuite/sim/sh64/media/cmpgt.cgs
sim/testsuite/sim/sh64/media/cmpgtu.cgs
sim/testsuite/sim/sh64/media/cmveq.cgs
sim/testsuite/sim/sh64/media/cmvne.cgs
sim/testsuite/sim/sh64/media/fabsd.cgs
sim/testsuite/sim/sh64/media/fabss.cgs
sim/testsuite/sim/sh64/media/faddd.cgs
sim/testsuite/sim/sh64/media/fadds.cgs
sim/testsuite/sim/sh64/media/fcmpeqd.cgs
sim/testsuite/sim/sh64/media/fcmpeqs.cgs
sim/testsuite/sim/sh64/media/fcmpged.cgs
sim/testsuite/sim/sh64/media/fcmpges.cgs
sim/testsuite/sim/sh64/media/fcmpgtd.cgs
sim/testsuite/sim/sh64/media/fcmpgts.cgs
sim/testsuite/sim/sh64/media/fcmpund.cgs
sim/testsuite/sim/sh64/media/fcmpuns.cgs
sim/testsuite/sim/sh64/media/fcnvds.cgs
sim/testsuite/sim/sh64/media/fcnvsd.cgs
sim/testsuite/sim/sh64/media/fdivd.cgs
sim/testsuite/sim/sh64/media/fdivs.cgs
sim/testsuite/sim/sh64/media/fgetscr.cgs
sim/testsuite/sim/sh64/media/fiprs.cgs
sim/testsuite/sim/sh64/media/fldd.cgs
sim/testsuite/sim/sh64/media/fldp.cgs
sim/testsuite/sim/sh64/media/flds.cgs
sim/testsuite/sim/sh64/media/fldxd.cgs
sim/testsuite/sim/sh64/media/fldxp.cgs
sim/testsuite/sim/sh64/media/fldxs.cgs
sim/testsuite/sim/sh64/media/floatld.cgs
sim/testsuite/sim/sh64/media/floatls.cgs
sim/testsuite/sim/sh64/media/floatqd.cgs
sim/testsuite/sim/sh64/media/floatqs.cgs
sim/testsuite/sim/sh64/media/fmacs.cgs
sim/testsuite/sim/sh64/media/fmovd.cgs
sim/testsuite/sim/sh64/media/fmovdq.cgs
sim/testsuite/sim/sh64/media/fmovls.cgs
sim/testsuite/sim/sh64/media/fmovqd.cgs
sim/testsuite/sim/sh64/media/fmovs.cgs
sim/testsuite/sim/sh64/media/fmovsl.cgs
sim/testsuite/sim/sh64/media/fmuld.cgs
sim/testsuite/sim/sh64/media/fmuls.cgs
sim/testsuite/sim/sh64/media/fnegd.cgs
sim/testsuite/sim/sh64/media/fnegs.cgs
sim/testsuite/sim/sh64/media/fputscr.cgs
sim/testsuite/sim/sh64/media/fsqrtd.cgs
sim/testsuite/sim/sh64/media/fsqrts.cgs
sim/testsuite/sim/sh64/media/fstd.cgs
sim/testsuite/sim/sh64/media/fstp.cgs
sim/testsuite/sim/sh64/media/fsts.cgs
sim/testsuite/sim/sh64/media/fstxd.cgs
sim/testsuite/sim/sh64/media/fstxp.cgs
sim/testsuite/sim/sh64/media/fstxs.cgs
sim/testsuite/sim/sh64/media/fsubd.cgs
sim/testsuite/sim/sh64/media/fsubs.cgs
sim/testsuite/sim/sh64/media/ftrcdl.cgs
sim/testsuite/sim/sh64/media/ftrcdq.cgs
sim/testsuite/sim/sh64/media/ftrcsl.cgs
sim/testsuite/sim/sh64/media/ftrcsq.cgs
sim/testsuite/sim/sh64/media/ftrvs.cgs
sim/testsuite/sim/sh64/media/getcfg.cgs
sim/testsuite/sim/sh64/media/getcon.cgs
sim/testsuite/sim/sh64/media/gettr.cgs
sim/testsuite/sim/sh64/media/icbi.cgs
sim/testsuite/sim/sh64/media/ldb.cgs
sim/testsuite/sim/sh64/media/ldhil.cgs
sim/testsuite/sim/sh64/media/ldhiq.cgs
sim/testsuite/sim/sh64/media/ldl.cgs
sim/testsuite/sim/sh64/media/ldlol.cgs
sim/testsuite/sim/sh64/media/ldloq.cgs
sim/testsuite/sim/sh64/media/ldq.cgs
sim/testsuite/sim/sh64/media/ldub.cgs
sim/testsuite/sim/sh64/media/lduw.cgs
sim/testsuite/sim/sh64/media/ldw.cgs
sim/testsuite/sim/sh64/media/ldxb.cgs
sim/testsuite/sim/sh64/media/ldxl.cgs
sim/testsuite/sim/sh64/media/ldxq.cgs
sim/testsuite/sim/sh64/media/ldxub.cgs
sim/testsuite/sim/sh64/media/ldxuw.cgs
sim/testsuite/sim/sh64/media/ldxw.cgs
sim/testsuite/sim/sh64/media/mabsl.cgs
sim/testsuite/sim/sh64/media/mabsw.cgs
sim/testsuite/sim/sh64/media/maddl.cgs
sim/testsuite/sim/sh64/media/maddsl.cgs
sim/testsuite/sim/sh64/media/maddsub.cgs
sim/testsuite/sim/sh64/media/maddsw.cgs
sim/testsuite/sim/sh64/media/maddw.cgs
sim/testsuite/sim/sh64/media/mcmpeqb.cgs
sim/testsuite/sim/sh64/media/mcmpeql.cgs
sim/testsuite/sim/sh64/media/mcmpeqw.cgs
sim/testsuite/sim/sh64/media/mcmpgtl.cgs
sim/testsuite/sim/sh64/media/mcmpgtub.cgs
sim/testsuite/sim/sh64/media/mcmpgtw.cgs
sim/testsuite/sim/sh64/media/mcmv.cgs
sim/testsuite/sim/sh64/media/mcnvslw.cgs
sim/testsuite/sim/sh64/media/mcnvswb.cgs
sim/testsuite/sim/sh64/media/mcnvswub.cgs
sim/testsuite/sim/sh64/media/mextr1.cgs
sim/testsuite/sim/sh64/media/mextr2.cgs
sim/testsuite/sim/sh64/media/mextr3.cgs
sim/testsuite/sim/sh64/media/mextr4.cgs
sim/testsuite/sim/sh64/media/mextr5.cgs
sim/testsuite/sim/sh64/media/mextr6.cgs
sim/testsuite/sim/sh64/media/mextr7.cgs
sim/testsuite/sim/sh64/media/mmacfxwl.cgs
sim/testsuite/sim/sh64/media/mmacnfx-wl.cgs
sim/testsuite/sim/sh64/media/mmulfxl.cgs
sim/testsuite/sim/sh64/media/mmulfxrpw.cgs
sim/testsuite/sim/sh64/media/mmulfxw.cgs
sim/testsuite/sim/sh64/media/mmulhiwl.cgs
sim/testsuite/sim/sh64/media/mmull.cgs
sim/testsuite/sim/sh64/media/mmullowl.cgs
sim/testsuite/sim/sh64/media/mmulsumwq.cgs
sim/testsuite/sim/sh64/media/mmulw.cgs
sim/testsuite/sim/sh64/media/movi.cgs
sim/testsuite/sim/sh64/media/mpermw.cgs
sim/testsuite/sim/sh64/media/msadubq.cgs
sim/testsuite/sim/sh64/media/mshaldsl.cgs
sim/testsuite/sim/sh64/media/mshaldsw.cgs
sim/testsuite/sim/sh64/media/mshardl.cgs
sim/testsuite/sim/sh64/media/mshardsq.cgs
sim/testsuite/sim/sh64/media/mshardw.cgs
sim/testsuite/sim/sh64/media/mshfhib.cgs
sim/testsuite/sim/sh64/media/mshfhil.cgs
sim/testsuite/sim/sh64/media/mshfhiw.cgs
sim/testsuite/sim/sh64/media/mshflob.cgs
sim/testsuite/sim/sh64/media/mshflol.cgs
sim/testsuite/sim/sh64/media/mshflow.cgs
sim/testsuite/sim/sh64/media/mshlldl.cgs
sim/testsuite/sim/sh64/media/mshlldw.cgs
sim/testsuite/sim/sh64/media/mshlrdl.cgs
sim/testsuite/sim/sh64/media/mshlrdw.cgs
sim/testsuite/sim/sh64/media/msubl.cgs
sim/testsuite/sim/sh64/media/msubsl.cgs
sim/testsuite/sim/sh64/media/msubsub.cgs
sim/testsuite/sim/sh64/media/msubsw.cgs
sim/testsuite/sim/sh64/media/msubw.cgs
sim/testsuite/sim/sh64/media/mulsl.cgs
sim/testsuite/sim/sh64/media/mulul.cgs
sim/testsuite/sim/sh64/media/nop.cgs
sim/testsuite/sim/sh64/media/nsb.cgs
sim/testsuite/sim/sh64/media/ocbi.cgs
sim/testsuite/sim/sh64/media/ocbp.cgs
sim/testsuite/sim/sh64/media/ocbwb.cgs
sim/testsuite/sim/sh64/media/or.cgs
sim/testsuite/sim/sh64/media/ori.cgs
sim/testsuite/sim/sh64/media/prefi.cgs
sim/testsuite/sim/sh64/media/pta.cgs
sim/testsuite/sim/sh64/media/ptabs.cgs
sim/testsuite/sim/sh64/media/ptb.cgs
sim/testsuite/sim/sh64/media/ptrel.cgs
sim/testsuite/sim/sh64/media/putcfg.cgs
sim/testsuite/sim/sh64/media/putcon.cgs
sim/testsuite/sim/sh64/media/rte.cgs
sim/testsuite/sim/sh64/media/shard.cgs
sim/testsuite/sim/sh64/media/shardl.cgs
sim/testsuite/sim/sh64/media/shari.cgs
sim/testsuite/sim/sh64/media/sharil.cgs
sim/testsuite/sim/sh64/media/shlld.cgs
sim/testsuite/sim/sh64/media/shlldl.cgs
sim/testsuite/sim/sh64/media/shlli.cgs
sim/testsuite/sim/sh64/media/shllil.cgs
sim/testsuite/sim/sh64/media/shlrd.cgs
sim/testsuite/sim/sh64/media/shlrdl.cgs
sim/testsuite/sim/sh64/media/shlri.cgs
sim/testsuite/sim/sh64/media/shlril.cgs
sim/testsuite/sim/sh64/media/shori.cgs
sim/testsuite/sim/sh64/media/sleep.cgs
sim/testsuite/sim/sh64/media/stb.cgs
sim/testsuite/sim/sh64/media/sthil.cgs
sim/testsuite/sim/sh64/media/sthiq.cgs
sim/testsuite/sim/sh64/media/stl.cgs
sim/testsuite/sim/sh64/media/stlol.cgs
sim/testsuite/sim/sh64/media/stloq.cgs
sim/testsuite/sim/sh64/media/stq.cgs
sim/testsuite/sim/sh64/media/stw.cgs
sim/testsuite/sim/sh64/media/stxb.cgs
sim/testsuite/sim/sh64/media/stxl.cgs
sim/testsuite/sim/sh64/media/stxq.cgs
sim/testsuite/sim/sh64/media/stxw.cgs
sim/testsuite/sim/sh64/media/sub.cgs
sim/testsuite/sim/sh64/media/subl.cgs
sim/testsuite/sim/sh64/media/swapq.cgs
sim/testsuite/sim/sh64/media/synci.cgs
sim/testsuite/sim/sh64/media/synco.cgs
sim/testsuite/sim/sh64/media/testutils.inc
sim/testsuite/sim/sh64/media/trapa.cgs
sim/testsuite/sim/sh64/media/xor.cgs
sim/testsuite/sim/sh64/media/xori.cgs
sim/testsuite/sim/sh64/misc/fr-dr.s
sim/testsuite/sim/v850/allinsns.exp
sim/testsuite/sim/v850/bsh.cgs
sim/testsuite/sim/v850/div.cgs
sim/testsuite/sim/v850/divh.cgs
sim/testsuite/sim/v850/divh_3.cgs
sim/testsuite/sim/v850/divhu.cgs
sim/testsuite/sim/v850/divu.cgs
sim/testsuite/sim/v850/sar.cgs
sim/testsuite/sim/v850/satadd.cgs
sim/testsuite/sim/v850/satsub.cgs
sim/testsuite/sim/v850/satsubi.cgs
sim/testsuite/sim/v850/satsubr.cgs
sim/testsuite/sim/v850/shl.cgs
sim/testsuite/sim/v850/shr.cgs
sim/testsuite/sim/v850/testutils.cgs
sim/testsuite/sim/v850/testutils.inc
sim/v850/ChangeLog
sim/v850/Makefile.in
sim/v850/config.in
sim/v850/configure
sim/v850/configure.ac
sim/v850/interp.c
sim/v850/sim-main.h
sim/v850/simops.c
sim/v850/simops.h
sim/v850/v850-dc
sim/v850/v850.igen
sim/v850/v850_sim.h
Diffstat (limited to 'gdb/gdbserver')
70 files changed, 0 insertions, 53753 deletions
diff --git a/gdb/gdbserver/.gitignore b/gdb/gdbserver/.gitignore deleted file mode 100644 index 9c9495023da..00000000000 --- a/gdb/gdbserver/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -gdbreplay -gdbserver -reg-*.c -version.c diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog deleted file mode 100644 index be5e5dd3f48..00000000000 --- a/gdb/gdbserver/ChangeLog +++ /dev/null @@ -1,6045 +0,0 @@ -2011-09-21 Ulrich Weigand <ulrich.weigand@linaro.org> - - * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove. - (arm_linux_hwbp_cap): New static variable. - (arm_linux_get_hwbp_cap): Replace by ... - (arm_linux_init_hwbp_cap): ... this new function. - (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap. - (arm_linux_get_hw_watchpoint_count): Likewise. - (arm_linux_get_hw_watchpoint_max_length): Likewise. - (arm_arch_setup): Call arm_linux_init_hwbp_cap. - (arm_prepare_to_resume): Use perror_with_name instead of error. - -2011-09-21 Ulrich Weigand <ulrich.weigand@linaro.org> - - * linux-arm-low.c: Include <signal.h>. - (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary. - (struct arm_linux_hwbp_cap): New data type. - (arm_hwbp_type, arm_hwbp_control_t): New typedefs. - (struct arm_linux_hw_breakpoint): New data type. - (MAX_BPTS, MAX_WPTS): Define. - (struct arch_process_info, struct arch_lwp_info): New data types. - (arm_linux_get_hwbp_cap): New function. - (arm_linux_get_hw_breakpoint_count): Likewise. - (arm_linux_get_hw_watchpoint_count): Likewise. - (arm_linux_get_hw_watchpoint_max_length): Likewise. - (arm_hwbp_control_initialize): Likewise. - (arm_hwbp_control_is_enabled): Likewise. - (arm_hwbp_control_is_initialized): Likewise. - (arm_hwbp_control_disable): Likewise. - (arm_linux_hw_breakpoint_equal): Likewise. - (arm_linux_hw_point_initialize): Likewise. - (struct update_registers_data): New data structure. - (update_registers_callback: New function. - (arm_insert_point): Likewise. - (arm_remove_point): Likewise. - (arm_stopped_by_watchpoint): Likewise. - (arm_stopped_data_address): Likewise. - (arm_new_process): Likewise. - (arm_new_thread): Likewise. - (arm_prepare_to_resume): Likewise. - (the_low_target): Register arm_insert_point, arm_remove_point, - arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process, - arm_new_thread, and arm_prepare_to_resume. - -2011-09-15 Stan Shebs <stan@codesourcery.com> - - * server.h (struct emit_ops): Add compare-goto fields. - * tracepoint.c (gdb_agent_op_sizes): New table. - (emit_eq_goto): New function. - (emit_ne_goto): New function. - (emit_lt_goto): New function. - (emit_le_goto): New function. - (emit_gt_goto): New function. - (emit_ge_goto): New function. - (is_goto_target): New function. - (compile_bytecodes): Recognize special cases of compare-goto - combinations and call specialized emitters for them. - * linux-x86-low.c (amd64_emit_eq_goto): New function. - (amd64_emit_ne_goto): New function. - (amd64_emit_lt_goto): New function. - (amd64_emit_le_goto): New function. - (amd64_emit_gt_goto): New function. - (amd64_emit_ge_goto): New function. - (amd64_emit_ops): Add the new functions. - (i386_emit_eq_goto): New function. - (i386_emit_ne_goto): New function. - (i386_emit_lt_goto): New function. - (i386_emit_le_goto): New function. - (i386_emit_gt_goto): New function. - (i386_emit_ge_goto): New function. - (i386_emit_ops): Add the new functions. - -2011-09-08 Stan Shebs <stan@codesourcery.com> - - * linux-x86-low.c (i386_emit_prologue): Save %ebx. - (i386_emit_epilogue): Restore %ebx. - -2011-08-31 Jie Zhang <jzhang918@gmail.com> - - * server.c (step_thread): Remove definition. - (process_serial_event): Don't handle Hs. - * server.h (step_thread): Remove declaration. - * target.c (set_desired_inferior): Remove use of step_thread. - -2011-08-24 Luis Machado <lgustavo@codesourcery.com> - - * linux-low.c: Include linux-procfs.h. - (linux_attach_lwp_1): Update comments. - (linux_attach): Scan for existing threads when attaching to a - process that is the tgid. - * Makefile.in: Update dependencies. - -2011-08-24 Luis Machado <lgustavo@codesourcery.com> - - * configure.srv: Add linux-procfs.o dependencies. - -2011-08-14 Yao Qi <yao@codesourcery.com> - - * target.h (struct target_ops): Fix indent. - * win32-low.c (win32_target_ops): Fix comment. - -2011-08-14 Andrew Jenner <andrew@codesourcery.com> - Yao Qi <yao@codesourcery.com> - - * Makefile.in (clean): Remove tic6x-*.c files. - (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules. - (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise. - (tic6x-c64xp-linux.c): Likewise. - * configure.srv: Add support for tic6x-*-uclinux. - * linux-tic6x-low.c: New. - * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define. - -2011-08-14 Andrew Stubbs <ams@codesourcery.com> - Yao Qi <yao@codesourcery.com> - - * target.h (struct target_ops): Add read_loadmap. - * linux-low.c (struct target_loadseg): New type. - (struct target_loadmap): New type. - (linux_read_loadmap): New function. - (linux_target_ops): Add linux_read_loadmap. - * server.c (handle_query): Support qXfer:fdpic:read packet. - * win32-low.c (win32_target_ops): Initialize field `read_loadmap' to NULL. - -2011-08-05 Eli Zaretskii <eliz@gnu.org> - - * win32-low.c: Include <stdint.h>. - -2011-07-22 Pedro Alves <pedro@codesourcery.com> - - * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info - to the inferior here. - (i386_remove_aligned_watchpoint): Ditto. - (i386_handle_nonaligned_watchpoint): Return immediate on fail to - fit part of the watchpoint in the debug registers. - (i386_update_inferior_debug_regs): New. - (i386_low_insert_watchpoint): Work on a local mirror of the debug - registers, and only update the inferior on success. - (i386_low_remove_watchpoint): Ditto. - -2011-07-22 Kwok Cheung Yeung <kcy@codesourcery.com> - - * linux-low.c (compare_ints, unique, list_threads, show_process, - linux_core_of_thread): Delete. - (linux_target_ops): Change linux_core_of_thread to - linux_common_core_of_thread. - (linux_qxfer_osdata): Defer to linux_common_xfer_osdata. - * utils.c (malloc_failure): Change type of argument. - (xmalloc, xrealloc, xcalloc, xsnprintf): Delete. - * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c, - common/linux-osdata.c, common/ptid.c and common/buffer.c. - (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o. - (IPA_OBJS): Add common-utils-ipa.o. - (ptid_h, linux_osdata_h): New macros. - (server_h): Add common/common-utils.h, common/xml-utils.h, - common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and - common/ptid.h. - (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o, - ptid.o, buffer.o): New rules. - (linux-low.o): Add common/linux-osdata.h as a dependency. - * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets. - * configure.ac: Add AC_HEADER_DIRENT check. - * config.in: Regenerate. - * configure: Regenerate. - * remote-utils.c (xml_escape_text): Delete. - (buffer_grow, buffer_free, buffer_init, buffer_finish, - buffer_xml_printf): Move to common/buffer.c. - * server.c (main): Remove call to initialize_inferiors. - * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid, - ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid, - ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text, - internal_error, gdb_assert, gdb_assert_fail): Delete. - (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish, - buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to - common/buffer.h. - * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid, - ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid, - initialize_inferiors): Delete. - -2011-07-20 Pedro Alves <pedro@codesourcery.com> - - * tracepoint.c (tracepoint_look_up_symbols): Return upon the first - symbol error. - -2011-05-31 Pedro Alves <pedro@codesourcery.com> - - * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in - assertion. - * win32-i386-low.c (i386_dr_low_get_addr): Ditto. - -2011-05-26 Yao Qi <yao@codesourcery.com> - - * Makefile.in (thread-db.o): Track dependence to - common/gdb_thread_db.h. - * thread-db.c: include gdb_thread_db.h from right place. - -2011-05-16 Adrian Cornish <gnu@bluedreamer.com> - - * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass - __FILE__ and __LINE__ to internal_error. - -2011-05-13 Doug Evans <dje@google.com> - - * thread-db.c (try_thread_db_load_from_sdir): New function. - (try_thread_db_load_from_dir): New function. - (thread_db_load_search): Handle $sdir, ignore $pdir. - Remove trying of system directories if search of - libthread-db-search-path fails, that is now done via $sdir. - -2011-05-12 Kwok Cheung Yeung <kcy@codesourcery.com> - - * server.c (handle_query): Add EnableDisableTracepoints to the list - of supported features. - * tracepoint.c (clear_installed_tracepoints): Uninstall disabled - tracepoints. - (cmd_qtenable_disable): New. - (cmd_qtstart): Install tracepoints even if disabled. - (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on - receiving a QTEnable or QTDisable packet. - (gdb_collect): Skip data collection if fast tracepoint is disabled. - (ust_marker_to_static_tracepoint): Do not ignore disabled static - tracepoints. - (gdb_probe): Skip data collection if static tracepoint is disabled. - -2011-05-10 Doug Evans <dje@google.com> - - * thread-db.c (thread_db_handle_monitor_command): Handle elided path. - -2011-05-04 Doug Evans <dje@google.com> - - * linux-low.c (linux_join): Skip process lookup. - * spu-low.c (spu_join): Ditto. - * server.c (join_inferiors_callback): Delete. - (process_serial_event): For 'D' packet (detach) call join_inferior - directly. - -2011-05-04 Joseph Myers <joseph@codesourcery.com> - - * README: Don't mention xscale*-*-linux*. - * configure.srv (xscale*-*-linux*): Don't handle target. - -2011-04-27 Nathan Froyd <froydnj@codesourcery.com> - - * linux-x86-low.c (amd64_emit_const): Call memcpy instead of - casting pointers. - (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2): - (i386_emit_const, i386_emit_reg, i386_emit_int_call_1): - (i386_emit_void_call_2): Likewise. - -2011-04-26 Yao Qi <yao@codesourcery.com> - - * linux-low.c: Move common macros to linux-ptrace.h. - Include linux-ptrace.h. - * Makefile.in (linux_ptrace_h): New. - (linux-low.o): Depends on linux-ptrace.h. - -2011-04-24 Jan Kratochvil <jan.kratochvil@redhat.com> - - * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if - RUN_ONCE. Comment for the LISTEN_DESC delete_file_handler call. - (remote_prepare): New function with most of the TCP code from ... - (remote_open): ... here. Detect PORT here unconditionally. Move also - setting transport_is_reliable. - * server.c (run_once): New variable. - (gdbserver_usage): Document it. - (main): Set run_once for `--once'. Call remote_prepare. Exit after - the first run if RUN_ONCE. - * server.h (run_once, remote_prepare): New declarations. - -2011-04-19 Tom Tromey <tromey@redhat.com> - - * win32-low.c (handle_load_dll): Remove duplicate "the". - -2011-04-07 Pierre Muller <muller@ics.u-strasbg.fr> - - Remove support for old Cygwin 1.5 versions. - * win32-low.c (win32_create_inferior): Use new cygwin_path_list - function to avoid warning. - (win32_add_one_solib): Use cygwin_conv_path function to avoid - warning. - -2011-03-18 Pierre Muller <muller@ics.u-strasbg.fr> - - * gdbserver/server.h (Macro _): Define it if not available. - -2011-03-14 Michael Snyder <msnyder@vmware.com> - - * hostio.c (handle_close): Remove unnecessary null test. - -2011-03-10 Joel Brobecker <brobecker@adacore.com> - - * Makefile.in (maintainer-clean realclean distclean): Remove - "make ... subdir_do" command. - -2011-03-10 Michael Snyder <msnyder@vmware.com> - - * tracepoint.c (tracepoint_finish_step): Fix loop variable. - - * server.c (handle_v_run): Free alloced buffer on early return. - -2011-03-09 Yao Qi <yao@codesourcery.com> - - Revert: - 2011-03-04 Yao Qi <yao@codesourcery.com> - - * Makefile.in: Remove GNU make feature --directory. - - 2011-03-05 Yao Qi <yao@codesourcery.com> - - * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable. - (subdir_do): New make target. Copied from gdb/Makefile. - (maintainer-clean, realclean, distclean, clean): Call corresponding - make targets in common/Makefile. - - 2011-02-11 Yao Qi <yao@codesourcery.com> - - * configure.ac: Call AC_PROG_RANLIB. - * Makefile.in: Remove signals.o from OBS. Link libcommon.a. - * configure: Regenerate. - -2011-03-07 Jan Kratochvil <jan.kratochvil@redhat.com> - - * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically. - -2011-03-06 Yao Qi <yao@codesourcery.com> - - * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR). - -2011-03-05 Yao Qi <yao@codesourcery.com> - - * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable. - (subdir_do): New make target. Copied from gdb/Makefile. - (maintainer-clean, realclean, distclean, clean): Call corresponding - make targets in common/Makefile. - -2011-03-04 Yao Qi <yao@codesourcery.com> - - * Makefile.in: Remove GNU make feature --directory. - -2011-03-04 Michael Snyder <msnyder@vmware.com> - - * server.c (queue_stop_reply): Call xmalloc not malloc. - -2011-03-02 Michael Snyder <msnyder@vmware.com> - - * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc. - -2011-02-28 Michael Snyder <msnyder@vmware.com> - - * tracepoint.c (cmd_qtv): Discard unused value 'packet'. - (cmd_qtframe): Ditto. - (cmd_qtbuffer): Ditto. - (cmd_bigqtbuffer): Ditto. - - * utils.c (decimal2str): Initialize 'width' to nine, then - don't mess with it. - -2011-02-28 Ulrich Weigand <uweigand@de.ibm.com> - - * hostio.c (require_data): Free *data, not data. - -2011-02-28 Jan Kratochvil <jan.kratochvil@redhat.com> - - * hostio.c (require_data): Use free, not xfree. - -2011-02-27 Michael Snyder <msnyder@vmware.com> - - * server.c (handle_query): Discard unused value. - - * hostio.c (require_data): Free malloc memory before returning - error. - -2011-02-26 Michael Snyder <msnyder@vmware.com> - - * linux-low.c (list_threads): Call closedir for dirent. - -2011-02-27 Michael Snyder <msnyder@vmware.com> - - * i386-low.c (i386-length_and_rw_bits): Comment the fact that - a case statement falls through. - - * linux-low.c (linux_xfer_siginfo): Fix fencepost error. - - * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error - in comparison. - -2011-02-26 Michael Snyder <msnyder@vmware.com> - - * utils.c (decimal2str): Eliminate dead code and dead param. - (pulongest): Drop dead param from call to decimal2str. - (plongest): Ditto. - -2011-02-24 Joel Brobecker <brobecker@adacore.com> - - Revert the following patch (not approved yet): - 2011-02-21 Hui Zhu <teawater@gmail.com> - * tracepoint.c (tp_printf): New function. - (eval_agent_expr): Handle gdb_agent_op_printf. - -2011-02-21 Hui Zhu <teawater@gmail.com> - - * tracepoint.c (tp_printf): New function. - (eval_agent_expr): Handle gdb_agent_op_printf. - -2011-02-18 Tom Tromey <tromey@redhat.com> - - * Makefile.in (tracepoint-ipa.o): Depend on ax.def. - (tracepoint.o): Likewise. - * tracepoint.c (enum gdb_agent_op): Use ax.def. - (gdb_agent_op_names): Likewise. - -2011-02-18 Tom Tromey <tromey@redhat.com> - - * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick, - gdb_agent_op_rot>: New constants. - (gdb_agent_op_names): Add pick and roll. - (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New - cases. - -2011-02-15 Jan Kratochvil <jan.kratochvil@redhat.com> - - * aclocal.m4: Regenerated with aclocal-1.11.1. - -2011-02-14 Pedro Alves <pedro@codesourcery.com> - - * server.c (handle_qxfer_traceframe_info): New. - (qxfer_packets): Register "traceframe-info". - (handle_query): Report support for qXfer:traceframe-info:read+. - * tracepoint.c (match_blocktype): New. - (traceframe_find_block_type): Rename to ... - (traceframe_walk_blocks): ... this. Add callback filter argument, - and use it. - (traceframe_find_block_type): New, reimplemented on top of - traceframe_walk_blocks. - (build_traceframe_info_xml): New. - (traceframe_read_info): New. - * server.h (traceframe_read_info): Declare. - -2011-02-11 Yao Qi <yao@codesourcery.com> - - * configure.ac: Call AC_PROG_RANLIB. - * Makefile.in: Remove signals.o from OBS. Link libcommon.a. - * configure: Regenerate. - -2011-02-07 Pedro Alves <pedro@codesourcery.com> - - * server.c (gdb_read_memory): Change return semantics to allow - partial transfers. - (handle_search_memory_1): Adjust. - (process_serial_event) <'m' packet>: Handle partial transfers. - * tracepoint.c (traceframe_read_mem): Handle partial transfers. - -2011-01-28 Pedro Alves <pedro@codesourcery.com> - - * regcache.c (init_register_cache): Initialize - regcache->register_status. - (free_register_cache): Release regcache->register_status. - (regcache_cpy): Copy register_status. - (registers_to_string): Print 'x's for unavailable registers. - (supply_register): Mark the register's status valid or - unavailable, depending on whether a buffer was passed in or not. - (supply_register_zeroed): New. - (supply_regblock): Mark the registers' status valid or - unavailable, depending on whether a buffer was passed in or not. - * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines. - (struct regcache): New `register_status' field. - (supply_register_zeroed): Declare. - * i387-fp.c (i387_xsave_to_cache): Zero out registers using - supply_register_zeroed, rather than passing a NULL buffer to - supply_register. - * tracepoint.c (fetch_traceframe_registers): Update comment. - -2011-01-28 Pedro Alves <pedro@codesourcery.com> - - * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register - buffer explicit. - -2011-01-25 Pedro Alves <pedro@codesourcery.com> - - * server.h (decode_xfer_write): Change prototype. - * remote-utils.c (decode_xfer_write): Remove `annex' parameter, - and don't extract the annex here. - * server.c (decode_xfer_read): Remove `annex' parameter, - and don't extract the annex here. - (decode_xfer): New. - (struct qxfer): New. - (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries) - (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu) - (handle_qxfer_statictrace): New functions, abstracted out from - handle_query, and made to use the struct qxfer interface. - (handle_threads_qxfer_proper): Rename to ... - (handle_qxfer_threads_proper): ... this. - (handle_threads_qxfer): Rename to ... - (handle_qxfer_threads): ... this. Adjust. - (qxfer_packets): New array. - (handle_qxfer): New function. - (handle_query): Use handle_qxfer. - -2011-01-05 Michael Snyder <msnyder@msnyder-server.eng.vmware.com> - - * gdbreplay.c: Shorten lines of >= 80 columns. - * linux-low.c: Ditto. - * linux-ppc-low.c: Ditto. - * linux-s390-low.c: Ditto. - * linux-sparc-low.c: Ditto. - * linux-x86-low.c: Ditto. - * linux-xtensa-low.c: Ditto. - * mem-break.c: Ditto. - * nto-low.c: Ditto. - * regcache.h: Ditto. - * remote-utils.c: Ditto. - * server.c: Ditto. - * server.h: Ditto. - * thread-db.c: Ditto. - * tracepoint.c: Ditto. - * utils.c: Ditto. - * win32-low.h: Ditto. - -2011-01-05 Joel Brobecker <brobecker@adacore.com> - - * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year - update. - -2011-01-01 Joel Brobecker <brobecker@adacore.com> - - * server.c (gdbserver_version): Update copyright year in version - output. - * gdbreplay.c (gdbreplay_version): Ditto. - -2010-12-29 Jie Zhang <jie.zhang@analog.com> - - * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets. - * linux-bfin-low.c: New file. - * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and - PT_DATA_ADDR for BFIN targets. - * Makefile.in (SFILES): Add linux-bfin-low.c. - (clean): Remove reg-bfin.c. - (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets. - * README: Mention supported Blackfin targets. - -2010-12-23 Mike Frysinger <vapier@gentoo.org> - - * .gitignore: New file. - -2010-11-16 Mike Frysinger <vapier@gentoo.org> - - * linux-low.c (linux_tracefork_child): Add char* cast to arg. - -2010-10-22 Jie Zhang <jie@codesourcery.com> - - * Makefile.in: Add FLAGS_TO_PASS variable. - (install): Remove dependency of install-only and recursively - invoke make for install-only. - -2010-10-04 Doug Evans <dje@google.com> - - * Makefile.in (uninstall): Use $(DESTDIR). - -2010-09-24 Pedro Alves <pedro@codesourcery.com> - - PR gdb/11842 - - * linux-x86-low.c (compat_siginfo_from_siginfo) - (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when - si_code is < 0. Check for si_code == SI_TIMER before checking for - si_code < 0. - -2010-09-13 Joel Brobecker <brobecker@adacore.com> - - * lynx-i386-low.c: New file. - * configure.srv: Add handling of i[34567]86-*-lynxos* targets. - -2010-09-13 Joel Brobecker <brobecker@adacore.com> - - * lynx-low.c (ptrace_request_to_str): Remove handling for - request values that have been removed in LynxOS 5.x. - -2010-09-13 Joel Brobecker <brobecker@adacore.com> - - * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of - <ptrace.h> - -2010-09-09 Nathan Sidwell <nathan@codesourcery.com> - - * configure.ac: Add --enable-inprocess-agent option. - * configure: Rebuilt. - -2010-09-06 Yao Qi <yao@codesourcery.com> - - * linux-low.c (linux_kill): Remove unused variable. - (linux_stabilize_threads): Likewise. - * server.c (start_inferior): Likewise. - (queue_stop_reply_callback): Likewise. - * tracepoint.c (do_action_at_tracepoint): Likewise. - -2010-09-06 Yao Qi <yao@codesourcery.com> - - * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior - on return. - -2010-09-06 Jan Kratochvil <jan.kratochvil@redhat.com> - - * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER. - -2010-09-06 Pedro Alves <pedro@codesourcery.com> - - * Makefile.in (install-only): Replace $IPA_DEPFILES with - "$(IPA_DEPFILES)". - -2010-09-01 Joel Brobecker <brobecker@adacore.com> - - * gdbserver/lynx-low.c, gdbserver/lynx-low.h, - gdbserver/lynx-ppc-low.c: New files. - * Makefile.in (lynx_low_h): New variable. - (lynx-low.o, lynx-ppc-low.o): New rules. - * configure.ac: On LynxOS, link with -lnetinet. - * configure.srv: Add handling of powerpc-*-lynxos* targets. - * configure: regenerate. - -2010-09-01 Joel Brobecker <brobecker@adacore.com> - - * Makefile.in (vasprintf.o, vsnprintf.o): New rules. - * configure.ac: Add check for vasprintf and vsnprintf. - * configure, config.in: Regenerate. - * server.h (vasprintf, vsnprintf): Add conditional declarations. - -2010-09-01 Joel Brobecker <brobecker@adacore.com> - - * gdbreplay.c: Move include of alloca.h up, next to include of - malloc.h. - * server.h: Add include of malloc.h. - * mem-break.c: Remove include of malloc.h. - * server.c, tracepoint.c, utils.c, win32-low.c: Likewise. - -2010-09-01 Joel Brobecker <brobecker@adacore.com> - - * Makefile.in (memmem.o): Build with -Wno-error. - -2010-09-01 Joel Brobecker <brobecker@adacore.com> - - * utils.c (xsnprintf): Make non-static. - * server.h: Add xsnprintf declaration. - * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c: - replace calls to snprintf by calls to xsnprintf throughout. - -2010-09-01 Joel Brobecker <brobecker@adacore.com> - - * configure.ac: Add configure check for alloca. - * configure, config.in: Regenerate. - * server.h: Include alloca.h if it exists. - * gdbreplay.c: Include alloca.h if it exists. - -2010-08-28 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (__SIGRTMIN): Define if not already defined. - (linux_create_inferior): Check for __ANDROID__ rather than - __SIGRTMIN. - (enqueue_one_deferred_signal): Don't requeue non-RT signals that - are already deferred. - (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN. - (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is - stopped and already has a pending signal to report. - (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has - a pending signal to report or is moving out of a jump pad. - (linux_init_signals): Check for __ANDROID__ rather than - __SIGRTMIN. - -2010-08-28 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_stabilize_threads): Wrap debug output in a - debug_threads check. Avoid a linear search when not doing debug - output. - -2010-08-27 Pedro Alves <pedro@codesourcery.com> - - * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t. - (struct gdb_event) <fd>: Change type to gdb_fildes_t. - (struct file_handler) <fd>: Change type to gdb_fildes_t. - (process_event): Change local fd's type to gdb_fildes_t. - (create_file_handler): Adjust prototype. - (delete_file_handler): Adjust prototype. - (handle_file_event): Adjust prototype. Use pfildes. - (create_file_event): Adjsut prototype. - * remote-utils.c (remote_desc, listen_desc): Change type to - gdb_fildes_t. - * server.h: New gdb_fildes_t typedef. - [USE_WIN32API]: Include winsock2.h. - (delete_file_handler, add_file_handler): Adjust prototypes. - (pfildes): Declare. - * utils.c (pfildes): New. - -2010-08-27 Pedro Alves <pedro@codesourcery.com> - - * configure.ac (build_warnings): Add -Wno-char-subscripts. - * configure: Regenerate. - -2010-08-27 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_unprepare_to_access_memory): Rename to ... - (linux_done_accessing_memory): ... this. - (linux_target_ops): Adjust. - * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust. - * nto-low.c (nto_target_ops): Adjust comment. - * server.c (gdb_read_memory, gdb_write_memory): Adjust. - * spu-low.c (spu_target_ops): Adjust comment. - * target.h (target_ops): Rename unprepare_to_access_memory field - to done_accessing_memory. - (unprepare_to_access_memory): Rename to ... - (done_accessing_memory): ... this. - -2010-08-26 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_prepare_to_access_memory): New. - (linux_unprepare_to_access_memory): New. - (linux_target_ops): Install them. - * server.c (read_memory): Rename to ... - (gdb_read_memory): ... this. Use - prepare_to_access_memory/prepare_to_access_memory. - (write_memory): Rename to ... - (gdb_write_memory): ... this. Use - prepare_to_access_memory/prepare_to_access_memory. - (handle_search_memory_1): Adjust. - (process_serial_event): Adjust. - * target.h (struct target_ops): New fields - prepare_to_access_memory and unprepare_to_access_memory. - (prepare_to_access_memory, unprepare_to_access_memory): New. - * linux-x86-low.c (x86_insert_point, x86_remove_point): Use - prepare_to_access_memory/prepare_to_access_memory. - * nto-low.c (nto_target_ops): Adjust. - * spu-low.c (spu_target_ops): Adjust. - * win32-low.c (win32_target_ops): Adjust. - -2010-08-26 Pedro Alves <pedro@codesourcery.com> - - * Makefile.in (WARN_CFLAGS): Get it from configure. - (WERROR_CFLAGS): New. - (INTERNAL_CFLAGS): Add WERROR_CFLAGS. - * configure.ac: Introduce --enable-werror, which adds -Werror to - the compiler command line. Enabled by default. Disable with - --disable-werror. Add -Wdeclaration-after-statement - Wpointer-arith and -Wformat-nonliteral to warning flags. - * configure: Regenerate. - -2010-08-26 Pedro Alves <pedro@codesourcery.com> - - * mem-break.c [HAVE_MALLOC_H]: Include malloc.h. - -2010-08-26 Pedro Alves <pedro@codesourcery.com> - - * gdbreplay.c (remote_error): New. - (gdbchar): New. - (expect): Use gdbchar. Check for error reading from GDB. - Clarify sync error output. - (play): Check for errors writing to GDB. - * linux-low.c (sigchld_handler): Really ignore `write' errors. - * remote-utils.c (getpkt): Check for errors writing to the remote - descriptor. - -2010-08-25 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_wait_1): Move non-debugging code out of - `debug_threads' control. - -2010-08-25 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_wait_1): Don't set last_status here. - * server.c (push_event, queue_stop_reply_callback): Assert we're - not pushing a TARGET_WAITKIND_IGNORE event. - (start_inferior, start_inferior, attach_inferior, handle_v_cont) - (myresume, handle_target_event): Set the thread's last_resume_kind - and last_status from the target returned status. - -2010-08-25 Pedro Alves <pedro@codesourcery.com> - - PR threads/10729 - - * linux-x86-low.c (update_debug_registers_callback): New. - (i386_dr_low_set_addr): Use it. - (i386_dr_low_get_addr): New. - (i386_dr_low_set_control): Use update_debug_registers_callback. - (i386_dr_low_get_control): New. - (i386_dr_low_get_status): Adjust. - * linux-low.c (linux_stop_lwp): New. - * linux-low.h (linux_stop_lwp): Declare. - - * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as - argument instead of a i386_debug_reg_state. - (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of - a i386_debug_reg_state. - (i386_insert_aligned_watchpoint): Adjust. - (i386_remove_aligned_watchpoint): Adjust. - (i386_low_stopped_data_address): Read the debug registers from the - inferior instead of from the mirrors. - * i386-low.h (struct i386_debug_reg_state): Extend comment. - (i386_dr_low_get_addr): Declare. - (i386_dr_low_get_control): Declare. - (i386_dr_low_get_status): Change prototype. - - * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals. - (i386_dr_low_get_addr): New. - (i386_dr_low_get_control): New. - (i386_dr_low_get_status): Adjust prototype. Return - dr_status_mirror. - (i386_initial_stuff): Clear dr_status_mirror and - dr_control_mirror. - (i386_get_thread_context): Adjust. - (i386_set_thread_context): Adjust. - (i386_thread_added): Adjust. - -2010-08-24 Pedro Alves <pedro@codesourcery.com> - - * linux-low.h (linux_thread_area): Delete declaration. - -2010-08-11 Thomas Schwinge <thomas@codesourcery.com> - - * linux-low.c (linux_wait_1): Correctly return the ptid of the child - after its termination. - -2010-08-09 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (gdb_wants_lwp_stopped): Delete. - (gdb_wants_all_stopped): Delete. - (linux_wait_1): Don't call them. - * server.c (handle_v_cont): Tag all threads as want-stopped. - (gdb_wants_thread_stopped): Fix comments. Tag the thread that - stopped as "client-wants-stopped". - -2010-07-31 Pedro Alves <pedro@codesourcery.com> - - * Makefile.in (signals_h): New. - (server_h): Depend on it. - (server.o): Don't depend on $(signals_def). - (signals.o): Depend on $(signals_def). - -2010-07-31 Jan Kratochvil <jan.kratochvil@redhat.com> - - * Makefile.in (signals_def): New. - (server_h): Append include/gdb/signals.h and signals_def. - (server.o): Append signals_def. - -2010-07-25 Jan Kratochvil <jan.kratochvil@redhat.com> - - * server.c (handle_target_event): Use target_signal_to_host for - resume_info.sig initialization. - * target.h (struct thread_resume) <sig>: New comment. - -2010-07-20 Ozkan Sezer <sezeroz@gmail.com> - - * server.c (handle_query): strcpy() the returned string from paddress() - instead of sprintf(). - * utils.c (paddress): Return phex_nz(). - -2010-07-07 Joel Brobecker <brobecker@adacore.com> - - * server.c (handle_v_cont): Call mourn_inferior if process - just exited. - (myresume): Likewise. - -2010-07-01 Pedro Alves <pedro@codesourcery.com> - - Static tracepoints, and integration with UST. - - * configure.ac: Handle --with-ust. substitute ustlibs and ustinc. - * mem-break.c (uninsert_all_breakpoints) - (reinsert_all_breakpoints): New. - * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints): - * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New. - (gdb_agent_ust_loaded, helper_thread_id) - (gdb_agent_helper_thread_id): New macros. - (struct ipa_sym_addresses): Add addr_ust_loaded, - addr_helper_thread_id, addr_cmd_buf. - (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf. - (in_process_agent_loaded_ust): New. - (write_e_ust_not_loaded): New. - (maybe_write_ipa_ust_not_loaded): New. - (struct collect_static_trace_data_action): New. - (enum tracepoint_type) <static_tracepoint>: New. - (struct tracepoint) <handle>: Mention static tracepoints. - (struct static_tracepoint_ctx): New. - (CMD_BUF_SIZE): New. - (add_tracepoint_action): Handle static tracepoint actions. - (unprobe_marker_at): New. - (clear_installed_tracepoints): Handle static tracepoints. - (cmd_qtdp): Handle static tracepoints. - (probe_marker_at): New. - (cmd_qtstart): Handle static tracepoints. - (response_tracepoint): Handle static tracepoints. - (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New. - (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat. - (get_context_regcache): Handle static tracepoints. - (do_action_at_tracepoint): Handle static tracepoint actions. - (traceframe_find_block_type): Handle static trace data blocks. - (traceframe_read_sdata): New. - (download_tracepoints): Download static tracepoint actions. - [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h. - (GDB_PROBE_NAME): New. - (ust_ops): New. - (GET_UST_SYM): New. - (USTF): New. - (dlsym_ust): New. - (ust_marker_to_static_tracepoint): New. - (gdb_probe): New. - (collect_ust_data_at_tracepoint): New. - (gdb_ust_probe): New. - (UNIX_PATH_MAX, SOCK_DIR): New. - (gdb_ust_connect_sync_socket): New. - (resume_thread, stop_thread): New. - (run_inferior_command): New. - (init_named_socket): New. - (gdb_ust_socket_init): New. - (cstr_to_hexstr): New. - (next_st): New. - (first_marker, next_marker): New. - (response_ust_marker): New. - (cmd_qtfstm, cmd_qtsstm): New. - (unprobe_marker_at, probe_marker_at): New. - (cmd_qtstmat, gdb_ust_thread): New. - (gdb_ust_init): New. - (initialize_tracepoint_ftlib): Call gdb_ust_init. - * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h - (ST_REGENTRY): New. - (x86_64_st_collect_regmap): New. - (X86_64_NUM_ST_COLLECT_GREGS): New. - (AMD64_RIP_REGNUM): New. - (supply_static_tracepoint_registers): New. - * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h - (ST_REGENTRY): New. - (i386_st_collect_regmap): New. - (i386_NUM_ST_COLLECT_GREGS): New. - (supply_static_tracepoint_registers): New. - * server.c (handle_query): Handle qXfer:statictrace:read. - <qSupported>: Report support for StaticTracepoints, and - qXfer:statictrace:read features. - * server.h (traceframe_read_sdata) - (supply_static_tracepoint_registers): Declare. - * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex) - (unpack_varlen_hex): Include in IPA build. - * Makefile.in (ustlibs, ustinc): New. - (IPA_OBJS): Add remote-utils-ipa.o. - ($(IPA_LIB)): Link -ldl and -lpthread. - (UST_CFLAGS): New. - (IPAGENT_CFLAGS): Add UST_CFLAGS. - * config.in, configure: Regenerate. - -2010-06-20 Ian Lance Taylor <iant@google.com> - Pedro Alves <pedro@codesourcery.com> - - * linux-x86-low.c (always_true): Delete. - (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of - trying to fool the compiler with always_true. - -2010-06-20 Pedro Alves <pedro@codesourcery.com> - - * tracepoint.c (condition_true_at_tracepoint): Don't run compiled - conditions in gdbserver. - -2010-06-19 Ulrich Weigand <uweigand@de.ibm.com> - - * spu-low.c (spu_read_memory): Wrap around local store limit. - (spu_write_memory): Likewise. - -2010-06-15 Pedro Alves <pedro@codesourcery.com> - - * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2) - (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with - LONGEST uses. - * server.h (struct emit_ops): Replace int64_t uses with LONGEST - uses. - * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t - uses with LONGEST uses. - -2010-06-14 Stan Shebs <stan@codesourcery.com> - Pedro Alves <pedro@codesourcery.com> - - Bytecode compiler. - - * linux-x86-low.c: Include limits.h. - (add_insns): New. - (always_true): New. - (EMIT_ASM): New. - (EMIT_ASM32): New. - (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add) - (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh) - (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext, - (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or) - (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal, - (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref, - (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address) - (amd64_emit_const, amd64_emit_call, amd64_emit_reg) - (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext) - (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1) - (amd64_emit_void_call_2): New. - (amd64_emit_ops): New. - (i386_emit_prologue, i386_emit_epilogue, i386_emit_add) - (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed) - (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not) - (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor) - (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed) - (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto) - (i386_emit_goto, i386_write_goto_address, i386_emit_const) - (i386_emit_call, i386_emit_reg, i386_emit_pop) - (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap) - (i386_emit_stack_adjust, i386_emit_int_call_1) - (i386_emit_void_call_2): New. - (i386_emit_ops): New. - (x86_emit_ops): New. - (the_low_target): Install x86_emit_ops. - * server.h (struct emit_ops): New. - (get_raw_reg_func_addr): Declare. - (current_insn_ptr, emit_error): Declare. - * tracepoint.c (get_raw_reg, get_trace_state_variable_value) - (set_trace_state_variable_value): New defines. - (struct ipa_sym_addresses): New fields addr_get_raw_reg, - addr_get_trace_state_variable_value and - addr_set_trace_state_variable_value. - (symbol_list): New fields for get_raw_reg, - get_trace_state_variable_value and set_trace_state_variable_value. - (condfn): New typedef. - (struct tracepoint): New field `compiled_cond'. - (do_action_at_tracepoint): Clear compiled_cond. - (get_trace_state_variable_value, set_trace_state_variable_value): - Export in the IPA. - (condition_true_at_tracepoint): If there's a compiled condition, - run that. - (current_insn_ptr, emit_error): New globals. - (struct bytecode_address): New. - (get_raw_reg_func_addr): New. - (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul) - (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext) - (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor) - (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned) - (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const) - (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap) - (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New. - (compile_tracepoint_condition, compile_bytecodes): New. - * target.h (emit_ops): Forward declare. - (struct target_ops): New field emit_ops. - (target_emit_ops): New. - * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New. - * linux-i386-ipa.c (gdb_agent_get_raw_reg): New. - * linux-low.c (linux_emit_ops): New. - (linux_target_ops): Install it. - * linux-low.h (struct linux_target_ops): New field emit_ops. - -2010-06-14 Ulrich Weigand <uweigand@de.ibm.com> - - * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR. - * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW. - -2010-06-01 Pedro Alves <pedro@codesourcery.com> - Stan Shebs <stan@codesourcery.com> - - * Makefile.in (IPA_DEPFILES, extra_libraries): New. - (all): Depend on $(extra_libraries). - (install-only): Install the IPA. - (IPA_OBJS, IPA_LIB): New. - (clean): Remove the IPA lib. - (IPAGENT_CFLAGS): New. - (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o) - (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o) - (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules. - * linux-amd64-ipa.c, linux-i386-ipa.c: New files. - * configure.ac: Check for atomic builtins support in the compiler. - (IPA_DEPFILES, extra_libraries): Define. - * configure.srv (ipa_obj): Add description. - (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define. - (i[34567]86-*-linux*): Set ipa_obj. - (x86_64-*-linux*): Set ipa_obj. - * linux-low.c (stabilizing_threads): New. - (supports_fast_tracepoints): New. - (linux_detach): Stabilize threads before detaching. - (handle_tracepoints): Handle internal tracing breakpoints. Assert - the lwp is either not stabilizing, or is moving out of a jump pad. - (linux_fast_tracepoint_collecting): New. - (maybe_move_out_of_jump_pad): New. - (enqueue_one_deferred_signal): New. - (dequeue_one_deferred_signal): New. - (linux_wait_for_event_1): If moving out of a jump pad, defer - pending signals to later. - (linux_stabilize_threads): New. - (linux_wait_1): Check if threads need moving out of jump pads, and - do it if so. - (stuck_in_jump_pad_callback): New. - (move_out_of_jump_pad_callback): New. - (lwp_running): New. - (linux_resume_one_lwp): Handle moving out of jump pads. - (linux_set_resume_request): Dequeue deferred signals. - (need_step_over_p): Also step over fast tracepoint jumps. - (start_step_over): Also uninsert fast tracepoint jumps. - (finish_step_over): Also reinsert fast tracepoint jumps. - (linux_install_fast_tracepoint_jump): New. - (linux_target_ops): Install linux_stabilize_threads and - linux_install_fast_tracepoint_jump_pad. - * linux-low.h (linux_target_ops) <get_thread_area, - install_fast_tracepoint_jump_pad>: New fields. - (struct lwp_info) <collecting_fast_tracepoint, - pending_signals_to_report, exit_jump_pad_bkpt>: New fields. - (linux_get_thread_area): Declare. - * linux-x86-low.c (jump_insn): New. - (x86_get_thread_area): New. - (append_insns): New. - (push_opcode): New. - (amd64_install_fast_tracepoint_jump_pad): New. - (i386_install_fast_tracepoint_jump_pad): New. - (x86_install_fast_tracepoint_jump_pad): New. - (the_low_target): Install x86_get_thread_area and - x86_install_fast_tracepoint_jump_pad. - * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory. - (struct fast_tracepoint_jump): New. - (fast_tracepoint_jump_insn): New. - (fast_tracepoint_jump_shadow): New. - (find_fast_tracepoint_jump_at): New. - (fast_tracepoint_jump_here): New. - (delete_fast_tracepoint_jump): New. - (set_fast_tracepoint_jump): New. - (uninsert_fast_tracepoint_jumps_at): New. - (reinsert_fast_tracepoint_jumps_at): New. - (set_breakpoint_at): Use write_inferior_memory. - (uninsert_raw_breakpoint): Use write_inferior_memory. - (check_mem_read): Mask out fast tracepoint jumps. - (check_mem_write): Mask out fast tracepoint jumps. - * mem-break.h (struct fast_tracepoint_jump): Forward declare. - (set_fast_tracepoint_jump): Declare. - (delete_fast_tracepoint_jump) - (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at) - (reinsert_fast_tracepoint_jumps_at): Declare. - * regcache.c: Don't compile many functions when building the - in-process agent library. - (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating - the register buffer in the heap. - (free_register_cache): If the register buffer isn't owned by the - regcache, don't free it. - (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate - pre-existing register caches. - * remote-utils.c (convert_int_to_ascii): Constify `from' parameter - type. - (convert_ascii_to_int): : Constify `from' parameter type. - (decode_M_packet, decode_X_packet): Replace the `to' parameter by - a `to_p' pointer to pointer parameter. If TO_P is NULL, malloc - the needed buffer in-place. - (relocate_instruction): New. - * server.c (handle_query) <qSymbols>: If the target supports - tracepoints, give it a chance of looking up symbols. Report - support for fast tracepoints. - (handle_status): Stabilize threads. - (process_serial_event): Adjust. - * server.h (struct fast_tracepoint_jump): Forward declare. - (struct process_info) <fast_tracepoint_jumps>: New field. - (convert_ascii_to_int, convert_int_to_ascii): Adjust. - (decode_X_packet, decode_M_packet): Adjust. - (relocate_instruction): Declare. - (in_process_agent_loaded): Declare. - (tracepoint_look_up_symbols): Declare. - (struct fast_tpoint_collect_status): Declare. - (fast_tracepoint_collecting): Declare. - (force_unlock_trace_buffer): Declare. - (handle_tracepoint_bkpts): Declare. - (initialize_low_tracepoint) - (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare. - * target.h (struct target_ops) <stabilize_threads, - install_fast_tracepoint_jump_pad>: New fields. - (stabilize_threads, install_fast_tracepoint_jump_pad): New. - * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h. - [HAVE_STDINT_H]: Include stdint.h. - (trace_debug_1): Rename to ... - (trace_vdebug): ... this. - (trace_debug): Rename to ... - (trace_debug_1): ... this. Add `level' parameter. - (trace_debug): New. - (ATTR_USED, ATTR_NOINLINE): New. - (IP_AGENT_EXPORT): New. - (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end) - (collecting, gdb_collect, stop_tracing, flush_trace_buffer) - (about_to_request_buffer_space, trace_buffer_is_full) - (stopping_tracepoint, expr_eval_result, error_tracepoint) - (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr) - (trace_buffer_lo, trace_buffer_hi, traceframe_read_count) - (traceframe_write_count, traceframes_created) - (trace_state_variables) - New renaming defines. - (struct ipa_sym_addresses): New. - (STRINGIZE_1, STRINGIZE, IPA_SYM): New. - (symbol_list): New. - (ipa_sym_addrs): New. - (all_tracepoint_symbols_looked_up): New. - (in_process_agent_loaded): New. - (write_e_ipa_not_loaded): New. - (maybe_write_ipa_not_loaded): New. - (tracepoint_look_up_symbols): New. - (debug_threads) [IN_PROCESS_AGENT]: New. - (read_inferior_memory) [IN_PROCESS_AGENT]: New. - (UNKNOWN_SIDE_EFFECTS): New. - (stop_tracing): New. - (flush_trace_buffer): New. - (stop_tracing_bkpt): New. - (flush_trace_buffer_bkpt): New. - (read_inferior_integer): New. - (read_inferior_uinteger): New. - (read_inferior_data_pointer): New. - (write_inferior_data_pointer): New. - (write_inferior_integer): New. - (write_inferior_uinteger): New. - (struct collect_static_trace_data_action): Delete. - (enum tracepoint_type): New. - (struct tracepoint) <type>: New field `type'. - <actions_str, step_actions, step_actions_str>: Only include in GDBserver. - <orig_size, obj_addr_on_target, adjusted_insn_addr> - <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields. - (tracepoints): Use IP_AGENT_EXPORT. - (last_tracepoint): Don't include in the IPA. - (stopping_tracepoint): Use IP_AGENT_EXPORT. - (trace_buffer_is_full): Use IP_AGENT_EXPORT. - (alloced_trace_state_variables): New. - (trace_state_variables): Use IP_AGENT_EXPORT. - (traceframe_t): Delete unused variable. - (circular_trace_buffer): Don't include in the IPA. - (trace_buffer_start): Delete. - (struct trace_buffer_control): New. - (trace_buffer_free): Delete. - (struct ipa_trace_buffer_control): New. - (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV) - (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT): - New. - (trace_buffer_ctrl): New. - (TRACE_BUFFER_CTRL_CURR): New. - (trace_buffer_start, trace_buffer_free, trace_buffer_end_free): - Reimplement as macros. - (trace_buffer_wrap): Delete. - (traceframe_write_count, traceframe_read_count) - (traceframes_created, tracing): Use IP_AGENT_EXPORT. - (struct tracepoint_hit_ctx) <type>: New field. - (struct fast_tracepoint_ctx): New. - (memory_barrier): New. - (cmpxchg): New. - (record_tracepoint_error): Update atomically in the IPA. - (clear_inferior_trace_buffer): New. - (about_to_request_buffer_space): New. - (trace_buffer_alloc): Handle GDBserver and inferior simulatenous - updating the same buffer. - (add_tracepoint): Default the tracepoint's type to trap - tracepoint, and orig_size to -1. - (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated - internal variables. - (create_trace_state_variable): New parameter `gdb'. Handle it. - (clear_installed_tracepoints): Clear fast tracepoint jumps. - (cmd_qtdp): Handle fast tracepoints. - (cmd_qtdv): Adjust. - (max_jump_pad_size): New. - (gdb_jump_pad_head): New. - (get_jump_space_head): New. - (claim_jump_space): New. - (sort_tracepoints): New. - (MAX_JUMP_SIZE): New. - (cmd_qtstart): Handle fast tracepoints. Sync tracepoints with the - IPA. - (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected - support. Upload fast traceframes, and delete internal IPA - breakpoints. - (stop_tracing_handler): New. - (flush_trace_buffer_handler): New. - (cmd_qtstop): Upload fast tracepoints. - (response_tracepoint): Handle fast tracepoints. - (tracepoint_finished_step): Upload fast traceframes. Set the - tracepoint hit context's tracepoint type. - (handle_tracepoint_bkpts): New. - (tracepoint_was_hit): Set the tracepoint hit context's tracepoint - type. Add comment about fast tracepoints. - (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the - non-existing action_str field. - (get_context_regcache): Handle fast tracepoints. - (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC - to the regcache. - (fast_tracepoint_from_jump_pad_address): New. - (fast_tracepoint_from_ipa_tpoint_address): New. - (collecting_t): New. - (force_unlock_trace_buffer): New. - (fast_tracepoint_collecting): New. - (collecting): New. - (gdb_collect): New. - (write_inferior_data_ptr): New. - (target_tp_heap): New. - (target_malloc): New. - (download_agent_expr): New. - (UALIGN): New. - (download_tracepoints): New. - (download_trace_state_variables): New. - (upload_fast_traceframes): New. - (IPA_FIRST_TRACEFRAME): New. - (IPA_NEXT_TRACEFRAME_1): New. - (IPA_NEXT_TRACEFRAME): New. - [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h. - [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer) - (gdb_jump_pad_buffer_end): New. - [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New. - (initialize_tracepoint): Adjust. - [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch - buffer. Initialize the low module. - * utils.c (PREFIX, TOOLNAME): New. - (malloc_failure): Use PREFIX. - (error): In the IPA, an error causes an exit. - (fatal, warning): Use PREFIX. - (internal_error): Use TOOLNAME. - (NUMCELLS): Increase to 10. - * configure, config.in: Regenerate. - -2010-06-01 Pedro Alves <pedro@codesourcery.com> - - * server.c (handle_query) <qSupported>: Do two passes over the - qSupported string to avoid nesting strtok. - -2010-05-28 Jan Kratochvil <jan.kratochvil@redhat.com> - - * Makefile.in (SFILES): Add $(srcdir)/proc-service.list. - (CDEPS): New. - * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping. Test also - -Wl,--dynamic-list. - * configure: Regenerate. - * proc-service.list: New. - -2010-05-28 Jan Kratochvil <jan.kratochvil@redhat.com> - - * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT. - New comment. - -2010-05-26 Ozkan Sezer <sezeroz@gmail.com> - - * gdbreplay.c (remote_open): Check error return from socket() call by - its equality to -1 not by it being negative. - * remote-utils.c (remote_open): Likewise. - -2010-05-23 Pedro Alves <pedro@codesourcery.com> - - * config.h: Regenerate. - -2010-05-19 Maxim Kuvyrkov <maxim@codesourcery.com> - - * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel - doesn't provide PTRACE_GET_THREAD_AREA. - -2010-05-19 Maxim Kuvyrkov <maxim@codesourcery.com> - - * linux-m68k-low.c: Include <asm/ptrace.h> - (ps_get_thread_area): Implement. - -2010-05-03 Doug Evans <dje@google.com> - - * event-loop.c (struct callback_event): New struct. - (callback_list): New global. - (append_callback_event, delete_callback_event): New functions. - (process_callback): New function. - (start_event_loop): Call it. - * remote-utils.c (NOT_SCHEDULED): Define. - (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals, - moved out of readchar. - (readchar): Rewrite. Call reschedule before returning. - (reset_readchar): New function. - (remote_close): Call it. - (process_remaining, reschedule): New functions. - * server.h (callback_handler_func): New typedef. - (append_callback_event, delete_callback_event): Declare. - -2010-05-03 Pedro Alves <pedro@codesourcery.com> - - * proc-service.c (ps_pglobal_lookup): Use - thread_db_look_up_one_symbol. - * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb' - parameter. Use it instead of all_symbols_looked_up. - * server.h (struct process_info) <all_symbols_looked_up>: Delete - field. - (all_symbols_looked_up): Don't declare. - (look_up_one_symbol): Add new `may_ask_gdb' parameter. - * thread-db.c (struct thread_db) <all_symbols_looked_up>: New - field. - (thread_db_look_up_symbols): Adjust call to look_up_one_symbol. - Set all_symbols_looked_up here. - (thread_db_look_up_one_symbol): New. - (thread_db_get_tls_address): Adjust. - (thread_db_load_search, try_thread_db_load_1): Always allocate the - thread_db object on the heap, and tentatively set it in the - process structure. - (thread_db_init): Don't set all_symbols_looked_up here. - * linux-low.h (thread_db_look_up_one_symbol): Declare. - -2010-05-03 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_kill, linux_detach): Adjust. - (status_pending_p_callback): Remove redundant statement. Check - for !TARGET_WAITIKIND_IGNORE, instead of - TARGET_WAITKIND_STOPPED. - (handle_tracepoints): Make sure LWP is locked. Adjust. - (linux_wait_for_event_1): Adjust. - (linux_cancel_breakpoints): New. - (unsuspend_one_lwp): New. - (unsuspend_all_lwps): New. - (linux_wait_1): If finishing a step-over, unsuspend all lwps. - (send_sigstop_callback): Change return type to int, add new - `except' parameter and handle it. - (suspend_and_send_sigstop_callback): New. - (stop_all_lwps): Add new `suspend' and `expect' parameters, and - pass them down. If SUSPEND, also increment the lwp's suspend - count. - (linux_resume_one_lwp): Add notice about resuming a suspended LWP. - (need_step_over_p): Don't consider suspended LWPs. - (start_step_over): Adjust. - (proceed_one_lwp): Change return type to int, add new `except' - parameter and handle it. - (unsuspend_and_proceed_one_lwp): New. - (proceed_all_lwps): Use find_inferior instead of - for_each_inferior. - (unstop_all_lwps): Add `unsuspend' parameter. If UNSUSPEND, them - also decrement the suspend count of LWPs. Pass `except' down, - instead of hacking its suspend count. - (linux_pause_all): Add `freeze' parameter. Adjust. - (linux_unpause_all): New. - (linux_target_ops): Install linux_unpause_all. - * server.c (handle_status): Adjust. - * target.h (struct target_ops): New fields `unpause_all' and - `cancel_breakpoints'. Add new parameter to `pause_all'. - (pause_all): Add new `freeze' parameter. - (unpause_all): New. - (cancel_breakpoints): New. - * tracepoint.c (clear_installed_tracepoints): Pause threads, and - cancel breakpoints. - (cmd_qtstart): Pause threads. - (stop_tracing): Pause threads, and cancel breakpoints. - * win32-low.c (win32_target_ops): Adjust. - -2010-05-03 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_wait_for_event_1): Move passing the signal to - the inferior right away from here... - (linux_wait_1): ... to here, and adjust to check the thread's - last_resume_kind instead of the lwp's step or stop_expected flags. - -2010-05-02 Pedro Alves <pedro@codesourcery.com> - - * README: Use consistent `GDB' and `GDBserver' spellings. - -2010-05-02 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped. - (linux_kill): Stop all lwps here. Don't delete the main lwp here. - (linux_detach_one_lwp): Assume the lwp is stopped. - (any_thread_of): Delete. - (linux_detach): Stop all lwps here. Don't blindly delete all - breakpoints. - (delete_lwp_callback): New. - (linux_mourn): Delete all lwps of the process that is gone. - (linux_wait_1): Don't delete the last lwp of the process here. - * mem-break.h (mark_breakpoints_out): Declare. - * mem-break.c (mark_breakpoints_out): New. - (free_all_breakpoints): Use it. - * server.c (handle_target_event): If the process is gone, mark - breakpoints out. - * thread-db.c (struct thread_db) <create_bp>: New field. - (thread_db_enable_reporting): Fix prototype. Store a thread event - breakpoint reference in the thread_db struct. - (thread_db_load_search): Clear the thread_db object. - (try_thread_db_load_1): Ditto. - (switch_to_process): New. - (disable_thread_event_reporting): Use it. - (remove_thread_event_breakpoints): New. - (thread_db_detach, thread_db_mourn): Use it. - -2010-05-01 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_enable_event_reporting): New. - (linux_wait_for_event_1, handle_extended_wait): Use it. - -2010-04-30 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_kill_one_lwp, linux_kill) - (linux_detach_one_lwp): Adjust to send_sigstop interface change. - (send_sigstop): Take an lwp_info as parameter instead. Queue a - SIGSTOP even if the LWP is stopped. - (send_sigstop_callback): New. - (stop_all_lwps): Use send_sigstop_callback instead. - (linux_resume_one_thread): Adjust. - (proceed_one_lwp): Still proceed an LWP that the client has - requested to stop, if we haven't reported it as stopped yet. Make - sure that LWPs the client want stopped, have a pending SIGSTOP. - -2010-04-26 Doug Evans <dje@google.com> - - * server.c (handle_general_set): Make static. - - * remote-utils.c (putpkt_binary_1): Call readchar instead of read. - Print received char after testing for error/eof instead of before. - (input_interrupt): Tweak comment. - -2010-04-23 Doug Evans <dje@google.com> - - * server.c (start_inferior): Print inferior argv if --debug. - -2010-04-21 Aleksandar Ristovski <aristovski@qnx.com> - - * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists. - * nto-x86-low.c: Include server.h - -2010-04-20 Pierre Muller <muller@ics.u-strasbg.fr> - - * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to - be consistent with other sources of this directory. - (init_registers_amd64): Correct name of source file of this function - in the comment. - -2010-04-19 Pierre Muller <muller@ics.u-strasbg.fr> - - * configure.srv (x86_64-*-mingw*): New configuration for Windows - 64-bit executables. - -2010-04-19 Pierre Muller <muller@ics.u-strasbg.fr> - - * win32-i386-low.c: Add 64-bit support. - (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting. - (init_registers_amd64): Declare. - (mappings): Add 64-bit version of array. - (init_windows_x86): New function. - (the_low_target): Change init_arch field to init_windows_x86. - -2010-04-19 Pierre Muller <muller@ics.u-strasbg.fr> - - * win32-low.c: Adapt to support also 64-bit architecture. - (child_xfer_memory): Use uintptr_t type for local variable `addr'. - (get_image_name): Use SIZE_T type for local variable `done'. - (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'. - (toolhelp_get_dll_name): Idem. - (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'. - Use uintptr_t typecast to avoid warning. - (handle_unload_dll): Use uintptr_t typecast to avoid warning. - (handle_exception): Use phex_nz to avoid warning. - (win32_wait): Remove unused local variable `process'. - -2010-04-19 Pierre Muller <muller@ics.u-strasbg.fr> - - * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by - `amd64-avx.o'. - -2010-04-17 Pierre Muller <muller@ics.u-strasbg.fr> - - * configure.ac: Use `ws2_32' library for srv_mingw. - * configure: Regenerate. - * gdbreplay.c: Include winsock2.h instead of winsock.h. - * remote-utils.c: Likewise. - -2010-04-17 H.J. Lu <hongjiu.lu@intel.com> - - * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only - if __x86_64__ is defined. - -2010-04-16 Pierre Muller <muller@ics.u-strasbg.fr> - - * configure: Regenerate. - -2010-04-16 Pierre Muller <muller@ics.u-strasbg.fr> - - * server.c (handle_query): Handle 'qGetTIBAddr' query. - * target.h (target_ops): New get_tib_address field. - * win32-low.h (win32_thread_info): Add thread_local_base field. - * win32-low.c (child_add_thread): Add tlb argument. - Set thread_local_base field to TLB. - (get_child_debug_event): Adapt to child_add_thread change. - (win32_get_tib_address): New function. - (win32_target_ops): Set get_tib_address field to - win32_get_tib_address. - * linux-low.c (linux_target_ops): Set get_tib_address field to NULL. - -2010-04-12 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_mourn): Also remove the process. - * server.c (handle_target_event): Don't remove the process here. - * nto-low.c (nto_mourn): New. - (nto_target_ops): Install it. - * spu-low.c (spu_mourn): New. - (spu_target_ops): Install it. - * win32-low.c (win32_mourn): New. - (win32_target_ops): Install it. - -2010-04-12 Pedro Alves <pedro@codesourcery.com> - - * server.h (buffer_xml_printf): Remove redundant `;'. - -2010-04-12 Pedro Alves <pedro@codesourcery.com> - - * regcache.c (set_register_cache): Invalidate regcaches before - changing the register cache layout. - (regcache_invalidate_one): Allow a NULL regcache. - * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate - regcaches before changing the register cache layout or the target - regsets. - -2010-04-12 H.J. Lu <hongjiu.lu@intel.com> - - * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused - variable warning on Linux/x86-64. - -2010-04-11 Pedro Alves <pedro@codesourcery.com> - - GDBserver disconnected tracing support. - - * linux-low.c (linux_remove_process): Delete. - (add_lwp): Don't set last_resume_kind here. - (linux_kill): Use `mourn'. - (linux_detach): Use `thread_db_detach', and `mourn'. - (linux_mourn): New. - (linux_attach_lwp_1): Adjust comment. - (linux_attach): last_resume_kind moved the thread_info; adjust. - (status_pending_p_callback): Adjust. - (linux_wait_for_event_1): Adjust. - (count_events_callback, select_singlestep_lwp_callback) - (select_event_lwp_callback, cancel_breakpoints_callback) - (db_wants_lwp_stopped, linux_wait_1, need_step_over_p) - (proceed_one_lwp): Adjust. - (linux_async): Add debug output. - (linux_thread_stopped): New. - (linux_pause_all): New. - (linux_target_ops): Install linux_mourn, linux_thread_stopped and - linux_pause_all. - * linux-low.h (struct lwp_info): Delete last_resume_kind field. - (thread_db_free): Delete declaration. - (thread_db_detach, thread_db_mourn): Declare. - * thread-db.c (thread_db_init): Use thread_db_mourn. - (thread_db_free): Delete, split in two. - (disable_thread_event_reporting): New. - (thread_db_detach): New. - (thread_db_mourn): New. - - * server.h (struct thread_info) <last_resume_kind>: New field. - <attached>: Add comment. - <gdb_detached>: New field. - (handler_func): Change return type to int. - (handle_serial_event, handle_target_event): Ditto. - (gdb_connected): Declare. - (tracing): Delete. - (disconnected_tracing): Declare. - (stop_tracing): Declare. - - * server.c (handle_query) <qSupported>: Report support for - disconnected tracing. - (queue_stop_reply_callback): Account for running threads. - (gdb_wants_thread_stopped): New. - (gdb_wants_all_threads_stopped): New. - (gdb_reattached_process): New. - (handle_status): Clear the `gdb_detached' flag of all processes. - In all-stop, stop all threads. - (main): Be sure to leave tfind mode. Handle disconnected tracing. - (process_serial_event): If the remote connection breaks, or if an - exit was forced with "monitor exit", force an event loop exit. - Handle disconnected tracing on detach. - (handle_serial_event): Adjust. - (handle_target_event): If GDB isn't connected, forward events back - to the inferior, unless the last process exited, in which case, - exit gdbserver. Adjust interface. - - * remote-utils.c (remote_open): Don't block in accept. Instead - register an event loop source on the listen socket file - descriptor. Refactor bits into ... - (listen_desc): ... this new global. - (gdb_connected): ... this new function. - (enable_async_notification): ... this new function. - (handle_accept_event): ... this new function. - (remote_close): Clear remote_desc. - - * inferiors.c (add_thread): Set the new thread's last_resume_kind. - - * target.h (struct target_ops) <mourn, thread_stopped, pause_all>: - New fields. - (mourn_inferior): Define. - (target_process_qsupported): Avoid the dangling else problem. - (thread_stopped): Define. - (pause_all): Define. - (target_waitstatus_to_string): Declare. - * target.c (target_waitstatus_to_string): New. - - * tracepoint.c (tracing): Make extern. - (disconnected_tracing): New. - (stop_tracing): Make extern. Handle tracing stops due to GDB - disconnecting. - (cmd_qtdisconnected): New. - (cmd_qtstatus): Report disconnected tracing status in trace reply. - (handle_tracepoint_general_set): Handle QTDisconnected. - - * event-loop.c (event_handler_func): Change return type to int. - (process_event): Bail out if the event handler wants the event - loop to stop. - (handle_file_event): Ditto. - (start_event_loop): Bail out if the event handler wants the event - loop to stop. - - * nto-low.c (nto_target_ops): Adjust. - * spu-low.c (spu_wait): Don't remove the process here. - (spu_target_ops): Adjust. - * win32-low.c (win32_wait): Don't remove the process here. - (win32_target_ops): Adjust. - -2010-04-11 Pedro Alves <pedro@codesourcery.com> - - * regcache.c (realloc_register_cache): Invalidate inferior's - regcache before recreating it. - -2010-04-09 Pedro Alves <pedro@codesourcery.com> - - * tracepoint.c (cmd_qtstatus): Report trace buffer circularity. - -2010-04-09 Stan Shebs <stan@codesourcery.com> - Pedro Alves <pedro@codesourcery.com> - - * server.h (LONGEST): New. - (struct thread_info) <while_stepping>: New field. - (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz): - Declare. - (initialize_tracepoint, handle_tracepoint_general_set) - (handle_tracepoint_query, tracepoint_finished_step) - (tracepoint_was_hit, release_while_stepping_state_list): - (current_traceframe): Declare. - * server.c (handle_general_set): Handle tracepoint packets. - (read_memory): New. - (write_memory): New. - (handle_search_memory_1): Use read_memory. - (handle_query): Report support for conditional tracepoints, trace - state variables, and tracepoint sources. Handle tracepoint - queries. - (main): Initialize the tracepoints module. - (process_serial_event): Handle traceframe reads/writes. - - * linux-low.c (handle_tracepoints): New. - (linux_wait_1): Call it. - (linux_resume_one_lwp): Handle while-stepping. - (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New. - (linux_target_ops): Install them. - * linux-low.h (struct linux_target_ops) <supports_tracepoints>: - New field. - * linux-x86-low.c (x86_supports_tracepoints): New. - (the_low_target). Install it. - - * mem-break.h (delete_breakpoint): Declare. - * mem-break.c (delete_breakpoint): Make external. - - * target.h (struct target_ops): Add `supports_tracepoints', - `read_pc', and `write_pc' fields. - (target_supports_tracepoints): Define. - * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two) - (phex_nz): New. - - * regcache.h (struct regcache) <registers_owned>: New field. - (init_register_cache, regcache_cpy): Declare. - (regcache_read_pc, regcache_write_pc): Declare. - (register_cache_size): Declare. - (supply_regblock): Declare. - * regcache.c (init_register_cache): New. - (new_register_cache): Use it. - (regcache_cpy): New. - (register_cache_size): New. - (supply_regblock): New. - (regcache_read_pc, regcache_write_pc): New. - - * tracepoint.c: New. - - * Makefile.in (OBS): Add tracepoint.o. - (tracepoint.o): New rule. - -2010-04-08 H.J. Lu <hongjiu.lu@intel.com> - - * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c. - (i386-mmx.o): New. - (i386-mmx.c): Likewise. - (i386-mmx-linux.o): Likewise. - (i386-mmx-linux.c): Likewise. - - * configure.srv (srv_i386_regobj): Add i386-mmx.o. - (srv_i386_linux_regobj): Add i386-mmx-linux.o. - (srv_i386_xmlfiles): Add i386/i386-mmx.xml. - (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml. - - * linux-x86-low.c (init_registers_i386_mmx_linux): New. - (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux - and return if ptrace PTRACE_GETFPXREGS failed in 32bit. - -2010-04-07 H.J. Lu <hongjiu.lu@intel.com> - - * Makefile.in (clean): Updated. - (i386-avx.o): New. - (i386-avx.c): Likewise. - (i386-avx-linux.o): Likewise. - (i386-avx-linux.c): Likewise. - (amd64-avx.o): Likewise. - (amd64-avx.c): Likewise. - (amd64-avx-linux.o): Likewise. - (amd64-avx-linux.c): Likewise. - - * configure.srv (srv_i386_regobj): Add i386-avx.o. - (srv_i386_linux_regobj): Add i386-avx-linux.o. - (srv_amd64_regobj): Add amd64-avx.o. - (srv_amd64_linux_regobj): Add amd64-avx-linux.o. - (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml. - (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml. - (srv_i386_xmlfiles): Add i386/i386-avx.xml. - (srv_amd64_xmlfiles): Add i386/amd64-avx.xml. - (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml. - (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml. - - * i387-fp.c: Include "i386-xstate.h". - (i387_xsave): New. - (i387_cache_to_xsave): Likewise. - (i387_xsave_to_cache): Likewise. - (x86_xcr0): Likewise. - - * i387-fp.h (i387_cache_to_xsave): Likewise. - (i387_xsave_to_cache): Likewise. - (x86_xcr0): Likewise. - - * linux-arm-low.c (target_regsets): Initialize nt_type to 0. - * linux-crisv32-low.c (target_regsets): Likewise. - * linux-m68k-low.c (target_regsets): Likewise. - * linux-mips-low.c (target_regsets): Likewise. - * linux-ppc-low.c (target_regsets): Likewise. - * linux-s390-low.c (target_regsets): Likewise. - * linux-sh-low.c (target_regsets): Likewise. - * linux-sparc-low.c (target_regsets): Likewise. - * linux-xtensa-low.c (target_regsets): Likewise. - - * linux-low.c: Include <sys/uio.h>. - (regsets_fetch_inferior_registers): Support nt_type. - (regsets_store_inferior_registers): Likewise. - (linux_process_qsupported): New. - (linux_target_ops): Add linux_process_qsupported. - - * linux-low.h (regset_info): Add nt_type. - (linux_target_ops): Add process_qsupported. - - * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h" - and <sys/uio.h>. - (init_registers_i386_avx_linux): New. - (init_registers_amd64_avx_linux): Likewise. - (xmltarget_i386_linux_no_xml): Likewise. - (xmltarget_amd64_linux_no_xml): Likewise. - (PTRACE_GETREGSET): Likewise. - (PTRACE_SETREGSET): Likewise. - (x86_fill_xstateregset): Likewise. - (x86_store_xstateregset): Likewise. - (use_xml): Likewise. - (x86_linux_update_xmltarget): Likewise. - (x86_linux_process_qsupported): Likewise. - (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type. - (x86_arch_setup): Don't call init_registers_amd64_linux nor - init_registers_i386_linux here. Call - x86_linux_update_xmltarget. - (the_low_target): Add x86_linux_process_qsupported. - - * server.c (handle_query): Call target_process_qsupported. - - * target.h (target_ops): Add process_qsupported. - (target_process_qsupported): New. - -2010-04-03 Pedro Alves <pedro@codesourcery.com> - - * inferiors.c (add_thread): Set last_status kind to - TARGET_WAITKIND_IGNORE. - * linux-low.c (cancel_breakpoint): Remove unnecessary regcache - fetch. Use ptid_of. Avoid unnecessary get_lwp_thread calls. - (linux_wait_1): Move `thread' local definition to block that uses - it. Don't NULL initialize `event_child'. - (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls. - Alway set the thread's last_status to TARGET_WAITKIND_IGNORE. - * linux-x86-low.c (x86_breakpoint_at): Read raw memory. - -2010-04-01 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with - an extended waitstatus, or by a watchpoint. - (cancel_breakpoints_callback): Don't cancel a breakpoint if the - thread was stepping or has been stopped by a watchpoint. - -2010-04-01 Pedro Alves <pedro@codesourcery.com> - - * mem-break.c (struct raw_breakpoint): New field shlib_disabled. - (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top - of another, then delete the previous, and validate all - breakpoints. - (validate_inserted_breakpoint): New. - (delete_disabled_breakpoints): New. - (validate_breakpoints): New. - (check_mem_read): Validate breakpoints before trusting their - shadow. Delete disabled breakpoints. - (check_mem_write): Validate breakpoints before trusting they - should be inserted. Delete disabled breakpoints. - * mem-break.h (validate_breakpoints): - * server.c (handle_query): Validate breakpoints when we see a - qSymbol query. - -2010-04-01 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_wait_1): Avoid setting need_step_over is - there's a GDB breakpoint at stop_pc. Always report a trap to GDB - if we could tell there's a GDB breakpoint at stop_pc. - (need_step_over_p): Don't do a step over if we find a GDB - breakpoint at the resume PC. - - * mem-break.c (struct raw_breakpoint): New. - (enum bkpt_type): New type `gdb_breakpoint'. - (struct breakpoint): Delete the `PC', `old_data' and `inserted' - fields. New field `raw'. - (find_raw_breakpoint_at): New. - (set_raw_breakpoint_at): Handle refcounting. Create a raw - breakpoint instead. - (set_breakpoint_at): Adjust. - (delete_raw_breakpoint): New. - (release_breakpoint): New. - (delete_breakpoint): Rename to... - (delete_breakpoint_1): ... this. Add proc parameter. Use - release_breakpoint. Return ENOENT. - (delete_breakpoint): Reimplement. - (find_breakpoint_at): Delete. - (find_gdb_breakpoint_at): New. - (delete_breakpoint_at): Delete. - (set_gdb_breakpoint_at): New. - (delete_gdb_breakpoint_at): New. - (gdb_breakpoint_here): New. - (set_reinsert_breakpoint): Use release_breakpoint. - (uninsert_breakpoint): Rename to ... - (uninsert_raw_breakpoint): ... this. - (uninsert_breakpoints_at): Adjust to handle raw breakpoints. - (reinsert_raw_breakpoint): Change parameter type to - raw_breakpoint. - (reinsert_breakpoints_at): Adjust to handle raw breakpoints - instead. - (check_breakpoints): Adjust. Use release_breakpoint. - (breakpoint_here): Rewrite using find_raw_breakpoint_at. - (breakpoint_inserted_here): Ditto. - (check_mem_read): Adjust to iterate over raw breakpoints instead. - Don't trust the breakpoint's shadow if it is not inserted. - (check_mem_write): Adjust to iterate over raw breakpoints instead. - (delete_all_breakpoints): Adjust. - (free_all_breakpoints): Mark all breakpoints as uninserted, and - use delete_breakpoint_1. - - * mem-break.h (breakpoints_supported): Delete declaration. - (set_gdb_breakpoint_at): Declare. - (gdb_breakpoint_here): Declare. - (delete_breakpoint_at): Delete. - (delete_gdb_breakpoint_at): Declare. - - * server.h (struct raw_breakpoint): Forward declare. - (struct process_info): New field `raw_breakpoints'. - - * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0 - breakpoints. - -2010-03-24 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (status_pending_p_callback): Fix comment. - (linux_wait_for_event_1): Move most of the internal breakpoint - handling from here... - (linux_wait_1): ... to here. - (count_events_callback): New. - (select_singlestep_lwp_callback): New. - (select_event_lwp_callback): New. - (cancel_breakpoints_callback): New. - (select_event_lwp): New. - (linux_wait_1): Simplify internal breakpoint handling. Give equal - priority to all LWPs that have had events that should be reported - to the client. Cancel breakpoints when about to reporting the - event to the client, not while stopping lwps. No longer cancel - finished single-steps here. - (cancel_finished_single_step): Delete. - (cancel_finished_single_steps): Delete. - -2010-03-24 Pedro Alves <pedro@codesourcery.com> - - * mem-break.c (enum bkpt_type): New. - (struct breakpoint): New field `type'. - (set_breakpoint_at): Change return type to struct breakpoint - pointer. Set type to `other_breakpoint' by default. - (delete_breakpoint): Rewrite, supporting more than one breakpoint - in the breakpoint list. - (delete_reinsert_breakpoints): Only delete reinsert breakpoints. - (reinsert_breakpoint): Rename to ... - (reinsert_raw_breakpoint): ... this. - (reinsert_breakpoints_at): Adjust. - * mem-break.h (struct breakpoint): Declare. - (set_breakpoint_at): Change return type to struct breakpoint - pointer. - -2010-03-24 Pedro Alves <pedro@codesourcery.com> - - * server.c (handle_query): Assign, not compare. - -2010-03-24 Pedro Alves <pedro@codesourcery.com> - - Teach linux gdbserver to step-over-breakpoints. - - * linux-low.c (can_hardware_single_step): New. - (supports_breakpoints): New. - (handle_extended_wait): If stopping threads, read the stop pc of - the new cloned LWP. - (get_pc): New. - (get_stop_pc): Add `lwp' parameter. Handle it. Bail out if the - low target doesn't support retrieving the PC. - (add_lwp): Set last_resume_kind to resume_continue. - (linux_attach_lwp_1): Adjust comments. Always set stop_expected. - (linux_attach): Don't clear stop_expected. Set the lwp's - last_resume_kind to resume_stop. - (linux_detach_one_lwp): Don't check for removed breakpoints. - (check_removed_breakpoint): Delete. - (status_pending_p): Rename to ... - (status_pending_p_callback): ... this. Don't check for removed - breakpoints. Don't consider threads that are stopped from GDB's - perspective. - (linux_wait_for_lwp): Always read the stop_pc here. - (cancel_breakpoint): New. - (step_over_bkpt): New global. - (linux_wait_for_event_1): Implement stepping over breakpoints. - (gdb_wants_lwp_stopped): New. - (gdb_wants_all_stopped): New. - (linux_wait_1): Tag threads as gdb-wants-stopped. Cancel finished - single-step traps here. Store the thread's last reported target - wait status. - (send_sigstop): Don't clear stop_expected. Always set it, - instead. - (mark_lwp_dead): Remove reference to pending_is_breakpoint. - (cancel_finished_single_step): New. - (cancel_finished_single_steps): New. - (wait_for_sigstop): Don't cancel finished single-step traps here. - (linux_resume_one_lwp): Don't check for removed breakpoints. - Don't set `step' on non-hardware step archs. - (linux_set_resume_request): Ignore resume_stop requests if already - stopping or stopped. Set the lwp's last_resume_kind. - (resume_status_pending_p): Don't check for removed breakpoints. - (need_step_over_p): New. - (start_step_over): New. - (finish_step_over): New. - (linux_resume_one_thread): Always queue a sigstop for resume_stop - requests. Clear the thread's last reported target waitstatus. - Don't use the `suspended' flag. Don't consider pending breakpoints. - (linux_resume): Start a step-over if necessary. - (proceed_one_lwp): New. - (proceed_all_lwps): New. - (unstop_all_lwps): New. - * linux-low.h (struct lwp_info): Rewrite comment for the - `suspended' flag. Add the `stop_pc' field. Delete the - `pending_stop_pc' field. Tweak the `stepping' flag's comment. - Add `'last_resume_kind' and `need_step_over' fields. - * inferiors.c (struct thread_info): Delete, moved elsewhere. - * mem-break.c (struct breakpoint): Delete `reinserting' flag. - Delete `breakpoint_to_reinsert' field. New flag `inserted'. - (set_raw_breakpoint_at): New. - (set_breakpoint_at): Rewrite to use it. - (reinsert_breakpoint_handler): Delete. - (set_reinsert_breakpoint): New. - (reinsert_breakpoint_by_bp): Delete. - (delete_reinsert_breakpoints): New. - (uninsert_breakpoint): Rewrite. - (uninsert_breakpoints_at): New. - (reinsert_breakpoint): Rewrite. - (reinsert_breakpoints_at): New. - (check_breakpoints): Rewrite. - (breakpoint_here): New. - (breakpoint_inserted_here): New. - (check_mem_read): Adjust. - * mem-break.h (breakpoints_supported, breakpoint_here) - (breakpoint_inserted_here, set_reinsert_breakpoint): Declare. - (reinsert_breakpoint_by_bp): Delete declaration. - (delete_reinsert_breakpoints): Declare. - (reinsert_breakpoint): Delete declaration. - (reinsert_breakpoints_at): Declare. - (uninsert_breakpoint): Delete declaration. - (uninsert_breakpoints_at): Declare. - (check_breakpoints): Adjust prototype. - * server.h: Adjust include order. - (struct thread_info): Declare here. Add a `last_status' field. - -2010-03-23 Michael Snyder <msnyder@vmware.com> - - * server.c (crc32): New function. - (handle_query): Add handling for 'qCRC:' request. - -2010-03-23 Pedro Alves <pedro@codesourcery.com> - - * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the - lwp had been stopped by a watchpoint. - -2010-03-16 Pedro Alves <pedro@codesourcery.com> - - * server.h (internal_error): Declare. - (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define. - * utils.c (internal_error): New function. - -2010-03-15 Andreas Schwab <schwab@redhat.com> - - * configure.srv: Fix typo setting srv_regobj. - -2010-03-15 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (fetch_register): Avoid passing a non string literal - format to `error'. - (usr_store_inferior_registers): Ditto. - -2010-03-14 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_write_memory): Bail out early if peeking - memory failed. - -2010-03-14 Pedro Alves <pedro@codesourcery.com> - - * linux-low.h (struct lwp_info): New fields - `stopped_by_watchpoint' and `stopped_data_address'. - * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers - here, and cache them in the lwp object. - (wait_for_sigstop): Check stopped_by_watchpoint lwp field - directly. - (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint - field. - (linux_stopped_by_watchpoint): Rewrite. - (linux_stopped_data_address): Rewrite. - -2010-03-06 Simo Melenius <simo.melenius@iki.fi> - - * linux-low.c (linux_wait_for_lwp): Fetch the regcache after - switching the current inferior, not before. - -2010-03-01 H.J. Lu <hongjiu.lu@intel.com> - - * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c, - reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c, - i386-linux.c and amd64-linux.c. - (reg-i386.o): Removed. - (reg-i386.c): Likewise. - (reg-i386-linux.o): Likewise. - (reg-i386-linux.c): Likewise. - (reg-x86-64.o): Likewise. - (reg-x86-64.c): Likewise. - (reg-x86-64-linux.o): Likewise. - (reg-x86-64-linux.c): Likewise. - (i386.o): New. - (i386.c): Likewise. - (i386-linux.o): Likewise. - (i386-linux.c): Likewise. - (amd64.o): Likewise. - (amd64.c): Likewise. - (amd64-linux.o): Likewise. - (amd64-linux.c): Likewise. - - * configure.srv (srv_i386_regobj): New. - (srv_i386_linux_regobj): Likewise. - (srv_amd64_regobj): Likewise. - (srv_amd64_linux_regobj): Likewise. - (srv_i386_32bit_xmlfiles): Likewise. - (srv_i386_64bit_xmlfiles): Likewise. - (srv_i386_xmlfiles): Likewise. - (srv_amd64_xmlfiles): Likewise. - (srv_i386_linux_xmlfiles): Likewise. - (srv_amd64_linux_xmlfiles): Likewise. - (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj. Set - srv_xmlfiles to $srv_i386_xmlfiles. - (i[34567]86-*-mingw32ce*): Likewise. - (i[34567]86-*-mingw*): Likewise. - (i[34567]86-*-nto*): Likewise. - (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj - and $srv_amd64_linux_regobj. Set srv_xmlfiles to - $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles. - (x86_64-*-linux*): Likewise. - - * linux-x86-low.c (init_registers_x86_64_linux): Removed. - (init_registers_amd64_linux): New. - (x86_arch_setup): Replace init_registers_x86_64_linux with - init_registers_amd64_linux. - -2010-02-23 Maxim Kuvyrkov <maxim@codesourcery.com> - - * configure.ac: Check for libdl. If it is not available link against - static libthread_db. - * configure: Regenerate. - -2010-02-22 Pedro Alves <pedro@codesourcery.com> - - PR9605 - - * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if - handing a read watchpoint. - (i386_low_insert_watchpoint): Read watchpoints aren't supported. - -2010-02-12 Doug Evans <dje@google.com> - - * linux-low.c (linux_supports_tracefork_flag): Document. - (linux_look_up_symbols): Add comment. - -2010-02-03 H.J. Lu <hongjiu.lu@intel.com> - - * regcache.c (supply_register): Clear regcache if buf is NULL. - -2010-02-02 Nicolas Roche <roche@sourceware.org> - Joel Brobecker <brobecker@adacore.com> - - * inferiors.c (find_inferior): Add function documentation. - (unloaded_dll): Handle the case where the unloaded dll has not - been previously registered in the dll list. - -2010-02-01 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-arm-low.c (thumb_breakpoint_len): Delete. - (thumb2_breakpoint): New. - (arm_breakpoint_at): Check for Thumb-2 breakpoints. - -2010-01-29 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (get_stop_pc): Check for SIGTRAP. - (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible - breakpoints. - -2010-01-21 Pedro Alves <pedro@codesourcery.com> - - * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes. - -2010-01-21 Jan Kratochvil <jan.kratochvil@redhat.com> - - * linux-s390-low.c (s390_collect_ptrace_register) - (s390_supply_ptrace_register): Adjust it for the new regcache parameter. - -2010-01-21 Doug Evans <dje@google.com> - - * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*. - (PTRACE_ARG4_TYPE): New macro. - (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE. - (linux_wait_for_event_1, linux_resume_one_lwp): Ditto. - (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE. - (usr_store_inferior_registers): Ditto. - (linux_read_memory, linux_write_memory): Ditto. - (linux_test_for_tracefork): Ditto. - - * linux-arm-low.c: Remove redundant include of gdb_proc_service.h. - Only include elf.h if gdb_proc_service.h didn't include linux/elf.h. - -2010-01-21 Pedro Alves <pedro@codesourcery.com> - - * proc-service.c (ps_lgetregs): Don't refetch registers from the - target. - -2010-01-21 Pedro Alves <pedro@codesourcery.com> - - * spu-low.c (spu_fetch_registers, spu_store_registers): Change - prototype to take a regcache. Adjust. - -2010-01-20 Pedro Alves <pedro@codesourcery.com> - - * regcache.h (struct thread_info): Forward declare. - (struct regcache): New. - (new_register_cache): Adjust prototype. - (get_thread_regcache): Declare. - (free_register_cache): Adjust prototype. - (registers_to_string, registers_from_string): Ditto. - (supply_register, supply_register_by_name, collect_register) - (collect_register_as_string, collect_register_by_name): Ditto. - * regcache.c (struct inferior_regcache_data): Delete. - (get_regcache): Rename to ... - (get_thread_regcache): ... this. Adjust. Switch inferior before - fetching registers. - (regcache_invalidate_one): Adjust. - (regcache_invalidate): Fix prototype. - (new_register_cache): Return the new register cache. - (free_register_cache): Change prototype. - (realloc_register_cache): Adjust. - (registers_to_string): Change prototype to take a regcache. Adjust. - (registers_from_string): Ditto. - (register_data): Ditto. - (supply_register): Ditto. - (supply_register_by_name): Ditto. - (collect_register): Ditto. - (collect_register_as_string): Ditto. - (collect_register_by_name): Ditto. - * server.c (process_serial_event): Adjust. - * linux-low.h (regset_fill_func, regset_store_func): Change - prototype. - (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register): - Change prototype. - * linux-low.c (get_stop_pc): Adjust. - (check_removed_breakpoint): Adjust. - (linux_wait_for_event): Adjust. - (linux_resume_one_lwp): Adjust. - (fetch_register): Add regcache parameter. Adjust. - (usr_store_inferior_registers): Ditto. - (regsets_fetch_inferior_registers): Ditto. - (regsets_store_inferior_registers): Ditto. - (linux_fetch_registers, linux_store_registers): Ditto. - * i387-fp.c (i387_cache_to_fsave): Change prototype to take a - regcache. Adjust. - (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto. - * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change - prototype to take a regcache. - (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto. - * remote-utils.c (convert_ascii_to_int, outreg) - (prepare_resume_reply): Change prototype to take a regcache. - Adjust. - * target.h (struct target_ops) <fetch_registers, store_registers>: - Change prototype to take a regcache. - (fetch_inferior_registers, store_inferior_registers): Change - prototype to take a regcache. Adjust. - * proc-service.c (ps_lgetregs): Adjust. - * linux-x86-low.c (x86_fill_gregset, x86_store_gregset) - (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset) - (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to - take a regcache. Adjust. - * linux-arm-low.c (arm_fill_gregset, arm_store_gregset) - (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset) - (arm_store_vfpregset, arm_get_pc, arm_set_pc): - (arm_breakpoint_at): Change prototype to take a regcache. Adjust. - * linux-cris-low.c (cris_get_pc, cris_set_pc) - (cris_cannot_fetch_register): - (cris_breakpoint_at): Change prototype to take a regcache. - Adjust. - * linux-crisv32-low.c (cris_get_pc, cris_set_pc, - cris_reinsert_addr, cris_write_data_breakpoint): Change prototype - to take a regcache. Adjust. - (cris_breakpoint_at, cris_insert_point, cris_remove_point): - Adjust. - * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to - take a regcache. Adjust. - * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset) - (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc, - (m68k_set_pc): Change prototype to take a regcache. Adjust. - * linux-mips-low.c (mips_get_pc): - (mips_set_pc): Change prototype to take a regcache. Adjust. - (mips_reinsert_addr): Adjust. - (mips_collect_register): Change prototype to take a regcache. - Adjust. - (mips_supply_register): - (mips_collect_register_32bit, mips_supply_register_32bit) - (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset) - (mips_store_fpregset): Ditto. - * linux-ppc-low.c (ppc_supply_ptrace_register, ppc_supply_ptrace_register): - Ditto. - (parse_spufs_run): Adjust. - (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset) - (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset) - (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to - take a regcache. Adjust. - * linux-s390-low.c (s390_collect_ptrace_register) - (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc) - (s390_set_pc): Change prototype to take a regcache. Adjust. - (s390_arch_setup): Adjust. - * linux-sh-low.c (sh_get_pc, sh_breakpoint_at) - (sh_fill_gregset): Change prototype to take a regcache. Adjust. - * linux-sparc-low.c (sparc_fill_gregset_to_stack) - (sparc_fill_gregset, sparc_store_gregset_from_stack) - (sparc_store_gregset, sparc_get_pc): Change prototype to take a - regcache. Adjust. - (sparc_breakpoint_at): Adjust. - * linux-xtensa-low.c (xtensa_fill_gregset): - (xtensa_store_gregset): - (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc) - (xtensa_set_pc): Change prototype to take a regcache. Adjust. - * nto-low.c (nto_fetch_registers, nto_store_registers): Change - prototype to take a regcache. Adjust. - * win32-arm-low.c (arm_fetch_inferior_register) - (arm_store_inferior_register): Change prototype to take a - regcache. Adjust. - * win32-i386-low.c (i386_fetch_inferior_register) - (i386_store_inferior_register): Change prototype to take a - regcache. Adjust. - * win32-low.c (child_fetch_inferior_registers) - (child_store_inferior_registers): Change prototype to take a - regcache. Adjust. - (win32_wait): Adjust. - (win32_fetch_inferior_registers): Change prototype to take a - regcache. Adjust. - (win32_store_inferior_registers): Adjust. - * win32-low.h (struct win32_target_ops) <fetch_inferior_register, - store_inferior_register>: Change prototype to take a regcache. - -2010-01-20 Doug Evans <dje@google.com> - - * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in - #ifdef. - (linux_wait_for_event1, linux_init_signals): Ditto. - (W_STOPCODE): Provide definition if missing. - -2010-01-13 Vladimir Prus <vladimir@codesourcery.com> - - * linux-low.c (linux_core_of_thread): New. - (compare_ints, show_process, list_threads): New. - (linux_qxfer_osdata): Report threads and cores. - (linux_target_op): Register linux_core_of_thread. - * remote-utils.c (prepare_resume_reply): Report the core. - (buffer_xml_printf): Support %d specifier. - * server.c (handle_threads_qxfer_proper, handle_threads_qxfer): - New. - (handle_query): Handle qXfer:threads. Announce availability - thereof. - * target.h (struct target_ops): New field core_of_thread. - -2010-01-04 Ulrich Weigand <uweigand@de.ibm.com> - - * Makefile.in (clean): Remove new generated files. - (reg-s390.o, reg-s390.c): Remove rules. - (reg-s390x.o, reg-s390x.c): Likewise. - (s390-linux32.o, s390-linux32.c): Add rules. - (s390-linux64.o, s390-linux64.c): Likewise. - (s390x-linux64.o, s390x-linux64.c): Likewise. - * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles. - * linux-s390-low.c: Include <elf.h>. - (HWCAP_S390_HIGH_GPRS): Define if undefined. - (init_registers_s390): Remove prototype. - (init_registers_s390x): Likewise. - (init_registers_s390_linux32): Add prototype. - (init_registers_s390_linux64): Likewise. - (init_registers_s390x_linux64): Likewise. - (s390_num_regs_3264): New define. - (s390_regmap_3264): New global variable. - (s390_cannot_fetch_register): Remove obsolete check. - (s390_cannot_store_register): Likewise. - (s390_collect_ptrace_register): Handle upper/lower register halves. - (s390_supply_ptrace_register): Likewise. - (s390_fill_gregset): Update to register number changes. - (s390_get_hwcap): New routine. - (s390_arch_setup): Detect 32-bit process running on 64-bit system. - Install appropriate regmap and register set. - -2010-01-01 Joel Brobecker <brobecker@adacore.com> - - * server.c (gdbserver_version): Update copyright year to 2010. - * gdbreplay.c (gdbreplay_version): Likewise. - -2009-12-28 Doug Evans <dje@google.com> - - * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h, - elf/external.h. Include <elf.h> instead but only if necessary. - -2009-12-28 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_remove_process): Remove `detaching' - parameter. Don't release/detach from thread_db here. - (linux_kill): Release/detach from thread_db here, ... - (linux_detach): ... and here, before actually detaching. - (linux_wait_1): ... and here, when a process exits. - * thread-db.c (any_thread_of): New. - (thread_db_free): Switch the current inferior to a thread of the - passed in process. - -2009-12-21 Doug Evans <dje@google.com> - - * linux-x86-low.c: Delete outdated comment about Elf32_Phdr. - - * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill. - Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc - warning ifndef __NR_tkill. Move setting of errno there too. - Delete unnecessary resetting of errno after syscall. - Minor comment changes to match gdb/linux-nat.c:kill_lwp. - - * configure.ac: Check for dladdr. - * config.in: Regenerate. - * configure: Regenerate. - * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR. - (try_thread_db_load): Update. - - * linux-low.c (my_waitpid): Delete unnecessary prototype. - -2009-12-18 Doug Evans <dje@google.com> - - * event-loop.c: Include unistd.h if it exists. - - * linux-low.c (my_waitpid): Move definition away from being in - between linux_tracefork_child/linux_test_for_tracefork. - - * gdb_proc_service.h (psaddr_t): Fix type. - * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix - signature to match glibc. - -2009-12-16 Doug Evans <dje@google.com> - - * linux-low.c (linux_read_memory): Fix argument to read. - -2009-11-26 Pedro Alves <pedro@codesourcery.com> - - * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT - events, don't leave current_inferior pointing at null. - -2009-11-26 Pedro Alves <pedro@codesourcery.com> - - * win32-low.c (LOG): Delete. - (OUTMSG): Output to stderr. - (OUTMSG2): Conditionalize on `debug_threads' variable, instead of - on compile time LOG macro. - (win32_wait): Fix debug output. - -2009-11-26 Pedro Alves <pedro@codesourcery.com> - - * win32-low.c (win32_add_one_solib): If the dll name is - "ntdll.dll", prepend the system directory to the dll path. - -2009-11-17 Daniel Jacobowitz <dan@codesourcery.com> - - * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization. - -2009-11-17 Nathan Sidwell <nathan@codesourcery.com> - Vladimir Prus <vladimir@codesourcery.com> - - * Makefile.in (reg-cf.o, reg-cf.c): New targets. - * configure.ac: Check for __mcoldfire__ and set - gdb_cv_m68k_is_coldfire. - * configure.srv: Use gdb_cv_m68k_is_coldfire to select between - reg-cf.o and reg-m68k.o. - * configure: Regenerated. - -2009-11-16 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_remove_process): Add `detaching' parameter. - Pass it to thread_db_free. - (linux_kill, linux_detach, linux_wait_1): Adjust to pass the - proper `detaching' argument to linux_remove_process. - * linux-low.h (thread_db_free): Add `detaching' parameter. - * thread-db.c (thread_db_init): Pass false as `detaching' argument - to thread_db_free. - (thread_db_free): Add `detaching' parameter. Only - call td_ta_clear_event if detaching from process. - -2009-11-12 Maxim Kuvyrkov <maxim@codesourcery.com> - - * thread-db.c (thread_db_free): Fix typo. - -2009-11-11 Paul Pluzhnikov <ppluzhnikov@google.com> - - PR gdb/10838 - * thread-db.c (thread_db_free): Call td_ta_clear_event. - -2009-11-03 Nathan Sidwell <nathan@codesourcery.com> - - * configure.ac (i[34567]86-*): Check if we're targetting x86-64 - with an i686 compiler. - * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if - needed. - * configure: Rebuilt. - -2009-10-29 Sandra Loosemore <sandra@codesourcery.com> - - PR gdb/10783 - - * server.c (handle_search_memory_1): Correct read_addr initialization - in loop for searching subsequent chunks. - -2009-10-29 Paul Pluzhnikov <ppluzhnikov@google.com> - - * configure.ac: New --with-libthread-db option. - * thread-db.c: Allow direct dependence on libthread_db. - (thread_db_free): Adjust. - * config.in: Regenerate. - * configure: Likewise. - -2009-10-28 Paul Pluzhnikov <ppluzhnikov@google.com> - - PR gdb/10757 - * thread-db.c (attach_thread): New function. - (maybe_attach_thread): Return success/failure. - (find_new_threads_callback): Adjust. - (thread_db_find_new_threads): Loop until no new threads. - -2009-10-13 Pedro Alves <pedro@codesourcery.com> - - * proc-service.c (ps_lgetregs): Formatting. - -2009-10-08 Paul Pluzhnikov <ppluzhnikov@google.com> - - * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove. - * configure.ac: Adjust. - * linux-low.h (struct process_info_private): Move members to struct - thread_db. - (thread_db_free, thread_db_handle_monitor_command): New prototype. - * linux-low.c (linux_remove_process): Adjust. - (linux_wait_for_event_1, linux_look_up_symbols): Likewise. - * server.c (handle_query): Move code ... - (handle_monitor_command): ... here. New function. - * target.h (struct target_ops): New member. - * thread-db.c (struct thread_db): New. - (libthread_db_search_path): New variable. - (thread_db_create_event, thread_db_enable_reporting) - (find_one_thread, maybe_attach_thread, find_new_threads_callback) - (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust. - (try_thread_db_load_1, dladdr_to_soname): New functions. - (try_thread_db_load, thread_db_load_search): New functions. - (thread_db_init): Search for libthread_db. - (thread_db_free): New function. - (thread_db_handle_monitor_command): Likewise. - * config.in: Regenerate. - * configure: Regenerate. - -2009-09-27 Ulrich Weigand <uweigand@de.ibm.com> - - * spu-low.c (spu_kill): Wait for inferior to terminate. - Call clear_inferiors. - (spu_detach): Call clear_inferiors. - -2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> - - * aclocal.m4: Regenerate. - * config.in: Likewise. - * configure: Likewise. - -2009-07-31 Ulrich Weigand <uweigand@de.ibm.com> - - * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define. - (parse_spufs_run): New function. - (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC. - (ppc_breakpoint_at): Handle SPU breakpoints. - -2009-07-31 Ulrich Weigand <uweigand@de.ibm.com> - - * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>. - (SPUFS_MAGIC): Define. - (spu_enumerate_spu_ids): New function. - (linux_qxfer_spu): New function. - (linux_target_ops): Install linux_qxfer_spu. - -2009-07-31 Ulrich Weigand <uweigand@de.ibm.com> - - * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o - and powerpc-cell64l.o to srv_regobj. Add rs6000/powerpc-cell32l.xml - and rs6000/powerpc-cell64l.xml to srv_xmlfiles. - * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules. - (powerpc-cell64l.o, powerpc-cell64l.c): Likewise. - (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c. - * linux-ppc-low.c (PPC_FEATURE_CELL): Define. - (init_registers_powerpc_cell32l): Add prototype. - (init_registers_powerpc_cell64l): Likewise. - (ppc_arch_setup): Detect Cell/B.E. architecture. - -2009-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> - - * Makefile.in (datarootdir): New variable. - -2009-07-28 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_write_memory): Update debugging output. - * Makefile.in (clean): Add new descriptions. - (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o) - (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules. - * configure.srv: Add new files for arm*-*-linux*. - * linux-arm-low.c: Add new declarations. - (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined. - (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3) - (HWCAP_VFPv3D16): New. - (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT - instead of __IWMMXT__. - (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap) - (arm_arch_setup): New. - (target_regsets): Remove #ifdef. Add VFP regset. - (the_low_target): Use arm_arch_setup. - -2009-07-28 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip - the main thread again. - -2009-07-06 Aleksandar Ristovski <aristovski@qnx.com> - - Adding Neutrino gdbserver. - * configure: Regenerated. - * configure.ac: Add case for srv_qnx and set LIBS accordingly. - * configure.srv (i[34567]86-*-nto*): New target. - * nto-low.c, nto-low.h, nto-x86-low.c: New files. - * remote-utils.c [__QNX__]: Include sys/iomgr.h - (nto_comctrl) [__QNX__]: New function. - (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl. - -2009-07-05 Danny Backx <dannybackx@users.sourceforge.net> - - * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to - srv_tgtobj. - -2009-07-04 Danny Backx <dannybackx@users.sourceforge.net> - Pedro Alves <pedro@codesourcery.com> - - * win32-i386-low.c (i386_get_thread_context): Handle systems that - don't support CONTEXT_EXTENDED_REGISTERS. - (i386_win32_breakpoint, i386_win32_breakpoint_len): New. - (the_low_target): Install them. - * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent - failing with ERROR_PIPE_NOT_CONNECTED. - -2009-06-30 Doug Evans <dje@google.com> - Pierre Muller <muller@ics.u-strasbg.fr> - - Add h/w watchpoint support to x86-linux, win32-i386. - * Makefile.in (SFILES): Add i386-low.c - (i386_low_h): Define. - (i386-low.o): Add dependencies. - (linux-x86-low.o): Add i386-low.h dependency. - (win32-i386-low.o): Ditto. - * i386-low.c: New file. - * i386-low.h: New file. - * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj. - (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto. - * linux-low.c (linux_add_process): Initialize arch_private. - (linux_remove_process): Free arch_private. - (add_lwp): Initialize arch_private. - (delete_lwp): Free arch_private. - (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if - provided. - * linux-low.h (process_info_private): New member arch_private. - (lwp_info): New member arch_private. - (linux_target_ops): New members new_process, new_thread, - prepare_to_resume. - (ptid_of): New macro. - * linux-x86-low.c: Include stddef.h, i386-low.h. - (arch_process_info): New struct. - (arch_lwp_info): New struct. - (x86_linux_dr_get, x86_linux_dr_set): New functions. - (i386_dr_low_set_addr, i386_dr_low_set_control): New functions. - (i386_dr_low_get_status): New function. - (x86_insert_point, x86_remove_point): New functions. - (x86_stopped_by_watchpoint): New function. - (x86_stopped_data_address): New function. - (x86_linux_new_process, x86_linux_new_thread): New functions. - (x86_linux_prepare_to_resume): New function. - (the_low_target): Add entries for insert_point, remove_point, - stopped_by_watchpoint, stopped_data_address, new_process, new_thread, - prepare_to_resume. - * server.c (debug_hw_points): New global. - (monitor_show_help): Document set debug-hw-points. - (handle_query): Process "set debug-hw-points". - * server.h (debug_hw_points): Declare. - (paddress): Declare. - * utils.c (NUMCELLS, CELLSIZE): New macros. - (get_sell, xsnprintf, paddress): New functions. - * win32-arm-low.c (the_low_target): Add entries for insert_point, - remove_point, stopped_by_watchpoint, stopped_data_address. - * win32-i386-low.c: Include i386-low.h. - (debug_reg_state): Replaces dr. - (i386_dr_low_set_addr, i386_dr_low_set_control): New functions. - (i386_dr_low_get_status): New function. - (i386_insert_point, i386_remove_point): New functions. - (i386_stopped_by_watchpoint): New function. - (i386_stopped_data_address): New function. - (i386_initial_stuff): Update. - (get_thread_context,set_thread_context,i386_thread_added): Update. - (the_low_target): Add entries for insert_point, - remove_point, stopped_by_watchpoint, stopped_data_address. - * win32-low.c (win32_insert_watchpoint): New function. - (win32_remove_watchpoint): New function. - (win32_stopped_by_watchpoint): New function. - (win32_stopped_data_address): New function. - (win32_target_ops): Add entries for insert_watchpoint, - remove_watchpoint, stopped_by_watchpoint, stopped_data_address. - * win32-low.h (win32_target_ops): New members insert_point, - remove_point, stopped_by_watchpoint, stopped_data_address. - -2009-06-25 Pedro Alves <pedro@codesourcery.com> - - * server.c (process_serial_event): Re-return unsupported, not - error, if the type isn't recognized. Re-allow supporting only - insert or remove packets. Also call require_running for - breakpoints. Add missing break statement to default case. Tidy. - * target.h (struct target_ops): Rename insert_watchpoint to - insert_point, and remove_watchpoint to remove_point. - - * linux-low.h (struct linux_target_ops): Likewise. - * linux-low.c (linux_insert_watchpoint): Rename to ... - (linux_insert_point): ... this. Adjust. - (linux_remove_watchpoint): Rename to ... - (linux_remove_point): ... this. Adjust. - (linux_target_ops): Adjust. - * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ... - (cris_insert_point): ... this. - (cris_remove_watchpoint): Rename to ... - (cris_remove_point): ... this. - (the_low_target): Adjust. - -2009-06-24 Pierre Muller <muller@ics.u-strasbg.fr> - - * server.c (handle_v_kill): Pass signal_pid to - kill_inferior if multi_process is zero. - -2009-06-23 Aleksandar Ristovski <aristovski@qnx.com> - - * server.c (process_serial_event): Add support for Z0 and Z1 packet. - * target.h (target_ops): Comment for *_watchpoint to make it clear - the functions can get types '0' and '1'. - -2009-06-22 Aleksandar Ristovski <aristovski@qnx.com> - - * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0. - * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers. - * regcache.c (get_regcache): Likewise. - * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion. - * win32-low.c (child_fetch_inferior_registers): Remove check for - regno 0. - -2009-06-19 Aleksandar Ristovski <aristovski@qnx.com> - Pedro Alves <pedro@codesourcery.com> - - * target.h (struct target_ops) <supports_multi_process>: New - callback. - (target_supports_multi_process): New. - * server.c (handle_query): Even if GDB reports support, only - enable multi-process if the target also supports it. Report - multi-process support only if the target backend supports it. - * linux-low.c (linux_supports_multi_process): New function. - (linux_target_ops): Install it as target_supports_multi_process - callback. - -2009-05-24 Doug Evans <dje@google.com> - - Global renaming of find_thread_pid to find_thread_ptid. - * server.h (find_thread_ptid): Renamed from find_thread_pid. - * inferiors.c (find_thread_ptid): Renamed from find_thread_pid. - All callers updated. - - * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp - to resume the newly created thread, don't call ptrace (PTRACE_CONT) - directly. - - * linux-low.c (get_stop_pc): Print pc if debug_threads. - (check_removed_breakpoint, linux_wait_for_lwp): Ditto. - (linux_resume_one_lwp): Ditto. - -2009-05-23 Doug Evans <dje@google.com> - - * linux-low.c (linux_resume_one_lwp): Change type of first arg - from struct inferior_list_entry * to struct lwp_info *. - All callers updated. - -2009-05-13 Doug Evans <dje@google.com> - - * linux-x86-low.c: Don't include assert.h. - (x86_siginfo_fixup): Use fatal, not assert. - (x86_arch_setup): Fix comment. - -2009-05-12 Doug Evans <dje@google.com> - - Biarch support for i386/amd64 gdbserver. - * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c. - Add linux-x86-low.c. - (linux-i386-low.o, linux-x86-64-low.o): Delete. - (linux-x86-low.o): Add. - * linux-x86-64-low.c: Delete. - * linux-i386-low.c: Delete. - * linux-x86-low.c: New file. - * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with - linux-x86-low.o. - (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with - linux-x86-low.o. - (x86_64-linux srv_regobj): Add reg-i386-linux.o. - * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h. - (linux_child_pid_to_exec_file): New function. - (elf_64_header_p, elf_64_file_p): New functions. - (siginfo_fixup): New function. - (linux_xfer_siginfo): New local inf_siginfo. Call siginfo_fixup to - give target a chance to convert layout. - * linux-low.h (linux_target_ops): New member siginfo_fixup. - (linux_child_pid_to_exec_file, elf_64_file_p): Declare. - -2009-05-07 Doug Evans <dje@google.com> - - * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak. - (regsets_store_inferior_registers): Ditto. - -2009-05-06 Pedro Alves <pedro@codesourcery.com> - - PR server/10048 - - * linux-low.c (must_set_ptrace_flags): Delete. - (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead - of the global. - (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here. Set - `lwp->must_set_ptrace_flags' instead. - (linux_wait_for_event_1): Set ptrace options here. - (linux_wait_1): ... not here. - -2009-04-30 Doug Evans <dje@google.com> - - * inferiors.c (started_inferior_callback): New function. - (attached_inferior_callback): New function. - (have_started_inferiors_p, have_attached_inferiors_p): New functions. - * server.c (print_started_pid, print_attached_pid): New functions. - (detach_or_kill_for_exit): New function. - (main): Call it instead of for_each_inferior (kill_inferior_callback). - * server.h (have_started_inferiors_p): Declare. - (have_attached_inferiors_p): Declare. - - * inferiors.c (remove_process): Fix memory leak, free process. - * linux-low.c (linux_remove_process): New function. - (linux_kill): Call it instead of remove_process. - (linux_detach, linux_wait_1): Ditto. - -2009-04-19 Danny Backx <dannybackx@users.sourceforge.net> - - * configure.srv: Add x86 Windows CE target. - -2009-04-03 Ulrich Weigand <uweigand@de.ibm.com> - - * inferiors.c (get_thread_process): Make global. - * server.h (get_thread_process): Add prototype. - * thread-db.c (find_one_thread): Use get_thread_process - instead of current_process. - (thread_db_get_tls_address): Do not crash if called when - thread layer is not yet initialized. - -2009-04-03 Ulrich Weigand <uweigand@de.ibm.com> - - * remote-utils.c (prepare_resume_reply): Null-terminate packet. - * spu-low.c (current_tid): Rename to ... - (current_ptid): ... this. - (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory, - spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use - ptid_get_lwp (current_ptid) instead of current_tid. - (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument - instead of current_tid. Use find_process_pid to verify pid - argument is valid. Pass proper argument to remove_process. - (spu_thread_alive): Compare current_ptid instead of current_tid. - (spu_resume): Likewise. - -2009-04-02 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (usr_store_inferior_registers): Declare local `pid' - variable. - -2009-04-01 Pedro Alves <pedro@codesourcery.com> - - Implement the multiprocess extensions, and add linux multiprocess - support. - - * server.h (ULONGEST): Declare. - (struct ptid, ptid_t): New. - (minus_one_ptid, null_ptid): Declare. - (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp) - (ptid_get_tid, ptid_equal, ptid_is_pid): Declare. - (struct inferior_list_entry): Change `id' type from unsigned from - to ptid_t. - (struct sym_cache, struct breakpoint, struct - process_info_private): Forward declare. - (struct process_info): Declare. - (current_process): Declare. - (all_processes): Declare. - (initialize_inferiors): Declare. - (add_thread): Adjust to use ptid_t. - (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto. - (add_process, remove_process, find_thread_pid): Declare. - (find_inferior_id): Adjust to use ptid_t. - (cont_thread, general_thread, step_thread): Change type to ptid_t. - (multi_process): Declare. - (push_event): Adjust to use ptid_t. - (read_ptid, write_ptid): Declare. - (prepare_resume_reply): Adjust to use ptid_t. - (clear_symbol_cache): Declare. - * inferiors.c (all_processes): New. - (null_ptid, minus_one_ptid): New. - (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp) - (ptid_get_tid, ptid_equal, ptid_is_pid): New. - (add_thread): Change unsigned long to ptid. Remove gdb_id - parameter. Adjust. - (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid. - (gdb_id_to_thread): Rename to ... - (find_thread_pid): ... this. Change unsigned long to ptid. - (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid. - (loaded_dll, pull_pid_from_list): Adjust. - (add_process, remove_process, find_process_pid) - (get_thread_process, current_process, initialize_inferiors): New. - * target.h (struct thread_resume) <thread>: Change type to ptid_t. - (struct target_waitstatus) <related_pid>: Ditto. - (struct target_ops) <kill, detach>: Add `pid' argument. Change - return type to int. - (struct target_ops) <join>: Add `pid' argument. - (struct target_ops) <thread_alive>: Change pid's type to ptid_t. - (struct target_ops) <wait>: Add `ptid' field. Change return type - to ptid. - (kill_inferior, detach_inferior, join_inferior): Add `pid' argument. - (mywait): Add `ptid' argument. Change return type to ptid_t. - (target_pid_to_str): Declare. - * target.c (set_desired_inferior): Adjust to use ptids. - (mywait): Add new `ptid' argument. Adjust. - (target_pid_to_str): New. - * mem-break.h (free_all_breakpoints): Declare. - * mem-break.c (breakpoints): Delelete. - (set_breakpoint_at, delete_breakpoint, find_breakpoint_at) - (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust - to use per-process breakpoint list. - (free_all_breakpoints): New. - * remote-utils.c (struct sym_cache) <name>: Drop `const'. - (symbol_cache, all_symbols_looked_up): Delete. - (hexchars): New. - (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one, - read_ptid): New. - (prepare_resume_reply): Change ptid argument's type from unsigned - long to ptid_t. Adjust. Implement W;process and X;process. - (free_sym_cache, clear_symbol_cache): New. - (look_up_one_symbol): Adjust to per-process symbol cache. * - * server.c (cont_thread, general_thread, step_thread): Change type - to ptid_t. - (attached): Delete. - (multi_process): New. - (last_ptid): Change type to ptid_t. - (struct vstop_notif) <ptid>: Change type to ptid_t. - (queue_stop_reply, push_event): Change `ptid' argument's type to - ptid_t. - (discard_queued_stop_replies): Add `pid' argument. - (start_inferior): Adjust to use ptids. Adjust to mywait interface - changes. Don't reference the `attached' global. - (attach_inferior): Adjust to mywait interface changes. - (handle_query): Adjust to use ptids. Parse GDB's qSupported - features. Handle and report "multiprocess+". Handle - "qAttached:PID". - (handle_v_cont): Adjust to use ptids. Adjust to mywait interface - changes. - (handle_v_kill): New. - (handle_v_stopped): Adjust to use target_pid_to_str. - (handle_v_requests): Allow multiple attaches and runs when - multiprocess extensions are in effect. Handle "vKill". - (myresume): Adjust to use ptids. - (queue_stop_reply_callback): Add `arg' parameter. Handle it. - (handle_status): Adjust to discard_queued_stop_replies interface - change. - (first_thread_of, kill_inferior_callback) - (detach_or_kill_inferior_callback, join_inferiors_callback): New. - (main): Call initialize_inferiors. Adjust to use ptids, killing - and detaching from all inferiors. Handle multiprocess packet - variants. - * linux-low.h: Include gdb_proc_service.h. - (struct process_info_private): New. - (struct linux_target_ops) <pid_of>: Use ptid_get_pid. - <lwpid_of>: Use ptid_get_lwp. - (get_lwp_thread): Adjust. - (struct lwp_info): Add `dead' member. - (find_lwp_pid): Declare. - * linux-low.c (thread_db_active): Delete. - (new_inferior): Adjust comment. - (inferior_pid): Delete. - (linux_add_process): New. - (handle_extended_wait): Adjust. - (add_lwp): Change unsigned long to ptid. - (linux_create_inferior): Add process to processes table. Adjust - to use ptids. Don't set new_inferior here. - (linux_attach_lwp): Rename to ... - (linux_attach_lwp_1): ... this. Add `initial' argument. Handle - it. Adjust to use ptids. - (linux_attach_lwp): New. - (linux_attach): Add process to processes table. Don't set - new_inferior here. - (struct counter): New. - (second_thread_of_pid_p, last_thread_of_process_p): New. - (linux_kill_one_lwp): Add `args' parameter. Handle it. Adjust to - multiple processes. - (linux_kill): Add `pid' argument. Handle it. Adjust to multiple - processes. Remove process from process table. - (linux_detach_one_lwp): Add `args' parameter. Handle it. Adjust - to multiple processes. - (any_thread_of): New. - (linux_detach): Add `pid' argument, and handle it. Remove process - from processes table. - (linux_join): Add `pid' argument. Handle it. - (linux_thread_alive): Change unsighed long argument to ptid_t. - Consider dead lwps as not being alive. - (status_pending_p): Rename `dummy' argument to `arg'. Filter out - threads we're not interested in. - (same_lwp, find_lwp_pid): New. - (linux_wait_for_lwp): Change `pid' argument's type from int to - ptid_t. Adjust. - (linux_wait_for_event): Rename to ... - (linux_wait_for_event_1): ... this. Change `pid' argument's type - from int to ptid_t. Adjust. - (linux_wait_for_event): New. - (linux_wait_1): Add `ptid' argument. Change return type to - ptid_t. Adjust. Use last_thread_of_process_p. Remove processes - that exit from the process table. - (linux_wait): Add `ptid' argument. Change return type to ptid_t. - Adjust. - (mark_lwp_dead): New. - (wait_for_sigstop): Adjust to use ptids. If a process exits while - stopping all threads, mark its main lwp as dead. - (linux_set_resume_request, linux_resume_one_thread): Adjust to use - ptids. - (fetch_register, usr_store_inferior_registers) - (regsets_fetch_inferior_registers) - (regsets_store_inferior_registers, linux_read_memory) - (linux_write_memory): Inline `inferior_pid'. - (linux_look_up_symbols): Adjust to use per-process - `thread_db_active'. - (linux_request_interrupt): Adjust to use ptids. - (linux_read_auxv): Inline `inferior_pid'. - (initialize_low): Don't reference thread_db_active. - * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove. - * proc-service.c (ps_lgetregs): Use find_lwp_pid. - (ps_getpid): Return the pid of the current inferior. - * thread-db.c (proc_handle, thread_agent): Delete. - (thread_db_create_event, thread_db_enable_reporting): Adjust to - per-process data. - (find_one_thread): Change argument type to ptid_t. Adjust to - per-process data. - (maybe_attach_thread): Adjust to per-process data and ptids. - (thread_db_find_new_threads): Ditto. - (thread_db_init): Ditto. - * spu-low.c (spu_create_inferior, spu_attach): Add process to - processes table. Adjust to use ptids. - (spu_kill, spu_detach): Adjust interface. Remove process from - processes table. - (spu_join, spu_thread_alive): Adjust interface. - (spu_wait): Adjust interface. Remove process from processes - table. Adjust to use ptids. - * win32-low.c (current_inferior_tid): Delete. - (current_inferior_ptid): New. - (debug_event_ptid): New. - (thread_rec): Take a ptid. Adjust. - (child_add_thread): Add `pid' argument. Adjust to use ptids. - (child_delete_thread): Ditto. - (do_initial_child_stuff): Add `attached' argument. Add process to - processes table. - (child_fetch_inferior_registers, child_store_inferior_registers): - Adjust. - (win32_create_inferior): Pass 0 to do_initial_child_stuff. - (win32_attach): Pass 1 to do_initial_child_stuff. - (win32_kill): Adjust interface. Remove process from processes - table. - (win32_detach): Ditto. - (win32_join): Adjust interface. - (win32_thread_alive): Take a ptid. - (win32_resume): Adjust to use ptids. - (get_child_debug_event): Ditto. - (win32_wait): Adjust interface. Remove exiting process from - processes table. - -2009-04-01 Pedro Alves <pedro@codesourcery.com> - - Non-stop mode support. - - * server.h (non_stop): Declare. - (gdb_client_data, handler_func): Declare. - (delete_file_handler, add_file_handler, start_event_loop): - Declare. - (handle_serial_event, handle_target_event, push_event) - (putpkt_notif): Declare. - * target.h (enum resume_kind): New. - (struct thread_resume): Replace `step' field by `kind' field. - (TARGET_WNOHANG): Define. - (struct target_ops) <wait>: Add `options' argument. - <supports_non_stop, async, start_non_stop>: New fields. - (target_supports_non_stop, target_async): New. - (start_non_stop): Declare. - (mywait): Add `options' argument. - * target.c (mywait): Add `options' argument. Print child exit - notifications here. - (start_non_stop): New. - * server.c (non_stop, own_buf, mem_buf): New globals. - (struct vstop_notif): New. - (notif_queue): New global. - (queue_stop_reply, push_event, discard_queued_stop_replies) - (send_next_stop_reply): New. - (start_inferior): Adjust to use resume_kind. Adjust to mywait - interface changes. - (attach_inferior): In non-stop mode, don't wait for the target - here. - (handle_general_set): Handle QNonStop. - (handle_query): When handling qC, return the current general - thread, instead of the first thread of the list. - (handle_query): If the backend supports non-stop mode, include - QNonStop+ in the qSupported query response. - (handle_v_cont): Adjust to use resume_kind. Handle resume_stop - and non-stop mode. - (handle_v_attach, handle_v_run): Handle non-stop mode. - (handle_v_stopped): New. - (handle_v_requests): Report support for vCont;t. Handle vStopped. - (myresume): Adjust to use resume_kind. Handle non-stop. - (queue_stop_reply_callback): New. - (handle_status): Handle non-stop mode. - (main): Clear non_stop flag on reconnection. Use the event-loop. - Refactor serial protocol handling from here ... - (process_serial_event): ... to this new function. When GDB - selects any thread, select one here. In non-stop mode, wait until - GDB acks all pending events before exiting. - (handle_serial_event, handle_target_event): New. - * remote-utils.c (remote_open): Install remote_desc in the event - loop. - (remote_close): Remove remote_desc from the event loop. - (putpkt_binary): Rename to... - (putpkt_binary_1): ... this. Add `is_notic' argument. Handle it. - (putpkt_binary): New as wrapper around putpkt_binary_1. - (putpkt_notif): New. - (prepare_resume_reply): In non-stop mode, don't change the - general_thread. - * event-loop.c: New. - * Makefile.in (OBJ): Add event-loop.o. - (event-loop.o): New rule. - - * linux-low.h (pid_of): Moved here. - (lwpid_of): New. - (get_lwp_thread): Use lwpid_of. - (struct lwp_info): Delete `lwpid' field. Add `suspended' field. - * linux-low.c (pid_of): Delete. - (inferior_pid): Use lwpid_of. - (linux_event_pipe): New. - (target_is_async_p): New. - (delete_lwp): New. - (handle_extended_wait): Use lwpid_of. - (add_lwp): Don't set lwpid field. - (linux_attach_lwp): Adjust debug output. Use lwpid_of. - (linux_kill_one_lwp): If killing a running lwp, stop it first. - Use lwpid_of. Adjust to linux_wait_for_event interface changes. - (linux_detach_one_lwp): If detaching from a running lwp, stop it - first. Adjust to linux_wait_for_event interface changes. Use - lwpid_of. - (linux_detach): Don't delete the main lwp here. - (linux_join): Use my_waitpid. Avoid signal_pid. Use lwpid_of. - (status_pending_p): Don't consider explicitly suspended lwps. - (linux_wait_for_lwp): Take an integer pid instead of a lwp_info - pointer. Add OPTIONS argument. Change return type to int. Use - my_waitpid instead of sleeping. Handle WNOHANG. Use lwpid_of. - (linux_wait_for_event): Take an integer pid instead of a lwp_info - pointer. Add status pointer argument. Return a pid instead of a - status. Use lwpid_of. Adjust to linux_wait_for_lwp interface - changes. In non-stop mode, don't switch to a random thread. - (linux_wait): Rename to... - (linux_wait_1): ... this. Add target_options argument, and handle - it. Adjust to use resume_kind. Use lwpid_of. In non-stop mode, - don't handle the continue thread. Handle TARGET_WNOHANG. Merge - clean exit and signal exit code. Don't stop all threads in - non-stop mode. In all-stop mode, only stop all threads when - reporting a stop to GDB. Handle explicit thread stop requests. - (async_file_flush, async_file_mark): New. - (linux_wait): New. - (send_sigstop): Use lwpid_of. - (wait_for_sigstop): Use lwpid_of. Adjust to linux_wait_for_event - interface changes. In non-stop mode, don't switch to a random - thread. - (linux_resume_one_lwp): Use lwpid_of. - (linux_continue_one_thread, linux_queue_one_thread): Merge into ... - (linux_resume_one_thread): ... this. Handle resume_stop. In - non-stop mode, don't look for pending flag in all threads. - (resume_status_pending_p): Don't consider explicitly suspended - threads. - (my_waitpid): Reimplement. Emulate __WALL. - (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo): - Use lwpid_of. - (sigchld_handler, linux_supports_non_stop, linux_async) - (linux_start_non_stop): New. - (linux_target_ops): Register linux_supports_non_stop, linux_async - and linux_start_non_stop. - (initialize_low): Install SIGCHLD handler. - * thread-db.c (thread_db_create_event, find_one_thread) - (thread_db_get_tls_address): Use lwpid_of. - * win32-low.c (win32_detach): Adjust to use resume_kind. - (win32_wait): Add `options' argument. - * spu-low.c (spu_resume): Adjust to use resume_kind. - (spu_wait): Add `options' argument. - -2009-04-01 Pedro Alves <pedro@codesourcery.com> - - Decouple target code from remote protocol. - - * target.h (enum target_waitkind): New. - (struct target_waitstatus): New. - (struct target_ops) <wait>: Return an unsigned long. Take a - target_waitstatus pointer instead of a char pointer. - (mywait): Likewise. - * target.c (mywait): Change prototype to return an unsigned long. - Take a target_waitstatus pointer instead of a char pointer. Adjust. - * server.h (thread_from_wait, old_thread_from_wait): Delete - declarations. - (prepare_resume_reply): Change prototype to take a - target_waitstatus. - * server.c (thread_from_wait, old_thread_from_wait): Delete. - (last_status, last_ptid): New. - (start_inferior): Remove "statusptr" argument. Adjust. Return a - pid instead of a signal. - (attach_inferior): Remove "status" and "signal" parameters. - Adjust. - (handle_query): For qGetTLSAddr, parse the thread id with strtol, - not as an address. - (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill) - (handle_v_requests, myresume): Remove "status" and "signal" - parameters. Adjust. - (handle_status): New. - (main): Delete local `status'. Adjust. - * remote-utils.c: Include target.h. - (prepare_resume_reply): Change prototype to take a - target_waitstatus. Adjust. - - * linux-low.c (linux_wait): Adjust to new target_ops->wait - interface. - * spu-low.c (spu_wait): Adjust. - * win32-low.c (enum target_waitkind, struct target_waitstatus): - Delete. - (win32_wait): Adjust. - -2009-04-01 Pedro Alves <pedro@codesourcery.com> - - * target.h (struct thread_resume): Delete leave_stopped member. - (struct target_ops): Add a `n' argument to the `resume' callback. - * server.c (start_inferior): Adjust. - (handle_v_cont, myresume): Adjust. - * linux-low.c (check_removed_breakpoint): Adjust to resume - interface change, and to removed leave_stopped field. - (resume_ptr): Delete. - (struct thread_resume_array): New. - (linux_set_resume_request): Add new `arg' parameter. Adjust to - resume interface change. - (linux_continue_one_thread, linux_queue_one_thread) - (resume_status_pending_p): Check if the resume field is NULL - instead of checking the leave_stopped member. - (linux_resume): Adjust to the target resume interface change. - * spu-low.c (spu_resume): Adjust to the target resume interface - change. - * win32-low.c (win32_detach, win32_resume): Ditto. - -2009-04-01 Pedro Alves <pedro@codesourcery.com> - - * linux-low.c (linux_wait_for_event): Don't clear the `stepping' - flag. - (wait_for_sigstop): Don't leave a finished single-step SIGTRAP - pending. - (linux_continue_one_thread): Only preserve the stepping flag if - there's a pending breakpoint. - -2009-03-31 Pedro Alves <pedro@codesourcery.com> - - * server.c (main): After the inferior having exited, call - remote_close before exiting gdbserver. - -2009-03-25 Thiago Jung Bauermann <bauerman@br.ibm.com> - - Fix size of FPSCR in Power 7 processors. - * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define. - (PPC_FEATURE_HAS_DFP): New #define. - (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on - size of the FPSCR. - -2009-03-23 Pedro Alves <pedro@codesourcery.com> - - * server.c (handle_query) Whitespace and formatting. - -2009-03-22 Pedro Alves <pedro@codesourcery.com> - - * i387-fp.c, linux-arm-low.c, linux-cris-low.c, - linux-crisv32-low.c, linux-i386-low.c, linux-low.c, - linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c, - linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c, - regcache.c, remote-utils.c, server.c, spu-low.c, target.h, - thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c, - Makefile.in, configure.ac: Fix whitespace throughout. - * configure: Regenerate. - -2009-03-22 Pedro Alves <pedro@codesourcery.com> - - * inferiors.c (find_inferior): Make it safe for the callback - function to delete the currently iterated inferior. - -2009-03-22 Pedro Alves <pedro@codesourcery.com> - - * Makefile.in (linuw_low_h): Move higher. - (thread-db.o): Depend on $(linux_low_h). - -2009-03-17 Pedro Alves <pedro@codesourcery.com> - - Rename "process" to "lwp" throughout. - - * linux-low.c (all_processes): Rename to... - (all_lwps): ... this. - (inferior_pid, handle_extended_wait, get_stop_pc): Adjust. - (add_process): Rename to ... - (add_lwp): ... this. Adjust. - (linux_create_inferior): Adjust. - (linux_attach_lwp): Adjust. - (linux_attach): Adjust. - (linux_kill_one_process): Rename to ... - (linux_kill_one_lwp): ... this. Adjust. - (linux_kill): Adjust. - (linux_detach_one_process): Rename to ... - (linux_detach_one_lwp): ... this. Adjust. - (linux_detach): Adjust. - (check_removed_breakpoint): Adjust. - (status_pending_p): Adjust. - (linux_wait_for_process): Rename to ... - (linux_wait_for_lwp): ... this. Adjust. - (linux_wait_for_event): Adjust. - (send_sigstop): Adjust. - (wait_for_sigstop): Adjust. - (stop_all_processes): Rename to ... - (stop_all_lwps): ... this. - (linux_resume_one_process): Rename to ... - (linux_resume_one_lwp): ... this. Adjust. - (linux_set_resume_request, linux_continue_one_thread) - (linux_queue_one_thread, resume_status_pending_p) - (usr_store_inferior_registers, regsets_store_inferior_registers) - (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo): - Adjust. - * linux-low.h (get_process): Rename to ... - (get_lwp): ... this. Adjust. - (get_thread_process): Rename to ... - (get_thread_lwp): ... this. Adjust. - (get_process_thread): Rename to ... - (get_lwp_thread): ... this. Adjust. - (struct process_info): Rename to ... - (struct lwp_info): ... this. - (all_processes): Rename to ... - (all_lwps): ... this. - * proc-service.c (ps_lgetregs): Adjust. - * thread-db.c (thread_db_create_event, find_one_thread) - (maybe_attach_thread, thread_db_get_tls_address): Adjust. - -2009-03-14 Pedro Alves <pedro@codesourcery.com> - - * server.c (handle_query): Handle "qAttached". - -2009-03-13 Nathan Sidwell <nathan@codesourcery.com> - - * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to - GPLv3, update license URL. - -2009-03-01 Doug Evans <dje@google.com> - - * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common. - (server_h): Add gdb_signals.h. - (signals.o): Update. - * server.h (target_signal_from_host,target_signal_to_host_p) - (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h. - -2009-02-14 Pierre Muller <muller@ics.u-strasbg.fr> - - * remote-utils.c (getpkt): Also generate remote-debug - information if noack_mode is set. - -2009-02-06 Pedro Alves <pedro@codesourcery.com> - - * server.c (handle_query): Report qXfer:siginfo:read and - qXfer:siginfo:write as supported and handle them. - * target.h (struct target_ops) <qxfer_siginfo>: New field. - * linux-low.c (linux_xfer_siginfo): New. - (linux_target_ops): Set it. - -2009-01-26 Pedro Alves <pedro@codesourcery.com> - - * server.c (gdbserver_usage): Mention --remote-debug. - (main): Accept '--remote-debug' switch. - -2009-01-18 Doug Evans <dje@google.com> - - * regcache.c (new_register_cache): No need to check result of xcalloc. - * server.c (handle_search_memory): Back out calls to xmalloc, - result is checked and error is returned to user upon failure. - (handle_query): Ditto. Add more checks for result of malloc. - (handle_v_cont): Check result of malloc, report error back to - user upon failure. - (handle_v_run): Ditto. Call freeargv. - * server.h (freeargv): Declare. - * utils.c (freeargv): New fn. - -2009-01-15 Doug Evans <dje@google.com> - - * gdbreplay.c (perror_with_name): Make arg const char *. - * server.h (target_signal_to_name): Make return type const char *. - * thread-db.c (thread_db_err_str): Make return type const char *. - * utils.c (perror_with_name): Make arg const char *. - -2009-01-14 Pedro Alves <pedro@codesourcery.com> - - * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE - when handling a EXIT_PROCESS_DEBUG_EVENT. - -2009-01-06 Joel Brobecker <brobecker@adacore.com> - - * gdbreplay.c (gdbreplay_version): Update copyright year. - * server.c (gdbserver_version): Likewise. - -2009-01-05 Doug Evans <dje@google.com> - - * linux-low.c (linux_attach_lwp): Add some comments/fixmes. - (handle_extended_wait): Improve comment. - -2008-12-13 Doug Evans <dje@google.com> - - * utils.c (xmalloc,xcalloc,xstrdup): New fns. - * server.h (ATTR_MALLOC): New macro. - (xmalloc,xcalloc,xstrdup): Declare. - * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup. - * inferiors.c: Ditto. - * linux-low.c: Ditto. - * mem-break.c: Ditto. - * regcache.c: Ditto. - * remote-utils.c: Ditto. - * server.c: Ditto. - * target.c: Ditto. - * win32-low.c: Ditto. - -2008-12-12 Doug Evans <dje@google.com> - - * linux-low.c (linux_wait_for_process): Don't clobber current_inferior - in debugging printf. - - * linux-low.c (handle_extended_wait): Simplify, use my_waitpid. - -2008-12-09 Doug Evans <dje@google.com> - - * linux-low.h (struct process_info): Delete member tid, unused. - * thread-db.c (find_one_thread): Update. - (maybe_attach_thread): Update. - -2008-12-02 Pedro Alves <pedro@codesourcery.com> - - * target.h (struct target_ops): Add qxfer_osdata member. - * linux-low.c: Include ctype.h and pwd.h and sys/types.h - and dirent.h. - (linux_qxfer_osdata): New functions. - (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata - callback. - * server.c (handle_query): Handle "qXfer:osdata:read:". - * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish) - (buffer_xml_printf): New functions. - * server.h (struct buffer): New. - (buffer_grow_str, buffer_grow_str0): New macros. - (buffer_grow, buffer_free, buffer_init, buffer_finish) - (buffer_xml_printf): Declare. - -2008-11-24 Doug Evans <dje@google.com> - - * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused. - -2008-11-24 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (handle_v_run): Always use the supplied argument list. - -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 - cache size isn't known yet. - (free_register_cache): Avoid dereferencing a NULL regcache. - -2008-09-04 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.srv: Merge MIPS and MIPS64. - -2008-08-24 Maciej W. Rozycki <macro@linux-mips.org> - - * Makefile.in (uninstall): Apply $(EXEEXT) too. - -2008-08-18 Luis Machado <luisgpm@br.ibm.com> - - * Makefile.in: Add required vsx dependencies. - - * linux-ppc-low: Define PPC_FEATURE_HAS_VSX. - Declare init_registers_powerpc_vsx32l. - Declare init_registers_powerpc_vsx64l. - Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS. - (ppc_arch_setup): Check for VSX in hwcap. - (ppc_fill_vsxregset): New function. - (ppc_store_vsxregset): New function. - Add new VSX entry in regset_info target_regsets. - - * configure.srv: Add new VSX dependencies. - -2008-08-12 Pedro Alves <pedro@codesourcery.com> - - * remote-utils.c (noack_mode, transport_is_reliable): New globals. - (remote_open): Set or clear transport_is_reliable. - (putpkt_binary): Don't expect acks in noack mode. - (getpkt): Don't send ack/nac in noack mode. - * server.c (handle_general_set): Handle QStartNoAckMode. - (handle_query): If connected by tcp pass QStartNoAckMode+ in - qSupported. - (main): Reset noack_mode on every connection. - * server.h (noack_mode): Declare. - -2008-08-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> - - * Makefile.in (GDBREPLAY_OBS): New variable. - (gdbreplay$(EXEEXT)): Use it to avoid unportable $^. - -2008-08-05 Ulrich Weigand <uweigand@de.ibm.com> - Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_resume_one_process): Ignore ESRCH. - (usr_store_inferior_registers): Likewise. - (regsets_store_inferior_registers): Likewise. - -2008-07-31 Rolf Jansen <rj@surtec.com> - Pedro Alves <pedro@codesourcery.com> - - * configure.ac: Check for memmem declaration. - * server.c [HAVE_MALLOC_H]: Include malloc.h. - (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC) - (disable_packet_qfThreadInfo): Unconditionally compile. - * server.h [!HAVE_DECL_MEMMEM]: Declare memmem. - * configure, config.in: Regenerate. - -2008-07-28 Doug Kwan <dougkwan@google.com> - - * linux-low.c (sys/dir.h, sys/user.h): Remove includes. - (linux_write_memory): Remove declaration of errno. - -2008-07-12 Ulrich Weigand <uweigand@de.ibm.com> - - * linux-low.c (handle_extended_wait): Do not use "status" - variable uninitialized. - -2008-07-07 Pedro Alves <pedro@codesourcery.com> - - * server.c (handle_v_attach): Inhibit reporting dll changes. - -2008-06-27 Pedro Alves <pedro@codesourcery.com> - - * remote-utils.c (prepare_resume_reply): If requested, don't - output "thread:TID" in the T stop reply. - - * server.c (disable_packet_vCont, disable_packet_Tthread) - (disable_packet_qC, disable_packet_qfThreadInfo): New globals. - (handle_query): If requested, disable support for qC, qfThreadInfo - and qsThreadInfo. - (handle_v_requests): If requested, disable support for vCont. - (gdbserver_show_disableable): New. - (main): Handle --disable-packet and --disable-packet=LIST. - - * server.h (disable_packet_vCont, disable_packet_Tthread) - (disable_packet_qC, disable_packet_qfThreadInfo): Declare. - -2008-06-20 Carlos O'Donell <carlos@codesourcery.com> - - * server.c (gdbserver_usage): Mention --version. - -2008-06-06 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (gdbreplay.o): New rule. - -2008-06-06 Joseph Myers <joseph@codesourcery.com> - - * gdbreplay.c (gdbreplay_version): Say gdbreplay in version - message, not gdbserver. - -2008-06-05 Vladimir Prus <vladimir@codesourcery.com> - Nathan Sidwell <nathan@codesourcery.com> - Joseph Myers <joseph@codesourcery.com> - - * acinclude.m4: Include ../../config/acx.m4. - * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL. - * configure, config.in: Regenerate. - * Makefile.in (gdbreplay$(EXEEXT)): Add version.o. - * server.c (gdbserver_version): Print PKGVERSION. - (gdbsrever_usage): Add stream parameter. Print REPORT_BUGS_TO. - (main): Adjust gdbserver_usage calls. - * gdbreplay.c (version, host_name): Add declarations. - (gdbreplay_version, gdbreplay_usage): New. - (main): Accept --version and --help options. - -2008-06-04 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New. - (arm_breakpoint_at): Handle Thumb. - (the_low_target): Add comment. - -2008-05-29 Ulrich Weigand <uweigand@de.ibm.com> - - * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer. - -2008-05-09 Doug Evans <dje@google.com> - - * server.h (decode_search_memory_packet): Declare. - * remote-utils.c (decode_search_memory_packet): New fn. - * server.c (handle_search_memory_1): New fn. - (handle_search_memory): New fn. - (handle_query): Process qSearch:memory packets. - -2008-05-08 Ulrich Weigand <uweigand@de.ibm.com> - - * regcache.c (registers_length): Remove. - (set_register_cache): Verify that PBUFSIZ is large enough to hold a - full register packet. - * regcache.h (registers_length): Remove prototype. - * server.h (PBUFSIZ): Define to 16384. - -2008-05-03 Ulrich Weigand <uweigand@de.ibm.com> - - * configure.srv (powerpc*-*-linux*): Set srv_regobj to - powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o, - powerpc-64l.o, and powerpc-altivec64l.o. - Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and - rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml, - rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml, - rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml, - rs6000/power-linux.xml, and rs6000/power64-linux.xml - to srv_xmlfiles. - - * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ... - (powerpc-32l.o, powerpc-32l.c): ... these new rules. - (powerpc-32.o, powerpc-32.c): Remove, replace by ... - (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules. - (powerpc-e500.o, powerpc-e500.c): Remove, replace by ... - (powerpc-e500l.o, powerpc-e500l.c): ... these new rules. - (reg-ppc64.o, reg-ppc64.c): Remove, replace by ... - (powerpc-64l.o, powerpc-64l.c): ... these new rules. - (powerpc-64.o, powerpc-64.c): Remove, replace by ... - (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules. - (clean): Update. - - * linux-ppc-low.c (init_registers_ppc): Remove, replace by ... - (init_registers_powerpc_32l): ... this new prototype. - (init_registers_powerpc_32): Remove, replace by ... - (init_registers_powerpc_altivec32l): ... this new prototype. - (init_registers_powerpc_e500): Remove, replace by ... - (init_registers_powerpc_e500l): ... this new prototype. - (init_registers_ppc64): Remove, replace by ... - (init_registers_powerpc_64l): ... this new prototype. - (init_registers_powerpc_64): Remove, replace by ... - (init_registers_powerpc_altivec64l): ... this new prototype. - (ppc_num_regs): Set to 73. - (PT_ORIG_R3, PT_TRAP): Define if necessary. - (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap. - (ppc_cannot_store_register): Handle orig_r3 and trap. - (ppc_arch_setup): Update init_registers_... calls. - (ppc_fill_gregset): Handle orig_r3 and trap. - - * inferiors.c (clear_inferiors): Reset current_inferior. - -2008-04-23 Paolo Bonzini <bonzini@gnu.org> - - * acinclude.m4: Add override.m4. - * configure: Regenerate. - -2008-04-21 Ulrich Weigand <uweigand@de.ibm.com> - - * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the - initial call to init_register_ppc64. - -2008-04-21 Ulrich Weigand <uweigand@de.ibm.com> - - * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into single - powerpc*-*-linux* case. - (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case. - -2008-04-17 Ulrich Weigand <uweigand@de.ibm.com> - - * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from - srv_regobj. Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml - from reg_xmlfiles. - * linux-ppc-low.c: Include <elf.h>. - (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define. - (ppc_hwcap): New global variable. - (ppc_regmap): Remove __SPE__ #ifdef sections. - (ppc_regmap_e500): New global variable. - (ppc_cannot_store_register): Update __SPE__ special case. - (ppc_get_hwcap): New function. - (ppc_arch_setup): Use it to determine whether inferior supports - AltiVec or SPE registers. Set the_low_target.regmap if appropriate. - (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally. - Do not access registers if target does not support AltiVec. - (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally. - Do not access registers if target does not support SPE. - (target_regsets): Unconditionally include AltiVec and SPE regsets. - -2008-04-17 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (disabled_regsets, num_regsets): New. - (use_regsets_p): Delete. - (linux_wait_for_process): Clear disabled_regsets. - (regsets_fetch_inferior_registers): Check and set it. - (regsets_store_inferior_registers): Likewise. - (linux_fetch_registers, linux_store_registers): Do not use - use_regsets_p. - (initialize_low): Allocate disabled_regsets. - -2008-04-14 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (LIBOBJS): New. - (OBS): Use LIBOBJS. - (memmem.o): New rule. - * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem. - * configure: Regenerated. - -2008-04-04 Ulrich Weigand <uweigand@de.ibm.com> - - * server.c (handle_query): Never return "unsupported" for - qXfer:features:read queries. - -2008-03-27 Ulrich Weigand <uweigand@de.ibm.com> - - * server.c (get_features_xml): Fix inverted condition. - (handle_query): Always support qXfer:feature:read. - -2008-03-10 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (wrapper_argv): New. - (start_inferior): Handle wrapper_argv. If set, expect an extra - trap. - (gdbserver_usage): Document --wrapper. - (main): Parse --wrapper. - -2008-02-28 Ulrich Weigand <uweigand@de.ibm.com> - - * configure.srv [powerpc64-*-linux*]: Add all files mentioned for - powerpc-*-linux* to srv_regobj and reg_xmlfiles. - * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation. - (ppc_set_pc): Likewise. - (ppc_arch_setup): New function. - (ppc_fill_gregset): Call ppc_collect_ptrace_register instead - of collect_register. - (the_low_target): Use ppc_arch_setup as arch_setup initializer. - -2008-02-28 Ulrich Weigand <uweigand@de.ibm.com> - - * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o - instead of linux-ppc64-low.o. - * linux-ppc64-low.c: Remove file. - * Makefile.in (SFILES): Remove linux-ppc64-low.c. - (linux-ppc64-low.o): Remove rule. - - * linux-ppc-low.c (init_registers_ppc64): Add prototype. - (init_registers_powerpc_64): Likewise. - (ppc_regmap): Conditionally define depending on __powerpc64__. - (ppc_cannot_store_register): Do not special-case "fpscr" when - compiled on __powerpc64__. - (ppc_collect_ptrace_register): New function. - (ppc_supply_ptrace_register): New function. - (ppc_breakpoint): Change type to "unsigned int". - (ppc_breakpoint_at): Change type of "insn" to "unsigned int". - (the_low_target): Conditionally provide initializers for the - arch_setup member depending on __powerpc64__. Install - collect_ptrace_register and supply_ptrace_register members. - -2008-02-28 Ulrich Weigand <uweigand@de.ibm.com> - - * regcache.h (gdbserver_xmltarget): Add extern declaration. - * server.c (gdbserver_xmltarget): Define. - (get_features_xml): Use it to replace "target.xml" and arch_string. - - * configure.srv: Remove srv_xmltarget. Add XML files that were - mentioned there to srv_xmlfiles instead. Remove conditional tests - on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set - srv_xmlfiles and srv_regobj to include all possible choices. - * configure.ac (srv_xmltarget): Remove. - (srv_xmlfiles): Do not add "target.xml". - (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove - checks for supplementary target information. - * configure: Regenerate. - * Makefile.in (XML_TARGET): Remove. - (target.xml): Remove rule. - (clean): Do not clean up target.xml. - (.PRECIOUS): Do not mention target.xml. - - * target.h (struct target_ops): Remove arch_string member. - * linux-low.c (linux_arch_string): Remove. - (linux_target_ops): Remove arch_string initializer. - * linux-low.h (struct linux_target_ops): Remove arch_string member. - * linux-i386-low.c (the_low_target): Remove arch_string initializer. - * linux-x86-64-low.c (the_low_target): Remove arch_string initializer. - * spu-low.c (spu_arch_string): Remove. - (spu_target_ops): Remove arch_string initializer. - * win32-low.c (win32_arch_string): Remove. - (win32_target_ops): Remove arch_string initializer. - * win32-low.h (struct win32_target_ops): Remove arch_string member. - * win32-arm-low.c (the_low_target): Remove arch_string initializer. - * win32-i368-low.c (the_low_target): Remove arch_string initializer. - -2008-02-27 Ulrich Weigand <uweigand@de.ibm.com> - - * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field - by collect_ptrace_register and supply_ptrace_register hooks. - * linux-low.c (fetch_register): Use supply_ptrace_register callback - instead of checking for the_low_target.left_pad_xfer. - (usr_store_inferior_registers): Use collect_ptrace_register callback - instead of checking for the_low_target.left_pad_xfer. - - * linux-s390-low.c (s390_collect_ptrace_register): New function. - (s390_supply_ptrace_register): Likewise. - (s390_fill_gregset): Call s390_collect_ptrace_register. - (the_low_target): Update. - - * linux-ppc64-low.c (ppc_collect_ptrace_register): New function. - (ppc_supply_ptrace_register): Likewise. - (the_low_target): Update. - - * linux-i386-low.c (the_low_target): Update. - * linux-x86-64-low.c (the_low_target): Update. - -2008-02-27 Ulrich Weigand <uweigand@de.ibm.com> - - * configure.srv [s390x-*-linux*]: Set srv_regobj to include both - reg-s390.o and reg-s390x.o. - - * linux-low.c (new_inferior): New global variable. - (linux_create_inferior, linux_attach): Set it. - (linux_wait_for_process): Call the_low_target.arch_setup after the - target has stopped for the first time. - (initialize_low): Do not call the_low_target.arch_setup. - - * linux-s390-low.c (s390_get_pc): Support bi-arch operation. - (s390_set_pc): Likewise. - (s390_arch_setup): New function. - (the_low_target): Use s390_arch_setup as arch_setup routine. - - * regcache.c (realloc_register_cache): New function. - (set_register_cache): Call it for each existing regcache. - -2008-02-27 Ulrich Weigand <uweigand@de.ibm.com> - - * server.h (init_registers): Remove prototype. - - * linux-low.h (struct linux_target_ops): Add arch_setup field. - * linux-low.c (initialize_low): Call the_low_target.arch_setup () - instead of init_registers (). - * linux-arm-low.c (init_registers_arm): Add prototype. - (init_registers_arm_with_iwmmxt): Likewise. - (the_low_target): Add initializer for arch_setup field. - * linux-cris-low.c (init_registers_cris): Add prototype. - (the_low_target): Add initializer for arch_setup field. - * linux-crisv32-low.c (init_registers_crisv32): Add prototype. - (the_low_target): Add initializer for arch_setup field. - * linux-i386-low.c (init_registers_i386_linux): Add prototype. - (the_low_target): Add initializer for arch_setup field. - * linux-ia64-low.c (init_registers_ia64): Add prototype. - (the_low_target): Add initializer for arch_setup field. - * linux-m32r-low.c (init_registers_m32r): Add prototype. - (the_low_target): Add initializer for arch_setup field. - * linux-m68k-low.c (init_registers_m68k): Add prototype. - (the_low_target): Add initializer for arch_setup field. - * linux-mips-low.c (init_registers_mips_linux): Add prototype. - (init_registers_mips64_linux): Likewise. - (the_low_target): Add initializer for arch_setup field. - * linux-ppc-low.c (init_registers_ppc): Add prototype. - (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise. - (the_low_target): Add initializer for arch_setup field. - * linux-ppc64-low.c (init_registers_ppc64): Add prototype. - (init_registers_powerpc_64): Likewise. - (the_low_target): Add initializer for arch_setup field. - * linux-s390-low.c (init_registers_s390): Add prototype. - (init_registers_s390x): Likewise. - (the_low_target): Add initializer for arch_setup field. - * linux-sh-low.c (init_registers_sh): Add prototype. - (the_low_target): Add initializer for arch_setup field. - * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype. - (the_low_target): Add initializer for arch_setup field. - * linux-xtensa-low.c (init_registers_xtensa): Add prototype. - (the_low_target): Add initializer for arch_setup field. - - * win32-low.h (struct win32_target_ops): Add arch_setup field. - * win32-low.c (initialize_low): Call the_low_target.arch_setup () - instead of init_registers (). - * win32-arm-low.c (init_registers_arm): Add prototype. - (the_low_target): Add initializer for arch_setup field. - * win32-i386-low.c (init_registers_i386): Add prototype. - (the_low_target): Add initializer for arch_setup field. - - * spu-low.c (init_registers_spu): Add prototype. - (initialize_low): Call initialie_registers_spu () instead of - initialize_registers (). - -2008-02-19 Pedro Alves <pedro@codesourcery.com> - - * server.c (handle_v_requests): When handling the vRun and vAttach - packets, if already debugging a process, don't kill it. Return an - error instead. - -2008-02-17 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (handle_query): Correct length check. - -2008-02-14 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (do_initial_child_stuff): Add process handle - parameter. Set current_process_handle and current_process_id from the - parameters. Clear globals. - (win32_create_inferior): Don't set current_process_handle and - current_process_id here. Instead pass them on the call to - do_initial_child_stuff. - (win32_attach): Likewise. - (win32_clear_inferiors): New. - (win32_kill): Don't close the current process handle or the - current thread handle here. Instead call win32_clear_inferiors. - (win32_detach): Don't open a new handle to the process. Call - win32_clear_inferiors. - (win32_join): Don't rely on current_process_handle; open a new - handle using the process id. - (win32_wait): Call win32_clear_inferiors when the inferior process - has exited. - -2008-02-14 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (monitor_show_help): Add "exit". - -2008-02-11 Maxim Grigoriev <maxim2405@gmail.com> - - * Makefile.in (SFILES): Add linux-xtensa-low.c. - (clean): Add reg-xtensa.c. - (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies. - * configure.srv (xtensa*-*-linux*) New target. - * linux-xtensa-low.c: New. - * xtensa-xtregs.c: New. - -2008-02-01 Pedro Alves <pedro_alves@portugalmail.pt> - - * hostio.c: Don't include errno.h. - (errno_to_fileio_errno): Move to hostio-errno. - * hostio.c: (hostio_error): Remove the error parameter. Defer the - error number outputting to the target->hostio_last_error callback. - (hostio_packet_error): Use FILEIO_EINVAL directly. - (handle_open, handle_pread, hostio_error, handle_unlink): Update - calls to hostio_error. - * hostio-errno.c: New. - * server.h (hostio_last_error_from_errno): Declare. - * target.h (target_ops): Add hostio_last_error member. - * linux-low.c (linux_target_op): Register hostio_last_error_from_errno - as hostio_last_error handler. - * spu-low.c (spu_target_ops): Likewise. - * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error) - (wince_hostio_last_error): New functions. - (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error - as hostio_last_error handler. - (win32_target_ops) [!_WIN32_WCE]: Register - hostio_last_error_from_errno as hostio_last_error handler. - * Makefile.in (SFILES): Add hostio.c and hostio-errno.c. - (hostio-errno.o): New rule. - * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs. - * configure.srv (srv_hostio_err_objs): New variable. Default to - hostio-errno.o. - (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "". - * configure: Regenerate. - -2008-01-29 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_attach_lwp): Do not _exit after errors. - (linux_kill, linux_detach): Clean up the process list. - * remote-utils.c (remote_open): Improve port number parsing. - (putpkt_binary, input_interrupt): Only send interrupts if the target - is running. - * server.c (extended_protocol): Make static. - (attached): Define earlier. - (exit_requested, response_needed, program_argv): New variables. - (target_running): New. - (start_inferior): Clear attached here. - (attach_inferior): Set attached here. - (require_running): Define. - (handle_query): Use require_running and target_running. Implement - "monitor exit". - (handle_v_attach, handle_v_run): New. - (handle_v_requests): Use require_running. Handle vAttach and vRun. - (gdbserver_usage): Update. - (main): Redo argument parsing. Handle --debug and --multi. Handle - --attach along with other options or after the port. Save - program_argv. Support no initial program. Resynchronize - communication with GDB after an error. Handle "monitor exit". - Use require_running and target_running. Always allow the extended - protocol. Do not error out for Hc0 or Hc-1. Do not automatically - restart in extended mode. - * README: Refer to the GDB manual. Update --attach usage. - -2007-12-20 Andreas Schwab <schwab@suse.de> - - * linux-low.c (STACK_SIZE): Define. - (linux_tracefork_child): Use it. Use __clone2 on ia64. - (linux_test_for_tracefork): Likewise. - -2007-12-18 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_wait_for_event): Update messages. Do not - reinsert auto-delete breakpoints. - * mem-break.c (struct breakpoint): Change return type of handler to - int. - (set_breakpoint_at): Update handler type. - (reinsert_breakpoint_handler): Return 1 instead of calling - delete_breakpoint. - (reinsert_breakpoint_by_bp): Check for the original breakpoint before - setting a new one. - (check_breakpoints): Delete auto-delete breakpoints and return 2. - * mem-break.h (set_breakpoint_at): Update handler type. - * thread-db.c (thread_db_create_event, thread_db_create_event): Update. - * win32-low.c (auto_delete_breakpoint): New. - (get_child_debug_event): Use it. - -2007-12-16 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.ac: Check for pread and pwrite. - * hostio.c (handle_pread): Fall back to lseek and read. - (handle_pwrite): Fall back to lseek and write. - * config.in, configure: Regenerated. - -2007-12-07 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (myresume): Add own_buf argument. - (main): Update calls. - -2007-12-06 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_wait, linux_resume): Do not handle async I/O. - * remote-utils.c (remote_open): Do not call disable_async_io. - (block_async_io): Delete. - (unblock_async_io): Make static. - (initialize_async_io): New. - * server.c (handle_v_cont): Handle async I/O here. - (myresume): Likewise. Move other common resume tasks here... - (main): ... from here. Call initialize_async_io. Disable async - I/O before the main loop. - * server.h (initialize_async_io): Declare. - (block_async_io, unblock_async_io): Delete prototypes. - * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here. - -2007-12-06 Mick Davis <mickd@goanna.iinet.net.au> - - * remote-utils.c (readchar): Allow binary data in received messages. - -2007-12-03 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (attaching): New global. - (win32_create_inferior): Clear the `attaching' global. - (win32_attach): Set the `attaching' global. - (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when - attaching. Only set a breakpoint at the entry point if not - attaching. - -2007-12-03 Pedro Alves <pedro_alves@portugalmail.pt> - - * server.c (main): Don't report dll events on the initial - connection on attaches. - -2007-12-03 Pedro Alves <pedro_alves@portugalmail.pt> - - * server.c (main): Relax numerical bases supported for the pid of - the --attach command line argument. - -2007-12-03 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (win32_attach): Call OpenProcess before - DebugActiveProcess, not after. Add last error output to error - call. - -2007-12-03 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (win32_get_thread_context) - (win32_set_thread_context): New functions. - (thread_rec): Use win32_get_thread_context. - (continue_one_thread, win32_resume): Use win32_set_thread_context. - * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context' - field. - -2007-12-03 Leo Zayas - Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (soft_interrupt_requested, faked_breakpoint): New - global variables. - (child_add_thread): Minor cleanup. - (child_continue): Resume artificially suspended threads before - calling ContinueDebugEvent. - (suspend_one_thread): New. - (fake_breakpoint_event): New. - (get_child_debug_event): Change return type to int. Check here if - gdb sent an interrupt request. If a soft interrupt was requested, - fake a breakpoint event. Return 0 if there is no event to handle, - and 1 otherwise. - (win32_wait): Don't check here if gdb sent an interrupt request. - Ensure there is a valid event to handle. - (win32_request_interrupt): Add soft interruption method as last - resort. - -2007-12-03 Leo Zayas - Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.h (win32_thread_info): Add descriptions to the - structure members. Replace `suspend_count' counter by a - `suspended' flag. - * win32-low.c (thread_rec): Update condition of when to get the - context from the inferior. Rely on ContextFlags being set if it - has already been retrieved. Only suspend the inferior thread if - we haven't already. Warn if that fails. - (continue_one_thread): s/suspend_count/suspended/. Only call - ResumeThread once. Warn if that fails. - -2007-12-02 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (win32_wait): Don't read from the inferior when it - has already exited. - -2007-12-02 Pedro Alves <pedro_alves@portugalmail.pt> - - * Makefile.in (win32_low_h): New variable. - (win32-low.o): Add dependency on $(win32_low_h). - (win32-arm-low.o, win32-i386-low.o): New rules. - -2007-11-30 Daniel Jacobowitz <dan@codesourcery.com> - - * hostio.c: Correct copyright year. - -2007-11-30 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (OBS): Add hostio.o. - (hostio.o): New rule. - * server.h (handle_vFile): Declare. - * hostio.c: New file. - * server.c (handle_v_requests): Take packet_len and new_packet_len - for binary packets. Call handle_vFile. - (main): Update call to handle_v_requests. - -2007-11-05 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c: Include <sched.h>. - -2007-11-01 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_tracefork_grandchild): New. - (linux_tracefork_child): Use clone. - (linux_test_for_tracefork): Use clone; allocate and free a stack. - -2007-10-31 Joel Brobecker <brobecker@adacore.com> - - * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh. - -2007-10-24 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (handle_extended_wait): Handle unexpected signals. - -2007-10-23 Daniel Jacobowitz <dan@codesourcery.com> - - * inferiors.c (change_inferior_id): Delete. - (add_pid_to_list, pull_pid_from_list): New. - * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG) - (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK) - (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE) - (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK) - (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE) - (PTRACE_EVENT_EXIT, __WALL): Provide default definitions. - (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables. - (using_threads): Always set to 1. - (handle_extended_wait): New. - (add_process): Do not set TID. - (linux_create_inferior): Set must_set_ptrace_flags. - (linux_attach_lwp): Remove TID argument. Do not check using_threads. - Use PTRACE_SETOPTIONS. Call new_thread_notify. Update all callers. - (linux_thread_alive): Rename TID argument to LWPID. - (linux_wait_for_process): Handle unknown processes. Do not use TID. - (linux_wait_for_event): Do not use TID or check using_threads. Update - call to dead_thread_notify. Call handle_extended_wait. - (linux_create_inferior): Use PTRACE_SETOPTIONS. - (send_sigstop): Delete sigstop_sent. - (wait_for_sigstop): Avoid TID. - (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid) - (linux_test_for_tracefork): New. - (linux_lookup_signals): Use thread_db_active and - linux_supports_tracefork_flag. - (initialize_low): Use thread_db_active and linux_test_for_tracefork. - * linux-low.h (get_process_thread): Avoid TID. - (struct process_ifo): Move thread_known and tid to the end. Remove - sigstop_sent. - (linux_attach_lwp, thread_db_init): Update prototypes. - * server.h (change_inferior_id): Delete prototype. - (add_pid_to_list, pull_pid_from_list): New prototypes. - * thread-db.c (thread_db_use_events): New. - (find_first_thread): Rename to... - (find_one_thread): ...this. Update callers and messages. Do not - call fatal. Check thread_db_use_events. Do not call - change_inferior_id or new_thread_notify. - (maybe_attach_thread): Update. Do not call new_thread_notify. - (thread_db_init): Set thread_db_use_events. Check use_events. - * utils.c (fatal, warning): Correct message prefix. - -2007-10-15 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (clean): Remove new files. - (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c) - (powerpc-64.o, powerpc-64.c): New rules. - * configure.srv: Use alternate register sets for powerpc64-*-linux* - with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux* - with SPE. - * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for - SPE targets. - (ppc_cannot_store_register): Do not check for FPSCR for SPE targets. - (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset) - (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS) - (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New. - (target_regsets): Add AltiVec and SPE register sets. - * configure.ac: Check for AltiVec and SPE. - * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS) - (ppc_fill_vrregset, ppc_store_vrregset): New. - (target_regsets): Add AltiVec register set. - * configure: Regenerated. - -2007-09-19 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (O_LARGEFILE): Define. - (linux_read_memory): Use /proc/PID/mem. - * configure.ac: Use AC_GNU_SOURCE. Check for pread64. - * configure, config.in: Regenerated. - -2007-09-04 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_wait_for_event): Do not pass signals while - single-stepping. - -2007-09-03 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (create_process): New. - (win32_create_inferior): Use create_process instead of - CreateProcess. If create_process failed retry appending an ".exe" - suffix. Store the GetLastError result immediatelly after - create_process calls and use it on the call to error. - -2007-09-03 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (handle_load_dll): Don't use toolhelp when waiting. - -2007-08-23 Joel Brobecker <brobecker@adacore.com> - - * configure.ac: Switch license to GPLv3. - -2007-08-01 Michael Snyder <msnyder@access-company.com> - - * remote-utils.c (putpkt_binary): Memory leak, free buf2. - -2007-07-31 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New - typedef. - (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var. - (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL. Get - CloseToolhelp32Snapshot. - (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with - CloseToolhelp32Snapshot. - -2007-07-27 Michael Snyder <michael.snyder@access-company.com> - - * server.c (main): Check for inferior exit before main loop. - -2007-07-18 Pedro Alves <pedro_alves@portugalmail.pt> - - * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc - instead of on tmp_desc. - -2007-07-17 Pedro Alves <pedro_alves@portugalmail.pt> - Daniel Jacobowitz <dan@codesourcery.com> - - * inferiors.c (all_dlls, dlls_changed, get_dll): New. - (add_thread): Minor cleanups. - (clear_inferiors): Move lower in the file. Clear the DLL - list. - (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New. - * remote-utils.c (prepare_resume_reply): Check dlls_changed. - (xml_escape_text): New. - * server.c (handle_query): Handle qXfer:libraries:read. Report it - for qSupported. - (handle_v_cont): Report errors. - (gdbserver_version): Update. - (main): Correct size of own_buf. Do not report initial DLL events. - * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll) - (unloaded_dll, xml_escape_text): New. - * win32-low.c (enum target_waitkind): Update comments. - (win32_add_one_solib, get_image_name, winapi_EnumProcessModules) - (winapi_GetModuleInformation, winapi_GetModuleFileNameExA) - (win32_EnumProcessModules, win32_GetModuleInformation) - (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name) - (winapi_CreateToolhelp32Snapshot, winapi_Module32First) - (winapi_Module32Next, win32_CreateToolhelp32Snapshot) - (win32_Module32First, win32_Module32Next, load_toolhelp) - (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New. - (get_child_debug_event): Handle DLL events. - (win32_wait): Likewise. - -2007-07-12 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.srv: Set srv_linux_regsets for sh*-*-linux*. - * linux-sh-low.c (sh_fill_gregset, target_regsets): New. - -2007-07-08 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (handle_output_debug_string): Ignore event if not - waiting. - -2007-07-08 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-arm-low.c (arm_wince_breakpoint): Fix typo. - -2007-07-03 Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c (look_up_one_symbol): Handle 'm' packets. - -2007-07-02 Daniel Jacobowitz <dan@codesourcery.com> - - * inferiors.c (change_inferior_id): Add comment. - * linux-low.c (check_removed_breakpoint): Add an early - prototype. Improve debug output. - (linux_attach): Doc update. - (linux_detach_one_process, linux_detach): Clean up before releasing - each process. - (send_sigstop, wait_for_sigstop): Improve comments and debug output. - * linux-low.h (struct process_info): Doc improvement. - * mem-break.c (delete_all_breakpoints): New. - * mem-break.h (delete_all_breakpoints): New prototype. - * thread-db.c (find_first_thread): New. - (thread_db_create_event): Call it instead of - thread_db_find_new_threads. Clean up unused variables. - (maybe_attach_thread): Remove first thread handling. - (thread_db_find_new_threads): Use find_first_thread. - (thread_db_get_tls_address): Likewise. - -2007-06-27 Daniel Jacobowitz <dan@codesourcery.com> - - * thread-db.c (thread_db_find_new_threads): Add prototype. - (thread_db_create_event): Check for the main thread before adding - a new thread. - (maybe_attach_thread): Only enable event reporting if TID == 0. - (thread_db_get_tls_address): Check for new threads. - -2007-06-20 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_create_inferior): Try execv before execvp. - * spu-low.c (spu_create_inferior): Likewise. - -2007-06-13 Mike Frysinger <vapier@gentoo.org> - - * linux-low.c (linux_create_inferior): Change execv to execvp. - * spu-low.c (spu_create_inferior): Likewies. - -2007-06-13 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (clean): Clean new files instead of deleted ones. - (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete. - (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New - rules. - * configure.srv: Specify XML files and new regformats for MIPS and - MIPS64 GNU/Linux. - * linux-mips-low.c (mips_num_regs): Set to only used registers. - (mips_regmap): Do not fetch $0. Remove unused registers. Add - an entry for the restart register. - (mips_cannot_fetch_register, mips_cannot_store_register) - (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update - register names to match the XML descriptions. - (mips_fill_gregset, mips_store_gregset): Likewise. Handle the - restart register instead of $0. - -2007-06-12 Ulrich Weigand <uweigand@de.ibm.com> - Markus Deuling <deuling@de.ibm.com> - - * remote-utils.c (decode_xfer_write): New function. - * server.h (decode_xfer_write): Add prototype. - * server.c (handle_query): Add PACKET_LEN argument. Support - qXfer:spu:read and qXfer:spu:write packets. - (main): Pass packet_len to handle_query. - * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu. - * target.h (target_ops): Add qxfer_spu. - -2007-06-12 Ulrich Weigand <uweigand@de.ibm.com> - - * spu-low.c (spu_proc_xfer_spu): Do not return failure when - accessing non-seekable spufs files. - -2007-05-16 Markus Deuling <deuling@de.ibm.com> - - * server.c (handle_query): Add reply for qC packet. - -2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt> - Leo Zayas <lerele@champenstudios@com> - - * server.h (check_remote_input_interrupt_request): New function. - * remote_utils.c (INVALID_DESCRIPTOR): New define. - (remote_desc): Initialize with INVALID_DESCRIPTOR. - (input_interrupt): Expose on USE_WIN32API too. Fix whitespace. - (check_remote_input_interrupt_request): New function. - * server.h (check_remote_input_interrupt_request): Declare. - * win32-low.c (winapi_DebugBreakProcess, - winapi_GenerateConsoleCtrlEvent): New typedefs. - (get_child_debug_event): Lower Win32 debug event polling from 1 sec - to 250 ms. - (win32_wait): Check for remote interrupt request - with check_remote_input_interrupt_request. - (win32_request_interrupt): New function. - (win32_target_op): Set request_interrupt to win32_request_interrupt. - -2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (debug_registers_changed, - debug_registers_used, CONTEXT_EXTENDED_REGISTERS, - CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS, - CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete. - (thread_rec): Get context using the low target. - (child_add_thread): Call thread_added on the low target, - which does the same thing. - (regptr): Delete. - (do_initial_child_stuff): Remove debug registers references. - Set context using the low target. Resume threads after - setting the contexts. - (child_continue): Remove dead variable. Remove debug - registers references. - (child_fetch_inferior_registers): Go through the low target. - (do_child_store_inferior_registers): Remove. - (child_store_inferior_registers): Go through the low target. - (win32_resume): Remove debug registers references. - Set context using the low target. - (handle_exception): Change return type to void. Don't record - context here. Set status to TARGET_WAITKIND_SPURIOUS on a - first chance exception. - (get_child_debug_event): Change return type to void. Remove - goto loop. Always return after waiting for debug event. - (win32_wait): Convert to switch statement. Handle spurious - events. - - * win32-i386-low.c (debug_registers_changed, - debug_registers_used): New. - (initial_stuff): Rename to ... - (i386_initial_stuff): ... this. Clear debug registers - state variables. - (store_debug_registers): Delete. - (i386_get_thread_context): New. - (load_debug_registers): Delete. - (i386_set_thread_context): New. - (i386_thread_added): New. - (single_step): Rename to ... - (i386_single_step): ... this. - (do_fetch_inferior_registers): Rename to ... - (i386_fetch_inferior_register): ... this. - (i386_store_inferior_register): New. - (the_low_target): Adapt to new interface. - - * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define. - (arm_get_thread_context): New. - (arm_set_thread_context): New. - (regptr): New. - (do_fetch_inferior_registers): Rename to ... - (arm_fetch_inferior_register): ... this. - (arm_store_inferior_register): New. - (arm_wince_breakpoint): Reimplement as unsigned long. - (arm_wince_breakpoint_len): Define. - (the_low_target): Adapt to new interface. - - * win32-low.h (target_ops): Remove regmap, store_debug_registers and - load_debug_registers. Add get_thread_context, set_thread_context, - thread_added and store_inferior_register. Rename - fetch_inferior_registers to fetch_inferior_register. - (regptr): Remove declaration. - -2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt> - - * linux-low.c (linux_detach): Change return type to int. Return 0. - * spu-low.c (spu_detach): Likewise. - -2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt> - - * target.h (target_ops): Change return type of detach to int. - Add join. - (join_inferior): New. - * server.c (main): Don't skip detach support on mingw32. - If the inferior doesn't support detaching return error. - Call join_inferior instead of using waitpid. - * linux-low.c (linux_join): New. - (linux_target_op): Add linux_join. - * spu-low.c (spu_join): New. - (spu_target_ops): Add spu_join. - * win32-low.c (win32_detach): Adapt to new interface. - Reopen current_process_handle before detaching. Issue a child - resume before detaching. - (win32_join): New. - (win32_target_op): Add win32_join. - -2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (win32-attach): Fix return value. - * target.h (target_ops): Describe ATTACH return values. - -2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (GETPROCADDRESS): Define. - (winapi_DebugActiveProcessStop): Add WINAPI. typedef as pointer. - (winapi_DebugSetProcessKillOnExit): Likewise. - (win32_create_inferior): Force usage of ansi CreateProcessA. - (win32_attach): Use GETPROCADDRESS. - (win32_detach): Likewise. - -2007-05-10 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c (win32_wait): Don't use WSTOPSIG. - -2007-03-30 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c: Commit leftover changes from 2007-03-29. - -2007-03-30 Daniel Jacobowitz <dan@codesourcery.com> - - * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit - fields short instead of int. Add explicit padding. - (i387_cache_to_fsave): Remove unnecessary casts. - (i387_fsave_to_cache): Doc fix. - (i387_cache_to_fxsave): Remove unnecessary casts and masking. - -2007-03-30 Daniel Jacobowitz <dan@codesourcery.com> - - * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use. - (i387_fxsave_to_cache): Check fp->ftag while building ftag value. - -2007-03-29 Pedro Alves <pedro_alves@portugalmail.pt> - - * configure.srv (arm*-*-mingw32ce*): Move near the other - arm targets. - -2007-03-29 Pedro Alves <pedro_alves@portugalmail.pt> - - * configure.ac: Add errno checking. - (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h, - sys/file.h and malloc.h. - (AC_CHECK_DECLS): Add perror. - (srv_mingwce): Handle. - * configure.srv (i[34567]86-*-cygwin*): Add - win32-i386-low.o to srv_tgtobj. - (i[34567]86-*-mingw*): Likewise. - (arm*-*-mingw32ce*): Add case. - * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H, - HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check. - [__MINGW32CE__] (strerror): New function. - [__MINGW32CE__] (errno): Define to GetLastError. - [__MINGW32CE__] (COUNTOF): New macro. - (remote_open): Remove extra close call. - * mem-break.c (delete_breakpoint_at): New function. - * mem-break.h (delete_breakpoint_at): Declare. - * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H, - HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check. - [USE_WIN32API] (read, write): Add char* casts. - * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check. - * server.h: Include wincecompat.h on Windows CE. - [HAVE_ERRNO_H]: Check. - (perror): Declare if not declared. - * utils.c: Add stdlib.h, errno.h and malloc.h includes. - (perror_with_name): Remove errno declaration. - * wincecompat.h: New. - * wincecompat.c: New. - * win32-low.h: New. - * win32-arm-low.c: New. - * win32-i386-low.c: New. - (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h. - (OUTMSG2): Make it safe. - (_T): New macro. - (COUNTOF): New macro. - (NUM_REGS): Get it from the low target. - (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT, - CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0. - (thread_rec): Let low target handle debug registers. - (child_add_thread): Likewise. - (child_init_thread_list): Likewise. - (continue_one_thread): Likewise. - (regptr): New. - (do_child_fetch_inferior_registers): Move to ... - * win32-i386-low.c: ... here, and rename to ... - (do_fetch_inferior_registers): ... this. - * win32-low.c (child_fetch_inferior_registers): - Go through the low target. - (do_child_store_inferior_registers): Use regptr. - (strwinerror): New function. - (win32_create_inferior): Handle Windows CE. - Use strwinerror instead of strerror on Windows error - codes. Add program to the error output. - Don't close the main thread handle on Windows CE. - (win32_attach): Use coredll.dll on Windows CE. - (win32_kill): Close current process and current - thread handles. - (win32_detach): Use coredll.dll on Windows CE. - (win32_resume): Let low target handle debug registers, and - step request. - (handle_exception): Add/Remove initial breakpoint. Avoid - non-existant WSTOPSIG on Windows CE. - (win32_read_inferior_memory): Cast to remove warning. - (win32_arch_string): Go through the low target. - (initialize_low): Call set_breakpoint_data with the low - target's breakpoint. - * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM, - FOP_REGNUM, mappings): Move to ... - * win32-i386-low.c: ... here. - * win32-low.c (win32_thread_info): Move to ... - * win32-low.h: ... here. - * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c, - win32-arm-low.c and wincecompat.c. - (all:): Add $EXEEXT. - (install-only:): Likewise. - (gdbserver:): Likewise. - (gdbreplay:): Likewise. - * config.in: Regenerate. - * configure: Regenerate. - -2007-03-28 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-low.c: Rename typedef thread_info to - win32_thread_info throughout. - -2007-03-28 Pedro Alves <pedro_alves@portugalmail.pt> - - * win32-i386-low.c: Rename to ... - * win32-low.c: ... this. - * configure.srv: Replace win32-i386-low.o with win32-low.o. - * Makefile.in: Likewise. - -2007-03-27 Pedro Alves <pedro_alves@portugalmail.pt> - - * remote-utils.c (monitor_output): Constify msg parameter. - * server.h (monitor_output): Likewise. - * win32-i386-low.c (handle_output_debug_string): New. - (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using - handle_output_debug_string. - (get_child_debug_event): Likewise. - -2007-03-27 Mat Hostetter <mat@lcs.mit.edu> - - * server.c (main): Correct strtoul check. - -2007-03-27 Jon Ringle <jon@ringle.org> - - * linux-low.c: Check __ARCH_HAS_MMU__ also. - -2007-03-27 Brooks Moses <brooks.moses@codesourcery.com> - - * Makefile.in: Add dummy "pdf" and "install-pdf" targets. - -2007-02-27 Daniel Jacobowitz <dan@codesourcery.com> - - * terminal.h: Check HAVE_SGTTY_H. - -2007-02-27 Mat Hostetter <mat@lcs.mit.edu> - - * remote-utils.c (remote_open): Print out the assigned port number. - -2007-02-26 Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c (monitor_output): New function. - * server.c (debug_threads): Define here. - (monitor_show_help): New function. - (handle_query): Handle qRcmd. - (main): Do not handle 'd' packet. - * server.h (debug_threads, remote_debug, monitor_output): Declare. - * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions - of debug_threads. - -2007-02-25 Pedro Alves <pedro_alves@portugalmail.pt> - - * Makefile.in (EXEEXT): New. - (clean): Use $(EXEEXT). - -2007-02-25 Pedro Alves <pedro_alves@portugalmail.pt> - - * target.h (target_ops): Rename send_signal to request_interrupt, - and remove enum target_signal parameter. - * linux-low.c (linux_request_interrupt): Rename from - linux_send_signal, and always send SIGINT. - * spu-low.c (spu_request_interrupt): Rename from spu_send_signal, - and always send SIGINT. - * remote-utils.c (putpkt_binary): Call request_interrupt, instead - of send_signal. - (input_interrupt): Likewise. - -2007-02-25 Pedro Alves <pedro_alves@portugalmail.pt> - - * server.c (get_features_xml): Check if target implemented - arch_string. - * win32-i386-low.c (win32_arch_string): New. - (win32_target_ops): Add win32_arch_string as arch_string member. - -2007-02-22 Markus Deuling <deuling@de.ibm.com> - - * spu-low.c (spu_arch_string): New. - (spu_target_ops): Add spu_arch_string. - -2007-02-16 Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c: Remove HAVE_TERMINAL_H check. - * configure.ac: Do not check for terminal.h. - * configure, config.in: Regenerated. - -2007-02-08 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (OBS): Add $(XML_BUILTIN). - (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New. - (clean): Update. - (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o) - (arm-with-iwmmxt.c): New. - * config.in, configure: Regenerate. - * configure.ac: Check for iWMMXt. Handle srv_xmltarget, - srv_xmlbuiltin, and srv_xmlfiles. Define USE_XML. - * configure.srv: Mention srv_xmltarget and srv_xmlfiles. - (arm*-*-linux*): Add iWMMXt and regset support. - * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define. - (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset) - (arm_store_wmmxregset, target_regsets): New. - * server.c (get_features_xml): Take annex argument. Check builtin - XML documents. - (handle_query): Handle multiple annexes. - -2007-01-29 Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c [USE_WIN32API] (read, write): Define. - (putpkt_binary, input_interrupt, readchar, getpkt): Use read and - write. - -2007-01-09 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-i386-low.c (the_low_target): Set arch_string. - * linux-x86-64-low.c (the_low_target): Likewise. - * linux-low.c (linux_arch_string): New. - (linux_target_ops): Add it. - * linux-low.h (struct linux_target_ops): Add arch_string. - * server.c (write_qxfer_response): Use const void * for DATA. - (get_features_xml): New. - (handle_query): Handle qXfer:features:read. Report it for qSupported. - * target.h (struct target_ops): Add arch_string method. - -2007-01-03 Denis Pilat <denis.pilat@st.com> - Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_kill): Handle being called with no threads. - * win32-i386-low.c (win32_kill): Likewise. - (get_child_debug_event): Clear current_process_handle. - -2006-12-30 Denis PILAT <denis.pilat@st.com> - Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c (remote_open): Check the type of specified - serial port devices before opening them. - * server.c (main): Kill the inferior if an error occurs during - the first remote_open. - -2006-12-05 Markus Deuling <deuling@de.ibm.com> - - * README: Update supported targets. - -2006-11-28 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (clean): Remove reg-mips64.c. - (reg-mips64.c, reg-mips64.o): New rules. - * configure.srv: Handle mips64. Include regset support for mips. - * linux-mips-low.c (union mips_register): New. - (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it. - (mips_breakpoint, mips_breakpoint_at): Use int. - (mips_collect_register, mips_supply_register) - (mips_collect_register_32bit, mips_supply_register_32bit) - (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset) - (mips_store_fpregset, target_regsets): New. - * thread-db.c (thread_db_get_tls_address): Use uintptr_t. - -2006-11-22 Ulrich Weigand <uweigand@de.ibm.com> - - * configure.srv: Add target "spu*-*-*". - * Makefile.in (clean): Remove reg-spu.c. - (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies. - * spu-low.c: New file. - -2006-11-16 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.ac: Correct td_thr_tls_get_addr test. - * configure: Regenerated. - -2006-11-16 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_wait_for_event): Reformat. Use the - pass_signals array. - * remote-utils.c (decode_address_to_semicolon): New. - * server.c (pass_signals, handle_general_set): New. - (handle_query): Mention QPassSignals for qSupported. - (main): Call handle_general_set. - * server.h (pass_signals, decode_address_to_semicolon): New. - -2006-11-06 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (handle_query): Correct error handling for read_auxv. - -2005-10-19 Ulrich Weigand <uweigand@de.ibm.com> - - * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets - and srv_linux_thread_db to yes. - * linux-s390-low.c (s390_fill_gregset): New function. - (target_regsets): Define data structure. - -2006-10-17 Daniel Jacobowitz <dan@codesourcery.com> - - * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New. - * configure.ac: Use it. Define HAVE_TD_THR_TLS_GET_ADDR. - * config.in, configure: Regenerated. - * inferiors.c (gdb_id_to_thread): New function. - (gdb_id_to_thread_id): Use it. - * linux-low.c (linux_target_ops): Use thread_db_get_tls_address. - * linux-low.h (struct process_info): Add th member. - (thread_db_get_tls_address): New prototype. - * remote-utils.c (decode_address): Make non-static. - * server.c (handle_query): Handle qGetTLSAddr. - * server.h (gdb_id_to_thread, decode_address): New prototypes. - * target.h (struct target_ops): Add get_tls_address. - * thread-db.c (maybe_attach_thread): Save the thread handle. - (thread_db_get_tls_address): New. - -2006-09-28 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define. - (linux_resume_one_process): Take a siginfo_t *. Update all - callers. Queue it if necessary. Use PTRACE_SETSIGINFO. - (struct pending_signals): Add a siginfo_t. - (linux_wait_for_process): Always set last_status. - (linux_wait_for_event): Use PTRACE_GETSIGINFO. - (linux_queue_one_thread): Use PTRACE_GETSIGINFO. - * linux-low.h (struct process_info): Add last_status. - -2006-09-21 Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c (try_rle): New function. - (putpkt_binary): Use it. - -2006-08-19 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (clean): Clean reg-x86-64-linux.c. - (reg-x86-64-linux.o, reg-x86-64-linux.c): New. - * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o. - * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX. - (x86_64_fill_gregset, x86_64_store_gregset): Skip floating - point registers. - -2006-08-08 Richard Sandiford <richard@codesourcery.com> - - * server.c (terminal_fd): New variable. - (old_foreground_pgrp): Likewise. - (restore_old_foreground_pgrp): New function. - (start_inferior): Record the terminal file descriptor in terminal_fd - and its original foreground group in old_foreground_pgrp. Register - restore_old_foreground_pgrp with atexit(). - -2006-07-26 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (handle_query): Correct qPart to qXfer. - -2006-07-22 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.ac: Check for more headers which are missing on - Windows. Automatically supply -lwsock32 and USE_WIN32API. - * configure.srv: Add Cygwin and mingw32. - * remote-utils.c: Don't include headers unconditionally which - are missing on mingw32. Include <winsock.h> for mingw32. - (remote_open): Adjust for mingw32 support. Flush - standard error after writing to it. - (remote_close, putpkt_binary, input_interrupt, block_async_io) - (unblock_async_io, enable_async_io, disable_async_io) - (readchar, getpkt): Update for Winsock support. - (prepare_resume_reply): Expect a protocol signal number. - * server.c: Disable <sys/wait.h> on mingw32. - (start_inferior): Adjust for mingw32 support. Flush - standard error after writing to it. - (attach_inferior): Likewise. Use protocol signal - numbers. - (main): Skip 'D' packet on mingw32. Use protocol signal numbers - and names. - * win32-i386-low.c: New file. - * Makefile.in (XM_CLIBS): Set. - (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS). - (win32-i386-low.o): New dependency rule. - * linux-low.c (linux_wait): Use target signal numbers. - * target.h (struct target_ops): Doc fix. - * server.h (target_signal_to_name): New prototype. - * gdbreplay.c: Don't include headers unconditionally which - are missing on mingw32. Include <winsock.h> for mingw32. - (remote_close, remote_open): Adjust for Winsock support. - * configure, config.in: Regenerated. - -2006-07-12 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (decode_xfer_read, write_qxfer_response): New. - (handle_query): Take a packet length argument. Handle - qXfer:auxv:read instead of qPart:auxv:read. Mention it in - the qSupported response. - (main): Update call to handle_query. - -2006-06-22 Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c (remote_escape_output, remote_unescape_input): New. - (putpkt_binary): Renamed from putpkt and adjusted for binary - data. - (putpkt): New wrapper for putpkt_binary. - (readchar): Don't mask off the high bit. - (decode_X_packet): New function. - * server.c (main): Call putpkt_binary if a handler sets the packet - length. Save the length of the incoming packet. Handle 'X'. - * server.h (gdb_byte, remote_escape_output, decode_X_packet): New. - -2006-06-21 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (handle_query): Handle qSupported. - -2006-05-30 Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c (all_symbols_looked_up): New variable. - (look_up_one_symbol): Check it. - * server.h (look_up_one_symbol): New declaration. - * thread-db.c (thread_db_init): Set all_symbols_looked_up. - -2006-05-30 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (linux-arm-low.o): Update dependencies. - * linux-arm-low.c: Include "gdb_proc_service.h". - (PTRACE_GET_THREAD_AREA): Define. - (ps_get_thread_area): New function. - -2006-05-09 Nathan Sidwell <nathan@codesourcery.com> - - * configure.srv (m68k*-*-uclinux*): New target. - * linux-low.c (linux_create_inferior): Use vfork on mmuless systems. - (linux_resume_one_process): Remove extraneous cast. - (linux_read_offsets): New. - (linux_target_op): Add linux_read_offsets on mmuless systems. - * server.c (handle_query): Add qOffsets logic. - * target.h (struct target_ops): Add read_offsets. - -2006-03-15 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h". - (PTRACE_GET_THREAD_AREA): Define. - (ps_get_thread_area): New function. - * Makefile.in (linux-i386-low.o, linux-mips-low.o) - (linux-x86-64-low.o): Update. - -2006-03-15 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.ac: Remove checks for prfpregset_t. - * gdb_proc_service.h: New file. - * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the - new "gdb_proc_service.h". - * proc-service.c: Likewise. - (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t. - (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument. - * Makefile.in (gdb_proc_service_h): Updated. - * configure, config.in: Regenerated. - -2006-03-03 Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c (prepare_resume_reply): Move declaration - of gdb_id_from_wait to the top of the block. - -2006-02-15 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (regsets_store_inferior_registers): Read the regset - from the target before filling it. - -2006-02-08 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (attach_inferior): Return SIGTRAP for a successful - attach. - -2006-02-01 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (OBS): Add version.o. - (STAGESTUFF): Delete. - (version.o): Add dependencies. - (version.c): Replace rule. - (clean): Remove version.c. - * server.c (gdbserver_version): New. - (gdbserver_usage): Use printf. - (main): Handle --version and --help. - * server.h (version, host_name): Add declarations. - -2005-12-23 Eli Zaretskii <eliz@gnu.org> - - * linux-arm-low.c: - * linux-arm-low.c: - * inferiors.c: - * i387-fp.h: - * i387-fp.c: - * gdbreplay.c: - * regcache.c: - * proc-service.c: - * mem-break.h: - * mem-break.c: - * linux-x86-64-low.c: - * linux-sh-low.c: - * linux-s390-low.c: - * linux-ppc64-low.c: - * linux-ppc-low.c: - * linux-mips-low.c: - * linux-m68k-low.c: - * linux-m32r-low.c: - * linux-low.h: - * linux-low.c: - * linux-ia64-low.c: - * linux-i386-low.c: - * linux-crisv32-low.c: - * thread-db.c: - * terminal.h: - * target.h: - * target.c: - * server.h: - * server.c: - * remote-utils.c: - * regcache.h: - * utils.c: - * Makefile.in: - * configure.ac: - * gdbserver.1: Add (C) after Copyright. Update the FSF - address. - -2005-11-13 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-arm-low.c (arm_eabi_breakpoint): New variable. - (arm_breakpoint_at): Recognize both breakpoints. - (the_low_target): Use the correct breakpoint instruction. - -2005-11-02 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.srv (x86_64-*-linux*): Turn on thread_db support. - * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len) - (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New. - (the_low_target): Update. - -2005-10-25 Andreas Schwab <schwab@suse.de> - - * server.c (main): Allocate mem_buf with PBUFSIZ bytes. - - * linux-ia64-low.c (ia64_regmap): Remove NAT registers. - (ia64_num_regs): Reduce to 462. - -2005-09-17 Daniel Jacobowitz <dan@codesourcery.com> - - * acinclude.m4: Correct quoting. - * aclocal.m4: Regenerated. - - Suggested by SZOKOVACS Robert <szo@ies.hu>: - * thread-db.c (thread_db_err_str): Handle TD_VERSION. - (thread_db_init): Call thread_db_err_str. - * configure.ac: Check for TD_VERSION. - * config.in, configure: Regenerated. - -2005-07-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * server.h (error, fatal, warning): Add ATTR_FORMAT. - -2005-07-13 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS - is not available. Define HAVE_PTRACE_GETREGS if it is. - * config.in, configure: Regenerated. - * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64. - * linux-i386-low.c, linux-m68k-low.c: Update to use - HAVE_PTRACE_GETREGS. - * linux-low.c (regsets_fetch_inferior_registers) - (regsets_store_inferior_registers): Only return 0 if we processed - GENERAL_REGS. - * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New. - * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New. - -2005-07-13 Daniel Jacobowitz <dan@codesourcery.com> - - * inferiors.c (struct thread_info): Add gdb_id. - (add_thread): Add gdb_id argument. - (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New. - * linux-low.c (linux_create_inferior, linux_attach_lwp): Update - calls to add_thread. - * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id. - * server.c (handle_query): Use thread_to_gdb_id. - (handle_v_cont, main): Use gdb_id_to_thread_id. - * server.h (add_thread): Update prototype. - (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New - prototypes. - -2005-07-13 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (fetch_register, usr_store_inferior_registers): Handle - left-padded registers. - * linux-low.h (struct linux_target_ops): Add left_pad_xfer. - * linux-ppc64-low.c (the_low_target): Set left_pad_xfer. - -2005-07-01 Steve Ellcey <sje@cup.hp.com> - - * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS. - * configure: Regenerate. - * config.in: Regenerate. - * server.h (NEED_DECLARATION_STRERROR): - Replace with !HAVE_DECL_STRERROR. - -2005-06-16 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_wait, linux_send_signal): Don't test - an unsigned long variable for > 0 if it could be MAX_ULONG. - * server.c (myresume): Likewise. - * target.c (set_desired_inferior): Likewise. - -2005-06-13 Mark Kettenis <kettenis@gnu.org> - - * configure.ac: Simplify and improve check for socklen_t. - * configure, config.in: Regenerate. - -2005-06-12 Daniel Jacobowitz <dan@codesourcery.com> - - * acconfig.h: Remove. - * configure.ac: Add a test for socklen_t. Use three-argument - AC_DEFINE throughout. - * config.in: Regenerated using autoheader 2.59. - * configure: Regenerated. - - * gdbreplay.c (socklen_t): Provide a default. - (remote_open): Use socklen_t. - * remote-utils.c (socklen_t): Provide a default. - (remote_open): Use socklen_t. - (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use - unsigned char. - - * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned - char for buffers. - * linux-low.c (linux_read_memory, linux_write_memory) - (linux_read_auxv): Likewise. - * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read) - (check_mem_write): Likewise. - * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write): - Likewise. - * regcache.c (struct inferior_rgcache_data, registers_to_string) - (registers_from_string, register_data): Likewise. - * server.c (handle_query, main): Likewise. - * server.h (convert_ascii_to_int, convert_int_to_ascii) - (decode_M_packet): Likewise. - * target.c (read_inferior_memory, write_inferior_memory): Likewise. - * target.h (struct target_ops): Update read_memory, write_memory, - and read_auxv. - (read_inferior_memory, write_inferior_memory): Update. - * linux-low.h (struct linux_target_ops): Change type of breakpoint - to unsigned char *. - * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c, - linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c, - linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c, - linux-s390-low.c, linux-sh-low.c: Update for changes in - read_inferior_memory and the_low_target->breakpoint. - -2005-05-28 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (SFILES): Add linux-ppc64-low.c. - (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets. - * configure.srv: Add powerpc64-*-linux*. - * linux-ppc64-low.c: New file. - -2005-05-23 Orjan Friberg <orjanf@axis.com> - - * linux-cris-low.c: New file with support for CRIS. - * linux-crisv32-low.c: Ditto for CRISv32. - * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c. - (clean): Add reg-cris.c and reg-crisv32.c. - Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c, - reg-crisv32.o, and reg-crisv32.c to make rules. - * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of - recognized targets. - -2005-05-16 Ulrich Weigand <uweigand@de.ibm.com> - - * linux-low.c (fetch_register): Ensure buffer size is a multiple - of sizeof (PTRACE_XFER_TYPE). - (usr_store_inferior_registers): Likewise. Zero out excess bytes. - -2005-05-12 Orjan Friberg <orjanf@axis.com> - - * target.h (struct target_ops): Add insert_watchpoint, - remove_watchpoint, stopped_by_watchpoint, stopped_data_address function - pointers for hardware watchpoint support. - * linux-low.h (struct linux_target_ops): Ditto. - * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint) - (linux_stopped_by_watchpoint, linux_stopped_data_address): New. Add - to linux_target_ops. - * remote-utils.c (prepare_resume_reply): Add watchpoint information to - reply packet. - * server.c (main): Recognize 'Z' and 'z' packets. - -2005-05-10 Ulrich Weigand <uweigand@de.ibm.com> - - * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define. - (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions. - (the_low_target): Add new members. - -2005-05-04 Daniel Jacobowitz <dan@codesourcery.com> - - * proc-service.c (ps_lgetregs): Search all_processes instead of - all_threads. - -2005-05-04 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (start_inferior): Change return type to int. - (attach_inferior): Change sigptr to int *. - (handle_v_cont, handle_v_requests): Change signal to int *. - (main): Change signal to int. - -2005-04-15 Kei Sakamoto <sakamoto.kei@renesas.com> - - * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o. - * configure.srv: Add m32r*-*-linux*. - * linux-m32r-low.c: New file. - -2005-03-04 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly. - -2005-03-03 Daniel Jacobowitz <dan@codesourcery.com> - - * inferiors.c (change_inferior_id, add_thread, find_inferior_id): - Take unsigned long arguments for PIDs. - * linux-low.c (add_process, linux_attach_lwp, linux_attach) - (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop) - (wait_for_sigstop, linux_resume_one_process) - (regsets_fetch_inferior_registers, linux_send_signal) - (linux_read_auxv): Likewise. Update the types of variables holding - PIDs. Update format string specifiers. - * linux-low.h (struct process_info, linux_attach_lwp): Likewise. - * remote-utils.c (prepare_resume_reply): Likewise. - * server.c (cont_thread, general_thread, step_thread) - (thread_from_wait, old_thread_from_wait, signal_pid): Change type to - unsigned long. - (handle_query): Update format specifiers. - (handle_v_cont, main): Use strtoul for thread IDs. - * server.h (struct inferior_list_entry): Use unsigned long for ID. - (add_thread, find_inferior_id, change_inferior_id, cont_thread) - (general_thread, step_thread, thread_from_wait) - (old_thread_from_wait): Update. - * target.h (struct thread_resume): Use unsigned long for THREAD. - (struct target_ops): Use unsigned long for arguments to attach and - thread_alive. - -2005-02-24 Daniel Jacobowitz <dan@codesourcery.com> - - * acinclude.m4: Include bfd/bfd.m4 directly. - * configure.ac: Use AC_ARG_PROGRAM. Suggested by Aron Griffis - <agriffis@toolchain.org>. - * aclocal.m4, configure: Regenerated. - -2005-01-07 Andrew Cagney <cagney@gnu.org> - - * configure.ac: Rename configure.in, require autoconf 2.59. - * configure: Re-generate. - -2004-12-08 Daniel Jacobowitz <dan@debian.org> - - * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area. Reset - LIBS when finished. - * aclocal.m4: Regenerated. - * configure: Regenerated. - -2004-11-21 Andreas Schwab <schwab@suse.de> - - * linux-m68k-low.c (m68k_num_gregs): Define. - (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset) - (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New. - (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc) - (m68k_breakpoint_at): New. Add to the_low_target. - - * configure.srv (m68*-*-linux*): Set srv_linux_regsets and - srv_linux_thread_db to yes. - -2004-10-20 Joel Brobecker <brobecker@gnat.com> - - * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing. - (ARCH_SET_FS): Likewise. - (ARCH_GET_FS): Likewise. - (ARCH_GET_GS): Likewise. - -2004-10-16 Daniel Jacobowitz <dan@debian.org> - - * linux-i386-low.c (ps_get_thread_area): New. - * linux-x86-64-low.c (ps_get_thread_area): New. - * linux-low.c: Include <sys/syscall.h>. - (linux_kill_one_process): Don't kill the first thread here. - (linux_kill): Kill the first thread here. - (kill_lwp): New function. - (send_sigstop, linux_send_signal): Use it. - * proc-service.c: Clean up #ifdefs. - (fpregset_info): Delete. - (ps_lgetregs): Update and enable implementation. - (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled - implementations. - * remote-utils.c (struct sym_cache, symbol_cache): New. - (input_interrupt): Print a clearer message. - (async_io_enabled): New variable. - (enable_async_io, disable_async_io): Use it. Update comments. - (look_up_one_symbol): Use the symbol cache. - * thread-db.c (thread_db_look_up_symbols): New function. - (thread_db_init): Update comments. Call thread_db_look_up_symbols. - -2004-10-16 Daniel Jacobowitz <dan@debian.org> - - * configure.in: Test for -rdynamic. - * configure: Regenerated. - * Makefile (INTERNAL_LDFLAGS): New. - (gdbserver, gdbreplay): Use it. - -2004-09-02 Andrew Cagney <cagney@gnu.org> - - * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE. - -2004-03-23 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_wait): Clear all_processes list also. - -2004-03-12 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c: Include <errno.h>. Remove extern declaration of - errno. - -2004-03-12 Daniel Jacobowitz <drow@mvista.com> - - * gdbreplay.c, server.h, utils.c: Update copyright years. - -2004-03-04 Nathan J. Williams <nathanw@wasabisystems.com> - - * server.c (main): Print child status or termination signal from - variable 'signal', not 'sig'. - -2004-03-04 Nathan J. Williams <nathanw@wasabisystems.com> - - * linux-low.c (linux_read_memory): Change return type to - int. Check for and return error from ptrace(). - * target.c (read_inferior_memory): Change return type to int. Pass - back return status from the_target->read_memory(). - * target.h (struct target_ops): Adapt *read_memory() prototype. - Update comment. - (read_inferior_memory): Adapt prototype. - * server.c (main): Return an error packet if - read_inferior_memory() returns an error. - -2004-03-04 Daniel Jacobowitz <drow@mvista.com> - - * Makefile.in (distclean): Remove config.h, stamp-h, and config.log. - Unify with other clean targets. - -2004-02-29 Daniel Jacobowitz <drow@mvista.com> - - * server.c (handle_v_cont): Call set_desired_inferior. - -2004-02-29 Daniel Jacobowitz <drow@mvista.com> - - * remote-utils.c (prepare_resume_reply): Always supply "thread:". - -2004-02-29 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_wait): Unblock async I/O. - (linux_resume): Block and enable async I/O. - * remote-utils.c (block_async_io, unblock_async_io): New functions. - * server.h (block_async_io, unblock_async_io): Add prototypes. - -2004-02-29 Daniel Jacobowitz <drow@mvista.com> - - * remote-utils.c (remote_open): Print a status notice after - opening a TCP port. - * server.c (attach_inferior): Print a status notice after - attaching. - -2004-02-29 Daniel Jacobowitz <drow@mvista.com> - - * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode. - -2004-02-26 Daniel Jacobowitz <drow@mvista.com> - - * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the - error packet. - * server.c, target.h: Update copyright years. - -2004-02-25 Roland McGrath <roland@redhat.com> - - * target.h (struct target_ops): New member `read_auxv'. - * server.c (handle_query): Handle qPart:auxv:read: query using that. - * linux-low.c (linux_read_auxv): New function. - (linux_target_ops): Initialize `read_auxv' member to that. - -2004-02-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> - - Committed by Jim Blandy <jimb@redhat.com>. - - * linux-s390-low.c (s390_num_regs): Update. - (s390_regmap): Remove control registers. Use __s390x__ predefine - instead of GPR_SIZE to distiguish s390 and s390x targets. - -2004-01-31 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c: Update copyright year. - (check_removed_breakpoint): Clear pending_is_breakpoint. - (linux_set_resume_request, linux_queue_one_thread) - (resume_status_pending_p): New functions. - (linux_continue_one_thread): Use process->resume. - (linux_resume): Only resume threads if there are no pending events. - * linux-low.h (struct process_info): Add resume request - pointer. - -2004-01-30 Daniel Jacobowitz <drow@mvista.com> - - * regcache.c (new_register_cache): Clear the allocated register - buffer. Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>. - -2003-10-13 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_resume): Take a struct thread_resume * - argument. - (linux_wait): Update call. - (resume_ptr): New static variable. - (linux_continue_one_thread): Renamed from - linux_continue_one_process. Use resume_ptr. - (linux_resume): Use linux_continue_one_thread. - * server.c (handle_v_cont, handle_v_requests): New functions. - (myresume): New function. - (main): Handle 'v' case. - * target.h (struct thread_resume): New type. - (struct target_ops): Change argument of "resume" to struct - thread_resume *. - (myresume): Delete macro. - -2003-08-08 H.J. Lu <hongjiu.lu@intel.com> - - * Makefile.in (install-only): Create dest dir. Support DESTDIR. - (uninstall): Support DESTDIR. - -Mon Jul 21 20:09:34 UTC 2003 Brendan Conoboy <blc@redhat.com> - - * configure.srv: Add xscale*linux copy of arm*linux entry. - -2003-07-24 Daniel Jacobowitz <drow@mvista.com> - - * linux-arm-low.c (arm_reinsert_addr): New function. - (the_low_target): Add arm_reinsert_addr. - -2003-07-08 Mark Kettenis <kettenis@gnu.org> - - * mem-break.c: Remove whitespace at end of file. - -2003-06-28 Daniel Jacobowitz <drow@mvista.com> - - * configure.in: Check whether we need to prototype strerror. - * server.h: Optionally prototype strerror. - * gdbreplay.c (perror_with_name): Use strerror. - * linux-low.c (linux_attach_lwp): Use strerror. - * utils.c (perror_with_name): Use strerror. - * config.in, configure: Regenerated. - -2003-06-28 Daniel Jacobowitz <drow@mvista.com> - - * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by - SUGIOKA Toshinobu <sugioka@itonet.co.jp>. - -2003-06-20 Daniel Jacobowitz <drow@mvista.com> - - * Makefile.in (SFILES): Update. - * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c, - low-sun3.c: Remove files. - -2003-06-17 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c: Move comment to linux_thread_alive where it belonged. - (linux_detach_one_process, linux_detach): New functions. - (linux_target_ops): Add linux_detach. - * server.c (main): Handle 'D' packet. - * target.h (struct target_ops): Add "detach" member. - (detach_inferior): Define. - -2003-06-13 Mark Kettenis <kettenis@gnu.org> - - From Kelley Cook <kelleycook@wideopenwest.com>: - * configure.srv: Accept i[34567]86 variants. - -2003-06-05 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_wait_for_event): Correct comment typos. - (linux_resume_one_process): Call check_removed_breakpoint. - (linux_send_signal): New function. - (linux_target_ops): Add linux_send_signal. - * remote-utils.c (putpkt, input_interrupt): Use send_signal instead - of kill. - * target.h (struct target_ops): Add send_signal. - -2003-05-29 Jim Blandy <jimb@redhat.com> - - * linux-low.c (usr_store_inferior_registers): Transfer buf in - PTRACE_XFER_TYPE-sized chunks, not int-sized chunks. Otherwise, - if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing - away part of the register's value. - -2003-03-26 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_create_inferior): Use __SIGRTMIN. - (linux_wait_for_event, linux_init_signals): Likewise. - -2003-03-17 Daniel Jacobowitz <drow@mvista.com> - - * configure.in: Check for stdlib.h. - * configure: Regenerated. - * config.in: Regenerated. - -2003-01-04 Andreas Schwab <schwab@suse.de> - - * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31. - -2003-01-02 Andrew Cagney <ac131313@redhat.com> - - * Makefile.in: Remove obsolete code. - -2002-11-20 Daniel Jacobowitz <drow@mvista.com> - - * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of - defined(PT_FPR0_HI). - -2002-11-17 Stuart Hughes <seh@zee2.com> - - * linux-arm-low.c (arm_num_regs): Increase. - (arm_regmap): Include status register. - -2002-11-17 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (register_addr): Remove incorrect -1 check. - -2002-08-29 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_create_inferior): Call setpgid. Return - the new PID. - (unstopped_p, linux_signal_pid): Remove. - (linux_target_ops): Remove linux_signal_pid. - * remote-utils.c (putpkt, input_interrupt): Use signal_pid - global instead of target method. - * target.h (struct target_ops): Remove signal_pid. Update comment - for create_inferior. - * server.c (signal_pid): New variable. - (create_inferior): Set signal_pid. Block SIGTTOU and SIGTTIN in - gdbserver. Set the child to be the foreground process group. - (attach_inferior): Set signal_pid. - -2002-08-23 Daniel Jacobowitz <drow@mvista.com> - - * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2. - -2002-08-20 Jim Blandy <jimb@redhat.com> - - * Makefile.in (LDFLAGS): Allow the configure script to establish a - default for this. - -2002-08-01 Andrew Cagney <cagney@redhat.com> - - * Makefile.in: Make chill references obsolete. - -2002-07-24 Kevin Buettner <kevinb@redhat.com> - - * configure.in (unistd.h): Add to AC_CHECK_HEADERS list. - * configure: Regenerate. - * config.in: Regenerate. - -2002-07-09 David O'Brien <obrien@FreeBSD.org> - - * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include. - (perror_with_name, remote_close, remote_open, expect, play): Static. - -2002-07-04 Michal Ludvig <mludvig@suse.cz> - - * linux-x86-64-low.c (x86_64_regmap): Make it an array of - byte offsets instead of an array of indexes. - (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const. - -2002-06-13 Daniel Jacobowitz <drow@mvista.com> - - * regcache.c: Add comment. - -2002-06-11 Daniel Jacobowitz <drow@mvista.com> - - * thread-db.c: New file. - * proc-service.c: New file. - * acinclude.m4: New file. - * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h, - proc-service.o, and thread-db.o. - (linux-low.o): Add USE_THREAD_DB. - * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T, - HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN. - * aclocal.m4: Regenerated. - * config.in: Regenerated. - * configure: Regenerated. - * configure.in: Check for proc_service.h, sys/procfs.h, - thread_db.h, and linux/elf.h headrs. - Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and - PRFPREGSET_T_BROKEN. Introduce srv_thread_depfiles and USE_THREAD_DB. - Check for -lthread_db and thread support. - * configure.srv: Enable thread_db support for ARM, i386, MIPS, - PowerPC, and SuperH. - * i387-fp.c: Constify arguments. - * i387-fp.h: Likewise. - * inferiors.c: (struct thread_info): Renamed from - `struct inferior_info'. Remove PID member. Use generic inferior - list header. All uses updated. - (inferiors, signal_pid): Removed. - (all_threads): New variable. - (get_thread): Define. - (add_inferior_to_list): New function. - (for_each_inferior): New function. - (change_inferior_id): New function. - (add_inferior): Removed. - (remove_inferior): New function. - (add_thread): New function. - (free_one_thread): New function. - (remove_thread): New function. - (clear_inferiors): Use for_each_inferior and free_one_thread. - (find_inferior): New function. - (find_inferior_id): New function. - (inferior_target_data): Update argument type. - (set_inferior_target_data): Likewise. - (inferior_regcache_data): Likewise. - (set_inferior_regcache_data): Likewise. - * linux-low.c (linux_bp_reinsert): Remove. - (all_processes, stopping_threads, using_thrads) - (struct pending_signals, debug_threads, pid_of): New. - (inferior_pid): Replace with macro. - (struct inferior_linux_data): Remove. - (get_stop_pc, add_process): New functions. - (linux_create_inferior): Restore SIGRTMIN+1 before calling exec. - Use add_process and add_thread. - (linux_attach_lwp): New function, based on old linux_attach. Use - add_process and add_thread. Set stop_expected for new threads. - (linux_attach): New function. - (linux_kill_one_process): New function. - (linux_kill): Kill all LWPs. - (linux_thread_alive): Use find_inferior_id. - (check_removed_breakpoints, status_pending_p): New functions. - (linux_wait_for_process): Renamed from linux_wait_for_one_inferior. - Update. Use WNOHANG. Wait for cloned processes also. Update process - struct for the found process. - (linux_wait_for_event): New function. - (linux_wait): Use it. Support LWPs. - (send_sigstop, wait_for_sigstop, stop_all_processes) - (linux_resume_one_process, linux_continue_one_process): New functions. - (linux_resume): Support LWPs. - (REGISTER_RAW_SIZE): Remove. - (fetch_register): Use register_size instead. Call supply_register. - (usr_store_inferior_registers): Likewise. Call collect_register. - Fix recursive case. - (regsets_fetch_inferior_registers): Improve error message. - (regsets_store_inferior_registers): Add debugging. - (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB. - (unstopped_p, linux_signal_pid): New functions. - (linux_target_ops): Add linux_signal_pid. - (linux_init_signals): New function. - (initialize_low): Call it. Initialize using_threads. - * regcache.c (inferior_regcache_data): Add valid - flag. - (get_regcache): Fetch registers lazily. Add fetch argument - and update all callers. - (regcache_invalidate_one, regcache_invalidate): New - functions. - (new_register_cache): Renamed from create_register_cache. - Return the new regcache. - (free_register_cache): Change argument to a void *. - (registers_to_string, registers_from_string): Call get_regcache - with fetch flag set. - (register_data): Make static. Pass fetch flag to get_regcache. - (supply_register): Call get_regcache with fetch flag clear. - (collect_register): Call get_regcache with fetch flag set. - (collect_register_as_string): New function. - * regcache.h: Update. - * remote-utils.c (putpkt): Flush after debug output and use - stderr. - Handle input interrupts while waiting for an ACK. - (input_interrupt): Use signal_pid method. - (getpkt): Flush after debug output and use stderr. - (outreg): Use collect_register_as_string. - (new_thread_notify, dead_thread_notify): New functions. - (prepare_resume_reply): Check using_threads. Set thread_from_wait - and general_thread. - (look_up_one_symbol): Flush after debug output. - * server.c (step_thread, server_waiting): New variables. - (start_inferior): Don't use signal_pid. Update call to mywait. - (attach_inferior): Update call to mywait. - (handle_query): Handle qfThreadInfo and qsThreadInfo. - (main): Don't fetch/store registers explicitly. Use - set_desired_inferior. Support proposed ``Hs'' packet. Update - calls to mywait. - * server.h: Update. - (struct inferior_list, struct_inferior_list_entry): New. - * target.c (set_desired_inferior): New. - (write_inferior_memory): Constify. - (mywait): New function. - * target.h: Update. - (struct target_ops): New signal_pid method. - (mywait): Removed macro, added prototype. - - * linux-low.h (regset_func): Removed. - (regset_fill_func, regset_store_func): New. - (enum regset_type): New. - (struct regset_info): Add type field. Use new operation types. - (struct linux_target_ops): stop_pc renamed to get_pc. - Add decr_pc_after_break and breakpoint_at. - (get_process, get_thread_proess, get_process_thread) - (strut process_info, all_processes, linux_attach_lwp) - (thread_db_init): New. - - * linux-arm-low.c (arm_get_pc, arm_set_pc, - arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New. - (the_low_target): Add new members. - * linux-i386-low.c (i386_store_gregset, i386_store_fpregset) - (i386_store_fpxregset): Constify. - (target_regsets): Add new kind identifier. - (i386_get_pc): Renamed from i386_stop_pc. Simplify. - (i386_set_pc): Add debugging. - (i386_breakpoint_at): New function. - (the_low_target): Add new members. - * linux-mips-low.c (mips_get_pc, mips_set_pc) - (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr) - (mips_breakpoint_at): New. - (the_low_target): Add new members. - * linux-ppc-low.c (ppc_get_pc, ppc_set_pc) - (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New. - (the_low_target): Add new members. - * linux-sh-low.c (sh_get_pc, sh_set_pc) - (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New. - (the_low_target): Add new members. - * linux-x86-64-low.c (target_regsets): Add new kind - identifier. - -2002-05-15 Daniel Jacobowitz <drow@mvista.com> - - From Martin Pool <mbp@samba.org>: - * server.c (gdbserver_usage): New function. - (main): Call it. - -2002-05-14 Daniel Jacobowitz <drow@mvista.com> - - * mem-break.c (reinsert_breakpoint_by_bp): Correct typo - stop_at -> stop_pc. - -2002-05-04 Andrew Cagney <ac131313@redhat.com> - - * Makefile.in: Remove obsolete code. - -2002-04-24 Michal Ludvig <mludvig@suse.cz> - - * linux-low.c (regsets_fetch_inferior_registers), - (regsets_store_inferior_registers): Removed cast to int from - ptrace() calls. - * regcache.h: Added declaration of struct inferior_info. - -2002-04-20 Daniel Jacobowitz <drow@mvista.com> - - * inferiors.c (struct inferior_info): Add regcache_data. - (add_inferior): Call create_register_cache. - (clear_inferiors): Call free_register_cache. - (inferior_regcache_data, set_inferior_regcache_data): New functions. - * regcache.c (struct inferior_regcache_data): New. - (registers): Remove. - (get_regcache): New function. - (create_register_cache, free_register_cache): New functions. - (set_register_cache): Don't initialize the register cache here. - (registers_to_string, registers_from_string, register_data): Call - get_regcache. - * regcache.h: Add prototypes. - * server.h: Likewise. - -2002-04-20 Daniel Jacobowitz <drow@mvista.com> - - * mem-break.c: New file. - * mem-break.h: New file. - * Makefile.in: Add mem-break.o rule; update server.h - dependencies. - * inferiors.c (struct inferior_info): Add target_data - member. - (clear_inferiors): Free target_data member if set. - (inferior_target_data, set_inferior_target_data): New functions. - * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len) - (i386_stop_pc, i386_set_pc): New. Add to the_low_target. - * linux-low.c (linux_bp_reinsert): New variable. - (struct inferior_linux_data): New. - (linux_create_inferior): Use set_inferior_target_data. - (linux_attach): Likewise. Call add_inferior. - (linux_wait_for_one_inferior): New function. - (linux_wait): Call it. - (linux_write_memory): Add const. - (initialize_low): Call set_breakpoint_data. - * linux-low.h (struct linux_target_ops): Add breakpoint - handling members. - * server.c (attach_inferior): Remove extra add_inferior - call. - * server.h: Include mem-break.h. Update inferior.c - prototypes. - * target.c (read_inferior_memory) - (write_inferior_memory): New functions. - * target.h (read_inferior_memory) - (write_inferior_memory): Change macros to prototypes. - (struct target_ops): Update comments. Add const to write_memory - definition. - -2002-04-11 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (usr_store_inferior_registers): Support - registers which are allowed to fail to store. - * linux-low.h (linux_target_ops): Likewise. - * linux-ppc-low.c (ppc_regmap): Support FPSCR. - (ppc_cannot_store_register): FPSCR may not be storable. - -2002-04-09 Daniel Jacobowitz <drow@mvista.com> - - * server.h: Include <string.h> if HAVE_STRING_H. - * ChangeLog: Correct paths in last ChangeLog entry. - -2002-04-09 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.h: Remove obsolete prototypes. - (struct linux_target_ops): New. - (extern the_low_target): New. - * linux-low.c (num_regs, regmap): Remove declarations. - (register_addr): Use the_low_target explicitly. - (fetch_register): Likewise. - (usr_fetch_inferior_registers): Likewise. - (usr_store_inferior_registers): Likewise. - * linux-arm-low.c (num_regs): Remove. - (arm_num_regs): Define. - (arm_regmap): Renamed from regmap, made static. - (arm_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (arm_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-i386-low.c (num_regs): Remove. - (i386_num_regs): Define. - (i386_regmap): Renamed from regmap, made static. - (i386_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (i386_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-ia64-low.c (num_regs): Remove. - (ia64_num_regs): Define. - (ia64_regmap): Renamed from regmap, made static. - (ia64_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (ia64_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-m68k-low.c (num_regs): Remove. - (m68k_num_regs): Define. - (m68k_regmap): Renamed from regmap, made static. - (m68k_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (m68k_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-mips-low.c (num_regs): Remove. - (mips_num_regs): Define. - (mips_regmap): Renamed from regmap, made static. - (mips_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (mips_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-ppc-low.c (num_regs): Remove. - (ppc_num_regs): Define. - (ppc_regmap): Renamed from regmap, made static. - (ppc_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (ppc_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-s390-low.c (num_regs): Remove. - (s390_num_regs): Define. - (s390_regmap): Renamed from regmap, made static. - (s390_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (s390_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-sh-low.c (num_regs): Remove. - (sh_num_regs): Define. - (sh_regmap): Renamed from regmap, made static. - (sh_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (sh_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap. - (the_low_target): New. - -2002-04-09 Daniel Jacobowitz <drow@mvista.com> - - * Makefile.in: Add stamp-h target. - * configure.in: Create stamp-h. - * configure: Regenerated. - -2002-04-09 Daniel Jacobowitz <drow@mvista.com> - - * inferiors.c: New file. - * target.c: New file. - * target.h: New file. - * Makefile.in: Add target.o and inferiors.o. Update - dependencies. - * linux-low.c (inferior_pid): New static variable, - moved from server.c. - (linux_create_inferior): Renamed from create_inferior. - Call add_inferior. Return 0 on success instead of a PID. - (linux_attach): Renamed from myattach. - (linux_kill): Renamed from kill_inferior. Call clear_inferiors (). - (linux_thread_alive): Renamed from mythread_alive. - (linux_wait): Renamed from mywait. Call clear_inferiors () if the - child dies. - (linux_resume): Renamed from myresume. Add missing ``return 0''. - (regsets_store_inferior_registers): Correct error message. - Add missing ``return 0''. - (linux_fetch_registers): Renamed from fetch_inferior_registers. - (linux_store_registers): Renamed from store_inferior_registers. - (linux_read_memory): Renamed from read_inferior_memory. - (linux_write_memory): Renamed from write_inferior_memory. - (linux_target_ops): New structure. - (initialize_low): Call set_target_ops (). - * remote-utils.c (unhexify): New function. - (hexify): New function. - (input_interrupt): Send signals to ``signal_pid''. - * server.c (inferior_pid): Remove. - (start_inferior): Update create_inferior call. - (attach_inferior): Call add_inferior. - (handle_query): New function. - (main): Call handle_query for `q' packets. - * server.h: Include "target.h". Remove obsolete prototypes. - Add prototypes for "inferiors.c", "target.c", hexify, and unhexify. - -2002-04-09 Daniel Jacobowitz <drow@mvista.com> - - * Makefile.in: Add WARN_CFLAGS. Update configury - dependencies. - * configure.in: Check for <string.h> - * configure: Regenerate. - * config.in: Regenerate. - * gdbreplay.c: Include needed system headers. - (remote_open): Remove strchr prototype. - * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS. - * regcache.c (supply_register): Change buf argument to const void *. - (supply_register_by_name): Likewise. - (collect_register): Change buf argument to void *. - (collect_register_by_name): Likewise. - * regcache.h: Add missing prototypes. - * remote-utils.c: Include <arpa/inet.h> for inet_ntoa. - * server.c (handle_query): New function. - (attached): New static variable, moved out of main. - (main): Quiet longjmp clobber warnings. - * server.h: Add ATTR_NORETURN and ATTR_FORMAT. Update prototypes. - * utils.c (error): Remove NORETURN. - (fatal): Likewise. diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in deleted file mode 100644 index 01729ce9b1d..00000000000 --- a/gdb/gdbserver/Makefile.in +++ /dev/null @@ -1,638 +0,0 @@ -# Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 -# 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/>. - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -host_alias = @host_alias@ -target_alias = @target_alias@ -program_transform_name = @program_transform_name@ -bindir = @bindir@ -libdir = @libdir@ -tooldir = $(libdir)/$(target_alias) - -datarootdir = @datarootdir@ -datadir = @datadir@ -mandir = @mandir@ -man1dir = $(mandir)/man1 -man2dir = $(mandir)/man2 -man3dir = $(mandir)/man3 -man4dir = $(mandir)/man4 -man5dir = $(mandir)/man5 -man6dir = $(mandir)/man6 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -man9dir = $(mandir)/man9 -infodir = @infodir@ -htmldir = $(prefix)/html -includedir = @includedir@ - -SHELL = /bin/sh -EXEEXT = @EXEEXT@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -CC = @CC@ - -# Directory containing source files. Don't clean up the spacing, -# this exact string is matched for by the "configure" script. -srcdir = @srcdir@ -VPATH = @srcdir@ - -# It is also possible that you will need to add -I/usr/include/sys to the -# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which -# is where it should be according to Posix). - -# Set this up with gcc if you have gnu ld and the loader will print out -# line numbers for undefinded refs. -#CC-LD=gcc -static -CC-LD=${CC} - -# Where is the "include" directory? Traditionally ../include or ./include -INCLUDE_DIR = ${srcdir}/../../include -INCLUDE_DEP = $$(INCLUDE_DIR) - -# Where is ust? These will be empty if ust was not available. -ustlibs = @ustlibs@ -ustinc = @ustinc@ - -# All the includes used for CFLAGS and for lint. -# -I. for config files. -# -I${srcdir} for our headers. -# -I$(srcdir)/../regformats for regdef.h. -INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../common \ - -I$(srcdir)/../regformats -I$(INCLUDE_DIR) - -# M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS -# from the config/ directory. -GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS} -#PROFILE_CFLAGS = -pg - -WARN_CFLAGS = @WARN_CFLAGS@ -WERROR_CFLAGS = @WERROR_CFLAGS@ - -# CFLAGS is specifically reserved for setting from the command line -# when running make. I.E. "make CFLAGS=-Wmissing-prototypes". -CFLAGS = @CFLAGS@ - -# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. -INTERNAL_CFLAGS_BASE = ${CFLAGS} ${GLOBAL_CFLAGS} \ - ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} -INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS) -INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) - -# LDFLAGS is specifically reserved for setting from the command line -# when running make. -LDFLAGS = @LDFLAGS@ -INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@ - -# All source files that go into linking GDB remote server. - -SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c \ - $(srcdir)/mem-break.c $(srcdir)/proc-service.c \ - $(srcdir)/proc-service.list $(srcdir)/regcache.c \ - $(srcdir)/remote-utils.c $(srcdir)/server.c $(srcdir)/target.c \ - $(srcdir)/thread-db.c $(srcdir)/utils.c \ - $(srcdir)/linux-arm-low.c $(srcdir)/linux-bfin-low.c \ - $(srcdir)/linux-cris-low.c $(srcdir)/linux-crisv32-low.c \ - ${srcdir}/i386-low.c $(srcdir)/i387-fp.c \ - $(srcdir)/linux-ia64-low.c $(srcdir)/linux-low.c \ - $(srcdir)/linux-m32r-low.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-sparc-low.c \ - $(srcdir)/linux-x86-low.c \ - $(srcdir)/linux-xtensa-low.c \ - $(srcdir)/win32-arm-low.c $(srcdir)/win32-i386-low.c \ - $(srcdir)/win32-low.c $(srcdir)/wincecompat.c \ - $(srcdir)/hostio.c $(srcdir)/hostio-errno.c \ - $(srcdir)/common/common-utils.c $(srcdir)/common/xml-utils.c \ - $(srcdir)/common/linux-osdata.c $(srcdir)/common/ptid.c \ - $(srcdir)/common/buffer.c - -DEPFILES = @GDBSERVER_DEPFILES@ - -LIBOBJS = @LIBOBJS@ - -SOURCES = $(SFILES) -TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS} - -OBS = inferiors.o regcache.o remote-utils.o server.o signals.o target.o \ - utils.o version.o \ - mem-break.o hostio.o event-loop.o tracepoint.o \ - xml-utils.o common-utils.o ptid.o buffer.o \ - $(XML_BUILTIN) \ - $(DEPFILES) $(LIBOBJS) -GDBREPLAY_OBS = gdbreplay.o version.o -GDBSERVER_LIBS = @GDBSERVER_LIBS@ -XM_CLIBS = @LIBS@ -CDEPS = $(srcdir)/proc-service.list - -# XML files to compile in to gdbserver, if any. -XML_DIR = $(srcdir)/../features -XML_FILES = @srv_xmlfiles@ -XML_BUILTIN = @srv_xmlbuiltin@ - -IPA_DEPFILES = @IPA_DEPFILES@ -extra_libraries = @extra_libraries@ - -FLAGS_TO_PASS = \ - "prefix=$(prefix)" \ - "exec_prefix=$(exec_prefix)" \ - "infodir=$(infodir)" \ - "datarootdir=$(datarootdir)" \ - "docdir=$(docdir)" \ - "htmldir=$(htmldir)" \ - "pdfdir=$(pdfdir)" \ - "libdir=$(libdir)" \ - "mandir=$(mandir)" \ - "datadir=$(datadir)" \ - "includedir=$(includedir)" \ - "against=$(against)" \ - "DESTDIR=$(DESTDIR)" \ - "AR=$(AR)" \ - "AR_FLAGS=$(AR_FLAGS)" \ - "CC=$(CC)" \ - "CFLAGS=$(CFLAGS)" \ - "CXX=$(CXX)" \ - "CXXFLAGS=$(CXXFLAGS)" \ - "DLLTOOL=$(DLLTOOL)" \ - "LDFLAGS=$(LDFLAGS)" \ - "RANLIB=$(RANLIB)" \ - "MAKEINFO=$(MAKEINFO)" \ - "MAKEHTML=$(MAKEHTML)" \ - "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \ - "INSTALL=$(INSTALL)" \ - "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ - "INSTALL_DATA=$(INSTALL_DATA)" \ - "RUNTEST=$(RUNTEST)" \ - "RUNTESTFLAGS=$(RUNTESTFLAGS)" - -# Prevent Sun make from putting in the machine type. Setting -# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1. -.c.o: - ${CC} -c ${INTERNAL_CFLAGS} $< - -all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT) $(extra_libraries) - -# Traditionally "install" depends on "all". But it may be useful -# not to; for example, if the user has made some trivial change to a -# source file and doesn't care about rebuilding or just wants to save the -# time it takes for make to check that all is up to date. -# install-only is intended to address that need. -install: all - @$(MAKE) $(FLAGS_TO_PASS) install-only - -install-only: - n=`echo gdbserver | sed '$(program_transform_name)'`; \ - if [ x$$n = x ]; then n=gdbserver; else true; fi; \ - if [ x"$(IPA_DEPFILES)" != x ]; then \ - $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir); \ - $(INSTALL_PROGRAM) $(IPA_LIB) $(DESTDIR)$(libdir)/$(IPA_LIB); \ - fi; \ - $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \ - $(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT); \ - $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(man1dir); \ - $(INSTALL_DATA) $(srcdir)/gdbserver.1 $(DESTDIR)$(man1dir)/$$n.1 - -uninstall: force - n=`echo gdbserver | sed '$(program_transform_name)'`; \ - if [ x$$n = x ]; then n=gdbserver; else true; fi; \ - rm -f $(DESTDIR)/$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(man1dir)/$$n.1 - -installcheck: -check: -info dvi pdf: -install-info: -install-pdf: -html: -install-html: -clean-info: - -gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} - rm -f gdbserver$(EXEEXT) - ${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \ - $(GDBSERVER_LIBS) $(XM_CLIBS) - -gdbreplay$(EXEEXT): $(GDBREPLAY_OBS) - rm -f gdbreplay$(EXEEXT) - ${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) \ - $(XM_CLIBS) - -IPA_OBJS=tracepoint-ipa.o utils-ipa.o regcache-ipa.o remote-utils-ipa.o common-utils-ipa.o ${IPA_DEPFILES} - -IPA_LIB=libinproctrace.so - -$(IPA_LIB): $(IPA_OBJS) ${ADD_DEPS} ${CDEPS} - rm -f $(IPA_LIB) - ${CC-LD} -shared -fPIC -Wl,--no-undefined $(INTERNAL_CFLAGS) \ - $(INTERNAL_LDFLAGS) -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread - -# Put the proper machine-specific files first, so M-. on a machine -# specific routine gets the one for the correct machine. -# The xyzzy stuff below deals with empty DEPFILES -TAGS: ${TAGFILES} - etags `find ${srcdir}/../config -name $(DEPRECATED_TM_FILE) -print` \ - `find ${srcdir}/../config -name ${XM_FILE} -print` \ - `find ${srcdir}/../config -name ${NAT_FILE} -print` \ - `for i in yzzy ${DEPFILES}; do \ - if [ x$$i != xyzzy ]; then \ - echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \ - fi; \ - done` \ - ${TAGFILES} -tags: TAGS - -clean: - rm -f *.o ${ADD_FILES} *~ - rm -f version.c - rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log - rm -f $(IPA_LIB) - rm -f reg-arm.c reg-bfin.c i386.c reg-ia64.c reg-m32r.c reg-m68k.c - rm -f reg-sh.c reg-sparc.c reg-spu.c amd64.c i386-linux.c - rm -f reg-cris.c reg-crisv32.c amd64-linux.c reg-xtensa.c - rm -f arm-with-iwmmxt.c - rm -f arm-with-vfpv2.c arm-with-vfpv3.c arm-with-neon.c - rm -f mips-linux.c mips64-linux.c - rm -f powerpc-32.c powerpc-32l.c powerpc-64l.c powerpc-e500l.c - rm -f powerpc-altivec32l.c powerpc-cell32l.c powerpc-vsx32l.c - rm -f powerpc-altivec64l.c powerpc-cell64l.c 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 s390-linux32.c s390-linux64.c s390x-linux64.c - rm -f tic6x-c64xp-linux.c tic6x-c64x-linux.c tic6x-c62x-linux.c - rm -f xml-builtin.c stamp-xml - rm -f i386-avx.c i386-avx-linux.c - rm -f amd64-avx.c amd64-avx-linux.c - rm -f i386-mmx.c i386-mmx-linux.c - -maintainer-clean realclean distclean: clean - rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log - rm -f Makefile - -config.h: stamp-h ; @true -stamp-h: config.in config.status - CONFIG_FILES="" CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status - -Makefile: Makefile.in config.status - CONFIG_HEADERS="" $(SHELL) ./config.status - -config.status: configure configure.srv - $(SHELL) ./config.status --recheck - -force: - -version.c: Makefile $(srcdir)/../version.in - rm -f version.c-tmp version.c - echo '#include "server.h"' >> version.c-tmp - echo 'const char version[] = "'"`sed q ${srcdir}/../version.in`"'";' >> version.c-tmp - echo 'const char host_name[] = "$(host_alias)";' >> version.c-tmp - mv version.c-tmp version.c -version.o: version.c $(server_h) - -xml-builtin.c: stamp-xml; @true -stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES) - rm -f xml-builtin.tmp - $(SHELL) $(XML_DIR)/feature_to_c.sh xml-builtin.tmp $(XML_FILES) - $(SHELL) $(srcdir)/../../move-if-change xml-builtin.tmp xml-builtin.c - echo stamp > stamp-xml - -.PRECIOUS: xml-builtin.c - -# GNU Make has an annoying habit of putting *all* the Makefile variables -# into the environment, unless you include this target as a circumvention. -# Rumor is that this will be fixed (and this target can be removed) -# in GNU Make 4.0. -.NOEXPORT: - -# GNU Make 3.63 has a different problem: it keeps tacking command line -# overrides onto the definition of $(MAKE). This variable setting -# will remove them. -MAKEOVERRIDES= - -gdb_proc_service_h = $(srcdir)/gdb_proc_service.h -regdat_sh = $(srcdir)/../regformats/regdat.sh -regdef_h = $(srcdir)/../regformats/regdef.h -regcache_h = $(srcdir)/regcache.h -signals_def = $(srcdir)/../../include/gdb/signals.def -signals_h = $(srcdir)/../../include/gdb/signals.h $(signals_def) -ptid_h = $(srcdir)/../common/ptid.h -linux_osdata_h = $(srcdir)/../common/linux-osdata.h -server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \ - $(srcdir)/mem-break.h $(srcdir)/../common/gdb_signals.h \ - $(srcdir)/../common/common-utils.h \ - $(srcdir)/../common/xml-utils.h \ - $(srcdir)/../common/buffer.h \ - $(srcdir)/../common/gdb_assert.h \ - $(srcdir)/../common/gdb_locale.h \ - $(ptid_h) \ - $(signals_h) - -linux_low_h = $(srcdir)/linux-low.h - -linux_ptrace_h = $(srcdir)/../common/linux-ptrace.h - -gdb_thread_db_h = $(srcdir)/../common/gdb_thread_db.h - -linux_procfs_h = $(srcdir)/../common/linux-procfs.h - -lynx_low_h = $(srcdir)/lynx-low.h $(srcdir)/server.h - -nto_low_h = $(srcdir)/nto-low.h - -UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION - -# Note, we only build the IPA if -fvisibility=hidden is supported in -# the first place. -IPAGENT_CFLAGS = $(CPPFLAGS) $(INTERNAL_CFLAGS) $(UST_CFLAGS) \ - -fPIC -DGDBSERVER -DIN_PROCESS_AGENT \ - -fvisibility=hidden - -# In-process agent object rules -tracepoint-ipa.o: tracepoint.c $(server_h) $(srcdir)/../common/ax.def - $(CC) -c $(IPAGENT_CFLAGS) $< -o tracepoint-ipa.o -utils-ipa.o: utils.c $(server_h) - $(CC) -c $(IPAGENT_CFLAGS) $< -o utils-ipa.o -common-utils-ipa.o: ../common/common-utils.c $(server_h) - $(CC) -c $(IPAGENT_CFLAGS) $< -o common-utils-ipa.o -remote-utils-ipa.o: remote-utils.c $(server_h) - $(CC) -c $(IPAGENT_CFLAGS) $< -o remote-utils-ipa.o -regcache-ipa.o: regcache.c $(server_h) - $(CC) -c $(IPAGENT_CFLAGS) $< -o regcache-ipa.o -i386-linux-ipa.o : i386-linux.c $(regdef_h) - $(CC) -c $(IPAGENT_CFLAGS) $< -o i386-linux-ipa.o -linux-i386-ipa.o: linux-i386-ipa.c $(server_h) - $(CC) -c $(IPAGENT_CFLAGS) $< -o linux-i386-ipa.o -linux-amd64-ipa.o: linux-amd64-ipa.c $(server_h) - $(CC) -c $(IPAGENT_CFLAGS) $< -o linux-amd64-ipa.o -amd64-linux-ipa.o : amd64-linux.c $(regdef_h) - $(CC) -c $(IPAGENT_CFLAGS) $< -o amd64-linux-ipa.o - -event-loop.o: event-loop.c $(server_h) -hostio.o: hostio.c $(server_h) -hostio-errno.o: hostio-errno.c $(server_h) -inferiors.o: inferiors.c $(server_h) -mem-break.o: mem-break.c $(server_h) -proc-service.o: proc-service.c $(server_h) $(gdb_proc_service_h) -regcache.o: regcache.c $(server_h) $(regdef_h) -remote-utils.o: remote-utils.c terminal.h $(server_h) -server.o: server.c $(server_h) -target.o: target.c $(server_h) -thread-db.o: thread-db.c $(server_h) $(linux_low_h) $(gdb_proc_service_h) \ - $(gdb_thread_db_h) -tracepoint.o: tracepoint.c $(server_h) $(srcdir)/../common/ax.def -utils.o: utils.c $(server_h) -gdbreplay.o: gdbreplay.c config.h - -signals.o: ../common/signals.c $(server_h) $(signals_def) - $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER - -linux-procfs.o: ../common/linux-procfs.c $(server_h) - $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER - -common-utils.o: ../common/common-utils.c $(server_h) - $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER - -xml-utils.o: ../common/xml-utils.c $(server_h) - $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER - -linux-osdata.o: ../common/linux-osdata.c $(server_h) $(linux_osdata_h) ../common/gdb_dirent.h - $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER - -ptid.o: ../common/ptid.c $(ptid_h) - $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER - -buffer.o: ../common/buffer.c $(server_h) - $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER - -# We build memmem.c without -Werror because this file is not under -# our control. On LynxOS, the compiler generates some warnings -# because str-two-way.h uses a constant (MAX_SIZE) whose definition -# makes it ambiguous whether it is signed or unsigned ("warning: this -# decimal constant is unsigned only in ISO C90"). -memmem.o: ../gnulib/memmem.c - $(CC) -o memmem.o -c $(CPPFLAGS) $(INTERNAL_WARN_CFLAGS) $< - -# We build vasprintf with -DHAVE_CONFIG_H because we want that unit to -# include our config.h file. Otherwise, some system headers do not get -# included, and the compiler emits a warning about implicitly defined -# functions (missing declaration). -vasprintf.o: $(srcdir)/../../libiberty/vasprintf.c - $(CC) -o vasprintf.o -c $(CPPFLAGS) $(INTERNAL_CFLAGS) -DHAVE_CONFIG_H $< -vsnprintf.o: $(srcdir)/../../libiberty/vsnprintf.c - $(CC) -o vsnprintf.o -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< - -i386_low_h = $(srcdir)/i386-low.h - -i386-low.o: i386-low.c $(i386_low_h) $(server_h) $(target_h) - -i387-fp.o: i387-fp.c $(server_h) - -linux-low.o: linux-low.c $(linux_low_h) $(linux_ptrace_h) $(linux_procfs_h) \ - $(server_h) $(linux_osdata_h) - $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< @USE_THREAD_DB@ - -linux-arm-low.o: linux-arm-low.c $(linux_low_h) $(server_h) \ - $(gdb_proc_service_h) -linux-bfin-low.o: linux-bfin-low.c $(linux_low_h) $(server_h) -linux-cris-low.o: linux-cris-low.c $(linux_low_h) $(server_h) -linux-crisv32-low.o: linux-crisv32-low.c $(linux_low_h) $(server_h) -linux-ia64-low.o: linux-ia64-low.c $(linux_low_h) $(server_h) -linux-m32r-low.o: linux-m32r-low.c $(linux_low_h) $(server_h) -linux-mips-low.o: linux-mips-low.c $(linux_low_h) $(server_h) \ - $(gdb_proc_service_h) -linux-ppc-low.o: linux-ppc-low.c $(linux_low_h) $(server_h) -linux-s390-low.o: linux-s390-low.c $(linux_low_h) $(server_h) -linux-sh-low.o: linux-sh-low.c $(linux_low_h) $(server_h) -linux-tic6x-low.o: linux-tic6x-low.c $(linux_low_h) $(server_h) -linux-x86-low.o: linux-x86-low.c $(linux_low_h) $(server_h) \ - $(gdb_proc_service_h) $(i386_low_h) -linux-xtensa-low.o: linux-xtensa-low.c xtensa-xtregs.c $(linux_low_h) $(server_h) - -lynx-low.o: lynx-low.c $(server_h) $(target_h) $(lynx_low_h) -lynx-ppc-low.o: lynx-ppc-low.c $(server_h) $(lynx_low_h) -nto-low.o: nto-low.c $(server_h) $(nto_low_h) -nto-x86-low.o: nto-x86-low.c $(server_h) $(nto_low_h) $(regdef_h) $(regcache_h) - -win32_low_h = $(srcdir)/win32-low.h - -win32-low.o: win32-low.c $(win32_low_h) $(server_h) $(regdef_h) $(regcache_h) - -win32-arm-low.o: win32-arm-low.c $(win32_low_h) $(server_h) -win32-i386-low.o: win32-i386-low.c $(win32_low_h) $(server_h) $(i386_low_h) - -spu-low.o: spu-low.c $(server_h) - -reg-arm.o : reg-arm.c $(regdef_h) -reg-arm.c : $(srcdir)/../regformats/reg-arm.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-arm.dat reg-arm.c -arm-with-iwmmxt.o : arm-with-iwmmxt.c $(regdef_h) -arm-with-iwmmxt.c : $(srcdir)/../regformats/arm-with-iwmmxt.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/arm-with-iwmmxt.dat arm-with-iwmmxt.c -arm-with-vfpv2.o : arm-with-vfpv2.c $(regdef_h) -arm-with-vfpv2.c : $(srcdir)/../regformats/arm-with-vfpv2.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/arm-with-vfpv2.dat arm-with-vfpv2.c -arm-with-vfpv3.o : arm-with-vfpv3.c $(regdef_h) -arm-with-vfpv3.c : $(srcdir)/../regformats/arm-with-vfpv3.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/arm-with-vfpv3.dat arm-with-vfpv3.c -arm-with-neon.o : arm-with-neon.c $(regdef_h) -arm-with-neon.c : $(srcdir)/../regformats/arm-with-neon.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/arm-with-neon.dat arm-with-neon.c -reg-bfin.o : reg-bfin.c $(regdef_h) -reg-bfin.c : $(srcdir)/../regformats/reg-bfin.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-bfin.dat reg-bfin.c -reg-cris.o : reg-cris.c $(regdef_h) -reg-cris.c : $(srcdir)/../regformats/reg-cris.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-cris.dat reg-cris.c -reg-crisv32.o : reg-crisv32.c $(regdef_h) -reg-crisv32.c : $(srcdir)/../regformats/reg-crisv32.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-crisv32.dat reg-crisv32.c -i386.o : i386.c $(regdef_h) -i386.c : $(srcdir)/../regformats/i386/i386.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386.dat i386.c -i386-linux.o : i386-linux.c $(regdef_h) -i386-linux.c : $(srcdir)/../regformats/i386/i386-linux.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-linux.dat i386-linux.c -i386-avx.o : i386-avx.c $(regdef_h) -i386-avx.c : $(srcdir)/../regformats/i386/i386-avx.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-avx.dat i386-avx.c -i386-avx-linux.o : i386-avx-linux.c $(regdef_h) -i386-avx-linux.c : $(srcdir)/../regformats/i386/i386-avx-linux.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-avx-linux.dat i386-avx-linux.c -i386-mmx.o : i386-mmx.c $(regdef_h) -i386-mmx.c : $(srcdir)/../regformats/i386/i386-mmx.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-mmx.dat i386-mmx.c -i386-mmx-linux.o : i386-mmx-linux.c $(regdef_h) -i386-mmx-linux.c : $(srcdir)/../regformats/i386/i386-mmx-linux.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/i386-mmx-linux.dat i386-mmx-linux.c -reg-ia64.o : reg-ia64.c $(regdef_h) -reg-ia64.c : $(srcdir)/../regformats/reg-ia64.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-ia64.dat reg-ia64.c -reg-m32r.o : reg-m32r.c $(regdef_h) -reg-m32r.c : $(srcdir)/../regformats/reg-m32r.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-m32r.dat reg-m32r.c -reg-m68k.o : reg-m68k.c $(regdef_h) -reg-m68k.c : $(srcdir)/../regformats/reg-m68k.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-m68k.dat reg-m68k.c -reg-cf.o : reg-cf.c $(regdef_h) -reg-cf.c : $(srcdir)/../regformats/reg-cf.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-cf.dat reg-cf.c -mips-linux.o : mips-linux.c $(regdef_h) -mips-linux.c : $(srcdir)/../regformats/mips-linux.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/mips-linux.dat mips-linux.c -mips64-linux.o : mips64-linux.c $(regdef_h) -mips64-linux.c : $(srcdir)/../regformats/mips64-linux.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/mips64-linux.dat mips64-linux.c -powerpc-32.o : powerpc-32.c $(regdef_h) -powerpc-32.c : $(srcdir)/../regformats/rs6000/powerpc-32.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-32.dat powerpc-32.c -powerpc-32l.o : powerpc-32l.c $(regdef_h) -powerpc-32l.c : $(srcdir)/../regformats/rs6000/powerpc-32l.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-32l.dat powerpc-32l.c -powerpc-altivec32l.o : powerpc-altivec32l.c $(regdef_h) -powerpc-altivec32l.c : $(srcdir)/../regformats/rs6000/powerpc-altivec32l.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-altivec32l.dat powerpc-altivec32l.c -powerpc-cell32l.o : powerpc-cell32l.c $(regdef_h) -powerpc-cell32l.c : $(srcdir)/../regformats/rs6000/powerpc-cell32l.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-cell32l.dat powerpc-cell32l.c -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 -powerpc-64l.o : powerpc-64l.c $(regdef_h) -powerpc-64l.c : $(srcdir)/../regformats/rs6000/powerpc-64l.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-64l.dat powerpc-64l.c -powerpc-altivec64l.o : powerpc-altivec64l.c $(regdef_h) -powerpc-altivec64l.c : $(srcdir)/../regformats/rs6000/powerpc-altivec64l.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-altivec64l.dat powerpc-altivec64l.c -powerpc-cell64l.o : powerpc-cell64l.c $(regdef_h) -powerpc-cell64l.c : $(srcdir)/../regformats/rs6000/powerpc-cell64l.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-cell64l.dat powerpc-cell64l.c -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 -s390-linux32.o : s390-linux32.c $(regdef_h) -s390-linux32.c : $(srcdir)/../regformats/s390-linux32.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390-linux32.dat s390-linux32.c -s390-linux64.o : s390-linux64.c $(regdef_h) -s390-linux64.c : $(srcdir)/../regformats/s390-linux64.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390-linux64.dat s390-linux64.c -s390x-linux64.o : s390x-linux64.c $(regdef_h) -s390x-linux64.c : $(srcdir)/../regformats/s390x-linux64.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/s390x-linux64.dat s390x-linux64.c - -tic6x-c64xp-linux.o : tic6x-c64xp-linux.c $(regdef_h) -tic6x-c64xp-linux.c : $(srcdir)/../regformats/tic6x-c64xp-linux.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/tic6x-c64xp-linux.dat tic6x-c64xp-linux.c -tic6x-c64x-linux.o : tic6x-c64x-linux.c $(regdef_h) -tic6x-c64x-linux.c : $(srcdir)/../regformats/tic6x-c64x-linux.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/tic6x-c64x-linux.dat tic6x-c64x-linux.c -tic6x-c62x-linux.o : tic6x-c62x-linux.c $(regdef_h) -tic6x-c62x-linux.c : $(srcdir)/../regformats/tic6x-c62x-linux.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/tic6x-c62x-linux.dat tic6x-c62x-linux.c - -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 -amd64.o : amd64.c $(regdef_h) -amd64.c : $(srcdir)/../regformats/i386/amd64.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/amd64.dat amd64.c -amd64-linux.o : amd64-linux.c $(regdef_h) -amd64-linux.c : $(srcdir)/../regformats/i386/amd64-linux.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/amd64-linux.dat amd64-linux.c -amd64-avx.o : amd64-avx.c $(regdef_h) -amd64-avx.c : $(srcdir)/../regformats/i386/amd64-avx.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/amd64-avx.dat amd64-avx.c -amd64-avx-linux.o : amd64-avx-linux.c $(regdef_h) -amd64-avx-linux.c : $(srcdir)/../regformats/i386/amd64-avx-linux.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/amd64-avx-linux.dat amd64-avx-linux.c -reg-xtensa.o : reg-xtensa.c $(regdef_h) -reg-xtensa.c : $(srcdir)/../regformats/reg-xtensa.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-xtensa.dat reg-xtensa.c -# This is the end of "Makefile.in". diff --git a/gdb/gdbserver/README b/gdb/gdbserver/README deleted file mode 100644 index 52a876b24e8..00000000000 --- a/gdb/gdbserver/README +++ /dev/null @@ -1,152 +0,0 @@ - README for GDBserver & GDBreplay - by Stu Grossman and Fred Fish - -Introduction: - -This is GDBserver, a remote server for Un*x-like systems. It can be used to -control the execution of a program on a target system from a GDB on a different -host. GDB and GDBserver communicate using the standard remote serial protocol -implemented in remote.c, and various *-stub.c files. They communicate via -either a serial line or a TCP connection. - -For more information about GDBserver, see the GDB manual. - -Usage (server (target) side): - -First, you need to have a copy of the program you want to debug put onto -the target system. The program can be stripped to save space if needed, as -GDBserver doesn't care about symbols. All symbol handling is taken care of by -the GDB running on the host system. - -To use the server, you log on to the target system, and run the `gdbserver' -program. You must tell it (a) how to communicate with GDB, (b) the name of -your program, and (c) its arguments. The general syntax is: - - target> gdbserver COMM PROGRAM [ARGS ...] - -For example, using a serial port, you might say: - - target> gdbserver /dev/com1 emacs foo.txt - -This tells GDBserver to debug emacs with an argument of foo.txt, and to -communicate with GDB via /dev/com1. GDBserver now waits patiently for the -host GDB to communicate with it. - -To use a TCP connection, you could say: - - target> gdbserver host:2345 emacs foo.txt - -This says pretty much the same thing as the last example, except that we are -going to communicate with the host GDB via TCP. The `host:2345' argument means -that we are expecting to see a TCP connection from `host' to local TCP port -2345. (Currently, the `host' part is ignored.) You can choose any number you -want for the port number as long as it does not conflict with any existing TCP -ports on the target system. This same port number must be used in the host -GDBs `target remote' command, which will be described shortly. Note that if -you chose a port number that conflicts with another service, GDBserver will -print an error message and exit. - -On some targets, GDBserver can also attach to running programs. This is -accomplished via the --attach argument. The syntax is: - - target> gdbserver --attach COMM PID - -PID is the process ID of a currently running process. It isn't necessary -to point GDBserver at a binary for the running process. - -Usage (host side): - -You need an unstripped copy of the target program on your host system, since -GDB needs to examine it's symbol tables and such. Start up GDB as you normally -would, with the target program as the first argument. (You may need to use the ---baud option if the serial line is running at anything except 9600 baud.) -Ie: `gdb TARGET-PROG', or `gdb --baud BAUD TARGET-PROG'. After that, the only -new command you need to know about is `target remote'. It's argument is either -a device name (usually a serial device, like `/dev/ttyb'), or a HOST:PORT -descriptor. For example: - - (gdb) target remote /dev/ttyb - -communicates with the server via serial line /dev/ttyb, and: - - (gdb) target remote the-target:2345 - -communicates via a TCP connection to port 2345 on host `the-target', where -you previously started up GDBserver with the same port number. Note that for -TCP connections, you must start up GDBserver prior to using the `target remote' -command, otherwise you may get an error that looks something like -`Connection refused'. - -Building GDBserver: - -The supported targets as of November 2006 are: - arm-*-linux* - bfin-*-uclinux - bfin-*-linux-uclibc - crisv32-*-linux* - cris-*-linux* - i[34567]86-*-cygwin* - i[34567]86-*-linux* - i[34567]86-*-mingw* - ia64-*-linux* - m32r*-*-linux* - m68*-*-linux* - m68*-*-uclinux* - mips*64*-*-linux* - mips*-*-linux* - powerpc[64]-*-linux* - s390[x]-*-linux* - sh-*-linux* - spu*-*-* - x86_64-*-linux* - -Configuring GDBserver you should specify the same machine for host and -target (which are the machine that GDBserver is going to run on. This -is not the same as the machine that GDB is going to run on; building -GDBserver automatically as part of building a whole tree of tools does -not currently work if cross-compilation is involved (we don't get the -right CC in the Makefile, to start with)). - -Building GDBserver for your target is very straightforward. If you build -GDB natively on a target which GDBserver supports, it will be built -automatically when you build GDB. You can also build just GDBserver: - - % mkdir obj - % cd obj - % path-to-gdbserver-sources/configure - % make - -If you prefer to cross-compile to your target, then you can also build -GDBserver that way. In a Bourne shell, for example: - - % export CC=your-cross-compiler - % path-to-gdbserver-sources/configure your-target-name - % make - -Using GDBreplay: - -A special hacked down version of GDBserver can be used to replay remote -debug log files created by GDB. Before using the GDB "target" command to -initiate a remote debug session, use "set remotelogfile <filename>" to tell -GDB that you want to make a recording of the serial or tcp session. Note -that when replaying the session, GDB communicates with GDBreplay via tcp, -regardless of whether the original session was via a serial link or tcp. - -Once you are done with the remote debug session, start GDBreplay and -tell it the name of the log file and the host and port number that GDB -should connect to (typically the same as the host running GDB): - - $ gdbreplay logfile host:port - -Then start GDB (preferably in a different screen or window) and use the -"target" command to connect to GDBreplay: - - (gdb) target remote host:port - -Repeat the same sequence of user commands to GDB that you gave in the -original debug session. GDB should not be able to tell that it is talking -to GDBreplay rather than a real target, all other things being equal. Note -that GDBreplay echos the command lines to stderr, as well as the contents of -the packets it sends and receives. The last command echoed by GDBreplay is -the next command that needs to be typed to GDB to continue the session in -sync with the original session. diff --git a/gdb/gdbserver/acinclude.m4 b/gdb/gdbserver/acinclude.m4 deleted file mode 100644 index 87d0db5f02e..00000000000 --- a/gdb/gdbserver/acinclude.m4 +++ /dev/null @@ -1,9 +0,0 @@ -dnl gdb/gdbserver/configure.in uses BFD_HAVE_SYS_PROCFS_TYPE. -sinclude(../../bfd/bfd.m4) - -dnl This gets autoconf bugfixes -sinclude(../../config/override.m4) - -dnl For ACX_PKGVERSION and ACX_BUGURL. -sinclude(../../config/acx.m4) - diff --git a/gdb/gdbserver/aclocal.m4 b/gdb/gdbserver/aclocal.m4 deleted file mode 100644 index cdae6e7f72e..00000000000 --- a/gdb/gdbserver/aclocal.m4 +++ /dev/null @@ -1,14 +0,0 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_include([acinclude.m4]) diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in deleted file mode 100644 index 65aa1ab098e..00000000000 --- a/gdb/gdbserver/config.in +++ /dev/null @@ -1,283 +0,0 @@ -/* config.in. Generated from configure.ac by autoheader. */ - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* Define to 1 if you have `alloca', as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you have the <arpa/inet.h> header file. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the declaration of `memmem', and to 0 if you don't. - */ -#undef HAVE_DECL_MEMMEM - -/* Define to 1 if you have the declaration of `perror', and to 0 if you don't. - */ -#undef HAVE_DECL_PERROR - -/* Define to 1 if you have the declaration of `strerror', and to 0 if you - don't. */ -#undef HAVE_DECL_STRERROR - -/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you - don't. */ -#undef HAVE_DECL_VASPRINTF - -/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you - don't. */ -#undef HAVE_DECL_VSNPRINTF - -/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the `dladdr' function. */ -#undef HAVE_DLADDR - -/* Define if <sys/procfs.h> has elf_fpregset_t. */ -#undef HAVE_ELF_FPREGSET_T - -/* Define if errno is available */ -#undef HAVE_ERRNO - -/* Define to 1 if you have the <errno.h> header file. */ -#undef HAVE_ERRNO_H - -/* Define to 1 if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `dl' library (-ldl). */ -#undef HAVE_LIBDL - -/* Define to 1 if you have the <linux/elf.h> header file. */ -#undef HAVE_LINUX_ELF_H - -/* Define if the target supports register sets. */ -#undef HAVE_LINUX_REGSETS - -/* Define if the target supports PTRACE_PEEKUSR for register access. */ -#undef HAVE_LINUX_USRREGS - -/* Define if <sys/procfs.h> has lwpid_t. */ -#undef HAVE_LWPID_T - -/* Define to 1 if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the `memmem' function. */ -#undef HAVE_MEMMEM - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the <netdb.h> header file. */ -#undef HAVE_NETDB_H - -/* Define to 1 if you have the <netinet/in.h> header file. */ -#undef HAVE_NETINET_IN_H - -/* Define to 1 if you have the <netinet/tcp.h> header file. */ -#undef HAVE_NETINET_TCP_H - -/* Define to 1 if you have the `pread' function. */ -#undef HAVE_PREAD - -/* Define to 1 if you have the `pread64' function. */ -#undef HAVE_PREAD64 - -/* Define if <sys/procfs.h> has prgregset_t. */ -#undef HAVE_PRGREGSET_T - -/* Define to 1 if you have the <proc_service.h> header file. */ -#undef HAVE_PROC_SERVICE_H - -/* Define if <sys/procfs.h> has psaddr_t. */ -#undef HAVE_PSADDR_T - -/* Define if the target supports PTRACE_GETFPXREGS for extended register - access. */ -#undef HAVE_PTRACE_GETFPXREGS - -/* Define if the target supports PTRACE_GETREGS for register access. */ -#undef HAVE_PTRACE_GETREGS - -/* Define to 1 if you have the `pwrite' function. */ -#undef HAVE_PWRITE - -/* Define to 1 if you have the <sgtty.h> header file. */ -#undef HAVE_SGTTY_H - -/* Define to 1 if you have the <signal.h> header file. */ -#undef HAVE_SIGNAL_H - -/* Define to 1 if the system has the type `socklen_t'. */ -#undef HAVE_SOCKLEN_T - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if the target supports __sync_*_compare_and_swap */ -#undef HAVE_SYNC_BUILTINS - -/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the <sys/file.h> header file. */ -#undef HAVE_SYS_FILE_H - -/* Define to 1 if you have the <sys/ioctl.h> header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the <sys/procfs.h> header file. */ -#undef HAVE_SYS_PROCFS_H - -/* Define to 1 if you have the <sys/reg.h> header file. */ -#undef HAVE_SYS_REG_H - -/* Define to 1 if you have the <sys/socket.h> header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <sys/wait.h> header file. */ -#undef HAVE_SYS_WAIT_H - -/* Define if TD_VERSION is available. */ -#undef HAVE_TD_VERSION - -/* Define to 1 if you have the <termios.h> header file. */ -#undef HAVE_TERMIOS_H - -/* Define to 1 if you have the <termio.h> header file. */ -#undef HAVE_TERMIO_H - -/* Define to 1 if you have the <thread_db.h> header file. */ -#undef HAVE_THREAD_DB_H - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define if UST is available */ -#undef HAVE_UST - -/* Define to 1 if you have the `vasprintf' function. */ -#undef HAVE_VASPRINTF - -/* Define to 1 if you have the `vsnprintf' function. */ -#undef HAVE_VSNPRINTF - -/* Checking if errno must be defined */ -#undef MUST_DEFINE_ERRNO - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Additional package description */ -#undef PKGVERSION - -/* Bug reporting address */ -#undef REPORT_BUGS_TO - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if we should use libthread_db directly. */ -#undef USE_LIBTHREAD_DB_DIRECTLY - -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - -/* Define if we should use the Windows API, instead of the POSIX API. On - Windows, we use the Windows API when building for MinGW, but the POSIX API - when building for Cygwin. */ -#undef USE_WIN32API - -/* Define if an XML target description is available. */ -#undef USE_XML - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure deleted file mode 100755 index c350159e23e..00000000000 --- a/gdb/gdbserver/configure +++ /dev/null @@ -1,6387 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software -# Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. -as_fn_error () -{ - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 - fi - $as_echo "$as_me: error: $1" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 7<&0 </dev/null 6>&1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= - -ac_unique_file="server.c" -ac_config_libobj_dir=../gnulib -# Factoring default headers for most tests. -ac_includes_default="\ -#include <stdio.h> -#ifdef HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif -#ifdef HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif -#ifdef STDC_HEADERS -# include <stdlib.h> -# include <stddef.h> -#else -# ifdef HAVE_STDLIB_H -# include <stdlib.h> -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include <memory.h> -# endif -# include <string.h> -#endif -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif -#ifdef HAVE_INTTYPES_H -# include <inttypes.h> -#endif -#ifdef HAVE_STDINT_H -# include <stdint.h> -#endif -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif" - -ac_subst_vars='LTLIBOBJS -extra_libraries -IPA_DEPFILES -srv_xmlfiles -srv_xmlbuiltin -USE_THREAD_DB -GDBSERVER_LIBS -GDBSERVER_DEPFILES -RDYNAMIC -REPORT_BUGS_TEXI -REPORT_BUGS_TO -PKGVERSION -WERROR_CFLAGS -WARN_CFLAGS -ustinc -ustlibs -LIBOBJS -ALLOCA -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -EGREP -GREP -CPP -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_ust -with_ust_include -with_ust_lib -enable_werror -with_pkgversion -with_bugurl -with_libthread_db -enable_inprocess_agent -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-werror treat compile warnings as errors - --enable-inprocess-agent - inprocess agent - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-ust=PATH Specify prefix directory for the installed UST package - Equivalent to --with-ust-include=PATH/include - plus --with-ust-lib=PATH/lib - --with-ust-include=PATH Specify directory for installed UST include files - --with-ust-lib=PATH Specify the directory for the installed UST library - --with-pkgversion=PKG Use PKG in the version string in place of "GDB" - --with-bugurl=URL Direct users to URL to report a bug - --with-libthread-db=PATH - use given libthread_db directly - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a - nonstandard directory <lib dir> - LIBS libraries to pass to the linker, e.g. -l<library> - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if - you have headers in a nonstandard directory <include dir> - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.64 - -Copyright (C) 2009 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case <limits.h> declares $2. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_func - -# ac_fn_c_check_decl LINENO SYMBOL VAR -# ------------------------------------ -# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. -ac_fn_c_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_decl - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_type -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.64. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - -ac_config_headers="$ac_config_headers config.h:config.in" - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - rm -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then : - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } -fi -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } -fi -rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = x""yes; then : - MINIX=yes -else - MINIX= -fi - - - if test "$MINIX" = yes; then - -$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h - - -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h - - -$as_echo "#define _MINIX 1" >>confdefs.h - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if test "${ac_cv_safe_to_define___extensions__+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_safe_to_define___extensions__=yes -else - ac_cv_safe_to_define___extensions__=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - - $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - - - - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done -done -if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if test "${ac_cv_target+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) as_fn_error "invalid value of canonical target" "$LINENO" 5;; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/types.h> -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" -else - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if test "${ac_cv_search_opendir+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then : - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - - -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 -$as_echo_n "checking for working alloca.h... " >&6; } -if test "${ac_cv_working_alloca_h+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <alloca.h> -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - if (p) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_working_alloca_h=yes -else - ac_cv_working_alloca_h=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 -$as_echo "$ac_cv_working_alloca_h" >&6; } -if test $ac_cv_working_alloca_h = yes; then - -$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 -$as_echo_n "checking for alloca... " >&6; } -if test "${ac_cv_func_alloca_works+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include <malloc.h> -# define alloca _alloca -# else -# ifdef HAVE_ALLOCA_H -# include <alloca.h> -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -# endif -#endif - -int -main () -{ -char *p = (char *) alloca (1); - if (p) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_func_alloca_works=yes -else - ac_cv_func_alloca_works=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 -$as_echo "$ac_cv_func_alloca_works" >&6; } - -if test $ac_cv_func_alloca_works = yes; then - -$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h - -else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. - -ALLOCA=\${LIBOBJDIR}alloca.$ac_objext - -$as_echo "#define C_ALLOCA 1" >>confdefs.h - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 -$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if test "${ac_cv_os_cray+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then : - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 -$as_echo "$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi - - done -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 -$as_echo_n "checking stack direction for C alloca... " >&6; } -if test "${ac_cv_c_stack_direction+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_c_stack_direction=0 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -find_stack_direction () -{ - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; -} - -int -main () -{ - return find_stack_direction () < 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_stack_direction=1 -else - ac_cv_c_stack_direction=-1 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 -$as_echo "$ac_cv_c_stack_direction" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF - - -fi - -for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h thread_db.h linux/elf.h stdlib.h unistd.h errno.h fcntl.h signal.h sys/file.h malloc.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h netinet/tcp.h arpa/inet.h sys/wait.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -for ac_func in pread pwrite pread64 -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in memmem vasprintf vsnprintf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" - ;; -esac - -fi -done - - - -# Check for UST -ustlibs="" -ustinc="" - - -# Check whether --with-ust was given. -if test "${with_ust+set}" = set; then : - withval=$with_ust; -fi - - -# Check whether --with-ust_include was given. -if test "${with_ust_include+set}" = set; then : - withval=$with_ust_include; -fi - - -# Check whether --with-ust_lib was given. -if test "${with_ust_lib+set}" = set; then : - withval=$with_ust_lib; -fi - - -case $with_ust in - no) - ustlibs= - ustinc= - ;; - "" | yes) - ustlibs=" -lust " - ustinc="" - ;; - *) - ustlibs="-L$with_ust/lib -lust" - ustinc="-I$with_ust/include " - ;; -esac -if test "x$with_ust_include" != x; then - ustinc="-I$with_ust_include " -fi -if test "x$with_ust_lib" != x; then - ustlibs="-L$with_ust_lib -lust" -fi - -if test "x$with_ust" != "xno"; then - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ustinc" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ust" >&5 -$as_echo_n "checking for ust... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#define CONFIG_UST_GDB_INTEGRATION -#include <ust/ust.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; -$as_echo "#define HAVE_UST 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; ustlibs= ; ustinc= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$saved_CFLAGS" -fi - -# Flags needed for UST - - - -# Check whether --enable-werror was given. -if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; case "${enableval}" in - yes | y) ERROR_ON_WARNING="yes" ;; - no | n) ERROR_ON_WARNING="no" ;; - *) as_fn_error "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;; - esac -fi - - -# Enable -Werror by default when using gcc -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - ERROR_ON_WARNING=yes -fi - -WERROR_CFLAGS="" -if test "${ERROR_ON_WARNING}" = yes ; then - WERROR_CFLAGS="-Werror" -fi - -build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ --Wformat-nonliteral -Wno-char-subscripts" - -WARN_CFLAGS="" -if test "x$GCC" = xyes -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5 -$as_echo_n "checking compiler warning flags... " >&6; } - # Separate out the -Werror flag as some files just cannot be - # compiled with it enabled. - for w in ${build_warnings}; do - case $w in - -Werr*) WERROR_CFLAGS=-Werror ;; - *) # Check that GCC accepts it - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $w" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - WARN_CFLAGS="${WARN_CFLAGS} $w" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$saved_CFLAGS" - esac - done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5 -$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&6; } -fi - - - -old_LIBS="$LIBS" -LIBS="$LIBS -ldl" -for ac_func in dladdr -do : - ac_fn_c_check_func "$LINENO" "dladdr" "ac_cv_func_dladdr" -if test "x$ac_cv_func_dladdr" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLADDR 1 -_ACEOF - -fi -done - -LIBS="$old_LIBS" - -have_errno=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno" >&5 -$as_echo_n "checking for errno... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#if HAVE_ERRNO_H -#include <errno.h> -#endif -int -main () -{ -static int x; x = errno; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - in errno.h" >&5 -$as_echo "yes - in errno.h" >&6; }; -$as_echo "#define HAVE_ERRNO 1" >>confdefs.h - have_errno=yes -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test $have_errno = no; then -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#if HAVE_ERRNO_H -#include <errno.h> -#endif -int -main () -{ -extern int errno; static int x; x = errno; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - must define" >&5 -$as_echo "yes - must define" >&6; }; -$as_echo "#define HAVE_ERRNO 1" >>confdefs.h - -$as_echo "#define MUST_DEFINE_ERRNO 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi - -ac_fn_c_check_decl "$LINENO" "strerror" "ac_cv_have_decl_strerror" "$ac_includes_default" -if test "x$ac_cv_have_decl_strerror" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "perror" "ac_cv_have_decl_perror" "$ac_includes_default" -if test "x$ac_cv_have_decl_perror" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PERROR $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "memmem" "ac_cv_have_decl_memmem" "$ac_includes_default" -if test "x$ac_cv_have_decl_memmem" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MEMMEM $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "vasprintf" "ac_cv_have_decl_vasprintf" "$ac_includes_default" -if test "x$ac_cv_have_decl_vasprintf" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VASPRINTF $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "vsnprintf" "ac_cv_have_decl_vsnprintf" "$ac_includes_default" -if test "x$ac_cv_have_decl_vsnprintf" = x""yes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VSNPRINTF $ac_have_decl -_ACEOF - - -ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h> -#include <sys/socket.h> - -" -if test "x$ac_cv_type_socklen_t" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_SOCKLEN_T 1 -_ACEOF - - -fi - - - - -# Check whether --with-pkgversion was given. -if test "${with_pkgversion+set}" = set; then : - withval=$with_pkgversion; case "$withval" in - yes) as_fn_error "package version not specified" "$LINENO" 5 ;; - no) PKGVERSION= ;; - *) PKGVERSION="($withval) " ;; - esac -else - PKGVERSION="(GDB) " - -fi - - - - - -# Check whether --with-bugurl was given. -if test "${with_bugurl+set}" = set; then : - withval=$with_bugurl; case "$withval" in - yes) as_fn_error "bug URL not specified" "$LINENO" 5 ;; - no) BUGURL= - ;; - *) BUGURL="$withval" - ;; - esac -else - BUGURL="http://www.gnu.org/software/gdb/bugs/" - -fi - - case ${BUGURL} in - "") - REPORT_BUGS_TO= - REPORT_BUGS_TEXI= - ;; - *) - REPORT_BUGS_TO="<$BUGURL>" - REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`} - ;; - esac; - - - - -cat >>confdefs.h <<_ACEOF -#define PKGVERSION "$PKGVERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define REPORT_BUGS_TO "$REPORT_BUGS_TO" -_ACEOF - - -# Check for various supplementary target information (beyond the -# triplet) which might affect the choices in configure.srv. -case "${target}" in - i[34567]86-*-linux*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if building for x86-64" >&5 -$as_echo_n "checking if building for x86-64... " >&6; } -if test "${gdb_cv_i386_is_x86_64+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#if __x86_64__ -got it -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "got it" >/dev/null 2>&1; then : - gdb_cv_i386_is_x86_64=yes -else - gdb_cv_i386_is_x86_64=no -fi -rm -f conftest* - - CPPFLAGS="$save_CPPFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_i386_is_x86_64" >&5 -$as_echo "$gdb_cv_i386_is_x86_64" >&6; } - ;; - m68k-*-*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if building for Coldfire" >&5 -$as_echo_n "checking if building for Coldfire... " >&6; } -if test "${gdb_cv_m68k_is_coldfire+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $CFLAGS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef __mcoldfire__ -got it -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "got it" >/dev/null 2>&1; then : - gdb_cv_m68k_is_coldfire=yes -else - gdb_cv_m68k_is_coldfire=no -fi -rm -f conftest* - - CPPFLAGS="$save_CPPFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_m68k_is_coldfire" >&5 -$as_echo "$gdb_cv_m68k_is_coldfire" >&6; } - ;; -esac - -. ${srcdir}/configure.srv - -if test "${srv_mingwce}" = "yes"; then - LIBS="$LIBS -lws2" -elif test "${srv_mingw}" = "yes"; then - LIBS="$LIBS -lws2_32" -elif test "${srv_qnx}" = "yes"; then - LIBS="$LIBS -lsocket" -elif test "${srv_lynxos}" = "yes"; then - LIBS="$LIBS -lnetinet" -fi - -if test "${srv_mingw}" = "yes"; then - -$as_echo "#define USE_WIN32API 1" >>confdefs.h - -fi - -if test "${srv_linux_usrregs}" = "yes"; then - -$as_echo "#define HAVE_LINUX_USRREGS 1" >>confdefs.h - -fi - -if test "${srv_linux_regsets}" = "yes"; then - -$as_echo "#define HAVE_LINUX_REGSETS 1" >>confdefs.h - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTRACE_GETREGS" >&5 -$as_echo_n "checking for PTRACE_GETREGS... " >&6; } - if test "${gdbsrv_cv_have_ptrace_getregs+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/ptrace.h> -int -main () -{ -PTRACE_GETREGS; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdbsrv_cv_have_ptrace_getregs=yes -else - gdbsrv_cv_have_ptrace_getregs=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbsrv_cv_have_ptrace_getregs" >&5 -$as_echo "$gdbsrv_cv_have_ptrace_getregs" >&6; } - if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then - -$as_echo "#define HAVE_PTRACE_GETREGS 1" >>confdefs.h - - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTRACE_GETFPXREGS" >&5 -$as_echo_n "checking for PTRACE_GETFPXREGS... " >&6; } - if test "${gdbsrv_cv_have_ptrace_getfpxregs+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/ptrace.h> -int -main () -{ -PTRACE_GETFPXREGS; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdbsrv_cv_have_ptrace_getfpxregs=yes -else - gdbsrv_cv_have_ptrace_getfpxregs=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbsrv_cv_have_ptrace_getfpxregs" >&5 -$as_echo "$gdbsrv_cv_have_ptrace_getfpxregs" >&6; } - if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then - -$as_echo "#define HAVE_PTRACE_GETFPXREGS 1" >>confdefs.h - - fi -fi - -if test "$ac_cv_header_sys_procfs_h" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lwpid_t in sys/procfs.h" >&5 -$as_echo_n "checking for lwpid_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_lwpid_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include <sys/procfs.h> -int -main () -{ -lwpid_t avar - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_lwpid_t=yes -else - bfd_cv_have_sys_procfs_type_lwpid_t=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then - -$as_echo "#define HAVE_LWPID_T 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_lwpid_t" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for psaddr_t in sys/procfs.h" >&5 -$as_echo_n "checking for psaddr_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_psaddr_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include <sys/procfs.h> -int -main () -{ -psaddr_t avar - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_psaddr_t=yes -else - bfd_cv_have_sys_procfs_type_psaddr_t=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then - -$as_echo "#define HAVE_PSADDR_T 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_psaddr_t" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prgregset_t in sys/procfs.h" >&5 -$as_echo_n "checking for prgregset_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_prgregset_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include <sys/procfs.h> -int -main () -{ -prgregset_t avar - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_prgregset_t=yes -else - bfd_cv_have_sys_procfs_type_prgregset_t=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then - -$as_echo "#define HAVE_PRGREGSET_T 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_prgregset_t" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elf_fpregset_t in sys/procfs.h" >&5 -$as_echo_n "checking for elf_fpregset_t in sys/procfs.h... " >&6; } - if test "${bfd_cv_have_sys_procfs_type_elf_fpregset_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#define _SYSCALL32 -/* Needed for new procfs interface on sparc-solaris. */ -#define _STRUCTURED_PROC 1 -#include <sys/procfs.h> -int -main () -{ -elf_fpregset_t avar - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - bfd_cv_have_sys_procfs_type_elf_fpregset_t=yes -else - bfd_cv_have_sys_procfs_type_elf_fpregset_t=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_elf_fpregset_t = yes; then - -$as_echo "#define HAVE_ELF_FPREGSET_T 1" >>confdefs.h - - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&5 -$as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; } - -fi - -old_LIBS="$LIBS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDL 1 -_ACEOF - - LIBS="-ldl $LIBS" - -fi - -LIBS="$old_LIBS" - -srv_thread_depfiles= -srv_libs= -USE_THREAD_DB= - -if test "$srv_linux_thread_db" = "yes"; then - if test "$ac_cv_lib_dl_dlopen" = "yes"; then - srv_libs="-ldl" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the dynamic export flag" >&5 -$as_echo_n "checking for the dynamic export flag... " >&6; } - old_LDFLAGS="$LDFLAGS" - # Older GNU ld supports --export-dynamic but --dynamic-list may not be - # supported there. - RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list" - LDFLAGS="$LDFLAGS $RDYNAMIC" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - found="-Wl,--dynamic-list" - RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list' -else - RDYNAMIC="-rdynamic" - LDFLAGS="$old_LDFLAGS $RDYNAMIC" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - found="-rdynamic" -else - found="no" - RDYNAMIC="" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - LDFLAGS="$old_LDFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found" >&5 -$as_echo "$found" >&6; } - else - srv_libs="-lthread_db" - fi - - srv_thread_depfiles="thread-db.o proc-service.o" - USE_THREAD_DB="-DUSE_THREAD_DB" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TD_VERSION" >&5 -$as_echo_n "checking for TD_VERSION... " >&6; } -if test "${gdbsrv_cv_have_td_version+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <thread_db.h> -int -main () -{ -TD_VERSION; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdbsrv_cv_have_td_version=yes -else - gdbsrv_cv_have_td_version=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbsrv_cv_have_td_version" >&5 -$as_echo "$gdbsrv_cv_have_td_version" >&6; } - if test $gdbsrv_cv_have_td_version = yes; then - -$as_echo "#define HAVE_TD_VERSION 1" >>confdefs.h - - fi -fi - - -# Check whether --with-libthread-db was given. -if test "${with_libthread_db+set}" = set; then : - withval=$with_libthread_db; srv_libthread_db_path="${withval}" - srv_libs="$srv_libthread_db_path" - -fi - - -if test "$srv_libs" != "" -a "$srv_libs" != "-ldl"; then - -$as_echo "#define USE_LIBTHREAD_DB_DIRECTLY 1" >>confdefs.h - -fi - -if test "$srv_xmlfiles" != ""; then - srv_xmlbuiltin="xml-builtin.o" - -$as_echo "#define USE_XML 1" >>confdefs.h - - - tmp_xmlfiles=$srv_xmlfiles - srv_xmlfiles="" - for f in $tmp_xmlfiles; do - srv_xmlfiles="$srv_xmlfiles \$(XML_DIR)/$f" - done -fi - -GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles" -GDBSERVER_LIBS="$srv_libs" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports __sync_*_compare_and_swap" >&5 -$as_echo_n "checking whether the target supports __sync_*_compare_and_swap... " >&6; } -if test "${gdbsrv_cv_have_sync_builtins+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -int foo, bar; bar = __sync_val_compare_and_swap(&foo, 0, 1); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gdbsrv_cv_have_sync_builtins=yes -else - gdbsrv_cv_have_sync_builtins=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdbsrv_cv_have_sync_builtins" >&5 -$as_echo "$gdbsrv_cv_have_sync_builtins" >&6; } -if test $gdbsrv_cv_have_sync_builtins = yes; then - -$as_echo "#define HAVE_SYNC_BUILTINS 1" >>confdefs.h - -fi - -saved_cflags="$CFLAGS" -CFLAGS="$CFLAGS -fvisibility=hidden" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gdbsrv_cv_have_visibility_hidden=yes -else - gdbsrv_cv_have_visibility_hidden=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -CFLAGS="$saved_cflags" - - -IPA_DEPFILES="" -extra_libraries="" - -# check whether to enable the inprocess agent -if test "$ipa_obj" != "" \ - -a "$gdbsrv_cv_have_sync_builtins" = yes \ - -a "$gdbsrv_cv_have_visibility_hidden" = yes; then - have_ipa=true -else - have_ipa=false -fi - -# Check whether --enable-inprocess-agent was given. -if test "${enable_inprocess_agent+set}" = set; then : - enableval=$enable_inprocess_agent; case "$enableval" in - yes) want_ipa=true ;; - no) want_ipa=false ;; - *) as_fn_error "bad value $enableval for inprocess-agent" "$LINENO" 5 ;; -esac -else - want_ipa=$have_ipa -fi - - -if $want_ipa ; then - if $have_ipa ; then - IPA_DEPFILES="$ipa_obj" - extra_libraries="$extra_libraries libinproctrace.so" - else - as_fn_error "inprocess agent not supported for this target" "$LINENO" 5 - fi -fi - - - - - - - - - -ac_config_files="$ac_config_files Makefile" - -ac_config_commands="$ac_config_commands default" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. -as_fn_error () -{ - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 - fi - $as_echo "$as_me: error: $1" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.64. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.64, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2009 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' <conf$$subs.awk | sed ' -/^[^""]/{ - N - s/\n// -} -' >>$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then - break - elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' <confdefs.h | sed ' -s/'"$ac_delim"'/"\\\ -"/g' >>$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 - fi - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "default":C) case x$CONFIG_HEADERS in -xconfig.h:config.in) -echo > stamp-h ;; -esac - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac deleted file mode 100644 index 567d3ea7e81..00000000000 --- a/gdb/gdbserver/configure.ac +++ /dev/null @@ -1,405 +0,0 @@ -dnl Autoconf configure script for GDB server. -dnl Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, -dnl 2010, 2011 Free Software Foundation, Inc. -dnl -dnl This file is part of GDB. -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 3 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program. If not, see <http://www.gnu.org/licenses/>. - -dnl Process this file with autoconf to produce a configure script. - -AC_PREREQ(2.59)dnl - -AC_INIT(server.c) -AC_CONFIG_HEADER(config.h:config.in) -AC_CONFIG_LIBOBJ_DIR(../gnulib) - -AC_PROG_CC -AC_GNU_SOURCE - -AC_CANONICAL_SYSTEM - -AC_PROG_INSTALL - -AC_ARG_PROGRAM - -AC_HEADER_STDC -AC_HEADER_DIRENT - -AC_FUNC_ALLOCA -AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl - proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl - stdlib.h unistd.h dnl - errno.h fcntl.h signal.h sys/file.h malloc.h dnl - sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl - netinet/tcp.h arpa/inet.h sys/wait.h) -AC_CHECK_FUNCS(pread pwrite pread64) -AC_REPLACE_FUNCS(memmem vasprintf vsnprintf) - -# Check for UST -ustlibs="" -ustinc="" - -AC_ARG_WITH(ust, [ --with-ust=PATH Specify prefix directory for the installed UST package - Equivalent to --with-ust-include=PATH/include - plus --with-ust-lib=PATH/lib]) -AC_ARG_WITH(ust_include, [ --with-ust-include=PATH Specify directory for installed UST include files]) -AC_ARG_WITH(ust_lib, [ --with-ust-lib=PATH Specify the directory for the installed UST library]) - -case $with_ust in - no) - ustlibs= - ustinc= - ;; - "" | yes) - ustlibs=" -lust " - ustinc="" - ;; - *) - ustlibs="-L$with_ust/lib -lust" - ustinc="-I$with_ust/include " - ;; -esac -if test "x$with_ust_include" != x; then - ustinc="-I$with_ust_include " -fi -if test "x$with_ust_lib" != x; then - ustlibs="-L$with_ust_lib -lust" -fi - -if test "x$with_ust" != "xno"; then - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $ustinc" - AC_MSG_CHECKING([for ust]) - AC_TRY_COMPILE([ -#define CONFIG_UST_GDB_INTEGRATION -#include <ust/ust.h> - ],[], - [AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_UST, 1, [Define if UST is available])], - [AC_MSG_RESULT([no]); ustlibs= ; ustinc= ]) - CFLAGS="$saved_CFLAGS" -fi - -# Flags needed for UST -AC_SUBST(ustlibs) -AC_SUBST(ustinc) - -AC_ARG_ENABLE(werror, - AS_HELP_STRING([--enable-werror], [treat compile warnings as errors]), - [case "${enableval}" in - yes | y) ERROR_ON_WARNING="yes" ;; - no | n) ERROR_ON_WARNING="no" ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;; - esac]) - -# Enable -Werror by default when using gcc -if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then - ERROR_ON_WARNING=yes -fi - -WERROR_CFLAGS="" -if test "${ERROR_ON_WARNING}" = yes ; then - WERROR_CFLAGS="-Werror" -fi - -build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ --Wformat-nonliteral -Wno-char-subscripts" - -WARN_CFLAGS="" -if test "x$GCC" = xyes -then - AC_MSG_CHECKING(compiler warning flags) - # Separate out the -Werror flag as some files just cannot be - # compiled with it enabled. - for w in ${build_warnings}; do - case $w in - -Werr*) WERROR_CFLAGS=-Werror ;; - *) # Check that GCC accepts it - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $w" - AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",) - CFLAGS="$saved_CFLAGS" - esac - done - AC_MSG_RESULT(${WARN_CFLAGS} ${WERROR_CFLAGS}) -fi -AC_SUBST(WARN_CFLAGS) -AC_SUBST(WERROR_CFLAGS) - -dnl dladdr is glibc-specific. It is used by thread-db.c but only for -dnl debugging messages. It lives in -ldl which is handled below so we don't -dnl use AC_CHECK_LIB (or AC_SEARCH_LIBS) here. Instead we just temporarily -dnl augment LIBS. -old_LIBS="$LIBS" -LIBS="$LIBS -ldl" -AC_CHECK_FUNCS(dladdr) -LIBS="$old_LIBS" - -have_errno=no -AC_MSG_CHECKING(for errno) -AC_TRY_LINK([ -#if HAVE_ERRNO_H -#include <errno.h> -#endif], [static int x; x = errno;], - [AC_MSG_RESULT(yes - in errno.h); AC_DEFINE(HAVE_ERRNO, 1, [Define if errno is available]) have_errno=yes]) -if test $have_errno = no; then -AC_TRY_LINK([ -#if HAVE_ERRNO_H -#include <errno.h> -#endif], [extern int errno; static int x; x = errno;], - [AC_MSG_RESULT(yes - must define); AC_DEFINE(HAVE_ERRNO, 1, [Define if errno is available]) AC_DEFINE(MUST_DEFINE_ERRNO, 1, [Checking if errno must be defined])], - [AC_MSG_RESULT(no)]) -fi - -AC_CHECK_DECLS([strerror, perror, memmem, vasprintf, vsnprintf]) - -AC_CHECK_TYPES(socklen_t, [], [], -[#include <sys/types.h> -#include <sys/socket.h> -]) - -ACX_PKGVERSION([GDB]) -ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/]) -AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description]) -AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address]) - -# Check for various supplementary target information (beyond the -# triplet) which might affect the choices in configure.srv. -case "${target}" in -changequote(,)dnl - i[34567]86-*-linux*) -changequote([,])dnl - AC_CACHE_CHECK([if building for x86-64], [gdb_cv_i386_is_x86_64], - [save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $CFLAGS" - AC_EGREP_CPP([got it], [ -#if __x86_64__ -got it -#endif - ], [gdb_cv_i386_is_x86_64=yes], - [gdb_cv_i386_is_x86_64=no]) - CPPFLAGS="$save_CPPFLAGS"]) - ;; - m68k-*-*) - AC_CACHE_CHECK([if building for Coldfire], [gdb_cv_m68k_is_coldfire], - [save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $CFLAGS" - AC_EGREP_CPP([got it], [ -#ifdef __mcoldfire__ -got it -#endif - ], [gdb_cv_m68k_is_coldfire=yes], - [gdb_cv_m68k_is_coldfire=no]) - CPPFLAGS="$save_CPPFLAGS"]) - ;; -esac - -. ${srcdir}/configure.srv - -if test "${srv_mingwce}" = "yes"; then - LIBS="$LIBS -lws2" -elif test "${srv_mingw}" = "yes"; then - LIBS="$LIBS -lws2_32" -elif test "${srv_qnx}" = "yes"; then - LIBS="$LIBS -lsocket" -elif test "${srv_lynxos}" = "yes"; then - LIBS="$LIBS -lnetinet" -fi - -if test "${srv_mingw}" = "yes"; then - AC_DEFINE(USE_WIN32API, 1, - [Define if we should use the Windows API, instead of the - POSIX API. On Windows, we use the Windows API when - building for MinGW, but the POSIX API when building - for Cygwin.]) -fi - -if test "${srv_linux_usrregs}" = "yes"; then - AC_DEFINE(HAVE_LINUX_USRREGS, 1, - [Define if the target supports PTRACE_PEEKUSR for register ] - [access.]) -fi - -if test "${srv_linux_regsets}" = "yes"; then - AC_DEFINE(HAVE_LINUX_REGSETS, 1, - [Define if the target supports register sets.]) - - AC_MSG_CHECKING(for PTRACE_GETREGS) - AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs, - [AC_TRY_COMPILE([#include <sys/ptrace.h>], - [PTRACE_GETREGS;], - [gdbsrv_cv_have_ptrace_getregs=yes], - [gdbsrv_cv_have_ptrace_getregs=no])]) - AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs) - if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then - AC_DEFINE(HAVE_PTRACE_GETREGS, 1, - [Define if the target supports PTRACE_GETREGS for register ] - [access.]) - fi - - AC_MSG_CHECKING(for PTRACE_GETFPXREGS) - AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs, - [AC_TRY_COMPILE([#include <sys/ptrace.h>], - [PTRACE_GETFPXREGS;], - [gdbsrv_cv_have_ptrace_getfpxregs=yes], - [gdbsrv_cv_have_ptrace_getfpxregs=no])]) - AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs) - if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then - AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1, - [Define if the target supports PTRACE_GETFPXREGS for extended ] - [register access.]) - fi -fi - -if test "$ac_cv_header_sys_procfs_h" = yes; then - BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t) - BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t) - BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t) - BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t) -fi - -dnl Check for libdl, but do not add it to LIBS as only gdbserver -dnl needs it (and gdbreplay doesn't). -old_LIBS="$LIBS" -AC_CHECK_LIB(dl, dlopen) -LIBS="$old_LIBS" - -srv_thread_depfiles= -srv_libs= -USE_THREAD_DB= - -if test "$srv_linux_thread_db" = "yes"; then - if test "$ac_cv_lib_dl_dlopen" = "yes"; then - srv_libs="-ldl" - AC_MSG_CHECKING(for the dynamic export flag) - old_LDFLAGS="$LDFLAGS" - # Older GNU ld supports --export-dynamic but --dynamic-list may not be - # supported there. - RDYNAMIC="-Wl,--dynamic-list=${srcdir}/proc-service.list" - LDFLAGS="$LDFLAGS $RDYNAMIC" - AC_TRY_LINK([], [], - [found="-Wl,--dynamic-list" - RDYNAMIC='-Wl,--dynamic-list=$(srcdir)/proc-service.list'], - [RDYNAMIC="-rdynamic" - LDFLAGS="$old_LDFLAGS $RDYNAMIC" - AC_TRY_LINK([], [], - [found="-rdynamic"], - [found="no" - RDYNAMIC=""])]) - AC_SUBST(RDYNAMIC) - LDFLAGS="$old_LDFLAGS" - AC_MSG_RESULT($found) - else - srv_libs="-lthread_db" - fi - - srv_thread_depfiles="thread-db.o proc-service.o" - USE_THREAD_DB="-DUSE_THREAD_DB" - AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version, - [AC_TRY_COMPILE([#include <thread_db.h>], [TD_VERSION;], - [gdbsrv_cv_have_td_version=yes], - [gdbsrv_cv_have_td_version=no])]) - if test $gdbsrv_cv_have_td_version = yes; then - AC_DEFINE(HAVE_TD_VERSION, 1, [Define if TD_VERSION is available.]) - fi -fi - -AC_ARG_WITH(libthread-db, -AS_HELP_STRING([--with-libthread-db=PATH], [use given libthread_db directly]), -[srv_libthread_db_path="${withval}" - srv_libs="$srv_libthread_db_path" -]) - -if test "$srv_libs" != "" -a "$srv_libs" != "-ldl"; then - AC_DEFINE(USE_LIBTHREAD_DB_DIRECTLY, 1, [Define if we should use libthread_db directly.]) -fi - -if test "$srv_xmlfiles" != ""; then - srv_xmlbuiltin="xml-builtin.o" - AC_DEFINE(USE_XML, 1, [Define if an XML target description is available.]) - - tmp_xmlfiles=$srv_xmlfiles - srv_xmlfiles="" - for f in $tmp_xmlfiles; do - srv_xmlfiles="$srv_xmlfiles \$(XML_DIR)/$f" - done -fi - -GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles" -GDBSERVER_LIBS="$srv_libs" - -dnl Check whether the target supports __sync_*_compare_and_swap. -AC_CACHE_CHECK([whether the target supports __sync_*_compare_and_swap], - gdbsrv_cv_have_sync_builtins, [ -AC_TRY_LINK([], [int foo, bar; bar = __sync_val_compare_and_swap(&foo, 0, 1);], - gdbsrv_cv_have_sync_builtins=yes, - gdbsrv_cv_have_sync_builtins=no)]) -if test $gdbsrv_cv_have_sync_builtins = yes; then - AC_DEFINE(HAVE_SYNC_BUILTINS, 1, - [Define to 1 if the target supports __sync_*_compare_and_swap]) -fi - -dnl Check for -fvisibility=hidden support in the compiler. -saved_cflags="$CFLAGS" -CFLAGS="$CFLAGS -fvisibility=hidden" -AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), - [gdbsrv_cv_have_visibility_hidden=yes], - [gdbsrv_cv_have_visibility_hidden=no]) -CFLAGS="$saved_cflags" - - -IPA_DEPFILES="" -extra_libraries="" - -# check whether to enable the inprocess agent -if test "$ipa_obj" != "" \ - -a "$gdbsrv_cv_have_sync_builtins" = yes \ - -a "$gdbsrv_cv_have_visibility_hidden" = yes; then - have_ipa=true -else - have_ipa=false -fi - -AC_ARG_ENABLE(inprocess-agent, -AS_HELP_STRING([--enable-inprocess-agent], [inprocess agent]), -[case "$enableval" in - yes) want_ipa=true ;; - no) want_ipa=false ;; - *) AC_MSG_ERROR([bad value $enableval for inprocess-agent]) ;; -esac], -[want_ipa=$have_ipa]) - -if $want_ipa ; then - if $have_ipa ; then - IPA_DEPFILES="$ipa_obj" - extra_libraries="$extra_libraries libinproctrace.so" - else - AC_MSG_ERROR([inprocess agent not supported for this target]) - fi -fi - -AC_SUBST(GDBSERVER_DEPFILES) -AC_SUBST(GDBSERVER_LIBS) -AC_SUBST(USE_THREAD_DB) -AC_SUBST(srv_xmlbuiltin) -AC_SUBST(srv_xmlfiles) -AC_SUBST(IPA_DEPFILES) -AC_SUBST(extra_libraries) - -AC_OUTPUT(Makefile, -[case x$CONFIG_HEADERS in -xconfig.h:config.in) -echo > stamp-h ;; -esac -]) diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv deleted file mode 100644 index 5c4900e8e41..00000000000 --- a/gdb/gdbserver/configure.srv +++ /dev/null @@ -1,281 +0,0 @@ -# Mappings from configuration triplets to gdbserver build options. -# This is invoked from the autoconf-generated configure script, to -# produce the appropriate Makefile substitutions. - -# This file sets the following shell variables: -# srv_regobj The register protocol appropriate for this target. -# srv_tgtobj Any other target-specific modules appropriate -# for this target. -# srv_hostio_err The object implementing the hostio_last_error -# target method. -# srv_xmlfiles All XML files which should be available for -# gdbserver in this configuration. -# ipa_obj Any other target-specific modules appropriate -# for this target's in-process agent. -# -# In addition, on GNU/Linux the following shell variables will be set: -# srv_linux_regsets Set to "yes" if ptrace(PTRACE_GETREGS) and friends -# may be available on this platform; unset otherwise. -# They will only be used if <sys/ptrace.h> defines -# PTRACE_GETREGS. -# srv_linux_usrregs Set to "yes" if we can get at registers via -# PTRACE_PEEKUSR / PTRACE_POKEUSR. - -# Default hostio_last_error implementation -srv_hostio_err_objs="hostio-errno.o" - -srv_i386_regobj="i386.o i386-avx.o i386-mmx.o" -srv_i386_linux_regobj="i386-linux.o i386-avx-linux.o i386-mmx-linux.o" -srv_amd64_regobj="amd64.o amd64-avx.o" -srv_amd64_linux_regobj="amd64-linux.o amd64-avx-linux.o" - -ipa_i386_linux_regobj=i386-linux-ipa.o -ipa_amd64_linux_regobj=amd64-linux-ipa.o - -srv_i386_32bit_xmlfiles="i386/32bit-core.xml i386/32bit-sse.xml i386/32bit-avx.xml" -srv_i386_64bit_xmlfiles="i386/64bit-core.xml i386/64bit-sse.xml i386/64bit-avx.xml" -srv_i386_xmlfiles="i386/i386.xml i386/i386-avx.xml i386/i386-mmx.xml $srv_i386_32bit_xmlfiles" -srv_amd64_xmlfiles="i386/amd64.xml i386/amd64-avx.xml $srv_i386_64bit_xmlfiles" -srv_i386_linux_xmlfiles="i386/i386-linux.xml i386/i386-avx-linux.xml i386/i386-mmx-linux.xml i386/32bit-linux.xml $srv_i386_32bit_xmlfiles" -srv_amd64_linux_xmlfiles="i386/amd64-linux.xml i386/amd64-avx-linux.xml i386/64bit-linux.xml $srv_i386_64bit_xmlfiles" - -# Input is taken from the "${target}" variable. - -case "${target}" in - arm*-*-linux*) srv_regobj="reg-arm.o arm-with-iwmmxt.o" - srv_regobj="${srv_regobj} arm-with-vfpv2.o" - srv_regobj="${srv_regobj} arm-with-vfpv3.o" - srv_regobj="${srv_regobj} arm-with-neon.o" - srv_tgtobj="linux-low.o linux-osdata.o linux-arm-low.o linux-procfs.o" - srv_xmlfiles="arm-with-iwmmxt.xml" - srv_xmlfiles="${srv_xmlfiles} arm-with-vfpv2.xml" - srv_xmlfiles="${srv_xmlfiles} arm-with-vfpv3.xml" - srv_xmlfiles="${srv_xmlfiles} arm-with-neon.xml" - srv_xmlfiles="${srv_xmlfiles} arm-core.xml" - srv_xmlfiles="${srv_xmlfiles} xscale-iwmmxt.xml" - srv_xmlfiles="${srv_xmlfiles} arm-vfpv2.xml" - srv_xmlfiles="${srv_xmlfiles} arm-vfpv3.xml" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - arm*-*-mingw32ce*) srv_regobj=reg-arm.o - srv_tgtobj="win32-low.o win32-arm-low.o" - srv_tgtobj="${srv_tgtobj} wincecompat.o" - # hostio_last_error implementation is in win32-low.c - srv_hostio_err_objs="" - srv_mingw=yes - srv_mingwce=yes - ;; - bfin-*-*linux*) srv_regobj=reg-bfin.o - srv_tgtobj="linux-low.o linux-osdata.o linux-bfin-low.o linux-procfs.o" - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; - crisv32-*-linux*) srv_regobj=reg-crisv32.o - srv_tgtobj="linux-low.o linux-osdata.o linux-crisv32-low.o linux-procfs.o" - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - cris-*-linux*) srv_regobj=reg-cris.o - srv_tgtobj="linux-low.o linux-osdata.o linux-cris-low.o linux-procfs.o" - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; - i[34567]86-*-cygwin*) srv_regobj="$srv_i386_regobj" - srv_tgtobj="i386-low.o win32-low.o win32-i386-low.o" - srv_xmlfiles="$srv_i386_xmlfiles" - ;; - i[34567]86-*-linux*) srv_regobj="$srv_i386_linux_regobj" - srv_xmlfiles="$srv_i386_linux_xmlfiles" - if test "$gdb_cv_i386_is_x86_64" = yes ; then - srv_regobj="$srv_regobj $srv_amd64_linux_regobj" - srv_xmlfiles="${srv_xmlfiles} $srv_amd64_linux_xmlfiles" - fi - srv_tgtobj="linux-low.o linux-osdata.o linux-x86-low.o i386-low.o i387-fp.o linux-procfs.o" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes - ipa_obj="${ipa_i386_linux_regobj} linux-i386-ipa.o" - ;; - i[34567]86-*-lynxos*) srv_regobj="i386.o" - srv_tgtobj="lynx-low.o lynx-i386-low.o" - srv_lynxos=yes - ;; - i[34567]86-*-mingw32ce*) - srv_regobj="$srv_i386_regobj" - srv_tgtobj="i386-low.o win32-low.o win32-i386-low.o" - srv_tgtobj="${srv_tgtobj} wincecompat.o" - srv_xmlfiles="$srv_i386_xmlfiles" - # hostio_last_error implementation is in win32-low.c - srv_hostio_err_objs="" - srv_mingw=yes - srv_mingwce=yes - ;; - i[34567]86-*-mingw*) srv_regobj="$srv_i386_regobj" - srv_tgtobj="i386-low.o win32-low.o win32-i386-low.o" - srv_xmlfiles="$srv_i386_xmlfiles" - srv_mingw=yes - ;; - i[34567]86-*-nto*) srv_regobj="$srv_i386_regobj" - srv_tgtobj="nto-low.o nto-x86-low.o" - srv_xmlfiles="$srv_i386_xmlfiles" - srv_qnx="yes" - ;; - ia64-*-linux*) srv_regobj=reg-ia64.o - srv_tgtobj="linux-low.o linux-osdata.o linux-ia64-low.o linux-procfs.o" - srv_linux_usrregs=yes - ;; - m32r*-*-linux*) srv_regobj=reg-m32r.o - srv_tgtobj="linux-low.o linux-osdata.o linux-m32r-low.o linux-procfs.o" - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; - m68*-*-linux*) if test "$gdb_cv_m68k_is_coldfire" = yes; then - srv_regobj=reg-cf.o - else - srv_regobj=reg-m68k.o - fi - srv_tgtobj="linux-low.o linux-osdata.o linux-m68k-low.o linux-procfs.o" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - m68*-*-uclinux*) if test "$gdb_cv_m68k_is_coldfire" = yes; then - srv_regobj=reg-cf.o - else - srv_regobj=reg-m68k.o - fi - srv_tgtobj="linux-low.o linux-osdata.o linux-m68k-low.o linux-procfs.o" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - mips*-*-linux*) srv_regobj="mips-linux.o mips64-linux.o" - srv_tgtobj="linux-low.o linux-osdata.o linux-mips-low.o linux-procfs.o" - srv_xmlfiles="mips-linux.xml" - srv_xmlfiles="${srv_xmlfiles} mips-cpu.xml" - srv_xmlfiles="${srv_xmlfiles} mips-cp0.xml" - srv_xmlfiles="${srv_xmlfiles} mips-fpu.xml" - srv_xmlfiles="${srv_xmlfiles} mips64-linux.xml" - srv_xmlfiles="${srv_xmlfiles} mips64-cpu.xml" - srv_xmlfiles="${srv_xmlfiles} mips64-cp0.xml" - srv_xmlfiles="${srv_xmlfiles} mips64-fpu.xml" - srv_linux_regsets=yes - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; - powerpc*-*-linux*) srv_regobj="powerpc-32l.o" - srv_regobj="${srv_regobj} powerpc-altivec32l.o" - srv_regobj="${srv_regobj} powerpc-cell32l.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-cell64l.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-osdata.o linux-ppc-low.o linux-procfs.o" - srv_xmlfiles="rs6000/powerpc-32l.xml" - srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml" - srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-cell32l.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-cell64l.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 - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - powerpc-*-lynxos*) srv_regobj="powerpc-32.o" - srv_tgtobj="lynx-low.o lynx-ppc-low.o" - srv_lynxos=yes - ;; - s390*-*-linux*) srv_regobj="s390-linux32.o" - srv_regobj="${srv_regobj} s390-linux64.o" - srv_regobj="${srv_regobj} s390x-linux64.o" - srv_tgtobj="linux-low.o linux-osdata.o linux-s390-low.o linux-procfs.o" - srv_xmlfiles="s390-linux32.xml" - srv_xmlfiles="${srv_xmlfiles} s390-linux64.xml" - srv_xmlfiles="${srv_xmlfiles} s390x-linux64.xml" - srv_xmlfiles="${srv_xmlfiles} s390-core32.xml" - srv_xmlfiles="${srv_xmlfiles} s390-core64.xml" - srv_xmlfiles="${srv_xmlfiles} s390x-core64.xml" - srv_xmlfiles="${srv_xmlfiles} s390-acr.xml" - srv_xmlfiles="${srv_xmlfiles} s390-fpr.xml" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - sh*-*-linux*) srv_regobj=reg-sh.o - srv_tgtobj="linux-low.o linux-osdata.o linux-sh-low.o linux-procfs.o" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - sparc*-*-linux*) srv_regobj=reg-sparc64.o - srv_tgtobj="linux-low.o linux-osdata.o linux-sparc-low.o linux-procfs.o" - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - spu*-*-*) srv_regobj=reg-spu.o - srv_tgtobj="spu-low.o" - ;; - tic6x-*-uclinux) srv_regobj="tic6x-c64xp-linux.o" - srv_regobj="${srv_regobj} tic6x-c64x-linux.o" - srv_regobj="${srv_regobj} tic6x-c62x-linux.o" - srv_xmlfiles="tic6x-c64xp-linux.xml" - srv_xmlfiles="${srv_xmlfiles} tic6x-c64x-linux.xml" - srv_xmlfiles="${srv_xmlfiles} tic6x-c62x-linux.xml" - srv_xmlfiles="${srv_xmlfiles} tic6x-core.xml" - srv_xmlfiles="${srv_xmlfiles} tic6x-gp.xml" - srv_xmlfiles="${srv_xmlfiles} tic6x-c6xp.xml" - srv_tgtobj="linux-low.o linux-osdata.o linux-tic6x-low.o linux-procfs.o" - srv_linux_regsets=yes - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; - x86_64-*-linux*) srv_regobj="$srv_amd64_linux_regobj $srv_i386_linux_regobj" - srv_tgtobj="linux-low.o linux-osdata.o linux-x86-low.o i386-low.o i387-fp.o linux-procfs.o" - srv_xmlfiles="$srv_i386_linux_xmlfiles $srv_amd64_linux_xmlfiles" - srv_linux_usrregs=yes # This is for i386 progs. - srv_linux_regsets=yes - srv_linux_thread_db=yes - ipa_obj="${ipa_amd64_linux_regobj} linux-amd64-ipa.o" - ;; - x86_64-*-mingw*) srv_regobj="$srv_amd64_regobj" - srv_tgtobj="i386-low.o i387-fp.o win32-low.o win32-i386-low.o" - srv_xmlfiles="$srv_i386_xmlfiles $srv_amd64_xmlfiles" - srv_mingw=yes - ;; - - xtensa*-*-linux*) srv_regobj=reg-xtensa.o - srv_tgtobj="linux-low.o linux-osdata.o linux-xtensa-low.o linux-procfs.o" - srv_linux_regsets=yes - ;; - *) echo "Error: target not supported by gdbserver." - exit 1 - ;; -esac diff --git a/gdb/gdbserver/event-loop.c b/gdb/gdbserver/event-loop.c deleted file mode 100644 index 74cb7d5b954..00000000000 --- a/gdb/gdbserver/event-loop.c +++ /dev/null @@ -1,637 +0,0 @@ -/* Event loop machinery for the remote server for GDB. - Copyright (C) 1999, 2000, 2001, 2002, 2005, 2006, 2007, 2008, 2010, 2011 - 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/>. */ - -/* Based on src/gdb/event-loop.c. */ - -#include "server.h" - -#include <sys/types.h> -#include <string.h> -#include <sys/time.h> - -#ifdef USE_WIN32API -#include <windows.h> -#include <io.h> -#endif - -#ifdef HAVE_ERRNO_H -#include <errno.h> -#endif - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif - -typedef struct gdb_event gdb_event; -typedef int (event_handler_func) (gdb_fildes_t); - -/* Tell create_file_handler what events we are interested in. */ - -#define GDB_READABLE (1<<1) -#define GDB_WRITABLE (1<<2) -#define GDB_EXCEPTION (1<<3) - -/* Events are queued by calling async_queue_event and serviced later - on by do_one_event. An event can be, for instance, a file - descriptor becoming ready to be read. Servicing an event simply - means that the procedure PROC will be called. We have 2 queues, - one for file handlers that we listen to in the event loop, and one - for the file handlers+events that are ready. The procedure PROC - associated with each event is always the same (handle_file_event). - Its duty is to invoke the handler associated with the file - descriptor whose state change generated the event, plus doing other - cleanups and such. */ - -struct gdb_event - { - /* Procedure to call to service this event. */ - event_handler_func *proc; - - /* File descriptor that is ready. */ - gdb_fildes_t fd; - - /* Next in list of events or NULL. */ - struct gdb_event *next_event; - }; - -/* Information about each file descriptor we register with the event - loop. */ - -typedef struct file_handler - { - /* File descriptor. */ - gdb_fildes_t fd; - - /* Events we want to monitor. */ - int mask; - - /* Events that have been seen since the last time. */ - int ready_mask; - - /* Procedure to call when fd is ready. */ - handler_func *proc; - - /* Argument to pass to proc. */ - gdb_client_data client_data; - - /* Was an error detected on this fd? */ - int error; - - /* Next registered file descriptor. */ - struct file_handler *next_file; - } -file_handler; - -/* Event queue: - - Events can be inserted at the front of the queue or at the end of - the queue. Events will be extracted from the queue for processing - starting from the head. Therefore, events inserted at the head of - the queue will be processed in a last in first out fashion, while - those inserted at the tail of the queue will be processed in a - first in first out manner. All the fields are NULL if the queue is - empty. */ - -static struct - { - /* The first pending event. */ - gdb_event *first_event; - - /* The last pending event. */ - gdb_event *last_event; - } -event_queue; - -/* Gdb_notifier is just a list of file descriptors gdb is interested - in. These are the input file descriptor, and the target file - descriptor. Each of the elements in the gdb_notifier list is - basically a description of what kind of events gdb is interested - in, for each fd. */ - -static struct - { - /* Ptr to head of file handler list. */ - file_handler *first_file_handler; - - /* Masks to be used in the next call to select. Bits are set in - response to calls to create_file_handler. */ - fd_set check_masks[3]; - - /* What file descriptors were found ready by select. */ - fd_set ready_masks[3]; - - /* Number of valid bits (highest fd value + 1). (for select) */ - int num_fds; - } -gdb_notifier; - -/* Callbacks are just routines that are executed before waiting for the - next event. In GDB this is struct gdb_timer. We don't need timers - so rather than copy all that complexity in gdbserver, we provide what - we need, but we do so in a way that if/when the day comes that we need - that complexity, it'll be easier to add - replace callbacks with timers - and use a delta of zero (which is all gdb currently uses timers for anyway). - - PROC will be executed before gdbserver goes to sleep to wait for the - next event. */ - -struct callback_event - { - int id; - callback_handler_func *proc; - gdb_client_data *data; - struct callback_event *next; - }; - -/* Table of registered callbacks. */ - -static struct - { - struct callback_event *first; - struct callback_event *last; - - /* Id of the last callback created. */ - int num_callbacks; - } -callback_list; - -/* Insert an event object into the gdb event queue. - - EVENT_PTR points to the event to be inserted into the queue. The - caller must allocate memory for the event. It is freed after the - event has ben handled. Events in the queue will be processed head - to tail, therefore, events will be processed first in first - out. */ - -static void -async_queue_event (gdb_event *event_ptr) -{ - /* The event will become the new last_event. */ - - event_ptr->next_event = NULL; - if (event_queue.first_event == NULL) - event_queue.first_event = event_ptr; - else - event_queue.last_event->next_event = event_ptr; - event_queue.last_event = event_ptr; -} - -/* Process one event. If an event was processed, 1 is returned - otherwise 0 is returned. Scan the queue from head to tail, - processing therefore the high priority events first, by invoking - the associated event handler procedure. */ - -static int -process_event (void) -{ - gdb_event *event_ptr, *prev_ptr; - event_handler_func *proc; - gdb_fildes_t fd; - - /* Look in the event queue to find an event that is ready - to be processed. */ - - for (event_ptr = event_queue.first_event; - event_ptr != NULL; - event_ptr = event_ptr->next_event) - { - /* Call the handler for the event. */ - - proc = event_ptr->proc; - fd = event_ptr->fd; - - /* Let's get rid of the event from the event queue. We need to - do this now because while processing the event, since the - proc function could end up jumping out to the caller of this - function. In that case, we would have on the event queue an - event which has been processed, but not deleted. */ - - if (event_queue.first_event == event_ptr) - { - event_queue.first_event = event_ptr->next_event; - if (event_ptr->next_event == NULL) - event_queue.last_event = NULL; - } - else - { - prev_ptr = event_queue.first_event; - while (prev_ptr->next_event != event_ptr) - prev_ptr = prev_ptr->next_event; - - prev_ptr->next_event = event_ptr->next_event; - if (event_ptr->next_event == NULL) - event_queue.last_event = prev_ptr; - } - free (event_ptr); - - /* Now call the procedure associated with the event. */ - if ((*proc) (fd)) - return -1; - return 1; - } - - /* This is the case if there are no event on the event queue. */ - return 0; -} - -/* Append PROC to the callback list. - The result is the "id" of the callback that can be passed back to - delete_callback_event. */ - -int -append_callback_event (callback_handler_func *proc, gdb_client_data data) -{ - struct callback_event *event_ptr; - - event_ptr = xmalloc (sizeof (*event_ptr)); - event_ptr->id = callback_list.num_callbacks++; - event_ptr->proc = proc; - event_ptr->data = data; - event_ptr->next = NULL; - if (callback_list.first == NULL) - callback_list.first = event_ptr; - if (callback_list.last != NULL) - callback_list.last->next = event_ptr; - callback_list.last = event_ptr; - return event_ptr->id; -} - -/* Delete callback ID. - It is not an error callback ID doesn't exist. */ - -void -delete_callback_event (int id) -{ - struct callback_event **p; - - for (p = &callback_list.first; *p != NULL; p = &(*p)->next) - { - struct callback_event *event_ptr = *p; - - if (event_ptr->id == id) - { - *p = event_ptr->next; - if (event_ptr == callback_list.last) - callback_list.last = NULL; - free (event_ptr); - break; - } - } -} - -/* Run the next callback. - The result is 1 if a callback was called and event processing - should continue, -1 if the callback wants the event loop to exit, - and 0 if there are no more callbacks. */ - -static int -process_callback (void) -{ - struct callback_event *event_ptr; - - event_ptr = callback_list.first; - if (event_ptr != NULL) - { - callback_handler_func *proc = event_ptr->proc; - gdb_client_data *data = event_ptr->data; - - /* Remove the event before calling PROC, - more events may get added by PROC. */ - callback_list.first = event_ptr->next; - if (callback_list.first == NULL) - callback_list.last = NULL; - free (event_ptr); - if ((*proc) (data)) - return -1; - return 1; - } - - return 0; -} - -/* Add a file handler/descriptor to the list of descriptors we are - interested in. FD is the file descriptor for the file/stream to be - listened to. MASK is a combination of READABLE, WRITABLE, - EXCEPTION. PROC is the procedure that will be called when an event - occurs for FD. CLIENT_DATA is the argument to pass to PROC. */ - -static void -create_file_handler (gdb_fildes_t fd, int mask, handler_func *proc, - gdb_client_data client_data) -{ - file_handler *file_ptr; - - /* Do we already have a file handler for this file? (We may be - changing its associated procedure). */ - for (file_ptr = gdb_notifier.first_file_handler; - file_ptr != NULL; - file_ptr = file_ptr->next_file) - if (file_ptr->fd == fd) - break; - - /* It is a new file descriptor. Add it to the list. Otherwise, - just change the data associated with it. */ - if (file_ptr == NULL) - { - file_ptr = xmalloc (sizeof (*file_ptr)); - file_ptr->fd = fd; - file_ptr->ready_mask = 0; - file_ptr->next_file = gdb_notifier.first_file_handler; - gdb_notifier.first_file_handler = file_ptr; - - if (mask & GDB_READABLE) - FD_SET (fd, &gdb_notifier.check_masks[0]); - else - FD_CLR (fd, &gdb_notifier.check_masks[0]); - - if (mask & GDB_WRITABLE) - FD_SET (fd, &gdb_notifier.check_masks[1]); - else - FD_CLR (fd, &gdb_notifier.check_masks[1]); - - if (mask & GDB_EXCEPTION) - FD_SET (fd, &gdb_notifier.check_masks[2]); - else - FD_CLR (fd, &gdb_notifier.check_masks[2]); - - if (gdb_notifier.num_fds <= fd) - gdb_notifier.num_fds = fd + 1; - } - - file_ptr->proc = proc; - file_ptr->client_data = client_data; - file_ptr->mask = mask; -} - -/* Wrapper function for create_file_handler. */ - -void -add_file_handler (gdb_fildes_t fd, - handler_func *proc, gdb_client_data client_data) -{ - create_file_handler (fd, GDB_READABLE | GDB_EXCEPTION, proc, client_data); -} - -/* Remove the file descriptor FD from the list of monitored fd's: - i.e. we don't care anymore about events on the FD. */ - -void -delete_file_handler (gdb_fildes_t fd) -{ - file_handler *file_ptr, *prev_ptr = NULL; - int i; - - /* Find the entry for the given file. */ - - for (file_ptr = gdb_notifier.first_file_handler; - file_ptr != NULL; - file_ptr = file_ptr->next_file) - if (file_ptr->fd == fd) - break; - - if (file_ptr == NULL) - return; - - if (file_ptr->mask & GDB_READABLE) - FD_CLR (fd, &gdb_notifier.check_masks[0]); - if (file_ptr->mask & GDB_WRITABLE) - FD_CLR (fd, &gdb_notifier.check_masks[1]); - if (file_ptr->mask & GDB_EXCEPTION) - FD_CLR (fd, &gdb_notifier.check_masks[2]); - - /* Find current max fd. */ - - if ((fd + 1) == gdb_notifier.num_fds) - { - gdb_notifier.num_fds--; - for (i = gdb_notifier.num_fds; i; i--) - { - if (FD_ISSET (i - 1, &gdb_notifier.check_masks[0]) - || FD_ISSET (i - 1, &gdb_notifier.check_masks[1]) - || FD_ISSET (i - 1, &gdb_notifier.check_masks[2])) - break; - } - gdb_notifier.num_fds = i; - } - - /* Deactivate the file descriptor, by clearing its mask, so that it - will not fire again. */ - - file_ptr->mask = 0; - - /* Get rid of the file handler in the file handler list. */ - if (file_ptr == gdb_notifier.first_file_handler) - gdb_notifier.first_file_handler = file_ptr->next_file; - else - { - for (prev_ptr = gdb_notifier.first_file_handler; - prev_ptr->next_file != file_ptr; - prev_ptr = prev_ptr->next_file) - ; - prev_ptr->next_file = file_ptr->next_file; - } - free (file_ptr); -} - -/* Handle the given event by calling the procedure associated to the - corresponding file handler. Called by process_event indirectly, - through event_ptr->proc. EVENT_FILE_DESC is file descriptor of the - event in the front of the event queue. */ - -static int -handle_file_event (gdb_fildes_t event_file_desc) -{ - file_handler *file_ptr; - int mask; - - /* Search the file handler list to find one that matches the fd in - the event. */ - for (file_ptr = gdb_notifier.first_file_handler; file_ptr != NULL; - file_ptr = file_ptr->next_file) - { - if (file_ptr->fd == event_file_desc) - { - /* See if the desired events (mask) match the received - events (ready_mask). */ - - if (file_ptr->ready_mask & GDB_EXCEPTION) - { - fprintf (stderr, "Exception condition detected on fd %s\n", - pfildes (file_ptr->fd)); - file_ptr->error = 1; - } - else - file_ptr->error = 0; - mask = file_ptr->ready_mask & file_ptr->mask; - - /* Clear the received events for next time around. */ - file_ptr->ready_mask = 0; - - /* If there was a match, then call the handler. */ - if (mask != 0) - { - if ((*file_ptr->proc) (file_ptr->error, - file_ptr->client_data) < 0) - return -1; - } - break; - } - } - - return 0; -} - -/* Create a file event, to be enqueued in the event queue for - processing. The procedure associated to this event is always - handle_file_event, which will in turn invoke the one that was - associated to FD when it was registered with the event loop. */ - -static gdb_event * -create_file_event (gdb_fildes_t fd) -{ - gdb_event *file_event_ptr; - - file_event_ptr = xmalloc (sizeof (gdb_event)); - file_event_ptr->proc = handle_file_event; - file_event_ptr->fd = fd; - return file_event_ptr; -} - -/* Called by 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 - select. Return -1 if there are no files descriptors to monitor, - otherwise return 0. */ - -static int -wait_for_event (void) -{ - file_handler *file_ptr; - gdb_event *file_event_ptr; - int num_found = 0; - - /* Make sure all output is done before getting another event. */ - fflush (stdout); - fflush (stderr); - - if (gdb_notifier.num_fds == 0) - return -1; - - gdb_notifier.ready_masks[0] = gdb_notifier.check_masks[0]; - gdb_notifier.ready_masks[1] = gdb_notifier.check_masks[1]; - gdb_notifier.ready_masks[2] = gdb_notifier.check_masks[2]; - num_found = select (gdb_notifier.num_fds, - &gdb_notifier.ready_masks[0], - &gdb_notifier.ready_masks[1], - &gdb_notifier.ready_masks[2], - NULL); - - /* Clear the masks after an error from select. */ - if (num_found == -1) - { - FD_ZERO (&gdb_notifier.ready_masks[0]); - FD_ZERO (&gdb_notifier.ready_masks[1]); - FD_ZERO (&gdb_notifier.ready_masks[2]); -#ifdef EINTR - /* Dont print anything if we got a signal, let gdb handle - it. */ - if (errno != EINTR) - perror_with_name ("select"); -#endif - } - - /* Enqueue all detected file events. */ - - for (file_ptr = gdb_notifier.first_file_handler; - file_ptr != NULL && num_found > 0; - file_ptr = file_ptr->next_file) - { - int mask = 0; - - if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[0])) - mask |= GDB_READABLE; - if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[1])) - mask |= GDB_WRITABLE; - if (FD_ISSET (file_ptr->fd, &gdb_notifier.ready_masks[2])) - mask |= GDB_EXCEPTION; - - if (!mask) - continue; - else - num_found--; - - /* Enqueue an event only if this is still a new event for this - fd. */ - - if (file_ptr->ready_mask == 0) - { - file_event_ptr = create_file_event (file_ptr->fd); - async_queue_event (file_event_ptr); - } - file_ptr->ready_mask = mask; - } - - return 0; -} - -/* Start up the event loop. This is the entry point to the event - loop. */ - -void -start_event_loop (void) -{ - /* Loop until there is nothing to do. This is the entry point to - the event loop engine. If nothing is ready at this time, wait - for something to happen (via wait_for_event), then process it. - Return when there are no longer event sources to wait for. */ - - while (1) - { - /* Any events already waiting in the queue? */ - int res = process_event (); - - /* Did the event handler want the event loop to stop? */ - if (res == -1) - return; - - if (res) - continue; - - /* Process any queued callbacks before we go to sleep. */ - res = process_callback (); - - /* Did the callback want the event loop to stop? */ - if (res == -1) - return; - - if (res) - continue; - - /* Wait for a new event. If 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 (wait_for_event () < 0) - return; - } - - /* We are done with the event loop. There are no more event sources - to listen to. So we exit gdbserver. */ -} diff --git a/gdb/gdbserver/gdb_proc_service.h b/gdb/gdbserver/gdb_proc_service.h deleted file mode 100644 index 160a1ca7ed0..00000000000 --- a/gdb/gdbserver/gdb_proc_service.h +++ /dev/null @@ -1,74 +0,0 @@ -/* <proc_service.h> replacement for systems that don't have it. - Copyright (C) 2000, 2006, 2007, 2008, 2009, 2010, 2011 - 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/>. */ - -#ifndef GDB_PROC_SERVICE_H -#define GDB_PROC_SERVICE_H - -#include <sys/types.h> - -#ifdef HAVE_PROC_SERVICE_H -#include <proc_service.h> -#else - -#ifdef HAVE_SYS_PROCFS_H -#include <sys/procfs.h> -#endif - -/* Not all platforms bring in <linux/elf.h> via <sys/procfs.h>. If - <sys/procfs.h> wasn't enough to find elf_fpregset_t, try the kernel - headers also (but don't if we don't need to). */ -#ifndef HAVE_ELF_FPREGSET_T -# ifdef HAVE_LINUX_ELF_H -# include <linux/elf.h> -# endif -#endif - -typedef enum -{ - PS_OK, /* Success. */ - PS_ERR, /* Generic error. */ - PS_BADPID, /* Bad process handle. */ - PS_BADLID, /* Bad LWP id. */ - PS_BADADDR, /* Bad address. */ - PS_NOSYM, /* Symbol not found. */ - PS_NOFREGS /* FPU register set not available. */ -} ps_err_e; - -#ifndef HAVE_LWPID_T -typedef unsigned int lwpid_t; -#endif - -#ifndef HAVE_PSADDR_T -typedef void *psaddr_t; -#endif - -#ifndef HAVE_PRGREGSET_T -typedef elf_gregset_t prgregset_t; -#endif - -#endif /* HAVE_PROC_SERVICE_H */ - -/* Structure that identifies the target process. */ -struct ps_prochandle -{ - /* We don't need to track anything. All context is served from the - current inferior. */ -}; - -#endif /* gdb_proc_service.h */ diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c deleted file mode 100644 index 469b79a08f8..00000000000 --- a/gdb/gdbserver/gdbreplay.c +++ /dev/null @@ -1,486 +0,0 @@ -/* Replay a remote debug session logfile for GDB. - Copyright (C) 1996, 1998, 1999, 2000, 2002, 2003, 2005, 2006, 2007, 2008, - 2009, 2010, 2011 Free Software Foundation, Inc. - Written by Fred Fish (fnf@cygnus.com) from pieces of gdbserver. - - This file is part of GDB. - - This program is free software; you can 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 "config.h" -#include <stdio.h> -#if HAVE_SYS_FILE_H -#include <sys/file.h> -#endif -#if HAVE_SIGNAL_H -#include <signal.h> -#endif -#include <ctype.h> -#if HAVE_FCNTL_H -#include <fcntl.h> -#endif -#if HAVE_ERRNO_H -#include <errno.h> -#endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#if HAVE_NETDB_H -#include <netdb.h> -#endif -#if HAVE_NETINET_TCP_H -#include <netinet/tcp.h> -#endif -#if HAVE_ALLOCA_H -#include <alloca.h> -#endif -#if HAVE_MALLOC_H -#include <malloc.h> -#endif -#if USE_WIN32API -#include <winsock2.h> -#endif - -#ifndef HAVE_SOCKLEN_T -typedef int socklen_t; -#endif - -/* Sort of a hack... */ -#define EOL (EOF - 1) - -/* Version information, from version.c. */ -extern const char version[]; -extern const char host_name[]; - -static int remote_desc; - -#ifdef __MINGW32CE__ - -#ifndef COUNTOF -#define COUNTOF(STR) (sizeof (STR) / sizeof ((STR)[0])) -#endif - -#define errno (GetLastError ()) - -char * -strerror (DWORD error) -{ - static char buf[1024]; - WCHAR *msgbuf; - DWORD lasterr = GetLastError (); - DWORD chars = FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM - | FORMAT_MESSAGE_ALLOCATE_BUFFER, - NULL, - error, - 0, /* Default language */ - (LPVOID)&msgbuf, - 0, - NULL); - if (chars != 0) - { - /* If there is an \r\n appended, zap it. */ - if (chars >= 2 - && msgbuf[chars - 2] == '\r' - && msgbuf[chars - 1] == '\n') - { - chars -= 2; - msgbuf[chars] = 0; - } - - if (chars > ((COUNTOF (buf)) - 1)) - { - chars = COUNTOF (buf) - 1; - msgbuf [chars] = 0; - } - - wcstombs (buf, msgbuf, chars + 1); - LocalFree (msgbuf); - } - else - sprintf (buf, "unknown win32 error (%ld)", error); - - SetLastError (lasterr); - return buf; -} - -#endif /* __MINGW32CE__ */ - -/* Print the system error message for errno, and also mention STRING - as the file name for which the error was encountered. - Then return to command level. */ - -static void -perror_with_name (const char *string) -{ -#ifndef STDC_HEADERS - extern int errno; -#endif - const char *err; - char *combined; - - err = strerror (errno); - if (err == NULL) - err = "unknown error"; - - combined = (char *) alloca (strlen (err) + strlen (string) + 3); - strcpy (combined, string); - strcat (combined, ": "); - strcat (combined, err); - fprintf (stderr, "\n%s.\n", combined); - fflush (stderr); - exit (1); -} - -static void -sync_error (FILE *fp, char *desc, int expect, int got) -{ - fprintf (stderr, "\n%s\n", desc); - fprintf (stderr, "At logfile offset %ld, expected '0x%x' got '0x%x'\n", - ftell (fp), expect, got); - fflush (stderr); - exit (1); -} - -static void -remote_error (const char *desc) -{ - fprintf (stderr, "\n%s\n", desc); - fflush (stderr); - exit (1); -} - -static void -remote_close (void) -{ -#ifdef USE_WIN32API - closesocket (remote_desc); -#else - close (remote_desc); -#endif -} - -/* Open a connection to a remote debugger. - NAME is the filename used for communication. */ - -static void -remote_open (char *name) -{ - if (!strchr (name, ':')) - { - fprintf (stderr, "%s: Must specify tcp connection as host:addr\n", name); - fflush (stderr); - exit (1); - } - else - { -#ifdef USE_WIN32API - static int winsock_initialized; -#endif - char *port_str; - int port; - struct sockaddr_in sockaddr; - socklen_t tmp; - int tmp_desc; - - port_str = strchr (name, ':'); - - port = atoi (port_str + 1); - -#ifdef USE_WIN32API - if (!winsock_initialized) - { - WSADATA wsad; - - WSAStartup (MAKEWORD (1, 0), &wsad); - winsock_initialized = 1; - } -#endif - - tmp_desc = socket (PF_INET, SOCK_STREAM, 0); - if (tmp_desc == -1) - perror_with_name ("Can't open socket"); - - /* Allow rapid reuse of this port. */ - tmp = 1; - setsockopt (tmp_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp, - sizeof (tmp)); - - sockaddr.sin_family = PF_INET; - sockaddr.sin_port = htons (port); - sockaddr.sin_addr.s_addr = INADDR_ANY; - - if (bind (tmp_desc, (struct sockaddr *) &sockaddr, sizeof (sockaddr)) - || listen (tmp_desc, 1)) - perror_with_name ("Can't bind address"); - - tmp = sizeof (sockaddr); - remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, &tmp); - if (remote_desc == -1) - perror_with_name ("Accept failed"); - - /* Enable TCP keep alive process. */ - tmp = 1; - setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, - (char *) &tmp, sizeof (tmp)); - - /* Tell TCP not to delay small packets. This greatly speeds up - interactive response. */ - tmp = 1; - setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY, - (char *) &tmp, sizeof (tmp)); - -#ifndef USE_WIN32API - close (tmp_desc); /* No longer need this */ - - signal (SIGPIPE, SIG_IGN); /* If we don't do this, then - gdbreplay simply exits when - the remote side dies. */ -#else - closesocket (tmp_desc); /* No longer need this */ -#endif - } - -#if defined(F_SETFL) && defined (FASYNC) - fcntl (remote_desc, F_SETFL, FASYNC); -#endif - - fprintf (stderr, "Replay logfile using %s\n", name); - fflush (stderr); -} - -static int -tohex (int ch) -{ - if (ch >= '0' && ch <= '9') - { - return (ch - '0'); - } - if (ch >= 'A' && ch <= 'F') - { - return (ch - 'A' + 10); - } - if (ch >= 'a' && ch <= 'f') - { - return (ch - 'a' + 10); - } - fprintf (stderr, "\nInvalid hex digit '%c'\n", ch); - fflush (stderr); - exit (1); -} - -static int -logchar (FILE *fp) -{ - int ch; - int ch2; - - ch = fgetc (fp); - fputc (ch, stdout); - fflush (stdout); - switch (ch) - { - case '\n': - ch = EOL; - break; - case '\\': - ch = fgetc (fp); - fputc (ch, stdout); - fflush (stdout); - switch (ch) - { - case '\\': - break; - case 'b': - ch = '\b'; - break; - case 'f': - ch = '\f'; - break; - case 'n': - ch = '\n'; - break; - case 'r': - ch = '\r'; - break; - case 't': - ch = '\t'; - break; - case 'v': - ch = '\v'; - break; - case 'x': - ch2 = fgetc (fp); - fputc (ch2, stdout); - fflush (stdout); - ch = tohex (ch2) << 4; - ch2 = fgetc (fp); - fputc (ch2, stdout); - fflush (stdout); - ch |= tohex (ch2); - break; - default: - /* Treat any other char as just itself */ - break; - } - default: - break; - } - return (ch); -} - -static int -gdbchar (int desc) -{ - unsigned char fromgdb; - - if (read (desc, &fromgdb, 1) != 1) - return -1; - else - return fromgdb; -} - -/* Accept input from gdb and match with chars from fp (after skipping one - blank) up until a \n is read from fp (which is not matched) */ - -static void -expect (FILE *fp) -{ - int fromlog; - int fromgdb; - - if ((fromlog = logchar (fp)) != ' ') - { - sync_error (fp, "Sync error during gdb read of leading blank", ' ', - fromlog); - } - do - { - fromlog = logchar (fp); - if (fromlog == EOL) - break; - fromgdb = gdbchar (remote_desc); - if (fromgdb < 0) - remote_error ("Error during read from gdb"); - } - while (fromlog == fromgdb); - - if (fromlog != EOL) - { - sync_error (fp, "Sync error during read of gdb packet from log", fromlog, - fromgdb); - } -} - -/* Play data back to gdb from fp (after skipping leading blank) up until a - \n is read from fp (which is discarded and not sent to gdb). */ - -static void -play (FILE *fp) -{ - int fromlog; - char ch; - - if ((fromlog = logchar (fp)) != ' ') - { - sync_error (fp, "Sync error skipping blank during write to gdb", ' ', - fromlog); - } - while ((fromlog = logchar (fp)) != EOL) - { - ch = fromlog; - if (write (remote_desc, &ch, 1) != 1) - remote_error ("Error during write to gdb"); - } -} - -static void -gdbreplay_version (void) -{ - printf ("GNU gdbreplay %s%s\n" - "Copyright (C) 2011 Free Software Foundation, Inc.\n" - "gdbreplay is free software, covered by " - "the GNU General Public License.\n" - "This gdbreplay was configured as \"%s\"\n", - PKGVERSION, version, host_name); -} - -static void -gdbreplay_usage (FILE *stream) -{ - fprintf (stream, "Usage:\tgdbreplay <logfile> <host:port>\n"); - if (REPORT_BUGS_TO[0] && stream == stdout) - fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO); -} - -int -main (int argc, char *argv[]) -{ - FILE *fp; - int ch; - - if (argc >= 2 && strcmp (argv[1], "--version") == 0) - { - gdbreplay_version (); - exit (0); - } - if (argc >= 2 && strcmp (argv[1], "--help") == 0) - { - gdbreplay_usage (stdout); - exit (0); - } - - if (argc < 3) - { - gdbreplay_usage (stderr); - exit (1); - } - fp = fopen (argv[1], "r"); - if (fp == NULL) - { - perror_with_name (argv[1]); - } - remote_open (argv[2]); - while ((ch = logchar (fp)) != EOF) - { - switch (ch) - { - case 'w': - /* data sent from gdb to gdbreplay, accept and match it */ - expect (fp); - break; - case 'r': - /* data sent from gdbreplay to gdb, play it */ - play (fp); - break; - case 'c': - /* Command executed by gdb */ - while ((ch = logchar (fp)) != EOL); - break; - } - } - remote_close (); - exit (0); -} diff --git a/gdb/gdbserver/gdbserver.1 b/gdb/gdbserver/gdbserver.1 deleted file mode 100644 index 0f71b1c5793..00000000000 --- a/gdb/gdbserver/gdbserver.1 +++ /dev/null @@ -1,116 +0,0 @@ -.\" Copyright (C) 1993, 2011 Free Software Foundation, Inc. -.\" See section COPYING for conditions for redistribution -.TH gdbserver 1 "2 November 1993" "Cygnus Support" "GNU Development Tools" -.SH NAME -gdbserver \- Remote Server for the GNU Debugger -.SH SYNOPSIS -.na -.TP -.B gdbserver -.RB tty -.RB prog -.RB "[\|" args... "\|]" -.PP -.B gdbserver -.RB tty -.B --attach -.RB PID -.ad b -.SH DESCRIPTION -GDBSERVER is a program that allows you to run GDB on a different machine -than the one which is running the program being debugged. - -Usage (server (target) side): - -First, you need to have a copy of the program you want to debug put onto -the target system. The program can be stripped to save space if needed, as -GDBserver doesn't care about symbols. All symbol handling is taken care of by -the GDB running on the host system. - -To use the server, you log on to the target system, and run the `gdbserver' -program. You must tell it (a) how to communicate with GDB, (b) the name of -your program, and (c) its arguments. The general syntax is: - - target> gdbserver COMM PROGRAM [ARGS ...] - -For example, using a serial port, you might say: - - target> gdbserver /dev/com1 emacs foo.txt - -This tells gdbserver to debug emacs with an argument of foo.txt, and to -communicate with GDB via /dev/com1. Gdbserver now waits patiently for the -host GDB to communicate with it. - -To use a TCP connection, you could say: - - target> gdbserver host:2345 emacs foo.txt - -This says pretty much the same thing as the last example, except that we are -going to communicate with the host GDB via TCP. The `host:2345' argument means -that we are expecting to see a TCP connection from `host' to local TCP port -2345. (Currently, the `host' part is ignored.) You can choose any number you -want for the port number as long as it does not conflict with any existing TCP -ports on the target system. This same port number must be used in the host -GDBs `target remote' command, which will be described shortly. Note that if -you chose a port number that conflicts with another service, gdbserver will -print an error message and exit. - -On some targets, gdbserver can also attach to running programs. -This is accomplished via the --attach argument. The syntax is: - - target> gdbserver COMM --attach PID - -PID is the process ID of a currently running process. It isn't -necessary to point gdbserver at a binary for the running process. - -Usage (host side): - -You need an unstripped copy of the target program on your host system, since -GDB needs to examine it's symbol tables and such. Start up GDB as you normally -would, with the target program as the first argument. (You may need to use the ---baud option if the serial line is running at anything except 9600 baud.) -Ie: `gdb TARGET-PROG', or `gdb --baud BAUD TARGET-PROG'. After that, the only -new command you need to know about is `target remote'. It's argument is either -a device name (usually a serial device, like `/dev/ttyb'), or a HOST:PORT -descriptor. For example: - - (gdb) target remote /dev/ttyb - -communicates with the server via serial line /dev/ttyb, and: - - (gdb) target remote the-target:2345 - -communicates via a TCP connection to port 2345 on host `the-target', where -you previously started up gdbserver with the same port number. Note that for -TCP connections, you must start up gdbserver prior to using the `target remote' -command, otherwise you may get an error that looks something like -`Connection refused'. -.SH OPTIONS -You have to supply the name of the program to debug -and the tty to communicate on; the remote GDB will do everything else. -Any remaining arguments will be passed to the program verbatim. -.SH "SEE ALSO" -.RB "`\|" gdb "\|'" -entry in -.B info\c -\&; -.I -Using GDB: A Guide to the GNU Source-Level Debugger\c -, Richard M. Stallman and Roland H. Pesch, July 1991. -.SH COPYING -Copyright (c) 1993 Free Software Foundation, Inc. -.PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the Free Software Foundation instead of in -the original English. diff --git a/gdb/gdbserver/hostio-errno.c b/gdb/gdbserver/hostio-errno.c deleted file mode 100644 index ded5066cf90..00000000000 --- a/gdb/gdbserver/hostio-errno.c +++ /dev/null @@ -1,86 +0,0 @@ -/* Host file transfer support for gdbserver. - Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. - - Contributed by CodeSourcery. - - This file is part of GDB. - - This program is free software; you can 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 implements the hostio_last_error target callback - on top of errno. */ - -#include <errno.h> -#include "server.h" -#include "gdb/fileio.h" - -static int -errno_to_fileio_error (int error) -{ - switch (error) - { - case EPERM: - return FILEIO_EPERM; - case ENOENT: - return FILEIO_ENOENT; - case EINTR: - return FILEIO_EINTR; - case EIO: - return FILEIO_EIO; - case EBADF: - return FILEIO_EBADF; - case EACCES: - return FILEIO_EACCES; - case EFAULT: - return FILEIO_EFAULT; - case EBUSY: - return FILEIO_EBUSY; - case EEXIST: - return FILEIO_EEXIST; - case ENODEV: - return FILEIO_ENODEV; - case ENOTDIR: - return FILEIO_ENOTDIR; - case EISDIR: - return FILEIO_EISDIR; - case EINVAL: - return FILEIO_EINVAL; - case ENFILE: - return FILEIO_ENFILE; - case EMFILE: - return FILEIO_EMFILE; - case EFBIG: - return FILEIO_EFBIG; - case ENOSPC: - return FILEIO_ENOSPC; - case ESPIPE: - return FILEIO_ESPIPE; - case EROFS: - return FILEIO_EROFS; - case ENOSYS: - return FILEIO_ENOSYS; - case ENAMETOOLONG: - return FILEIO_ENAMETOOLONG; - } - - return FILEIO_EUNKNOWN; -} - -void -hostio_last_error_from_errno (char *buf) -{ - int error = errno; - int fileio_error = errno_to_fileio_error (error); - sprintf (buf, "F-1,%x", fileio_error); -} diff --git a/gdb/gdbserver/hostio.c b/gdb/gdbserver/hostio.c deleted file mode 100644 index 7105013485b..00000000000 --- a/gdb/gdbserver/hostio.c +++ /dev/null @@ -1,478 +0,0 @@ -/* Host file transfer support for gdbserver. - Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. - - Contributed by CodeSourcery. - - This file is part of GDB. - - This program is free software; you can 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 "gdb/fileio.h" - -#include <fcntl.h> -#include <limits.h> -#include <unistd.h> - -extern int remote_debug; - -struct fd_list -{ - int fd; - struct fd_list *next; -}; - -static struct fd_list *open_fds; - -static int -safe_fromhex (char a, int *nibble) -{ - if (a >= '0' && a <= '9') - *nibble = a - '0'; - else if (a >= 'a' && a <= 'f') - *nibble = a - 'a' + 10; - else if (a >= 'A' && a <= 'F') - *nibble = a - 'A' + 10; - else - return -1; - - return 0; -} - -static int -require_filename (char **pp, char *filename) -{ - int count; - char *p; - - p = *pp; - count = 0; - - while (*p && *p != ',') - { - int nib1, nib2; - - /* Don't allow overflow. */ - if (count >= PATH_MAX - 1) - return -1; - - if (safe_fromhex (p[0], &nib1) - || safe_fromhex (p[1], &nib2)) - return -1; - - filename[count++] = nib1 * 16 + nib2; - p += 2; - } - - filename[count] = '\0'; - *pp = p; - return 0; -} - -static int -require_int (char **pp, int *value) -{ - char *p; - int count; - - p = *pp; - *value = 0; - count = 0; - - while (*p && *p != ',') - { - int nib; - - /* Don't allow overflow. */ - if (count >= 7) - return -1; - - if (safe_fromhex (p[0], &nib)) - return -1; - *value = *value * 16 + nib; - p++; - count++; - } - - *pp = p; - return 0; -} - -static int -require_data (char *p, int p_len, char **data, int *data_len) -{ - int input_index, output_index, escaped; - - *data = xmalloc (p_len); - - output_index = 0; - escaped = 0; - for (input_index = 0; input_index < p_len; input_index++) - { - char b = p[input_index]; - - if (escaped) - { - (*data)[output_index++] = b ^ 0x20; - escaped = 0; - } - else if (b == '}') - escaped = 1; - else - (*data)[output_index++] = b; - } - - if (escaped) - { - free (*data); - return -1; - } - - *data_len = output_index; - return 0; -} - -static int -require_comma (char **pp) -{ - if (**pp == ',') - { - (*pp)++; - return 0; - } - else - return -1; -} - -static int -require_end (char *p) -{ - if (*p == '\0') - return 0; - else - return -1; -} - -static int -require_valid_fd (int fd) -{ - struct fd_list *fd_ptr; - - for (fd_ptr = open_fds; fd_ptr != NULL; fd_ptr = fd_ptr->next) - if (fd_ptr->fd == fd) - return 0; - - return -1; -} - -/* Fill in own_buf with the last hostio error packet, however it - suitable for the target. */ -static void -hostio_error (char *own_buf) -{ - the_target->hostio_last_error (own_buf); -} - -static void -hostio_packet_error (char *own_buf) -{ - sprintf (own_buf, "F-1,%x", FILEIO_EINVAL); -} - -static void -hostio_reply (char *own_buf, int result) -{ - sprintf (own_buf, "F%x", result); -} - -static int -hostio_reply_with_data (char *own_buf, char *buffer, int len, - int *new_packet_len) -{ - int input_index, output_index, out_maxlen; - - sprintf (own_buf, "F%x;", len); - output_index = strlen (own_buf); - - out_maxlen = PBUFSIZ; - - for (input_index = 0; input_index < len; input_index++) - { - char b = buffer[input_index]; - - if (b == '$' || b == '#' || b == '}' || b == '*') - { - /* These must be escaped. */ - if (output_index + 2 > out_maxlen) - break; - own_buf[output_index++] = '}'; - own_buf[output_index++] = b ^ 0x20; - } - else - { - if (output_index + 1 > out_maxlen) - break; - own_buf[output_index++] = b; - } - } - - *new_packet_len = output_index; - return input_index; -} - -static int -fileio_open_flags_to_host (int fileio_open_flags, int *open_flags_p) -{ - int open_flags = 0; - - if (fileio_open_flags & ~FILEIO_O_SUPPORTED) - return -1; - - if (fileio_open_flags & FILEIO_O_CREAT) - open_flags |= O_CREAT; - if (fileio_open_flags & FILEIO_O_EXCL) - open_flags |= O_EXCL; - if (fileio_open_flags & FILEIO_O_TRUNC) - open_flags |= O_TRUNC; - if (fileio_open_flags & FILEIO_O_APPEND) - open_flags |= O_APPEND; - if (fileio_open_flags & FILEIO_O_RDONLY) - open_flags |= O_RDONLY; - if (fileio_open_flags & FILEIO_O_WRONLY) - open_flags |= O_WRONLY; - if (fileio_open_flags & FILEIO_O_RDWR) - open_flags |= O_RDWR; -/* On systems supporting binary and text mode, always open files in - binary mode. */ -#ifdef O_BINARY - open_flags |= O_BINARY; -#endif - - *open_flags_p = open_flags; - return 0; -} - -static void -handle_open (char *own_buf) -{ - char filename[PATH_MAX]; - char *p; - int fileio_flags, mode, flags, fd; - struct fd_list *new_fd; - - p = own_buf + strlen ("vFile:open:"); - - if (require_filename (&p, filename) - || require_comma (&p) - || require_int (&p, &fileio_flags) - || require_comma (&p) - || require_int (&p, &mode) - || require_end (p) - || fileio_open_flags_to_host (fileio_flags, &flags)) - { - hostio_packet_error (own_buf); - return; - } - - /* We do not need to convert MODE, since the fileio protocol - uses the standard values. */ - fd = open (filename, flags, mode); - - if (fd == -1) - { - hostio_error (own_buf); - return; - } - - /* Record the new file descriptor. */ - new_fd = xmalloc (sizeof (struct fd_list)); - new_fd->fd = fd; - new_fd->next = open_fds; - open_fds = new_fd; - - hostio_reply (own_buf, fd); -} - -static void -handle_pread (char *own_buf, int *new_packet_len) -{ - int fd, ret, len, offset, bytes_sent; - char *p, *data; - - p = own_buf + strlen ("vFile:pread:"); - - if (require_int (&p, &fd) - || require_comma (&p) - || require_valid_fd (fd) - || require_int (&p, &len) - || require_comma (&p) - || require_int (&p, &offset) - || require_end (p)) - { - hostio_packet_error (own_buf); - return; - } - - data = xmalloc (len); -#ifdef HAVE_PREAD - ret = pread (fd, data, len, offset); -#else - ret = lseek (fd, offset, SEEK_SET); - if (ret != -1) - ret = read (fd, data, len); -#endif - - if (ret == -1) - { - hostio_error (own_buf); - free (data); - return; - } - - bytes_sent = hostio_reply_with_data (own_buf, data, ret, new_packet_len); - - /* If we were using read, and the data did not all fit in the reply, - we would have to back up using lseek here. With pread it does - not matter. But we still have a problem; the return value in the - packet might be wrong, so we must fix it. This time it will - definitely fit. */ - if (bytes_sent < ret) - bytes_sent = hostio_reply_with_data (own_buf, data, bytes_sent, - new_packet_len); - - free (data); -} - -static void -handle_pwrite (char *own_buf, int packet_len) -{ - int fd, ret, len, offset; - char *p, *data; - - p = own_buf + strlen ("vFile:pwrite:"); - - if (require_int (&p, &fd) - || require_comma (&p) - || require_valid_fd (fd) - || require_int (&p, &offset) - || require_comma (&p) - || require_data (p, packet_len - (p - own_buf), &data, &len)) - { - hostio_packet_error (own_buf); - return; - } - -#ifdef HAVE_PWRITE - ret = pwrite (fd, data, len, offset); -#else - ret = lseek (fd, offset, SEEK_SET); - if (ret != -1) - ret = write (fd, data, len); -#endif - - if (ret == -1) - { - hostio_error (own_buf); - free (data); - return; - } - - hostio_reply (own_buf, ret); - free (data); -} - -static void -handle_close (char *own_buf) -{ - int fd, ret; - char *p; - struct fd_list **open_fd_p, *old_fd; - - p = own_buf + strlen ("vFile:close:"); - - if (require_int (&p, &fd) - || require_valid_fd (fd) - || require_end (p)) - { - hostio_packet_error (own_buf); - return; - } - - ret = close (fd); - - if (ret == -1) - { - hostio_error (own_buf); - return; - } - - open_fd_p = &open_fds; - /* We know that fd is in the list, thanks to require_valid_fd. */ - while ((*open_fd_p)->fd != fd) - open_fd_p = &(*open_fd_p)->next; - - old_fd = *open_fd_p; - *open_fd_p = (*open_fd_p)->next; - free (old_fd); - - hostio_reply (own_buf, ret); -} - -static void -handle_unlink (char *own_buf) -{ - char filename[PATH_MAX]; - char *p; - int ret; - - p = own_buf + strlen ("vFile:unlink:"); - - if (require_filename (&p, filename) - || require_end (p)) - { - hostio_packet_error (own_buf); - return; - } - - ret = unlink (filename); - - if (ret == -1) - { - hostio_error (own_buf); - return; - } - - hostio_reply (own_buf, ret); -} - -/* Handle all the 'F' file transfer packets. */ - -int -handle_vFile (char *own_buf, int packet_len, int *new_packet_len) -{ - if (strncmp (own_buf, "vFile:open:", 11) == 0) - handle_open (own_buf); - else if (strncmp (own_buf, "vFile:pread:", 11) == 0) - handle_pread (own_buf, new_packet_len); - else if (strncmp (own_buf, "vFile:pwrite:", 12) == 0) - handle_pwrite (own_buf, packet_len); - else if (strncmp (own_buf, "vFile:close:", 12) == 0) - handle_close (own_buf); - else if (strncmp (own_buf, "vFile:unlink:", 13) == 0) - handle_unlink (own_buf); - else - return 0; - - return 1; -} diff --git a/gdb/gdbserver/i386-low.c b/gdb/gdbserver/i386-low.c deleted file mode 100644 index a9591794680..00000000000 --- a/gdb/gdbserver/i386-low.c +++ /dev/null @@ -1,604 +0,0 @@ -/* Debug register code for the i386. - - Copyright (C) 2009, 2010, 2011 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 "target.h" -#include "i386-low.h" - -/* Support for 8-byte wide hw watchpoints. */ -#ifndef TARGET_HAS_DR_LEN_8 -/* NOTE: sizeof (long) == 4 on win64. */ -#define TARGET_HAS_DR_LEN_8 (sizeof (void *) == 8) -#endif - -enum target_hw_bp_type - { - hw_write = 0, /* Common HW watchpoint */ - hw_read = 1, /* Read HW watchpoint */ - hw_access = 2, /* Access HW watchpoint */ - hw_execute = 3 /* Execute HW breakpoint */ - }; - -/* DR7 Debug Control register fields. */ - -/* How many bits to skip in DR7 to get to R/W and LEN fields. */ -#define DR_CONTROL_SHIFT 16 -/* How many bits in DR7 per R/W and LEN field for each watchpoint. */ -#define DR_CONTROL_SIZE 4 - -/* Watchpoint/breakpoint read/write fields in DR7. */ -#define DR_RW_EXECUTE (0x0) /* Break on instruction execution. */ -#define DR_RW_WRITE (0x1) /* Break on data writes. */ -#define DR_RW_READ (0x3) /* Break on data reads or writes. */ - -/* This is here for completeness. No platform supports this - functionality yet (as of March 2001). Note that the DE flag in the - CR4 register needs to be set to support this. */ -#ifndef DR_RW_IORW -#define DR_RW_IORW (0x2) /* Break on I/O reads or writes. */ -#endif - -/* Watchpoint/breakpoint length fields in DR7. The 2-bit left shift - is so we could OR this with the read/write field defined above. */ -#define DR_LEN_1 (0x0 << 2) /* 1-byte region watch or breakpoint. */ -#define DR_LEN_2 (0x1 << 2) /* 2-byte region watch. */ -#define DR_LEN_4 (0x3 << 2) /* 4-byte region watch. */ -#define DR_LEN_8 (0x2 << 2) /* 8-byte region watch (AMD64). */ - -/* Local and Global Enable flags in DR7. - - When the Local Enable flag is set, the breakpoint/watchpoint is - enabled only for the current task; the processor automatically - clears this flag on every task switch. When the Global Enable flag - is set, the breakpoint/watchpoint is enabled for all tasks; the - processor never clears this flag. - - Currently, all watchpoint are locally enabled. If you need to - enable them globally, read the comment which pertains to this in - i386_insert_aligned_watchpoint below. */ -#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit. */ -#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit. */ -#define DR_ENABLE_SIZE 2 /* Two enable bits per debug register. */ - -/* Local and global exact breakpoint enable flags (a.k.a. slowdown - flags). These are only required on i386, to allow detection of the - exact instruction which caused a watchpoint to break; i486 and - later processors do that automatically. We set these flags for - backwards compatibility. */ -#define DR_LOCAL_SLOWDOWN (0x100) -#define DR_GLOBAL_SLOWDOWN (0x200) - -/* Fields reserved by Intel. This includes the GD (General Detect - Enable) flag, which causes a debug exception to be generated when a - MOV instruction accesses one of the debug registers. - - FIXME: My Intel manual says we should use 0xF800, not 0xFC00. */ -#define DR_CONTROL_RESERVED (0xFC00) - -/* Auxiliary helper macros. */ - -/* A value that masks all fields in DR7 that are reserved by Intel. */ -#define I386_DR_CONTROL_MASK (~DR_CONTROL_RESERVED) - -/* The I'th debug register is vacant if its Local and Global Enable - bits are reset in the Debug Control register. */ -#define I386_DR_VACANT(state, i) \ - (((state)->dr_control_mirror & (3 << (DR_ENABLE_SIZE * (i)))) == 0) - -/* Locally enable the break/watchpoint in the I'th debug register. */ -#define I386_DR_LOCAL_ENABLE(state, i) \ - do { \ - (state)->dr_control_mirror |= \ - (1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))); \ - } while (0) - -/* Globally enable the break/watchpoint in the I'th debug register. */ -#define I386_DR_GLOBAL_ENABLE(state, i) \ - do { \ - (state)->dr_control_mirror |= \ - (1 << (DR_GLOBAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))); \ - } while (0) - -/* Disable the break/watchpoint in the I'th debug register. */ -#define I386_DR_DISABLE(state, i) \ - do { \ - (state)->dr_control_mirror &= \ - ~(3 << (DR_ENABLE_SIZE * (i))); \ - } while (0) - -/* Set in DR7 the RW and LEN fields for the I'th debug register. */ -#define I386_DR_SET_RW_LEN(state, i,rwlen) \ - do { \ - (state)->dr_control_mirror &= \ - ~(0x0f << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))); \ - (state)->dr_control_mirror |= \ - ((rwlen) << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))); \ - } while (0) - -/* Get from DR7 the RW and LEN fields for the I'th debug register. */ -#define I386_DR_GET_RW_LEN(dr7, i) \ - (((dr7) \ - >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))) & 0x0f) - -/* Did the watchpoint whose address is in the I'th register break? */ -#define I386_DR_WATCH_HIT(dr6, i) ((dr6) & (1 << (i))) - -/* A macro to loop over all debug registers. */ -#define ALL_DEBUG_REGISTERS(i) for (i = 0; i < DR_NADDR; i++) - -/* Types of operations supported by i386_handle_nonaligned_watchpoint. */ -typedef enum { WP_INSERT, WP_REMOVE, WP_COUNT } i386_wp_op_t; - -/* Implementation. */ - -/* Clear the reference counts and forget everything we knew about the - debug registers. */ - -void -i386_low_init_dregs (struct i386_debug_reg_state *state) -{ - int i; - - ALL_DEBUG_REGISTERS (i) - { - state->dr_mirror[i] = 0; - state->dr_ref_count[i] = 0; - } - state->dr_control_mirror = 0; - state->dr_status_mirror = 0; -} - -/* Print the values of the mirrored debug registers. This is enabled via - the "set debug-hw-points 1" monitor command. */ - -static void -i386_show_dr (struct i386_debug_reg_state *state, - const char *func, CORE_ADDR addr, - int len, enum target_hw_bp_type type) -{ - int i; - - fprintf (stderr, "%s", func); - if (addr || len) - fprintf (stderr, " (addr=%lx, len=%d, type=%s)", - (unsigned long) addr, len, - type == hw_write ? "data-write" - : (type == hw_read ? "data-read" - : (type == hw_access ? "data-read/write" - : (type == hw_execute ? "instruction-execute" - /* FIXME: if/when I/O read/write - watchpoints are supported, add them - here. */ - : "??unknown??")))); - fprintf (stderr, ":\n"); - fprintf (stderr, "\tCONTROL (DR7): %08x STATUS (DR6): %08x\n", - state->dr_control_mirror, state->dr_status_mirror); - ALL_DEBUG_REGISTERS (i) - { - fprintf (stderr, "\ -\tDR%d: addr=0x%s, ref.count=%d DR%d: addr=0x%s, ref.count=%d\n", - i, paddress (state->dr_mirror[i]), - state->dr_ref_count[i], - i + 1, paddress (state->dr_mirror[i + 1]), - state->dr_ref_count[i + 1]); - i++; - } -} - -/* Return the value of a 4-bit field for DR7 suitable for watching a - region of LEN bytes for accesses of type TYPE. LEN is assumed to - have the value of 1, 2, or 4. */ - -static unsigned -i386_length_and_rw_bits (int len, enum target_hw_bp_type type) -{ - unsigned rw; - - switch (type) - { - case hw_execute: - rw = DR_RW_EXECUTE; - break; - case hw_write: - rw = DR_RW_WRITE; - break; - case hw_read: - fatal ("The i386 doesn't support data-read watchpoints.\n"); - case hw_access: - rw = DR_RW_READ; - break; -#if 0 - /* Not yet supported. */ - case hw_io_access: - rw = DR_RW_IORW; - break; -#endif - default: - error ("\ -Invalid hardware breakpoint type %d in i386_length_and_rw_bits.\n", - (int) type); - } - - switch (len) - { - case 1: - return (DR_LEN_1 | rw); - case 2: - return (DR_LEN_2 | rw); - case 4: - return (DR_LEN_4 | rw); - /* ELSE FALL THROUGH */ - case 8: - if (TARGET_HAS_DR_LEN_8) - return (DR_LEN_8 | rw); - default: - error ("\ -Invalid hardware breakpoint length %d in i386_length_and_rw_bits.\n", len); - } -} - -/* Insert a watchpoint at address ADDR, which is assumed to be aligned - according to the length of the region to watch. LEN_RW_BITS is the - value of the bits from DR7 which describes the length and access - type of the region to be watched by this watchpoint. Return 0 on - success, -1 on failure. */ - -static int -i386_insert_aligned_watchpoint (struct i386_debug_reg_state *state, - CORE_ADDR addr, unsigned len_rw_bits) -{ - int i; - - /* First, look for an occupied debug register with the same address - and the same RW and LEN definitions. If we find one, we can - reuse it for this watchpoint as well (and save a register). */ - ALL_DEBUG_REGISTERS (i) - { - if (!I386_DR_VACANT (state, i) - && state->dr_mirror[i] == addr - && I386_DR_GET_RW_LEN (state->dr_control_mirror, i) == len_rw_bits) - { - state->dr_ref_count[i]++; - return 0; - } - } - - /* Next, look for a vacant debug register. */ - ALL_DEBUG_REGISTERS (i) - { - if (I386_DR_VACANT (state, i)) - break; - } - - /* No more debug registers! */ - if (i >= DR_NADDR) - return -1; - - /* Now set up the register I to watch our region. */ - - /* Record the info in our local mirrored array. */ - state->dr_mirror[i] = addr; - state->dr_ref_count[i] = 1; - I386_DR_SET_RW_LEN (state, i, len_rw_bits); - /* Note: we only enable the watchpoint locally, i.e. in the current - task. Currently, no i386 target allows or supports global - watchpoints; however, if any target would want that in the - future, GDB should probably provide a command to control whether - to enable watchpoints globally or locally, and the code below - should use global or local enable and slow-down flags as - appropriate. */ - I386_DR_LOCAL_ENABLE (state, i); - state->dr_control_mirror |= DR_LOCAL_SLOWDOWN; - state->dr_control_mirror &= I386_DR_CONTROL_MASK; - - return 0; -} - -/* Remove a watchpoint at address ADDR, which is assumed to be aligned - according to the length of the region to watch. LEN_RW_BITS is the - value of the bits from DR7 which describes the length and access - type of the region watched by this watchpoint. Return 0 on - success, -1 on failure. */ - -static int -i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state, - CORE_ADDR addr, unsigned len_rw_bits) -{ - int i, retval = -1; - - ALL_DEBUG_REGISTERS (i) - { - if (!I386_DR_VACANT (state, i) - && state->dr_mirror[i] == addr - && I386_DR_GET_RW_LEN (state->dr_control_mirror, i) == len_rw_bits) - { - if (--state->dr_ref_count[i] == 0) /* No longer in use? */ - { - /* Reset our mirror. */ - state->dr_mirror[i] = 0; - I386_DR_DISABLE (state, i); - } - retval = 0; - } - } - - return retval; -} - -/* Insert or remove a (possibly non-aligned) watchpoint, or count the - number of debug registers required to watch a region at address - ADDR whose length is LEN for accesses of type TYPE. Return 0 on - successful insertion or removal, a positive number when queried - about the number of registers, or -1 on failure. If WHAT is not a - valid value, bombs through internal_error. */ - -static int -i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, - i386_wp_op_t what, CORE_ADDR addr, int len, - enum target_hw_bp_type type) -{ - int retval = 0; - int max_wp_len = TARGET_HAS_DR_LEN_8 ? 8 : 4; - - static const int size_try_array[8][8] = - { - {1, 1, 1, 1, 1, 1, 1, 1}, /* Trying size one. */ - {2, 1, 2, 1, 2, 1, 2, 1}, /* Trying size two. */ - {2, 1, 2, 1, 2, 1, 2, 1}, /* Trying size three. */ - {4, 1, 2, 1, 4, 1, 2, 1}, /* Trying size four. */ - {4, 1, 2, 1, 4, 1, 2, 1}, /* Trying size five. */ - {4, 1, 2, 1, 4, 1, 2, 1}, /* Trying size six. */ - {4, 1, 2, 1, 4, 1, 2, 1}, /* Trying size seven. */ - {8, 1, 2, 1, 4, 1, 2, 1}, /* Trying size eight. */ - }; - - while (len > 0) - { - int align = addr % max_wp_len; - /* Four (eight on AMD64) is the maximum length a debug register - can watch. */ - int try = (len > max_wp_len ? (max_wp_len - 1) : len - 1); - int size = size_try_array[try][align]; - - if (what == WP_COUNT) - { - /* size_try_array[] is defined such that each iteration - through the loop is guaranteed to produce an address and a - size that can be watched with a single debug register. - Thus, for counting the registers required to watch a - region, we simply need to increment the count on each - iteration. */ - retval++; - } - else - { - unsigned len_rw = i386_length_and_rw_bits (size, type); - - if (what == WP_INSERT) - retval = i386_insert_aligned_watchpoint (state, addr, len_rw); - else if (what == WP_REMOVE) - retval = i386_remove_aligned_watchpoint (state, addr, len_rw); - else - fatal ("\ -Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n", - (int) what); - - if (retval) - break; - } - - addr += size; - len -= size; - } - - return retval; -} - -#define Z_PACKET_WRITE_WP '2' -#define Z_PACKET_READ_WP '3' -#define Z_PACKET_ACCESS_WP '4' - -/* Map the protocol watchpoint type TYPE to enum target_hw_bp_type. */ - -static enum target_hw_bp_type -Z_packet_to_hw_type (char type) -{ - switch (type) - { - case Z_PACKET_WRITE_WP: - return hw_write; - case Z_PACKET_READ_WP: - return hw_read; - case Z_PACKET_ACCESS_WP: - return hw_access; - default: - fatal ("Z_packet_to_hw_type: bad watchpoint type %c", type); - } -} - -/* Update the inferior debug registers state, in INF_STATE, with the - new debug registers state, in NEW_STATE. */ - -static void -i386_update_inferior_debug_regs (struct i386_debug_reg_state *inf_state, - struct i386_debug_reg_state *new_state) -{ - int i; - - ALL_DEBUG_REGISTERS (i) - { - if (I386_DR_VACANT (new_state, i) != I386_DR_VACANT (inf_state, i)) - i386_dr_low_set_addr (new_state, i); - else - gdb_assert (new_state->dr_mirror[i] == inf_state->dr_mirror[i]); - } - - if (new_state->dr_control_mirror != inf_state->dr_control_mirror) - i386_dr_low_set_control (new_state); - - *inf_state = *new_state; -} - -/* Insert a watchpoint to watch a memory region which starts at - address ADDR and whose length is LEN bytes. Watch memory accesses - of the type TYPE_FROM_PACKET. Return 0 on success, -1 on failure. */ - -int -i386_low_insert_watchpoint (struct i386_debug_reg_state *state, - char type_from_packet, CORE_ADDR addr, int len) -{ - int retval; - enum target_hw_bp_type type = Z_packet_to_hw_type (type_from_packet); - /* Work on a local copy of the debug registers, and on success, - commit the change back to the inferior. */ - struct i386_debug_reg_state local_state = *state; - - if (type == hw_read) - return 1; /* unsupported */ - - if (((len != 1 && len != 2 && len != 4) - && !(TARGET_HAS_DR_LEN_8 && len == 8)) - || addr % len != 0) - { - retval = i386_handle_nonaligned_watchpoint (&local_state, WP_INSERT, - addr, len, type); - } - else - { - unsigned len_rw = i386_length_and_rw_bits (len, type); - - retval = i386_insert_aligned_watchpoint (&local_state, addr, len_rw); - } - - if (retval == 0) - i386_update_inferior_debug_regs (state, &local_state); - - if (debug_hw_points) - i386_show_dr (state, "insert_watchpoint", addr, len, type); - - return retval; -} - -/* Remove a watchpoint that watched the memory region which starts at - address ADDR, whose length is LEN bytes, and for accesses of the - type TYPE_FROM_PACKET. Return 0 on success, -1 on failure. */ - -int -i386_low_remove_watchpoint (struct i386_debug_reg_state *state, - char type_from_packet, CORE_ADDR addr, int len) -{ - int retval; - enum target_hw_bp_type type = Z_packet_to_hw_type (type_from_packet); - /* Work on a local copy of the debug registers, and on success, - commit the change back to the inferior. */ - struct i386_debug_reg_state local_state = *state; - - if (((len != 1 && len != 2 && len != 4) - && !(TARGET_HAS_DR_LEN_8 && len == 8)) - || addr % len != 0) - { - retval = i386_handle_nonaligned_watchpoint (&local_state, WP_REMOVE, - addr, len, type); - } - else - { - unsigned len_rw = i386_length_and_rw_bits (len, type); - - retval = i386_remove_aligned_watchpoint (&local_state, addr, len_rw); - } - - if (retval == 0) - i386_update_inferior_debug_regs (state, &local_state); - - if (debug_hw_points) - i386_show_dr (state, "remove_watchpoint", addr, len, type); - - return retval; -} - -/* Return non-zero if we can watch a memory region that starts at - address ADDR and whose length is LEN bytes. */ - -int -i386_low_region_ok_for_watchpoint (struct i386_debug_reg_state *state, - CORE_ADDR addr, int len) -{ - int nregs; - - /* Compute how many aligned watchpoints we would need to cover this - region. */ - nregs = i386_handle_nonaligned_watchpoint (state, WP_COUNT, - addr, len, hw_write); - return nregs <= DR_NADDR ? 1 : 0; -} - -/* If the inferior has some break/watchpoint that triggered, set the - address associated with that break/watchpoint and return true. - Otherwise, return false. */ - -int -i386_low_stopped_data_address (struct i386_debug_reg_state *state, - CORE_ADDR *addr_p) -{ - CORE_ADDR addr = 0; - int i; - int rc = 0; - unsigned status; - unsigned control; - - /* Get the current values the inferior has. If the thread was - running when we last changed watchpoints, the mirror no longer - represents what was set in this LWP's debug registers. */ - status = i386_dr_low_get_status (); - control = i386_dr_low_get_control (); - - ALL_DEBUG_REGISTERS (i) - { - if (I386_DR_WATCH_HIT (status, i) - /* This second condition makes sure DRi is set up for a data - watchpoint, not a hardware breakpoint. The reason is - that GDB doesn't call the target_stopped_data_address - method except for data watchpoints. In other words, I'm - being paranoiac. */ - && I386_DR_GET_RW_LEN (control, i) != 0) - { - addr = i386_dr_low_get_addr (i); - rc = 1; - if (debug_hw_points) - i386_show_dr (state, "watchpoint_hit", addr, -1, hw_write); - } - } - - if (debug_hw_points && addr == 0) - i386_show_dr (state, "stopped_data_addr", 0, 0, hw_write); - - if (rc) - *addr_p = addr; - return rc; -} - -/* Return true if the inferior has some watchpoint that triggered. - Otherwise return false. */ - -int -i386_low_stopped_by_watchpoint (struct i386_debug_reg_state *state) -{ - CORE_ADDR addr = 0; - return i386_low_stopped_data_address (state, &addr); -} diff --git a/gdb/gdbserver/i386-low.h b/gdb/gdbserver/i386-low.h deleted file mode 100644 index bbfbc10a397..00000000000 --- a/gdb/gdbserver/i386-low.h +++ /dev/null @@ -1,116 +0,0 @@ -/* Misc. low level support for i386. - - Copyright (C) 2009, 2010, 2011 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/>. */ - -/* Support for hardware watchpoints and breakpoints using the i386 - debug registers. - - This provides several functions for inserting and removing - hardware-assisted breakpoints and watchpoints, testing if one or - more of the watchpoints triggered and at what address, checking - whether a given region can be watched, etc. - - The functions below implement debug registers sharing by reference - counts, and allow to watch regions up to 16 bytes long - (32 bytes on 64 bit hosts). */ - - -/* Debug registers' indices. */ -#define DR_FIRSTADDR 0 -#define DR_LASTADDR 3 -#define DR_NADDR 4 /* The number of debug address registers. */ -#define DR_STATUS 6 -#define DR_CONTROL 7 - -/* Global state needed to track h/w watchpoints. */ - -struct i386_debug_reg_state -{ - /* Mirror the inferior's DRi registers. We keep the status and - control registers separated because they don't hold addresses. - Note that since we can change these mirrors while threads are - running, we never trust them to explain a cause of a trap. - For that, we need to peek directly in the inferior registers. */ - CORE_ADDR dr_mirror[DR_NADDR]; - unsigned dr_status_mirror, dr_control_mirror; - - /* Reference counts for each debug register. */ - int dr_ref_count[DR_NADDR]; -}; - -/* Initialize STATE. */ -extern void i386_low_init_dregs (struct i386_debug_reg_state *state); - -/* Insert a watchpoint to watch a memory region which starts at - address ADDR and whose length is LEN bytes. Watch memory accesses - of the type TYPE_FROM_PACKET. Return 0 on success, -1 on failure. */ -extern int i386_low_insert_watchpoint (struct i386_debug_reg_state *state, - char type_from_packet, CORE_ADDR addr, - int len); - -/* Remove a watchpoint that watched the memory region which starts at - address ADDR, whose length is LEN bytes, and for accesses of the - type TYPE_FROM_PACKET. Return 0 on success, -1 on failure. */ -extern int i386_low_remove_watchpoint (struct i386_debug_reg_state *state, - char type_from_packet, CORE_ADDR addr, - int len); - -/* Return non-zero if we can watch a memory region that starts at - address ADDR and whose length is LEN bytes. */ -extern int i386_low_region_ok_for_watchpoint (struct i386_debug_reg_state *state, - CORE_ADDR addr, int len); - -/* If the inferior has some break/watchpoint that triggered, set the - address associated with that break/watchpoint and return true. - Otherwise, return false. */ -extern int i386_low_stopped_data_address (struct i386_debug_reg_state *state, - CORE_ADDR *addr_p); - -/* Return true if the inferior has some watchpoint that triggered. - Otherwise return false. */ -extern int i386_low_stopped_by_watchpoint (struct i386_debug_reg_state *state); - -/* Each target needs to provide several low-level functions - that will be called to insert watchpoints and hardware breakpoints - into the inferior, remove them, and check their status. These - functions are: - - i386_dr_low_set_control -- set the debug control (DR7) - register to a given value - - i386_dr_low_set_addr -- put an address into one debug register - - i386_dr_low_get_status -- return the value of the debug - status (DR6) register. -*/ - -/* Update the inferior's debug register REGNUM from STATE. */ -extern void i386_dr_low_set_addr (const struct i386_debug_reg_state *state, - int regnum); - -/* Return the inferior's debug register REGNUM. */ -extern CORE_ADDR i386_dr_low_get_addr (int regnum); - -/* Update the inferior's DR7 debug control register from STATE. */ -extern void i386_dr_low_set_control (const struct i386_debug_reg_state *state); - -/* Return the value of the inferior's DR7 debug control register. */ -extern unsigned i386_dr_low_get_control (void); - -/* Return the value of the inferior's DR6 debug status register. */ -extern unsigned i386_dr_low_get_status (void); diff --git a/gdb/gdbserver/i387-fp.c b/gdb/gdbserver/i387-fp.c deleted file mode 100644 index 80b5de66f0d..00000000000 --- a/gdb/gdbserver/i387-fp.c +++ /dev/null @@ -1,565 +0,0 @@ -/* i387-specific utility functions, for the remote server for GDB. - Copyright (C) 2000, 2001, 2002, 2005, 2007, 2008, 2009, 2010, 2011 - 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 "i387-fp.h" -#include "i386-xstate.h" - -int num_xmm_registers = 8; - -/* Note: These functions preserve the reserved bits in control registers. - However, gdbserver promptly throws away that information. */ - -/* These structs should have the proper sizes and alignment on both - i386 and x86-64 machines. */ - -struct i387_fsave { - /* All these are only sixteen bits, plus padding, except for fop (which - is only eleven bits), and fooff / fioff (which are 32 bits each). */ - unsigned short fctrl; - unsigned short pad1; - unsigned short fstat; - unsigned short pad2; - unsigned short ftag; - unsigned short pad3; - unsigned int fioff; - unsigned short fiseg; - unsigned short fop; - unsigned int fooff; - unsigned short foseg; - unsigned short pad4; - - /* Space for eight 80-bit FP values. */ - unsigned char st_space[80]; -}; - -struct i387_fxsave { - /* All these are only sixteen bits, plus padding, except for fop (which - is only eleven bits), and fooff / fioff (which are 32 bits each). */ - unsigned short fctrl; - unsigned short fstat; - unsigned short ftag; - unsigned short fop; - unsigned int fioff; - unsigned short fiseg; - unsigned short pad1; - unsigned int fooff; - unsigned short foseg; - unsigned short pad12; - - unsigned int mxcsr; - unsigned int pad3; - - /* Space for eight 80-bit FP values in 128-bit spaces. */ - unsigned char st_space[128]; - - /* Space for eight 128-bit XMM values, or 16 on x86-64. */ - unsigned char xmm_space[256]; -}; - -struct i387_xsave { - /* All these are only sixteen bits, plus padding, except for fop (which - is only eleven bits), and fooff / fioff (which are 32 bits each). */ - unsigned short fctrl; - unsigned short fstat; - unsigned short ftag; - unsigned short fop; - unsigned int fioff; - unsigned short fiseg; - unsigned short pad1; - unsigned int fooff; - unsigned short foseg; - unsigned short pad12; - - unsigned int mxcsr; - unsigned int mxcsr_mask; - - /* Space for eight 80-bit FP values in 128-bit spaces. */ - unsigned char st_space[128]; - - /* Space for eight 128-bit XMM values, or 16 on x86-64. */ - unsigned char xmm_space[256]; - - unsigned char reserved1[48]; - - /* The extended control register 0 (the XFEATURE_ENABLED_MASK - register). */ - unsigned long long xcr0; - - unsigned char reserved2[40]; - - /* The XSTATE_BV bit vector. */ - unsigned long long xstate_bv; - - unsigned char reserved3[56]; - - /* Space for eight upper 128-bit YMM values, or 16 on x86-64. */ - unsigned char ymmh_space[256]; -}; - -void -i387_cache_to_fsave (struct regcache *regcache, void *buf) -{ - struct i387_fsave *fp = (struct i387_fsave *) buf; - int i; - int st0_regnum = find_regno ("st0"); - unsigned long val, val2; - - for (i = 0; i < 8; i++) - collect_register (regcache, i + st0_regnum, - ((char *) &fp->st_space[0]) + i * 10); - - collect_register_by_name (regcache, "fioff", &fp->fioff); - collect_register_by_name (regcache, "fooff", &fp->fooff); - - /* This one's 11 bits... */ - collect_register_by_name (regcache, "fop", &val2); - fp->fop = (val2 & 0x7FF) | (fp->fop & 0xF800); - - /* Some registers are 16-bit. */ - collect_register_by_name (regcache, "fctrl", &val); - fp->fctrl = val; - - collect_register_by_name (regcache, "fstat", &val); - val &= 0xFFFF; - fp->fstat = val; - - collect_register_by_name (regcache, "ftag", &val); - val &= 0xFFFF; - fp->ftag = val; - - collect_register_by_name (regcache, "fiseg", &val); - val &= 0xFFFF; - fp->fiseg = val; - - collect_register_by_name (regcache, "foseg", &val); - val &= 0xFFFF; - fp->foseg = val; -} - -void -i387_fsave_to_cache (struct regcache *regcache, const void *buf) -{ - struct i387_fsave *fp = (struct i387_fsave *) buf; - int i; - int st0_regnum = find_regno ("st0"); - unsigned long val; - - for (i = 0; i < 8; i++) - supply_register (regcache, i + st0_regnum, - ((char *) &fp->st_space[0]) + i * 10); - - supply_register_by_name (regcache, "fioff", &fp->fioff); - supply_register_by_name (regcache, "fooff", &fp->fooff); - - /* Some registers are 16-bit. */ - val = fp->fctrl & 0xFFFF; - supply_register_by_name (regcache, "fctrl", &val); - - val = fp->fstat & 0xFFFF; - supply_register_by_name (regcache, "fstat", &val); - - val = fp->ftag & 0xFFFF; - supply_register_by_name (regcache, "ftag", &val); - - val = fp->fiseg & 0xFFFF; - supply_register_by_name (regcache, "fiseg", &val); - - val = fp->foseg & 0xFFFF; - supply_register_by_name (regcache, "foseg", &val); - - /* fop has only 11 valid bits. */ - val = (fp->fop) & 0x7FF; - supply_register_by_name (regcache, "fop", &val); -} - -void -i387_cache_to_fxsave (struct regcache *regcache, void *buf) -{ - struct i387_fxsave *fp = (struct i387_fxsave *) buf; - int i; - int st0_regnum = find_regno ("st0"); - int xmm0_regnum = find_regno ("xmm0"); - unsigned long val, val2; - - for (i = 0; i < 8; i++) - collect_register (regcache, i + st0_regnum, - ((char *) &fp->st_space[0]) + i * 16); - for (i = 0; i < num_xmm_registers; i++) - collect_register (regcache, i + xmm0_regnum, - ((char *) &fp->xmm_space[0]) + i * 16); - - collect_register_by_name (regcache, "fioff", &fp->fioff); - collect_register_by_name (regcache, "fooff", &fp->fooff); - collect_register_by_name (regcache, "mxcsr", &fp->mxcsr); - - /* This one's 11 bits... */ - collect_register_by_name (regcache, "fop", &val2); - fp->fop = (val2 & 0x7FF) | (fp->fop & 0xF800); - - /* Some registers are 16-bit. */ - collect_register_by_name (regcache, "fctrl", &val); - fp->fctrl = val; - - collect_register_by_name (regcache, "fstat", &val); - fp->fstat = val; - - /* Convert to the simplifed tag form stored in fxsave data. */ - collect_register_by_name (regcache, "ftag", &val); - val &= 0xFFFF; - val2 = 0; - for (i = 7; i >= 0; i--) - { - int tag = (val >> (i * 2)) & 3; - - if (tag != 3) - val2 |= (1 << i); - } - fp->ftag = val2; - - collect_register_by_name (regcache, "fiseg", &val); - fp->fiseg = val; - - collect_register_by_name (regcache, "foseg", &val); - fp->foseg = val; -} - -void -i387_cache_to_xsave (struct regcache *regcache, void *buf) -{ - struct i387_xsave *fp = (struct i387_xsave *) buf; - int i; - unsigned long val, val2; - unsigned int clear_bv; - unsigned long long xstate_bv = 0; - char raw[16]; - char *p; - - /* The supported bits in `xstat_bv' are 1 byte. Clear part in - vector registers if its bit in xstat_bv is zero. */ - clear_bv = (~fp->xstate_bv) & x86_xcr0; - - /* Clear part in x87 and vector registers if its bit in xstat_bv is - zero. */ - if (clear_bv) - { - if ((clear_bv & I386_XSTATE_X87)) - for (i = 0; i < 8; i++) - memset (((char *) &fp->st_space[0]) + i * 16, 0, 10); - - if ((clear_bv & I386_XSTATE_SSE)) - for (i = 0; i < num_xmm_registers; i++) - memset (((char *) &fp->xmm_space[0]) + i * 16, 0, 16); - - if ((clear_bv & I386_XSTATE_AVX)) - for (i = 0; i < num_xmm_registers; i++) - memset (((char *) &fp->ymmh_space[0]) + i * 16, 0, 16); - } - - /* Check if any x87 registers are changed. */ - if ((x86_xcr0 & I386_XSTATE_X87)) - { - int st0_regnum = find_regno ("st0"); - - for (i = 0; i < 8; i++) - { - collect_register (regcache, i + st0_regnum, raw); - p = ((char *) &fp->st_space[0]) + i * 16; - if (memcmp (raw, p, 10)) - { - xstate_bv |= I386_XSTATE_X87; - memcpy (p, raw, 10); - } - } - } - - /* Check if any SSE registers are changed. */ - if ((x86_xcr0 & I386_XSTATE_SSE)) - { - int xmm0_regnum = find_regno ("xmm0"); - - for (i = 0; i < num_xmm_registers; i++) - { - collect_register (regcache, i + xmm0_regnum, raw); - p = ((char *) &fp->xmm_space[0]) + i * 16; - if (memcmp (raw, p, 16)) - { - xstate_bv |= I386_XSTATE_SSE; - memcpy (p, raw, 16); - } - } - } - - /* Check if any AVX registers are changed. */ - if ((x86_xcr0 & I386_XSTATE_AVX)) - { - int ymm0h_regnum = find_regno ("ymm0h"); - - for (i = 0; i < num_xmm_registers; i++) - { - collect_register (regcache, i + ymm0h_regnum, raw); - p = ((char *) &fp->ymmh_space[0]) + i * 16; - if (memcmp (raw, p, 16)) - { - xstate_bv |= I386_XSTATE_AVX; - memcpy (p, raw, 16); - } - } - } - - /* Update the corresponding bits in xstate_bv if any SSE/AVX - registers are changed. */ - fp->xstate_bv |= xstate_bv; - - collect_register_by_name (regcache, "fioff", &fp->fioff); - collect_register_by_name (regcache, "fooff", &fp->fooff); - collect_register_by_name (regcache, "mxcsr", &fp->mxcsr); - - /* This one's 11 bits... */ - collect_register_by_name (regcache, "fop", &val2); - fp->fop = (val2 & 0x7FF) | (fp->fop & 0xF800); - - /* Some registers are 16-bit. */ - collect_register_by_name (regcache, "fctrl", &val); - fp->fctrl = val; - - collect_register_by_name (regcache, "fstat", &val); - fp->fstat = val; - - /* Convert to the simplifed tag form stored in fxsave data. */ - collect_register_by_name (regcache, "ftag", &val); - val &= 0xFFFF; - val2 = 0; - for (i = 7; i >= 0; i--) - { - int tag = (val >> (i * 2)) & 3; - - if (tag != 3) - val2 |= (1 << i); - } - fp->ftag = val2; - - collect_register_by_name (regcache, "fiseg", &val); - fp->fiseg = val; - - collect_register_by_name (regcache, "foseg", &val); - fp->foseg = val; -} - -static int -i387_ftag (struct i387_fxsave *fp, int regno) -{ - unsigned char *raw = &fp->st_space[regno * 16]; - unsigned int exponent; - unsigned long fraction[2]; - int integer; - - integer = raw[7] & 0x80; - exponent = (((raw[9] & 0x7f) << 8) | raw[8]); - fraction[0] = ((raw[3] << 24) | (raw[2] << 16) | (raw[1] << 8) | raw[0]); - fraction[1] = (((raw[7] & 0x7f) << 24) | (raw[6] << 16) - | (raw[5] << 8) | raw[4]); - - if (exponent == 0x7fff) - { - /* Special. */ - return (2); - } - else if (exponent == 0x0000) - { - if (fraction[0] == 0x0000 && fraction[1] == 0x0000 && !integer) - { - /* Zero. */ - return (1); - } - else - { - /* Special. */ - return (2); - } - } - else - { - if (integer) - { - /* Valid. */ - return (0); - } - else - { - /* Special. */ - return (2); - } - } -} - -void -i387_fxsave_to_cache (struct regcache *regcache, const void *buf) -{ - struct i387_fxsave *fp = (struct i387_fxsave *) buf; - int i, top; - int st0_regnum = find_regno ("st0"); - int xmm0_regnum = find_regno ("xmm0"); - unsigned long val; - - for (i = 0; i < 8; i++) - supply_register (regcache, i + st0_regnum, - ((char *) &fp->st_space[0]) + i * 16); - for (i = 0; i < num_xmm_registers; i++) - supply_register (regcache, i + xmm0_regnum, - ((char *) &fp->xmm_space[0]) + i * 16); - - supply_register_by_name (regcache, "fioff", &fp->fioff); - supply_register_by_name (regcache, "fooff", &fp->fooff); - supply_register_by_name (regcache, "mxcsr", &fp->mxcsr); - - /* Some registers are 16-bit. */ - val = fp->fctrl & 0xFFFF; - supply_register_by_name (regcache, "fctrl", &val); - - val = fp->fstat & 0xFFFF; - supply_register_by_name (regcache, "fstat", &val); - - /* Generate the form of ftag data that GDB expects. */ - top = (fp->fstat >> 11) & 0x7; - val = 0; - for (i = 7; i >= 0; i--) - { - int tag; - if (fp->ftag & (1 << i)) - tag = i387_ftag (fp, (i + 8 - top) % 8); - else - tag = 3; - val |= tag << (2 * i); - } - supply_register_by_name (regcache, "ftag", &val); - - val = fp->fiseg & 0xFFFF; - supply_register_by_name (regcache, "fiseg", &val); - - val = fp->foseg & 0xFFFF; - supply_register_by_name (regcache, "foseg", &val); - - val = (fp->fop) & 0x7FF; - supply_register_by_name (regcache, "fop", &val); -} - -void -i387_xsave_to_cache (struct regcache *regcache, const void *buf) -{ - struct i387_xsave *fp = (struct i387_xsave *) buf; - struct i387_fxsave *fxp = (struct i387_fxsave *) buf; - int i, top; - unsigned long val; - unsigned int clear_bv; - gdb_byte *p; - - /* The supported bits in `xstat_bv' are 1 byte. Clear part in - vector registers if its bit in xstat_bv is zero. */ - clear_bv = (~fp->xstate_bv) & x86_xcr0; - - /* Check if any x87 registers are changed. */ - if ((x86_xcr0 & I386_XSTATE_X87) != 0) - { - int st0_regnum = find_regno ("st0"); - - if ((clear_bv & I386_XSTATE_X87) != 0) - { - for (i = 0; i < 8; i++) - supply_register_zeroed (regcache, i + st0_regnum); - } - else - { - p = (gdb_byte *) &fp->st_space[0]; - for (i = 0; i < 8; i++) - supply_register (regcache, i + st0_regnum, p + i * 16); - } - } - - if ((x86_xcr0 & I386_XSTATE_SSE) != 0) - { - int xmm0_regnum = find_regno ("xmm0"); - - if ((clear_bv & I386_XSTATE_SSE)) - { - for (i = 0; i < num_xmm_registers; i++) - supply_register_zeroed (regcache, i + xmm0_regnum); - } - else - { - p = (gdb_byte *) &fp->xmm_space[0]; - for (i = 0; i < num_xmm_registers; i++) - supply_register (regcache, i + xmm0_regnum, p + i * 16); - } - } - - if ((x86_xcr0 & I386_XSTATE_AVX) != 0) - { - int ymm0h_regnum = find_regno ("ymm0h"); - - if ((clear_bv & I386_XSTATE_AVX) != 0) - { - for (i = 0; i < num_xmm_registers; i++) - supply_register_zeroed (regcache, i + ymm0h_regnum); - } - else - { - p = (gdb_byte *) &fp->ymmh_space[0]; - for (i = 0; i < num_xmm_registers; i++) - supply_register (regcache, i + ymm0h_regnum, p + i * 16); - } - } - - supply_register_by_name (regcache, "fioff", &fp->fioff); - supply_register_by_name (regcache, "fooff", &fp->fooff); - supply_register_by_name (regcache, "mxcsr", &fp->mxcsr); - - /* Some registers are 16-bit. */ - val = fp->fctrl & 0xFFFF; - supply_register_by_name (regcache, "fctrl", &val); - - val = fp->fstat & 0xFFFF; - supply_register_by_name (regcache, "fstat", &val); - - /* Generate the form of ftag data that GDB expects. */ - top = (fp->fstat >> 11) & 0x7; - val = 0; - for (i = 7; i >= 0; i--) - { - int tag; - if (fp->ftag & (1 << i)) - tag = i387_ftag (fxp, (i + 8 - top) % 8); - else - tag = 3; - val |= tag << (2 * i); - } - supply_register_by_name (regcache, "ftag", &val); - - val = fp->fiseg & 0xFFFF; - supply_register_by_name (regcache, "fiseg", &val); - - val = fp->foseg & 0xFFFF; - supply_register_by_name (regcache, "foseg", &val); - - val = (fp->fop) & 0x7FF; - supply_register_by_name (regcache, "fop", &val); -} - -/* Default to SSE. */ -unsigned long long x86_xcr0 = I386_XSTATE_SSE_MASK; diff --git a/gdb/gdbserver/i387-fp.h b/gdb/gdbserver/i387-fp.h deleted file mode 100644 index d9153dc2e50..00000000000 --- a/gdb/gdbserver/i387-fp.h +++ /dev/null @@ -1,36 +0,0 @@ -/* i387-specific utility functions, for the remote server for GDB. - Copyright (C) 2000, 2001, 2002, 2007, 2008, 2009, 2010, 2011 - 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/>. */ - -#ifndef I387_FP_H -#define I387_FP_H - -void i387_cache_to_fsave (struct regcache *regcache, void *buf); -void i387_fsave_to_cache (struct regcache *regcache, const void *buf); - -void i387_cache_to_fxsave (struct regcache *regcache, void *buf); -void i387_fxsave_to_cache (struct regcache *regcache, const void *buf); - -void i387_cache_to_xsave (struct regcache *regcache, void *buf); -void i387_xsave_to_cache (struct regcache *regcache, const void *buf); - -extern unsigned long long x86_xcr0; - -extern int num_xmm_registers; - -#endif /* I387_FP_H */ diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c deleted file mode 100644 index a7e1a83927a..00000000000 --- a/gdb/gdbserver/inferiors.c +++ /dev/null @@ -1,445 +0,0 @@ -/* Inferior process information for the remote server for GDB. - Copyright (C) 2002, 2005, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - This file is part of GDB. - - This program is free software; you can 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 <stdlib.h> - -#include "server.h" - -struct inferior_list all_processes; -struct inferior_list all_threads; -struct inferior_list all_dlls; -int dlls_changed; - -struct thread_info *current_inferior; - -#define get_thread(inf) ((struct thread_info *)(inf)) -#define get_dll(inf) ((struct dll_info *)(inf)) - -void -add_inferior_to_list (struct inferior_list *list, - struct inferior_list_entry *new_inferior) -{ - new_inferior->next = NULL; - if (list->tail != NULL) - list->tail->next = new_inferior; - else - list->head = new_inferior; - list->tail = new_inferior; -} - -/* Invoke ACTION for each inferior in LIST. */ - -void -for_each_inferior (struct inferior_list *list, - void (*action) (struct inferior_list_entry *)) -{ - struct inferior_list_entry *cur = list->head, *next; - - while (cur != NULL) - { - next = cur->next; - (*action) (cur); - cur = next; - } -} - -void -remove_inferior (struct inferior_list *list, - struct inferior_list_entry *entry) -{ - struct inferior_list_entry **cur; - - if (list->head == entry) - { - list->head = entry->next; - if (list->tail == entry) - list->tail = list->head; - return; - } - - cur = &list->head; - while (*cur && (*cur)->next != entry) - cur = &(*cur)->next; - - if (*cur == NULL) - return; - - (*cur)->next = entry->next; - - if (list->tail == entry) - list->tail = *cur; -} - -void -add_thread (ptid_t thread_id, void *target_data) -{ - struct thread_info *new_thread = xmalloc (sizeof (*new_thread)); - - memset (new_thread, 0, sizeof (*new_thread)); - - new_thread->entry.id = thread_id; - new_thread->last_resume_kind = resume_continue; - new_thread->last_status.kind = TARGET_WAITKIND_IGNORE; - - add_inferior_to_list (&all_threads, & new_thread->entry); - - if (current_inferior == NULL) - current_inferior = new_thread; - - new_thread->target_data = target_data; - set_inferior_regcache_data (new_thread, new_register_cache ()); -} - -ptid_t -thread_id_to_gdb_id (ptid_t thread_id) -{ - struct inferior_list_entry *inf = all_threads.head; - - while (inf != NULL) - { - if (ptid_equal (inf->id, thread_id)) - return thread_id; - inf = inf->next; - } - - return null_ptid; -} - -ptid_t -thread_to_gdb_id (struct thread_info *thread) -{ - return thread->entry.id; -} - -struct thread_info * -find_thread_ptid (ptid_t ptid) -{ - struct inferior_list_entry *inf = all_threads.head; - - while (inf != NULL) - { - struct thread_info *thread = get_thread (inf); - if (ptid_equal (thread->entry.id, ptid)) - return thread; - inf = inf->next; - } - - return NULL; -} - -ptid_t -gdb_id_to_thread_id (ptid_t gdb_id) -{ - struct thread_info *thread = find_thread_ptid (gdb_id); - - return thread ? thread->entry.id : null_ptid; -} - -static void -free_one_thread (struct inferior_list_entry *inf) -{ - struct thread_info *thread = get_thread (inf); - free_register_cache (inferior_regcache_data (thread)); - free (thread); -} - -void -remove_thread (struct thread_info *thread) -{ - remove_inferior (&all_threads, (struct inferior_list_entry *) thread); - free_one_thread (&thread->entry); -} - -/* Find the first inferior_list_entry E in LIST for which FUNC (E, ARG) - returns non-zero. If no entry is found then return NULL. */ - -struct inferior_list_entry * -find_inferior (struct inferior_list *list, - int (*func) (struct inferior_list_entry *, void *), void *arg) -{ - struct inferior_list_entry *inf = list->head; - - while (inf != NULL) - { - struct inferior_list_entry *next; - - next = inf->next; - if ((*func) (inf, arg)) - return inf; - inf = next; - } - - return NULL; -} - -struct inferior_list_entry * -find_inferior_id (struct inferior_list *list, ptid_t id) -{ - struct inferior_list_entry *inf = list->head; - - while (inf != NULL) - { - if (ptid_equal (inf->id, id)) - return inf; - inf = inf->next; - } - - return NULL; -} - -void * -inferior_target_data (struct thread_info *inferior) -{ - return inferior->target_data; -} - -void -set_inferior_target_data (struct thread_info *inferior, void *data) -{ - inferior->target_data = data; -} - -void * -inferior_regcache_data (struct thread_info *inferior) -{ - return inferior->regcache_data; -} - -void -set_inferior_regcache_data (struct thread_info *inferior, void *data) -{ - inferior->regcache_data = data; -} - -static void -free_one_dll (struct inferior_list_entry *inf) -{ - struct dll_info *dll = get_dll (inf); - if (dll->name != NULL) - free (dll->name); - free (dll); -} - -/* Find a DLL with the same name and/or base address. A NULL name in - the key is ignored; so is an all-ones base address. */ - -static int -match_dll (struct inferior_list_entry *inf, void *arg) -{ - struct dll_info *iter = (void *) inf; - struct dll_info *key = arg; - - if (key->base_addr != ~(CORE_ADDR) 0 - && iter->base_addr == key->base_addr) - return 1; - else if (key->name != NULL - && iter->name != NULL - && strcmp (key->name, iter->name) == 0) - return 1; - - return 0; -} - -/* Record a newly loaded DLL at BASE_ADDR. */ - -void -loaded_dll (const char *name, CORE_ADDR base_addr) -{ - struct dll_info *new_dll = xmalloc (sizeof (*new_dll)); - memset (new_dll, 0, sizeof (*new_dll)); - - new_dll->entry.id = minus_one_ptid; - - new_dll->name = xstrdup (name); - new_dll->base_addr = base_addr; - - add_inferior_to_list (&all_dlls, &new_dll->entry); - dlls_changed = 1; -} - -/* Record that the DLL with NAME and BASE_ADDR has been unloaded. */ - -void -unloaded_dll (const char *name, CORE_ADDR base_addr) -{ - struct dll_info *dll; - struct dll_info key_dll; - - /* Be careful not to put the key DLL in any list. */ - key_dll.name = (char *) name; - key_dll.base_addr = base_addr; - - dll = (void *) find_inferior (&all_dlls, match_dll, &key_dll); - - if (dll == NULL) - /* For some inferiors we might get unloaded_dll events without having - a corresponding loaded_dll. In that case, the dll cannot be found - in ALL_DLL, and there is nothing further for us to do. - - This has been observed when running 32bit executables on Windows64 - (i.e. through WOW64, the interface between the 32bits and 64bits - worlds). In that case, the inferior always does some strange - unloading of unnamed dll. */ - return; - else - { - /* DLL has been found so remove the entry and free associated - resources. */ - remove_inferior (&all_dlls, &dll->entry); - free_one_dll (&dll->entry); - dlls_changed = 1; - } -} - -#define clear_list(LIST) \ - do { (LIST)->head = (LIST)->tail = NULL; } while (0) - -void -clear_inferiors (void) -{ - for_each_inferior (&all_threads, free_one_thread); - for_each_inferior (&all_dlls, free_one_dll); - - clear_list (&all_threads); - clear_list (&all_dlls); - - current_inferior = NULL; -} - -/* Two utility functions for a truly degenerate inferior_list: a simple - PID listing. */ - -void -add_pid_to_list (struct inferior_list *list, unsigned long pid) -{ - struct inferior_list_entry *new_entry; - - new_entry = xmalloc (sizeof (struct inferior_list_entry)); - new_entry->id = pid_to_ptid (pid); - add_inferior_to_list (list, new_entry); -} - -int -pull_pid_from_list (struct inferior_list *list, unsigned long pid) -{ - struct inferior_list_entry *new_entry; - - new_entry = find_inferior_id (list, pid_to_ptid (pid)); - if (new_entry == NULL) - return 0; - else - { - remove_inferior (list, new_entry); - free (new_entry); - return 1; - } -} - -struct process_info * -add_process (int pid, int attached) -{ - struct process_info *process; - - process = xcalloc (1, sizeof (*process)); - - process->head.id = pid_to_ptid (pid); - process->attached = attached; - - add_inferior_to_list (&all_processes, &process->head); - - return process; -} - -/* Remove a process from the common process list and free the memory - allocated for it. - The caller is responsible for freeing private data first. */ - -void -remove_process (struct process_info *process) -{ - clear_symbol_cache (&process->symbol_cache); - free_all_breakpoints (process); - remove_inferior (&all_processes, &process->head); - free (process); -} - -struct process_info * -find_process_pid (int pid) -{ - return (struct process_info *) - find_inferior_id (&all_processes, pid_to_ptid (pid)); -} - -/* Return non-zero if INF, a struct process_info, was started by us, - i.e. not attached to. */ - -static int -started_inferior_callback (struct inferior_list_entry *entry, void *args) -{ - struct process_info *process = (struct process_info *) entry; - - return ! process->attached; -} - -/* Return non-zero if there are any inferiors that we have created - (as opposed to attached-to). */ - -int -have_started_inferiors_p (void) -{ - return (find_inferior (&all_processes, started_inferior_callback, NULL) - != NULL); -} - -/* Return non-zero if INF, a struct process_info, was attached to. */ - -static int -attached_inferior_callback (struct inferior_list_entry *entry, void *args) -{ - struct process_info *process = (struct process_info *) entry; - - return process->attached; -} - -/* Return non-zero if there are any inferiors that we have attached to. */ - -int -have_attached_inferiors_p (void) -{ - return (find_inferior (&all_processes, attached_inferior_callback, NULL) - != NULL); -} - -struct process_info * -get_thread_process (struct thread_info *thread) -{ - int pid = ptid_get_pid (thread->entry.id); - return find_process_pid (pid); -} - -struct process_info * -current_process (void) -{ - if (current_inferior == NULL) - fatal ("Current inferior requested, but current_inferior is NULL\n"); - - return get_thread_process (current_inferior); -} diff --git a/gdb/gdbserver/linux-amd64-ipa.c b/gdb/gdbserver/linux-amd64-ipa.c deleted file mode 100644 index 60665a71d63..00000000000 --- a/gdb/gdbserver/linux-amd64-ipa.c +++ /dev/null @@ -1,175 +0,0 @@ -/* GNU/Linux/x86-64 specific low level interface, for the in-process - agent library for GDB. - - Copyright (C) 2010, 2011 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" - -/* Defined in auto-generated file amd64-linux.c. */ -void init_registers_amd64_linux (void); - -/* fast tracepoints collect registers. */ - -#define FT_CR_RIP 0 -#define FT_CR_EFLAGS 1 -#define FT_CR_R8 2 -#define FT_CR_R9 3 -#define FT_CR_R10 4 -#define FT_CR_R11 5 -#define FT_CR_R12 6 -#define FT_CR_R13 7 -#define FT_CR_R14 8 -#define FT_CR_R15 9 -#define FT_CR_RAX 10 -#define FT_CR_RBX 11 -#define FT_CR_RCX 12 -#define FT_CR_RDX 13 -#define FT_CR_RSI 14 -#define FT_CR_RDI 15 -#define FT_CR_RBP 16 -#define FT_CR_RSP 17 - -static const int x86_64_ft_collect_regmap[] = { - FT_CR_RAX * 8, FT_CR_RBX * 8, FT_CR_RCX * 8, FT_CR_RDX * 8, - FT_CR_RSI * 8, FT_CR_RDI * 8, FT_CR_RBP * 8, FT_CR_RSP * 8, - FT_CR_R8 * 8, FT_CR_R9 * 8, FT_CR_R10 * 8, FT_CR_R11 * 8, - FT_CR_R12 * 8, FT_CR_R13 * 8, FT_CR_R14 * 8, FT_CR_R15 * 8, - FT_CR_RIP * 8, FT_CR_EFLAGS * 8 -}; - -#define X86_64_NUM_FT_COLLECT_GREGS \ - (sizeof (x86_64_ft_collect_regmap) / sizeof(x86_64_ft_collect_regmap[0])) - -void -supply_fast_tracepoint_registers (struct regcache *regcache, - const unsigned char *buf) -{ - int i; - - for (i = 0; i < X86_64_NUM_FT_COLLECT_GREGS; i++) - supply_register (regcache, i, - ((char *) buf) + x86_64_ft_collect_regmap[i]); -} - -ULONGEST __attribute__ ((visibility("default"), used)) -gdb_agent_get_raw_reg (const unsigned char *raw_regs, int regnum) -{ - if (regnum >= X86_64_NUM_FT_COLLECT_GREGS) - return 0; - - return *(ULONGEST *) (raw_regs + x86_64_ft_collect_regmap[regnum]); -} - -#ifdef HAVE_UST - -#include <ust/processor.h> - -/* "struct registers" is the UST object type holding the registers at - the time of the static tracepoint marker call. This doesn't - contain RIP, but we know what it must have been (the marker - address). */ - -#define ST_REGENTRY(REG) \ - { \ - offsetof (struct registers, REG), \ - sizeof (((struct registers *) NULL)->REG) \ - } - -static struct -{ - int offset; - int size; -} x86_64_st_collect_regmap[] = - { - ST_REGENTRY(rax), - ST_REGENTRY(rbx), - ST_REGENTRY(rcx), - ST_REGENTRY(rdx), - ST_REGENTRY(rsi), - ST_REGENTRY(rdi), - ST_REGENTRY(rbp), - ST_REGENTRY(rsp), - ST_REGENTRY(r8), - ST_REGENTRY(r9), - ST_REGENTRY(r10), - ST_REGENTRY(r11), - ST_REGENTRY(r12), - ST_REGENTRY(r13), - ST_REGENTRY(r14), - ST_REGENTRY(r15), - { -1, 0 }, - ST_REGENTRY(rflags), - ST_REGENTRY(cs), - ST_REGENTRY(ss), - }; - -#define X86_64_NUM_ST_COLLECT_GREGS \ - (sizeof (x86_64_st_collect_regmap) / sizeof (x86_64_st_collect_regmap[0])) - -/* GDB's RIP register number. */ -#define AMD64_RIP_REGNUM 16 - -void -supply_static_tracepoint_registers (struct regcache *regcache, - const unsigned char *buf, - CORE_ADDR pc) -{ - int i; - unsigned long newpc = pc; - - supply_register (regcache, AMD64_RIP_REGNUM, &newpc); - - for (i = 0; i < X86_64_NUM_ST_COLLECT_GREGS; i++) - if (x86_64_st_collect_regmap[i].offset != -1) - { - switch (x86_64_st_collect_regmap[i].size) - { - case 8: - supply_register (regcache, i, - ((char *) buf) - + x86_64_st_collect_regmap[i].offset); - break; - case 2: - { - unsigned long reg - = * (short *) (((char *) buf) - + x86_64_st_collect_regmap[i].offset); - reg &= 0xffff; - supply_register (regcache, i, ®); - } - break; - default: - internal_error (__FILE__, __LINE__, - "unhandled register size: %d", - x86_64_st_collect_regmap[i].size); - break; - } - } -} - -#endif /* HAVE_UST */ - -/* This is only needed because reg-i386-linux-lib.o references it. We - may use it proper at some point. */ -const char *gdbserver_xmltarget; - -void -initialize_low_tracepoint (void) -{ - init_registers_amd64_linux (); -} diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c deleted file mode 100644 index 547292ecd64..00000000000 --- a/gdb/gdbserver/linux-arm-low.c +++ /dev/null @@ -1,867 +0,0 @@ -/* GNU/Linux/ARM specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010, 2011 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" - -/* Don't include elf.h if linux/elf.h got included by gdb_proc_service.h. - On Bionic elf.h and linux/elf.h have conflicting definitions. */ -#ifndef ELFMAG0 -#include <elf.h> -#endif -#include <sys/ptrace.h> -#include <signal.h> - -/* Defined in auto-generated files. */ -void init_registers_arm (void); -void init_registers_arm_with_iwmmxt (void); -void init_registers_arm_with_vfpv2 (void); -void init_registers_arm_with_vfpv3 (void); -void init_registers_arm_with_neon (void); - -#ifndef PTRACE_GET_THREAD_AREA -#define PTRACE_GET_THREAD_AREA 22 -#endif - -#ifndef PTRACE_GETWMMXREGS -# define PTRACE_GETWMMXREGS 18 -# define PTRACE_SETWMMXREGS 19 -#endif - -#ifndef PTRACE_GETVFPREGS -# define PTRACE_GETVFPREGS 27 -# define PTRACE_SETVFPREGS 28 -#endif - -#ifndef PTRACE_GETHBPREGS -#define PTRACE_GETHBPREGS 29 -#define PTRACE_SETHBPREGS 30 -#endif - -/* Information describing the hardware breakpoint capabilities. */ -static struct -{ - unsigned char arch; - unsigned char max_wp_length; - unsigned char wp_count; - unsigned char bp_count; -} arm_linux_hwbp_cap; - -/* Enum describing the different types of ARM hardware break-/watch-points. */ -typedef enum -{ - arm_hwbp_break = 0, - arm_hwbp_load = 1, - arm_hwbp_store = 2, - arm_hwbp_access = 3 -} arm_hwbp_type; - -/* Type describing an ARM Hardware Breakpoint Control register value. */ -typedef unsigned int arm_hwbp_control_t; - -/* Structure used to keep track of hardware break-/watch-points. */ -struct arm_linux_hw_breakpoint -{ - /* Address to break on, or being watched. */ - unsigned int address; - /* Control register for break-/watch- point. */ - arm_hwbp_control_t control; -}; - -/* Since we cannot dynamically allocate subfields of arch_process_info, - assume a maximum number of supported break-/watchpoints. */ -#define MAX_BPTS 32 -#define MAX_WPTS 32 - -/* Per-process arch-specific data we want to keep. */ -struct arch_process_info -{ - /* Hardware breakpoints for this process. */ - struct arm_linux_hw_breakpoint bpts[MAX_BPTS]; - /* Hardware watchpoints for this process. */ - struct arm_linux_hw_breakpoint wpts[MAX_WPTS]; -}; - -/* Per-thread arch-specific data we want to keep. */ -struct arch_lwp_info -{ - /* Non-zero if our copy differs from what's recorded in the thread. */ - char bpts_changed[MAX_BPTS]; - char wpts_changed[MAX_WPTS]; - /* Cached stopped data address. */ - CORE_ADDR stopped_data_address; -}; - -static unsigned long arm_hwcap; - -/* These are in <asm/elf.h> in current kernels. */ -#define HWCAP_VFP 64 -#define HWCAP_IWMMXT 512 -#define HWCAP_NEON 4096 -#define HWCAP_VFPv3 8192 -#define HWCAP_VFPv3D16 16384 - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -#define arm_num_regs 26 - -static int arm_regmap[] = { - 0, 4, 8, 12, 16, 20, 24, 28, - 32, 36, 40, 44, 48, 52, 56, 60, - -1, -1, -1, -1, -1, -1, -1, -1, -1, - 64 -}; - -static int -arm_cannot_store_register (int regno) -{ - return (regno >= arm_num_regs); -} - -static int -arm_cannot_fetch_register (int regno) -{ - return (regno >= arm_num_regs); -} - -static void -arm_fill_gregset (struct regcache *regcache, void *buf) -{ - int i; - - for (i = 0; i < arm_num_regs; i++) - if (arm_regmap[i] != -1) - collect_register (regcache, i, ((char *) buf) + arm_regmap[i]); -} - -static void -arm_store_gregset (struct regcache *regcache, const void *buf) -{ - int i; - char zerobuf[8]; - - memset (zerobuf, 0, 8); - for (i = 0; i < arm_num_regs; i++) - if (arm_regmap[i] != -1) - supply_register (regcache, i, ((char *) buf) + arm_regmap[i]); - else - supply_register (regcache, i, zerobuf); -} - -static void -arm_fill_wmmxregset (struct regcache *regcache, void *buf) -{ - int i; - - if (!(arm_hwcap & HWCAP_IWMMXT)) - return; - - for (i = 0; i < 16; i++) - collect_register (regcache, arm_num_regs + i, (char *) buf + i * 8); - - /* We only have access to wcssf, wcasf, and wcgr0-wcgr3. */ - for (i = 0; i < 6; i++) - collect_register (regcache, arm_num_regs + i + 16, - (char *) buf + 16 * 8 + i * 4); -} - -static void -arm_store_wmmxregset (struct regcache *regcache, const void *buf) -{ - int i; - - if (!(arm_hwcap & HWCAP_IWMMXT)) - return; - - for (i = 0; i < 16; i++) - supply_register (regcache, arm_num_regs + i, (char *) buf + i * 8); - - /* We only have access to wcssf, wcasf, and wcgr0-wcgr3. */ - for (i = 0; i < 6; i++) - supply_register (regcache, arm_num_regs + i + 16, - (char *) buf + 16 * 8 + i * 4); -} - -static void -arm_fill_vfpregset (struct regcache *regcache, void *buf) -{ - int i, num, base; - - if (!(arm_hwcap & HWCAP_VFP)) - return; - - if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3) - num = 32; - else - num = 16; - - base = find_regno ("d0"); - for (i = 0; i < num; i++) - collect_register (regcache, base + i, (char *) buf + i * 8); - - collect_register_by_name (regcache, "fpscr", (char *) buf + 32 * 8); -} - -static void -arm_store_vfpregset (struct regcache *regcache, const void *buf) -{ - int i, num, base; - - if (!(arm_hwcap & HWCAP_VFP)) - return; - - if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3) - num = 32; - else - num = 16; - - base = find_regno ("d0"); - for (i = 0; i < num; i++) - supply_register (regcache, base + i, (char *) buf + i * 8); - - supply_register_by_name (regcache, "fpscr", (char *) buf + 32 * 8); -} - -extern int debug_threads; - -static CORE_ADDR -arm_get_pc (struct regcache *regcache) -{ - unsigned long pc; - collect_register_by_name (regcache, "pc", &pc); - if (debug_threads) - fprintf (stderr, "stop pc is %08lx\n", pc); - return pc; -} - -static void -arm_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name (regcache, "pc", &newpc); -} - -/* Correct in either endianness. */ -static const unsigned long arm_breakpoint = 0xef9f0001; -#define arm_breakpoint_len 4 -static const unsigned short thumb_breakpoint = 0xde01; -static const unsigned short thumb2_breakpoint[] = { 0xf7f0, 0xa000 }; - -/* For new EABI binaries. We recognize it regardless of which ABI - is used for gdbserver, so single threaded debugging should work - OK, but for multi-threaded debugging we only insert the current - ABI's breakpoint instruction. For now at least. */ -static const unsigned long arm_eabi_breakpoint = 0xe7f001f0; - -static int -arm_breakpoint_at (CORE_ADDR where) -{ - struct regcache *regcache = get_thread_regcache (current_inferior, 1); - unsigned long cpsr; - - collect_register_by_name (regcache, "cpsr", &cpsr); - - if (cpsr & 0x20) - { - /* Thumb mode. */ - unsigned short insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, 2); - if (insn == thumb_breakpoint) - return 1; - - if (insn == thumb2_breakpoint[0]) - { - (*the_target->read_memory) (where + 2, (unsigned char *) &insn, 2); - if (insn == thumb2_breakpoint[1]) - return 1; - } - } - else - { - /* ARM mode. */ - unsigned long insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, 4); - if (insn == arm_breakpoint) - return 1; - - if (insn == arm_eabi_breakpoint) - return 1; - } - - 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 -arm_reinsert_addr (void) -{ - struct regcache *regcache = get_thread_regcache (current_inferior, 1); - unsigned long pc; - collect_register_by_name (regcache, "lr", &pc); - return pc; -} - -/* Fetch the thread-local storage pointer for libthread_db. */ - -ps_err_e -ps_get_thread_area (const struct ps_prochandle *ph, - lwpid_t lwpid, int idx, void **base) -{ - if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) - return PS_ERR; - - /* IDX is the bias from the thread pointer to the beginning of the - thread descriptor. It has to be subtracted due to implementation - quirks in libthread_db. */ - *base = (void *) ((char *)*base - idx); - - return PS_OK; -} - - -/* Query Hardware Breakpoint information for the target we are attached to - (using PID as ptrace argument) and set up arm_linux_hwbp_cap. */ -static void -arm_linux_init_hwbp_cap (int pid) -{ - unsigned int val; - - if (ptrace (PTRACE_GETHBPREGS, pid, 0, &val) < 0) - return; - - arm_linux_hwbp_cap.arch = (unsigned char)((val >> 24) & 0xff); - if (arm_linux_hwbp_cap.arch == 0) - return; - - arm_linux_hwbp_cap.max_wp_length = (unsigned char)((val >> 16) & 0xff); - arm_linux_hwbp_cap.wp_count = (unsigned char)((val >> 8) & 0xff); - arm_linux_hwbp_cap.bp_count = (unsigned char)(val & 0xff); - - if (arm_linux_hwbp_cap.wp_count > MAX_WPTS) - internal_error (__FILE__, __LINE__, "Unsupported number of watchpoints"); - if (arm_linux_hwbp_cap.bp_count > MAX_BPTS) - internal_error (__FILE__, __LINE__, "Unsupported number of breakpoints"); -} - -/* How many hardware breakpoints are available? */ -static int -arm_linux_get_hw_breakpoint_count (void) -{ - return arm_linux_hwbp_cap.bp_count; -} - -/* How many hardware watchpoints are available? */ -static int -arm_linux_get_hw_watchpoint_count (void) -{ - return arm_linux_hwbp_cap.wp_count; -} - -/* Maximum length of area watched by hardware watchpoint. */ -static int -arm_linux_get_hw_watchpoint_max_length (void) -{ - return arm_linux_hwbp_cap.max_wp_length; -} - -/* Initialize an ARM hardware break-/watch-point control register value. - BYTE_ADDRESS_SELECT is the mask of bytes to trigger on; HWBP_TYPE is the - type of break-/watch-point; ENABLE indicates whether the point is enabled. - */ -static arm_hwbp_control_t -arm_hwbp_control_initialize (unsigned byte_address_select, - arm_hwbp_type hwbp_type, - int enable) -{ - gdb_assert ((byte_address_select & ~0xffU) == 0); - gdb_assert (hwbp_type != arm_hwbp_break - || ((byte_address_select & 0xfU) != 0)); - - return (byte_address_select << 5) | (hwbp_type << 3) | (3 << 1) | enable; -} - -/* Does the breakpoint control value CONTROL have the enable bit set? */ -static int -arm_hwbp_control_is_enabled (arm_hwbp_control_t control) -{ - return control & 0x1; -} - -/* Is the breakpoint control value CONTROL initialized? */ -static int -arm_hwbp_control_is_initialized (arm_hwbp_control_t control) -{ - return control != 0; -} - -/* Change a breakpoint control word so that it is in the disabled state. */ -static arm_hwbp_control_t -arm_hwbp_control_disable (arm_hwbp_control_t control) -{ - return control & ~0x1; -} - -/* Are two break-/watch-points equal? */ -static int -arm_linux_hw_breakpoint_equal (const struct arm_linux_hw_breakpoint *p1, - const struct arm_linux_hw_breakpoint *p2) -{ - return p1->address == p2->address && p1->control == p2->control; -} - -/* Initialize the hardware breakpoint structure P for a breakpoint or - watchpoint at ADDR to LEN. The type of watchpoint is given in TYPE. - Returns -1 if TYPE is unsupported, 0 if TYPE represents a breakpoint, - and 1 if type represents a watchpoint. */ -static int -arm_linux_hw_point_initialize (char type, CORE_ADDR addr, int len, - struct arm_linux_hw_breakpoint *p) -{ - arm_hwbp_type hwbp_type; - unsigned mask; - - /* Breakpoint/watchpoint types (GDB terminology): - 0 = memory breakpoint for instructions - (not supported; done via memory write instead) - 1 = hardware breakpoint for instructions (supported) - 2 = write watchpoint (supported) - 3 = read watchpoint (supported) - 4 = access watchpoint (supported). */ - switch (type) - { - case '1': - hwbp_type = arm_hwbp_break; - break; - case '2': - hwbp_type = arm_hwbp_store; - break; - case '3': - hwbp_type = arm_hwbp_load; - break; - case '4': - hwbp_type = arm_hwbp_access; - break; - default: - /* Unsupported. */ - return -1; - } - - if (hwbp_type == arm_hwbp_break) - { - /* For breakpoints, the length field encodes the mode. */ - switch (len) - { - case 2: /* 16-bit Thumb mode breakpoint */ - case 3: /* 32-bit Thumb mode breakpoint */ - mask = 0x3 << (addr & 2); - break; - case 4: /* 32-bit ARM mode breakpoint */ - mask = 0xf; - break; - default: - /* Unsupported. */ - return -1; - } - - addr &= ~3; - } - else - { - CORE_ADDR max_wp_length = arm_linux_get_hw_watchpoint_max_length (); - CORE_ADDR aligned_addr; - - /* Can not set watchpoints for zero or negative lengths. */ - if (len <= 0) - return -1; - /* The current ptrace interface can only handle watchpoints that are a - power of 2. */ - if ((len & (len - 1)) != 0) - return -1; - - /* Test that the range [ADDR, ADDR + LEN) fits into the largest address - range covered by a watchpoint. */ - aligned_addr = addr & ~(max_wp_length - 1); - if (aligned_addr + max_wp_length < addr + len) - return -1; - - mask = (1 << len) - 1; - } - - p->address = (unsigned int) addr; - p->control = arm_hwbp_control_initialize (mask, hwbp_type, 1); - - return hwbp_type != arm_hwbp_break; -} - -/* Callback to mark a watch-/breakpoint to be updated in all threads of - the current process. */ - -struct update_registers_data -{ - int watch; - int i; -}; - -static int -update_registers_callback (struct inferior_list_entry *entry, void *arg) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - struct update_registers_data *data = (struct update_registers_data *) arg; - - /* Only update the threads of the current process. */ - if (pid_of (lwp) == pid_of (get_thread_lwp (current_inferior))) - { - /* The actual update is done later just before resuming the lwp, - we just mark that the registers need updating. */ - if (data->watch) - lwp->arch_private->wpts_changed[data->i] = 1; - else - lwp->arch_private->bpts_changed[data->i] = 1; - - /* If the lwp isn't stopped, force it to momentarily pause, so - we can update its breakpoint registers. */ - if (!lwp->stopped) - linux_stop_lwp (lwp); - } - - return 0; -} - -/* Insert hardware break-/watchpoint. */ -static int -arm_insert_point (char type, CORE_ADDR addr, int len) -{ - struct process_info *proc = current_process (); - struct arm_linux_hw_breakpoint p, *pts; - int watch, i, count; - - watch = arm_linux_hw_point_initialize (type, addr, len, &p); - if (watch < 0) - { - /* Unsupported. */ - return 1; - } - - if (watch) - { - count = arm_linux_get_hw_watchpoint_count (); - pts = proc->private->arch_private->wpts; - } - else - { - count = arm_linux_get_hw_breakpoint_count (); - pts = proc->private->arch_private->bpts; - } - - for (i = 0; i < count; i++) - if (!arm_hwbp_control_is_enabled (pts[i].control)) - { - struct update_registers_data data = { watch, i }; - pts[i] = p; - find_inferior (&all_lwps, update_registers_callback, &data); - return 0; - } - - /* We're out of watchpoints. */ - return -1; -} - -/* Remove hardware break-/watchpoint. */ -static int -arm_remove_point (char type, CORE_ADDR addr, int len) -{ - struct process_info *proc = current_process (); - struct arm_linux_hw_breakpoint p, *pts; - int watch, i, count; - - watch = arm_linux_hw_point_initialize (type, addr, len, &p); - if (watch < 0) - { - /* Unsupported. */ - return -1; - } - - if (watch) - { - count = arm_linux_get_hw_watchpoint_count (); - pts = proc->private->arch_private->wpts; - } - else - { - count = arm_linux_get_hw_breakpoint_count (); - pts = proc->private->arch_private->bpts; - } - - for (i = 0; i < count; i++) - if (arm_linux_hw_breakpoint_equal (&p, pts + i)) - { - struct update_registers_data data = { watch, i }; - pts[i].control = arm_hwbp_control_disable (pts[i].control); - find_inferior (&all_lwps, update_registers_callback, &data); - return 0; - } - - /* No watchpoint matched. */ - return -1; -} - -/* Return whether current thread is stopped due to a watchpoint. */ -static int -arm_stopped_by_watchpoint (void) -{ - struct lwp_info *lwp = get_thread_lwp (current_inferior); - struct siginfo siginfo; - - /* We must be able to set hardware watchpoints. */ - if (arm_linux_get_hw_watchpoint_count () == 0) - return 0; - - /* Retrieve siginfo. */ - errno = 0; - ptrace (PTRACE_GETSIGINFO, lwpid_of (lwp), 0, &siginfo); - if (errno != 0) - return 0; - - /* This must be a hardware breakpoint. */ - if (siginfo.si_signo != SIGTRAP - || (siginfo.si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */) - return 0; - - /* If we are in a positive slot then we're looking at a breakpoint and not - a watchpoint. */ - if (siginfo.si_errno >= 0) - return 0; - - /* Cache stopped data address for use by arm_stopped_data_address. */ - lwp->arch_private->stopped_data_address - = (CORE_ADDR) (uintptr_t) siginfo.si_addr; - - return 1; -} - -/* Return data address that triggered watchpoint. Called only if - arm_stopped_by_watchpoint returned true. */ -static CORE_ADDR -arm_stopped_data_address (void) -{ - struct lwp_info *lwp = get_thread_lwp (current_inferior); - return lwp->arch_private->stopped_data_address; -} - -/* Called when a new process is created. */ -static struct arch_process_info * -arm_new_process (void) -{ - struct arch_process_info *info = xcalloc (1, sizeof (*info)); - return info; -} - -/* Called when a new thread is detected. */ -static struct arch_lwp_info * -arm_new_thread (void) -{ - struct arch_lwp_info *info = xcalloc (1, sizeof (*info)); - int i; - - for (i = 0; i < MAX_BPTS; i++) - info->bpts_changed[i] = 1; - for (i = 0; i < MAX_WPTS; i++) - info->wpts_changed[i] = 1; - - return info; -} - -/* Called when resuming a thread. - If the debug regs have changed, update the thread's copies. */ -static void -arm_prepare_to_resume (struct lwp_info *lwp) -{ - int pid = lwpid_of (lwp); - struct process_info *proc = find_process_pid (pid_of (lwp)); - struct arch_process_info *proc_info = proc->private->arch_private; - struct arch_lwp_info *lwp_info = lwp->arch_private; - int i; - - for (i = 0; i < arm_linux_get_hw_breakpoint_count (); i++) - if (lwp_info->bpts_changed[i]) - { - errno = 0; - - if (arm_hwbp_control_is_enabled (proc_info->bpts[i].control)) - if (ptrace (PTRACE_SETHBPREGS, pid, ((i << 1) + 1), - &proc_info->bpts[i].address) < 0) - perror_with_name ("Unexpected error setting breakpoint address"); - - if (arm_hwbp_control_is_initialized (proc_info->bpts[i].control)) - if (ptrace (PTRACE_SETHBPREGS, pid, ((i << 1) + 2), - &proc_info->bpts[i].control) < 0) - perror_with_name ("Unexpected error setting breakpoint"); - - lwp_info->bpts_changed[i] = 0; - } - - for (i = 0; i < arm_linux_get_hw_watchpoint_count (); i++) - if (lwp_info->wpts_changed[i]) - { - errno = 0; - - if (arm_hwbp_control_is_enabled (proc_info->wpts[i].control)) - if (ptrace (PTRACE_SETHBPREGS, pid, -((i << 1) + 1), - &proc_info->wpts[i].address) < 0) - perror_with_name ("Unexpected error setting watchpoint address"); - - if (arm_hwbp_control_is_initialized (proc_info->wpts[i].control)) - if (ptrace (PTRACE_SETHBPREGS, pid, -((i << 1) + 2), - &proc_info->wpts[i].control) < 0) - perror_with_name ("Unexpected error setting watchpoint"); - - lwp_info->wpts_changed[i] = 0; - } -} - - -static int -arm_get_hwcap (unsigned long *valp) -{ - unsigned char *data = alloca (8); - int offset = 0; - - while ((*the_target->read_auxv) (offset, data, 8) == 8) - { - unsigned int *data_p = (unsigned int *)data; - if (data_p[0] == AT_HWCAP) - { - *valp = data_p[1]; - return 1; - } - - offset += 8; - } - - *valp = 0; - return 0; -} - -static void -arm_arch_setup (void) -{ - int pid = lwpid_of (get_thread_lwp (current_inferior)); - - /* Query hardware watchpoint/breakpoint capabilities. */ - arm_linux_init_hwbp_cap (pid); - - arm_hwcap = 0; - if (arm_get_hwcap (&arm_hwcap) == 0) - { - init_registers_arm (); - return; - } - - if (arm_hwcap & HWCAP_IWMMXT) - { - init_registers_arm_with_iwmmxt (); - return; - } - - if (arm_hwcap & HWCAP_VFP) - { - char *buf; - - /* NEON implies either no VFP, or VFPv3-D32. We only support - it with VFP. */ - if (arm_hwcap & HWCAP_NEON) - init_registers_arm_with_neon (); - else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3) - init_registers_arm_with_vfpv3 (); - else - init_registers_arm_with_vfpv2 (); - - /* Now make sure that the kernel supports reading these - registers. Support was added in 2.6.30. */ - errno = 0; - buf = xmalloc (32 * 8 + 4); - if (ptrace (PTRACE_GETVFPREGS, pid, 0, buf) < 0 - && errno == EIO) - { - arm_hwcap = 0; - init_registers_arm (); - } - free (buf); - - return; - } - - /* The default configuration uses legacy FPA registers, probably - simulated. */ - init_registers_arm (); -} - -struct regset_info target_regsets[] = { - { PTRACE_GETREGS, PTRACE_SETREGS, 0, 18 * 4, - GENERAL_REGS, - arm_fill_gregset, arm_store_gregset }, - { PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS, 0, 16 * 8 + 6 * 4, - EXTENDED_REGS, - arm_fill_wmmxregset, arm_store_wmmxregset }, - { PTRACE_GETVFPREGS, PTRACE_SETVFPREGS, 0, 32 * 8 + 4, - EXTENDED_REGS, - arm_fill_vfpregset, arm_store_vfpregset }, - { 0, 0, 0, -1, -1, NULL, NULL } -}; - -struct linux_target_ops the_low_target = { - arm_arch_setup, - arm_num_regs, - arm_regmap, - arm_cannot_fetch_register, - arm_cannot_store_register, - arm_get_pc, - arm_set_pc, - - /* Define an ARM-mode breakpoint; we only set breakpoints in the C - library, which is most likely to be ARM. If the kernel supports - clone events, we will never insert a breakpoint, so even a Thumb - C library will work; so will mixing EABI/non-EABI gdbserver and - application. */ -#ifndef __ARM_EABI__ - (const unsigned char *) &arm_breakpoint, -#else - (const unsigned char *) &arm_eabi_breakpoint, -#endif - arm_breakpoint_len, - arm_reinsert_addr, - 0, - arm_breakpoint_at, - arm_insert_point, - arm_remove_point, - arm_stopped_by_watchpoint, - arm_stopped_data_address, - NULL, /* collect_ptrace_register */ - NULL, /* supply_ptrace_register */ - NULL, /* siginfo_fixup */ - arm_new_process, - arm_new_thread, - arm_prepare_to_resume, -}; diff --git a/gdb/gdbserver/linux-bfin-low.c b/gdb/gdbserver/linux-bfin-low.c deleted file mode 100644 index 58ad288f000..00000000000 --- a/gdb/gdbserver/linux-bfin-low.c +++ /dev/null @@ -1,107 +0,0 @@ -/* GNU/Linux/BFIN specific low level interface, for the remote server for GDB. - - Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. - - Contributed by Analog Devices, 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 "libiberty.h" -#include <asm/ptrace.h> - -/* Defined in auto-generated file reg-bfin.c. */ -void init_registers_bfin (void); - -static int bfin_regmap[] = -{ - PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5, PT_R6, PT_R7, - PT_P0, PT_P1, PT_P2, PT_P3, PT_P4, PT_P5, PT_USP, PT_FP, - PT_I0, PT_I1, PT_I2, PT_I3, PT_M0, PT_M1, PT_M2, PT_M3, - PT_B0, PT_B1, PT_B2, PT_B3, PT_L0, PT_L1, PT_L2, PT_L3, - PT_A0X, PT_A0W, PT_A1X, PT_A1W, PT_ASTAT, PT_RETS, - PT_LC0, PT_LT0, PT_LB0, PT_LC1, PT_LT1, PT_LB1, - -1 /* PT_CYCLES */, -1 /* PT_CYCLES2 */, - -1 /* PT_USP */, PT_SEQSTAT, PT_SYSCFG, PT_PC, PT_RETX, PT_RETN, PT_RETE, - PT_PC, -}; - -#define bfin_num_regs ARRAY_SIZE (bfin_regmap) - -static int -bfin_cannot_store_register (int regno) -{ - return (regno >= bfin_num_regs); -} - -static int -bfin_cannot_fetch_register (int regno) -{ - return (regno >= bfin_num_regs); -} - -static CORE_ADDR -bfin_get_pc (struct regcache *regcache) -{ - unsigned long pc; - - collect_register_by_name (regcache, "pc", &pc); - - return pc; -} - -static void -bfin_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - unsigned long newpc = pc; - - supply_register_by_name (regcache, "pc", &newpc); -} - -#define bfin_breakpoint_len 2 -static const unsigned char bfin_breakpoint[bfin_breakpoint_len] = {0xa1, 0x00}; - -static int -bfin_breakpoint_at (CORE_ADDR where) -{ - unsigned char insn[bfin_breakpoint_len]; - - read_inferior_memory(where, insn, bfin_breakpoint_len); - if (insn[0] == bfin_breakpoint[0] - && insn[1] == bfin_breakpoint[1]) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -struct linux_target_ops the_low_target = { - init_registers_bfin, - bfin_num_regs, - bfin_regmap, - bfin_cannot_fetch_register, - bfin_cannot_store_register, - bfin_get_pc, - bfin_set_pc, - bfin_breakpoint, - bfin_breakpoint_len, - 0, - 2, - bfin_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-cris-low.c b/gdb/gdbserver/linux-cris-low.c deleted file mode 100644 index e9df8c66524..00000000000 --- a/gdb/gdbserver/linux-cris-low.c +++ /dev/null @@ -1,128 +0,0 @@ -/* GNU/Linux/CRIS specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2007, 2008, 2009, 2010, 2011 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> - -/* Defined in auto-generated file reg-cris.c. */ -void init_registers_cris (void); - -/* CRISv10 */ -#define cris_num_regs 32 - -/* Locations need to match <include/asm/arch/ptrace.h>. */ -static int cris_regmap[] = { - 15*4, 14*4, 13*4, 12*4, - 11*4, 10*4, 9*4, 8*4, - 7*4, 6*4, 5*4, 4*4, - 3*4, 2*4, 23*4, 19*4, - - -1, -1, -1, -1, - -1, 17*4, -1, 16*4, - -1, -1, -1, 18*4, - -1, 17*4, -1, -1 - -}; - -static int -cris_cannot_store_register (int regno) -{ - if (cris_regmap[regno] == -1) - return 1; - - return (regno >= cris_num_regs); -} - -static int -cris_cannot_fetch_register (int regno) -{ - if (cris_regmap[regno] == -1) - return 1; - - return (regno >= cris_num_regs); -} - -extern int debug_threads; - -static CORE_ADDR -cris_get_pc (struct regcache *regcache, void) -{ - unsigned long pc; - collect_register_by_name (regcache, "pc", &pc); - if (debug_threads) - fprintf (stderr, "stop pc is %08lx\n", pc); - return pc; -} - -static void -cris_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name (regcache, "pc", &newpc); -} - -static const unsigned short cris_breakpoint = 0xe938; -#define cris_breakpoint_len 2 - -static int -cris_breakpoint_at (CORE_ADDR where) -{ - unsigned short insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, - cris_breakpoint_len); - if (insn == cris_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - 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 -cris_reinsert_addr (void) -{ - struct regcache *regcache = get_thread_regcache (current_inferior, 1); - unsigned long pc; - collect_register_by_name (regcache, "srp", &pc); - return pc; -} - -struct linux_target_ops the_low_target = { - init_registers_cris, - cris_num_regs, - cris_regmap, - cris_cannot_fetch_register, - cris_cannot_store_register, - cris_get_pc, - cris_set_pc, - (const unsigned char *) &cris_breakpoint, - cris_breakpoint_len, - cris_reinsert_addr, - 0, - cris_breakpoint_at, - 0, - 0, - 0, - 0, -}; diff --git a/gdb/gdbserver/linux-crisv32-low.c b/gdb/gdbserver/linux-crisv32-low.c deleted file mode 100644 index 71a037a257e..00000000000 --- a/gdb/gdbserver/linux-crisv32-low.c +++ /dev/null @@ -1,390 +0,0 @@ -/* GNU/Linux/CRIS specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2007, 2008, 2009, 2010, 2011 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> - -/* Defined in auto-generated file reg-crisv32.c. */ -void init_registers_crisv32 (void); - -/* CRISv32 */ -#define cris_num_regs 49 - -/* Note: Ignoring USP (having the stack pointer in two locations causes trouble - without any significant gain). */ - -/* Locations need to match <include/asm/arch/ptrace.h>. */ -static int cris_regmap[] = { - 1*4, 2*4, 3*4, 4*4, - 5*4, 6*4, 7*4, 8*4, - 9*4, 10*4, 11*4, 12*4, - 13*4, 14*4, 24*4, 15*4, - - -1, -1, -1, 16*4, - -1, 22*4, 23*4, 17*4, - -1, -1, 21*4, 20*4, - -1, 19*4, -1, 18*4, - - 25*4, - - 26*4, -1, -1, 29*4, - 30*4, 31*4, 32*4, 33*4, - 34*4, 35*4, 36*4, 37*4, - 38*4, 39*4, 40*4, -1 - -}; - -extern int debug_threads; - -static CORE_ADDR -cris_get_pc (struct regcache *regcache) -{ - unsigned long pc; - collect_register_by_name (regcache, "pc", &pc); - if (debug_threads) - fprintf (stderr, "stop pc is %08lx\n", pc); - return pc; -} - -static void -cris_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name (regcache, "pc", &newpc); -} - -static const unsigned short cris_breakpoint = 0xe938; -#define cris_breakpoint_len 2 - -static int -cris_breakpoint_at (CORE_ADDR where) -{ - unsigned short insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, - cris_breakpoint_len); - if (insn == cris_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - 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. */ - -/* FIXME: This function should not be needed, since we have PTRACE_SINGLESTEP - for CRISv32. Without it, td_ta_event_getmsg in thread_db_create_event - will fail when debugging multi-threaded applications. */ - -static CORE_ADDR -cris_reinsert_addr (void) -{ - struct regcache *regcache = get_thread_regcache (current_inferior, 1); - unsigned long pc; - collect_register_by_name (regcache, "srp", &pc); - return pc; -} - -static void -cris_write_data_breakpoint (struct regcache *regcache, - int bp, unsigned long start, unsigned long end) -{ - switch (bp) - { - case 0: - supply_register_by_name (regcache, "s3", &start); - supply_register_by_name (regcache, "s4", &end); - break; - case 1: - supply_register_by_name (regcache, "s5", &start); - supply_register_by_name (regcache, "s6", &end); - break; - case 2: - supply_register_by_name (regcache, "s7", &start); - supply_register_by_name (regcache, "s8", &end); - break; - case 3: - supply_register_by_name (regcache, "s9", &start); - supply_register_by_name (regcache, "s10", &end); - break; - case 4: - supply_register_by_name (regcache, "s11", &start); - supply_register_by_name (regcache, "s12", &end); - break; - case 5: - supply_register_by_name (regcache, "s13", &start); - supply_register_by_name (regcache, "s14", &end); - break; - } -} - -static int -cris_insert_point (char type, CORE_ADDR addr, int len) -{ - int bp; - unsigned long bp_ctrl; - unsigned long start, end; - unsigned long ccs; - struct regcache *regcache; - - /* Breakpoint/watchpoint types (GDB terminology): - 0 = memory breakpoint for instructions - (not supported; done via memory write instead) - 1 = hardware breakpoint for instructions (not supported) - 2 = write watchpoint (supported) - 3 = read watchpoint (supported) - 4 = access watchpoint (supported). */ - - if (type < '2' || type > '4') - { - /* Unsupported. */ - return 1; - } - - regcache = get_thread_regcache (current_inferior, 1); - - /* Read watchpoints are set as access watchpoints, because of GDB's - inability to deal with pure read watchpoints. */ - if (type == '3') - type = '4'; - - /* Get the configuration register. */ - collect_register_by_name (regcache, "s0", &bp_ctrl); - - /* The watchpoint allocation scheme is the simplest possible. - For example, if a region is watched for read and - a write watch is requested, a new watchpoint will - be used. Also, if a watch for a region that is already - covered by one or more existing watchpoints, a new - watchpoint will be used. */ - - /* First, find a free data watchpoint. */ - for (bp = 0; bp < 6; bp++) - { - /* Each data watchpoint's control registers occupy 2 bits - (hence the 3), starting at bit 2 for D0 (hence the 2) - with 4 bits between for each watchpoint (yes, the 4). */ - if (!(bp_ctrl & (0x3 << (2 + (bp * 4))))) - break; - } - - if (bp > 5) - { - /* We're out of watchpoints. */ - return -1; - } - - /* Configure the control register first. */ - if (type == '3' || type == '4') - { - /* Trigger on read. */ - bp_ctrl |= (1 << (2 + bp * 4)); - } - if (type == '2' || type == '4') - { - /* Trigger on write. */ - bp_ctrl |= (2 << (2 + bp * 4)); - } - - /* Setup the configuration register. */ - supply_register_by_name (regcache, "s0", &bp_ctrl); - - /* Setup the range. */ - start = addr; - end = addr + len - 1; - - /* Configure the watchpoint register. */ - cris_write_data_breakpoint (regcache, bp, start, end); - - collect_register_by_name (regcache, "ccs", &ccs); - /* Set the S1 flag to enable watchpoints. */ - ccs |= (1 << 19); - supply_register_by_name (regcache, "ccs", &ccs); - - return 0; -} - -static int -cris_remove_point (char type, CORE_ADDR addr, int len) -{ - int bp; - unsigned long bp_ctrl; - unsigned long start, end; - struct regcache *regcache; - - /* Breakpoint/watchpoint types: - 0 = memory breakpoint for instructions - (not supported; done via memory write instead) - 1 = hardware breakpoint for instructions (not supported) - 2 = write watchpoint (supported) - 3 = read watchpoint (supported) - 4 = access watchpoint (supported). */ - if (type < '2' || type > '4') - return -1; - - regcache = get_thread_regcache (current_inferior, 1); - - /* Read watchpoints are set as access watchpoints, because of GDB's - inability to deal with pure read watchpoints. */ - if (type == '3') - type = '4'; - - /* Get the configuration register. */ - collect_register_by_name (regcache, "s0", &bp_ctrl); - - /* Try to find a watchpoint that is configured for the - specified range, then check that read/write also matches. */ - - /* Ugly pointer arithmetic, since I cannot rely on a - single switch (addr) as there may be several watchpoints with - the same start address for example. */ - - unsigned long bp_d_regs[12]; - - /* Get all range registers to simplify search. */ - collect_register_by_name (regcache, "s3", &bp_d_regs[0]); - collect_register_by_name (regcache, "s4", &bp_d_regs[1]); - collect_register_by_name (regcache, "s5", &bp_d_regs[2]); - collect_register_by_name (regcache, "s6", &bp_d_regs[3]); - collect_register_by_name (regcache, "s7", &bp_d_regs[4]); - collect_register_by_name (regcache, "s8", &bp_d_regs[5]); - collect_register_by_name (regcache, "s9", &bp_d_regs[6]); - collect_register_by_name (regcache, "s10", &bp_d_regs[7]); - collect_register_by_name (regcache, "s11", &bp_d_regs[8]); - collect_register_by_name (regcache, "s12", &bp_d_regs[9]); - collect_register_by_name (regcache, "s13", &bp_d_regs[10]); - collect_register_by_name (regcache, "s14", &bp_d_regs[11]); - - for (bp = 0; bp < 6; bp++) - { - if (bp_d_regs[bp * 2] == addr - && bp_d_regs[bp * 2 + 1] == (addr + len - 1)) { - /* Matching range. */ - int bitpos = 2 + bp * 4; - int rw_bits; - - /* Read/write bits for this BP. */ - rw_bits = (bp_ctrl & (0x3 << bitpos)) >> bitpos; - - if ((type == '3' && rw_bits == 0x1) - || (type == '2' && rw_bits == 0x2) - || (type == '4' && rw_bits == 0x3)) - { - /* Read/write matched. */ - break; - } - } - } - - if (bp > 5) - { - /* No watchpoint matched. */ - return -1; - } - - /* Found a matching watchpoint. Now, deconfigure it by - both disabling read/write in bp_ctrl and zeroing its - start/end addresses. */ - bp_ctrl &= ~(3 << (2 + (bp * 4))); - /* Setup the configuration register. */ - supply_register_by_name (regcache, "s0", &bp_ctrl); - - start = end = 0; - /* Configure the watchpoint register. */ - cris_write_data_breakpoint (regcache, bp, start, end); - - /* Note that we don't clear the S1 flag here. It's done when continuing. */ - return 0; -} - -static int -cris_stopped_by_watchpoint (void) -{ - unsigned long exs; - - collect_register_by_name ("exs", &exs); - - return (((exs & 0xff00) >> 8) == 0xc); -} - -static CORE_ADDR -cris_stopped_data_address (void) -{ - unsigned long eda; - - collect_register_by_name ("eda", &eda); - - /* FIXME: Possibly adjust to match watched range. */ - return eda; -} - -static void -cris_fill_gregset (void *buf) -{ - int i; - - for (i = 0; i < cris_num_regs; i++) - { - if (cris_regmap[i] != -1) - collect_register (i, ((char *) buf) + cris_regmap[i]); - } -} - -static void -cris_store_gregset (const void *buf) -{ - int i; - - for (i = 0; i < cris_num_regs; i++) - { - if (cris_regmap[i] != -1) - supply_register (i, ((char *) buf) + cris_regmap[i]); - } -} - -typedef unsigned long elf_gregset_t[cris_num_regs]; - -struct regset_info target_regsets[] = { - { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t), - GENERAL_REGS, cris_fill_gregset, cris_store_gregset }, - { 0, 0, 0, -1, -1, NULL, NULL } -}; - -struct linux_target_ops the_low_target = { - init_register_crisv32, - -1, - NULL, - NULL, - NULL, - cris_get_pc, - cris_set_pc, - (const unsigned char *) &cris_breakpoint, - cris_breakpoint_len, - cris_reinsert_addr, - 0, - cris_breakpoint_at, - cris_insert_point, - cris_remove_point, - cris_stopped_by_watchpoint, - cris_stopped_data_address, -}; diff --git a/gdb/gdbserver/linux-i386-ipa.c b/gdb/gdbserver/linux-i386-ipa.c deleted file mode 100644 index f0eeb4af54d..00000000000 --- a/gdb/gdbserver/linux-i386-ipa.c +++ /dev/null @@ -1,198 +0,0 @@ -/* GNU/Linux/x86 specific low level interface, for the in-process - agent library for GDB. - - Copyright (C) 2010, 2011 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" - -/* GDB register numbers. */ - -enum i386_gdb_regnum -{ - I386_EAX_REGNUM, /* %eax */ - I386_ECX_REGNUM, /* %ecx */ - I386_EDX_REGNUM, /* %edx */ - I386_EBX_REGNUM, /* %ebx */ - I386_ESP_REGNUM, /* %esp */ - I386_EBP_REGNUM, /* %ebp */ - I386_ESI_REGNUM, /* %esi */ - I386_EDI_REGNUM, /* %edi */ - I386_EIP_REGNUM, /* %eip */ - I386_EFLAGS_REGNUM, /* %eflags */ - I386_CS_REGNUM, /* %cs */ - I386_SS_REGNUM, /* %ss */ - I386_DS_REGNUM, /* %ds */ - I386_ES_REGNUM, /* %es */ - I386_FS_REGNUM, /* %fs */ - I386_GS_REGNUM, /* %gs */ - I386_ST0_REGNUM /* %st(0) */ -}; - -#define i386_num_regs 16 - -/* Defined in auto-generated file i386-linux.c. */ -void init_registers_i386_linux (void); - -#define FT_CR_EAX 15 -#define FT_CR_ECX 14 -#define FT_CR_EDX 13 -#define FT_CR_EBX 12 -#define FT_CR_UESP 11 -#define FT_CR_EBP 10 -#define FT_CR_ESI 9 -#define FT_CR_EDI 8 -#define FT_CR_EIP 7 -#define FT_CR_EFL 6 -#define FT_CR_DS 5 -#define FT_CR_ES 4 -#define FT_CR_FS 3 -#define FT_CR_GS 2 -#define FT_CR_SS 1 -#define FT_CR_CS 0 - -/* Mapping between the general-purpose registers in jump tracepoint - format and GDB's register array layout. */ - -static const int i386_ft_collect_regmap[] = -{ - FT_CR_EAX * 4, FT_CR_ECX * 4, FT_CR_EDX * 4, FT_CR_EBX * 4, - FT_CR_UESP * 4, FT_CR_EBP * 4, FT_CR_ESI * 4, FT_CR_EDI * 4, - FT_CR_EIP * 4, FT_CR_EFL * 4, FT_CR_CS * 4, FT_CR_SS * 4, - FT_CR_DS * 4, FT_CR_ES * 4, FT_CR_FS * 4, FT_CR_GS * 4 -}; - -void -supply_fast_tracepoint_registers (struct regcache *regcache, - const unsigned char *buf) -{ - int i; - - for (i = 0; i < i386_num_regs; i++) - { - int regval; - - if (i >= I386_CS_REGNUM && i <= I386_GS_REGNUM) - regval = *(short *) (((char *) buf) + i386_ft_collect_regmap[i]); - else - regval = *(int *) (((char *) buf) + i386_ft_collect_regmap[i]); - - supply_register (regcache, i, ®val); - } -} - -ULONGEST __attribute__ ((visibility("default"), used)) -gdb_agent_get_raw_reg (unsigned char *raw_regs, int regnum) -{ - /* This should maybe be allowed to return an error code, or perhaps - better, have the emit_reg detect this, and emit a constant zero, - or something. */ - - if (regnum > i386_num_regs) - return 0; - else if (regnum >= I386_CS_REGNUM && regnum <= I386_GS_REGNUM) - return *(short *) (raw_regs + i386_ft_collect_regmap[regnum]); - else - return *(int *) (raw_regs + i386_ft_collect_regmap[regnum]); -} - -#ifdef HAVE_UST - -#include <ust/processor.h> - -/* "struct registers" is the UST object type holding the registers at - the time of the static tracepoint marker call. This doesn't - contain EIP, but we know what it must have been (the marker - address). */ - -#define ST_REGENTRY(REG) \ - { \ - offsetof (struct registers, REG), \ - sizeof (((struct registers *) NULL)->REG) \ - } - -static struct -{ - int offset; - int size; -} i386_st_collect_regmap[] = - { - ST_REGENTRY(eax), - ST_REGENTRY(ecx), - ST_REGENTRY(edx), - ST_REGENTRY(ebx), - ST_REGENTRY(esp), - ST_REGENTRY(ebp), - ST_REGENTRY(esi), - ST_REGENTRY(edi), - { -1, 0 }, /* eip */ - ST_REGENTRY(eflags), - ST_REGENTRY(cs), - ST_REGENTRY(ss), - }; - -#define i386_NUM_ST_COLLECT_GREGS \ - (sizeof (i386_st_collect_regmap) / sizeof (i386_st_collect_regmap[0])) - -void -supply_static_tracepoint_registers (struct regcache *regcache, - const unsigned char *buf, - CORE_ADDR pc) -{ - int i; - unsigned int newpc = pc; - - supply_register (regcache, I386_EIP_REGNUM, &newpc); - - for (i = 0; i < i386_NUM_ST_COLLECT_GREGS; i++) - if (i386_st_collect_regmap[i].offset != -1) - { - switch (i386_st_collect_regmap[i].size) - { - case 4: - supply_register (regcache, i, - ((char *) buf) - + i386_st_collect_regmap[i].offset); - break; - case 2: - { - unsigned long reg - = * (short *) (((char *) buf) - + i386_st_collect_regmap[i].offset); - reg &= 0xffff; - supply_register (regcache, i, ®); - } - break; - default: - internal_error (__FILE__, __LINE__, "unhandled register size: %d", - i386_st_collect_regmap[i].size); - } - } -} - -#endif /* HAVE_UST */ - - -/* This is only needed because reg-i386-linux-lib.o references it. We - may use it proper at some point. */ -const char *gdbserver_xmltarget; - -void -initialize_low_tracepoint (void) -{ - init_registers_i386_linux (); -} diff --git a/gdb/gdbserver/linux-ia64-low.c b/gdb/gdbserver/linux-ia64-low.c deleted file mode 100644 index 0f6568a4eb7..00000000000 --- a/gdb/gdbserver/linux-ia64-low.c +++ /dev/null @@ -1,287 +0,0 @@ -/* GNU/Linux/IA64 specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2007, 2008, 2009, - 2010, 2011 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" - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -/* Defined in auto-generated file reg-ia64.c. */ -void init_registers_ia64 (void); - -#define ia64_num_regs 462 - -#include <asm/ptrace_offsets.h> - -static int ia64_regmap[] = - { - /* general registers */ - -1, /* gr0 not available; i.e, it's always zero */ - PT_R1, - PT_R2, - PT_R3, - PT_R4, - PT_R5, - PT_R6, - PT_R7, - PT_R8, - PT_R9, - PT_R10, - PT_R11, - PT_R12, - PT_R13, - PT_R14, - PT_R15, - PT_R16, - PT_R17, - PT_R18, - PT_R19, - PT_R20, - PT_R21, - PT_R22, - PT_R23, - PT_R24, - PT_R25, - PT_R26, - PT_R27, - PT_R28, - PT_R29, - PT_R30, - PT_R31, - /* gr32 through gr127 not directly available via the ptrace interface */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - /* Floating point registers */ - -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */ - PT_F2, - PT_F3, - PT_F4, - PT_F5, - PT_F6, - PT_F7, - PT_F8, - PT_F9, - PT_F10, - PT_F11, - PT_F12, - PT_F13, - PT_F14, - PT_F15, - PT_F16, - PT_F17, - PT_F18, - PT_F19, - PT_F20, - PT_F21, - PT_F22, - PT_F23, - PT_F24, - PT_F25, - PT_F26, - PT_F27, - PT_F28, - PT_F29, - PT_F30, - PT_F31, - PT_F32, - PT_F33, - PT_F34, - PT_F35, - PT_F36, - PT_F37, - PT_F38, - PT_F39, - PT_F40, - PT_F41, - PT_F42, - PT_F43, - PT_F44, - PT_F45, - PT_F46, - PT_F47, - PT_F48, - PT_F49, - PT_F50, - PT_F51, - PT_F52, - PT_F53, - PT_F54, - PT_F55, - PT_F56, - PT_F57, - PT_F58, - PT_F59, - PT_F60, - PT_F61, - PT_F62, - PT_F63, - PT_F64, - PT_F65, - PT_F66, - PT_F67, - PT_F68, - PT_F69, - PT_F70, - PT_F71, - PT_F72, - PT_F73, - PT_F74, - PT_F75, - PT_F76, - PT_F77, - PT_F78, - PT_F79, - PT_F80, - PT_F81, - PT_F82, - PT_F83, - PT_F84, - PT_F85, - PT_F86, - PT_F87, - PT_F88, - PT_F89, - PT_F90, - PT_F91, - PT_F92, - PT_F93, - PT_F94, - PT_F95, - PT_F96, - PT_F97, - PT_F98, - PT_F99, - PT_F100, - PT_F101, - PT_F102, - PT_F103, - PT_F104, - PT_F105, - PT_F106, - PT_F107, - PT_F108, - PT_F109, - PT_F110, - PT_F111, - PT_F112, - PT_F113, - PT_F114, - PT_F115, - PT_F116, - PT_F117, - PT_F118, - PT_F119, - PT_F120, - PT_F121, - PT_F122, - PT_F123, - PT_F124, - PT_F125, - PT_F126, - PT_F127, - /* predicate registers - we don't fetch these individually */ - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - /* branch registers */ - PT_B0, - PT_B1, - PT_B2, - PT_B3, - PT_B4, - PT_B5, - PT_B6, - PT_B7, - /* virtual frame pointer and virtual return address pointer */ - -1, -1, - /* other registers */ - PT_PR, - PT_CR_IIP, /* ip */ - PT_CR_IPSR, /* psr */ - PT_CFM, /* cfm */ - /* kernel registers not visible via ptrace interface (?) */ - -1, -1, -1, -1, -1, -1, -1, -1, - /* hole */ - -1, -1, -1, -1, -1, -1, -1, -1, - PT_AR_RSC, - PT_AR_BSP, - PT_AR_BSPSTORE, - PT_AR_RNAT, - -1, - -1, /* Not available: FCR, IA32 floating control register */ - -1, -1, - -1, /* Not available: EFLAG */ - -1, /* Not available: CSD */ - -1, /* Not available: SSD */ - -1, /* Not available: CFLG */ - -1, /* Not available: FSR */ - -1, /* Not available: FIR */ - -1, /* Not available: FDR */ - -1, - PT_AR_CCV, - -1, -1, -1, - PT_AR_UNAT, - -1, -1, -1, - PT_AR_FPSR, - -1, -1, -1, - -1, /* Not available: ITC */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, - PT_AR_PFS, - PT_AR_LC, - -1, /* Not available: EC, the Epilog Count register */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, - }; - -static int -ia64_cannot_store_register (int regno) -{ - return 0; -} - -static int -ia64_cannot_fetch_register (int regno) -{ - return 0; -} - -struct linux_target_ops the_low_target = { - init_registers_ia64, - ia64_num_regs, - ia64_regmap, - ia64_cannot_fetch_register, - ia64_cannot_store_register, -}; diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c deleted file mode 100644 index 94f785c2a64..00000000000 --- a/gdb/gdbserver/linux-low.c +++ /dev/null @@ -1,4987 +0,0 @@ -/* 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, 2009, 2010, 2011 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 "linux-osdata.h" - -#include <sys/wait.h> -#include <stdio.h> -#include <sys/param.h> -#include <sys/ptrace.h> -#include "linux-ptrace.h" -#include "linux-procfs.h" -#include <signal.h> -#include <sys/ioctl.h> -#include <fcntl.h> -#include <string.h> -#include <stdlib.h> -#include <unistd.h> -#include <errno.h> -#include <sys/syscall.h> -#include <sched.h> -#include <ctype.h> -#include <pwd.h> -#include <sys/types.h> -#include <dirent.h> -#include <sys/stat.h> -#include <sys/vfs.h> -#include <sys/uio.h> -#ifndef ELFMAG0 -/* Don't include <linux/elf.h> here. If it got included by gdb_proc_service.h - then ELFMAG0 will have been defined. If it didn't get included by - gdb_proc_service.h then including it will likely introduce a duplicate - definition of elf_fpregset_t. */ -#include <elf.h> -#endif - -#ifndef SPUFS_MAGIC -#define SPUFS_MAGIC 0x23c9b64e -#endif - -#ifndef O_LARGEFILE -#define O_LARGEFILE 0 -#endif - -#ifndef W_STOPCODE -#define W_STOPCODE(sig) ((sig) << 8 | 0x7f) -#endif - -/* This is the kernel's hard limit. Not to be confused with - SIGRTMIN. */ -#ifndef __SIGRTMIN -#define __SIGRTMIN 32 -#endif - -#ifdef __UCLIBC__ -#if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__)) -#define HAS_NOMMU -#endif -#endif - -/* ``all_threads'' is keyed by the LWP ID, which we use as the GDB protocol - representation of the thread ID. - - ``all_lwps'' is keyed by the process ID - which on Linux is (presently) - the same as the LWP ID. - - ``all_processes'' is keyed by the "overall process ID", which - GNU/Linux calls tgid, "thread group ID". */ - -struct inferior_list all_lwps; - -/* A list of all unknown processes which receive stop signals. Some other - process will presumably claim each of these as forked children - momentarily. */ - -struct inferior_list stopped_pids; - -/* FIXME this is a bit of a hack, and could be removed. */ -int stopping_threads; - -/* FIXME make into a target method? */ -int using_threads = 1; - -/* True if we're presently stabilizing threads (moving them out of - jump pads). */ -static int stabilizing_threads; - -/* This flag is true iff we've just created or attached to our first - inferior but it has not stopped yet. As soon as it does, we need - to call the low target's arch_setup callback. Doing this only on - the first inferior avoids reinializing the architecture on every - inferior, and avoids messing with the register caches of the - already running inferiors. NOTE: this assumes all inferiors under - control of gdbserver have the same architecture. */ -static int new_inferior; - -static void linux_resume_one_lwp (struct lwp_info *lwp, - int step, int signal, siginfo_t *info); -static void linux_resume (struct thread_resume *resume_info, size_t n); -static void stop_all_lwps (int suspend, struct lwp_info *except); -static void unstop_all_lwps (int unsuspend, struct lwp_info *except); -static int linux_wait_for_event (ptid_t ptid, int *wstat, int options); -static void *add_lwp (ptid_t ptid); -static int linux_stopped_by_watchpoint (void); -static void mark_lwp_dead (struct lwp_info *lwp, int wstat); -static void proceed_all_lwps (void); -static int finish_step_over (struct lwp_info *lwp); -static CORE_ADDR get_stop_pc (struct lwp_info *lwp); -static int kill_lwp (unsigned long lwpid, int signo); -static void linux_enable_event_reporting (int pid); - -/* True if the low target can hardware single-step. Such targets - don't need a BREAKPOINT_REINSERT_ADDR callback. */ - -static int -can_hardware_single_step (void) -{ - return (the_low_target.breakpoint_reinsert_addr == NULL); -} - -/* True if the low target supports memory breakpoints. If so, we'll - have a GET_PC implementation. */ - -static int -supports_breakpoints (void) -{ - return (the_low_target.get_pc != NULL); -} - -/* Returns true if this target can support fast tracepoints. This - does not mean that the in-process agent has been loaded in the - inferior. */ - -static int -supports_fast_tracepoints (void) -{ - return the_low_target.install_fast_tracepoint_jump_pad != NULL; -} - -struct pending_signals -{ - int signal; - siginfo_t info; - struct pending_signals *prev; -}; - -#define PTRACE_ARG3_TYPE void * -#define PTRACE_ARG4_TYPE void * -#define PTRACE_XFER_TYPE long - -#ifdef HAVE_LINUX_REGSETS -static char *disabled_regsets; -static int num_regsets; -#endif - -/* The read/write ends of the pipe registered as waitable file in the - event loop. */ -static int linux_event_pipe[2] = { -1, -1 }; - -/* True if we're currently in async mode. */ -#define target_is_async_p() (linux_event_pipe[0] != -1) - -static void send_sigstop (struct lwp_info *lwp); -static void wait_for_sigstop (struct inferior_list_entry *entry); - -/* Accepts an integer PID; Returns a string representing a file that - can be opened to get info for the child process. - Space for the result is malloc'd, caller must free. */ - -char * -linux_child_pid_to_exec_file (int pid) -{ - char *name1, *name2; - - name1 = xmalloc (MAXPATHLEN); - name2 = xmalloc (MAXPATHLEN); - memset (name2, 0, MAXPATHLEN); - - sprintf (name1, "/proc/%d/exe", pid); - if (readlink (name1, name2, MAXPATHLEN) > 0) - { - free (name1); - return name2; - } - else - { - free (name2); - return name1; - } -} - -/* Return non-zero if HEADER is a 64-bit ELF file. */ - -static int -elf_64_header_p (const Elf64_Ehdr *header) -{ - return (header->e_ident[EI_MAG0] == ELFMAG0 - && header->e_ident[EI_MAG1] == ELFMAG1 - && header->e_ident[EI_MAG2] == ELFMAG2 - && header->e_ident[EI_MAG3] == ELFMAG3 - && header->e_ident[EI_CLASS] == ELFCLASS64); -} - -/* Return non-zero if FILE is a 64-bit ELF file, - zero if the file is not a 64-bit ELF file, - and -1 if the file is not accessible or doesn't exist. */ - -int -elf_64_file_p (const char *file) -{ - Elf64_Ehdr header; - int fd; - - fd = open (file, O_RDONLY); - if (fd < 0) - return -1; - - if (read (fd, &header, sizeof (header)) != sizeof (header)) - { - close (fd); - return 0; - } - close (fd); - - return elf_64_header_p (&header); -} - -static void -delete_lwp (struct lwp_info *lwp) -{ - remove_thread (get_lwp_thread (lwp)); - remove_inferior (&all_lwps, &lwp->head); - free (lwp->arch_private); - free (lwp); -} - -/* Add a process to the common process list, and set its private - data. */ - -static struct process_info * -linux_add_process (int pid, int attached) -{ - struct process_info *proc; - - /* Is this the first process? If so, then set the arch. */ - if (all_processes.head == NULL) - new_inferior = 1; - - proc = add_process (pid, attached); - proc->private = xcalloc (1, sizeof (*proc->private)); - - if (the_low_target.new_process != NULL) - proc->private->arch_private = the_low_target.new_process (); - - return proc; -} - -/* Wrapper function for waitpid which handles EINTR, and emulates - __WALL for systems where that is not available. */ - -static int -my_waitpid (int pid, int *status, int flags) -{ - int ret, out_errno; - - if (debug_threads) - fprintf (stderr, "my_waitpid (%d, 0x%x)\n", pid, flags); - - if (flags & __WALL) - { - sigset_t block_mask, org_mask, wake_mask; - int wnohang; - - wnohang = (flags & WNOHANG) != 0; - flags &= ~(__WALL | __WCLONE); - flags |= WNOHANG; - - /* Block all signals while here. This avoids knowing about - LinuxThread's signals. */ - sigfillset (&block_mask); - sigprocmask (SIG_BLOCK, &block_mask, &org_mask); - - /* ... except during the sigsuspend below. */ - sigemptyset (&wake_mask); - - while (1) - { - /* Since all signals are blocked, there's no need to check - for EINTR here. */ - ret = waitpid (pid, status, flags); - out_errno = errno; - - if (ret == -1 && out_errno != ECHILD) - break; - else if (ret > 0) - break; - - if (flags & __WCLONE) - { - /* We've tried both flavors now. If WNOHANG is set, - there's nothing else to do, just bail out. */ - if (wnohang) - break; - - if (debug_threads) - fprintf (stderr, "blocking\n"); - - /* Block waiting for signals. */ - sigsuspend (&wake_mask); - } - - flags ^= __WCLONE; - } - - sigprocmask (SIG_SETMASK, &org_mask, NULL); - } - else - { - do - ret = waitpid (pid, status, flags); - while (ret == -1 && errno == EINTR); - out_errno = errno; - } - - if (debug_threads) - fprintf (stderr, "my_waitpid (%d, 0x%x): status(%x), %d\n", - pid, flags, status ? *status : -1, ret); - - errno = out_errno; - return ret; -} - -/* Handle a GNU/Linux extended wait response. If we see a clone - event, we need to add the new LWP to our list (and not report the - trap to higher layers). */ - -static void -handle_extended_wait (struct lwp_info *event_child, int wstat) -{ - int event = wstat >> 16; - struct lwp_info *new_lwp; - - if (event == PTRACE_EVENT_CLONE) - { - ptid_t ptid; - unsigned long new_pid; - int ret, status = W_STOPCODE (SIGSTOP); - - ptrace (PTRACE_GETEVENTMSG, lwpid_of (event_child), 0, &new_pid); - - /* If we haven't already seen the new PID stop, wait for it now. */ - if (! pull_pid_from_list (&stopped_pids, new_pid)) - { - /* The new child has a pending SIGSTOP. We can't affect it until it - hits the SIGSTOP, but we're already attached. */ - - ret = my_waitpid (new_pid, &status, __WALL); - - if (ret == -1) - perror_with_name ("waiting for new child"); - else if (ret != new_pid) - warning ("wait returned unexpected PID %d", ret); - else if (!WIFSTOPPED (status)) - warning ("wait returned unexpected status 0x%x", status); - } - - linux_enable_event_reporting (new_pid); - - ptid = ptid_build (pid_of (event_child), new_pid, 0); - new_lwp = (struct lwp_info *) add_lwp (ptid); - add_thread (ptid, new_lwp); - - /* Either we're going to immediately resume the new thread - or leave it stopped. linux_resume_one_lwp is a nop if it - thinks the thread is currently running, so set this first - before calling linux_resume_one_lwp. */ - new_lwp->stopped = 1; - - /* Normally we will get the pending SIGSTOP. But in some cases - we might get another signal delivered to the group first. - If we do get another signal, be sure not to lose it. */ - if (WSTOPSIG (status) == SIGSTOP) - { - if (stopping_threads) - new_lwp->stop_pc = get_stop_pc (new_lwp); - else - linux_resume_one_lwp (new_lwp, 0, 0, NULL); - } - else - { - new_lwp->stop_expected = 1; - - if (stopping_threads) - { - new_lwp->stop_pc = get_stop_pc (new_lwp); - new_lwp->status_pending_p = 1; - new_lwp->status_pending = status; - } - else - /* Pass the signal on. This is what GDB does - except - shouldn't we really report it instead? */ - linux_resume_one_lwp (new_lwp, 0, WSTOPSIG (status), NULL); - } - - /* Always resume the current thread. If we are stopping - threads, it will have a pending SIGSTOP; we may as well - collect it now. */ - linux_resume_one_lwp (event_child, event_child->stepping, 0, NULL); - } -} - -/* Return the PC as read from the regcache of LWP, without any - adjustment. */ - -static CORE_ADDR -get_pc (struct lwp_info *lwp) -{ - struct thread_info *saved_inferior; - struct regcache *regcache; - CORE_ADDR pc; - - if (the_low_target.get_pc == NULL) - return 0; - - saved_inferior = current_inferior; - current_inferior = get_lwp_thread (lwp); - - regcache = get_thread_regcache (current_inferior, 1); - pc = (*the_low_target.get_pc) (regcache); - - if (debug_threads) - fprintf (stderr, "pc is 0x%lx\n", (long) pc); - - current_inferior = saved_inferior; - return pc; -} - -/* This function should only be called if LWP got a SIGTRAP. - The SIGTRAP could mean several things. - - On i386, where decr_pc_after_break is non-zero: - If we were single-stepping this process using PTRACE_SINGLESTEP, - we will get only the one SIGTRAP (even if the instruction we - stepped over was a breakpoint). The value of $eip will be the - next instruction. - If we continue the process using PTRACE_CONT, we will get a - SIGTRAP when we hit a breakpoint. The value of $eip will be - the instruction after the breakpoint (i.e. needs to be - decremented). If we report the SIGTRAP to GDB, we must also - report the undecremented PC. If we cancel the SIGTRAP, we - must resume at the decremented PC. - - (Presumably, not yet tested) On a non-decr_pc_after_break machine - with hardware or kernel single-step: - If we single-step over a breakpoint instruction, our PC will - point at the following instruction. If we continue and hit a - breakpoint instruction, our PC will point at the breakpoint - instruction. */ - -static CORE_ADDR -get_stop_pc (struct lwp_info *lwp) -{ - CORE_ADDR stop_pc; - - if (the_low_target.get_pc == NULL) - return 0; - - stop_pc = get_pc (lwp); - - if (WSTOPSIG (lwp->last_status) == SIGTRAP - && !lwp->stepping - && !lwp->stopped_by_watchpoint - && lwp->last_status >> 16 == 0) - stop_pc -= the_low_target.decr_pc_after_break; - - if (debug_threads) - fprintf (stderr, "stop pc is 0x%lx\n", (long) stop_pc); - - return stop_pc; -} - -static void * -add_lwp (ptid_t ptid) -{ - struct lwp_info *lwp; - - lwp = (struct lwp_info *) xmalloc (sizeof (*lwp)); - memset (lwp, 0, sizeof (*lwp)); - - lwp->head.id = ptid; - - if (the_low_target.new_thread != NULL) - lwp->arch_private = the_low_target.new_thread (); - - add_inferior_to_list (&all_lwps, &lwp->head); - - return lwp; -} - -/* Start an inferior process and returns its pid. - ALLARGS is a vector of program-name and args. */ - -static int -linux_create_inferior (char *program, char **allargs) -{ - struct lwp_info *new_lwp; - int pid; - ptid_t ptid; - -#if defined(__UCLIBC__) && defined(HAS_NOMMU) - pid = vfork (); -#else - pid = fork (); -#endif - if (pid < 0) - perror_with_name ("fork"); - - if (pid == 0) - { - ptrace (PTRACE_TRACEME, 0, 0, 0); - -#ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */ - signal (__SIGRTMIN + 1, SIG_DFL); -#endif - - setpgid (0, 0); - - execv (program, allargs); - if (errno == ENOENT) - execvp (program, allargs); - - fprintf (stderr, "Cannot exec %s: %s.\n", program, - strerror (errno)); - fflush (stderr); - _exit (0177); - } - - linux_add_process (pid, 0); - - ptid = ptid_build (pid, pid, 0); - new_lwp = add_lwp (ptid); - add_thread (ptid, new_lwp); - new_lwp->must_set_ptrace_flags = 1; - - return pid; -} - -/* Attach to an inferior process. */ - -static void -linux_attach_lwp_1 (unsigned long lwpid, int initial) -{ - ptid_t ptid; - struct lwp_info *new_lwp; - - if (ptrace (PTRACE_ATTACH, lwpid, 0, 0) != 0) - { - if (!initial) - { - /* If we fail to attach to an LWP, just warn. */ - fprintf (stderr, "Cannot attach to lwp %ld: %s (%d)\n", lwpid, - strerror (errno), errno); - fflush (stderr); - return; - } - else - /* If we fail to attach to a process, report an error. */ - error ("Cannot attach to lwp %ld: %s (%d)\n", lwpid, - strerror (errno), errno); - } - - if (initial) - /* If lwp is the tgid, we handle adding existing threads later. - Otherwise we just add lwp without bothering about any other - threads. */ - ptid = ptid_build (lwpid, lwpid, 0); - else - { - /* Note that extracting the pid from the current inferior is - safe, since we're always called in the context of the same - process as this new thread. */ - int pid = pid_of (get_thread_lwp (current_inferior)); - ptid = ptid_build (pid, lwpid, 0); - } - - new_lwp = (struct lwp_info *) add_lwp (ptid); - add_thread (ptid, new_lwp); - - /* We need to wait for SIGSTOP before being able to make the next - ptrace call on this LWP. */ - new_lwp->must_set_ptrace_flags = 1; - - /* The next time we wait for this LWP we'll see a SIGSTOP as PTRACE_ATTACH - brings it to a halt. - - There are several cases to consider here: - - 1) gdbserver has already attached to the process and is being notified - of a new thread that is being created. - In this case we should ignore that SIGSTOP and resume the - process. This is handled below by setting stop_expected = 1, - and the fact that add_thread sets last_resume_kind == - resume_continue. - - 2) This is the first thread (the process thread), and we're attaching - to it via attach_inferior. - In this case we want the process thread to stop. - This is handled by having linux_attach set last_resume_kind == - resume_stop after we return. - - If the pid we are attaching to is also the tgid, we attach to and - stop all the existing threads. Otherwise, we attach to pid and - ignore any other threads in the same group as this pid. - - 3) GDB is connecting to gdbserver and is requesting an enumeration of all - existing threads. - In this case we want the thread to stop. - FIXME: This case is currently not properly handled. - We should wait for the SIGSTOP but don't. Things work apparently - because enough time passes between when we ptrace (ATTACH) and when - gdb makes the next ptrace call on the thread. - - On the other hand, if we are currently trying to stop all threads, we - should treat the new thread as if we had sent it a SIGSTOP. This works - because we are guaranteed that the add_lwp call above added us to the - end of the list, and so the new thread has not yet reached - wait_for_sigstop (but will). */ - new_lwp->stop_expected = 1; -} - -void -linux_attach_lwp (unsigned long lwpid) -{ - linux_attach_lwp_1 (lwpid, 0); -} - -/* Attach to PID. If PID is the tgid, attach to it and all - of its threads. */ - -int -linux_attach (unsigned long pid) -{ - /* Attach to PID. We will check for other threads - soon. */ - linux_attach_lwp_1 (pid, 1); - linux_add_process (pid, 1); - - if (!non_stop) - { - struct thread_info *thread; - - /* Don't ignore the initial SIGSTOP if we just attached to this - process. It will be collected by wait shortly. */ - thread = find_thread_ptid (ptid_build (pid, pid, 0)); - thread->last_resume_kind = resume_stop; - } - - if (linux_proc_get_tgid (pid) == pid) - { - DIR *dir; - char pathname[128]; - - sprintf (pathname, "/proc/%ld/task", pid); - - dir = opendir (pathname); - - if (!dir) - { - fprintf (stderr, "Could not open /proc/%ld/task.\n", pid); - fflush (stderr); - } - else - { - /* At this point we attached to the tgid. Scan the task for - existing threads. */ - unsigned long lwp; - int new_threads_found; - int iterations = 0; - struct dirent *dp; - - while (iterations < 2) - { - new_threads_found = 0; - /* Add all the other threads. While we go through the - threads, new threads may be spawned. Cycle through - the list of threads until we have done two iterations without - finding new threads. */ - while ((dp = readdir (dir)) != NULL) - { - /* Fetch one lwp. */ - lwp = strtoul (dp->d_name, NULL, 10); - - /* Is this a new thread? */ - if (lwp - && find_thread_ptid (ptid_build (pid, lwp, 0)) == NULL) - { - linux_attach_lwp_1 (lwp, 0); - new_threads_found++; - - if (debug_threads) - fprintf (stderr, "\ -Found and attached to new lwp %ld\n", lwp); - } - } - - if (!new_threads_found) - iterations++; - else - iterations = 0; - - rewinddir (dir); - } - closedir (dir); - } - } - - return 0; -} - -struct counter -{ - int pid; - int count; -}; - -static int -second_thread_of_pid_p (struct inferior_list_entry *entry, void *args) -{ - struct counter *counter = args; - - if (ptid_get_pid (entry->id) == counter->pid) - { - if (++counter->count > 1) - return 1; - } - - return 0; -} - -static int -last_thread_of_process_p (struct thread_info *thread) -{ - ptid_t ptid = ((struct inferior_list_entry *)thread)->id; - int pid = ptid_get_pid (ptid); - struct counter counter = { pid , 0 }; - - return (find_inferior (&all_threads, - second_thread_of_pid_p, &counter) == NULL); -} - -/* Kill the inferior lwp. */ - -static int -linux_kill_one_lwp (struct inferior_list_entry *entry, void *args) -{ - struct thread_info *thread = (struct thread_info *) entry; - struct lwp_info *lwp = get_thread_lwp (thread); - int wstat; - int pid = * (int *) args; - - if (ptid_get_pid (entry->id) != pid) - return 0; - - /* We avoid killing the first thread here, because of a Linux kernel (at - least 2.6.0-test7 through 2.6.8-rc4) bug; if we kill the parent before - the children get a chance to be reaped, it will remain a zombie - forever. */ - - if (lwpid_of (lwp) == pid) - { - if (debug_threads) - fprintf (stderr, "lkop: is last of process %s\n", - target_pid_to_str (entry->id)); - return 0; - } - - do - { - ptrace (PTRACE_KILL, lwpid_of (lwp), 0, 0); - - /* Make sure it died. The loop is most likely unnecessary. */ - pid = linux_wait_for_event (lwp->head.id, &wstat, __WALL); - } while (pid > 0 && WIFSTOPPED (wstat)); - - return 0; -} - -static int -linux_kill (int pid) -{ - struct process_info *process; - struct lwp_info *lwp; - int wstat; - int lwpid; - - process = find_process_pid (pid); - if (process == NULL) - return -1; - - /* If we're killing a running inferior, make sure it is stopped - first, as PTRACE_KILL will not work otherwise. */ - stop_all_lwps (0, NULL); - - find_inferior (&all_threads, linux_kill_one_lwp, &pid); - - /* See the comment in linux_kill_one_lwp. We did not kill the first - thread in the list, so do so now. */ - lwp = find_lwp_pid (pid_to_ptid (pid)); - - if (debug_threads) - fprintf (stderr, "lk_1: killing lwp %ld, for pid: %d\n", - lwpid_of (lwp), pid); - - do - { - ptrace (PTRACE_KILL, lwpid_of (lwp), 0, 0); - - /* Make sure it died. The loop is most likely unnecessary. */ - lwpid = linux_wait_for_event (lwp->head.id, &wstat, __WALL); - } while (lwpid > 0 && WIFSTOPPED (wstat)); - - the_target->mourn (process); - - /* Since we presently can only stop all lwps of all processes, we - need to unstop lwps of other processes. */ - unstop_all_lwps (0, NULL); - return 0; -} - -static int -linux_detach_one_lwp (struct inferior_list_entry *entry, void *args) -{ - struct thread_info *thread = (struct thread_info *) entry; - struct lwp_info *lwp = get_thread_lwp (thread); - int pid = * (int *) args; - - if (ptid_get_pid (entry->id) != pid) - return 0; - - /* If this process is stopped but is expecting a SIGSTOP, then make - sure we take care of that now. This isn't absolutely guaranteed - to collect the SIGSTOP, but is fairly likely to. */ - if (lwp->stop_expected) - { - int wstat; - /* Clear stop_expected, so that the SIGSTOP will be reported. */ - lwp->stop_expected = 0; - linux_resume_one_lwp (lwp, 0, 0, NULL); - linux_wait_for_event (lwp->head.id, &wstat, __WALL); - } - - /* Flush any pending changes to the process's registers. */ - regcache_invalidate_one ((struct inferior_list_entry *) - get_lwp_thread (lwp)); - - /* Finally, let it resume. */ - ptrace (PTRACE_DETACH, lwpid_of (lwp), 0, 0); - - delete_lwp (lwp); - return 0; -} - -static int -linux_detach (int pid) -{ - struct process_info *process; - - process = find_process_pid (pid); - if (process == NULL) - return -1; - - /* Stop all threads before detaching. First, ptrace requires that - the thread is stopped to sucessfully detach. Second, thread_db - may need to uninstall thread event breakpoints from memory, which - only works with a stopped process anyway. */ - stop_all_lwps (0, NULL); - -#ifdef USE_THREAD_DB - thread_db_detach (process); -#endif - - /* Stabilize threads (move out of jump pads). */ - stabilize_threads (); - - find_inferior (&all_threads, linux_detach_one_lwp, &pid); - - the_target->mourn (process); - - /* Since we presently can only stop all lwps of all processes, we - need to unstop lwps of other processes. */ - unstop_all_lwps (0, NULL); - return 0; -} - -/* Remove all LWPs that belong to process PROC from the lwp list. */ - -static int -delete_lwp_callback (struct inferior_list_entry *entry, void *proc) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - struct process_info *process = proc; - - if (pid_of (lwp) == pid_of (process)) - delete_lwp (lwp); - - return 0; -} - -static void -linux_mourn (struct process_info *process) -{ - struct process_info_private *priv; - -#ifdef USE_THREAD_DB - thread_db_mourn (process); -#endif - - find_inferior (&all_lwps, delete_lwp_callback, process); - - /* Freeing all private data. */ - priv = process->private; - free (priv->arch_private); - free (priv); - process->private = NULL; - - remove_process (process); -} - -static void -linux_join (int pid) -{ - int status, ret; - - do { - ret = my_waitpid (pid, &status, 0); - if (WIFEXITED (status) || WIFSIGNALED (status)) - break; - } while (ret != -1 || errno != ECHILD); -} - -/* Return nonzero if the given thread is still alive. */ -static int -linux_thread_alive (ptid_t ptid) -{ - struct lwp_info *lwp = find_lwp_pid (ptid); - - /* We assume we always know if a thread exits. If a whole process - exited but we still haven't been able to report it to GDB, we'll - hold on to the last lwp of the dead process. */ - if (lwp != NULL) - return !lwp->dead; - else - return 0; -} - -/* Return 1 if this lwp has an interesting status pending. */ -static int -status_pending_p_callback (struct inferior_list_entry *entry, void *arg) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - ptid_t ptid = * (ptid_t *) arg; - struct thread_info *thread; - - /* Check if we're only interested in events from a specific process - or its lwps. */ - if (!ptid_equal (minus_one_ptid, ptid) - && ptid_get_pid (ptid) != ptid_get_pid (lwp->head.id)) - return 0; - - thread = get_lwp_thread (lwp); - - /* If we got a `vCont;t', but we haven't reported a stop yet, do - report any status pending the LWP may have. */ - if (thread->last_resume_kind == resume_stop - && thread->last_status.kind != TARGET_WAITKIND_IGNORE) - return 0; - - return lwp->status_pending_p; -} - -static int -same_lwp (struct inferior_list_entry *entry, void *data) -{ - ptid_t ptid = *(ptid_t *) data; - int lwp; - - if (ptid_get_lwp (ptid) != 0) - lwp = ptid_get_lwp (ptid); - else - lwp = ptid_get_pid (ptid); - - if (ptid_get_lwp (entry->id) == lwp) - return 1; - - return 0; -} - -struct lwp_info * -find_lwp_pid (ptid_t ptid) -{ - return (struct lwp_info*) find_inferior (&all_lwps, same_lwp, &ptid); -} - -static struct lwp_info * -linux_wait_for_lwp (ptid_t ptid, int *wstatp, int options) -{ - int ret; - int to_wait_for = -1; - struct lwp_info *child = NULL; - - if (debug_threads) - fprintf (stderr, "linux_wait_for_lwp: %s\n", target_pid_to_str (ptid)); - - if (ptid_equal (ptid, minus_one_ptid)) - to_wait_for = -1; /* any child */ - else - to_wait_for = ptid_get_lwp (ptid); /* this lwp only */ - - options |= __WALL; - -retry: - - ret = my_waitpid (to_wait_for, wstatp, options); - if (ret == 0 || (ret == -1 && errno == ECHILD && (options & WNOHANG))) - return NULL; - else if (ret == -1) - perror_with_name ("waitpid"); - - if (debug_threads - && (!WIFSTOPPED (*wstatp) - || (WSTOPSIG (*wstatp) != 32 - && WSTOPSIG (*wstatp) != 33))) - fprintf (stderr, "Got an event from %d (%x)\n", ret, *wstatp); - - child = find_lwp_pid (pid_to_ptid (ret)); - - /* If we didn't find a process, one of two things presumably happened: - - A process we started and then detached from has exited. Ignore it. - - A process we are controlling has forked and the new child's stop - was reported to us by the kernel. Save its PID. */ - if (child == NULL && WIFSTOPPED (*wstatp)) - { - add_pid_to_list (&stopped_pids, ret); - goto retry; - } - else if (child == NULL) - goto retry; - - child->stopped = 1; - - child->last_status = *wstatp; - - /* Architecture-specific setup after inferior is running. - This needs to happen after we have attached to the inferior - and it is stopped for the first time, but before we access - any inferior registers. */ - if (new_inferior) - { - the_low_target.arch_setup (); -#ifdef HAVE_LINUX_REGSETS - memset (disabled_regsets, 0, num_regsets); -#endif - new_inferior = 0; - } - - /* Fetch the possibly triggered data watchpoint info and store it in - CHILD. - - On some archs, like x86, that use debug registers to set - watchpoints, it's possible that the way to know which watched - address trapped, is to check the register that is used to select - which address to watch. Problem is, between setting the - watchpoint and reading back which data address trapped, the user - may change the set of watchpoints, and, as a consequence, GDB - changes the debug registers in the inferior. To avoid reading - back a stale stopped-data-address when that happens, we cache in - LP the fact that a watchpoint trapped, and the corresponding data - address, as soon as we see CHILD stop with a SIGTRAP. If GDB - changes the debug registers meanwhile, we have the cached data we - can rely on. */ - - if (WIFSTOPPED (*wstatp) && WSTOPSIG (*wstatp) == SIGTRAP) - { - if (the_low_target.stopped_by_watchpoint == NULL) - { - child->stopped_by_watchpoint = 0; - } - else - { - struct thread_info *saved_inferior; - - saved_inferior = current_inferior; - current_inferior = get_lwp_thread (child); - - child->stopped_by_watchpoint - = the_low_target.stopped_by_watchpoint (); - - if (child->stopped_by_watchpoint) - { - if (the_low_target.stopped_data_address != NULL) - child->stopped_data_address - = the_low_target.stopped_data_address (); - else - child->stopped_data_address = 0; - } - - current_inferior = saved_inferior; - } - } - - /* Store the STOP_PC, with adjustment applied. This depends on the - architecture being defined already (so that CHILD has a valid - regcache), and on LAST_STATUS being set (to check for SIGTRAP or - not). */ - if (WIFSTOPPED (*wstatp)) - child->stop_pc = get_stop_pc (child); - - if (debug_threads - && WIFSTOPPED (*wstatp) - && the_low_target.get_pc != NULL) - { - struct thread_info *saved_inferior = current_inferior; - struct regcache *regcache; - CORE_ADDR pc; - - current_inferior = get_lwp_thread (child); - regcache = get_thread_regcache (current_inferior, 1); - pc = (*the_low_target.get_pc) (regcache); - fprintf (stderr, "linux_wait_for_lwp: pc is 0x%lx\n", (long) pc); - current_inferior = saved_inferior; - } - - return child; -} - -/* This function should only be called if the LWP got a SIGTRAP. - - Handle any tracepoint steps or hits. Return true if a tracepoint - event was handled, 0 otherwise. */ - -static int -handle_tracepoints (struct lwp_info *lwp) -{ - struct thread_info *tinfo = get_lwp_thread (lwp); - int tpoint_related_event = 0; - - /* If this tracepoint hit causes a tracing stop, we'll immediately - uninsert tracepoints. To do this, we temporarily pause all - threads, unpatch away, and then unpause threads. We need to make - sure the unpausing doesn't resume LWP too. */ - lwp->suspended++; - - /* And we need to be sure that any all-threads-stopping doesn't try - to move threads out of the jump pads, as it could deadlock the - inferior (LWP could be in the jump pad, maybe even holding the - lock.) */ - - /* Do any necessary step collect actions. */ - tpoint_related_event |= tracepoint_finished_step (tinfo, lwp->stop_pc); - - tpoint_related_event |= handle_tracepoint_bkpts (tinfo, lwp->stop_pc); - - /* See if we just hit a tracepoint and do its main collect - actions. */ - tpoint_related_event |= tracepoint_was_hit (tinfo, lwp->stop_pc); - - lwp->suspended--; - - gdb_assert (lwp->suspended == 0); - gdb_assert (!stabilizing_threads || lwp->collecting_fast_tracepoint); - - if (tpoint_related_event) - { - if (debug_threads) - fprintf (stderr, "got a tracepoint event\n"); - return 1; - } - - return 0; -} - -/* Convenience wrapper. Returns true if LWP is presently collecting a - fast tracepoint. */ - -static int -linux_fast_tracepoint_collecting (struct lwp_info *lwp, - struct fast_tpoint_collect_status *status) -{ - CORE_ADDR thread_area; - - if (the_low_target.get_thread_area == NULL) - return 0; - - /* Get the thread area address. This is used to recognize which - thread is which when tracing with the in-process agent library. - We don't read anything from the address, and treat it as opaque; - it's the address itself that we assume is unique per-thread. */ - if ((*the_low_target.get_thread_area) (lwpid_of (lwp), &thread_area) == -1) - return 0; - - return fast_tracepoint_collecting (thread_area, lwp->stop_pc, status); -} - -/* The reason we resume in the caller, is because we want to be able - to pass lwp->status_pending as WSTAT, and we need to clear - status_pending_p before resuming, otherwise, linux_resume_one_lwp - refuses to resume. */ - -static int -maybe_move_out_of_jump_pad (struct lwp_info *lwp, int *wstat) -{ - struct thread_info *saved_inferior; - - saved_inferior = current_inferior; - current_inferior = get_lwp_thread (lwp); - - if ((wstat == NULL - || (WIFSTOPPED (*wstat) && WSTOPSIG (*wstat) != SIGTRAP)) - && supports_fast_tracepoints () - && in_process_agent_loaded ()) - { - struct fast_tpoint_collect_status status; - int r; - - if (debug_threads) - fprintf (stderr, "\ -Checking whether LWP %ld needs to move out of the jump pad.\n", - lwpid_of (lwp)); - - r = linux_fast_tracepoint_collecting (lwp, &status); - - if (wstat == NULL - || (WSTOPSIG (*wstat) != SIGILL - && WSTOPSIG (*wstat) != SIGFPE - && WSTOPSIG (*wstat) != SIGSEGV - && WSTOPSIG (*wstat) != SIGBUS)) - { - lwp->collecting_fast_tracepoint = r; - - if (r != 0) - { - if (r == 1 && lwp->exit_jump_pad_bkpt == NULL) - { - /* Haven't executed the original instruction yet. - Set breakpoint there, and wait till it's hit, - then single-step until exiting the jump pad. */ - lwp->exit_jump_pad_bkpt - = set_breakpoint_at (status.adjusted_insn_addr, NULL); - } - - if (debug_threads) - fprintf (stderr, "\ -Checking whether LWP %ld needs to move out of the jump pad...it does\n", - lwpid_of (lwp)); - current_inferior = saved_inferior; - - return 1; - } - } - else - { - /* If we get a synchronous signal while collecting, *and* - while executing the (relocated) original instruction, - reset the PC to point at the tpoint address, before - reporting to GDB. Otherwise, it's an IPA lib bug: just - report the signal to GDB, and pray for the best. */ - - lwp->collecting_fast_tracepoint = 0; - - if (r != 0 - && (status.adjusted_insn_addr <= lwp->stop_pc - && lwp->stop_pc < status.adjusted_insn_addr_end)) - { - siginfo_t info; - struct regcache *regcache; - - /* The si_addr on a few signals references the address - of the faulting instruction. Adjust that as - well. */ - if ((WSTOPSIG (*wstat) == SIGILL - || WSTOPSIG (*wstat) == SIGFPE - || WSTOPSIG (*wstat) == SIGBUS - || WSTOPSIG (*wstat) == SIGSEGV) - && ptrace (PTRACE_GETSIGINFO, lwpid_of (lwp), 0, &info) == 0 - /* Final check just to make sure we don't clobber - the siginfo of non-kernel-sent signals. */ - && (uintptr_t) info.si_addr == lwp->stop_pc) - { - info.si_addr = (void *) (uintptr_t) status.tpoint_addr; - ptrace (PTRACE_SETSIGINFO, lwpid_of (lwp), 0, &info); - } - - regcache = get_thread_regcache (get_lwp_thread (lwp), 1); - (*the_low_target.set_pc) (regcache, status.tpoint_addr); - lwp->stop_pc = status.tpoint_addr; - - /* Cancel any fast tracepoint lock this thread was - holding. */ - force_unlock_trace_buffer (); - } - - if (lwp->exit_jump_pad_bkpt != NULL) - { - if (debug_threads) - fprintf (stderr, - "Cancelling fast exit-jump-pad: removing bkpt. " - "stopping all threads momentarily.\n"); - - stop_all_lwps (1, lwp); - cancel_breakpoints (); - - delete_breakpoint (lwp->exit_jump_pad_bkpt); - lwp->exit_jump_pad_bkpt = NULL; - - unstop_all_lwps (1, lwp); - - gdb_assert (lwp->suspended >= 0); - } - } - } - - if (debug_threads) - fprintf (stderr, "\ -Checking whether LWP %ld needs to move out of the jump pad...no\n", - lwpid_of (lwp)); - - current_inferior = saved_inferior; - return 0; -} - -/* Enqueue one signal in the "signals to report later when out of the - jump pad" list. */ - -static void -enqueue_one_deferred_signal (struct lwp_info *lwp, int *wstat) -{ - struct pending_signals *p_sig; - - if (debug_threads) - fprintf (stderr, "\ -Deferring signal %d for LWP %ld.\n", WSTOPSIG (*wstat), lwpid_of (lwp)); - - if (debug_threads) - { - struct pending_signals *sig; - - for (sig = lwp->pending_signals_to_report; - sig != NULL; - sig = sig->prev) - fprintf (stderr, - " Already queued %d\n", - sig->signal); - - fprintf (stderr, " (no more currently queued signals)\n"); - } - - /* Don't enqueue non-RT signals if they are already in the deferred - queue. (SIGSTOP being the easiest signal to see ending up here - twice) */ - if (WSTOPSIG (*wstat) < __SIGRTMIN) - { - struct pending_signals *sig; - - for (sig = lwp->pending_signals_to_report; - sig != NULL; - sig = sig->prev) - { - if (sig->signal == WSTOPSIG (*wstat)) - { - if (debug_threads) - fprintf (stderr, - "Not requeuing already queued non-RT signal %d" - " for LWP %ld\n", - sig->signal, - lwpid_of (lwp)); - return; - } - } - } - - p_sig = xmalloc (sizeof (*p_sig)); - p_sig->prev = lwp->pending_signals_to_report; - p_sig->signal = WSTOPSIG (*wstat); - memset (&p_sig->info, 0, sizeof (siginfo_t)); - ptrace (PTRACE_GETSIGINFO, lwpid_of (lwp), 0, &p_sig->info); - - lwp->pending_signals_to_report = p_sig; -} - -/* Dequeue one signal from the "signals to report later when out of - the jump pad" list. */ - -static int -dequeue_one_deferred_signal (struct lwp_info *lwp, int *wstat) -{ - if (lwp->pending_signals_to_report != NULL) - { - struct pending_signals **p_sig; - - p_sig = &lwp->pending_signals_to_report; - while ((*p_sig)->prev != NULL) - p_sig = &(*p_sig)->prev; - - *wstat = W_STOPCODE ((*p_sig)->signal); - if ((*p_sig)->info.si_signo != 0) - ptrace (PTRACE_SETSIGINFO, lwpid_of (lwp), 0, &(*p_sig)->info); - free (*p_sig); - *p_sig = NULL; - - if (debug_threads) - fprintf (stderr, "Reporting deferred signal %d for LWP %ld.\n", - WSTOPSIG (*wstat), lwpid_of (lwp)); - - if (debug_threads) - { - struct pending_signals *sig; - - for (sig = lwp->pending_signals_to_report; - sig != NULL; - sig = sig->prev) - fprintf (stderr, - " Still queued %d\n", - sig->signal); - - fprintf (stderr, " (no more queued signals)\n"); - } - - return 1; - } - - return 0; -} - -/* Arrange for a breakpoint to be hit again later. We don't keep the - SIGTRAP status and don't forward the SIGTRAP signal to the LWP. We - will handle the current event, eventually we will resume this LWP, - and this breakpoint will trap again. */ - -static int -cancel_breakpoint (struct lwp_info *lwp) -{ - struct thread_info *saved_inferior; - - /* There's nothing to do if we don't support breakpoints. */ - if (!supports_breakpoints ()) - return 0; - - /* breakpoint_at reads from current inferior. */ - saved_inferior = current_inferior; - current_inferior = get_lwp_thread (lwp); - - if ((*the_low_target.breakpoint_at) (lwp->stop_pc)) - { - if (debug_threads) - fprintf (stderr, - "CB: Push back breakpoint for %s\n", - target_pid_to_str (ptid_of (lwp))); - - /* Back up the PC if necessary. */ - if (the_low_target.decr_pc_after_break) - { - struct regcache *regcache - = get_thread_regcache (current_inferior, 1); - (*the_low_target.set_pc) (regcache, lwp->stop_pc); - } - - current_inferior = saved_inferior; - return 1; - } - else - { - if (debug_threads) - fprintf (stderr, - "CB: No breakpoint found at %s for [%s]\n", - paddress (lwp->stop_pc), - target_pid_to_str (ptid_of (lwp))); - } - - current_inferior = saved_inferior; - return 0; -} - -/* When the event-loop is doing a step-over, this points at the thread - being stepped. */ -ptid_t step_over_bkpt; - -/* Wait for an event from child PID. If PID is -1, wait for any - child. Store the stop status through the status pointer WSTAT. - OPTIONS is passed to the waitpid call. Return 0 if no child stop - event was found and OPTIONS contains WNOHANG. Return the PID of - the stopped child otherwise. */ - -static int -linux_wait_for_event_1 (ptid_t ptid, int *wstat, int options) -{ - struct lwp_info *event_child, *requested_child; - - event_child = NULL; - requested_child = NULL; - - /* Check for a lwp with a pending status. */ - - if (ptid_equal (ptid, minus_one_ptid) - || ptid_equal (pid_to_ptid (ptid_get_pid (ptid)), ptid)) - { - event_child = (struct lwp_info *) - find_inferior (&all_lwps, status_pending_p_callback, &ptid); - if (debug_threads && event_child) - fprintf (stderr, "Got a pending child %ld\n", lwpid_of (event_child)); - } - else - { - requested_child = find_lwp_pid (ptid); - - if (!stopping_threads - && requested_child->status_pending_p - && requested_child->collecting_fast_tracepoint) - { - enqueue_one_deferred_signal (requested_child, - &requested_child->status_pending); - requested_child->status_pending_p = 0; - requested_child->status_pending = 0; - linux_resume_one_lwp (requested_child, 0, 0, NULL); - } - - if (requested_child->suspended - && requested_child->status_pending_p) - fatal ("requesting an event out of a suspended child?"); - - if (requested_child->status_pending_p) - event_child = requested_child; - } - - if (event_child != NULL) - { - if (debug_threads) - fprintf (stderr, "Got an event from pending child %ld (%04x)\n", - lwpid_of (event_child), event_child->status_pending); - *wstat = event_child->status_pending; - event_child->status_pending_p = 0; - event_child->status_pending = 0; - current_inferior = get_lwp_thread (event_child); - return lwpid_of (event_child); - } - - /* We only enter this loop if no process has a pending wait status. Thus - any action taken in response to a wait status inside this loop is - responding as soon as we detect the status, not after any pending - events. */ - while (1) - { - event_child = linux_wait_for_lwp (ptid, wstat, options); - - if ((options & WNOHANG) && event_child == NULL) - { - if (debug_threads) - fprintf (stderr, "WNOHANG set, no event found\n"); - return 0; - } - - if (event_child == NULL) - error ("event from unknown child"); - - current_inferior = get_lwp_thread (event_child); - - /* Check for thread exit. */ - if (! WIFSTOPPED (*wstat)) - { - if (debug_threads) - fprintf (stderr, "LWP %ld exiting\n", lwpid_of (event_child)); - - /* If the last thread is exiting, just return. */ - if (last_thread_of_process_p (current_inferior)) - { - if (debug_threads) - fprintf (stderr, "LWP %ld is last lwp of process\n", - lwpid_of (event_child)); - return lwpid_of (event_child); - } - - if (!non_stop) - { - current_inferior = (struct thread_info *) all_threads.head; - if (debug_threads) - fprintf (stderr, "Current inferior is now %ld\n", - lwpid_of (get_thread_lwp (current_inferior))); - } - else - { - current_inferior = NULL; - if (debug_threads) - fprintf (stderr, "Current inferior is now <NULL>\n"); - } - - /* If we were waiting for this particular child to do something... - well, it did something. */ - if (requested_child != NULL) - { - int lwpid = lwpid_of (event_child); - - /* Cancel the step-over operation --- the thread that - started it is gone. */ - if (finish_step_over (event_child)) - unstop_all_lwps (1, event_child); - delete_lwp (event_child); - return lwpid; - } - - delete_lwp (event_child); - - /* Wait for a more interesting event. */ - continue; - } - - if (event_child->must_set_ptrace_flags) - { - linux_enable_event_reporting (lwpid_of (event_child)); - event_child->must_set_ptrace_flags = 0; - } - - if (WIFSTOPPED (*wstat) && WSTOPSIG (*wstat) == SIGTRAP - && *wstat >> 16 != 0) - { - handle_extended_wait (event_child, *wstat); - continue; - } - - if (WIFSTOPPED (*wstat) - && WSTOPSIG (*wstat) == SIGSTOP - && event_child->stop_expected) - { - int should_stop; - - if (debug_threads) - fprintf (stderr, "Expected stop.\n"); - event_child->stop_expected = 0; - - should_stop = (current_inferior->last_resume_kind == resume_stop - || stopping_threads); - - if (!should_stop) - { - linux_resume_one_lwp (event_child, - event_child->stepping, 0, NULL); - continue; - } - } - - return lwpid_of (event_child); - } - - /* NOTREACHED */ - return 0; -} - -static int -linux_wait_for_event (ptid_t ptid, int *wstat, int options) -{ - ptid_t wait_ptid; - - if (ptid_is_pid (ptid)) - { - /* A request to wait for a specific tgid. This is not possible - with waitpid, so instead, we wait for any child, and leave - children we're not interested in right now with a pending - status to report later. */ - wait_ptid = minus_one_ptid; - } - else - wait_ptid = ptid; - - while (1) - { - int event_pid; - - event_pid = linux_wait_for_event_1 (wait_ptid, wstat, options); - - if (event_pid > 0 - && ptid_is_pid (ptid) && ptid_get_pid (ptid) != event_pid) - { - struct lwp_info *event_child - = find_lwp_pid (pid_to_ptid (event_pid)); - - if (! WIFSTOPPED (*wstat)) - mark_lwp_dead (event_child, *wstat); - else - { - event_child->status_pending_p = 1; - event_child->status_pending = *wstat; - } - } - else - return event_pid; - } -} - - -/* Count the LWP's that have had events. */ - -static int -count_events_callback (struct inferior_list_entry *entry, void *data) -{ - struct lwp_info *lp = (struct lwp_info *) entry; - struct thread_info *thread = get_lwp_thread (lp); - int *count = data; - - gdb_assert (count != NULL); - - /* Count only resumed LWPs that have a SIGTRAP event pending that - should be reported to GDB. */ - if (thread->last_status.kind == TARGET_WAITKIND_IGNORE - && thread->last_resume_kind != resume_stop - && lp->status_pending_p - && WIFSTOPPED (lp->status_pending) - && WSTOPSIG (lp->status_pending) == SIGTRAP - && !breakpoint_inserted_here (lp->stop_pc)) - (*count)++; - - return 0; -} - -/* Select the LWP (if any) that is currently being single-stepped. */ - -static int -select_singlestep_lwp_callback (struct inferior_list_entry *entry, void *data) -{ - struct lwp_info *lp = (struct lwp_info *) entry; - struct thread_info *thread = get_lwp_thread (lp); - - if (thread->last_status.kind == TARGET_WAITKIND_IGNORE - && thread->last_resume_kind == resume_step - && lp->status_pending_p) - return 1; - else - return 0; -} - -/* Select the Nth LWP that has had a SIGTRAP event that should be - reported to GDB. */ - -static int -select_event_lwp_callback (struct inferior_list_entry *entry, void *data) -{ - struct lwp_info *lp = (struct lwp_info *) entry; - struct thread_info *thread = get_lwp_thread (lp); - int *selector = data; - - gdb_assert (selector != NULL); - - /* Select only resumed LWPs that have a SIGTRAP event pending. */ - if (thread->last_resume_kind != resume_stop - && thread->last_status.kind == TARGET_WAITKIND_IGNORE - && lp->status_pending_p - && WIFSTOPPED (lp->status_pending) - && WSTOPSIG (lp->status_pending) == SIGTRAP - && !breakpoint_inserted_here (lp->stop_pc)) - if ((*selector)-- == 0) - return 1; - - return 0; -} - -static int -cancel_breakpoints_callback (struct inferior_list_entry *entry, void *data) -{ - struct lwp_info *lp = (struct lwp_info *) entry; - struct thread_info *thread = get_lwp_thread (lp); - struct lwp_info *event_lp = data; - - /* Leave the LWP that has been elected to receive a SIGTRAP alone. */ - if (lp == event_lp) - return 0; - - /* If a LWP other than the LWP that we're reporting an event for has - hit a GDB breakpoint (as opposed to some random trap signal), - then just arrange for it to hit it again later. We don't keep - the SIGTRAP status and don't forward the SIGTRAP signal to the - LWP. We will handle the current event, eventually we will resume - all LWPs, and this one will get its breakpoint trap again. - - If we do not do this, then we run the risk that the user will - delete or disable the breakpoint, but the LWP will have already - tripped on it. */ - - if (thread->last_resume_kind != resume_stop - && thread->last_status.kind == TARGET_WAITKIND_IGNORE - && lp->status_pending_p - && WIFSTOPPED (lp->status_pending) - && WSTOPSIG (lp->status_pending) == SIGTRAP - && !lp->stepping - && !lp->stopped_by_watchpoint - && cancel_breakpoint (lp)) - /* Throw away the SIGTRAP. */ - lp->status_pending_p = 0; - - return 0; -} - -static void -linux_cancel_breakpoints (void) -{ - find_inferior (&all_lwps, cancel_breakpoints_callback, NULL); -} - -/* Select one LWP out of those that have events pending. */ - -static void -select_event_lwp (struct lwp_info **orig_lp) -{ - int num_events = 0; - int random_selector; - struct lwp_info *event_lp; - - /* Give preference to any LWP that is being single-stepped. */ - event_lp - = (struct lwp_info *) find_inferior (&all_lwps, - select_singlestep_lwp_callback, NULL); - if (event_lp != NULL) - { - if (debug_threads) - fprintf (stderr, - "SEL: Select single-step %s\n", - target_pid_to_str (ptid_of (event_lp))); - } - else - { - /* No single-stepping LWP. Select one at random, out of those - which have had SIGTRAP events. */ - - /* First see how many SIGTRAP events we have. */ - find_inferior (&all_lwps, count_events_callback, &num_events); - - /* Now randomly pick a LWP out of those that have had a SIGTRAP. */ - random_selector = (int) - ((num_events * (double) rand ()) / (RAND_MAX + 1.0)); - - if (debug_threads && num_events > 1) - fprintf (stderr, - "SEL: Found %d SIGTRAP events, selecting #%d\n", - num_events, random_selector); - - event_lp = (struct lwp_info *) find_inferior (&all_lwps, - select_event_lwp_callback, - &random_selector); - } - - if (event_lp != NULL) - { - /* Switch the event LWP. */ - *orig_lp = event_lp; - } -} - -/* Decrement the suspend count of an LWP. */ - -static int -unsuspend_one_lwp (struct inferior_list_entry *entry, void *except) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - - /* Ignore EXCEPT. */ - if (lwp == except) - return 0; - - lwp->suspended--; - - gdb_assert (lwp->suspended >= 0); - return 0; -} - -/* Decrement the suspend count of all LWPs, except EXCEPT, if non - NULL. */ - -static void -unsuspend_all_lwps (struct lwp_info *except) -{ - find_inferior (&all_lwps, unsuspend_one_lwp, except); -} - -static void move_out_of_jump_pad_callback (struct inferior_list_entry *entry); -static int stuck_in_jump_pad_callback (struct inferior_list_entry *entry, - void *data); -static int lwp_running (struct inferior_list_entry *entry, void *data); -static ptid_t linux_wait_1 (ptid_t ptid, - struct target_waitstatus *ourstatus, - int target_options); - -/* Stabilize threads (move out of jump pads). - - If a thread is midway collecting a fast tracepoint, we need to - finish the collection and move it out of the jump pad before - reporting the signal. - - This avoids recursion while collecting (when a signal arrives - midway, and the signal handler itself collects), which would trash - the trace buffer. In case the user set a breakpoint in a signal - handler, this avoids the backtrace showing the jump pad, etc.. - Most importantly, there are certain things we can't do safely if - threads are stopped in a jump pad (or in its callee's). For - example: - - - starting a new trace run. A thread still collecting the - previous run, could trash the trace buffer when resumed. The trace - buffer control structures would have been reset but the thread had - no way to tell. The thread could even midway memcpy'ing to the - buffer, which would mean that when resumed, it would clobber the - trace buffer that had been set for a new run. - - - we can't rewrite/reuse the jump pads for new tracepoints - safely. Say you do tstart while a thread is stopped midway while - collecting. When the thread is later resumed, it finishes the - collection, and returns to the jump pad, to execute the original - instruction that was under the tracepoint jump at the time the - older run had been started. If the jump pad had been rewritten - since for something else in the new run, the thread would now - execute the wrong / random instructions. */ - -static void -linux_stabilize_threads (void) -{ - struct thread_info *save_inferior; - struct lwp_info *lwp_stuck; - - lwp_stuck - = (struct lwp_info *) find_inferior (&all_lwps, - stuck_in_jump_pad_callback, NULL); - if (lwp_stuck != NULL) - { - if (debug_threads) - fprintf (stderr, "can't stabilize, LWP %ld is stuck in jump pad\n", - lwpid_of (lwp_stuck)); - return; - } - - save_inferior = current_inferior; - - stabilizing_threads = 1; - - /* Kick 'em all. */ - for_each_inferior (&all_lwps, move_out_of_jump_pad_callback); - - /* Loop until all are stopped out of the jump pads. */ - while (find_inferior (&all_lwps, lwp_running, NULL) != NULL) - { - struct target_waitstatus ourstatus; - struct lwp_info *lwp; - int wstat; - - /* Note that we go through the full wait even loop. While - moving threads out of jump pad, we need to be able to step - over internal breakpoints and such. */ - linux_wait_1 (minus_one_ptid, &ourstatus, 0); - - if (ourstatus.kind == TARGET_WAITKIND_STOPPED) - { - lwp = get_thread_lwp (current_inferior); - - /* Lock it. */ - lwp->suspended++; - - if (ourstatus.value.sig != TARGET_SIGNAL_0 - || current_inferior->last_resume_kind == resume_stop) - { - wstat = W_STOPCODE (target_signal_to_host (ourstatus.value.sig)); - enqueue_one_deferred_signal (lwp, &wstat); - } - } - } - - find_inferior (&all_lwps, unsuspend_one_lwp, NULL); - - stabilizing_threads = 0; - - current_inferior = save_inferior; - - if (debug_threads) - { - lwp_stuck - = (struct lwp_info *) find_inferior (&all_lwps, - stuck_in_jump_pad_callback, NULL); - if (lwp_stuck != NULL) - fprintf (stderr, "couldn't stabilize, LWP %ld got stuck in jump pad\n", - lwpid_of (lwp_stuck)); - } -} - -/* Wait for process, returns status. */ - -static ptid_t -linux_wait_1 (ptid_t ptid, - struct target_waitstatus *ourstatus, int target_options) -{ - int w; - struct lwp_info *event_child; - int options; - int pid; - int step_over_finished; - int bp_explains_trap; - int maybe_internal_trap; - int report_to_gdb; - int trace_event; - - /* Translate generic target options into linux options. */ - options = __WALL; - if (target_options & TARGET_WNOHANG) - options |= WNOHANG; - -retry: - bp_explains_trap = 0; - trace_event = 0; - ourstatus->kind = TARGET_WAITKIND_IGNORE; - - /* If we were only supposed to resume one thread, only wait for - that thread - if it's still alive. If it died, however - which - can happen if we're coming from the thread death case below - - then we need to make sure we restart the other threads. We could - pick a thread at random or restart all; restarting all is less - arbitrary. */ - if (!non_stop - && !ptid_equal (cont_thread, null_ptid) - && !ptid_equal (cont_thread, minus_one_ptid)) - { - struct thread_info *thread; - - thread = (struct thread_info *) find_inferior_id (&all_threads, - cont_thread); - - /* No stepping, no signal - unless one is pending already, of course. */ - if (thread == NULL) - { - struct thread_resume resume_info; - resume_info.thread = minus_one_ptid; - resume_info.kind = resume_continue; - resume_info.sig = 0; - linux_resume (&resume_info, 1); - } - else - ptid = cont_thread; - } - - if (ptid_equal (step_over_bkpt, null_ptid)) - pid = linux_wait_for_event (ptid, &w, options); - else - { - if (debug_threads) - fprintf (stderr, "step_over_bkpt set [%s], doing a blocking wait\n", - target_pid_to_str (step_over_bkpt)); - pid = linux_wait_for_event (step_over_bkpt, &w, options & ~WNOHANG); - } - - if (pid == 0) /* only if TARGET_WNOHANG */ - return null_ptid; - - event_child = get_thread_lwp (current_inferior); - - /* If we are waiting for a particular child, and it exited, - linux_wait_for_event will return its exit status. Similarly if - the last child exited. If this is not the last child, however, - do not report it as exited until there is a 'thread exited' response - available in the remote protocol. Instead, just wait for another event. - This should be safe, because if the thread crashed we will already - have reported the termination signal to GDB; that should stop any - in-progress stepping operations, etc. - - Report the exit status of the last thread to exit. This matches - LinuxThreads' behavior. */ - - if (last_thread_of_process_p (current_inferior)) - { - if (WIFEXITED (w) || WIFSIGNALED (w)) - { - if (WIFEXITED (w)) - { - ourstatus->kind = TARGET_WAITKIND_EXITED; - ourstatus->value.integer = WEXITSTATUS (w); - - if (debug_threads) - fprintf (stderr, - "\nChild exited with retcode = %x \n", - WEXITSTATUS (w)); - } - else - { - ourstatus->kind = TARGET_WAITKIND_SIGNALLED; - ourstatus->value.sig = target_signal_from_host (WTERMSIG (w)); - - if (debug_threads) - fprintf (stderr, - "\nChild terminated with signal = %x \n", - WTERMSIG (w)); - - } - - return ptid_of (event_child); - } - } - else - { - if (!WIFSTOPPED (w)) - goto retry; - } - - /* If this event was not handled before, and is not a SIGTRAP, we - report it. SIGILL and SIGSEGV are also treated as traps in case - a breakpoint is inserted at the current PC. If this target does - not support internal breakpoints at all, we also report the - SIGTRAP without further processing; it's of no concern to us. */ - maybe_internal_trap - = (supports_breakpoints () - && (WSTOPSIG (w) == SIGTRAP - || ((WSTOPSIG (w) == SIGILL - || WSTOPSIG (w) == SIGSEGV) - && (*the_low_target.breakpoint_at) (event_child->stop_pc)))); - - if (maybe_internal_trap) - { - /* Handle anything that requires bookkeeping before deciding to - report the event or continue waiting. */ - - /* First check if we can explain the SIGTRAP with an internal - breakpoint, or if we should possibly report the event to GDB. - Do this before anything that may remove or insert a - breakpoint. */ - bp_explains_trap = breakpoint_inserted_here (event_child->stop_pc); - - /* We have a SIGTRAP, possibly a step-over dance has just - finished. If so, tweak the state machine accordingly, - reinsert breakpoints and delete any reinsert (software - single-step) breakpoints. */ - step_over_finished = finish_step_over (event_child); - - /* Now invoke the callbacks of any internal breakpoints there. */ - check_breakpoints (event_child->stop_pc); - - /* Handle tracepoint data collecting. This may overflow the - trace buffer, and cause a tracing stop, removing - breakpoints. */ - trace_event = handle_tracepoints (event_child); - - if (bp_explains_trap) - { - /* If we stepped or ran into an internal breakpoint, we've - already handled it. So next time we resume (from this - PC), we should step over it. */ - if (debug_threads) - fprintf (stderr, "Hit a gdbserver breakpoint.\n"); - - if (breakpoint_here (event_child->stop_pc)) - event_child->need_step_over = 1; - } - } - else - { - /* We have some other signal, possibly a step-over dance was in - progress, and it should be cancelled too. */ - step_over_finished = finish_step_over (event_child); - } - - /* We have all the data we need. Either report the event to GDB, or - resume threads and keep waiting for more. */ - - /* If we're collecting a fast tracepoint, finish the collection and - move out of the jump pad before delivering a signal. See - linux_stabilize_threads. */ - - if (WIFSTOPPED (w) - && WSTOPSIG (w) != SIGTRAP - && supports_fast_tracepoints () - && in_process_agent_loaded ()) - { - if (debug_threads) - fprintf (stderr, - "Got signal %d for LWP %ld. Check if we need " - "to defer or adjust it.\n", - WSTOPSIG (w), lwpid_of (event_child)); - - /* Allow debugging the jump pad itself. */ - if (current_inferior->last_resume_kind != resume_step - && maybe_move_out_of_jump_pad (event_child, &w)) - { - enqueue_one_deferred_signal (event_child, &w); - - if (debug_threads) - fprintf (stderr, - "Signal %d for LWP %ld deferred (in jump pad)\n", - WSTOPSIG (w), lwpid_of (event_child)); - - linux_resume_one_lwp (event_child, 0, 0, NULL); - goto retry; - } - } - - if (event_child->collecting_fast_tracepoint) - { - if (debug_threads) - fprintf (stderr, "\ -LWP %ld was trying to move out of the jump pad (%d). \ -Check if we're already there.\n", - lwpid_of (event_child), - event_child->collecting_fast_tracepoint); - - trace_event = 1; - - event_child->collecting_fast_tracepoint - = linux_fast_tracepoint_collecting (event_child, NULL); - - if (event_child->collecting_fast_tracepoint != 1) - { - /* No longer need this breakpoint. */ - if (event_child->exit_jump_pad_bkpt != NULL) - { - if (debug_threads) - fprintf (stderr, - "No longer need exit-jump-pad bkpt; removing it." - "stopping all threads momentarily.\n"); - - /* Other running threads could hit this breakpoint. - We don't handle moribund locations like GDB does, - instead we always pause all threads when removing - breakpoints, so that any step-over or - decr_pc_after_break adjustment is always taken - care of while the breakpoint is still - inserted. */ - stop_all_lwps (1, event_child); - cancel_breakpoints (); - - delete_breakpoint (event_child->exit_jump_pad_bkpt); - event_child->exit_jump_pad_bkpt = NULL; - - unstop_all_lwps (1, event_child); - - gdb_assert (event_child->suspended >= 0); - } - } - - if (event_child->collecting_fast_tracepoint == 0) - { - if (debug_threads) - fprintf (stderr, - "fast tracepoint finished " - "collecting successfully.\n"); - - /* We may have a deferred signal to report. */ - if (dequeue_one_deferred_signal (event_child, &w)) - { - if (debug_threads) - fprintf (stderr, "dequeued one signal.\n"); - } - else - { - if (debug_threads) - fprintf (stderr, "no deferred signals.\n"); - - if (stabilizing_threads) - { - ourstatus->kind = TARGET_WAITKIND_STOPPED; - ourstatus->value.sig = TARGET_SIGNAL_0; - return ptid_of (event_child); - } - } - } - } - - /* Check whether GDB would be interested in this event. */ - - /* If GDB is not interested in this signal, don't stop other - threads, and don't report it to GDB. Just resume the inferior - right away. We do this for threading-related signals as well as - any that GDB specifically requested we ignore. But never ignore - SIGSTOP if we sent it ourselves, and do not ignore signals when - stepping - they may require special handling to skip the signal - handler. */ - /* FIXME drow/2002-06-09: Get signal numbers from the inferior's - thread library? */ - if (WIFSTOPPED (w) - && current_inferior->last_resume_kind != resume_step - && ( -#if defined (USE_THREAD_DB) && !defined (__ANDROID__) - (current_process ()->private->thread_db != NULL - && (WSTOPSIG (w) == __SIGRTMIN - || WSTOPSIG (w) == __SIGRTMIN + 1)) - || -#endif - (pass_signals[target_signal_from_host (WSTOPSIG (w))] - && !(WSTOPSIG (w) == SIGSTOP - && current_inferior->last_resume_kind == resume_stop)))) - { - siginfo_t info, *info_p; - - if (debug_threads) - fprintf (stderr, "Ignored signal %d for LWP %ld.\n", - WSTOPSIG (w), lwpid_of (event_child)); - - if (ptrace (PTRACE_GETSIGINFO, lwpid_of (event_child), 0, &info) == 0) - info_p = &info; - else - info_p = NULL; - linux_resume_one_lwp (event_child, event_child->stepping, - WSTOPSIG (w), info_p); - goto retry; - } - - /* If GDB wanted this thread to single step, we always want to - report the SIGTRAP, and let GDB handle it. Watchpoints should - always be reported. So should signals we can't explain. A - SIGTRAP we can't explain could be a GDB breakpoint --- we may or - not support Z0 breakpoints. If we do, we're be able to handle - GDB breakpoints on top of internal breakpoints, by handling the - internal breakpoint and still reporting the event to GDB. If we - don't, we're out of luck, GDB won't see the breakpoint hit. */ - report_to_gdb = (!maybe_internal_trap - || current_inferior->last_resume_kind == resume_step - || event_child->stopped_by_watchpoint - || (!step_over_finished - && !bp_explains_trap && !trace_event) - || gdb_breakpoint_here (event_child->stop_pc)); - - /* We found no reason GDB would want us to stop. We either hit one - of our own breakpoints, or finished an internal step GDB - shouldn't know about. */ - if (!report_to_gdb) - { - if (debug_threads) - { - if (bp_explains_trap) - fprintf (stderr, "Hit a gdbserver breakpoint.\n"); - if (step_over_finished) - fprintf (stderr, "Step-over finished.\n"); - if (trace_event) - fprintf (stderr, "Tracepoint event.\n"); - } - - /* We're not reporting this breakpoint to GDB, so apply the - decr_pc_after_break adjustment to the inferior's regcache - ourselves. */ - - if (the_low_target.set_pc != NULL) - { - struct regcache *regcache - = get_thread_regcache (get_lwp_thread (event_child), 1); - (*the_low_target.set_pc) (regcache, event_child->stop_pc); - } - - /* We may have finished stepping over a breakpoint. If so, - we've stopped and suspended all LWPs momentarily except the - stepping one. This is where we resume them all again. We're - going to keep waiting, so use proceed, which handles stepping - over the next breakpoint. */ - if (debug_threads) - fprintf (stderr, "proceeding all threads.\n"); - - if (step_over_finished) - unsuspend_all_lwps (event_child); - - proceed_all_lwps (); - goto retry; - } - - if (debug_threads) - { - if (current_inferior->last_resume_kind == resume_step) - fprintf (stderr, "GDB wanted to single-step, reporting event.\n"); - if (event_child->stopped_by_watchpoint) - fprintf (stderr, "Stopped by watchpoint.\n"); - if (gdb_breakpoint_here (event_child->stop_pc)) - fprintf (stderr, "Stopped by GDB breakpoint.\n"); - if (debug_threads) - fprintf (stderr, "Hit a non-gdbserver trap event.\n"); - } - - /* Alright, we're going to report a stop. */ - - if (!non_stop && !stabilizing_threads) - { - /* In all-stop, stop all threads. */ - stop_all_lwps (0, NULL); - - /* If we're not waiting for a specific LWP, choose an event LWP - from among those that have had events. Giving equal priority - to all LWPs that have had events helps prevent - starvation. */ - if (ptid_equal (ptid, minus_one_ptid)) - { - event_child->status_pending_p = 1; - event_child->status_pending = w; - - select_event_lwp (&event_child); - - event_child->status_pending_p = 0; - w = event_child->status_pending; - } - - /* Now that we've selected our final event LWP, cancel any - breakpoints in other LWPs that have hit a GDB breakpoint. - See the comment in cancel_breakpoints_callback to find out - why. */ - find_inferior (&all_lwps, cancel_breakpoints_callback, event_child); - - /* Stabilize threads (move out of jump pads). */ - stabilize_threads (); - } - else - { - /* If we just finished a step-over, then all threads had been - momentarily paused. In all-stop, that's fine, we want - threads stopped by now anyway. In non-stop, we need to - re-resume threads that GDB wanted to be running. */ - if (step_over_finished) - unstop_all_lwps (1, event_child); - } - - ourstatus->kind = TARGET_WAITKIND_STOPPED; - - if (current_inferior->last_resume_kind == resume_stop - && WSTOPSIG (w) == SIGSTOP) - { - /* A thread that has been requested to stop by GDB with vCont;t, - and it stopped cleanly, so report as SIG0. The use of - SIGSTOP is an implementation detail. */ - ourstatus->value.sig = TARGET_SIGNAL_0; - } - else if (current_inferior->last_resume_kind == resume_stop - && WSTOPSIG (w) != SIGSTOP) - { - /* A thread that has been requested to stop by GDB with vCont;t, - but, it stopped for other reasons. */ - ourstatus->value.sig = target_signal_from_host (WSTOPSIG (w)); - } - else - { - ourstatus->value.sig = target_signal_from_host (WSTOPSIG (w)); - } - - gdb_assert (ptid_equal (step_over_bkpt, null_ptid)); - - if (debug_threads) - fprintf (stderr, "linux_wait ret = %s, %d, %d\n", - target_pid_to_str (ptid_of (event_child)), - ourstatus->kind, - ourstatus->value.sig); - - return ptid_of (event_child); -} - -/* Get rid of any pending event in the pipe. */ -static void -async_file_flush (void) -{ - int ret; - char buf; - - do - ret = read (linux_event_pipe[0], &buf, 1); - while (ret >= 0 || (ret == -1 && errno == EINTR)); -} - -/* Put something in the pipe, so the event loop wakes up. */ -static void -async_file_mark (void) -{ - int ret; - - async_file_flush (); - - do - ret = write (linux_event_pipe[1], "+", 1); - while (ret == 0 || (ret == -1 && errno == EINTR)); - - /* Ignore EAGAIN. If the pipe is full, the event loop will already - be awakened anyway. */ -} - -static ptid_t -linux_wait (ptid_t ptid, - struct target_waitstatus *ourstatus, int target_options) -{ - ptid_t event_ptid; - - if (debug_threads) - fprintf (stderr, "linux_wait: [%s]\n", target_pid_to_str (ptid)); - - /* Flush the async file first. */ - if (target_is_async_p ()) - async_file_flush (); - - event_ptid = linux_wait_1 (ptid, ourstatus, target_options); - - /* If at least one stop was reported, there may be more. A single - SIGCHLD can signal more than one child stop. */ - if (target_is_async_p () - && (target_options & TARGET_WNOHANG) != 0 - && !ptid_equal (event_ptid, null_ptid)) - async_file_mark (); - - return event_ptid; -} - -/* Send a signal to an LWP. */ - -static int -kill_lwp (unsigned long lwpid, int signo) -{ - /* Use tkill, if possible, in case we are using nptl threads. If tkill - fails, then we are not using nptl threads and we should be using kill. */ - -#ifdef __NR_tkill - { - static int tkill_failed; - - if (!tkill_failed) - { - int ret; - - errno = 0; - ret = syscall (__NR_tkill, lwpid, signo); - if (errno != ENOSYS) - return ret; - tkill_failed = 1; - } - } -#endif - - return kill (lwpid, signo); -} - -void -linux_stop_lwp (struct lwp_info *lwp) -{ - send_sigstop (lwp); -} - -static void -send_sigstop (struct lwp_info *lwp) -{ - int pid; - - pid = lwpid_of (lwp); - - /* If we already have a pending stop signal for this process, don't - send another. */ - if (lwp->stop_expected) - { - if (debug_threads) - fprintf (stderr, "Have pending sigstop for lwp %d\n", pid); - - return; - } - - if (debug_threads) - fprintf (stderr, "Sending sigstop to lwp %d\n", pid); - - lwp->stop_expected = 1; - kill_lwp (pid, SIGSTOP); -} - -static int -send_sigstop_callback (struct inferior_list_entry *entry, void *except) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - - /* Ignore EXCEPT. */ - if (lwp == except) - return 0; - - if (lwp->stopped) - return 0; - - send_sigstop (lwp); - return 0; -} - -/* Increment the suspend count of an LWP, and stop it, if not stopped - yet. */ -static int -suspend_and_send_sigstop_callback (struct inferior_list_entry *entry, - void *except) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - - /* Ignore EXCEPT. */ - if (lwp == except) - return 0; - - lwp->suspended++; - - return send_sigstop_callback (entry, except); -} - -static void -mark_lwp_dead (struct lwp_info *lwp, int wstat) -{ - /* It's dead, really. */ - lwp->dead = 1; - - /* Store the exit status for later. */ - lwp->status_pending_p = 1; - lwp->status_pending = wstat; - - /* Prevent trying to stop it. */ - lwp->stopped = 1; - - /* No further stops are expected from a dead lwp. */ - lwp->stop_expected = 0; -} - -static void -wait_for_sigstop (struct inferior_list_entry *entry) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - struct thread_info *saved_inferior; - int wstat; - ptid_t saved_tid; - ptid_t ptid; - int pid; - - if (lwp->stopped) - { - if (debug_threads) - fprintf (stderr, "wait_for_sigstop: LWP %ld already stopped\n", - lwpid_of (lwp)); - return; - } - - saved_inferior = current_inferior; - if (saved_inferior != NULL) - saved_tid = ((struct inferior_list_entry *) saved_inferior)->id; - else - saved_tid = null_ptid; /* avoid bogus unused warning */ - - ptid = lwp->head.id; - - if (debug_threads) - fprintf (stderr, "wait_for_sigstop: pulling one event\n"); - - pid = linux_wait_for_event (ptid, &wstat, __WALL); - - /* If we stopped with a non-SIGSTOP signal, save it for later - and record the pending SIGSTOP. If the process exited, just - return. */ - if (WIFSTOPPED (wstat)) - { - if (debug_threads) - fprintf (stderr, "LWP %ld stopped with signal %d\n", - lwpid_of (lwp), WSTOPSIG (wstat)); - - if (WSTOPSIG (wstat) != SIGSTOP) - { - if (debug_threads) - fprintf (stderr, "LWP %ld stopped with non-sigstop status %06x\n", - lwpid_of (lwp), wstat); - - lwp->status_pending_p = 1; - lwp->status_pending = wstat; - } - } - else - { - if (debug_threads) - fprintf (stderr, "Process %d exited while stopping LWPs\n", pid); - - lwp = find_lwp_pid (pid_to_ptid (pid)); - if (lwp) - { - /* Leave this status pending for the next time we're able to - report it. In the mean time, we'll report this lwp as - dead to GDB, so GDB doesn't try to read registers and - memory from it. This can only happen if this was the - last thread of the process; otherwise, PID is removed - from the thread tables before linux_wait_for_event - returns. */ - mark_lwp_dead (lwp, wstat); - } - } - - if (saved_inferior == NULL || linux_thread_alive (saved_tid)) - current_inferior = saved_inferior; - else - { - if (debug_threads) - fprintf (stderr, "Previously current thread died.\n"); - - if (non_stop) - { - /* We can't change the current inferior behind GDB's back, - otherwise, a subsequent command may apply to the wrong - process. */ - current_inferior = NULL; - } - else - { - /* Set a valid thread as current. */ - set_desired_inferior (0); - } - } -} - -/* Returns true if LWP ENTRY is stopped in a jump pad, and we can't - move it out, because we need to report the stop event to GDB. For - example, if the user puts a breakpoint in the jump pad, it's - because she wants to debug it. */ - -static int -stuck_in_jump_pad_callback (struct inferior_list_entry *entry, void *data) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - struct thread_info *thread = get_lwp_thread (lwp); - - gdb_assert (lwp->suspended == 0); - gdb_assert (lwp->stopped); - - /* Allow debugging the jump pad, gdb_collect, etc.. */ - return (supports_fast_tracepoints () - && in_process_agent_loaded () - && (gdb_breakpoint_here (lwp->stop_pc) - || lwp->stopped_by_watchpoint - || thread->last_resume_kind == resume_step) - && linux_fast_tracepoint_collecting (lwp, NULL)); -} - -static void -move_out_of_jump_pad_callback (struct inferior_list_entry *entry) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - struct thread_info *thread = get_lwp_thread (lwp); - int *wstat; - - gdb_assert (lwp->suspended == 0); - gdb_assert (lwp->stopped); - - wstat = lwp->status_pending_p ? &lwp->status_pending : NULL; - - /* Allow debugging the jump pad, gdb_collect, etc. */ - if (!gdb_breakpoint_here (lwp->stop_pc) - && !lwp->stopped_by_watchpoint - && thread->last_resume_kind != resume_step - && maybe_move_out_of_jump_pad (lwp, wstat)) - { - if (debug_threads) - fprintf (stderr, - "LWP %ld needs stabilizing (in jump pad)\n", - lwpid_of (lwp)); - - if (wstat) - { - lwp->status_pending_p = 0; - enqueue_one_deferred_signal (lwp, wstat); - - if (debug_threads) - fprintf (stderr, - "Signal %d for LWP %ld deferred " - "(in jump pad)\n", - WSTOPSIG (*wstat), lwpid_of (lwp)); - } - - linux_resume_one_lwp (lwp, 0, 0, NULL); - } - else - lwp->suspended++; -} - -static int -lwp_running (struct inferior_list_entry *entry, void *data) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - - if (lwp->dead) - return 0; - if (lwp->stopped) - return 0; - return 1; -} - -/* Stop all lwps that aren't stopped yet, except EXCEPT, if not NULL. - If SUSPEND, then also increase the suspend count of every LWP, - except EXCEPT. */ - -static void -stop_all_lwps (int suspend, struct lwp_info *except) -{ - stopping_threads = 1; - - if (suspend) - find_inferior (&all_lwps, suspend_and_send_sigstop_callback, except); - else - find_inferior (&all_lwps, send_sigstop_callback, except); - for_each_inferior (&all_lwps, wait_for_sigstop); - stopping_threads = 0; -} - -/* Resume execution of the inferior process. - If STEP is nonzero, single-step it. - If SIGNAL is nonzero, give it that signal. */ - -static void -linux_resume_one_lwp (struct lwp_info *lwp, - int step, int signal, siginfo_t *info) -{ - struct thread_info *saved_inferior; - int fast_tp_collecting; - - if (lwp->stopped == 0) - return; - - fast_tp_collecting = lwp->collecting_fast_tracepoint; - - gdb_assert (!stabilizing_threads || fast_tp_collecting); - - /* Cancel actions that rely on GDB not changing the PC (e.g., the - user used the "jump" command, or "set $pc = foo"). */ - if (lwp->stop_pc != get_pc (lwp)) - { - /* Collecting 'while-stepping' actions doesn't make sense - anymore. */ - release_while_stepping_state_list (get_lwp_thread (lwp)); - } - - /* If we have pending signals or status, and a new signal, enqueue the - signal. Also enqueue the signal if we are waiting to reinsert a - breakpoint; it will be picked up again below. */ - if (signal != 0 - && (lwp->status_pending_p - || lwp->pending_signals != NULL - || lwp->bp_reinsert != 0 - || fast_tp_collecting)) - { - struct pending_signals *p_sig; - p_sig = xmalloc (sizeof (*p_sig)); - p_sig->prev = lwp->pending_signals; - p_sig->signal = signal; - if (info == NULL) - memset (&p_sig->info, 0, sizeof (siginfo_t)); - else - memcpy (&p_sig->info, info, sizeof (siginfo_t)); - lwp->pending_signals = p_sig; - } - - if (lwp->status_pending_p) - { - if (debug_threads) - fprintf (stderr, "Not resuming lwp %ld (%s, signal %d, stop %s);" - " has pending status\n", - lwpid_of (lwp), step ? "step" : "continue", signal, - lwp->stop_expected ? "expected" : "not expected"); - return; - } - - saved_inferior = current_inferior; - current_inferior = get_lwp_thread (lwp); - - if (debug_threads) - fprintf (stderr, "Resuming lwp %ld (%s, signal %d, stop %s)\n", - lwpid_of (lwp), step ? "step" : "continue", signal, - lwp->stop_expected ? "expected" : "not expected"); - - /* This bit needs some thinking about. If we get a signal that - we must report while a single-step reinsert is still pending, - we often end up resuming the thread. It might be better to - (ew) allow a stack of pending events; then we could be sure that - the reinsert happened right away and not lose any signals. - - Making this stack would also shrink the window in which breakpoints are - uninserted (see comment in linux_wait_for_lwp) but not enough for - complete correctness, so it won't solve that problem. It may be - worthwhile just to solve this one, however. */ - if (lwp->bp_reinsert != 0) - { - if (debug_threads) - fprintf (stderr, " pending reinsert at 0x%s\n", - paddress (lwp->bp_reinsert)); - - if (lwp->bp_reinsert != 0 && can_hardware_single_step ()) - { - if (fast_tp_collecting == 0) - { - if (step == 0) - fprintf (stderr, "BAD - reinserting but not stepping.\n"); - if (lwp->suspended) - fprintf (stderr, "BAD - reinserting and suspended(%d).\n", - lwp->suspended); - } - - step = 1; - } - - /* Postpone any pending signal. It was enqueued above. */ - signal = 0; - } - - if (fast_tp_collecting == 1) - { - if (debug_threads) - fprintf (stderr, "\ -lwp %ld wants to get out of fast tracepoint jump pad (exit-jump-pad-bkpt)\n", - lwpid_of (lwp)); - - /* Postpone any pending signal. It was enqueued above. */ - signal = 0; - } - else if (fast_tp_collecting == 2) - { - if (debug_threads) - fprintf (stderr, "\ -lwp %ld wants to get out of fast tracepoint jump pad single-stepping\n", - lwpid_of (lwp)); - - if (can_hardware_single_step ()) - step = 1; - else - fatal ("moving out of jump pad single-stepping" - " not implemented on this target"); - - /* Postpone any pending signal. It was enqueued above. */ - signal = 0; - } - - /* If we have while-stepping actions in this thread set it stepping. - If we have a signal to deliver, it may or may not be set to - SIG_IGN, we don't know. Assume so, and allow collecting - while-stepping into a signal handler. A possible smart thing to - do would be to set an internal breakpoint at the signal return - address, continue, and carry on catching this while-stepping - action only when that breakpoint is hit. A future - enhancement. */ - if (get_lwp_thread (lwp)->while_stepping != NULL - && can_hardware_single_step ()) - { - if (debug_threads) - fprintf (stderr, - "lwp %ld has a while-stepping action -> forcing step.\n", - lwpid_of (lwp)); - step = 1; - } - - if (debug_threads && the_low_target.get_pc != NULL) - { - struct regcache *regcache = get_thread_regcache (current_inferior, 1); - CORE_ADDR pc = (*the_low_target.get_pc) (regcache); - fprintf (stderr, " resuming from pc 0x%lx\n", (long) pc); - } - - /* If we have pending signals, consume one unless we are trying to - reinsert a breakpoint or we're trying to finish a fast tracepoint - collect. */ - if (lwp->pending_signals != NULL - && lwp->bp_reinsert == 0 - && fast_tp_collecting == 0) - { - struct pending_signals **p_sig; - - p_sig = &lwp->pending_signals; - while ((*p_sig)->prev != NULL) - p_sig = &(*p_sig)->prev; - - signal = (*p_sig)->signal; - if ((*p_sig)->info.si_signo != 0) - ptrace (PTRACE_SETSIGINFO, lwpid_of (lwp), 0, &(*p_sig)->info); - - free (*p_sig); - *p_sig = NULL; - } - - if (the_low_target.prepare_to_resume != NULL) - the_low_target.prepare_to_resume (lwp); - - regcache_invalidate_one ((struct inferior_list_entry *) - get_lwp_thread (lwp)); - errno = 0; - lwp->stopped = 0; - lwp->stopped_by_watchpoint = 0; - lwp->stepping = step; - ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, lwpid_of (lwp), 0, - /* Coerce to a uintptr_t first to avoid potential gcc warning - of coercing an 8 byte integer to a 4 byte pointer. */ - (PTRACE_ARG4_TYPE) (uintptr_t) signal); - - current_inferior = saved_inferior; - if (errno) - { - /* ESRCH from ptrace either means that the thread was already - running (an error) or that it is gone (a race condition). If - it's gone, we will get a notification the next time we wait, - so we can ignore the error. We could differentiate these - two, but it's tricky without waiting; the thread still exists - as a zombie, so sending it signal 0 would succeed. So just - ignore ESRCH. */ - if (errno == ESRCH) - return; - - perror_with_name ("ptrace"); - } -} - -struct thread_resume_array -{ - struct thread_resume *resume; - size_t n; -}; - -/* This function is called once per thread. We look up the thread - in RESUME_PTR, and mark the thread with a pointer to the appropriate - resume request. - - This algorithm is O(threads * resume elements), but resume elements - is small (and will remain small at least until GDB supports thread - suspension). */ -static int -linux_set_resume_request (struct inferior_list_entry *entry, void *arg) -{ - struct lwp_info *lwp; - struct thread_info *thread; - int ndx; - struct thread_resume_array *r; - - thread = (struct thread_info *) entry; - lwp = get_thread_lwp (thread); - r = arg; - - for (ndx = 0; ndx < r->n; ndx++) - { - ptid_t ptid = r->resume[ndx].thread; - if (ptid_equal (ptid, minus_one_ptid) - || ptid_equal (ptid, entry->id) - || (ptid_is_pid (ptid) - && (ptid_get_pid (ptid) == pid_of (lwp))) - || (ptid_get_lwp (ptid) == -1 - && (ptid_get_pid (ptid) == pid_of (lwp)))) - { - if (r->resume[ndx].kind == resume_stop - && thread->last_resume_kind == resume_stop) - { - if (debug_threads) - fprintf (stderr, "already %s LWP %ld at GDB's request\n", - thread->last_status.kind == TARGET_WAITKIND_STOPPED - ? "stopped" - : "stopping", - lwpid_of (lwp)); - - continue; - } - - lwp->resume = &r->resume[ndx]; - thread->last_resume_kind = lwp->resume->kind; - - /* If we had a deferred signal to report, dequeue one now. - This can happen if LWP gets more than one signal while - trying to get out of a jump pad. */ - if (lwp->stopped - && !lwp->status_pending_p - && dequeue_one_deferred_signal (lwp, &lwp->status_pending)) - { - lwp->status_pending_p = 1; - - if (debug_threads) - fprintf (stderr, - "Dequeueing deferred signal %d for LWP %ld, " - "leaving status pending.\n", - WSTOPSIG (lwp->status_pending), lwpid_of (lwp)); - } - - return 0; - } - } - - /* No resume action for this thread. */ - lwp->resume = NULL; - - return 0; -} - - -/* Set *FLAG_P if this lwp has an interesting status pending. */ -static int -resume_status_pending_p (struct inferior_list_entry *entry, void *flag_p) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - - /* LWPs which will not be resumed are not interesting, because - we might not wait for them next time through linux_wait. */ - if (lwp->resume == NULL) - return 0; - - if (lwp->status_pending_p) - * (int *) flag_p = 1; - - return 0; -} - -/* Return 1 if this lwp that GDB wants running is stopped at an - internal breakpoint that we need to step over. It assumes that any - required STOP_PC adjustment has already been propagated to the - inferior's regcache. */ - -static int -need_step_over_p (struct inferior_list_entry *entry, void *dummy) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - struct thread_info *thread; - struct thread_info *saved_inferior; - CORE_ADDR pc; - - /* LWPs which will not be resumed are not interesting, because we - might not wait for them next time through linux_wait. */ - - if (!lwp->stopped) - { - if (debug_threads) - fprintf (stderr, - "Need step over [LWP %ld]? Ignoring, not stopped\n", - lwpid_of (lwp)); - return 0; - } - - thread = get_lwp_thread (lwp); - - if (thread->last_resume_kind == resume_stop) - { - if (debug_threads) - fprintf (stderr, - "Need step over [LWP %ld]? Ignoring, should remain stopped\n", - lwpid_of (lwp)); - return 0; - } - - gdb_assert (lwp->suspended >= 0); - - if (lwp->suspended) - { - if (debug_threads) - fprintf (stderr, - "Need step over [LWP %ld]? Ignoring, suspended\n", - lwpid_of (lwp)); - return 0; - } - - if (!lwp->need_step_over) - { - if (debug_threads) - fprintf (stderr, - "Need step over [LWP %ld]? No\n", lwpid_of (lwp)); - } - - if (lwp->status_pending_p) - { - if (debug_threads) - fprintf (stderr, - "Need step over [LWP %ld]? Ignoring, has pending status.\n", - lwpid_of (lwp)); - return 0; - } - - /* Note: PC, not STOP_PC. Either GDB has adjusted the PC already, - or we have. */ - pc = get_pc (lwp); - - /* If the PC has changed since we stopped, then don't do anything, - and let the breakpoint/tracepoint be hit. This happens if, for - instance, GDB handled the decr_pc_after_break subtraction itself, - GDB is OOL stepping this thread, or the user has issued a "jump" - command, or poked thread's registers herself. */ - if (pc != lwp->stop_pc) - { - if (debug_threads) - fprintf (stderr, - "Need step over [LWP %ld]? Cancelling, PC was changed. " - "Old stop_pc was 0x%s, PC is now 0x%s\n", - lwpid_of (lwp), paddress (lwp->stop_pc), paddress (pc)); - - lwp->need_step_over = 0; - return 0; - } - - saved_inferior = current_inferior; - current_inferior = thread; - - /* We can only step over breakpoints we know about. */ - if (breakpoint_here (pc) || fast_tracepoint_jump_here (pc)) - { - /* Don't step over a breakpoint that GDB expects to hit - though. */ - if (gdb_breakpoint_here (pc)) - { - if (debug_threads) - fprintf (stderr, - "Need step over [LWP %ld]? yes, but found" - " GDB breakpoint at 0x%s; skipping step over\n", - lwpid_of (lwp), paddress (pc)); - - current_inferior = saved_inferior; - return 0; - } - else - { - if (debug_threads) - fprintf (stderr, - "Need step over [LWP %ld]? yes, " - "found breakpoint at 0x%s\n", - lwpid_of (lwp), paddress (pc)); - - /* We've found an lwp that needs stepping over --- return 1 so - that find_inferior stops looking. */ - current_inferior = saved_inferior; - - /* If the step over is cancelled, this is set again. */ - lwp->need_step_over = 0; - return 1; - } - } - - current_inferior = saved_inferior; - - if (debug_threads) - fprintf (stderr, - "Need step over [LWP %ld]? No, no breakpoint found at 0x%s\n", - lwpid_of (lwp), paddress (pc)); - - return 0; -} - -/* Start a step-over operation on LWP. When LWP stopped at a - breakpoint, to make progress, we need to remove the breakpoint out - of the way. If we let other threads run while we do that, they may - pass by the breakpoint location and miss hitting it. To avoid - that, a step-over momentarily stops all threads while LWP is - single-stepped while the breakpoint is temporarily uninserted from - the inferior. When the single-step finishes, we reinsert the - breakpoint, and let all threads that are supposed to be running, - run again. - - On targets that don't support hardware single-step, we don't - currently support full software single-stepping. Instead, we only - support stepping over the thread event breakpoint, by asking the - low target where to place a reinsert breakpoint. Since this - routine assumes the breakpoint being stepped over is a thread event - breakpoint, it usually assumes the return address of the current - function is a good enough place to set the reinsert breakpoint. */ - -static int -start_step_over (struct lwp_info *lwp) -{ - struct thread_info *saved_inferior; - CORE_ADDR pc; - int step; - - if (debug_threads) - fprintf (stderr, - "Starting step-over on LWP %ld. Stopping all threads\n", - lwpid_of (lwp)); - - stop_all_lwps (1, lwp); - gdb_assert (lwp->suspended == 0); - - if (debug_threads) - fprintf (stderr, "Done stopping all threads for step-over.\n"); - - /* Note, we should always reach here with an already adjusted PC, - either by GDB (if we're resuming due to GDB's request), or by our - caller, if we just finished handling an internal breakpoint GDB - shouldn't care about. */ - pc = get_pc (lwp); - - saved_inferior = current_inferior; - current_inferior = get_lwp_thread (lwp); - - lwp->bp_reinsert = pc; - uninsert_breakpoints_at (pc); - uninsert_fast_tracepoint_jumps_at (pc); - - if (can_hardware_single_step ()) - { - step = 1; - } - else - { - CORE_ADDR raddr = (*the_low_target.breakpoint_reinsert_addr) (); - set_reinsert_breakpoint (raddr); - step = 0; - } - - current_inferior = saved_inferior; - - linux_resume_one_lwp (lwp, step, 0, NULL); - - /* Require next event from this LWP. */ - step_over_bkpt = lwp->head.id; - return 1; -} - -/* Finish a step-over. Reinsert the breakpoint we had uninserted in - start_step_over, if still there, and delete any reinsert - breakpoints we've set, on non hardware single-step targets. */ - -static int -finish_step_over (struct lwp_info *lwp) -{ - if (lwp->bp_reinsert != 0) - { - if (debug_threads) - fprintf (stderr, "Finished step over.\n"); - - /* Reinsert any breakpoint at LWP->BP_REINSERT. Note that there - may be no breakpoint to reinsert there by now. */ - reinsert_breakpoints_at (lwp->bp_reinsert); - reinsert_fast_tracepoint_jumps_at (lwp->bp_reinsert); - - lwp->bp_reinsert = 0; - - /* Delete any software-single-step reinsert breakpoints. No - longer needed. We don't have to worry about other threads - hitting this trap, and later not being able to explain it, - because we were stepping over a breakpoint, and we hold all - threads but LWP stopped while doing that. */ - if (!can_hardware_single_step ()) - delete_reinsert_breakpoints (); - - step_over_bkpt = null_ptid; - return 1; - } - else - return 0; -} - -/* This function is called once per thread. We check the thread's resume - request, which will tell us whether to resume, step, or leave the thread - stopped; and what signal, if any, it should be sent. - - For threads which we aren't explicitly told otherwise, we preserve - the stepping flag; this is used for stepping over gdbserver-placed - breakpoints. - - If pending_flags was set in any thread, we queue any needed - signals, since we won't actually resume. We already have a pending - event to report, so we don't need to preserve any step requests; - they should be re-issued if necessary. */ - -static int -linux_resume_one_thread (struct inferior_list_entry *entry, void *arg) -{ - struct lwp_info *lwp; - struct thread_info *thread; - int step; - int leave_all_stopped = * (int *) arg; - int leave_pending; - - thread = (struct thread_info *) entry; - lwp = get_thread_lwp (thread); - - if (lwp->resume == NULL) - return 0; - - if (lwp->resume->kind == resume_stop) - { - if (debug_threads) - fprintf (stderr, "resume_stop request for LWP %ld\n", lwpid_of (lwp)); - - if (!lwp->stopped) - { - if (debug_threads) - fprintf (stderr, "stopping LWP %ld\n", lwpid_of (lwp)); - - /* Stop the thread, and wait for the event asynchronously, - through the event loop. */ - send_sigstop (lwp); - } - else - { - if (debug_threads) - fprintf (stderr, "already stopped LWP %ld\n", - lwpid_of (lwp)); - - /* The LWP may have been stopped in an internal event that - was not meant to be notified back to GDB (e.g., gdbserver - breakpoint), so we should be reporting a stop event in - this case too. */ - - /* If the thread already has a pending SIGSTOP, this is a - no-op. Otherwise, something later will presumably resume - the thread and this will cause it to cancel any pending - operation, due to last_resume_kind == resume_stop. If - the thread already has a pending status to report, we - will still report it the next time we wait - see - status_pending_p_callback. */ - - /* If we already have a pending signal to report, then - there's no need to queue a SIGSTOP, as this means we're - midway through moving the LWP out of the jumppad, and we - will report the pending signal as soon as that is - finished. */ - if (lwp->pending_signals_to_report == NULL) - send_sigstop (lwp); - } - - /* For stop requests, we're done. */ - lwp->resume = NULL; - thread->last_status.kind = TARGET_WAITKIND_IGNORE; - return 0; - } - - /* If this thread which is about to be resumed has a pending status, - then don't resume any threads - we can just report the pending - status. Make sure to queue any signals that would otherwise be - sent. In all-stop mode, we do this decision based on if *any* - thread has a pending status. If there's a thread that needs the - step-over-breakpoint dance, then don't resume any other thread - but that particular one. */ - leave_pending = (lwp->status_pending_p || leave_all_stopped); - - if (!leave_pending) - { - if (debug_threads) - fprintf (stderr, "resuming LWP %ld\n", lwpid_of (lwp)); - - step = (lwp->resume->kind == resume_step); - linux_resume_one_lwp (lwp, step, lwp->resume->sig, NULL); - } - else - { - if (debug_threads) - fprintf (stderr, "leaving LWP %ld stopped\n", lwpid_of (lwp)); - - /* If we have a new signal, enqueue the signal. */ - if (lwp->resume->sig != 0) - { - struct pending_signals *p_sig; - p_sig = xmalloc (sizeof (*p_sig)); - p_sig->prev = lwp->pending_signals; - p_sig->signal = lwp->resume->sig; - memset (&p_sig->info, 0, sizeof (siginfo_t)); - - /* If this is the same signal we were previously stopped by, - make sure to queue its siginfo. We can ignore the return - value of ptrace; if it fails, we'll skip - PTRACE_SETSIGINFO. */ - if (WIFSTOPPED (lwp->last_status) - && WSTOPSIG (lwp->last_status) == lwp->resume->sig) - ptrace (PTRACE_GETSIGINFO, lwpid_of (lwp), 0, &p_sig->info); - - lwp->pending_signals = p_sig; - } - } - - thread->last_status.kind = TARGET_WAITKIND_IGNORE; - lwp->resume = NULL; - return 0; -} - -static void -linux_resume (struct thread_resume *resume_info, size_t n) -{ - struct thread_resume_array array = { resume_info, n }; - struct lwp_info *need_step_over = NULL; - int any_pending; - int leave_all_stopped; - - find_inferior (&all_threads, linux_set_resume_request, &array); - - /* If there is a thread which would otherwise be resumed, which has - a pending status, then don't resume any threads - we can just - report the pending status. Make sure to queue any signals that - would otherwise be sent. In non-stop mode, we'll apply this - logic to each thread individually. We consume all pending events - before considering to start a step-over (in all-stop). */ - any_pending = 0; - if (!non_stop) - find_inferior (&all_lwps, resume_status_pending_p, &any_pending); - - /* If there is a thread which would otherwise be resumed, which is - stopped at a breakpoint that needs stepping over, then don't - resume any threads - have it step over the breakpoint with all - other threads stopped, then resume all threads again. Make sure - to queue any signals that would otherwise be delivered or - queued. */ - if (!any_pending && supports_breakpoints ()) - need_step_over - = (struct lwp_info *) find_inferior (&all_lwps, - need_step_over_p, NULL); - - leave_all_stopped = (need_step_over != NULL || any_pending); - - if (debug_threads) - { - if (need_step_over != NULL) - fprintf (stderr, "Not resuming all, need step over\n"); - else if (any_pending) - fprintf (stderr, - "Not resuming, all-stop and found " - "an LWP with pending status\n"); - else - fprintf (stderr, "Resuming, no pending status or step over needed\n"); - } - - /* Even if we're leaving threads stopped, queue all signals we'd - otherwise deliver. */ - find_inferior (&all_threads, linux_resume_one_thread, &leave_all_stopped); - - if (need_step_over) - start_step_over (need_step_over); -} - -/* This function is called once per thread. We check the thread's - last resume request, which will tell us whether to resume, step, or - leave the thread stopped. Any signal the client requested to be - delivered has already been enqueued at this point. - - If any thread that GDB wants running is stopped at an internal - breakpoint that needs stepping over, we start a step-over operation - on that particular thread, and leave all others stopped. */ - -static int -proceed_one_lwp (struct inferior_list_entry *entry, void *except) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - struct thread_info *thread; - int step; - - if (lwp == except) - return 0; - - if (debug_threads) - fprintf (stderr, - "proceed_one_lwp: lwp %ld\n", lwpid_of (lwp)); - - if (!lwp->stopped) - { - if (debug_threads) - fprintf (stderr, " LWP %ld already running\n", lwpid_of (lwp)); - return 0; - } - - thread = get_lwp_thread (lwp); - - if (thread->last_resume_kind == resume_stop - && thread->last_status.kind != TARGET_WAITKIND_IGNORE) - { - if (debug_threads) - fprintf (stderr, " client wants LWP to remain %ld stopped\n", - lwpid_of (lwp)); - return 0; - } - - if (lwp->status_pending_p) - { - if (debug_threads) - fprintf (stderr, " LWP %ld has pending status, leaving stopped\n", - lwpid_of (lwp)); - return 0; - } - - gdb_assert (lwp->suspended >= 0); - - if (lwp->suspended) - { - if (debug_threads) - fprintf (stderr, " LWP %ld is suspended\n", lwpid_of (lwp)); - return 0; - } - - if (thread->last_resume_kind == resume_stop - && lwp->pending_signals_to_report == NULL - && lwp->collecting_fast_tracepoint == 0) - { - /* We haven't reported this LWP as stopped yet (otherwise, the - last_status.kind check above would catch it, and we wouldn't - reach here. This LWP may have been momentarily paused by a - stop_all_lwps call while handling for example, another LWP's - step-over. In that case, the pending expected SIGSTOP signal - that was queued at vCont;t handling time will have already - been consumed by wait_for_sigstop, and so we need to requeue - another one here. Note that if the LWP already has a SIGSTOP - pending, this is a no-op. */ - - if (debug_threads) - fprintf (stderr, - "Client wants LWP %ld to stop. " - "Making sure it has a SIGSTOP pending\n", - lwpid_of (lwp)); - - send_sigstop (lwp); - } - - step = thread->last_resume_kind == resume_step; - linux_resume_one_lwp (lwp, step, 0, NULL); - return 0; -} - -static int -unsuspend_and_proceed_one_lwp (struct inferior_list_entry *entry, void *except) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - - if (lwp == except) - return 0; - - lwp->suspended--; - gdb_assert (lwp->suspended >= 0); - - return proceed_one_lwp (entry, except); -} - -/* When we finish a step-over, set threads running again. If there's - another thread that may need a step-over, now's the time to start - it. Eventually, we'll move all threads past their breakpoints. */ - -static void -proceed_all_lwps (void) -{ - struct lwp_info *need_step_over; - - /* If there is a thread which would otherwise be resumed, which is - stopped at a breakpoint that needs stepping over, then don't - resume any threads - have it step over the breakpoint with all - other threads stopped, then resume all threads again. */ - - if (supports_breakpoints ()) - { - need_step_over - = (struct lwp_info *) find_inferior (&all_lwps, - need_step_over_p, NULL); - - if (need_step_over != NULL) - { - if (debug_threads) - fprintf (stderr, "proceed_all_lwps: found " - "thread %ld needing a step-over\n", - lwpid_of (need_step_over)); - - start_step_over (need_step_over); - return; - } - } - - if (debug_threads) - fprintf (stderr, "Proceeding, no step-over needed\n"); - - find_inferior (&all_lwps, proceed_one_lwp, NULL); -} - -/* Stopped LWPs that the client wanted to be running, that don't have - pending statuses, are set to run again, except for EXCEPT, if not - NULL. This undoes a stop_all_lwps call. */ - -static void -unstop_all_lwps (int unsuspend, struct lwp_info *except) -{ - if (debug_threads) - { - if (except) - fprintf (stderr, - "unstopping all lwps, except=(LWP %ld)\n", lwpid_of (except)); - else - fprintf (stderr, - "unstopping all lwps\n"); - } - - if (unsuspend) - find_inferior (&all_lwps, unsuspend_and_proceed_one_lwp, except); - else - find_inferior (&all_lwps, proceed_one_lwp, except); -} - -#ifdef HAVE_LINUX_USRREGS - -int -register_addr (int regnum) -{ - int addr; - - if (regnum < 0 || regnum >= the_low_target.num_regs) - error ("Invalid register number %d.", regnum); - - addr = the_low_target.regmap[regnum]; - - return addr; -} - -/* Fetch one register. */ -static void -fetch_register (struct regcache *regcache, int regno) -{ - CORE_ADDR regaddr; - int i, size; - char *buf; - int pid; - - if (regno >= the_low_target.num_regs) - return; - if ((*the_low_target.cannot_fetch_register) (regno)) - return; - - regaddr = register_addr (regno); - if (regaddr == -1) - return; - - pid = lwpid_of (get_thread_lwp (current_inferior)); - size = ((register_size (regno) + sizeof (PTRACE_XFER_TYPE) - 1) - & - sizeof (PTRACE_XFER_TYPE)); - buf = alloca (size); - for (i = 0; i < size; i += sizeof (PTRACE_XFER_TYPE)) - { - errno = 0; - *(PTRACE_XFER_TYPE *) (buf + i) = - ptrace (PTRACE_PEEKUSER, pid, - /* Coerce to a uintptr_t first to avoid potential gcc warning - of coercing an 8 byte integer to a 4 byte pointer. */ - (PTRACE_ARG3_TYPE) (uintptr_t) regaddr, 0); - regaddr += sizeof (PTRACE_XFER_TYPE); - if (errno != 0) - error ("reading register %d: %s", regno, strerror (errno)); - } - - if (the_low_target.supply_ptrace_register) - the_low_target.supply_ptrace_register (regcache, regno, buf); - else - supply_register (regcache, regno, buf); -} - -/* Fetch all registers, or just one, from the child process. */ -static void -usr_fetch_inferior_registers (struct regcache *regcache, int regno) -{ - if (regno == -1) - for (regno = 0; regno < the_low_target.num_regs; regno++) - fetch_register (regcache, regno); - else - fetch_register (regcache, regno); -} - -/* Store our register values back into the inferior. - If REGNO is -1, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ -static void -usr_store_inferior_registers (struct regcache *regcache, int regno) -{ - CORE_ADDR regaddr; - int i, size; - char *buf; - int pid; - - if (regno >= 0) - { - if (regno >= the_low_target.num_regs) - return; - - if ((*the_low_target.cannot_store_register) (regno) == 1) - return; - - regaddr = register_addr (regno); - if (regaddr == -1) - return; - errno = 0; - size = (register_size (regno) + sizeof (PTRACE_XFER_TYPE) - 1) - & - sizeof (PTRACE_XFER_TYPE); - buf = alloca (size); - memset (buf, 0, size); - - if (the_low_target.collect_ptrace_register) - the_low_target.collect_ptrace_register (regcache, regno, buf); - else - collect_register (regcache, regno, buf); - - pid = lwpid_of (get_thread_lwp (current_inferior)); - for (i = 0; i < size; i += sizeof (PTRACE_XFER_TYPE)) - { - errno = 0; - ptrace (PTRACE_POKEUSER, pid, - /* Coerce to a uintptr_t first to avoid potential gcc warning - about coercing an 8 byte integer to a 4 byte pointer. */ - (PTRACE_ARG3_TYPE) (uintptr_t) regaddr, - (PTRACE_ARG4_TYPE) *(PTRACE_XFER_TYPE *) (buf + i)); - if (errno != 0) - { - /* At this point, ESRCH should mean the process is - already gone, in which case we simply ignore attempts - to change its registers. See also the related - comment in linux_resume_one_lwp. */ - if (errno == ESRCH) - return; - - if ((*the_low_target.cannot_store_register) (regno) == 0) - error ("writing register %d: %s", regno, strerror (errno)); - } - regaddr += sizeof (PTRACE_XFER_TYPE); - } - } - else - for (regno = 0; regno < the_low_target.num_regs; regno++) - usr_store_inferior_registers (regcache, regno); -} -#endif /* HAVE_LINUX_USRREGS */ - - - -#ifdef HAVE_LINUX_REGSETS - -static int -regsets_fetch_inferior_registers (struct regcache *regcache) -{ - struct regset_info *regset; - int saw_general_regs = 0; - int pid; - struct iovec iov; - - regset = target_regsets; - - pid = lwpid_of (get_thread_lwp (current_inferior)); - while (regset->size >= 0) - { - void *buf, *data; - int nt_type, res; - - if (regset->size == 0 || disabled_regsets[regset - target_regsets]) - { - regset ++; - continue; - } - - buf = xmalloc (regset->size); - - nt_type = regset->nt_type; - if (nt_type) - { - iov.iov_base = buf; - iov.iov_len = regset->size; - data = (void *) &iov; - } - else - data = buf; - -#ifndef __sparc__ - res = ptrace (regset->get_request, pid, nt_type, data); -#else - res = ptrace (regset->get_request, pid, data, nt_type); -#endif - if (res < 0) - { - if (errno == EIO) - { - /* If we get EIO on a regset, do not try it again for - this process. */ - disabled_regsets[regset - target_regsets] = 1; - free (buf); - continue; - } - else - { - char s[256]; - sprintf (s, "ptrace(regsets_fetch_inferior_registers) PID=%d", - pid); - perror (s); - } - } - else if (regset->type == GENERAL_REGS) - saw_general_regs = 1; - regset->store_function (regcache, buf); - regset ++; - free (buf); - } - if (saw_general_regs) - return 0; - else - return 1; -} - -static int -regsets_store_inferior_registers (struct regcache *regcache) -{ - struct regset_info *regset; - int saw_general_regs = 0; - int pid; - struct iovec iov; - - regset = target_regsets; - - pid = lwpid_of (get_thread_lwp (current_inferior)); - while (regset->size >= 0) - { - void *buf, *data; - int nt_type, res; - - if (regset->size == 0 || disabled_regsets[regset - target_regsets]) - { - regset ++; - continue; - } - - buf = xmalloc (regset->size); - - /* 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. */ - - nt_type = regset->nt_type; - if (nt_type) - { - iov.iov_base = buf; - iov.iov_len = regset->size; - data = (void *) &iov; - } - else - data = buf; - -#ifndef __sparc__ - res = ptrace (regset->get_request, pid, nt_type, data); -#else - res = ptrace (regset->get_request, pid, &iov, data); -#endif - - if (res == 0) - { - /* Then overlay our cached registers on that. */ - regset->fill_function (regcache, buf); - - /* Only now do we write the register set. */ -#ifndef __sparc__ - res = ptrace (regset->set_request, pid, nt_type, data); -#else - res = ptrace (regset->set_request, pid, data, nt_type); -#endif - } - - if (res < 0) - { - if (errno == EIO) - { - /* If we get EIO on a regset, do not try it again for - this process. */ - disabled_regsets[regset - target_regsets] = 1; - free (buf); - continue; - } - else if (errno == ESRCH) - { - /* At this point, ESRCH should mean the process is - already gone, in which case we simply ignore attempts - to change its registers. See also the related - comment in linux_resume_one_lwp. */ - free (buf); - return 0; - } - else - { - perror ("Warning: ptrace(regsets_store_inferior_registers)"); - } - } - else if (regset->type == GENERAL_REGS) - saw_general_regs = 1; - regset ++; - free (buf); - } - if (saw_general_regs) - return 0; - else - return 1; - return 0; -} - -#endif /* HAVE_LINUX_REGSETS */ - - -void -linux_fetch_registers (struct regcache *regcache, int regno) -{ -#ifdef HAVE_LINUX_REGSETS - if (regsets_fetch_inferior_registers (regcache) == 0) - return; -#endif -#ifdef HAVE_LINUX_USRREGS - usr_fetch_inferior_registers (regcache, regno); -#endif -} - -void -linux_store_registers (struct regcache *regcache, int regno) -{ -#ifdef HAVE_LINUX_REGSETS - if (regsets_store_inferior_registers (regcache) == 0) - return; -#endif -#ifdef HAVE_LINUX_USRREGS - usr_store_inferior_registers (regcache, regno); -#endif -} - - -/* Copy LEN bytes from inferior's memory starting at MEMADDR - to debugger memory starting at MYADDR. */ - -static int -linux_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) - / sizeof (PTRACE_XFER_TYPE); - /* Allocate buffer of that many longwords. */ - register PTRACE_XFER_TYPE *buffer - = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE)); - int fd; - char filename[64]; - int pid = lwpid_of (get_thread_lwp (current_inferior)); - - /* Try using /proc. Don't bother for one word. */ - if (len >= 3 * sizeof (long)) - { - /* We could keep this file open and cache it - possibly one per - thread. That requires some juggling, but is even faster. */ - sprintf (filename, "/proc/%d/mem", pid); - fd = open (filename, O_RDONLY | O_LARGEFILE); - if (fd == -1) - goto no_proc; - - /* If pread64 is available, use it. It's faster if the kernel - supports it (only one syscall), and it's 64-bit safe even on - 32-bit platforms (for instance, SPARC debugging a SPARC64 - application). */ -#ifdef HAVE_PREAD64 - if (pread64 (fd, myaddr, len, memaddr) != len) -#else - if (lseek (fd, memaddr, SEEK_SET) == -1 || read (fd, myaddr, len) != len) -#endif - { - close (fd); - goto no_proc; - } - - close (fd); - return 0; - } - - no_proc: - /* Read all the longwords */ - for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE)) - { - errno = 0; - /* Coerce the 3rd arg to a uintptr_t first to avoid potential gcc warning - about coercing an 8 byte integer to a 4 byte pointer. */ - buffer[i] = ptrace (PTRACE_PEEKTEXT, pid, - (PTRACE_ARG3_TYPE) (uintptr_t) addr, 0); - if (errno) - return errno; - } - - /* Copy appropriate bytes out of the buffer. */ - memcpy (myaddr, - (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), - len); - - return 0; -} - -/* Copy LEN bytes of data from debugger memory at MYADDR to inferior's - memory at MEMADDR. On failure (cannot write to the inferior) - returns the value of errno. */ - -static int -linux_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) - / sizeof (PTRACE_XFER_TYPE); - - /* Allocate buffer of that many longwords. */ - register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) - alloca (count * sizeof (PTRACE_XFER_TYPE)); - - int pid = lwpid_of (get_thread_lwp (current_inferior)); - - if (debug_threads) - { - /* Dump up to four bytes. */ - unsigned int val = * (unsigned int *) myaddr; - if (len == 1) - val = val & 0xff; - else if (len == 2) - val = val & 0xffff; - else if (len == 3) - val = val & 0xffffff; - fprintf (stderr, "Writing %0*x to 0x%08lx\n", 2 * ((len < 4) ? len : 4), - val, (long)memaddr); - } - - /* Fill start and end extra bytes of buffer with existing memory data. */ - - errno = 0; - /* Coerce the 3rd arg to a uintptr_t first to avoid potential gcc warning - about coercing an 8 byte integer to a 4 byte pointer. */ - buffer[0] = ptrace (PTRACE_PEEKTEXT, pid, - (PTRACE_ARG3_TYPE) (uintptr_t) addr, 0); - if (errno) - return errno; - - if (count > 1) - { - errno = 0; - buffer[count - 1] - = ptrace (PTRACE_PEEKTEXT, pid, - /* Coerce to a uintptr_t first to avoid potential gcc warning - about coercing an 8 byte integer to a 4 byte pointer. */ - (PTRACE_ARG3_TYPE) (uintptr_t) (addr + (count - 1) - * sizeof (PTRACE_XFER_TYPE)), - 0); - if (errno) - return errno; - } - - /* Copy data to be written over corresponding part of buffer. */ - - memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), - myaddr, len); - - /* Write the entire buffer. */ - - for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE)) - { - errno = 0; - ptrace (PTRACE_POKETEXT, pid, - /* Coerce to a uintptr_t first to avoid potential gcc warning - about coercing an 8 byte integer to a 4 byte pointer. */ - (PTRACE_ARG3_TYPE) (uintptr_t) addr, - (PTRACE_ARG4_TYPE) buffer[i]); - if (errno) - return errno; - } - - return 0; -} - -/* Non-zero if the kernel supports PTRACE_O_TRACEFORK. */ -static int linux_supports_tracefork_flag; - -static void -linux_enable_event_reporting (int pid) -{ - if (!linux_supports_tracefork_flag) - return; - - ptrace (PTRACE_SETOPTIONS, pid, 0, (PTRACE_ARG4_TYPE) PTRACE_O_TRACECLONE); -} - -/* Helper functions for linux_test_for_tracefork, called via clone (). */ - -static int -linux_tracefork_grandchild (void *arg) -{ - _exit (0); -} - -#define STACK_SIZE 4096 - -static int -linux_tracefork_child (void *arg) -{ - ptrace (PTRACE_TRACEME, 0, 0, 0); - kill (getpid (), SIGSTOP); - -#if !(defined(__UCLIBC__) && defined(HAS_NOMMU)) - - if (fork () == 0) - linux_tracefork_grandchild (NULL); - -#else /* defined(__UCLIBC__) && defined(HAS_NOMMU) */ - -#ifdef __ia64__ - __clone2 (linux_tracefork_grandchild, arg, STACK_SIZE, - CLONE_VM | SIGCHLD, NULL); -#else - clone (linux_tracefork_grandchild, (char *) arg + STACK_SIZE, - CLONE_VM | SIGCHLD, NULL); -#endif - -#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */ - - _exit (0); -} - -/* Determine if PTRACE_O_TRACEFORK can be used to follow fork events. Make - sure that we can enable the option, and that it had the desired - effect. */ - -static void -linux_test_for_tracefork (void) -{ - int child_pid, ret, status; - long second_pid; -#if defined(__UCLIBC__) && defined(HAS_NOMMU) - char *stack = xmalloc (STACK_SIZE * 4); -#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */ - - linux_supports_tracefork_flag = 0; - -#if !(defined(__UCLIBC__) && defined(HAS_NOMMU)) - - child_pid = fork (); - if (child_pid == 0) - linux_tracefork_child (NULL); - -#else /* defined(__UCLIBC__) && defined(HAS_NOMMU) */ - - /* Use CLONE_VM instead of fork, to support uClinux (no MMU). */ -#ifdef __ia64__ - child_pid = __clone2 (linux_tracefork_child, stack, STACK_SIZE, - CLONE_VM | SIGCHLD, stack + STACK_SIZE * 2); -#else /* !__ia64__ */ - child_pid = clone (linux_tracefork_child, stack + STACK_SIZE, - CLONE_VM | SIGCHLD, stack + STACK_SIZE * 2); -#endif /* !__ia64__ */ - -#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */ - - if (child_pid == -1) - perror_with_name ("clone"); - - ret = my_waitpid (child_pid, &status, 0); - if (ret == -1) - perror_with_name ("waitpid"); - else if (ret != child_pid) - error ("linux_test_for_tracefork: waitpid: unexpected result %d.", ret); - if (! WIFSTOPPED (status)) - error ("linux_test_for_tracefork: waitpid: unexpected status %d.", status); - - ret = ptrace (PTRACE_SETOPTIONS, child_pid, 0, - (PTRACE_ARG4_TYPE) PTRACE_O_TRACEFORK); - if (ret != 0) - { - ret = ptrace (PTRACE_KILL, child_pid, 0, 0); - if (ret != 0) - { - warning ("linux_test_for_tracefork: failed to kill child"); - return; - } - - ret = my_waitpid (child_pid, &status, 0); - if (ret != child_pid) - warning ("linux_test_for_tracefork: failed to wait for killed child"); - else if (!WIFSIGNALED (status)) - warning ("linux_test_for_tracefork: unexpected wait status 0x%x from " - "killed child", status); - - return; - } - - ret = ptrace (PTRACE_CONT, child_pid, 0, 0); - if (ret != 0) - warning ("linux_test_for_tracefork: failed to resume child"); - - ret = my_waitpid (child_pid, &status, 0); - - if (ret == child_pid && WIFSTOPPED (status) - && status >> 16 == PTRACE_EVENT_FORK) - { - second_pid = 0; - ret = ptrace (PTRACE_GETEVENTMSG, child_pid, 0, &second_pid); - if (ret == 0 && second_pid != 0) - { - int second_status; - - linux_supports_tracefork_flag = 1; - my_waitpid (second_pid, &second_status, 0); - ret = ptrace (PTRACE_KILL, second_pid, 0, 0); - if (ret != 0) - warning ("linux_test_for_tracefork: failed to kill second child"); - my_waitpid (second_pid, &status, 0); - } - } - else - warning ("linux_test_for_tracefork: unexpected result from waitpid " - "(%d, status 0x%x)", ret, status); - - do - { - ret = ptrace (PTRACE_KILL, child_pid, 0, 0); - if (ret != 0) - warning ("linux_test_for_tracefork: failed to kill child"); - my_waitpid (child_pid, &status, 0); - } - while (WIFSTOPPED (status)); - -#if defined(__UCLIBC__) && defined(HAS_NOMMU) - free (stack); -#endif /* defined(__UCLIBC__) && defined(HAS_NOMMU) */ -} - - -static void -linux_look_up_symbols (void) -{ -#ifdef USE_THREAD_DB - struct process_info *proc = current_process (); - - if (proc->private->thread_db != NULL) - return; - - /* If the kernel supports tracing forks then it also supports tracing - clones, and then we don't need to use the magic thread event breakpoint - to learn about threads. */ - thread_db_init (!linux_supports_tracefork_flag); -#endif -} - -static void -linux_request_interrupt (void) -{ - extern unsigned long signal_pid; - - if (!ptid_equal (cont_thread, null_ptid) - && !ptid_equal (cont_thread, minus_one_ptid)) - { - struct lwp_info *lwp; - int lwpid; - - lwp = get_thread_lwp (current_inferior); - lwpid = lwpid_of (lwp); - kill_lwp (lwpid, SIGINT); - } - else - kill_lwp (signal_pid, SIGINT); -} - -/* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET - to debugger memory starting at MYADDR. */ - -static int -linux_read_auxv (CORE_ADDR offset, unsigned char *myaddr, unsigned int len) -{ - char filename[PATH_MAX]; - int fd, n; - int pid = lwpid_of (get_thread_lwp (current_inferior)); - - xsnprintf (filename, sizeof filename, "/proc/%d/auxv", pid); - - fd = open (filename, O_RDONLY); - if (fd < 0) - return -1; - - if (offset != (CORE_ADDR) 0 - && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset) - n = -1; - else - n = read (fd, myaddr, len); - - close (fd); - - return n; -} - -/* These breakpoint and watchpoint related wrapper functions simply - pass on the function call if the target has registered a - corresponding function. */ - -static int -linux_insert_point (char type, CORE_ADDR addr, int len) -{ - if (the_low_target.insert_point != NULL) - return the_low_target.insert_point (type, addr, len); - else - /* Unsupported (see target.h). */ - return 1; -} - -static int -linux_remove_point (char type, CORE_ADDR addr, int len) -{ - if (the_low_target.remove_point != NULL) - return the_low_target.remove_point (type, addr, len); - else - /* Unsupported (see target.h). */ - return 1; -} - -static int -linux_stopped_by_watchpoint (void) -{ - struct lwp_info *lwp = get_thread_lwp (current_inferior); - - return lwp->stopped_by_watchpoint; -} - -static CORE_ADDR -linux_stopped_data_address (void) -{ - struct lwp_info *lwp = get_thread_lwp (current_inferior); - - return lwp->stopped_data_address; -} - -#if defined(__UCLIBC__) && defined(HAS_NOMMU) -#if defined(__mcoldfire__) -/* These should really be defined in the kernel's ptrace.h header. */ -#define PT_TEXT_ADDR 49*4 -#define PT_DATA_ADDR 50*4 -#define PT_TEXT_END_ADDR 51*4 -#elif defined(BFIN) -#define PT_TEXT_ADDR 220 -#define PT_TEXT_END_ADDR 224 -#define PT_DATA_ADDR 228 -#elif defined(__TMS320C6X__) -#define PT_TEXT_ADDR (0x10000*4) -#define PT_DATA_ADDR (0x10004*4) -#define PT_TEXT_END_ADDR (0x10008*4) -#endif - -/* Under uClinux, programs are loaded at non-zero offsets, which we need - to tell gdb about. */ - -static int -linux_read_offsets (CORE_ADDR *text_p, CORE_ADDR *data_p) -{ -#if defined(PT_TEXT_ADDR) && defined(PT_DATA_ADDR) && defined(PT_TEXT_END_ADDR) - unsigned long text, text_end, data; - int pid = lwpid_of (get_thread_lwp (current_inferior)); - - errno = 0; - - text = ptrace (PTRACE_PEEKUSER, pid, (long)PT_TEXT_ADDR, 0); - text_end = ptrace (PTRACE_PEEKUSER, pid, (long)PT_TEXT_END_ADDR, 0); - data = ptrace (PTRACE_PEEKUSER, pid, (long)PT_DATA_ADDR, 0); - - if (errno == 0) - { - /* Both text and data offsets produced at compile-time (and so - used by gdb) are relative to the beginning of the program, - with the data segment immediately following the text segment. - However, the actual runtime layout in memory may put the data - somewhere else, so when we send gdb a data base-address, we - use the real data base address and subtract the compile-time - data base-address from it (which is just the length of the - text segment). BSS immediately follows data in both - cases. */ - *text_p = text; - *data_p = data - (text_end - text); - - return 1; - } -#endif - return 0; -} -#endif - -static int -linux_qxfer_osdata (const char *annex, - unsigned char *readbuf, unsigned const char *writebuf, - CORE_ADDR offset, int len) -{ - return linux_common_xfer_osdata (annex, readbuf, offset, len); -} - -/* Convert a native/host siginfo object, into/from the siginfo in the - layout of the inferiors' architecture. */ - -static void -siginfo_fixup (struct siginfo *siginfo, void *inf_siginfo, int direction) -{ - int done = 0; - - if (the_low_target.siginfo_fixup != NULL) - done = the_low_target.siginfo_fixup (siginfo, inf_siginfo, direction); - - /* If there was no callback, or the callback didn't do anything, - then just do a straight memcpy. */ - if (!done) - { - if (direction == 1) - memcpy (siginfo, inf_siginfo, sizeof (struct siginfo)); - else - memcpy (inf_siginfo, siginfo, sizeof (struct siginfo)); - } -} - -static int -linux_xfer_siginfo (const char *annex, unsigned char *readbuf, - unsigned const char *writebuf, CORE_ADDR offset, int len) -{ - int pid; - struct siginfo siginfo; - char inf_siginfo[sizeof (struct siginfo)]; - - if (current_inferior == NULL) - return -1; - - pid = lwpid_of (get_thread_lwp (current_inferior)); - - if (debug_threads) - fprintf (stderr, "%s siginfo for lwp %d.\n", - readbuf != NULL ? "Reading" : "Writing", - pid); - - if (offset >= sizeof (siginfo)) - return -1; - - if (ptrace (PTRACE_GETSIGINFO, pid, 0, &siginfo) != 0) - return -1; - - /* When GDBSERVER is built as a 64-bit application, ptrace writes into - SIGINFO an object with 64-bit layout. Since debugging a 32-bit - inferior with a 64-bit GDBSERVER should look the same as debugging it - with a 32-bit GDBSERVER, we need to convert it. */ - siginfo_fixup (&siginfo, inf_siginfo, 0); - - if (offset + len > sizeof (siginfo)) - len = sizeof (siginfo) - offset; - - if (readbuf != NULL) - memcpy (readbuf, inf_siginfo + offset, len); - else - { - memcpy (inf_siginfo + offset, writebuf, len); - - /* Convert back to ptrace layout before flushing it out. */ - siginfo_fixup (&siginfo, inf_siginfo, 1); - - if (ptrace (PTRACE_SETSIGINFO, pid, 0, &siginfo) != 0) - return -1; - } - - return len; -} - -/* SIGCHLD handler that serves two purposes: In non-stop/async mode, - so we notice when children change state; as the handler for the - sigsuspend in my_waitpid. */ - -static void -sigchld_handler (int signo) -{ - int old_errno = errno; - - if (debug_threads) - { - do - { - /* fprintf is not async-signal-safe, so call write - directly. */ - if (write (2, "sigchld_handler\n", - sizeof ("sigchld_handler\n") - 1) < 0) - break; /* just ignore */ - } while (0); - } - - if (target_is_async_p ()) - async_file_mark (); /* trigger a linux_wait */ - - errno = old_errno; -} - -static int -linux_supports_non_stop (void) -{ - return 1; -} - -static int -linux_async (int enable) -{ - int previous = (linux_event_pipe[0] != -1); - - if (debug_threads) - fprintf (stderr, "linux_async (%d), previous=%d\n", - enable, previous); - - if (previous != enable) - { - sigset_t mask; - sigemptyset (&mask); - sigaddset (&mask, SIGCHLD); - - sigprocmask (SIG_BLOCK, &mask, NULL); - - if (enable) - { - if (pipe (linux_event_pipe) == -1) - fatal ("creating event pipe failed."); - - fcntl (linux_event_pipe[0], F_SETFL, O_NONBLOCK); - fcntl (linux_event_pipe[1], F_SETFL, O_NONBLOCK); - - /* Register the event loop handler. */ - add_file_handler (linux_event_pipe[0], - handle_target_event, NULL); - - /* Always trigger a linux_wait. */ - async_file_mark (); - } - else - { - delete_file_handler (linux_event_pipe[0]); - - close (linux_event_pipe[0]); - close (linux_event_pipe[1]); - linux_event_pipe[0] = -1; - linux_event_pipe[1] = -1; - } - - sigprocmask (SIG_UNBLOCK, &mask, NULL); - } - - return previous; -} - -static int -linux_start_non_stop (int nonstop) -{ - /* Register or unregister from event-loop accordingly. */ - linux_async (nonstop); - return 0; -} - -static int -linux_supports_multi_process (void) -{ - return 1; -} - - -/* Enumerate spufs IDs for process PID. */ -static int -spu_enumerate_spu_ids (long pid, unsigned char *buf, CORE_ADDR offset, int len) -{ - int pos = 0; - int written = 0; - char path[128]; - DIR *dir; - struct dirent *entry; - - sprintf (path, "/proc/%ld/fd", pid); - dir = opendir (path); - if (!dir) - return -1; - - rewinddir (dir); - while ((entry = readdir (dir)) != NULL) - { - struct stat st; - struct statfs stfs; - int fd; - - fd = atoi (entry->d_name); - if (!fd) - continue; - - sprintf (path, "/proc/%ld/fd/%d", pid, fd); - if (stat (path, &st) != 0) - continue; - if (!S_ISDIR (st.st_mode)) - continue; - - if (statfs (path, &stfs) != 0) - continue; - if (stfs.f_type != SPUFS_MAGIC) - continue; - - if (pos >= offset && pos + 4 <= offset + len) - { - *(unsigned int *)(buf + pos - offset) = fd; - written += 4; - } - pos += 4; - } - - closedir (dir); - return written; -} - -/* Implements the to_xfer_partial interface for the TARGET_OBJECT_SPU - object type, using the /proc file system. */ -static int -linux_qxfer_spu (const char *annex, unsigned char *readbuf, - unsigned const char *writebuf, - CORE_ADDR offset, int len) -{ - long pid = lwpid_of (get_thread_lwp (current_inferior)); - char buf[128]; - int fd = 0; - int ret = 0; - - if (!writebuf && !readbuf) - return -1; - - if (!*annex) - { - if (!readbuf) - return -1; - else - return spu_enumerate_spu_ids (pid, readbuf, offset, len); - } - - sprintf (buf, "/proc/%ld/fd/%s", pid, annex); - fd = open (buf, writebuf? O_WRONLY : O_RDONLY); - if (fd <= 0) - return -1; - - if (offset != 0 - && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset) - { - close (fd); - return 0; - } - - if (writebuf) - ret = write (fd, writebuf, (size_t) len); - else - ret = read (fd, readbuf, (size_t) len); - - close (fd); - return ret; -} - -#if defined PT_GETDSBT -struct target_loadseg -{ - /* Core address to which the segment is mapped. */ - Elf32_Addr addr; - /* VMA recorded in the program header. */ - Elf32_Addr p_vaddr; - /* Size of this segment in memory. */ - Elf32_Word p_memsz; -}; - -struct target_loadmap -{ - /* Protocol version number, must be zero. */ - Elf32_Word version; - /* Pointer to the DSBT table, its size, and the DSBT index. */ - unsigned *dsbt_table; - unsigned dsbt_size, dsbt_index; - /* Number of segments in this map. */ - Elf32_Word nsegs; - /* The actual memory map. */ - struct target_loadseg segs[/*nsegs*/]; -}; -#endif - -#if defined PT_GETDSBT -static int -linux_read_loadmap (const char *annex, CORE_ADDR offset, - unsigned char *myaddr, unsigned int len) -{ - int pid = lwpid_of (get_thread_lwp (current_inferior)); - int addr = -1; - struct target_loadmap *data = NULL; - unsigned int actual_length, copy_length; - - if (strcmp (annex, "exec") == 0) - addr= (int) PTRACE_GETDSBT_EXEC; - else if (strcmp (annex, "interp") == 0) - addr = (int) PTRACE_GETDSBT_INTERP; - else - return -1; - - if (ptrace (PT_GETDSBT, pid, addr, &data) != 0) - return -1; - - if (data == NULL) - return -1; - - actual_length = sizeof (struct target_loadmap) - + sizeof (struct target_loadseg) * data->nsegs; - - if (offset < 0 || offset > actual_length) - return -1; - - copy_length = actual_length - offset < len ? actual_length - offset : len; - memcpy (myaddr, (char *) data + offset, copy_length); - return copy_length; -} -#endif /* defined PT_GETDSBT */ - -static void -linux_process_qsupported (const char *query) -{ - if (the_low_target.process_qsupported != NULL) - the_low_target.process_qsupported (query); -} - -static int -linux_supports_tracepoints (void) -{ - if (*the_low_target.supports_tracepoints == NULL) - return 0; - - return (*the_low_target.supports_tracepoints) (); -} - -static CORE_ADDR -linux_read_pc (struct regcache *regcache) -{ - if (the_low_target.get_pc == NULL) - return 0; - - return (*the_low_target.get_pc) (regcache); -} - -static void -linux_write_pc (struct regcache *regcache, CORE_ADDR pc) -{ - gdb_assert (the_low_target.set_pc != NULL); - - (*the_low_target.set_pc) (regcache, pc); -} - -static int -linux_thread_stopped (struct thread_info *thread) -{ - return get_thread_lwp (thread)->stopped; -} - -/* This exposes stop-all-threads functionality to other modules. */ - -static void -linux_pause_all (int freeze) -{ - stop_all_lwps (freeze, NULL); -} - -/* This exposes unstop-all-threads functionality to other gdbserver - modules. */ - -static void -linux_unpause_all (int unfreeze) -{ - unstop_all_lwps (unfreeze, NULL); -} - -static int -linux_prepare_to_access_memory (void) -{ - /* Neither ptrace nor /proc/PID/mem allow accessing memory through a - running LWP. */ - if (non_stop) - linux_pause_all (1); - return 0; -} - -static void -linux_done_accessing_memory (void) -{ - /* Neither ptrace nor /proc/PID/mem allow accessing memory through a - running LWP. */ - if (non_stop) - linux_unpause_all (1); -} - -static int -linux_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr, - CORE_ADDR collector, - CORE_ADDR lockaddr, - ULONGEST orig_size, - CORE_ADDR *jump_entry, - unsigned char *jjump_pad_insn, - ULONGEST *jjump_pad_insn_size, - CORE_ADDR *adjusted_insn_addr, - CORE_ADDR *adjusted_insn_addr_end) -{ - return (*the_low_target.install_fast_tracepoint_jump_pad) - (tpoint, tpaddr, collector, lockaddr, orig_size, - jump_entry, jjump_pad_insn, jjump_pad_insn_size, - adjusted_insn_addr, adjusted_insn_addr_end); -} - -static struct emit_ops * -linux_emit_ops (void) -{ - if (the_low_target.emit_ops != NULL) - return (*the_low_target.emit_ops) (); - else - return NULL; -} - -static struct target_ops linux_target_ops = { - linux_create_inferior, - linux_attach, - linux_kill, - linux_detach, - linux_mourn, - linux_join, - linux_thread_alive, - linux_resume, - linux_wait, - linux_fetch_registers, - linux_store_registers, - linux_prepare_to_access_memory, - linux_done_accessing_memory, - linux_read_memory, - linux_write_memory, - linux_look_up_symbols, - linux_request_interrupt, - linux_read_auxv, - linux_insert_point, - linux_remove_point, - linux_stopped_by_watchpoint, - linux_stopped_data_address, -#if defined(__UCLIBC__) && defined(HAS_NOMMU) - linux_read_offsets, -#else - NULL, -#endif -#ifdef USE_THREAD_DB - thread_db_get_tls_address, -#else - NULL, -#endif - linux_qxfer_spu, - hostio_last_error_from_errno, - linux_qxfer_osdata, - linux_xfer_siginfo, - linux_supports_non_stop, - linux_async, - linux_start_non_stop, - linux_supports_multi_process, -#ifdef USE_THREAD_DB - thread_db_handle_monitor_command, -#else - NULL, -#endif - linux_common_core_of_thread, -#if defined PT_GETDSBT - linux_read_loadmap, -#else - NULL, -#endif - linux_process_qsupported, - linux_supports_tracepoints, - linux_read_pc, - linux_write_pc, - linux_thread_stopped, - NULL, - linux_pause_all, - linux_unpause_all, - linux_cancel_breakpoints, - linux_stabilize_threads, - linux_install_fast_tracepoint_jump_pad, - linux_emit_ops -}; - -static void -linux_init_signals () -{ - /* FIXME drow/2002-06-09: As above, we should check with LinuxThreads - to find what the cancel signal actually is. */ -#ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */ - signal (__SIGRTMIN+1, SIG_IGN); -#endif -} - -void -initialize_low (void) -{ - struct sigaction sigchld_action; - memset (&sigchld_action, 0, sizeof (sigchld_action)); - set_target_ops (&linux_target_ops); - set_breakpoint_data (the_low_target.breakpoint, - the_low_target.breakpoint_len); - linux_init_signals (); - linux_test_for_tracefork (); -#ifdef HAVE_LINUX_REGSETS - for (num_regsets = 0; target_regsets[num_regsets].size >= 0; num_regsets++) - ; - disabled_regsets = xmalloc (num_regsets); -#endif - - sigchld_action.sa_handler = sigchld_handler; - sigemptyset (&sigchld_action.sa_mask); - sigchld_action.sa_flags = SA_RESTART; - sigaction (SIGCHLD, &sigchld_action, NULL); -} diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h deleted file mode 100644 index 6635bc656f9..00000000000 --- a/gdb/gdbserver/linux-low.h +++ /dev/null @@ -1,271 +0,0 @@ -/* Internal interfaces for the GNU/Linux specific target code for gdbserver. - Copyright (C) 2002, 2004, 2005, 2007, 2008, 2009, 2010, 2011 - 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/>. */ - -#ifdef HAVE_THREAD_DB_H -#include <thread_db.h> -#endif - -#include "gdb_proc_service.h" - -#ifdef HAVE_LINUX_REGSETS -typedef void (*regset_fill_func) (struct regcache *, void *); -typedef void (*regset_store_func) (struct regcache *, const void *); -enum regset_type { - GENERAL_REGS, - FP_REGS, - EXTENDED_REGS, -}; - -struct regset_info -{ - int get_request, set_request; - /* If NT_TYPE isn't 0, it will be passed to ptrace as the 3rd - argument and the 4th argument should be "const struct iovec *". */ - int nt_type; - int size; - enum regset_type type; - regset_fill_func fill_function; - regset_store_func store_function; -}; -extern struct regset_info target_regsets[]; -#endif - -struct siginfo; - -struct process_info_private -{ - /* Arch-specific additions. */ - struct arch_process_info *arch_private; - - /* libthread_db-specific additions. Not NULL if this process has loaded - thread_db, and it is active. */ - struct thread_db *thread_db; -}; - -struct lwp_info; - -struct linux_target_ops -{ - /* Architecture-specific setup. */ - void (*arch_setup) (void); - - int num_regs; - int *regmap; - int (*cannot_fetch_register) (int); - - /* Returns 0 if we can store the register, 1 if we can not - store the register, and 2 if failure to store the register - is acceptable. */ - int (*cannot_store_register) (int); - CORE_ADDR (*get_pc) (struct regcache *regcache); - void (*set_pc) (struct regcache *regcache, CORE_ADDR newpc); - const unsigned char *breakpoint; - int breakpoint_len; - CORE_ADDR (*breakpoint_reinsert_addr) (void); - - int decr_pc_after_break; - int (*breakpoint_at) (CORE_ADDR pc); - - /* Breakpoint and watchpoint related functions. See target.h for - comments. */ - int (*insert_point) (char type, CORE_ADDR addr, int len); - int (*remove_point) (char type, CORE_ADDR addr, int len); - int (*stopped_by_watchpoint) (void); - CORE_ADDR (*stopped_data_address) (void); - - /* Hooks to reformat register data for PEEKUSR/POKEUSR (in particular - for registers smaller than an xfer unit). */ - void (*collect_ptrace_register) (struct regcache *regcache, - int regno, char *buf); - void (*supply_ptrace_register) (struct regcache *regcache, - int regno, const char *buf); - - /* Hook to convert from target format to ptrace format and back. - Returns true if any conversion was done; false otherwise. - If DIRECTION is 1, then copy from INF to NATIVE. - If DIRECTION is 0, copy from NATIVE to INF. */ - int (*siginfo_fixup) (struct siginfo *native, void *inf, int direction); - - /* Hook to call when a new process is created or attached to. - If extra per-process architecture-specific data is needed, - allocate it here. */ - struct arch_process_info * (*new_process) (void); - - /* Hook to call when a new thread is detected. - If extra per-thread architecture-specific data is needed, - allocate it here. */ - struct arch_lwp_info * (*new_thread) (void); - - /* Hook to call prior to resuming a thread. */ - void (*prepare_to_resume) (struct lwp_info *); - - /* Hook to support target specific qSupported. */ - void (*process_qsupported) (const char *); - - /* Returns true if the low target supports tracepoints. */ - int (*supports_tracepoints) (void); - - /* Fill ADDRP with the thread area address of LWPID. Returns 0 on - success, -1 on failure. */ - int (*get_thread_area) (int lwpid, CORE_ADDR *addrp); - - /* Install a fast tracepoint jump pad. See target.h for - comments. */ - int (*install_fast_tracepoint_jump_pad) (CORE_ADDR tpoint, CORE_ADDR tpaddr, - CORE_ADDR collector, - CORE_ADDR lockaddr, - ULONGEST orig_size, - CORE_ADDR *jump_entry, - unsigned char *jjump_pad_insn, - ULONGEST *jjump_pad_insn_size, - CORE_ADDR *adjusted_insn_addr, - CORE_ADDR *adjusted_insn_addr_end); - - /* Return the bytecode operations vector for the current inferior. - Returns NULL if bytecode compilation is not supported. */ - struct emit_ops *(*emit_ops) (void); -}; - -extern struct linux_target_ops the_low_target; - -#define ptid_of(proc) ((proc)->head.id) -#define pid_of(proc) ptid_get_pid ((proc)->head.id) -#define lwpid_of(proc) ptid_get_lwp ((proc)->head.id) - -#define get_lwp(inf) ((struct lwp_info *)(inf)) -#define get_thread_lwp(thr) (get_lwp (inferior_target_data (thr))) -#define get_lwp_thread(proc) ((struct thread_info *) \ - find_inferior_id (&all_threads, \ - get_lwp (proc)->head.id)) - -struct lwp_info -{ - struct inferior_list_entry head; - - /* If this flag is set, the next SIGSTOP will be ignored (the - process will be immediately resumed). This means that either we - sent the SIGSTOP to it ourselves and got some other pending event - (so the SIGSTOP is still pending), or that we stopped the - inferior implicitly via PTRACE_ATTACH and have not waited for it - yet. */ - int stop_expected; - - /* When this is true, we shall not try to resume this thread, even - if last_resume_kind isn't resume_stop. */ - int suspended; - - /* If this flag is set, the lwp is known to be stopped right now (stop - event already received in a wait()). */ - int stopped; - - /* If this flag is set, the lwp is known to be dead already (exit - event already received in a wait(), and is cached in - status_pending). */ - int dead; - - /* When stopped is set, the last wait status recorded for this lwp. */ - int last_status; - - /* When stopped is set, this is where the lwp stopped, with - decr_pc_after_break already accounted for. */ - CORE_ADDR stop_pc; - - /* If this flag is set, STATUS_PENDING is a waitstatus that has not yet - been reported. */ - int status_pending_p; - int status_pending; - - /* STOPPED_BY_WATCHPOINT is non-zero if this LWP stopped with a data - watchpoint trap. */ - int stopped_by_watchpoint; - - /* On architectures where it is possible to know the data address of - a triggered watchpoint, STOPPED_DATA_ADDRESS is non-zero, and - contains such data address. Only valid if STOPPED_BY_WATCHPOINT - is true. */ - CORE_ADDR stopped_data_address; - - /* If this is non-zero, it is a breakpoint to be reinserted at our next - stop (SIGTRAP stops only). */ - CORE_ADDR bp_reinsert; - - /* If this flag is set, the last continue operation at the ptrace - level on this process was a single-step. */ - int stepping; - - /* If this flag is set, we need to set the event request flags the - next time we see this LWP stop. */ - int must_set_ptrace_flags; - - /* If this is non-zero, it points to a chain of signals which need to - be delivered to this process. */ - struct pending_signals *pending_signals; - - /* A link used when resuming. It is initialized from the resume request, - and then processed and cleared in linux_resume_one_lwp. */ - struct thread_resume *resume; - - /* True if it is known that this lwp is presently collecting a fast - tracepoint (it is in the jump pad or in some code that will - return to the jump pad. Normally, we won't care about this, but - we will if a signal arrives to this lwp while it is - collecting. */ - int collecting_fast_tracepoint; - - /* If this is non-zero, it points to a chain of signals which need - to be reported to GDB. These were deferred because the thread - was doing a fast tracepoint collect when they arrived. */ - struct pending_signals *pending_signals_to_report; - - /* When collecting_fast_tracepoint is first found to be 1, we insert - a exit-jump-pad-quickly breakpoint. This is it. */ - struct breakpoint *exit_jump_pad_bkpt; - - /* True if the LWP was seen stop at an internal breakpoint and needs - stepping over later when it is resumed. */ - int need_step_over; - - int thread_known; -#ifdef HAVE_THREAD_DB_H - /* The thread handle, used for e.g. TLS access. Only valid if - THREAD_KNOWN is set. */ - td_thrhandle_t th; -#endif - - /* Arch-specific additions. */ - struct arch_lwp_info *arch_private; -}; - -extern struct inferior_list all_lwps; - -char *linux_child_pid_to_exec_file (int pid); -int elf_64_file_p (const char *file); - -void linux_attach_lwp (unsigned long pid); -struct lwp_info *find_lwp_pid (ptid_t ptid); -void linux_stop_lwp (struct lwp_info *lwp); - -/* From thread-db.c */ -int thread_db_init (int use_events); -void thread_db_detach (struct process_info *); -void thread_db_mourn (struct process_info *); -int thread_db_handle_monitor_command (char *); -int thread_db_get_tls_address (struct thread_info *thread, CORE_ADDR offset, - CORE_ADDR load_module, CORE_ADDR *address); -int thread_db_look_up_one_symbol (const char *name, CORE_ADDR *addrp); diff --git a/gdb/gdbserver/linux-m32r-low.c b/gdb/gdbserver/linux-m32r-low.c deleted file mode 100644 index cf5e106212f..00000000000 --- a/gdb/gdbserver/linux-m32r-low.c +++ /dev/null @@ -1,104 +0,0 @@ -/* GNU/Linux/m32r specific low level interface, for the remote server for GDB. - Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011 - 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" - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -/* Defined in auto-generated file reg-m32r.c. */ -void init_registers_m32r (void); - -#define m32r_num_regs 25 - -static int m32r_regmap[] = { -#ifdef PT_R0 - PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5, PT_R6, PT_R7, - PT_R8, PT_R9, PT_R10, PT_R11, PT_R12, PT_FP, PT_LR, PT_SPU, - PT_PSW, PT_CBR, PT_SPI, PT_SPU, PT_BPC, PT_PC, PT_ACCL, PT_ACCH, PT_EVB -#else - 4 * 4, 4 * 5, 4 * 6, 4 * 7, 4 * 0, 4 * 1, 4 * 2, 4 * 8, - 4 * 9, 4 * 10, 4 * 11, 4 * 12, 4 * 13, 4 * 24, 4 * 25, 4 * 23, - 4 * 19, 4 * 31, 4 * 26, 4 * 23, 4 * 20, 4 * 30, 4 * 16, 4 * 15, 4 * 32 -#endif -}; - -static int -m32r_cannot_store_register (int regno) -{ - return (regno >= m32r_num_regs); -} - -static int -m32r_cannot_fetch_register (int regno) -{ - return (regno >= m32r_num_regs); -} - -static CORE_ADDR -m32r_get_pc (struct regcache *regcache) -{ - unsigned long pc; - collect_register_by_name (regcache, "pc", &pc); - if (debug_threads) - fprintf (stderr, "stop pc is %08lx\n", pc); - return pc; -} - -static void -m32r_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name (regcache, "pc", &newpc); -} - -static const unsigned short m32r_breakpoint = 0x10f1; -#define m32r_breakpoint_len 2 - -static int -m32r_breakpoint_at (CORE_ADDR where) -{ - unsigned short insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, - m32r_breakpoint_len); - if (insn == m32r_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -struct linux_target_ops the_low_target = { - init_registers_m32r, - m32r_num_regs, - m32r_regmap, - m32r_cannot_fetch_register, - m32r_cannot_store_register, - m32r_get_pc, - m32r_set_pc, - (const unsigned char *) &m32r_breakpoint, - m32r_breakpoint_len, - NULL, - 0, - m32r_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c deleted file mode 100644 index f266997c24b..00000000000 --- a/gdb/gdbserver/linux-m68k-low.c +++ /dev/null @@ -1,191 +0,0 @@ -/* GNU/Linux/m68k specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2007, 2008, 2009, 2010, 2011 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" - -/* Defined in auto-generated file reg-m68k.c. */ -void init_registers_m68k (void); - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -#define m68k_num_regs 29 -#define m68k_num_gregs 18 - -/* This table must line up with REGISTER_NAMES in tm-m68k.h */ -static int m68k_regmap[] = -{ -#ifdef PT_D0 - PT_D0 * 4, PT_D1 * 4, PT_D2 * 4, PT_D3 * 4, - PT_D4 * 4, PT_D5 * 4, PT_D6 * 4, PT_D7 * 4, - PT_A0 * 4, PT_A1 * 4, PT_A2 * 4, PT_A3 * 4, - PT_A4 * 4, PT_A5 * 4, PT_A6 * 4, PT_USP * 4, - PT_SR * 4, PT_PC * 4, -#else - 14 * 4, 0 * 4, 1 * 4, 2 * 4, 3 * 4, 4 * 4, 5 * 4, 6 * 4, - 7 * 4, 8 * 4, 9 * 4, 10 * 4, 11 * 4, 12 * 4, 13 * 4, 15 * 4, - 17 * 4, 18 * 4, -#endif -#ifdef PT_FP0 - PT_FP0 * 4, PT_FP1 * 4, PT_FP2 * 4, PT_FP3 * 4, - PT_FP4 * 4, PT_FP5 * 4, PT_FP6 * 4, PT_FP7 * 4, - PT_FPCR * 4, PT_FPSR * 4, PT_FPIAR * 4 -#else - 21 * 4, 24 * 4, 27 * 4, 30 * 4, 33 * 4, 36 * 4, - 39 * 4, 42 * 4, 45 * 4, 46 * 4, 47 * 4 -#endif -}; - -static int -m68k_cannot_store_register (int regno) -{ - return (regno >= m68k_num_regs); -} - -static int -m68k_cannot_fetch_register (int regno) -{ - return (regno >= m68k_num_regs); -} - -#ifdef HAVE_PTRACE_GETREGS -#include <sys/procfs.h> -#include <sys/ptrace.h> - -static void -m68k_fill_gregset (struct regcache *regcache, void *buf) -{ - int i; - - for (i = 0; i < m68k_num_gregs; i++) - collect_register (regcache, i, (char *) buf + m68k_regmap[i]); -} - -static void -m68k_store_gregset (struct regcache *regcache, const void *buf) -{ - int i; - - for (i = 0; i < m68k_num_gregs; i++) - supply_register (regcache, i, (const char *) buf + m68k_regmap[i]); -} - -static void -m68k_fill_fpregset (struct regcache *regcache, void *buf) -{ - int i; - - for (i = m68k_num_gregs; i < m68k_num_regs; i++) - collect_register (regcache, i, ((char *) buf - + (m68k_regmap[i] - m68k_regmap[m68k_num_gregs]))); -} - -static void -m68k_store_fpregset (struct regcache *regcache, const void *buf) -{ - int i; - - for (i = m68k_num_gregs; i < m68k_num_regs; i++) - supply_register (regcache, i, ((const char *) buf - + (m68k_regmap[i] - m68k_regmap[m68k_num_gregs]))); -} - -#endif /* HAVE_PTRACE_GETREGS */ - -struct regset_info target_regsets[] = { -#ifdef HAVE_PTRACE_GETREGS - { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t), - GENERAL_REGS, - m68k_fill_gregset, m68k_store_gregset }, - { PTRACE_GETFPREGS, PTRACE_SETFPREGS, 0, sizeof (elf_fpregset_t), - FP_REGS, - m68k_fill_fpregset, m68k_store_fpregset }, -#endif /* HAVE_PTRACE_GETREGS */ - { 0, 0, 0, -1, -1, NULL, NULL } -}; - -static const unsigned char m68k_breakpoint[] = { 0x4E, 0x4F }; -#define m68k_breakpoint_len 2 - -static CORE_ADDR -m68k_get_pc (struct regcache *regcache) -{ - unsigned long pc; - - collect_register_by_name (regcache, "pc", &pc); - return pc; -} - -static void -m68k_set_pc (struct regcache *regcache, CORE_ADDR value) -{ - unsigned long newpc = value; - - supply_register_by_name (regcache, "pc", &newpc); -} - -static int -m68k_breakpoint_at (CORE_ADDR pc) -{ - unsigned char c[2]; - - read_inferior_memory (pc, c, 2); - if (c[0] == 0x4E && c[1] == 0x4F) - return 1; - - return 0; -} - -#include <asm/ptrace.h> - -#ifdef PTRACE_GET_THREAD_AREA -/* Fetch the thread-local storage pointer for libthread_db. */ - -ps_err_e -ps_get_thread_area (const struct ps_prochandle *ph, - lwpid_t lwpid, int idx, void **base) -{ - if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) - return PS_ERR; - - /* IDX is the bias from the thread pointer to the beginning of the - thread descriptor. It has to be subtracted due to implementation - quirks in libthread_db. */ - *base = (void *) ((char *)*base - idx); - - return PS_OK; -} -#endif /* PTRACE_GET_THREAD_AREA */ - -struct linux_target_ops the_low_target = { - init_registers_m68k, - m68k_num_regs, - m68k_regmap, - m68k_cannot_fetch_register, - m68k_cannot_store_register, - m68k_get_pc, - m68k_set_pc, - m68k_breakpoint, - m68k_breakpoint_len, - NULL, - 2, - m68k_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c deleted file mode 100644 index ec516724d35..00000000000 --- a/gdb/gdbserver/linux-mips-low.c +++ /dev/null @@ -1,371 +0,0 @@ -/* GNU/Linux/MIPS specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2005, 2006, 2007, - 2008, 2009, 2010, 2011 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 <endian.h> - -#include "gdb_proc_service.h" - -/* Defined in auto-generated file mips-linux.c. */ -void init_registers_mips_linux (void); -/* Defined in auto-generated file mips64-linux.c. */ -void init_registers_mips64_linux (void); - -#ifndef PTRACE_GET_THREAD_AREA -#define PTRACE_GET_THREAD_AREA 25 -#endif - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -#define mips_num_regs 73 - -#include <asm/ptrace.h> - -union mips_register -{ - unsigned char buf[8]; - - /* Deliberately signed, for proper sign extension. */ - int reg32; - long long reg64; -}; - -/* Return the ptrace ``address'' of register REGNO. */ - -static int mips_regmap[] = { - -1, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, - - -1, MMLO, MMHI, BADVADDR, CAUSE, PC, - - FPR_BASE, FPR_BASE + 1, FPR_BASE + 2, FPR_BASE + 3, - FPR_BASE + 4, FPR_BASE + 5, FPR_BASE + 6, FPR_BASE + 7, - FPR_BASE + 8, FPR_BASE + 8, FPR_BASE + 10, FPR_BASE + 11, - FPR_BASE + 12, FPR_BASE + 13, FPR_BASE + 14, FPR_BASE + 15, - FPR_BASE + 16, FPR_BASE + 17, FPR_BASE + 18, FPR_BASE + 19, - FPR_BASE + 20, FPR_BASE + 21, FPR_BASE + 22, FPR_BASE + 23, - FPR_BASE + 24, FPR_BASE + 25, FPR_BASE + 26, FPR_BASE + 27, - FPR_BASE + 28, FPR_BASE + 29, FPR_BASE + 30, FPR_BASE + 31, - FPC_CSR, FPC_EIR, - - 0 -}; - -/* From mips-linux-nat.c. */ - -/* Pseudo registers can not be read. ptrace does not provide a way to - read (or set) PS_REGNUM, and there's no point in reading or setting - ZERO_REGNUM. We also can not set BADVADDR, CAUSE, or FCRIR via - ptrace(). */ - -static int -mips_cannot_fetch_register (int regno) -{ - if (mips_regmap[regno] == -1) - return 1; - - if (find_regno ("r0") == regno) - return 1; - - return 0; -} - -static int -mips_cannot_store_register (int regno) -{ - if (mips_regmap[regno] == -1) - return 1; - - if (find_regno ("r0") == regno) - return 1; - - if (find_regno ("cause") == regno) - return 1; - - if (find_regno ("badvaddr") == regno) - return 1; - - if (find_regno ("fir") == regno) - return 1; - - return 0; -} - -static CORE_ADDR -mips_get_pc (struct regcache *regcache) -{ - union mips_register pc; - collect_register_by_name (regcache, "pc", pc.buf); - return register_size (0) == 4 ? pc.reg32 : pc.reg64; -} - -static void -mips_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - union mips_register newpc; - if (register_size (0) == 4) - newpc.reg32 = pc; - else - newpc.reg64 = pc; - - supply_register_by_name (regcache, "pc", newpc.buf); -} - -/* Correct in either endianness. */ -static const unsigned int mips_breakpoint = 0x0005000d; -#define mips_breakpoint_len 4 - -/* 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 -mips_reinsert_addr (void) -{ - struct regcache *regcache = get_thread_regcache (current_inferior, 1); - union mips_register ra; - collect_register_by_name (regcache, "r31", ra.buf); - return register_size (0) == 4 ? ra.reg32 : ra.reg64; -} - -static int -mips_breakpoint_at (CORE_ADDR where) -{ - unsigned int insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, 4); - if (insn == mips_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -/* Fetch the thread-local storage pointer for libthread_db. */ - -ps_err_e -ps_get_thread_area (const struct ps_prochandle *ph, - lwpid_t lwpid, int idx, void **base) -{ - if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) - return PS_ERR; - - /* IDX is the bias from the thread pointer to the beginning of the - thread descriptor. It has to be subtracted due to implementation - quirks in libthread_db. */ - *base = (void *) ((char *)*base - idx); - - return PS_OK; -} - -#ifdef HAVE_PTRACE_GETREGS - -static void -mips_collect_register (struct regcache *regcache, - int use_64bit, int regno, union mips_register *reg) -{ - union mips_register tmp_reg; - - if (use_64bit) - { - collect_register (regcache, regno, &tmp_reg.reg64); - *reg = tmp_reg; - } - else - { - collect_register (regcache, regno, &tmp_reg.reg32); - reg->reg64 = tmp_reg.reg32; - } -} - -static void -mips_supply_register (struct regcache *regcache, - int use_64bit, int regno, const union mips_register *reg) -{ - int offset = 0; - - /* For big-endian 32-bit targets, ignore the high four bytes of each - eight-byte slot. */ - if (__BYTE_ORDER == __BIG_ENDIAN && !use_64bit) - offset = 4; - - supply_register (regcache, regno, reg->buf + offset); -} - -static void -mips_collect_register_32bit (struct regcache *regcache, - int use_64bit, int regno, unsigned char *buf) -{ - union mips_register tmp_reg; - int reg32; - - mips_collect_register (regcache, use_64bit, regno, &tmp_reg); - reg32 = tmp_reg.reg64; - memcpy (buf, ®32, 4); -} - -static void -mips_supply_register_32bit (struct regcache *regcache, - int use_64bit, int regno, const unsigned char *buf) -{ - union mips_register tmp_reg; - int reg32; - - memcpy (®32, buf, 4); - tmp_reg.reg64 = reg32; - mips_supply_register (regcache, use_64bit, regno, &tmp_reg); -} - -static void -mips_fill_gregset (struct regcache *regcache, void *buf) -{ - union mips_register *regset = buf; - int i, use_64bit; - - use_64bit = (register_size (0) == 8); - - for (i = 1; i < 32; i++) - mips_collect_register (regcache, use_64bit, i, regset + i); - - mips_collect_register (regcache, use_64bit, - find_regno ("lo"), regset + 32); - mips_collect_register (regcache, use_64bit, - find_regno ("hi"), regset + 33); - mips_collect_register (regcache, use_64bit, - find_regno ("pc"), regset + 34); - mips_collect_register (regcache, use_64bit, - find_regno ("badvaddr"), regset + 35); - mips_collect_register (regcache, use_64bit, - find_regno ("status"), regset + 36); - mips_collect_register (regcache, use_64bit, - find_regno ("cause"), regset + 37); - - mips_collect_register (regcache, use_64bit, - find_regno ("restart"), regset + 0); -} - -static void -mips_store_gregset (struct regcache *regcache, const void *buf) -{ - const union mips_register *regset = buf; - int i, use_64bit; - - use_64bit = (register_size (0) == 8); - - for (i = 0; i < 32; i++) - mips_supply_register (regcache, use_64bit, i, regset + i); - - mips_supply_register (regcache, use_64bit, find_regno ("lo"), regset + 32); - mips_supply_register (regcache, use_64bit, find_regno ("hi"), regset + 33); - mips_supply_register (regcache, use_64bit, find_regno ("pc"), regset + 34); - mips_supply_register (regcache, use_64bit, - find_regno ("badvaddr"), regset + 35); - mips_supply_register (regcache, use_64bit, - find_regno ("status"), regset + 36); - mips_supply_register (regcache, use_64bit, - find_regno ("cause"), regset + 37); - - mips_supply_register (regcache, use_64bit, - find_regno ("restart"), regset + 0); -} - -static void -mips_fill_fpregset (struct regcache *regcache, void *buf) -{ - union mips_register *regset = buf; - int i, use_64bit, first_fp, big_endian; - - use_64bit = (register_size (0) == 8); - first_fp = find_regno ("f0"); - big_endian = (__BYTE_ORDER == __BIG_ENDIAN); - - /* See GDB for a discussion of this peculiar layout. */ - for (i = 0; i < 32; i++) - if (use_64bit) - collect_register (regcache, first_fp + i, regset[i].buf); - else - collect_register (regcache, first_fp + i, - regset[i & ~1].buf + 4 * (big_endian != (i & 1))); - - mips_collect_register_32bit (regcache, use_64bit, - find_regno ("fcsr"), regset[32].buf); - mips_collect_register_32bit (regcache, use_64bit, find_regno ("fir"), - regset[32].buf + 4); -} - -static void -mips_store_fpregset (struct regcache *regcache, const void *buf) -{ - const union mips_register *regset = buf; - int i, use_64bit, first_fp, big_endian; - - use_64bit = (register_size (0) == 8); - first_fp = find_regno ("f0"); - big_endian = (__BYTE_ORDER == __BIG_ENDIAN); - - /* See GDB for a discussion of this peculiar layout. */ - for (i = 0; i < 32; i++) - if (use_64bit) - supply_register (regcache, first_fp + i, regset[i].buf); - else - supply_register (regcache, first_fp + i, - regset[i & ~1].buf + 4 * (big_endian != (i & 1))); - - mips_supply_register_32bit (regcache, use_64bit, - find_regno ("fcsr"), regset[32].buf); - mips_supply_register_32bit (regcache, use_64bit, find_regno ("fir"), - regset[32].buf + 4); -} -#endif /* HAVE_PTRACE_GETREGS */ - -struct regset_info target_regsets[] = { -#ifdef HAVE_PTRACE_GETREGS - { PTRACE_GETREGS, PTRACE_SETREGS, 0, 38 * 8, GENERAL_REGS, - mips_fill_gregset, mips_store_gregset }, - { PTRACE_GETFPREGS, PTRACE_SETFPREGS, 0, 33 * 8, FP_REGS, - mips_fill_fpregset, mips_store_fpregset }, -#endif /* HAVE_PTRACE_GETREGS */ - { 0, 0, 0, -1, -1, NULL, NULL } -}; - -struct linux_target_ops the_low_target = { -#ifdef __mips64 - init_registers_mips64_linux, -#else - init_registers_mips_linux, -#endif - mips_num_regs, - mips_regmap, - mips_cannot_fetch_register, - mips_cannot_store_register, - mips_get_pc, - mips_set_pc, - (const unsigned char *) &mips_breakpoint, - mips_breakpoint_len, - mips_reinsert_addr, - 0, - mips_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c deleted file mode 100644 index e19f10ab264..00000000000 --- a/gdb/gdbserver/linux-ppc-low.c +++ /dev/null @@ -1,628 +0,0 @@ -/* GNU/Linux/PowerPC specific low level interface, for the remote server for - GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2008, - 2009, 2010, 2011 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 <elf.h> -#include <asm/ptrace.h> - -/* These are in <asm/cputable.h> in current kernels. */ -#define PPC_FEATURE_HAS_VSX 0x00000080 -#define PPC_FEATURE_HAS_ALTIVEC 0x10000000 -#define PPC_FEATURE_HAS_SPE 0x00800000 -#define PPC_FEATURE_CELL 0x00010000 -#define PPC_FEATURE_HAS_DFP 0x00000400 - -static unsigned long ppc_hwcap; - - -/* Defined in auto-generated file powerpc-32l.c. */ -void init_registers_powerpc_32l (void); -/* Defined in auto-generated file powerpc-altivec32l.c. */ -void init_registers_powerpc_altivec32l (void); -/* Defined in auto-generated file powerpc-cell32l.c. */ -void init_registers_powerpc_cell32l (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. */ -void init_registers_powerpc_64l (void); -/* Defined in auto-generated file powerpc-altivec64l.c. */ -void init_registers_powerpc_altivec64l (void); -/* Defined in auto-generated file powerpc-cell64l.c. */ -void init_registers_powerpc_cell64l (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 - -/* This sometimes isn't defined. */ -#ifndef PT_ORIG_R3 -#define PT_ORIG_R3 34 -#endif -#ifndef PT_TRAP -#define PT_TRAP 40 -#endif - -#ifdef __powerpc64__ -/* We use a constant for FPSCR instead of PT_FPSCR, because - many shipped PPC64 kernels had the wrong value in ptrace.h. */ -static int ppc_regmap[] = - {PT_R0 * 8, PT_R1 * 8, PT_R2 * 8, PT_R3 * 8, - PT_R4 * 8, PT_R5 * 8, PT_R6 * 8, PT_R7 * 8, - PT_R8 * 8, PT_R9 * 8, PT_R10 * 8, PT_R11 * 8, - PT_R12 * 8, PT_R13 * 8, PT_R14 * 8, PT_R15 * 8, - PT_R16 * 8, PT_R17 * 8, PT_R18 * 8, PT_R19 * 8, - PT_R20 * 8, PT_R21 * 8, PT_R22 * 8, PT_R23 * 8, - PT_R24 * 8, PT_R25 * 8, PT_R26 * 8, PT_R27 * 8, - PT_R28 * 8, PT_R29 * 8, PT_R30 * 8, PT_R31 * 8, - PT_FPR0*8, PT_FPR0*8 + 8, PT_FPR0*8+16, PT_FPR0*8+24, - PT_FPR0*8+32, PT_FPR0*8+40, PT_FPR0*8+48, PT_FPR0*8+56, - PT_FPR0*8+64, PT_FPR0*8+72, PT_FPR0*8+80, PT_FPR0*8+88, - PT_FPR0*8+96, PT_FPR0*8+104, PT_FPR0*8+112, PT_FPR0*8+120, - PT_FPR0*8+128, PT_FPR0*8+136, PT_FPR0*8+144, PT_FPR0*8+152, - PT_FPR0*8+160, PT_FPR0*8+168, PT_FPR0*8+176, PT_FPR0*8+184, - PT_FPR0*8+192, PT_FPR0*8+200, PT_FPR0*8+208, PT_FPR0*8+216, - PT_FPR0*8+224, PT_FPR0*8+232, PT_FPR0*8+240, PT_FPR0*8+248, - PT_NIP * 8, PT_MSR * 8, PT_CCR * 8, PT_LNK * 8, - PT_CTR * 8, PT_XER * 8, PT_FPR0*8 + 256, - PT_ORIG_R3 * 8, PT_TRAP * 8 }; -#else -/* Currently, don't check/send MQ. */ -static int ppc_regmap[] = - {PT_R0 * 4, PT_R1 * 4, PT_R2 * 4, PT_R3 * 4, - PT_R4 * 4, PT_R5 * 4, PT_R6 * 4, PT_R7 * 4, - PT_R8 * 4, PT_R9 * 4, PT_R10 * 4, PT_R11 * 4, - PT_R12 * 4, PT_R13 * 4, PT_R14 * 4, PT_R15 * 4, - PT_R16 * 4, PT_R17 * 4, PT_R18 * 4, PT_R19 * 4, - PT_R20 * 4, PT_R21 * 4, PT_R22 * 4, PT_R23 * 4, - PT_R24 * 4, PT_R25 * 4, PT_R26 * 4, PT_R27 * 4, - PT_R28 * 4, PT_R29 * 4, PT_R30 * 4, PT_R31 * 4, - PT_FPR0*4, PT_FPR0*4 + 8, PT_FPR0*4+16, PT_FPR0*4+24, - PT_FPR0*4+32, PT_FPR0*4+40, PT_FPR0*4+48, PT_FPR0*4+56, - PT_FPR0*4+64, PT_FPR0*4+72, PT_FPR0*4+80, PT_FPR0*4+88, - PT_FPR0*4+96, PT_FPR0*4+104, PT_FPR0*4+112, PT_FPR0*4+120, - PT_FPR0*4+128, PT_FPR0*4+136, PT_FPR0*4+144, PT_FPR0*4+152, - PT_FPR0*4+160, PT_FPR0*4+168, PT_FPR0*4+176, PT_FPR0*4+184, - PT_FPR0*4+192, PT_FPR0*4+200, PT_FPR0*4+208, PT_FPR0*4+216, - PT_FPR0*4+224, PT_FPR0*4+232, PT_FPR0*4+240, PT_FPR0*4+248, - PT_NIP * 4, PT_MSR * 4, PT_CCR * 4, PT_LNK * 4, - PT_CTR * 4, PT_XER * 4, PT_FPSCR * 4, - PT_ORIG_R3 * 4, PT_TRAP * 4 - }; - -static int ppc_regmap_e500[] = - {PT_R0 * 4, PT_R1 * 4, PT_R2 * 4, PT_R3 * 4, - PT_R4 * 4, PT_R5 * 4, PT_R6 * 4, PT_R7 * 4, - PT_R8 * 4, PT_R9 * 4, PT_R10 * 4, PT_R11 * 4, - PT_R12 * 4, PT_R13 * 4, PT_R14 * 4, PT_R15 * 4, - PT_R16 * 4, PT_R17 * 4, PT_R18 * 4, PT_R19 * 4, - PT_R20 * 4, PT_R21 * 4, PT_R22 * 4, PT_R23 * 4, - PT_R24 * 4, PT_R25 * 4, PT_R26 * 4, PT_R27 * 4, - PT_R28 * 4, PT_R29 * 4, PT_R30 * 4, PT_R31 * 4, - -1, -1, -1, -1, - -1, -1, -1, -1, - -1, -1, -1, -1, - -1, -1, -1, -1, - -1, -1, -1, -1, - -1, -1, -1, -1, - -1, -1, -1, -1, - -1, -1, -1, -1, - PT_NIP * 4, PT_MSR * 4, PT_CCR * 4, PT_LNK * 4, - PT_CTR * 4, PT_XER * 4, -1, - PT_ORIG_R3 * 4, PT_TRAP * 4 - }; -#endif - -static int -ppc_cannot_store_register (int regno) -{ -#ifndef __powerpc64__ - /* Some kernels do not allow us to store fpscr. */ - if (!(ppc_hwcap & PPC_FEATURE_HAS_SPE) && regno == find_regno ("fpscr")) - return 2; -#endif - - /* Some kernels do not allow us to store orig_r3 or trap. */ - if (regno == find_regno ("orig_r3") - || regno == find_regno ("trap")) - return 2; - - return 0; -} - -static int -ppc_cannot_fetch_register (int regno) -{ - return 0; -} - -static void -ppc_collect_ptrace_register (struct regcache *regcache, int regno, char *buf) -{ - int size = register_size (regno); - - memset (buf, 0, sizeof (long)); - - if (size < sizeof (long)) - collect_register (regcache, regno, buf + sizeof (long) - size); - else - collect_register (regcache, regno, buf); -} - -static void -ppc_supply_ptrace_register (struct regcache *regcache, - int regno, const char *buf) -{ - int size = register_size (regno); - if (size < sizeof (long)) - supply_register (regcache, regno, buf + sizeof (long) - size); - else - supply_register (regcache, regno, buf); -} - - -#define INSTR_SC 0x44000002 -#define NR_spu_run 0x0116 - -/* If the PPU thread is currently stopped on a spu_run system call, - return to FD and ADDR the file handle and NPC parameter address - used with the system call. Return non-zero if successful. */ -static int -parse_spufs_run (struct regcache *regcache, int *fd, CORE_ADDR *addr) -{ - CORE_ADDR curr_pc; - int curr_insn; - int curr_r0; - - if (register_size (0) == 4) - { - unsigned int pc, r0, r3, r4; - collect_register_by_name (regcache, "pc", &pc); - collect_register_by_name (regcache, "r0", &r0); - collect_register_by_name (regcache, "orig_r3", &r3); - collect_register_by_name (regcache, "r4", &r4); - curr_pc = (CORE_ADDR) pc; - curr_r0 = (int) r0; - *fd = (int) r3; - *addr = (CORE_ADDR) r4; - } - else - { - unsigned long pc, r0, r3, r4; - collect_register_by_name (regcache, "pc", &pc); - collect_register_by_name (regcache, "r0", &r0); - collect_register_by_name (regcache, "orig_r3", &r3); - collect_register_by_name (regcache, "r4", &r4); - curr_pc = (CORE_ADDR) pc; - curr_r0 = (int) r0; - *fd = (int) r3; - *addr = (CORE_ADDR) r4; - } - - /* Fetch instruction preceding current NIP. */ - if ((*the_target->read_memory) (curr_pc - 4, - (unsigned char *) &curr_insn, 4) != 0) - return 0; - /* It should be a "sc" instruction. */ - if (curr_insn != INSTR_SC) - return 0; - /* System call number should be NR_spu_run. */ - if (curr_r0 != NR_spu_run) - return 0; - - return 1; -} - -static CORE_ADDR -ppc_get_pc (struct regcache *regcache) -{ - CORE_ADDR addr; - int fd; - - if (parse_spufs_run (regcache, &fd, &addr)) - { - unsigned int pc; - (*the_target->read_memory) (addr, (unsigned char *) &pc, 4); - return ((CORE_ADDR)1 << 63) - | ((CORE_ADDR)fd << 32) | (CORE_ADDR) (pc - 4); - } - else if (register_size (0) == 4) - { - unsigned int pc; - collect_register_by_name (regcache, "pc", &pc); - return (CORE_ADDR) pc; - } - else - { - unsigned long pc; - collect_register_by_name (regcache, "pc", &pc); - return (CORE_ADDR) pc; - } -} - -static void -ppc_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - CORE_ADDR addr; - int fd; - - if (parse_spufs_run (regcache, &fd, &addr)) - { - unsigned int newpc = pc; - (*the_target->write_memory) (addr, (unsigned char *) &newpc, 4); - } - else if (register_size (0) == 4) - { - unsigned int newpc = pc; - supply_register_by_name (regcache, "pc", &newpc); - } - else - { - unsigned long newpc = pc; - supply_register_by_name (regcache, "pc", &newpc); - } -} - - -static int -ppc_get_hwcap (unsigned long *valp) -{ - int wordsize = register_size (0); - unsigned char *data = alloca (2 * wordsize); - int offset = 0; - - while ((*the_target->read_auxv) (offset, data, 2 * wordsize) == 2 * wordsize) - { - if (wordsize == 4) - { - unsigned int *data_p = (unsigned int *)data; - if (data_p[0] == AT_HWCAP) - { - *valp = data_p[1]; - return 1; - } - } - else - { - unsigned long *data_p = (unsigned long *)data; - if (data_p[0] == AT_HWCAP) - { - *valp = data_p[1]; - return 1; - } - } - - offset += 2 * wordsize; - } - - *valp = 0; - return 0; -} - -static void -ppc_arch_setup (void) -{ -#ifdef __powerpc64__ - long msr; - struct regcache *regcache; - - /* On a 64-bit host, assume 64-bit inferior process with no - AltiVec registers. Reset ppc_hwcap to ensure that the - collect_register call below does not fail. */ - init_registers_powerpc_64l (); - ppc_hwcap = 0; - - /* Only if the high bit of the MSR is set, we actually have - a 64-bit inferior. */ - regcache = new_register_cache (); - fetch_inferior_registers (regcache, find_regno ("msr")); - collect_register_by_name (regcache, "msr", &msr); - free_register_cache (regcache); - if (msr < 0) - { - ppc_get_hwcap (&ppc_hwcap); - if (ppc_hwcap & PPC_FEATURE_CELL) - init_registers_powerpc_cell64l (); - else if (ppc_hwcap & PPC_FEATURE_HAS_VSX) - { - /* Power ISA 2.05 (implemented by Power 6 and newer processors) - increases the FPSCR from 32 bits to 64 bits. Even though Power 7 - supports this ISA version, it doesn't have PPC_FEATURE_ARCH_2_05 - set, only PPC_FEATURE_ARCH_2_06. Since for now the only bits - used in the higher half of the register are for Decimal Floating - Point, we check if that feature is available to decide the size - of the FPSCR. */ - if (ppc_hwcap & PPC_FEATURE_HAS_DFP) - init_registers_powerpc_isa205_vsx64l (); - else - init_registers_powerpc_vsx64l (); - } - else if (ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC) - { - if (ppc_hwcap & PPC_FEATURE_HAS_DFP) - init_registers_powerpc_isa205_altivec64l (); - else - init_registers_powerpc_altivec64l (); - } - - return; - } -#endif - - /* OK, we have a 32-bit inferior. */ - init_registers_powerpc_32l (); - - ppc_get_hwcap (&ppc_hwcap); - if (ppc_hwcap & PPC_FEATURE_CELL) - init_registers_powerpc_cell32l (); - else if (ppc_hwcap & PPC_FEATURE_HAS_VSX) - { - if (ppc_hwcap & PPC_FEATURE_HAS_DFP) - init_registers_powerpc_isa205_vsx32l (); - else - init_registers_powerpc_vsx32l (); - } - else if (ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC) - { - if (ppc_hwcap & PPC_FEATURE_HAS_DFP) - 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. */ -#ifndef __powerpc64__ - the_low_target.regmap = ppc_regmap; - if (ppc_hwcap & PPC_FEATURE_HAS_SPE) - { - 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 -} - -/* Correct in either endianness. - This instruction is "twge r2, r2", which GDB uses as a software - breakpoint. */ -static const unsigned int ppc_breakpoint = 0x7d821008; -#define ppc_breakpoint_len 4 - -static int -ppc_breakpoint_at (CORE_ADDR where) -{ - unsigned int insn; - - if (where & ((CORE_ADDR)1 << 63)) - { - char mem_annex[32]; - sprintf (mem_annex, "%d/mem", (int)((where >> 32) & 0x7fffffff)); - (*the_target->qxfer_spu) (mem_annex, (unsigned char *) &insn, - NULL, where & 0xffffffff, 4); - if (insn == 0x3fff) - return 1; - } - else - { - (*the_target->read_memory) (where, (unsigned char *) &insn, 4); - if (insn == ppc_breakpoint) - return 1; - /* If necessary, recognize more trap instructions here. GDB only uses - the one. */ - } - - return 0; -} - -/* Provide only a fill function for the general register set. ps_lgetregs - will use this for NPTL support. */ - -static void ppc_fill_gregset (struct regcache *regcache, void *buf) -{ - int i; - - for (i = 0; i < 32; i++) - ppc_collect_ptrace_register (regcache, i, (char *) buf + ppc_regmap[i]); - - for (i = 64; i < 70; i++) - ppc_collect_ptrace_register (regcache, i, (char *) buf + ppc_regmap[i]); - - for (i = 71; i < 73; i++) - ppc_collect_ptrace_register (regcache, i, (char *) buf + ppc_regmap[i]); -} - -#ifndef PTRACE_GETVSXREGS -#define PTRACE_GETVSXREGS 27 -#define PTRACE_SETVSXREGS 28 -#endif - -#define SIZEOF_VSXREGS 32*8 - -static void -ppc_fill_vsxregset (struct regcache *regcache, void *buf) -{ - int i, base; - char *regset = buf; - - if (!(ppc_hwcap & PPC_FEATURE_HAS_VSX)) - return; - - base = find_regno ("vs0h"); - for (i = 0; i < 32; i++) - collect_register (regcache, base + i, ®set[i * 8]); -} - -static void -ppc_store_vsxregset (struct regcache *regcache, const void *buf) -{ - int i, base; - const char *regset = buf; - - if (!(ppc_hwcap & PPC_FEATURE_HAS_VSX)) - return; - - base = find_regno ("vs0h"); - for (i = 0; i < 32; i++) - supply_register (regcache, base + i, ®set[i * 8]); -} - -#ifndef PTRACE_GETVRREGS -#define PTRACE_GETVRREGS 18 -#define PTRACE_SETVRREGS 19 -#endif - -#define SIZEOF_VRREGS 33*16+4 - -static void -ppc_fill_vrregset (struct regcache *regcache, void *buf) -{ - int i, base; - char *regset = buf; - - if (!(ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC)) - return; - - base = find_regno ("vr0"); - for (i = 0; i < 32; i++) - collect_register (regcache, base + i, ®set[i * 16]); - - collect_register_by_name (regcache, "vscr", ®set[32 * 16 + 12]); - collect_register_by_name (regcache, "vrsave", ®set[33 * 16]); -} - -static void -ppc_store_vrregset (struct regcache *regcache, const void *buf) -{ - int i, base; - const char *regset = buf; - - if (!(ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC)) - return; - - base = find_regno ("vr0"); - for (i = 0; i < 32; i++) - supply_register (regcache, base + i, ®set[i * 16]); - - supply_register_by_name (regcache, "vscr", ®set[32 * 16 + 12]); - supply_register_by_name (regcache, "vrsave", ®set[33 * 16]); -} - -#ifndef PTRACE_GETEVRREGS -#define PTRACE_GETEVRREGS 20 -#define PTRACE_SETEVRREGS 21 -#endif - -struct gdb_evrregset_t -{ - unsigned long evr[32]; - unsigned long long acc; - unsigned long spefscr; -}; - -static void -ppc_fill_evrregset (struct regcache *regcache, void *buf) -{ - int i, ev0; - struct gdb_evrregset_t *regset = buf; - - if (!(ppc_hwcap & PPC_FEATURE_HAS_SPE)) - return; - - ev0 = find_regno ("ev0h"); - for (i = 0; i < 32; i++) - collect_register (regcache, ev0 + i, ®set->evr[i]); - - collect_register_by_name (regcache, "acc", ®set->acc); - collect_register_by_name (regcache, "spefscr", ®set->spefscr); -} - -static void -ppc_store_evrregset (struct regcache *regcache, const void *buf) -{ - int i, ev0; - const struct gdb_evrregset_t *regset = buf; - - if (!(ppc_hwcap & PPC_FEATURE_HAS_SPE)) - return; - - ev0 = find_regno ("ev0h"); - for (i = 0; i < 32; i++) - supply_register (regcache, ev0 + i, ®set->evr[i]); - - supply_register_by_name (regcache, "acc", ®set->acc); - supply_register_by_name (regcache, "spefscr", ®set->spefscr); -} - -struct regset_info target_regsets[] = { - /* List the extra register sets before GENERAL_REGS. That way we will - fetch them every time, but still fall back to PTRACE_PEEKUSER for the - general registers. Some kernels support these, but not the newer - PPC_PTRACE_GETREGS. */ - { PTRACE_GETVSXREGS, PTRACE_SETVSXREGS, 0, SIZEOF_VSXREGS, EXTENDED_REGS, - ppc_fill_vsxregset, ppc_store_vsxregset }, - { PTRACE_GETVRREGS, PTRACE_SETVRREGS, 0, SIZEOF_VRREGS, EXTENDED_REGS, - ppc_fill_vrregset, ppc_store_vrregset }, - { PTRACE_GETEVRREGS, PTRACE_SETEVRREGS, 0, 32 * 4 + 8 + 4, EXTENDED_REGS, - ppc_fill_evrregset, ppc_store_evrregset }, - { 0, 0, 0, 0, GENERAL_REGS, ppc_fill_gregset, NULL }, - { 0, 0, 0, -1, -1, NULL, NULL } -}; - -struct linux_target_ops the_low_target = { - ppc_arch_setup, - ppc_num_regs, - ppc_regmap, - ppc_cannot_fetch_register, - ppc_cannot_store_register, - ppc_get_pc, - ppc_set_pc, - (const unsigned char *) &ppc_breakpoint, - ppc_breakpoint_len, - NULL, - 0, - ppc_breakpoint_at, - NULL, - NULL, - NULL, - NULL, - ppc_collect_ptrace_register, - ppc_supply_ptrace_register, -}; diff --git a/gdb/gdbserver/linux-s390-low.c b/gdb/gdbserver/linux-s390-low.c deleted file mode 100644 index 5c38e434c11..00000000000 --- a/gdb/gdbserver/linux-s390-low.c +++ /dev/null @@ -1,327 +0,0 @@ -/* GNU/Linux S/390 specific low level interface, for the remote server - for GDB. - Copyright (C) 2001, 2002, 2005, 2006, 2007, 2008, 2009, 2010, 2011 - 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/>. */ - -/* This file is used for both 31-bit and 64-bit S/390 systems. */ - -#include "server.h" -#include "linux-low.h" - -#include <asm/ptrace.h> -#include <elf.h> - -#ifndef HWCAP_S390_HIGH_GPRS -#define HWCAP_S390_HIGH_GPRS 512 -#endif - -/* Defined in auto-generated file s390-linux32.c. */ -void init_registers_s390_linux32 (void); -/* Defined in auto-generated file s390-linux64.c. */ -void init_registers_s390_linux64 (void); -/* Defined in auto-generated file s390x-linux64.c. */ -void init_registers_s390x_linux64 (void); - -#define s390_num_regs 51 - -static int s390_regmap[] = { - PT_PSWMASK, PT_PSWADDR, - - PT_GPR0, PT_GPR1, PT_GPR2, PT_GPR3, - PT_GPR4, PT_GPR5, PT_GPR6, PT_GPR7, - PT_GPR8, PT_GPR9, PT_GPR10, PT_GPR11, - PT_GPR12, PT_GPR13, PT_GPR14, PT_GPR15, - - PT_ACR0, PT_ACR1, PT_ACR2, PT_ACR3, - PT_ACR4, PT_ACR5, PT_ACR6, PT_ACR7, - PT_ACR8, PT_ACR9, PT_ACR10, PT_ACR11, - PT_ACR12, PT_ACR13, PT_ACR14, PT_ACR15, - - PT_FPC, - -#ifndef __s390x__ - PT_FPR0_HI, PT_FPR1_HI, PT_FPR2_HI, PT_FPR3_HI, - PT_FPR4_HI, PT_FPR5_HI, PT_FPR6_HI, PT_FPR7_HI, - PT_FPR8_HI, PT_FPR9_HI, PT_FPR10_HI, PT_FPR11_HI, - PT_FPR12_HI, PT_FPR13_HI, PT_FPR14_HI, PT_FPR15_HI, -#else - PT_FPR0, PT_FPR1, PT_FPR2, PT_FPR3, - PT_FPR4, PT_FPR5, PT_FPR6, PT_FPR7, - PT_FPR8, PT_FPR9, PT_FPR10, PT_FPR11, - PT_FPR12, PT_FPR13, PT_FPR14, PT_FPR15, -#endif -}; - -#ifdef __s390x__ -#define s390_num_regs_3264 67 - -static int s390_regmap_3264[] = { - PT_PSWMASK, PT_PSWADDR, - - PT_GPR0, PT_GPR0, PT_GPR1, PT_GPR1, - PT_GPR2, PT_GPR2, PT_GPR3, PT_GPR3, - PT_GPR4, PT_GPR4, PT_GPR5, PT_GPR5, - PT_GPR6, PT_GPR6, PT_GPR7, PT_GPR7, - PT_GPR8, PT_GPR8, PT_GPR9, PT_GPR9, - PT_GPR10, PT_GPR10, PT_GPR11, PT_GPR11, - PT_GPR12, PT_GPR12, PT_GPR13, PT_GPR13, - PT_GPR14, PT_GPR14, PT_GPR15, PT_GPR15, - - PT_ACR0, PT_ACR1, PT_ACR2, PT_ACR3, - PT_ACR4, PT_ACR5, PT_ACR6, PT_ACR7, - PT_ACR8, PT_ACR9, PT_ACR10, PT_ACR11, - PT_ACR12, PT_ACR13, PT_ACR14, PT_ACR15, - - PT_FPC, - - PT_FPR0, PT_FPR1, PT_FPR2, PT_FPR3, - PT_FPR4, PT_FPR5, PT_FPR6, PT_FPR7, - PT_FPR8, PT_FPR9, PT_FPR10, PT_FPR11, - PT_FPR12, PT_FPR13, PT_FPR14, PT_FPR15, -}; -#endif - - -static int -s390_cannot_fetch_register (int regno) -{ - return 0; -} - -static int -s390_cannot_store_register (int regno) -{ - return 0; -} - -static void -s390_collect_ptrace_register (struct regcache *regcache, int regno, char *buf) -{ - int size = register_size (regno); - if (size < sizeof (long)) - { - int regaddr = the_low_target.regmap[regno]; - - memset (buf, 0, sizeof (long)); - - if ((regno ^ 1) < the_low_target.num_regs - && the_low_target.regmap[regno ^ 1] == regaddr) - { - collect_register (regcache, regno & ~1, buf); - collect_register (regcache, (regno & ~1) + 1, - buf + sizeof (long) - size); - } - else if (regaddr == PT_PSWADDR - || (regaddr >= PT_GPR0 && regaddr <= PT_GPR15)) - collect_register (regcache, regno, buf + sizeof (long) - size); - else - collect_register (regcache, regno, buf); - - /* When debugging a 32-bit inferior on a 64-bit host, make sure - the 31-bit addressing mode bit is set in the PSW mask. */ - if (regaddr == PT_PSWMASK) - buf[size] |= 0x80; - } - else - collect_register (regcache, regno, buf); -} - -static void -s390_supply_ptrace_register (struct regcache *regcache, - int regno, const char *buf) -{ - int size = register_size (regno); - if (size < sizeof (long)) - { - int regaddr = the_low_target.regmap[regno]; - - if ((regno ^ 1) < the_low_target.num_regs - && the_low_target.regmap[regno ^ 1] == regaddr) - { - supply_register (regcache, regno & ~1, buf); - supply_register (regcache, (regno & ~1) + 1, - buf + sizeof (long) - size); - } - else if (regaddr == PT_PSWADDR - || (regaddr >= PT_GPR0 && regaddr <= PT_GPR15)) - supply_register (regcache, regno, buf + sizeof (long) - size); - else - supply_register (regcache, regno, buf); - } - else - supply_register (regcache, regno, buf); -} - -/* Provide only a fill function for the general register set. ps_lgetregs - will use this for NPTL support. */ - -static void s390_fill_gregset (struct regcache *regcache, void *buf) -{ - int i; - - for (i = 0; i < the_low_target.num_regs; i++) - { - if (the_low_target.regmap[i] < PT_PSWMASK - || the_low_target.regmap[i] > PT_ACR15) - continue; - - s390_collect_ptrace_register (regcache, i, (char *) buf - + the_low_target.regmap[i]); - } -} - -struct regset_info target_regsets[] = { - { 0, 0, 0, 0, GENERAL_REGS, s390_fill_gregset, NULL }, - { 0, 0, 0, -1, -1, NULL, NULL } -}; - - -static const unsigned char s390_breakpoint[] = { 0, 1 }; -#define s390_breakpoint_len 2 - -static CORE_ADDR -s390_get_pc (struct regcache *regcache) -{ - if (register_size (0) == 4) - { - unsigned int pc; - collect_register_by_name (regcache, "pswa", &pc); -#ifndef __s390x__ - pc &= 0x7fffffff; -#endif - return pc; - } - else - { - unsigned long pc; - collect_register_by_name (regcache, "pswa", &pc); - return pc; - } -} - -static void -s390_set_pc (struct regcache *regcache, CORE_ADDR newpc) -{ - if (register_size (0) == 4) - { - unsigned int pc = newpc; -#ifndef __s390x__ - pc |= 0x80000000; -#endif - supply_register_by_name (regcache, "pswa", &pc); - } - else - { - unsigned long pc = newpc; - supply_register_by_name (regcache, "pswa", &pc); - } -} - -#ifdef __s390x__ -static unsigned long -s390_get_hwcap (void) -{ - int wordsize = register_size (0); - unsigned char *data = alloca (2 * wordsize); - int offset = 0; - - while ((*the_target->read_auxv) (offset, data, 2 * wordsize) == 2 * wordsize) - { - if (wordsize == 4) - { - unsigned int *data_p = (unsigned int *)data; - if (data_p[0] == AT_HWCAP) - return data_p[1]; - } - else - { - unsigned long *data_p = (unsigned long *)data; - if (data_p[0] == AT_HWCAP) - return data_p[1]; - } - - offset += 2 * wordsize; - } - - return 0; -} -#endif - -static void -s390_arch_setup (void) -{ - /* Assume 31-bit inferior process. */ - init_registers_s390_linux32 (); - the_low_target.num_regs = s390_num_regs; - the_low_target.regmap = s390_regmap; - - /* On a 64-bit host, check the low bit of the (31-bit) PSWM - -- if this is one, we actually have a 64-bit inferior. */ -#ifdef __s390x__ - { - unsigned int pswm; - struct regcache *regcache = new_register_cache (); - fetch_inferior_registers (regcache, find_regno ("pswm")); - collect_register_by_name (regcache, "pswm", &pswm); - free_register_cache (regcache); - - if (pswm & 1) - init_registers_s390x_linux64 (); - - /* For a 31-bit inferior, check whether the kernel supports - using the full 64-bit GPRs. */ - else if (s390_get_hwcap () & HWCAP_S390_HIGH_GPRS) - { - init_registers_s390_linux64 (); - the_low_target.num_regs = s390_num_regs_3264; - the_low_target.regmap = s390_regmap_3264; - } - } -#endif -} - - -static int -s390_breakpoint_at (CORE_ADDR pc) -{ - unsigned char c[s390_breakpoint_len]; - read_inferior_memory (pc, c, s390_breakpoint_len); - return memcmp (c, s390_breakpoint, s390_breakpoint_len) == 0; -} - - -struct linux_target_ops the_low_target = { - s390_arch_setup, - s390_num_regs, - s390_regmap, - s390_cannot_fetch_register, - s390_cannot_store_register, - s390_get_pc, - s390_set_pc, - s390_breakpoint, - s390_breakpoint_len, - NULL, - s390_breakpoint_len, - s390_breakpoint_at, - NULL, - NULL, - NULL, - NULL, - s390_collect_ptrace_register, - s390_supply_ptrace_register, -}; diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c deleted file mode 100644 index f9752ebdb7b..00000000000 --- a/gdb/gdbserver/linux-sh-low.c +++ /dev/null @@ -1,124 +0,0 @@ -/* GNU/Linux/SH specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007, - 2008, 2009, 2010, 2011 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" - -/* Defined in auto-generated file reg-sh.c. */ -void init_registers_sh (void); - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -#include <asm/ptrace.h> - -#define sh_num_regs 41 - -/* Currently, don't check/send MQ. */ -static int sh_regmap[] = { - 0, 4, 8, 12, 16, 20, 24, 28, - 32, 36, 40, 44, 48, 52, 56, 60, - - REG_PC*4, REG_PR*4, REG_GBR*4, -1, - REG_MACH*4, REG_MACL*4, REG_SR*4, - REG_FPUL*4, REG_FPSCR*4, - - REG_FPREG0*4+0, REG_FPREG0*4+4, REG_FPREG0*4+8, REG_FPREG0*4+12, - REG_FPREG0*4+16, REG_FPREG0*4+20, REG_FPREG0*4+24, REG_FPREG0*4+28, - REG_FPREG0*4+32, REG_FPREG0*4+36, REG_FPREG0*4+40, REG_FPREG0*4+44, - REG_FPREG0*4+48, REG_FPREG0*4+52, REG_FPREG0*4+56, REG_FPREG0*4+60, -}; - -static int -sh_cannot_store_register (int regno) -{ - return 0; -} - -static int -sh_cannot_fetch_register (int regno) -{ - return 0; -} - -static CORE_ADDR -sh_get_pc (struct regcache *regcache) -{ - unsigned long pc; - collect_register_by_name (regcache, "pc", &pc); - return pc; -} - -static void -sh_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name (regcache, "pc", &newpc); -} - -/* Correct in either endianness, obviously. */ -static const unsigned short sh_breakpoint = 0xc3c3; -#define sh_breakpoint_len 2 - -static int -sh_breakpoint_at (CORE_ADDR where) -{ - unsigned short insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, 2); - if (insn == sh_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -/* Provide only a fill function for the general register set. ps_lgetregs - will use this for NPTL support. */ - -static void sh_fill_gregset (struct regcache *regcache, void *buf) -{ - int i; - - for (i = 0; i < 23; i++) - if (sh_regmap[i] != -1) - collect_register (regcache, i, (char *) buf + sh_regmap[i]); -} - -struct regset_info target_regsets[] = { - { 0, 0, 0, 0, GENERAL_REGS, sh_fill_gregset, NULL }, - { 0, 0, 0, -1, -1, NULL, NULL } -}; - -struct linux_target_ops the_low_target = { - init_registers_sh, - sh_num_regs, - sh_regmap, - sh_cannot_fetch_register, - sh_cannot_store_register, - sh_get_pc, - sh_set_pc, - (const unsigned char *) &sh_breakpoint, - sh_breakpoint_len, - NULL, - 0, - sh_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-sparc-low.c b/gdb/gdbserver/linux-sparc-low.c deleted file mode 100644 index d88bf0d4b91..00000000000 --- a/gdb/gdbserver/linux-sparc-low.c +++ /dev/null @@ -1,297 +0,0 @@ -/* 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, 2009, 2010, 2011 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 (struct regcache *regcache, 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 (regcache, 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 (struct regcache *regcache, 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 (regcache, i, ((char *) buf) + sparc_regmap[i]); - - sparc_fill_gregset_to_stack (regcache, buf); -} - -static void -sparc_fill_fpregset (struct regcache *regcache, 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 (regcache, i, ((char *) buf) + sparc_regmap[i]); - -} - -static void -sparc_store_gregset_from_stack (struct regcache *regcache, 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 (regcache, i, tmp_reg_buf); - addr += sizeof(tmp_reg_buf); - } -} - -static void -sparc_store_gregset (struct regcache *regcache, 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 (regcache, i, ((char *) buf) + sparc_regmap[i]); - else - supply_register (regcache, i, zerobuf); - - sparc_store_gregset_from_stack (regcache, buf); -} - -static void -sparc_store_fpregset (struct regcache *regcache, 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 (regcache, i, ((char *) buf) + sparc_regmap[i]); -} - -extern int debug_threads; - -static CORE_ADDR -sparc_get_pc (struct regcache *regcache) -{ - unsigned long pc; - collect_register_by_name (regcache, "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 (void) -{ - struct regcache *regcache = get_thread_regcache (current_inferior, 1); - CORE_ADDR lr; - /* O7 is the equivalent to the 'lr' of other archs. */ - collect_register_by_name (regcache, "o7", &lr); - return lr; -} - - -struct regset_info target_regsets[] = { - { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t), - GENERAL_REGS, - sparc_fill_gregset, sparc_store_gregset }, - { PTRACE_GETFPREGS, PTRACE_SETFPREGS, 0, sizeof (fpregset_t), - FP_REGS, - sparc_fill_fpregset, sparc_store_fpregset }, - { 0, 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/linux-tic6x-low.c b/gdb/gdbserver/linux-tic6x-low.c deleted file mode 100644 index 44daa4d711c..00000000000 --- a/gdb/gdbserver/linux-tic6x-low.c +++ /dev/null @@ -1,334 +0,0 @@ -/* Target dependent code for GDB on TI C6x systems. - - Copyright (C) 2010, 2011 - Free Software Foundation, Inc. - Contributed by Andrew Jenner <andrew@codesourcery.com> - Contributed by Yao Qi <yao@codesourcery.com> - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 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 <endian.h> - -#include "gdb_proc_service.h" - -#ifndef PTRACE_GET_THREAD_AREA -#define PTRACE_GET_THREAD_AREA 25 -#endif - -/* There are at most 69 registers accessible in ptrace. */ -#define TIC6X_NUM_REGS 69 - -#include <asm/ptrace.h> - -/* Defined in auto-generated file tic6x-c64xp-linux.c. */ -void init_registers_tic6x_c64xp_linux (void); -/* Defined in auto-generated file tic6x-c64x-linux.c. */ -void init_registers_tic6x_c64x_linux (void); -/* Defined in auto-generated file tic62x-c6xp-linux.c. */ -void init_registers_tic6x_c62x_linux (void); - -union tic6x_register -{ - unsigned char buf[4]; - - int reg32; -}; - -/* Return the ptrace ``address'' of register REGNO. */ - -#if __BYTE_ORDER == __BIG_ENDIAN -static int tic6x_regmap_c64xp[] = { - /* A0 - A15 */ - 53, 52, 55, 54, 57, 56, 59, 58, - 61, 60, 63, 62, 65, 64, 67, 66, - /* B0 - B15 */ - 23, 22, 25, 24, 27, 26, 29, 28, - 31, 30, 33, 32, 35, 34, 69, 68, - /* CSR PC */ - 5, 4, - /* A16 - A31 */ - 37, 36, 39, 38, 41, 40, 43, 42, - 45, 44, 47, 46, 49, 48, 51, 50, - /* B16 - B31 */ - 7, 6, 9, 8, 11, 10, 13, 12, - 15, 14, 17, 16, 19, 18, 21, 20, - /* TSR, ILC, RILC */ - 1, 2, 3 -}; - -static int tic6x_regmap_c64x[] = { - /* A0 - A15 */ - 51, 50, 53, 52, 55, 54, 57, 56, - 59, 58, 61, 60, 63, 62, 65, 64, - /* B0 - B15 */ - 21, 20, 23, 22, 25, 24, 27, 26, - 29, 28, 31, 30, 33, 32, 67, 66, - /* CSR PC */ - 3, 2, - /* A16 - A31 */ - 35, 34, 37, 36, 39, 38, 41, 40, - 43, 42, 45, 44, 47, 46, 49, 48, - /* B16 - B31 */ - 5, 4, 7, 6, 9, 8, 11, 10, - 13, 12, 15, 14, 17, 16, 19, 18, - -1, -1, -1 -}; - -static int tic6x_regmap_c62x[] = { - /* A0 - A15 */ - 19, 18, 21, 20, 23, 22, 25, 24, - 27, 26, 29, 28, 31, 30, 33, 32, - /* B0 - B15 */ - 5, 4, 7, 6, 9, 8, 11, 10, - 13, 12, 15, 14, 17, 16, 35, 34, - /* CSR, PC */ - 3, 2, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1 -}; - -#else -static int tic6x_regmap_c64xp[] = { - /* A0 - A15 */ - 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, - /* B0 - B15 */ - 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 68, 69, - /* CSR PC */ - 4, 5, - /* A16 - A31 */ - 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, - /* B16 -B31 */ - 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 31, - /* TSR, ILC, RILC */ - 0, 3, 2 -}; - -static int tic6x_regmap_c64x[] = { - /* A0 - A15 */ - 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, - /* B0 - B15 */ - 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 66, 67, - /* CSR PC */ - 2, 3, - /* A16 - A31 */ - 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, - /* B16 - B31 */ - 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, - -1, -1, -1 -}; - -static int tic6x_regmap_c62x[] = { - /* A0 - A15 */ - 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, - /* B0 - B15 */ - 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 34, 35, - /* CSR PC */ - 2, 3, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1 -}; - -#endif - -extern struct linux_target_ops the_low_target; - -static int *tic6x_regmap; -static unsigned int tic6x_breakpoint; - -static void -tic6x_arch_setup (void) -{ - register unsigned int csr asm ("B2"); - unsigned int cpuid; - - /* Determine the CPU we're running on to find the register order. */ - __asm__ ("MVC .S2 CSR,%0" : "=r" (csr) :); - cpuid = csr >> 24; - switch (cpuid) - { - case 0x00: /* C62x */ - case 0x02: /* C67x */ - tic6x_regmap = tic6x_regmap_c62x; - tic6x_breakpoint = 0x0000a122; /* BNOP .S2 0,5 */ - init_registers_tic6x_c62x_linux (); - break; - case 0x03: /* C67x+ */ - tic6x_regmap = tic6x_regmap_c64x; - tic6x_breakpoint = 0x0000a122; /* BNOP .S2 0,5 */ - init_registers_tic6x_c64x_linux (); - break; - case 0x0c: /* C64x */ - tic6x_regmap = tic6x_regmap_c64x; - tic6x_breakpoint = 0x0000a122; /* BNOP .S2 0,5 */ - init_registers_tic6x_c64x_linux (); - break; - case 0x10: /* C64x+ */ - case 0x14: /* C674x */ - case 0x15: /* C66x */ - tic6x_regmap = tic6x_regmap_c64xp; - tic6x_breakpoint = 0x56454314; /* illegal opcode */ - init_registers_tic6x_c64xp_linux (); - break; - default: - error ("Unknown CPU ID 0x%02x", cpuid); - } - the_low_target.regmap = tic6x_regmap; -} - -static int -tic6x_cannot_fetch_register (int regno) -{ - return (tic6x_regmap[regno] == -1); -} - -static int -tic6x_cannot_store_register (int regno) -{ - return (tic6x_regmap[regno] == -1); -} - -static CORE_ADDR -tic6x_get_pc (struct regcache *regcache) -{ - union tic6x_register pc; - - collect_register_by_name (regcache, "PC", pc.buf); - return pc.reg32; -} - -static void -tic6x_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - union tic6x_register newpc; - - newpc.reg32 = pc; - supply_register_by_name (regcache, "PC", newpc.buf); -} - -#define tic6x_breakpoint_len 4 - -static int -tic6x_breakpoint_at (CORE_ADDR where) -{ - unsigned int insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, 4); - if (insn == tic6x_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -/* Fetch the thread-local storage pointer for libthread_db. */ - -ps_err_e -ps_get_thread_area (const struct ps_prochandle *ph, - lwpid_t lwpid, int idx, void **base) -{ - if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) - return PS_ERR; - - /* IDX is the bias from the thread pointer to the beginning of the - thread descriptor. It has to be subtracted due to implementation - quirks in libthread_db. */ - *base = (void *) ((char *) *base - idx); - - return PS_OK; -} - -static void -tic6x_collect_register (struct regcache *regcache, int regno, - union tic6x_register *reg) -{ - union tic6x_register tmp_reg; - - collect_register (regcache, regno, &tmp_reg.reg32); - reg->reg32 = tmp_reg.reg32; -} - -static void -tic6x_supply_register (struct regcache *regcache, int regno, - const union tic6x_register *reg) -{ - int offset = 0; - - supply_register (regcache, regno, reg->buf + offset); -} - -static void -tic6x_fill_gregset (struct regcache *regcache, void *buf) -{ - union tic6x_register *regset = buf; - int i; - - for (i = 0; i < TIC6X_NUM_REGS; i++) - if (tic6x_regmap[i] != -1) - tic6x_collect_register (regcache, i, regset + tic6x_regmap[i]); -} - -static void -tic6x_store_gregset (struct regcache *regcache, const void *buf) -{ - const union tic6x_register *regset = buf; - int i; - - for (i = 0; i < TIC6X_NUM_REGS; i++) - if (tic6x_regmap[i] != -1) - tic6x_supply_register (regcache, i, regset + tic6x_regmap[i]); -} - -struct regset_info target_regsets[] = { - { PTRACE_GETREGS, PTRACE_SETREGS, 0, TIC6X_NUM_REGS * 4, GENERAL_REGS, - tic6x_fill_gregset, tic6x_store_gregset }, - { 0, 0, 0, -1, -1, NULL, NULL } -}; - -struct linux_target_ops the_low_target = { - tic6x_arch_setup, - TIC6X_NUM_REGS, - 0, - tic6x_cannot_fetch_register, - tic6x_cannot_store_register, - tic6x_get_pc, - tic6x_set_pc, - (const unsigned char *) &tic6x_breakpoint, - tic6x_breakpoint_len, - NULL, - 0, - tic6x_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c deleted file mode 100644 index 4cc3feb956b..00000000000 --- a/gdb/gdbserver/linux-x86-low.c +++ /dev/null @@ -1,2877 +0,0 @@ -/* GNU/Linux/x86-64 specific low level interface, for the remote server - for GDB. - Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 - 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 <stddef.h> -#include <signal.h> -#include <limits.h> -#include "server.h" -#include "linux-low.h" -#include "i387-fp.h" -#include "i386-low.h" -#include "i386-xstate.h" -#include "elf/common.h" - -#include "gdb_proc_service.h" - -/* Defined in auto-generated file i386-linux.c. */ -void init_registers_i386_linux (void); -/* Defined in auto-generated file amd64-linux.c. */ -void init_registers_amd64_linux (void); -/* Defined in auto-generated file i386-avx-linux.c. */ -void init_registers_i386_avx_linux (void); -/* Defined in auto-generated file amd64-avx-linux.c. */ -void init_registers_amd64_avx_linux (void); -/* Defined in auto-generated file i386-mmx-linux.c. */ -void init_registers_i386_mmx_linux (void); - -static unsigned char jump_insn[] = { 0xe9, 0, 0, 0, 0 }; - -/* Backward compatibility for gdb without XML support. */ - -static const char *xmltarget_i386_linux_no_xml = "@<target>\ -<architecture>i386</architecture>\ -<osabi>GNU/Linux</osabi>\ -</target>"; - -#ifdef __x86_64__ -static const char *xmltarget_amd64_linux_no_xml = "@<target>\ -<architecture>i386:x86-64</architecture>\ -<osabi>GNU/Linux</osabi>\ -</target>"; -#endif - -#include <sys/reg.h> -#include <sys/procfs.h> -#include <sys/ptrace.h> -#include <sys/uio.h> - -#ifndef PTRACE_GETREGSET -#define PTRACE_GETREGSET 0x4204 -#endif - -#ifndef PTRACE_SETREGSET -#define PTRACE_SETREGSET 0x4205 -#endif - - -#ifndef PTRACE_GET_THREAD_AREA -#define PTRACE_GET_THREAD_AREA 25 -#endif - -/* This definition comes from prctl.h, but some kernels may not have it. */ -#ifndef PTRACE_ARCH_PRCTL -#define PTRACE_ARCH_PRCTL 30 -#endif - -/* The following definitions come from prctl.h, but may be absent - for certain configurations. */ -#ifndef ARCH_GET_FS -#define ARCH_SET_GS 0x1001 -#define ARCH_SET_FS 0x1002 -#define ARCH_GET_FS 0x1003 -#define ARCH_GET_GS 0x1004 -#endif - -/* Per-process arch-specific data we want to keep. */ - -struct arch_process_info -{ - struct i386_debug_reg_state debug_reg_state; -}; - -/* Per-thread arch-specific data we want to keep. */ - -struct arch_lwp_info -{ - /* Non-zero if our copy differs from what's recorded in the thread. */ - int debug_registers_changed; -}; - -#ifdef __x86_64__ - -/* Mapping between the general-purpose registers in `struct user' - format and GDB's register array layout. - Note that the transfer layout uses 64-bit regs. */ -static /*const*/ int i386_regmap[] = -{ - RAX * 8, RCX * 8, RDX * 8, RBX * 8, - RSP * 8, RBP * 8, RSI * 8, RDI * 8, - RIP * 8, EFLAGS * 8, CS * 8, SS * 8, - DS * 8, ES * 8, FS * 8, GS * 8 -}; - -#define I386_NUM_REGS (sizeof (i386_regmap) / sizeof (i386_regmap[0])) - -/* So code below doesn't have to care, i386 or amd64. */ -#define ORIG_EAX ORIG_RAX - -static const int x86_64_regmap[] = -{ - RAX * 8, RBX * 8, RCX * 8, RDX * 8, - RSI * 8, RDI * 8, RBP * 8, RSP * 8, - R8 * 8, R9 * 8, R10 * 8, R11 * 8, - R12 * 8, R13 * 8, R14 * 8, R15 * 8, - RIP * 8, EFLAGS * 8, CS * 8, SS * 8, - DS * 8, ES * 8, FS * 8, GS * 8, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, - ORIG_RAX * 8 -}; - -#define X86_64_NUM_REGS (sizeof (x86_64_regmap) / sizeof (x86_64_regmap[0])) - -#else /* ! __x86_64__ */ - -/* Mapping between the general-purpose registers in `struct user' - format and GDB's register array layout. */ -static /*const*/ int i386_regmap[] = -{ - EAX * 4, ECX * 4, EDX * 4, EBX * 4, - UESP * 4, EBP * 4, ESI * 4, EDI * 4, - EIP * 4, EFL * 4, CS * 4, SS * 4, - DS * 4, ES * 4, FS * 4, GS * 4 -}; - -#define I386_NUM_REGS (sizeof (i386_regmap) / sizeof (i386_regmap[0])) - -#endif - -/* Called by libthread_db. */ - -ps_err_e -ps_get_thread_area (const struct ps_prochandle *ph, - lwpid_t lwpid, int idx, void **base) -{ -#ifdef __x86_64__ - int use_64bit = register_size (0) == 8; - - if (use_64bit) - { - switch (idx) - { - case FS: - if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_FS) == 0) - return PS_OK; - break; - case GS: - if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_GS) == 0) - return PS_OK; - break; - default: - return PS_BADADDR; - } - return PS_ERR; - } -#endif - - { - unsigned int desc[4]; - - if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, - (void *) (intptr_t) idx, (unsigned long) &desc) < 0) - return PS_ERR; - - *(int *)base = desc[1]; - return PS_OK; - } -} - -/* Get the thread area address. This is used to recognize which - thread is which when tracing with the in-process agent library. We - don't read anything from the address, and treat it as opaque; it's - the address itself that we assume is unique per-thread. */ - -static int -x86_get_thread_area (int lwpid, CORE_ADDR *addr) -{ -#ifdef __x86_64__ - int use_64bit = register_size (0) == 8; - - if (use_64bit) - { - void *base; - if (ptrace (PTRACE_ARCH_PRCTL, lwpid, &base, ARCH_GET_FS) == 0) - { - *addr = (CORE_ADDR) (uintptr_t) base; - return 0; - } - - return -1; - } -#endif - - { - struct lwp_info *lwp = find_lwp_pid (pid_to_ptid (lwpid)); - struct regcache *regcache = get_thread_regcache (get_lwp_thread (lwp), 1); - unsigned int desc[4]; - ULONGEST gs = 0; - const int reg_thread_area = 3; /* bits to scale down register value. */ - int idx; - - collect_register_by_name (regcache, "gs", &gs); - - idx = gs >> reg_thread_area; - - if (ptrace (PTRACE_GET_THREAD_AREA, - lwpid_of (lwp), - (void *) (long) idx, (unsigned long) &desc) < 0) - return -1; - - *addr = desc[1]; - return 0; - } -} - - - -static int -i386_cannot_store_register (int regno) -{ - return regno >= I386_NUM_REGS; -} - -static int -i386_cannot_fetch_register (int regno) -{ - return regno >= I386_NUM_REGS; -} - -static void -x86_fill_gregset (struct regcache *regcache, void *buf) -{ - int i; - -#ifdef __x86_64__ - if (register_size (0) == 8) - { - for (i = 0; i < X86_64_NUM_REGS; i++) - if (x86_64_regmap[i] != -1) - collect_register (regcache, i, ((char *) buf) + x86_64_regmap[i]); - return; - } -#endif - - for (i = 0; i < I386_NUM_REGS; i++) - collect_register (regcache, i, ((char *) buf) + i386_regmap[i]); - - collect_register_by_name (regcache, "orig_eax", - ((char *) buf) + ORIG_EAX * 4); -} - -static void -x86_store_gregset (struct regcache *regcache, const void *buf) -{ - int i; - -#ifdef __x86_64__ - if (register_size (0) == 8) - { - for (i = 0; i < X86_64_NUM_REGS; i++) - if (x86_64_regmap[i] != -1) - supply_register (regcache, i, ((char *) buf) + x86_64_regmap[i]); - return; - } -#endif - - for (i = 0; i < I386_NUM_REGS; i++) - supply_register (regcache, i, ((char *) buf) + i386_regmap[i]); - - supply_register_by_name (regcache, "orig_eax", - ((char *) buf) + ORIG_EAX * 4); -} - -static void -x86_fill_fpregset (struct regcache *regcache, void *buf) -{ -#ifdef __x86_64__ - i387_cache_to_fxsave (regcache, buf); -#else - i387_cache_to_fsave (regcache, buf); -#endif -} - -static void -x86_store_fpregset (struct regcache *regcache, const void *buf) -{ -#ifdef __x86_64__ - i387_fxsave_to_cache (regcache, buf); -#else - i387_fsave_to_cache (regcache, buf); -#endif -} - -#ifndef __x86_64__ - -static void -x86_fill_fpxregset (struct regcache *regcache, void *buf) -{ - i387_cache_to_fxsave (regcache, buf); -} - -static void -x86_store_fpxregset (struct regcache *regcache, const void *buf) -{ - i387_fxsave_to_cache (regcache, buf); -} - -#endif - -static void -x86_fill_xstateregset (struct regcache *regcache, void *buf) -{ - i387_cache_to_xsave (regcache, buf); -} - -static void -x86_store_xstateregset (struct regcache *regcache, const void *buf) -{ - i387_xsave_to_cache (regcache, buf); -} - -/* ??? The non-biarch i386 case stores all the i387 regs twice. - Once in i387_.*fsave.* and once in i387_.*fxsave.*. - This is, presumably, to handle the case where PTRACE_[GS]ETFPXREGS - doesn't work. IWBN to avoid the duplication in the case where it - does work. Maybe the arch_setup routine could check whether it works - and update target_regsets accordingly, maybe by moving target_regsets - to linux_target_ops and set the right one there, rather than having to - modify the target_regsets global. */ - -struct regset_info target_regsets[] = -{ -#ifdef HAVE_PTRACE_GETREGS - { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t), - GENERAL_REGS, - x86_fill_gregset, x86_store_gregset }, - { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_X86_XSTATE, 0, - EXTENDED_REGS, x86_fill_xstateregset, x86_store_xstateregset }, -# ifndef __x86_64__ -# ifdef HAVE_PTRACE_GETFPXREGS - { PTRACE_GETFPXREGS, PTRACE_SETFPXREGS, 0, sizeof (elf_fpxregset_t), - EXTENDED_REGS, - x86_fill_fpxregset, x86_store_fpxregset }, -# endif -# endif - { PTRACE_GETFPREGS, PTRACE_SETFPREGS, 0, sizeof (elf_fpregset_t), - FP_REGS, - x86_fill_fpregset, x86_store_fpregset }, -#endif /* HAVE_PTRACE_GETREGS */ - { 0, 0, 0, -1, -1, NULL, NULL } -}; - -static CORE_ADDR -x86_get_pc (struct regcache *regcache) -{ - int use_64bit = register_size (0) == 8; - - if (use_64bit) - { - unsigned long pc; - collect_register_by_name (regcache, "rip", &pc); - return (CORE_ADDR) pc; - } - else - { - unsigned int pc; - collect_register_by_name (regcache, "eip", &pc); - return (CORE_ADDR) pc; - } -} - -static void -x86_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - int use_64bit = register_size (0) == 8; - - if (use_64bit) - { - unsigned long newpc = pc; - supply_register_by_name (regcache, "rip", &newpc); - } - else - { - unsigned int newpc = pc; - supply_register_by_name (regcache, "eip", &newpc); - } -} - -static const unsigned char x86_breakpoint[] = { 0xCC }; -#define x86_breakpoint_len 1 - -static int -x86_breakpoint_at (CORE_ADDR pc) -{ - unsigned char c; - - (*the_target->read_memory) (pc, &c, 1); - if (c == 0xCC) - return 1; - - return 0; -} - -/* Support for debug registers. */ - -static unsigned long -x86_linux_dr_get (ptid_t ptid, int regnum) -{ - int tid; - unsigned long value; - - tid = ptid_get_lwp (ptid); - - errno = 0; - value = ptrace (PTRACE_PEEKUSER, tid, - offsetof (struct user, u_debugreg[regnum]), 0); - if (errno != 0) - error ("Couldn't read debug register"); - - return value; -} - -static void -x86_linux_dr_set (ptid_t ptid, int regnum, unsigned long value) -{ - int tid; - - tid = ptid_get_lwp (ptid); - - errno = 0; - ptrace (PTRACE_POKEUSER, tid, - offsetof (struct user, u_debugreg[regnum]), value); - if (errno != 0) - error ("Couldn't write debug register"); -} - -static int -update_debug_registers_callback (struct inferior_list_entry *entry, - void *pid_p) -{ - struct lwp_info *lwp = (struct lwp_info *) entry; - int pid = *(int *) pid_p; - - /* Only update the threads of this process. */ - if (pid_of (lwp) == pid) - { - /* The actual update is done later just before resuming the lwp, - we just mark that the registers need updating. */ - lwp->arch_private->debug_registers_changed = 1; - - /* If the lwp isn't stopped, force it to momentarily pause, so - we can update its debug registers. */ - if (!lwp->stopped) - linux_stop_lwp (lwp); - } - - return 0; -} - -/* Update the inferior's debug register REGNUM from STATE. */ - -void -i386_dr_low_set_addr (const struct i386_debug_reg_state *state, int regnum) -{ - /* Only update the threads of this process. */ - int pid = pid_of (get_thread_lwp (current_inferior)); - - if (! (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR)) - fatal ("Invalid debug register %d", regnum); - - find_inferior (&all_lwps, update_debug_registers_callback, &pid); -} - -/* Return the inferior's debug register REGNUM. */ - -CORE_ADDR -i386_dr_low_get_addr (int regnum) -{ - struct lwp_info *lwp = get_thread_lwp (current_inferior); - ptid_t ptid = ptid_of (lwp); - - /* DR6 and DR7 are retrieved with some other way. */ - gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR); - - return x86_linux_dr_get (ptid, regnum); -} - -/* Update the inferior's DR7 debug control register from STATE. */ - -void -i386_dr_low_set_control (const struct i386_debug_reg_state *state) -{ - /* Only update the threads of this process. */ - int pid = pid_of (get_thread_lwp (current_inferior)); - - find_inferior (&all_lwps, update_debug_registers_callback, &pid); -} - -/* Return the inferior's DR7 debug control register. */ - -unsigned -i386_dr_low_get_control (void) -{ - struct lwp_info *lwp = get_thread_lwp (current_inferior); - ptid_t ptid = ptid_of (lwp); - - return x86_linux_dr_get (ptid, DR_CONTROL); -} - -/* Get the value of the DR6 debug status register from the inferior - and record it in STATE. */ - -unsigned -i386_dr_low_get_status (void) -{ - struct lwp_info *lwp = get_thread_lwp (current_inferior); - ptid_t ptid = ptid_of (lwp); - - return x86_linux_dr_get (ptid, DR_STATUS); -} - -/* Breakpoint/Watchpoint support. */ - -static int -x86_insert_point (char type, CORE_ADDR addr, int len) -{ - struct process_info *proc = current_process (); - switch (type) - { - case '0': - { - int ret; - - ret = prepare_to_access_memory (); - if (ret) - return -1; - ret = set_gdb_breakpoint_at (addr); - done_accessing_memory (); - return ret; - } - case '2': - case '3': - case '4': - return i386_low_insert_watchpoint (&proc->private->arch_private->debug_reg_state, - type, addr, len); - default: - /* Unsupported. */ - return 1; - } -} - -static int -x86_remove_point (char type, CORE_ADDR addr, int len) -{ - struct process_info *proc = current_process (); - switch (type) - { - case '0': - { - int ret; - - ret = prepare_to_access_memory (); - if (ret) - return -1; - ret = delete_gdb_breakpoint_at (addr); - done_accessing_memory (); - return ret; - } - case '2': - case '3': - case '4': - return i386_low_remove_watchpoint (&proc->private->arch_private->debug_reg_state, - type, addr, len); - default: - /* Unsupported. */ - return 1; - } -} - -static int -x86_stopped_by_watchpoint (void) -{ - struct process_info *proc = current_process (); - return i386_low_stopped_by_watchpoint (&proc->private->arch_private->debug_reg_state); -} - -static CORE_ADDR -x86_stopped_data_address (void) -{ - struct process_info *proc = current_process (); - CORE_ADDR addr; - if (i386_low_stopped_data_address (&proc->private->arch_private->debug_reg_state, - &addr)) - return addr; - return 0; -} - -/* Called when a new process is created. */ - -static struct arch_process_info * -x86_linux_new_process (void) -{ - struct arch_process_info *info = xcalloc (1, sizeof (*info)); - - i386_low_init_dregs (&info->debug_reg_state); - - return info; -} - -/* Called when a new thread is detected. */ - -static struct arch_lwp_info * -x86_linux_new_thread (void) -{ - struct arch_lwp_info *info = xcalloc (1, sizeof (*info)); - - info->debug_registers_changed = 1; - - return info; -} - -/* Called when resuming a thread. - If the debug regs have changed, update the thread's copies. */ - -static void -x86_linux_prepare_to_resume (struct lwp_info *lwp) -{ - ptid_t ptid = ptid_of (lwp); - - if (lwp->arch_private->debug_registers_changed) - { - int i; - int pid = ptid_get_pid (ptid); - struct process_info *proc = find_process_pid (pid); - struct i386_debug_reg_state *state - = &proc->private->arch_private->debug_reg_state; - - for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++) - x86_linux_dr_set (ptid, i, state->dr_mirror[i]); - - x86_linux_dr_set (ptid, DR_CONTROL, state->dr_control_mirror); - - lwp->arch_private->debug_registers_changed = 0; - } - - if (lwp->stopped_by_watchpoint) - x86_linux_dr_set (ptid, DR_STATUS, 0); -} - -/* When GDBSERVER is built as a 64-bit application on linux, the - PTRACE_GETSIGINFO data is always presented in 64-bit layout. Since - debugging a 32-bit inferior with a 64-bit GDBSERVER should look the same - as debugging it with a 32-bit GDBSERVER, we do the 32-bit <-> 64-bit - conversion in-place ourselves. */ - -/* These types below (compat_*) define a siginfo type that is layout - compatible with the siginfo type exported by the 32-bit userspace - support. */ - -#ifdef __x86_64__ - -typedef int compat_int_t; -typedef unsigned int compat_uptr_t; - -typedef int compat_time_t; -typedef int compat_timer_t; -typedef int compat_clock_t; - -struct compat_timeval -{ - compat_time_t tv_sec; - int tv_usec; -}; - -typedef union compat_sigval -{ - compat_int_t sival_int; - compat_uptr_t sival_ptr; -} compat_sigval_t; - -typedef struct compat_siginfo -{ - int si_signo; - int si_errno; - int si_code; - - union - { - int _pad[((128 / sizeof (int)) - 3)]; - - /* kill() */ - struct - { - unsigned int _pid; - unsigned int _uid; - } _kill; - - /* POSIX.1b timers */ - struct - { - compat_timer_t _tid; - int _overrun; - compat_sigval_t _sigval; - } _timer; - - /* POSIX.1b signals */ - struct - { - unsigned int _pid; - unsigned int _uid; - compat_sigval_t _sigval; - } _rt; - - /* SIGCHLD */ - struct - { - unsigned int _pid; - unsigned int _uid; - int _status; - compat_clock_t _utime; - compat_clock_t _stime; - } _sigchld; - - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ - struct - { - unsigned int _addr; - } _sigfault; - - /* SIGPOLL */ - struct - { - int _band; - int _fd; - } _sigpoll; - } _sifields; -} compat_siginfo_t; - -#define cpt_si_pid _sifields._kill._pid -#define cpt_si_uid _sifields._kill._uid -#define cpt_si_timerid _sifields._timer._tid -#define cpt_si_overrun _sifields._timer._overrun -#define cpt_si_status _sifields._sigchld._status -#define cpt_si_utime _sifields._sigchld._utime -#define cpt_si_stime _sifields._sigchld._stime -#define cpt_si_ptr _sifields._rt._sigval.sival_ptr -#define cpt_si_addr _sifields._sigfault._addr -#define cpt_si_band _sifields._sigpoll._band -#define cpt_si_fd _sifields._sigpoll._fd - -/* glibc at least up to 2.3.2 doesn't have si_timerid, si_overrun. - In their place is si_timer1,si_timer2. */ -#ifndef si_timerid -#define si_timerid si_timer1 -#endif -#ifndef si_overrun -#define si_overrun si_timer2 -#endif - -static void -compat_siginfo_from_siginfo (compat_siginfo_t *to, siginfo_t *from) -{ - memset (to, 0, sizeof (*to)); - - to->si_signo = from->si_signo; - to->si_errno = from->si_errno; - to->si_code = from->si_code; - - if (to->si_code == SI_TIMER) - { - to->cpt_si_timerid = from->si_timerid; - to->cpt_si_overrun = from->si_overrun; - to->cpt_si_ptr = (intptr_t) from->si_ptr; - } - else if (to->si_code == SI_USER) - { - to->cpt_si_pid = from->si_pid; - to->cpt_si_uid = from->si_uid; - } - else if (to->si_code < 0) - { - to->cpt_si_pid = from->si_pid; - to->cpt_si_uid = from->si_uid; - to->cpt_si_ptr = (intptr_t) from->si_ptr; - } - else - { - switch (to->si_signo) - { - case SIGCHLD: - to->cpt_si_pid = from->si_pid; - to->cpt_si_uid = from->si_uid; - to->cpt_si_status = from->si_status; - to->cpt_si_utime = from->si_utime; - to->cpt_si_stime = from->si_stime; - break; - case SIGILL: - case SIGFPE: - case SIGSEGV: - case SIGBUS: - to->cpt_si_addr = (intptr_t) from->si_addr; - break; - case SIGPOLL: - to->cpt_si_band = from->si_band; - to->cpt_si_fd = from->si_fd; - break; - default: - to->cpt_si_pid = from->si_pid; - to->cpt_si_uid = from->si_uid; - to->cpt_si_ptr = (intptr_t) from->si_ptr; - break; - } - } -} - -static void -siginfo_from_compat_siginfo (siginfo_t *to, compat_siginfo_t *from) -{ - memset (to, 0, sizeof (*to)); - - to->si_signo = from->si_signo; - to->si_errno = from->si_errno; - to->si_code = from->si_code; - - if (to->si_code == SI_TIMER) - { - to->si_timerid = from->cpt_si_timerid; - to->si_overrun = from->cpt_si_overrun; - to->si_ptr = (void *) (intptr_t) from->cpt_si_ptr; - } - else if (to->si_code == SI_USER) - { - to->si_pid = from->cpt_si_pid; - to->si_uid = from->cpt_si_uid; - } - else if (to->si_code < 0) - { - to->si_pid = from->cpt_si_pid; - to->si_uid = from->cpt_si_uid; - to->si_ptr = (void *) (intptr_t) from->cpt_si_ptr; - } - else - { - switch (to->si_signo) - { - case SIGCHLD: - to->si_pid = from->cpt_si_pid; - to->si_uid = from->cpt_si_uid; - to->si_status = from->cpt_si_status; - to->si_utime = from->cpt_si_utime; - to->si_stime = from->cpt_si_stime; - break; - case SIGILL: - case SIGFPE: - case SIGSEGV: - case SIGBUS: - to->si_addr = (void *) (intptr_t) from->cpt_si_addr; - break; - case SIGPOLL: - to->si_band = from->cpt_si_band; - to->si_fd = from->cpt_si_fd; - break; - default: - to->si_pid = from->cpt_si_pid; - to->si_uid = from->cpt_si_uid; - to->si_ptr = (void* ) (intptr_t) from->cpt_si_ptr; - break; - } - } -} - -#endif /* __x86_64__ */ - -/* Convert a native/host siginfo object, into/from the siginfo in the - layout of the inferiors' architecture. Returns true if any - conversion was done; false otherwise. If DIRECTION is 1, then copy - from INF to NATIVE. If DIRECTION is 0, copy from NATIVE to - INF. */ - -static int -x86_siginfo_fixup (struct siginfo *native, void *inf, int direction) -{ -#ifdef __x86_64__ - /* Is the inferior 32-bit? If so, then fixup the siginfo object. */ - if (register_size (0) == 4) - { - if (sizeof (struct siginfo) != sizeof (compat_siginfo_t)) - fatal ("unexpected difference in siginfo"); - - if (direction == 0) - compat_siginfo_from_siginfo ((struct compat_siginfo *) inf, native); - else - siginfo_from_compat_siginfo (native, (struct compat_siginfo *) inf); - - return 1; - } -#endif - - return 0; -} - -static int use_xml; - -/* Update gdbserver_xmltarget. */ - -static void -x86_linux_update_xmltarget (void) -{ - int pid; - struct regset_info *regset; - static unsigned long long xcr0; - static int have_ptrace_getregset = -1; -#if !defined(__x86_64__) && defined(HAVE_PTRACE_GETFPXREGS) - static int have_ptrace_getfpxregs = -1; -#endif - - if (!current_inferior) - return; - - /* Before changing the register cache internal layout or the target - regsets, flush the contents of the current valid caches back to - the threads. */ - regcache_invalidate (); - - pid = pid_of (get_thread_lwp (current_inferior)); -#ifdef __x86_64__ - if (num_xmm_registers == 8) - init_registers_i386_linux (); - else - init_registers_amd64_linux (); -#else - { -# ifdef HAVE_PTRACE_GETFPXREGS - if (have_ptrace_getfpxregs == -1) - { - elf_fpxregset_t fpxregs; - - if (ptrace (PTRACE_GETFPXREGS, pid, 0, (int) &fpxregs) < 0) - { - have_ptrace_getfpxregs = 0; - x86_xcr0 = I386_XSTATE_X87_MASK; - - /* Disable PTRACE_GETFPXREGS. */ - for (regset = target_regsets; - regset->fill_function != NULL; regset++) - if (regset->get_request == PTRACE_GETFPXREGS) - { - regset->size = 0; - break; - } - } - else - have_ptrace_getfpxregs = 1; - } - - if (!have_ptrace_getfpxregs) - { - init_registers_i386_mmx_linux (); - return; - } -# endif - init_registers_i386_linux (); - } -#endif - - if (!use_xml) - { - /* Don't use XML. */ -#ifdef __x86_64__ - if (num_xmm_registers == 8) - gdbserver_xmltarget = xmltarget_i386_linux_no_xml; - else - gdbserver_xmltarget = xmltarget_amd64_linux_no_xml; -#else - gdbserver_xmltarget = xmltarget_i386_linux_no_xml; -#endif - - x86_xcr0 = I386_XSTATE_SSE_MASK; - - return; - } - - /* Check if XSAVE extended state is supported. */ - if (have_ptrace_getregset == -1) - { - unsigned long long xstateregs[I386_XSTATE_SSE_SIZE / sizeof (long long)]; - struct iovec iov; - - iov.iov_base = xstateregs; - iov.iov_len = sizeof (xstateregs); - - /* Check if PTRACE_GETREGSET works. */ - if (ptrace (PTRACE_GETREGSET, pid, (unsigned int) NT_X86_XSTATE, - &iov) < 0) - { - have_ptrace_getregset = 0; - return; - } - else - have_ptrace_getregset = 1; - - /* Get XCR0 from XSAVE extended state at byte 464. */ - xcr0 = xstateregs[464 / sizeof (long long)]; - - /* Use PTRACE_GETREGSET if it is available. */ - for (regset = target_regsets; - regset->fill_function != NULL; regset++) - if (regset->get_request == PTRACE_GETREGSET) - regset->size = I386_XSTATE_SIZE (xcr0); - else if (regset->type != GENERAL_REGS) - regset->size = 0; - } - - if (have_ptrace_getregset) - { - /* AVX is the highest feature we support. */ - if ((xcr0 & I386_XSTATE_AVX_MASK) == I386_XSTATE_AVX_MASK) - { - x86_xcr0 = xcr0; - -#ifdef __x86_64__ - /* I386 has 8 xmm regs. */ - if (num_xmm_registers == 8) - init_registers_i386_avx_linux (); - else - init_registers_amd64_avx_linux (); -#else - init_registers_i386_avx_linux (); -#endif - } - } -} - -/* Process qSupported query, "xmlRegisters=". Update the buffer size for - PTRACE_GETREGSET. */ - -static void -x86_linux_process_qsupported (const char *query) -{ - /* Return if gdb doesn't support XML. If gdb sends "xmlRegisters=" - with "i386" in qSupported query, it supports x86 XML target - descriptions. */ - use_xml = 0; - if (query != NULL && strncmp (query, "xmlRegisters=", 13) == 0) - { - char *copy = xstrdup (query + 13); - char *p; - - for (p = strtok (copy, ","); p != NULL; p = strtok (NULL, ",")) - { - if (strcmp (p, "i386") == 0) - { - use_xml = 1; - break; - } - } - - free (copy); - } - - x86_linux_update_xmltarget (); -} - -/* Initialize gdbserver for the architecture of the inferior. */ - -static void -x86_arch_setup (void) -{ -#ifdef __x86_64__ - int pid = pid_of (get_thread_lwp (current_inferior)); - char *file = linux_child_pid_to_exec_file (pid); - int use_64bit = elf_64_file_p (file); - - free (file); - - if (use_64bit < 0) - { - /* This can only happen if /proc/<pid>/exe is unreadable, - but "that can't happen" if we've gotten this far. - Fall through and assume this is a 32-bit program. */ - } - else if (use_64bit) - { - /* Amd64 doesn't have HAVE_LINUX_USRREGS. */ - the_low_target.num_regs = -1; - the_low_target.regmap = NULL; - the_low_target.cannot_fetch_register = NULL; - the_low_target.cannot_store_register = NULL; - - /* Amd64 has 16 xmm regs. */ - num_xmm_registers = 16; - - x86_linux_update_xmltarget (); - return; - } -#endif - - /* Ok we have a 32-bit inferior. */ - - the_low_target.num_regs = I386_NUM_REGS; - the_low_target.regmap = i386_regmap; - the_low_target.cannot_fetch_register = i386_cannot_fetch_register; - the_low_target.cannot_store_register = i386_cannot_store_register; - - /* I386 has 8 xmm regs. */ - num_xmm_registers = 8; - - x86_linux_update_xmltarget (); -} - -static int -x86_supports_tracepoints (void) -{ - return 1; -} - -static void -append_insns (CORE_ADDR *to, size_t len, const unsigned char *buf) -{ - write_inferior_memory (*to, buf, len); - *to += len; -} - -static int -push_opcode (unsigned char *buf, char *op) -{ - unsigned char *buf_org = buf; - - while (1) - { - char *endptr; - unsigned long ul = strtoul (op, &endptr, 16); - - if (endptr == op) - break; - - *buf++ = ul; - op = endptr; - } - - return buf - buf_org; -} - -#ifdef __x86_64__ - -/* Build a jump pad that saves registers and calls a collection - function. Writes a jump instruction to the jump pad to - JJUMPAD_INSN. The caller is responsible to write it in at the - tracepoint address. */ - -static int -amd64_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr, - CORE_ADDR collector, - CORE_ADDR lockaddr, - ULONGEST orig_size, - CORE_ADDR *jump_entry, - unsigned char *jjump_pad_insn, - ULONGEST *jjump_pad_insn_size, - CORE_ADDR *adjusted_insn_addr, - CORE_ADDR *adjusted_insn_addr_end) -{ - unsigned char buf[40]; - int i, offset; - CORE_ADDR buildaddr = *jump_entry; - - /* Build the jump pad. */ - - /* First, do tracepoint data collection. Save registers. */ - i = 0; - /* Need to ensure stack pointer saved first. */ - buf[i++] = 0x54; /* push %rsp */ - buf[i++] = 0x55; /* push %rbp */ - buf[i++] = 0x57; /* push %rdi */ - buf[i++] = 0x56; /* push %rsi */ - buf[i++] = 0x52; /* push %rdx */ - buf[i++] = 0x51; /* push %rcx */ - buf[i++] = 0x53; /* push %rbx */ - buf[i++] = 0x50; /* push %rax */ - buf[i++] = 0x41; buf[i++] = 0x57; /* push %r15 */ - buf[i++] = 0x41; buf[i++] = 0x56; /* push %r14 */ - buf[i++] = 0x41; buf[i++] = 0x55; /* push %r13 */ - buf[i++] = 0x41; buf[i++] = 0x54; /* push %r12 */ - buf[i++] = 0x41; buf[i++] = 0x53; /* push %r11 */ - buf[i++] = 0x41; buf[i++] = 0x52; /* push %r10 */ - buf[i++] = 0x41; buf[i++] = 0x51; /* push %r9 */ - buf[i++] = 0x41; buf[i++] = 0x50; /* push %r8 */ - buf[i++] = 0x9c; /* pushfq */ - buf[i++] = 0x48; /* movl <addr>,%rdi */ - buf[i++] = 0xbf; - *((unsigned long *)(buf + i)) = (unsigned long) tpaddr; - i += sizeof (unsigned long); - buf[i++] = 0x57; /* push %rdi */ - append_insns (&buildaddr, i, buf); - - /* Stack space for the collecting_t object. */ - i = 0; - i += push_opcode (&buf[i], "48 83 ec 18"); /* sub $0x18,%rsp */ - i += push_opcode (&buf[i], "48 b8"); /* mov <tpoint>,%rax */ - memcpy (buf + i, &tpoint, 8); - i += 8; - i += push_opcode (&buf[i], "48 89 04 24"); /* mov %rax,(%rsp) */ - i += push_opcode (&buf[i], - "64 48 8b 04 25 00 00 00 00"); /* mov %fs:0x0,%rax */ - i += push_opcode (&buf[i], "48 89 44 24 08"); /* mov %rax,0x8(%rsp) */ - append_insns (&buildaddr, i, buf); - - /* spin-lock. */ - i = 0; - i += push_opcode (&buf[i], "48 be"); /* movl <lockaddr>,%rsi */ - memcpy (&buf[i], (void *) &lockaddr, 8); - i += 8; - i += push_opcode (&buf[i], "48 89 e1"); /* mov %rsp,%rcx */ - i += push_opcode (&buf[i], "31 c0"); /* xor %eax,%eax */ - i += push_opcode (&buf[i], "f0 48 0f b1 0e"); /* lock cmpxchg %rcx,(%rsi) */ - i += push_opcode (&buf[i], "48 85 c0"); /* test %rax,%rax */ - i += push_opcode (&buf[i], "75 f4"); /* jne <again> */ - append_insns (&buildaddr, i, buf); - - /* Set up the gdb_collect call. */ - /* At this point, (stack pointer + 0x18) is the base of our saved - register block. */ - - i = 0; - i += push_opcode (&buf[i], "48 89 e6"); /* mov %rsp,%rsi */ - i += push_opcode (&buf[i], "48 83 c6 18"); /* add $0x18,%rsi */ - - /* tpoint address may be 64-bit wide. */ - i += push_opcode (&buf[i], "48 bf"); /* movl <addr>,%rdi */ - memcpy (buf + i, &tpoint, 8); - i += 8; - append_insns (&buildaddr, i, buf); - - /* The collector function being in the shared library, may be - >31-bits away off the jump pad. */ - i = 0; - i += push_opcode (&buf[i], "48 b8"); /* mov $collector,%rax */ - memcpy (buf + i, &collector, 8); - i += 8; - i += push_opcode (&buf[i], "ff d0"); /* callq *%rax */ - append_insns (&buildaddr, i, buf); - - /* Clear the spin-lock. */ - i = 0; - i += push_opcode (&buf[i], "31 c0"); /* xor %eax,%eax */ - i += push_opcode (&buf[i], "48 a3"); /* mov %rax, lockaddr */ - memcpy (buf + i, &lockaddr, 8); - i += 8; - append_insns (&buildaddr, i, buf); - - /* Remove stack that had been used for the collect_t object. */ - i = 0; - i += push_opcode (&buf[i], "48 83 c4 18"); /* add $0x18,%rsp */ - append_insns (&buildaddr, i, buf); - - /* Restore register state. */ - i = 0; - buf[i++] = 0x48; /* add $0x8,%rsp */ - buf[i++] = 0x83; - buf[i++] = 0xc4; - buf[i++] = 0x08; - buf[i++] = 0x9d; /* popfq */ - buf[i++] = 0x41; buf[i++] = 0x58; /* pop %r8 */ - buf[i++] = 0x41; buf[i++] = 0x59; /* pop %r9 */ - buf[i++] = 0x41; buf[i++] = 0x5a; /* pop %r10 */ - buf[i++] = 0x41; buf[i++] = 0x5b; /* pop %r11 */ - buf[i++] = 0x41; buf[i++] = 0x5c; /* pop %r12 */ - buf[i++] = 0x41; buf[i++] = 0x5d; /* pop %r13 */ - buf[i++] = 0x41; buf[i++] = 0x5e; /* pop %r14 */ - buf[i++] = 0x41; buf[i++] = 0x5f; /* pop %r15 */ - buf[i++] = 0x58; /* pop %rax */ - buf[i++] = 0x5b; /* pop %rbx */ - buf[i++] = 0x59; /* pop %rcx */ - buf[i++] = 0x5a; /* pop %rdx */ - buf[i++] = 0x5e; /* pop %rsi */ - buf[i++] = 0x5f; /* pop %rdi */ - buf[i++] = 0x5d; /* pop %rbp */ - buf[i++] = 0x5c; /* pop %rsp */ - append_insns (&buildaddr, i, buf); - - /* Now, adjust the original instruction to execute in the jump - pad. */ - *adjusted_insn_addr = buildaddr; - relocate_instruction (&buildaddr, tpaddr); - *adjusted_insn_addr_end = buildaddr; - - /* Finally, write a jump back to the program. */ - offset = (tpaddr + orig_size) - (buildaddr + sizeof (jump_insn)); - memcpy (buf, jump_insn, sizeof (jump_insn)); - memcpy (buf + 1, &offset, 4); - append_insns (&buildaddr, sizeof (jump_insn), buf); - - /* The jump pad is now built. Wire in a jump to our jump pad. This - is always done last (by our caller actually), so that we can - install fast tracepoints with threads running. This relies on - the agent's atomic write support. */ - offset = *jump_entry - (tpaddr + sizeof (jump_insn)); - memcpy (buf, jump_insn, sizeof (jump_insn)); - memcpy (buf + 1, &offset, 4); - memcpy (jjump_pad_insn, buf, sizeof (jump_insn)); - *jjump_pad_insn_size = sizeof (jump_insn); - - /* Return the end address of our pad. */ - *jump_entry = buildaddr; - - return 0; -} - -#endif /* __x86_64__ */ - -/* Build a jump pad that saves registers and calls a collection - function. Writes a jump instruction to the jump pad to - JJUMPAD_INSN. The caller is responsible to write it in at the - tracepoint address. */ - -static int -i386_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr, - CORE_ADDR collector, - CORE_ADDR lockaddr, - ULONGEST orig_size, - CORE_ADDR *jump_entry, - unsigned char *jjump_pad_insn, - ULONGEST *jjump_pad_insn_size, - CORE_ADDR *adjusted_insn_addr, - CORE_ADDR *adjusted_insn_addr_end) -{ - unsigned char buf[0x100]; - int i, offset; - CORE_ADDR buildaddr = *jump_entry; - - /* Build the jump pad. */ - - /* First, do tracepoint data collection. Save registers. */ - i = 0; - buf[i++] = 0x60; /* pushad */ - buf[i++] = 0x68; /* push tpaddr aka $pc */ - *((int *)(buf + i)) = (int) tpaddr; - i += 4; - buf[i++] = 0x9c; /* pushf */ - buf[i++] = 0x1e; /* push %ds */ - buf[i++] = 0x06; /* push %es */ - buf[i++] = 0x0f; /* push %fs */ - buf[i++] = 0xa0; - buf[i++] = 0x0f; /* push %gs */ - buf[i++] = 0xa8; - buf[i++] = 0x16; /* push %ss */ - buf[i++] = 0x0e; /* push %cs */ - append_insns (&buildaddr, i, buf); - - /* Stack space for the collecting_t object. */ - i = 0; - i += push_opcode (&buf[i], "83 ec 08"); /* sub $0x8,%esp */ - - /* Build the object. */ - i += push_opcode (&buf[i], "b8"); /* mov <tpoint>,%eax */ - memcpy (buf + i, &tpoint, 4); - i += 4; - i += push_opcode (&buf[i], "89 04 24"); /* mov %eax,(%esp) */ - - i += push_opcode (&buf[i], "65 a1 00 00 00 00"); /* mov %gs:0x0,%eax */ - i += push_opcode (&buf[i], "89 44 24 04"); /* mov %eax,0x4(%esp) */ - append_insns (&buildaddr, i, buf); - - /* spin-lock. Note this is using cmpxchg, which leaves i386 behind. - If we cared for it, this could be using xchg alternatively. */ - - i = 0; - i += push_opcode (&buf[i], "31 c0"); /* xor %eax,%eax */ - i += push_opcode (&buf[i], "f0 0f b1 25"); /* lock cmpxchg - %esp,<lockaddr> */ - memcpy (&buf[i], (void *) &lockaddr, 4); - i += 4; - i += push_opcode (&buf[i], "85 c0"); /* test %eax,%eax */ - i += push_opcode (&buf[i], "75 f2"); /* jne <again> */ - append_insns (&buildaddr, i, buf); - - - /* Set up arguments to the gdb_collect call. */ - i = 0; - i += push_opcode (&buf[i], "89 e0"); /* mov %esp,%eax */ - i += push_opcode (&buf[i], "83 c0 08"); /* add $0x08,%eax */ - i += push_opcode (&buf[i], "89 44 24 fc"); /* mov %eax,-0x4(%esp) */ - append_insns (&buildaddr, i, buf); - - i = 0; - i += push_opcode (&buf[i], "83 ec 08"); /* sub $0x8,%esp */ - append_insns (&buildaddr, i, buf); - - i = 0; - i += push_opcode (&buf[i], "c7 04 24"); /* movl <addr>,(%esp) */ - memcpy (&buf[i], (void *) &tpoint, 4); - i += 4; - append_insns (&buildaddr, i, buf); - - buf[0] = 0xe8; /* call <reladdr> */ - offset = collector - (buildaddr + sizeof (jump_insn)); - memcpy (buf + 1, &offset, 4); - append_insns (&buildaddr, 5, buf); - /* Clean up after the call. */ - buf[0] = 0x83; /* add $0x8,%esp */ - buf[1] = 0xc4; - buf[2] = 0x08; - append_insns (&buildaddr, 3, buf); - - - /* Clear the spin-lock. This would need the LOCK prefix on older - broken archs. */ - i = 0; - i += push_opcode (&buf[i], "31 c0"); /* xor %eax,%eax */ - i += push_opcode (&buf[i], "a3"); /* mov %eax, lockaddr */ - memcpy (buf + i, &lockaddr, 4); - i += 4; - append_insns (&buildaddr, i, buf); - - - /* Remove stack that had been used for the collect_t object. */ - i = 0; - i += push_opcode (&buf[i], "83 c4 08"); /* add $0x08,%esp */ - append_insns (&buildaddr, i, buf); - - i = 0; - buf[i++] = 0x83; /* add $0x4,%esp (no pop of %cs, assume unchanged) */ - buf[i++] = 0xc4; - buf[i++] = 0x04; - buf[i++] = 0x17; /* pop %ss */ - buf[i++] = 0x0f; /* pop %gs */ - buf[i++] = 0xa9; - buf[i++] = 0x0f; /* pop %fs */ - buf[i++] = 0xa1; - buf[i++] = 0x07; /* pop %es */ - buf[i++] = 0x1f; /* pop %de */ - buf[i++] = 0x9d; /* popf */ - buf[i++] = 0x83; /* add $0x4,%esp (pop of tpaddr aka $pc) */ - buf[i++] = 0xc4; - buf[i++] = 0x04; - buf[i++] = 0x61; /* popad */ - append_insns (&buildaddr, i, buf); - - /* Now, adjust the original instruction to execute in the jump - pad. */ - *adjusted_insn_addr = buildaddr; - relocate_instruction (&buildaddr, tpaddr); - *adjusted_insn_addr_end = buildaddr; - - /* Write the jump back to the program. */ - offset = (tpaddr + orig_size) - (buildaddr + sizeof (jump_insn)); - memcpy (buf, jump_insn, sizeof (jump_insn)); - memcpy (buf + 1, &offset, 4); - append_insns (&buildaddr, sizeof (jump_insn), buf); - - /* The jump pad is now built. Wire in a jump to our jump pad. This - is always done last (by our caller actually), so that we can - install fast tracepoints with threads running. This relies on - the agent's atomic write support. */ - offset = *jump_entry - (tpaddr + sizeof (jump_insn)); - memcpy (buf, jump_insn, sizeof (jump_insn)); - memcpy (buf + 1, &offset, 4); - memcpy (jjump_pad_insn, buf, sizeof (jump_insn)); - *jjump_pad_insn_size = sizeof (jump_insn); - - /* Return the end address of our pad. */ - *jump_entry = buildaddr; - - return 0; -} - -static int -x86_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr, - CORE_ADDR collector, - CORE_ADDR lockaddr, - ULONGEST orig_size, - CORE_ADDR *jump_entry, - unsigned char *jjump_pad_insn, - ULONGEST *jjump_pad_insn_size, - CORE_ADDR *adjusted_insn_addr, - CORE_ADDR *adjusted_insn_addr_end) -{ -#ifdef __x86_64__ - if (register_size (0) == 8) - return amd64_install_fast_tracepoint_jump_pad (tpoint, tpaddr, - collector, lockaddr, - orig_size, jump_entry, - jjump_pad_insn, - jjump_pad_insn_size, - adjusted_insn_addr, - adjusted_insn_addr_end); -#endif - - return i386_install_fast_tracepoint_jump_pad (tpoint, tpaddr, - collector, lockaddr, - orig_size, jump_entry, - jjump_pad_insn, - jjump_pad_insn_size, - adjusted_insn_addr, - adjusted_insn_addr_end); -} - -static void -add_insns (unsigned char *start, int len) -{ - CORE_ADDR buildaddr = current_insn_ptr; - - if (debug_threads) - fprintf (stderr, "Adding %d bytes of insn at %s\n", - len, paddress (buildaddr)); - - append_insns (&buildaddr, len, start); - current_insn_ptr = buildaddr; -} - -/* Our general strategy for emitting code is to avoid specifying raw - bytes whenever possible, and instead copy a block of inline asm - that is embedded in the function. This is a little messy, because - we need to keep the compiler from discarding what looks like dead - code, plus suppress various warnings. */ - -#define EMIT_ASM(NAME, INSNS) \ - do \ - { \ - extern unsigned char start_ ## NAME, end_ ## NAME; \ - add_insns (&start_ ## NAME, &end_ ## NAME - &start_ ## NAME); \ - __asm__ ("jmp end_" #NAME "\n" \ - "\t" "start_" #NAME ":" \ - "\t" INSNS "\n" \ - "\t" "end_" #NAME ":"); \ - } while (0) - -#ifdef __x86_64__ - -#define EMIT_ASM32(NAME,INSNS) \ - do \ - { \ - extern unsigned char start_ ## NAME, end_ ## NAME; \ - add_insns (&start_ ## NAME, &end_ ## NAME - &start_ ## NAME); \ - __asm__ (".code32\n" \ - "\t" "jmp end_" #NAME "\n" \ - "\t" "start_" #NAME ":\n" \ - "\t" INSNS "\n" \ - "\t" "end_" #NAME ":\n" \ - ".code64\n"); \ - } while (0) - -#else - -#define EMIT_ASM32(NAME,INSNS) EMIT_ASM(NAME,INSNS) - -#endif - -#ifdef __x86_64__ - -static void -amd64_emit_prologue (void) -{ - EMIT_ASM (amd64_prologue, - "pushq %rbp\n\t" - "movq %rsp,%rbp\n\t" - "sub $0x20,%rsp\n\t" - "movq %rdi,-8(%rbp)\n\t" - "movq %rsi,-16(%rbp)"); -} - - -static void -amd64_emit_epilogue (void) -{ - EMIT_ASM (amd64_epilogue, - "movq -16(%rbp),%rdi\n\t" - "movq %rax,(%rdi)\n\t" - "xor %rax,%rax\n\t" - "leave\n\t" - "ret"); -} - -static void -amd64_emit_add (void) -{ - EMIT_ASM (amd64_add, - "add (%rsp),%rax\n\t" - "lea 0x8(%rsp),%rsp"); -} - -static void -amd64_emit_sub (void) -{ - EMIT_ASM (amd64_sub, - "sub %rax,(%rsp)\n\t" - "pop %rax"); -} - -static void -amd64_emit_mul (void) -{ - emit_error = 1; -} - -static void -amd64_emit_lsh (void) -{ - emit_error = 1; -} - -static void -amd64_emit_rsh_signed (void) -{ - emit_error = 1; -} - -static void -amd64_emit_rsh_unsigned (void) -{ - emit_error = 1; -} - -static void -amd64_emit_ext (int arg) -{ - switch (arg) - { - case 8: - EMIT_ASM (amd64_ext_8, - "cbtw\n\t" - "cwtl\n\t" - "cltq"); - break; - case 16: - EMIT_ASM (amd64_ext_16, - "cwtl\n\t" - "cltq"); - break; - case 32: - EMIT_ASM (amd64_ext_32, - "cltq"); - break; - default: - emit_error = 1; - } -} - -static void -amd64_emit_log_not (void) -{ - EMIT_ASM (amd64_log_not, - "test %rax,%rax\n\t" - "sete %cl\n\t" - "movzbq %cl,%rax"); -} - -static void -amd64_emit_bit_and (void) -{ - EMIT_ASM (amd64_and, - "and (%rsp),%rax\n\t" - "lea 0x8(%rsp),%rsp"); -} - -static void -amd64_emit_bit_or (void) -{ - EMIT_ASM (amd64_or, - "or (%rsp),%rax\n\t" - "lea 0x8(%rsp),%rsp"); -} - -static void -amd64_emit_bit_xor (void) -{ - EMIT_ASM (amd64_xor, - "xor (%rsp),%rax\n\t" - "lea 0x8(%rsp),%rsp"); -} - -static void -amd64_emit_bit_not (void) -{ - EMIT_ASM (amd64_bit_not, - "xorq $0xffffffffffffffff,%rax"); -} - -static void -amd64_emit_equal (void) -{ - EMIT_ASM (amd64_equal, - "cmp %rax,(%rsp)\n\t" - "je .Lamd64_equal_true\n\t" - "xor %rax,%rax\n\t" - "jmp .Lamd64_equal_end\n\t" - ".Lamd64_equal_true:\n\t" - "mov $0x1,%rax\n\t" - ".Lamd64_equal_end:\n\t" - "lea 0x8(%rsp),%rsp"); -} - -static void -amd64_emit_less_signed (void) -{ - EMIT_ASM (amd64_less_signed, - "cmp %rax,(%rsp)\n\t" - "jl .Lamd64_less_signed_true\n\t" - "xor %rax,%rax\n\t" - "jmp .Lamd64_less_signed_end\n\t" - ".Lamd64_less_signed_true:\n\t" - "mov $1,%rax\n\t" - ".Lamd64_less_signed_end:\n\t" - "lea 0x8(%rsp),%rsp"); -} - -static void -amd64_emit_less_unsigned (void) -{ - EMIT_ASM (amd64_less_unsigned, - "cmp %rax,(%rsp)\n\t" - "jb .Lamd64_less_unsigned_true\n\t" - "xor %rax,%rax\n\t" - "jmp .Lamd64_less_unsigned_end\n\t" - ".Lamd64_less_unsigned_true:\n\t" - "mov $1,%rax\n\t" - ".Lamd64_less_unsigned_end:\n\t" - "lea 0x8(%rsp),%rsp"); -} - -static void -amd64_emit_ref (int size) -{ - switch (size) - { - case 1: - EMIT_ASM (amd64_ref1, - "movb (%rax),%al"); - break; - case 2: - EMIT_ASM (amd64_ref2, - "movw (%rax),%ax"); - break; - case 4: - EMIT_ASM (amd64_ref4, - "movl (%rax),%eax"); - break; - case 8: - EMIT_ASM (amd64_ref8, - "movq (%rax),%rax"); - break; - } -} - -static void -amd64_emit_if_goto (int *offset_p, int *size_p) -{ - EMIT_ASM (amd64_if_goto, - "mov %rax,%rcx\n\t" - "pop %rax\n\t" - "cmp $0,%rcx\n\t" - ".byte 0x0f, 0x85, 0x0, 0x0, 0x0, 0x0"); - if (offset_p) - *offset_p = 10; - if (size_p) - *size_p = 4; -} - -static void -amd64_emit_goto (int *offset_p, int *size_p) -{ - EMIT_ASM (amd64_goto, - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0"); - if (offset_p) - *offset_p = 1; - if (size_p) - *size_p = 4; -} - -static void -amd64_write_goto_address (CORE_ADDR from, CORE_ADDR to, int size) -{ - int diff = (to - (from + size)); - unsigned char buf[sizeof (int)]; - - if (size != 4) - { - emit_error = 1; - return; - } - - memcpy (buf, &diff, sizeof (int)); - write_inferior_memory (from, buf, sizeof (int)); -} - -static void -amd64_emit_const (LONGEST num) -{ - unsigned char buf[16]; - int i; - CORE_ADDR buildaddr = current_insn_ptr; - - i = 0; - buf[i++] = 0x48; buf[i++] = 0xb8; /* mov $<n>,%rax */ - memcpy (&buf[i], &num, sizeof (num)); - i += 8; - append_insns (&buildaddr, i, buf); - current_insn_ptr = buildaddr; -} - -static void -amd64_emit_call (CORE_ADDR fn) -{ - unsigned char buf[16]; - int i; - CORE_ADDR buildaddr; - LONGEST offset64; - - /* The destination function being in the shared library, may be - >31-bits away off the compiled code pad. */ - - buildaddr = current_insn_ptr; - - offset64 = fn - (buildaddr + 1 /* call op */ + 4 /* 32-bit offset */); - - i = 0; - - if (offset64 > INT_MAX || offset64 < INT_MIN) - { - /* Offset is too large for a call. Use callq, but that requires - a register, so avoid it if possible. Use r10, since it is - call-clobbered, we don't have to push/pop it. */ - buf[i++] = 0x48; /* mov $fn,%r10 */ - buf[i++] = 0xba; - memcpy (buf + i, &fn, 8); - i += 8; - buf[i++] = 0xff; /* callq *%r10 */ - buf[i++] = 0xd2; - } - else - { - int offset32 = offset64; /* we know we can't overflow here. */ - memcpy (buf + i, &offset32, 4); - i += 4; - } - - append_insns (&buildaddr, i, buf); - current_insn_ptr = buildaddr; -} - -static void -amd64_emit_reg (int reg) -{ - unsigned char buf[16]; - int i; - CORE_ADDR buildaddr; - - /* Assume raw_regs is still in %rdi. */ - buildaddr = current_insn_ptr; - i = 0; - buf[i++] = 0xbe; /* mov $<n>,%esi */ - memcpy (&buf[i], ®, sizeof (reg)); - i += 4; - append_insns (&buildaddr, i, buf); - current_insn_ptr = buildaddr; - amd64_emit_call (get_raw_reg_func_addr ()); -} - -static void -amd64_emit_pop (void) -{ - EMIT_ASM (amd64_pop, - "pop %rax"); -} - -static void -amd64_emit_stack_flush (void) -{ - EMIT_ASM (amd64_stack_flush, - "push %rax"); -} - -static void -amd64_emit_zero_ext (int arg) -{ - switch (arg) - { - case 8: - EMIT_ASM (amd64_zero_ext_8, - "and $0xff,%rax"); - break; - case 16: - EMIT_ASM (amd64_zero_ext_16, - "and $0xffff,%rax"); - break; - case 32: - EMIT_ASM (amd64_zero_ext_32, - "mov $0xffffffff,%rcx\n\t" - "and %rcx,%rax"); - break; - default: - emit_error = 1; - } -} - -static void -amd64_emit_swap (void) -{ - EMIT_ASM (amd64_swap, - "mov %rax,%rcx\n\t" - "pop %rax\n\t" - "push %rcx"); -} - -static void -amd64_emit_stack_adjust (int n) -{ - unsigned char buf[16]; - int i; - CORE_ADDR buildaddr = current_insn_ptr; - - i = 0; - buf[i++] = 0x48; /* lea $<n>(%rsp),%rsp */ - buf[i++] = 0x8d; - buf[i++] = 0x64; - buf[i++] = 0x24; - /* This only handles adjustments up to 16, but we don't expect any more. */ - buf[i++] = n * 8; - append_insns (&buildaddr, i, buf); - current_insn_ptr = buildaddr; -} - -/* FN's prototype is `LONGEST(*fn)(int)'. */ - -static void -amd64_emit_int_call_1 (CORE_ADDR fn, int arg1) -{ - unsigned char buf[16]; - int i; - CORE_ADDR buildaddr; - - buildaddr = current_insn_ptr; - i = 0; - buf[i++] = 0xbf; /* movl $<n>,%edi */ - memcpy (&buf[i], &arg1, sizeof (arg1)); - i += 4; - append_insns (&buildaddr, i, buf); - current_insn_ptr = buildaddr; - amd64_emit_call (fn); -} - -/* FN's prototype is `void(*fn)(int,LONGEST)'. */ - -static void -amd64_emit_void_call_2 (CORE_ADDR fn, int arg1) -{ - unsigned char buf[16]; - int i; - CORE_ADDR buildaddr; - - buildaddr = current_insn_ptr; - i = 0; - buf[i++] = 0xbf; /* movl $<n>,%edi */ - memcpy (&buf[i], &arg1, sizeof (arg1)); - i += 4; - append_insns (&buildaddr, i, buf); - current_insn_ptr = buildaddr; - EMIT_ASM (amd64_void_call_2_a, - /* Save away a copy of the stack top. */ - "push %rax\n\t" - /* Also pass top as the second argument. */ - "mov %rax,%rsi"); - amd64_emit_call (fn); - EMIT_ASM (amd64_void_call_2_b, - /* Restore the stack top, %rax may have been trashed. */ - "pop %rax"); -} - -void -amd64_emit_eq_goto (int *offset_p, int *size_p) -{ - EMIT_ASM (amd64_eq, - "cmp %rax,(%rsp)\n\t" - "jne .Lamd64_eq_fallthru\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Lamd64_eq_fallthru:\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax"); - - if (offset_p) - *offset_p = 13; - if (size_p) - *size_p = 4; -} - -void -amd64_emit_ne_goto (int *offset_p, int *size_p) -{ - EMIT_ASM (amd64_ne, - "cmp %rax,(%rsp)\n\t" - "je .Lamd64_ne_fallthru\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Lamd64_ne_fallthru:\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax"); - - if (offset_p) - *offset_p = 13; - if (size_p) - *size_p = 4; -} - -void -amd64_emit_lt_goto (int *offset_p, int *size_p) -{ - EMIT_ASM (amd64_lt, - "cmp %rax,(%rsp)\n\t" - "jnl .Lamd64_lt_fallthru\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Lamd64_lt_fallthru:\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax"); - - if (offset_p) - *offset_p = 13; - if (size_p) - *size_p = 4; -} - -void -amd64_emit_le_goto (int *offset_p, int *size_p) -{ - EMIT_ASM (amd64_le, - "cmp %rax,(%rsp)\n\t" - "jnle .Lamd64_le_fallthru\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Lamd64_le_fallthru:\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax"); - - if (offset_p) - *offset_p = 13; - if (size_p) - *size_p = 4; -} - -void -amd64_emit_gt_goto (int *offset_p, int *size_p) -{ - EMIT_ASM (amd64_gt, - "cmp %rax,(%rsp)\n\t" - "jng .Lamd64_gt_fallthru\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Lamd64_gt_fallthru:\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax"); - - if (offset_p) - *offset_p = 13; - if (size_p) - *size_p = 4; -} - -void -amd64_emit_ge_goto (int *offset_p, int *size_p) -{ - EMIT_ASM (amd64_ge, - "cmp %rax,(%rsp)\n\t" - "jnge .Lamd64_ge_fallthru\n\t" - ".Lamd64_ge_jump:\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Lamd64_ge_fallthru:\n\t" - "lea 0x8(%rsp),%rsp\n\t" - "pop %rax"); - - if (offset_p) - *offset_p = 13; - if (size_p) - *size_p = 4; -} - -struct emit_ops amd64_emit_ops = - { - amd64_emit_prologue, - amd64_emit_epilogue, - amd64_emit_add, - amd64_emit_sub, - amd64_emit_mul, - amd64_emit_lsh, - amd64_emit_rsh_signed, - amd64_emit_rsh_unsigned, - amd64_emit_ext, - amd64_emit_log_not, - amd64_emit_bit_and, - amd64_emit_bit_or, - amd64_emit_bit_xor, - amd64_emit_bit_not, - amd64_emit_equal, - amd64_emit_less_signed, - amd64_emit_less_unsigned, - amd64_emit_ref, - amd64_emit_if_goto, - amd64_emit_goto, - amd64_write_goto_address, - amd64_emit_const, - amd64_emit_call, - amd64_emit_reg, - amd64_emit_pop, - amd64_emit_stack_flush, - amd64_emit_zero_ext, - amd64_emit_swap, - amd64_emit_stack_adjust, - amd64_emit_int_call_1, - amd64_emit_void_call_2, - amd64_emit_eq_goto, - amd64_emit_ne_goto, - amd64_emit_lt_goto, - amd64_emit_le_goto, - amd64_emit_gt_goto, - amd64_emit_ge_goto - }; - -#endif /* __x86_64__ */ - -static void -i386_emit_prologue (void) -{ - EMIT_ASM32 (i386_prologue, - "push %ebp\n\t" - "mov %esp,%ebp\n\t" - "push %ebx"); - /* At this point, the raw regs base address is at 8(%ebp), and the - value pointer is at 12(%ebp). */ -} - -static void -i386_emit_epilogue (void) -{ - EMIT_ASM32 (i386_epilogue, - "mov 12(%ebp),%ecx\n\t" - "mov %eax,(%ecx)\n\t" - "mov %ebx,0x4(%ecx)\n\t" - "xor %eax,%eax\n\t" - "pop %ebx\n\t" - "pop %ebp\n\t" - "ret"); -} - -static void -i386_emit_add (void) -{ - EMIT_ASM32 (i386_add, - "add (%esp),%eax\n\t" - "adc 0x4(%esp),%ebx\n\t" - "lea 0x8(%esp),%esp"); -} - -static void -i386_emit_sub (void) -{ - EMIT_ASM32 (i386_sub, - "subl %eax,(%esp)\n\t" - "sbbl %ebx,4(%esp)\n\t" - "pop %eax\n\t" - "pop %ebx\n\t"); -} - -static void -i386_emit_mul (void) -{ - emit_error = 1; -} - -static void -i386_emit_lsh (void) -{ - emit_error = 1; -} - -static void -i386_emit_rsh_signed (void) -{ - emit_error = 1; -} - -static void -i386_emit_rsh_unsigned (void) -{ - emit_error = 1; -} - -static void -i386_emit_ext (int arg) -{ - switch (arg) - { - case 8: - EMIT_ASM32 (i386_ext_8, - "cbtw\n\t" - "cwtl\n\t" - "movl %eax,%ebx\n\t" - "sarl $31,%ebx"); - break; - case 16: - EMIT_ASM32 (i386_ext_16, - "cwtl\n\t" - "movl %eax,%ebx\n\t" - "sarl $31,%ebx"); - break; - case 32: - EMIT_ASM32 (i386_ext_32, - "movl %eax,%ebx\n\t" - "sarl $31,%ebx"); - break; - default: - emit_error = 1; - } -} - -static void -i386_emit_log_not (void) -{ - EMIT_ASM32 (i386_log_not, - "or %ebx,%eax\n\t" - "test %eax,%eax\n\t" - "sete %cl\n\t" - "xor %ebx,%ebx\n\t" - "movzbl %cl,%eax"); -} - -static void -i386_emit_bit_and (void) -{ - EMIT_ASM32 (i386_and, - "and (%esp),%eax\n\t" - "and 0x4(%esp),%ebx\n\t" - "lea 0x8(%esp),%esp"); -} - -static void -i386_emit_bit_or (void) -{ - EMIT_ASM32 (i386_or, - "or (%esp),%eax\n\t" - "or 0x4(%esp),%ebx\n\t" - "lea 0x8(%esp),%esp"); -} - -static void -i386_emit_bit_xor (void) -{ - EMIT_ASM32 (i386_xor, - "xor (%esp),%eax\n\t" - "xor 0x4(%esp),%ebx\n\t" - "lea 0x8(%esp),%esp"); -} - -static void -i386_emit_bit_not (void) -{ - EMIT_ASM32 (i386_bit_not, - "xor $0xffffffff,%eax\n\t" - "xor $0xffffffff,%ebx\n\t"); -} - -static void -i386_emit_equal (void) -{ - EMIT_ASM32 (i386_equal, - "cmpl %ebx,4(%esp)\n\t" - "jne .Li386_equal_false\n\t" - "cmpl %eax,(%esp)\n\t" - "je .Li386_equal_true\n\t" - ".Li386_equal_false:\n\t" - "xor %eax,%eax\n\t" - "jmp .Li386_equal_end\n\t" - ".Li386_equal_true:\n\t" - "mov $1,%eax\n\t" - ".Li386_equal_end:\n\t" - "xor %ebx,%ebx\n\t" - "lea 0x8(%esp),%esp"); -} - -static void -i386_emit_less_signed (void) -{ - EMIT_ASM32 (i386_less_signed, - "cmpl %ebx,4(%esp)\n\t" - "jl .Li386_less_signed_true\n\t" - "jne .Li386_less_signed_false\n\t" - "cmpl %eax,(%esp)\n\t" - "jl .Li386_less_signed_true\n\t" - ".Li386_less_signed_false:\n\t" - "xor %eax,%eax\n\t" - "jmp .Li386_less_signed_end\n\t" - ".Li386_less_signed_true:\n\t" - "mov $1,%eax\n\t" - ".Li386_less_signed_end:\n\t" - "xor %ebx,%ebx\n\t" - "lea 0x8(%esp),%esp"); -} - -static void -i386_emit_less_unsigned (void) -{ - EMIT_ASM32 (i386_less_unsigned, - "cmpl %ebx,4(%esp)\n\t" - "jb .Li386_less_unsigned_true\n\t" - "jne .Li386_less_unsigned_false\n\t" - "cmpl %eax,(%esp)\n\t" - "jb .Li386_less_unsigned_true\n\t" - ".Li386_less_unsigned_false:\n\t" - "xor %eax,%eax\n\t" - "jmp .Li386_less_unsigned_end\n\t" - ".Li386_less_unsigned_true:\n\t" - "mov $1,%eax\n\t" - ".Li386_less_unsigned_end:\n\t" - "xor %ebx,%ebx\n\t" - "lea 0x8(%esp),%esp"); -} - -static void -i386_emit_ref (int size) -{ - switch (size) - { - case 1: - EMIT_ASM32 (i386_ref1, - "movb (%eax),%al"); - break; - case 2: - EMIT_ASM32 (i386_ref2, - "movw (%eax),%ax"); - break; - case 4: - EMIT_ASM32 (i386_ref4, - "movl (%eax),%eax"); - break; - case 8: - EMIT_ASM32 (i386_ref8, - "movl 4(%eax),%ebx\n\t" - "movl (%eax),%eax"); - break; - } -} - -static void -i386_emit_if_goto (int *offset_p, int *size_p) -{ - EMIT_ASM32 (i386_if_goto, - "mov %eax,%ecx\n\t" - "or %ebx,%ecx\n\t" - "pop %eax\n\t" - "pop %ebx\n\t" - "cmpl $0,%ecx\n\t" - /* Don't trust the assembler to choose the right jump */ - ".byte 0x0f, 0x85, 0x0, 0x0, 0x0, 0x0"); - - if (offset_p) - *offset_p = 11; /* be sure that this matches the sequence above */ - if (size_p) - *size_p = 4; -} - -static void -i386_emit_goto (int *offset_p, int *size_p) -{ - EMIT_ASM32 (i386_goto, - /* Don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0"); - if (offset_p) - *offset_p = 1; - if (size_p) - *size_p = 4; -} - -static void -i386_write_goto_address (CORE_ADDR from, CORE_ADDR to, int size) -{ - int diff = (to - (from + size)); - unsigned char buf[sizeof (int)]; - - /* We're only doing 4-byte sizes at the moment. */ - if (size != 4) - { - emit_error = 1; - return; - } - - memcpy (buf, &diff, sizeof (int)); - write_inferior_memory (from, buf, sizeof (int)); -} - -static void -i386_emit_const (LONGEST num) -{ - unsigned char buf[16]; - int i, hi, lo; - CORE_ADDR buildaddr = current_insn_ptr; - - i = 0; - buf[i++] = 0xb8; /* mov $<n>,%eax */ - lo = num & 0xffffffff; - memcpy (&buf[i], &lo, sizeof (lo)); - i += 4; - hi = ((num >> 32) & 0xffffffff); - if (hi) - { - buf[i++] = 0xbb; /* mov $<n>,%ebx */ - memcpy (&buf[i], &hi, sizeof (hi)); - i += 4; - } - else - { - buf[i++] = 0x31; buf[i++] = 0xdb; /* xor %ebx,%ebx */ - } - append_insns (&buildaddr, i, buf); - current_insn_ptr = buildaddr; -} - -static void -i386_emit_call (CORE_ADDR fn) -{ - unsigned char buf[16]; - int i, offset; - CORE_ADDR buildaddr; - - buildaddr = current_insn_ptr; - i = 0; - buf[i++] = 0xe8; /* call <reladdr> */ - offset = ((int) fn) - (buildaddr + 5); - memcpy (buf + 1, &offset, 4); - append_insns (&buildaddr, 5, buf); - current_insn_ptr = buildaddr; -} - -static void -i386_emit_reg (int reg) -{ - unsigned char buf[16]; - int i; - CORE_ADDR buildaddr; - - EMIT_ASM32 (i386_reg_a, - "sub $0x8,%esp"); - buildaddr = current_insn_ptr; - i = 0; - buf[i++] = 0xb8; /* mov $<n>,%eax */ - memcpy (&buf[i], ®, sizeof (reg)); - i += 4; - append_insns (&buildaddr, i, buf); - current_insn_ptr = buildaddr; - EMIT_ASM32 (i386_reg_b, - "mov %eax,4(%esp)\n\t" - "mov 8(%ebp),%eax\n\t" - "mov %eax,(%esp)"); - i386_emit_call (get_raw_reg_func_addr ()); - EMIT_ASM32 (i386_reg_c, - "xor %ebx,%ebx\n\t" - "lea 0x8(%esp),%esp"); -} - -static void -i386_emit_pop (void) -{ - EMIT_ASM32 (i386_pop, - "pop %eax\n\t" - "pop %ebx"); -} - -static void -i386_emit_stack_flush (void) -{ - EMIT_ASM32 (i386_stack_flush, - "push %ebx\n\t" - "push %eax"); -} - -static void -i386_emit_zero_ext (int arg) -{ - switch (arg) - { - case 8: - EMIT_ASM32 (i386_zero_ext_8, - "and $0xff,%eax\n\t" - "xor %ebx,%ebx"); - break; - case 16: - EMIT_ASM32 (i386_zero_ext_16, - "and $0xffff,%eax\n\t" - "xor %ebx,%ebx"); - break; - case 32: - EMIT_ASM32 (i386_zero_ext_32, - "xor %ebx,%ebx"); - break; - default: - emit_error = 1; - } -} - -static void -i386_emit_swap (void) -{ - EMIT_ASM32 (i386_swap, - "mov %eax,%ecx\n\t" - "mov %ebx,%edx\n\t" - "pop %eax\n\t" - "pop %ebx\n\t" - "push %edx\n\t" - "push %ecx"); -} - -static void -i386_emit_stack_adjust (int n) -{ - unsigned char buf[16]; - int i; - CORE_ADDR buildaddr = current_insn_ptr; - - i = 0; - buf[i++] = 0x8d; /* lea $<n>(%esp),%esp */ - buf[i++] = 0x64; - buf[i++] = 0x24; - buf[i++] = n * 8; - append_insns (&buildaddr, i, buf); - current_insn_ptr = buildaddr; -} - -/* FN's prototype is `LONGEST(*fn)(int)'. */ - -static void -i386_emit_int_call_1 (CORE_ADDR fn, int arg1) -{ - unsigned char buf[16]; - int i; - CORE_ADDR buildaddr; - - EMIT_ASM32 (i386_int_call_1_a, - /* Reserve a bit of stack space. */ - "sub $0x8,%esp"); - /* Put the one argument on the stack. */ - buildaddr = current_insn_ptr; - i = 0; - buf[i++] = 0xc7; /* movl $<arg1>,(%esp) */ - buf[i++] = 0x04; - buf[i++] = 0x24; - memcpy (&buf[i], &arg1, sizeof (arg1)); - i += 4; - append_insns (&buildaddr, i, buf); - current_insn_ptr = buildaddr; - i386_emit_call (fn); - EMIT_ASM32 (i386_int_call_1_c, - "mov %edx,%ebx\n\t" - "lea 0x8(%esp),%esp"); -} - -/* FN's prototype is `void(*fn)(int,LONGEST)'. */ - -static void -i386_emit_void_call_2 (CORE_ADDR fn, int arg1) -{ - unsigned char buf[16]; - int i; - CORE_ADDR buildaddr; - - EMIT_ASM32 (i386_void_call_2_a, - /* Preserve %eax only; we don't have to worry about %ebx. */ - "push %eax\n\t" - /* Reserve a bit of stack space for arguments. */ - "sub $0x10,%esp\n\t" - /* Copy "top" to the second argument position. (Note that - we can't assume function won't scribble on its - arguments, so don't try to restore from this.) */ - "mov %eax,4(%esp)\n\t" - "mov %ebx,8(%esp)"); - /* Put the first argument on the stack. */ - buildaddr = current_insn_ptr; - i = 0; - buf[i++] = 0xc7; /* movl $<arg1>,(%esp) */ - buf[i++] = 0x04; - buf[i++] = 0x24; - memcpy (&buf[i], &arg1, sizeof (arg1)); - i += 4; - append_insns (&buildaddr, i, buf); - current_insn_ptr = buildaddr; - i386_emit_call (fn); - EMIT_ASM32 (i386_void_call_2_b, - "lea 0x10(%esp),%esp\n\t" - /* Restore original stack top. */ - "pop %eax"); -} - - -void -i386_emit_eq_goto (int *offset_p, int *size_p) -{ - EMIT_ASM32 (eq, - /* Check low half first, more likely to be decider */ - "cmpl %eax,(%esp)\n\t" - "jne .Leq_fallthru\n\t" - "cmpl %ebx,4(%esp)\n\t" - "jne .Leq_fallthru\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Leq_fallthru:\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx"); - - if (offset_p) - *offset_p = 18; - if (size_p) - *size_p = 4; -} - -void -i386_emit_ne_goto (int *offset_p, int *size_p) -{ - EMIT_ASM32 (ne, - /* Check low half first, more likely to be decider */ - "cmpl %eax,(%esp)\n\t" - "jne .Lne_jump\n\t" - "cmpl %ebx,4(%esp)\n\t" - "je .Lne_fallthru\n\t" - ".Lne_jump:\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Lne_fallthru:\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx"); - - if (offset_p) - *offset_p = 18; - if (size_p) - *size_p = 4; -} - -void -i386_emit_lt_goto (int *offset_p, int *size_p) -{ - EMIT_ASM32 (lt, - "cmpl %ebx,4(%esp)\n\t" - "jl .Llt_jump\n\t" - "jne .Llt_fallthru\n\t" - "cmpl %eax,(%esp)\n\t" - "jnl .Llt_fallthru\n\t" - ".Llt_jump:\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Llt_fallthru:\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx"); - - if (offset_p) - *offset_p = 20; - if (size_p) - *size_p = 4; -} - -void -i386_emit_le_goto (int *offset_p, int *size_p) -{ - EMIT_ASM32 (le, - "cmpl %ebx,4(%esp)\n\t" - "jle .Lle_jump\n\t" - "jne .Lle_fallthru\n\t" - "cmpl %eax,(%esp)\n\t" - "jnle .Lle_fallthru\n\t" - ".Lle_jump:\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Lle_fallthru:\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx"); - - if (offset_p) - *offset_p = 20; - if (size_p) - *size_p = 4; -} - -void -i386_emit_gt_goto (int *offset_p, int *size_p) -{ - EMIT_ASM32 (gt, - "cmpl %ebx,4(%esp)\n\t" - "jg .Lgt_jump\n\t" - "jne .Lgt_fallthru\n\t" - "cmpl %eax,(%esp)\n\t" - "jng .Lgt_fallthru\n\t" - ".Lgt_jump:\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Lgt_fallthru:\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx"); - - if (offset_p) - *offset_p = 20; - if (size_p) - *size_p = 4; -} - -void -i386_emit_ge_goto (int *offset_p, int *size_p) -{ - EMIT_ASM32 (ge, - "cmpl %ebx,4(%esp)\n\t" - "jge .Lge_jump\n\t" - "jne .Lge_fallthru\n\t" - "cmpl %eax,(%esp)\n\t" - "jnge .Lge_fallthru\n\t" - ".Lge_jump:\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx\n\t" - /* jmp, but don't trust the assembler to choose the right jump */ - ".byte 0xe9, 0x0, 0x0, 0x0, 0x0\n\t" - ".Lge_fallthru:\n\t" - "lea 0x8(%esp),%esp\n\t" - "pop %eax\n\t" - "pop %ebx"); - - if (offset_p) - *offset_p = 20; - if (size_p) - *size_p = 4; -} - -struct emit_ops i386_emit_ops = - { - i386_emit_prologue, - i386_emit_epilogue, - i386_emit_add, - i386_emit_sub, - i386_emit_mul, - i386_emit_lsh, - i386_emit_rsh_signed, - i386_emit_rsh_unsigned, - i386_emit_ext, - i386_emit_log_not, - i386_emit_bit_and, - i386_emit_bit_or, - i386_emit_bit_xor, - i386_emit_bit_not, - i386_emit_equal, - i386_emit_less_signed, - i386_emit_less_unsigned, - i386_emit_ref, - i386_emit_if_goto, - i386_emit_goto, - i386_write_goto_address, - i386_emit_const, - i386_emit_call, - i386_emit_reg, - i386_emit_pop, - i386_emit_stack_flush, - i386_emit_zero_ext, - i386_emit_swap, - i386_emit_stack_adjust, - i386_emit_int_call_1, - i386_emit_void_call_2, - i386_emit_eq_goto, - i386_emit_ne_goto, - i386_emit_lt_goto, - i386_emit_le_goto, - i386_emit_gt_goto, - i386_emit_ge_goto - }; - - -static struct emit_ops * -x86_emit_ops (void) -{ -#ifdef __x86_64__ - int use_64bit = register_size (0) == 8; - - if (use_64bit) - return &amd64_emit_ops; - else -#endif - return &i386_emit_ops; -} - -/* This is initialized assuming an amd64 target. - x86_arch_setup will correct it for i386 or amd64 targets. */ - -struct linux_target_ops the_low_target = -{ - x86_arch_setup, - -1, - NULL, - NULL, - NULL, - x86_get_pc, - x86_set_pc, - x86_breakpoint, - x86_breakpoint_len, - NULL, - 1, - x86_breakpoint_at, - x86_insert_point, - x86_remove_point, - x86_stopped_by_watchpoint, - x86_stopped_data_address, - /* collect_ptrace_register/supply_ptrace_register are not needed in the - native i386 case (no registers smaller than an xfer unit), and are not - used in the biarch case (HAVE_LINUX_USRREGS is not defined). */ - NULL, - NULL, - /* need to fix up i386 siginfo if host is amd64 */ - x86_siginfo_fixup, - x86_linux_new_process, - x86_linux_new_thread, - x86_linux_prepare_to_resume, - x86_linux_process_qsupported, - x86_supports_tracepoints, - x86_get_thread_area, - x86_install_fast_tracepoint_jump_pad, - x86_emit_ops -}; diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c deleted file mode 100644 index d9b76f0fb2a..00000000000 --- a/gdb/gdbserver/linux-xtensa-low.c +++ /dev/null @@ -1,192 +0,0 @@ -/* GNU/Linux/Xtensa specific low level interface, for the remote server for GDB. - Copyright 2007, 2008, 2009, 2010, 2011 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" - -/* Defined in auto-generated file reg-xtensa.c. */ -void init_registers_xtensa (void); - -#include <sys/ptrace.h> -#include <xtensa-config.h> - -#include "xtensa-xtregs.c" - -enum regnum { - R_PC=0, R_PS, - R_LBEG, R_LEND, R_LCOUNT, - R_SAR, - R_WS, R_WB, - R_A0 = 64 -}; - -static void -xtensa_fill_gregset (struct regcache *regcache, void *buf) -{ - elf_greg_t* rset = (elf_greg_t*)buf; - int ar0_regnum; - char *ptr; - int i; - - /* Take care of AR registers. */ - - ar0_regnum = find_regno ("ar0"); - ptr = (char*)&rset[R_A0]; - - for (i = ar0_regnum; i < ar0_regnum + XCHAL_NUM_AREGS; i++) - { - collect_register (regcache, i, ptr); - ptr += register_size(i); - } - - /* Loop registers, if hardware has it. */ - -#if XCHAL_HAVE_LOOP - collect_register_by_name (regcache, "lbeg", (char*)&rset[R_LBEG]); - collect_register_by_name (regcache, "lend", (char*)&rset[R_LEND]); - collect_register_by_name (regcache, "lcount", (char*)&rset[R_LCOUNT]); -#endif - - collect_register_by_name (regcache, "sar", (char*)&rset[R_SAR]); - collect_register_by_name (regcache, "pc", (char*)&rset[R_PC]); - collect_register_by_name (regcache, "ps", (char*)&rset[R_PS]); - collect_register_by_name (regcache, "windowbase", (char*)&rset[R_WB]); - collect_register_by_name (regcache, "windowstart", (char*)&rset[R_WS]); -} - -static void -xtensa_store_gregset (struct regcache *regcache, const void *buf) -{ - const elf_greg_t* rset = (const elf_greg_t*)buf; - int ar0_regnum; - char *ptr; - int i; - - /* Take care of AR registers. */ - - ar0_regnum = find_regno ("ar0"); - ptr = (char *)&rset[R_A0]; - - for (i = ar0_regnum; i < ar0_regnum + XCHAL_NUM_AREGS; i++) - { - supply_register (regcache, i, ptr); - ptr += register_size(i); - } - - /* Loop registers, if hardware has it. */ - -#if XCHAL_HAVE_LOOP - supply_register_by_name (regcache, "lbeg", (char*)&rset[R_LBEG]); - supply_register_by_name (regcache, "lend", (char*)&rset[R_LEND]); - supply_register_by_name (regcache, "lcount", (char*)&rset[R_LCOUNT]); -#endif - - supply_register_by_name (regcache, "sar", (char*)&rset[R_SAR]); - supply_register_by_name (regcache, "pc", (char*)&rset[R_PC]); - supply_register_by_name (regcache, "ps", (char*)&rset[R_PS]); - supply_register_by_name (regcache, "windowbase", (char*)&rset[R_WB]); - supply_register_by_name (regcache, "windowstart", (char*)&rset[R_WS]); -} - -/* Xtensa GNU/Linux PTRACE interface includes extended register set. */ - -static void -xtensa_fill_xtregset (struct regcache *regcache, void *buf) -{ - const xtensa_regtable_t *ptr; - - for (ptr = xtensa_regmap_table; ptr->name; ptr++) - { - collect_register_by_name (regcache, ptr->name, - (char*)buf + ptr->ptrace_offset); - } -} - -static void -xtensa_store_xtregset (struct regcache *regcache, const void *buf) -{ - const xtensa_regtable_t *ptr; - - for (ptr = xtensa_regmap_table; ptr->name; ptr++) - { - supply_register_by_name (regcache, ptr->name, - (char*)buf + ptr->ptrace_offset); - } -} - -struct regset_info target_regsets[] = { - { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t), - GENERAL_REGS, - xtensa_fill_gregset, xtensa_store_gregset }, - { PTRACE_GETXTREGS, PTRACE_SETXTREGS, 0, XTENSA_ELF_XTREG_SIZE, - EXTENDED_REGS, - xtensa_fill_xtregset, xtensa_store_xtregset }, - { 0, 0, 0, -1, -1, NULL, NULL } -}; - -#if XCHAL_HAVE_BE -#define XTENSA_BREAKPOINT {0xd2,0x0f} -#else -#define XTENSA_BREAKPOINT {0x2d,0xf0} -#endif - -static const unsigned char xtensa_breakpoint[] = XTENSA_BREAKPOINT; -#define xtensa_breakpoint_len 2 - -static CORE_ADDR -xtensa_get_pc (struct regcache *regcache) -{ - unsigned long pc; - - collect_register_by_name (regcache, "pc", &pc); - return pc; -} - -static void -xtensa_set_pc (struct regcache *regcache, CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name (regcache, "pc", &newpc); -} - -static int -xtensa_breakpoint_at (CORE_ADDR where) -{ - unsigned long insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, - xtensa_breakpoint_len); - return memcmp((char *) &insn, - xtensa_breakpoint, xtensa_breakpoint_len) == 0; -} - -struct linux_target_ops the_low_target = { - init_registers_xtensa, - 0, - 0, - 0, - 0, - xtensa_get_pc, - xtensa_set_pc, - xtensa_breakpoint, - xtensa_breakpoint_len, - NULL, - 0, - xtensa_breakpoint_at, -}; diff --git a/gdb/gdbserver/lynx-i386-low.c b/gdb/gdbserver/lynx-i386-low.c deleted file mode 100644 index b8dd4052ce6..00000000000 --- a/gdb/gdbserver/lynx-i386-low.c +++ /dev/null @@ -1,319 +0,0 @@ -/* Copyright (C) 2010, 2011 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 "lynx-low.h" - -#include <stdint.h> -#include <limits.h> -#include <sys/ptrace.h> - -/* The following two typedefs are defined in a .h file which is not - in the standard include path (/sys/include/family/x86/ucontext.h), - so we just duplicate them here. */ - -/* General register context */ -typedef struct usr_econtext { - - uint32_t uec_fault; - uint32_t uec_es; - uint32_t uec_ds; - uint32_t uec_edi; - uint32_t uec_esi; - uint32_t uec_ebp; - uint32_t uec_temp; - uint32_t uec_ebx; - uint32_t uec_edx; - uint32_t uec_ecx; - uint32_t uec_eax; - uint32_t uec_inum; - uint32_t uec_ecode; - uint32_t uec_eip; - uint32_t uec_cs; - uint32_t uec_eflags; - uint32_t uec_esp; - uint32_t uec_ss; - uint32_t uec_fs; - uint32_t uec_gs; -} usr_econtext_t; - -/* Floating point and SIMD register context */ -typedef struct usr_fcontext { - uint16_t ufc_control; - uint16_t ufc_status; - uint16_t ufc_tag; - uint16_t ufc_opcode; - uint8_t *ufc_inst_off; - uint32_t ufc_inst_sel; - uint8_t *ufc_data_off; - uint32_t ufc_data_sel; - uint32_t usse_mxcsr; - uint32_t usse_mxcsr_mask; - struct ufp387_real { - uint16_t umant4; - uint16_t umant3; - uint16_t umant2; - uint16_t umant1; - uint16_t us_and_e; - uint16_t ureserved_1; - uint16_t ureserved_2; - uint16_t ureserved_3; - } ufc_reg[8]; - struct uxmm_register { - uint16_t uchunk_1; - uint16_t uchunk_2; - uint16_t uchunk_3; - uint16_t uchunk_4; - uint16_t uchunk_5; - uint16_t uchunk_6; - uint16_t uchunk_7; - uint16_t uchunk_8; - } uxmm_reg[8]; - char ureserved[16][14]; -} usr_fcontext_t; - -/* The index of various registers inside the regcache. */ - -enum lynx_i386_gdb_regnum -{ - I386_EAX_REGNUM, - I386_ECX_REGNUM, - I386_EDX_REGNUM, - I386_EBX_REGNUM, - I386_ESP_REGNUM, - I386_EBP_REGNUM, - I386_ESI_REGNUM, - I386_EDI_REGNUM, - I386_EIP_REGNUM, - I386_EFLAGS_REGNUM, - I386_CS_REGNUM, - I386_SS_REGNUM, - I386_DS_REGNUM, - I386_ES_REGNUM, - I386_FS_REGNUM, - I386_GS_REGNUM, - I386_ST0_REGNUM, - I386_FCTRL_REGNUM = I386_ST0_REGNUM + 8, - I386_FSTAT_REGNUM, - I386_FTAG_REGNUM, - I386_FISEG_REGNUM, - I386_FIOFF_REGNUM, - I386_FOSEG_REGNUM, - I386_FOOFF_REGNUM, - I386_FOP_REGNUM, - I386_XMM0_REGNUM = 32, - I386_MXCSR_REGNUM = I386_XMM0_REGNUM + 8, - I386_SENTINEL_REGUM -}; - -/* Defined in auto-generated file i386.c. */ -extern void init_registers_i386 (void); - -/* The fill_function for the general-purpose register set. */ - -static void -lynx_i386_fill_gregset (struct regcache *regcache, char *buf) -{ -#define lynx_i386_collect_gp(regnum, fld) \ - collect_register (regcache, regnum, \ - buf + offsetof (usr_econtext_t, uec_##fld)) - - lynx_i386_collect_gp (I386_EAX_REGNUM, eax); - lynx_i386_collect_gp (I386_ECX_REGNUM, ecx); - lynx_i386_collect_gp (I386_EDX_REGNUM, edx); - lynx_i386_collect_gp (I386_EBX_REGNUM, ebx); - lynx_i386_collect_gp (I386_ESP_REGNUM, esp); - lynx_i386_collect_gp (I386_EBP_REGNUM, ebp); - lynx_i386_collect_gp (I386_ESI_REGNUM, esi); - lynx_i386_collect_gp (I386_EDI_REGNUM, edi); - lynx_i386_collect_gp (I386_EIP_REGNUM, eip); - lynx_i386_collect_gp (I386_EFLAGS_REGNUM, eflags); - lynx_i386_collect_gp (I386_CS_REGNUM, cs); - lynx_i386_collect_gp (I386_SS_REGNUM, ss); - lynx_i386_collect_gp (I386_DS_REGNUM, ds); - lynx_i386_collect_gp (I386_ES_REGNUM, es); - lynx_i386_collect_gp (I386_FS_REGNUM, fs); - lynx_i386_collect_gp (I386_GS_REGNUM, gs); -} - -/* The store_function for the general-purpose register set. */ - -static void -lynx_i386_store_gregset (struct regcache *regcache, const char *buf) -{ -#define lynx_i386_supply_gp(regnum, fld) \ - supply_register (regcache, regnum, \ - buf + offsetof (usr_econtext_t, uec_##fld)) - - lynx_i386_supply_gp (I386_EAX_REGNUM, eax); - lynx_i386_supply_gp (I386_ECX_REGNUM, ecx); - lynx_i386_supply_gp (I386_EDX_REGNUM, edx); - lynx_i386_supply_gp (I386_EBX_REGNUM, ebx); - lynx_i386_supply_gp (I386_ESP_REGNUM, esp); - lynx_i386_supply_gp (I386_EBP_REGNUM, ebp); - lynx_i386_supply_gp (I386_ESI_REGNUM, esi); - lynx_i386_supply_gp (I386_EDI_REGNUM, edi); - lynx_i386_supply_gp (I386_EIP_REGNUM, eip); - lynx_i386_supply_gp (I386_EFLAGS_REGNUM, eflags); - lynx_i386_supply_gp (I386_CS_REGNUM, cs); - lynx_i386_supply_gp (I386_SS_REGNUM, ss); - lynx_i386_supply_gp (I386_DS_REGNUM, ds); - lynx_i386_supply_gp (I386_ES_REGNUM, es); - lynx_i386_supply_gp (I386_FS_REGNUM, fs); - lynx_i386_supply_gp (I386_GS_REGNUM, gs); -} - -/* Extract the first 16 bits of register REGNUM in the REGCACHE, - and store these 2 bytes at DEST. - - This is useful to collect certain 16bit registers which are known - by GDBserver as 32bit registers (such as the Control Register - for instance). */ - -static void -collect_16bit_register (struct regcache *regcache, int regnum, char *dest) -{ - gdb_byte word[4]; - - collect_register (regcache, regnum, word); - memcpy (dest, word, 2); -} - -/* The fill_function for the floating-point register set. */ - -static void -lynx_i386_fill_fpregset (struct regcache *regcache, char *buf) -{ - int i; - - /* Collect %st0 .. %st7. */ - for (i = 0; i < 8; i++) - collect_register (regcache, I386_ST0_REGNUM + i, - buf + offsetof (usr_fcontext_t, ufc_reg) - + i * sizeof (struct ufp387_real)); - - /* Collect the other FPU registers. */ - collect_16bit_register (regcache, I386_FCTRL_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_control)); - collect_16bit_register (regcache, I386_FSTAT_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_status)); - collect_16bit_register (regcache, I386_FTAG_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_tag)); - collect_register (regcache, I386_FISEG_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_inst_sel)); - collect_register (regcache, I386_FIOFF_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_inst_off)); - collect_register (regcache, I386_FOSEG_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_data_sel)); - collect_register (regcache, I386_FOOFF_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_data_off)); - collect_16bit_register (regcache, I386_FOP_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_opcode)); - - /* Collect the XMM registers. */ - for (i = 0; i < 8; i++) - collect_register (regcache, I386_XMM0_REGNUM + i, - buf + offsetof (usr_fcontext_t, uxmm_reg) - + i * sizeof (struct uxmm_register)); - collect_register (regcache, I386_MXCSR_REGNUM, - buf + offsetof (usr_fcontext_t, usse_mxcsr)); -} - -/* This is the supply counterpart for collect_16bit_register: - It extracts a 2byte value from BUF, and uses that value to - set REGNUM's value in the regcache. - - This is useful to supply the value of certain 16bit registers - which are known by GDBserver as 32bit registers (such as the Control - Register for instance). */ - -static void -supply_16bit_register (struct regcache *regcache, int regnum, const char *buf) -{ - gdb_byte word[4]; - - memcpy (word, buf, 2); - memset (word + 2, 0, 2); - supply_register (regcache, regnum, word); -} - -/* The store_function for the floating-point register set. */ - -static void -lynx_i386_store_fpregset (struct regcache *regcache, const char *buf) -{ - int i; - - /* Store the %st0 .. %st7 registers. */ - for (i = 0; i < 8; i++) - supply_register (regcache, I386_ST0_REGNUM + i, - buf + offsetof (usr_fcontext_t, ufc_reg) - + i * sizeof (struct ufp387_real)); - - /* Store the other FPU registers. */ - supply_16bit_register (regcache, I386_FCTRL_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_control)); - supply_16bit_register (regcache, I386_FSTAT_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_status)); - supply_16bit_register (regcache, I386_FTAG_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_tag)); - supply_register (regcache, I386_FISEG_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_inst_sel)); - supply_register (regcache, I386_FIOFF_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_inst_off)); - supply_register (regcache, I386_FOSEG_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_data_sel)); - supply_register (regcache, I386_FOOFF_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_data_off)); - supply_16bit_register (regcache, I386_FOP_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_opcode)); - - /* Store the XMM registers. */ - for (i = 0; i < 8; i++) - supply_register (regcache, I386_XMM0_REGNUM + i, - buf + offsetof (usr_fcontext_t, uxmm_reg) - + i * sizeof (struct uxmm_register)); - supply_register (regcache, I386_MXCSR_REGNUM, - buf + offsetof (usr_fcontext_t, usse_mxcsr)); -} - -/* Implements the lynx_target_ops.arch_setup routine. */ - -static void -lynx_i386_arch_setup (void) -{ - init_registers_i386 (); -} - -/* Description of all the x86-lynx register sets. */ - -struct lynx_regset_info lynx_target_regsets[] = { - /* General Purpose Registers. */ - {PTRACE_GETREGS, PTRACE_SETREGS, sizeof(usr_econtext_t), - lynx_i386_fill_gregset, lynx_i386_store_gregset}, - /* Floating Point Registers. */ - { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof(usr_fcontext_t), - lynx_i386_fill_fpregset, lynx_i386_store_fpregset }, - /* End of list marker. */ - {0, 0, -1, NULL, NULL } -}; - -/* The lynx_target_ops vector for x86-lynx. */ - -struct lynx_target_ops the_low_target = { - lynx_i386_arch_setup, -}; diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c deleted file mode 100644 index fa06c4869a9..00000000000 --- a/gdb/gdbserver/lynx-low.c +++ /dev/null @@ -1,770 +0,0 @@ -/* Copyright (C) 2009, 2010, 2011 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 "target.h" -#include "lynx-low.h" - -#include <limits.h> -#include <sys/ptrace.h> -#include <sys/piddef.h> /* Provides PIDGET, TIDGET, BUILDPID, etc. */ -#include <unistd.h> -#include <sys/ioctl.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <signal.h> - -int using_threads = 1; - -/* Print a debug trace on standard output if debug_threads is set. */ - -static void -lynx_debug (char *string, ...) -{ - va_list args; - - if (!debug_threads) - return; - - va_start (args, string); - fprintf (stderr, "DEBUG(lynx): "); - vfprintf (stderr, string, args); - fprintf (stderr, "\n"); - va_end (args); -} - -/* Build a ptid_t given a PID and a LynxOS TID. */ - -static ptid_t -lynx_ptid_build (int pid, long tid) -{ - /* brobecker/2010-06-21: It looks like the LWP field in ptids - should be distinct for each thread (see write_ptid where it - writes the thread ID from the LWP). So instead of storing - the LynxOS tid in the tid field of the ptid, we store it in - the lwp field. */ - return ptid_build (pid, tid, 0); -} - -/* Return the process ID of the given PTID. - - This function has little reason to exist, it's just a wrapper around - ptid_get_pid. But since we have a getter function for the lynxos - ptid, it feels cleaner to have a getter for the pid as well. */ - -static int -lynx_ptid_get_pid (ptid_t ptid) -{ - return ptid_get_pid (ptid); -} - -/* Return the LynxOS tid of the given PTID. */ - -static long -lynx_ptid_get_tid (ptid_t ptid) -{ - /* See lynx_ptid_build: The LynxOS tid is stored inside the lwp field - of the ptid. */ - return ptid_get_lwp (ptid); -} - -/* For a given PTID, return the associated PID as known by the LynxOS - ptrace layer. */ - -static int -lynx_ptrace_pid_from_ptid (ptid_t ptid) -{ - return BUILDPID (lynx_ptid_get_pid (ptid), lynx_ptid_get_tid (ptid)); -} - -/* Return a string image of the ptrace REQUEST number. */ - -static char * -ptrace_request_to_str (int request) -{ - switch (request) - { - case PTRACE_TRACEME: - return "PTRACE_TRACEME"; - break; - case PTRACE_PEEKTEXT: - return "PTRACE_PEEKTEXT"; - break; - case PTRACE_PEEKDATA: - return "PTRACE_PEEKDATA"; - break; - case PTRACE_PEEKUSER: - return "PTRACE_PEEKUSER"; - break; - case PTRACE_POKETEXT: - return "PTRACE_POKETEXT"; - break; - case PTRACE_POKEDATA: - return "PTRACE_POKEDATA"; - break; - case PTRACE_POKEUSER: - return "PTRACE_POKEUSER"; - break; - case PTRACE_CONT: - return "PTRACE_CONT"; - break; - case PTRACE_KILL: - return "PTRACE_KILL"; - break; - case PTRACE_SINGLESTEP: - return "PTRACE_SINGLESTEP"; - break; - case PTRACE_ATTACH: - return "PTRACE_ATTACH"; - break; - case PTRACE_DETACH: - return "PTRACE_DETACH"; - break; - case PTRACE_GETREGS: - return "PTRACE_GETREGS"; - break; - case PTRACE_SETREGS: - return "PTRACE_SETREGS"; - break; - case PTRACE_GETFPREGS: - return "PTRACE_GETFPREGS"; - break; - case PTRACE_SETFPREGS: - return "PTRACE_SETFPREGS"; - break; - case PTRACE_READDATA: - return "PTRACE_READDATA"; - break; - case PTRACE_WRITEDATA: - return "PTRACE_WRITEDATA"; - break; - case PTRACE_READTEXT: - return "PTRACE_READTEXT"; - break; - case PTRACE_WRITETEXT: - return "PTRACE_WRITETEXT"; - break; - case PTRACE_GETFPAREGS: - return "PTRACE_GETFPAREGS"; - break; - case PTRACE_SETFPAREGS: - return "PTRACE_SETFPAREGS"; - break; - case PTRACE_GETWINDOW: - return "PTRACE_GETWINDOW"; - break; - case PTRACE_SETWINDOW: - return "PTRACE_SETWINDOW"; - break; - case PTRACE_SYSCALL: - return "PTRACE_SYSCALL"; - break; - case PTRACE_DUMPCORE: - return "PTRACE_DUMPCORE"; - break; - case PTRACE_SETWRBKPT: - return "PTRACE_SETWRBKPT"; - break; - case PTRACE_SETACBKPT: - return "PTRACE_SETACBKPT"; - break; - case PTRACE_CLRBKPT: - return "PTRACE_CLRBKPT"; - break; - case PTRACE_GET_UCODE: - return "PTRACE_GET_UCODE"; - break; -#ifdef PT_READ_GPR - case PT_READ_GPR: - return "PT_READ_GPR"; - break; -#endif -#ifdef PT_WRITE_GPR - case PT_WRITE_GPR: - return "PT_WRITE_GPR"; - break; -#endif -#ifdef PT_READ_FPR - case PT_READ_FPR: - return "PT_READ_FPR"; - break; -#endif -#ifdef PT_WRITE_FPR - case PT_WRITE_FPR: - return "PT_WRITE_FPR"; - break; -#endif -#ifdef PT_READ_VPR - case PT_READ_VPR: - return "PT_READ_VPR"; - break; -#endif -#ifdef PT_WRITE_VPR - case PT_WRITE_VPR: - return "PT_WRITE_VPR"; - break; -#endif -#ifdef PTRACE_PEEKUSP - case PTRACE_PEEKUSP: - return "PTRACE_PEEKUSP"; - break; -#endif -#ifdef PTRACE_POKEUSP - case PTRACE_POKEUSP: - return "PTRACE_POKEUSP"; - break; -#endif - case PTRACE_PEEKTHREAD: - return "PTRACE_PEEKTHREAD"; - break; - case PTRACE_THREADUSER: - return "PTRACE_THREADUSER"; - break; - case PTRACE_FPREAD: - return "PTRACE_FPREAD"; - break; - case PTRACE_FPWRITE: - return "PTRACE_FPWRITE"; - break; - case PTRACE_SETSIG: - return "PTRACE_SETSIG"; - break; - case PTRACE_CONT_ONE: - return "PTRACE_CONT_ONE"; - break; - case PTRACE_KILL_ONE: - return "PTRACE_KILL_ONE"; - break; - case PTRACE_SINGLESTEP_ONE: - return "PTRACE_SINGLESTEP_ONE"; - break; - case PTRACE_GETLOADINFO: - return "PTRACE_GETLOADINFO"; - break; - case PTRACE_GETTHREADLIST: - return "PTRACE_GETTHREADLIST"; - break; - } - return "<unknown-request>"; -} - -/* A wrapper around ptrace that allows us to print debug traces of - ptrace calls if debug traces are activated. */ - -static int -lynx_ptrace (int request, ptid_t ptid, int addr, int data, int addr2) -{ - int result; - const int pid = lynx_ptrace_pid_from_ptid (ptid); - int saved_errno; - - if (debug_threads) - fprintf (stderr, "PTRACE (%s, pid=%d(pid=%d, tid=%d), addr=0x%x, " - "data=0x%x, addr2=0x%x)", - ptrace_request_to_str (request), pid, PIDGET (pid), TIDGET (pid), - addr, data, addr2); - result = ptrace (request, pid, addr, data, addr2); - saved_errno = errno; - if (debug_threads) - fprintf (stderr, " -> %d (=0x%x)\n", result, result); - - errno = saved_errno; - return result; -} - -/* Implement the create_inferior method of the target_ops vector. */ - -static int -lynx_create_inferior (char *program, char **allargs) -{ - struct process_info *new_process; - int pid; - - lynx_debug ("lynx_create_inferior ()"); - - pid = fork (); - if (pid < 0) - perror_with_name ("fork"); - - if (pid == 0) - { - int pgrp; - - /* Switch child to its own process group so that signals won't - directly affect gdbserver. */ - pgrp = getpid(); - setpgid (0, pgrp); - ioctl (0, TIOCSPGRP, &pgrp); - lynx_ptrace (PTRACE_TRACEME, null_ptid, 0, 0, 0); - execv (program, allargs); - fprintf (stderr, "Cannot exec %s: %s.\n", program, strerror (errno)); - fflush (stderr); - _exit (0177); - } - - new_process = add_process (pid, 0); - /* Do not add the process thread just yet, as we do not know its tid. - We will add it later, during the wait for the STOP event corresponding - to the lynx_ptrace (PTRACE_TRACEME) call above. */ - return pid; -} - -/* Implement the attach target_ops method. */ - -static int -lynx_attach (unsigned long pid) -{ - struct process_info *new_process; - ptid_t ptid = lynx_ptid_build (pid, 0); - - if (lynx_ptrace (PTRACE_ATTACH, ptid, 0, 0, 0) != 0) - error ("Cannot attach to process %lu: %s (%d)\n", pid, - strerror (errno), errno); - - new_process = add_process (pid, 1); - add_thread (ptid, NULL); - - return 0; -} - -/* Implement the resume target_ops method. */ - -static void -lynx_resume (struct thread_resume *resume_info, size_t n) -{ - ptid_t inferior_ptid = thread_to_gdb_id (current_inferior); - /* FIXME: Assume for now that n == 1. */ - const int request = (resume_info[0].kind == resume_step - ? PTRACE_SINGLESTEP : PTRACE_CONT); - const int signal = resume_info[0].sig; - int ret; - - regcache_invalidate (); - ret = lynx_ptrace (request, inferior_ptid, 1, signal, 0); -} - -/* Resume the execution of the given PTID. */ - -static void -lynx_continue (ptid_t ptid) -{ - struct thread_resume resume_info; - - resume_info.thread = ptid; - resume_info.kind = resume_continue; - resume_info.sig = 0; - - lynx_resume (&resume_info, 1); -} - -/* Remove all inferiors and associated threads. */ - -static void -lynx_clear_inferiors (void) -{ - /* We do not use private data, so nothing much to do except calling - clear_inferiors. */ - clear_inferiors (); -} - -/* A wrapper around waitpid that handles the various idiosyncrasies - of LynxOS' waitpid. */ - -static int -lynx_waitpid (int pid, int *stat_loc) -{ - int ret = 0; - - while (1) - { - ret = waitpid (pid, stat_loc, WNOHANG); - if (ret < 0) - { - /* An ECHILD error is not indicative of a real problem. - It happens for instance while waiting for the inferior - to stop after attaching to it. */ - if (errno != ECHILD) - perror_with_name ("waitpid (WNOHANG)"); - } - if (ret > 0) - break; - /* No event with WNOHANG. See if there is one with WUNTRACED. */ - ret = waitpid (pid, stat_loc, WNOHANG | WUNTRACED); - if (ret < 0) - { - /* An ECHILD error is not indicative of a real problem. - It happens for instance while waiting for the inferior - to stop after attaching to it. */ - if (errno != ECHILD) - perror_with_name ("waitpid (WNOHANG|WUNTRACED)"); - } - if (ret > 0) - break; - usleep (1000); - } - return ret; -} - -/* Implement the wait target_ops method. */ - -static ptid_t -lynx_wait_1 (ptid_t ptid, struct target_waitstatus *status, int options) -{ - int pid; - int ret; - int wstat; - ptid_t new_ptid; - - if (ptid_equal (ptid, minus_one_ptid)) - pid = lynx_ptid_get_pid (thread_to_gdb_id (current_inferior)); - else - pid = BUILDPID (lynx_ptid_get_pid (ptid), lynx_ptid_get_tid (ptid)); - -retry: - - ret = lynx_waitpid (pid, &wstat); - new_ptid = lynx_ptid_build (ret, ((union wait *) &wstat)->w_tid); - - /* If this is a new thread, then add it now. The reason why we do - this here instead of when handling new-thread events is because - we need to add the thread associated to the "main" thread - even - for non-threaded applications where the new-thread events are not - generated. */ - if (!find_thread_ptid (new_ptid)) - add_thread (new_ptid, NULL); - - if (WIFSTOPPED (wstat)) - { - status->kind = TARGET_WAITKIND_STOPPED; - status->value.integer = target_signal_from_host (WSTOPSIG (wstat)); - lynx_debug ("process stopped with signal: %d", - status->value.integer); - } - else if (WIFEXITED (wstat)) - { - status->kind = TARGET_WAITKIND_EXITED; - status->value.integer = WEXITSTATUS (wstat); - lynx_debug ("process exited with code: %d", status->value.integer); - } - else if (WIFSIGNALED (wstat)) - { - status->kind = TARGET_WAITKIND_SIGNALLED; - status->value.integer = target_signal_from_host (WTERMSIG (wstat)); - lynx_debug ("process terminated with code: %d", - status->value.integer); - } - else - { - /* Not sure what happened if we get here, or whether we can - in fact get here. But if we do, handle the event the best - we can. */ - status->kind = TARGET_WAITKIND_STOPPED; - status->value.integer = target_signal_from_host (0); - lynx_debug ("unknown event ????"); - } - - /* SIGTRAP events are generated for situations other than single-step/ - breakpoint events (Eg. new-thread events). Handle those other types - of events, and resume the execution if necessary. */ - if (status->kind == TARGET_WAITKIND_STOPPED - && status->value.integer == TARGET_SIGNAL_TRAP) - { - const int realsig = lynx_ptrace (PTRACE_GETTRACESIG, new_ptid, 0, 0, 0); - - lynx_debug ("(realsig = %d)", realsig); - switch (realsig) - { - case SIGNEWTHREAD: - /* We just added the new thread above. No need to do anything - further. Just resume the execution again. */ - lynx_continue (ptid); - goto retry; - - case SIGTHREADEXIT: - remove_thread (find_thread_ptid (new_ptid)); - lynx_continue (ptid); - goto retry; - } - } - - return new_ptid; -} - -/* A wrapper around lynx_wait_1 that also prints debug traces when - such debug traces have been activated. */ - -static ptid_t -lynx_wait (ptid_t ptid, struct target_waitstatus *status, int options) -{ - ptid_t new_ptid; - - lynx_debug ("lynx_wait (pid = %d, tid = %ld)", - lynx_ptid_get_pid (ptid), lynx_ptid_get_tid (ptid)); - new_ptid = lynx_wait_1 (ptid, status, options); - lynx_debug (" -> (pid=%d, tid=%ld, status->kind = %d)", - lynx_ptid_get_pid (new_ptid), lynx_ptid_get_tid (new_ptid), - status->kind); - return new_ptid; -} - -/* Implement the kill target_ops method. */ - -static int -lynx_kill (int pid) -{ - ptid_t ptid = lynx_ptid_build (pid, 0); - struct target_waitstatus status; - struct process_info *process; - - process = find_process_pid (pid); - if (process == NULL) - return -1; - - lynx_ptrace (PTRACE_KILL, ptid, 0, 0, 0); - lynx_wait (ptid, &status, 0); - the_target->mourn (process); - return 0; -} - -/* Implement the detach target_ops method. */ - -static int -lynx_detach (int pid) -{ - ptid_t ptid = lynx_ptid_build (pid, 0); - struct process_info *process; - - process = find_process_pid (pid); - if (process == NULL) - return -1; - - lynx_ptrace (PTRACE_DETACH, ptid, 0, 0, 0); - the_target->mourn (process); - return 0; -} - -/* Implement the mourn target_ops method. */ - -static void -lynx_mourn (struct process_info *proc) -{ - lynx_clear_inferiors (); -} - -/* Implement the join target_ops method. */ - -static void -lynx_join (int pid) -{ - /* The PTRACE_DETACH is sufficient to detach from the process. - So no need to do anything extra. */ -} - -/* Implement the thread_alive target_ops method. */ - -static int -lynx_thread_alive (ptid_t ptid) -{ - /* The list of threads is updated at the end of each wait, so it - should be up to date. No need to re-fetch it. */ - return (find_thread_ptid (ptid) != NULL); -} - -/* Implement the fetch_registers target_ops method. */ - -static void -lynx_fetch_registers (struct regcache *regcache, int regno) -{ - struct lynx_regset_info *regset = lynx_target_regsets; - ptid_t inferior_ptid = thread_to_gdb_id (current_inferior); - - lynx_debug ("lynx_fetch_registers (regno = %d)", regno); - - while (regset->size >= 0) - { - char *buf; - int res; - - buf = xmalloc (regset->size); - res = lynx_ptrace (regset->get_request, inferior_ptid, (int) buf, 0, 0); - if (res < 0) - perror ("ptrace"); - regset->store_function (regcache, buf); - free (buf); - regset++; - } -} - -/* Implement the store_registers target_ops method. */ - -static void -lynx_store_registers (struct regcache *regcache, int regno) -{ - struct lynx_regset_info *regset = lynx_target_regsets; - ptid_t inferior_ptid = thread_to_gdb_id (current_inferior); - - lynx_debug ("lynx_store_registers (regno = %d)", regno); - - while (regset->size >= 0) - { - char *buf; - int res; - - buf = xmalloc (regset->size); - res = lynx_ptrace (regset->get_request, inferior_ptid, (int) buf, 0, 0); - if (res == 0) - { - /* Then overlay our cached registers on that. */ - regset->fill_function (regcache, buf); - /* Only now do we write the register set. */ - res = lynx_ptrace (regset->set_request, inferior_ptid, (int) buf, - 0, 0); - } - if (res < 0) - perror ("ptrace"); - free (buf); - regset++; - } -} - -/* Implement the read_memory target_ops method. */ - -static int -lynx_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - /* On LynxOS, memory reads needs to be performed in chunks the size - of int types, and they should also be aligned accordingly. */ - int buf; - const int xfer_size = sizeof (buf); - CORE_ADDR addr = memaddr & -(CORE_ADDR) xfer_size; - ptid_t inferior_ptid = thread_to_gdb_id (current_inferior); - - while (addr < memaddr + len) - { - int skip = 0; - int truncate = 0; - - errno = 0; - if (addr < memaddr) - skip = memaddr - addr; - if (addr + xfer_size > memaddr + len) - truncate = addr + xfer_size - memaddr - len; - buf = lynx_ptrace (PTRACE_PEEKTEXT, inferior_ptid, addr, 0, 0); - if (errno) - return errno; - memcpy (myaddr + (addr - memaddr) + skip, (gdb_byte *) &buf + skip, - xfer_size - skip - truncate); - addr += xfer_size; - } - - return 0; -} - -/* Implement the write_memory target_ops method. */ - -static int -lynx_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len) -{ - /* On LynxOS, memory writes needs to be performed in chunks the size - of int types, and they should also be aligned accordingly. */ - int buf; - const int xfer_size = sizeof (buf); - CORE_ADDR addr = memaddr & -(CORE_ADDR) xfer_size; - ptid_t inferior_ptid = thread_to_gdb_id (current_inferior); - - while (addr < memaddr + len) - { - int skip = 0; - int truncate = 0; - - if (addr < memaddr) - skip = memaddr - addr; - if (addr + xfer_size > memaddr + len) - truncate = addr + xfer_size - memaddr - len; - if (skip > 0 || truncate > 0) - /* We need to read the memory at this address in order to preserve - the data that we are not overwriting. */ - lynx_read_memory (addr, (unsigned char *) &buf, xfer_size); - if (errno) - return errno; - memcpy ((gdb_byte *) &buf + skip, myaddr + (addr - memaddr) + skip, - xfer_size - skip - truncate); - errno = 0; - lynx_ptrace (PTRACE_POKETEXT, inferior_ptid, addr, buf, 0); - if (errno) - return errno; - addr += xfer_size; - } - - return 0; -} - -/* Implement the kill_request target_ops method. */ - -static void -lynx_request_interrupt (void) -{ - ptid_t inferior_ptid = thread_to_gdb_id (current_inferior); - - kill (lynx_ptid_get_pid (inferior_ptid), SIGINT); -} - -/* The LynxOS target_ops vector. */ - -static struct target_ops lynx_target_ops = { - lynx_create_inferior, - lynx_attach, - lynx_kill, - lynx_detach, - lynx_mourn, - lynx_join, - lynx_thread_alive, - lynx_resume, - lynx_wait, - lynx_fetch_registers, - lynx_store_registers, - NULL, /* prepare_to_access_memory */ - NULL, /* done_accessing_memory */ - lynx_read_memory, - lynx_write_memory, - NULL, /* look_up_symbols */ - lynx_request_interrupt, - NULL, /* read_auxv */ - NULL, /* insert_point */ - NULL, /* remove_point */ - NULL, /* stopped_by_watchpoint */ - NULL, /* stopped_data_address */ - NULL, /* read_offsets */ - NULL, /* get_tls_address */ - NULL, /* qxfer_spu */ - NULL, /* hostio_last_error */ - NULL, /* qxfer_osdata */ - NULL, /* qxfer_siginfo */ - NULL, /* supports_non_stop */ - NULL, /* async */ - NULL, /* start_non_stop */ - NULL, /* supports_multi_process */ - NULL, /* handle_monitor_command */ -}; - -void -initialize_low (void) -{ - set_target_ops (&lynx_target_ops); - the_low_target.arch_setup (); -} - diff --git a/gdb/gdbserver/lynx-low.h b/gdb/gdbserver/lynx-low.h deleted file mode 100644 index 48642a0d18f..00000000000 --- a/gdb/gdbserver/lynx-low.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright (C) 2010, 2011 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" - -struct regcache; - -/* Some information relative to a given register set. */ - -struct lynx_regset_info -{ - /* The ptrace request needed to get/set registers of this set. */ - int get_request, set_request; - /* The size of the register set. */ - int size; - /* Fill the buffer BUF from the contents of the given REGCACHE. */ - void (*fill_function) (struct regcache *regcache, char *buf); - /* Store the register value in BUF in the given REGCACHE. */ - void (*store_function) (struct regcache *regcache, const char *buf); -}; - -/* A list of regsets for the target being debugged, terminated by an entry - where the size is negative. - - This list should be created by the target-specific code. */ - -extern struct lynx_regset_info lynx_target_regsets[]; - -/* The target-specific operations for LynxOS support. */ - -struct lynx_target_ops -{ - /* Architecture-specific setup. */ - void (*arch_setup) (void); -}; - -extern struct lynx_target_ops the_low_target; - diff --git a/gdb/gdbserver/lynx-ppc-low.c b/gdb/gdbserver/lynx-ppc-low.c deleted file mode 100644 index 7c755bfd4ec..00000000000 --- a/gdb/gdbserver/lynx-ppc-low.c +++ /dev/null @@ -1,186 +0,0 @@ -/* Copyright (C) 2009, 2010, 2011 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 "lynx-low.h" - -#include <stdint.h> -#include <stddef.h> -#include <limits.h> -#include <sys/ptrace.h> - -/* The following two typedefs are defined in a .h file which is not - in the standard include path (/sys/include/family/ppc/ucontext.h), - so we just duplicate them here. */ - -/* General register context */ -typedef struct usr_econtext_s -{ - uint32_t uec_iregs[32]; - uint32_t uec_inum; - uint32_t uec_srr0; - uint32_t uec_srr1; - uint32_t uec_lr; - uint32_t uec_ctr; - uint32_t uec_cr; - uint32_t uec_xer; - uint32_t uec_dar; - uint32_t uec_mq; - uint32_t uec_msr; - uint32_t uec_sregs[16]; - uint32_t uec_ss_count; - uint32_t uec_ss_addr1; - uint32_t uec_ss_addr2; - uint32_t uec_ss_code1; - uint32_t uec_ss_code2; -} usr_econtext_t; - -/* Floating point register context */ -typedef struct usr_fcontext_s -{ - uint64_t ufc_freg[32]; - uint32_t ufc_fpscr[2]; -} usr_fcontext_t; - -/* Index of for various registers inside the regcache. */ -#define R0_REGNUM 0 -#define F0_REGNUM 32 -#define PC_REGNUM 64 -#define MSR_REGNUM 65 -#define CR_REGNUM 66 -#define LR_REGNUM 67 -#define CTR_REGNUM 68 -#define XER_REGNUM 69 -#define FPSCR_REGNUM 70 - -/* Defined in auto-generated file powerpc-32.c. */ -extern void init_registers_powerpc_32 (void); - -/* The fill_function for the general-purpose register set. */ - -static void -lynx_ppc_fill_gregset (struct regcache *regcache, char *buf) -{ - int i; - - /* r0 - r31 */ - for (i = 0; i < 32; i++) - collect_register (regcache, R0_REGNUM + i, - buf + offsetof (usr_econtext_t, uec_iregs[i])); - - /* The other registers provided in the GP register context. */ - collect_register (regcache, PC_REGNUM, - buf + offsetof (usr_econtext_t, uec_srr0)); - collect_register (regcache, MSR_REGNUM, - buf + offsetof (usr_econtext_t, uec_srr1)); - collect_register (regcache, CR_REGNUM, - buf + offsetof (usr_econtext_t, uec_cr)); - collect_register (regcache, LR_REGNUM, - buf + offsetof (usr_econtext_t, uec_lr)); - collect_register (regcache, CTR_REGNUM, - buf + offsetof (usr_econtext_t, uec_ctr)); - collect_register (regcache, XER_REGNUM, - buf + offsetof (usr_econtext_t, uec_xer)); -} - -/* The store_function for the general-purpose register set. */ - -static void -lynx_ppc_store_gregset (struct regcache *regcache, const char *buf) -{ - int i; - - /* r0 - r31 */ - for (i = 0; i < 32; i++) - supply_register (regcache, R0_REGNUM + i, - buf + offsetof (usr_econtext_t, uec_iregs[i])); - - /* The other registers provided in the GP register context. */ - supply_register (regcache, PC_REGNUM, - buf + offsetof (usr_econtext_t, uec_srr0)); - supply_register (regcache, MSR_REGNUM, - buf + offsetof (usr_econtext_t, uec_srr1)); - supply_register (regcache, CR_REGNUM, - buf + offsetof (usr_econtext_t, uec_cr)); - supply_register (regcache, LR_REGNUM, - buf + offsetof (usr_econtext_t, uec_lr)); - supply_register (regcache, CTR_REGNUM, - buf + offsetof (usr_econtext_t, uec_ctr)); - supply_register (regcache, XER_REGNUM, - buf + offsetof (usr_econtext_t, uec_xer)); -} - -/* The fill_function for the floating-point register set. */ - -static void -lynx_ppc_fill_fpregset (struct regcache *regcache, char *buf) -{ - int i; - - /* f0 - f31 */ - for (i = 0; i < 32; i++) - collect_register (regcache, F0_REGNUM + i, - buf + offsetof (usr_fcontext_t, ufc_freg[i])); - - /* fpscr */ - collect_register (regcache, FPSCR_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_fpscr)); -} - -/* The store_function for the floating-point register set. */ - -static void -lynx_ppc_store_fpregset (struct regcache *regcache, const char *buf) -{ - int i; - - /* f0 - f31 */ - for (i = 0; i < 32; i++) - supply_register (regcache, F0_REGNUM + i, - buf + offsetof (usr_fcontext_t, ufc_freg[i])); - - /* fpscr */ - supply_register (regcache, FPSCR_REGNUM, - buf + offsetof (usr_fcontext_t, ufc_fpscr)); -} - -/* Implements the lynx_target_ops.arch_setup routine. */ - -static void -lynx_ppc_arch_setup (void) -{ - init_registers_powerpc_32 (); -} - -/* Description of all the powerpc-lynx register sets. */ - -struct lynx_regset_info lynx_target_regsets[] = { - /* General Purpose Registers. */ - {PTRACE_GETREGS, PTRACE_SETREGS, sizeof(usr_econtext_t), - lynx_ppc_fill_gregset, lynx_ppc_store_gregset}, - /* Floating Point Registers. */ - { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof(usr_fcontext_t), - lynx_ppc_fill_fpregset, lynx_ppc_store_fpregset }, - /* End of list marker. */ - {0, 0, -1, NULL, NULL } -}; - -/* The lynx_target_ops vector for powerpc-lynxos. */ - -struct lynx_target_ops the_low_target = { - lynx_ppc_arch_setup, -}; diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c deleted file mode 100644 index eea8c713471..00000000000 --- a/gdb/gdbserver/mem-break.c +++ /dev/null @@ -1,1145 +0,0 @@ -/* Memory breakpoint operations for the remote server for GDB. - Copyright (C) 2002, 2003, 2005, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - This file is part of GDB. - - This program is free software; you can 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" - -const unsigned char *breakpoint_data; -int breakpoint_len; - -#define MAX_BREAKPOINT_LEN 8 - -/* GDB will never try to install multiple breakpoints at the same - address. But, we need to keep track of internal breakpoints too, - and so we do need to be able to install multiple breakpoints at the - same address transparently. We keep track of two different, and - closely related structures. A raw breakpoint, which manages the - low level, close to the metal aspect of a breakpoint. It holds the - breakpoint address, and a buffer holding a copy of the instructions - that would be in memory had not been a breakpoint there (we call - that the shadow memory of the breakpoint). We occasionally need to - temporarilly uninsert a breakpoint without the client knowing about - it (e.g., to step over an internal breakpoint), so we keep an - `inserted' state associated with this low level breakpoint - structure. There can only be one such object for a given address. - Then, we have (a bit higher level) breakpoints. This structure - holds a callback to be called whenever a breakpoint is hit, a - high-level type, and a link to a low level raw breakpoint. There - can be many high-level breakpoints at the same address, and all of - them will point to the same raw breakpoint, which is reference - counted. */ - -/* The low level, physical, raw breakpoint. */ -struct raw_breakpoint -{ - struct raw_breakpoint *next; - - /* A reference count. Each high level breakpoint referencing this - raw breakpoint accounts for one reference. */ - int refcount; - - /* The breakpoint's insertion address. There can only be one raw - breakpoint for a given PC. */ - CORE_ADDR pc; - - /* The breakpoint's shadow memory. */ - unsigned char old_data[MAX_BREAKPOINT_LEN]; - - /* Non-zero if this breakpoint is currently inserted in the - inferior. */ - int inserted; - - /* Non-zero if this breakpoint is currently disabled because we no - longer detect it as inserted. */ - int shlib_disabled; -}; - -/* The type of a breakpoint. */ -enum bkpt_type - { - /* A GDB breakpoint, requested with a Z0 packet. */ - gdb_breakpoint, - - /* A basic-software-single-step breakpoint. */ - reinsert_breakpoint, - - /* Any other breakpoint type that doesn't require specific - treatment goes here. E.g., an event breakpoint. */ - other_breakpoint, - }; - -/* A high level (in gdbserver's perspective) breakpoint. */ -struct breakpoint -{ - struct breakpoint *next; - - /* The breakpoint's type. */ - enum bkpt_type type; - - /* Link to this breakpoint's raw breakpoint. This is always - non-NULL. */ - struct raw_breakpoint *raw; - - /* Function to call when we hit this breakpoint. If it returns 1, - the breakpoint shall be deleted; 0 or if this callback is NULL, - it will be left inserted. */ - int (*handler) (CORE_ADDR); -}; - -static struct raw_breakpoint * -find_raw_breakpoint_at (CORE_ADDR where) -{ - struct process_info *proc = current_process (); - struct raw_breakpoint *bp; - - for (bp = proc->raw_breakpoints; bp != NULL; bp = bp->next) - if (bp->pc == where) - return bp; - - return NULL; -} - -static struct raw_breakpoint * -set_raw_breakpoint_at (CORE_ADDR where) -{ - struct process_info *proc = current_process (); - struct raw_breakpoint *bp; - int err; - - if (breakpoint_data == NULL) - error ("Target does not support breakpoints."); - - bp = find_raw_breakpoint_at (where); - if (bp != NULL) - { - bp->refcount++; - return bp; - } - - bp = xcalloc (1, sizeof (*bp)); - bp->pc = where; - bp->refcount = 1; - - /* Note that there can be fast tracepoint jumps installed in the - same memory range, so to get at the original memory, we need to - use read_inferior_memory, which masks those out. */ - err = read_inferior_memory (where, bp->old_data, breakpoint_len); - if (err != 0) - { - if (debug_threads) - fprintf (stderr, - "Failed to read shadow memory of" - " breakpoint at 0x%s (%s).\n", - paddress (where), strerror (err)); - free (bp); - return NULL; - } - - err = (*the_target->write_memory) (where, breakpoint_data, - breakpoint_len); - if (err != 0) - { - if (debug_threads) - fprintf (stderr, - "Failed to insert breakpoint at 0x%s (%s).\n", - paddress (where), strerror (err)); - free (bp); - return NULL; - } - - /* Link the breakpoint in. */ - bp->inserted = 1; - bp->next = proc->raw_breakpoints; - proc->raw_breakpoints = bp; - return bp; -} - -/* Notice that breakpoint traps are always installed on top of fast - tracepoint jumps. This is even if the fast tracepoint is installed - at a later time compared to when the breakpoint was installed. - This means that a stopping breakpoint or tracepoint has higher - "priority". In turn, this allows having fast and slow tracepoints - (and breakpoints) at the same address behave correctly. */ - - -/* A fast tracepoint jump. */ - -struct fast_tracepoint_jump -{ - struct fast_tracepoint_jump *next; - - /* A reference count. GDB can install more than one fast tracepoint - at the same address (each with its own action list, for - example). */ - int refcount; - - /* The fast tracepoint's insertion address. There can only be one - of these for a given PC. */ - CORE_ADDR pc; - - /* Non-zero if this fast tracepoint jump is currently inserted in - the inferior. */ - int inserted; - - /* The length of the jump instruction. */ - int length; - - /* A poor-man's flexible array member, holding both the jump - instruction to insert, and a copy of the instruction that would - be in memory had not been a jump there (the shadow memory of the - tracepoint jump). */ - unsigned char insn_and_shadow[0]; -}; - -/* Fast tracepoint FP's jump instruction to insert. */ -#define fast_tracepoint_jump_insn(fp) \ - ((fp)->insn_and_shadow + 0) - -/* The shadow memory of fast tracepoint jump FP. */ -#define fast_tracepoint_jump_shadow(fp) \ - ((fp)->insn_and_shadow + (fp)->length) - - -/* Return the fast tracepoint jump set at WHERE. */ - -static struct fast_tracepoint_jump * -find_fast_tracepoint_jump_at (CORE_ADDR where) -{ - struct process_info *proc = current_process (); - struct fast_tracepoint_jump *jp; - - for (jp = proc->fast_tracepoint_jumps; jp != NULL; jp = jp->next) - if (jp->pc == where) - return jp; - - return NULL; -} - -int -fast_tracepoint_jump_here (CORE_ADDR where) -{ - struct fast_tracepoint_jump *jp = find_fast_tracepoint_jump_at (where); - - return (jp != NULL); -} - -int -delete_fast_tracepoint_jump (struct fast_tracepoint_jump *todel) -{ - struct fast_tracepoint_jump *bp, **bp_link; - int ret; - struct process_info *proc = current_process (); - - bp = proc->fast_tracepoint_jumps; - bp_link = &proc->fast_tracepoint_jumps; - - while (bp) - { - if (bp == todel) - { - if (--bp->refcount == 0) - { - struct fast_tracepoint_jump *prev_bp_link = *bp_link; - - /* Unlink it. */ - *bp_link = bp->next; - - /* Since there can be breakpoints inserted in the same - address range, we use `write_inferior_memory', which - takes care of layering breakpoints on top of fast - tracepoints, and on top of the buffer we pass it. - This works because we've already unlinked the fast - tracepoint jump above. Also note that we need to - pass the current shadow contents, because - write_inferior_memory updates any shadow memory with - what we pass here, and we want that to be a nop. */ - ret = write_inferior_memory (bp->pc, - fast_tracepoint_jump_shadow (bp), - bp->length); - if (ret != 0) - { - /* Something went wrong, relink the jump. */ - *bp_link = prev_bp_link; - - if (debug_threads) - fprintf (stderr, - "Failed to uninsert fast tracepoint jump " - "at 0x%s (%s) while deleting it.\n", - paddress (bp->pc), strerror (ret)); - return ret; - } - - free (bp); - } - - return 0; - } - else - { - bp_link = &bp->next; - bp = *bp_link; - } - } - - warning ("Could not find fast tracepoint jump in list."); - return ENOENT; -} - -struct fast_tracepoint_jump * -set_fast_tracepoint_jump (CORE_ADDR where, - unsigned char *insn, ULONGEST length) -{ - struct process_info *proc = current_process (); - struct fast_tracepoint_jump *jp; - int err; - - /* We refcount fast tracepoint jumps. Check if we already know - about a jump at this address. */ - jp = find_fast_tracepoint_jump_at (where); - if (jp != NULL) - { - jp->refcount++; - return jp; - } - - /* We don't, so create a new object. Double the length, because the - flexible array member holds both the jump insn, and the - shadow. */ - jp = xcalloc (1, sizeof (*jp) + (length * 2)); - jp->pc = where; - jp->length = length; - memcpy (fast_tracepoint_jump_insn (jp), insn, length); - jp->refcount = 1; - - /* Note that there can be trap breakpoints inserted in the same - address range. To access the original memory contents, we use - `read_inferior_memory', which masks out breakpoints. */ - err = read_inferior_memory (where, - fast_tracepoint_jump_shadow (jp), jp->length); - if (err != 0) - { - if (debug_threads) - fprintf (stderr, - "Failed to read shadow memory of" - " fast tracepoint at 0x%s (%s).\n", - paddress (where), strerror (err)); - free (jp); - return NULL; - } - - /* Link the jump in. */ - jp->inserted = 1; - jp->next = proc->fast_tracepoint_jumps; - proc->fast_tracepoint_jumps = jp; - - /* Since there can be trap breakpoints inserted in the same address - range, we use use `write_inferior_memory', which takes care of - layering breakpoints on top of fast tracepoints, on top of the - buffer we pass it. This works because we've already linked in - the fast tracepoint jump above. Also note that we need to pass - the current shadow contents, because write_inferior_memory - updates any shadow memory with what we pass here, and we want - that to be a nop. */ - err = write_inferior_memory (where, fast_tracepoint_jump_shadow (jp), - length); - if (err != 0) - { - if (debug_threads) - fprintf (stderr, - "Failed to insert fast tracepoint jump at 0x%s (%s).\n", - paddress (where), strerror (err)); - - /* Unlink it. */ - proc->fast_tracepoint_jumps = jp->next; - free (jp); - - return NULL; - } - - return jp; -} - -void -uninsert_fast_tracepoint_jumps_at (CORE_ADDR pc) -{ - struct fast_tracepoint_jump *jp; - int err; - - jp = find_fast_tracepoint_jump_at (pc); - if (jp == NULL) - { - /* This can happen when we remove all breakpoints while handling - a step-over. */ - if (debug_threads) - fprintf (stderr, - "Could not find fast tracepoint jump at 0x%s " - "in list (uninserting).\n", - paddress (pc)); - return; - } - - if (jp->inserted) - { - jp->inserted = 0; - - /* Since there can be trap breakpoints inserted in the same - address range, we use use `write_inferior_memory', which - takes care of layering breakpoints on top of fast - tracepoints, and on top of the buffer we pass it. This works - because we've already marked the fast tracepoint fast - tracepoint jump uninserted above. Also note that we need to - pass the current shadow contents, because - write_inferior_memory updates any shadow memory with what we - pass here, and we want that to be a nop. */ - err = write_inferior_memory (jp->pc, - fast_tracepoint_jump_shadow (jp), - jp->length); - if (err != 0) - { - jp->inserted = 1; - - if (debug_threads) - fprintf (stderr, - "Failed to uninsert fast tracepoint jump at 0x%s (%s).\n", - paddress (pc), strerror (err)); - } - } -} - -void -reinsert_fast_tracepoint_jumps_at (CORE_ADDR where) -{ - struct fast_tracepoint_jump *jp; - int err; - - jp = find_fast_tracepoint_jump_at (where); - if (jp == NULL) - { - /* This can happen when we remove breakpoints when a tracepoint - hit causes a tracing stop, while handling a step-over. */ - if (debug_threads) - fprintf (stderr, - "Could not find fast tracepoint jump at 0x%s " - "in list (reinserting).\n", - paddress (where)); - return; - } - - if (jp->inserted) - error ("Jump already inserted at reinsert time."); - - jp->inserted = 1; - - /* Since there can be trap breakpoints inserted in the same address - range, we use `write_inferior_memory', which takes care of - layering breakpoints on top of fast tracepoints, and on top of - the buffer we pass it. This works because we've already marked - the fast tracepoint jump inserted above. Also note that we need - to pass the current shadow contents, because - write_inferior_memory updates any shadow memory with what we pass - here, and we want that to be a nop. */ - err = write_inferior_memory (where, - fast_tracepoint_jump_shadow (jp), jp->length); - if (err != 0) - { - jp->inserted = 0; - - if (debug_threads) - fprintf (stderr, - "Failed to reinsert fast tracepoint jump at 0x%s (%s).\n", - paddress (where), strerror (err)); - } -} - -struct breakpoint * -set_breakpoint_at (CORE_ADDR where, int (*handler) (CORE_ADDR)) -{ - struct process_info *proc = current_process (); - struct breakpoint *bp; - struct raw_breakpoint *raw; - - raw = set_raw_breakpoint_at (where); - - if (raw == NULL) - { - /* warn? */ - return NULL; - } - - bp = xcalloc (1, sizeof (struct breakpoint)); - bp->type = other_breakpoint; - - bp->raw = raw; - bp->handler = handler; - - bp->next = proc->breakpoints; - proc->breakpoints = bp; - - return bp; -} - -static int -delete_raw_breakpoint (struct process_info *proc, struct raw_breakpoint *todel) -{ - struct raw_breakpoint *bp, **bp_link; - int ret; - - bp = proc->raw_breakpoints; - bp_link = &proc->raw_breakpoints; - - while (bp) - { - if (bp == todel) - { - if (bp->inserted) - { - struct raw_breakpoint *prev_bp_link = *bp_link; - - *bp_link = bp->next; - - /* Since there can be trap breakpoints inserted in the - same address range, we use `write_inferior_memory', - which takes care of layering breakpoints on top of - fast tracepoints, and on top of the buffer we pass - it. This works because we've already unlinked the - fast tracepoint jump above. Also note that we need - to pass the current shadow contents, because - write_inferior_memory updates any shadow memory with - what we pass here, and we want that to be a nop. */ - ret = write_inferior_memory (bp->pc, bp->old_data, - breakpoint_len); - if (ret != 0) - { - /* Something went wrong, relink the breakpoint. */ - *bp_link = prev_bp_link; - - if (debug_threads) - fprintf (stderr, - "Failed to uninsert raw breakpoint " - "at 0x%s (%s) while deleting it.\n", - paddress (bp->pc), strerror (ret)); - return ret; - } - - } - else - *bp_link = bp->next; - - free (bp); - return 0; - } - else - { - bp_link = &bp->next; - bp = *bp_link; - } - } - - warning ("Could not find raw breakpoint in list."); - return ENOENT; -} - -static int -release_breakpoint (struct process_info *proc, struct breakpoint *bp) -{ - int newrefcount; - int ret; - - newrefcount = bp->raw->refcount - 1; - if (newrefcount == 0) - { - ret = delete_raw_breakpoint (proc, bp->raw); - if (ret != 0) - return ret; - } - else - bp->raw->refcount = newrefcount; - - free (bp); - - return 0; -} - -static int -delete_breakpoint_1 (struct process_info *proc, struct breakpoint *todel) -{ - struct breakpoint *bp, **bp_link; - int err; - - bp = proc->breakpoints; - bp_link = &proc->breakpoints; - - while (bp) - { - if (bp == todel) - { - *bp_link = bp->next; - - err = release_breakpoint (proc, bp); - if (err != 0) - return err; - - bp = *bp_link; - return 0; - } - else - { - bp_link = &bp->next; - bp = *bp_link; - } - } - - warning ("Could not find breakpoint in list."); - return ENOENT; -} - -int -delete_breakpoint (struct breakpoint *todel) -{ - struct process_info *proc = current_process (); - return delete_breakpoint_1 (proc, todel); -} - -static struct breakpoint * -find_gdb_breakpoint_at (CORE_ADDR where) -{ - struct process_info *proc = current_process (); - struct breakpoint *bp; - - for (bp = proc->breakpoints; bp != NULL; bp = bp->next) - if (bp->type == gdb_breakpoint && bp->raw->pc == where) - return bp; - - return NULL; -} - -int -set_gdb_breakpoint_at (CORE_ADDR where) -{ - struct breakpoint *bp; - - if (breakpoint_data == NULL) - return 1; - - /* If we see GDB inserting a second breakpoint at the same address, - then the first breakpoint must have disappeared due to a shared - library unload. On targets where the shared libraries are - handled by userspace, like SVR4, for example, GDBserver can't - tell if a library was loaded or unloaded. Since we refcount - breakpoints, if we didn't do this, we'd just increase the - refcount of the previous breakpoint at this address, but the trap - was not planted in the inferior anymore, thus the breakpoint - would never be hit. */ - bp = find_gdb_breakpoint_at (where); - if (bp != NULL) - { - delete_gdb_breakpoint_at (where); - - /* Might as well validate all other breakpoints. */ - validate_breakpoints (); - } - - bp = set_breakpoint_at (where, NULL); - if (bp == NULL) - return -1; - - bp->type = gdb_breakpoint; - return 0; -} - -int -delete_gdb_breakpoint_at (CORE_ADDR addr) -{ - struct breakpoint *bp; - int err; - - if (breakpoint_data == NULL) - return 1; - - bp = find_gdb_breakpoint_at (addr); - if (bp == NULL) - return -1; - - err = delete_breakpoint (bp); - if (err) - return -1; - - return 0; -} - -int -gdb_breakpoint_here (CORE_ADDR where) -{ - struct breakpoint *bp = find_gdb_breakpoint_at (where); - - return (bp != NULL); -} - -void -set_reinsert_breakpoint (CORE_ADDR stop_at) -{ - struct breakpoint *bp; - - bp = set_breakpoint_at (stop_at, NULL); - bp->type = reinsert_breakpoint; -} - -void -delete_reinsert_breakpoints (void) -{ - struct process_info *proc = current_process (); - struct breakpoint *bp, **bp_link; - - bp = proc->breakpoints; - bp_link = &proc->breakpoints; - - while (bp) - { - if (bp->type == reinsert_breakpoint) - { - *bp_link = bp->next; - release_breakpoint (proc, bp); - bp = *bp_link; - } - else - { - bp_link = &bp->next; - bp = *bp_link; - } - } -} - -static void -uninsert_raw_breakpoint (struct raw_breakpoint *bp) -{ - if (bp->inserted) - { - int err; - - bp->inserted = 0; - /* Since there can be fast tracepoint jumps inserted in the same - address range, we use `write_inferior_memory', which takes - care of layering breakpoints on top of fast tracepoints, and - on top of the buffer we pass it. This works because we've - already unlinked the fast tracepoint jump above. Also note - that we need to pass the current shadow contents, because - write_inferior_memory updates any shadow memory with what we - pass here, and we want that to be a nop. */ - err = write_inferior_memory (bp->pc, bp->old_data, - breakpoint_len); - if (err != 0) - { - bp->inserted = 1; - - if (debug_threads) - fprintf (stderr, - "Failed to uninsert raw breakpoint at 0x%s (%s).\n", - paddress (bp->pc), strerror (err)); - } - } -} - -void -uninsert_breakpoints_at (CORE_ADDR pc) -{ - struct raw_breakpoint *bp; - - bp = find_raw_breakpoint_at (pc); - if (bp == NULL) - { - /* This can happen when we remove all breakpoints while handling - a step-over. */ - if (debug_threads) - fprintf (stderr, - "Could not find breakpoint at 0x%s " - "in list (uninserting).\n", - paddress (pc)); - return; - } - - if (bp->inserted) - uninsert_raw_breakpoint (bp); -} - -void -uninsert_all_breakpoints (void) -{ - struct process_info *proc = current_process (); - struct raw_breakpoint *bp; - - for (bp = proc->raw_breakpoints; bp != NULL; bp = bp->next) - if (bp->inserted) - uninsert_raw_breakpoint (bp); -} - -static void -reinsert_raw_breakpoint (struct raw_breakpoint *bp) -{ - int err; - - if (bp->inserted) - error ("Breakpoint already inserted at reinsert time."); - - err = (*the_target->write_memory) (bp->pc, breakpoint_data, - breakpoint_len); - if (err == 0) - bp->inserted = 1; - else if (debug_threads) - fprintf (stderr, - "Failed to reinsert breakpoint at 0x%s (%s).\n", - paddress (bp->pc), strerror (err)); -} - -void -reinsert_breakpoints_at (CORE_ADDR pc) -{ - struct raw_breakpoint *bp; - - bp = find_raw_breakpoint_at (pc); - if (bp == NULL) - { - /* This can happen when we remove all breakpoints while handling - a step-over. */ - if (debug_threads) - fprintf (stderr, - "Could not find raw breakpoint at 0x%s " - "in list (reinserting).\n", - paddress (pc)); - return; - } - - reinsert_raw_breakpoint (bp); -} - -void -reinsert_all_breakpoints (void) -{ - struct process_info *proc = current_process (); - struct raw_breakpoint *bp; - - for (bp = proc->raw_breakpoints; bp != NULL; bp = bp->next) - if (!bp->inserted) - reinsert_raw_breakpoint (bp); -} - -void -check_breakpoints (CORE_ADDR stop_pc) -{ - struct process_info *proc = current_process (); - struct breakpoint *bp, **bp_link; - - bp = proc->breakpoints; - bp_link = &proc->breakpoints; - - while (bp) - { - if (bp->raw->pc == stop_pc) - { - if (!bp->raw->inserted) - { - warning ("Hit a removed breakpoint?"); - return; - } - - if (bp->handler != NULL && (*bp->handler) (stop_pc)) - { - *bp_link = bp->next; - - release_breakpoint (proc, bp); - - bp = *bp_link; - continue; - } - } - - bp_link = &bp->next; - bp = *bp_link; - } -} - -void -set_breakpoint_data (const unsigned char *bp_data, int bp_len) -{ - breakpoint_data = bp_data; - breakpoint_len = bp_len; -} - -int -breakpoint_here (CORE_ADDR addr) -{ - return (find_raw_breakpoint_at (addr) != NULL); -} - -int -breakpoint_inserted_here (CORE_ADDR addr) -{ - struct raw_breakpoint *bp; - - bp = find_raw_breakpoint_at (addr); - - return (bp != NULL && bp->inserted); -} - -static int -validate_inserted_breakpoint (struct raw_breakpoint *bp) -{ - unsigned char *buf; - int err; - - gdb_assert (bp->inserted); - - buf = alloca (breakpoint_len); - err = (*the_target->read_memory) (bp->pc, buf, breakpoint_len); - if (err || memcmp (buf, breakpoint_data, breakpoint_len) != 0) - { - /* Tag it as gone. */ - bp->inserted = 0; - bp->shlib_disabled = 1; - return 0; - } - - return 1; -} - -static void -delete_disabled_breakpoints (void) -{ - struct process_info *proc = current_process (); - struct breakpoint *bp, *next; - - for (bp = proc->breakpoints; bp != NULL; bp = next) - { - next = bp->next; - if (bp->raw->shlib_disabled) - delete_breakpoint_1 (proc, bp); - } -} - -/* Check if breakpoints we inserted still appear to be inserted. They - may disappear due to a shared library unload, and worse, a new - shared library may be reloaded at the same address as the - previously unloaded one. If that happens, we should make sure that - the shadow memory of the old breakpoints isn't used when reading or - writing memory. */ - -void -validate_breakpoints (void) -{ - struct process_info *proc = current_process (); - struct breakpoint *bp; - - for (bp = proc->breakpoints; bp != NULL; bp = bp->next) - { - if (bp->raw->inserted) - validate_inserted_breakpoint (bp->raw); - } - - delete_disabled_breakpoints (); -} - -void -check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len) -{ - struct process_info *proc = current_process (); - struct raw_breakpoint *bp = proc->raw_breakpoints; - struct fast_tracepoint_jump *jp = proc->fast_tracepoint_jumps; - CORE_ADDR mem_end = mem_addr + mem_len; - int disabled_one = 0; - - for (; jp != NULL; jp = jp->next) - { - CORE_ADDR bp_end = jp->pc + jp->length; - CORE_ADDR start, end; - int copy_offset, copy_len, buf_offset; - - if (mem_addr >= bp_end) - continue; - if (jp->pc >= mem_end) - continue; - - start = jp->pc; - if (mem_addr > start) - start = mem_addr; - - end = bp_end; - if (end > mem_end) - end = mem_end; - - copy_len = end - start; - copy_offset = start - jp->pc; - buf_offset = start - mem_addr; - - if (jp->inserted) - memcpy (buf + buf_offset, - fast_tracepoint_jump_shadow (jp) + copy_offset, - copy_len); - } - - for (; bp != NULL; bp = bp->next) - { - CORE_ADDR bp_end = bp->pc + breakpoint_len; - CORE_ADDR start, end; - int copy_offset, copy_len, buf_offset; - - if (mem_addr >= bp_end) - continue; - if (bp->pc >= mem_end) - continue; - - start = bp->pc; - if (mem_addr > start) - start = mem_addr; - - end = bp_end; - if (end > mem_end) - end = mem_end; - - copy_len = end - start; - copy_offset = start - bp->pc; - buf_offset = start - mem_addr; - - if (bp->inserted) - { - if (validate_inserted_breakpoint (bp)) - memcpy (buf + buf_offset, bp->old_data + copy_offset, copy_len); - else - disabled_one = 1; - } - } - - if (disabled_one) - delete_disabled_breakpoints (); -} - -void -check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len) -{ - struct process_info *proc = current_process (); - struct raw_breakpoint *bp = proc->raw_breakpoints; - struct fast_tracepoint_jump *jp = proc->fast_tracepoint_jumps; - CORE_ADDR mem_end = mem_addr + mem_len; - int disabled_one = 0; - - /* First fast tracepoint jumps, then breakpoint traps on top. */ - - for (; jp != NULL; jp = jp->next) - { - CORE_ADDR jp_end = jp->pc + jp->length; - CORE_ADDR start, end; - int copy_offset, copy_len, buf_offset; - - if (mem_addr >= jp_end) - continue; - if (jp->pc >= mem_end) - continue; - - start = jp->pc; - if (mem_addr > start) - start = mem_addr; - - end = jp_end; - if (end > mem_end) - end = mem_end; - - copy_len = end - start; - copy_offset = start - jp->pc; - buf_offset = start - mem_addr; - - memcpy (fast_tracepoint_jump_shadow (jp) + copy_offset, - buf + buf_offset, copy_len); - if (jp->inserted) - memcpy (buf + buf_offset, - fast_tracepoint_jump_insn (jp) + copy_offset, copy_len); - } - - for (; bp != NULL; bp = bp->next) - { - CORE_ADDR bp_end = bp->pc + breakpoint_len; - CORE_ADDR start, end; - int copy_offset, copy_len, buf_offset; - - if (mem_addr >= bp_end) - continue; - if (bp->pc >= mem_end) - continue; - - start = bp->pc; - if (mem_addr > start) - start = mem_addr; - - end = bp_end; - if (end > mem_end) - end = mem_end; - - copy_len = end - start; - copy_offset = start - bp->pc; - buf_offset = start - mem_addr; - - memcpy (bp->old_data + copy_offset, buf + buf_offset, copy_len); - if (bp->inserted) - { - if (validate_inserted_breakpoint (bp)) - memcpy (buf + buf_offset, breakpoint_data + copy_offset, copy_len); - else - disabled_one = 1; - } - } - - if (disabled_one) - delete_disabled_breakpoints (); -} - -/* Delete all breakpoints, and un-insert them from the inferior. */ - -void -delete_all_breakpoints (void) -{ - struct process_info *proc = current_process (); - - while (proc->breakpoints) - delete_breakpoint_1 (proc, proc->breakpoints); -} - -/* Clear the "inserted" flag in all breakpoints. */ - -void -mark_breakpoints_out (struct process_info *proc) -{ - struct raw_breakpoint *raw_bp; - - for (raw_bp = proc->raw_breakpoints; raw_bp != NULL; raw_bp = raw_bp->next) - raw_bp->inserted = 0; -} - -/* Release all breakpoints, but do not try to un-insert them from the - inferior. */ - -void -free_all_breakpoints (struct process_info *proc) -{ - mark_breakpoints_out (proc); - - /* Note: use PROC explicitly instead of deferring to - delete_all_breakpoints --- CURRENT_INFERIOR may already have been - released when we get here. There should be no call to - current_process from here on. */ - while (proc->breakpoints) - delete_breakpoint_1 (proc, proc->breakpoints); -} diff --git a/gdb/gdbserver/mem-break.h b/gdb/gdbserver/mem-break.h deleted file mode 100644 index 2f1dbeab7be..00000000000 --- a/gdb/gdbserver/mem-break.h +++ /dev/null @@ -1,157 +0,0 @@ -/* Memory breakpoint interfaces for the remote server for GDB. - Copyright (C) 2002, 2005, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - This file is part of GDB. - - This program is free software; you can 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/>. */ - -#ifndef MEM_BREAK_H -#define MEM_BREAK_H - -/* Breakpoints are opaque. */ -struct breakpoint; -struct fast_tracepoint_jump; - -/* Create a new GDB breakpoint at WHERE. Returns -1 if breakpoints - are not supported on this target, 0 otherwise. */ - -int set_gdb_breakpoint_at (CORE_ADDR where); - -/* Returns TRUE if there's any breakpoint at ADDR in our tables, - inserted, or not. */ - -int breakpoint_here (CORE_ADDR addr); - -/* Returns TRUE if there's any inserted breakpoint set at ADDR. */ - -int breakpoint_inserted_here (CORE_ADDR addr); - -/* Returns TRUE if there's a GDB breakpoint set at ADDR. */ - -int gdb_breakpoint_here (CORE_ADDR where); - -/* Create a new breakpoint at WHERE, and call HANDLER when - it is hit. HANDLER should return 1 if the breakpoint - should be deleted, 0 otherwise. */ - -struct breakpoint *set_breakpoint_at (CORE_ADDR where, - int (*handler) (CORE_ADDR)); - -/* Delete a GDB breakpoint previously inserted at ADDR with - set_gdb_breakpoint_at. */ - -int delete_gdb_breakpoint_at (CORE_ADDR addr); - -/* Delete a breakpoint. */ - -int delete_breakpoint (struct breakpoint *bkpt); - -/* Set a reinsert breakpoint at STOP_AT. */ - -void set_reinsert_breakpoint (CORE_ADDR stop_at); - -/* Delete all reinsert breakpoints. */ - -void delete_reinsert_breakpoints (void); - -/* Reinsert breakpoints at WHERE (and change their status to - inserted). */ - -void reinsert_breakpoints_at (CORE_ADDR where); - -/* Uninsert breakpoints at WHERE (and change their status to - uninserted). This still leaves the breakpoints in the table. */ - -void uninsert_breakpoints_at (CORE_ADDR where); - -/* Reinsert all breakpoints of the current process (and change their - status to inserted). */ - -void reinsert_all_breakpoints (void); - -/* Uninsert all breakpoints of the current process (and change their - status to uninserted). This still leaves the breakpoints in the - table. */ - -void uninsert_all_breakpoints (void); - -/* See if any breakpoint claims ownership of STOP_PC. Call the handler for - the breakpoint, if found. */ - -void check_breakpoints (CORE_ADDR stop_pc); - -/* See if any breakpoints shadow the target memory area from MEM_ADDR - to MEM_ADDR + MEM_LEN. Update the data already read from the target - (in BUF) if necessary. */ - -void check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len); - -/* See if any breakpoints shadow the target memory area from MEM_ADDR - to MEM_ADDR + MEM_LEN. Update the data to be written to the target - (in BUF) if necessary, as well as the original data for any breakpoints. */ - -void check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len); - -/* Set the byte pattern to insert for memory breakpoints. This function - must be called before any breakpoints are set. */ - -void set_breakpoint_data (const unsigned char *bp_data, int bp_len); - -/* Delete all breakpoints. */ - -void delete_all_breakpoints (void); - -/* Clear the "inserted" flag in all breakpoints of PROC. */ - -void mark_breakpoints_out (struct process_info *proc); - -/* Delete all breakpoints, but do not try to un-insert them from the - inferior. */ - -void free_all_breakpoints (struct process_info *proc); - -/* Check if breakpoints still seem to be inserted in the inferior. */ - -void validate_breakpoints (void); - -/* Insert a fast tracepoint jump at WHERE, using instruction INSN, of - LENGTH bytes. */ - -struct fast_tracepoint_jump *set_fast_tracepoint_jump (CORE_ADDR where, - unsigned char *insn, - ULONGEST length); - -/* Delete fast tracepoint jump TODEL from our tables, and uninsert if - from memory. */ - -int delete_fast_tracepoint_jump (struct fast_tracepoint_jump *todel); - -/* Returns true if there's fast tracepoint jump set at WHERE. */ - -int fast_tracepoint_jump_here (CORE_ADDR); - -/* Uninsert fast tracepoint jumps at WHERE (and change their status to - uninserted). This still leaves the tracepoints in the table. */ - -void uninsert_fast_tracepoint_jumps_at (CORE_ADDR pc); - -/* Reinsert fast tracepoint jumps at WHERE (and change their status to - inserted). */ - -void reinsert_fast_tracepoint_jumps_at (CORE_ADDR where); - -#endif /* MEM_BREAK_H */ diff --git a/gdb/gdbserver/nto-low.c b/gdb/gdbserver/nto-low.c deleted file mode 100644 index 47d7a93c5b2..00000000000 --- a/gdb/gdbserver/nto-low.c +++ /dev/null @@ -1,959 +0,0 @@ -/* QNX Neutrino specific low level interface, for the remote server - for GDB. - Copyright (C) 2009, 2010, 2011 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 "nto-low.h" - -#include <limits.h> -#include <fcntl.h> -#include <spawn.h> -#include <sys/procfs.h> -#include <sys/auxv.h> -#include <stdarg.h> -#include <sys/iomgr.h> -#include <sys/neutrino.h> - - -extern int using_threads; -int using_threads = 1; - -static void -nto_trace (const char *fmt, ...) -{ - va_list arg_list; - - if (debug_threads == 0) - return; - fprintf (stderr, "nto:"); - va_start (arg_list, fmt); - vfprintf (stderr, fmt, arg_list); - va_end (arg_list); -} - -#define TRACE nto_trace - -/* Structure holding neutrino specific information about - inferior. */ - -struct nto_inferior -{ - char nto_procfs_path[PATH_MAX]; - int ctl_fd; - pid_t pid; - int exit_signo; /* For tracking exit status. */ -}; - -static struct nto_inferior nto_inferior; - -static void -init_nto_inferior (struct nto_inferior *nto_inferior) -{ - memset (nto_inferior, 0, sizeof (struct nto_inferior)); - nto_inferior->ctl_fd = -1; - nto_inferior->pid = -1; -} - -static void -do_detach (void) -{ - if (nto_inferior.ctl_fd != -1) - { - nto_trace ("Closing fd\n"); - close (nto_inferior.ctl_fd); - init_nto_inferior (&nto_inferior); - } -} - -/* Set current thread. Return 1 on success, 0 otherwise. */ - -static int -nto_set_thread (ptid_t ptid) -{ - int res = 0; - - TRACE ("%s pid: %d tid: %ld\n", __func__, ptid_get_pid (ptid), - ptid_get_lwp (ptid)); - if (nto_inferior.ctl_fd != -1 - && !ptid_equal (ptid, null_ptid) - && !ptid_equal (ptid, minus_one_ptid)) - { - pthread_t tid = ptid_get_lwp (ptid); - - if (EOK == devctl (nto_inferior.ctl_fd, DCMD_PROC_CURTHREAD, &tid, - sizeof (tid), 0)) - res = 1; - else - TRACE ("%s: Error: failed to set current thread\n", __func__); - } - return res; -} - -/* This function will determine all alive threads. Note that we do not list - dead but unjoined threads even though they are still in the process' thread - list. - - NTO_INFERIOR must not be NULL. */ - -static void -nto_find_new_threads (struct nto_inferior *nto_inferior) -{ - pthread_t tid; - - TRACE ("%s pid:%d\n", __func__, nto_inferior->pid); - - if (nto_inferior->ctl_fd == -1) - return; - - for (tid = 1;; ++tid) - { - procfs_status status; - ptid_t ptid; - int err; - - status.tid = tid; - err = devctl (nto_inferior->ctl_fd, DCMD_PROC_TIDSTATUS, &status, - sizeof (status), 0); - - if (err != EOK || status.tid == 0) - break; - - /* All threads in between are gone. */ - while (tid != status.tid || status.state == STATE_DEAD) - { - struct thread_info *ti; - - ptid = ptid_build (nto_inferior->pid, tid, 0); - ti = find_thread_ptid (ptid); - if (ti != NULL) - { - TRACE ("Removing thread %d\n", tid); - remove_thread (ti); - } - if (tid == status.tid) - break; - ++tid; - } - - if (status.state != STATE_DEAD) - { - TRACE ("Adding thread %d\n", tid); - ptid = ptid_build (nto_inferior->pid, tid, 0); - if (!find_thread_ptid (ptid)) - add_thread (ptid, NULL); - } - } -} - -/* Given pid, open procfs path. */ - -static pid_t -do_attach (pid_t pid) -{ - procfs_status status; - struct sigevent event; - - if (nto_inferior.ctl_fd != -1) - { - close (nto_inferior.ctl_fd); - init_nto_inferior (&nto_inferior); - } - xsnprintf (nto_inferior.nto_procfs_path, PATH_MAX - 1, "/proc/%d/as", pid); - nto_inferior.ctl_fd = open (nto_inferior.nto_procfs_path, O_RDWR); - if (nto_inferior.ctl_fd == -1) - { - TRACE ("Failed to open %s\n", nto_inferior.nto_procfs_path); - init_nto_inferior (&nto_inferior); - return -1; - } - if (devctl (nto_inferior.ctl_fd, DCMD_PROC_STOP, &status, sizeof (status), 0) - != EOK) - { - do_detach (); - return -1; - } - nto_inferior.pid = pid; - /* Define a sigevent for process stopped notification. */ - event.sigev_notify = SIGEV_SIGNAL_THREAD; - event.sigev_signo = SIGUSR1; - event.sigev_code = 0; - event.sigev_value.sival_ptr = NULL; - event.sigev_priority = -1; - devctl (nto_inferior.ctl_fd, DCMD_PROC_EVENT, &event, sizeof (event), 0); - - if (devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status), - 0) == EOK - && (status.flags & _DEBUG_FLAG_STOPPED)) - { - ptid_t ptid; - - kill (pid, SIGCONT); - ptid = ptid_build (status.pid, status.tid, 0); - the_low_target.arch_setup (); - add_process (status.pid, 1); - TRACE ("Adding thread: pid=%d tid=%ld\n", status.pid, - ptid_get_lwp (ptid)); - nto_find_new_threads (&nto_inferior); - } - else - { - do_detach (); - return -1; - } - - return pid; -} - -/* Read or write LEN bytes from/to inferior's MEMADDR memory address - into gdbservers's MYADDR buffer. Return number of bytes actually - transfered. */ - -static int -nto_xfer_memory (off_t memaddr, unsigned char *myaddr, int len, - int dowrite) -{ - int nbytes = 0; - - if (lseek (nto_inferior.ctl_fd, memaddr, SEEK_SET) == memaddr) - { - if (dowrite) - nbytes = write (nto_inferior.ctl_fd, myaddr, len); - else - nbytes = read (nto_inferior.ctl_fd, myaddr, len); - if (nbytes < 0) - nbytes = 0; - } - if (nbytes == 0) - { - int e = errno; - TRACE ("Error in %s : errno=%d (%s)\n", __func__, e, strerror (e)); - } - return nbytes; -} - -/* Insert or remove breakpoint or watchpoint at address ADDR. - TYPE can be one of Neutrino breakpoint types. SIZE must be 0 for - inserting the point, -1 for removing it. - - Return 0 on success, 1 otherwise. */ - -static int -nto_breakpoint (CORE_ADDR addr, int type, int size) -{ - procfs_break brk; - - brk.type = type; - brk.addr = addr; - brk.size = size; - if (devctl (nto_inferior.ctl_fd, DCMD_PROC_BREAK, &brk, sizeof (brk), 0) - != EOK) - return 1; - return 0; -} - -/* Read auxiliary vector from inferior's initial stack into gdbserver's - MYADDR buffer, up to LEN bytes. - - Return number of bytes read. */ - -static int -nto_read_auxv_from_initial_stack (CORE_ADDR initial_stack, - unsigned char *myaddr, - unsigned int len) -{ - int data_ofs = 0; - int anint; - unsigned int len_read = 0; - - /* Skip over argc, argv and envp... Comment from ldd.c: - - The startup frame is set-up so that we have: - auxv - NULL - ... - envp2 - envp1 <----- void *frame + (argc + 2) * sizeof(char *) - NULL - ... - argv2 - argv1 - argc <------ void * frame - - On entry to ldd, frame gives the address of argc on the stack. */ - if (nto_xfer_memory (initial_stack, (unsigned char *)&anint, - sizeof (anint), 0) != sizeof (anint)) - return 0; - - /* Size of pointer is assumed to be 4 bytes (32 bit arch. ) */ - data_ofs += (anint + 2) * sizeof (void *); /* + 2 comes from argc itself and - NULL terminating pointer in - argv. */ - - /* Now loop over env table: */ - while (nto_xfer_memory (initial_stack + data_ofs, - (unsigned char *)&anint, sizeof (anint), 0) - == sizeof (anint)) - { - data_ofs += sizeof (anint); - if (anint == 0) - break; - } - initial_stack += data_ofs; - - memset (myaddr, 0, len); - while (len_read <= len - sizeof (auxv_t)) - { - auxv_t *auxv = (auxv_t *)myaddr; - - /* Search backwards until we have read AT_PHDR (num. 3), - AT_PHENT (num 4), AT_PHNUM (num 5) */ - if (nto_xfer_memory (initial_stack, (unsigned char *)auxv, - sizeof (auxv_t), 0) == sizeof (auxv_t)) - { - if (auxv->a_type != AT_NULL) - { - auxv++; - len_read += sizeof (auxv_t); - } - if (auxv->a_type == AT_PHNUM) /* That's all we need. */ - break; - initial_stack += sizeof (auxv_t); - } - else - break; - } - TRACE ("auxv: len_read: %d\n", len_read); - return len_read; -} - -/* Start inferior specified by PROGRAM passing arguments ALLARGS. */ - -static int -nto_create_inferior (char *program, char **allargs) -{ - struct inheritance inherit; - pid_t pid; - sigset_t set; - - TRACE ("%s %s\n", __func__, program); - /* Clear any pending SIGUSR1's but keep the behavior the same. */ - signal (SIGUSR1, signal (SIGUSR1, SIG_IGN)); - - sigemptyset (&set); - sigaddset (&set, SIGUSR1); - sigprocmask (SIG_UNBLOCK, &set, NULL); - - memset (&inherit, 0, sizeof (inherit)); - inherit.flags |= SPAWN_SETGROUP | SPAWN_HOLD; - inherit.pgroup = SPAWN_NEWPGROUP; - pid = spawnp (program, 0, NULL, &inherit, allargs, 0); - sigprocmask (SIG_BLOCK, &set, NULL); - - if (pid == -1) - return -1; - - if (do_attach (pid) != pid) - return -1; - - return pid; -} - -/* Attach to process PID. */ - -static int -nto_attach (unsigned long pid) -{ - TRACE ("%s %ld\n", __func__, pid); - if (do_attach (pid) != pid) - error ("Unable to attach to %ld\n", pid); - return 0; -} - -/* Send signal to process PID. */ - -static int -nto_kill (int pid) -{ - TRACE ("%s %d\n", __func__, pid); - kill (pid, SIGKILL); - do_detach (); - return 0; -} - -/* Detach from process PID. */ - -static int -nto_detach (int pid) -{ - TRACE ("%s %d\n", __func__, pid); - do_detach (); - return 0; -} - -static void -nto_mourn (struct process_info *process) -{ - remove_process (process); -} - -/* Check if the given thread is alive. - - Return 1 if alive, 0 otherwise. */ - -static int -nto_thread_alive (ptid_t ptid) -{ - int res; - - TRACE ("%s pid:%d tid:%d\n", __func__, ptid_get_pid (ptid), - ptid_get_lwp (ptid)); - if (SignalKill (0, ptid_get_pid (ptid), ptid_get_lwp (ptid), - 0, 0, 0) == -1) - res = 0; - else - res = 1; - TRACE ("%s: %s\n", __func__, res ? "yes" : "no"); - return res; -} - -/* Resume inferior's execution. */ - -static void -nto_resume (struct thread_resume *resume_info, size_t n) -{ - /* We can only work in all-stop mode. */ - procfs_status status; - procfs_run run; - int err; - - TRACE ("%s\n", __func__); - /* Workaround for aliasing rules violation. */ - sigset_t *run_fault = (sigset_t *) (void *) &run.fault; - - nto_set_thread (resume_info->thread); - - run.flags = _DEBUG_RUN_FAULT | _DEBUG_RUN_TRACE; - if (resume_info->kind == resume_step) - run.flags |= _DEBUG_RUN_STEP; - run.flags |= _DEBUG_RUN_ARM; - - sigemptyset (run_fault); - sigaddset (run_fault, FLTBPT); - sigaddset (run_fault, FLTTRACE); - sigaddset (run_fault, FLTILL); - sigaddset (run_fault, FLTPRIV); - sigaddset (run_fault, FLTBOUNDS); - sigaddset (run_fault, FLTIOVF); - sigaddset (run_fault, FLTIZDIV); - sigaddset (run_fault, FLTFPE); - sigaddset (run_fault, FLTPAGE); - sigaddset (run_fault, FLTSTACK); - sigaddset (run_fault, FLTACCESS); - - sigemptyset (&run.trace); - if (resume_info->sig) - { - int signal_to_pass; - - devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status), - 0); - signal_to_pass = resume_info->sig; - if (status.why & (_DEBUG_WHY_SIGNALLED | _DEBUG_WHY_FAULTED)) - { - if (signal_to_pass != status.info.si_signo) - { - kill (status.pid, signal_to_pass); - run.flags |= _DEBUG_RUN_CLRFLT | _DEBUG_RUN_CLRSIG; - } - else /* Let it kill the program without telling us. */ - sigdelset (&run.trace, signal_to_pass); - } - } - else - run.flags |= _DEBUG_RUN_CLRSIG | _DEBUG_RUN_CLRFLT; - - sigfillset (&run.trace); - - regcache_invalidate (); - - err = devctl (nto_inferior.ctl_fd, DCMD_PROC_RUN, &run, sizeof (run), 0); - if (err != EOK) - TRACE ("Error: %d \"%s\"\n", err, strerror (err)); -} - -/* Wait for inferior's event. - - Return ptid of thread that caused the event. */ - -static ptid_t -nto_wait (ptid_t ptid, - struct target_waitstatus *ourstatus, int target_options) -{ - sigset_t set; - siginfo_t info; - procfs_status status; - const int trace_mask = (_DEBUG_FLAG_TRACE_EXEC | _DEBUG_FLAG_TRACE_RD - | _DEBUG_FLAG_TRACE_WR | _DEBUG_FLAG_TRACE_MODIFY); - - TRACE ("%s\n", __func__); - - ourstatus->kind = TARGET_WAITKIND_SPURIOUS; - - sigemptyset (&set); - sigaddset (&set, SIGUSR1); - - devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status), 0); - while (!(status.flags & _DEBUG_FLAG_ISTOP)) - { - sigwaitinfo (&set, &info); - devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status), - 0); - } - nto_find_new_threads (&nto_inferior); - - if (status.flags & _DEBUG_FLAG_SSTEP) - { - TRACE ("SSTEP\n"); - ourstatus->kind = TARGET_WAITKIND_STOPPED; - ourstatus->value.sig = TARGET_SIGNAL_TRAP; - } - /* Was it a breakpoint? */ - else if (status.flags & trace_mask) - { - TRACE ("STOPPED\n"); - ourstatus->kind = TARGET_WAITKIND_STOPPED; - ourstatus->value.sig = TARGET_SIGNAL_TRAP; - } - else if (status.flags & _DEBUG_FLAG_ISTOP) - { - TRACE ("ISTOP\n"); - switch (status.why) - { - case _DEBUG_WHY_SIGNALLED: - TRACE (" SIGNALLED\n"); - ourstatus->kind = TARGET_WAITKIND_STOPPED; - ourstatus->value.sig = - target_signal_from_host (status.info.si_signo); - nto_inferior.exit_signo = ourstatus->value.sig; - break; - case _DEBUG_WHY_FAULTED: - TRACE (" FAULTED\n"); - ourstatus->kind = TARGET_WAITKIND_STOPPED; - if (status.info.si_signo == SIGTRAP) - { - ourstatus->value.sig = 0; - nto_inferior.exit_signo = 0; - } - else - { - ourstatus->value.sig = - target_signal_from_host (status.info.si_signo); - nto_inferior.exit_signo = ourstatus->value.sig; - } - break; - - case _DEBUG_WHY_TERMINATED: - { - int waitval = 0; - - TRACE (" TERMINATED\n"); - waitpid (ptid_get_pid (ptid), &waitval, WNOHANG); - if (nto_inferior.exit_signo) - { - /* Abnormal death. */ - ourstatus->kind = TARGET_WAITKIND_SIGNALLED; - ourstatus->value.sig = nto_inferior.exit_signo; - } - else - { - /* Normal death. */ - ourstatus->kind = TARGET_WAITKIND_EXITED; - ourstatus->value.integer = WEXITSTATUS (waitval); - } - nto_inferior.exit_signo = 0; - break; - } - - case _DEBUG_WHY_REQUESTED: - TRACE ("REQUESTED\n"); - /* We are assuming a requested stop is due to a SIGINT. */ - ourstatus->kind = TARGET_WAITKIND_STOPPED; - ourstatus->value.sig = TARGET_SIGNAL_INT; - nto_inferior.exit_signo = 0; - break; - } - } - - return ptid_build (status.pid, status.tid, 0); -} - -/* Fetch inferior's registers for currently selected thread (CURRENT_INFERIOR). - If REGNO is -1, fetch all registers, or REGNO register only otherwise. */ - -static void -nto_fetch_registers (struct regcache *regcache, int regno) -{ - int regsize; - procfs_greg greg; - ptid_t ptid; - - TRACE ("%s (regno=%d)\n", __func__, regno); - if (regno >= the_low_target.num_regs) - return; - - if (current_inferior == NULL) - { - TRACE ("current_inferior is NULL\n"); - return; - } - ptid = thread_to_gdb_id (current_inferior); - if (!nto_set_thread (ptid)) - return; - - if (devctl (nto_inferior.ctl_fd, DCMD_PROC_GETGREG, &greg, sizeof (greg), - ®size) == EOK) - { - if (regno == -1) /* All registers. */ - { - for (regno = 0; regno != the_low_target.num_regs; ++regno) - { - const unsigned int registeroffset - = the_low_target.register_offset (regno); - supply_register (regcache, regno, - ((char *)&greg) + registeroffset); - } - } - else - { - const unsigned int registeroffset - = the_low_target.register_offset (regno); - if (registeroffset == -1) - return; - supply_register (regcache, regno, ((char *)&greg) + registeroffset); - } - } - else - TRACE ("ERROR reading registers from inferior.\n"); -} - -/* Store registers for currently selected thread (CURRENT_INFERIOR). - We always store all registers, regardless of REGNO. */ - -static void -nto_store_registers (struct regcache *regcache, int regno) -{ - procfs_greg greg; - int err; - ptid_t ptid; - - TRACE ("%s (regno:%d)\n", __func__, regno); - - if (current_inferior == NULL) - { - TRACE ("current_inferior is NULL\n"); - return; - } - ptid = thread_to_gdb_id (current_inferior); - if (!nto_set_thread (ptid)) - return; - - memset (&greg, 0, sizeof (greg)); - for (regno = 0; regno != the_low_target.num_regs; ++regno) - { - const unsigned int regoffset - = the_low_target.register_offset (regno); - collect_register (regcache, regno, ((char *)&greg) + regoffset); - } - err = devctl (nto_inferior.ctl_fd, DCMD_PROC_SETGREG, &greg, sizeof (greg), - 0); - if (err != EOK) - TRACE ("Error: setting registers.\n"); -} - -/* Read LEN bytes from inferior's memory address MEMADDR into - gdbserver's MYADDR buffer. - - Return 0 on success -1 otherwise. */ - -static int -nto_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - TRACE ("%s memaddr:0x%08lx, len:%d\n", __func__, memaddr, len); - - if (nto_xfer_memory (memaddr, myaddr, len, 0) != len) - { - TRACE ("Failed to read memory\n"); - return -1; - } - - return 0; -} - -/* Write LEN bytes from gdbserver's buffer MYADDR into inferior's - memory at address MEMADDR. - - Return 0 on success -1 otherwise. */ - -static int -nto_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len) -{ - int len_written; - - TRACE ("%s memaddr: 0x%08llx len: %d\n", __func__, memaddr, len); - if ((len_written = nto_xfer_memory (memaddr, (unsigned char *)myaddr, len, - 1)) - != len) - { - TRACE ("Wanted to write: %d but written: %d\n", len, len_written); - return -1; - } - - return 0; -} - -/* Stop inferior. We always stop all threads. */ - -static void -nto_request_interrupt (void) -{ - TRACE ("%s\n", __func__); - nto_set_thread (ptid_build (nto_inferior.pid, 1, 0)); - if (EOK != devctl (nto_inferior.ctl_fd, DCMD_PROC_STOP, NULL, 0, 0)) - TRACE ("Error stopping inferior.\n"); -} - -/* Read auxiliary vector from inferior's memory into gdbserver's buffer - MYADDR. We always read whole auxv. - - Return number of bytes stored in MYADDR buffer, 0 if OFFSET > 0 - or -1 on error. */ - -static int -nto_read_auxv (CORE_ADDR offset, unsigned char *myaddr, unsigned int len) -{ - int err; - CORE_ADDR initial_stack; - procfs_info procinfo; - - TRACE ("%s\n", __func__); - if (offset > 0) - return 0; - - err = devctl (nto_inferior.ctl_fd, DCMD_PROC_INFO, &procinfo, - sizeof procinfo, 0); - if (err != EOK) - return -1; - - initial_stack = procinfo.initial_stack; - - return nto_read_auxv_from_initial_stack (initial_stack, myaddr, len); -} - -/* Insert {break/watch}point at address ADDR. - TYPE must be in '0'..'4' range. LEN is not used. */ - -static int -nto_insert_point (char type, CORE_ADDR addr, int len) -{ - int wtype = _DEBUG_BREAK_HW; /* Always request HW. */ - - TRACE ("%s type:%c addr: 0x%08lx len:%d\n", __func__, (int)type, addr, len); - switch (type) - { - case '0': /* software-breakpoint */ - wtype = _DEBUG_BREAK_EXEC; - break; - case '1': /* hardware-breakpoint */ - wtype |= _DEBUG_BREAK_EXEC; - break; - case '2': /* write watchpoint */ - wtype |= _DEBUG_BREAK_RW; - break; - case '3': /* read watchpoint */ - wtype |= _DEBUG_BREAK_RD; - break; - case '4': /* access watchpoint */ - wtype |= _DEBUG_BREAK_RW; - break; - default: - return 1; /* Not supported. */ - } - return nto_breakpoint (addr, wtype, 0); -} - -/* Remove {break/watch}point at address ADDR. - TYPE must be in '0'..'4' range. LEN is not used. */ - -static int -nto_remove_point (char type, CORE_ADDR addr, int len) -{ - int wtype = _DEBUG_BREAK_HW; /* Always request HW. */ - - TRACE ("%s type:%c addr: 0x%08lx len:%d\n", __func__, (int)type, addr, len); - switch (type) - { - case '0': /* software-breakpoint */ - wtype = _DEBUG_BREAK_EXEC; - break; - case '1': /* hardware-breakpoint */ - wtype |= _DEBUG_BREAK_EXEC; - break; - case '2': /* write watchpoint */ - wtype |= _DEBUG_BREAK_RW; - break; - case '3': /* read watchpoint */ - wtype |= _DEBUG_BREAK_RD; - break; - case '4': /* access watchpoint */ - wtype |= _DEBUG_BREAK_RW; - break; - default: - return 1; /* Not supported. */ - } - return nto_breakpoint (addr, wtype, -1); -} - -/* Check if the reason of stop for current thread (CURRENT_INFERIOR) is - a watchpoint. - - Return 1 if stopped by watchpoint, 0 otherwise. */ - -static int -nto_stopped_by_watchpoint (void) -{ - int ret = 0; - - TRACE ("%s\n", __func__); - if (nto_inferior.ctl_fd != -1 && current_inferior != NULL) - { - ptid_t ptid; - - ptid = thread_to_gdb_id (current_inferior); - if (nto_set_thread (ptid)) - { - const int watchmask = _DEBUG_FLAG_TRACE_RD | _DEBUG_FLAG_TRACE_WR - | _DEBUG_FLAG_TRACE_MODIFY; - procfs_status status; - int err; - - err = devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status, - sizeof (status), 0); - if (err == EOK && (status.flags & watchmask)) - ret = 1; - } - } - TRACE ("%s: %s\n", __func__, ret ? "yes" : "no"); - return ret; -} - -/* Get instruction pointer for CURRENT_INFERIOR thread. - - Return inferior's instruction pointer value, or 0 on error. */ - -static CORE_ADDR -nto_stopped_data_address (void) -{ - CORE_ADDR ret = (CORE_ADDR)0; - - TRACE ("%s\n", __func__); - if (nto_inferior.ctl_fd != -1 && current_inferior != NULL) - { - ptid_t ptid; - - ptid = thread_to_gdb_id (current_inferior); - - if (nto_set_thread (ptid)) - { - procfs_status status; - - if (devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status, - sizeof (status), 0) == EOK) - ret = status.ip; - } - } - TRACE ("%s: 0x%08lx\n", __func__, ret); - return ret; -} - -/* We do not currently support non-stop. */ - -static int -nto_supports_non_stop (void) -{ - TRACE ("%s\n", __func__); - return 0; -} - - - -static struct target_ops nto_target_ops = { - nto_create_inferior, - nto_attach, - nto_kill, - nto_detach, - nto_mourn, - NULL, /* nto_join */ - nto_thread_alive, - nto_resume, - nto_wait, - nto_fetch_registers, - nto_store_registers, - NULL, /* prepare_to_access_memory */ - NULL, /* done_accessing_memory */ - nto_read_memory, - nto_write_memory, - NULL, /* nto_look_up_symbols */ - nto_request_interrupt, - nto_read_auxv, - nto_insert_point, - nto_remove_point, - nto_stopped_by_watchpoint, - nto_stopped_data_address, - NULL, /* nto_read_offsets */ - NULL, /* thread_db_set_tls_address */ - NULL, - hostio_last_error_from_errno, - NULL, /* nto_qxfer_osdata */ - NULL, /* xfer_siginfo */ - nto_supports_non_stop, - NULL, /* async */ - NULL /* start_non_stop */ -}; - - -/* Global function called by server.c. Initializes QNX Neutrino - gdbserver. */ - -void -initialize_low (void) -{ - sigset_t set; - - TRACE ("%s\n", __func__); - set_target_ops (&nto_target_ops); - set_breakpoint_data (the_low_target.breakpoint, - the_low_target.breakpoint_len); - - /* We use SIGUSR1 to gain control after we block waiting for a process. - We use sigwaitevent to wait. */ - sigemptyset (&set); - sigaddset (&set, SIGUSR1); - sigprocmask (SIG_BLOCK, &set, NULL); -} - diff --git a/gdb/gdbserver/nto-low.h b/gdb/gdbserver/nto-low.h deleted file mode 100644 index e72cdbf90e1..00000000000 --- a/gdb/gdbserver/nto-low.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Internal interfaces for the QNX Neutrino specific target code for gdbserver. - Copyright (C) 2009, 2010, 2011 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/>. */ - -#ifndef NTO_LOW_H -#define NTO_LOW_H - -enum regset_type -{ - NTO_REG_GENERAL, - NTO_REG_FLOAT, - NTO_REG_SYSTEM, - NTO_REG_ALT, - NTO_REG_END -}; - -struct nto_target_ops -{ - /* Architecture specific setup. */ - void (*arch_setup) (void); - int num_regs; - int (*register_offset) (int gdbregno); - const unsigned char *breakpoint; - int breakpoint_len; -}; - -extern struct nto_target_ops the_low_target; - -#endif - diff --git a/gdb/gdbserver/nto-x86-low.c b/gdb/gdbserver/nto-x86-low.c deleted file mode 100644 index 20e71b60ce3..00000000000 --- a/gdb/gdbserver/nto-x86-low.c +++ /dev/null @@ -1,106 +0,0 @@ -/* QNX Neutrino specific low level interface, for the remote server - for GDB. - Copyright (C) 2009, 2010, 2011 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 "nto-low.h" -#include "regdef.h" -#include "regcache.h" - -#include <x86/context.h> - - -/* Definition auto generated from reg-i386.dep. */ -extern void init_registers_i386 (); -extern struct reg *regs_i386; - -const unsigned char x86_breakpoint[] = { 0xCC }; -#define x86_breakpoint_len 1 - -/* Returns offset in appropriate Neutrino's context structure. - Defined in x86/context.h. - GDBREGNO is index into regs_i386 array. It is autogenerated and - hopefully doesn't change. */ -static int -nto_x86_register_offset (int gdbregno) -{ - if (gdbregno >= 0 && gdbregno < 16) - { - X86_CPU_REGISTERS *dummy = (void*)0; - /* GPRs */ - switch (gdbregno) - { - case 0: - return (int)&(dummy->eax); - case 1: - return (int)&(dummy->ecx); - case 2: - return (int)&(dummy->edx); - case 3: - return (int)&(dummy->ebx); - case 4: - return (int)&(dummy->esp); - case 5: - return (int)&(dummy->ebp); - case 6: - return (int)&(dummy->esi); - case 7: - return (int)&(dummy->edi); - case 8: - return (int)&(dummy->eip); - case 9: - return (int)&(dummy->efl); - case 10: - return (int)&(dummy->cs); - case 11: - return (int)&(dummy->ss); -#ifdef __SEGMENTS__ - case 12: - return (int)&(dummy->ds); - case 13: - return (int)&(dummy->es); - case 14: - return (int)&(dummy->fs); - case 15: - return (int)&(dummy->gs); -#endif - default: - return -1; - } - } - return -1; -} - -static void -nto_x86_arch_setup (void) -{ - init_registers_i386 (); - the_low_target.num_regs = 16; -} - -struct nto_target_ops the_low_target = -{ - nto_x86_arch_setup, - 0, /* num_regs */ - nto_x86_register_offset, - x86_breakpoint, - x86_breakpoint_len -}; - - - diff --git a/gdb/gdbserver/proc-service.c b/gdb/gdbserver/proc-service.c deleted file mode 100644 index 2c75c81af53..00000000000 --- a/gdb/gdbserver/proc-service.c +++ /dev/null @@ -1,160 +0,0 @@ -/* libthread_db helper functions for the remote server for GDB. - Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - This file is part of GDB. - - This program is free software; you can 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" - -/* This file is currently tied to GNU/Linux. It should scale well to - another libthread_db implementation, with the approriate gdbserver - hooks, but for now this means we can use GNU/Linux's target data. */ - -#include "linux-low.h" - -#include "gdb_proc_service.h" - -typedef struct ps_prochandle *gdb_ps_prochandle_t; -typedef void *gdb_ps_read_buf_t; -typedef const void *gdb_ps_write_buf_t; -typedef size_t gdb_ps_size_t; - -#ifdef HAVE_LINUX_REGSETS -#define HAVE_REGSETS -#endif - -#ifdef HAVE_REGSETS -static struct regset_info * -gregset_info(void) -{ - int i = 0; - - while (target_regsets[i].size != -1) - { - if (target_regsets[i].type == GENERAL_REGS) - break; - i++; - } - - return &target_regsets[i]; -} -#endif - -/* Search for the symbol named NAME within the object named OBJ within - the target process PH. If the symbol is found the address of the - symbol is stored in SYM_ADDR. */ - -ps_err_e -ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj, - const char *name, psaddr_t *sym_addr) -{ - CORE_ADDR addr; - - if (thread_db_look_up_one_symbol (name, &addr) == 0) - return PS_NOSYM; - - *sym_addr = (psaddr_t) (unsigned long) addr; - return PS_OK; -} - -/* Read SIZE bytes from the target process PH at address ADDR and copy - them into BUF. */ - -ps_err_e -ps_pdread (gdb_ps_prochandle_t ph, psaddr_t addr, - gdb_ps_read_buf_t buf, gdb_ps_size_t size) -{ - read_inferior_memory ((unsigned long) addr, buf, size); - return PS_OK; -} - -/* Write SIZE bytes from BUF into the target process PH at address ADDR. */ - -ps_err_e -ps_pdwrite (gdb_ps_prochandle_t ph, psaddr_t addr, - gdb_ps_write_buf_t buf, gdb_ps_size_t size) -{ - return write_inferior_memory ((unsigned long) addr, buf, size); -} - -/* Get the general registers of LWP LWPID within the target process PH - and store them in GREGSET. */ - -ps_err_e -ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset) -{ -#ifdef HAVE_REGSETS - struct lwp_info *lwp; - struct thread_info *reg_inferior, *save_inferior; - struct regcache *regcache; - - lwp = find_lwp_pid (pid_to_ptid (lwpid)); - if (lwp == NULL) - return PS_ERR; - - reg_inferior = get_lwp_thread (lwp); - save_inferior = current_inferior; - current_inferior = reg_inferior; - regcache = get_thread_regcache (current_inferior, 1); - gregset_info ()->fill_function (regcache, gregset); - - current_inferior = save_inferior; - return PS_OK; -#else - return PS_ERR; -#endif -} - -/* Set the general registers of LWP LWPID within the target process PH - from GREGSET. */ - -ps_err_e -ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset) -{ - /* Unneeded. */ - return PS_ERR; -} - -/* Get the floating-point registers of LWP LWPID within the target - process PH and store them in FPREGSET. */ - -ps_err_e -ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, void *fpregset) -{ - /* Unneeded. */ - return PS_ERR; -} - -/* Set the floating-point registers of LWP LWPID within the target - process PH from FPREGSET. */ - -ps_err_e -ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, void *fpregset) -{ - /* Unneeded. */ - return PS_ERR; -} - -/* Return overall process id of the target PH. Special for GNU/Linux - -- not used on Solaris. */ - -pid_t -ps_getpid (gdb_ps_prochandle_t ph) -{ - return pid_of (get_thread_lwp (current_inferior)); -} diff --git a/gdb/gdbserver/proc-service.list b/gdb/gdbserver/proc-service.list deleted file mode 100644 index 6139ee02741..00000000000 --- a/gdb/gdbserver/proc-service.list +++ /dev/null @@ -1,30 +0,0 @@ -/* -Wl,--dynamic-list symbols exported for libthread_db. - - Copyright (C) 2010, 2011 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/>. */ - -{ - ps_get_thread_area; - ps_getpid; - ps_lgetfpregs; - ps_lgetregs; - ps_lsetfpregs; - ps_lsetregs; - ps_pdread; - ps_pdwrite; - ps_pglobal_lookup; -}; diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c deleted file mode 100644 index ecd974441b0..00000000000 --- a/gdb/gdbserver/regcache.c +++ /dev/null @@ -1,430 +0,0 @@ -/* Register support routines for the remote server for GDB. - Copyright (C) 2001, 2002, 2004, 2005, 2007, 2008, 2009, 2010, 2011 - 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 "regdef.h" - -#include <stdlib.h> -#include <string.h> - -static int register_bytes; - -static struct reg *reg_defs; -static int num_registers; - -const char **gdbserver_expedite_regs; - -#ifndef IN_PROCESS_AGENT - -struct regcache * -get_thread_regcache (struct thread_info *thread, int fetch) -{ - struct regcache *regcache; - - regcache = (struct regcache *) inferior_regcache_data (thread); - - if (regcache == NULL) - fatal ("no register cache"); - - if (fetch && regcache->registers_valid == 0) - { - struct thread_info *saved_inferior = current_inferior; - - current_inferior = thread; - fetch_inferior_registers (regcache, -1); - current_inferior = saved_inferior; - regcache->registers_valid = 1; - } - - return regcache; -} - -void -regcache_invalidate_one (struct inferior_list_entry *entry) -{ - struct thread_info *thread = (struct thread_info *) entry; - struct regcache *regcache; - - regcache = (struct regcache *) inferior_regcache_data (thread); - - if (regcache == NULL) - return; - - if (regcache->registers_valid) - { - struct thread_info *saved_inferior = current_inferior; - - current_inferior = thread; - store_inferior_registers (regcache, -1); - current_inferior = saved_inferior; - } - - regcache->registers_valid = 0; -} - -void -regcache_invalidate (void) -{ - for_each_inferior (&all_threads, regcache_invalidate_one); -} - -#endif - -struct regcache * -init_register_cache (struct regcache *regcache, unsigned char *regbuf) -{ -#ifndef IN_PROCESS_AGENT - if (regbuf == NULL) - { - /* Make sure to zero-initialize the register cache when it is - created, in case there are registers the target never - fetches. This way they'll read as zero instead of - garbage. */ - regcache->registers = xcalloc (1, register_bytes); - regcache->registers_owned = 1; - regcache->register_status = xcalloc (1, num_registers); - gdb_assert (REG_UNAVAILABLE == 0); - } - else -#else - if (regbuf == NULL) - fatal ("init_register_cache: can't allocate memory from the heap"); - else -#endif - { - regcache->registers = regbuf; - regcache->registers_owned = 0; -#ifndef IN_PROCESS_AGENT - regcache->register_status = NULL; -#endif - } - - regcache->registers_valid = 0; - - return regcache; -} - -#ifndef IN_PROCESS_AGENT - -struct regcache * -new_register_cache (void) -{ - struct regcache *regcache; - - if (register_bytes == 0) - return NULL; /* The architecture hasn't been initialized yet. */ - - regcache = xmalloc (sizeof (*regcache)); - return init_register_cache (regcache, NULL); -} - -void -free_register_cache (struct regcache *regcache) -{ - if (regcache) - { - if (regcache->registers_owned) - free (regcache->registers); - free (regcache->register_status); - free (regcache); - } -} - -#endif - -void -regcache_cpy (struct regcache *dst, struct regcache *src) -{ - memcpy (dst->registers, src->registers, register_bytes); -#ifndef IN_PROCESS_AGENT - if (dst->register_status != NULL && src->register_status != NULL) - memcpy (dst->register_status, src->register_status, num_registers); -#endif - dst->registers_valid = src->registers_valid; -} - -#ifndef IN_PROCESS_AGENT -static void -realloc_register_cache (struct inferior_list_entry *thread_p) -{ - struct thread_info *thread = (struct thread_info *) thread_p; - struct regcache *regcache - = (struct regcache *) inferior_regcache_data (thread); - - if (regcache != NULL) - regcache_invalidate_one (thread_p); - free_register_cache (regcache); - set_inferior_regcache_data (thread, new_register_cache ()); -} -#endif - -void -set_register_cache (struct reg *regs, int n) -{ - int offset, i; - -#ifndef IN_PROCESS_AGENT - /* Before changing the register cache internal layout, flush the - contents of valid caches back to the threads. */ - regcache_invalidate (); -#endif - - reg_defs = regs; - num_registers = n; - - offset = 0; - for (i = 0; i < n; i++) - { - regs[i].offset = offset; - offset += regs[i].size; - } - - register_bytes = offset / 8; - - /* Make sure PBUFSIZ is large enough to hold a full register packet. */ - if (2 * register_bytes + 32 > PBUFSIZ) - fatal ("Register packet size exceeds PBUFSIZ."); - -#ifndef IN_PROCESS_AGENT - /* Re-allocate all pre-existing register caches. */ - for_each_inferior (&all_threads, realloc_register_cache); -#endif -} - -int -register_cache_size (void) -{ - return register_bytes; -} - -#ifndef IN_PROCESS_AGENT - -void -registers_to_string (struct regcache *regcache, char *buf) -{ - unsigned char *registers = regcache->registers; - int i; - - for (i = 0; i < num_registers; i++) - { - if (regcache->register_status[i] == REG_VALID) - { - convert_int_to_ascii (registers, buf, register_size (i)); - buf += register_size (i) * 2; - } - else - { - memset (buf, 'x', register_size (i) * 2); - buf += register_size (i) * 2; - } - registers += register_size (i); - } - *buf = '\0'; -} - -void -registers_from_string (struct regcache *regcache, char *buf) -{ - int len = strlen (buf); - unsigned char *registers = regcache->registers; - - if (len != register_bytes * 2) - { - warning ("Wrong sized register packet (expected %d bytes, got %d)", - 2*register_bytes, len); - if (len > register_bytes * 2) - len = register_bytes * 2; - } - convert_ascii_to_int (buf, registers, len / 2); -} - -struct reg * -find_register_by_name (const char *name) -{ - int i; - - for (i = 0; i < num_registers; i++) - if (!strcmp (name, reg_defs[i].name)) - return ®_defs[i]; - fatal ("Unknown register %s requested", name); - return 0; -} - -int -find_regno (const char *name) -{ - int i; - - for (i = 0; i < num_registers; i++) - if (!strcmp (name, reg_defs[i].name)) - return i; - fatal ("Unknown register %s requested", name); - return -1; -} - -struct reg * -find_register_by_number (int n) -{ - return ®_defs[n]; -} - -#endif - -int -register_size (int n) -{ - return reg_defs[n].size / 8; -} - -static unsigned char * -register_data (struct regcache *regcache, int n, int fetch) -{ - return regcache->registers + (reg_defs[n].offset / 8); -} - -/* Supply register N, whose contents are stored in BUF, to REGCACHE. - If BUF is NULL, the register's value is recorded as - unavailable. */ - -void -supply_register (struct regcache *regcache, int n, const void *buf) -{ - if (buf) - { - memcpy (register_data (regcache, n, 0), buf, register_size (n)); -#ifndef IN_PROCESS_AGENT - if (regcache->register_status != NULL) - regcache->register_status[n] = REG_VALID; -#endif - } - else - { - memset (register_data (regcache, n, 0), 0, register_size (n)); -#ifndef IN_PROCESS_AGENT - if (regcache->register_status != NULL) - regcache->register_status[n] = REG_UNAVAILABLE; -#endif - } -} - -/* Supply register N with value zero to REGCACHE. */ - -void -supply_register_zeroed (struct regcache *regcache, int n) -{ - memset (register_data (regcache, n, 0), 0, register_size (n)); -#ifndef IN_PROCESS_AGENT - if (regcache->register_status != NULL) - regcache->register_status[n] = REG_VALID; -#endif -} - -/* Supply the whole register set whose contents are stored in BUF, to - REGCACHE. If BUF is NULL, all the registers' values are recorded - as unavailable. */ - -void -supply_regblock (struct regcache *regcache, const void *buf) -{ - if (buf) - { - memcpy (regcache->registers, buf, register_bytes); -#ifndef IN_PROCESS_AGENT - { - int i; - - for (i = 0; i < num_registers; i++) - regcache->register_status[i] = REG_VALID; - } -#endif - } - else - { - memset (regcache->registers, 0, register_bytes); -#ifndef IN_PROCESS_AGENT - { - int i; - - for (i = 0; i < num_registers; i++) - regcache->register_status[i] = REG_UNAVAILABLE; - } -#endif - } -} - -#ifndef IN_PROCESS_AGENT - -void -supply_register_by_name (struct regcache *regcache, - const char *name, const void *buf) -{ - supply_register (regcache, find_regno (name), buf); -} - -#endif - -void -collect_register (struct regcache *regcache, int n, void *buf) -{ - memcpy (buf, register_data (regcache, n, 1), register_size (n)); -} - -#ifndef IN_PROCESS_AGENT - -void -collect_register_as_string (struct regcache *regcache, int n, char *buf) -{ - convert_int_to_ascii (register_data (regcache, n, 1), - buf, register_size (n)); -} - -void -collect_register_by_name (struct regcache *regcache, - const char *name, void *buf) -{ - collect_register (regcache, find_regno (name), buf); -} - -/* Special handling for register PC. */ - -CORE_ADDR -regcache_read_pc (struct regcache *regcache) -{ - CORE_ADDR pc_val; - - if (the_target->read_pc) - pc_val = the_target->read_pc (regcache); - else - internal_error (__FILE__, __LINE__, - "regcache_read_pc: Unable to find PC"); - - return pc_val; -} - -void -regcache_write_pc (struct regcache *regcache, CORE_ADDR pc) -{ - if (the_target->write_pc) - the_target->write_pc (regcache, pc); - else - internal_error (__FILE__, __LINE__, - "regcache_write_pc: Unable to update PC"); -} - -#endif diff --git a/gdb/gdbserver/regcache.h b/gdb/gdbserver/regcache.h deleted file mode 100644 index 5fe64cb1d80..00000000000 --- a/gdb/gdbserver/regcache.h +++ /dev/null @@ -1,117 +0,0 @@ -/* Register support routines for the remote server for GDB. - Copyright (C) 2001, 2002, 2007, 2008, 2009, 2010, 2011 - 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/>. */ - -#ifndef REGCACHE_H -#define REGCACHE_H - -struct inferior_list_entry; -struct thread_info; - -/* The register exists, it has a value, but we don't know what it is. - Used when inspecting traceframes. */ -#define REG_UNAVAILABLE 0 - -/* We know the register's value (and we have it cached). */ -#define REG_VALID 1 - -/* The data for the register cache. Note that we have one per - inferior; this is primarily for simplicity, as the performance - benefit is minimal. */ - -struct regcache -{ - /* Whether the REGISTERS buffer's contents are valid. If false, we - haven't fetched the registers from the target yet. Not that this - register cache is _not_ pass-through, unlike GDB's. Note that - "valid" here is unrelated to whether the registers are available - in a traceframe. For that, check REGISTER_STATUS below. */ - int registers_valid; - int registers_owned; - unsigned char *registers; -#ifndef IN_PROCESS_AGENT - /* One of REG_UNAVAILBLE or REG_VALID. */ - unsigned char *register_status; -#endif -}; - -struct regcache *init_register_cache (struct regcache *regcache, - unsigned char *regbuf); - -void regcache_cpy (struct regcache *dst, struct regcache *src); - -/* Create a new register cache for INFERIOR. */ - -struct regcache *new_register_cache (void); - -struct regcache *get_thread_regcache (struct thread_info *thread, int fetch); - -/* Release all memory associated with the register cache for INFERIOR. */ - -void free_register_cache (struct regcache *regcache); - -/* Invalidate cached registers for one or all threads. */ - -void regcache_invalidate_one (struct inferior_list_entry *); -void regcache_invalidate (void); - -/* Convert all registers to a string in the currently specified remote - format. */ - -void registers_to_string (struct regcache *regcache, char *buf); - -/* Convert a string to register values and fill our register cache. */ - -void registers_from_string (struct regcache *regcache, char *buf); - -CORE_ADDR regcache_read_pc (struct regcache *regcache); - -void regcache_write_pc (struct regcache *regcache, CORE_ADDR pc); - -/* Return a pointer to the description of register ``n''. */ - -struct reg *find_register_by_number (int n); - -int register_size (int n); - -int register_cache_size (void); - -int find_regno (const char *name); - -/* The following two variables are set by auto-generated - code in the init_registers_... routines. */ -extern const char **gdbserver_expedite_regs; -extern const char *gdbserver_xmltarget; - -void supply_register (struct regcache *regcache, int n, const void *buf); - -void supply_register_zeroed (struct regcache *regcache, int n); - -void supply_register_by_name (struct regcache *regcache, - const char *name, const void *buf); - -void supply_regblock (struct regcache *regcache, const void *buf); - -void collect_register (struct regcache *regcache, int n, void *buf); - -void collect_register_as_string (struct regcache *regcache, int n, char *buf); - -void collect_register_by_name (struct regcache *regcache, - const char *name, void *buf); - -#endif /* REGCACHE_H */ diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c deleted file mode 100644 index 8832417dc3e..00000000000 --- a/gdb/gdbserver/remote-utils.c +++ /dev/null @@ -1,1717 +0,0 @@ -/* Remote utility routines for the remote server for GDB. - Copyright (C) 1986, 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 - 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 "terminal.h" -#include "target.h" -#include <stdio.h> -#include <string.h> -#if HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> -#endif -#if HAVE_SYS_FILE_H -#include <sys/file.h> -#endif -#if HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#if HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#if HAVE_NETDB_H -#include <netdb.h> -#endif -#if HAVE_NETINET_TCP_H -#include <netinet/tcp.h> -#endif -#if HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> -#endif -#if HAVE_SIGNAL_H -#include <signal.h> -#endif -#if HAVE_FCNTL_H -#include <fcntl.h> -#endif -#include <sys/time.h> -#if HAVE_UNISTD_H -#include <unistd.h> -#endif -#if HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif -#include <sys/stat.h> -#if HAVE_ERRNO_H -#include <errno.h> -#endif - -#if USE_WIN32API -#include <winsock2.h> -#endif - -#if __QNX__ -#include <sys/iomgr.h> -#endif /* __QNX__ */ - -#ifndef HAVE_SOCKLEN_T -typedef int socklen_t; -#endif - -#ifndef IN_PROCESS_AGENT - -#if USE_WIN32API -# define INVALID_DESCRIPTOR INVALID_SOCKET -#else -# define INVALID_DESCRIPTOR -1 -#endif - -/* Extra value for readchar_callback. */ -enum { - /* The callback is currently not scheduled. */ - NOT_SCHEDULED = -1 -}; - -/* Status of the readchar callback. - Either NOT_SCHEDULED or the callback id. */ -static int readchar_callback = NOT_SCHEDULED; - -static int readchar (void); -static void reset_readchar (void); -static void reschedule (void); - -/* A cache entry for a successfully looked-up symbol. */ -struct sym_cache -{ - char *name; - CORE_ADDR addr; - struct sym_cache *next; -}; - -int remote_debug = 0; -struct ui_file *gdb_stdlog; - -static gdb_fildes_t remote_desc = INVALID_DESCRIPTOR; -static gdb_fildes_t listen_desc = INVALID_DESCRIPTOR; - -/* FIXME headerize? */ -extern int using_threads; -extern int debug_threads; - -/* If true, then GDB has requested noack mode. */ -int noack_mode = 0; -/* If true, then we tell GDB to use noack mode by default. */ -int transport_is_reliable = 0; - -#ifdef USE_WIN32API -# define read(fd, buf, len) recv (fd, (char *) buf, len, 0) -# define write(fd, buf, len) send (fd, (char *) buf, len, 0) -#endif - -int -gdb_connected (void) -{ - return remote_desc != INVALID_DESCRIPTOR; -} - -static void -enable_async_notification (int fd) -{ -#if defined(F_SETFL) && defined (FASYNC) - int save_fcntl_flags; - - save_fcntl_flags = fcntl (fd, F_GETFL, 0); - fcntl (fd, F_SETFL, save_fcntl_flags | FASYNC); -#if defined (F_SETOWN) - fcntl (fd, F_SETOWN, getpid ()); -#endif -#endif -} - -static int -handle_accept_event (int err, gdb_client_data client_data) -{ - struct sockaddr_in sockaddr; - socklen_t tmp; - - if (debug_threads) - fprintf (stderr, "handling possible accept event\n"); - - tmp = sizeof (sockaddr); - remote_desc = accept (listen_desc, (struct sockaddr *) &sockaddr, &tmp); - if (remote_desc == -1) - perror_with_name ("Accept failed"); - - /* Enable TCP keep alive process. */ - tmp = 1; - setsockopt (remote_desc, SOL_SOCKET, SO_KEEPALIVE, - (char *) &tmp, sizeof (tmp)); - - /* Tell TCP not to delay small packets. This greatly speeds up - interactive response. */ - tmp = 1; - setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY, - (char *) &tmp, sizeof (tmp)); - -#ifndef USE_WIN32API - signal (SIGPIPE, SIG_IGN); /* If we don't do this, then gdbserver simply - exits when the remote side dies. */ -#endif - - if (run_once) - { -#ifndef USE_WIN32API - close (listen_desc); /* No longer need this */ -#else - closesocket (listen_desc); /* No longer need this */ -#endif - } - - /* Even if !RUN_ONCE no longer notice new connections. Still keep the - descriptor open for add_file_handler to wait for a new connection. */ - delete_file_handler (listen_desc); - - /* Convert IP address to string. */ - fprintf (stderr, "Remote debugging from host %s\n", - inet_ntoa (sockaddr.sin_addr)); - - enable_async_notification (remote_desc); - - /* Register the event loop handler. */ - add_file_handler (remote_desc, handle_serial_event, NULL); - - /* We have a new GDB connection now. If we were disconnected - tracing, there's a window where the target could report a stop - event to the event loop, and since we have a connection now, we'd - try to send vStopped notifications to GDB. But, don't do that - until GDB as selected all-stop/non-stop, and has queried the - threads' status ('?'). */ - target_async (0); - - return 0; -} - -/* Prepare for a later connection to a remote debugger. - NAME is the filename used for communication. */ - -void -remote_prepare (char *name) -{ - char *port_str; -#ifdef USE_WIN32API - static int winsock_initialized; -#endif - int port; - struct sockaddr_in sockaddr; - socklen_t tmp; - char *port_end; - - port_str = strchr (name, ':'); - if (port_str == NULL) - { - transport_is_reliable = 0; - return; - } - - port = strtoul (port_str + 1, &port_end, 10); - if (port_str[1] == '\0' || *port_end != '\0') - fatal ("Bad port argument: %s", name); - -#ifdef USE_WIN32API - if (!winsock_initialized) - { - WSADATA wsad; - - WSAStartup (MAKEWORD (1, 0), &wsad); - winsock_initialized = 1; - } -#endif - - listen_desc = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); - if (listen_desc == -1) - perror_with_name ("Can't open socket"); - - /* Allow rapid reuse of this port. */ - tmp = 1; - setsockopt (listen_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp, - sizeof (tmp)); - - sockaddr.sin_family = PF_INET; - sockaddr.sin_port = htons (port); - sockaddr.sin_addr.s_addr = INADDR_ANY; - - if (bind (listen_desc, (struct sockaddr *) &sockaddr, sizeof (sockaddr)) - || listen (listen_desc, 1)) - perror_with_name ("Can't bind address"); - - transport_is_reliable = 1; -} - -/* Open a connection to a remote debugger. - NAME is the filename used for communication. */ - -void -remote_open (char *name) -{ - char *port_str; - - port_str = strchr (name, ':'); - if (port_str == NULL) - { -#ifdef USE_WIN32API - error ("Only <host>:<port> is supported on this platform."); -#else - struct stat statbuf; - - if (stat (name, &statbuf) == 0 - && (S_ISCHR (statbuf.st_mode) || S_ISFIFO (statbuf.st_mode))) - remote_desc = open (name, O_RDWR); - else - { - errno = EINVAL; - remote_desc = -1; - } - - if (remote_desc < 0) - perror_with_name ("Could not open remote device"); - -#ifdef HAVE_TERMIOS - { - struct termios termios; - tcgetattr (remote_desc, &termios); - - termios.c_iflag = 0; - termios.c_oflag = 0; - termios.c_lflag = 0; - termios.c_cflag &= ~(CSIZE | PARENB); - termios.c_cflag |= CLOCAL | CS8; - termios.c_cc[VMIN] = 1; - termios.c_cc[VTIME] = 0; - - tcsetattr (remote_desc, TCSANOW, &termios); - } -#endif - -#ifdef HAVE_TERMIO - { - struct termio termio; - ioctl (remote_desc, TCGETA, &termio); - - termio.c_iflag = 0; - termio.c_oflag = 0; - termio.c_lflag = 0; - termio.c_cflag &= ~(CSIZE | PARENB); - termio.c_cflag |= CLOCAL | CS8; - termio.c_cc[VMIN] = 1; - termio.c_cc[VTIME] = 0; - - ioctl (remote_desc, TCSETA, &termio); - } -#endif - -#ifdef HAVE_SGTTY - { - struct sgttyb sg; - - ioctl (remote_desc, TIOCGETP, &sg); - sg.sg_flags = RAW; - ioctl (remote_desc, TIOCSETP, &sg); - } -#endif - - fprintf (stderr, "Remote debugging using %s\n", name); - - enable_async_notification (remote_desc); - - /* Register the event loop handler. */ - add_file_handler (remote_desc, handle_serial_event, NULL); -#endif /* USE_WIN32API */ - } - else - { - int port; - socklen_t len; - struct sockaddr_in sockaddr; - - len = sizeof (sockaddr); - if (getsockname (listen_desc, - (struct sockaddr *) &sockaddr, &len) < 0 - || len < sizeof (sockaddr)) - perror_with_name ("Can't determine port"); - port = ntohs (sockaddr.sin_port); - - fprintf (stderr, "Listening on port %d\n", port); - fflush (stderr); - - /* Register the event loop handler. */ - add_file_handler (listen_desc, handle_accept_event, NULL); - } -} - -void -remote_close (void) -{ - delete_file_handler (remote_desc); - -#ifdef USE_WIN32API - closesocket (remote_desc); -#else - close (remote_desc); -#endif - remote_desc = INVALID_DESCRIPTOR; - - reset_readchar (); -} - -/* Convert hex digit A to a number. */ - -static int -fromhex (int a) -{ - if (a >= '0' && a <= '9') - return a - '0'; - else if (a >= 'a' && a <= 'f') - return a - 'a' + 10; - else - error ("Reply contains invalid hex digit"); - return 0; -} - -#endif - -static const char hexchars[] = "0123456789abcdef"; - -static int -ishex (int ch, int *val) -{ - if ((ch >= 'a') && (ch <= 'f')) - { - *val = ch - 'a' + 10; - return 1; - } - if ((ch >= 'A') && (ch <= 'F')) - { - *val = ch - 'A' + 10; - return 1; - } - if ((ch >= '0') && (ch <= '9')) - { - *val = ch - '0'; - return 1; - } - return 0; -} - -#ifndef IN_PROCESS_AGENT - -int -unhexify (char *bin, const char *hex, int count) -{ - int i; - - for (i = 0; i < count; i++) - { - if (hex[0] == 0 || hex[1] == 0) - { - /* Hex string is short, or of uneven length. - Return the count that has been converted so far. */ - return i; - } - *bin++ = fromhex (hex[0]) * 16 + fromhex (hex[1]); - hex += 2; - } - return i; -} - -void -decode_address (CORE_ADDR *addrp, const char *start, int len) -{ - CORE_ADDR addr; - char ch; - int i; - - addr = 0; - for (i = 0; i < len; i++) - { - ch = start[i]; - addr = addr << 4; - addr = addr | (fromhex (ch) & 0x0f); - } - *addrp = addr; -} - -const char * -decode_address_to_semicolon (CORE_ADDR *addrp, const char *start) -{ - const char *end; - - end = start; - while (*end != '\0' && *end != ';') - end++; - - decode_address (addrp, start, end - start); - - if (*end == ';') - end++; - return end; -} - -#endif - -/* Convert number NIB to a hex digit. */ - -static int -tohex (int nib) -{ - if (nib < 10) - return '0' + nib; - else - return 'a' + nib - 10; -} - -#ifndef IN_PROCESS_AGENT - -int -hexify (char *hex, const char *bin, int count) -{ - int i; - - /* May use a length, or a nul-terminated string as input. */ - if (count == 0) - count = strlen (bin); - - for (i = 0; i < count; i++) - { - *hex++ = tohex ((*bin >> 4) & 0xf); - *hex++ = tohex (*bin++ & 0xf); - } - *hex = 0; - return i; -} - -/* Convert BUFFER, binary data at least LEN bytes long, into escaped - binary data in OUT_BUF. Set *OUT_LEN to the length of the data - encoded in OUT_BUF, and return the number of bytes in OUT_BUF - (which may be more than *OUT_LEN due to escape characters). The - total number of bytes in the output buffer will be at most - OUT_MAXLEN. */ - -int -remote_escape_output (const gdb_byte *buffer, int len, - gdb_byte *out_buf, int *out_len, - int out_maxlen) -{ - int input_index, output_index; - - output_index = 0; - for (input_index = 0; input_index < len; input_index++) - { - gdb_byte b = buffer[input_index]; - - if (b == '$' || b == '#' || b == '}' || b == '*') - { - /* These must be escaped. */ - if (output_index + 2 > out_maxlen) - break; - out_buf[output_index++] = '}'; - out_buf[output_index++] = b ^ 0x20; - } - else - { - if (output_index + 1 > out_maxlen) - break; - out_buf[output_index++] = b; - } - } - - *out_len = input_index; - return output_index; -} - -/* Convert BUFFER, escaped data LEN bytes long, into binary data - in OUT_BUF. Return the number of bytes written to OUT_BUF. - Raise an error if the total number of bytes exceeds OUT_MAXLEN. - - This function reverses remote_escape_output. It allows more - escaped characters than that function does, in particular because - '*' must be escaped to avoid the run-length encoding processing - in reading packets. */ - -static int -remote_unescape_input (const gdb_byte *buffer, int len, - gdb_byte *out_buf, int out_maxlen) -{ - int input_index, output_index; - int escaped; - - output_index = 0; - escaped = 0; - for (input_index = 0; input_index < len; input_index++) - { - gdb_byte b = buffer[input_index]; - - if (output_index + 1 > out_maxlen) - error ("Received too much data from the target."); - - if (escaped) - { - out_buf[output_index++] = b ^ 0x20; - escaped = 0; - } - else if (b == '}') - escaped = 1; - else - out_buf[output_index++] = b; - } - - if (escaped) - error ("Unmatched escape character in target response."); - - return output_index; -} - -/* Look for a sequence of characters which can be run-length encoded. - If there are any, update *CSUM and *P. Otherwise, output the - single character. Return the number of characters consumed. */ - -static int -try_rle (char *buf, int remaining, unsigned char *csum, char **p) -{ - int n; - - /* Always output the character. */ - *csum += buf[0]; - *(*p)++ = buf[0]; - - /* Don't go past '~'. */ - if (remaining > 97) - remaining = 97; - - for (n = 1; n < remaining; n++) - if (buf[n] != buf[0]) - break; - - /* N is the index of the first character not the same as buf[0]. - buf[0] is counted twice, so by decrementing N, we get the number - of characters the RLE sequence will replace. */ - n--; - - if (n < 3) - return 1; - - /* Skip the frame characters. The manual says to skip '+' and '-' - also, but there's no reason to. Unfortunately these two unusable - characters double the encoded length of a four byte zero - value. */ - while (n + 29 == '$' || n + 29 == '#') - n--; - - *csum += '*'; - *(*p)++ = '*'; - *csum += n + 29; - *(*p)++ = n + 29; - - return n + 1; -} - -#endif - -char * -unpack_varlen_hex (char *buff, /* packet to parse */ - ULONGEST *result) -{ - int nibble; - ULONGEST retval = 0; - - while (ishex (*buff, &nibble)) - { - buff++; - retval = retval << 4; - retval |= nibble & 0x0f; - } - *result = retval; - return buff; -} - -#ifndef IN_PROCESS_AGENT - -/* Write a PTID to BUF. Returns BUF+CHARACTERS_WRITTEN. */ - -char * -write_ptid (char *buf, ptid_t ptid) -{ - int pid, tid; - - if (multi_process) - { - pid = ptid_get_pid (ptid); - if (pid < 0) - buf += sprintf (buf, "p-%x.", -pid); - else - buf += sprintf (buf, "p%x.", pid); - } - tid = ptid_get_lwp (ptid); - if (tid < 0) - buf += sprintf (buf, "-%x", -tid); - else - buf += sprintf (buf, "%x", tid); - - return buf; -} - -ULONGEST -hex_or_minus_one (char *buf, char **obuf) -{ - ULONGEST ret; - - if (strncmp (buf, "-1", 2) == 0) - { - ret = (ULONGEST) -1; - buf += 2; - } - else - buf = unpack_varlen_hex (buf, &ret); - - if (obuf) - *obuf = buf; - - return ret; -} - -/* Extract a PTID from BUF. If non-null, OBUF is set to the to one - passed the last parsed char. Returns null_ptid on error. */ -ptid_t -read_ptid (char *buf, char **obuf) -{ - char *p = buf; - char *pp; - ULONGEST pid = 0, tid = 0; - - if (*p == 'p') - { - /* Multi-process ptid. */ - pp = unpack_varlen_hex (p + 1, &pid); - if (*pp != '.') - error ("invalid remote ptid: %s\n", p); - - p = pp + 1; - - tid = hex_or_minus_one (p, &pp); - - if (obuf) - *obuf = pp; - return ptid_build (pid, tid, 0); - } - - /* No multi-process. Just a tid. */ - tid = hex_or_minus_one (p, &pp); - - /* Since the stub is not sending a process id, then default to - what's in the current inferior. */ - pid = ptid_get_pid (((struct inferior_list_entry *) current_inferior)->id); - - if (obuf) - *obuf = pp; - return ptid_build (pid, tid, 0); -} - -/* Send a packet to the remote machine, with error checking. - The data of the packet is in BUF, and the length of the - packet is in CNT. Returns >= 0 on success, -1 otherwise. */ - -static int -putpkt_binary_1 (char *buf, int cnt, int is_notif) -{ - int i; - unsigned char csum = 0; - char *buf2; - char *p; - int cc; - - buf2 = xmalloc (strlen ("$") + cnt + strlen ("#nn") + 1); - - /* Copy the packet into buffer BUF2, encapsulating it - and giving it a checksum. */ - - p = buf2; - if (is_notif) - *p++ = '%'; - else - *p++ = '$'; - - for (i = 0; i < cnt;) - i += try_rle (buf + i, cnt - i, &csum, &p); - - *p++ = '#'; - *p++ = tohex ((csum >> 4) & 0xf); - *p++ = tohex (csum & 0xf); - - *p = '\0'; - - /* Send it over and over until we get a positive ack. */ - - do - { - if (write (remote_desc, buf2, p - buf2) != p - buf2) - { - perror ("putpkt(write)"); - free (buf2); - return -1; - } - - if (noack_mode || is_notif) - { - /* Don't expect an ack then. */ - if (remote_debug) - { - if (is_notif) - fprintf (stderr, "putpkt (\"%s\"); [notif]\n", buf2); - else - fprintf (stderr, "putpkt (\"%s\"); [noack mode]\n", buf2); - fflush (stderr); - } - break; - } - - if (remote_debug) - { - fprintf (stderr, "putpkt (\"%s\"); [looking for ack]\n", buf2); - fflush (stderr); - } - - cc = readchar (); - - if (cc < 0) - { - free (buf2); - return -1; - } - - if (remote_debug) - { - fprintf (stderr, "[received '%c' (0x%x)]\n", cc, cc); - fflush (stderr); - } - - /* Check for an input interrupt while we're here. */ - if (cc == '\003' && current_inferior != NULL) - (*the_target->request_interrupt) (); - } - while (cc != '+'); - - free (buf2); - return 1; /* Success! */ -} - -int -putpkt_binary (char *buf, int cnt) -{ - return putpkt_binary_1 (buf, cnt, 0); -} - -/* Send a packet to the remote machine, with error checking. The data - of the packet is in BUF, and the packet should be a NUL-terminated - string. Returns >= 0 on success, -1 otherwise. */ - -int -putpkt (char *buf) -{ - return putpkt_binary (buf, strlen (buf)); -} - -int -putpkt_notif (char *buf) -{ - return putpkt_binary_1 (buf, strlen (buf), 1); -} - -/* Come here when we get an input interrupt from the remote side. This - interrupt should only be active while we are waiting for the child to do - something. Thus this assumes readchar:bufcnt is 0. - About the only thing that should come through is a ^C, which - will cause us to request child interruption. */ - -static void -input_interrupt (int unused) -{ - fd_set readset; - struct timeval immediate = { 0, 0 }; - - /* Protect against spurious interrupts. This has been observed to - be a problem under NetBSD 1.4 and 1.5. */ - - FD_ZERO (&readset); - FD_SET (remote_desc, &readset); - if (select (remote_desc + 1, &readset, 0, 0, &immediate) > 0) - { - int cc; - char c = 0; - - cc = read (remote_desc, &c, 1); - - if (cc != 1 || c != '\003' || current_inferior == NULL) - { - fprintf (stderr, "input_interrupt, count = %d c = %d ('%c')\n", - cc, c, c); - return; - } - - (*the_target->request_interrupt) (); - } -} - -/* Check if the remote side sent us an interrupt request (^C). */ -void -check_remote_input_interrupt_request (void) -{ - /* This function may be called before establishing communications, - therefore we need to validate the remote descriptor. */ - - if (remote_desc == INVALID_DESCRIPTOR) - return; - - input_interrupt (0); -} - -/* Asynchronous I/O support. SIGIO must be enabled when waiting, in order to - accept Control-C from the client, and must be disabled when talking to - the client. */ - -static void -unblock_async_io (void) -{ -#ifndef USE_WIN32API - sigset_t sigio_set; - - sigemptyset (&sigio_set); - sigaddset (&sigio_set, SIGIO); - sigprocmask (SIG_UNBLOCK, &sigio_set, NULL); -#endif -} - -#ifdef __QNX__ -static void -nto_comctrl (int enable) -{ - struct sigevent event; - - if (enable) - { - event.sigev_notify = SIGEV_SIGNAL_THREAD; - event.sigev_signo = SIGIO; - event.sigev_code = 0; - event.sigev_value.sival_ptr = NULL; - event.sigev_priority = -1; - ionotify (remote_desc, _NOTIFY_ACTION_POLLARM, _NOTIFY_COND_INPUT, - &event); - } - else - ionotify (remote_desc, _NOTIFY_ACTION_POLL, _NOTIFY_COND_INPUT, NULL); -} -#endif /* __QNX__ */ - - -/* Current state of asynchronous I/O. */ -static int async_io_enabled; - -/* Enable asynchronous I/O. */ -void -enable_async_io (void) -{ - if (async_io_enabled) - return; - -#ifndef USE_WIN32API - signal (SIGIO, input_interrupt); -#endif - async_io_enabled = 1; -#ifdef __QNX__ - nto_comctrl (1); -#endif /* __QNX__ */ -} - -/* Disable asynchronous I/O. */ -void -disable_async_io (void) -{ - if (!async_io_enabled) - return; - -#ifndef USE_WIN32API - signal (SIGIO, SIG_IGN); -#endif - async_io_enabled = 0; -#ifdef __QNX__ - nto_comctrl (0); -#endif /* __QNX__ */ - -} - -void -initialize_async_io (void) -{ - /* Make sure that async I/O starts disabled. */ - async_io_enabled = 1; - disable_async_io (); - - /* Make sure the signal is unblocked. */ - unblock_async_io (); -} - -/* Internal buffer used by readchar. - These are global to readchar because reschedule_remote needs to be - able to tell whether the buffer is empty. */ - -static unsigned char readchar_buf[BUFSIZ]; -static int readchar_bufcnt = 0; -static unsigned char *readchar_bufp; - -/* Returns next char from remote GDB. -1 if error. */ - -static int -readchar (void) -{ - int ch; - - if (readchar_bufcnt == 0) - { - readchar_bufcnt = read (remote_desc, readchar_buf, - sizeof (readchar_buf)); - - if (readchar_bufcnt <= 0) - { - if (readchar_bufcnt == 0) - fprintf (stderr, "readchar: Got EOF\n"); - else - perror ("readchar"); - - return -1; - } - - readchar_bufp = readchar_buf; - } - - readchar_bufcnt--; - ch = *readchar_bufp++; - reschedule (); - return ch; -} - -/* Reset the readchar state machine. */ - -static void -reset_readchar (void) -{ - readchar_bufcnt = 0; - if (readchar_callback != NOT_SCHEDULED) - { - delete_callback_event (readchar_callback); - readchar_callback = NOT_SCHEDULED; - } -} - -/* Process remaining data in readchar_buf. */ - -static int -process_remaining (void *context) -{ - int res; - - /* This is a one-shot event. */ - readchar_callback = NOT_SCHEDULED; - - if (readchar_bufcnt > 0) - res = handle_serial_event (0, NULL); - else - res = 0; - - return res; -} - -/* If there is still data in the buffer, queue another event to process it, - we can't sleep in select yet. */ - -static void -reschedule (void) -{ - if (readchar_bufcnt > 0 && readchar_callback == NOT_SCHEDULED) - readchar_callback = append_callback_event (process_remaining, NULL); -} - -/* Read a packet from the remote machine, with error checking, - and store it in BUF. Returns length of packet, or negative if error. */ - -int -getpkt (char *buf) -{ - char *bp; - unsigned char csum, c1, c2; - int c; - - while (1) - { - csum = 0; - - while (1) - { - c = readchar (); - if (c == '$') - break; - if (remote_debug) - { - fprintf (stderr, "[getpkt: discarding char '%c']\n", c); - fflush (stderr); - } - - if (c < 0) - return -1; - } - - bp = buf; - while (1) - { - c = readchar (); - if (c < 0) - return -1; - if (c == '#') - break; - *bp++ = c; - csum += c; - } - *bp = 0; - - c1 = fromhex (readchar ()); - c2 = fromhex (readchar ()); - - if (csum == (c1 << 4) + c2) - break; - - if (noack_mode) - { - fprintf (stderr, - "Bad checksum, sentsum=0x%x, csum=0x%x, " - "buf=%s [no-ack-mode, Bad medium?]\n", - (c1 << 4) + c2, csum, buf); - /* Not much we can do, GDB wasn't expecting an ack/nac. */ - break; - } - - fprintf (stderr, "Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n", - (c1 << 4) + c2, csum, buf); - if (write (remote_desc, "-", 1) != 1) - return -1; - } - - if (!noack_mode) - { - if (remote_debug) - { - fprintf (stderr, "getpkt (\"%s\"); [sending ack] \n", buf); - fflush (stderr); - } - - if (write (remote_desc, "+", 1) != 1) - return -1; - - if (remote_debug) - { - fprintf (stderr, "[sent ack]\n"); - fflush (stderr); - } - } - else - { - if (remote_debug) - { - fprintf (stderr, "getpkt (\"%s\"); [no ack sent] \n", buf); - fflush (stderr); - } - } - - return bp - buf; -} - -void -write_ok (char *buf) -{ - buf[0] = 'O'; - buf[1] = 'K'; - buf[2] = '\0'; -} - -void -write_enn (char *buf) -{ - /* Some day, we should define the meanings of the error codes... */ - buf[0] = 'E'; - buf[1] = '0'; - buf[2] = '1'; - buf[3] = '\0'; -} - -#endif - -void -convert_int_to_ascii (const unsigned char *from, char *to, int n) -{ - int nib; - int ch; - while (n--) - { - ch = *from++; - nib = ((ch & 0xf0) >> 4) & 0x0f; - *to++ = tohex (nib); - nib = ch & 0x0f; - *to++ = tohex (nib); - } - *to++ = 0; -} - -#ifndef IN_PROCESS_AGENT - -void -convert_ascii_to_int (const char *from, unsigned char *to, int n) -{ - int nib1, nib2; - while (n--) - { - nib1 = fromhex (*from++); - nib2 = fromhex (*from++); - *to++ = (((nib1 & 0x0f) << 4) & 0xf0) | (nib2 & 0x0f); - } -} - -static char * -outreg (struct regcache *regcache, int regno, char *buf) -{ - if ((regno >> 12) != 0) - *buf++ = tohex ((regno >> 12) & 0xf); - if ((regno >> 8) != 0) - *buf++ = tohex ((regno >> 8) & 0xf); - *buf++ = tohex ((regno >> 4) & 0xf); - *buf++ = tohex (regno & 0xf); - *buf++ = ':'; - collect_register_as_string (regcache, regno, buf); - buf += 2 * register_size (regno); - *buf++ = ';'; - - return buf; -} - -void -new_thread_notify (int id) -{ - char own_buf[256]; - - /* The `n' response is not yet part of the remote protocol. Do nothing. */ - if (1) - return; - - if (server_waiting == 0) - return; - - sprintf (own_buf, "n%x", id); - disable_async_io (); - putpkt (own_buf); - enable_async_io (); -} - -void -dead_thread_notify (int id) -{ - char own_buf[256]; - - /* The `x' response is not yet part of the remote protocol. Do nothing. */ - if (1) - return; - - sprintf (own_buf, "x%x", id); - disable_async_io (); - putpkt (own_buf); - enable_async_io (); -} - -void -prepare_resume_reply (char *buf, ptid_t ptid, - struct target_waitstatus *status) -{ - if (debug_threads) - fprintf (stderr, "Writing resume reply for %s:%d\n\n", - target_pid_to_str (ptid), status->kind); - - switch (status->kind) - { - case TARGET_WAITKIND_STOPPED: - { - struct thread_info *saved_inferior; - const char **regp; - struct regcache *regcache; - - sprintf (buf, "T%02x", status->value.sig); - buf += strlen (buf); - - regp = gdbserver_expedite_regs; - - saved_inferior = current_inferior; - - current_inferior = find_thread_ptid (ptid); - - regcache = get_thread_regcache (current_inferior, 1); - - if (the_target->stopped_by_watchpoint != NULL - && (*the_target->stopped_by_watchpoint) ()) - { - CORE_ADDR addr; - int i; - - strncpy (buf, "watch:", 6); - buf += 6; - - addr = (*the_target->stopped_data_address) (); - - /* Convert each byte of the address into two hexadecimal - chars. Note that we take sizeof (void *) instead of - sizeof (addr); this is to avoid sending a 64-bit - address to a 32-bit GDB. */ - for (i = sizeof (void *) * 2; i > 0; i--) - *buf++ = tohex ((addr >> (i - 1) * 4) & 0xf); - *buf++ = ';'; - } - - while (*regp) - { - buf = outreg (regcache, find_regno (*regp), buf); - regp ++; - } - *buf = '\0'; - - /* Formerly, if the debugger had not used any thread features - we would not burden it with a thread status response. This - was for the benefit of GDB 4.13 and older. However, in - recent GDB versions the check (``if (cont_thread != 0)'') - does not have the desired effect because of sillyness in - the way that the remote protocol handles specifying a - thread. Since thread support relies on qSymbol support - anyway, assume GDB can handle threads. */ - - if (using_threads && !disable_packet_Tthread) - { - /* This if (1) ought to be unnecessary. But remote_wait - in GDB will claim this event belongs to inferior_ptid - if we do not specify a thread, and there's no way for - gdbserver to know what inferior_ptid is. */ - if (1 || !ptid_equal (general_thread, ptid)) - { - int core = -1; - /* In non-stop, don't change the general thread behind - GDB's back. */ - if (!non_stop) - general_thread = ptid; - sprintf (buf, "thread:"); - buf += strlen (buf); - buf = write_ptid (buf, ptid); - strcat (buf, ";"); - buf += strlen (buf); - - if (the_target->core_of_thread) - core = (*the_target->core_of_thread) (ptid); - if (core != -1) - { - sprintf (buf, "core:"); - buf += strlen (buf); - sprintf (buf, "%x", core); - strcat (buf, ";"); - buf += strlen (buf); - } - } - } - - if (dlls_changed) - { - strcpy (buf, "library:;"); - buf += strlen (buf); - dlls_changed = 0; - } - - current_inferior = saved_inferior; - } - break; - case TARGET_WAITKIND_EXITED: - if (multi_process) - sprintf (buf, "W%x;process:%x", - status->value.integer, ptid_get_pid (ptid)); - else - sprintf (buf, "W%02x", status->value.integer); - break; - case TARGET_WAITKIND_SIGNALLED: - if (multi_process) - sprintf (buf, "X%x;process:%x", - status->value.sig, ptid_get_pid (ptid)); - else - sprintf (buf, "X%02x", status->value.sig); - break; - default: - error ("unhandled waitkind"); - break; - } -} - -void -decode_m_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr) -{ - int i = 0, j = 0; - char ch; - *mem_addr_ptr = *len_ptr = 0; - - while ((ch = from[i++]) != ',') - { - *mem_addr_ptr = *mem_addr_ptr << 4; - *mem_addr_ptr |= fromhex (ch) & 0x0f; - } - - for (j = 0; j < 4; j++) - { - if ((ch = from[i++]) == 0) - break; - *len_ptr = *len_ptr << 4; - *len_ptr |= fromhex (ch) & 0x0f; - } -} - -void -decode_M_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr, - unsigned char **to_p) -{ - int i = 0; - char ch; - *mem_addr_ptr = *len_ptr = 0; - - while ((ch = from[i++]) != ',') - { - *mem_addr_ptr = *mem_addr_ptr << 4; - *mem_addr_ptr |= fromhex (ch) & 0x0f; - } - - while ((ch = from[i++]) != ':') - { - *len_ptr = *len_ptr << 4; - *len_ptr |= fromhex (ch) & 0x0f; - } - - if (*to_p == NULL) - *to_p = xmalloc (*len_ptr); - - convert_ascii_to_int (&from[i++], *to_p, *len_ptr); -} - -int -decode_X_packet (char *from, int packet_len, CORE_ADDR *mem_addr_ptr, - unsigned int *len_ptr, unsigned char **to_p) -{ - int i = 0; - char ch; - *mem_addr_ptr = *len_ptr = 0; - - while ((ch = from[i++]) != ',') - { - *mem_addr_ptr = *mem_addr_ptr << 4; - *mem_addr_ptr |= fromhex (ch) & 0x0f; - } - - while ((ch = from[i++]) != ':') - { - *len_ptr = *len_ptr << 4; - *len_ptr |= fromhex (ch) & 0x0f; - } - - if (*to_p == NULL) - *to_p = xmalloc (*len_ptr); - - if (remote_unescape_input ((const gdb_byte *) &from[i], packet_len - i, - *to_p, *len_ptr) != *len_ptr) - return -1; - - return 0; -} - -/* Decode a qXfer write request. */ - -int -decode_xfer_write (char *buf, int packet_len, CORE_ADDR *offset, - unsigned int *len, unsigned char *data) -{ - char ch; - char *b = buf; - - /* Extract the offset. */ - *offset = 0; - while ((ch = *buf++) != ':') - { - *offset = *offset << 4; - *offset |= fromhex (ch) & 0x0f; - } - - /* Get encoded data. */ - packet_len -= buf - b; - *len = remote_unescape_input ((const gdb_byte *) buf, packet_len, - data, packet_len); - return 0; -} - -/* Decode the parameters of a qSearch:memory packet. */ - -int -decode_search_memory_packet (const char *buf, int packet_len, - CORE_ADDR *start_addrp, - CORE_ADDR *search_space_lenp, - gdb_byte *pattern, unsigned int *pattern_lenp) -{ - const char *p = buf; - - p = decode_address_to_semicolon (start_addrp, p); - p = decode_address_to_semicolon (search_space_lenp, p); - packet_len -= p - buf; - *pattern_lenp = remote_unescape_input ((const gdb_byte *) p, packet_len, - pattern, packet_len); - return 0; -} - -static void -free_sym_cache (struct sym_cache *sym) -{ - if (sym != NULL) - { - free (sym->name); - free (sym); - } -} - -void -clear_symbol_cache (struct sym_cache **symcache_p) -{ - struct sym_cache *sym, *next; - - /* Check the cache first. */ - for (sym = *symcache_p; sym; sym = next) - { - next = sym->next; - free_sym_cache (sym); - } - - *symcache_p = NULL; -} - -/* Get the address of NAME, and return it in ADDRP if found. if - MAY_ASK_GDB is false, assume symbol cache misses are failures. - Returns 1 if the symbol is found, 0 if it is not, -1 on error. */ - -int -look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb) -{ - char own_buf[266], *p, *q; - int len; - struct sym_cache *sym; - struct process_info *proc; - - proc = current_process (); - - /* Check the cache first. */ - for (sym = proc->symbol_cache; sym; sym = sym->next) - if (strcmp (name, sym->name) == 0) - { - *addrp = sym->addr; - return 1; - } - - /* It might not be an appropriate time to look up a symbol, - e.g. while we're trying to fetch registers. */ - if (!may_ask_gdb) - return 0; - - /* Send the request. */ - strcpy (own_buf, "qSymbol:"); - hexify (own_buf + strlen ("qSymbol:"), name, strlen (name)); - if (putpkt (own_buf) < 0) - return -1; - - /* FIXME: Eventually add buffer overflow checking (to getpkt?) */ - len = getpkt (own_buf); - if (len < 0) - return -1; - - /* We ought to handle pretty much any packet at this point while we - wait for the qSymbol "response". That requires re-entering the - main loop. For now, this is an adequate approximation; allow - GDB to read from memory while it figures out the address of the - symbol. */ - while (own_buf[0] == 'm') - { - CORE_ADDR mem_addr; - unsigned char *mem_buf; - unsigned int mem_len; - - decode_m_packet (&own_buf[1], &mem_addr, &mem_len); - mem_buf = xmalloc (mem_len); - if (read_inferior_memory (mem_addr, mem_buf, mem_len) == 0) - convert_int_to_ascii (mem_buf, own_buf, mem_len); - else - write_enn (own_buf); - free (mem_buf); - if (putpkt (own_buf) < 0) - return -1; - len = getpkt (own_buf); - if (len < 0) - return -1; - } - - if (strncmp (own_buf, "qSymbol:", strlen ("qSymbol:")) != 0) - { - warning ("Malformed response to qSymbol, ignoring: %s\n", own_buf); - return -1; - } - - p = own_buf + strlen ("qSymbol:"); - q = p; - while (*q && *q != ':') - q++; - - /* Make sure we found a value for the symbol. */ - if (p == q || *q == '\0') - return 0; - - decode_address (addrp, p, q - p); - - /* Save the symbol in our cache. */ - sym = xmalloc (sizeof (*sym)); - sym->name = xstrdup (name); - sym->addr = *addrp; - sym->next = proc->symbol_cache; - proc->symbol_cache = sym; - - return 1; -} - -/* Relocate an instruction to execute at a different address. OLDLOC - is the address in the inferior memory where the instruction to - relocate is currently at. On input, TO points to the destination - where we want the instruction to be copied (and possibly adjusted) - to. On output, it points to one past the end of the resulting - instruction(s). The effect of executing the instruction at TO - shall be the same as if executing it at FROM. For example, call - instructions that implicitly push the return address on the stack - should be adjusted to return to the instruction after OLDLOC; - relative branches, and other PC-relative instructions need the - offset adjusted; etc. Returns 0 on success, -1 on failure. */ - -int -relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc) -{ - char own_buf[266]; - int len; - ULONGEST written = 0; - - /* Send the request. */ - strcpy (own_buf, "qRelocInsn:"); - sprintf (own_buf, "qRelocInsn:%s;%s", paddress (oldloc), - paddress (*to)); - if (putpkt (own_buf) < 0) - return -1; - - /* FIXME: Eventually add buffer overflow checking (to getpkt?) */ - len = getpkt (own_buf); - if (len < 0) - return -1; - - /* We ought to handle pretty much any packet at this point while we - wait for the qRelocInsn "response". That requires re-entering - the main loop. For now, this is an adequate approximation; allow - GDB to access memory. */ - while (own_buf[0] == 'm' || own_buf[0] == 'M' || own_buf[0] == 'X') - { - CORE_ADDR mem_addr; - unsigned char *mem_buf = NULL; - unsigned int mem_len; - - if (own_buf[0] == 'm') - { - decode_m_packet (&own_buf[1], &mem_addr, &mem_len); - mem_buf = xmalloc (mem_len); - if (read_inferior_memory (mem_addr, mem_buf, mem_len) == 0) - convert_int_to_ascii (mem_buf, own_buf, mem_len); - else - write_enn (own_buf); - } - else if (own_buf[0] == 'X') - { - if (decode_X_packet (&own_buf[1], len - 1, &mem_addr, - &mem_len, &mem_buf) < 0 - || write_inferior_memory (mem_addr, mem_buf, mem_len) != 0) - write_enn (own_buf); - else - write_ok (own_buf); - } - else - { - decode_M_packet (&own_buf[1], &mem_addr, &mem_len, &mem_buf); - if (write_inferior_memory (mem_addr, mem_buf, mem_len) == 0) - write_ok (own_buf); - else - write_enn (own_buf); - } - free (mem_buf); - if (putpkt (own_buf) < 0) - return -1; - len = getpkt (own_buf); - if (len < 0) - return -1; - } - - if (own_buf[0] == 'E') - { - warning ("An error occurred while relocating an instruction: %s\n", - own_buf); - return -1; - } - - if (strncmp (own_buf, "qRelocInsn:", strlen ("qRelocInsn:")) != 0) - { - warning ("Malformed response to qRelocInsn, ignoring: %s\n", - own_buf); - return -1; - } - - unpack_varlen_hex (own_buf + strlen ("qRelocInsn:"), &written); - - *to += written; - return 0; -} - -void -monitor_output (const char *msg) -{ - char *buf = xmalloc (strlen (msg) * 2 + 2); - - buf[0] = 'O'; - hexify (buf + 1, msg, 0); - - putpkt (buf); - free (buf); -} - -#endif diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c deleted file mode 100644 index 79eeba55e44..00000000000 --- a/gdb/gdbserver/server.c +++ /dev/null @@ -1,3276 +0,0 @@ -/* Main code for remote server for GDB. - Copyright (C) 1989, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 - 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" - -#if HAVE_UNISTD_H -#include <unistd.h> -#endif -#if HAVE_SIGNAL_H -#include <signal.h> -#endif -#if HAVE_SYS_WAIT_H -#include <sys/wait.h> -#endif - -ptid_t cont_thread; -ptid_t general_thread; - -int server_waiting; - -static int extended_protocol; -static int response_needed; -static int exit_requested; - -/* --once: Exit after the first connection has closed. */ -int run_once; - -int multi_process; -int non_stop; - -static char **program_argv, **wrapper_argv; - -/* Enable miscellaneous debugging output. The name is historical - it - was originally used to debug LinuxThreads support. */ -int debug_threads; - -/* Enable debugging of h/w breakpoint/watchpoint support. */ -int debug_hw_points; - -int pass_signals[TARGET_SIGNAL_LAST]; - -jmp_buf toplevel; - -const char *gdbserver_xmltarget; - -/* The PID of the originally created or attached inferior. Used to - send signals to the process when GDB sends us an asynchronous interrupt - (user hitting Control-C in the client), and to wait for the child to exit - when no longer debugging it. */ - -unsigned long signal_pid; - -#ifdef SIGTTOU -/* A file descriptor for the controlling terminal. */ -int terminal_fd; - -/* TERMINAL_FD's original foreground group. */ -pid_t old_foreground_pgrp; - -/* Hand back terminal ownership to the original foreground group. */ - -static void -restore_old_foreground_pgrp (void) -{ - tcsetpgrp (terminal_fd, old_foreground_pgrp); -} -#endif - -/* Set if you want to disable optional thread related packets support - in gdbserver, for the sake of testing GDB against stubs that don't - support them. */ -int disable_packet_vCont; -int disable_packet_Tthread; -int disable_packet_qC; -int disable_packet_qfThreadInfo; - -/* Last status reported to GDB. */ -static struct target_waitstatus last_status; -static ptid_t last_ptid; - -static char *own_buf; -static unsigned char *mem_buf; - -/* Structure holding information relative to a single stop reply. We - keep a queue of these (really a singly-linked list) to push to GDB - in non-stop mode. */ -struct vstop_notif -{ - /* Pointer to next in list. */ - struct vstop_notif *next; - - /* Thread or process that got the event. */ - ptid_t ptid; - - /* Event info. */ - struct target_waitstatus status; -}; - -/* The pending stop replies list head. */ -static struct vstop_notif *notif_queue = NULL; - -/* Put a stop reply to the stop reply queue. */ - -static void -queue_stop_reply (ptid_t ptid, struct target_waitstatus *status) -{ - struct vstop_notif *new_notif; - - new_notif = xmalloc (sizeof (*new_notif)); - new_notif->next = NULL; - new_notif->ptid = ptid; - new_notif->status = *status; - - if (notif_queue) - { - struct vstop_notif *tail; - for (tail = notif_queue; - tail && tail->next; - tail = tail->next) - ; - tail->next = new_notif; - } - else - notif_queue = new_notif; - - if (remote_debug) - { - int i = 0; - struct vstop_notif *n; - - for (n = notif_queue; n; n = n->next) - i++; - - fprintf (stderr, "pending stop replies: %d\n", i); - } -} - -/* Place an event in the stop reply queue, and push a notification if - we aren't sending one yet. */ - -void -push_event (ptid_t ptid, struct target_waitstatus *status) -{ - gdb_assert (status->kind != TARGET_WAITKIND_IGNORE); - - queue_stop_reply (ptid, status); - - /* If this is the first stop reply in the queue, then inform GDB - about it, by sending a Stop notification. */ - if (notif_queue->next == NULL) - { - char *p = own_buf; - strcpy (p, "Stop:"); - p += strlen (p); - prepare_resume_reply (p, - notif_queue->ptid, ¬if_queue->status); - putpkt_notif (own_buf); - } -} - -/* Get rid of the currently pending stop replies for PID. If PID is - -1, then apply to all processes. */ - -static void -discard_queued_stop_replies (int pid) -{ - struct vstop_notif *prev = NULL, *reply, *next; - - for (reply = notif_queue; reply; reply = next) - { - next = reply->next; - - if (pid == -1 - || ptid_get_pid (reply->ptid) == pid) - { - if (reply == notif_queue) - notif_queue = next; - else - prev->next = reply->next; - - free (reply); - } - else - prev = reply; - } -} - -/* If there are more stop replies to push, push one now. */ - -static void -send_next_stop_reply (char *own_buf) -{ - if (notif_queue) - prepare_resume_reply (own_buf, - notif_queue->ptid, - ¬if_queue->status); - else - write_ok (own_buf); -} - -static int -target_running (void) -{ - return all_threads.head != NULL; -} - -static int -start_inferior (char **argv) -{ - char **new_argv = argv; - - if (wrapper_argv != NULL) - { - int i, count = 1; - - for (i = 0; wrapper_argv[i] != NULL; i++) - count++; - for (i = 0; argv[i] != NULL; i++) - count++; - new_argv = alloca (sizeof (char *) * count); - count = 0; - for (i = 0; wrapper_argv[i] != NULL; i++) - new_argv[count++] = wrapper_argv[i]; - for (i = 0; argv[i] != NULL; i++) - new_argv[count++] = argv[i]; - new_argv[count] = NULL; - } - - if (debug_threads) - { - int i; - for (i = 0; new_argv[i]; ++i) - fprintf (stderr, "new_argv[%d] = \"%s\"\n", i, new_argv[i]); - fflush (stderr); - } - -#ifdef SIGTTOU - signal (SIGTTOU, SIG_DFL); - signal (SIGTTIN, SIG_DFL); -#endif - - signal_pid = create_inferior (new_argv[0], new_argv); - - /* FIXME: we don't actually know at this point that the create - actually succeeded. We won't know that until we wait. */ - fprintf (stderr, "Process %s created; pid = %ld\n", argv[0], - signal_pid); - fflush (stderr); - -#ifdef SIGTTOU - signal (SIGTTOU, SIG_IGN); - signal (SIGTTIN, SIG_IGN); - terminal_fd = fileno (stderr); - old_foreground_pgrp = tcgetpgrp (terminal_fd); - tcsetpgrp (terminal_fd, signal_pid); - atexit (restore_old_foreground_pgrp); -#endif - - if (wrapper_argv != NULL) - { - struct thread_resume resume_info; - - resume_info.thread = pid_to_ptid (signal_pid); - resume_info.kind = resume_continue; - resume_info.sig = 0; - - mywait (pid_to_ptid (signal_pid), &last_status, 0, 0); - - if (last_status.kind != TARGET_WAITKIND_STOPPED) - return signal_pid; - - do - { - (*the_target->resume) (&resume_info, 1); - - mywait (pid_to_ptid (signal_pid), &last_status, 0, 0); - if (last_status.kind != TARGET_WAITKIND_STOPPED) - return signal_pid; - - current_inferior->last_resume_kind = resume_stop; - current_inferior->last_status = last_status; - } - while (last_status.value.sig != TARGET_SIGNAL_TRAP); - - current_inferior->last_resume_kind = resume_stop; - current_inferior->last_status = last_status; - return signal_pid; - } - - /* Wait till we are at 1st instruction in program, return new pid - (assuming success). */ - last_ptid = mywait (pid_to_ptid (signal_pid), &last_status, 0, 0); - - if (last_status.kind != TARGET_WAITKIND_EXITED - && last_status.kind != TARGET_WAITKIND_SIGNALLED) - { - current_inferior->last_resume_kind = resume_stop; - current_inferior->last_status = last_status; - } - - return signal_pid; -} - -static int -attach_inferior (int pid) -{ - /* myattach should return -1 if attaching is unsupported, - 0 if it succeeded, and call error() otherwise. */ - - if (myattach (pid) != 0) - return -1; - - fprintf (stderr, "Attached; pid = %d\n", pid); - fflush (stderr); - - /* FIXME - It may be that we should get the SIGNAL_PID from the - attach function, so that it can be the main thread instead of - whichever we were told to attach to. */ - signal_pid = pid; - - if (!non_stop) - { - last_ptid = mywait (pid_to_ptid (pid), &last_status, 0, 0); - - /* GDB knows to ignore the first SIGSTOP after attaching to a running - process using the "attach" command, but this is different; it's - just using "target remote". Pretend it's just starting up. */ - if (last_status.kind == TARGET_WAITKIND_STOPPED - && last_status.value.sig == TARGET_SIGNAL_STOP) - last_status.value.sig = TARGET_SIGNAL_TRAP; - - current_inferior->last_resume_kind = resume_stop; - current_inferior->last_status = last_status; - } - - return 0; -} - -extern int remote_debug; - -/* Decode a qXfer read request. Return 0 if everything looks OK, - or -1 otherwise. */ - -static int -decode_xfer_read (char *buf, CORE_ADDR *ofs, unsigned int *len) -{ - /* After the read marker and annex, qXfer looks like a - traditional 'm' packet. */ - decode_m_packet (buf, ofs, len); - - return 0; -} - -static int -decode_xfer (char *buf, char **object, char **rw, char **annex, char **offset) -{ - /* Extract and NUL-terminate the object. */ - *object = buf; - while (*buf && *buf != ':') - buf++; - if (*buf == '\0') - return -1; - *buf++ = 0; - - /* Extract and NUL-terminate the read/write action. */ - *rw = buf; - while (*buf && *buf != ':') - buf++; - if (*buf == '\0') - return -1; - *buf++ = 0; - - /* Extract and NUL-terminate the annex. */ - *annex = buf; - while (*buf && *buf != ':') - buf++; - if (*buf == '\0') - return -1; - *buf++ = 0; - - *offset = buf; - return 0; -} - -/* Write the response to a successful qXfer read. Returns the - length of the (binary) data stored in BUF, corresponding - to as much of DATA/LEN as we could fit. IS_MORE controls - the first character of the response. */ -static int -write_qxfer_response (char *buf, const void *data, int len, int is_more) -{ - int out_len; - - if (is_more) - buf[0] = 'm'; - else - buf[0] = 'l'; - - return remote_escape_output (data, len, (unsigned char *) buf + 1, &out_len, - PBUFSIZ - 2) + 1; -} - -/* Handle all of the extended 'Q' packets. */ - -static void -handle_general_set (char *own_buf) -{ - if (strncmp ("QPassSignals:", own_buf, strlen ("QPassSignals:")) == 0) - { - int numsigs = (int) TARGET_SIGNAL_LAST, i; - const char *p = own_buf + strlen ("QPassSignals:"); - CORE_ADDR cursig; - - p = decode_address_to_semicolon (&cursig, p); - for (i = 0; i < numsigs; i++) - { - if (i == cursig) - { - pass_signals[i] = 1; - if (*p == '\0') - /* Keep looping, to clear the remaining signals. */ - cursig = -1; - else - p = decode_address_to_semicolon (&cursig, p); - } - else - pass_signals[i] = 0; - } - strcpy (own_buf, "OK"); - return; - } - - if (strcmp (own_buf, "QStartNoAckMode") == 0) - { - if (remote_debug) - { - fprintf (stderr, "[noack mode enabled]\n"); - fflush (stderr); - } - - noack_mode = 1; - write_ok (own_buf); - return; - } - - if (strncmp (own_buf, "QNonStop:", 9) == 0) - { - char *mode = own_buf + 9; - int req = -1; - char *req_str; - - if (strcmp (mode, "0") == 0) - req = 0; - else if (strcmp (mode, "1") == 0) - req = 1; - else - { - /* We don't know what this mode is, so complain to - GDB. */ - fprintf (stderr, "Unknown non-stop mode requested: %s\n", - own_buf); - write_enn (own_buf); - return; - } - - req_str = req ? "non-stop" : "all-stop"; - if (start_non_stop (req) != 0) - { - fprintf (stderr, "Setting %s mode failed\n", req_str); - write_enn (own_buf); - return; - } - - non_stop = req; - - if (remote_debug) - fprintf (stderr, "[%s mode enabled]\n", req_str); - - write_ok (own_buf); - return; - } - - if (target_supports_tracepoints () - && handle_tracepoint_general_set (own_buf)) - return; - - /* Otherwise we didn't know what packet it was. Say we didn't - understand it. */ - own_buf[0] = 0; -} - -static const char * -get_features_xml (const char *annex) -{ - /* gdbserver_xmltarget defines what to return when looking - for the "target.xml" file. Its contents can either be - verbatim XML code (prefixed with a '@') or else the name - of the actual XML file to be used in place of "target.xml". - - This variable is set up from the auto-generated - init_registers_... routine for the current target. */ - - if (gdbserver_xmltarget - && strcmp (annex, "target.xml") == 0) - { - if (*gdbserver_xmltarget == '@') - return gdbserver_xmltarget + 1; - else - annex = gdbserver_xmltarget; - } - -#ifdef USE_XML - { - extern const char *const xml_builtin[][2]; - int i; - - /* Look for the annex. */ - for (i = 0; xml_builtin[i][0] != NULL; i++) - if (strcmp (annex, xml_builtin[i][0]) == 0) - break; - - if (xml_builtin[i][0] != NULL) - return xml_builtin[i][1]; - } -#endif - - return NULL; -} - -void -monitor_show_help (void) -{ - monitor_output ("The following monitor commands are supported:\n"); - monitor_output (" set debug <0|1>\n"); - monitor_output (" Enable general debugging messages\n"); - monitor_output (" set debug-hw-points <0|1>\n"); - monitor_output (" Enable h/w breakpoint/watchpoint debugging messages\n"); - monitor_output (" set remote-debug <0|1>\n"); - monitor_output (" Enable remote protocol debugging messages\n"); - monitor_output (" exit\n"); - monitor_output (" Quit GDBserver\n"); -} - -/* Read trace frame or inferior memory. Returns the number of bytes - actually read, zero when no further transfer is possible, and -1 on - error. Return of a positive value smaller than LEN does not - indicate there's no more to be read, only the end of the transfer. - E.g., when GDB reads memory from a traceframe, a first request may - be served from a memory block that does not cover the whole request - length. A following request gets the rest served from either - another block (of the same traceframe) or from the read-only - regions. */ - -static int -gdb_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - int res; - - if (current_traceframe >= 0) - { - ULONGEST nbytes; - ULONGEST length = len; - - if (traceframe_read_mem (current_traceframe, - memaddr, myaddr, len, &nbytes)) - return EIO; - /* Data read from trace buffer, we're done. */ - if (nbytes > 0) - return nbytes; - if (!in_readonly_region (memaddr, length)) - return -1; - /* Otherwise we have a valid readonly case, fall through. */ - /* (assume no half-trace half-real blocks for now) */ - } - - res = prepare_to_access_memory (); - if (res == 0) - { - res = read_inferior_memory (memaddr, myaddr, len); - done_accessing_memory (); - - return res == 0 ? len : -1; - } - else - return -1; -} - -/* Write trace frame or inferior memory. Actually, writing to trace - frames is forbidden. */ - -static int -gdb_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len) -{ - if (current_traceframe >= 0) - return EIO; - else - { - int ret; - - ret = prepare_to_access_memory (); - if (ret == 0) - { - ret = write_inferior_memory (memaddr, myaddr, len); - done_accessing_memory (); - } - return ret; - } -} - -/* Subroutine of handle_search_memory to simplify it. */ - -static int -handle_search_memory_1 (CORE_ADDR start_addr, CORE_ADDR search_space_len, - gdb_byte *pattern, unsigned pattern_len, - gdb_byte *search_buf, - unsigned chunk_size, unsigned search_buf_size, - CORE_ADDR *found_addrp) -{ - /* Prime the search buffer. */ - - if (gdb_read_memory (start_addr, search_buf, search_buf_size) - != search_buf_size) - { - warning ("Unable to access target memory at 0x%lx, halting search.", - (long) start_addr); - return -1; - } - - /* Perform the search. - - The loop is kept simple by allocating [N + pattern-length - 1] bytes. - When we've scanned N bytes we copy the trailing bytes to the start and - read in another N bytes. */ - - while (search_space_len >= pattern_len) - { - gdb_byte *found_ptr; - unsigned nr_search_bytes = (search_space_len < search_buf_size - ? search_space_len - : search_buf_size); - - found_ptr = memmem (search_buf, nr_search_bytes, pattern, pattern_len); - - if (found_ptr != NULL) - { - CORE_ADDR found_addr = start_addr + (found_ptr - search_buf); - *found_addrp = found_addr; - return 1; - } - - /* Not found in this chunk, skip to next chunk. */ - - /* Don't let search_space_len wrap here, it's unsigned. */ - if (search_space_len >= chunk_size) - search_space_len -= chunk_size; - else - search_space_len = 0; - - if (search_space_len >= pattern_len) - { - unsigned keep_len = search_buf_size - chunk_size; - CORE_ADDR read_addr = start_addr + chunk_size + keep_len; - int nr_to_read; - - /* Copy the trailing part of the previous iteration to the front - of the buffer for the next iteration. */ - memcpy (search_buf, search_buf + chunk_size, keep_len); - - nr_to_read = (search_space_len - keep_len < chunk_size - ? search_space_len - keep_len - : chunk_size); - - if (gdb_read_memory (read_addr, search_buf + keep_len, - nr_to_read) != search_buf_size) - { - warning ("Unable to access target memory " - "at 0x%lx, halting search.", - (long) read_addr); - return -1; - } - - start_addr += chunk_size; - } - } - - /* Not found. */ - - return 0; -} - -/* Handle qSearch:memory packets. */ - -static void -handle_search_memory (char *own_buf, int packet_len) -{ - CORE_ADDR start_addr; - CORE_ADDR search_space_len; - gdb_byte *pattern; - unsigned int pattern_len; - /* NOTE: also defined in find.c testcase. */ -#define SEARCH_CHUNK_SIZE 16000 - const unsigned chunk_size = SEARCH_CHUNK_SIZE; - /* Buffer to hold memory contents for searching. */ - gdb_byte *search_buf; - unsigned search_buf_size; - int found; - CORE_ADDR found_addr; - int cmd_name_len = sizeof ("qSearch:memory:") - 1; - - pattern = malloc (packet_len); - if (pattern == NULL) - { - error ("Unable to allocate memory to perform the search"); - strcpy (own_buf, "E00"); - return; - } - if (decode_search_memory_packet (own_buf + cmd_name_len, - packet_len - cmd_name_len, - &start_addr, &search_space_len, - pattern, &pattern_len) < 0) - { - free (pattern); - error ("Error in parsing qSearch:memory packet"); - strcpy (own_buf, "E00"); - return; - } - - search_buf_size = chunk_size + pattern_len - 1; - - /* No point in trying to allocate a buffer larger than the search space. */ - if (search_space_len < search_buf_size) - search_buf_size = search_space_len; - - search_buf = malloc (search_buf_size); - if (search_buf == NULL) - { - free (pattern); - error ("Unable to allocate memory to perform the search"); - strcpy (own_buf, "E00"); - return; - } - - found = handle_search_memory_1 (start_addr, search_space_len, - pattern, pattern_len, - search_buf, chunk_size, search_buf_size, - &found_addr); - - if (found > 0) - sprintf (own_buf, "1,%lx", (long) found_addr); - else if (found == 0) - strcpy (own_buf, "0"); - else - strcpy (own_buf, "E00"); - - free (search_buf); - free (pattern); -} - -#define require_running(BUF) \ - if (!target_running ()) \ - { \ - write_enn (BUF); \ - return; \ - } - -/* Handle monitor commands not handled by target-specific handlers. */ - -static void -handle_monitor_command (char *mon) -{ - if (strcmp (mon, "set debug 1") == 0) - { - debug_threads = 1; - monitor_output ("Debug output enabled.\n"); - } - else if (strcmp (mon, "set debug 0") == 0) - { - debug_threads = 0; - monitor_output ("Debug output disabled.\n"); - } - else if (strcmp (mon, "set debug-hw-points 1") == 0) - { - debug_hw_points = 1; - monitor_output ("H/W point debugging output enabled.\n"); - } - else if (strcmp (mon, "set debug-hw-points 0") == 0) - { - debug_hw_points = 0; - monitor_output ("H/W point debugging output disabled.\n"); - } - else if (strcmp (mon, "set remote-debug 1") == 0) - { - remote_debug = 1; - monitor_output ("Protocol debug output enabled.\n"); - } - else if (strcmp (mon, "set remote-debug 0") == 0) - { - remote_debug = 0; - monitor_output ("Protocol debug output disabled.\n"); - } - else if (strcmp (mon, "help") == 0) - monitor_show_help (); - else if (strcmp (mon, "exit") == 0) - exit_requested = 1; - else - { - monitor_output ("Unknown monitor command.\n\n"); - monitor_show_help (); - write_enn (own_buf); - } -} - -/* Associates a callback with each supported qXfer'able object. */ - -struct qxfer -{ - /* The object this handler handles. */ - const char *object; - - /* Request that the target transfer up to LEN 8-bit bytes of the - target's OBJECT. The OFFSET, for a seekable object, specifies - the starting point. The ANNEX can be used to provide additional - data-specific information to the target. - - Return the number of bytes actually transfered, zero when no - further transfer is possible, -1 on error, and -2 when the - transfer is not supported. Return of a positive value smaller - than LEN does not indicate the end of the object, only the end of - the transfer. - - One, and only one, of readbuf or writebuf must be non-NULL. */ - int (*xfer) (const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, LONGEST len); -}; - -/* Handle qXfer:auxv:read. */ - -static int -handle_qxfer_auxv (const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, LONGEST len) -{ - if (the_target->read_auxv == NULL || writebuf != NULL) - return -2; - - if (annex[0] != '\0' || !target_running ()) - return -1; - - return (*the_target->read_auxv) (offset, readbuf, len); -} - -/* Handle qXfer:features:read. */ - -static int -handle_qxfer_features (const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, LONGEST len) -{ - const char *document; - size_t total_len; - - if (writebuf != NULL) - return -2; - - if (!target_running ()) - return -1; - - /* Grab the correct annex. */ - document = get_features_xml (annex); - if (document == NULL) - return -1; - - total_len = strlen (document); - - if (offset > total_len) - return -1; - - if (offset + len > total_len) - len = total_len - offset; - - memcpy (readbuf, document + offset, len); - return len; -} - -/* Handle qXfer:libraries:read. */ - -static int -handle_qxfer_libraries (const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, LONGEST len) -{ - unsigned int total_len; - char *document, *p; - struct inferior_list_entry *dll_ptr; - - if (writebuf != NULL) - return -2; - - if (annex[0] != '\0' || !target_running ()) - return -1; - - /* Over-estimate the necessary memory. Assume that every character - in the library name must be escaped. */ - total_len = 64; - for (dll_ptr = all_dlls.head; dll_ptr != NULL; dll_ptr = dll_ptr->next) - total_len += 128 + 6 * strlen (((struct dll_info *) dll_ptr)->name); - - document = malloc (total_len); - if (document == NULL) - return -1; - - strcpy (document, "<library-list>\n"); - p = document + strlen (document); - - for (dll_ptr = all_dlls.head; dll_ptr != NULL; dll_ptr = dll_ptr->next) - { - struct dll_info *dll = (struct dll_info *) dll_ptr; - char *name; - - strcpy (p, " <library name=\""); - p = p + strlen (p); - name = xml_escape_text (dll->name); - strcpy (p, name); - free (name); - p = p + strlen (p); - strcpy (p, "\"><segment address=\""); - p = p + strlen (p); - sprintf (p, "0x%lx", (long) dll->base_addr); - p = p + strlen (p); - strcpy (p, "\"/></library>\n"); - p = p + strlen (p); - } - - strcpy (p, "</library-list>\n"); - - total_len = strlen (document); - - if (offset > total_len) - { - free (document); - return -1; - } - - if (offset + len > total_len) - len = total_len - offset; - - memcpy (readbuf, document + offset, len); - free (document); - return len; -} - -/* Handle qXfer:osadata:read. */ - -static int -handle_qxfer_osdata (const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, LONGEST len) -{ - if (the_target->qxfer_osdata == NULL || writebuf != NULL) - return -2; - - return (*the_target->qxfer_osdata) (annex, readbuf, NULL, offset, len); -} - -/* Handle qXfer:siginfo:read and qXfer:siginfo:write. */ - -static int -handle_qxfer_siginfo (const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, LONGEST len) -{ - if (the_target->qxfer_siginfo == NULL) - return -2; - - if (annex[0] != '\0' || !target_running ()) - return -1; - - return (*the_target->qxfer_siginfo) (annex, readbuf, writebuf, offset, len); -} - -/* Handle qXfer:spu:read and qXfer:spu:write. */ - -static int -handle_qxfer_spu (const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, LONGEST len) -{ - if (the_target->qxfer_spu == NULL) - return -2; - - if (!target_running ()) - return -1; - - return (*the_target->qxfer_spu) (annex, readbuf, writebuf, offset, len); -} - -/* Handle qXfer:statictrace:read. */ - -static int -handle_qxfer_statictrace (const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, LONGEST len) -{ - ULONGEST nbytes; - - if (writebuf != NULL) - return -2; - - if (annex[0] != '\0' || !target_running () || current_traceframe == -1) - return -1; - - if (traceframe_read_sdata (current_traceframe, offset, - readbuf, len, &nbytes)) - return -1; - return nbytes; -} - -/* Helper for handle_qxfer_threads. */ - -static void -handle_qxfer_threads_proper (struct buffer *buffer) -{ - struct inferior_list_entry *thread; - - buffer_grow_str (buffer, "<threads>\n"); - - for (thread = all_threads.head; thread; thread = thread->next) - { - ptid_t ptid = thread_to_gdb_id ((struct thread_info *)thread); - char ptid_s[100]; - int core = -1; - char core_s[21]; - - write_ptid (ptid_s, ptid); - - if (the_target->core_of_thread) - core = (*the_target->core_of_thread) (ptid); - - if (core != -1) - { - sprintf (core_s, "%d", core); - buffer_xml_printf (buffer, "<thread id=\"%s\" core=\"%s\"/>\n", - ptid_s, core_s); - } - else - { - buffer_xml_printf (buffer, "<thread id=\"%s\"/>\n", - ptid_s); - } - } - - buffer_grow_str0 (buffer, "</threads>\n"); -} - -/* Handle qXfer:threads:read. */ - -static int -handle_qxfer_threads (const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, LONGEST len) -{ - static char *result = 0; - static unsigned int result_length = 0; - - if (writebuf != NULL) - return -2; - - if (!target_running () || annex[0] != '\0') - return -1; - - if (offset == 0) - { - struct buffer buffer; - /* When asked for data at offset 0, generate everything and store into - 'result'. Successive reads will be served off 'result'. */ - if (result) - free (result); - - buffer_init (&buffer); - - handle_qxfer_threads_proper (&buffer); - - result = buffer_finish (&buffer); - result_length = strlen (result); - buffer_free (&buffer); - } - - if (offset >= result_length) - { - /* We're out of data. */ - free (result); - result = NULL; - result_length = 0; - return 0; - } - - if (len > result_length - offset) - len = result_length - offset; - - memcpy (readbuf, result + offset, len); - - return len; -} - -/* Handle qXfer:traceframe-info:read. */ - -static int -handle_qxfer_traceframe_info (const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, LONGEST len) -{ - static char *result = 0; - static unsigned int result_length = 0; - - if (writebuf != NULL) - return -2; - - if (!target_running () || annex[0] != '\0' || current_traceframe == -1) - return -1; - - if (offset == 0) - { - struct buffer buffer; - - /* When asked for data at offset 0, generate everything and - store into 'result'. Successive reads will be served off - 'result'. */ - free (result); - - buffer_init (&buffer); - - traceframe_read_info (current_traceframe, &buffer); - - result = buffer_finish (&buffer); - result_length = strlen (result); - buffer_free (&buffer); - } - - if (offset >= result_length) - { - /* We're out of data. */ - free (result); - result = NULL; - result_length = 0; - return 0; - } - - if (len > result_length - offset) - len = result_length - offset; - - memcpy (readbuf, result + offset, len); - return len; -} - -/* Handle qXfer:fdpic:read. */ - -static int -handle_qxfer_fdpic (const char *annex, gdb_byte *readbuf, - const gdb_byte *writebuf, ULONGEST offset, LONGEST len) -{ - if (the_target->read_loadmap == NULL) - return -2; - - if (!target_running ()) - return -1; - - return (*the_target->read_loadmap) (annex, offset, readbuf, len); -} - -static const struct qxfer qxfer_packets[] = - { - { "auxv", handle_qxfer_auxv }, - { "fdpic", handle_qxfer_fdpic}, - { "features", handle_qxfer_features }, - { "libraries", handle_qxfer_libraries }, - { "osdata", handle_qxfer_osdata }, - { "siginfo", handle_qxfer_siginfo }, - { "spu", handle_qxfer_spu }, - { "statictrace", handle_qxfer_statictrace }, - { "threads", handle_qxfer_threads }, - { "traceframe-info", handle_qxfer_traceframe_info }, - }; - -static int -handle_qxfer (char *own_buf, int packet_len, int *new_packet_len_p) -{ - int i; - char *object; - char *rw; - char *annex; - char *offset; - - if (strncmp (own_buf, "qXfer:", 6) != 0) - return 0; - - /* Grab the object, r/w and annex. */ - if (decode_xfer (own_buf + 6, &object, &rw, &annex, &offset) < 0) - { - write_enn (own_buf); - return 1; - } - - for (i = 0; - i < sizeof (qxfer_packets) / sizeof (qxfer_packets[0]); - i++) - { - const struct qxfer *q = &qxfer_packets[i]; - - if (strcmp (object, q->object) == 0) - { - if (strcmp (rw, "read") == 0) - { - unsigned char *data; - int n; - CORE_ADDR ofs; - unsigned int len; - - /* Grab the offset and length. */ - if (decode_xfer_read (offset, &ofs, &len) < 0) - { - write_enn (own_buf); - return 1; - } - - /* Read one extra byte, as an indicator of whether there is - more. */ - if (len > PBUFSIZ - 2) - len = PBUFSIZ - 2; - data = malloc (len + 1); - if (data == NULL) - { - write_enn (own_buf); - return 1; - } - n = (*q->xfer) (annex, data, NULL, ofs, len + 1); - if (n == -2) - { - free (data); - return 0; - } - else if (n < 0) - write_enn (own_buf); - else if (n > len) - *new_packet_len_p = write_qxfer_response (own_buf, data, len, 1); - else - *new_packet_len_p = write_qxfer_response (own_buf, data, n, 0); - - free (data); - return 1; - } - else if (strcmp (rw, "write") == 0) - { - int n; - unsigned int len; - CORE_ADDR ofs; - unsigned char *data; - - strcpy (own_buf, "E00"); - data = malloc (packet_len - (offset - own_buf)); - if (data == NULL) - { - write_enn (own_buf); - return 1; - } - if (decode_xfer_write (offset, packet_len - (offset - own_buf), - &ofs, &len, data) < 0) - { - free (data); - write_enn (own_buf); - return 1; - } - - n = (*q->xfer) (annex, NULL, data, ofs, len); - if (n == -2) - { - free (data); - return 0; - } - else if (n < 0) - write_enn (own_buf); - else - sprintf (own_buf, "%x", n); - - free (data); - return 1; - } - - return 0; - } - } - - return 0; -} - -/* Table used by the crc32 function to calcuate the checksum. */ - -static unsigned int crc32_table[256] = -{0, 0}; - -/* Compute 32 bit CRC from inferior memory. - - On success, return 32 bit CRC. - On failure, return (unsigned long long) -1. */ - -static unsigned long long -crc32 (CORE_ADDR base, int len, unsigned int crc) -{ - if (!crc32_table[1]) - { - /* Initialize the CRC table and the decoding table. */ - int i, j; - unsigned int c; - - for (i = 0; i < 256; i++) - { - for (c = i << 24, j = 8; j > 0; --j) - c = c & 0x80000000 ? (c << 1) ^ 0x04c11db7 : (c << 1); - crc32_table[i] = c; - } - } - - while (len--) - { - unsigned char byte = 0; - - /* Return failure if memory read fails. */ - if (read_inferior_memory (base, &byte, 1) != 0) - return (unsigned long long) -1; - - crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ byte) & 255]; - base++; - } - return (unsigned long long) crc; -} - -/* Handle all of the extended 'q' packets. */ - -void -handle_query (char *own_buf, int packet_len, int *new_packet_len_p) -{ - static struct inferior_list_entry *thread_ptr; - - /* Reply the current thread id. */ - if (strcmp ("qC", own_buf) == 0 && !disable_packet_qC) - { - ptid_t gdb_id; - require_running (own_buf); - - if (!ptid_equal (general_thread, null_ptid) - && !ptid_equal (general_thread, minus_one_ptid)) - gdb_id = general_thread; - else - { - thread_ptr = all_threads.head; - gdb_id = thread_to_gdb_id ((struct thread_info *)thread_ptr); - } - - sprintf (own_buf, "QC"); - own_buf += 2; - write_ptid (own_buf, gdb_id); - return; - } - - if (strcmp ("qSymbol::", own_buf) == 0) - { - /* GDB is suggesting new symbols have been loaded. This may - mean a new shared library has been detected as loaded, so - take the opportunity to check if breakpoints we think are - inserted, still are. Note that it isn't guaranteed that - we'll see this when a shared library is loaded, and nor will - we see this for unloads (although breakpoints in unloaded - libraries shouldn't trigger), as GDB may not find symbols for - the library at all. We also re-validate breakpoints when we - see a second GDB breakpoint for the same address, and or when - we access breakpoint shadows. */ - validate_breakpoints (); - - if (target_supports_tracepoints ()) - tracepoint_look_up_symbols (); - - if (target_running () && the_target->look_up_symbols != NULL) - (*the_target->look_up_symbols) (); - - strcpy (own_buf, "OK"); - return; - } - - if (!disable_packet_qfThreadInfo) - { - if (strcmp ("qfThreadInfo", own_buf) == 0) - { - ptid_t gdb_id; - - require_running (own_buf); - thread_ptr = all_threads.head; - - *own_buf++ = 'm'; - gdb_id = thread_to_gdb_id ((struct thread_info *)thread_ptr); - write_ptid (own_buf, gdb_id); - thread_ptr = thread_ptr->next; - return; - } - - if (strcmp ("qsThreadInfo", own_buf) == 0) - { - ptid_t gdb_id; - - require_running (own_buf); - if (thread_ptr != NULL) - { - *own_buf++ = 'm'; - gdb_id = thread_to_gdb_id ((struct thread_info *)thread_ptr); - write_ptid (own_buf, gdb_id); - thread_ptr = thread_ptr->next; - return; - } - else - { - sprintf (own_buf, "l"); - return; - } - } - } - - if (the_target->read_offsets != NULL - && strcmp ("qOffsets", own_buf) == 0) - { - CORE_ADDR text, data; - - require_running (own_buf); - if (the_target->read_offsets (&text, &data)) - sprintf (own_buf, "Text=%lX;Data=%lX;Bss=%lX", - (long)text, (long)data, (long)data); - else - write_enn (own_buf); - - return; - } - - /* Protocol features query. */ - if (strncmp ("qSupported", own_buf, 10) == 0 - && (own_buf[10] == ':' || own_buf[10] == '\0')) - { - char *p = &own_buf[10]; - int gdb_supports_qRelocInsn = 0; - - /* Start processing qSupported packet. */ - target_process_qsupported (NULL); - - /* Process each feature being provided by GDB. The first - feature will follow a ':', and latter features will follow - ';'. */ - if (*p == ':') - { - char **qsupported = NULL; - int count = 0; - int i; - - /* Two passes, to avoid nested strtok calls in - target_process_qsupported. */ - for (p = strtok (p + 1, ";"); - p != NULL; - p = strtok (NULL, ";")) - { - count++; - qsupported = xrealloc (qsupported, count * sizeof (char *)); - qsupported[count - 1] = xstrdup (p); - } - - for (i = 0; i < count; i++) - { - p = qsupported[i]; - if (strcmp (p, "multiprocess+") == 0) - { - /* GDB supports and wants multi-process support if - possible. */ - if (target_supports_multi_process ()) - multi_process = 1; - } - else if (strcmp (p, "qRelocInsn+") == 0) - { - /* GDB supports relocate instruction requests. */ - gdb_supports_qRelocInsn = 1; - } - else - target_process_qsupported (p); - - free (p); - } - - free (qsupported); - } - - sprintf (own_buf, "PacketSize=%x;QPassSignals+", PBUFSIZ - 1); - - /* We do not have any hook to indicate whether the target backend - supports qXfer:libraries:read, so always report it. */ - strcat (own_buf, ";qXfer:libraries:read+"); - - if (the_target->read_auxv != NULL) - strcat (own_buf, ";qXfer:auxv:read+"); - - if (the_target->qxfer_spu != NULL) - strcat (own_buf, ";qXfer:spu:read+;qXfer:spu:write+"); - - if (the_target->qxfer_siginfo != NULL) - strcat (own_buf, ";qXfer:siginfo:read+;qXfer:siginfo:write+"); - - if (the_target->read_loadmap != NULL) - strcat (own_buf, ";qXfer:fdpic:read+"); - - /* We always report qXfer:features:read, as targets may - install XML files on a subsequent call to arch_setup. - If we reported to GDB on startup that we don't support - qXfer:feature:read at all, we will never be re-queried. */ - strcat (own_buf, ";qXfer:features:read+"); - - if (transport_is_reliable) - strcat (own_buf, ";QStartNoAckMode+"); - - if (the_target->qxfer_osdata != NULL) - strcat (own_buf, ";qXfer:osdata:read+"); - - if (target_supports_multi_process ()) - strcat (own_buf, ";multiprocess+"); - - if (target_supports_non_stop ()) - strcat (own_buf, ";QNonStop+"); - - strcat (own_buf, ";qXfer:threads:read+"); - - if (target_supports_tracepoints ()) - { - strcat (own_buf, ";ConditionalTracepoints+"); - strcat (own_buf, ";TraceStateVariables+"); - strcat (own_buf, ";TracepointSource+"); - strcat (own_buf, ";DisconnectedTracing+"); - if (gdb_supports_qRelocInsn && target_supports_fast_tracepoints ()) - strcat (own_buf, ";FastTracepoints+"); - strcat (own_buf, ";StaticTracepoints+"); - strcat (own_buf, ";qXfer:statictrace:read+"); - strcat (own_buf, ";qXfer:traceframe-info:read+"); - strcat (own_buf, ";EnableDisableTracepoints+"); - } - - return; - } - - /* Thread-local storage support. */ - if (the_target->get_tls_address != NULL - && strncmp ("qGetTLSAddr:", own_buf, 12) == 0) - { - char *p = own_buf + 12; - CORE_ADDR parts[2], address = 0; - int i, err; - ptid_t ptid = null_ptid; - - require_running (own_buf); - - for (i = 0; i < 3; i++) - { - char *p2; - int len; - - if (p == NULL) - break; - - p2 = strchr (p, ','); - if (p2) - { - len = p2 - p; - p2++; - } - else - { - len = strlen (p); - p2 = NULL; - } - - if (i == 0) - ptid = read_ptid (p, NULL); - else - decode_address (&parts[i - 1], p, len); - p = p2; - } - - if (p != NULL || i < 3) - err = 1; - else - { - struct thread_info *thread = find_thread_ptid (ptid); - - if (thread == NULL) - err = 2; - else - err = the_target->get_tls_address (thread, parts[0], parts[1], - &address); - } - - if (err == 0) - { - strcpy (own_buf, paddress(address)); - return; - } - else if (err > 0) - { - write_enn (own_buf); - return; - } - - /* Otherwise, pretend we do not understand this packet. */ - } - - /* Windows OS Thread Information Block address support. */ - if (the_target->get_tib_address != NULL - && strncmp ("qGetTIBAddr:", own_buf, 12) == 0) - { - char *annex; - int n; - CORE_ADDR tlb; - ptid_t ptid = read_ptid (own_buf + 12, &annex); - - n = (*the_target->get_tib_address) (ptid, &tlb); - if (n == 1) - { - strcpy (own_buf, paddress(tlb)); - return; - } - else if (n == 0) - { - write_enn (own_buf); - return; - } - return; - } - - /* Handle "monitor" commands. */ - if (strncmp ("qRcmd,", own_buf, 6) == 0) - { - char *mon = malloc (PBUFSIZ); - int len = strlen (own_buf + 6); - - if (mon == NULL) - { - write_enn (own_buf); - return; - } - - if ((len % 2) != 0 || unhexify (mon, own_buf + 6, len / 2) != len / 2) - { - write_enn (own_buf); - free (mon); - return; - } - mon[len / 2] = '\0'; - - write_ok (own_buf); - - if (the_target->handle_monitor_command == NULL - || (*the_target->handle_monitor_command) (mon) == 0) - /* Default processing. */ - handle_monitor_command (mon); - - free (mon); - return; - } - - if (strncmp ("qSearch:memory:", own_buf, - sizeof ("qSearch:memory:") - 1) == 0) - { - require_running (own_buf); - handle_search_memory (own_buf, packet_len); - return; - } - - if (strcmp (own_buf, "qAttached") == 0 - || strncmp (own_buf, "qAttached:", sizeof ("qAttached:") - 1) == 0) - { - struct process_info *process; - - if (own_buf[sizeof ("qAttached") - 1]) - { - int pid = strtoul (own_buf + sizeof ("qAttached:") - 1, NULL, 16); - process = (struct process_info *) - find_inferior_id (&all_processes, pid_to_ptid (pid)); - } - else - { - require_running (own_buf); - process = current_process (); - } - - if (process == NULL) - { - write_enn (own_buf); - return; - } - - strcpy (own_buf, process->attached ? "1" : "0"); - return; - } - - if (strncmp ("qCRC:", own_buf, 5) == 0) - { - /* CRC check (compare-section). */ - char *comma; - CORE_ADDR base; - int len; - unsigned long long crc; - - require_running (own_buf); - base = strtoul (own_buf + 5, &comma, 16); - if (*comma++ != ',') - { - write_enn (own_buf); - return; - } - len = strtoul (comma, NULL, 16); - crc = crc32 (base, len, 0xffffffff); - /* Check for memory failure. */ - if (crc == (unsigned long long) -1) - { - write_enn (own_buf); - return; - } - sprintf (own_buf, "C%lx", (unsigned long) crc); - return; - } - - if (handle_qxfer (own_buf, packet_len, new_packet_len_p)) - return; - - if (target_supports_tracepoints () && handle_tracepoint_query (own_buf)) - return; - - /* Otherwise we didn't know what packet it was. Say we didn't - understand it. */ - own_buf[0] = 0; -} - -static void gdb_wants_all_threads_stopped (void); - -/* Parse vCont packets. */ -void -handle_v_cont (char *own_buf) -{ - char *p, *q; - int n = 0, i = 0; - struct thread_resume *resume_info; - struct thread_resume default_action = {{0}}; - - /* Count the number of semicolons in the packet. There should be one - for every action. */ - p = &own_buf[5]; - while (p) - { - n++; - p++; - p = strchr (p, ';'); - } - - resume_info = malloc (n * sizeof (resume_info[0])); - if (resume_info == NULL) - goto err; - - p = &own_buf[5]; - while (*p) - { - p++; - - if (p[0] == 's' || p[0] == 'S') - resume_info[i].kind = resume_step; - else if (p[0] == 'c' || p[0] == 'C') - resume_info[i].kind = resume_continue; - else if (p[0] == 't') - resume_info[i].kind = resume_stop; - else - goto err; - - if (p[0] == 'S' || p[0] == 'C') - { - int sig; - sig = strtol (p + 1, &q, 16); - if (p == q) - goto err; - p = q; - - if (!target_signal_to_host_p (sig)) - goto err; - resume_info[i].sig = target_signal_to_host (sig); - } - else - { - resume_info[i].sig = 0; - p = p + 1; - } - - if (p[0] == 0) - { - resume_info[i].thread = minus_one_ptid; - default_action = resume_info[i]; - - /* Note: we don't increment i here, we'll overwrite this entry - the next time through. */ - } - else if (p[0] == ':') - { - ptid_t ptid = read_ptid (p + 1, &q); - - if (p == q) - goto err; - p = q; - if (p[0] != ';' && p[0] != 0) - goto err; - - resume_info[i].thread = ptid; - - i++; - } - } - - if (i < n) - resume_info[i] = default_action; - - /* Still used in occasional places in the backend. */ - if (n == 1 - && !ptid_equal (resume_info[0].thread, minus_one_ptid) - && resume_info[0].kind != resume_stop) - cont_thread = resume_info[0].thread; - else - cont_thread = minus_one_ptid; - set_desired_inferior (0); - - if (!non_stop) - enable_async_io (); - - (*the_target->resume) (resume_info, n); - - free (resume_info); - - if (non_stop) - write_ok (own_buf); - else - { - last_ptid = mywait (minus_one_ptid, &last_status, 0, 1); - - if (last_status.kind != TARGET_WAITKIND_EXITED - && last_status.kind != TARGET_WAITKIND_SIGNALLED) - current_inferior->last_status = last_status; - - /* From the client's perspective, all-stop mode always stops all - threads implicitly (and the target backend has already done - so by now). Tag all threads as "want-stopped", so we don't - resume them implicitly without the client telling us to. */ - gdb_wants_all_threads_stopped (); - prepare_resume_reply (own_buf, last_ptid, &last_status); - disable_async_io (); - - if (last_status.kind == TARGET_WAITKIND_EXITED - || last_status.kind == TARGET_WAITKIND_SIGNALLED) - mourn_inferior (find_process_pid (ptid_get_pid (last_ptid))); - } - return; - -err: - write_enn (own_buf); - free (resume_info); - return; -} - -/* Attach to a new program. Return 1 if successful, 0 if failure. */ -int -handle_v_attach (char *own_buf) -{ - int pid; - - pid = strtol (own_buf + 8, NULL, 16); - if (pid != 0 && attach_inferior (pid) == 0) - { - /* Don't report shared library events after attaching, even if - some libraries are preloaded. GDB will always poll the - library list. Avoids the "stopped by shared library event" - notice on the GDB side. */ - dlls_changed = 0; - - if (non_stop) - { - /* In non-stop, we don't send a resume reply. Stop events - will follow up using the normal notification - mechanism. */ - write_ok (own_buf); - } - else - prepare_resume_reply (own_buf, last_ptid, &last_status); - - return 1; - } - else - { - write_enn (own_buf); - return 0; - } -} - -/* Run a new program. Return 1 if successful, 0 if failure. */ -static int -handle_v_run (char *own_buf) -{ - char *p, *next_p, **new_argv; - int i, new_argc; - - new_argc = 0; - for (p = own_buf + strlen ("vRun;"); p && *p; p = strchr (p, ';')) - { - p++; - new_argc++; - } - - new_argv = calloc (new_argc + 2, sizeof (char *)); - if (new_argv == NULL) - { - write_enn (own_buf); - return 0; - } - - i = 0; - for (p = own_buf + strlen ("vRun;"); *p; p = next_p) - { - next_p = strchr (p, ';'); - if (next_p == NULL) - next_p = p + strlen (p); - - if (i == 0 && p == next_p) - new_argv[i] = NULL; - else - { - /* FIXME: Fail request if out of memory instead of dying. */ - new_argv[i] = xmalloc (1 + (next_p - p) / 2); - unhexify (new_argv[i], p, (next_p - p) / 2); - new_argv[i][(next_p - p) / 2] = '\0'; - } - - if (*next_p) - next_p++; - i++; - } - new_argv[i] = NULL; - - if (new_argv[0] == NULL) - { - /* GDB didn't specify a program to run. Use the program from the - last run with the new argument list. */ - - if (program_argv == NULL) - { - write_enn (own_buf); - freeargv (new_argv); - return 0; - } - - new_argv[0] = strdup (program_argv[0]); - if (new_argv[0] == NULL) - { - write_enn (own_buf); - freeargv (new_argv); - return 0; - } - } - - /* Free the old argv and install the new one. */ - freeargv (program_argv); - program_argv = new_argv; - - start_inferior (program_argv); - if (last_status.kind == TARGET_WAITKIND_STOPPED) - { - prepare_resume_reply (own_buf, last_ptid, &last_status); - - /* In non-stop, sending a resume reply doesn't set the general - thread, but GDB assumes a vRun sets it (this is so GDB can - query which is the main thread of the new inferior. */ - if (non_stop) - general_thread = last_ptid; - - return 1; - } - else - { - write_enn (own_buf); - return 0; - } -} - -/* Kill process. Return 1 if successful, 0 if failure. */ -int -handle_v_kill (char *own_buf) -{ - int pid; - char *p = &own_buf[6]; - if (multi_process) - pid = strtol (p, NULL, 16); - else - pid = signal_pid; - if (pid != 0 && kill_inferior (pid) == 0) - { - last_status.kind = TARGET_WAITKIND_SIGNALLED; - last_status.value.sig = TARGET_SIGNAL_KILL; - last_ptid = pid_to_ptid (pid); - discard_queued_stop_replies (pid); - write_ok (own_buf); - return 1; - } - else - { - write_enn (own_buf); - return 0; - } -} - -/* Handle a 'vStopped' packet. */ -static void -handle_v_stopped (char *own_buf) -{ - /* If we're waiting for GDB to acknowledge a pending stop reply, - consider that done. */ - if (notif_queue) - { - struct vstop_notif *head; - - if (remote_debug) - fprintf (stderr, "vStopped: acking %s\n", - target_pid_to_str (notif_queue->ptid)); - - head = notif_queue; - notif_queue = notif_queue->next; - free (head); - } - - /* Push another stop reply, or if there are no more left, an OK. */ - send_next_stop_reply (own_buf); -} - -/* Handle all of the extended 'v' packets. */ -void -handle_v_requests (char *own_buf, int packet_len, int *new_packet_len) -{ - if (!disable_packet_vCont) - { - if (strncmp (own_buf, "vCont;", 6) == 0) - { - require_running (own_buf); - handle_v_cont (own_buf); - return; - } - - if (strncmp (own_buf, "vCont?", 6) == 0) - { - strcpy (own_buf, "vCont;c;C;s;S;t"); - return; - } - } - - if (strncmp (own_buf, "vFile:", 6) == 0 - && handle_vFile (own_buf, packet_len, new_packet_len)) - return; - - if (strncmp (own_buf, "vAttach;", 8) == 0) - { - if (!multi_process && target_running ()) - { - fprintf (stderr, "Already debugging a process\n"); - write_enn (own_buf); - return; - } - handle_v_attach (own_buf); - return; - } - - if (strncmp (own_buf, "vRun;", 5) == 0) - { - if (!multi_process && target_running ()) - { - fprintf (stderr, "Already debugging a process\n"); - write_enn (own_buf); - return; - } - handle_v_run (own_buf); - return; - } - - if (strncmp (own_buf, "vKill;", 6) == 0) - { - if (!target_running ()) - { - fprintf (stderr, "No process to kill\n"); - write_enn (own_buf); - return; - } - handle_v_kill (own_buf); - return; - } - - if (strncmp (own_buf, "vStopped", 8) == 0) - { - handle_v_stopped (own_buf); - return; - } - - /* Otherwise we didn't know what packet it was. Say we didn't - understand it. */ - own_buf[0] = 0; - return; -} - -/* Resume inferior and wait for another event. In non-stop mode, - don't really wait here, but return immediatelly to the event - loop. */ -static void -myresume (char *own_buf, int step, int sig) -{ - struct thread_resume resume_info[2]; - int n = 0; - int valid_cont_thread; - - set_desired_inferior (0); - - valid_cont_thread = (!ptid_equal (cont_thread, null_ptid) - && !ptid_equal (cont_thread, minus_one_ptid)); - - if (step || sig || valid_cont_thread) - { - resume_info[0].thread - = ((struct inferior_list_entry *) current_inferior)->id; - if (step) - resume_info[0].kind = resume_step; - else - resume_info[0].kind = resume_continue; - resume_info[0].sig = sig; - n++; - } - - if (!valid_cont_thread) - { - resume_info[n].thread = minus_one_ptid; - resume_info[n].kind = resume_continue; - resume_info[n].sig = 0; - n++; - } - - if (!non_stop) - enable_async_io (); - - (*the_target->resume) (resume_info, n); - - if (non_stop) - write_ok (own_buf); - else - { - last_ptid = mywait (minus_one_ptid, &last_status, 0, 1); - - if (last_status.kind != TARGET_WAITKIND_EXITED - && last_status.kind != TARGET_WAITKIND_SIGNALLED) - { - current_inferior->last_resume_kind = resume_stop; - current_inferior->last_status = last_status; - } - - prepare_resume_reply (own_buf, last_ptid, &last_status); - disable_async_io (); - - if (last_status.kind == TARGET_WAITKIND_EXITED - || last_status.kind == TARGET_WAITKIND_SIGNALLED) - mourn_inferior (find_process_pid (ptid_get_pid (last_ptid))); - } -} - -/* Callback for for_each_inferior. Make a new stop reply for each - stopped thread. */ - -static int -queue_stop_reply_callback (struct inferior_list_entry *entry, void *arg) -{ - struct thread_info *thread = (struct thread_info *) entry; - - /* For now, assume targets that don't have this callback also don't - manage the thread's last_status field. */ - if (the_target->thread_stopped == NULL) - { - /* Pass the last stop reply back to GDB, but don't notify - yet. */ - queue_stop_reply (entry->id, &thread->last_status); - } - else - { - if (thread_stopped (thread)) - { - if (debug_threads) - fprintf (stderr, - "Reporting thread %s as already stopped with %s\n", - target_pid_to_str (entry->id), - target_waitstatus_to_string (&thread->last_status)); - - gdb_assert (thread->last_status.kind != TARGET_WAITKIND_IGNORE); - - /* Pass the last stop reply back to GDB, but don't notify - yet. */ - queue_stop_reply (entry->id, &thread->last_status); - } - } - - return 0; -} - -/* Set this inferior threads's state as "want-stopped". We won't - resume this thread until the client gives us another action for - it. */ - -static void -gdb_wants_thread_stopped (struct inferior_list_entry *entry) -{ - struct thread_info *thread = (struct thread_info *) entry; - - thread->last_resume_kind = resume_stop; - - if (thread->last_status.kind == TARGET_WAITKIND_IGNORE) - { - /* Most threads are stopped implicitly (all-stop); tag that with - signal 0. */ - thread->last_status.kind = TARGET_WAITKIND_STOPPED; - thread->last_status.value.sig = TARGET_SIGNAL_0; - } -} - -/* Set all threads' states as "want-stopped". */ - -static void -gdb_wants_all_threads_stopped (void) -{ - for_each_inferior (&all_threads, gdb_wants_thread_stopped); -} - -/* Clear the gdb_detached flag of every process. */ - -static void -gdb_reattached_process (struct inferior_list_entry *entry) -{ - struct process_info *process = (struct process_info *) entry; - - process->gdb_detached = 0; -} - -/* Status handler for the '?' packet. */ - -static void -handle_status (char *own_buf) -{ - /* GDB is connected, don't forward events to the target anymore. */ - for_each_inferior (&all_processes, gdb_reattached_process); - - /* In non-stop mode, we must send a stop reply for each stopped - thread. In all-stop mode, just send one for the first stopped - thread we find. */ - - if (non_stop) - { - discard_queued_stop_replies (-1); - find_inferior (&all_threads, queue_stop_reply_callback, NULL); - - /* The first is sent immediatly. OK is sent if there is no - stopped thread, which is the same handling of the vStopped - packet (by design). */ - send_next_stop_reply (own_buf); - } - else - { - pause_all (0); - stabilize_threads (); - gdb_wants_all_threads_stopped (); - - if (all_threads.head) - { - struct target_waitstatus status; - - status.kind = TARGET_WAITKIND_STOPPED; - status.value.sig = TARGET_SIGNAL_TRAP; - prepare_resume_reply (own_buf, - all_threads.head->id, &status); - } - else - strcpy (own_buf, "W00"); - } -} - -static void -gdbserver_version (void) -{ - printf ("GNU gdbserver %s%s\n" - "Copyright (C) 2011 Free Software Foundation, Inc.\n" - "gdbserver is free software, covered by the " - "GNU General Public License.\n" - "This gdbserver was configured as \"%s\"\n", - PKGVERSION, version, host_name); -} - -static void -gdbserver_usage (FILE *stream) -{ - fprintf (stream, "Usage:\tgdbserver [OPTIONS] COMM PROG [ARGS ...]\n" - "\tgdbserver [OPTIONS] --attach COMM PID\n" - "\tgdbserver [OPTIONS] --multi COMM\n" - "\n" - "COMM may either be a tty device (for serial debugging), or \n" - "HOST:PORT to listen for a TCP connection.\n" - "\n" - "Options:\n" - " --debug Enable general debugging output.\n" - " --remote-debug Enable remote protocol debugging output.\n" - " --version Display version information and exit.\n" - " --wrapper WRAPPER -- Run WRAPPER to start new programs.\n" - " --once Exit after the first connection has " - "closed.\n"); - if (REPORT_BUGS_TO[0] && stream == stdout) - fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO); -} - -static void -gdbserver_show_disableable (FILE *stream) -{ - fprintf (stream, "Disableable packets:\n" - " vCont \tAll vCont packets\n" - " qC \tQuerying the current thread\n" - " qfThreadInfo\tThread listing\n" - " Tthread \tPassing the thread specifier in the " - "T stop reply packet\n" - " threads \tAll of the above\n"); -} - - -#undef require_running -#define require_running(BUF) \ - if (!target_running ()) \ - { \ - write_enn (BUF); \ - break; \ - } - -static int -first_thread_of (struct inferior_list_entry *entry, void *args) -{ - int pid = * (int *) args; - - if (ptid_get_pid (entry->id) == pid) - return 1; - - return 0; -} - -static void -kill_inferior_callback (struct inferior_list_entry *entry) -{ - struct process_info *process = (struct process_info *) entry; - int pid = ptid_get_pid (process->head.id); - - kill_inferior (pid); - discard_queued_stop_replies (pid); -} - -/* Callback for for_each_inferior to detach or kill the inferior, - depending on whether we attached to it or not. - We inform the user whether we're detaching or killing the process - as this is only called when gdbserver is about to exit. */ - -static void -detach_or_kill_inferior_callback (struct inferior_list_entry *entry) -{ - struct process_info *process = (struct process_info *) entry; - int pid = ptid_get_pid (process->head.id); - - if (process->attached) - detach_inferior (pid); - else - kill_inferior (pid); - - discard_queued_stop_replies (pid); -} - -/* for_each_inferior callback for detach_or_kill_for_exit to print - the pids of started inferiors. */ - -static void -print_started_pid (struct inferior_list_entry *entry) -{ - struct process_info *process = (struct process_info *) entry; - - if (! process->attached) - { - int pid = ptid_get_pid (process->head.id); - fprintf (stderr, " %d", pid); - } -} - -/* for_each_inferior callback for detach_or_kill_for_exit to print - the pids of attached inferiors. */ - -static void -print_attached_pid (struct inferior_list_entry *entry) -{ - struct process_info *process = (struct process_info *) entry; - - if (process->attached) - { - int pid = ptid_get_pid (process->head.id); - fprintf (stderr, " %d", pid); - } -} - -/* Call this when exiting gdbserver with possible inferiors that need - to be killed or detached from. */ - -static void -detach_or_kill_for_exit (void) -{ - /* First print a list of the inferiors we will be killing/detaching. - This is to assist the user, for example, in case the inferior unexpectedly - dies after we exit: did we screw up or did the inferior exit on its own? - Having this info will save some head-scratching. */ - - if (have_started_inferiors_p ()) - { - fprintf (stderr, "Killing process(es):"); - for_each_inferior (&all_processes, print_started_pid); - fprintf (stderr, "\n"); - } - if (have_attached_inferiors_p ()) - { - fprintf (stderr, "Detaching process(es):"); - for_each_inferior (&all_processes, print_attached_pid); - fprintf (stderr, "\n"); - } - - /* Now we can kill or detach the inferiors. */ - - for_each_inferior (&all_processes, detach_or_kill_inferior_callback); -} - -int -main (int argc, char *argv[]) -{ - int bad_attach; - int pid; - char *arg_end, *port; - char **next_arg = &argv[1]; - int multi_mode = 0; - int attach = 0; - int was_running; - - while (*next_arg != NULL && **next_arg == '-') - { - if (strcmp (*next_arg, "--version") == 0) - { - gdbserver_version (); - exit (0); - } - else if (strcmp (*next_arg, "--help") == 0) - { - gdbserver_usage (stdout); - exit (0); - } - else if (strcmp (*next_arg, "--attach") == 0) - attach = 1; - else if (strcmp (*next_arg, "--multi") == 0) - multi_mode = 1; - else if (strcmp (*next_arg, "--wrapper") == 0) - { - next_arg++; - - wrapper_argv = next_arg; - while (*next_arg != NULL && strcmp (*next_arg, "--") != 0) - next_arg++; - - if (next_arg == wrapper_argv || *next_arg == NULL) - { - gdbserver_usage (stderr); - exit (1); - } - - /* Consume the "--". */ - *next_arg = NULL; - } - else if (strcmp (*next_arg, "--debug") == 0) - debug_threads = 1; - else if (strcmp (*next_arg, "--remote-debug") == 0) - remote_debug = 1; - else if (strcmp (*next_arg, "--disable-packet") == 0) - { - gdbserver_show_disableable (stdout); - exit (0); - } - else if (strncmp (*next_arg, - "--disable-packet=", - sizeof ("--disable-packet=") - 1) == 0) - { - char *packets, *tok; - - packets = *next_arg += sizeof ("--disable-packet=") - 1; - for (tok = strtok (packets, ","); - tok != NULL; - tok = strtok (NULL, ",")) - { - if (strcmp ("vCont", tok) == 0) - disable_packet_vCont = 1; - else if (strcmp ("Tthread", tok) == 0) - disable_packet_Tthread = 1; - else if (strcmp ("qC", tok) == 0) - disable_packet_qC = 1; - else if (strcmp ("qfThreadInfo", tok) == 0) - disable_packet_qfThreadInfo = 1; - else if (strcmp ("threads", tok) == 0) - { - disable_packet_vCont = 1; - disable_packet_Tthread = 1; - disable_packet_qC = 1; - disable_packet_qfThreadInfo = 1; - } - else - { - fprintf (stderr, "Don't know how to disable \"%s\".\n\n", - tok); - gdbserver_show_disableable (stderr); - exit (1); - } - } - } - else if (strcmp (*next_arg, "--once") == 0) - run_once = 1; - else - { - fprintf (stderr, "Unknown argument: %s\n", *next_arg); - exit (1); - } - - next_arg++; - continue; - } - - if (setjmp (toplevel)) - { - fprintf (stderr, "Exiting\n"); - exit (1); - } - - port = *next_arg; - next_arg++; - if (port == NULL || (!attach && !multi_mode && *next_arg == NULL)) - { - gdbserver_usage (stderr); - exit (1); - } - - bad_attach = 0; - pid = 0; - - /* --attach used to come after PORT, so allow it there for - compatibility. */ - if (*next_arg != NULL && strcmp (*next_arg, "--attach") == 0) - { - attach = 1; - next_arg++; - } - - if (attach - && (*next_arg == NULL - || (*next_arg)[0] == '\0' - || (pid = strtoul (*next_arg, &arg_end, 0)) == 0 - || *arg_end != '\0' - || next_arg[1] != NULL)) - bad_attach = 1; - - if (bad_attach) - { - gdbserver_usage (stderr); - exit (1); - } - - initialize_async_io (); - initialize_low (); - if (target_supports_tracepoints ()) - initialize_tracepoint (); - - own_buf = xmalloc (PBUFSIZ + 1); - mem_buf = xmalloc (PBUFSIZ); - - if (pid == 0 && *next_arg != NULL) - { - int i, n; - - n = argc - (next_arg - argv); - program_argv = xmalloc (sizeof (char *) * (n + 1)); - for (i = 0; i < n; i++) - program_argv[i] = xstrdup (next_arg[i]); - program_argv[i] = NULL; - - /* Wait till we are at first instruction in program. */ - start_inferior (program_argv); - - /* We are now (hopefully) stopped at the first instruction of - the target process. This assumes that the target process was - successfully created. */ - } - else if (pid != 0) - { - if (attach_inferior (pid) == -1) - error ("Attaching not supported on this target"); - - /* Otherwise succeeded. */ - } - else - { - last_status.kind = TARGET_WAITKIND_EXITED; - last_status.value.integer = 0; - last_ptid = minus_one_ptid; - } - - /* Don't report shared library events on the initial connection, - even if some libraries are preloaded. Avoids the "stopped by - shared library event" notice on gdb side. */ - dlls_changed = 0; - - if (setjmp (toplevel)) - { - detach_or_kill_for_exit (); - exit (1); - } - - if (last_status.kind == TARGET_WAITKIND_EXITED - || last_status.kind == TARGET_WAITKIND_SIGNALLED) - was_running = 0; - else - was_running = 1; - - if (!was_running && !multi_mode) - { - fprintf (stderr, "No program to debug. GDBserver exiting.\n"); - exit (1); - } - - remote_prepare (port); - - while (1) - { - noack_mode = 0; - multi_process = 0; - /* Be sure we're out of tfind mode. */ - current_traceframe = -1; - - remote_open (port); - - if (setjmp (toplevel) != 0) - { - /* An error occurred. */ - if (response_needed) - { - write_enn (own_buf); - putpkt (own_buf); - } - } - - /* Wait for events. This will return when all event sources are - removed from the event loop. */ - start_event_loop (); - - /* If an exit was requested (using the "monitor exit" command), - terminate now. The only other way to get here is for - getpkt to fail; close the connection and reopen it at the - top of the loop. */ - - if (exit_requested || run_once) - { - detach_or_kill_for_exit (); - exit (0); - } - - fprintf (stderr, - "Remote side has terminated connection. " - "GDBserver will reopen the connection.\n"); - - if (tracing) - { - if (disconnected_tracing) - { - /* Try to enable non-stop/async mode, so we we can both - wait for an async socket accept, and handle async - target events simultaneously. There's also no point - either in having the target always stop all threads, - when we're going to pass signals down without - informing GDB. */ - if (!non_stop) - { - if (start_non_stop (1)) - non_stop = 1; - - /* Detaching implicitly resumes all threads; simply - disconnecting does not. */ - } - } - else - { - fprintf (stderr, - "Disconnected tracing disabled; stopping trace run.\n"); - stop_tracing (); - } - } - } -} - -/* Event loop callback that handles a serial event. The first byte in - the serial buffer gets us here. We expect characters to arrive at - a brisk pace, so we read the rest of the packet with a blocking - getpkt call. */ - -static int -process_serial_event (void) -{ - char ch; - int i = 0; - int signal; - unsigned int len; - int res; - CORE_ADDR mem_addr; - int pid; - unsigned char sig; - int packet_len; - int new_packet_len = -1; - - /* Used to decide when gdbserver should exit in - multi-mode/remote. */ - static int have_ran = 0; - - if (!have_ran) - have_ran = target_running (); - - disable_async_io (); - - response_needed = 0; - packet_len = getpkt (own_buf); - if (packet_len <= 0) - { - remote_close (); - /* Force an event loop break. */ - return -1; - } - response_needed = 1; - - i = 0; - ch = own_buf[i++]; - switch (ch) - { - case 'q': - handle_query (own_buf, packet_len, &new_packet_len); - break; - case 'Q': - handle_general_set (own_buf); - break; - case 'D': - require_running (own_buf); - - if (multi_process) - { - i++; /* skip ';' */ - pid = strtol (&own_buf[i], NULL, 16); - } - else - pid = - ptid_get_pid (((struct inferior_list_entry *) current_inferior)->id); - - if (tracing && disconnected_tracing) - { - struct thread_resume resume_info; - struct process_info *process = find_process_pid (pid); - - if (process == NULL) - { - write_enn (own_buf); - break; - } - - fprintf (stderr, - "Disconnected tracing in effect, " - "leaving gdbserver attached to the process\n"); - - /* Make sure we're in non-stop/async mode, so we we can both - wait for an async socket accept, and handle async target - events simultaneously. There's also no point either in - having the target stop all threads, when we're going to - pass signals down without informing GDB. */ - if (!non_stop) - { - if (debug_threads) - fprintf (stderr, "Forcing non-stop mode\n"); - - non_stop = 1; - start_non_stop (1); - } - - process->gdb_detached = 1; - - /* Detaching implicitly resumes all threads. */ - resume_info.thread = minus_one_ptid; - resume_info.kind = resume_continue; - resume_info.sig = 0; - (*the_target->resume) (&resume_info, 1); - - write_ok (own_buf); - break; /* from switch/case */ - } - - fprintf (stderr, "Detaching from process %d\n", pid); - stop_tracing (); - if (detach_inferior (pid) != 0) - write_enn (own_buf); - else - { - discard_queued_stop_replies (pid); - write_ok (own_buf); - - if (extended_protocol) - { - /* Treat this like a normal program exit. */ - last_status.kind = TARGET_WAITKIND_EXITED; - last_status.value.integer = 0; - last_ptid = pid_to_ptid (pid); - - current_inferior = NULL; - } - else - { - putpkt (own_buf); - remote_close (); - - /* If we are attached, then we can exit. Otherwise, we - need to hang around doing nothing, until the child is - gone. */ - join_inferior (pid); - exit (0); - } - } - break; - case '!': - extended_protocol = 1; - write_ok (own_buf); - break; - case '?': - handle_status (own_buf); - break; - case 'H': - if (own_buf[1] == 'c' || own_buf[1] == 'g' || own_buf[1] == 's') - { - ptid_t gdb_id, thread_id; - int pid; - - require_running (own_buf); - - gdb_id = read_ptid (&own_buf[2], NULL); - - pid = ptid_get_pid (gdb_id); - - if (ptid_equal (gdb_id, null_ptid) - || ptid_equal (gdb_id, minus_one_ptid)) - thread_id = null_ptid; - else if (pid != 0 - && ptid_equal (pid_to_ptid (pid), - gdb_id)) - { - struct thread_info *thread = - (struct thread_info *) find_inferior (&all_threads, - first_thread_of, - &pid); - if (!thread) - { - write_enn (own_buf); - break; - } - - thread_id = ((struct inferior_list_entry *)thread)->id; - } - else - { - thread_id = gdb_id_to_thread_id (gdb_id); - if (ptid_equal (thread_id, null_ptid)) - { - write_enn (own_buf); - break; - } - } - - if (own_buf[1] == 'g') - { - if (ptid_equal (thread_id, null_ptid)) - { - /* GDB is telling us to choose any thread. Check if - the currently selected thread is still valid. If - it is not, select the first available. */ - struct thread_info *thread = - (struct thread_info *) find_inferior_id (&all_threads, - general_thread); - if (thread == NULL) - thread_id = all_threads.head->id; - } - - general_thread = thread_id; - set_desired_inferior (1); - } - else if (own_buf[1] == 'c') - cont_thread = thread_id; - - write_ok (own_buf); - } - else - { - /* Silently ignore it so that gdb can extend the protocol - without compatibility headaches. */ - own_buf[0] = '\0'; - } - break; - case 'g': - require_running (own_buf); - if (current_traceframe >= 0) - { - struct regcache *regcache = new_register_cache (); - - if (fetch_traceframe_registers (current_traceframe, - regcache, -1) == 0) - registers_to_string (regcache, own_buf); - else - write_enn (own_buf); - free_register_cache (regcache); - } - else - { - struct regcache *regcache; - - set_desired_inferior (1); - regcache = get_thread_regcache (current_inferior, 1); - registers_to_string (regcache, own_buf); - } - break; - case 'G': - require_running (own_buf); - if (current_traceframe >= 0) - write_enn (own_buf); - else - { - struct regcache *regcache; - - set_desired_inferior (1); - regcache = get_thread_regcache (current_inferior, 1); - registers_from_string (regcache, &own_buf[1]); - write_ok (own_buf); - } - break; - case 'm': - require_running (own_buf); - decode_m_packet (&own_buf[1], &mem_addr, &len); - res = gdb_read_memory (mem_addr, mem_buf, len); - if (res < 0) - write_enn (own_buf); - else - convert_int_to_ascii (mem_buf, own_buf, res); - break; - case 'M': - require_running (own_buf); - decode_M_packet (&own_buf[1], &mem_addr, &len, &mem_buf); - if (gdb_write_memory (mem_addr, mem_buf, len) == 0) - write_ok (own_buf); - else - write_enn (own_buf); - break; - case 'X': - require_running (own_buf); - if (decode_X_packet (&own_buf[1], packet_len - 1, - &mem_addr, &len, &mem_buf) < 0 - || gdb_write_memory (mem_addr, mem_buf, len) != 0) - write_enn (own_buf); - else - write_ok (own_buf); - break; - case 'C': - require_running (own_buf); - convert_ascii_to_int (own_buf + 1, &sig, 1); - if (target_signal_to_host_p (sig)) - signal = target_signal_to_host (sig); - else - signal = 0; - myresume (own_buf, 0, signal); - break; - case 'S': - require_running (own_buf); - convert_ascii_to_int (own_buf + 1, &sig, 1); - if (target_signal_to_host_p (sig)) - signal = target_signal_to_host (sig); - else - signal = 0; - myresume (own_buf, 1, signal); - break; - case 'c': - require_running (own_buf); - signal = 0; - myresume (own_buf, 0, signal); - break; - case 's': - require_running (own_buf); - signal = 0; - myresume (own_buf, 1, signal); - break; - case 'Z': /* insert_ ... */ - /* Fallthrough. */ - case 'z': /* remove_ ... */ - { - char *lenptr; - char *dataptr; - CORE_ADDR addr = strtoul (&own_buf[3], &lenptr, 16); - int len = strtol (lenptr + 1, &dataptr, 16); - char type = own_buf[1]; - int res; - const int insert = ch == 'Z'; - - /* Default to unrecognized/unsupported. */ - res = 1; - switch (type) - { - case '0': /* software-breakpoint */ - case '1': /* hardware-breakpoint */ - case '2': /* write watchpoint */ - case '3': /* read watchpoint */ - case '4': /* access watchpoint */ - require_running (own_buf); - if (insert && the_target->insert_point != NULL) - res = (*the_target->insert_point) (type, addr, len); - else if (!insert && the_target->remove_point != NULL) - res = (*the_target->remove_point) (type, addr, len); - break; - default: - break; - } - - if (res == 0) - write_ok (own_buf); - else if (res == 1) - /* Unsupported. */ - own_buf[0] = '\0'; - else - write_enn (own_buf); - break; - } - case 'k': - response_needed = 0; - if (!target_running ()) - /* The packet we received doesn't make sense - but we can't - reply to it, either. */ - return 0; - - fprintf (stderr, "Killing all inferiors\n"); - for_each_inferior (&all_processes, kill_inferior_callback); - - /* When using the extended protocol, we wait with no program - running. The traditional protocol will exit instead. */ - if (extended_protocol) - { - last_status.kind = TARGET_WAITKIND_EXITED; - last_status.value.sig = TARGET_SIGNAL_KILL; - return 0; - } - else - exit (0); - - case 'T': - { - ptid_t gdb_id, thread_id; - - require_running (own_buf); - - gdb_id = read_ptid (&own_buf[1], NULL); - thread_id = gdb_id_to_thread_id (gdb_id); - if (ptid_equal (thread_id, null_ptid)) - { - write_enn (own_buf); - break; - } - - if (mythread_alive (thread_id)) - write_ok (own_buf); - else - write_enn (own_buf); - } - break; - case 'R': - response_needed = 0; - - /* Restarting the inferior is only supported in the extended - protocol. */ - if (extended_protocol) - { - if (target_running ()) - for_each_inferior (&all_processes, - kill_inferior_callback); - fprintf (stderr, "GDBserver restarting\n"); - - /* Wait till we are at 1st instruction in prog. */ - if (program_argv != NULL) - start_inferior (program_argv); - else - { - last_status.kind = TARGET_WAITKIND_EXITED; - last_status.value.sig = TARGET_SIGNAL_KILL; - } - return 0; - } - else - { - /* It is a request we don't understand. Respond with an - empty packet so that gdb knows that we don't support this - request. */ - own_buf[0] = '\0'; - break; - } - case 'v': - /* Extended (long) request. */ - handle_v_requests (own_buf, packet_len, &new_packet_len); - break; - - default: - /* It is a request we don't understand. Respond with an empty - packet so that gdb knows that we don't support this - request. */ - own_buf[0] = '\0'; - break; - } - - if (new_packet_len != -1) - putpkt_binary (own_buf, new_packet_len); - else - putpkt (own_buf); - - response_needed = 0; - - if (!extended_protocol && have_ran && !target_running ()) - { - /* In non-stop, defer exiting until GDB had a chance to query - the whole vStopped list (until it gets an OK). */ - if (!notif_queue) - { - fprintf (stderr, "GDBserver exiting\n"); - remote_close (); - exit (0); - } - } - - if (exit_requested) - return -1; - - return 0; -} - -/* Event-loop callback for serial events. */ - -int -handle_serial_event (int err, gdb_client_data client_data) -{ - if (debug_threads) - fprintf (stderr, "handling possible serial event\n"); - - /* Really handle it. */ - if (process_serial_event () < 0) - return -1; - - /* Be sure to not change the selected inferior behind GDB's back. - Important in the non-stop mode asynchronous protocol. */ - set_desired_inferior (1); - - return 0; -} - -/* Event-loop callback for target events. */ - -int -handle_target_event (int err, gdb_client_data client_data) -{ - if (debug_threads) - fprintf (stderr, "handling possible target event\n"); - - last_ptid = mywait (minus_one_ptid, &last_status, - TARGET_WNOHANG, 1); - - if (last_status.kind != TARGET_WAITKIND_IGNORE) - { - int pid = ptid_get_pid (last_ptid); - struct process_info *process = find_process_pid (pid); - int forward_event = !gdb_connected () || process->gdb_detached; - - if (last_status.kind == TARGET_WAITKIND_EXITED - || last_status.kind == TARGET_WAITKIND_SIGNALLED) - { - mark_breakpoints_out (process); - mourn_inferior (process); - } - else - { - /* We're reporting this thread as stopped. Update its - "want-stopped" state to what the client wants, until it - gets a new resume action. */ - current_inferior->last_resume_kind = resume_stop; - current_inferior->last_status = last_status; - } - - if (forward_event) - { - if (!target_running ()) - { - /* The last process exited. We're done. */ - exit (0); - } - - if (last_status.kind == TARGET_WAITKIND_STOPPED) - { - /* A thread stopped with a signal, but gdb isn't - connected to handle it. Pass it down to the - inferior, as if it wasn't being traced. */ - struct thread_resume resume_info; - - if (debug_threads) - fprintf (stderr, - "GDB not connected; forwarding event %d for [%s]\n", - (int) last_status.kind, - target_pid_to_str (last_ptid)); - - resume_info.thread = last_ptid; - resume_info.kind = resume_continue; - resume_info.sig = target_signal_to_host (last_status.value.sig); - (*the_target->resume) (&resume_info, 1); - } - else if (debug_threads) - fprintf (stderr, "GDB not connected; ignoring event %d for [%s]\n", - (int) last_status.kind, - target_pid_to_str (last_ptid)); - } - else - { - /* Something interesting. Tell GDB about it. */ - push_event (last_ptid, &last_status); - } - } - - /* Be sure to not change the selected inferior behind GDB's back. - Important in the non-stop mode asynchronous protocol. */ - set_desired_inferior (1); - - return 0; -} diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h deleted file mode 100644 index 7c682dcca77..00000000000 --- a/gdb/gdbserver/server.h +++ /dev/null @@ -1,562 +0,0 @@ -/* Common definitions for remote server for GDB. - Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010, 2011 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/>. */ - -#ifndef SERVER_H -#define SERVER_H - -#include "config.h" - -#ifdef __MINGW32CE__ -#include "wincecompat.h" -#endif - -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#ifdef HAVE_ERRNO_H -#include <errno.h> -#endif -#include <setjmp.h> - -#ifdef HAVE_STRING_H -#include <string.h> -#endif - -#ifdef HAVE_ALLOCA_H -#include <alloca.h> -#endif -/* On some systems such as MinGW, alloca is declared in malloc.h - (there is no alloca.h). */ -#if HAVE_MALLOC_H -#include <malloc.h> -#endif - -#if !HAVE_DECL_STRERROR -#ifndef strerror -extern char *strerror (int); /* X3.159-1989 4.11.6.2 */ -#endif -#endif - -#if !HAVE_DECL_PERROR -#ifndef perror -extern void perror (const char *); -#endif -#endif - -#if !HAVE_DECL_MEMMEM -extern void *memmem (const void *, size_t , const void *, size_t); -#endif - -#if !HAVE_DECL_VASPRINTF -extern int vasprintf(char **strp, const char *fmt, va_list ap); -#endif -#if !HAVE_DECL_VSNPRINTF -int vsnprintf(char *str, size_t size, const char *format, va_list ap); -#endif - -#ifndef ATTR_NORETURN -#if defined(__GNUC__) && (__GNUC__ > 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) -#define ATTR_NORETURN __attribute__ ((noreturn)) -#else -#define ATTR_NORETURN /* nothing */ -#endif -#endif - -#ifndef ATTR_FORMAT -#if defined(__GNUC__) && (__GNUC__ > 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4)) -#define ATTR_FORMAT(type, x, y) __attribute__ ((format(type, x, y))) -#else -#define ATTR_FORMAT(type, x, y) /* nothing */ -#endif -#endif - -#ifndef ATTR_MALLOC -#if defined(__GNUC__) && (__GNUC__ >= 3) -#define ATTR_MALLOC __attribute__ ((__malloc__)) -#else -#define ATTR_MALLOC /* nothing */ -#endif -#endif - -/* Define underscore macro, if not available, to be able to use it inside - code shared with gdb in common directory. */ -#ifndef _ -#define _(String) (String) -#endif - -/* A type used for binary buffers. */ -typedef unsigned char gdb_byte; - -#include "ptid.h" -#include "buffer.h" -#include "xml-utils.h" -#include "gdb_locale.h" - -/* FIXME: This should probably be autoconf'd for. It's an integer type at - least the size of a (void *). */ -typedef long long CORE_ADDR; - -typedef long long LONGEST; -typedef unsigned long long ULONGEST; - -/* Generic information for tracking a list of ``inferiors'' - threads, - processes, etc. */ -struct inferior_list -{ - struct inferior_list_entry *head; - struct inferior_list_entry *tail; -}; -struct inferior_list_entry -{ - ptid_t id; - struct inferior_list_entry *next; -}; - -struct thread_info; -struct process_info; -struct regcache; - -#include "regcache.h" -#include "gdb/signals.h" -#include "gdb_signals.h" -#include "target.h" -#include "mem-break.h" - -struct thread_info -{ - struct inferior_list_entry entry; - void *target_data; - void *regcache_data; - - /* The last resume GDB requested on this thread. */ - enum resume_kind last_resume_kind; - - /* The last wait status reported for this thread. */ - struct target_waitstatus last_status; - - /* Given `while-stepping', a thread may be collecting data for more - than one tracepoint simultaneously. E.g.: - - ff0001 INSN1 <-- TP1, while-stepping 10 collect $regs - ff0002 INSN2 - ff0003 INSN3 <-- TP2, collect $regs - ff0004 INSN4 <-- TP3, while-stepping 10 collect $regs - ff0005 INSN5 - - Notice that when instruction INSN5 is reached, the while-stepping - actions of both TP1 and TP3 are still being collected, and that TP2 - had been collected meanwhile. The whole range of ff0001-ff0005 - should be single-stepped, due to at least TP1's while-stepping - action covering the whole range. - - On the other hand, the same tracepoint with a while-stepping action - may be hit by more than one thread simultaneously, hence we can't - keep the current step count in the tracepoint itself. - - This is the head of the list of the states of `while-stepping' - tracepoint actions this thread is now collecting; NULL if empty. - Each item in the list holds the current step of the while-stepping - action. */ - struct wstep_state *while_stepping; -}; - -struct dll_info -{ - struct inferior_list_entry entry; - char *name; - CORE_ADDR base_addr; -}; - -struct sym_cache; -struct breakpoint; -struct raw_breakpoint; -struct fast_tracepoint_jump; -struct process_info_private; - -struct process_info -{ - struct inferior_list_entry head; - - /* Nonzero if this child process was attached rather than - spawned. */ - int attached; - - /* True if GDB asked us to detach from this process, but we remained - attached anyway. */ - int gdb_detached; - - /* The symbol cache. */ - struct sym_cache *symbol_cache; - - /* The list of memory breakpoints. */ - struct breakpoint *breakpoints; - - /* The list of raw memory breakpoints. */ - struct raw_breakpoint *raw_breakpoints; - - /* The list of installed fast tracepoints. */ - struct fast_tracepoint_jump *fast_tracepoint_jumps; - - /* Private target data. */ - struct process_info_private *private; -}; - -/* Return a pointer to the process that corresponds to the current - thread (current_inferior). It is an error to call this if there is - no current thread selected. */ - -struct process_info *current_process (void); -struct process_info *get_thread_process (struct thread_info *); - -/* Target-specific functions */ - -void initialize_low (); - -/* From inferiors.c. */ - -extern struct inferior_list all_processes; -extern struct inferior_list all_threads; -extern struct inferior_list all_dlls; -extern int dlls_changed; - -void add_inferior_to_list (struct inferior_list *list, - struct inferior_list_entry *new_inferior); -void for_each_inferior (struct inferior_list *list, - void (*action) (struct inferior_list_entry *)); - -extern struct thread_info *current_inferior; -void remove_inferior (struct inferior_list *list, - struct inferior_list_entry *entry); -void remove_thread (struct thread_info *thread); -void add_thread (ptid_t ptid, void *target_data); - -struct process_info *add_process (int pid, int attached); -void remove_process (struct process_info *process); -struct process_info *find_process_pid (int pid); -int have_started_inferiors_p (void); -int have_attached_inferiors_p (void); - -struct thread_info *find_thread_ptid (ptid_t ptid); - -ptid_t thread_id_to_gdb_id (ptid_t); -ptid_t thread_to_gdb_id (struct thread_info *); -ptid_t gdb_id_to_thread_id (ptid_t); -struct thread_info *gdb_id_to_thread (unsigned int); -void clear_inferiors (void); -struct inferior_list_entry *find_inferior - (struct inferior_list *, - int (*func) (struct inferior_list_entry *, - void *), - void *arg); -struct inferior_list_entry *find_inferior_id (struct inferior_list *list, - ptid_t id); -void *inferior_target_data (struct thread_info *); -void set_inferior_target_data (struct thread_info *, void *); -void *inferior_regcache_data (struct thread_info *); -void set_inferior_regcache_data (struct thread_info *, void *); -void add_pid_to_list (struct inferior_list *list, unsigned long pid); -int pull_pid_from_list (struct inferior_list *list, unsigned long pid); - -void loaded_dll (const char *name, CORE_ADDR base_addr); -void unloaded_dll (const char *name, CORE_ADDR base_addr); - -/* Public variables in server.c */ - -extern ptid_t cont_thread; -extern ptid_t general_thread; - -extern int server_waiting; -extern int debug_threads; -extern int debug_hw_points; -extern int pass_signals[]; - -extern jmp_buf toplevel; - -extern int disable_packet_vCont; -extern int disable_packet_Tthread; -extern int disable_packet_qC; -extern int disable_packet_qfThreadInfo; - -extern int run_once; -extern int multi_process; -extern int non_stop; - -#if USE_WIN32API -#include <winsock2.h> -typedef SOCKET gdb_fildes_t; -#else -typedef int gdb_fildes_t; -#endif - -/* Functions from event-loop.c. */ -typedef void *gdb_client_data; -typedef int (handler_func) (int, gdb_client_data); -typedef int (callback_handler_func) (gdb_client_data); - -extern void delete_file_handler (gdb_fildes_t fd); -extern void add_file_handler (gdb_fildes_t fd, handler_func *proc, - gdb_client_data client_data); -extern int append_callback_event (callback_handler_func *proc, - gdb_client_data client_data); -extern void delete_callback_event (int id); - -extern void start_event_loop (void); - -/* Functions from server.c. */ -extern int handle_serial_event (int err, gdb_client_data client_data); -extern int handle_target_event (int err, gdb_client_data client_data); - -extern void push_event (ptid_t ptid, struct target_waitstatus *status); - -/* Functions from hostio.c. */ -extern int handle_vFile (char *, int, int *); - -/* Functions from hostio-errno.c. */ -extern void hostio_last_error_from_errno (char *own_buf); - -/* From remote-utils.c */ - -extern int remote_debug; -extern int noack_mode; -extern int transport_is_reliable; - -int gdb_connected (void); - -ptid_t read_ptid (char *buf, char **obuf); -char *write_ptid (char *buf, ptid_t ptid); - -int putpkt (char *buf); -int putpkt_binary (char *buf, int len); -int putpkt_notif (char *buf); -int getpkt (char *buf); -void remote_prepare (char *name); -void remote_open (char *name); -void remote_close (void); -void write_ok (char *buf); -void write_enn (char *buf); -void initialize_async_io (void); -void enable_async_io (void); -void disable_async_io (void); -void check_remote_input_interrupt_request (void); -void convert_ascii_to_int (const char *from, unsigned char *to, int n); -void convert_int_to_ascii (const unsigned char *from, char *to, int n); -void new_thread_notify (int id); -void dead_thread_notify (int id); -void prepare_resume_reply (char *buf, ptid_t ptid, - struct target_waitstatus *status); - -const char *decode_address_to_semicolon (CORE_ADDR *addrp, const char *start); -void decode_address (CORE_ADDR *addrp, const char *start, int len); -void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr, - unsigned int *len_ptr); -void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr, - unsigned int *len_ptr, unsigned char **to_p); -int decode_X_packet (char *from, int packet_len, CORE_ADDR * mem_addr_ptr, - unsigned int *len_ptr, unsigned char **to_p); -int decode_xfer_write (char *buf, int packet_len, - CORE_ADDR *offset, unsigned int *len, - unsigned char *data); -int decode_search_memory_packet (const char *buf, int packet_len, - CORE_ADDR *start_addrp, - CORE_ADDR *search_space_lenp, - gdb_byte *pattern, - unsigned int *pattern_lenp); - -int unhexify (char *bin, const char *hex, int count); -int hexify (char *hex, const char *bin, int count); -int remote_escape_output (const gdb_byte *buffer, int len, - gdb_byte *out_buf, int *out_len, - int out_maxlen); -char *unpack_varlen_hex (char *buff, ULONGEST *result); - -void clear_symbol_cache (struct sym_cache **symcache_p); -int look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb); - -int relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc); - -void monitor_output (const char *msg); - -/* Functions from utils.c */ -#include "common-utils.h" - -void *xmalloc (size_t) ATTR_MALLOC; -void *xrealloc (void *, size_t); -void *xcalloc (size_t, size_t) ATTR_MALLOC; -char *xstrdup (const char *) ATTR_MALLOC; -int xsnprintf (char *str, size_t size, const char *format, ...) - ATTR_FORMAT (printf, 3, 4);; -void freeargv (char **argv); -void perror_with_name (const char *string); -void error (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2); -void fatal (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2); -void warning (const char *string,...) ATTR_FORMAT (printf, 1, 2); -char *paddress (CORE_ADDR addr); -char *pulongest (ULONGEST u); -char *plongest (LONGEST l); -char *phex_nz (ULONGEST l, int sizeof_l); -char *pfildes (gdb_fildes_t fd); - -#include "gdb_assert.h" - -/* Maximum number of bytes to read/write at once. The value here - is chosen to fill up a packet (the headers account for the 32). */ -#define MAXBUFBYTES(N) (((N)-32)/2) - -/* Buffer sizes for transferring memory, registers, etc. Set to a constant - value to accomodate multiple register formats. This value must be at least - as large as the largest register set supported by gdbserver. */ -#define PBUFSIZ 16384 - -/* Functions from tracepoint.c */ - -int in_process_agent_loaded (void); - -void initialize_tracepoint (void); - -extern int tracing; -extern int disconnected_tracing; - -void tracepoint_look_up_symbols (void); - -void stop_tracing (void); - -int handle_tracepoint_general_set (char *own_buf); -int handle_tracepoint_query (char *own_buf); - -int tracepoint_finished_step (struct thread_info *tinfo, CORE_ADDR stop_pc); -int tracepoint_was_hit (struct thread_info *tinfo, CORE_ADDR stop_pc); - -void release_while_stepping_state_list (struct thread_info *tinfo); - -extern int current_traceframe; - -int in_readonly_region (CORE_ADDR addr, ULONGEST length); -int traceframe_read_mem (int tfnum, CORE_ADDR addr, - unsigned char *buf, ULONGEST length, - ULONGEST *nbytes); -int fetch_traceframe_registers (int tfnum, - struct regcache *regcache, - int regnum); - -int traceframe_read_sdata (int tfnum, ULONGEST offset, - unsigned char *buf, ULONGEST length, - ULONGEST *nbytes); - -int traceframe_read_info (int tfnum, struct buffer *buffer); - -/* If a thread is determined to be collecting a fast tracepoint, this - structure holds the collect status. */ - -struct fast_tpoint_collect_status -{ - /* The tracepoint that is presently being collected. */ - int tpoint_num; - CORE_ADDR tpoint_addr; - - /* The address range in the jump pad of where the original - instruction the tracepoint jump was inserted was relocated - to. */ - CORE_ADDR adjusted_insn_addr; - CORE_ADDR adjusted_insn_addr_end; -}; - -int fast_tracepoint_collecting (CORE_ADDR thread_area, - CORE_ADDR stop_pc, - struct fast_tpoint_collect_status *status); -void force_unlock_trace_buffer (void); - -int handle_tracepoint_bkpts (struct thread_info *tinfo, CORE_ADDR stop_pc); - -#ifdef IN_PROCESS_AGENT -void initialize_low_tracepoint (void); -void supply_fast_tracepoint_registers (struct regcache *regcache, - const unsigned char *regs); -void supply_static_tracepoint_registers (struct regcache *regcache, - const unsigned char *regs, - CORE_ADDR pc); -#else -void stop_tracing (void); -#endif - -/* Bytecode compilation function vector. */ - -struct emit_ops -{ - void (*emit_prologue) (void); - void (*emit_epilogue) (void); - void (*emit_add) (void); - void (*emit_sub) (void); - void (*emit_mul) (void); - void (*emit_lsh) (void); - void (*emit_rsh_signed) (void); - void (*emit_rsh_unsigned) (void); - void (*emit_ext) (int arg); - void (*emit_log_not) (void); - void (*emit_bit_and) (void); - void (*emit_bit_or) (void); - void (*emit_bit_xor) (void); - void (*emit_bit_not) (void); - void (*emit_equal) (void); - void (*emit_less_signed) (void); - void (*emit_less_unsigned) (void); - void (*emit_ref) (int size); - void (*emit_if_goto) (int *offset_p, int *size_p); - void (*emit_goto) (int *offset_p, int *size_p); - void (*write_goto_address) (CORE_ADDR from, CORE_ADDR to, int size); - void (*emit_const) (LONGEST num); - void (*emit_call) (CORE_ADDR fn); - void (*emit_reg) (int reg); - void (*emit_pop) (void); - void (*emit_stack_flush) (void); - void (*emit_zero_ext) (int arg); - void (*emit_swap) (void); - void (*emit_stack_adjust) (int n); - - /* Emit code for a generic function that takes one fixed integer - argument and returns a 64-bit int (for instance, tsv getter). */ - void (*emit_int_call_1) (CORE_ADDR fn, int arg1); - - /* Emit code for a generic function that takes one fixed integer - argument and a 64-bit int from the top of the stack, and returns - nothing (for instance, tsv setter). */ - void (*emit_void_call_2) (CORE_ADDR fn, int arg1); - - /* Emit code specialized for common combinations of compare followed - by a goto. */ - void (*emit_eq_goto) (int *offset_p, int *size_p); - void (*emit_ne_goto) (int *offset_p, int *size_p); - void (*emit_lt_goto) (int *offset_p, int *size_p); - void (*emit_le_goto) (int *offset_p, int *size_p); - void (*emit_gt_goto) (int *offset_p, int *size_p); - void (*emit_ge_goto) (int *offset_p, int *size_p); -}; - -/* Returns the address of the get_raw_reg function in the IPA. */ -CORE_ADDR get_raw_reg_func_addr (void); - -CORE_ADDR current_insn_ptr; -int emit_error; - -/* Version information, from version.c. */ -extern const char version[]; -extern const char host_name[]; - -#endif /* SERVER_H */ diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c deleted file mode 100644 index 898e46d6f7e..00000000000 --- a/gdb/gdbserver/spu-low.c +++ /dev/null @@ -1,677 +0,0 @@ -/* Low level interface to SPUs, for the remote server for GDB. - Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. - - Contributed by Ulrich Weigand <uweigand@de.ibm.com>. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 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 <sys/wait.h> -#include <stdio.h> -#include <sys/ptrace.h> -#include <fcntl.h> -#include <string.h> -#include <stdlib.h> -#include <unistd.h> -#include <errno.h> -#include <sys/syscall.h> - -/* Some older glibc versions do not define this. */ -#ifndef __WNOTHREAD -#define __WNOTHREAD 0x20000000 /* Don't wait on children of other - threads in this group */ -#endif - -#define PTRACE_TYPE_RET long -#define PTRACE_TYPE_ARG3 long - -/* Number of registers. */ -#define SPU_NUM_REGS 130 -#define SPU_NUM_CORE_REGS 128 - -/* Special registers. */ -#define SPU_ID_REGNUM 128 -#define SPU_PC_REGNUM 129 - -/* PPU side system calls. */ -#define INSTR_SC 0x44000002 -#define NR_spu_run 0x0116 - -/* Get current thread ID (Linux task ID). */ -#define current_ptid ((struct inferior_list_entry *)current_inferior)->id - -/* These are used in remote-utils.c. */ -int using_threads = 0; - -/* Defined in auto-generated file reg-spu.c. */ -void init_registers_spu (void); - - -/* Fetch PPU register REGNO. */ -static CORE_ADDR -fetch_ppc_register (int regno) -{ - PTRACE_TYPE_RET res; - - int tid = ptid_get_lwp (current_ptid); - -#ifndef __powerpc64__ - /* If running as a 32-bit process on a 64-bit system, we attempt - to get the full 64-bit register content of the target process. - If the PPC special ptrace call fails, we're on a 32-bit system; - just fall through to the regular ptrace call in that case. */ - { - char buf[8]; - - errno = 0; - ptrace (PPC_PTRACE_PEEKUSR_3264, tid, - (PTRACE_TYPE_ARG3) (regno * 8), buf); - if (errno == 0) - ptrace (PPC_PTRACE_PEEKUSR_3264, tid, - (PTRACE_TYPE_ARG3) (regno * 8 + 4), buf + 4); - if (errno == 0) - return (CORE_ADDR) *(unsigned long long *)buf; - } -#endif - - errno = 0; - res = ptrace (PT_READ_U, tid, - (PTRACE_TYPE_ARG3) (regno * sizeof (PTRACE_TYPE_RET)), 0); - if (errno != 0) - { - char mess[128]; - sprintf (mess, "reading PPC register #%d", regno); - perror_with_name (mess); - } - - return (CORE_ADDR) (unsigned long) res; -} - -/* Fetch WORD from PPU memory at (aligned) MEMADDR in thread TID. */ -static int -fetch_ppc_memory_1 (int tid, CORE_ADDR memaddr, PTRACE_TYPE_RET *word) -{ - errno = 0; - -#ifndef __powerpc64__ - if (memaddr >> 32) - { - unsigned long long addr_8 = (unsigned long long) memaddr; - ptrace (PPC_PTRACE_PEEKTEXT_3264, tid, (PTRACE_TYPE_ARG3) &addr_8, word); - } - else -#endif - *word = ptrace (PT_READ_I, tid, (PTRACE_TYPE_ARG3) (size_t) memaddr, 0); - - return errno; -} - -/* Store WORD into PPU memory at (aligned) MEMADDR in thread TID. */ -static int -store_ppc_memory_1 (int tid, CORE_ADDR memaddr, PTRACE_TYPE_RET word) -{ - errno = 0; - -#ifndef __powerpc64__ - if (memaddr >> 32) - { - unsigned long long addr_8 = (unsigned long long) memaddr; - ptrace (PPC_PTRACE_POKEDATA_3264, tid, (PTRACE_TYPE_ARG3) &addr_8, word); - } - else -#endif - ptrace (PT_WRITE_D, tid, (PTRACE_TYPE_ARG3) (size_t) memaddr, word); - - return errno; -} - -/* Fetch LEN bytes of PPU memory at MEMADDR to MYADDR. */ -static int -fetch_ppc_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - int i, ret; - - CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_TYPE_RET); - int count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1) - / sizeof (PTRACE_TYPE_RET)); - PTRACE_TYPE_RET *buffer; - - int tid = ptid_get_lwp (current_ptid); - - buffer = (PTRACE_TYPE_RET *) alloca (count * sizeof (PTRACE_TYPE_RET)); - for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET)) - if ((ret = fetch_ppc_memory_1 (tid, addr, &buffer[i])) != 0) - return ret; - - memcpy (myaddr, - (char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)), - len); - - return 0; -} - -/* Store LEN bytes from MYADDR to PPU memory at MEMADDR. */ -static int -store_ppc_memory (CORE_ADDR memaddr, char *myaddr, int len) -{ - int i, ret; - - CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_TYPE_RET); - int count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1) - / sizeof (PTRACE_TYPE_RET)); - PTRACE_TYPE_RET *buffer; - - int tid = ptid_get_lwp (current_ptid); - - buffer = (PTRACE_TYPE_RET *) alloca (count * sizeof (PTRACE_TYPE_RET)); - - if (addr != memaddr || len < (int) sizeof (PTRACE_TYPE_RET)) - if ((ret = fetch_ppc_memory_1 (tid, addr, &buffer[0])) != 0) - return ret; - - if (count > 1) - if ((ret = fetch_ppc_memory_1 (tid, addr + (count - 1) - * sizeof (PTRACE_TYPE_RET), - &buffer[count - 1])) != 0) - return ret; - - memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)), - myaddr, len); - - for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET)) - if ((ret = store_ppc_memory_1 (tid, addr, buffer[i])) != 0) - return ret; - - return 0; -} - - -/* If the PPU thread is currently stopped on a spu_run system call, - return to FD and ADDR the file handle and NPC parameter address - used with the system call. Return non-zero if successful. */ -static int -parse_spufs_run (int *fd, CORE_ADDR *addr) -{ - char buf[4]; - CORE_ADDR pc = fetch_ppc_register (32); /* nip */ - - /* Fetch instruction preceding current NIP. */ - if (fetch_ppc_memory (pc-4, buf, 4) != 0) - return 0; - /* It should be a "sc" instruction. */ - if (*(unsigned int *)buf != INSTR_SC) - return 0; - /* System call number should be NR_spu_run. */ - if (fetch_ppc_register (0) != NR_spu_run) - return 0; - - /* Register 3 contains fd, register 4 the NPC param pointer. */ - *fd = fetch_ppc_register (34); /* orig_gpr3 */ - *addr = fetch_ppc_register (4); - return 1; -} - - -/* Copy LEN bytes at OFFSET in spufs file ANNEX into/from READBUF or WRITEBUF, - using the /proc file system. */ -static int -spu_proc_xfer_spu (const char *annex, unsigned char *readbuf, - const unsigned char *writebuf, - CORE_ADDR offset, int len) -{ - char buf[128]; - int fd = 0; - int ret = -1; - - if (!annex) - return 0; - - sprintf (buf, "/proc/%ld/fd/%s", ptid_get_lwp (current_ptid), annex); - fd = open (buf, writebuf? O_WRONLY : O_RDONLY); - if (fd <= 0) - return -1; - - if (offset != 0 - && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset) - { - close (fd); - return 0; - } - - if (writebuf) - ret = write (fd, writebuf, (size_t) len); - else if (readbuf) - ret = read (fd, readbuf, (size_t) len); - - close (fd); - return ret; -} - - -/* Start an inferior process and returns its pid. - ALLARGS is a vector of program-name and args. */ -static int -spu_create_inferior (char *program, char **allargs) -{ - int pid; - ptid_t ptid; - - pid = fork (); - if (pid < 0) - perror_with_name ("fork"); - - if (pid == 0) - { - ptrace (PTRACE_TRACEME, 0, 0, 0); - - setpgid (0, 0); - - execv (program, allargs); - if (errno == ENOENT) - execvp (program, allargs); - - fprintf (stderr, "Cannot exec %s: %s.\n", program, - strerror (errno)); - fflush (stderr); - _exit (0177); - } - - add_process (pid, 0); - - ptid = ptid_build (pid, pid, 0); - add_thread (ptid, NULL); - return pid; -} - -/* Attach to an inferior process. */ -int -spu_attach (unsigned long pid) -{ - ptid_t ptid; - - if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0) - { - fprintf (stderr, "Cannot attach to process %ld: %s (%d)\n", pid, - strerror (errno), errno); - fflush (stderr); - _exit (0177); - } - - add_process (pid, 1); - ptid = ptid_build (pid, pid, 0); - add_thread (ptid, NULL); - return 0; -} - -/* Kill the inferior process. */ -static int -spu_kill (int pid) -{ - int status, ret; - struct process_info *process = find_process_pid (pid); - if (process == NULL) - return -1; - - ptrace (PTRACE_KILL, pid, 0, 0); - - do { - ret = waitpid (pid, &status, 0); - if (WIFEXITED (status) || WIFSIGNALED (status)) - break; - } while (ret != -1 || errno != ECHILD); - - clear_inferiors (); - remove_process (process); - return 0; -} - -/* Detach from inferior process. */ -static int -spu_detach (int pid) -{ - struct process_info *process = find_process_pid (pid); - if (process == NULL) - return -1; - - ptrace (PTRACE_DETACH, pid, 0, 0); - - clear_inferiors (); - remove_process (process); - return 0; -} - -static void -spu_mourn (struct process_info *process) -{ - remove_process (process); -} - -static void -spu_join (int pid) -{ - int status, ret; - - do { - ret = waitpid (pid, &status, 0); - if (WIFEXITED (status) || WIFSIGNALED (status)) - break; - } while (ret != -1 || errno != ECHILD); -} - -/* Return nonzero if the given thread is still alive. */ -static int -spu_thread_alive (ptid_t ptid) -{ - return ptid_equal (ptid, current_ptid); -} - -/* Resume process. */ -static void -spu_resume (struct thread_resume *resume_info, size_t n) -{ - size_t i; - - for (i = 0; i < n; i++) - if (ptid_equal (resume_info[i].thread, minus_one_ptid) - || ptid_equal (resume_info[i].thread, current_ptid)) - break; - - if (i == n) - return; - - /* We don't support hardware single-stepping right now, assume - GDB knows to use software single-stepping. */ - if (resume_info[i].kind == resume_step) - fprintf (stderr, "Hardware single-step not supported.\n"); - - regcache_invalidate (); - - errno = 0; - ptrace (PTRACE_CONT, ptid_get_lwp (current_ptid), 0, resume_info[i].sig); - if (errno) - perror_with_name ("ptrace"); -} - -/* Wait for process, returns status. */ -static ptid_t -spu_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options) -{ - int pid = ptid_get_pid (ptid); - int w; - int ret; - - while (1) - { - ret = waitpid (pid, &w, WNOHANG | __WALL | __WNOTHREAD); - - if (ret == -1) - { - if (errno != ECHILD) - perror_with_name ("waitpid"); - } - else if (ret > 0) - break; - - usleep (1000); - } - - /* On the first wait, continue running the inferior until we are - blocked inside an spu_run system call. */ - if (!server_waiting) - { - int fd; - CORE_ADDR addr; - - while (!parse_spufs_run (&fd, &addr)) - { - ptrace (PT_SYSCALL, pid, (PTRACE_TYPE_ARG3) 0, 0); - waitpid (pid, NULL, __WALL | __WNOTHREAD); - } - } - - if (WIFEXITED (w)) - { - fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w)); - ourstatus->kind = TARGET_WAITKIND_EXITED; - ourstatus->value.integer = WEXITSTATUS (w); - clear_inferiors (); - return pid_to_ptid (ret); - } - else if (!WIFSTOPPED (w)) - { - fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w)); - ourstatus->kind = TARGET_WAITKIND_SIGNALLED; - ourstatus->value.sig = target_signal_from_host (WTERMSIG (w)); - clear_inferiors (); - return pid_to_ptid (ret); - } - - /* After attach, we may have received a SIGSTOP. Do not return this - as signal to GDB, or else it will try to continue with SIGSTOP ... */ - if (!server_waiting) - { - ourstatus->kind = TARGET_WAITKIND_STOPPED; - ourstatus->value.sig = TARGET_SIGNAL_0; - return ptid_build (ret, ret, 0); - } - - ourstatus->kind = TARGET_WAITKIND_STOPPED; - ourstatus->value.sig = target_signal_from_host (WSTOPSIG (w)); - return ptid_build (ret, ret, 0); -} - -/* Fetch inferior registers. */ -static void -spu_fetch_registers (struct regcache *regcache, int regno) -{ - int fd; - CORE_ADDR addr; - - /* We must be stopped on a spu_run system call. */ - if (!parse_spufs_run (&fd, &addr)) - return; - - /* The ID register holds the spufs file handle. */ - if (regno == -1 || regno == SPU_ID_REGNUM) - supply_register (regcache, SPU_ID_REGNUM, (char *)&fd); - - /* The NPC register is found at ADDR. */ - if (regno == -1 || regno == SPU_PC_REGNUM) - { - char buf[4]; - if (fetch_ppc_memory (addr, buf, 4) == 0) - supply_register (regcache, SPU_PC_REGNUM, buf); - } - - /* The GPRs are found in the "regs" spufs file. */ - if (regno == -1 || (regno >= 0 && regno < SPU_NUM_CORE_REGS)) - { - unsigned char buf[16*SPU_NUM_CORE_REGS]; - char annex[32]; - int i; - - sprintf (annex, "%d/regs", fd); - if (spu_proc_xfer_spu (annex, buf, NULL, 0, sizeof buf) == sizeof buf) - for (i = 0; i < SPU_NUM_CORE_REGS; i++) - supply_register (regcache, i, buf + i*16); - } -} - -/* Store inferior registers. */ -static void -spu_store_registers (struct regcache *regcache, int regno) -{ - int fd; - CORE_ADDR addr; - - /* ??? Some callers use 0 to mean all registers. */ - if (regno == 0) - regno = -1; - - /* We must be stopped on a spu_run system call. */ - if (!parse_spufs_run (&fd, &addr)) - return; - - /* The NPC register is found at ADDR. */ - if (regno == -1 || regno == SPU_PC_REGNUM) - { - char buf[4]; - collect_register (regcache, SPU_PC_REGNUM, buf); - store_ppc_memory (addr, buf, 4); - } - - /* The GPRs are found in the "regs" spufs file. */ - if (regno == -1 || (regno >= 0 && regno < SPU_NUM_CORE_REGS)) - { - unsigned char buf[16*SPU_NUM_CORE_REGS]; - char annex[32]; - int i; - - for (i = 0; i < SPU_NUM_CORE_REGS; i++) - collect_register (regcache, i, buf + i*16); - - sprintf (annex, "%d/regs", fd); - spu_proc_xfer_spu (annex, NULL, buf, 0, sizeof buf); - } -} - -/* Copy LEN bytes from inferior's memory starting at MEMADDR - to debugger memory starting at MYADDR. */ -static int -spu_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - int fd, ret; - CORE_ADDR addr; - char annex[32], lslr_annex[32], buf[32]; - CORE_ADDR lslr; - - /* We must be stopped on a spu_run system call. */ - if (!parse_spufs_run (&fd, &addr)) - return 0; - - /* Use the "mem" spufs file to access SPU local store. */ - sprintf (annex, "%d/mem", fd); - ret = spu_proc_xfer_spu (annex, myaddr, NULL, memaddr, len); - if (ret > 0) - return ret == len ? 0 : EIO; - - /* SPU local store access wraps the address around at the - local store limit. We emulate this here. To avoid needing - an extra access to retrieve the LSLR, we only do that after - trying the original address first, and getting end-of-file. */ - sprintf (lslr_annex, "%d/lslr", fd); - memset (buf, 0, sizeof buf); - if (spu_proc_xfer_spu (lslr_annex, (unsigned char *)buf, NULL, - 0, sizeof buf) <= 0) - return ret; - - lslr = strtoul (buf, NULL, 16); - ret = spu_proc_xfer_spu (annex, myaddr, NULL, memaddr & lslr, len); - - return ret == len ? 0 : EIO; -} - -/* Copy LEN bytes of data from debugger memory at MYADDR - to inferior's memory at MEMADDR. - On failure (cannot write the inferior) - returns the value of errno. */ -static int -spu_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len) -{ - int fd, ret; - CORE_ADDR addr; - char annex[32], lslr_annex[32], buf[32]; - CORE_ADDR lslr; - - /* We must be stopped on a spu_run system call. */ - if (!parse_spufs_run (&fd, &addr)) - return 0; - - /* Use the "mem" spufs file to access SPU local store. */ - sprintf (annex, "%d/mem", fd); - ret = spu_proc_xfer_spu (annex, NULL, myaddr, memaddr, len); - if (ret > 0) - return ret == len ? 0 : EIO; - - /* SPU local store access wraps the address around at the - local store limit. We emulate this here. To avoid needing - an extra access to retrieve the LSLR, we only do that after - trying the original address first, and getting end-of-file. */ - sprintf (lslr_annex, "%d/lslr", fd); - memset (buf, 0, sizeof buf); - if (spu_proc_xfer_spu (lslr_annex, (unsigned char *)buf, NULL, - 0, sizeof buf) <= 0) - return ret; - - lslr = strtoul (buf, NULL, 16); - ret = spu_proc_xfer_spu (annex, NULL, myaddr, memaddr & lslr, len); - - return ret == len ? 0 : EIO; -} - -/* Look up special symbols -- unneded here. */ -static void -spu_look_up_symbols (void) -{ -} - -/* Send signal to inferior. */ -static void -spu_request_interrupt (void) -{ - syscall (SYS_tkill, ptid_get_lwp (current_ptid), SIGINT); -} - -static struct target_ops spu_target_ops = { - spu_create_inferior, - spu_attach, - spu_kill, - spu_detach, - spu_mourn, - spu_join, - spu_thread_alive, - spu_resume, - spu_wait, - spu_fetch_registers, - spu_store_registers, - NULL, /* prepare_to_access_memory */ - NULL, /* done_accessing_memory */ - spu_read_memory, - spu_write_memory, - spu_look_up_symbols, - spu_request_interrupt, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - spu_proc_xfer_spu, - hostio_last_error_from_errno, -}; - -void -initialize_low (void) -{ - static const unsigned char breakpoint[] = { 0x00, 0x00, 0x3f, 0xff }; - - set_target_ops (&spu_target_ops); - set_breakpoint_data (breakpoint, sizeof breakpoint); - init_registers_spu (); -} diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c deleted file mode 100644 index 83eb27f4357..00000000000 --- a/gdb/gdbserver/target.c +++ /dev/null @@ -1,184 +0,0 @@ -/* Target operations for the remote server for GDB. - Copyright (C) 2002, 2004, 2005, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - This file is part of GDB. - - This program is free software; you can 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" - -struct target_ops *the_target; - -void -set_desired_inferior (int use_general) -{ - struct thread_info *found; - - if (use_general == 1) - found = find_thread_ptid (general_thread); - else - found = find_thread_ptid (cont_thread); - - if (found == NULL) - current_inferior = (struct thread_info *) all_threads.head; - else - current_inferior = found; -} - -int -read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - int res; - res = (*the_target->read_memory) (memaddr, myaddr, len); - check_mem_read (memaddr, myaddr, len); - return res; -} - -int -write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr, - int len) -{ - /* Lacking cleanups, there is some potential for a memory leak if the - write fails and we go through error(). Make sure that no more than - one buffer is ever pending by making BUFFER static. */ - static unsigned char *buffer = 0; - int res; - - if (buffer != NULL) - free (buffer); - - buffer = xmalloc (len); - memcpy (buffer, myaddr, len); - check_mem_write (memaddr, buffer, len); - res = (*the_target->write_memory) (memaddr, buffer, len); - free (buffer); - buffer = NULL; - - return res; -} - -ptid_t -mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options, - int connected_wait) -{ - ptid_t ret; - - if (connected_wait) - server_waiting = 1; - - ret = (*the_target->wait) (ptid, ourstatus, options); - - if (ourstatus->kind == TARGET_WAITKIND_EXITED) - fprintf (stderr, - "\nChild exited with status %d\n", ourstatus->value.integer); - else if (ourstatus->kind == TARGET_WAITKIND_SIGNALLED) - fprintf (stderr, "\nChild terminated with signal = 0x%x (%s)\n", - target_signal_to_host (ourstatus->value.sig), - target_signal_to_name (ourstatus->value.sig)); - - if (connected_wait) - server_waiting = 0; - - return ret; -} - -int -start_non_stop (int nonstop) -{ - if (the_target->start_non_stop == NULL) - { - if (nonstop) - return -1; - else - return 0; - } - - return (*the_target->start_non_stop) (nonstop); -} - -void -set_target_ops (struct target_ops *target) -{ - the_target = (struct target_ops *) xmalloc (sizeof (*the_target)); - memcpy (the_target, target, sizeof (*the_target)); -} - -/* Convert pid to printable format. */ - -const char * -target_pid_to_str (ptid_t ptid) -{ - static char buf[80]; - - if (ptid_equal (ptid, minus_one_ptid)) - xsnprintf (buf, sizeof (buf), "<all threads>"); - else if (ptid_equal (ptid, null_ptid)) - xsnprintf (buf, sizeof (buf), "<null thread>"); - else if (ptid_get_tid (ptid) != 0) - xsnprintf (buf, sizeof (buf), "Thread %d.0x%lx", - ptid_get_pid (ptid), ptid_get_tid (ptid)); - else if (ptid_get_lwp (ptid) != 0) - xsnprintf (buf, sizeof (buf), "LWP %d.%ld", - ptid_get_pid (ptid), ptid_get_lwp (ptid)); - else - xsnprintf (buf, sizeof (buf), "Process %d", - ptid_get_pid (ptid)); - - return buf; -} - -/* Return a pretty printed form of target_waitstatus. */ - -const char * -target_waitstatus_to_string (const struct target_waitstatus *ws) -{ - static char buf[200]; - const char *kind_str = "status->kind = "; - - switch (ws->kind) - { - case TARGET_WAITKIND_EXITED: - sprintf (buf, "%sexited, status = %d", - kind_str, ws->value.integer); - break; - case TARGET_WAITKIND_STOPPED: - sprintf (buf, "%sstopped, signal = %s", - kind_str, target_signal_to_name (ws->value.sig)); - break; - case TARGET_WAITKIND_SIGNALLED: - sprintf (buf, "%ssignalled, signal = %s", - kind_str, target_signal_to_name (ws->value.sig)); - break; - case TARGET_WAITKIND_LOADED: - sprintf (buf, "%sloaded", kind_str); - break; - case TARGET_WAITKIND_EXECD: - sprintf (buf, "%sexecd", kind_str); - break; - case TARGET_WAITKIND_SPURIOUS: - sprintf (buf, "%sspurious", kind_str); - break; - case TARGET_WAITKIND_IGNORE: - sprintf (buf, "%signore", kind_str); - break; - default: - sprintf (buf, "%sunknown???", kind_str); - break; - } - - return buf; -} diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h deleted file mode 100644 index 442dc913a8a..00000000000 --- a/gdb/gdbserver/target.h +++ /dev/null @@ -1,516 +0,0 @@ -/* Target operations for the remote server for GDB. - Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - This file is part of GDB. - - This program is free software; you can 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/>. */ - -#ifndef TARGET_H -#define TARGET_H - -struct emit_ops; - -/* Ways to "resume" a thread. */ - -enum resume_kind -{ - /* Thread should continue. */ - resume_continue, - - /* Thread should single-step. */ - resume_step, - - /* Thread should be stopped. */ - resume_stop -}; - -/* This structure describes how to resume a particular thread (or all - threads) based on the client's request. If thread is -1, then this - entry applies to all threads. These are passed around as an - array. */ - -struct thread_resume -{ - ptid_t thread; - - /* How to "resume". */ - enum resume_kind kind; - - /* If non-zero, send this signal when we resume, or to stop the - thread. If stopping a thread, and this is 0, the target should - stop the thread however it best decides to (e.g., SIGSTOP on - linux; SuspendThread on win32). This is a host signal value (not - enum target_signal). */ - int sig; -}; - -/* Generally, what has the program done? */ -enum target_waitkind - { - /* The program has exited. The exit status is in - value.integer. */ - TARGET_WAITKIND_EXITED, - - /* The program has stopped with a signal. Which signal is in - value.sig. */ - TARGET_WAITKIND_STOPPED, - - /* The program has terminated with a signal. Which signal is in - value.sig. */ - TARGET_WAITKIND_SIGNALLED, - - /* The program is letting us know that it dynamically loaded - something. */ - TARGET_WAITKIND_LOADED, - - /* The program has exec'ed a new executable file. The new file's - pathname is pointed to by value.execd_pathname. */ - TARGET_WAITKIND_EXECD, - - /* Nothing of interest to GDB happened, but we stopped anyway. */ - TARGET_WAITKIND_SPURIOUS, - - /* An event has occurred, but we should wait again. In this case, - we want to go back to the event loop and wait there for another - event from the inferior. */ - TARGET_WAITKIND_IGNORE - }; - -struct target_waitstatus - { - enum target_waitkind kind; - - /* Forked child pid, execd pathname, exit status or signal number. */ - union - { - int integer; - enum target_signal sig; - ptid_t related_pid; - char *execd_pathname; - } - value; - }; - -/* Options that can be passed to target_ops->wait. */ - -#define TARGET_WNOHANG 1 - -struct target_ops -{ - /* Start a new process. - - PROGRAM is a path to the program to execute. - ARGS is a standard NULL-terminated array of arguments, - to be passed to the inferior as ``argv''. - - Returns the new PID on success, -1 on failure. Registers the new - process with the process list. */ - - int (*create_inferior) (char *program, char **args); - - /* Attach to a running process. - - PID is the process ID to attach to, specified by the user - or a higher layer. - - Returns -1 if attaching is unsupported, 0 on success, and calls - error() otherwise. */ - - int (*attach) (unsigned long pid); - - /* Kill inferior PID. Return -1 on failure, and 0 on success. */ - - int (*kill) (int pid); - - /* Detach from inferior PID. Return -1 on failure, and 0 on - success. */ - - int (*detach) (int pid); - - /* The inferior process has died. Do what is right. */ - - void (*mourn) (struct process_info *proc); - - /* Wait for inferior PID to exit. */ - void (*join) (int pid); - - /* Return 1 iff the thread with process ID PID is alive. */ - - int (*thread_alive) (ptid_t pid); - - /* Resume the inferior process. */ - - void (*resume) (struct thread_resume *resume_info, size_t n); - - /* Wait for the inferior process or thread to change state. Store - status through argument pointer STATUS. - - PTID = -1 to wait for any pid to do something, PTID(pid,0,0) to - wait for any thread of process pid to do something. Return ptid - of child, or -1 in case of error; store status through argument - pointer STATUS. OPTIONS is a bit set of options defined as - TARGET_W* above. If options contains TARGET_WNOHANG and there's - no child stop to report, return is - null_ptid/TARGET_WAITKIND_IGNORE. */ - - ptid_t (*wait) (ptid_t ptid, struct target_waitstatus *status, int options); - - /* Fetch registers from the inferior process. - - If REGNO is -1, fetch all registers; otherwise, fetch at least REGNO. */ - - void (*fetch_registers) (struct regcache *regcache, int regno); - - /* Store registers to the inferior process. - - If REGNO is -1, store all registers; otherwise, store at least REGNO. */ - - void (*store_registers) (struct regcache *regcache, int regno); - - /* Prepare to read or write memory from the inferior process. - Targets use this to do what is necessary to get the state of the - inferior such that it is possible to access memory. - - This should generally only be called from client facing routines, - such as gdb_read_memory/gdb_write_memory, or the insert_point - callbacks. - - Like `read_memory' and `write_memory' below, returns 0 on success - and errno on failure. */ - - int (*prepare_to_access_memory) (void); - - /* Undo the effects of prepare_to_access_memory. */ - - void (*done_accessing_memory) (void); - - /* Read memory from the inferior process. This should generally be - called through read_inferior_memory, which handles breakpoint shadowing. - - Read LEN bytes at MEMADDR into a buffer at MYADDR. - - Returns 0 on success and errno on failure. */ - - int (*read_memory) (CORE_ADDR memaddr, unsigned char *myaddr, int len); - - /* Write memory to the inferior process. This should generally be - called through write_inferior_memory, which handles breakpoint shadowing. - - Write LEN bytes from the buffer at MYADDR to MEMADDR. - - Returns 0 on success and errno on failure. */ - - int (*write_memory) (CORE_ADDR memaddr, const unsigned char *myaddr, - int len); - - /* Query GDB for the values of any symbols we're interested in. - This function is called whenever we receive a "qSymbols::" - query, which corresponds to every time more symbols (might) - become available. NULL if we aren't interested in any - symbols. */ - - void (*look_up_symbols) (void); - - /* Send an interrupt request to the inferior process, - however is appropriate. */ - - void (*request_interrupt) (void); - - /* Read auxiliary vector data from the inferior process. - - Read LEN bytes at OFFSET into a buffer at MYADDR. */ - - int (*read_auxv) (CORE_ADDR offset, unsigned char *myaddr, - unsigned int len); - - /* Insert and remove a break or watchpoint. - Returns 0 on success, -1 on failure and 1 on unsupported. - The type is coded as follows: - '0' - software-breakpoint - '1' - hardware-breakpoint - '2' - write watchpoint - '3' - read watchpoint - '4' - access watchpoint */ - - int (*insert_point) (char type, CORE_ADDR addr, int len); - int (*remove_point) (char type, CORE_ADDR addr, int len); - - /* Returns 1 if target was stopped due to a watchpoint hit, 0 otherwise. */ - - int (*stopped_by_watchpoint) (void); - - /* Returns the address associated with the watchpoint that hit, if any; - returns 0 otherwise. */ - - CORE_ADDR (*stopped_data_address) (void); - - /* Reports the text, data offsets of the executable. This is - needed for uclinux where the executable is relocated during load - time. */ - - int (*read_offsets) (CORE_ADDR *text, CORE_ADDR *data); - - /* Fetch the address associated with a specific thread local storage - area, determined by the specified THREAD, OFFSET, and LOAD_MODULE. - Stores it in *ADDRESS and returns zero on success; otherwise returns - an error code. A return value of -1 means this system does not - support the operation. */ - - int (*get_tls_address) (struct thread_info *thread, CORE_ADDR offset, - CORE_ADDR load_module, CORE_ADDR *address); - - /* Read/Write from/to spufs using qXfer packets. */ - int (*qxfer_spu) (const char *annex, unsigned char *readbuf, - unsigned const char *writebuf, CORE_ADDR offset, int len); - - /* Fill BUF with an hostio error packet representing the last hostio - error. */ - void (*hostio_last_error) (char *buf); - - /* Read/Write OS data using qXfer packets. */ - int (*qxfer_osdata) (const char *annex, unsigned char *readbuf, - unsigned const char *writebuf, CORE_ADDR offset, - int len); - - /* Read/Write extra signal info. */ - int (*qxfer_siginfo) (const char *annex, unsigned char *readbuf, - unsigned const char *writebuf, - CORE_ADDR offset, int len); - - int (*supports_non_stop) (void); - - /* Enables async target events. Returns the previous enable - state. */ - int (*async) (int enable); - - /* Switch to non-stop (1) or all-stop (0) mode. Return 0 on - success, -1 otherwise. */ - int (*start_non_stop) (int); - - /* Returns true if the target supports multi-process debugging. */ - int (*supports_multi_process) (void); - - /* If not NULL, target-specific routine to process monitor command. - Returns 1 if handled, or 0 to perform default processing. */ - int (*handle_monitor_command) (char *); - - /* Returns the core given a thread, or -1 if not known. */ - int (*core_of_thread) (ptid_t); - - /* Read loadmaps. Read LEN bytes at OFFSET into a buffer at MYADDR. */ - int (*read_loadmap) (const char *annex, CORE_ADDR offset, - unsigned char *myaddr, unsigned int len); - - /* Target specific qSupported support. */ - void (*process_qsupported) (const char *); - - /* Return 1 if the target supports tracepoints, 0 (or leave the - callback NULL) otherwise. */ - int (*supports_tracepoints) (void); - - /* Read PC from REGCACHE. */ - CORE_ADDR (*read_pc) (struct regcache *regcache); - - /* Write PC to REGCACHE. */ - void (*write_pc) (struct regcache *regcache, CORE_ADDR pc); - - /* Return true if THREAD is known to be stopped now. */ - int (*thread_stopped) (struct thread_info *thread); - - /* Read Thread Information Block address. */ - int (*get_tib_address) (ptid_t ptid, CORE_ADDR *address); - - /* Pause all threads. If FREEZE, arrange for any resume attempt be - be ignored until an unpause_all call unfreezes threads again. - There can be nested calls to pause_all, so a freeze counter - should be maintained. */ - void (*pause_all) (int freeze); - - /* Unpause all threads. Threads that hadn't been resumed by the - client should be left stopped. Basically a pause/unpause call - pair should not end up resuming threads that were stopped before - the pause call. */ - void (*unpause_all) (int unfreeze); - - /* Cancel all pending breakpoints hits in all threads. */ - void (*cancel_breakpoints) (void); - - /* Stabilize all threads. That is, force them out of jump pads. */ - void (*stabilize_threads) (void); - - /* Install a fast tracepoint jump pad. TPOINT is the address of the - tracepoint internal object as used by the IPA agent. TPADDR is - the address of tracepoint. COLLECTOR is address of the function - the jump pad redirects to. LOCKADDR is the address of the jump - pad lock object. ORIG_SIZE is the size in bytes of the - instruction at TPADDR. JUMP_ENTRY points to the address of the - jump pad entry, and on return holds the address past the end of - the created jump pad. JJUMP_PAD_INSN is a buffer containing a - copy of the instruction at TPADDR. ADJUST_INSN_ADDR and - ADJUST_INSN_ADDR_END are output parameters that return the - address range where the instruction at TPADDR was relocated - to. */ - int (*install_fast_tracepoint_jump_pad) (CORE_ADDR tpoint, CORE_ADDR tpaddr, - CORE_ADDR collector, - CORE_ADDR lockaddr, - ULONGEST orig_size, - CORE_ADDR *jump_entry, - unsigned char *jjump_pad_insn, - ULONGEST *jjump_pad_insn_size, - CORE_ADDR *adjusted_insn_addr, - CORE_ADDR *adjusted_insn_addr_end); - - /* Return the bytecode operations vector for the current inferior. - Returns NULL if bytecode compilation is not supported. */ - struct emit_ops *(*emit_ops) (void); -}; - -extern struct target_ops *the_target; - -void set_target_ops (struct target_ops *); - -#define create_inferior(program, args) \ - (*the_target->create_inferior) (program, args) - -#define myattach(pid) \ - (*the_target->attach) (pid) - -#define kill_inferior(pid) \ - (*the_target->kill) (pid) - -#define detach_inferior(pid) \ - (*the_target->detach) (pid) - -#define mourn_inferior(PROC) \ - (*the_target->mourn) (PROC) - -#define mythread_alive(pid) \ - (*the_target->thread_alive) (pid) - -#define fetch_inferior_registers(regcache, regno) \ - (*the_target->fetch_registers) (regcache, regno) - -#define store_inferior_registers(regcache, regno) \ - (*the_target->store_registers) (regcache, regno) - -#define join_inferior(pid) \ - (*the_target->join) (pid) - -#define target_supports_non_stop() \ - (the_target->supports_non_stop ? (*the_target->supports_non_stop ) () : 0) - -#define target_async(enable) \ - (the_target->async ? (*the_target->async) (enable) : 0) - -#define target_supports_multi_process() \ - (the_target->supports_multi_process ? \ - (*the_target->supports_multi_process) () : 0) - -#define target_process_qsupported(query) \ - do \ - { \ - if (the_target->process_qsupported) \ - the_target->process_qsupported (query); \ - } while (0) - -#define target_supports_tracepoints() \ - (the_target->supports_tracepoints \ - ? (*the_target->supports_tracepoints) () : 0) - -#define target_supports_fast_tracepoints() \ - (the_target->install_fast_tracepoint_jump_pad != NULL) - -#define thread_stopped(thread) \ - (*the_target->thread_stopped) (thread) - -#define pause_all(freeze) \ - do \ - { \ - if (the_target->pause_all) \ - (*the_target->pause_all) (freeze); \ - } while (0) - -#define unpause_all(unfreeze) \ - do \ - { \ - if (the_target->unpause_all) \ - (*the_target->unpause_all) (unfreeze); \ - } while (0) - -#define cancel_breakpoints() \ - do \ - { \ - if (the_target->cancel_breakpoints) \ - (*the_target->cancel_breakpoints) (); \ - } while (0) - -#define stabilize_threads() \ - do \ - { \ - if (the_target->stabilize_threads) \ - (*the_target->stabilize_threads) (); \ - } while (0) - -#define install_fast_tracepoint_jump_pad(tpoint, tpaddr, \ - collector, lockaddr, \ - orig_size, \ - jump_entry, jjump_pad_insn, \ - jjump_pad_insn_size, \ - adjusted_insn_addr, \ - adjusted_insn_addr_end) \ - (*the_target->install_fast_tracepoint_jump_pad) (tpoint, tpaddr, \ - collector,lockaddr, \ - orig_size, jump_entry, \ - jjump_pad_insn, \ - jjump_pad_insn_size, \ - adjusted_insn_addr, \ - adjusted_insn_addr_end) - -#define target_emit_ops() \ - (the_target->emit_ops ? (*the_target->emit_ops) () : NULL) - -/* Start non-stop mode, returns 0 on success, -1 on failure. */ - -int start_non_stop (int nonstop); - -ptid_t mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options, - int connected_wait); - -#define prepare_to_access_memory() \ - (the_target->prepare_to_access_memory \ - ? (*the_target->prepare_to_access_memory) () \ - : 0) - -#define done_accessing_memory() \ - do \ - { \ - if (the_target->done_accessing_memory) \ - (*the_target->done_accessing_memory) (); \ - } while (0) - -int read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len); - -int write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr, - int len); - -void set_desired_inferior (int id); - -const char *target_pid_to_str (ptid_t); - -const char *target_waitstatus_to_string (const struct target_waitstatus *); - -#endif /* TARGET_H */ diff --git a/gdb/gdbserver/terminal.h b/gdb/gdbserver/terminal.h deleted file mode 100644 index 843f039930c..00000000000 --- a/gdb/gdbserver/terminal.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Terminal interface definitions for the GDB remote server. - Copyright (C) 2002, Free Software Foundation, Inc. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 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 !defined (TERMINAL_H) -#define TERMINAL_H 1 - -/* Autoconf will have defined HAVE_TERMIOS_H, HAVE_TERMIO_H, - and HAVE_SGTTY_H for us as appropriate. */ - -#if defined(HAVE_TERMIOS_H) -#define HAVE_TERMIOS -#include <termios.h> -#else /* ! HAVE_TERMIOS_H */ -#if defined(HAVE_TERMIO_H) -#define HAVE_TERMIO -#include <termio.h> - -#undef TIOCGETP -#define TIOCGETP TCGETA -#undef TIOCSETN -#define TIOCSETN TCSETA -#undef TIOCSETP -#define TIOCSETP TCSETAF -#define TERMINAL struct termio -#else /* ! HAVE_TERMIO_H */ -#ifdef HAVE_SGTTY_H -#define HAVE_SGTTY -#include <fcntl.h> -#include <sgtty.h> -#include <sys/ioctl.h> -#define TERMINAL struct sgttyb -#endif -#endif -#endif - -#endif /* !defined (TERMINAL_H) */ diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c deleted file mode 100644 index 9bedd8973c7..00000000000 --- a/gdb/gdbserver/thread-db.c +++ /dev/null @@ -1,983 +0,0 @@ -/* Thread management interface, for the remote server for GDB. - Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - This file is part of GDB. - - This program is free software; you can 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" - -extern int debug_threads; - -static int thread_db_use_events; - -#include "gdb_proc_service.h" -#include "gdb_thread_db.h" - -#ifndef USE_LIBTHREAD_DB_DIRECTLY -#include <dlfcn.h> -#endif - -#include <stdint.h> -#include <limits.h> -#include <ctype.h> - -struct thread_db -{ - /* Structure that identifies the child process for the - <proc_service.h> interface. */ - struct ps_prochandle proc_handle; - - /* Connection to the libthread_db library. */ - td_thragent_t *thread_agent; - - /* If this flag has been set, we've already asked GDB for all - symbols we might need; assume symbol cache misses are - failures. */ - int all_symbols_looked_up; - -#ifndef USE_LIBTHREAD_DB_DIRECTLY - /* Handle of the libthread_db from dlopen. */ - void *handle; -#endif - - /* Thread creation event breakpoint. The code at this location in - the child process will be called by the pthread library whenever - a new thread is created. By setting a special breakpoint at this - location, GDB can detect when a new thread is created. We obtain - this location via the td_ta_event_addr call. Note that if the - running kernel supports tracing clones, then we don't need to use - (and in fact don't use) this magic thread event breakpoint to - learn about threads. */ - struct breakpoint *td_create_bp; - - /* Addresses of libthread_db functions. */ - td_err_e (*td_ta_new_p) (struct ps_prochandle * ps, td_thragent_t **ta); - td_err_e (*td_ta_event_getmsg_p) (const td_thragent_t *ta, - td_event_msg_t *msg); - td_err_e (*td_ta_set_event_p) (const td_thragent_t *ta, - td_thr_events_t *event); - td_err_e (*td_ta_event_addr_p) (const td_thragent_t *ta, - td_event_e event, td_notify_t *ptr); - td_err_e (*td_ta_map_lwp2thr_p) (const td_thragent_t *ta, lwpid_t lwpid, - td_thrhandle_t *th); - td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th, - td_thrinfo_t *infop); - td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th, int event); - td_err_e (*td_ta_thr_iter_p) (const td_thragent_t *ta, - td_thr_iter_f *callback, void *cbdata_p, - td_thr_state_e state, int ti_pri, - sigset_t *ti_sigmask_p, - unsigned int ti_user_flags); - td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th, - psaddr_t map_address, - size_t offset, psaddr_t *address); - const char ** (*td_symbol_list_p) (void); -}; - -static char *libthread_db_search_path; - -static int find_one_thread (ptid_t); -static int find_new_threads_callback (const td_thrhandle_t *th_p, void *data); - -static const char * -thread_db_err_str (td_err_e err) -{ - static char buf[64]; - - switch (err) - { - case TD_OK: - return "generic 'call succeeded'"; - case TD_ERR: - return "generic error"; - case TD_NOTHR: - return "no thread to satisfy query"; - case TD_NOSV: - return "no sync handle to satisfy query"; - case TD_NOLWP: - return "no LWP to satisfy query"; - case TD_BADPH: - return "invalid process handle"; - case TD_BADTH: - return "invalid thread handle"; - case TD_BADSH: - return "invalid synchronization handle"; - case TD_BADTA: - return "invalid thread agent"; - case TD_BADKEY: - return "invalid key"; - case TD_NOMSG: - return "no event message for getmsg"; - case TD_NOFPREGS: - return "FPU register set not available"; - case TD_NOLIBTHREAD: - return "application not linked with libthread"; - case TD_NOEVENT: - return "requested event is not supported"; - case TD_NOCAPAB: - return "capability not available"; - case TD_DBERR: - return "debugger service failed"; - case TD_NOAPLIC: - return "operation not applicable to"; - case TD_NOTSD: - return "no thread-specific data for this thread"; - case TD_MALLOC: - return "malloc failed"; - case TD_PARTIALREG: - return "only part of register set was written/read"; - case TD_NOXREGS: - return "X register set not available for this thread"; -#ifdef HAVE_TD_VERSION - case TD_VERSION: - return "version mismatch between libthread_db and libpthread"; -#endif - default: - xsnprintf (buf, sizeof (buf), "unknown thread_db error '%d'", err); - return buf; - } -} - -#if 0 -static char * -thread_db_state_str (td_thr_state_e state) -{ - static char buf[64]; - - switch (state) - { - case TD_THR_STOPPED: - return "stopped by debugger"; - case TD_THR_RUN: - return "runnable"; - case TD_THR_ACTIVE: - return "active"; - case TD_THR_ZOMBIE: - return "zombie"; - case TD_THR_SLEEP: - return "sleeping"; - case TD_THR_STOPPED_ASLEEP: - return "stopped by debugger AND blocked"; - default: - xsnprintf (buf, sizeof (buf), "unknown thread_db state %d", state); - return buf; - } -} -#endif - -static int -thread_db_create_event (CORE_ADDR where) -{ - td_event_msg_t msg; - td_err_e err; - struct lwp_info *lwp; - struct thread_db *thread_db = current_process ()->private->thread_db; - - if (thread_db->td_ta_event_getmsg_p == NULL) - fatal ("unexpected thread_db->td_ta_event_getmsg_p == NULL"); - - if (debug_threads) - fprintf (stderr, "Thread creation event.\n"); - - /* FIXME: This assumes we don't get another event. - In the LinuxThreads implementation, this is safe, - because all events come from the manager thread - (except for its own creation, of course). */ - err = thread_db->td_ta_event_getmsg_p (thread_db->thread_agent, &msg); - if (err != TD_OK) - fprintf (stderr, "thread getmsg err: %s\n", - thread_db_err_str (err)); - - /* If we do not know about the main thread yet, this would be a good time to - find it. We need to do this to pick up the main thread before any newly - created threads. */ - lwp = get_thread_lwp (current_inferior); - if (lwp->thread_known == 0) - find_one_thread (lwp->head.id); - - /* msg.event == TD_EVENT_CREATE */ - - find_new_threads_callback (msg.th_p, NULL); - - return 0; -} - -static int -thread_db_enable_reporting (void) -{ - td_thr_events_t events; - td_notify_t notify; - td_err_e err; - struct thread_db *thread_db = current_process ()->private->thread_db; - - if (thread_db->td_ta_set_event_p == NULL - || thread_db->td_ta_event_addr_p == NULL - || thread_db->td_ta_event_getmsg_p == NULL) - /* This libthread_db is missing required support. */ - return 0; - - /* Set the process wide mask saying which events we're interested in. */ - td_event_emptyset (&events); - td_event_addset (&events, TD_CREATE); - - err = thread_db->td_ta_set_event_p (thread_db->thread_agent, &events); - if (err != TD_OK) - { - warning ("Unable to set global thread event mask: %s", - thread_db_err_str (err)); - return 0; - } - - /* Get address for thread creation breakpoint. */ - err = thread_db->td_ta_event_addr_p (thread_db->thread_agent, TD_CREATE, - ¬ify); - if (err != TD_OK) - { - warning ("Unable to get location for thread creation breakpoint: %s", - thread_db_err_str (err)); - return 0; - } - thread_db->td_create_bp - = set_breakpoint_at ((CORE_ADDR) (unsigned long) notify.u.bptaddr, - thread_db_create_event); - - return 1; -} - -static int -find_one_thread (ptid_t ptid) -{ - td_thrhandle_t th; - td_thrinfo_t ti; - td_err_e err; - struct thread_info *inferior; - struct lwp_info *lwp; - struct thread_db *thread_db = current_process ()->private->thread_db; - int lwpid = ptid_get_lwp (ptid); - - inferior = (struct thread_info *) find_inferior_id (&all_threads, ptid); - lwp = get_thread_lwp (inferior); - if (lwp->thread_known) - return 1; - - /* Get information about this thread. */ - err = thread_db->td_ta_map_lwp2thr_p (thread_db->thread_agent, lwpid, &th); - if (err != TD_OK) - error ("Cannot get thread handle for LWP %d: %s", - lwpid, thread_db_err_str (err)); - - err = thread_db->td_thr_get_info_p (&th, &ti); - if (err != TD_OK) - error ("Cannot get thread info for LWP %d: %s", - lwpid, thread_db_err_str (err)); - - if (debug_threads) - fprintf (stderr, "Found thread %ld (LWP %d)\n", - ti.ti_tid, ti.ti_lid); - - if (lwpid != ti.ti_lid) - { - warning ("PID mismatch! Expected %ld, got %ld", - (long) lwpid, (long) ti.ti_lid); - return 0; - } - - if (thread_db_use_events) - { - err = thread_db->td_thr_event_enable_p (&th, 1); - if (err != TD_OK) - error ("Cannot enable thread event reporting for %d: %s", - ti.ti_lid, thread_db_err_str (err)); - } - - /* If the new thread ID is zero, a final thread ID will be available - later. Do not enable thread debugging yet. */ - if (ti.ti_tid == 0) - return 0; - - lwp->thread_known = 1; - lwp->th = th; - - return 1; -} - -/* Attach a thread. Return true on success. */ - -static int -attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p) -{ - struct lwp_info *lwp; - - if (debug_threads) - fprintf (stderr, "Attaching to thread %ld (LWP %d)\n", - ti_p->ti_tid, ti_p->ti_lid); - linux_attach_lwp (ti_p->ti_lid); - lwp = find_lwp_pid (pid_to_ptid (ti_p->ti_lid)); - if (lwp == NULL) - { - warning ("Could not attach to thread %ld (LWP %d)\n", - ti_p->ti_tid, ti_p->ti_lid); - return 0; - } - - lwp->thread_known = 1; - lwp->th = *th_p; - - if (thread_db_use_events) - { - td_err_e err; - struct thread_db *thread_db = current_process ()->private->thread_db; - - err = thread_db->td_thr_event_enable_p (th_p, 1); - if (err != TD_OK) - error ("Cannot enable thread event reporting for %d: %s", - ti_p->ti_lid, thread_db_err_str (err)); - } - - return 1; -} - -/* Attach thread if we haven't seen it yet. - Increment *COUNTER if we have attached a new thread. - Return false on failure. */ - -static int -maybe_attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p, - int *counter) -{ - struct lwp_info *lwp; - - lwp = find_lwp_pid (pid_to_ptid (ti_p->ti_lid)); - if (lwp != NULL) - return 1; - - if (!attach_thread (th_p, ti_p)) - return 0; - - if (counter != NULL) - *counter += 1; - - return 1; -} - -static int -find_new_threads_callback (const td_thrhandle_t *th_p, void *data) -{ - td_thrinfo_t ti; - td_err_e err; - struct thread_db *thread_db = current_process ()->private->thread_db; - - err = thread_db->td_thr_get_info_p (th_p, &ti); - if (err != TD_OK) - error ("Cannot get thread info: %s", thread_db_err_str (err)); - - /* Check for zombies. */ - if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE) - return 0; - - if (!maybe_attach_thread (th_p, &ti, (int *) data)) - { - /* Terminate iteration early: we might be looking at stale data in - the inferior. The thread_db_find_new_threads will retry. */ - return 1; - } - - return 0; -} - -static void -thread_db_find_new_threads (void) -{ - td_err_e err; - ptid_t ptid = ((struct inferior_list_entry *) current_inferior)->id; - struct thread_db *thread_db = current_process ()->private->thread_db; - int loop, iteration; - - /* This function is only called when we first initialize thread_db. - First locate the initial thread. If it is not ready for - debugging yet, then stop. */ - if (find_one_thread (ptid) == 0) - return; - - /* Require 4 successive iterations which do not find any new threads. - The 4 is a heuristic: there is an inherent race here, and I have - seen that 2 iterations in a row are not always sufficient to - "capture" all threads. */ - for (loop = 0, iteration = 0; loop < 4; ++loop, ++iteration) - { - int new_thread_count = 0; - - /* Iterate over all user-space threads to discover new threads. */ - err = thread_db->td_ta_thr_iter_p (thread_db->thread_agent, - find_new_threads_callback, - &new_thread_count, - TD_THR_ANY_STATE, - TD_THR_LOWEST_PRIORITY, - TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); - if (debug_threads) - fprintf (stderr, "Found %d threads in iteration %d.\n", - new_thread_count, iteration); - - if (new_thread_count != 0) - { - /* Found new threads. Restart iteration from beginning. */ - loop = -1; - } - } - if (err != TD_OK) - error ("Cannot find new threads: %s", thread_db_err_str (err)); -} - -/* Cache all future symbols that thread_db might request. We can not - request symbols at arbitrary states in the remote protocol, only - when the client tells us that new symbols are available. So when - we load the thread library, make sure to check the entire list. */ - -static void -thread_db_look_up_symbols (void) -{ - struct thread_db *thread_db = current_process ()->private->thread_db; - const char **sym_list; - CORE_ADDR unused; - - for (sym_list = thread_db->td_symbol_list_p (); *sym_list; sym_list++) - look_up_one_symbol (*sym_list, &unused, 1); - - /* We're not interested in any other libraries loaded after this - point, only in symbols in libpthread.so. */ - thread_db->all_symbols_looked_up = 1; -} - -int -thread_db_look_up_one_symbol (const char *name, CORE_ADDR *addrp) -{ - struct thread_db *thread_db = current_process ()->private->thread_db; - int may_ask_gdb = !thread_db->all_symbols_looked_up; - - /* If we've passed the call to thread_db_look_up_symbols, then - anything not in the cache must not exist; we're not interested - in any libraries loaded after that point, only in symbols in - libpthread.so. It might not be an appropriate time to look - up a symbol, e.g. while we're trying to fetch registers. */ - return look_up_one_symbol (name, addrp, may_ask_gdb); -} - -int -thread_db_get_tls_address (struct thread_info *thread, CORE_ADDR offset, - CORE_ADDR load_module, CORE_ADDR *address) -{ - psaddr_t addr; - td_err_e err; - struct lwp_info *lwp; - struct thread_info *saved_inferior; - struct process_info *proc; - struct thread_db *thread_db; - - proc = get_thread_process (thread); - thread_db = proc->private->thread_db; - - /* If the thread layer is not (yet) initialized, fail. */ - if (!thread_db->all_symbols_looked_up) - return TD_ERR; - - if (thread_db->td_thr_tls_get_addr_p == NULL) - return -1; - - lwp = get_thread_lwp (thread); - if (!lwp->thread_known) - find_one_thread (lwp->head.id); - if (!lwp->thread_known) - return TD_NOTHR; - - saved_inferior = current_inferior; - current_inferior = thread; - /* Note the cast through uintptr_t: this interface only works if - a target address fits in a psaddr_t, which is a host pointer. - So a 32-bit debugger can not access 64-bit TLS through this. */ - err = thread_db->td_thr_tls_get_addr_p (&lwp->th, - (psaddr_t) (uintptr_t) load_module, - offset, &addr); - current_inferior = saved_inferior; - if (err == TD_OK) - { - *address = (CORE_ADDR) (uintptr_t) addr; - return 0; - } - else - return err; -} - -#ifdef USE_LIBTHREAD_DB_DIRECTLY - -static int -thread_db_load_search (void) -{ - td_err_e err; - struct thread_db *tdb; - struct process_info *proc = current_process (); - - if (proc->private->thread_db != NULL) - fatal ("unexpected: proc->private->thread_db != NULL"); - - tdb = xcalloc (1, sizeof (*tdb)); - proc->private->thread_db = tdb; - - tdb->td_ta_new_p = &td_ta_new; - - /* Attempt to open a connection to the thread library. */ - err = tdb->td_ta_new_p (&tdb->proc_handle, &tdb->thread_agent); - if (err != TD_OK) - { - if (debug_threads) - fprintf (stderr, "td_ta_new(): %s\n", thread_db_err_str (err)); - free (tdb); - proc->private->thread_db = NULL; - return 0; - } - - tdb->td_ta_map_lwp2thr_p = &td_ta_map_lwp2thr; - tdb->td_thr_get_info_p = &td_thr_get_info; - tdb->td_ta_thr_iter_p = &td_ta_thr_iter; - tdb->td_symbol_list_p = &td_symbol_list; - - /* This is required only when thread_db_use_events is on. */ - tdb->td_thr_event_enable_p = &td_thr_event_enable; - - /* These are not essential. */ - tdb->td_ta_event_addr_p = &td_ta_event_addr; - tdb->td_ta_set_event_p = &td_ta_set_event; - tdb->td_ta_event_getmsg_p = &td_ta_event_getmsg; - tdb->td_thr_tls_get_addr_p = &td_thr_tls_get_addr; - - return 1; -} - -#else - -static int -try_thread_db_load_1 (void *handle) -{ - td_err_e err; - struct thread_db *tdb; - struct process_info *proc = current_process (); - - if (proc->private->thread_db != NULL) - fatal ("unexpected: proc->private->thread_db != NULL"); - - tdb = xcalloc (1, sizeof (*tdb)); - proc->private->thread_db = tdb; - - tdb->handle = handle; - - /* Initialize pointers to the dynamic library functions we will use. - Essential functions first. */ - -#define CHK(required, a) \ - do \ - { \ - if ((a) == NULL) \ - { \ - if (debug_threads) \ - fprintf (stderr, "dlsym: %s\n", dlerror ()); \ - if (required) \ - { \ - free (tdb); \ - proc->private->thread_db = NULL; \ - return 0; \ - } \ - } \ - } \ - while (0) - - CHK (1, tdb->td_ta_new_p = dlsym (handle, "td_ta_new")); - - /* Attempt to open a connection to the thread library. */ - err = tdb->td_ta_new_p (&tdb->proc_handle, &tdb->thread_agent); - if (err != TD_OK) - { - if (debug_threads) - fprintf (stderr, "td_ta_new(): %s\n", thread_db_err_str (err)); - free (tdb); - proc->private->thread_db = NULL; - return 0; - } - - CHK (1, tdb->td_ta_map_lwp2thr_p = dlsym (handle, "td_ta_map_lwp2thr")); - CHK (1, tdb->td_thr_get_info_p = dlsym (handle, "td_thr_get_info")); - CHK (1, tdb->td_ta_thr_iter_p = dlsym (handle, "td_ta_thr_iter")); - CHK (1, tdb->td_symbol_list_p = dlsym (handle, "td_symbol_list")); - - /* This is required only when thread_db_use_events is on. */ - CHK (thread_db_use_events, - tdb->td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable")); - - /* These are not essential. */ - CHK (0, tdb->td_ta_event_addr_p = dlsym (handle, "td_ta_event_addr")); - CHK (0, tdb->td_ta_set_event_p = dlsym (handle, "td_ta_set_event")); - CHK (0, tdb->td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg")); - CHK (0, tdb->td_thr_tls_get_addr_p = dlsym (handle, "td_thr_tls_get_addr")); - -#undef CHK - - return 1; -} - -#ifdef HAVE_DLADDR - -/* Lookup a library in which given symbol resides. - Note: this is looking in the GDBSERVER process, not in the inferior. - Returns library name, or NULL. */ - -static const char * -dladdr_to_soname (const void *addr) -{ - Dl_info info; - - if (dladdr (addr, &info) != 0) - return info.dli_fname; - return NULL; -} - -#endif - -static int -try_thread_db_load (const char *library) -{ - void *handle; - - if (debug_threads) - fprintf (stderr, "Trying host libthread_db library: %s.\n", - library); - handle = dlopen (library, RTLD_NOW); - if (handle == NULL) - { - if (debug_threads) - fprintf (stderr, "dlopen failed: %s.\n", dlerror ()); - return 0; - } - -#ifdef HAVE_DLADDR - if (debug_threads && strchr (library, '/') == NULL) - { - void *td_init; - - td_init = dlsym (handle, "td_init"); - if (td_init != NULL) - { - const char *const libpath = dladdr_to_soname (td_init); - - if (libpath != NULL) - fprintf (stderr, "Host %s resolved to: %s.\n", - library, libpath); - } - } -#endif - - if (try_thread_db_load_1 (handle)) - return 1; - - /* This library "refused" to work on current inferior. */ - dlclose (handle); - return 0; -} - -/* Handle $sdir in libthread-db-search-path. - Look for libthread_db in the system dirs, or wherever a plain - dlopen(file_without_path) will look. - The result is true for success. */ - -static int -try_thread_db_load_from_sdir (void) -{ - return try_thread_db_load (LIBTHREAD_DB_SO); -} - -/* Try to load libthread_db from directory DIR of length DIR_LEN. - The result is true for success. */ - -static int -try_thread_db_load_from_dir (const char *dir, size_t dir_len) -{ - char path[PATH_MAX]; - - if (dir_len + 1 + strlen (LIBTHREAD_DB_SO) + 1 > sizeof (path)) - { - char *cp = xmalloc (dir_len + 1); - - memcpy (cp, dir, dir_len); - cp[dir_len] = '\0'; - warning (_("libthread-db-search-path component too long," - " ignored: %s."), cp); - free (cp); - return 0; - } - - memcpy (path, dir, dir_len); - path[dir_len] = '/'; - strcpy (path + dir_len + 1, LIBTHREAD_DB_SO); - return try_thread_db_load (path); -} - -/* Search libthread_db_search_path for libthread_db which "agrees" - to work on current inferior. - The result is true for success. */ - -static int -thread_db_load_search (void) -{ - const char *search_path; - int rc = 0; - - if (libthread_db_search_path == NULL) - libthread_db_search_path = xstrdup (LIBTHREAD_DB_SEARCH_PATH); - - search_path = libthread_db_search_path; - while (*search_path) - { - const char *end = strchr (search_path, ':'); - const char *this_dir = search_path; - size_t this_dir_len; - - if (end) - { - this_dir_len = end - search_path; - search_path += this_dir_len + 1; - } - else - { - this_dir_len = strlen (this_dir); - search_path += this_dir_len; - } - - if (this_dir_len == sizeof ("$pdir") - 1 - && strncmp (this_dir, "$pdir", this_dir_len) == 0) - { - /* We don't maintain a list of loaded libraries so we don't know - where libpthread lives. We *could* fetch the info, but we don't - do that yet. Ignore it. */ - } - else if (this_dir_len == sizeof ("$sdir") - 1 - && strncmp (this_dir, "$sdir", this_dir_len) == 0) - { - if (try_thread_db_load_from_sdir ()) - { - rc = 1; - break; - } - } - else - { - if (try_thread_db_load_from_dir (this_dir, this_dir_len)) - { - rc = 1; - break; - } - } - } - - if (debug_threads) - fprintf (stderr, "thread_db_load_search returning %d\n", rc); - return rc; -} - -#endif /* USE_LIBTHREAD_DB_DIRECTLY */ - -int -thread_db_init (int use_events) -{ - struct process_info *proc = current_process (); - - /* FIXME drow/2004-10-16: This is the "overall process ID", which - GNU/Linux calls tgid, "thread group ID". When we support - attaching to threads, the original thread may not be the correct - thread. We would have to get the process ID from /proc for NPTL. - For LinuxThreads we could do something similar: follow the chain - of parent processes until we find the highest one we're attached - to, and use its tgid. - - This isn't the only place in gdbserver that assumes that the first - process in the list is the thread group leader. */ - - thread_db_use_events = use_events; - - if (thread_db_load_search ()) - { - if (use_events && thread_db_enable_reporting () == 0) - { - /* Keep trying; maybe event reporting will work later. */ - thread_db_mourn (proc); - return 0; - } - thread_db_find_new_threads (); - thread_db_look_up_symbols (); - return 1; - } - - return 0; -} - -static int -any_thread_of (struct inferior_list_entry *entry, void *args) -{ - int *pid_p = args; - - if (ptid_get_pid (entry->id) == *pid_p) - return 1; - - return 0; -} - -static void -switch_to_process (struct process_info *proc) -{ - int pid = pid_of (proc); - - current_inferior = - (struct thread_info *) find_inferior (&all_threads, - any_thread_of, &pid); -} - -/* Disconnect from libthread_db and free resources. */ - -static void -disable_thread_event_reporting (struct process_info *proc) -{ - struct thread_db *thread_db = proc->private->thread_db; - if (thread_db) - { - td_err_e (*td_ta_clear_event_p) (const td_thragent_t *ta, - td_thr_events_t *event); - -#ifndef USE_LIBTHREAD_DB_DIRECTLY - td_ta_clear_event_p = dlsym (thread_db->handle, "td_ta_clear_event"); -#else - td_ta_clear_event_p = &td_ta_clear_event; -#endif - - if (td_ta_clear_event_p != NULL) - { - struct thread_info *saved_inferior = current_inferior; - td_thr_events_t events; - - switch_to_process (proc); - - /* Set the process wide mask saying we aren't interested - in any events anymore. */ - td_event_fillset (&events); - (*td_ta_clear_event_p) (thread_db->thread_agent, &events); - - current_inferior = saved_inferior; - } - } -} - -static void -remove_thread_event_breakpoints (struct process_info *proc) -{ - struct thread_db *thread_db = proc->private->thread_db; - - if (thread_db->td_create_bp != NULL) - { - struct thread_info *saved_inferior = current_inferior; - - switch_to_process (proc); - - delete_breakpoint (thread_db->td_create_bp); - thread_db->td_create_bp = NULL; - - current_inferior = saved_inferior; - } -} - -void -thread_db_detach (struct process_info *proc) -{ - struct thread_db *thread_db = proc->private->thread_db; - - if (thread_db) - { - disable_thread_event_reporting (proc); - remove_thread_event_breakpoints (proc); - } -} - -/* Disconnect from libthread_db and free resources. */ - -void -thread_db_mourn (struct process_info *proc) -{ - struct thread_db *thread_db = proc->private->thread_db; - if (thread_db) - { - td_err_e (*td_ta_delete_p) (td_thragent_t *); - -#ifndef USE_LIBTHREAD_DB_DIRECTLY - td_ta_delete_p = dlsym (thread_db->handle, "td_ta_delete"); -#else - td_ta_delete_p = &td_ta_delete; -#endif - - if (td_ta_delete_p != NULL) - (*td_ta_delete_p) (thread_db->thread_agent); - -#ifndef USE_LIBTHREAD_DB_DIRECTLY - dlclose (thread_db->handle); -#endif /* USE_LIBTHREAD_DB_DIRECTLY */ - - free (thread_db); - proc->private->thread_db = NULL; - } -} - -/* Handle "set libthread-db-search-path" monitor command and return 1. - For any other command, return 0. */ - -int -thread_db_handle_monitor_command (char *mon) -{ - const char *cmd = "set libthread-db-search-path"; - size_t cmd_len = strlen (cmd); - - if (strncmp (mon, cmd, cmd_len) == 0 - && (mon[cmd_len] == '\0' - || mon[cmd_len] == ' ')) - { - const char *cp = mon + cmd_len; - - if (libthread_db_search_path != NULL) - free (libthread_db_search_path); - - /* Skip leading space (if any). */ - while (isspace (*cp)) - ++cp; - - if (*cp == '\0') - cp = LIBTHREAD_DB_SEARCH_PATH; - libthread_db_search_path = xstrdup (cp); - - monitor_output ("libthread-db-search-path set to `"); - monitor_output (libthread_db_search_path); - monitor_output ("'\n"); - return 1; - } - - /* Tell server.c to perform default processing. */ - return 0; -} diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c deleted file mode 100644 index 0a64104072c..00000000000 --- a/gdb/gdbserver/tracepoint.c +++ /dev/null @@ -1,7687 +0,0 @@ -/* Tracepoint code for remote server for GDB. - Copyright (C) 2009, 2010, 2011 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 <ctype.h> -#include <fcntl.h> -#include <unistd.h> -#include <sys/time.h> -#include <stddef.h> -#if HAVE_STDINT_H -#include <stdint.h> -#endif - -/* This file is built for both GDBserver, and the in-process - agent (IPA), a shared library that includes a tracing agent that is - loaded by the inferior to support fast tracepoints. Fast - tracepoints (or more accurately, jump based tracepoints) are - implemented by patching the tracepoint location with a jump into a - small trampoline function whose job is to save the register state, - call the in-process tracing agent, and then execute the original - instruction that was under the tracepoint jump (possibly adjusted, - if PC-relative, or some such). - - The current synchronization design is pull based. That means, - GDBserver does most of the work, by peeking/poking at the inferior - agent's memory directly for downloading tracepoint and associated - objects, and for uploading trace frames. Whenever the IPA needs - something from GDBserver (trace buffer is full, tracing stopped for - some reason, etc.) the IPA calls a corresponding hook function - where GDBserver has placed a breakpoint. - - Each of the agents has its own trace buffer. When browsing the - trace frames built from slow and fast tracepoints from GDB (tfind - mode), there's no guarantee the user is seeing the trace frames in - strict chronological creation order, although, GDBserver tries to - keep the order relatively reasonable, by syncing the trace buffers - at appropriate times. - -*/ - -static void trace_vdebug (const char *, ...) ATTR_FORMAT (printf, 1, 2); - -static void -trace_vdebug (const char *fmt, ...) -{ - char buf[1024]; - va_list ap; - - va_start (ap, fmt); - vsprintf (buf, fmt, ap); - fprintf (stderr, "gdbserver/tracepoint: %s\n", buf); - va_end (ap); -} - -#define trace_debug_1(level, fmt, args...) \ - do { \ - if (level <= debug_threads) \ - trace_vdebug ((fmt), ##args); \ - } while (0) - -#define trace_debug(FMT, args...) \ - trace_debug_1 (1, FMT, ##args) - -#if defined(__GNUC__) -# define ATTR_USED __attribute__((used)) -# define ATTR_NOINLINE __attribute__((noinline)) -# define ATTR_CONSTRUCTOR __attribute__ ((constructor)) -#else -# define ATTR_USED -# define ATTR_NOINLINE -# define ATTR_CONSTRUCTOR -#endif - -/* Make sure the functions the IPA needs to export (symbols GDBserver - needs to query GDB about) are exported. */ - -#ifdef IN_PROCESS_AGENT -# if defined _WIN32 || defined __CYGWIN__ -# define IP_AGENT_EXPORT __declspec(dllexport) ATTR_USED -# else -# if __GNUC__ >= 4 -# define IP_AGENT_EXPORT \ - __attribute__ ((visibility("default"))) ATTR_USED -# else -# define IP_AGENT_EXPORT ATTR_USED -# endif -# endif -#else -# define IP_AGENT_EXPORT -#endif - -/* Prefix exported symbols, for good citizenship. All the symbols - that need exporting are defined in this module. */ -#ifdef IN_PROCESS_AGENT -# define gdb_tp_heap_buffer gdb_agent_gdb_tp_heap_buffer -# define gdb_jump_pad_buffer gdb_agent_gdb_jump_pad_buffer -# define gdb_jump_pad_buffer_end gdb_agent_gdb_jump_pad_buffer_end -# define collecting gdb_agent_collecting -# define gdb_collect gdb_agent_gdb_collect -# define stop_tracing gdb_agent_stop_tracing -# define flush_trace_buffer gdb_agent_flush_trace_buffer -# define about_to_request_buffer_space gdb_agent_about_to_request_buffer_space -# define trace_buffer_is_full gdb_agent_trace_buffer_is_full -# define stopping_tracepoint gdb_agent_stopping_tracepoint -# define expr_eval_result gdb_agent_expr_eval_result -# define error_tracepoint gdb_agent_error_tracepoint -# define tracepoints gdb_agent_tracepoints -# define tracing gdb_agent_tracing -# define trace_buffer_ctrl gdb_agent_trace_buffer_ctrl -# define trace_buffer_ctrl_curr gdb_agent_trace_buffer_ctrl_curr -# define trace_buffer_lo gdb_agent_trace_buffer_lo -# define trace_buffer_hi gdb_agent_trace_buffer_hi -# define traceframe_read_count gdb_agent_traceframe_read_count -# define traceframe_write_count gdb_agent_traceframe_write_count -# define traceframes_created gdb_agent_traceframes_created -# define trace_state_variables gdb_agent_trace_state_variables -# define get_raw_reg gdb_agent_get_raw_reg -# define get_trace_state_variable_value \ - gdb_agent_get_trace_state_variable_value -# define set_trace_state_variable_value \ - gdb_agent_set_trace_state_variable_value -# define ust_loaded gdb_agent_ust_loaded -# define helper_thread_id gdb_agent_helper_thread_id -# define cmd_buf gdb_agent_cmd_buf -#endif - -#ifndef IN_PROCESS_AGENT - -/* Addresses of in-process agent's symbols GDBserver cares about. */ - -struct ipa_sym_addresses -{ - CORE_ADDR addr_gdb_tp_heap_buffer; - CORE_ADDR addr_gdb_jump_pad_buffer; - CORE_ADDR addr_gdb_jump_pad_buffer_end; - CORE_ADDR addr_collecting; - CORE_ADDR addr_gdb_collect; - CORE_ADDR addr_stop_tracing; - CORE_ADDR addr_flush_trace_buffer; - CORE_ADDR addr_about_to_request_buffer_space; - CORE_ADDR addr_trace_buffer_is_full; - CORE_ADDR addr_stopping_tracepoint; - CORE_ADDR addr_expr_eval_result; - CORE_ADDR addr_error_tracepoint; - CORE_ADDR addr_tracepoints; - CORE_ADDR addr_tracing; - CORE_ADDR addr_trace_buffer_ctrl; - CORE_ADDR addr_trace_buffer_ctrl_curr; - CORE_ADDR addr_trace_buffer_lo; - CORE_ADDR addr_trace_buffer_hi; - CORE_ADDR addr_traceframe_read_count; - CORE_ADDR addr_traceframe_write_count; - CORE_ADDR addr_traceframes_created; - CORE_ADDR addr_trace_state_variables; - CORE_ADDR addr_get_raw_reg; - CORE_ADDR addr_get_trace_state_variable_value; - CORE_ADDR addr_set_trace_state_variable_value; - CORE_ADDR addr_ust_loaded; - CORE_ADDR addr_helper_thread_id; - CORE_ADDR addr_cmd_buf; -}; - -#define STRINGIZE_1(STR) #STR -#define STRINGIZE(STR) STRINGIZE_1(STR) -#define IPA_SYM(SYM) \ - { \ - STRINGIZE (gdb_agent_ ## SYM), \ - offsetof (struct ipa_sym_addresses, addr_ ## SYM) \ - } - -static struct -{ - const char *name; - int offset; - int required; -} symbol_list[] = { - IPA_SYM(gdb_tp_heap_buffer), - IPA_SYM(gdb_jump_pad_buffer), - IPA_SYM(gdb_jump_pad_buffer_end), - IPA_SYM(collecting), - IPA_SYM(gdb_collect), - IPA_SYM(stop_tracing), - IPA_SYM(flush_trace_buffer), - IPA_SYM(about_to_request_buffer_space), - IPA_SYM(trace_buffer_is_full), - IPA_SYM(stopping_tracepoint), - IPA_SYM(expr_eval_result), - IPA_SYM(error_tracepoint), - IPA_SYM(tracepoints), - IPA_SYM(tracing), - IPA_SYM(trace_buffer_ctrl), - IPA_SYM(trace_buffer_ctrl_curr), - IPA_SYM(trace_buffer_lo), - IPA_SYM(trace_buffer_hi), - IPA_SYM(traceframe_read_count), - IPA_SYM(traceframe_write_count), - IPA_SYM(traceframes_created), - IPA_SYM(trace_state_variables), - IPA_SYM(get_raw_reg), - IPA_SYM(get_trace_state_variable_value), - IPA_SYM(set_trace_state_variable_value), - IPA_SYM(ust_loaded), - IPA_SYM(helper_thread_id), - IPA_SYM(cmd_buf), -}; - -struct ipa_sym_addresses ipa_sym_addrs; - -int all_tracepoint_symbols_looked_up; - -int -in_process_agent_loaded (void) -{ - return all_tracepoint_symbols_looked_up; -} - -static int read_inferior_integer (CORE_ADDR symaddr, int *val); - -/* Returns true if both the in-process agent library and the static - tracepoints libraries are loaded in the inferior. */ - -static int -in_process_agent_loaded_ust (void) -{ - int loaded = 0; - - if (!in_process_agent_loaded ()) - { - warning ("In-process agent not loaded"); - return 0; - } - - if (read_inferior_integer (ipa_sym_addrs.addr_ust_loaded, &loaded)) - { - warning ("Error reading ust_loaded in lib"); - return 0; - } - - return loaded; -} - -static void -write_e_ipa_not_loaded (char *buffer) -{ - sprintf (buffer, - "E.In-process agent library not loaded in process. " - "Fast and static tracepoints unavailable."); -} - -/* Write an error to BUFFER indicating that UST isn't loaded in the - inferior. */ - -static void -write_e_ust_not_loaded (char *buffer) -{ -#ifdef HAVE_UST - sprintf (buffer, - "E.UST library not loaded in process. " - "Static tracepoints unavailable."); -#else - sprintf (buffer, "E.GDBserver was built without static tracepoints support"); -#endif -} - -/* If the in-process agent library isn't loaded in the inferior, write - an error to BUFFER, and return 1. Otherwise, return 0. */ - -static int -maybe_write_ipa_not_loaded (char *buffer) -{ - if (!in_process_agent_loaded ()) - { - write_e_ipa_not_loaded (buffer); - return 1; - } - return 0; -} - -/* If the in-process agent library and the ust (static tracepoints) - library aren't loaded in the inferior, write an error to BUFFER, - and return 1. Otherwise, return 0. */ - -static int -maybe_write_ipa_ust_not_loaded (char *buffer) -{ - if (!in_process_agent_loaded ()) - { - write_e_ipa_not_loaded (buffer); - return 1; - } - else if (!in_process_agent_loaded_ust ()) - { - write_e_ust_not_loaded (buffer); - return 1; - } - return 0; -} - -/* Cache all future symbols that the tracepoints module might request. - We can not request symbols at arbitrary states in the remote - protocol, only when the client tells us that new symbols are - available. So when we load the in-process library, make sure to - check the entire list. */ - -void -tracepoint_look_up_symbols (void) -{ - int i; - - if (all_tracepoint_symbols_looked_up) - return; - - for (i = 0; i < sizeof (symbol_list) / sizeof (symbol_list[0]); i++) - { - CORE_ADDR *addrp = - (CORE_ADDR *) ((char *) &ipa_sym_addrs + symbol_list[i].offset); - - if (look_up_one_symbol (symbol_list[i].name, addrp, 1) == 0) - { - if (debug_threads) - fprintf (stderr, "symbol `%s' not found\n", symbol_list[i].name); - return; - } - } - - all_tracepoint_symbols_looked_up = 1; -} - -#endif - -/* GDBserver places a breakpoint on the IPA's version (which is a nop) - of the "stop_tracing" function. When this breakpoint is hit, - tracing stopped in the IPA for some reason. E.g., due to - tracepoint reaching the pass count, hitting conditional expression - evaluation error, etc. - - The IPA's trace buffer is never in circular tracing mode: instead, - GDBserver's is, and whenever the in-process buffer fills, it calls - "flush_trace_buffer", which triggers an internal breakpoint. - GDBserver reacts to this breakpoint by pulling the meanwhile - collected data. Old frames discarding is always handled on the - GDBserver side. */ - -#ifdef IN_PROCESS_AGENT -int debug_threads = 0; - -int -read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - memcpy (myaddr, (void *) (uintptr_t) memaddr, len); - return 0; -} - -/* Call this in the functions where GDBserver places a breakpoint, so - that the compiler doesn't try to be clever and skip calling the - function at all. This is necessary, even if we tell the compiler - to not inline said functions. */ - -#if defined(__GNUC__) -# define UNKNOWN_SIDE_EFFECTS() asm ("") -#else -# define UNKNOWN_SIDE_EFFECTS() do {} while (0) -#endif - -IP_AGENT_EXPORT void ATTR_USED ATTR_NOINLINE -stop_tracing (void) -{ - /* GDBserver places breakpoint here. */ - UNKNOWN_SIDE_EFFECTS(); -} - -IP_AGENT_EXPORT void ATTR_USED ATTR_NOINLINE -flush_trace_buffer (void) -{ - /* GDBserver places breakpoint here. */ - UNKNOWN_SIDE_EFFECTS(); -} - -#endif - -#ifndef IN_PROCESS_AGENT -static int -tracepoint_handler (CORE_ADDR address) -{ - trace_debug ("tracepoint_handler: tracepoint at 0x%s hit", - paddress (address)); - return 0; -} - -/* Breakpoint at "stop_tracing" in the inferior lib. */ -struct breakpoint *stop_tracing_bkpt; -static int stop_tracing_handler (CORE_ADDR); - -/* Breakpoint at "flush_trace_buffer" in the inferior lib. */ -struct breakpoint *flush_trace_buffer_bkpt; -static int flush_trace_buffer_handler (CORE_ADDR); - -static void download_tracepoints (void); -static void download_trace_state_variables (void); -static void upload_fast_traceframes (void); - -static int run_inferior_command (char *cmd); - -static int -read_inferior_integer (CORE_ADDR symaddr, int *val) -{ - return read_inferior_memory (symaddr, (unsigned char *) val, - sizeof (*val)); -} - -static int -read_inferior_uinteger (CORE_ADDR symaddr, unsigned int *val) -{ - return read_inferior_memory (symaddr, (unsigned char *) val, - sizeof (*val)); -} - -static int -read_inferior_data_pointer (CORE_ADDR symaddr, CORE_ADDR *val) -{ - void *pval = (void *) (uintptr_t) val; - int ret; - - ret = read_inferior_memory (symaddr, (unsigned char *) &pval, sizeof (pval)); - *val = (uintptr_t) pval; - return ret; -} - -static int -write_inferior_data_pointer (CORE_ADDR symaddr, CORE_ADDR val) -{ - void *pval = (void *) (uintptr_t) val; - return write_inferior_memory (symaddr, - (unsigned char *) &pval, sizeof (pval)); -} - -static int -write_inferior_integer (CORE_ADDR symaddr, int val) -{ - return write_inferior_memory (symaddr, (unsigned char *) &val, sizeof (val)); -} - -static int -write_inferior_uinteger (CORE_ADDR symaddr, unsigned int val) -{ - return write_inferior_memory (symaddr, (unsigned char *) &val, sizeof (val)); -} - -#endif - -/* This enum must exactly match what is documented in - gdb/doc/agentexpr.texi, including all the numerical values. */ - -enum gdb_agent_op - { -#define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE) \ - gdb_agent_op_ ## NAME = VALUE, -#include "ax.def" -#undef DEFOP - gdb_agent_op_last - }; - -static const char *gdb_agent_op_names [gdb_agent_op_last] = - { - "?undef?" -#define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE) , # NAME -#include "ax.def" -#undef DEFOP - }; - -static const unsigned char gdb_agent_op_sizes [gdb_agent_op_last] = - { - 0 -#define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE) , SIZE -#include "ax.def" -#undef DEFOP - }; - -struct agent_expr -{ - int length; - - unsigned char *bytes; -}; - -/* Base action. Concrete actions inherit this. */ - -struct tracepoint_action -{ - char type; -}; - -/* An 'M' (collect memory) action. */ -struct collect_memory_action -{ - struct tracepoint_action base; - - ULONGEST addr; - ULONGEST len; - int basereg; -}; - -/* An 'R' (collect registers) action. */ - -struct collect_registers_action -{ - struct tracepoint_action base; -}; - -/* An 'X' (evaluate expression) action. */ - -struct eval_expr_action -{ - struct tracepoint_action base; - - struct agent_expr *expr; -}; - -/* An 'L' (collect static trace data) action. */ -struct collect_static_trace_data_action -{ - struct tracepoint_action base; -}; - -/* This structure describes a piece of the source-level definition of - the tracepoint. The contents are not interpreted by the target, - but preserved verbatim for uploading upon reconnection. */ - -struct source_string -{ - /* The type of string, such as "cond" for a conditional. */ - char *type; - - /* The source-level string itself. For the sake of target - debugging, we store it in plaintext, even though it is always - transmitted in hex. */ - char *str; - - /* Link to the next one in the list. We link them in the order - received, in case some make up an ordered list of commands or - some such. */ - struct source_string *next; -}; - -enum tracepoint_type -{ - /* Trap based tracepoint. */ - trap_tracepoint, - - /* A fast tracepoint implemented with a jump instead of a trap. */ - fast_tracepoint, - - /* A static tracepoint, implemented by a program call into a tracing - library. */ - static_tracepoint -}; - -struct tracepoint_hit_ctx; - -typedef enum eval_result_type (*condfn) (struct tracepoint_hit_ctx *, - ULONGEST *); - -/* The definition of a tracepoint. */ - -/* Tracepoints may have multiple locations, each at a different - address. This can occur with optimizations, template - instantiation, etc. Since the locations may be in different - scopes, the conditions and actions may be different for each - location. Our target version of tracepoints is more like GDB's - notion of "breakpoint locations", but we have almost nothing that - is not per-location, so we bother having two kinds of objects. The - key consequence is that numbers are not unique, and that it takes - both number and address to identify a tracepoint uniquely. */ - -struct tracepoint -{ - /* The number of the tracepoint, as specified by GDB. Several - tracepoint objects here may share a number. */ - int number; - - /* Address at which the tracepoint is supposed to trigger. Several - tracepoints may share an address. */ - CORE_ADDR address; - - /* Tracepoint type. */ - enum tracepoint_type type; - - /* True if the tracepoint is currently enabled. */ - int enabled; - - /* The number of single steps that will be performed after each - tracepoint hit. */ - long step_count; - - /* The number of times the tracepoint may be hit before it will - terminate the entire tracing run. */ - long pass_count; - - /* Pointer to the agent expression that is the tracepoint's - conditional, or NULL if the tracepoint is unconditional. */ - struct agent_expr *cond; - - /* The list of actions to take when the tracepoint triggers. */ - int numactions; - struct tracepoint_action **actions; - - /* Count of the times we've hit this tracepoint during the run. - Note that while-stepping steps are not counted as "hits". */ - long hit_count; - - CORE_ADDR compiled_cond; - - /* Link to the next tracepoint in the list. */ - struct tracepoint *next; - -#ifndef IN_PROCESS_AGENT - /* The list of actions to take when the tracepoint triggers, in - string/packet form. */ - char **actions_str; - - /* The collection of strings that describe the tracepoint as it was - entered into GDB. These are not used by the target, but are - reported back to GDB upon reconnection. */ - struct source_string *source_strings; - - /* The number of bytes displaced by fast tracepoints. It may subsume - multiple instructions, for multi-byte fast tracepoints. This - field is only valid for fast tracepoints. */ - int orig_size; - - /* Only for fast tracepoints. */ - CORE_ADDR obj_addr_on_target; - - /* Address range where the original instruction under a fast - tracepoint was relocated to. (_end is actually one byte past - the end). */ - CORE_ADDR adjusted_insn_addr; - CORE_ADDR adjusted_insn_addr_end; - - /* The address range of the piece of the jump pad buffer that was - assigned to this fast tracepoint. (_end is actually one byte - past the end).*/ - CORE_ADDR jump_pad; - CORE_ADDR jump_pad_end; - - /* The list of actions to take while in a stepping loop. These - fields are only valid for patch-based tracepoints. */ - int num_step_actions; - struct tracepoint_action **step_actions; - /* Same, but in string/packet form. */ - char **step_actions_str; - - /* Handle returned by the breakpoint or tracepoint module when we - inserted the trap or jump, or hooked into a static tracepoint. - NULL if we haven't inserted it yet. */ - void *handle; -#endif - -}; - -#ifndef IN_PROCESS_AGENT - -/* Given `while-stepping', a thread may be collecting data for more - than one tracepoint simultaneously. On the other hand, the same - tracepoint with a while-stepping action may be hit by more than one - thread simultaneously (but not quite, each thread could be handling - a different step). Each thread holds a list of these objects, - representing the current step of each while-stepping action being - collected. */ - -struct wstep_state -{ - struct wstep_state *next; - - /* The tracepoint number. */ - int tp_number; - /* The tracepoint's address. */ - CORE_ADDR tp_address; - - /* The number of the current step in this 'while-stepping' - action. */ - long current_step; -}; - -#endif - -/* The linked list of all tracepoints. Marked explicitly as used as - the in-process library doesn't use it for the fast tracepoints - support. */ -IP_AGENT_EXPORT struct tracepoint *tracepoints ATTR_USED; - -#ifndef IN_PROCESS_AGENT - -/* Pointer to the last tracepoint in the list, new tracepoints are - linked in at the end. */ - -static struct tracepoint *last_tracepoint; -#endif - -/* The first tracepoint to exceed its pass count. */ - -IP_AGENT_EXPORT struct tracepoint *stopping_tracepoint; - -/* True if the trace buffer is full or otherwise no longer usable. */ - -IP_AGENT_EXPORT int trace_buffer_is_full; - -/* Enumeration of the different kinds of things that can happen during - agent expression evaluation. */ - -enum eval_result_type - { - expr_eval_no_error, - expr_eval_empty_expression, - expr_eval_empty_stack, - expr_eval_stack_overflow, - expr_eval_stack_underflow, - expr_eval_unhandled_opcode, - expr_eval_unrecognized_opcode, - expr_eval_divide_by_zero, - expr_eval_invalid_goto - }; - -static enum eval_result_type expr_eval_result = expr_eval_no_error; - -#ifndef IN_PROCESS_AGENT - -static const char *eval_result_names[] = - { - "terror:in the attic", /* this should never be reported */ - "terror:empty expression", - "terror:empty stack", - "terror:stack overflow", - "terror:stack underflow", - "terror:unhandled opcode", - "terror:unrecognized opcode", - "terror:divide by zero" - }; - -#endif - -/* The tracepoint in which the error occurred. */ - -static struct tracepoint *error_tracepoint; - -struct trace_state_variable -{ - /* This is the name of the variable as used in GDB. The target - doesn't use the name, but needs to have it for saving and - reconnection purposes. */ - char *name; - - /* This number identifies the variable uniquely. Numbers may be - assigned either by the target (in the case of builtin variables), - or by GDB, and are presumed unique during the course of a trace - experiment. */ - int number; - - /* The variable's initial value, a 64-bit signed integer always. */ - LONGEST initial_value; - - /* The variable's value, a 64-bit signed integer always. */ - LONGEST value; - - /* Pointer to a getter function, used to supply computed values. */ - LONGEST (*getter) (void); - - /* Link to the next variable. */ - struct trace_state_variable *next; -}; - -/* Linked list of all trace state variables. */ - -#ifdef IN_PROCESS_AGENT -struct trace_state_variable *alloced_trace_state_variables; -#endif - -IP_AGENT_EXPORT struct trace_state_variable *trace_state_variables; - -/* The results of tracing go into a fixed-size space known as the - "trace buffer". Because usage follows a limited number of - patterns, we manage it ourselves rather than with malloc. Basic - rules are that we create only one trace frame at a time, each is - variable in size, they are never moved once created, and we only - discard if we are doing a circular buffer, and then only the oldest - ones. Each trace frame includes its own size, so we don't need to - link them together, and the trace frame number is relative to the - first one, so we don't need to record numbers. A trace frame also - records the number of the tracepoint that created it. The data - itself is a series of blocks, each introduced by a single character - and with a defined format. Each type of block has enough - type/length info to allow scanners to jump quickly from one block - to the next without reading each byte in the block. */ - -/* Trace buffer management would be simple - advance a free pointer - from beginning to end, then stop - were it not for the circular - buffer option, which is a useful way to prevent a trace run from - stopping prematurely because the buffer filled up. In the circular - case, the location of the first trace frame (trace_buffer_start) - moves as old trace frames are discarded. Also, since we grow trace - frames incrementally as actions are performed, we wrap around to - the beginning of the trace buffer. This is per-block, so each - block within a trace frame remains contiguous. Things get messy - when the wrapped-around trace frame is the one being discarded; the - free space ends up in two parts at opposite ends of the buffer. */ - -#ifndef ATTR_PACKED -# if defined(__GNUC__) -# define ATTR_PACKED __attribute__ ((packed)) -# else -# define ATTR_PACKED /* nothing */ -# endif -#endif - -/* The data collected at a tracepoint hit. This object should be as - small as possible, since there may be a great many of them. We do - not need to keep a frame number, because they are all sequential - and there are no deletions; so the Nth frame in the buffer is - always frame number N. */ - -struct traceframe -{ - /* Number of the tracepoint that collected this traceframe. A value - of 0 indicates the current end of the trace buffer. We make this - a 16-bit field because it's never going to happen that GDB's - numbering of tracepoints reaches 32,000. */ - int tpnum : 16; - - /* The size of the data in this trace frame. We limit this to 32 - bits, even on a 64-bit target, because it's just implausible that - one is validly going to collect 4 gigabytes of data at a single - tracepoint hit. */ - unsigned int data_size : 32; - - /* The base of the trace data, which is contiguous from this point. */ - unsigned char data[0]; - -} ATTR_PACKED; - -/* The traceframe to be used as the source of data to send back to - GDB. A value of -1 means to get data from the live program. */ - -int current_traceframe = -1; - -/* This flag is true if the trace buffer is circular, meaning that - when it fills, the oldest trace frames are discarded in order to - make room. */ - -#ifndef IN_PROCESS_AGENT -static int circular_trace_buffer; -#endif - -/* Pointer to the block of memory that traceframes all go into. */ - -static unsigned char *trace_buffer_lo; - -/* Pointer to the end of the trace buffer, more precisely to the byte - after the end of the buffer. */ - -static unsigned char *trace_buffer_hi; - -/* Control structure holding the read/write/etc. pointers into the - trace buffer. We need more than one of these to implement a - transaction-like mechanism to garantees that both GDBserver and the - in-process agent can try to change the trace buffer - simultaneously. */ - -struct trace_buffer_control -{ - /* Pointer to the first trace frame in the buffer. In the - non-circular case, this is equal to trace_buffer_lo, otherwise it - moves around in the buffer. */ - unsigned char *start; - - /* Pointer to the free part of the trace buffer. Note that we clear - several bytes at and after this pointer, so that traceframe - scans/searches terminate properly. */ - unsigned char *free; - - /* Pointer to the byte after the end of the free part. Note that - this may be smaller than trace_buffer_free in the circular case, - and means that the free part is in two pieces. Initially it is - equal to trace_buffer_hi, then is generally equivalent to - trace_buffer_start. */ - unsigned char *end_free; - - /* Pointer to the wraparound. If not equal to trace_buffer_hi, then - this is the point at which the trace data breaks, and resumes at - trace_buffer_lo. */ - unsigned char *wrap; -}; - -/* Same as above, to be used by GDBserver when updating the in-process - agent. */ -struct ipa_trace_buffer_control -{ - uintptr_t start; - uintptr_t free; - uintptr_t end_free; - uintptr_t wrap; -}; - - -/* We have possibly both GDBserver and an inferior thread accessing - the same IPA trace buffer memory. The IPA is the producer (tries - to put new frames in the buffer), while GDBserver occasionally - consumes them, that is, flushes the IPA's buffer into its own - buffer. Both sides need to update the trace buffer control - pointers (current head, tail, etc.). We can't use a global lock to - synchronize the accesses, as otherwise we could deadlock GDBserver - (if the thread holding the lock stops for a signal, say). So - instead of that, we use a transaction scheme where GDBserver writes - always prevail over the IPAs writes, and, we have the IPA detect - the commit failure/overwrite, and retry the whole attempt. This is - mainly implemented by having a global token object that represents - who wrote last to the buffer control structure. We need to freeze - any inferior writing to the buffer while GDBserver touches memory, - so that the inferior can correctly detect that GDBserver had been - there, otherwise, it could mistakingly think its commit was - successful; that's implemented by simply having GDBserver set a - breakpoint the inferior hits if it is the critical region. - - There are three cycling trace buffer control structure copies - (buffer head, tail, etc.), with the token object including an index - indicating which is current live copy. The IPA tentatively builds - an updated copy in a non-current control structure, while GDBserver - always clobbers the current version directly. The IPA then tries - to atomically "commit" its version; if GDBserver clobbered the - structure meanwhile, that will fail, and the IPA restarts the - allocation process. - - Listing the step in further detail, we have: - - In-process agent (producer): - - - passes by `about_to_request_buffer_space' breakpoint/lock - - - reads current token, extracts current trace buffer control index, - and starts tentatively updating the rightmost one (0->1, 1->2, - 2->0). Note that only one inferior thread is executing this code - at any given time, due to an outer lock in the jump pads. - - - updates counters, and tries to commit the token. - - - passes by second `about_to_request_buffer_space' breakpoint/lock, - leaving the sync region. - - - checks if the update was effective. - - - if trace buffer was found full, hits flush_trace_buffer - breakpoint, and restarts later afterwards. - - GDBserver (consumer): - - - sets `about_to_request_buffer_space' breakpoint/lock. - - - updates the token unconditionally, using the current buffer - control index, since it knows that the IP agent always writes to - the rightmost, and due to the breakpoint, at most one IP thread - can try to update the trace buffer concurrently to GDBserver, so - there will be no danger of trace buffer control index wrap making - the IPA write to the same index as GDBserver. - - - flushes the IP agent's trace buffer completely, and updates the - current trace buffer control structure. GDBserver *always* wins. - - - removes the `about_to_request_buffer_space' breakpoint. - -The token is stored in the `trace_buffer_ctrl_curr' variable. -Internally, it's bits are defined as: - - |-------------+-----+-------------+--------+-------------+--------------| - | Bit offsets | 31 | 30 - 20 | 19 | 18-8 | 7-0 | - |-------------+-----+-------------+--------+-------------+--------------| - | What | GSB | PC (11-bit) | unused | CC (11-bit) | TBCI (8-bit) | - |-------------+-----+-------------+--------+-------------+--------------| - - GSB - GDBserver Stamp Bit - PC - Previous Counter - CC - Current Counter - TBCI - Trace Buffer Control Index - - -An IPA update of `trace_buffer_ctrl_curr' does: - - - read CC from the current token, save as PC. - - updates pointers - - atomically tries to write PC+1,CC - -A GDBserver update of `trace_buffer_ctrl_curr' does: - - - reads PC and CC from the current token. - - updates pointers - - writes GSB,PC,CC -*/ - -/* These are the bits of `trace_buffer_ctrl_curr' that are reserved - for the counters described below. The cleared bits are used to - hold the index of the items of the `trace_buffer_ctrl' array that - is "current". */ -#define GDBSERVER_FLUSH_COUNT_MASK 0xfffffff0 - -/* `trace_buffer_ctrl_curr' contains two counters. The `previous' - counter, and the `current' counter. */ - -#define GDBSERVER_FLUSH_COUNT_MASK_PREV 0x7ff00000 -#define GDBSERVER_FLUSH_COUNT_MASK_CURR 0x0007ff00 - -/* When GDBserver update the IP agent's `trace_buffer_ctrl_curr', it - always stamps this bit as set. */ -#define GDBSERVER_UPDATED_FLUSH_COUNT_BIT 0x80000000 - -#ifdef IN_PROCESS_AGENT -IP_AGENT_EXPORT struct trace_buffer_control trace_buffer_ctrl[3]; -IP_AGENT_EXPORT unsigned int trace_buffer_ctrl_curr; - -# define TRACE_BUFFER_CTRL_CURR \ - (trace_buffer_ctrl_curr & ~GDBSERVER_FLUSH_COUNT_MASK) - -#else - -/* The GDBserver side agent only needs one instance of this object, as - it doesn't need to sync with itself. Define it as array anyway so - that the rest of the code base doesn't need to care for the - difference. */ -struct trace_buffer_control trace_buffer_ctrl[1]; -# define TRACE_BUFFER_CTRL_CURR 0 -#endif - -/* These are convenience macros used to access the current trace - buffer control in effect. */ -#define trace_buffer_start (trace_buffer_ctrl[TRACE_BUFFER_CTRL_CURR].start) -#define trace_buffer_free (trace_buffer_ctrl[TRACE_BUFFER_CTRL_CURR].free) -#define trace_buffer_end_free \ - (trace_buffer_ctrl[TRACE_BUFFER_CTRL_CURR].end_free) -#define trace_buffer_wrap (trace_buffer_ctrl[TRACE_BUFFER_CTRL_CURR].wrap) - - -/* Macro that returns a pointer to the first traceframe in the buffer. */ - -#define FIRST_TRACEFRAME() ((struct traceframe *) trace_buffer_start) - -/* Macro that returns a pointer to the next traceframe in the buffer. - If the computed location is beyond the wraparound point, subtract - the offset of the wraparound. */ - -#define NEXT_TRACEFRAME_1(TF) \ - (((unsigned char *) (TF)) + sizeof (struct traceframe) + (TF)->data_size) - -#define NEXT_TRACEFRAME(TF) \ - ((struct traceframe *) (NEXT_TRACEFRAME_1 (TF) \ - - ((NEXT_TRACEFRAME_1 (TF) >= trace_buffer_wrap) \ - ? (trace_buffer_wrap - trace_buffer_lo) \ - : 0))) - -/* The difference between these counters represents the total number - of complete traceframes present in the trace buffer. The IP agent - writes to the write count, GDBserver writes to read count. */ - -IP_AGENT_EXPORT unsigned int traceframe_write_count; -IP_AGENT_EXPORT unsigned int traceframe_read_count; - -/* Convenience macro. */ - -#define traceframe_count \ - ((unsigned int) (traceframe_write_count - traceframe_read_count)) - -/* The count of all traceframes created in the current run, including - ones that were discarded to make room. */ - -IP_AGENT_EXPORT int traceframes_created; - -#ifndef IN_PROCESS_AGENT - -/* Read-only regions are address ranges whose contents don't change, - and so can be read from target memory even while looking at a trace - frame. Without these, disassembly for instance will likely fail, - because the program code is not usually collected into a trace - frame. This data structure does not need to be very complicated or - particularly efficient, it's only going to be used occasionally, - and only by some commands. */ - -struct readonly_region -{ - /* The bounds of the region. */ - CORE_ADDR start, end; - - /* Link to the next one. */ - struct readonly_region *next; -}; - -/* Linked list of readonly regions. This list stays in effect from - one tstart to the next. */ - -static struct readonly_region *readonly_regions; - -#endif - -/* The global that controls tracing overall. */ - -IP_AGENT_EXPORT int tracing; - -#ifndef IN_PROCESS_AGENT - -/* Controls whether tracing should continue after GDB disconnects. */ - -int disconnected_tracing; - -/* The reason for the last tracing run to have stopped. We initialize - to a distinct string so that GDB can distinguish between "stopped - after running" and "stopped because never run" cases. */ - -static const char *tracing_stop_reason = "tnotrun"; - -static int tracing_stop_tpnum; - -#endif - -/* Functions local to this file. */ - -/* Base "class" for tracepoint type specific data to be passed down to - collect_data_at_tracepoint. */ -struct tracepoint_hit_ctx -{ - enum tracepoint_type type; -}; - -#ifdef IN_PROCESS_AGENT - -/* Fast/jump tracepoint specific data to be passed down to - collect_data_at_tracepoint. */ -struct fast_tracepoint_ctx -{ - struct tracepoint_hit_ctx base; - - struct regcache regcache; - int regcache_initted; - unsigned char *regspace; - - unsigned char *regs; - struct tracepoint *tpoint; -}; - -/* Static tracepoint specific data to be passed down to - collect_data_at_tracepoint. */ -struct static_tracepoint_ctx -{ - struct tracepoint_hit_ctx base; - - /* The regcache corresponding to the registers state at the time of - the tracepoint hit. Initialized lazily, from REGS. */ - struct regcache regcache; - int regcache_initted; - - /* The buffer space REGCACHE above uses. We use a separate buffer - instead of letting the regcache malloc for both signal safety and - performance reasons; this is allocated on the stack instead. */ - unsigned char *regspace; - - /* The register buffer as passed on by lttng/ust. */ - struct registers *regs; - - /* The "printf" formatter and the args the user passed to the marker - call. We use this to be able to collect "static trace data" - ($_sdata). */ - const char *fmt; - va_list *args; - - /* The GDB tracepoint matching the probed marker that was "hit". */ - struct tracepoint *tpoint; -}; - -#else - -/* Static tracepoint specific data to be passed down to - collect_data_at_tracepoint. */ -struct trap_tracepoint_ctx -{ - struct tracepoint_hit_ctx base; - - struct regcache *regcache; -}; - -#endif - -#ifndef IN_PROCESS_AGENT -static struct agent_expr *parse_agent_expr (char **actparm); -static char *unparse_agent_expr (struct agent_expr *aexpr); -#endif -static enum eval_result_type eval_agent_expr (struct tracepoint_hit_ctx *ctx, - struct traceframe *tframe, - struct agent_expr *aexpr, - ULONGEST *rslt); - -static int agent_mem_read (struct traceframe *tframe, - unsigned char *to, CORE_ADDR from, ULONGEST len); -static int agent_tsv_read (struct traceframe *tframe, int n); - -#ifndef IN_PROCESS_AGENT -static CORE_ADDR traceframe_get_pc (struct traceframe *tframe); -static int traceframe_read_tsv (int num, LONGEST *val); -#endif - -static int condition_true_at_tracepoint (struct tracepoint_hit_ctx *ctx, - struct tracepoint *tpoint); - -#ifndef IN_PROCESS_AGENT -static void clear_readonly_regions (void); -static void clear_installed_tracepoints (void); -#endif - -static void collect_data_at_tracepoint (struct tracepoint_hit_ctx *ctx, - CORE_ADDR stop_pc, - struct tracepoint *tpoint); -#ifndef IN_PROCESS_AGENT -static void collect_data_at_step (struct tracepoint_hit_ctx *ctx, - CORE_ADDR stop_pc, - struct tracepoint *tpoint, int current_step); -static void compile_tracepoint_condition (struct tracepoint *tpoint, - CORE_ADDR *jump_entry); -#endif -static void do_action_at_tracepoint (struct tracepoint_hit_ctx *ctx, - CORE_ADDR stop_pc, - struct tracepoint *tpoint, - struct traceframe *tframe, - struct tracepoint_action *taction); - -#ifndef IN_PROCESS_AGENT -static struct tracepoint *fast_tracepoint_from_ipa_tpoint_address (CORE_ADDR); -#endif - -#if defined(__GNUC__) -# define memory_barrier() asm volatile ("" : : : "memory") -#else -# define memory_barrier() do {} while (0) -#endif - -/* We only build the IPA if this builtin is supported, and there are - no uses of this in GDBserver itself, so we're safe in defining this - unconditionally. */ -#define cmpxchg(mem, oldval, newval) \ - __sync_val_compare_and_swap (mem, oldval, newval) - -/* The size in bytes of the buffer used to talk to the IPA helper - thread. */ -#define CMD_BUF_SIZE 1024 - -/* Record that an error occurred during expression evaluation. */ - -static void -record_tracepoint_error (struct tracepoint *tpoint, const char *which, - enum eval_result_type rtype) -{ - trace_debug ("Tracepoint %d at %s %s eval reports error %d", - tpoint->number, paddress (tpoint->address), which, rtype); - -#ifdef IN_PROCESS_AGENT - /* Only record the first error we get. */ - if (cmpxchg (&expr_eval_result, - expr_eval_no_error, - rtype) != expr_eval_no_error) - return; -#else - if (expr_eval_result != expr_eval_no_error) - return; -#endif - - error_tracepoint = tpoint; -} - -/* Trace buffer management. */ - -static void -clear_trace_buffer (void) -{ - trace_buffer_start = trace_buffer_lo; - trace_buffer_free = trace_buffer_lo; - trace_buffer_end_free = trace_buffer_hi; - trace_buffer_wrap = trace_buffer_hi; - /* A traceframe with zeroed fields marks the end of trace data. */ - ((struct traceframe *) trace_buffer_free)->tpnum = 0; - ((struct traceframe *) trace_buffer_free)->data_size = 0; - traceframe_read_count = traceframe_write_count = 0; - traceframes_created = 0; -} - -#ifndef IN_PROCESS_AGENT - -static void -clear_inferior_trace_buffer (void) -{ - CORE_ADDR ipa_trace_buffer_lo; - CORE_ADDR ipa_trace_buffer_hi; - struct traceframe ipa_traceframe = { 0 }; - struct ipa_trace_buffer_control ipa_trace_buffer_ctrl; - - read_inferior_data_pointer (ipa_sym_addrs.addr_trace_buffer_lo, - &ipa_trace_buffer_lo); - read_inferior_data_pointer (ipa_sym_addrs.addr_trace_buffer_hi, - &ipa_trace_buffer_hi); - - ipa_trace_buffer_ctrl.start = ipa_trace_buffer_lo; - ipa_trace_buffer_ctrl.free = ipa_trace_buffer_lo; - ipa_trace_buffer_ctrl.end_free = ipa_trace_buffer_hi; - ipa_trace_buffer_ctrl.wrap = ipa_trace_buffer_hi; - - /* A traceframe with zeroed fields marks the end of trace data. */ - write_inferior_memory (ipa_sym_addrs.addr_trace_buffer_ctrl, - (unsigned char *) &ipa_trace_buffer_ctrl, - sizeof (ipa_trace_buffer_ctrl)); - - write_inferior_uinteger (ipa_sym_addrs.addr_trace_buffer_ctrl_curr, 0); - - /* A traceframe with zeroed fields marks the end of trace data. */ - write_inferior_memory (ipa_trace_buffer_lo, - (unsigned char *) &ipa_traceframe, - sizeof (ipa_traceframe)); - - write_inferior_uinteger (ipa_sym_addrs.addr_traceframe_write_count, 0); - write_inferior_uinteger (ipa_sym_addrs.addr_traceframe_read_count, 0); - write_inferior_integer (ipa_sym_addrs.addr_traceframes_created, 0); -} - -#endif - -static void -init_trace_buffer (unsigned char *buf, int bufsize) -{ - trace_buffer_lo = buf; - trace_buffer_hi = trace_buffer_lo + bufsize; - - clear_trace_buffer (); -} - -#ifdef IN_PROCESS_AGENT - -IP_AGENT_EXPORT void ATTR_USED ATTR_NOINLINE -about_to_request_buffer_space (void) -{ - /* GDBserver places breakpoint here while it goes about to flush - data at random times. */ - UNKNOWN_SIDE_EFFECTS(); -} - -#endif - -/* Carve out a piece of the trace buffer, returning NULL in case of - failure. */ - -static void * -trace_buffer_alloc (size_t amt) -{ - unsigned char *rslt; - struct trace_buffer_control *tbctrl; - unsigned int curr; -#ifdef IN_PROCESS_AGENT - unsigned int prev, prev_filtered; - unsigned int commit_count; - unsigned int commit; - unsigned int readout; -#else - struct traceframe *oldest; - unsigned char *new_start; -#endif - - trace_debug ("Want to allocate %ld+%ld bytes in trace buffer", - (long) amt, (long) sizeof (struct traceframe)); - - /* Account for the EOB marker. */ - amt += sizeof (struct traceframe); - -#ifdef IN_PROCESS_AGENT - again: - memory_barrier (); - - /* Read the current token and extract the index to try to write to, - storing it in CURR. */ - prev = trace_buffer_ctrl_curr; - prev_filtered = prev & ~GDBSERVER_FLUSH_COUNT_MASK; - curr = prev_filtered + 1; - if (curr > 2) - curr = 0; - - about_to_request_buffer_space (); - - /* Start out with a copy of the current state. GDBserver may be - midway writing to the PREV_FILTERED TBC, but, that's OK, we won't - be able to commit anyway if that happens. */ - trace_buffer_ctrl[curr] - = trace_buffer_ctrl[prev_filtered]; - trace_debug ("trying curr=%u", curr); -#else - /* The GDBserver's agent doesn't need all that syncing, and always - updates TCB 0 (there's only one, mind you). */ - curr = 0; -#endif - tbctrl = &trace_buffer_ctrl[curr]; - - /* Offsets are easier to grok for debugging than raw addresses, - especially for the small trace buffer sizes that are useful for - testing. */ - trace_debug ("Trace buffer [%d] start=%d free=%d endfree=%d wrap=%d hi=%d", - curr, - (int) (tbctrl->start - trace_buffer_lo), - (int) (tbctrl->free - trace_buffer_lo), - (int) (tbctrl->end_free - trace_buffer_lo), - (int) (tbctrl->wrap - trace_buffer_lo), - (int) (trace_buffer_hi - trace_buffer_lo)); - - /* The algorithm here is to keep trying to get a contiguous block of - the requested size, possibly discarding older traceframes to free - up space. Since free space might come in one or two pieces, - depending on whether discarded traceframes wrapped around at the - high end of the buffer, we test both pieces after each - discard. */ - while (1) - { - /* First, if we have two free parts, try the upper one first. */ - if (tbctrl->end_free < tbctrl->free) - { - if (tbctrl->free + amt <= trace_buffer_hi) - /* We have enough in the upper part. */ - break; - else - { - /* Our high part of free space wasn't enough. Give up - on it for now, set wraparound. We will recover the - space later, if/when the wrapped-around traceframe is - discarded. */ - trace_debug ("Upper part too small, setting wraparound"); - tbctrl->wrap = tbctrl->free; - tbctrl->free = trace_buffer_lo; - } - } - - /* The normal case. */ - if (tbctrl->free + amt <= tbctrl->end_free) - break; - -#ifdef IN_PROCESS_AGENT - /* The IP Agent's buffer is always circular. It isn't used - currently, but `circular_trace_buffer' could represent - GDBserver's mode. If we didn't find space, ask GDBserver to - flush. */ - - flush_trace_buffer (); - memory_barrier (); - if (tracing) - { - trace_debug ("gdbserver flushed buffer, retrying"); - goto again; - } - - /* GDBserver cancelled the tracing. Bail out as well. */ - return NULL; -#else - /* If we're here, then neither part is big enough, and - non-circular trace buffers are now full. */ - if (!circular_trace_buffer) - { - trace_debug ("Not enough space in the trace buffer"); - return NULL; - } - - trace_debug ("Need more space in the trace buffer"); - - /* If we have a circular buffer, we can try discarding the - oldest traceframe and see if that helps. */ - oldest = FIRST_TRACEFRAME (); - if (oldest->tpnum == 0) - { - /* Not good; we have no traceframes to free. Perhaps we're - asking for a block that is larger than the buffer? In - any case, give up. */ - trace_debug ("No traceframes to discard"); - return NULL; - } - - /* We don't run this code in the in-process agent currently. - E.g., we could leave the in-process agent in autonomous - circular mode if we only have fast tracepoints. If we do - that, then this bit becomes racy with GDBserver, which also - writes to this counter. */ - --traceframe_write_count; - - new_start = (unsigned char *) NEXT_TRACEFRAME (oldest); - /* If we freed the traceframe that wrapped around, go back - to the non-wrap case. */ - if (new_start < tbctrl->start) - { - trace_debug ("Discarding past the wraparound"); - tbctrl->wrap = trace_buffer_hi; - } - tbctrl->start = new_start; - tbctrl->end_free = tbctrl->start; - - trace_debug ("Discarded a traceframe\n" - "Trace buffer [%d], start=%d free=%d " - "endfree=%d wrap=%d hi=%d", - curr, - (int) (tbctrl->start - trace_buffer_lo), - (int) (tbctrl->free - trace_buffer_lo), - (int) (tbctrl->end_free - trace_buffer_lo), - (int) (tbctrl->wrap - trace_buffer_lo), - (int) (trace_buffer_hi - trace_buffer_lo)); - - /* Now go back around the loop. The discard might have resulted - in either one or two pieces of free space, so we want to try - both before freeing any more traceframes. */ -#endif - } - - /* If we get here, we know we can provide the asked-for space. */ - - rslt = tbctrl->free; - - /* Adjust the request back down, now that we know we have space for - the marker, but don't commit to AMT yet, we may still need to - restart the operation if GDBserver touches the trace buffer - (obviously only important in the in-process agent's version). */ - tbctrl->free += (amt - sizeof (struct traceframe)); - - /* Or not. If GDBserver changed the trace buffer behind our back, - we get to restart a new allocation attempt. */ - -#ifdef IN_PROCESS_AGENT - /* Build the tentative token. */ - commit_count = (((prev & 0x0007ff00) + 0x100) & 0x0007ff00); - commit = (((prev & 0x0007ff00) << 12) - | commit_count - | curr); - - /* Try to commit it. */ - readout = cmpxchg (&trace_buffer_ctrl_curr, prev, commit); - if (readout != prev) - { - trace_debug ("GDBserver has touched the trace buffer, restarting." - " (prev=%08x, commit=%08x, readout=%08x)", - prev, commit, readout); - goto again; - } - - /* Hold your horses here. Even if that change was committed, - GDBserver could come in, and clobber it. We need to hold to be - able to tell if GDBserver clobbers before or after we committed - the change. Whenever GDBserver goes about touching the IPA - buffer, it sets a breakpoint in this routine, so we have a sync - point here. */ - about_to_request_buffer_space (); - - /* Check if the change has been effective, even if GDBserver stopped - us at the breakpoint. */ - - { - unsigned int refetch; - - memory_barrier (); - - refetch = trace_buffer_ctrl_curr; - - if ((refetch == commit - || ((refetch & 0x7ff00000) >> 12) == commit_count)) - { - /* effective */ - trace_debug ("change is effective: (prev=%08x, commit=%08x, " - "readout=%08x, refetch=%08x)", - prev, commit, readout, refetch); - } - else - { - trace_debug ("GDBserver has touched the trace buffer, not effective." - " (prev=%08x, commit=%08x, readout=%08x, refetch=%08x)", - prev, commit, readout, refetch); - goto again; - } - } -#endif - - /* We have a new piece of the trace buffer. Hurray! */ - - /* Add an EOB marker just past this allocation. */ - ((struct traceframe *) tbctrl->free)->tpnum = 0; - ((struct traceframe *) tbctrl->free)->data_size = 0; - - /* Adjust the request back down, now that we know we have space for - the marker. */ - amt -= sizeof (struct traceframe); - - if (debug_threads) - { - trace_debug ("Allocated %d bytes", (int) amt); - trace_debug ("Trace buffer [%d] start=%d free=%d " - "endfree=%d wrap=%d hi=%d", - curr, - (int) (tbctrl->start - trace_buffer_lo), - (int) (tbctrl->free - trace_buffer_lo), - (int) (tbctrl->end_free - trace_buffer_lo), - (int) (tbctrl->wrap - trace_buffer_lo), - (int) (trace_buffer_hi - trace_buffer_lo)); - } - - return rslt; -} - -#ifndef IN_PROCESS_AGENT - -/* Return the total free space. This is not necessarily the largest - block we can allocate, because of the two-part case. */ - -static int -free_space (void) -{ - if (trace_buffer_free <= trace_buffer_end_free) - return trace_buffer_end_free - trace_buffer_free; - else - return ((trace_buffer_end_free - trace_buffer_lo) - + (trace_buffer_hi - trace_buffer_free)); -} - -/* An 'S' in continuation packets indicates remainder are for - while-stepping. */ - -static int seen_step_action_flag; - -/* Create a tracepoint (location) with given number and address. */ - -static struct tracepoint * -add_tracepoint (int num, CORE_ADDR addr) -{ - struct tracepoint *tpoint; - - tpoint = xmalloc (sizeof (struct tracepoint)); - tpoint->number = num; - tpoint->address = addr; - tpoint->numactions = 0; - tpoint->actions = NULL; - tpoint->actions_str = NULL; - tpoint->cond = NULL; - tpoint->num_step_actions = 0; - tpoint->step_actions = NULL; - tpoint->step_actions_str = NULL; - /* Start all off as regular (slow) tracepoints. */ - tpoint->type = trap_tracepoint; - tpoint->orig_size = -1; - tpoint->source_strings = NULL; - tpoint->compiled_cond = 0; - tpoint->handle = NULL; - tpoint->next = NULL; - - if (!last_tracepoint) - tracepoints = tpoint; - else - last_tracepoint->next = tpoint; - last_tracepoint = tpoint; - - seen_step_action_flag = 0; - - return tpoint; -} - -#ifndef IN_PROCESS_AGENT - -/* Return the tracepoint with the given number and address, or NULL. */ - -static struct tracepoint * -find_tracepoint (int id, CORE_ADDR addr) -{ - struct tracepoint *tpoint; - - for (tpoint = tracepoints; tpoint; tpoint = tpoint->next) - if (tpoint->number == id && tpoint->address == addr) - return tpoint; - - return NULL; -} - -/* There may be several tracepoints with the same number (because they - are "locations", in GDB parlance); return the next one after the - given tracepoint, or search from the beginning of the list if the - first argument is NULL. */ - -static struct tracepoint * -find_next_tracepoint_by_number (struct tracepoint *prev_tp, int num) -{ - struct tracepoint *tpoint; - - if (prev_tp) - tpoint = prev_tp->next; - else - tpoint = tracepoints; - for (; tpoint; tpoint = tpoint->next) - if (tpoint->number == num) - return tpoint; - - return NULL; -} - -#endif - -static char * -save_string (const char *str, size_t len) -{ - char *s; - - s = xmalloc (len + 1); - memcpy (s, str, len); - s[len] = '\0'; - - return s; -} - -/* Append another action to perform when the tracepoint triggers. */ - -static void -add_tracepoint_action (struct tracepoint *tpoint, char *packet) -{ - char *act; - - if (*packet == 'S') - { - seen_step_action_flag = 1; - ++packet; - } - - act = packet; - - while (*act) - { - char *act_start = act; - struct tracepoint_action *action = NULL; - - switch (*act) - { - case 'M': - { - struct collect_memory_action *maction; - ULONGEST basereg; - int is_neg; - - maction = xmalloc (sizeof *maction); - maction->base.type = *act; - action = &maction->base; - - ++act; - is_neg = (*act == '-'); - if (*act == '-') - ++act; - act = unpack_varlen_hex (act, &basereg); - ++act; - act = unpack_varlen_hex (act, &maction->addr); - ++act; - act = unpack_varlen_hex (act, &maction->len); - maction->basereg = (is_neg - ? - (int) basereg - : (int) basereg); - trace_debug ("Want to collect %s bytes at 0x%s (basereg %d)", - pulongest (maction->len), - paddress (maction->addr), maction->basereg); - break; - } - case 'R': - { - struct collect_registers_action *raction; - - raction = xmalloc (sizeof *raction); - raction->base.type = *act; - action = &raction->base; - - trace_debug ("Want to collect registers"); - ++act; - /* skip past hex digits of mask for now */ - while (isxdigit(*act)) - ++act; - break; - } - case 'L': - { - struct collect_static_trace_data_action *raction; - - raction = xmalloc (sizeof *raction); - raction->base.type = *act; - action = &raction->base; - - trace_debug ("Want to collect static trace data"); - ++act; - break; - } - case 'S': - trace_debug ("Unexpected step action, ignoring"); - ++act; - break; - case 'X': - { - struct eval_expr_action *xaction; - - xaction = xmalloc (sizeof (*xaction)); - xaction->base.type = *act; - action = &xaction->base; - - trace_debug ("Want to evaluate expression"); - xaction->expr = parse_agent_expr (&act); - break; - } - default: - trace_debug ("unknown trace action '%c', ignoring...", *act); - break; - case '-': - break; - } - - if (action == NULL) - break; - - if (seen_step_action_flag) - { - tpoint->num_step_actions++; - - tpoint->step_actions - = xrealloc (tpoint->step_actions, - (sizeof (*tpoint->step_actions) - * tpoint->num_step_actions)); - tpoint->step_actions_str - = xrealloc (tpoint->step_actions_str, - (sizeof (*tpoint->step_actions_str) - * tpoint->num_step_actions)); - tpoint->step_actions[tpoint->num_step_actions - 1] = action; - tpoint->step_actions_str[tpoint->num_step_actions - 1] - = save_string (act_start, act - act_start); - } - else - { - tpoint->numactions++; - tpoint->actions - = xrealloc (tpoint->actions, - sizeof (*tpoint->actions) * tpoint->numactions); - tpoint->actions_str - = xrealloc (tpoint->actions_str, - sizeof (*tpoint->actions_str) * tpoint->numactions); - tpoint->actions[tpoint->numactions - 1] = action; - tpoint->actions_str[tpoint->numactions - 1] - = save_string (act_start, act - act_start); - } - } -} - -#endif - -/* Find or create a trace state variable with the given number. */ - -static struct trace_state_variable * -get_trace_state_variable (int num) -{ - struct trace_state_variable *tsv; - -#ifdef IN_PROCESS_AGENT - /* Search for an existing variable. */ - for (tsv = alloced_trace_state_variables; tsv; tsv = tsv->next) - if (tsv->number == num) - return tsv; -#endif - - /* Search for an existing variable. */ - for (tsv = trace_state_variables; tsv; tsv = tsv->next) - if (tsv->number == num) - return tsv; - - return NULL; -} - -/* Find or create a trace state variable with the given number. */ - -static struct trace_state_variable * -create_trace_state_variable (int num, int gdb) -{ - struct trace_state_variable *tsv; - - tsv = get_trace_state_variable (num); - if (tsv != NULL) - return tsv; - - /* Create a new variable. */ - tsv = xmalloc (sizeof (struct trace_state_variable)); - tsv->number = num; - tsv->initial_value = 0; - tsv->value = 0; - tsv->getter = NULL; - tsv->name = NULL; -#ifdef IN_PROCESS_AGENT - if (!gdb) - { - tsv->next = alloced_trace_state_variables; - alloced_trace_state_variables = tsv; - } - else -#endif - { - tsv->next = trace_state_variables; - trace_state_variables = tsv; - } - return tsv; -} - -IP_AGENT_EXPORT LONGEST -get_trace_state_variable_value (int num) -{ - struct trace_state_variable *tsv; - - tsv = get_trace_state_variable (num); - - if (!tsv) - { - trace_debug ("No trace state variable %d, skipping value get", num); - return 0; - } - - /* Call a getter function if we have one. While it's tempting to - set up something to only call the getter once per tracepoint hit, - it could run afoul of thread races. Better to let the getter - handle it directly, if necessary to worry about it. */ - if (tsv->getter) - tsv->value = (tsv->getter) (); - - trace_debug ("get_trace_state_variable_value(%d) ==> %s", - num, plongest (tsv->value)); - - return tsv->value; -} - -IP_AGENT_EXPORT void -set_trace_state_variable_value (int num, LONGEST val) -{ - struct trace_state_variable *tsv; - - tsv = get_trace_state_variable (num); - - if (!tsv) - { - trace_debug ("No trace state variable %d, skipping value set", num); - return; - } - - tsv->value = val; -} - -static void -set_trace_state_variable_name (int num, const char *name) -{ - struct trace_state_variable *tsv; - - tsv = get_trace_state_variable (num); - - if (!tsv) - { - trace_debug ("No trace state variable %d, skipping name set", num); - return; - } - - tsv->name = (char *) name; -} - -static void -set_trace_state_variable_getter (int num, LONGEST (*getter) (void)) -{ - struct trace_state_variable *tsv; - - tsv = get_trace_state_variable (num); - - if (!tsv) - { - trace_debug ("No trace state variable %d, skipping getter set", num); - return; - } - - tsv->getter = getter; -} - -/* Add a raw traceframe for the given tracepoint. */ - -static struct traceframe * -add_traceframe (struct tracepoint *tpoint) -{ - struct traceframe *tframe; - - tframe = trace_buffer_alloc (sizeof (struct traceframe)); - - if (tframe == NULL) - return NULL; - - tframe->tpnum = tpoint->number; - tframe->data_size = 0; - - return tframe; -} - -/* Add a block to the traceframe currently being worked on. */ - -static unsigned char * -add_traceframe_block (struct traceframe *tframe, int amt) -{ - unsigned char *block; - - if (!tframe) - return NULL; - - block = trace_buffer_alloc (amt); - - if (!block) - return NULL; - - tframe->data_size += amt; - - return block; -} - -/* Flag that the current traceframe is finished. */ - -static void -finish_traceframe (struct traceframe *tframe) -{ - ++traceframe_write_count; - ++traceframes_created; -} - -#ifndef IN_PROCESS_AGENT - -/* Given a traceframe number NUM, find the NUMth traceframe in the - buffer. */ - -static struct traceframe * -find_traceframe (int num) -{ - struct traceframe *tframe; - int tfnum = 0; - - for (tframe = FIRST_TRACEFRAME (); - tframe->tpnum != 0; - tframe = NEXT_TRACEFRAME (tframe)) - { - if (tfnum == num) - return tframe; - ++tfnum; - } - - return NULL; -} - -static CORE_ADDR -get_traceframe_address (struct traceframe *tframe) -{ - CORE_ADDR addr; - struct tracepoint *tpoint; - - addr = traceframe_get_pc (tframe); - - if (addr) - return addr; - - /* Fallback strategy, will be incorrect for while-stepping frames - and multi-location tracepoints. */ - tpoint = find_next_tracepoint_by_number (NULL, tframe->tpnum); - return tpoint->address; -} - -/* Search for the next traceframe whose address is inside or outside - the given range. */ - -static struct traceframe * -find_next_traceframe_in_range (CORE_ADDR lo, CORE_ADDR hi, int inside_p, - int *tfnump) -{ - struct traceframe *tframe; - CORE_ADDR tfaddr; - - *tfnump = current_traceframe + 1; - tframe = find_traceframe (*tfnump); - /* The search is not supposed to wrap around. */ - if (!tframe) - { - *tfnump = -1; - return NULL; - } - - for (; tframe->tpnum != 0; tframe = NEXT_TRACEFRAME (tframe)) - { - tfaddr = get_traceframe_address (tframe); - if (inside_p - ? (lo <= tfaddr && tfaddr <= hi) - : (lo > tfaddr || tfaddr > hi)) - return tframe; - ++*tfnump; - } - - *tfnump = -1; - return NULL; -} - -/* Search for the next traceframe recorded by the given tracepoint. - Note that for multi-location tracepoints, this will find whatever - location appears first. */ - -static struct traceframe * -find_next_traceframe_by_tracepoint (int num, int *tfnump) -{ - struct traceframe *tframe; - - *tfnump = current_traceframe + 1; - tframe = find_traceframe (*tfnump); - /* The search is not supposed to wrap around. */ - if (!tframe) - { - *tfnump = -1; - return NULL; - } - - for (; tframe->tpnum != 0; tframe = NEXT_TRACEFRAME (tframe)) - { - if (tframe->tpnum == num) - return tframe; - ++*tfnump; - } - - *tfnump = -1; - return NULL; -} - -#endif - -#ifndef IN_PROCESS_AGENT - -/* Clear all past trace state. */ - -static void -cmd_qtinit (char *packet) -{ - struct trace_state_variable *tsv, *prev, *next; - - /* Make sure we don't try to read from a trace frame. */ - current_traceframe = -1; - - trace_debug ("Initializing the trace"); - - clear_installed_tracepoints (); - clear_readonly_regions (); - - tracepoints = NULL; - last_tracepoint = NULL; - - /* Clear out any leftover trace state variables. Ones with target - defined getters should be kept however. */ - prev = NULL; - tsv = trace_state_variables; - while (tsv) - { - trace_debug ("Looking at var %d", tsv->number); - if (tsv->getter == NULL) - { - next = tsv->next; - if (prev) - prev->next = next; - else - trace_state_variables = next; - trace_debug ("Deleting var %d", tsv->number); - free (tsv); - tsv = next; - } - else - { - prev = tsv; - tsv = tsv->next; - } - } - - clear_trace_buffer (); - clear_inferior_trace_buffer (); - - write_ok (packet); -} - -/* Unprobe the UST marker at ADDRESS. */ - -static void -unprobe_marker_at (CORE_ADDR address) -{ - char cmd[CMD_BUF_SIZE]; - - sprintf (cmd, "unprobe_marker_at:%s", paddress (address)); - run_inferior_command (cmd); -} - -/* Restore the program to its pre-tracing state. This routine may be called - in error situations, so it needs to be careful about only restoring - from known-valid bits. */ - -static void -clear_installed_tracepoints (void) -{ - struct tracepoint *tpoint; - struct tracepoint *prev_stpoint; - - pause_all (1); - cancel_breakpoints (); - - prev_stpoint = NULL; - - /* Restore any bytes overwritten by tracepoints. */ - for (tpoint = tracepoints; tpoint; tpoint = tpoint->next) - { - /* Catch the case where we might try to remove a tracepoint that - was never actually installed. */ - if (tpoint->handle == NULL) - { - trace_debug ("Tracepoint %d at 0x%s was " - "never installed, nothing to clear", - tpoint->number, paddress (tpoint->address)); - continue; - } - - switch (tpoint->type) - { - case trap_tracepoint: - delete_breakpoint (tpoint->handle); - break; - case fast_tracepoint: - delete_fast_tracepoint_jump (tpoint->handle); - break; - case static_tracepoint: - if (prev_stpoint != NULL - && prev_stpoint->address == tpoint->address) - /* Nothing to do. We already unprobed a tracepoint set at - this marker address (and there can only be one probe - per marker). */ - ; - else - { - unprobe_marker_at (tpoint->address); - prev_stpoint = tpoint; - } - break; - } - - tpoint->handle = NULL; - } - - unpause_all (1); -} - -/* Parse a packet that defines a tracepoint. */ - -static void -cmd_qtdp (char *own_buf) -{ - int tppacket; - ULONGEST num; - ULONGEST addr; - ULONGEST count; - struct tracepoint *tpoint; - char *actparm; - char *packet = own_buf; - - packet += strlen ("QTDP:"); - - /* A hyphen at the beginning marks a packet specifying actions for a - tracepoint already supplied. */ - tppacket = 1; - if (*packet == '-') - { - tppacket = 0; - ++packet; - } - packet = unpack_varlen_hex (packet, &num); - ++packet; /* skip a colon */ - packet = unpack_varlen_hex (packet, &addr); - ++packet; /* skip a colon */ - - /* See if we already have this tracepoint. */ - tpoint = find_tracepoint (num, addr); - - if (tppacket) - { - /* Duplicate tracepoints are never allowed. */ - if (tpoint) - { - trace_debug ("Tracepoint error: tracepoint %d" - " at 0x%s already exists", - (int) num, paddress (addr)); - write_enn (own_buf); - return; - } - - tpoint = add_tracepoint (num, addr); - - tpoint->enabled = (*packet == 'E'); - ++packet; /* skip 'E' */ - ++packet; /* skip a colon */ - packet = unpack_varlen_hex (packet, &count); - tpoint->step_count = count; - ++packet; /* skip a colon */ - packet = unpack_varlen_hex (packet, &count); - tpoint->pass_count = count; - /* See if we have any of the additional optional fields. */ - while (*packet == ':') - { - ++packet; - if (*packet == 'F') - { - tpoint->type = fast_tracepoint; - ++packet; - packet = unpack_varlen_hex (packet, &count); - tpoint->orig_size = count; - } - else if (*packet == 'S') - { - tpoint->type = static_tracepoint; - ++packet; - } - else if (*packet == 'X') - { - actparm = (char *) packet; - tpoint->cond = parse_agent_expr (&actparm); - packet = actparm; - } - else if (*packet == '-') - break; - else if (*packet == '\0') - break; - else - trace_debug ("Unknown optional tracepoint field"); - } - if (*packet == '-') - trace_debug ("Also has actions\n"); - - trace_debug ("Defined %stracepoint %d at 0x%s, " - "enabled %d step %ld pass %ld", - tpoint->type == fast_tracepoint ? "fast " - : "", - tpoint->number, paddress (tpoint->address), tpoint->enabled, - tpoint->step_count, tpoint->pass_count); - } - else if (tpoint) - add_tracepoint_action (tpoint, packet); - else - { - trace_debug ("Tracepoint error: tracepoint %d at 0x%s not found", - (int) num, paddress (addr)); - write_enn (own_buf); - return; - } - - write_ok (own_buf); -} - -static void -cmd_qtdpsrc (char *own_buf) -{ - ULONGEST num, addr, start, slen; - struct tracepoint *tpoint; - char *packet = own_buf; - char *saved, *srctype, *src; - size_t nbytes; - struct source_string *last, *newlast; - - packet += strlen ("QTDPsrc:"); - - packet = unpack_varlen_hex (packet, &num); - ++packet; /* skip a colon */ - packet = unpack_varlen_hex (packet, &addr); - ++packet; /* skip a colon */ - - /* See if we already have this tracepoint. */ - tpoint = find_tracepoint (num, addr); - - if (!tpoint) - { - trace_debug ("Tracepoint error: tracepoint %d at 0x%s not found", - (int) num, paddress (addr)); - write_enn (own_buf); - return; - } - - saved = packet; - packet = strchr (packet, ':'); - srctype = xmalloc (packet - saved + 1); - memcpy (srctype, saved, packet - saved); - srctype[packet - saved] = '\0'; - ++packet; - packet = unpack_varlen_hex (packet, &start); - ++packet; /* skip a colon */ - packet = unpack_varlen_hex (packet, &slen); - ++packet; /* skip a colon */ - src = xmalloc (slen + 1); - nbytes = unhexify (src, packet, strlen (packet) / 2); - src[nbytes] = '\0'; - - newlast = xmalloc (sizeof (struct source_string)); - newlast->type = srctype; - newlast->str = src; - newlast->next = NULL; - /* Always add a source string to the end of the list; - this keeps sequences of actions/commands in the right - order. */ - if (tpoint->source_strings) - { - for (last = tpoint->source_strings; last->next; last = last->next) - ; - last->next = newlast; - } - else - tpoint->source_strings = newlast; - - write_ok (own_buf); -} - -static void -cmd_qtdv (char *own_buf) -{ - ULONGEST num, val, builtin; - char *varname; - size_t nbytes; - struct trace_state_variable *tsv; - char *packet = own_buf; - - packet += strlen ("QTDV:"); - - packet = unpack_varlen_hex (packet, &num); - ++packet; /* skip a colon */ - packet = unpack_varlen_hex (packet, &val); - ++packet; /* skip a colon */ - packet = unpack_varlen_hex (packet, &builtin); - ++packet; /* skip a colon */ - - nbytes = strlen (packet) / 2; - varname = xmalloc (nbytes + 1); - nbytes = unhexify (varname, packet, nbytes); - varname[nbytes] = '\0'; - - tsv = create_trace_state_variable (num, 1); - tsv->initial_value = (LONGEST) val; - tsv->name = varname; - - set_trace_state_variable_value (num, (LONGEST) val); - - write_ok (own_buf); -} - -static void -cmd_qtenable_disable (char *own_buf, int enable) -{ - char *packet = own_buf; - ULONGEST num, addr; - struct tracepoint *tp; - - packet += strlen (enable ? "QTEnable:" : "QTDisable:"); - packet = unpack_varlen_hex (packet, &num); - ++packet; /* skip a colon */ - packet = unpack_varlen_hex (packet, &addr); - - tp = find_tracepoint (num, addr); - - if (tp) - { - if ((enable && tp->enabled) || (!enable && !tp->enabled)) - { - trace_debug ("Tracepoint %d at 0x%s is already %s", - (int) num, paddress (addr), - enable ? "enabled" : "disabled"); - write_ok (own_buf); - return; - } - - trace_debug ("%s tracepoint %d at 0x%s", - enable ? "Enabling" : "Disabling", - (int) num, paddress (addr)); - - tp->enabled = enable; - - if (tp->type == fast_tracepoint || tp->type == static_tracepoint) - { - int ret; - int offset = offsetof (struct tracepoint, enabled); - CORE_ADDR obj_addr = tp->obj_addr_on_target + offset; - - ret = prepare_to_access_memory (); - if (ret) - { - trace_debug ("Failed to temporarily stop inferior threads"); - write_enn (own_buf); - return; - } - - ret = write_inferior_integer (obj_addr, enable); - done_accessing_memory (); - - if (ret) - { - trace_debug ("Cannot write enabled flag into " - "inferior process memory"); - write_enn (own_buf); - return; - } - } - - write_ok (own_buf); - } - else - { - trace_debug ("Tracepoint %d at 0x%s not found", - (int) num, paddress (addr)); - write_enn (own_buf); - } -} - -static void -cmd_qtv (char *own_buf) -{ - ULONGEST num; - LONGEST val; - int err; - char *packet = own_buf; - - packet += strlen ("qTV:"); - unpack_varlen_hex (packet, &num); - - if (current_traceframe >= 0) - { - err = traceframe_read_tsv ((int) num, &val); - if (err) - { - strcpy (own_buf, "U"); - return; - } - } - /* Only make tsv's be undefined before the first trace run. After a - trace run is over, the user might want to see the last value of - the tsv, and it might not be available in a traceframe. */ - else if (!tracing && strcmp (tracing_stop_reason, "tnotrun") == 0) - { - strcpy (own_buf, "U"); - return; - } - else - val = get_trace_state_variable_value (num); - - sprintf (own_buf, "V%s", phex_nz (val, 0)); -} - -/* Clear out the list of readonly regions. */ - -static void -clear_readonly_regions (void) -{ - struct readonly_region *roreg; - - while (readonly_regions) - { - roreg = readonly_regions; - readonly_regions = readonly_regions->next; - free (roreg); - } -} - -/* Parse the collection of address ranges whose contents GDB believes - to be unchanging and so can be read directly from target memory - even while looking at a traceframe. */ - -static void -cmd_qtro (char *own_buf) -{ - ULONGEST start, end; - struct readonly_region *roreg; - char *packet = own_buf; - - trace_debug ("Want to mark readonly regions"); - - clear_readonly_regions (); - - packet += strlen ("QTro"); - - while (*packet == ':') - { - ++packet; /* skip a colon */ - packet = unpack_varlen_hex (packet, &start); - ++packet; /* skip a comma */ - packet = unpack_varlen_hex (packet, &end); - roreg = xmalloc (sizeof (struct readonly_region)); - roreg->start = start; - roreg->end = end; - roreg->next = readonly_regions; - readonly_regions = roreg; - trace_debug ("Added readonly region from 0x%s to 0x%s", - paddress (roreg->start), paddress (roreg->end)); - } - - write_ok (own_buf); -} - -/* Test to see if the given range is in our list of readonly ranges. - We only test for being entirely within a range, GDB is not going to - send a single memory packet that spans multiple regions. */ - -int -in_readonly_region (CORE_ADDR addr, ULONGEST length) -{ - struct readonly_region *roreg; - - for (roreg = readonly_regions; roreg; roreg = roreg->next) - if (roreg->start <= addr && (addr + length - 1) <= roreg->end) - return 1; - - return 0; -} - -/* The maximum size of a jump pad entry. */ -static const int max_jump_pad_size = 0x100; - -static CORE_ADDR gdb_jump_pad_head; - -/* Return the address of the next free jump space. */ - -static CORE_ADDR -get_jump_space_head (void) -{ - if (gdb_jump_pad_head == 0) - { - if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_jump_pad_buffer, - &gdb_jump_pad_head)) - fatal ("error extracting jump_pad_buffer"); - } - - return gdb_jump_pad_head; -} - -/* Reserve USED bytes from the jump space. */ - -static void -claim_jump_space (ULONGEST used) -{ - trace_debug ("claim_jump_space reserves %s bytes at %s", - pulongest (used), paddress (gdb_jump_pad_head)); - gdb_jump_pad_head += used; -} - -/* Sort tracepoints by PC, using a bubble sort. */ - -static void -sort_tracepoints (void) -{ - struct tracepoint *lst, *tmp, *prev = NULL; - int i, j, n = 0; - - if (tracepoints == NULL) - return; - - /* Count nodes. */ - for (tmp = tracepoints; tmp->next; tmp = tmp->next) - n++; - - for (i = 0; i < n - 1; i++) - for (j = 0, lst = tracepoints; - lst && lst->next && (j <= n - 1 - i); - j++) - { - /* If we're at beginning, the start node is the prev - node. */ - if (j == 0) - prev = lst; - - /* Compare neighbors. */ - if (lst->next->address < lst->address) - { - struct tracepoint *p; - - /* Swap'em. */ - tmp = (lst->next ? lst->next->next : NULL); - - if (j == 0 && prev == tracepoints) - tracepoints = lst->next; - - p = lst->next; - prev->next = lst->next; - lst->next->next = lst; - lst->next = tmp; - prev = p; - } - else - { - lst = lst->next; - /* Keep track of the previous node. We need it if we need - to swap nodes. */ - if (j != 0) - prev = prev->next; - } - } -} - -/* Ask the IPA to probe the marker at ADDRESS. Returns -1 if running - the command fails, or 0 otherwise. If the command ran - successfully, but probing the marker failed, ERROUT will be filled - with the error to reply to GDB, and -1 is also returned. This - allows directly passing IPA errors to GDB. */ - -static int -probe_marker_at (CORE_ADDR address, char *errout) -{ - char cmd[CMD_BUF_SIZE]; - int err; - - sprintf (cmd, "probe_marker_at:%s", paddress (address)); - err = run_inferior_command (cmd); - - if (err == 0) - { - if (*cmd == 'E') - { - strcpy (errout, cmd); - return -1; - } - } - - return err; -} - -#define MAX_JUMP_SIZE 20 - -static void -cmd_qtstart (char *packet) -{ - struct tracepoint *tpoint, *prev_ftpoint, *prev_stpoint; - int slow_tracepoint_count, fast_count; - CORE_ADDR jump_entry; - - /* The jump to the jump pad of the last fast tracepoint - installed. */ - unsigned char fjump[MAX_JUMP_SIZE]; - ULONGEST fjump_size; - - trace_debug ("Starting the trace"); - - slow_tracepoint_count = fast_count = 0; - - /* Sort tracepoints by ascending address. This makes installing - fast tracepoints at the same address easier to handle. */ - sort_tracepoints (); - - /* Pause all threads temporarily while we patch tracepoints. */ - pause_all (0); - - /* Get threads out of jump pads. Safe to do here, since this is a - top level command. And, required to do here, since we're - deleting/rewriting jump pads. */ - - stabilize_threads (); - - /* Freeze threads. */ - pause_all (1); - - /* Sync the fast tracepoints list in the inferior ftlib. */ - if (in_process_agent_loaded ()) - { - download_tracepoints (); - download_trace_state_variables (); - } - - /* No previous fast tpoint yet. */ - prev_ftpoint = NULL; - - /* No previous static tpoint yet. */ - prev_stpoint = NULL; - - *packet = '\0'; - - /* Install tracepoints. */ - for (tpoint = tracepoints; tpoint; tpoint = tpoint->next) - { - /* Ensure all the hit counts start at zero. */ - tpoint->hit_count = 0; - - if (tpoint->type == trap_tracepoint) - { - ++slow_tracepoint_count; - - /* Tracepoints are installed as memory breakpoints. Just go - ahead and install the trap. The breakpoints module - handles duplicated breakpoints, and the memory read - routine handles un-patching traps from memory reads. */ - tpoint->handle = set_breakpoint_at (tpoint->address, - tracepoint_handler); - } - else if (tpoint->type == fast_tracepoint) - { - ++fast_count; - - if (maybe_write_ipa_not_loaded (packet)) - { - trace_debug ("Requested a fast tracepoint, but fast " - "tracepoints aren't supported."); - break; - } - - if (prev_ftpoint != NULL && prev_ftpoint->address == tpoint->address) - { - tpoint->handle = set_fast_tracepoint_jump (tpoint->address, - fjump, - fjump_size); - tpoint->jump_pad = prev_ftpoint->jump_pad; - tpoint->jump_pad_end = prev_ftpoint->jump_pad_end; - tpoint->adjusted_insn_addr = prev_ftpoint->adjusted_insn_addr; - tpoint->adjusted_insn_addr_end - = prev_ftpoint->adjusted_insn_addr_end; - } - else - { - CORE_ADDR jentry; - int err = 0; - - prev_ftpoint = NULL; - - jentry = jump_entry = get_jump_space_head (); - - /* Install the jump pad. */ - err = install_fast_tracepoint_jump_pad - (tpoint->obj_addr_on_target, - tpoint->address, - ipa_sym_addrs.addr_gdb_collect, - ipa_sym_addrs.addr_collecting, - tpoint->orig_size, - &jentry, - fjump, &fjump_size, - &tpoint->adjusted_insn_addr, - &tpoint->adjusted_insn_addr_end); - - /* Wire it in. */ - if (!err) - tpoint->handle = set_fast_tracepoint_jump (tpoint->address, - fjump, fjump_size); - - if (tpoint->handle != NULL) - { - tpoint->jump_pad = jump_entry; - tpoint->jump_pad_end = jentry; - - /* Pad to 8-byte alignment. */ - jentry = ((jentry + 7) & ~0x7); - claim_jump_space (jentry - jump_entry); - - /* So that we can handle multiple fast tracepoints - at the same address easily. */ - prev_ftpoint = tpoint; - } - } - } - else if (tpoint->type == static_tracepoint) - { - if (maybe_write_ipa_ust_not_loaded (packet)) - { - trace_debug ("Requested a static tracepoint, but static " - "tracepoints are not supported."); - break; - } - - /* Can only probe a given marker once. */ - if (prev_stpoint != NULL && prev_stpoint->address == tpoint->address) - { - tpoint->handle = (void *) -1; - } - else - { - if (probe_marker_at (tpoint->address, packet) == 0) - { - tpoint->handle = (void *) -1; - - /* So that we can handle multiple static tracepoints - at the same address easily. */ - prev_stpoint = tpoint; - } - } - } - - /* Any failure in the inner loop is sufficient cause to give - up. */ - if (tpoint->handle == NULL) - break; - } - - /* Any error in tracepoint insertion is unacceptable; better to - address the problem now, than end up with a useless or misleading - trace run. */ - if (tpoint != NULL) - { - clear_installed_tracepoints (); - if (*packet == '\0') - write_enn (packet); - unpause_all (1); - return; - } - - stopping_tracepoint = NULL; - trace_buffer_is_full = 0; - expr_eval_result = expr_eval_no_error; - error_tracepoint = NULL; - - /* Tracing is now active, hits will now start being logged. */ - tracing = 1; - - if (in_process_agent_loaded ()) - { - if (write_inferior_integer (ipa_sym_addrs.addr_tracing, 1)) - fatal ("Error setting tracing variable in lib"); - - if (write_inferior_data_pointer (ipa_sym_addrs.addr_stopping_tracepoint, - 0)) - fatal ("Error clearing stopping_tracepoint variable in lib"); - - if (write_inferior_integer (ipa_sym_addrs.addr_trace_buffer_is_full, 0)) - fatal ("Error clearing trace_buffer_is_full variable in lib"); - - stop_tracing_bkpt = set_breakpoint_at (ipa_sym_addrs.addr_stop_tracing, - stop_tracing_handler); - if (stop_tracing_bkpt == NULL) - error ("Error setting stop_tracing breakpoint"); - - flush_trace_buffer_bkpt - = set_breakpoint_at (ipa_sym_addrs.addr_flush_trace_buffer, - flush_trace_buffer_handler); - if (flush_trace_buffer_bkpt == NULL) - error ("Error setting flush_trace_buffer breakpoint"); - } - - unpause_all (1); - - write_ok (packet); -} - -/* End a tracing run, filling in a stop reason to report back to GDB, - and removing the tracepoints from the code. */ - -void -stop_tracing (void) -{ - if (!tracing) - { - trace_debug ("Tracing is already off, ignoring"); - return; - } - - trace_debug ("Stopping the trace"); - - /* Pause all threads before removing fast jumps from memory, - breakpoints, and touching IPA state variables (inferior memory). - Some thread may hit the internal tracing breakpoints, or be - collecting this moment, but that's ok, we don't release the - tpoint object's memory or the jump pads here (we only do that - when we're sure we can move all threads out of the jump pads). - We can't now, since we may be getting here due to the inferior - agent calling us. */ - pause_all (1); - /* Since we're removing breakpoints, cancel breakpoint hits, - possibly related to the breakpoints we're about to delete. */ - cancel_breakpoints (); - - /* Stop logging. Tracepoints can still be hit, but they will not be - recorded. */ - tracing = 0; - if (in_process_agent_loaded ()) - { - if (write_inferior_integer (ipa_sym_addrs.addr_tracing, 0)) - fatal ("Error clearing tracing variable in lib"); - } - - tracing_stop_reason = "t???"; - tracing_stop_tpnum = 0; - if (stopping_tracepoint) - { - trace_debug ("Stopping the trace because " - "tracepoint %d was hit %ld times", - stopping_tracepoint->number, - stopping_tracepoint->pass_count); - tracing_stop_reason = "tpasscount"; - tracing_stop_tpnum = stopping_tracepoint->number; - } - else if (trace_buffer_is_full) - { - trace_debug ("Stopping the trace because the trace buffer is full"); - tracing_stop_reason = "tfull"; - } - else if (expr_eval_result != expr_eval_no_error) - { - trace_debug ("Stopping the trace because of an expression eval error"); - tracing_stop_reason = eval_result_names[expr_eval_result]; - tracing_stop_tpnum = error_tracepoint->number; - } -#ifndef IN_PROCESS_AGENT - else if (!gdb_connected ()) - { - trace_debug ("Stopping the trace because GDB disconnected"); - tracing_stop_reason = "tdisconnected"; - } -#endif - else - { - trace_debug ("Stopping the trace because of a tstop command"); - tracing_stop_reason = "tstop"; - } - - stopping_tracepoint = NULL; - error_tracepoint = NULL; - - /* Clear out the tracepoints. */ - clear_installed_tracepoints (); - - if (in_process_agent_loaded ()) - { - /* Pull in fast tracepoint trace frames from the inferior lib - buffer into our buffer, even if our buffer is already full, - because we want to present the full number of created frames - in addition to what fit in the trace buffer. */ - upload_fast_traceframes (); - } - - if (stop_tracing_bkpt != NULL) - { - delete_breakpoint (stop_tracing_bkpt); - stop_tracing_bkpt = NULL; - } - - if (flush_trace_buffer_bkpt != NULL) - { - delete_breakpoint (flush_trace_buffer_bkpt); - flush_trace_buffer_bkpt = NULL; - } - - unpause_all (1); -} - -static int -stop_tracing_handler (CORE_ADDR addr) -{ - trace_debug ("lib hit stop_tracing"); - - /* Don't actually handle it here. When we stop tracing we remove - breakpoints from the inferior, and that is not allowed in a - breakpoint handler (as the caller is walking the breakpoint - list). */ - return 0; -} - -static int -flush_trace_buffer_handler (CORE_ADDR addr) -{ - trace_debug ("lib hit flush_trace_buffer"); - return 0; -} - -static void -cmd_qtstop (char *packet) -{ - stop_tracing (); - write_ok (packet); -} - -static void -cmd_qtdisconnected (char *own_buf) -{ - ULONGEST setting; - char *packet = own_buf; - - packet += strlen ("QTDisconnected:"); - - unpack_varlen_hex (packet, &setting); - - write_ok (own_buf); - - disconnected_tracing = setting; -} - -static void -cmd_qtframe (char *own_buf) -{ - ULONGEST frame, pc, lo, hi, num; - int tfnum, tpnum; - struct traceframe *tframe; - char *packet = own_buf; - - packet += strlen ("QTFrame:"); - - if (strncmp (packet, "pc:", strlen ("pc:")) == 0) - { - packet += strlen ("pc:"); - unpack_varlen_hex (packet, &pc); - trace_debug ("Want to find next traceframe at pc=0x%s", paddress (pc)); - tframe = find_next_traceframe_in_range (pc, pc, 1, &tfnum); - } - else if (strncmp (packet, "range:", strlen ("range:")) == 0) - { - packet += strlen ("range:"); - packet = unpack_varlen_hex (packet, &lo); - ++packet; - unpack_varlen_hex (packet, &hi); - trace_debug ("Want to find next traceframe in the range 0x%s to 0x%s", - paddress (lo), paddress (hi)); - tframe = find_next_traceframe_in_range (lo, hi, 1, &tfnum); - } - else if (strncmp (packet, "outside:", strlen ("outside:")) == 0) - { - packet += strlen ("outside:"); - packet = unpack_varlen_hex (packet, &lo); - ++packet; - unpack_varlen_hex (packet, &hi); - trace_debug ("Want to find next traceframe " - "outside the range 0x%s to 0x%s", - paddress (lo), paddress (hi)); - tframe = find_next_traceframe_in_range (lo, hi, 0, &tfnum); - } - else if (strncmp (packet, "tdp:", strlen ("tdp:")) == 0) - { - packet += strlen ("tdp:"); - unpack_varlen_hex (packet, &num); - tpnum = (int) num; - trace_debug ("Want to find next traceframe for tracepoint %d", tpnum); - tframe = find_next_traceframe_by_tracepoint (tpnum, &tfnum); - } - else - { - unpack_varlen_hex (packet, &frame); - tfnum = (int) frame; - if (tfnum == -1) - { - trace_debug ("Want to stop looking at traceframes"); - current_traceframe = -1; - write_ok (own_buf); - return; - } - trace_debug ("Want to look at traceframe %d", tfnum); - tframe = find_traceframe (tfnum); - } - - if (tframe) - { - current_traceframe = tfnum; - sprintf (own_buf, "F%xT%x", tfnum, tframe->tpnum); - } - else - sprintf (own_buf, "F-1"); -} - -static void -cmd_qtstatus (char *packet) -{ - char *stop_reason_rsp = NULL; - - trace_debug ("Returning trace status as %d, stop reason %s", - tracing, tracing_stop_reason); - - if (in_process_agent_loaded ()) - { - pause_all (1); - - upload_fast_traceframes (); - - unpause_all (1); - } - - stop_reason_rsp = (char *) tracing_stop_reason; - - /* The user visible error string in terror needs to be hex encoded. - We leave it as plain string in `tracepoint_stop_reason' to ease - debugging. */ - if (strncmp (stop_reason_rsp, "terror:", strlen ("terror:")) == 0) - { - const char *result_name; - int hexstr_len; - char *p; - - result_name = stop_reason_rsp + strlen ("terror:"); - hexstr_len = strlen (result_name) * 2; - p = stop_reason_rsp = alloca (strlen ("terror:") + hexstr_len + 1); - strcpy (p, "terror:"); - p += strlen (p); - convert_int_to_ascii ((gdb_byte *) result_name, p, strlen (result_name)); - } - - sprintf (packet, - "T%d;" - "%s:%x;" - "tframes:%x;tcreated:%x;" - "tfree:%x;tsize:%s;" - "circular:%d;" - "disconn:%d", - tracing ? 1 : 0, - stop_reason_rsp, tracing_stop_tpnum, - traceframe_count, traceframes_created, - free_space (), phex_nz (trace_buffer_hi - trace_buffer_lo, 0), - circular_trace_buffer, - disconnected_tracing); -} - -/* State variables to help return all the tracepoint bits. */ -static struct tracepoint *cur_tpoint; -static int cur_action; -static int cur_step_action; -static struct source_string *cur_source_string; -static struct trace_state_variable *cur_tsv; - -/* Compose a response that is an imitation of the syntax by which the - tracepoint was originally downloaded. */ - -static void -response_tracepoint (char *packet, struct tracepoint *tpoint) -{ - char *buf; - - sprintf (packet, "T%x:%s:%c:%lx:%lx", tpoint->number, - paddress (tpoint->address), - (tpoint->enabled ? 'E' : 'D'), tpoint->step_count, - tpoint->pass_count); - if (tpoint->type == fast_tracepoint) - sprintf (packet + strlen (packet), ":F%x", tpoint->orig_size); - else if (tpoint->type == static_tracepoint) - sprintf (packet + strlen (packet), ":S"); - - if (tpoint->cond) - { - buf = unparse_agent_expr (tpoint->cond); - sprintf (packet + strlen (packet), ":X%x,%s", - tpoint->cond->length, buf); - free (buf); - } -} - -/* Compose a response that is an imitation of the syntax by which the - tracepoint action was originally downloaded (with the difference - that due to the way we store the actions, this will output a packet - per action, while GDB could have combined more than one action - per-packet. */ - -static void -response_action (char *packet, struct tracepoint *tpoint, - char *taction, int step) -{ - sprintf (packet, "%c%x:%s:%s", - (step ? 'S' : 'A'), tpoint->number, paddress (tpoint->address), - taction); -} - -/* Compose a response that is an imitation of the syntax by which the - tracepoint source piece was originally downloaded. */ - -static void -response_source (char *packet, - struct tracepoint *tpoint, struct source_string *src) -{ - char *buf; - int len; - - len = strlen (src->str); - buf = alloca (len * 2 + 1); - convert_int_to_ascii ((gdb_byte *) src->str, buf, len); - - sprintf (packet, "Z%x:%s:%s:%x:%x:%s", - tpoint->number, paddress (tpoint->address), - src->type, 0, len, buf); -} - -/* Return the first piece of tracepoint definition, and initialize the - state machine that will iterate through all the tracepoint - bits. */ - -static void -cmd_qtfp (char *packet) -{ - trace_debug ("Returning first tracepoint definition piece"); - - cur_tpoint = tracepoints; - cur_action = cur_step_action = -1; - cur_source_string = NULL; - - if (cur_tpoint) - response_tracepoint (packet, cur_tpoint); - else - strcpy (packet, "l"); -} - -/* Return additional pieces of tracepoint definition. Each action and - stepping action must go into its own packet, because of packet size - limits, and so we use state variables to deliver one piece at a - time. */ - -static void -cmd_qtsp (char *packet) -{ - trace_debug ("Returning subsequent tracepoint definition piece"); - - if (!cur_tpoint) - { - /* This case would normally never occur, but be prepared for - GDB misbehavior. */ - strcpy (packet, "l"); - } - else if (cur_action < cur_tpoint->numactions - 1) - { - ++cur_action; - response_action (packet, cur_tpoint, - cur_tpoint->actions_str[cur_action], 0); - } - else if (cur_step_action < cur_tpoint->num_step_actions - 1) - { - ++cur_step_action; - response_action (packet, cur_tpoint, - cur_tpoint->step_actions_str[cur_step_action], 1); - } - else if ((cur_source_string - ? cur_source_string->next - : cur_tpoint->source_strings)) - { - if (cur_source_string) - cur_source_string = cur_source_string->next; - else - cur_source_string = cur_tpoint->source_strings; - response_source (packet, cur_tpoint, cur_source_string); - } - else - { - cur_tpoint = cur_tpoint->next; - cur_action = cur_step_action = -1; - cur_source_string = NULL; - if (cur_tpoint) - response_tracepoint (packet, cur_tpoint); - else - strcpy (packet, "l"); - } -} - -/* Compose a response that is an imitation of the syntax by which the - trace state variable was originally downloaded. */ - -static void -response_tsv (char *packet, struct trace_state_variable *tsv) -{ - char *buf = (char *) ""; - int namelen; - - if (tsv->name) - { - namelen = strlen (tsv->name); - buf = alloca (namelen * 2 + 1); - convert_int_to_ascii ((gdb_byte *) tsv->name, buf, namelen); - } - - sprintf (packet, "%x:%s:%x:%s", tsv->number, phex_nz (tsv->initial_value, 0), - tsv->getter ? 1 : 0, buf); -} - -/* Return the first trace state variable definition, and initialize - the state machine that will iterate through all the tsv bits. */ - -static void -cmd_qtfv (char *packet) -{ - trace_debug ("Returning first trace state variable definition"); - - cur_tsv = trace_state_variables; - - if (cur_tsv) - response_tsv (packet, cur_tsv); - else - strcpy (packet, "l"); -} - -/* Return additional trace state variable definitions. */ - -static void -cmd_qtsv (char *packet) -{ - trace_debug ("Returning first trace state variable definition"); - - if (!cur_tpoint) - { - /* This case would normally never occur, but be prepared for - GDB misbehavior. */ - strcpy (packet, "l"); - } - else if (cur_tsv) - { - cur_tsv = cur_tsv->next; - if (cur_tsv) - response_tsv (packet, cur_tsv); - else - strcpy (packet, "l"); - } - else - strcpy (packet, "l"); -} - -/* Return the first static tracepoint marker, and initialize the state - machine that will iterate through all the static tracepoints - markers. */ - -static void -cmd_qtfstm (char *packet) -{ - if (!maybe_write_ipa_ust_not_loaded (packet)) - run_inferior_command (packet); -} - -/* Return additional static tracepoints markers. */ - -static void -cmd_qtsstm (char *packet) -{ - if (!maybe_write_ipa_ust_not_loaded (packet)) - run_inferior_command (packet); -} - -/* Return the definition of the static tracepoint at a given address. - Result packet is the same as qTsST's. */ - -static void -cmd_qtstmat (char *packet) -{ - if (!maybe_write_ipa_ust_not_loaded (packet)) - run_inferior_command (packet); -} - -/* Respond to qTBuffer packet with a block of raw data from the trace - buffer. GDB may ask for a lot, but we are allowed to reply with - only as much as will fit within packet limits or whatever. */ - -static void -cmd_qtbuffer (char *own_buf) -{ - ULONGEST offset, num, tot; - unsigned char *tbp; - char *packet = own_buf; - - packet += strlen ("qTBuffer:"); - - packet = unpack_varlen_hex (packet, &offset); - ++packet; /* skip a comma */ - unpack_varlen_hex (packet, &num); - - trace_debug ("Want to get trace buffer, %d bytes at offset 0x%s", - (int) num, pulongest (offset)); - - tot = (trace_buffer_hi - trace_buffer_lo) - free_space (); - - /* If we're right at the end, reply specially that we're done. */ - if (offset == tot) - { - strcpy (own_buf, "l"); - return; - } - - /* Object to any other out-of-bounds request. */ - if (offset > tot) - { - write_enn (own_buf); - return; - } - - /* Compute the pointer corresponding to the given offset, accounting - for wraparound. */ - tbp = trace_buffer_start + offset; - if (tbp >= trace_buffer_wrap) - tbp -= (trace_buffer_wrap - trace_buffer_lo); - - /* Trim to the remaining bytes if we're close to the end. */ - if (num > tot - offset) - num = tot - offset; - - /* Trim to available packet size. */ - if (num >= (PBUFSIZ - 16) / 2 ) - num = (PBUFSIZ - 16) / 2; - - convert_int_to_ascii (tbp, own_buf, num); - own_buf[num] = '\0'; -} - -static void -cmd_bigqtbuffer (char *own_buf) -{ - ULONGEST val; - char *packet = own_buf; - - packet += strlen ("QTBuffer:"); - - if (strncmp ("circular:", packet, strlen ("circular:")) == 0) - { - packet += strlen ("circular:"); - unpack_varlen_hex (packet, &val); - circular_trace_buffer = val; - trace_debug ("Trace buffer is now %s", - circular_trace_buffer ? "circular" : "linear"); - write_ok (own_buf); - } - else - write_enn (own_buf); -} - -int -handle_tracepoint_general_set (char *packet) -{ - if (strcmp ("QTinit", packet) == 0) - { - cmd_qtinit (packet); - return 1; - } - else if (strncmp ("QTDP:", packet, strlen ("QTDP:")) == 0) - { - cmd_qtdp (packet); - return 1; - } - else if (strncmp ("QTDPsrc:", packet, strlen ("QTDPsrc:")) == 0) - { - cmd_qtdpsrc (packet); - return 1; - } - else if (strncmp ("QTEnable:", packet, strlen ("QTEnable:")) == 0) - { - cmd_qtenable_disable (packet, 1); - return 1; - } - else if (strncmp ("QTDisable:", packet, strlen ("QTDisable:")) == 0) - { - cmd_qtenable_disable (packet, 0); - return 1; - } - else if (strncmp ("QTDV:", packet, strlen ("QTDV:")) == 0) - { - cmd_qtdv (packet); - return 1; - } - else if (strncmp ("QTro:", packet, strlen ("QTro:")) == 0) - { - cmd_qtro (packet); - return 1; - } - else if (strcmp ("QTStart", packet) == 0) - { - cmd_qtstart (packet); - return 1; - } - else if (strcmp ("QTStop", packet) == 0) - { - cmd_qtstop (packet); - return 1; - } - else if (strncmp ("QTDisconnected:", packet, - strlen ("QTDisconnected:")) == 0) - { - cmd_qtdisconnected (packet); - return 1; - } - else if (strncmp ("QTFrame:", packet, strlen ("QTFrame:")) == 0) - { - cmd_qtframe (packet); - return 1; - } - else if (strncmp ("QTBuffer:", packet, strlen ("QTBuffer:")) == 0) - { - cmd_bigqtbuffer (packet); - return 1; - } - - return 0; -} - -int -handle_tracepoint_query (char *packet) -{ - if (strcmp ("qTStatus", packet) == 0) - { - cmd_qtstatus (packet); - return 1; - } - else if (strcmp ("qTfP", packet) == 0) - { - cmd_qtfp (packet); - return 1; - } - else if (strcmp ("qTsP", packet) == 0) - { - cmd_qtsp (packet); - return 1; - } - else if (strcmp ("qTfV", packet) == 0) - { - cmd_qtfv (packet); - return 1; - } - else if (strcmp ("qTsV", packet) == 0) - { - cmd_qtsv (packet); - return 1; - } - else if (strncmp ("qTV:", packet, strlen ("qTV:")) == 0) - { - cmd_qtv (packet); - return 1; - } - else if (strncmp ("qTBuffer:", packet, strlen ("qTBuffer:")) == 0) - { - cmd_qtbuffer (packet); - return 1; - } - else if (strcmp ("qTfSTM", packet) == 0) - { - cmd_qtfstm (packet); - return 1; - } - else if (strcmp ("qTsSTM", packet) == 0) - { - cmd_qtsstm (packet); - return 1; - } - else if (strncmp ("qTSTMat:", packet, strlen ("qTSTMat:")) == 0) - { - cmd_qtstmat (packet); - return 1; - } - - return 0; -} - -#endif -#ifndef IN_PROCESS_AGENT - -/* Call this when thread TINFO has hit the tracepoint defined by - TP_NUMBER and TP_ADDRESS, and that tracepoint has a while-stepping - action. This adds a while-stepping collecting state item to the - threads' collecting state list, so that we can keep track of - multiple simultaneous while-stepping actions being collected by the - same thread. This can happen in cases like: - - ff0001 INSN1 <-- TP1, while-stepping 10 collect $regs - ff0002 INSN2 - ff0003 INSN3 <-- TP2, collect $regs - ff0004 INSN4 <-- TP3, while-stepping 10 collect $regs - ff0005 INSN5 - - Notice that when instruction INSN5 is reached, the while-stepping - actions of both TP1 and TP3 are still being collected, and that TP2 - had been collected meanwhile. The whole range of ff0001-ff0005 - should be single-stepped, due to at least TP1's while-stepping - action covering the whole range. */ - -static void -add_while_stepping_state (struct thread_info *tinfo, - int tp_number, CORE_ADDR tp_address) -{ - struct wstep_state *wstep; - - wstep = xmalloc (sizeof (*wstep)); - wstep->next = tinfo->while_stepping; - - wstep->tp_number = tp_number; - wstep->tp_address = tp_address; - wstep->current_step = 0; - - tinfo->while_stepping = wstep; -} - -/* Release the while-stepping collecting state WSTEP. */ - -static void -release_while_stepping_state (struct wstep_state *wstep) -{ - free (wstep); -} - -/* Release all while-stepping collecting states currently associated - with thread TINFO. */ - -void -release_while_stepping_state_list (struct thread_info *tinfo) -{ - struct wstep_state *head; - - while (tinfo->while_stepping) - { - head = tinfo->while_stepping; - tinfo->while_stepping = head->next; - release_while_stepping_state (head); - } -} - -/* If TINFO was handling a 'while-stepping' action, the step has - finished, so collect any step data needed, and check if any more - steps are required. Return true if the thread was indeed - collecting tracepoint data, false otherwise. */ - -int -tracepoint_finished_step (struct thread_info *tinfo, CORE_ADDR stop_pc) -{ - struct tracepoint *tpoint; - struct wstep_state *wstep; - struct wstep_state **wstep_link; - struct trap_tracepoint_ctx ctx; - - /* Pull in fast tracepoint trace frames from the inferior lib buffer into - our buffer. */ - if (in_process_agent_loaded ()) - upload_fast_traceframes (); - - /* Check if we were indeed collecting data for one of more - tracepoints with a 'while-stepping' count. */ - if (tinfo->while_stepping == NULL) - return 0; - - if (!tracing) - { - /* We're not even tracing anymore. Stop this thread from - collecting. */ - release_while_stepping_state_list (tinfo); - - /* The thread had stopped due to a single-step request indeed - explained by a tracepoint. */ - return 1; - } - - wstep = tinfo->while_stepping; - wstep_link = &tinfo->while_stepping; - - trace_debug ("Thread %s finished a single-step for tracepoint %d at 0x%s", - target_pid_to_str (tinfo->entry.id), - wstep->tp_number, paddress (wstep->tp_address)); - - ctx.base.type = trap_tracepoint; - ctx.regcache = get_thread_regcache (tinfo, 1); - - while (wstep != NULL) - { - tpoint = find_tracepoint (wstep->tp_number, wstep->tp_address); - if (tpoint == NULL) - { - trace_debug ("NO TRACEPOINT %d at 0x%s FOR THREAD %s!", - wstep->tp_number, paddress (wstep->tp_address), - target_pid_to_str (tinfo->entry.id)); - - /* Unlink. */ - *wstep_link = wstep->next; - release_while_stepping_state (wstep); - wstep = *wstep_link; - continue; - } - - /* We've just finished one step. */ - ++wstep->current_step; - - /* Collect data. */ - collect_data_at_step ((struct tracepoint_hit_ctx *) &ctx, - stop_pc, tpoint, wstep->current_step); - - if (wstep->current_step >= tpoint->step_count) - { - /* The requested numbers of steps have occurred. */ - trace_debug ("Thread %s done stepping for tracepoint %d at 0x%s", - target_pid_to_str (tinfo->entry.id), - wstep->tp_number, paddress (wstep->tp_address)); - - /* Unlink the wstep. */ - *wstep_link = wstep->next; - release_while_stepping_state (wstep); - wstep = *wstep_link; - - /* Only check the hit count now, which ensure that we do all - our stepping before stopping the run. */ - if (tpoint->pass_count > 0 - && tpoint->hit_count >= tpoint->pass_count - && stopping_tracepoint == NULL) - stopping_tracepoint = tpoint; - } - else - { - /* Keep single-stepping until the requested numbers of steps - have occurred. */ - wstep_link = &wstep->next; - wstep = *wstep_link; - } - - if (stopping_tracepoint - || trace_buffer_is_full - || expr_eval_result != expr_eval_no_error) - { - stop_tracing (); - break; - } - } - - return 1; -} - -/* Handle any internal tracing control breakpoint hits. That means, - pull traceframes from the IPA to our buffer, and syncing both - tracing agents when the IPA's tracing stops for some reason. */ - -int -handle_tracepoint_bkpts (struct thread_info *tinfo, CORE_ADDR stop_pc) -{ - /* Pull in fast tracepoint trace frames from the inferior in-process - agent's buffer into our buffer. */ - - if (!in_process_agent_loaded ()) - return 0; - - upload_fast_traceframes (); - - /* Check if the in-process agent had decided we should stop - tracing. */ - if (stop_pc == ipa_sym_addrs.addr_stop_tracing) - { - int ipa_trace_buffer_is_full; - CORE_ADDR ipa_stopping_tracepoint; - int ipa_expr_eval_result; - CORE_ADDR ipa_error_tracepoint; - - trace_debug ("lib stopped at stop_tracing"); - - read_inferior_integer (ipa_sym_addrs.addr_trace_buffer_is_full, - &ipa_trace_buffer_is_full); - - read_inferior_data_pointer (ipa_sym_addrs.addr_stopping_tracepoint, - &ipa_stopping_tracepoint); - write_inferior_data_pointer (ipa_sym_addrs.addr_stopping_tracepoint, 0); - - read_inferior_data_pointer (ipa_sym_addrs.addr_error_tracepoint, - &ipa_error_tracepoint); - write_inferior_data_pointer (ipa_sym_addrs.addr_error_tracepoint, 0); - - read_inferior_integer (ipa_sym_addrs.addr_expr_eval_result, - &ipa_expr_eval_result); - write_inferior_integer (ipa_sym_addrs.addr_expr_eval_result, 0); - - trace_debug ("lib: trace_buffer_is_full: %d, " - "stopping_tracepoint: %s, " - "ipa_expr_eval_result: %d, " - "error_tracepoint: %s, ", - ipa_trace_buffer_is_full, - paddress (ipa_stopping_tracepoint), - ipa_expr_eval_result, - paddress (ipa_error_tracepoint)); - - if (debug_threads) - { - if (ipa_trace_buffer_is_full) - trace_debug ("lib stopped due to full buffer."); - if (ipa_stopping_tracepoint) - trace_debug ("lib stopped due to tpoint"); - if (ipa_stopping_tracepoint) - trace_debug ("lib stopped due to error"); - } - - if (ipa_stopping_tracepoint != 0) - { - stopping_tracepoint - = fast_tracepoint_from_ipa_tpoint_address (ipa_stopping_tracepoint); - } - else if (ipa_expr_eval_result != expr_eval_no_error) - { - expr_eval_result = ipa_expr_eval_result; - error_tracepoint - = fast_tracepoint_from_ipa_tpoint_address (ipa_error_tracepoint); - } - stop_tracing (); - return 1; - } - else if (stop_pc == ipa_sym_addrs.addr_flush_trace_buffer) - { - trace_debug ("lib stopped at flush_trace_buffer"); - return 1; - } - - return 0; -} - -/* Return true if TINFO just hit a tracepoint. Collect data if - so. */ - -int -tracepoint_was_hit (struct thread_info *tinfo, CORE_ADDR stop_pc) -{ - struct tracepoint *tpoint; - int ret = 0; - struct trap_tracepoint_ctx ctx; - - /* Not tracing, don't handle. */ - if (!tracing) - return 0; - - ctx.base.type = trap_tracepoint; - ctx.regcache = get_thread_regcache (tinfo, 1); - - for (tpoint = tracepoints; tpoint; tpoint = tpoint->next) - { - /* Note that we collect fast tracepoints here as well. We'll - step over the fast tracepoint jump later, which avoids the - double collect. */ - if (tpoint->enabled && stop_pc == tpoint->address) - { - trace_debug ("Thread %s at address of tracepoint %d at 0x%s", - target_pid_to_str (tinfo->entry.id), - tpoint->number, paddress (tpoint->address)); - - /* Test the condition if present, and collect if true. */ - if (!tpoint->cond - || (condition_true_at_tracepoint - ((struct tracepoint_hit_ctx *) &ctx, tpoint))) - collect_data_at_tracepoint ((struct tracepoint_hit_ctx *) &ctx, - stop_pc, tpoint); - - if (stopping_tracepoint - || trace_buffer_is_full - || expr_eval_result != expr_eval_no_error) - { - stop_tracing (); - } - /* If the tracepoint had a 'while-stepping' action, then set - the thread to collect this tracepoint on the following - single-steps. */ - else if (tpoint->step_count > 0) - { - add_while_stepping_state (tinfo, - tpoint->number, tpoint->address); - } - - ret = 1; - } - } - - return ret; -} - -#endif - -#if defined IN_PROCESS_AGENT && defined HAVE_UST -struct ust_marker_data; -static void collect_ust_data_at_tracepoint (struct tracepoint_hit_ctx *ctx, - CORE_ADDR stop_pc, - struct tracepoint *tpoint, - struct traceframe *tframe); -#endif - -/* Create a trace frame for the hit of the given tracepoint in the - given thread. */ - -static void -collect_data_at_tracepoint (struct tracepoint_hit_ctx *ctx, CORE_ADDR stop_pc, - struct tracepoint *tpoint) -{ - struct traceframe *tframe; - int acti; - - /* Only count it as a hit when we actually collect data. */ - tpoint->hit_count++; - - /* If we've exceeded a defined pass count, record the event for - later, and finish the collection for this hit. This test is only - for nonstepping tracepoints, stepping tracepoints test at the end - of their while-stepping loop. */ - if (tpoint->pass_count > 0 - && tpoint->hit_count >= tpoint->pass_count - && tpoint->step_count == 0 - && stopping_tracepoint == NULL) - stopping_tracepoint = tpoint; - - trace_debug ("Making new traceframe for tracepoint %d at 0x%s, hit %ld", - tpoint->number, paddress (tpoint->address), tpoint->hit_count); - - tframe = add_traceframe (tpoint); - - if (tframe) - { - for (acti = 0; acti < tpoint->numactions; ++acti) - { -#ifndef IN_PROCESS_AGENT - trace_debug ("Tracepoint %d at 0x%s about to do action '%s'", - tpoint->number, paddress (tpoint->address), - tpoint->actions_str[acti]); -#endif - - do_action_at_tracepoint (ctx, stop_pc, tpoint, tframe, - tpoint->actions[acti]); - } - - finish_traceframe (tframe); - } - - if (tframe == NULL && tracing) - trace_buffer_is_full = 1; -} - -#ifndef IN_PROCESS_AGENT - -static void -collect_data_at_step (struct tracepoint_hit_ctx *ctx, - CORE_ADDR stop_pc, - struct tracepoint *tpoint, int current_step) -{ - struct traceframe *tframe; - int acti; - - trace_debug ("Making new step traceframe for " - "tracepoint %d at 0x%s, step %d of %ld, hit %ld", - tpoint->number, paddress (tpoint->address), - current_step, tpoint->step_count, - tpoint->hit_count); - - tframe = add_traceframe (tpoint); - - if (tframe) - { - for (acti = 0; acti < tpoint->num_step_actions; ++acti) - { - trace_debug ("Tracepoint %d at 0x%s about to do step action '%s'", - tpoint->number, paddress (tpoint->address), - tpoint->step_actions_str[acti]); - - do_action_at_tracepoint (ctx, stop_pc, tpoint, tframe, - tpoint->step_actions[acti]); - } - - finish_traceframe (tframe); - } - - if (tframe == NULL && tracing) - trace_buffer_is_full = 1; -} - -#endif - -static struct regcache * -get_context_regcache (struct tracepoint_hit_ctx *ctx) -{ - struct regcache *regcache = NULL; - -#ifdef IN_PROCESS_AGENT - if (ctx->type == fast_tracepoint) - { - struct fast_tracepoint_ctx *fctx = (struct fast_tracepoint_ctx *) ctx; - if (!fctx->regcache_initted) - { - fctx->regcache_initted = 1; - init_register_cache (&fctx->regcache, fctx->regspace); - supply_regblock (&fctx->regcache, NULL); - supply_fast_tracepoint_registers (&fctx->regcache, fctx->regs); - } - regcache = &fctx->regcache; - } -#ifdef HAVE_UST - if (ctx->type == static_tracepoint) - { - struct static_tracepoint_ctx *sctx - = (struct static_tracepoint_ctx *) ctx; - - if (!sctx->regcache_initted) - { - sctx->regcache_initted = 1; - init_register_cache (&sctx->regcache, sctx->regspace); - supply_regblock (&sctx->regcache, NULL); - /* Pass down the tracepoint address, because REGS doesn't - include the PC, but we know what it must have been. */ - supply_static_tracepoint_registers (&sctx->regcache, - (const unsigned char *) - sctx->regs, - sctx->tpoint->address); - } - regcache = &sctx->regcache; - } -#endif -#else - if (ctx->type == trap_tracepoint) - { - struct trap_tracepoint_ctx *tctx = (struct trap_tracepoint_ctx *) ctx; - regcache = tctx->regcache; - } -#endif - - gdb_assert (regcache != NULL); - - return regcache; -} - -static void -do_action_at_tracepoint (struct tracepoint_hit_ctx *ctx, - CORE_ADDR stop_pc, - struct tracepoint *tpoint, - struct traceframe *tframe, - struct tracepoint_action *taction) -{ - enum eval_result_type err; - - switch (taction->type) - { - case 'M': - { - struct collect_memory_action *maction; - - maction = (struct collect_memory_action *) taction; - - trace_debug ("Want to collect %s bytes at 0x%s (basereg %d)", - pulongest (maction->len), - paddress (maction->addr), maction->basereg); - /* (should use basereg) */ - agent_mem_read (tframe, NULL, - (CORE_ADDR) maction->addr, maction->len); - break; - } - case 'R': - { - unsigned char *regspace; - struct regcache tregcache; - struct regcache *context_regcache; - - - trace_debug ("Want to collect registers"); - - /* Collect all registers for now. */ - regspace = add_traceframe_block (tframe, - 1 + register_cache_size ()); - if (regspace == NULL) - { - trace_debug ("Trace buffer block allocation failed, skipping"); - break; - } - /* Identify a register block. */ - *regspace = 'R'; - - context_regcache = get_context_regcache (ctx); - - /* Wrap the regblock in a register cache (in the stack, we - don't want to malloc here). */ - init_register_cache (&tregcache, regspace + 1); - - /* Copy the register data to the regblock. */ - regcache_cpy (&tregcache, context_regcache); - -#ifndef IN_PROCESS_AGENT - /* On some platforms, trap-based tracepoints will have the PC - pointing to the next instruction after the trap, but we - don't want the user or GDB trying to guess whether the - saved PC needs adjusting; so always record the adjusted - stop_pc. Note that we can't use tpoint->address instead, - since it will be wrong for while-stepping actions. This - adjustment is a nop for fast tracepoints collected from the - in-process lib (but not if GDBserver is collecting one - preemptively), since the PC had already been adjusted to - contain the tracepoint's address by the jump pad. */ - trace_debug ("Storing stop pc (0x%s) in regblock", - paddress (tpoint->address)); - - /* This changes the regblock, not the thread's - regcache. */ - regcache_write_pc (&tregcache, stop_pc); -#endif - } - break; - case 'X': - { - struct eval_expr_action *eaction; - - eaction = (struct eval_expr_action *) taction; - - trace_debug ("Want to evaluate expression"); - - err = eval_agent_expr (ctx, tframe, eaction->expr, NULL); - - if (err != expr_eval_no_error) - { - record_tracepoint_error (tpoint, "action expression", err); - return; - } - } - break; - case 'L': - { -#if defined IN_PROCESS_AGENT && defined HAVE_UST - trace_debug ("Want to collect static trace data"); - collect_ust_data_at_tracepoint (ctx, stop_pc, - tpoint, tframe); -#else - trace_debug ("warning: collecting static trace data, " - "but static tracepoints are not supported"); -#endif - } - break; - default: - trace_debug ("unknown trace action '%c', ignoring", taction->type); - break; - } -} - -static int -condition_true_at_tracepoint (struct tracepoint_hit_ctx *ctx, - struct tracepoint *tpoint) -{ - ULONGEST value = 0; - enum eval_result_type err; - - /* Presently, gdbserver doesn't run compiled conditions, only the - IPA does. If the program stops at a fast tracepoint's address - (e.g., due to a breakpoint, trap tracepoint, or stepping), - gdbserver preemptively collect the fast tracepoint. Later, on - resume, gdbserver steps over the fast tracepoint like it steps - over breakpoints, so that the IPA doesn't see that fast - tracepoint. This avoids double collects of fast tracepoints in - that stopping scenario. Having gdbserver itself handle the fast - tracepoint gives the user a consistent view of when fast or trap - tracepoints are collected, compared to an alternative where only - trap tracepoints are collected on stop, and fast tracepoints on - resume. When a fast tracepoint is being processed by gdbserver, - it is always the non-compiled condition expression that is - used. */ -#ifdef IN_PROCESS_AGENT - if (tpoint->compiled_cond) - err = ((condfn) (uintptr_t) (tpoint->compiled_cond)) (ctx, &value); - else -#endif - err = eval_agent_expr (ctx, NULL, tpoint->cond, &value); - - if (err != expr_eval_no_error) - { - record_tracepoint_error (tpoint, "condition", err); - /* The error case must return false. */ - return 0; - } - - trace_debug ("Tracepoint %d at 0x%s condition evals to %s", - tpoint->number, paddress (tpoint->address), - pulongest (value)); - return (value ? 1 : 0); -} - -#ifndef IN_PROCESS_AGENT - -/* The packet form of an agent expression consists of an 'X', number - of bytes in expression, a comma, and then the bytes. */ - -static struct agent_expr * -parse_agent_expr (char **actparm) -{ - char *act = *actparm; - ULONGEST xlen; - struct agent_expr *aexpr; - - ++act; /* skip the X */ - act = unpack_varlen_hex (act, &xlen); - ++act; /* skip a comma */ - aexpr = xmalloc (sizeof (struct agent_expr)); - aexpr->length = xlen; - aexpr->bytes = xmalloc (xlen); - convert_ascii_to_int (act, aexpr->bytes, xlen); - *actparm = act + (xlen * 2); - return aexpr; -} - -/* Convert the bytes of an agent expression back into hex digits, so - they can be printed or uploaded. This allocates the buffer, - callers should free when they are done with it. */ - -static char * -unparse_agent_expr (struct agent_expr *aexpr) -{ - char *rslt; - - rslt = xmalloc (2 * aexpr->length + 1); - convert_int_to_ascii (aexpr->bytes, rslt, aexpr->length); - return rslt; -} - -#endif - -/* A wrapper for gdb_agent_op_names that does some bounds-checking. */ - -static const char * -gdb_agent_op_name (int op) -{ - if (op < 0 || op >= gdb_agent_op_last || gdb_agent_op_names[op] == NULL) - return "?undef?"; - return gdb_agent_op_names[op]; -} - -/* The agent expression evaluator, as specified by the GDB docs. It - returns 0 if everything went OK, and a nonzero error code - otherwise. */ - -static enum eval_result_type -eval_agent_expr (struct tracepoint_hit_ctx *ctx, - struct traceframe *tframe, - struct agent_expr *aexpr, - ULONGEST *rslt) -{ - int pc = 0; -#define STACK_MAX 100 - ULONGEST stack[STACK_MAX], top; - int sp = 0; - unsigned char op; - int arg; - - /* This union is a convenient way to convert representations. For - now, assume a standard architecture where the hardware integer - types have 8, 16, 32, 64 bit types. A more robust solution would - be to import stdint.h from gnulib. */ - union - { - union - { - unsigned char bytes[1]; - unsigned char val; - } u8; - union - { - unsigned char bytes[2]; - unsigned short val; - } u16; - union - { - unsigned char bytes[4]; - unsigned int val; - } u32; - union - { - unsigned char bytes[8]; - ULONGEST val; - } u64; - } cnv; - - if (aexpr->length == 0) - { - trace_debug ("empty agent expression"); - return expr_eval_empty_expression; - } - - /* Cache the stack top in its own variable. Much of the time we can - operate on this variable, rather than dinking with the stack. It - needs to be copied to the stack when sp changes. */ - top = 0; - - while (1) - { - op = aexpr->bytes[pc++]; - - trace_debug ("About to interpret byte 0x%x", op); - - switch (op) - { - case gdb_agent_op_add: - top += stack[--sp]; - break; - - case gdb_agent_op_sub: - top = stack[--sp] - top; - break; - - case gdb_agent_op_mul: - top *= stack[--sp]; - break; - - case gdb_agent_op_div_signed: - if (top == 0) - { - trace_debug ("Attempted to divide by zero"); - return expr_eval_divide_by_zero; - } - top = ((LONGEST) stack[--sp]) / ((LONGEST) top); - break; - - case gdb_agent_op_div_unsigned: - if (top == 0) - { - trace_debug ("Attempted to divide by zero"); - return expr_eval_divide_by_zero; - } - top = stack[--sp] / top; - break; - - case gdb_agent_op_rem_signed: - if (top == 0) - { - trace_debug ("Attempted to divide by zero"); - return expr_eval_divide_by_zero; - } - top = ((LONGEST) stack[--sp]) % ((LONGEST) top); - break; - - case gdb_agent_op_rem_unsigned: - if (top == 0) - { - trace_debug ("Attempted to divide by zero"); - return expr_eval_divide_by_zero; - } - top = stack[--sp] % top; - break; - - case gdb_agent_op_lsh: - top = stack[--sp] << top; - break; - - case gdb_agent_op_rsh_signed: - top = ((LONGEST) stack[--sp]) >> top; - break; - - case gdb_agent_op_rsh_unsigned: - top = stack[--sp] >> top; - break; - - case gdb_agent_op_trace: - agent_mem_read (tframe, - NULL, (CORE_ADDR) stack[--sp], (ULONGEST) top); - if (--sp >= 0) - top = stack[sp]; - break; - - case gdb_agent_op_trace_quick: - arg = aexpr->bytes[pc++]; - agent_mem_read (tframe, NULL, (CORE_ADDR) top, (ULONGEST) arg); - break; - - case gdb_agent_op_log_not: - top = !top; - break; - - case gdb_agent_op_bit_and: - top &= stack[--sp]; - break; - - case gdb_agent_op_bit_or: - top |= stack[--sp]; - break; - - case gdb_agent_op_bit_xor: - top ^= stack[--sp]; - break; - - case gdb_agent_op_bit_not: - top = ~top; - break; - - case gdb_agent_op_equal: - top = (stack[--sp] == top); - break; - - case gdb_agent_op_less_signed: - top = (((LONGEST) stack[--sp]) < ((LONGEST) top)); - break; - - case gdb_agent_op_less_unsigned: - top = (stack[--sp] < top); - break; - - case gdb_agent_op_ext: - arg = aexpr->bytes[pc++]; - if (arg < (sizeof (LONGEST) * 8)) - { - LONGEST mask = 1 << (arg - 1); - top &= ((LONGEST) 1 << arg) - 1; - top = (top ^ mask) - mask; - } - break; - - case gdb_agent_op_ref8: - agent_mem_read (tframe, cnv.u8.bytes, (CORE_ADDR) top, 1); - top = cnv.u8.val; - break; - - case gdb_agent_op_ref16: - agent_mem_read (tframe, cnv.u16.bytes, (CORE_ADDR) top, 2); - top = cnv.u16.val; - break; - - case gdb_agent_op_ref32: - agent_mem_read (tframe, cnv.u32.bytes, (CORE_ADDR) top, 4); - top = cnv.u32.val; - break; - - case gdb_agent_op_ref64: - agent_mem_read (tframe, cnv.u64.bytes, (CORE_ADDR) top, 8); - top = cnv.u64.val; - break; - - case gdb_agent_op_if_goto: - if (top) - pc = (aexpr->bytes[pc] << 8) + (aexpr->bytes[pc + 1]); - else - pc += 2; - if (--sp >= 0) - top = stack[sp]; - break; - - case gdb_agent_op_goto: - pc = (aexpr->bytes[pc] << 8) + (aexpr->bytes[pc + 1]); - break; - - case gdb_agent_op_const8: - /* Flush the cached stack top. */ - stack[sp++] = top; - top = aexpr->bytes[pc++]; - break; - - case gdb_agent_op_const16: - /* Flush the cached stack top. */ - stack[sp++] = top; - top = aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - break; - - case gdb_agent_op_const32: - /* Flush the cached stack top. */ - stack[sp++] = top; - top = aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - break; - - case gdb_agent_op_const64: - /* Flush the cached stack top. */ - stack[sp++] = top; - top = aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - break; - - case gdb_agent_op_reg: - /* Flush the cached stack top. */ - stack[sp++] = top; - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - { - int regnum = arg; - struct regcache *regcache; - - regcache = get_context_regcache (ctx); - - switch (register_size (regnum)) - { - case 8: - collect_register (regcache, regnum, cnv.u64.bytes); - top = cnv.u64.val; - break; - case 4: - collect_register (regcache, regnum, cnv.u32.bytes); - top = cnv.u32.val; - break; - case 2: - collect_register (regcache, regnum, cnv.u16.bytes); - top = cnv.u16.val; - break; - case 1: - collect_register (regcache, regnum, cnv.u8.bytes); - top = cnv.u8.val; - break; - default: - internal_error (__FILE__, __LINE__, - "unhandled register size"); - } - } - break; - - case gdb_agent_op_end: - trace_debug ("At end of expression, sp=%d, stack top cache=0x%s", - sp, pulongest (top)); - if (rslt) - { - if (sp <= 0) - { - /* This should be an error */ - trace_debug ("Stack is empty, nothing to return"); - return expr_eval_empty_stack; - } - *rslt = top; - } - return expr_eval_no_error; - - case gdb_agent_op_dup: - stack[sp++] = top; - break; - - case gdb_agent_op_pop: - if (--sp >= 0) - top = stack[sp]; - break; - - case gdb_agent_op_pick: - arg = aexpr->bytes[pc++]; - stack[sp] = top; - top = stack[sp - arg]; - ++sp; - break; - - case gdb_agent_op_rot: - { - ULONGEST tem = stack[sp - 1]; - - stack[sp - 1] = stack[sp - 2]; - stack[sp - 2] = top; - top = tem; - } - break; - - case gdb_agent_op_zero_ext: - arg = aexpr->bytes[pc++]; - if (arg < (sizeof (LONGEST) * 8)) - top &= ((LONGEST) 1 << arg) - 1; - break; - - case gdb_agent_op_swap: - /* Interchange top two stack elements, making sure top gets - copied back onto stack. */ - stack[sp] = top; - top = stack[sp - 1]; - stack[sp - 1] = stack[sp]; - break; - - case gdb_agent_op_getv: - /* Flush the cached stack top. */ - stack[sp++] = top; - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - top = get_trace_state_variable_value (arg); - break; - - case gdb_agent_op_setv: - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - set_trace_state_variable_value (arg, top); - /* Note that we leave the value on the stack, for the - benefit of later/enclosing expressions. */ - break; - - case gdb_agent_op_tracev: - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - agent_tsv_read (tframe, arg); - break; - - /* GDB never (currently) generates any of these ops. */ - case gdb_agent_op_float: - case gdb_agent_op_ref_float: - case gdb_agent_op_ref_double: - case gdb_agent_op_ref_long_double: - case gdb_agent_op_l_to_d: - case gdb_agent_op_d_to_l: - case gdb_agent_op_trace16: - trace_debug ("Agent expression op 0x%x valid, but not handled", - op); - /* If ever GDB generates any of these, we don't have the - option of ignoring. */ - return 1; - - default: - trace_debug ("Agent expression op 0x%x not recognized", op); - /* Don't struggle on, things will just get worse. */ - return expr_eval_unrecognized_opcode; - } - - /* Check for stack badness. */ - if (sp >= (STACK_MAX - 1)) - { - trace_debug ("Expression stack overflow"); - return expr_eval_stack_overflow; - } - - if (sp < 0) - { - trace_debug ("Expression stack underflow"); - return expr_eval_stack_underflow; - } - - trace_debug ("Op %s -> sp=%d, top=0x%s", - gdb_agent_op_name (op), sp, pulongest (top)); - } -} - -/* Do memory copies for bytecodes. */ -/* Do the recording of memory blocks for actions and bytecodes. */ - -static int -agent_mem_read (struct traceframe *tframe, - unsigned char *to, CORE_ADDR from, ULONGEST len) -{ - unsigned char *mspace; - ULONGEST remaining = len; - unsigned short blocklen; - - /* If a 'to' buffer is specified, use it. */ - if (to != NULL) - { - read_inferior_memory (from, to, len); - return 0; - } - - /* Otherwise, create a new memory block in the trace buffer. */ - while (remaining > 0) - { - size_t sp; - - blocklen = (remaining > 65535 ? 65535 : remaining); - sp = 1 + sizeof (from) + sizeof (blocklen) + blocklen; - mspace = add_traceframe_block (tframe, sp); - if (mspace == NULL) - return 1; - /* Identify block as a memory block. */ - *mspace = 'M'; - ++mspace; - /* Record address and size. */ - memcpy (mspace, &from, sizeof (from)); - mspace += sizeof (from); - memcpy (mspace, &blocklen, sizeof (blocklen)); - mspace += sizeof (blocklen); - /* Record the memory block proper. */ - read_inferior_memory (from, mspace, blocklen); - trace_debug ("%d bytes recorded", blocklen); - remaining -= blocklen; - from += blocklen; - } - return 0; -} - -/* Record the value of a trace state variable. */ - -static int -agent_tsv_read (struct traceframe *tframe, int n) -{ - unsigned char *vspace; - LONGEST val; - - vspace = add_traceframe_block (tframe, - 1 + sizeof (n) + sizeof (LONGEST)); - if (vspace == NULL) - return 1; - /* Identify block as a variable. */ - *vspace = 'V'; - /* Record variable's number and value. */ - memcpy (vspace + 1, &n, sizeof (n)); - val = get_trace_state_variable_value (n); - memcpy (vspace + 1 + sizeof (n), &val, sizeof (val)); - trace_debug ("Variable %d recorded", n); - return 0; -} - -#ifndef IN_PROCESS_AGENT - -/* Callback for traceframe_walk_blocks, used to find a given block - type in a traceframe. */ - -static int -match_blocktype (char blocktype, unsigned char *dataptr, void *data) -{ - char *wantedp = data; - - if (*wantedp == blocktype) - return 1; - - return 0; -} - -/* Walk over all traceframe blocks of the traceframe buffer starting - at DATABASE, of DATASIZE bytes long, and call CALLBACK for each - block found, passing in DATA unmodified. If CALLBACK returns true, - this returns a pointer to where the block is found. Returns NULL - if no callback call returned true, indicating that all blocks have - been walked. */ - -static unsigned char * -traceframe_walk_blocks (unsigned char *database, unsigned int datasize, - int tfnum, - int (*callback) (char blocktype, - unsigned char *dataptr, - void *data), - void *data) -{ - unsigned char *dataptr; - - if (datasize == 0) - { - trace_debug ("traceframe %d has no data", tfnum); - return NULL; - } - - /* Iterate through a traceframe's blocks, looking for a block of the - requested type. */ - for (dataptr = database; - dataptr < database + datasize; - /* nothing */) - { - char blocktype; - unsigned short mlen; - - if (dataptr == trace_buffer_wrap) - { - /* Adjust to reflect wrapping part of the frame around to - the beginning. */ - datasize = dataptr - database; - dataptr = database = trace_buffer_lo; - } - - blocktype = *dataptr++; - - if ((*callback) (blocktype, dataptr, data)) - return dataptr; - - switch (blocktype) - { - case 'R': - /* Skip over the registers block. */ - dataptr += register_cache_size (); - break; - case 'M': - /* Skip over the memory block. */ - dataptr += sizeof (CORE_ADDR); - memcpy (&mlen, dataptr, sizeof (mlen)); - dataptr += (sizeof (mlen) + mlen); - break; - case 'V': - /* Skip over the TSV block. */ - dataptr += (sizeof (int) + sizeof (LONGEST)); - break; - case 'S': - /* Skip over the static trace data block. */ - memcpy (&mlen, dataptr, sizeof (mlen)); - dataptr += (sizeof (mlen) + mlen); - break; - default: - trace_debug ("traceframe %d has unknown block type 0x%x", - tfnum, blocktype); - return NULL; - } - } - - return NULL; -} - -/* Look for the block of type TYPE_WANTED in the trameframe starting - at DATABASE of DATASIZE bytes long. TFNUM is the traceframe - number. */ - -static unsigned char * -traceframe_find_block_type (unsigned char *database, unsigned int datasize, - int tfnum, char type_wanted) -{ - return traceframe_walk_blocks (database, datasize, tfnum, - match_blocktype, &type_wanted); -} - -static unsigned char * -traceframe_find_regblock (struct traceframe *tframe, int tfnum) -{ - unsigned char *regblock; - - regblock = traceframe_find_block_type (tframe->data, - tframe->data_size, - tfnum, 'R'); - - if (regblock == NULL) - trace_debug ("traceframe %d has no register data", tfnum); - - return regblock; -} - -/* Get registers from a traceframe. */ - -int -fetch_traceframe_registers (int tfnum, struct regcache *regcache, int regnum) -{ - unsigned char *dataptr; - struct tracepoint *tpoint; - struct traceframe *tframe; - - tframe = find_traceframe (tfnum); - - if (tframe == NULL) - { - trace_debug ("traceframe %d not found", tfnum); - return 1; - } - - dataptr = traceframe_find_regblock (tframe, tfnum); - if (dataptr == NULL) - { - /* Mark registers unavailable. */ - supply_regblock (regcache, NULL); - - /* We can generally guess at a PC, although this will be - misleading for while-stepping frames and multi-location - tracepoints. */ - tpoint = find_next_tracepoint_by_number (NULL, tframe->tpnum); - if (tpoint != NULL) - regcache_write_pc (regcache, tpoint->address); - } - else - supply_regblock (regcache, dataptr); - - return 0; -} - -static CORE_ADDR -traceframe_get_pc (struct traceframe *tframe) -{ - struct regcache regcache; - unsigned char *dataptr; - - dataptr = traceframe_find_regblock (tframe, -1); - if (dataptr == NULL) - return 0; - - init_register_cache (®cache, dataptr); - return regcache_read_pc (®cache); -} - -/* Read a requested block of memory from a trace frame. */ - -int -traceframe_read_mem (int tfnum, CORE_ADDR addr, - unsigned char *buf, ULONGEST length, - ULONGEST *nbytes) -{ - struct traceframe *tframe; - unsigned char *database, *dataptr; - unsigned int datasize; - CORE_ADDR maddr; - unsigned short mlen; - - trace_debug ("traceframe_read_mem"); - - tframe = find_traceframe (tfnum); - - if (!tframe) - { - trace_debug ("traceframe %d not found", tfnum); - return 1; - } - - datasize = tframe->data_size; - database = dataptr = &tframe->data[0]; - - /* Iterate through a traceframe's blocks, looking for memory. */ - while ((dataptr = traceframe_find_block_type (dataptr, - datasize - - (dataptr - database), - tfnum, 'M')) != NULL) - { - memcpy (&maddr, dataptr, sizeof (maddr)); - dataptr += sizeof (maddr); - memcpy (&mlen, dataptr, sizeof (mlen)); - dataptr += sizeof (mlen); - trace_debug ("traceframe %d has %d bytes at %s", - tfnum, mlen, paddress (maddr)); - - /* If the block includes the first part of the desired range, - return as much it has; GDB will re-request the remainder, - which might be in a different block of this trace frame. */ - if (maddr <= addr && addr < (maddr + mlen)) - { - ULONGEST amt = (maddr + mlen) - addr; - if (amt > length) - amt = length; - - memcpy (buf, dataptr + (addr - maddr), amt); - *nbytes = amt; - return 0; - } - - /* Skip over this block. */ - dataptr += mlen; - } - - trace_debug ("traceframe %d has no memory data for the desired region", - tfnum); - - *nbytes = 0; - return 0; -} - -static int -traceframe_read_tsv (int tsvnum, LONGEST *val) -{ - int tfnum; - struct traceframe *tframe; - unsigned char *database, *dataptr; - unsigned int datasize; - int vnum; - - trace_debug ("traceframe_read_tsv"); - - tfnum = current_traceframe; - - if (tfnum < 0) - { - trace_debug ("no current traceframe"); - return 1; - } - - tframe = find_traceframe (tfnum); - - if (tframe == NULL) - { - trace_debug ("traceframe %d not found", tfnum); - return 1; - } - - datasize = tframe->data_size; - database = dataptr = &tframe->data[0]; - - /* Iterate through a traceframe's blocks, looking for the tsv. */ - while ((dataptr = traceframe_find_block_type (dataptr, - datasize - - (dataptr - database), - tfnum, 'V')) != NULL) - { - memcpy (&vnum, dataptr, sizeof (vnum)); - dataptr += sizeof (vnum); - - trace_debug ("traceframe %d has variable %d", tfnum, vnum); - - /* Check that this is the variable we want. */ - if (tsvnum == vnum) - { - memcpy (val, dataptr, sizeof (*val)); - return 0; - } - - /* Skip over this block. */ - dataptr += sizeof (LONGEST); - } - - trace_debug ("traceframe %d has no data for variable %d", - tfnum, tsvnum); - return 1; -} - -/* Read a requested block of static tracepoint data from a trace - frame. */ - -int -traceframe_read_sdata (int tfnum, ULONGEST offset, - unsigned char *buf, ULONGEST length, - ULONGEST *nbytes) -{ - struct traceframe *tframe; - unsigned char *database, *dataptr; - unsigned int datasize; - unsigned short mlen; - - trace_debug ("traceframe_read_sdata"); - - tframe = find_traceframe (tfnum); - - if (!tframe) - { - trace_debug ("traceframe %d not found", tfnum); - return 1; - } - - datasize = tframe->data_size; - database = &tframe->data[0]; - - /* Iterate through a traceframe's blocks, looking for static - tracepoint data. */ - dataptr = traceframe_find_block_type (database, datasize, - tfnum, 'S'); - if (dataptr != NULL) - { - memcpy (&mlen, dataptr, sizeof (mlen)); - dataptr += sizeof (mlen); - if (offset < mlen) - { - if (offset + length > mlen) - length = mlen - offset; - - memcpy (buf, dataptr, length); - *nbytes = length; - } - else - *nbytes = 0; - return 0; - } - - trace_debug ("traceframe %d has no static trace data", tfnum); - - *nbytes = 0; - return 0; -} - -/* Callback for traceframe_walk_blocks. Builds a traceframe-info - object. DATA is pointer to a struct buffer holding the - traceframe-info object being built. */ - -static int -build_traceframe_info_xml (char blocktype, unsigned char *dataptr, void *data) -{ - struct buffer *buffer = data; - - switch (blocktype) - { - case 'M': - { - unsigned short mlen; - CORE_ADDR maddr; - - memcpy (&maddr, dataptr, sizeof (maddr)); - dataptr += sizeof (maddr); - memcpy (&mlen, dataptr, sizeof (mlen)); - dataptr += sizeof (mlen); - buffer_xml_printf (buffer, - "<memory start=\"0x%s\" length=\"0x%s\"/>\n", - paddress (maddr), phex_nz (mlen, sizeof (mlen))); - break; - } - case 'V': - case 'R': - case 'S': - { - break; - } - default: - warning ("Unhandled trace block type (%d) '%c ' " - "while building trace frame info.", - blocktype, blocktype); - break; - } - - return 0; -} - -/* Build a traceframe-info object for traceframe number TFNUM into - BUFFER. */ - -int -traceframe_read_info (int tfnum, struct buffer *buffer) -{ - struct traceframe *tframe; - - trace_debug ("traceframe_read_info"); - - tframe = find_traceframe (tfnum); - - if (!tframe) - { - trace_debug ("traceframe %d not found", tfnum); - return 1; - } - - buffer_grow_str (buffer, "<traceframe-info>\n"); - traceframe_walk_blocks (tframe->data, tframe->data_size, - tfnum, build_traceframe_info_xml, buffer); - buffer_grow_str0 (buffer, "</traceframe-info>\n"); - return 0; -} - -/* Return the first fast tracepoint whose jump pad contains PC. */ - -static struct tracepoint * -fast_tracepoint_from_jump_pad_address (CORE_ADDR pc) -{ - struct tracepoint *tpoint; - - for (tpoint = tracepoints; tpoint; tpoint = tpoint->next) - if (tpoint->type == fast_tracepoint) - if (tpoint->jump_pad <= pc && pc < tpoint->jump_pad_end) - return tpoint; - - return NULL; -} - -/* Return GDBserver's tracepoint that matches the IP Agent's - tracepoint object that lives at IPA_TPOINT_OBJ in the IP Agent's - address space. */ - -static struct tracepoint * -fast_tracepoint_from_ipa_tpoint_address (CORE_ADDR ipa_tpoint_obj) -{ - struct tracepoint *tpoint; - - for (tpoint = tracepoints; tpoint; tpoint = tpoint->next) - if (tpoint->type == fast_tracepoint) - if (tpoint->obj_addr_on_target == ipa_tpoint_obj) - return tpoint; - - return NULL; -} - -#endif - -/* The type of the object that is used to synchronize fast tracepoint - collection. */ - -typedef struct collecting_t -{ - /* The fast tracepoint number currently collecting. */ - uintptr_t tpoint; - - /* A number that GDBserver can use to identify the thread that is - presently holding the collect lock. This need not (and usually - is not) the thread id, as getting the current thread ID usually - requires a system call, which we want to avoid like the plague. - Usually this is thread's TCB, found in the TLS (pseudo-) - register, which is readable with a single insn on several - architectures. */ - uintptr_t thread_area; -} collecting_t; - -#ifndef IN_PROCESS_AGENT - -void -force_unlock_trace_buffer (void) -{ - write_inferior_data_pointer (ipa_sym_addrs.addr_collecting, 0); -} - -/* Check if the thread identified by THREAD_AREA which is stopped at - STOP_PC, is presently locking the fast tracepoint collection, and - if so, gather some status of said collection. Returns 0 if the - thread isn't collecting or in the jump pad at all. 1, if in the - jump pad (or within gdb_collect) and hasn't executed the adjusted - original insn yet (can set a breakpoint there and run to it). 2, - if presently executing the adjusted original insn --- in which - case, if we want to move the thread out of the jump pad, we need to - single-step it until this function returns 0. */ - -int -fast_tracepoint_collecting (CORE_ADDR thread_area, - CORE_ADDR stop_pc, - struct fast_tpoint_collect_status *status) -{ - CORE_ADDR ipa_collecting; - CORE_ADDR ipa_gdb_jump_pad_buffer, ipa_gdb_jump_pad_buffer_end; - struct tracepoint *tpoint; - int needs_breakpoint; - - /* The thread THREAD_AREA is either: - - 0. not collecting at all, not within the jump pad, or within - gdb_collect or one of its callees. - - 1. in the jump pad and haven't reached gdb_collect - - 2. within gdb_collect (out of the jump pad) (collect is set) - - 3. we're in the jump pad, after gdb_collect having returned, - possibly executing the adjusted insns. - - For cases 1 and 3, `collecting' may or not be set. The jump pad - doesn't have any complicated jump logic, so we can tell if the - thread is executing the adjust original insn or not by just - matching STOP_PC with known jump pad addresses. If we it isn't - yet executing the original insn, set a breakpoint there, and let - the thread run to it, so to quickly step over a possible (many - insns) gdb_collect call. Otherwise, or when the breakpoint is - hit, only a few (small number of) insns are left to be executed - in the jump pad. Single-step the thread until it leaves the - jump pad. */ - - again: - tpoint = NULL; - needs_breakpoint = 0; - trace_debug ("fast_tracepoint_collecting"); - - if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_jump_pad_buffer, - &ipa_gdb_jump_pad_buffer)) - fatal ("error extracting `gdb_jump_pad_buffer'"); - if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_jump_pad_buffer_end, - &ipa_gdb_jump_pad_buffer_end)) - fatal ("error extracting `gdb_jump_pad_buffer_end'"); - - if (ipa_gdb_jump_pad_buffer <= stop_pc - && stop_pc < ipa_gdb_jump_pad_buffer_end) - { - /* We can tell which tracepoint(s) the thread is collecting by - matching the jump pad address back to the tracepoint. */ - tpoint = fast_tracepoint_from_jump_pad_address (stop_pc); - if (tpoint == NULL) - { - warning ("in jump pad, but no matching tpoint?"); - return 0; - } - else - { - trace_debug ("in jump pad of tpoint (%d, %s); jump_pad(%s, %s); " - "adj_insn(%s, %s)", - tpoint->number, paddress (tpoint->address), - paddress (tpoint->jump_pad), - paddress (tpoint->jump_pad_end), - paddress (tpoint->adjusted_insn_addr), - paddress (tpoint->adjusted_insn_addr_end)); - } - - /* Definitely in the jump pad. May or may not need - fast-exit-jump-pad breakpoint. */ - if (tpoint->jump_pad <= stop_pc - && stop_pc < tpoint->adjusted_insn_addr) - needs_breakpoint = 1; - } - else - { - collecting_t ipa_collecting_obj; - - /* If `collecting' is set/locked, then the THREAD_AREA thread - may or not be the one holding the lock. We have to read the - lock to find out. */ - - if (read_inferior_data_pointer (ipa_sym_addrs.addr_collecting, - &ipa_collecting)) - { - trace_debug ("fast_tracepoint_collecting:" - " failed reading 'collecting' in the inferior"); - return 0; - } - - if (!ipa_collecting) - { - trace_debug ("fast_tracepoint_collecting: not collecting" - " (and nobody is)."); - return 0; - } - - /* Some thread is collecting. Check which. */ - if (read_inferior_memory (ipa_collecting, - (unsigned char *) &ipa_collecting_obj, - sizeof (ipa_collecting_obj)) != 0) - goto again; - - if (ipa_collecting_obj.thread_area != thread_area) - { - trace_debug ("fast_tracepoint_collecting: not collecting " - "(another thread is)"); - return 0; - } - - tpoint - = fast_tracepoint_from_ipa_tpoint_address (ipa_collecting_obj.tpoint); - if (tpoint == NULL) - { - warning ("fast_tracepoint_collecting: collecting, " - "but tpoint %s not found?", - paddress ((CORE_ADDR) ipa_collecting_obj.tpoint)); - return 0; - } - - /* The thread is within `gdb_collect', skip over the rest of - fast tracepoint collection quickly using a breakpoint. */ - needs_breakpoint = 1; - } - - /* The caller wants a bit of status detail. */ - if (status != NULL) - { - status->tpoint_num = tpoint->number; - status->tpoint_addr = tpoint->address; - status->adjusted_insn_addr = tpoint->adjusted_insn_addr; - status->adjusted_insn_addr_end = tpoint->adjusted_insn_addr_end; - } - - if (needs_breakpoint) - { - /* Hasn't executed the original instruction yet. Set breakpoint - there, and wait till it's hit, then single-step until exiting - the jump pad. */ - - trace_debug ("\ -fast_tracepoint_collecting, returning continue-until-break at %s", - paddress (tpoint->adjusted_insn_addr)); - - return 1; /* continue */ - } - else - { - /* Just single-step until exiting the jump pad. */ - - trace_debug ("fast_tracepoint_collecting, returning " - "need-single-step (%s-%s)", - paddress (tpoint->adjusted_insn_addr), - paddress (tpoint->adjusted_insn_addr_end)); - - return 2; /* single-step */ - } -} - -#endif - -#ifdef IN_PROCESS_AGENT - -/* The global fast tracepoint collect lock. Points to a collecting_t - object built on the stack by the jump pad, if presently locked; - NULL if it isn't locked. Note that this lock *must* be set while - executing any *function other than the jump pad. See - fast_tracepoint_collecting. */ -static collecting_t * ATTR_USED collecting; - -/* This routine, called from the jump pad (in asm) is designed to be - called from the jump pads of fast tracepoints, thus it is on the - critical path. */ - -IP_AGENT_EXPORT void ATTR_USED -gdb_collect (struct tracepoint *tpoint, unsigned char *regs) -{ - struct fast_tracepoint_ctx ctx; - - /* Don't do anything until the trace run is completely set up. */ - if (!tracing) - return; - - if (!tpoint->enabled) - return; - - ctx.base.type = fast_tracepoint; - ctx.regs = regs; - ctx.regcache_initted = 0; - ctx.tpoint = tpoint; - - /* Wrap the regblock in a register cache (in the stack, we don't - want to malloc here). */ - ctx.regspace = alloca (register_cache_size ()); - if (ctx.regspace == NULL) - { - trace_debug ("Trace buffer block allocation failed, skipping"); - return; - } - - /* Test the condition if present, and collect if true. */ - if (tpoint->cond == NULL - || condition_true_at_tracepoint ((struct tracepoint_hit_ctx *) &ctx, - tpoint)) - { - collect_data_at_tracepoint ((struct tracepoint_hit_ctx *) &ctx, - tpoint->address, tpoint); - - /* Note that this will cause original insns to be written back - to where we jumped from, but that's OK because we're jumping - back to the next whole instruction. This will go badly if - instruction restoration is not atomic though. */ - if (stopping_tracepoint - || trace_buffer_is_full - || expr_eval_result != expr_eval_no_error) - stop_tracing (); - } - else - { - /* If there was a condition and it evaluated to false, the only - way we would stop tracing is if there was an error during - condition expression evaluation. */ - if (expr_eval_result != expr_eval_no_error) - stop_tracing (); - } -} - -#endif - -#ifndef IN_PROCESS_AGENT - -/* Bytecode compilation. */ - -CORE_ADDR current_insn_ptr; - -int emit_error; - -struct bytecode_address -{ - int pc; - CORE_ADDR address; - int goto_pc; - /* Offset and size of field to be modified in the goto block. */ - int from_offset, from_size; - struct bytecode_address *next; -} *bytecode_address_table; - -CORE_ADDR -get_raw_reg_func_addr (void) -{ - return ipa_sym_addrs.addr_get_raw_reg; -} - -static void -emit_prologue (void) -{ - target_emit_ops ()->emit_prologue (); -} - -static void -emit_epilogue (void) -{ - target_emit_ops ()->emit_epilogue (); -} - -static void -emit_add (void) -{ - target_emit_ops ()->emit_add (); -} - -static void -emit_sub (void) -{ - target_emit_ops ()->emit_sub (); -} - -static void -emit_mul (void) -{ - target_emit_ops ()->emit_mul (); -} - -static void -emit_lsh (void) -{ - target_emit_ops ()->emit_lsh (); -} - -static void -emit_rsh_signed (void) -{ - target_emit_ops ()->emit_rsh_signed (); -} - -static void -emit_rsh_unsigned (void) -{ - target_emit_ops ()->emit_rsh_unsigned (); -} - -static void -emit_ext (int arg) -{ - target_emit_ops ()->emit_ext (arg); -} - -static void -emit_log_not (void) -{ - target_emit_ops ()->emit_log_not (); -} - -static void -emit_bit_and (void) -{ - target_emit_ops ()->emit_bit_and (); -} - -static void -emit_bit_or (void) -{ - target_emit_ops ()->emit_bit_or (); -} - -static void -emit_bit_xor (void) -{ - target_emit_ops ()->emit_bit_xor (); -} - -static void -emit_bit_not (void) -{ - target_emit_ops ()->emit_bit_not (); -} - -static void -emit_equal (void) -{ - target_emit_ops ()->emit_equal (); -} - -static void -emit_less_signed (void) -{ - target_emit_ops ()->emit_less_signed (); -} - -static void -emit_less_unsigned (void) -{ - target_emit_ops ()->emit_less_unsigned (); -} - -static void -emit_ref (int size) -{ - target_emit_ops ()->emit_ref (size); -} - -static void -emit_if_goto (int *offset_p, int *size_p) -{ - target_emit_ops ()->emit_if_goto (offset_p, size_p); -} - -static void -emit_goto (int *offset_p, int *size_p) -{ - target_emit_ops ()->emit_goto (offset_p, size_p); -} - -static void -write_goto_address (CORE_ADDR from, CORE_ADDR to, int size) -{ - target_emit_ops ()->write_goto_address (from, to, size); -} - -static void -emit_const (LONGEST num) -{ - target_emit_ops ()->emit_const (num); -} - -static void -emit_reg (int reg) -{ - target_emit_ops ()->emit_reg (reg); -} - -static void -emit_pop (void) -{ - target_emit_ops ()->emit_pop (); -} - -static void -emit_stack_flush (void) -{ - target_emit_ops ()->emit_stack_flush (); -} - -static void -emit_zero_ext (int arg) -{ - target_emit_ops ()->emit_zero_ext (arg); -} - -static void -emit_swap (void) -{ - target_emit_ops ()->emit_swap (); -} - -static void -emit_stack_adjust (int n) -{ - target_emit_ops ()->emit_stack_adjust (n); -} - -/* FN's prototype is `LONGEST(*fn)(int)'. */ - -static void -emit_int_call_1 (CORE_ADDR fn, int arg1) -{ - target_emit_ops ()->emit_int_call_1 (fn, arg1); -} - -/* FN's prototype is `void(*fn)(int,LONGEST)'. */ - -static void -emit_void_call_2 (CORE_ADDR fn, int arg1) -{ - target_emit_ops ()->emit_void_call_2 (fn, arg1); -} - -static void -emit_eq_goto (int *offset_p, int *size_p) -{ - target_emit_ops ()->emit_eq_goto (offset_p, size_p); -} - -static void -emit_ne_goto (int *offset_p, int *size_p) -{ - target_emit_ops ()->emit_ne_goto (offset_p, size_p); -} - -static void -emit_lt_goto (int *offset_p, int *size_p) -{ - target_emit_ops ()->emit_lt_goto (offset_p, size_p); -} - -static void -emit_ge_goto (int *offset_p, int *size_p) -{ - target_emit_ops ()->emit_ge_goto (offset_p, size_p); -} - -static void -emit_gt_goto (int *offset_p, int *size_p) -{ - target_emit_ops ()->emit_gt_goto (offset_p, size_p); -} - -static void -emit_le_goto (int *offset_p, int *size_p) -{ - target_emit_ops ()->emit_le_goto (offset_p, size_p); -} - -static enum eval_result_type compile_bytecodes (struct agent_expr *aexpr); - -static void -compile_tracepoint_condition (struct tracepoint *tpoint, - CORE_ADDR *jump_entry) -{ - CORE_ADDR entry_point = *jump_entry; - enum eval_result_type err; - - trace_debug ("Starting condition compilation for tracepoint %d\n", - tpoint->number); - - /* Initialize the global pointer to the code being built. */ - current_insn_ptr = *jump_entry; - - emit_prologue (); - - err = compile_bytecodes (tpoint->cond); - - if (err == expr_eval_no_error) - { - emit_epilogue (); - - /* Record the beginning of the compiled code. */ - tpoint->compiled_cond = entry_point; - - trace_debug ("Condition compilation for tracepoint %d complete\n", - tpoint->number); - } - else - { - /* Leave the unfinished code in situ, but don't point to it. */ - - tpoint->compiled_cond = 0; - - trace_debug ("Condition compilation for tracepoint %d failed, " - "error code %d", - tpoint->number, err); - } - - /* Update the code pointer passed in. Note that we do this even if - the compile fails, so that we can look at the partial results - instead of letting them be overwritten. */ - *jump_entry = current_insn_ptr; - - /* Leave a gap, to aid dump decipherment. */ - *jump_entry += 16; -} - -/* Scan an agent expression for any evidence that the given PC is the - target of a jump bytecode in the expression. */ - -int -is_goto_target (struct agent_expr *aexpr, int pc) -{ - int i; - unsigned char op; - - for (i = 0; i < aexpr->length; i += 1 + gdb_agent_op_sizes[op]) - { - op = aexpr->bytes[i]; - - if (op == gdb_agent_op_goto || op == gdb_agent_op_if_goto) - { - int target = (aexpr->bytes[i + 1] << 8) + aexpr->bytes[i + 2]; - if (target == pc) - return 1; - } - } - - return 0; -} - -/* Given an agent expression, turn it into native code. */ - -static enum eval_result_type -compile_bytecodes (struct agent_expr *aexpr) -{ - int pc = 0; - int done = 0; - unsigned char op, next_op; - int arg; - /* This is only used to build 64-bit value for constants. */ - ULONGEST top; - struct bytecode_address *aentry, *aentry2; - -#define UNHANDLED \ - do \ - { \ - trace_debug ("Cannot compile op 0x%x\n", op); \ - return expr_eval_unhandled_opcode; \ - } while (0) - - if (aexpr->length == 0) - { - trace_debug ("empty agent expression\n"); - return expr_eval_empty_expression; - } - - bytecode_address_table = NULL; - - while (!done) - { - op = aexpr->bytes[pc]; - - trace_debug ("About to compile op 0x%x, pc=%d\n", op, pc); - - /* Record the compiled-code address of the bytecode, for use by - jump instructions. */ - aentry = xmalloc (sizeof (struct bytecode_address)); - aentry->pc = pc; - aentry->address = current_insn_ptr; - aentry->goto_pc = -1; - aentry->from_offset = aentry->from_size = 0; - aentry->next = bytecode_address_table; - bytecode_address_table = aentry; - - ++pc; - - emit_error = 0; - - switch (op) - { - case gdb_agent_op_add: - emit_add (); - break; - - case gdb_agent_op_sub: - emit_sub (); - break; - - case gdb_agent_op_mul: - emit_mul (); - break; - - case gdb_agent_op_div_signed: - UNHANDLED; - break; - - case gdb_agent_op_div_unsigned: - UNHANDLED; - break; - - case gdb_agent_op_rem_signed: - UNHANDLED; - break; - - case gdb_agent_op_rem_unsigned: - UNHANDLED; - break; - - case gdb_agent_op_lsh: - emit_lsh (); - break; - - case gdb_agent_op_rsh_signed: - emit_rsh_signed (); - break; - - case gdb_agent_op_rsh_unsigned: - emit_rsh_unsigned (); - break; - - case gdb_agent_op_trace: - UNHANDLED; - break; - - case gdb_agent_op_trace_quick: - UNHANDLED; - break; - - case gdb_agent_op_log_not: - emit_log_not (); - break; - - case gdb_agent_op_bit_and: - emit_bit_and (); - break; - - case gdb_agent_op_bit_or: - emit_bit_or (); - break; - - case gdb_agent_op_bit_xor: - emit_bit_xor (); - break; - - case gdb_agent_op_bit_not: - emit_bit_not (); - break; - - case gdb_agent_op_equal: - next_op = aexpr->bytes[pc]; - if (next_op == gdb_agent_op_if_goto - && !is_goto_target (aexpr, pc) - && target_emit_ops ()->emit_eq_goto) - { - trace_debug ("Combining equal & if_goto"); - pc += 1; - aentry->pc = pc; - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - aentry->goto_pc = arg; - emit_eq_goto (&(aentry->from_offset), &(aentry->from_size)); - } - else if (next_op == gdb_agent_op_log_not - && (aexpr->bytes[pc + 1] == gdb_agent_op_if_goto) - && !is_goto_target (aexpr, pc + 1) - && target_emit_ops ()->emit_ne_goto) - { - trace_debug ("Combining equal & log_not & if_goto"); - pc += 2; - aentry->pc = pc; - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - aentry->goto_pc = arg; - emit_ne_goto (&(aentry->from_offset), &(aentry->from_size)); - } - else - emit_equal (); - break; - - case gdb_agent_op_less_signed: - next_op = aexpr->bytes[pc]; - if (next_op == gdb_agent_op_if_goto - && !is_goto_target (aexpr, pc)) - { - trace_debug ("Combining less_signed & if_goto"); - pc += 1; - aentry->pc = pc; - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - aentry->goto_pc = arg; - emit_lt_goto (&(aentry->from_offset), &(aentry->from_size)); - } - else if (next_op == gdb_agent_op_log_not - && !is_goto_target (aexpr, pc) - && (aexpr->bytes[pc + 1] == gdb_agent_op_if_goto) - && !is_goto_target (aexpr, pc + 1)) - { - trace_debug ("Combining less_signed & log_not & if_goto"); - pc += 2; - aentry->pc = pc; - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - aentry->goto_pc = arg; - emit_ge_goto (&(aentry->from_offset), &(aentry->from_size)); - } - else - emit_less_signed (); - break; - - case gdb_agent_op_less_unsigned: - emit_less_unsigned (); - break; - - case gdb_agent_op_ext: - arg = aexpr->bytes[pc++]; - if (arg < (sizeof (LONGEST) * 8)) - emit_ext (arg); - break; - - case gdb_agent_op_ref8: - emit_ref (1); - break; - - case gdb_agent_op_ref16: - emit_ref (2); - break; - - case gdb_agent_op_ref32: - emit_ref (4); - break; - - case gdb_agent_op_ref64: - emit_ref (8); - break; - - case gdb_agent_op_if_goto: - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - aentry->goto_pc = arg; - emit_if_goto (&(aentry->from_offset), &(aentry->from_size)); - break; - - case gdb_agent_op_goto: - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - aentry->goto_pc = arg; - emit_goto (&(aentry->from_offset), &(aentry->from_size)); - break; - - case gdb_agent_op_const8: - emit_stack_flush (); - top = aexpr->bytes[pc++]; - emit_const (top); - break; - - case gdb_agent_op_const16: - emit_stack_flush (); - top = aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - emit_const (top); - break; - - case gdb_agent_op_const32: - emit_stack_flush (); - top = aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - emit_const (top); - break; - - case gdb_agent_op_const64: - emit_stack_flush (); - top = aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - top = (top << 8) + aexpr->bytes[pc++]; - emit_const (top); - break; - - case gdb_agent_op_reg: - emit_stack_flush (); - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - emit_reg (arg); - break; - - case gdb_agent_op_end: - trace_debug ("At end of expression\n"); - - /* Assume there is one stack element left, and that it is - cached in "top" where emit_epilogue can get to it. */ - emit_stack_adjust (1); - - done = 1; - break; - - case gdb_agent_op_dup: - /* In our design, dup is equivalent to stack flushing. */ - emit_stack_flush (); - break; - - case gdb_agent_op_pop: - emit_pop (); - break; - - case gdb_agent_op_zero_ext: - arg = aexpr->bytes[pc++]; - if (arg < (sizeof (LONGEST) * 8)) - emit_zero_ext (arg); - break; - - case gdb_agent_op_swap: - next_op = aexpr->bytes[pc]; - /* Detect greater-than comparison sequences. */ - if (next_op == gdb_agent_op_less_signed - && !is_goto_target (aexpr, pc) - && (aexpr->bytes[pc + 1] == gdb_agent_op_if_goto) - && !is_goto_target (aexpr, pc + 1)) - { - trace_debug ("Combining swap & less_signed & if_goto"); - pc += 2; - aentry->pc = pc; - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - aentry->goto_pc = arg; - emit_gt_goto (&(aentry->from_offset), &(aentry->from_size)); - } - else if (next_op == gdb_agent_op_less_signed - && !is_goto_target (aexpr, pc) - && (aexpr->bytes[pc + 1] == gdb_agent_op_log_not) - && !is_goto_target (aexpr, pc + 1) - && (aexpr->bytes[pc + 2] == gdb_agent_op_if_goto) - && !is_goto_target (aexpr, pc + 2)) - { - trace_debug ("Combining swap & less_signed & log_not & if_goto"); - pc += 3; - aentry->pc = pc; - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - aentry->goto_pc = arg; - emit_le_goto (&(aentry->from_offset), &(aentry->from_size)); - } - else - emit_swap (); - break; - - case gdb_agent_op_getv: - emit_stack_flush (); - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - emit_int_call_1 (ipa_sym_addrs.addr_get_trace_state_variable_value, - arg); - break; - - case gdb_agent_op_setv: - arg = aexpr->bytes[pc++]; - arg = (arg << 8) + aexpr->bytes[pc++]; - emit_void_call_2 (ipa_sym_addrs.addr_set_trace_state_variable_value, - arg); - break; - - case gdb_agent_op_tracev: - UNHANDLED; - break; - - /* GDB never (currently) generates any of these ops. */ - case gdb_agent_op_float: - case gdb_agent_op_ref_float: - case gdb_agent_op_ref_double: - case gdb_agent_op_ref_long_double: - case gdb_agent_op_l_to_d: - case gdb_agent_op_d_to_l: - case gdb_agent_op_trace16: - UNHANDLED; - break; - - default: - trace_debug ("Agent expression op 0x%x not recognized\n", op); - /* Don't struggle on, things will just get worse. */ - return expr_eval_unrecognized_opcode; - } - - /* This catches errors that occur in target-specific code - emission. */ - if (emit_error) - { - trace_debug ("Error %d while emitting code for %s\n", - emit_error, gdb_agent_op_name (op)); - return expr_eval_unhandled_opcode; - } - - trace_debug ("Op %s compiled\n", gdb_agent_op_name (op)); - } - - /* Now fill in real addresses as goto destinations. */ - for (aentry = bytecode_address_table; aentry; aentry = aentry->next) - { - int written = 0; - - if (aentry->goto_pc < 0) - continue; - - /* Find the location that we are going to, and call back into - target-specific code to write the actual address or - displacement. */ - for (aentry2 = bytecode_address_table; aentry2; aentry2 = aentry2->next) - { - if (aentry2->pc == aentry->goto_pc) - { - trace_debug ("Want to jump from %s to %s\n", - paddress (aentry->address), - paddress (aentry2->address)); - write_goto_address (aentry->address + aentry->from_offset, - aentry2->address, aentry->from_size); - written = 1; - break; - } - } - - /* Error out if we didn't find a destination. */ - if (!written) - { - trace_debug ("Destination of goto %d not found\n", - aentry->goto_pc); - return expr_eval_invalid_goto; - } - } - - return expr_eval_no_error; -} - -/* We'll need to adjust these when we consider bi-arch setups, and big - endian machines. */ - -static int -write_inferior_data_ptr (CORE_ADDR where, CORE_ADDR ptr) -{ - return write_inferior_memory (where, - (unsigned char *) &ptr, sizeof (void *)); -} - -/* The base pointer of the IPA's heap. This is the only memory the - IPA is allowed to use. The IPA should _not_ call the inferior's - `malloc' during operation. That'd be slow, and, most importantly, - it may not be safe. We may be collecting a tracepoint in a signal - handler, for example. */ -static CORE_ADDR target_tp_heap; - -/* Allocate at least SIZE bytes of memory from the IPA heap, aligned - to 8 bytes. */ - -static CORE_ADDR -target_malloc (ULONGEST size) -{ - CORE_ADDR ptr; - - if (target_tp_heap == 0) - { - /* We have the pointer *address*, need what it points to. */ - if (read_inferior_data_pointer (ipa_sym_addrs.addr_gdb_tp_heap_buffer, - &target_tp_heap)) - fatal ("could get target heap head pointer"); - } - - ptr = target_tp_heap; - target_tp_heap += size; - - /* Pad to 8-byte alignment. */ - target_tp_heap = ((target_tp_heap + 7) & ~0x7); - - return ptr; -} - -static CORE_ADDR -download_agent_expr (struct agent_expr *expr) -{ - CORE_ADDR expr_addr; - CORE_ADDR expr_bytes; - - expr_addr = target_malloc (sizeof (*expr)); - write_inferior_memory (expr_addr, (unsigned char *) expr, sizeof (*expr)); - - expr_bytes = target_malloc (expr->length); - write_inferior_data_ptr (expr_addr + offsetof (struct agent_expr, bytes), - expr_bytes); - write_inferior_memory (expr_bytes, expr->bytes, expr->length); - - return expr_addr; -} - -/* Align V up to N bits. */ -#define UALIGN(V, N) (((V) + ((N) - 1)) & ~((N) - 1)) - -static void -download_tracepoints (void) -{ - CORE_ADDR tpptr = 0, prev_tpptr = 0; - struct tracepoint *tpoint; - - /* Start out empty. */ - write_inferior_data_ptr (ipa_sym_addrs.addr_tracepoints, 0); - - for (tpoint = tracepoints; tpoint; tpoint = tpoint->next) - { - struct tracepoint target_tracepoint; - - if (tpoint->type != fast_tracepoint - && tpoint->type != static_tracepoint) - continue; - - /* Maybe download a compiled condition. */ - if (tpoint->cond != NULL && target_emit_ops () != NULL) - { - CORE_ADDR jentry, jump_entry; - - jentry = jump_entry = get_jump_space_head (); - - if (tpoint->cond != NULL) - { - /* Pad to 8-byte alignment. (needed?) */ - /* Actually this should be left for the target to - decide. */ - jentry = UALIGN (jentry, 8); - - compile_tracepoint_condition (tpoint, &jentry); - } - - /* Pad to 8-byte alignment. */ - jentry = UALIGN (jentry, 8); - claim_jump_space (jentry - jump_entry); - } - - target_tracepoint = *tpoint; - - prev_tpptr = tpptr; - tpptr = target_malloc (sizeof (*tpoint)); - tpoint->obj_addr_on_target = tpptr; - - if (tpoint == tracepoints) - { - /* First object in list, set the head pointer in the - inferior. */ - write_inferior_data_ptr (ipa_sym_addrs.addr_tracepoints, tpptr); - } - else - { - write_inferior_data_ptr (prev_tpptr + offsetof (struct tracepoint, - next), - tpptr); - } - - /* Write the whole object. We'll fix up its pointers in a bit. - Assume no next for now. This is fixed up above on the next - iteration, if there's any. */ - target_tracepoint.next = NULL; - /* Need to clear this here too, since we're downloading the - tracepoints before clearing our own copy. */ - target_tracepoint.hit_count = 0; - - write_inferior_memory (tpptr, (unsigned char *) &target_tracepoint, - sizeof (target_tracepoint)); - - if (tpoint->cond) - write_inferior_data_ptr (tpptr + offsetof (struct tracepoint, - cond), - download_agent_expr (tpoint->cond)); - - if (tpoint->numactions) - { - int i; - CORE_ADDR actions_array; - - /* The pointers array. */ - actions_array - = target_malloc (sizeof (*tpoint->actions) * tpoint->numactions); - write_inferior_data_ptr (tpptr + offsetof (struct tracepoint, - actions), - actions_array); - - /* Now for each pointer, download the action. */ - for (i = 0; i < tpoint->numactions; i++) - { - CORE_ADDR ipa_action = 0; - struct tracepoint_action *action = tpoint->actions[i]; - - switch (action->type) - { - case 'M': - ipa_action - = target_malloc (sizeof (struct collect_memory_action)); - write_inferior_memory (ipa_action, - (unsigned char *) action, - sizeof (struct collect_memory_action)); - break; - case 'R': - ipa_action - = target_malloc (sizeof (struct collect_registers_action)); - write_inferior_memory (ipa_action, - (unsigned char *) action, - sizeof (struct collect_registers_action)); - break; - case 'X': - { - CORE_ADDR expr; - struct eval_expr_action *eaction - = (struct eval_expr_action *) action; - - ipa_action = target_malloc (sizeof (*eaction)); - write_inferior_memory (ipa_action, - (unsigned char *) eaction, - sizeof (*eaction)); - - expr = download_agent_expr (eaction->expr); - write_inferior_data_ptr - (ipa_action + offsetof (struct eval_expr_action, expr), - expr); - break; - } - case 'L': - ipa_action = target_malloc - (sizeof (struct collect_static_trace_data_action)); - write_inferior_memory - (ipa_action, - (unsigned char *) action, - sizeof (struct collect_static_trace_data_action)); - break; - default: - trace_debug ("unknown trace action '%c', ignoring", - action->type); - break; - } - - if (ipa_action != 0) - write_inferior_data_ptr - (actions_array + i * sizeof (sizeof (*tpoint->actions)), - ipa_action); - } - } - } -} - -static void -download_trace_state_variables (void) -{ - CORE_ADDR ptr = 0, prev_ptr = 0; - struct trace_state_variable *tsv; - - /* Start out empty. */ - write_inferior_data_ptr (ipa_sym_addrs.addr_trace_state_variables, 0); - - for (tsv = trace_state_variables; tsv != NULL; tsv = tsv->next) - { - struct trace_state_variable target_tsv; - - /* TSV's with a getter have been initialized equally in both the - inferior and GDBserver. Skip them. */ - if (tsv->getter != NULL) - continue; - - target_tsv = *tsv; - - prev_ptr = ptr; - ptr = target_malloc (sizeof (*tsv)); - - if (tsv == trace_state_variables) - { - /* First object in list, set the head pointer in the - inferior. */ - - write_inferior_data_ptr (ipa_sym_addrs.addr_trace_state_variables, - ptr); - } - else - { - write_inferior_data_ptr (prev_ptr - + offsetof (struct trace_state_variable, - next), - ptr); - } - - /* Write the whole object. We'll fix up its pointers in a bit. - Assume no next, fixup when needed. */ - target_tsv.next = NULL; - - write_inferior_memory (ptr, (unsigned char *) &target_tsv, - sizeof (target_tsv)); - - if (tsv->name != NULL) - { - size_t size = strlen (tsv->name) + 1; - CORE_ADDR name_addr = target_malloc (size); - write_inferior_memory (name_addr, - (unsigned char *) tsv->name, size); - write_inferior_data_ptr (ptr - + offsetof (struct trace_state_variable, - name), - name_addr); - } - - if (tsv->getter != NULL) - { - fatal ("what to do with these?"); - } - } - - if (prev_ptr != 0) - { - /* Fixup the next pointer in the last item in the list. */ - write_inferior_data_ptr (prev_ptr - + offsetof (struct trace_state_variable, - next), 0); - } -} - -/* Upload complete trace frames out of the IP Agent's trace buffer - into GDBserver's trace buffer. This always uploads either all or - no trace frames. This is the counter part of - `trace_alloc_trace_buffer'. See its description of the atomic - synching mechanism. */ - -static void -upload_fast_traceframes (void) -{ - unsigned int ipa_traceframe_read_count, ipa_traceframe_write_count; - unsigned int ipa_traceframe_read_count_racy, ipa_traceframe_write_count_racy; - CORE_ADDR tf; - struct ipa_trace_buffer_control ipa_trace_buffer_ctrl; - unsigned int curr_tbctrl_idx; - unsigned int ipa_trace_buffer_ctrl_curr; - unsigned int ipa_trace_buffer_ctrl_curr_old; - CORE_ADDR ipa_trace_buffer_ctrl_addr; - struct breakpoint *about_to_request_buffer_space_bkpt; - CORE_ADDR ipa_trace_buffer_lo; - CORE_ADDR ipa_trace_buffer_hi; - - if (read_inferior_uinteger (ipa_sym_addrs.addr_traceframe_read_count, - &ipa_traceframe_read_count_racy)) - { - /* This will happen in most targets if the current thread is - running. */ - return; - } - - if (read_inferior_uinteger (ipa_sym_addrs.addr_traceframe_write_count, - &ipa_traceframe_write_count_racy)) - return; - - trace_debug ("ipa_traceframe_count (racy area): %d (w=%d, r=%d)", - ipa_traceframe_write_count_racy - - ipa_traceframe_read_count_racy, - ipa_traceframe_write_count_racy, - ipa_traceframe_read_count_racy); - - if (ipa_traceframe_write_count_racy == ipa_traceframe_read_count_racy) - return; - - about_to_request_buffer_space_bkpt - = set_breakpoint_at (ipa_sym_addrs.addr_about_to_request_buffer_space, - NULL); - - if (read_inferior_uinteger (ipa_sym_addrs.addr_trace_buffer_ctrl_curr, - &ipa_trace_buffer_ctrl_curr)) - return; - - ipa_trace_buffer_ctrl_curr_old = ipa_trace_buffer_ctrl_curr; - - curr_tbctrl_idx = ipa_trace_buffer_ctrl_curr & ~GDBSERVER_FLUSH_COUNT_MASK; - - { - unsigned int prev, counter; - - /* Update the token, with new counters, and the GDBserver stamp - bit. Alway reuse the current TBC index. */ - prev = ipa_trace_buffer_ctrl_curr & 0x0007ff00; - counter = (prev + 0x100) & 0x0007ff00; - - ipa_trace_buffer_ctrl_curr = (0x80000000 - | (prev << 12) - | counter - | curr_tbctrl_idx); - } - - if (write_inferior_uinteger (ipa_sym_addrs.addr_trace_buffer_ctrl_curr, - ipa_trace_buffer_ctrl_curr)) - return; - - trace_debug ("Lib: Committed %08x -> %08x", - ipa_trace_buffer_ctrl_curr_old, - ipa_trace_buffer_ctrl_curr); - - /* Re-read these, now that we've installed the - `about_to_request_buffer_space' breakpoint/lock. A thread could - have finished a traceframe between the last read of these - counters and setting the breakpoint above. If we start - uploading, we never want to leave this function with - traceframe_read_count != 0, otherwise, GDBserver could end up - incrementing the counter tokens more than once (due to event loop - nesting), which would break the IP agent's "effective" detection - (see trace_alloc_trace_buffer). */ - if (read_inferior_uinteger (ipa_sym_addrs.addr_traceframe_read_count, - &ipa_traceframe_read_count)) - return; - if (read_inferior_uinteger (ipa_sym_addrs.addr_traceframe_write_count, - &ipa_traceframe_write_count)) - return; - - if (debug_threads) - { - trace_debug ("ipa_traceframe_count (blocked area): %d (w=%d, r=%d)", - ipa_traceframe_write_count - ipa_traceframe_read_count, - ipa_traceframe_write_count, ipa_traceframe_read_count); - - if (ipa_traceframe_write_count != ipa_traceframe_write_count_racy - || ipa_traceframe_read_count != ipa_traceframe_read_count_racy) - trace_debug ("note that ipa_traceframe_count's parts changed"); - } - - /* Get the address of the current TBC object (the IP agent has an - array of 3 such objects). The index is stored in the TBC - token. */ - ipa_trace_buffer_ctrl_addr = ipa_sym_addrs.addr_trace_buffer_ctrl; - ipa_trace_buffer_ctrl_addr - += sizeof (struct ipa_trace_buffer_control) * curr_tbctrl_idx; - - if (read_inferior_memory (ipa_trace_buffer_ctrl_addr, - (unsigned char *) &ipa_trace_buffer_ctrl, - sizeof (struct ipa_trace_buffer_control))) - return; - - if (read_inferior_data_pointer (ipa_sym_addrs.addr_trace_buffer_lo, - &ipa_trace_buffer_lo)) - return; - if (read_inferior_data_pointer (ipa_sym_addrs.addr_trace_buffer_hi, - &ipa_trace_buffer_hi)) - return; - - /* Offsets are easier to grok for debugging than raw addresses, - especially for the small trace buffer sizes that are useful for - testing. */ - trace_debug ("Lib: Trace buffer [%d] start=%d free=%d " - "endfree=%d wrap=%d hi=%d", - curr_tbctrl_idx, - (int) (ipa_trace_buffer_ctrl.start - ipa_trace_buffer_lo), - (int) (ipa_trace_buffer_ctrl.free - ipa_trace_buffer_lo), - (int) (ipa_trace_buffer_ctrl.end_free - ipa_trace_buffer_lo), - (int) (ipa_trace_buffer_ctrl.wrap - ipa_trace_buffer_lo), - (int) (ipa_trace_buffer_hi - ipa_trace_buffer_lo)); - - /* Note that the IPA's buffer is always circular. */ - -#define IPA_FIRST_TRACEFRAME() (ipa_trace_buffer_ctrl.start) - -#define IPA_NEXT_TRACEFRAME_1(TF, TFOBJ) \ - ((TF) + sizeof (struct traceframe) + (TFOBJ)->data_size) - -#define IPA_NEXT_TRACEFRAME(TF, TFOBJ) \ - (IPA_NEXT_TRACEFRAME_1 (TF, TFOBJ) \ - - ((IPA_NEXT_TRACEFRAME_1 (TF, TFOBJ) >= ipa_trace_buffer_ctrl.wrap) \ - ? (ipa_trace_buffer_ctrl.wrap - ipa_trace_buffer_lo) \ - : 0)) - - tf = IPA_FIRST_TRACEFRAME (); - - while (ipa_traceframe_write_count - ipa_traceframe_read_count) - { - struct tracepoint *tpoint; - struct traceframe *tframe; - unsigned char *block; - struct traceframe ipa_tframe; - - if (read_inferior_memory (tf, (unsigned char *) &ipa_tframe, - offsetof (struct traceframe, data))) - error ("Uploading: couldn't read traceframe at %s\n", paddress (tf)); - - if (ipa_tframe.tpnum == 0) - fatal ("Uploading: No (more) fast traceframes, but " - "ipa_traceframe_count == %u??\n", - ipa_traceframe_write_count - ipa_traceframe_read_count); - - /* Note that this will be incorrect for multi-location - tracepoints... */ - tpoint = find_next_tracepoint_by_number (NULL, ipa_tframe.tpnum); - - tframe = add_traceframe (tpoint); - if (tframe == NULL) - { - trace_buffer_is_full = 1; - trace_debug ("Uploading: trace buffer is full"); - } - else - { - /* Copy the whole set of blocks in one go for now. FIXME: - split this in smaller blocks. */ - block = add_traceframe_block (tframe, ipa_tframe.data_size); - if (block != NULL) - { - if (read_inferior_memory (tf - + offsetof (struct traceframe, data), - block, ipa_tframe.data_size)) - error ("Uploading: Couldn't read traceframe data at %s\n", - paddress (tf + offsetof (struct traceframe, data))); - } - - trace_debug ("Uploading: traceframe didn't fit"); - finish_traceframe (tframe); - } - - tf = IPA_NEXT_TRACEFRAME (tf, &ipa_tframe); - - /* If we freed the traceframe that wrapped around, go back - to the non-wrap case. */ - if (tf < ipa_trace_buffer_ctrl.start) - { - trace_debug ("Lib: Discarding past the wraparound"); - ipa_trace_buffer_ctrl.wrap = ipa_trace_buffer_hi; - } - ipa_trace_buffer_ctrl.start = tf; - ipa_trace_buffer_ctrl.end_free = ipa_trace_buffer_ctrl.start; - ++ipa_traceframe_read_count; - - if (ipa_trace_buffer_ctrl.start == ipa_trace_buffer_ctrl.free - && ipa_trace_buffer_ctrl.start == ipa_trace_buffer_ctrl.end_free) - { - trace_debug ("Lib: buffer is fully empty. " - "Trace buffer [%d] start=%d free=%d endfree=%d", - curr_tbctrl_idx, - (int) (ipa_trace_buffer_ctrl.start - - ipa_trace_buffer_lo), - (int) (ipa_trace_buffer_ctrl.free - - ipa_trace_buffer_lo), - (int) (ipa_trace_buffer_ctrl.end_free - - ipa_trace_buffer_lo)); - - ipa_trace_buffer_ctrl.start = ipa_trace_buffer_lo; - ipa_trace_buffer_ctrl.free = ipa_trace_buffer_lo; - ipa_trace_buffer_ctrl.end_free = ipa_trace_buffer_hi; - ipa_trace_buffer_ctrl.wrap = ipa_trace_buffer_hi; - } - - trace_debug ("Uploaded a traceframe\n" - "Lib: Trace buffer [%d] start=%d free=%d " - "endfree=%d wrap=%d hi=%d", - curr_tbctrl_idx, - (int) (ipa_trace_buffer_ctrl.start - ipa_trace_buffer_lo), - (int) (ipa_trace_buffer_ctrl.free - ipa_trace_buffer_lo), - (int) (ipa_trace_buffer_ctrl.end_free - - ipa_trace_buffer_lo), - (int) (ipa_trace_buffer_ctrl.wrap - ipa_trace_buffer_lo), - (int) (ipa_trace_buffer_hi - ipa_trace_buffer_lo)); - } - - if (write_inferior_memory (ipa_trace_buffer_ctrl_addr, - (unsigned char *) &ipa_trace_buffer_ctrl, - sizeof (struct ipa_trace_buffer_control))) - return; - - write_inferior_integer (ipa_sym_addrs.addr_traceframe_read_count, - ipa_traceframe_read_count); - - trace_debug ("Done uploading traceframes [%d]\n", curr_tbctrl_idx); - - pause_all (1); - cancel_breakpoints (); - - delete_breakpoint (about_to_request_buffer_space_bkpt); - about_to_request_buffer_space_bkpt = NULL; - - unpause_all (1); - - if (trace_buffer_is_full) - stop_tracing (); -} -#endif - -#ifdef IN_PROCESS_AGENT - -IP_AGENT_EXPORT int ust_loaded; -IP_AGENT_EXPORT char cmd_buf[CMD_BUF_SIZE]; - -#ifdef HAVE_UST - -/* Static tracepoints. */ - -/* UST puts a "struct tracepoint" in the global namespace, which - conflicts with our tracepoint. Arguably, being a library, it - shouldn't take ownership of such a generic name. We work around it - here. */ -#define tracepoint ust_tracepoint -#include <ust/ust.h> -#undef tracepoint - -extern int serialize_to_text (char *outbuf, int bufsize, - const char *fmt, va_list ap); - -#define GDB_PROBE_NAME "gdb" - -/* We dynamically search for the UST symbols instead of linking them - in. This lets the user decide if the application uses static - tracepoints, instead of always pulling libust.so in. This vector - holds pointers to all functions we care about. */ - -static struct -{ - int (*serialize_to_text) (char *outbuf, int bufsize, - const char *fmt, va_list ap); - - int (*ltt_probe_register) (struct ltt_available_probe *pdata); - int (*ltt_probe_unregister) (struct ltt_available_probe *pdata); - - int (*ltt_marker_connect) (const char *channel, const char *mname, - const char *pname); - int (*ltt_marker_disconnect) (const char *channel, const char *mname, - const char *pname); - - void (*marker_iter_start) (struct marker_iter *iter); - void (*marker_iter_next) (struct marker_iter *iter); - void (*marker_iter_stop) (struct marker_iter *iter); - void (*marker_iter_reset) (struct marker_iter *iter); -} ust_ops; - -#include <dlfcn.h> - -/* Cast through typeof to catch incompatible API changes. Since UST - only builds with gcc, we can freely use gcc extensions here - too. */ -#define GET_UST_SYM(SYM) \ - do \ - { \ - if (ust_ops.SYM == NULL) \ - ust_ops.SYM = (typeof (&SYM)) dlsym (RTLD_DEFAULT, #SYM); \ - if (ust_ops.SYM == NULL) \ - return 0; \ - } while (0) - -#define USTF(SYM) ust_ops.SYM - -/* Get pointers to all libust.so functions we care about. */ - -static int -dlsym_ust (void) -{ - GET_UST_SYM (serialize_to_text); - - GET_UST_SYM (ltt_probe_register); - GET_UST_SYM (ltt_probe_unregister); - GET_UST_SYM (ltt_marker_connect); - GET_UST_SYM (ltt_marker_disconnect); - - GET_UST_SYM (marker_iter_start); - GET_UST_SYM (marker_iter_next); - GET_UST_SYM (marker_iter_stop); - GET_UST_SYM (marker_iter_reset); - - ust_loaded = 1; - return 1; -} - -/* Given an UST marker, return the matching gdb static tracepoint. - The match is done by address. */ - -static struct tracepoint * -ust_marker_to_static_tracepoint (const struct marker *mdata) -{ - struct tracepoint *tpoint; - - for (tpoint = tracepoints; tpoint; tpoint = tpoint->next) - { - if (tpoint->type != static_tracepoint) - continue; - - if (tpoint->address == (uintptr_t) mdata->location) - return tpoint; - } - - return NULL; -} - -/* The probe function we install on lttng/ust markers. Whenever a - probed ust marker is hit, this function is called. This is similar - to gdb_collect, only for static tracepoints, instead of fast - tracepoints. */ - -static void -gdb_probe (const struct marker *mdata, void *probe_private, - struct registers *regs, void *call_private, - const char *fmt, va_list *args) -{ - struct tracepoint *tpoint; - struct static_tracepoint_ctx ctx; - - /* Don't do anything until the trace run is completely set up. */ - if (!tracing) - { - trace_debug ("gdb_probe: not tracing\n"); - return; - } - - ctx.base.type = static_tracepoint; - ctx.regcache_initted = 0; - ctx.regs = regs; - ctx.fmt = fmt; - ctx.args = args; - - /* Wrap the regblock in a register cache (in the stack, we don't - want to malloc here). */ - ctx.regspace = alloca (register_cache_size ()); - if (ctx.regspace == NULL) - { - trace_debug ("Trace buffer block allocation failed, skipping"); - return; - } - - tpoint = ust_marker_to_static_tracepoint (mdata); - if (tpoint == NULL) - { - trace_debug ("gdb_probe: marker not known: " - "loc:0x%p, ch:\"%s\",n:\"%s\",f:\"%s\"", - mdata->location, mdata->channel, - mdata->name, mdata->format); - return; - } - - if (!tpoint->enabled) - { - trace_debug ("gdb_probe: tracepoint disabled"); - return; - } - - ctx.tpoint = tpoint; - - trace_debug ("gdb_probe: collecting marker: " - "loc:0x%p, ch:\"%s\",n:\"%s\",f:\"%s\"", - mdata->location, mdata->channel, - mdata->name, mdata->format); - - /* Test the condition if present, and collect if true. */ - if (tpoint->cond == NULL - || condition_true_at_tracepoint ((struct tracepoint_hit_ctx *) &ctx, - tpoint)) - { - collect_data_at_tracepoint ((struct tracepoint_hit_ctx *) &ctx, - tpoint->address, tpoint); - - if (stopping_tracepoint - || trace_buffer_is_full - || expr_eval_result != expr_eval_no_error) - stop_tracing (); - } - else - { - /* If there was a condition and it evaluated to false, the only - way we would stop tracing is if there was an error during - condition expression evaluation. */ - if (expr_eval_result != expr_eval_no_error) - stop_tracing (); - } -} - -/* Called if the gdb static tracepoint requested collecting "$_sdata", - static tracepoint string data. This is a string passed to the - tracing library by the user, at the time of the tracepoint marker - call. E.g., in the UST marker call: - - trace_mark (ust, bar33, "str %s", "FOOBAZ"); - - the collected data is "str FOOBAZ". -*/ - -static void -collect_ust_data_at_tracepoint (struct tracepoint_hit_ctx *ctx, - CORE_ADDR stop_pc, - struct tracepoint *tpoint, - struct traceframe *tframe) -{ - struct static_tracepoint_ctx *umd = (struct static_tracepoint_ctx *) ctx; - unsigned char *bufspace; - int size; - va_list copy; - unsigned short blocklen; - - if (umd == NULL) - { - trace_debug ("Wanted to collect static trace data, " - "but there's no static trace data"); - return; - } - - va_copy (copy, *umd->args); - size = USTF(serialize_to_text) (NULL, 0, umd->fmt, copy); - va_end (copy); - - trace_debug ("Want to collect ust data"); - - /* 'S' + size + string */ - bufspace = add_traceframe_block (tframe, - 1 + sizeof (blocklen) + size + 1); - if (bufspace == NULL) - { - trace_debug ("Trace buffer block allocation failed, skipping"); - return; - } - - /* Identify a static trace data block. */ - *bufspace = 'S'; - - blocklen = size + 1; - memcpy (bufspace + 1, &blocklen, sizeof (blocklen)); - - va_copy (copy, *umd->args); - USTF(serialize_to_text) ((char *) bufspace + 1 + sizeof (blocklen), - size + 1, umd->fmt, copy); - va_end (copy); - - trace_debug ("Storing static tracepoint data in regblock: %s", - bufspace + 1 + sizeof (blocklen)); -} - -/* The probe to register with lttng/ust. */ -static struct ltt_available_probe gdb_ust_probe = - { - GDB_PROBE_NAME, - NULL, - gdb_probe, - }; - -#endif /* HAVE_UST */ -#endif /* IN_PROCESS_AGENT */ - -#ifdef HAVE_UST - -#include <sys/socket.h> -#include <sys/un.h> - -#ifndef UNIX_PATH_MAX -#define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) NULL)->sun_path) -#endif - -/* Where we put the socked used for synchronization. */ -#define SOCK_DIR P_tmpdir - -#endif /* HAVE_UST */ - -#ifndef IN_PROCESS_AGENT - -#ifdef HAVE_UST - -static int -gdb_ust_connect_sync_socket (int pid) -{ - struct sockaddr_un addr; - int res, fd; - char path[UNIX_PATH_MAX]; - - res = xsnprintf (path, UNIX_PATH_MAX, "%s/gdb_ust%d", SOCK_DIR, pid); - if (res >= UNIX_PATH_MAX) - { - trace_debug ("string overflow allocating socket name"); - return -1; - } - - res = fd = socket (PF_UNIX, SOCK_STREAM, 0); - if (res == -1) - { - warning ("error opening sync socket: %s\n", strerror (errno)); - return -1; - } - - addr.sun_family = AF_UNIX; - - res = xsnprintf (addr.sun_path, UNIX_PATH_MAX, "%s", path); - if (res >= UNIX_PATH_MAX) - { - warning ("string overflow allocating socket name\n"); - close (fd); - return -1; - } - - res = connect (fd, (struct sockaddr *) &addr, sizeof (addr)); - if (res == -1) - { - warning ("error connecting sync socket (%s): %s. " - "Make sure the directory exists and that it is writable.", - path, strerror (errno)); - close (fd); - return -1; - } - - return fd; -} - -/* Resume thread PTID. */ - -static void -resume_thread (ptid_t ptid) -{ - struct thread_resume resume_info; - - resume_info.thread = ptid; - resume_info.kind = resume_continue; - resume_info.sig = TARGET_SIGNAL_0; - (*the_target->resume) (&resume_info, 1); -} - -/* Stop thread PTID. */ - -static void -stop_thread (ptid_t ptid) -{ - struct thread_resume resume_info; - - resume_info.thread = ptid; - resume_info.kind = resume_stop; - resume_info.sig = TARGET_SIGNAL_0; - (*the_target->resume) (&resume_info, 1); -} - -/* Ask the in-process agent to run a command. Since we don't want to - have to handle the IPA hitting breakpoints while running the - command, we pause all threads, remove all breakpoints, and then set - the helper thread re-running. We communicate with the helper - thread by means of direct memory xfering, and a socket for - synchronization. */ - -static int -run_inferior_command (char *cmd) -{ - int err = -1; - int fd = -1; - int pid = ptid_get_pid (current_inferior->entry.id); - int tid; - ptid_t ptid = null_ptid; - - trace_debug ("run_inferior_command: running: %s", cmd); - - pause_all (0); - uninsert_all_breakpoints (); - - if (read_inferior_integer (ipa_sym_addrs.addr_helper_thread_id, &tid)) - { - warning ("Error reading helper thread's id in lib"); - goto out; - } - - if (tid == 0) - { - warning ("helper thread not initialized yet"); - goto out; - } - - if (write_inferior_memory (ipa_sym_addrs.addr_cmd_buf, - (unsigned char *) cmd, strlen (cmd) + 1)) - { - warning ("Error writing command"); - goto out; - } - - ptid = ptid_build (pid, tid, 0); - - resume_thread (ptid); - - fd = gdb_ust_connect_sync_socket (pid); - if (fd >= 0) - { - char buf[1] = ""; - int ret; - - trace_debug ("signalling helper thread"); - - do - { - ret = write (fd, buf, 1); - } while (ret == -1 && errno == EINTR); - - trace_debug ("waiting for helper thread's response"); - - do - { - ret = read (fd, buf, 1); - } while (ret == -1 && errno == EINTR); - - close (fd); - - trace_debug ("helper thread's response received"); - } - - out: - - /* Need to read response with the inferior stopped. */ - if (!ptid_equal (ptid, null_ptid)) - { - int was_non_stop = non_stop; - struct target_waitstatus status; - - stop_thread (ptid); - non_stop = 1; - mywait (ptid, &status, 0, 0); - non_stop = was_non_stop; - } - - if (fd >= 0) - { - if (read_inferior_memory (ipa_sym_addrs.addr_cmd_buf, - (unsigned char *) cmd, CMD_BUF_SIZE)) - { - warning ("Error reading command response"); - } - else - { - err = 0; - trace_debug ("run_inferior_command: response: %s", cmd); - } - } - - reinsert_all_breakpoints (); - unpause_all (0); - - return err; -} - -#else /* HAVE_UST */ - -static int -run_inferior_command (char *cmd) -{ - return -1; -} - -#endif /* HAVE_UST */ - -#else /* !IN_PROCESS_AGENT */ - -/* Thread ID of the helper thread. GDBserver reads this to know which - is the help thread. This is an LWP id on Linux. */ -int helper_thread_id; - -#ifdef HAVE_UST - -static int -init_named_socket (const char *name) -{ - int result, fd; - struct sockaddr_un addr; - - result = fd = socket (PF_UNIX, SOCK_STREAM, 0); - if (result == -1) - { - warning ("socket creation failed: %s", strerror (errno)); - return -1; - } - - addr.sun_family = AF_UNIX; - - strncpy (addr.sun_path, name, UNIX_PATH_MAX); - addr.sun_path[UNIX_PATH_MAX - 1] = '\0'; - - result = access (name, F_OK); - if (result == 0) - { - /* File exists. */ - result = unlink (name); - if (result == -1) - { - warning ("unlink failed: %s", strerror (errno)); - close (fd); - return -1; - } - warning ("socket %s already exists; overwriting", name); - } - - result = bind (fd, (struct sockaddr *) &addr, sizeof (addr)); - if (result == -1) - { - warning ("bind failed: %s", strerror (errno)); - close (fd); - return -1; - } - - result = listen (fd, 1); - if (result == -1) - { - warning ("listen: %s", strerror (errno)); - close (fd); - return -1; - } - - return fd; -} - -static int -gdb_ust_socket_init (void) -{ - int result, fd; - char name[UNIX_PATH_MAX]; - - result = xsnprintf (name, UNIX_PATH_MAX, "%s/gdb_ust%d", - SOCK_DIR, getpid ()); - if (result >= UNIX_PATH_MAX) - { - trace_debug ("string overflow allocating socket name"); - return -1; - } - - fd = init_named_socket (name); - if (fd < 0) - warning ("Error initializing named socket (%s) for communication with the " - "ust helper thread. Check that directory exists and that it " - "is writable.", name); - - return fd; -} - -/* Return an hexstr version of the STR C string, fit for sending to - GDB. */ - -static char * -cstr_to_hexstr (const char *str) -{ - int len = strlen (str); - char *hexstr = xmalloc (len * 2 + 1); - convert_int_to_ascii ((gdb_byte *) str, hexstr, len); - return hexstr; -} - -/* The next marker to be returned on a qTsSTM command. */ -static const struct marker *next_st; - -/* Returns the first known marker. */ - -struct marker * -first_marker (void) -{ - struct marker_iter iter; - - USTF(marker_iter_reset) (&iter); - USTF(marker_iter_start) (&iter); - - return iter.marker; -} - -/* Returns the marker following M. */ - -const struct marker * -next_marker (const struct marker *m) -{ - struct marker_iter iter; - - USTF(marker_iter_reset) (&iter); - USTF(marker_iter_start) (&iter); - - for (; iter.marker != NULL; USTF(marker_iter_next) (&iter)) - { - if (iter.marker == m) - { - USTF(marker_iter_next) (&iter); - return iter.marker; - } - } - - return NULL; -} - -/* Compose packet that is the response to the qTsSTM/qTfSTM/qTSTMat - packets. */ - -static void -response_ust_marker (char *packet, const struct marker *st) -{ - char *strid, *format, *tmp; - - next_st = next_marker (st); - - tmp = xmalloc (strlen (st->channel) + 1 + - strlen (st->name) + 1); - sprintf (tmp, "%s/%s", st->channel, st->name); - - strid = cstr_to_hexstr (tmp); - free (tmp); - - format = cstr_to_hexstr (st->format); - - sprintf (packet, "m%s:%s:%s", - paddress ((uintptr_t) st->location), - strid, - format); - - free (strid); - free (format); -} - -/* Return the first static tracepoint, and initialize the state - machine that will iterate through all the static tracepoints. */ - -static void -cmd_qtfstm (char *packet) -{ - trace_debug ("Returning first trace state variable definition"); - - if (first_marker ()) - response_ust_marker (packet, first_marker ()); - else - strcpy (packet, "l"); -} - -/* Return additional trace state variable definitions. */ - -static void -cmd_qtsstm (char *packet) -{ - trace_debug ("Returning static tracepoint"); - - if (next_st) - response_ust_marker (packet, next_st); - else - strcpy (packet, "l"); -} - -/* Disconnect the GDB probe from a marker at a given address. */ - -static void -unprobe_marker_at (char *packet) -{ - char *p = packet; - ULONGEST address; - struct marker_iter iter; - - p += sizeof ("unprobe_marker_at:") - 1; - - p = unpack_varlen_hex (p, &address); - - USTF(marker_iter_reset) (&iter); - USTF(marker_iter_start) (&iter); - for (; iter.marker != NULL; USTF(marker_iter_next) (&iter)) - if ((uintptr_t ) iter.marker->location == address) - { - int result; - - result = USTF(ltt_marker_disconnect) (iter.marker->channel, - iter.marker->name, - GDB_PROBE_NAME); - if (result < 0) - warning ("could not disable marker %s/%s", - iter.marker->channel, iter.marker->name); - break; - } -} - -/* Connect the GDB probe to a marker at a given address. */ - -static int -probe_marker_at (char *packet) -{ - char *p = packet; - ULONGEST address; - struct marker_iter iter; - struct marker *m; - - p += sizeof ("probe_marker_at:") - 1; - - p = unpack_varlen_hex (p, &address); - - USTF(marker_iter_reset) (&iter); - - for (USTF(marker_iter_start) (&iter), m = iter.marker; - m != NULL; - USTF(marker_iter_next) (&iter), m = iter.marker) - if ((uintptr_t ) m->location == address) - { - int result; - - trace_debug ("found marker for address. " - "ltt_marker_connect (marker = %s/%s)", - m->channel, m->name); - - result = USTF(ltt_marker_connect) (m->channel, m->name, - GDB_PROBE_NAME); - if (result && result != -EEXIST) - trace_debug ("ltt_marker_connect (marker = %s/%s, errno = %d)", - m->channel, m->name, -result); - - if (result < 0) - { - sprintf (packet, "E.could not connect marker: channel=%s, name=%s", - m->channel, m->name); - return -1; - } - - strcpy (packet, "OK"); - return 0; - } - - sprintf (packet, "E.no marker found at 0x%s", paddress (address)); - return -1; -} - -static int -cmd_qtstmat (char *packet) -{ - char *p = packet; - ULONGEST address; - struct marker_iter iter; - struct marker *m; - - p += sizeof ("qTSTMat:") - 1; - - p = unpack_varlen_hex (p, &address); - - USTF(marker_iter_reset) (&iter); - - for (USTF(marker_iter_start) (&iter), m = iter.marker; - m != NULL; - USTF(marker_iter_next) (&iter), m = iter.marker) - if ((uintptr_t ) m->location == address) - { - response_ust_marker (packet, m); - return 0; - } - - strcpy (packet, "l"); - return -1; -} - -static void * -gdb_ust_thread (void *arg) -{ - int listen_fd; - - while (1) - { - listen_fd = gdb_ust_socket_init (); - -#ifdef SYS_gettid - if (helper_thread_id == 0) - helper_thread_id = syscall (SYS_gettid); -#endif - - if (listen_fd == -1) - { - warning ("could not create sync socket\n"); - break; - } - - while (1) - { - socklen_t tmp; - struct sockaddr_un sockaddr; - int fd; - char buf[1]; - int ret; - - tmp = sizeof (sockaddr); - - do - { - fd = accept (listen_fd, &sockaddr, &tmp); - } - /* It seems an ERESTARTSYS can escape out of accept. */ - while (fd == -512 || (fd == -1 && errno == EINTR)); - - if (fd < 0) - { - warning ("Accept returned %d, error: %s\n", - fd, strerror (errno)); - break; - } - - do - { - ret = read (fd, buf, 1); - } while (ret == -1 && errno == EINTR); - - if (ret == -1) - { - warning ("reading socket (fd=%d) failed with %s", - fd, strerror (errno)); - close (fd); - break; - } - - if (cmd_buf[0]) - { - if (strcmp ("qTfSTM", cmd_buf) == 0) - { - cmd_qtfstm (cmd_buf); - } - else if (strcmp ("qTsSTM", cmd_buf) == 0) - { - cmd_qtsstm (cmd_buf); - } - else if (strncmp ("unprobe_marker_at:", - cmd_buf, - sizeof ("unprobe_marker_at:") - 1) == 0) - { - unprobe_marker_at (cmd_buf); - } - else if (strncmp ("probe_marker_at:", - cmd_buf, - sizeof ("probe_marker_at:") - 1) == 0) - { - probe_marker_at (cmd_buf); - } - else if (strncmp ("qTSTMat:", - cmd_buf, - sizeof ("qTSTMat:") - 1) == 0) - { - cmd_qtstmat (cmd_buf); - } - else if (strcmp (cmd_buf, "help") == 0) - { - strcpy (cmd_buf, "for help, press F1\n"); - } - else - strcpy (cmd_buf, ""); - } - - write (fd, buf, 1); - close (fd); - } - } - - return NULL; -} - -#include <signal.h> - -static void -gdb_ust_init (void) -{ - int res; - pthread_t thread; - sigset_t new_mask; - sigset_t orig_mask; - - if (!dlsym_ust ()) - return; - - /* We want the helper thread to be as transparent as possible, so - have it inherit an all-signals-blocked mask. */ - - sigfillset (&new_mask); - res = pthread_sigmask (SIG_SETMASK, &new_mask, &orig_mask); - if (res) - fatal ("pthread_sigmask (1) failed: %s", strerror (res)); - - res = pthread_create (&thread, - NULL, - gdb_ust_thread, - NULL); - - res = pthread_sigmask (SIG_SETMASK, &orig_mask, NULL); - if (res) - fatal ("pthread_sigmask (2) failed: %s", strerror (res)); - - while (helper_thread_id == 0) - usleep (1); - - USTF(ltt_probe_register) (&gdb_ust_probe); -} - -#endif /* HAVE_UST */ - -#include <sys/mman.h> -#include <fcntl.h> - -IP_AGENT_EXPORT char *gdb_tp_heap_buffer; -IP_AGENT_EXPORT char *gdb_jump_pad_buffer; -IP_AGENT_EXPORT char *gdb_jump_pad_buffer_end; - -static void __attribute__ ((constructor)) -initialize_tracepoint_ftlib (void) -{ - initialize_tracepoint (); - -#ifdef HAVE_UST - gdb_ust_init (); -#endif -} - -#endif /* IN_PROCESS_AGENT */ - -static LONGEST -tsv_get_timestamp (void) -{ - struct timeval tv; - - if (gettimeofday (&tv, 0) != 0) - return -1; - else - return (LONGEST) tv.tv_sec * 1000000 + tv.tv_usec; -} - -void -initialize_tracepoint (void) -{ - /* There currently no way to change the buffer size. */ - const int sizeOfBuffer = 5 * 1024 * 1024; - unsigned char *buf = xmalloc (sizeOfBuffer); - init_trace_buffer (buf, sizeOfBuffer); - - /* Wire trace state variable 1 to be the timestamp. This will be - uploaded to GDB upon connection and become one of its trace state - variables. (In case you're wondering, if GDB already has a trace - variable numbered 1, it will be renumbered.) */ - create_trace_state_variable (1, 0); - set_trace_state_variable_name (1, "trace_timestamp"); - set_trace_state_variable_getter (1, tsv_get_timestamp); - -#ifdef IN_PROCESS_AGENT - { - int pagesize; - pagesize = sysconf (_SC_PAGE_SIZE); - if (pagesize == -1) - fatal ("sysconf"); - - gdb_tp_heap_buffer = xmalloc (5 * 1024 * 1024); - - /* Allocate scratch buffer aligned on a page boundary. */ - gdb_jump_pad_buffer = memalign (pagesize, pagesize * 20); - gdb_jump_pad_buffer_end = gdb_jump_pad_buffer + pagesize * 20; - - /* Make it writable and executable. */ - if (mprotect (gdb_jump_pad_buffer, pagesize * 20, - PROT_READ | PROT_WRITE | PROT_EXEC) != 0) - fatal ("\ -initialize_tracepoint: mprotect(%p, %d, PROT_READ|PROT_EXEC) failed with %s", - gdb_jump_pad_buffer, pagesize * 20, strerror (errno)); - } - - initialize_low_tracepoint (); -#endif -} diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c deleted file mode 100644 index f804ced1ea1..00000000000 --- a/gdb/gdbserver/utils.c +++ /dev/null @@ -1,305 +0,0 @@ -/* General utility routines for the remote server for GDB. - Copyright (C) 1986, 1989, 1993, 1995, 1996, 1997, 1999, 2000, 2002, 2003, - 2007, 2008, 2009, 2010, 2011 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 <stdio.h> -#include <string.h> -#include <stdlib.h> -#if HAVE_ERRNO_H -#include <errno.h> -#endif - -#ifdef IN_PROCESS_AGENT -# define PREFIX "ipa: " -# define TOOLNAME "GDBserver in-process agent" -#else -# define PREFIX "gdbserver: " -# define TOOLNAME "GDBserver" -#endif - -/* Generally useful subroutines used throughout the program. */ - -void -malloc_failure (long size) -{ - fprintf (stderr, - PREFIX "ran out of memory while trying to allocate %lu bytes\n", - (unsigned long) size); - exit (1); -} - -/* Copy a string into a memory buffer. - If malloc fails, this will print a message to stderr and exit. */ - -char * -xstrdup (const char *s) -{ - char *ret = strdup (s); - if (ret == NULL) - malloc_failure (strlen (s) + 1); - return ret; -} - -#ifndef IN_PROCESS_AGENT - -/* Free a standard argv vector. */ - -void -freeargv (char **vector) -{ - char **scan; - - if (vector != NULL) - { - for (scan = vector; *scan != NULL; scan++) - { - free (*scan); - } - free (vector); - } -} - -#endif - -/* Print the system error message for errno, and also mention STRING - as the file name for which the error was encountered. - Then return to command level. */ - -void -perror_with_name (const char *string) -{ - const char *err; - char *combined; - - err = strerror (errno); - if (err == NULL) - err = "unknown error"; - - combined = (char *) alloca (strlen (err) + strlen (string) + 3); - strcpy (combined, string); - strcat (combined, ": "); - strcat (combined, err); - - error ("%s.", combined); -} - -/* Print an error message and return to command level. - STRING is the error message, used as a fprintf string, - and ARG is passed as an argument to it. */ - -void -error (const char *string,...) -{ -#ifndef IN_PROCESS_AGENT - extern jmp_buf toplevel; -#endif - va_list args; - va_start (args, string); - fflush (stdout); - vfprintf (stderr, string, args); - fprintf (stderr, "\n"); -#ifndef IN_PROCESS_AGENT - longjmp (toplevel, 1); -#else - exit (1); -#endif -} - -/* Print an error message and exit reporting failure. - This is for a error that we cannot continue from. - STRING and ARG are passed to fprintf. */ - -/* VARARGS */ -void -fatal (const char *string,...) -{ - va_list args; - va_start (args, string); - fprintf (stderr, PREFIX); - vfprintf (stderr, string, args); - fprintf (stderr, "\n"); - va_end (args); - exit (1); -} - -/* VARARGS */ -void -warning (const char *string,...) -{ - va_list args; - va_start (args, string); - fprintf (stderr, PREFIX); - vfprintf (stderr, string, args); - fprintf (stderr, "\n"); - va_end (args); -} - -/* Report a problem internal to GDBserver, and exit. */ - -void -internal_error (const char *file, int line, const char *fmt, ...) -{ - va_list args; - va_start (args, fmt); - - fprintf (stderr, "\ -%s:%d: A problem internal to " TOOLNAME " has been detected.\n", file, line); - vfprintf (stderr, fmt, args); - fprintf (stderr, "\n"); - va_end (args); - exit (1); -} - -/* Temporary storage using circular buffer. */ -#define NUMCELLS 10 -#define CELLSIZE 50 - -/* Return the next entry in the circular buffer. */ - -static char * -get_cell (void) -{ - static char buf[NUMCELLS][CELLSIZE]; - static int cell = 0; - if (++cell >= NUMCELLS) - cell = 0; - return buf[cell]; -} - -static char * -decimal2str (char *sign, ULONGEST addr) -{ - /* Steal code from valprint.c:print_decimal(). Should this worry - about the real size of addr as the above does? */ - unsigned long temp[3]; - char *str = get_cell (); - int i = 0; - int width = 9; - - do - { - temp[i] = addr % (1000 * 1000 * 1000); - addr /= (1000 * 1000 * 1000); - i++; - } - while (addr != 0 && i < (sizeof (temp) / sizeof (temp[0]))); - - switch (i) - { - case 1: - xsnprintf (str, CELLSIZE, "%s%0*lu", sign, width, temp[0]); - break; - case 2: - xsnprintf (str, CELLSIZE, "%s%0*lu%09lu", sign, width, - temp[1], temp[0]); - break; - case 3: - xsnprintf (str, CELLSIZE, "%s%0*lu%09lu%09lu", sign, width, - temp[2], temp[1], temp[0]); - break; - default: - internal_error (__FILE__, __LINE__, - "failed internal consistency check"); - } - - return str; -} - -/* %u for ULONGEST. The result is stored in a circular static buffer, - NUMCELLS deep. */ - -char * -pulongest (ULONGEST u) -{ - return decimal2str ("", u); -} - -/* %d for LONGEST. The result is stored in a circular static buffer, - NUMCELLS deep. */ - -char * -plongest (LONGEST l) -{ - if (l < 0) - return decimal2str ("-", -l); - else - return decimal2str ("", l); -} - -/* Eliminate warning from compiler on 32-bit systems. */ -static int thirty_two = 32; - -/* Convert a ULONGEST into a HEX string, like %lx. The result is - stored in a circular static buffer, NUMCELLS deep. */ - -char * -phex_nz (ULONGEST l, int sizeof_l) -{ - char *str; - - switch (sizeof_l) - { - case 8: - { - unsigned long high = (unsigned long) (l >> thirty_two); - str = get_cell (); - if (high == 0) - xsnprintf (str, CELLSIZE, "%lx", - (unsigned long) (l & 0xffffffff)); - else - xsnprintf (str, CELLSIZE, "%lx%08lx", high, - (unsigned long) (l & 0xffffffff)); - break; - } - case 4: - str = get_cell (); - xsnprintf (str, CELLSIZE, "%lx", (unsigned long) l); - break; - case 2: - str = get_cell (); - xsnprintf (str, CELLSIZE, "%x", (unsigned short) (l & 0xffff)); - break; - default: - str = phex_nz (l, sizeof (l)); - break; - } - - return str; -} - -/* Convert a CORE_ADDR into a HEX string, like %lx. - The result is stored in a circular static buffer, NUMCELLS deep. */ - -char * -paddress (CORE_ADDR addr) -{ - return phex_nz (addr, sizeof (CORE_ADDR)); -} - -/* Convert a file descriptor into a printable string. */ - -char * -pfildes (gdb_fildes_t fd) -{ -#if USE_WIN32API - return phex_nz (fd, sizeof (gdb_fildes_t)); -#else - return plongest (fd); -#endif -} diff --git a/gdb/gdbserver/win32-arm-low.c b/gdb/gdbserver/win32-arm-low.c deleted file mode 100644 index a8e3f0640fb..00000000000 --- a/gdb/gdbserver/win32-arm-low.c +++ /dev/null @@ -1,132 +0,0 @@ -/* Copyright (C) 2007, 2008, 2009, 2010, 2011 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 "win32-low.h" - -#ifndef CONTEXT_FLOATING_POINT -#define CONTEXT_FLOATING_POINT 0 -#endif - -/* Defined in auto-generated file reg-arm.c. */ -void init_registers_arm (void); - - -static void -arm_get_thread_context (win32_thread_info *th, DEBUG_EVENT* current_event) -{ - th->context.ContextFlags = \ - CONTEXT_FULL | \ - CONTEXT_FLOATING_POINT; - - GetThreadContext (th->h, &th->context); -} - -static void -arm_set_thread_context (win32_thread_info *th, DEBUG_EVENT* current_event) -{ - SetThreadContext (th->h, &th->context); -} - -#define context_offset(x) ((int)&(((CONTEXT *)NULL)->x)) -static const int mappings[] = { - context_offset (R0), - context_offset (R1), - context_offset (R2), - context_offset (R3), - context_offset (R4), - context_offset (R5), - context_offset (R6), - context_offset (R7), - context_offset (R8), - context_offset (R9), - context_offset (R10), - context_offset (R11), - context_offset (R12), - context_offset (Sp), - context_offset (Lr), - context_offset (Pc), - -1, /* f0 */ - -1, /* f1 */ - -1, /* f2 */ - -1, /* f3 */ - -1, /* f4 */ - -1, /* f5 */ - -1, /* f6 */ - -1, /* f7 */ - -1, /* fps */ - context_offset (Psr), -}; -#undef context_offset - -/* Return a pointer into a CONTEXT field indexed by gdb register number. - Return a pointer to an dummy register holding zero if there is no - corresponding CONTEXT field for the given register number. */ -static char * -regptr (CONTEXT* c, int r) -{ - if (mappings[r] < 0) - { - static ULONG zero; - /* Always force value to zero, in case the user tried to write - to this register before. */ - zero = 0; - return (char *) &zero; - } - else - return (char *) c + mappings[r]; -} - -/* Fetch register from gdbserver regcache data. */ -static void -arm_fetch_inferior_register (struct regcache *regcache, - win32_thread_info *th, int r) -{ - char *context_offset = regptr (&th->context, r); - supply_register (regcache, r, context_offset); -} - -/* Store a new register value into the thread context of TH. */ -static void -arm_store_inferior_register (struct regcache *regcache, - win32_thread_info *th, int r) -{ - collect_register (regcache, r, regptr (&th->context, r)); -} - -/* Correct in either endianness. We do not support Thumb yet. */ -static const unsigned long arm_wince_breakpoint = 0xe6000010; -#define arm_wince_breakpoint_len 4 - -struct win32_target_ops the_low_target = { - init_registers_arm, - sizeof (mappings) / sizeof (mappings[0]), - NULL, /* initial_stuff */ - arm_get_thread_context, - arm_set_thread_context, - NULL, /* thread_added */ - arm_fetch_inferior_register, - arm_store_inferior_register, - NULL, /* single_step */ - (const unsigned char *) &arm_wince_breakpoint, - arm_wince_breakpoint_len, - /* Watchpoint related functions. See target.h for comments. */ - NULL, /* insert_point */ - NULL, /* remove_point */ - NULL, /* stopped_by_watchpoint */ - NULL /* stopped_data_address */ -}; diff --git a/gdb/gdbserver/win32-i386-low.c b/gdb/gdbserver/win32-i386-low.c deleted file mode 100644 index c29b9b040ee..00000000000 --- a/gdb/gdbserver/win32-i386-low.c +++ /dev/null @@ -1,431 +0,0 @@ -/* Copyright (C) 2007, 2008, 2009, 2010, 2011 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 "win32-low.h" -#include "i386-low.h" - -#ifndef CONTEXT_EXTENDED_REGISTERS -#define CONTEXT_EXTENDED_REGISTERS 0 -#endif - -#define FCS_REGNUM 27 -#define FOP_REGNUM 31 - -#define FLAG_TRACE_BIT 0x100 - -#ifdef __x86_64__ -/* Defined in auto-generated file reg-amd64.c. */ -void init_registers_amd64 (void); -#else -/* Defined in auto-generated file reg-i386.c. */ -void init_registers_i386 (void); -#endif - -static struct i386_debug_reg_state debug_reg_state; -static unsigned dr_status_mirror; -static unsigned dr_control_mirror; - -static int debug_registers_changed = 0; -static int debug_registers_used = 0; - -/* Update the inferior's debug register REGNUM from STATE. */ - -void -i386_dr_low_set_addr (const struct i386_debug_reg_state *state, int regnum) -{ - if (! (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR)) - fatal ("Invalid debug register %d", regnum); - - /* debug_reg_state.dr_mirror is already set. - Just notify i386_set_thread_context, i386_thread_added - that the registers need to be updated. */ - debug_registers_changed = 1; - debug_registers_used = 1; -} - -CORE_ADDR -i386_dr_low_get_addr (int regnum) -{ - gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR); - - return debug_reg_state.dr_mirror[regnum]; -} - -/* Update the inferior's DR7 debug control register from STATE. */ - -void -i386_dr_low_set_control (const struct i386_debug_reg_state *state) -{ - /* debug_reg_state.dr_control_mirror is already set. - Just notify i386_set_thread_context, i386_thread_added - that the registers need to be updated. */ - debug_registers_changed = 1; - debug_registers_used = 1; -} - -unsigned -i386_dr_low_get_control (void) -{ - return dr_control_mirror; -} - -/* Get the value of the DR6 debug status register from the inferior - and record it in STATE. */ - -unsigned -i386_dr_low_get_status (void) -{ - /* We don't need to do anything here, the last call to thread_rec for - current_event.dwThreadId id has already set it. */ - return dr_status_mirror; -} - -/* Watchpoint support. */ - -static int -i386_insert_point (char type, CORE_ADDR addr, int len) -{ - switch (type) - { - case '2': - case '3': - case '4': - return i386_low_insert_watchpoint (&debug_reg_state, - type, addr, len); - default: - /* Unsupported. */ - return 1; - } -} - -static int -i386_remove_point (char type, CORE_ADDR addr, int len) -{ - switch (type) - { - case '2': - case '3': - case '4': - return i386_low_remove_watchpoint (&debug_reg_state, - type, addr, len); - default: - /* Unsupported. */ - return 1; - } -} - -static int -i386_stopped_by_watchpoint (void) -{ - return i386_low_stopped_by_watchpoint (&debug_reg_state); -} - -static CORE_ADDR -i386_stopped_data_address (void) -{ - CORE_ADDR addr; - if (i386_low_stopped_data_address (&debug_reg_state, &addr)) - return addr; - return 0; -} - -static void -i386_initial_stuff (void) -{ - i386_low_init_dregs (&debug_reg_state); - debug_registers_changed = 0; - debug_registers_used = 0; - dr_status_mirror = 0; - dr_control_mirror = 0; -} - -static void -i386_get_thread_context (win32_thread_info *th, DEBUG_EVENT* current_event) -{ - /* Requesting the CONTEXT_EXTENDED_REGISTERS register set fails if - the system doesn't support extended registers. */ - static DWORD extended_registers = CONTEXT_EXTENDED_REGISTERS; - - again: - th->context.ContextFlags = (CONTEXT_FULL - | CONTEXT_FLOATING_POINT - | CONTEXT_DEBUG_REGISTERS - | extended_registers); - - if (!GetThreadContext (th->h, &th->context)) - { - DWORD e = GetLastError (); - - if (extended_registers && e == ERROR_INVALID_PARAMETER) - { - extended_registers = 0; - goto again; - } - - error ("GetThreadContext failure %ld\n", (long) e); - } - - debug_registers_changed = 0; - - if (th->tid == current_event->dwThreadId) - { - /* Copy dr values from the current thread. */ - struct i386_debug_reg_state *dr = &debug_reg_state; - dr->dr_mirror[0] = th->context.Dr0; - dr->dr_mirror[1] = th->context.Dr1; - dr->dr_mirror[2] = th->context.Dr2; - dr->dr_mirror[3] = th->context.Dr3; - dr_status_mirror = th->context.Dr6; - dr_control_mirror = th->context.Dr7; - } -} - -static void -i386_set_thread_context (win32_thread_info *th, DEBUG_EVENT* current_event) -{ - if (debug_registers_changed) - { - struct i386_debug_reg_state *dr = &debug_reg_state; - th->context.Dr0 = dr->dr_mirror[0]; - th->context.Dr1 = dr->dr_mirror[1]; - th->context.Dr2 = dr->dr_mirror[2]; - th->context.Dr3 = dr->dr_mirror[3]; - /* th->context.Dr6 = dr_status_mirror; - FIXME: should we set dr6 also ?? */ - th->context.Dr7 = dr_control_mirror; - } - - SetThreadContext (th->h, &th->context); -} - -static void -i386_thread_added (win32_thread_info *th) -{ - /* Set the debug registers for the new thread if they are used. */ - if (debug_registers_used) - { - struct i386_debug_reg_state *dr = &debug_reg_state; - th->context.ContextFlags = CONTEXT_DEBUG_REGISTERS; - GetThreadContext (th->h, &th->context); - - th->context.Dr0 = dr->dr_mirror[0]; - th->context.Dr1 = dr->dr_mirror[1]; - th->context.Dr2 = dr->dr_mirror[2]; - th->context.Dr3 = dr->dr_mirror[3]; - /* th->context.Dr6 = dr_status_mirror; - FIXME: should we set dr6 also ?? */ - th->context.Dr7 = dr_control_mirror; - - SetThreadContext (th->h, &th->context); - th->context.ContextFlags = 0; - } -} - -static void -i386_single_step (win32_thread_info *th) -{ - th->context.EFlags |= FLAG_TRACE_BIT; -} - -#ifndef __x86_64__ - -/* An array of offset mappings into a Win32 Context structure. - This is a one-to-one mapping which is indexed by gdb's register - numbers. It retrieves an offset into the context structure where - the 4 byte register is located. - An offset value of -1 indicates that Win32 does not provide this - register in it's CONTEXT structure. In this case regptr will return - a pointer into a dummy register. */ -#define context_offset(x) ((int)&(((CONTEXT *)NULL)->x)) -static const int mappings[] = { - context_offset (Eax), - context_offset (Ecx), - context_offset (Edx), - context_offset (Ebx), - context_offset (Esp), - context_offset (Ebp), - context_offset (Esi), - context_offset (Edi), - context_offset (Eip), - context_offset (EFlags), - context_offset (SegCs), - context_offset (SegSs), - context_offset (SegDs), - context_offset (SegEs), - context_offset (SegFs), - context_offset (SegGs), - context_offset (FloatSave.RegisterArea[0 * 10]), - context_offset (FloatSave.RegisterArea[1 * 10]), - context_offset (FloatSave.RegisterArea[2 * 10]), - context_offset (FloatSave.RegisterArea[3 * 10]), - context_offset (FloatSave.RegisterArea[4 * 10]), - context_offset (FloatSave.RegisterArea[5 * 10]), - context_offset (FloatSave.RegisterArea[6 * 10]), - context_offset (FloatSave.RegisterArea[7 * 10]), - context_offset (FloatSave.ControlWord), - context_offset (FloatSave.StatusWord), - context_offset (FloatSave.TagWord), - context_offset (FloatSave.ErrorSelector), - context_offset (FloatSave.ErrorOffset), - context_offset (FloatSave.DataSelector), - context_offset (FloatSave.DataOffset), - context_offset (FloatSave.ErrorSelector), - /* XMM0-7 */ - context_offset (ExtendedRegisters[10 * 16]), - context_offset (ExtendedRegisters[11 * 16]), - context_offset (ExtendedRegisters[12 * 16]), - context_offset (ExtendedRegisters[13 * 16]), - context_offset (ExtendedRegisters[14 * 16]), - context_offset (ExtendedRegisters[15 * 16]), - context_offset (ExtendedRegisters[16 * 16]), - context_offset (ExtendedRegisters[17 * 16]), - /* MXCSR */ - context_offset (ExtendedRegisters[24]) -}; -#undef context_offset - -#else /* __x86_64__ */ - -#define context_offset(x) (offsetof (CONTEXT, x)) -static const int mappings[] = -{ - context_offset (Rax), - context_offset (Rbx), - context_offset (Rcx), - context_offset (Rdx), - context_offset (Rsi), - context_offset (Rdi), - context_offset (Rbp), - context_offset (Rsp), - context_offset (R8), - context_offset (R9), - context_offset (R10), - context_offset (R11), - context_offset (R12), - context_offset (R13), - context_offset (R14), - context_offset (R15), - context_offset (Rip), - context_offset (EFlags), - context_offset (SegCs), - context_offset (SegSs), - context_offset (SegDs), - context_offset (SegEs), - context_offset (SegFs), - context_offset (SegGs), - context_offset (FloatSave.FloatRegisters[0]), - context_offset (FloatSave.FloatRegisters[1]), - context_offset (FloatSave.FloatRegisters[2]), - context_offset (FloatSave.FloatRegisters[3]), - context_offset (FloatSave.FloatRegisters[4]), - context_offset (FloatSave.FloatRegisters[5]), - context_offset (FloatSave.FloatRegisters[6]), - context_offset (FloatSave.FloatRegisters[7]), - context_offset (FloatSave.ControlWord), - context_offset (FloatSave.StatusWord), - context_offset (FloatSave.TagWord), - context_offset (FloatSave.ErrorSelector), - context_offset (FloatSave.ErrorOffset), - context_offset (FloatSave.DataSelector), - context_offset (FloatSave.DataOffset), - context_offset (FloatSave.ErrorSelector) - /* XMM0-7 */ , - context_offset (Xmm0), - context_offset (Xmm1), - context_offset (Xmm2), - context_offset (Xmm3), - context_offset (Xmm4), - context_offset (Xmm5), - context_offset (Xmm6), - context_offset (Xmm7), - context_offset (Xmm8), - context_offset (Xmm9), - context_offset (Xmm10), - context_offset (Xmm11), - context_offset (Xmm12), - context_offset (Xmm13), - context_offset (Xmm14), - context_offset (Xmm15), - /* MXCSR */ - context_offset (FloatSave.MxCsr) -}; -#undef context_offset - -#endif /* __x86_64__ */ - -/* Fetch register from gdbserver regcache data. */ -static void -i386_fetch_inferior_register (struct regcache *regcache, - win32_thread_info *th, int r) -{ - char *context_offset = (char *) &th->context + mappings[r]; - - long l; - if (r == FCS_REGNUM) - { - l = *((long *) context_offset) & 0xffff; - supply_register (regcache, r, (char *) &l); - } - else if (r == FOP_REGNUM) - { - l = (*((long *) context_offset) >> 16) & ((1 << 11) - 1); - supply_register (regcache, r, (char *) &l); - } - else - supply_register (regcache, r, context_offset); -} - -/* Store a new register value into the thread context of TH. */ -static void -i386_store_inferior_register (struct regcache *regcache, - win32_thread_info *th, int r) -{ - char *context_offset = (char *) &th->context + mappings[r]; - collect_register (regcache, r, context_offset); -} - -static const unsigned char i386_win32_breakpoint = 0xcc; -#define i386_win32_breakpoint_len 1 - -static void -init_windows_x86 (void) -{ -#ifdef __x86_64__ - init_registers_amd64 (); -#else - init_registers_i386 (); -#endif -} - -struct win32_target_ops the_low_target = { - init_windows_x86, - sizeof (mappings) / sizeof (mappings[0]), - i386_initial_stuff, - i386_get_thread_context, - i386_set_thread_context, - i386_thread_added, - i386_fetch_inferior_register, - i386_store_inferior_register, - i386_single_step, - &i386_win32_breakpoint, - i386_win32_breakpoint_len, - i386_insert_point, - i386_remove_point, - i386_stopped_by_watchpoint, - i386_stopped_data_address -}; diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c deleted file mode 100644 index bcf0e4d5f74..00000000000 --- a/gdb/gdbserver/win32-low.c +++ /dev/null @@ -1,1832 +0,0 @@ -/* Low level interface to Windows debugging, for gdbserver. - Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. - - Contributed by Leo Zayas. Based on "win32-nat.c" from GDB. - - This file is part of GDB. - - This program is free software; you can 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 "regcache.h" -#include "gdb/signals.h" -#include "gdb/fileio.h" -#include "mem-break.h" -#include "win32-low.h" - -#include <stdint.h> -#include <windows.h> -#include <winnt.h> -#include <imagehlp.h> -#include <tlhelp32.h> -#include <psapi.h> -#include <sys/param.h> -#include <process.h> - -#ifndef USE_WIN32API -#include <sys/cygwin.h> -#endif - -#define OUTMSG(X) do { printf X; fflush (stderr); } while (0) - -#define OUTMSG2(X) \ - do \ - { \ - if (debug_threads) \ - { \ - printf X; \ - fflush (stderr); \ - } \ - } while (0) - -#ifndef _T -#define _T(x) TEXT (x) -#endif - -#ifndef COUNTOF -#define COUNTOF(STR) (sizeof (STR) / sizeof ((STR)[0])) -#endif - -#ifdef _WIN32_WCE -# define GETPROCADDRESS(DLL, PROC) \ - ((winapi_ ## PROC) GetProcAddress (DLL, TEXT (#PROC))) -#else -# define GETPROCADDRESS(DLL, PROC) \ - ((winapi_ ## PROC) GetProcAddress (DLL, #PROC)) -#endif - -int using_threads = 1; - -/* Globals. */ -static int attaching = 0; -static HANDLE current_process_handle = NULL; -static DWORD current_process_id = 0; -static DWORD main_thread_id = 0; -static enum target_signal last_sig = TARGET_SIGNAL_0; - -/* The current debug event from WaitForDebugEvent. */ -static DEBUG_EVENT current_event; - -/* Non zero if an interrupt request is to be satisfied by suspending - all threads. */ -static int soft_interrupt_requested = 0; - -/* Non zero if the inferior is stopped in a simulated breakpoint done - by suspending all the threads. */ -static int faked_breakpoint = 0; - -#define NUM_REGS (the_low_target.num_regs) - -typedef BOOL WINAPI (*winapi_DebugActiveProcessStop) (DWORD dwProcessId); -typedef BOOL WINAPI (*winapi_DebugSetProcessKillOnExit) (BOOL KillOnExit); -typedef BOOL WINAPI (*winapi_DebugBreakProcess) (HANDLE); -typedef BOOL WINAPI (*winapi_GenerateConsoleCtrlEvent) (DWORD, DWORD); - -static void win32_resume (struct thread_resume *resume_info, size_t n); - -/* Get the thread ID from the current selected inferior (the current - thread). */ -static ptid_t -current_inferior_ptid (void) -{ - return ((struct inferior_list_entry*) current_inferior)->id; -} - -/* The current debug event from WaitForDebugEvent. */ -static ptid_t -debug_event_ptid (DEBUG_EVENT *event) -{ - return ptid_build (event->dwProcessId, event->dwThreadId, 0); -} - -/* Get the thread context of the thread associated with TH. */ - -static void -win32_get_thread_context (win32_thread_info *th) -{ - memset (&th->context, 0, sizeof (CONTEXT)); - (*the_low_target.get_thread_context) (th, ¤t_event); -#ifdef _WIN32_WCE - memcpy (&th->base_context, &th->context, sizeof (CONTEXT)); -#endif -} - -/* Set the thread context of the thread associated with TH. */ - -static void -win32_set_thread_context (win32_thread_info *th) -{ -#ifdef _WIN32_WCE - /* Calling SuspendThread on a thread that is running kernel code - will report that the suspending was successful, but in fact, that - will often not be true. In those cases, the context returned by - GetThreadContext will not be correct by the time the thread - stops, hence we can't set that context back into the thread when - resuming - it will most likelly crash the inferior. - Unfortunately, there is no way to know when the thread will - really stop. To work around it, we'll only write the context - back to the thread when either the user or GDB explicitly change - it between stopping and resuming. */ - if (memcmp (&th->context, &th->base_context, sizeof (CONTEXT)) != 0) -#endif - (*the_low_target.set_thread_context) (th, ¤t_event); -} - -/* Find a thread record given a thread id. If GET_CONTEXT is set then - also retrieve the context for this thread. */ -static win32_thread_info * -thread_rec (ptid_t ptid, int get_context) -{ - struct thread_info *thread; - win32_thread_info *th; - - thread = (struct thread_info *) find_inferior_id (&all_threads, ptid); - if (thread == NULL) - return NULL; - - th = inferior_target_data (thread); - if (get_context && th->context.ContextFlags == 0) - { - if (!th->suspended) - { - if (SuspendThread (th->h) == (DWORD) -1) - { - DWORD err = GetLastError (); - OUTMSG (("warning: SuspendThread failed in thread_rec, " - "(error %d): %s\n", (int) err, strwinerror (err))); - } - else - th->suspended = 1; - } - - win32_get_thread_context (th); - } - - return th; -} - -/* Add a thread to the thread list. */ -static win32_thread_info * -child_add_thread (DWORD pid, DWORD tid, HANDLE h, void *tlb) -{ - win32_thread_info *th; - ptid_t ptid = ptid_build (pid, tid, 0); - - if ((th = thread_rec (ptid, FALSE))) - return th; - - th = xcalloc (1, sizeof (*th)); - th->tid = tid; - th->h = h; - th->thread_local_base = (CORE_ADDR) (uintptr_t) tlb; - - add_thread (ptid, th); - set_inferior_regcache_data ((struct thread_info *) - find_inferior_id (&all_threads, ptid), - new_register_cache ()); - - if (the_low_target.thread_added != NULL) - (*the_low_target.thread_added) (th); - - return th; -} - -/* Delete a thread from the list of threads. */ -static void -delete_thread_info (struct inferior_list_entry *thread) -{ - win32_thread_info *th = inferior_target_data ((struct thread_info *) thread); - - remove_thread ((struct thread_info *) thread); - CloseHandle (th->h); - free (th); -} - -/* Delete a thread from the list of threads. */ -static void -child_delete_thread (DWORD pid, DWORD tid) -{ - struct inferior_list_entry *thread; - ptid_t ptid; - - /* If the last thread is exiting, just return. */ - if (all_threads.head == all_threads.tail) - return; - - ptid = ptid_build (pid, tid, 0); - thread = find_inferior_id (&all_threads, ptid); - if (thread == NULL) - return; - - delete_thread_info (thread); -} - -/* These watchpoint related wrapper functions simply pass on the function call - if the low target has registered a corresponding function. */ - -static int -win32_insert_point (char type, CORE_ADDR addr, int len) -{ - if (the_low_target.insert_point != NULL) - return the_low_target.insert_point (type, addr, len); - else - /* Unsupported (see target.h). */ - return 1; -} - -static int -win32_remove_point (char type, CORE_ADDR addr, int len) -{ - if (the_low_target.remove_point != NULL) - return the_low_target.remove_point (type, addr, len); - else - /* Unsupported (see target.h). */ - return 1; -} - -static int -win32_stopped_by_watchpoint (void) -{ - if (the_low_target.stopped_by_watchpoint != NULL) - return the_low_target.stopped_by_watchpoint (); - else - return 0; -} - -static CORE_ADDR -win32_stopped_data_address (void) -{ - if (the_low_target.stopped_data_address != NULL) - return the_low_target.stopped_data_address (); - else - return 0; -} - - -/* Transfer memory from/to the debugged process. */ -static int -child_xfer_memory (CORE_ADDR memaddr, char *our, int len, - int write, struct target_ops *target) -{ - SIZE_T done; - uintptr_t addr = (uintptr_t) memaddr; - - if (write) - { - WriteProcessMemory (current_process_handle, (LPVOID) addr, - (LPCVOID) our, len, &done); - FlushInstructionCache (current_process_handle, (LPCVOID) addr, len); - } - else - { - ReadProcessMemory (current_process_handle, (LPCVOID) addr, (LPVOID) our, - len, &done); - } - return done; -} - -/* Clear out any old thread list and reinitialize it to a pristine - state. */ -static void -child_init_thread_list (void) -{ - for_each_inferior (&all_threads, delete_thread_info); -} - -static void -do_initial_child_stuff (HANDLE proch, DWORD pid, int attached) -{ - last_sig = TARGET_SIGNAL_0; - - current_process_handle = proch; - current_process_id = pid; - main_thread_id = 0; - - soft_interrupt_requested = 0; - faked_breakpoint = 0; - - memset (¤t_event, 0, sizeof (current_event)); - - add_process (pid, attached); - child_init_thread_list (); - - if (the_low_target.initial_stuff != NULL) - (*the_low_target.initial_stuff) (); -} - -/* Resume all artificially suspended threads if we are continuing - execution. */ -static int -continue_one_thread (struct inferior_list_entry *this_thread, void *id_ptr) -{ - struct thread_info *thread = (struct thread_info *) this_thread; - int thread_id = * (int *) id_ptr; - win32_thread_info *th = inferior_target_data (thread); - - if ((thread_id == -1 || thread_id == th->tid) - && th->suspended) - { - if (th->context.ContextFlags) - { - win32_set_thread_context (th); - th->context.ContextFlags = 0; - } - - if (ResumeThread (th->h) == (DWORD) -1) - { - DWORD err = GetLastError (); - OUTMSG (("warning: ResumeThread failed in continue_one_thread, " - "(error %d): %s\n", (int) err, strwinerror (err))); - } - th->suspended = 0; - } - - return 0; -} - -static BOOL -child_continue (DWORD continue_status, int thread_id) -{ - /* The inferior will only continue after the ContinueDebugEvent - call. */ - find_inferior (&all_threads, continue_one_thread, &thread_id); - faked_breakpoint = 0; - - if (!ContinueDebugEvent (current_event.dwProcessId, - current_event.dwThreadId, - continue_status)) - return FALSE; - - return TRUE; -} - -/* Fetch register(s) from the current thread context. */ -static void -child_fetch_inferior_registers (struct regcache *regcache, int r) -{ - int regno; - win32_thread_info *th = thread_rec (current_inferior_ptid (), TRUE); - if (r == -1 || r > NUM_REGS) - child_fetch_inferior_registers (regcache, NUM_REGS); - else - for (regno = 0; regno < r; regno++) - (*the_low_target.fetch_inferior_register) (regcache, th, regno); -} - -/* Store a new register value into the current thread context. We don't - change the program's context until later, when we resume it. */ -static void -child_store_inferior_registers (struct regcache *regcache, int r) -{ - int regno; - win32_thread_info *th = thread_rec (current_inferior_ptid (), TRUE); - if (r == -1 || r == 0 || r > NUM_REGS) - child_store_inferior_registers (regcache, NUM_REGS); - else - for (regno = 0; regno < r; regno++) - (*the_low_target.store_inferior_register) (regcache, th, regno); -} - -/* Map the Windows error number in ERROR to a locale-dependent error - message string and return a pointer to it. Typically, the values - for ERROR come from GetLastError. - - The string pointed to shall not be modified by the application, - but may be overwritten by a subsequent call to strwinerror - - The strwinerror function does not change the current setting - of GetLastError. */ - -char * -strwinerror (DWORD error) -{ - static char buf[1024]; - TCHAR *msgbuf; - DWORD lasterr = GetLastError (); - DWORD chars = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM - | FORMAT_MESSAGE_ALLOCATE_BUFFER, - NULL, - error, - 0, /* Default language */ - (LPVOID)&msgbuf, - 0, - NULL); - if (chars != 0) - { - /* If there is an \r\n appended, zap it. */ - if (chars >= 2 - && msgbuf[chars - 2] == '\r' - && msgbuf[chars - 1] == '\n') - { - chars -= 2; - msgbuf[chars] = 0; - } - - if (chars > ((COUNTOF (buf)) - 1)) - { - chars = COUNTOF (buf) - 1; - msgbuf [chars] = 0; - } - -#ifdef UNICODE - wcstombs (buf, msgbuf, chars + 1); -#else - strncpy (buf, msgbuf, chars + 1); -#endif - LocalFree (msgbuf); - } - else - sprintf (buf, "unknown win32 error (%ld)", error); - - SetLastError (lasterr); - return buf; -} - -static BOOL -create_process (const char *program, char *args, - DWORD flags, PROCESS_INFORMATION *pi) -{ - BOOL ret; - -#ifdef _WIN32_WCE - wchar_t *p, *wprogram, *wargs; - size_t argslen; - - wprogram = alloca ((strlen (program) + 1) * sizeof (wchar_t)); - mbstowcs (wprogram, program, strlen (program) + 1); - - for (p = wprogram; *p; ++p) - if (L'/' == *p) - *p = L'\\'; - - argslen = strlen (args); - wargs = alloca ((argslen + 1) * sizeof (wchar_t)); - mbstowcs (wargs, args, argslen + 1); - - ret = CreateProcessW (wprogram, /* image name */ - wargs, /* command line */ - NULL, /* security, not supported */ - NULL, /* thread, not supported */ - FALSE, /* inherit handles, not supported */ - flags, /* start flags */ - NULL, /* environment, not supported */ - NULL, /* current directory, not supported */ - NULL, /* start info, not supported */ - pi); /* proc info */ -#else - STARTUPINFOA si = { sizeof (STARTUPINFOA) }; - - ret = CreateProcessA (program, /* image name */ - args, /* command line */ - NULL, /* security */ - NULL, /* thread */ - TRUE, /* inherit handles */ - flags, /* start flags */ - NULL, /* environment */ - NULL, /* current directory */ - &si, /* start info */ - pi); /* proc info */ -#endif - - return ret; -} - -/* Start a new process. - PROGRAM is a path to the program to execute. - ARGS is a standard NULL-terminated array of arguments, - to be passed to the inferior as ``argv''. - Returns the new PID on success, -1 on failure. Registers the new - process with the process list. */ -static int -win32_create_inferior (char *program, char **program_args) -{ -#ifndef USE_WIN32API - char real_path[MAXPATHLEN]; - char *orig_path, *new_path, *path_ptr; -#endif - BOOL ret; - DWORD flags; - char *args; - int argslen; - int argc; - PROCESS_INFORMATION pi; - DWORD err; - - /* win32_wait needs to know we're not attaching. */ - attaching = 0; - - if (!program) - error ("No executable specified, specify executable to debug.\n"); - - flags = DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS; - -#ifndef USE_WIN32API - orig_path = NULL; - path_ptr = getenv ("PATH"); - if (path_ptr) - { - int size = cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, NULL, 0); - orig_path = alloca (strlen (path_ptr) + 1); - new_path = alloca (size); - strcpy (orig_path, path_ptr); - cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, new_path, size); - setenv ("PATH", new_path, 1); - } - cygwin_conv_path (CCP_POSIX_TO_WIN_A, program, real_path, - MAXPATHLEN); - program = real_path; -#endif - - argslen = 1; - for (argc = 1; program_args[argc]; argc++) - argslen += strlen (program_args[argc]) + 1; - args = alloca (argslen); - args[0] = '\0'; - for (argc = 1; program_args[argc]; argc++) - { - /* FIXME: Can we do better about quoting? How does Cygwin - handle this? */ - strcat (args, " "); - strcat (args, program_args[argc]); - } - OUTMSG2 (("Command line is \"%s\"\n", args)); - -#ifdef CREATE_NEW_PROCESS_GROUP - flags |= CREATE_NEW_PROCESS_GROUP; -#endif - - ret = create_process (program, args, flags, &pi); - err = GetLastError (); - if (!ret && err == ERROR_FILE_NOT_FOUND) - { - char *exename = alloca (strlen (program) + 5); - strcat (strcpy (exename, program), ".exe"); - ret = create_process (exename, args, flags, &pi); - err = GetLastError (); - } - -#ifndef USE_WIN32API - if (orig_path) - setenv ("PATH", orig_path, 1); -#endif - - if (!ret) - { - error ("Error creating process \"%s%s\", (error %d): %s\n", - program, args, (int) err, strwinerror (err)); - } - else - { - OUTMSG2 (("Process created: %s\n", (char *) args)); - } - -#ifndef _WIN32_WCE - /* On Windows CE this handle can't be closed. The OS reuses - it in the debug events, while the 9x/NT versions of Windows - probably use a DuplicateHandle'd one. */ - CloseHandle (pi.hThread); -#endif - - do_initial_child_stuff (pi.hProcess, pi.dwProcessId, 0); - - return current_process_id; -} - -/* Attach to a running process. - PID is the process ID to attach to, specified by the user - or a higher layer. */ -static int -win32_attach (unsigned long pid) -{ - HANDLE h; - winapi_DebugSetProcessKillOnExit DebugSetProcessKillOnExit = NULL; - DWORD err; -#ifdef _WIN32_WCE - HMODULE dll = GetModuleHandle (_T("COREDLL.DLL")); -#else - HMODULE dll = GetModuleHandle (_T("KERNEL32.DLL")); -#endif - DebugSetProcessKillOnExit = GETPROCADDRESS (dll, DebugSetProcessKillOnExit); - - h = OpenProcess (PROCESS_ALL_ACCESS, FALSE, pid); - if (h != NULL) - { - if (DebugActiveProcess (pid)) - { - if (DebugSetProcessKillOnExit != NULL) - DebugSetProcessKillOnExit (FALSE); - - /* win32_wait needs to know we're attaching. */ - attaching = 1; - do_initial_child_stuff (h, pid, 1); - return 0; - } - - CloseHandle (h); - } - - err = GetLastError (); - error ("Attach to process failed (error %d): %s\n", - (int) err, strwinerror (err)); -} - -/* Handle OUTPUT_DEBUG_STRING_EVENT from child process. */ -static void -handle_output_debug_string (struct target_waitstatus *ourstatus) -{ -#define READ_BUFFER_LEN 1024 - CORE_ADDR addr; - char s[READ_BUFFER_LEN + 1] = { 0 }; - DWORD nbytes = current_event.u.DebugString.nDebugStringLength; - - if (nbytes == 0) - return; - - if (nbytes > READ_BUFFER_LEN) - nbytes = READ_BUFFER_LEN; - - addr = (CORE_ADDR) (size_t) current_event.u.DebugString.lpDebugStringData; - - if (current_event.u.DebugString.fUnicode) - { - /* The event tells us how many bytes, not chars, even - in Unicode. */ - WCHAR buffer[(READ_BUFFER_LEN + 1) / sizeof (WCHAR)] = { 0 }; - if (read_inferior_memory (addr, (unsigned char *) buffer, nbytes) != 0) - return; - wcstombs (s, buffer, (nbytes + 1) / sizeof (WCHAR)); - } - else - { - if (read_inferior_memory (addr, (unsigned char *) s, nbytes) != 0) - return; - } - - if (strncmp (s, "cYg", 3) != 0) - { - if (!server_waiting) - { - OUTMSG2(("%s", s)); - return; - } - - monitor_output (s); - } -#undef READ_BUFFER_LEN -} - -static void -win32_clear_inferiors (void) -{ - if (current_process_handle != NULL) - CloseHandle (current_process_handle); - - for_each_inferior (&all_threads, delete_thread_info); - clear_inferiors (); -} - -/* Kill all inferiors. */ -static int -win32_kill (int pid) -{ - struct process_info *process; - - if (current_process_handle == NULL) - return -1; - - TerminateProcess (current_process_handle, 0); - for (;;) - { - if (!child_continue (DBG_CONTINUE, -1)) - break; - if (!WaitForDebugEvent (¤t_event, INFINITE)) - break; - if (current_event.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT) - break; - else if (current_event.dwDebugEventCode == OUTPUT_DEBUG_STRING_EVENT) - { - struct target_waitstatus our_status = { 0 }; - handle_output_debug_string (&our_status); - } - } - - win32_clear_inferiors (); - - process = find_process_pid (pid); - remove_process (process); - return 0; -} - -/* Detach from inferior PID. */ -static int -win32_detach (int pid) -{ - struct process_info *process; - winapi_DebugActiveProcessStop DebugActiveProcessStop = NULL; - winapi_DebugSetProcessKillOnExit DebugSetProcessKillOnExit = NULL; -#ifdef _WIN32_WCE - HMODULE dll = GetModuleHandle (_T("COREDLL.DLL")); -#else - HMODULE dll = GetModuleHandle (_T("KERNEL32.DLL")); -#endif - DebugActiveProcessStop = GETPROCADDRESS (dll, DebugActiveProcessStop); - DebugSetProcessKillOnExit = GETPROCADDRESS (dll, DebugSetProcessKillOnExit); - - if (DebugSetProcessKillOnExit == NULL - || DebugActiveProcessStop == NULL) - return -1; - - { - struct thread_resume resume; - resume.thread = minus_one_ptid; - resume.kind = resume_continue; - resume.sig = 0; - win32_resume (&resume, 1); - } - - if (!DebugActiveProcessStop (current_process_id)) - return -1; - - DebugSetProcessKillOnExit (FALSE); - process = find_process_pid (pid); - remove_process (process); - - win32_clear_inferiors (); - return 0; -} - -static void -win32_mourn (struct process_info *process) -{ - remove_process (process); -} - -/* Wait for inferiors to end. */ -static void -win32_join (int pid) -{ - HANDLE h = OpenProcess (PROCESS_ALL_ACCESS, FALSE, pid); - if (h != NULL) - { - WaitForSingleObject (h, INFINITE); - CloseHandle (h); - } -} - -/* Return 1 iff the thread with thread ID TID is alive. */ -static int -win32_thread_alive (ptid_t ptid) -{ - int res; - - /* Our thread list is reliable; don't bother to poll target - threads. */ - if (find_inferior_id (&all_threads, ptid) != NULL) - res = 1; - else - res = 0; - return res; -} - -/* Resume the inferior process. RESUME_INFO describes how we want - to resume. */ -static void -win32_resume (struct thread_resume *resume_info, size_t n) -{ - DWORD tid; - enum target_signal sig; - int step; - win32_thread_info *th; - DWORD continue_status = DBG_CONTINUE; - ptid_t ptid; - - /* This handles the very limited set of resume packets that GDB can - currently produce. */ - - if (n == 1 && ptid_equal (resume_info[0].thread, minus_one_ptid)) - tid = -1; - else if (n > 1) - tid = -1; - else - /* Yes, we're ignoring resume_info[0].thread. It'd be tricky to make - the Windows resume code do the right thing for thread switching. */ - tid = current_event.dwThreadId; - - if (!ptid_equal (resume_info[0].thread, minus_one_ptid)) - { - sig = resume_info[0].sig; - step = resume_info[0].kind == resume_step; - } - else - { - sig = 0; - step = 0; - } - - if (sig != TARGET_SIGNAL_0) - { - if (current_event.dwDebugEventCode != EXCEPTION_DEBUG_EVENT) - { - OUTMSG (("Cannot continue with signal %d here.\n", sig)); - } - else if (sig == last_sig) - continue_status = DBG_EXCEPTION_NOT_HANDLED; - else - OUTMSG (("Can only continue with recieved signal %d.\n", last_sig)); - } - - last_sig = TARGET_SIGNAL_0; - - /* Get context for the currently selected thread. */ - ptid = debug_event_ptid (¤t_event); - th = thread_rec (ptid, FALSE); - if (th) - { - if (th->context.ContextFlags) - { - /* Move register values from the inferior into the thread - context structure. */ - regcache_invalidate (); - - if (step) - { - if (the_low_target.single_step != NULL) - (*the_low_target.single_step) (th); - else - error ("Single stepping is not supported " - "in this configuration.\n"); - } - - win32_set_thread_context (th); - th->context.ContextFlags = 0; - } - } - - /* Allow continuing with the same signal that interrupted us. - Otherwise complain. */ - - child_continue (continue_status, tid); -} - -static void -win32_add_one_solib (const char *name, CORE_ADDR load_addr) -{ - char buf[MAX_PATH + 1]; - char buf2[MAX_PATH + 1]; - -#ifdef _WIN32_WCE - WIN32_FIND_DATA w32_fd; - WCHAR wname[MAX_PATH + 1]; - mbstowcs (wname, name, MAX_PATH); - HANDLE h = FindFirstFile (wname, &w32_fd); -#else - WIN32_FIND_DATAA w32_fd; - HANDLE h = FindFirstFileA (name, &w32_fd); -#endif - - if (h == INVALID_HANDLE_VALUE) - strcpy (buf, name); - else - { - FindClose (h); - strcpy (buf, name); -#ifndef _WIN32_WCE - { - char cwd[MAX_PATH + 1]; - char *p; - if (GetCurrentDirectoryA (MAX_PATH + 1, cwd)) - { - p = strrchr (buf, '\\'); - if (p) - p[1] = '\0'; - SetCurrentDirectoryA (buf); - GetFullPathNameA (w32_fd.cFileName, MAX_PATH, buf, &p); - SetCurrentDirectoryA (cwd); - } - } -#endif - } - -#ifndef _WIN32_WCE - if (strcasecmp (buf, "ntdll.dll") == 0) - { - GetSystemDirectoryA (buf, sizeof (buf)); - strcat (buf, "\\ntdll.dll"); - } -#endif - -#ifdef __CYGWIN__ - cygwin_conv_path (CCP_WIN_A_TO_POSIX, buf, buf2, sizeof (buf2)); -#else - strcpy (buf2, buf); -#endif - - loaded_dll (buf2, load_addr); -} - -static char * -get_image_name (HANDLE h, void *address, int unicode) -{ - static char buf[(2 * MAX_PATH) + 1]; - DWORD size = unicode ? sizeof (WCHAR) : sizeof (char); - char *address_ptr; - int len = 0; - char b[2]; - SIZE_T done; - - /* Attempt to read the name of the dll that was detected. - This is documented to work only when actively debugging - a program. It will not work for attached processes. */ - if (address == NULL) - return NULL; - -#ifdef _WIN32_WCE - /* Windows CE reports the address of the image name, - instead of an address of a pointer into the image name. */ - address_ptr = address; -#else - /* See if we could read the address of a string, and that the - address isn't null. */ - if (!ReadProcessMemory (h, address, &address_ptr, - sizeof (address_ptr), &done) - || done != sizeof (address_ptr) - || !address_ptr) - return NULL; -#endif - - /* Find the length of the string */ - while (ReadProcessMemory (h, address_ptr + len++ * size, &b, size, &done) - && (b[0] != 0 || b[size - 1] != 0) && done == size) - continue; - - if (!unicode) - ReadProcessMemory (h, address_ptr, buf, len, &done); - else - { - WCHAR *unicode_address = (WCHAR *) alloca (len * sizeof (WCHAR)); - ReadProcessMemory (h, address_ptr, unicode_address, len * sizeof (WCHAR), - &done); - - WideCharToMultiByte (CP_ACP, 0, unicode_address, len, buf, len, 0, 0); - } - - return buf; -} - -typedef BOOL (WINAPI *winapi_EnumProcessModules) (HANDLE, HMODULE *, - DWORD, LPDWORD); -typedef BOOL (WINAPI *winapi_GetModuleInformation) (HANDLE, HMODULE, - LPMODULEINFO, DWORD); -typedef DWORD (WINAPI *winapi_GetModuleFileNameExA) (HANDLE, HMODULE, - LPSTR, DWORD); - -static winapi_EnumProcessModules win32_EnumProcessModules; -static winapi_GetModuleInformation win32_GetModuleInformation; -static winapi_GetModuleFileNameExA win32_GetModuleFileNameExA; - -static BOOL -load_psapi (void) -{ - static int psapi_loaded = 0; - static HMODULE dll = NULL; - - if (!psapi_loaded) - { - psapi_loaded = 1; - dll = LoadLibrary (TEXT("psapi.dll")); - if (!dll) - return FALSE; - win32_EnumProcessModules = - GETPROCADDRESS (dll, EnumProcessModules); - win32_GetModuleInformation = - GETPROCADDRESS (dll, GetModuleInformation); - win32_GetModuleFileNameExA = - GETPROCADDRESS (dll, GetModuleFileNameExA); - } - - return (win32_EnumProcessModules != NULL - && win32_GetModuleInformation != NULL - && win32_GetModuleFileNameExA != NULL); -} - -static int -psapi_get_dll_name (LPVOID BaseAddress, char *dll_name_ret) -{ - DWORD len; - MODULEINFO mi; - size_t i; - HMODULE dh_buf[1]; - HMODULE *DllHandle = dh_buf; - DWORD cbNeeded; - BOOL ok; - - if (!load_psapi ()) - goto failed; - - cbNeeded = 0; - ok = (*win32_EnumProcessModules) (current_process_handle, - DllHandle, - sizeof (HMODULE), - &cbNeeded); - - if (!ok || !cbNeeded) - goto failed; - - DllHandle = (HMODULE *) alloca (cbNeeded); - if (!DllHandle) - goto failed; - - ok = (*win32_EnumProcessModules) (current_process_handle, - DllHandle, - cbNeeded, - &cbNeeded); - if (!ok) - goto failed; - - for (i = 0; i < ((size_t) cbNeeded / sizeof (HMODULE)); i++) - { - if (!(*win32_GetModuleInformation) (current_process_handle, - DllHandle[i], - &mi, - sizeof (mi))) - { - DWORD err = GetLastError (); - error ("Can't get module info: (error %d): %s\n", - (int) err, strwinerror (err)); - } - - if (mi.lpBaseOfDll == BaseAddress) - { - len = (*win32_GetModuleFileNameExA) (current_process_handle, - DllHandle[i], - dll_name_ret, - MAX_PATH); - if (len == 0) - { - DWORD err = GetLastError (); - error ("Error getting dll name: (error %d): %s\n", - (int) err, strwinerror (err)); - } - return 1; - } - } - -failed: - dll_name_ret[0] = '\0'; - return 0; -} - -typedef HANDLE (WINAPI *winapi_CreateToolhelp32Snapshot) (DWORD, DWORD); -typedef BOOL (WINAPI *winapi_Module32First) (HANDLE, LPMODULEENTRY32); -typedef BOOL (WINAPI *winapi_Module32Next) (HANDLE, LPMODULEENTRY32); - -static winapi_CreateToolhelp32Snapshot win32_CreateToolhelp32Snapshot; -static winapi_Module32First win32_Module32First; -static winapi_Module32Next win32_Module32Next; -#ifdef _WIN32_WCE -typedef BOOL (WINAPI *winapi_CloseToolhelp32Snapshot) (HANDLE); -static winapi_CloseToolhelp32Snapshot win32_CloseToolhelp32Snapshot; -#endif - -static BOOL -load_toolhelp (void) -{ - static int toolhelp_loaded = 0; - static HMODULE dll = NULL; - - if (!toolhelp_loaded) - { - toolhelp_loaded = 1; -#ifndef _WIN32_WCE - dll = GetModuleHandle (_T("KERNEL32.DLL")); -#else - dll = LoadLibrary (L"TOOLHELP.DLL"); -#endif - if (!dll) - return FALSE; - - win32_CreateToolhelp32Snapshot = - GETPROCADDRESS (dll, CreateToolhelp32Snapshot); - win32_Module32First = GETPROCADDRESS (dll, Module32First); - win32_Module32Next = GETPROCADDRESS (dll, Module32Next); -#ifdef _WIN32_WCE - win32_CloseToolhelp32Snapshot = - GETPROCADDRESS (dll, CloseToolhelp32Snapshot); -#endif - } - - return (win32_CreateToolhelp32Snapshot != NULL - && win32_Module32First != NULL - && win32_Module32Next != NULL -#ifdef _WIN32_WCE - && win32_CloseToolhelp32Snapshot != NULL -#endif - ); -} - -static int -toolhelp_get_dll_name (LPVOID BaseAddress, char *dll_name_ret) -{ - HANDLE snapshot_module; - MODULEENTRY32 modEntry = { sizeof (MODULEENTRY32) }; - int found = 0; - - if (!load_toolhelp ()) - return 0; - - snapshot_module = win32_CreateToolhelp32Snapshot (TH32CS_SNAPMODULE, - current_event.dwProcessId); - if (snapshot_module == INVALID_HANDLE_VALUE) - return 0; - - /* Ignore the first module, which is the exe. */ - if (win32_Module32First (snapshot_module, &modEntry)) - while (win32_Module32Next (snapshot_module, &modEntry)) - if (modEntry.modBaseAddr == BaseAddress) - { -#ifdef UNICODE - wcstombs (dll_name_ret, modEntry.szExePath, MAX_PATH + 1); -#else - strcpy (dll_name_ret, modEntry.szExePath); -#endif - found = 1; - break; - } - -#ifdef _WIN32_WCE - win32_CloseToolhelp32Snapshot (snapshot_module); -#else - CloseHandle (snapshot_module); -#endif - return found; -} - -static void -handle_load_dll (void) -{ - LOAD_DLL_DEBUG_INFO *event = ¤t_event.u.LoadDll; - char dll_buf[MAX_PATH + 1]; - char *dll_name = NULL; - CORE_ADDR load_addr; - - dll_buf[0] = dll_buf[sizeof (dll_buf) - 1] = '\0'; - - /* Windows does not report the image name of the dlls in the debug - event on attaches. We resort to iterating over the list of - loaded dlls looking for a match by image base. */ - if (!psapi_get_dll_name (event->lpBaseOfDll, dll_buf)) - { - if (!server_waiting) - /* On some versions of Windows and Windows CE, we can't create - toolhelp snapshots while the inferior is stopped in a - LOAD_DLL_DEBUG_EVENT due to a dll load, but we can while - Windows is reporting the already loaded dlls. */ - toolhelp_get_dll_name (event->lpBaseOfDll, dll_buf); - } - - dll_name = dll_buf; - - if (*dll_name == '\0') - dll_name = get_image_name (current_process_handle, - event->lpImageName, event->fUnicode); - if (!dll_name) - return; - - /* The symbols in a dll are offset by 0x1000, which is the - offset from 0 of the first byte in an image - because - of the file header and the section alignment. */ - - load_addr = (CORE_ADDR) (uintptr_t) event->lpBaseOfDll + 0x1000; - win32_add_one_solib (dll_name, load_addr); -} - -static void -handle_unload_dll (void) -{ - CORE_ADDR load_addr = - (CORE_ADDR) (uintptr_t) current_event.u.UnloadDll.lpBaseOfDll; - load_addr += 0x1000; - unloaded_dll (NULL, load_addr); -} - -static void -handle_exception (struct target_waitstatus *ourstatus) -{ - DWORD code = current_event.u.Exception.ExceptionRecord.ExceptionCode; - - ourstatus->kind = TARGET_WAITKIND_STOPPED; - - switch (code) - { - case EXCEPTION_ACCESS_VIOLATION: - OUTMSG2 (("EXCEPTION_ACCESS_VIOLATION")); - ourstatus->value.sig = TARGET_SIGNAL_SEGV; - break; - case STATUS_STACK_OVERFLOW: - OUTMSG2 (("STATUS_STACK_OVERFLOW")); - ourstatus->value.sig = TARGET_SIGNAL_SEGV; - break; - case STATUS_FLOAT_DENORMAL_OPERAND: - OUTMSG2 (("STATUS_FLOAT_DENORMAL_OPERAND")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: - OUTMSG2 (("EXCEPTION_ARRAY_BOUNDS_EXCEEDED")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_INEXACT_RESULT: - OUTMSG2 (("STATUS_FLOAT_INEXACT_RESULT")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_INVALID_OPERATION: - OUTMSG2 (("STATUS_FLOAT_INVALID_OPERATION")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_OVERFLOW: - OUTMSG2 (("STATUS_FLOAT_OVERFLOW")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_STACK_CHECK: - OUTMSG2 (("STATUS_FLOAT_STACK_CHECK")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_UNDERFLOW: - OUTMSG2 (("STATUS_FLOAT_UNDERFLOW")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_DIVIDE_BY_ZERO: - OUTMSG2 (("STATUS_FLOAT_DIVIDE_BY_ZERO")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_INTEGER_DIVIDE_BY_ZERO: - OUTMSG2 (("STATUS_INTEGER_DIVIDE_BY_ZERO")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_INTEGER_OVERFLOW: - OUTMSG2 (("STATUS_INTEGER_OVERFLOW")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case EXCEPTION_BREAKPOINT: - OUTMSG2 (("EXCEPTION_BREAKPOINT")); - ourstatus->value.sig = TARGET_SIGNAL_TRAP; -#ifdef _WIN32_WCE - /* Remove the initial breakpoint. */ - check_breakpoints ((CORE_ADDR) (long) current_event - .u.Exception.ExceptionRecord.ExceptionAddress); -#endif - break; - case DBG_CONTROL_C: - OUTMSG2 (("DBG_CONTROL_C")); - ourstatus->value.sig = TARGET_SIGNAL_INT; - break; - case DBG_CONTROL_BREAK: - OUTMSG2 (("DBG_CONTROL_BREAK")); - ourstatus->value.sig = TARGET_SIGNAL_INT; - break; - case EXCEPTION_SINGLE_STEP: - OUTMSG2 (("EXCEPTION_SINGLE_STEP")); - ourstatus->value.sig = TARGET_SIGNAL_TRAP; - break; - case EXCEPTION_ILLEGAL_INSTRUCTION: - OUTMSG2 (("EXCEPTION_ILLEGAL_INSTRUCTION")); - ourstatus->value.sig = TARGET_SIGNAL_ILL; - break; - case EXCEPTION_PRIV_INSTRUCTION: - OUTMSG2 (("EXCEPTION_PRIV_INSTRUCTION")); - ourstatus->value.sig = TARGET_SIGNAL_ILL; - break; - case EXCEPTION_NONCONTINUABLE_EXCEPTION: - OUTMSG2 (("EXCEPTION_NONCONTINUABLE_EXCEPTION")); - ourstatus->value.sig = TARGET_SIGNAL_ILL; - break; - default: - if (current_event.u.Exception.dwFirstChance) - { - ourstatus->kind = TARGET_WAITKIND_SPURIOUS; - return; - } - OUTMSG2 (("gdbserver: unknown target exception 0x%08lx at 0x%s", - current_event.u.Exception.ExceptionRecord.ExceptionCode, - phex_nz ((uintptr_t) current_event.u.Exception.ExceptionRecord. - ExceptionAddress, sizeof (uintptr_t)))); - ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN; - break; - } - OUTMSG2 (("\n")); - last_sig = ourstatus->value.sig; -} - - -static void -suspend_one_thread (struct inferior_list_entry *entry) -{ - struct thread_info *thread = (struct thread_info *) entry; - win32_thread_info *th = inferior_target_data (thread); - - if (!th->suspended) - { - if (SuspendThread (th->h) == (DWORD) -1) - { - DWORD err = GetLastError (); - OUTMSG (("warning: SuspendThread failed in suspend_one_thread, " - "(error %d): %s\n", (int) err, strwinerror (err))); - } - else - th->suspended = 1; - } -} - -static void -fake_breakpoint_event (void) -{ - OUTMSG2(("fake_breakpoint_event\n")); - - faked_breakpoint = 1; - - memset (¤t_event, 0, sizeof (current_event)); - current_event.dwThreadId = main_thread_id; - current_event.dwDebugEventCode = EXCEPTION_DEBUG_EVENT; - current_event.u.Exception.ExceptionRecord.ExceptionCode - = EXCEPTION_BREAKPOINT; - - for_each_inferior (&all_threads, suspend_one_thread); -} - -#ifdef _WIN32_WCE -static int -auto_delete_breakpoint (CORE_ADDR stop_pc) -{ - return 1; -} -#endif - -/* Get the next event from the child. */ - -static int -get_child_debug_event (struct target_waitstatus *ourstatus) -{ - ptid_t ptid; - - last_sig = TARGET_SIGNAL_0; - ourstatus->kind = TARGET_WAITKIND_SPURIOUS; - - /* Check if GDB sent us an interrupt request. */ - check_remote_input_interrupt_request (); - - if (soft_interrupt_requested) - { - soft_interrupt_requested = 0; - fake_breakpoint_event (); - goto gotevent; - } - -#ifndef _WIN32_WCE - attaching = 0; -#else - if (attaching) - { - /* WinCE doesn't set an initial breakpoint automatically. To - stop the inferior, we flush all currently pending debug - events -- the thread list and the dll list are always - reported immediatelly without delay, then, we suspend all - threads and pretend we saw a trap at the current PC of the - main thread. - - Contrary to desktop Windows, Windows CE *does* report the dll - names on LOAD_DLL_DEBUG_EVENTs resulting from a - DebugActiveProcess call. This limits the way we can detect - if all the dlls have already been reported. If we get a real - debug event before leaving attaching, the worst that will - happen is the user will see a spurious breakpoint. */ - - current_event.dwDebugEventCode = 0; - if (!WaitForDebugEvent (¤t_event, 0)) - { - OUTMSG2(("no attach events left\n")); - fake_breakpoint_event (); - attaching = 0; - } - else - OUTMSG2(("got attach event\n")); - } - else -#endif - { - /* Keep the wait time low enough for confortable remote - interruption, but high enough so gdbserver doesn't become a - bottleneck. */ - if (!WaitForDebugEvent (¤t_event, 250)) - { - DWORD e = GetLastError(); - - if (e == ERROR_PIPE_NOT_CONNECTED) - { - /* This will happen if the loader fails to succesfully - load the application, e.g., if the main executable - tries to pull in a non-existing export from a - DLL. */ - ourstatus->kind = TARGET_WAITKIND_EXITED; - ourstatus->value.integer = 1; - return 1; - } - - return 0; - } - } - - gotevent: - - switch (current_event.dwDebugEventCode) - { - case CREATE_THREAD_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event CREATE_THREAD_DEBUG_EVENT " - "for pid=%d tid=%x)\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - - /* Record the existence of this thread. */ - child_add_thread (current_event.dwProcessId, - current_event.dwThreadId, - current_event.u.CreateThread.hThread, - current_event.u.CreateThread.lpThreadLocalBase); - break; - - case EXIT_THREAD_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event EXIT_THREAD_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - child_delete_thread (current_event.dwProcessId, - current_event.dwThreadId); - - current_inferior = (struct thread_info *) all_threads.head; - return 1; - - case CREATE_PROCESS_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event CREATE_PROCESS_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - CloseHandle (current_event.u.CreateProcessInfo.hFile); - - current_process_handle = current_event.u.CreateProcessInfo.hProcess; - main_thread_id = current_event.dwThreadId; - - ourstatus->kind = TARGET_WAITKIND_EXECD; - ourstatus->value.execd_pathname = "Main executable"; - - /* Add the main thread. */ - child_add_thread (current_event.dwProcessId, - main_thread_id, - current_event.u.CreateProcessInfo.hThread, - current_event.u.CreateProcessInfo.lpThreadLocalBase); - - ourstatus->value.related_pid = debug_event_ptid (¤t_event); -#ifdef _WIN32_WCE - if (!attaching) - { - /* Windows CE doesn't set the initial breakpoint - automatically like the desktop versions of Windows do. - We add it explicitly here. It will be removed as soon as - it is hit. */ - set_breakpoint_at ((CORE_ADDR) (long) current_event.u - .CreateProcessInfo.lpStartAddress, - auto_delete_breakpoint); - } -#endif - break; - - case EXIT_PROCESS_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event EXIT_PROCESS_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - ourstatus->kind = TARGET_WAITKIND_EXITED; - ourstatus->value.integer = current_event.u.ExitProcess.dwExitCode; - child_continue (DBG_CONTINUE, -1); - CloseHandle (current_process_handle); - current_process_handle = NULL; - break; - - case LOAD_DLL_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event LOAD_DLL_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - CloseHandle (current_event.u.LoadDll.hFile); - handle_load_dll (); - - ourstatus->kind = TARGET_WAITKIND_LOADED; - ourstatus->value.sig = TARGET_SIGNAL_TRAP; - break; - - case UNLOAD_DLL_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event UNLOAD_DLL_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - handle_unload_dll (); - ourstatus->kind = TARGET_WAITKIND_LOADED; - ourstatus->value.sig = TARGET_SIGNAL_TRAP; - break; - - case EXCEPTION_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event EXCEPTION_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - handle_exception (ourstatus); - break; - - case OUTPUT_DEBUG_STRING_EVENT: - /* A message from the kernel (or Cygwin). */ - OUTMSG2 (("gdbserver: kernel event OUTPUT_DEBUG_STRING_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - handle_output_debug_string (ourstatus); - break; - - default: - OUTMSG2 (("gdbserver: kernel event unknown " - "for pid=%d tid=%x code=%ld\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId, - current_event.dwDebugEventCode)); - break; - } - - ptid = debug_event_ptid (¤t_event); - current_inferior = - (struct thread_info *) find_inferior_id (&all_threads, ptid); - return 1; -} - -/* Wait for the inferior process to change state. - STATUS will be filled in with a response code to send to GDB. - Returns the signal which caused the process to stop. */ -static ptid_t -win32_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options) -{ - struct regcache *regcache; - - while (1) - { - if (!get_child_debug_event (ourstatus)) - continue; - - switch (ourstatus->kind) - { - case TARGET_WAITKIND_EXITED: - OUTMSG2 (("Child exited with retcode = %x\n", - ourstatus->value.integer)); - win32_clear_inferiors (); - return pid_to_ptid (current_event.dwProcessId); - case TARGET_WAITKIND_STOPPED: - case TARGET_WAITKIND_LOADED: - OUTMSG2 (("Child Stopped with signal = %d \n", - ourstatus->value.sig)); - - regcache = get_thread_regcache (current_inferior, 1); - child_fetch_inferior_registers (regcache, -1); - - if (ourstatus->kind == TARGET_WAITKIND_LOADED - && !server_waiting) - { - /* When gdb connects, we want to be stopped at the - initial breakpoint, not in some dll load event. */ - child_continue (DBG_CONTINUE, -1); - break; - } - - /* We don't expose _LOADED events to gdbserver core. See - the `dlls_changed' global. */ - if (ourstatus->kind == TARGET_WAITKIND_LOADED) - ourstatus->kind = TARGET_WAITKIND_STOPPED; - - return debug_event_ptid (¤t_event); - default: - OUTMSG (("Ignoring unknown internal event, %d\n", ourstatus->kind)); - /* fall-through */ - case TARGET_WAITKIND_SPURIOUS: - case TARGET_WAITKIND_EXECD: - /* do nothing, just continue */ - child_continue (DBG_CONTINUE, -1); - break; - } - } -} - -/* Fetch registers from the inferior process. - If REGNO is -1, fetch all registers; otherwise, fetch at least REGNO. */ -static void -win32_fetch_inferior_registers (struct regcache *regcache, int regno) -{ - child_fetch_inferior_registers (regcache, regno); -} - -/* Store registers to the inferior process. - If REGNO is -1, store all registers; otherwise, store at least REGNO. */ -static void -win32_store_inferior_registers (struct regcache *regcache, int regno) -{ - child_store_inferior_registers (regcache, regno); -} - -/* Read memory from the inferior process. This should generally be - called through read_inferior_memory, which handles breakpoint shadowing. - Read LEN bytes at MEMADDR into a buffer at MYADDR. */ -static int -win32_read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - return child_xfer_memory (memaddr, (char *) myaddr, len, 0, 0) != len; -} - -/* Write memory to the inferior process. This should generally be - called through write_inferior_memory, which handles breakpoint shadowing. - Write LEN bytes from the buffer at MYADDR to MEMADDR. - Returns 0 on success and errno on failure. */ -static int -win32_write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr, - int len) -{ - return child_xfer_memory (memaddr, (char *) myaddr, len, 1, 0) != len; -} - -/* Send an interrupt request to the inferior process. */ -static void -win32_request_interrupt (void) -{ - winapi_DebugBreakProcess DebugBreakProcess; - winapi_GenerateConsoleCtrlEvent GenerateConsoleCtrlEvent; - -#ifdef _WIN32_WCE - HMODULE dll = GetModuleHandle (_T("COREDLL.DLL")); -#else - HMODULE dll = GetModuleHandle (_T("KERNEL32.DLL")); -#endif - - GenerateConsoleCtrlEvent = GETPROCADDRESS (dll, GenerateConsoleCtrlEvent); - - if (GenerateConsoleCtrlEvent != NULL - && GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, current_process_id)) - return; - - /* GenerateConsoleCtrlEvent can fail if process id being debugged is - not a process group id. - Fallback to XP/Vista 'DebugBreakProcess', which generates a - breakpoint exception in the interior process. */ - - DebugBreakProcess = GETPROCADDRESS (dll, DebugBreakProcess); - - if (DebugBreakProcess != NULL - && DebugBreakProcess (current_process_handle)) - return; - - /* Last resort, suspend all threads manually. */ - soft_interrupt_requested = 1; -} - -#ifdef _WIN32_WCE -int -win32_error_to_fileio_error (DWORD err) -{ - switch (err) - { - case ERROR_BAD_PATHNAME: - case ERROR_FILE_NOT_FOUND: - case ERROR_INVALID_NAME: - case ERROR_PATH_NOT_FOUND: - return FILEIO_ENOENT; - case ERROR_CRC: - case ERROR_IO_DEVICE: - case ERROR_OPEN_FAILED: - return FILEIO_EIO; - case ERROR_INVALID_HANDLE: - return FILEIO_EBADF; - case ERROR_ACCESS_DENIED: - case ERROR_SHARING_VIOLATION: - return FILEIO_EACCES; - case ERROR_NOACCESS: - return FILEIO_EFAULT; - case ERROR_BUSY: - return FILEIO_EBUSY; - case ERROR_ALREADY_EXISTS: - case ERROR_FILE_EXISTS: - return FILEIO_EEXIST; - case ERROR_BAD_DEVICE: - return FILEIO_ENODEV; - case ERROR_DIRECTORY: - return FILEIO_ENOTDIR; - case ERROR_FILENAME_EXCED_RANGE: - case ERROR_INVALID_DATA: - case ERROR_INVALID_PARAMETER: - case ERROR_NEGATIVE_SEEK: - return FILEIO_EINVAL; - case ERROR_TOO_MANY_OPEN_FILES: - return FILEIO_EMFILE; - case ERROR_HANDLE_DISK_FULL: - case ERROR_DISK_FULL: - return FILEIO_ENOSPC; - case ERROR_WRITE_PROTECT: - return FILEIO_EROFS; - case ERROR_NOT_SUPPORTED: - return FILEIO_ENOSYS; - } - - return FILEIO_EUNKNOWN; -} - -static void -wince_hostio_last_error (char *buf) -{ - DWORD winerr = GetLastError (); - int fileio_err = win32_error_to_fileio_error (winerr); - sprintf (buf, "F-1,%x", fileio_err); -} -#endif - -/* Write Windows OS Thread Information Block address. */ - -static int -win32_get_tib_address (ptid_t ptid, CORE_ADDR *addr) -{ - win32_thread_info *th; - th = thread_rec (ptid, 0); - if (th == NULL) - return 0; - if (addr != NULL) - *addr = th->thread_local_base; - return 1; -} - -static struct target_ops win32_target_ops = { - win32_create_inferior, - win32_attach, - win32_kill, - win32_detach, - win32_mourn, - win32_join, - win32_thread_alive, - win32_resume, - win32_wait, - win32_fetch_inferior_registers, - win32_store_inferior_registers, - NULL, /* prepare_to_access_memory */ - NULL, /* done_accessing_memory */ - win32_read_inferior_memory, - win32_write_inferior_memory, - NULL, /* lookup_symbols */ - win32_request_interrupt, - NULL, /* read_auxv */ - win32_insert_point, - win32_remove_point, - win32_stopped_by_watchpoint, - win32_stopped_data_address, - NULL, /* read_offsets */ - NULL, /* get_tls_address */ - NULL, /* qxfer_spu */ -#ifdef _WIN32_WCE - wince_hostio_last_error, -#else - hostio_last_error_from_errno, -#endif - NULL, /* qxfer_osdata */ - NULL, /* qxfer_siginfo */ - NULL, /* supports_non_stop */ - NULL, /* async */ - NULL, /* start_non_stop */ - NULL, /* supports_multi_process */ - NULL, /* handle_monitor_command */ - NULL, /* core_of_thread */ - NULL, /* read_loadmap */ - NULL, /* process_qsupported */ - NULL, /* supports_tracepoints */ - NULL, /* read_pc */ - NULL, /* write_pc */ - NULL, /* thread_stopped */ - win32_get_tib_address -}; - -/* Initialize the Win32 backend. */ -void -initialize_low (void) -{ - set_target_ops (&win32_target_ops); - if (the_low_target.breakpoint != NULL) - set_breakpoint_data (the_low_target.breakpoint, - the_low_target.breakpoint_len); - the_low_target.arch_setup (); -} diff --git a/gdb/gdbserver/win32-low.h b/gdb/gdbserver/win32-low.h deleted file mode 100644 index 4099a98be6d..00000000000 --- a/gdb/gdbserver/win32-low.h +++ /dev/null @@ -1,103 +0,0 @@ -/* Internal interfaces for the Win32 specific target code for gdbserver. - Copyright (C) 2007, 2008, 2009, 2010, 2011 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 <windows.h> - -/* Thread information structure used to track extra information about - each thread. */ -typedef struct win32_thread_info -{ - /* The Win32 thread identifier. */ - DWORD tid; - - /* The handle to the thread. */ - HANDLE h; - - /* Thread Information Block address. */ - CORE_ADDR thread_local_base; - - /* Non zero if SuspendThread was called on this thread. */ - int suspended; - -#ifdef _WIN32_WCE - /* The context as retrieved right after suspending the thread. */ - CONTEXT base_context; -#endif - - /* The context of the thread, including any manipulations. */ - CONTEXT context; -} win32_thread_info; - -struct win32_target_ops -{ - /* Architecture-specific setup. */ - void (*arch_setup) (void); - - /* The number of target registers. */ - int num_regs; - - /* Perform initializations on startup. */ - void (*initial_stuff) (void); - - /* Fetch the context from the inferior. */ - void (*get_thread_context) (win32_thread_info *th, - DEBUG_EVENT *current_event); - - /* Flush the context back to the inferior. */ - void (*set_thread_context) (win32_thread_info *th, - DEBUG_EVENT *current_event); - - /* Called when a thread was added. */ - void (*thread_added) (win32_thread_info *th); - - /* Fetch register from gdbserver regcache data. */ - void (*fetch_inferior_register) (struct regcache *regcache, - win32_thread_info *th, int r); - - /* Store a new register value into the thread context of TH. */ - void (*store_inferior_register) (struct regcache *regcache, - win32_thread_info *th, int r); - - void (*single_step) (win32_thread_info *th); - - const unsigned char *breakpoint; - int breakpoint_len; - - /* Breakpoint/Watchpoint related functions. See target.h for comments. */ - int (*insert_point) (char type, CORE_ADDR addr, int len); - int (*remove_point) (char type, CORE_ADDR addr, int len); - int (*stopped_by_watchpoint) (void); - CORE_ADDR (*stopped_data_address) (void); -}; - -extern struct win32_target_ops the_low_target; - -/* Map the Windows error number in ERROR to a locale-dependent error - message string and return a pointer to it. Typically, the values - for ERROR come from GetLastError. - - The string pointed to shall not be modified by the application, - but may be overwritten by a subsequent call to strwinerror - - The strwinerror function does not change the current setting - of GetLastError. */ -extern char * strwinerror (DWORD error); - -/* in wincecompat.c */ - -extern void to_back_slashes (char *); diff --git a/gdb/gdbserver/wincecompat.c b/gdb/gdbserver/wincecompat.c deleted file mode 100644 index 03b3e3b2058..00000000000 --- a/gdb/gdbserver/wincecompat.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Compatibility routines for Windows CE. - Copyright (C) 2007, 2008, 2009, 2010, 2011 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 <stdio.h> -#include <windows.h> - -void -perror (const char *s) -{ - if (s && *s) - fprintf (stderr, "%s: %s\n", s, strwinerror (GetLastError ())); - else - fprintf (stderr, "%s\n", strwinerror (GetLastError ())); -} - -void -to_back_slashes (char *path) -{ - for (; *path; ++path) - if ('/' == *path) - *path = '\\'; -} diff --git a/gdb/gdbserver/wincecompat.h b/gdb/gdbserver/wincecompat.h deleted file mode 100644 index e147c22b190..00000000000 --- a/gdb/gdbserver/wincecompat.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Compatibility routines for Windows CE. - Copyright (C) 2007, 2008, 2009, 2010, 2011 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/>. */ - -#ifndef WINCECOMPAT_H -#define WINCECOMPAT_H - -#include <windows.h> - -#define errno (GetLastError ()) - -/* in win32-low.c */ -extern char * strwinerror (DWORD error); -#define strerror strwinerror - -#endif diff --git a/gdb/gdbserver/xtensa-xtregs.c b/gdb/gdbserver/xtensa-xtregs.c deleted file mode 100644 index 78698f00d70..00000000000 --- a/gdb/gdbserver/xtensa-xtregs.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Table mapping between kernel xtregset and GDB register cache. - Copyright 2007, 2008, 2009, 2010, 2011 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/>. */ - - -typedef struct { - int gdb_regnum; - int gdb_offset; - int ptrace_cp_offset; - int ptrace_offset; - int size; - int coproc; - int dbnum; - char* name -;} xtensa_regtable_t; - -#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 } -}; |