diff options
author | Siva Chandra Reddy <sivachandra@sourceware.org> | 2013-04-15 20:37:37 +0000 |
---|---|---|
committer | Siva Chandra Reddy <sivachandra@sourceware.org> | 2013-04-15 20:37:37 +0000 |
commit | a0d3f2f58f9dab54cab0c50658431823f3749ea9 (patch) | |
tree | dab2b5ee7246d8ee840a9452c1c7120c43f13edb | |
parent | b340913d3d295229cd5d1907bce58b4dbd9361a0 (diff) | |
download | gdb-a0d3f2f58f9dab54cab0c50658431823f3749ea9.zip gdb-a0d3f2f58f9dab54cab0c50658431823f3749ea9.tar.gz gdb-a0d3f2f58f9dab54cab0c50658431823f3749ea9.tar.bz2 |
2013-04-15 Siva Chandra Reddy <sivachandra@google.com>
Add option to link testcases with Pthreads library when
using 'prepare_for_testing' in tests.
testsuite/
* lib/gdb.exp (build_executable_from_specs): Use
gdb_compile_pthreads to compile if option "pthreads" is
specified.
-rw-r--r-- | gdb/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 20 |
2 files changed, 24 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a35d9ed..b51758a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2013-04-15 Siva Chandra Reddy <sivachandra@google.com> + + Add option to link testcases with Pthreads library when + using 'prepare_for_testing' in tests. + + * lib/gdb.exp (build_executable_from_specs): Use + gdb_compile_pthreads to compile if option "pthreads" is + specified. + 2013-04-15 Tom Tromey <tromey@redhat.com> * gdb.cp/exceptprint.exp: Add regexp catchpoint tests. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 3273bf4..06e1226 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3995,7 +3995,8 @@ proc test_prefix_command_help { command_list expected_initial_lines args } { # different options to be passed to different sub-compilations. # TESTNAME is the name of the test; this is passed to 'untested' if # something fails. -# OPTIONS is passed to the final link, using gdb_compile. +# OPTIONS is passed to the final link, using gdb_compile. If OPTIONS +# contains the option "pthreads", then gdb_compile_pthreads is used. # ARGS is a flat list of source specifications, of the form: # { SOURCE1 OPTIONS1 [ SOURCE2 OPTIONS2 ]... } # Each SOURCE is compiled to an object file using its OPTIONS, @@ -4017,10 +4018,19 @@ proc build_executable_from_specs {testname executable options args} { lappend objects "${binfile}${i}.o" incr i } - - if { [gdb_compile $objects "${binfile}" executable $options] != "" } { - untested $testname - return -1 + + set pthreads [lsearch -exact $options "pthreads"] + if { $pthreads >= 0 } { + set options [lreplace $options $pthreads $pthreads] + if { [gdb_compile_pthreads $objects "${binfile}" executable $options] != "" } { + untested $testname + return -1 + } + } else { + if { [gdb_compile $objects "${binfile}" executable $options] != "" } { + untested $testname + return -1 + } } set info_options "" |