Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit] Fix timeouts in break-interp.exp on slow machines
@ 2010-10-12 17:20 Ulrich Weigand
  2010-10-12 18:23 ` Jan Kratochvil
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weigand @ 2010-10-12 17:20 UTC (permalink / raw)
  To: gdb-patches

Hello,

since Jan checked in his recent set of patches, break-interp.exp test cases
have started to succeed on my ARM machines.  However, I was still seeing
timeouts in the "info files" tests.

This is once again caused by a gdb_expect clause with a ".*" wildcard that
matches a large number of lines.  This can cause expect to slow down
significantly, to the extent that the tests time out on slow machines.

Fixed along the lines of similiar tests elsewhere by separating the
statement into two different gdb_expect patterns, which eliminates
the need for this particular wildcard.

Tested on i386-linux and armv7l-linux-gnueabi with no regressions,
fixes the timeouts on ARM.

Committed to mainline.

Bye,
Ulrich


ChangeLog:

	* break-interp.exp (test_ld): Use two separate gdb_expect statements
	for the "info files" test to avoid timeouts on slow machines.


Index: gdb/testsuite/gdb.base/break-interp.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break-interp.exp,v
retrieving revision 1.22
diff -u -p -r1.22 break-interp.exp
--- gdb/testsuite/gdb.base/break-interp.exp	11 Oct 2010 08:47:47 -0000	1.22
+++ gdb/testsuite/gdb.base/break-interp.exp	12 Oct 2010 13:38:57 -0000
@@ -442,14 +442,23 @@ proc test_ld {file ifmain trynosym displ
     if $ifmain {
 	reach "_dl_debug_state" run $displacement
 
+	# Use two separate gdb_expect statements to avoid timeouts due to
+	# slow processing of wildcard capturing long output
 	set test "info files"
 	set entrynohex ""
-	gdb_test_multiple $test $test {
-	    -re "\r\n\[\t \]*Entry point:\[\t \]*0x(\[0-9a-f\]+)\r\n.*$gdb_prompt $" {
+	send_gdb "$test\n"
+	gdb_expect  {
+	    -re "\r\n\[\t \]*Entry point:\[\t \]*0x(\[0-9a-f\]+)\r\n" {
 		set entrynohex $expect_out(1,string)
-		pass $test
+	        gdb_expect {
+		    -re "$gdb_prompt $" { pass $test }
+		    timeout { fail "$test (timeout)" }
+		}
 	    }
+	    -re ".*$gdb_prompt $"  { fail $test }
+	    timeout         { fail "$test (timeout)" }
 	}
+
 	# `info sym' cannot be tested for .opd as the binary may not have
 	# symbols.
 	if {[istarget powerpc64-*] && [is_lp64_target]} {
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [commit] Fix timeouts in break-interp.exp on slow machines
  2010-10-12 17:20 [commit] Fix timeouts in break-interp.exp on slow machines Ulrich Weigand
@ 2010-10-12 18:23 ` Jan Kratochvil
  2010-10-12 18:37   ` Ulrich Weigand
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2010-10-12 18:23 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

On Tue, 12 Oct 2010 19:20:29 +0200, Ulrich Weigand wrote:
> This is once again caused by a gdb_expect clause with a ".*" wildcard that
> matches a large number of lines.  This can cause expect to slow down
> significantly, to the extent that the tests time out on slow machines.

OK, thanks for the fix.  I do not have the slowness reproducible here but
I thought gdb_expect is deprecated in the favor of gdb_test_multiple.

I do not mind but just curious if it could be rather coded this way or it
would be still slow/incompatible by the more patterns of gdb_test_multiple?

Tested on x86_64-fedora14snapshot-linux-gnu.


Thanks,
Jan


gdb/testsuite/
2010-10-12  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.base/break-interp.exp (test_ld): Replace gdb_expect by
	gdb_test_multiple.

--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -442,21 +442,19 @@ proc test_ld {file ifmain trynosym displacement} {
     if $ifmain {
 	reach "_dl_debug_state" run $displacement
 
-	# Use two separate gdb_expect statements to avoid timeouts due to
-	# slow processing of wildcard capturing long output
+	# Use two separate gdb_test_multiple statements to avoid timeouts due
+	# to slow processing of wildcard capturing long output
 	set test "info files"
 	set entrynohex ""
-	send_gdb "$test\n"
-	gdb_expect  {
+	gdb_test_multiple $test $test {
 	    -re "\r\n\[\t \]*Entry point:\[\t \]*0x(\[0-9a-f\]+)\r\n" {
 		set entrynohex $expect_out(1,string)
-	        gdb_expect {
-		    -re "$gdb_prompt $" { pass $test }
-		    timeout { fail "$test (timeout)" }
+		gdb_test_multiple "" $test {
+		    -re "\r\n$gdb_prompt $" {
+			pass $test
+		    }
 		}
 	    }
-	    -re ".*$gdb_prompt $"  { fail $test }
-	    timeout         { fail "$test (timeout)" }
 	}
 
 	# `info sym' cannot be tested for .opd as the binary may not have


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [commit] Fix timeouts in break-interp.exp on slow machines
  2010-10-12 18:23 ` Jan Kratochvil
@ 2010-10-12 18:37   ` Ulrich Weigand
  2010-10-12 18:41     ` Jan Kratochvil
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weigand @ 2010-10-12 18:37 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches

Jan Kratochvil wrote:
> On Tue, 12 Oct 2010 19:20:29 +0200, Ulrich Weigand wrote:
> > This is once again caused by a gdb_expect clause with a ".*" wildcard that
> > matches a large number of lines.  This can cause expect to slow down
> > significantly, to the extent that the tests time out on slow machines.
> 
> OK, thanks for the fix.  I do not have the slowness reproducible here but
> I thought gdb_expect is deprecated in the favor of gdb_test_multiple.
> 
> I do not mind but just curious if it could be rather coded this way or it
> would be still slow/incompatible by the more patterns of gdb_test_multiple?

Ah, I wasn't aware you could use gdb_test_multiple with an empty
string to send to GDB!  That's even better, of course.

> 2010-10-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* gdb.base/break-interp.exp (test_ld): Replace gdb_expect by
> 	gdb_test_multiple.

This still works for me (no timeouts) on armv7l-linux-gnueabi.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [commit] Fix timeouts in break-interp.exp on slow machines
  2010-10-12 18:37   ` Ulrich Weigand
@ 2010-10-12 18:41     ` Jan Kratochvil
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Kratochvil @ 2010-10-12 18:41 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

On Tue, 12 Oct 2010 20:37:17 +0200, Ulrich Weigand wrote:
> Jan Kratochvil wrote:
> > 2010-10-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
> > 
> > 	* gdb.base/break-interp.exp (test_ld): Replace gdb_expect by
> > 	gdb_test_multiple.
> 
> This still works for me (no timeouts) on armv7l-linux-gnueabi.

Checked-in:
	http://sourceware.org/ml/gdb-cvs/2010-10/msg00077.html


Thanks,
Jan


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-12 18:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-12 17:20 [commit] Fix timeouts in break-interp.exp on slow machines Ulrich Weigand
2010-10-12 18:23 ` Jan Kratochvil
2010-10-12 18:37   ` Ulrich Weigand
2010-10-12 18:41     ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox