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]

[RFC] win32-nat.c: fix "info threads" test failures


  This one line patch fixes an issue of
testsuite failures due to an assumption in 
several tests that "info threads" should return "Thread "
while it does return "thread " currently for cygwin/mingw32.
  
  The reason why this is a RFC rather than a RFA is that
when I tried to find out where the difference was coming from,
I realized that the process and thread strings used by gdb
where not very uniform and win32-nat.c does not 
seem to be the only place where "thread" is used...
The proc_string function in gnu-nat.c at line 2559 
seems to also use "thread" for the same purpose.

  Of course, another option would be to 
leave the sources unchanged and to only 
change the testsuite by changing all "Thread" into "\[Tt\]hread",
in the tests using "info threads".
 
  Anyhow, as Christopher told recently that he wanted to
reduce the number of differences between the mingw32/cygwin 
gdb port and others, I finally decided to send
the win32-nat.c change as a RFC.


Pierre Muller
Pascal language support maintainer for GDB




ChangeLog entry:
2008-12-18  Pierre Muller  <muller@ics.u-strasbg.fr>

        * win32-nat.c (win32_pid_to_str): Use capital T for "Thread".


Pierre@d620-muller ~/gdbcvs/purecvs
$ cat win32thread.patch
Index: gdb/win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.152
diff -u -p -r1.152 win32-nat.c
--- gdb/win32-nat.c     20 May 2008 18:36:36 -0000      1.152
+++ gdb/win32-nat.c     17 Jun 2008 08:11:26 -0000
@@ -2006,7 +2006,7 @@ win32_pid_to_str (ptid_t ptid)
   if ((DWORD) pid == current_event.dwProcessId)
     sprintf (buf, "process %d", pid);
   else
-    sprintf (buf, "thread %ld.0x%x", current_event.dwProcessId, pid);
+    sprintf (buf, "Thread %ld.0x%x", current_event.dwProcessId, pid);
   return buf;
 }



Differences between testsuite without/with that patch.
--- gdb-cvs.sum 2008-06-19 00:26:27.968750000 +0200
+++ gdb-win32thread.sum 2008-06-19 01:42:19.421875000 +0200
@@ -1,4 +1,4 @@
-Test Run By Pierre on Wed Jun 18 23:12:11 2008
+Test Run By Pierre on Thu Jun 19 00:27:04 2008
 Native configuration is i686-pc-cygwin

                === gdb tests ===
@@ -6294,7 +6294,7 @@
 FAIL: gdb.base/signull.exp: code; backtrace from keeper through SIGSEGV
 Running ../../../purecvs/gdb/testsuite/gdb.base/sigrepeat.exp ...
 PASS: gdb.base/sigrepeat.exp: advance to infinite loop
-FAIL: gdb.base/sigrepeat.exp: next (timeout)
+FAIL: gdb.base/sigrepeat.exp: next
 Running ../../../purecvs/gdb/testsuite/gdb.base/sigstep.exp ...
 PASS: gdb.base/sigstep.exp: display/i $pc
 PASS: gdb.base/sigstep.exp: break handler
@@ -11848,7 +11848,7 @@
 PASS: gdb.threads/execl.exp: successfully compiled posix threads test case
 PASS: gdb.threads/execl.exp: set breakpoint at execl
 PASS: gdb.threads/execl.exp: continue to exec
-FAIL: gdb.threads/execl.exp: info threads before exec
+PASS: gdb.threads/execl.exp: info threads before exec
 FAIL: gdb.threads/execl.exp: continue across exec
 PASS: gdb.threads/execl.exp: info threads after exec
 PASS: gdb.threads/execl.exp: info threads after exec
@@ -11908,7 +11908,37 @@
 PASS: gdb.threads/pthreads.exp: set print sevenbit-strings
 PASS: gdb.threads/pthreads.exp: set width 0
 PASS: gdb.threads/pthreads.exp: shell stty intr '^C'
