This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/2] Add a test for "break thread thread 2".
- From: Keith Seitz <keiths at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 17 Mar 2015 13:59:45 -0700
- Subject: [PATCH 2/2] Add a test for "break thread thread 2".
- Authentication-results: sourceware.org; auth=none
- References: <20150317205942 dot 9650 dot 84728 dot stgit at valrhona dot uglyboxes dot com>
This is a follow-on patch to prove that we really do need the linespec
parser `keyword_ok' state. This test is mentioned in the source code,
but it is never actually tested anywhere. This patch adds it.
gdb/testsuite/ChangeLog
* gdb.threads/bp_in_thread.c (noreturn): Rename to ...
(thread): ... this.
* gdb.threads/bp_in_thread.exp: Change all references of
`noreturn' to `thread'.
Add test for setting thread-specific breakpoint on the
function called `thread'.
---
gdb/testsuite/gdb.threads/bp_in_thread.c | 4 ++--
gdb/testsuite/gdb.threads/bp_in_thread.exp | 13 ++++++++-----
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/gdb/testsuite/gdb.threads/bp_in_thread.c b/gdb/testsuite/gdb.threads/bp_in_thread.c
index 3b16b62..4e7e94c 100644
--- a/gdb/testsuite/gdb.threads/bp_in_thread.c
+++ b/gdb/testsuite/gdb.threads/bp_in_thread.c
@@ -30,7 +30,7 @@ cond_wait (pthread_cond_t *cond, pthread_mutex_t *mut)
}
void
-noreturn (void)
+thread (void)
{
pthread_mutex_t mut;
pthread_cond_t cond;
@@ -46,7 +46,7 @@ noreturn (void)
void *
forever_pthread (void *unused)
{
- noreturn ();
+ thread ();
}
void
diff --git a/gdb/testsuite/gdb.threads/bp_in_thread.exp b/gdb/testsuite/gdb.threads/bp_in_thread.exp
index 306dabe..d6e2353 100644
--- a/gdb/testsuite/gdb.threads/bp_in_thread.exp
+++ b/gdb/testsuite/gdb.threads/bp_in_thread.exp
@@ -28,14 +28,17 @@ clean_restart $binfile
runto_main
-gdb_test "break noreturn" \
+gdb_test "break thread" \
"Breakpoint 2 at .*: file .*${srcfile}, line .*" \
- "breakpoint on noreturn"
+ "breakpoint on thread"
# Run the program and make sure GDB reports that we stopped after
-# hitting breakpoint 1 in noreturn().
+# hitting breakpoint 1 in thread().
gdb_test "continue" \
- ".*Breakpoint 2, noreturn ().*" \
- "run to noreturn"
+ ".*Breakpoint 2, thread ().*" \
+ "run to thread()"
+# Make sure the linespec parser understands that "break thread thread 2"
+# is a valid thread-specific location.
+gdb_breakpoint "thread thread 2" message