* gdb.threads/linux-dp.c (shared_random): Call rand instead of rand_r.
authorDoug Evans <dje@google.com>
Wed, 3 Mar 2010 22:13:51 +0000 (22:13 +0000)
committerDoug Evans <dje@google.com>
Wed, 3 Mar 2010 22:13:51 +0000 (22:13 +0000)
* gdb.threads/linux-dp.exp: Compile with gdb_compile_pthreads instead
of gdb_compile.  Add another pattern to match android backtrace.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/linux-dp.c
gdb/testsuite/gdb.threads/linux-dp.exp

index 7a555645e82e7278d9fe8ec5216b7e0b2a79cee5..963e679c3789c57ce123dd112405478ae46093a6 100644 (file)
@@ -1,3 +1,9 @@
+2010-03-03  Doug Evans  <dje@google.com>
+
+       * gdb.threads/linux-dp.c (shared_random): Call rand instead of rand_r.
+       * gdb.threads/linux-dp.exp: Compile with gdb_compile_pthreads instead
+       of gdb_compile.  Add another pattern to match android backtrace.
+
 2010-03-03  Tom Tromey  <tromey@redhat.com>
 
        PR gdb/11345:
index c3775bd62ae3dcf13d9ce5a0978189cd06734daa..a57938d1886cdaa38a91e373a18655569f8ecdc5 100644 (file)
@@ -71,11 +71,10 @@ shared_printf (char *format, ...)
 int 
 shared_random ()
 {
-  static unsigned int seed;
   int result;
 
   pthread_mutex_lock (&random_mutex);
-  result = rand_r (&seed);
+  result = rand ();
   pthread_mutex_unlock (&random_mutex);
   return result;
 }
index 52b0eae953675e7bc33c6a6eb81fa299f9cfb881..f2f9b036d7b4f1aedcedb1953b56582e36fd7ae4 100644 (file)
@@ -49,7 +49,7 @@ if ![istarget *-*-linux-gnu*] then {
 set testfile "linux-dp"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug libs=-lpthread}] != ""} {
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != ""} {
     return -1
 }
 
@@ -247,11 +247,11 @@ gdb_breakpoint "print_philosopher thread 5"
 gdb_continue_to_breakpoint "thread 5's print"
 # When there is no debugging info available for the thread library,
 # the backtrace entry for philosopher's caller looks like:
-#    #1  0x4001c548 in pthread_create () from /lib/libpthread.so.0
+#    #2  0x4001c548 in pthread_create () from /lib/libpthread.so.0
 # If you do have debug info, the output obviously depends more on the
 # exact library in use; under NPTL, you get:
 #    #2  0x0012b7fc in start_thread (arg=0x21) at pthread_create.c:264
-gdb_test "where" "print_philosopher.*philosopher.* \(from .*libpthread\|at pthread_create\).*" \
+gdb_test "where" "print_philosopher.*philosopher.* \(from .*libpthread\|at pthread_create\|in pthread_create\).*" \
        "first thread-specific breakpoint hit"
 
 # Make sure it's catching the right thread.  Try hitting the
This page took 0.044766 seconds and 4 git commands to generate.