This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][testsuite] Add option to link testcases with pthreads when using 'prepare_for_testing'


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]