This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: New thread testcase (resubmit)
- From: Michael Snyder <msnyder at redhat dot com>
- To: Manoj Iyer <manjo at austin dot ibm dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 27 Aug 2004 17:54:58 +0000
- Subject: Re: New thread testcase (resubmit)
- Organization: Red Hat, Inc.
- References: <Pine.LNX.4.58.0408271002390.30583@lazy>
Manoj Iyer wrote:
I have attached two modified versions of my new thread testcase.
- version 1
incorporates Michael Chastain's suggestions and it includes
the step and backtrace tests from the thread fucntion.
-version 2
incorporates Michael Snyder suggestion to remove the step and backtrace
tests from the testcase.
Please let me know which one you like and any other comments or changes.
ChangeLog is pasted at the begning of the patch.
Version 2 is OK as is, if you're tired of messing with it.
You didn't have to remove the backtrace, though, if you'd
like to keep that.
Also,
+#
+#
+# continue to tf() breakpoint #2
+#
+gdb_test_multiple "continue\n" "continue to thread fucntion breakpoint #2" {
+ -re ".*Breakpoint 2.*tf.* at .*tbug.* .*\r\n.*$gdb_prompt $" {
+ pass "continue to tf";
+ }
+ -re ".*$gdb_prompt $" {
+ fail "continue to tf";
+ return 1;
+ }
+}
I think this could be simplified to:
gdb_test "continue" \
"Breakpoint 2.*tf.* at .*tbug.*" \
"continue to tf"
Similarly, your backtrace test could be as simple as:
gdb_test "backtrace" \
"#0 .*tf .*at .*tbug.*" \
"backtrace from thread function"
I don't think you can predict what will be on any
higher frames, but you could test the current frame
and make sure backtrace didn't just die or show you
the wrong thread.
+
+
+#
+# delete all breakpoints
+#
+send_gdb "delete\n"
+gdb_expect {
+ -re "Delete all breakpoint.*$gdb_prompt $" {
+ send_gdb "y\n"
For this, all you need is the existing procedure call:
delete_breakpoints