diff options
author | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2014-03-07 10:23:42 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2014-03-12 16:22:18 +0100 |
commit | 0e5c45554bc3d274809e688d3bfb8e5438cc3539 (patch) | |
tree | 549a37d9d6ddce99e85f692c645dadf5db257bbb | |
parent | c792917cdc10a5ada2f4f73ecb39c764756bf994 (diff) | |
download | gdb-0e5c45554bc3d274809e688d3bfb8e5438cc3539.zip gdb-0e5c45554bc3d274809e688d3bfb8e5438cc3539.tar.gz gdb-0e5c45554bc3d274809e688d3bfb8e5438cc3539.tar.bz2 |
gdb.exp: Support absolute path name args in 'prepare_for_testing' etc.
Test cases that produce source files in the build directory have not
been able to use prepare_for_testing and friends. This was because
build_executable_from_specs unconditionally prepended the source
directory path name to its arguments.
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 11 |
2 files changed, 14 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 44fb290..47b586b 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-03-12 Andreas Arnez <arnez@linux.vnet.ibm.com> + + * lib/gdb.exp (build_executable_from_specs): Don't prepend source + directory to absolute path name arguments. + 2014-03-10 Joel Brobecker <brobecker@adacore.com> * gdb.ada/tagged_access: New testcase. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 2d04a8c..4a6f930 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4260,14 +4260,21 @@ proc build_executable_from_specs {testname executable options args} { if [string match gdb_compile_shlib* $func] { set sources_path {} foreach {s local_options} $args { - lappend sources_path "${srcdir}/${subdir}/${s}" + if { [regexp "^/" "$s"] } then { + lappend sources_path "$s" + } else { + lappend sources_path "$srcdir/$subdir/$s" + } } set ret [$func $sources_path "${binfile}" $options] } else { set objects {} set i 0 foreach {s local_options} $args { - if { [gdb_compile "${srcdir}/${subdir}/${s}" "${binfile}${i}.o" object $local_options] != "" } { + if { ! [regexp "^/" "$s"] } then { + set s "$srcdir/$subdir/$s" + } + if { [gdb_compile "${s}" "${binfile}${i}.o" object $local_options] != "" } { untested $testname return -1 } |