]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/testsuite/
authorYao Qi <yao@codesourcery.com>
Wed, 14 Nov 2012 05:52:32 +0000 (05:52 +0000)
committerYao Qi <yao@codesourcery.com>
Wed, 14 Nov 2012 05:52:32 +0000 (05:52 +0000)
2012-11-14  Yao Qi  <yao@codesourcery.com>

* gdb.threads/manythreads.c [DEBUG]: Include "stdio.h".
(thread_function) [DEBUG]: Call 'printf'.
* gdb.threads/manythreads.exp: Pass '-DDEBUG' to compilation
command line if 'DEBUG=1' is passed to test.
Remove a pattern to match inferior's output.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/manythreads.c
gdb/testsuite/gdb.threads/manythreads.exp

index 289f1155b589b0b890da3a8f27e4be56b9f0d70c..4ef90646563092283642633bb3a90484a4121e9f 100644 (file)
@@ -1,3 +1,11 @@
+2012-11-14  Yao Qi  <yao@codesourcery.com>
+
+       * gdb.threads/manythreads.c [DEBUG]: Include "stdio.h".
+       (thread_function) [DEBUG]: Call 'printf'.
+       * gdb.threads/manythreads.exp: Pass '-DDEBUG' to compilation
+       command line if 'DEBUG=1' is passed to test.
+       Remove a pattern to match inferior's output.
+
 2012-11-13  Giuseppe Montalto  <giuseppe.montalto@st.com>
 
        * gdb.mi/mi-fill-memory.exp: New test.
index a622d998da1df0825f1f2e02ec8b0f65e6e8c951..8cef148ca9884f27fd8855e35c40428946768582 100644 (file)
@@ -20,7 +20,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <pthread.h>
+#ifdef DEBUG
 #include <stdio.h>
+#endif
 #include <limits.h>
 
 void *
@@ -28,7 +30,9 @@ thread_function (void *arg)
 {
   int x = * (int *) arg;
 
+#ifdef DEBUG
   printf ("Thread <%d> executing\n", x);
+#endif /* DEBUG */
 
   return NULL;
 }
index c863ee19c6e9984a99c2038e4a3a0bb2b01581cd..b06a34aae5e51fad81f33e5235f2f583ec51596e 100644 (file)
 
 standard_testfile
 
-if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable debug] != "" } {
+set opts { debug }
+if [info exists DEBUG] {
+    # make check RUNTESTFLAGS='gdb.threads/manythreads.exp DEBUG=1'
+    lappend opts "additional_flags=-DDEBUG"
+}
+
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts] != "" } {
     return -1
 }
 
@@ -59,9 +65,6 @@ gdb_test_multiple "" "stop threads 1" {
   -re "\\\[\[^\]\]* exited\\\]\r\n" {
     exp_continue
   }
-  -re "Thread \[^\n\]* executing\r\n" {
-    exp_continue
-  }
   -re "Program received signal SIGINT.*$gdb_prompt $" {
     pass "$message"
   }
@@ -113,9 +116,6 @@ remote_expect host 1 {
   -re "\\\[\[^\]\]* exited\\\]\r\n" {
     exp_continue -continue_timer
   }
-  -re "Thread \[^\n\]* executing\r\n" {
-    exp_continue -continue_timer
-  }
   -re "Program received signal SIGINT.*$gdb_prompt $" {
     if { $failed == 0 } {
       fail "check for duplicate SIGINT"
@@ -141,9 +141,6 @@ gdb_test_multiple "" "stop threads 2" {
   -re "\\\[\[^\]\]* exited\\\]\r\n" {
     exp_continue
   }
-  -re "Thread \[^\n\]* executing\r\n" {
-    exp_continue
-  }
   -re "Program received signal SIGINT.*$gdb_prompt $" {
     pass "$message"
   }