-UNSUPPORTED: gdb.threads/pthreads.exp: gdb does not support pthreads for
this m
achine
+PASS: gdb.threads/pthreads.exp: info threads
+PASS: gdb.threads/pthreads.exp: break thread1
+FAIL: gdb.threads/pthreads.exp: Continue to creation of first thread (the
progr
am exited)
+PASS: gdb.threads/pthreads.exp: disable
+FAIL: gdb.threads/pthreads.exp: break thread2
+FAIL: gdb.threads/pthreads.exp: Continue to creation of second thread (the
prog
ram is no longer running)
+PASS: gdb.threads/pthreads.exp: set var common_routine::hits=0
+PASS: gdb.threads/pthreads.exp: set var common_routine::from_thread1=0
+PASS: gdb.threads/pthreads.exp: set var common_routine::from_thread2=0
+PASS: gdb.threads/pthreads.exp: set var common_routine::from_main=0
+PASS: gdb.threads/pthreads.exp: set var common_routine::full_coverage=0
+PASS: gdb.threads/pthreads.exp: disable
+PASS: gdb.threads/pthreads.exp: tbreak common_routine if hits >= 15
+FAIL: gdb.threads/pthreads.exp: continue until common routine run 15 times
+FAIL: gdb.threads/pthreads.exp: Continue with all threads running (timeout)
+PASS: gdb.threads/pthreads.exp: Stopped with a ^C
+PASS: gdb.threads/pthreads.exp: bt
+PASS: gdb.threads/pthreads.exp: set var common_routine::hits=0
+PASS: gdb.threads/pthreads.exp: set var common_routine::from_thread1=0
+PASS: gdb.threads/pthreads.exp: set var common_routine::from_thread2=0
+PASS: gdb.threads/pthreads.exp: set var common_routine::from_main=0
+PASS: gdb.threads/pthreads.exp: set var common_routine::full_coverage=0
+PASS: gdb.threads/pthreads.exp: disable
+PASS: gdb.threads/pthreads.exp: tbreak common_routine if hits >= 15
+FAIL: gdb.threads/pthreads.exp: continue until common routine run 15 times
+FAIL: gdb.threads/pthreads.exp: check backtrace from main thread (the
program i
s no longer running)
+FAIL: gdb.threads/pthreads.exp: check backtrace from thread 1
+FAIL: gdb.threads/pthreads.exp: check backtrace from thread 2
+FAIL: gdb.threads/pthreads.exp: apply backtrace command to all three
threads
+PASS: gdb.threads/pthreads.exp: set break at common_routine in thread 2
+FAIL: gdb.threads/pthreads.exp: continue to bkpt at common_routine in
thread 2
 Running ../../../purecvs/gdb/testsuite/gdb.threads/schedlock.exp ...
 PASS: gdb.threads/schedlock.exp: successfully compiled posix threads test
case
 PASS: gdb.threads/schedlock.exp: shell stty intr '^C'
@@ -11930,7 +11960,9 @@
 PASS: gdb.threads/thread-specific.exp: set print sevenbit-strings
 PASS: gdb.threads/thread-specific.exp: set width 0
 PASS: gdb.threads/thread-specific.exp: continue to breakpoint: all threads
star
ted
-FAIL: gdb.threads/thread-specific.exp: get threads list (no threads)
+PASS: gdb.threads/thread-specific.exp: get threads list
+PASS: gdb.threads/thread-specific.exp: breakpoint 59 main thread
+PASS: gdb.threads/thread-specific.exp: continue to thread-specific
breakpoint
 Running ../../../purecvs/gdb/testsuite/gdb.threads/thread_check.exp ...
 PASS: gdb.threads/thread_check.exp: successfully compiled posix threads
test ca
se
 PASS: gdb.threads/thread_check.exp: breakpoint at tf
@@ -12125,13 +12157,13 @@

                === gdb Summary ===

-# of expected passes           10970
-# of unexpected failures       389
+# of expected passes           10994
+# of unexpected failures       398
 # of expected failures         59
 # of unknown successes         2
 # of known failures            23
 # of unresolved testcases      40
 # of untested testcases                14
-# of unsupported tests         23
+# of unsupported tests         22
 /usr/local/src/gdbcvs/build-bare/gdb/testsuite/../../gdb/gdb version
6.8.50.20
080618-cvs -nx



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