* [RFC] switch-threads.exp added tests.
@ 2005-06-14 19:46 Manoj Iyer
2005-06-14 19:50 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Manoj Iyer @ 2005-06-14 19:46 UTC (permalink / raw)
To: gdb-patches
I added couple of tests to explicitly test switching threads. Any
comments/suggestion?
2005-06-14 Manoj Iyer <manjo@austin.ibm.com>
* gdb.base/switch-threads.exp: Added test explicitly changing threads.
--------------------------------------------------------------
--- ./switch-threads.exp 2003-10-09 14:49:28.000000000 -0500
+++ /tmp/switch-threads.exp 2005-06-14 14:01:15.000000000 -0500
@@ -24,8 +24,6 @@
# multi-threaded stubs to reliably get this correct; gdbserver defaulted
# to the first thread.
-# TODO: we should also test explicitly changing threads with the "thread"
-# command.
if $tracelevel then {
strace $tracelevel
@@ -49,4 +47,7 @@ runto_main
gdb_breakpoint thread_func
gdb_continue_to_breakpoint "continue to thread_func"
gdb_test "next" ".*foo \\(\\);"
-
+gdb_test "info threads" "\\* .*2 Thread.*.LWP.* .*thread_func.*"
+gdb_test "thread 1" ".*Switching to thread 1.*"
+gdb_test "next" ".*foo \\(\\).*\[0-9\]*"
+gdb_test "thread 2" ".*Switching to thread 2.*"
-----
manjo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Cogito ergo sum +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [RFC] switch-threads.exp added tests.
2005-06-14 19:46 [RFC] switch-threads.exp added tests Manoj Iyer
@ 2005-06-14 19:50 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2005-06-14 19:50 UTC (permalink / raw)
To: Manoj Iyer; +Cc: gdb-patches
On Tue, Jun 14, 2005 at 02:35:05PM -0500, Manoj Iyer wrote:
> +gdb_test "info threads" "\\* .*2 Thread.*.LWP.* .*thread_func.*"
> +gdb_test "thread 1" ".*Switching to thread 1.*"
> +gdb_test "next" ".*foo \\(\\).*\[0-9\]*"
> +gdb_test "thread 2" ".*Switching to thread 2.*"
The numbers of threads depend on the operating system, and on the order
in which GDB notices new threads. For instance the LinuxThreads
manager thread, or a remote target which does not report new threads
immediately.
Also the format of "info threads" output is target specific. LWP comes
from the Linux specific native code.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-06-14 19:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-14 19:46 [RFC] switch-threads.exp added tests Manoj Iyer
2005-06-14 19:50 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox