Don't remove files copied to host
authorYao Qi <yao@codesourcery.com>
Mon, 29 Sep 2014 12:47:30 +0000 (20:47 +0800)
committerYao Qi <yao@codesourcery.com>
Mon, 20 Oct 2014 05:34:28 +0000 (13:34 +0800)
commitacbdb7f355f9dfa851dcff3154944a0d96771b0e
treee96ad56f9b500542b0deb11731d858da901ee956
parentc6ecbe44d87c71dc97f5d305c47cc3f7d4510e57
Don't remove files copied to host

Nowadays, if we do in-tree build and run tests sequentially, some source
files are removed, due to the following pattern:

set pi_txt [gdb_remote_download host ${srcdir}/${subdir}/pi.txt]

remote_exec host "rm -f $pi_txt"

If testing is run sequentially, file ${srcdir}/${subdir}/pi.txt is
copied to ${objdir}/${subdir}/pi.txt.  However, ${objdir} is ${srcdir}
in the in-tree build/test, so the file is coped to itself, as a nop.
As a result, the file in source is removed at the end of test.

This patch fixes this problem by not removing files copied to host in
each test.  This patch also addresses the question we've had that why
don't we keep files copied to host because they are needed to reproduce
certain fails.

gdb/testsuite:

2014-10-20  Yao Qi  <yao@codesourcery.com>

* gdb.base/checkpoint.exp: Don't remove file copied on host.
* gdb.base/step-line.exp: Likewise.
* gdb.dwarf2/dw2-anonymous-func.exp: Likewise.
* gdb.dwarf2/dw2-basic.exp: Likewise.
* gdb.dwarf2/dw2-compressed.exp: Likewise.
* gdb.dwarf2/dw2-filename.exp: Likewise.
* gdb.dwarf2/dw2-intercu.exp: Likewise.
* gdb.dwarf2/dw2-intermix.exp: Likewise.
* gdb.dwarf2/dw2-producer.exp: Likewise.
* gdb.dwarf2/mac-fileno.exp: Likewise.
* gdb.python/py-frame-args.exp: Likewise.
* gdb.python/py-framefilter.exp: Likewise.
* gdb.python/py-mi.exp: Likewise.
* gdb.python/py-objfile-script.exp: Likewise
* gdb.python/py-pp-integral.exp: Likewise.
* gdb.python/py-pp-re-notag.exp: Likewise.
* gdb.python/py-prettyprint.exp: Likewise.
* gdb.python/py-section-script.exp: Likewise.
* gdb.python/py-typeprint.exp: Likewise.
* gdb.python/py-xmethods.exp: Likewise.
* gdb.stabs/weird.exp: Likewise.
* gdb.xml/tdesc-regs.exp: Likewise.
23 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/checkpoint.exp
gdb/testsuite/gdb.base/step-line.exp
gdb/testsuite/gdb.dwarf2/dw2-anonymous-func.exp
gdb/testsuite/gdb.dwarf2/dw2-basic.exp
gdb/testsuite/gdb.dwarf2/dw2-compressed.exp
gdb/testsuite/gdb.dwarf2/dw2-filename.exp
gdb/testsuite/gdb.dwarf2/dw2-intercu.exp
gdb/testsuite/gdb.dwarf2/dw2-intermix.exp
gdb/testsuite/gdb.dwarf2/dw2-producer.exp
gdb/testsuite/gdb.dwarf2/mac-fileno.exp
gdb/testsuite/gdb.python/py-frame-args.exp
gdb/testsuite/gdb.python/py-framefilter.exp
gdb/testsuite/gdb.python/py-mi.exp
gdb/testsuite/gdb.python/py-objfile-script.exp
gdb/testsuite/gdb.python/py-pp-integral.exp
gdb/testsuite/gdb.python/py-pp-re-notag.exp
gdb/testsuite/gdb.python/py-prettyprint.exp
gdb/testsuite/gdb.python/py-section-script.exp
gdb/testsuite/gdb.python/py-typeprint.exp
gdb/testsuite/gdb.python/py-xmethods.exp
gdb/testsuite/gdb.stabs/weird.exp
gdb/testsuite/gdb.xml/tdesc-regs.exp