From: Siva Chandra <sivachandra@google.com>
To: gdb-patches <gdb-patches@sourceware.org>
Subject: [RFC][testsuite] Add option to link testcases with pthreads when using 'prepare_for_testing'
Date: Sun, 24 Mar 2013 12:02:00 -0000 [thread overview]
Message-ID: <CAGyQ6gyQ8+Txgam=W9+PCdFP1Uy_VHJrK3JM2pL=ZwpYVqjedA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 740 bytes --]
Hello,
The attached patch allows one to specify an option 'with_pthreads'
when using 'prepare_for_testing' in tests. One could call
gdb_compile_pthreads directly for such a purpose, but I think using
'prepare_for_testing' is the suggested approach. If my understanding
or approach is wrong here, then what is the best way to make testcases
to link with pthreads for c++ testcases?
2013-03-23 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 "with_pthreads" is
specified.
Thanks,
Siva Chandra
[-- Attachment #2: pthreads_option_patch.txt --]
[-- Type: text/plain, Size: 863 bytes --]
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index ee9fdec..ab91cc5 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3997,10 +3997,17 @@ 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
+
+ if { [lsearch -exact $options "with_pthreads"] >= 0 } {
+ 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 ""
next reply other threads:[~2013-03-24 4:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-24 12:02 Siva Chandra [this message]
2013-04-15 9:22 ` Tom Tromey
2013-04-15 18:12 ` Siva Chandra
2013-04-15 18:51 ` Pedro Alves
2013-04-16 5:39 ` Siva Chandra
2013-04-16 5:47 ` Tom Tromey
2013-04-16 7:52 ` Siva Chandra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGyQ6gyQ8+Txgam=W9+PCdFP1Uy_VHJrK3JM2pL=ZwpYVqjedA@mail.gmail.com' \
--to=sivachandra@google.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox