This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[pushed] gdb.threads/signal-command-handle-nopass.exp: Add comment (was: Re: [PATCH v2] Always pass signals to the right thread.)
- From: Pedro Alves <palves at redhat dot com>
- To: Doug Evans <dje at google dot com>, Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 30 Jul 2014 12:30:33 +0100
- Subject: [pushed] gdb.threads/signal-command-handle-nopass.exp: Add comment (was: Re: [PATCH v2] Always pass signals to the right thread.)
- Authentication-results: sourceware.org; auth=none
- References: <1403183341-12581-1-git-send-email-palves at redhat dot com> <53A790DB dot 40908 at codesourcery dot com> <53A9648F dot 1030006 at redhat dot com> <53ABB36D dot 6090909 at codesourcery dot com> <21462 dot 42759 dot 772857 dot 933479 at ruffy dot mtv dot corp dot google dot com>
On 07/28/2014 08:39 PM, Doug Evans wrote:
> Yao Qi writes:
> > >> > We want to know whether thread 1 is selected, so using "info threads 1"
> > >> > is simpler in the regexp pattern, like
> > >> >
> > >> > gdb_test "info threads 1" "\\\* 1${ws}Thread .*" "thread 1 selected"
> > > The reason I don't like "info threads 1" this is that if the test fails,
> > > when you go look at the logs, you don't see which thread was actually
> > > current, which tends to make debugging things a little easier. But we
> > > can still simplify the patterns. I was aiming at having no wildcards in
> > > the middle of the output, but that's really not necessary.
> > > I've simplified the patterns now.
> >
> > OK.
>
> A good thing to document in the test though, eh?
> [i.e., *why* "info threads" is used instead of "info threads 1"]
>
> [I realize the patch has been pushed, just a thought for future reference.]
>
OK, done.
Thanks.
---------------------------------------
[PATCH] gdb.threads/signal-command-handle-nopass.exp: Add comment
Explain why we do "info threads".
gdb/testsuite/
2014-07-30 Pedro Alves <palves@redhat.com>
* gdb.threads/signal-command-handle-nopass.exp (test): Add
comment.
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index a90ee8b..6eb8f3e 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-07-30 Pedro Alves <palves@redhat.com>
+
+ * gdb.threads/signal-command-handle-nopass.exp (test): Add
+ comment.
+
2014-07-29 Yao Qi <yao@codesourcery.com>
PR gdb/17206
diff --git a/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp b/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp
index 3ea9cf8..e46a0ab 100644
--- a/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp
+++ b/gdb/testsuite/gdb.threads/signal-command-handle-nopass.exp
@@ -69,6 +69,10 @@ proc test { step_over } {
gdb_test "signal SIGUSR1" "handler .*"
+ # Make sure it was thread 1 that got the signal. Note we list
+ # all threads instead of just thread 1, so that if something
+ # goes wrong and another thread ends up selected, we can
+ # easily see which in the logs.
gdb_test "info threads" $pattern "thread 1 got the signal"
}
}
--
1.9.3