Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: [commit] [testsuite patch]#2 Fix PR threads/19422 regression + Guile regression [Re: [PATCH+doc] Fix PR threads/19422 - show which thread caused stop]
Date: Fri, 22 Jan 2016 20:25:00 -0000	[thread overview]
Message-ID: <20160122202548.GA14352@host1.jankratochvil.net> (raw)
In-Reply-To: <56A28E40.205@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

On Fri, 22 Jan 2016 21:17:04 +0100, Pedro Alves wrote:
> Not all targets support thread names, and even those that do, not all
> use the program name as default thread name -- I think that's only true
> for GNU/Linux, actually.

OK, changed.

Considered it as an implicit approval, therefore checked in.


Thanks,
Jan

[-- Attachment #2: Type: message/rfc822, Size: 3929 bytes --]

From: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: [PATCH] testsuite: Fix PR threads/19422 regression + Guile regression
Date: Fri, 22 Jan 2016 21:21:45 +0100

The PR threads/19422 patchset added a new regression.

Additionally below it there was already a regression if --with-guile (which is
default if Guile is found) was used.

racy case #1:

(xgdb) PASS: gdb.gdb/selftest.exp: Set xgdb_prompt
^M
Thread 1 "xgdb" received signal SIGINT, Interrupt.^M
0x00007ffff583bfdd in poll () from /lib64/libc.so.6^M
(gdb) FAIL: gdb.gdb/selftest.exp: send ^C to child process
signal SIGINT^M
Continuing with signal SIGINT.^M
^C^M
Thread 1 "xgdb" received signal SIGINT, Interrupt.^M
0x00007ffff5779da0 in sigprocmask () from /lib64/libc.so.6^M
(gdb) PASS: gdb.gdb/selftest.exp: send SIGINT signal to child process
backtrace^M
errstring=errstring@entry=0x7e0e6c "", mask=mask@entry=RETURN_MASK_ALL) at exceptions.c:240^M
errstring=errstring@entry=0x7e0e6c "", mask=mask@entry=RETURN_MASK_ALL) at exceptions.c:240^M
(gdb) PASS: gdb.gdb/selftest.exp: backtrace through signal handler

racy case #2:

(xgdb) PASS: gdb.gdb/selftest.exp: Set xgdb_prompt
^M
Thread 1 "xgdb" received signal SIGINT, Interrupt.^M
0x00007ffff583bfdd in poll () from /lib64/libc.so.6^M
(gdb) FAIL: gdb.gdb/selftest.exp: send ^C to child process
signal SIGINT^M
Continuing with signal SIGINT.^M
^C^M
Thread 2 "xgdb" received signal SIGINT, Interrupt.^M
[Switching to Thread 0x7ffff3b7f700 (LWP 13227)]^M
0x00007ffff6b88b10 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0^M
(gdb) PASS: gdb.gdb/selftest.exp: send SIGINT signal to child process
backtrace^M
(gdb) FAIL: gdb.gdb/selftest.exp: backtrace through signal handler

Pedro Alves:
Not all targets support thread names, and even those that do, not all
use the program name as default thread name -- I think that's only true
for GNU/Linux, actually.  So I think it's best to not expect that, like:
            -re "(Thread .*|Program) received signal SIGINT.*$gdb_prompt $" {

gdb/testsuite/ChangeLog
2016-01-22  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix testsuite compatibility with Guile.
	* gdb.gdb/selftest.exp (send ^C to child process): Accept also Thread.
	(thread 1): New test for backtrace through signal handler.
---
 gdb/testsuite/ChangeLog            | 6 ++++++
 gdb/testsuite/gdb.gdb/selftest.exp | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index d7721d5..5e99adf 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2016-01-22  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Fix testsuite compatibility with Guile.
+	* gdb.gdb/selftest.exp (send ^C to child process): Accept also Thread.
+	(thread 1): New test for backtrace through signal handler.
+
 2016-01-22  Yao Qi  <yao.qi@linaro.org>
 
 	PR testsuite/19491
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index 4d55cb5..3d98a0c 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -436,8 +436,9 @@ proc test_with_self { executable } {
     if ![target_info exists gdb,nointerrupts] {
 	set description "send ^C to child process"
 	send_gdb "\003"
+	# "Thread 1" is displayed iff Guile support is linked in.
 	gdb_expect {
-	    -re "Program received signal SIGINT.*$gdb_prompt $" {
+	    -re "(Thread 1 .*|Program) received signal SIGINT.*$gdb_prompt $" {
 		pass "$description"
 	    }
 	    -re ".*$gdb_prompt $" {
@@ -453,6 +454,10 @@ proc test_with_self { executable } {
     gdb_test "signal SIGINT" \
 	"Continuing with signal SIGINT.*" \
 	"$description"
+
+    # Switch back to the GDB thread if Guile support is linked in.
+    # "signal SIGINT" could also switch the current thread.
+    gdb_test "thread 1" {\[Switching to thread 1 .*\].*}
     
     # get a stack trace
     #
-- 
2.5.0

  reply	other threads:[~2016-01-22 20:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 23:30 [PATCH] Fix PR threads/19422 - show which thread caused stop Pedro Alves
2016-01-14 14:08 ` [PATCH+doc] " Pedro Alves
2016-01-14 16:36   ` Eli Zaretskii
2016-01-14 17:12     ` Pedro Alves
2016-01-14 18:25       ` Eli Zaretskii
2016-01-14 19:00         ` Pedro Alves
2016-01-14 19:06           ` Eli Zaretskii
2016-01-18 15:17             ` Pedro Alves
2016-01-22 16:44   ` Jan Kratochvil
2016-01-22 16:55     ` Pedro Alves
2016-01-22 16:56       ` Jan Kratochvil
2016-01-22 17:30   ` [testsuite patch] Fix PR threads/19422 regression + Guile regression [Re: [PATCH+doc] Fix PR threads/19422 - show which thread caused stop] Jan Kratochvil
2016-01-22 17:31     ` [testsuite patch]#2 " Jan Kratochvil
2016-01-22 18:18       ` [testsuite patch]#3 " Jan Kratochvil
2016-01-22 18:37       ` [testsuite patch]#2 " Pedro Alves
2016-01-22 20:05         ` Jan Kratochvil
2016-01-22 20:11           ` Pedro Alves
2016-01-22 20:17             ` Pedro Alves
2016-01-22 20:25               ` Jan Kratochvil [this message]
2016-01-22 20:44                 ` [commit] " Pedro Alves
2016-01-22 20:51                   ` [commit#2] " Jan Kratochvil
2016-01-22 20:53                     ` Pedro Alves
2016-01-14 16:04 ` [PATCH] Fix PR threads/19422 - show which thread caused stop Yao Qi
2016-01-18 15:24   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160122202548.GA14352@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox