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]

[pushed] gdb.threads/signal-command-handle-nopass.exp: Add comment (was: Re: [PATCH v2] Always pass signals to the right thread.)


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



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