This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC][testsuite] Add option to link testcases with pthreads when using 'prepare_for_testing'
- From: Tom Tromey <tromey at redhat dot com>
- To: Siva Chandra <sivachandra at google dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Fri, 12 Apr 2013 14:56:52 -0600
- Subject: Re: [RFC][testsuite] Add option to link testcases with pthreads when using 'prepare_for_testing'
- References: <CAGyQ6gyQ8+Txgam=W9+PCdFP1Uy_VHJrK3JM2pL=ZwpYVqjedA at mail dot gmail dot com>
>>>>> "Siva" == Siva Chandra <sivachandra@google.com> writes:
Siva> The attached patch allows one to specify an option 'with_pthreads'
Siva> when using 'prepare_for_testing' in tests. One could call
Siva> gdb_compile_pthreads directly for such a purpose, but I think using
Siva> 'prepare_for_testing' is the suggested approach. If my understanding
Siva> or approach is wrong here, then what is the best way to make testcases
Siva> to link with pthreads for c++ testcases?
You can use gdb_compile_pthreads and put "c++" in the options.
However, I like your approach. Actually I wish most of the
gdb_compile_* procs would go away and be replaced by a variant of this
idea.
Siva> * lib/gdb.exp (build_executable_from_specs): Use
Siva> gdb_compile_pthreads to compile if option "with_pthreads" is
Siva> specified.
The intro comment to build_executable_from_specs needs an update to note
that with_pthreads is handled locally.
Siva> + if { [lsearch -exact $options "with_pthreads"] >= 0 } {
Siva> + if { [gdb_compile_pthreads $objects "${binfile}" executable $options] != "" } {
I wonder if you need to remove with_pthreads from the options here.
Tom