Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Testsuite: Change match_max for current also
@ 2009-10-02 13:58 Pierre Muller
  2009-10-02 23:20 ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Muller @ 2009-10-02 13:58 UTC (permalink / raw)
  To: gdb-patches

  I got several "internal buffer full" errors
in the results of the testsuite, especially on gcc16.

  I finally discovered that the expect command
match_max is made for that:
  change the size of the internal buffer used for
pattern matching.

  In lib/gdb.exp, I found this:

match_max -d 30000

  But then, in several other tests 
(gdb.base/annota1.exp, gdb.base/annota3.exp and gdb.base/maint.exp), 
that said that they wanted to increase the size
of the buffer, but used smaller values than the 30000
above... I was lost :(


In annota1.exp, I found that:
    verbose "match_max local is: [match_max]"
    verbose "match_max default is: [match_max -d]"
    # This is necessary because a 2000 buffer is not enought to get
everything
    # up to the prompt ad the test gets a timeout.
    match_max 3000
    verbose "match_max now is: [match_max]"

Running annota1.exp with -v option in RUNTESTFLAGS,
I discovered that the local value of match_max still was the
expect default of 2000...

  After digging into the expect sources, I found out
that using 
  match_max -d 3000
changes the default value, but only for later started jobs,
meaning that it does not change the current value.
 Adding
  'match_max [match_max -d]'
right after 'match_max -d 30000'
did fix the problem!

This removes a "internal buffer full" ERROR
in gcc16 testsuite on
gdb.server/ext-run.exp: get process list

Is this OK?

Pierre Muller

PS1: If this is approved, we should also 
consider what to do about the three tests
that set another value of match_max
(lower than the 30000).

PS2: calling 'match_max -d 30000'
several times is a waste of time,
as long as nothing changes that default value
in any of the tests, should it rather be 
extracted out of default_gdb_init,
so that it get executed only once?


gdb/testsuite/ChangeLog entry:

2009-10-02  Pierre Muller  <muller@ics.u-strasbg.fr>

	* lib/gdb.exp (default_gdb_init): Set current value of match_max 
	to default.

Index: src/gdb/testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.119
diff -u -F^proc  -r1.119 gdb.exp
--- src/gdb/testsuite/lib/gdb.exp	13 Jul 2009 19:24:18 -0000
1.119
+++ src/gdb/testsuite/lib/gdb.exp	2 Oct 2009 13:28:57 -0000
@@ -2326,6 +2326,8 @@ proc default_gdb_init { args } {
     # a very large amount of output.  We therefore increase the expect
     # buffer size to be able to contain the entire test output.
     match_max -d 30000
+    # Also set this value for the currently running GDB. 
+    match_max [match_max -d]
 
     # We want to add the name of the TCL testcase to the PASS/FAIL
messages.
     if { [llength $args] > 0 } {


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

* Re: [RFA] Testsuite: Change match_max for current also
  2009-10-02 13:58 [RFA] Testsuite: Change match_max for current also Pierre Muller
@ 2009-10-02 23:20 ` Joel Brobecker
  2009-10-06 14:46   ` [RFA] Testsuite: Remove obsolete match_max uses Pierre Muller
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2009-10-02 23:20 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

> In annota1.exp, I found that:
>     verbose "match_max local is: [match_max]"
>     verbose "match_max default is: [match_max -d]"
>     # This is necessary because a 2000 buffer is not enought to get
> everything
>     # up to the prompt ad the test gets a timeout.
>     match_max 3000
>     verbose "match_max now is: [match_max]"

Yeah - wild guess is that this was done before the match_max value
got unilaterally increased by default_gdb_init.

> PS1: If this is approved, we should also 
> consider what to do about the three tests
> that set another value of match_max
> (lower than the 30000).

We should simply remove them, since this is now handled automatically.

> PS2: calling 'match_max -d 30000' several times is a waste of time, as
> long as nothing changes that default value in any of the tests, should
> it rather be extracted out of default_gdb_init, so that it get
> executed only once?

I'd say: Only if the optimization provides noticeable performance
benefits.  Another wild guess is that it is not noticeable, but if
you can measure it, and it doesn't increase code complexity too much,
sure. Of, if it does not increase code complexity at all, then by
all means.

I was actually wondering if we needed to change the default value
at all. Just keep resetting the match_max value to the current
default, or even to 30000, if we eliminate setting the default
at all.

> 2009-10-02  Pierre Muller  <muller@ics.u-strasbg.fr>
> 
> 	* lib/gdb.exp (default_gdb_init): Set current value of match_max 
> 	to default.

In the meantime, this looks fine to me.

-- 
Joel


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

* [RFA] Testsuite: Remove obsolete match_max uses
  2009-10-02 23:20 ` Joel Brobecker
@ 2009-10-06 14:46   ` Pierre Muller
  2009-10-06 14:57     ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Muller @ 2009-10-06 14:46 UTC (permalink / raw)
  To: 'Joel Brobecker'; +Cc: gdb-patches

  I've checked in the patch.

> > PS1: If this is approved, we should also
> > consider what to do about the three tests
> > that set another value of match_max
> > (lower than the 30000).
> 
> We should simply remove them, since this is now handled automatically.


  This new RFA handles this removal:
Tested manually on cygwin and ubuntu/i386
without any changes in modified tests results.

 
2009-10-05  Pierre Muller  <muller@ics.u-strasbg.fr>

	* gdb.base/annota1.exp: Remove obsolete match_max increase.
	* gdb.base/annota3.exp: Idem.
	* gdb.base/maint.exp: Idem.

Index: src/gdb/testsuite/gdb.base/annota1.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/annota1.exp,v
retrieving revision 1.34
diff -u -F^proc  -r1.34 annota1.exp
--- src/gdb/testsuite/gdb.base/annota1.exp	13 Jul 2009 19:20:39 -0000
1.34
+++ src/gdb/testsuite/gdb.base/annota1.exp	5 Oct 2009 06:30:43 -0000
@@ -297,12 +297,6 @@
     # test:
     # annotate-signal-handler-caller
     #
-    verbose "match_max local is: [match_max]"
-    verbose "match_max default is: [match_max -d]"
-    # This is necessary because a 2000 buffer is not enought to get
everything
-    # up to the prompt ad the test gets a timeout.
-    match_max 3000
-    verbose "match_max now is: [match_max]"
     send_gdb "backtrace\n"
     gdb_expect {
 	-re "frame-begin 0 $hex\r\n#0.*frame-end.*frame-begin 1
$hex\r\n#1.*(\032\032signal-handler-caller\r\n.signal handler
called.\r\n\r\n)+\032\032frame-end\r\n\r\n\032\032frame-begin 2
$hex\r\n#2.*(frame-begin 3 $hex\r\n#3.*)*frame-end.*$gdb_prompt$" {
Index: src/gdb/testsuite/gdb.base/annota3.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/annota3.exp,v
retrieving revision 1.19
diff -u -F^proc  -r1.19 annota3.exp
--- src/gdb/testsuite/gdb.base/annota3.exp	3 Jan 2009 05:58:03 -0000
1.19
+++ src/gdb/testsuite/gdb.base/annota3.exp	5 Oct 2009 06:30:43 -0000
@@ -258,12 +258,6 @@
     #
     # test:
     #
-    verbose "match_max local is: [match_max]"
-    verbose "match_max default is: [match_max -d]"
-    # This is necessary because a 2000 buffer is not enought to get
everything
-    # up to the prompt ad the test gets a timeout.
-    match_max 3000
-    verbose "match_max now is: [match_max]"
     send_gdb "backtrace\n"
     gdb_expect_list "backtrace @ signal handler" "$gdb_prompt$" {
 	"#0 +handle_USR1 \[^\r\n\]+\r\n"
Index: src/gdb/testsuite/gdb.base/maint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/maint.exp,v
retrieving revision 1.37
diff -u -F^proc  -r1.37 maint.exp
--- src/gdb/testsuite/gdb.base/maint.exp	3 Jan 2009 05:58:03 -0000
1.37
+++ src/gdb/testsuite/gdb.base/maint.exp	5 Oct 2009 06:30:44 -0000
@@ -96,8 +96,6 @@
 send_gdb "set height 0\n"
 gdb_expect -re "$gdb_prompt $"
 
-# use a larger expect input buffer for long help outputs.
-match_max 6000
 
 #
 # this command does not produce any output


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

* Re: [RFA] Testsuite: Remove obsolete match_max uses
  2009-10-06 14:46   ` [RFA] Testsuite: Remove obsolete match_max uses Pierre Muller
@ 2009-10-06 14:57     ` Joel Brobecker
  2009-10-06 15:14       ` Pierre Muller
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2009-10-06 14:57 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb-patches

> 2009-10-05  Pierre Muller  <muller@ics.u-strasbg.fr>
> 
> 	* gdb.base/annota1.exp: Remove obsolete match_max increase.
> 	* gdb.base/annota3.exp: Idem.
> 	* gdb.base/maint.exp: Idem.

Thanks for doing this, Pierre. This is approved.

-- 
Joel


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

* RE: [RFA] Testsuite: Remove obsolete match_max uses
  2009-10-06 14:57     ` Joel Brobecker
@ 2009-10-06 15:14       ` Pierre Muller
  0 siblings, 0 replies; 5+ messages in thread
From: Pierre Muller @ 2009-10-06 15:14 UTC (permalink / raw)
  To: 'Joel Brobecker'; +Cc: gdb-patches



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Joel Brobecker
> Envoyé : Tuesday, October 06, 2009 4:58 PM
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA] Testsuite: Remove obsolete match_max uses
> 
> > 2009-10-05  Pierre Muller  <muller@ics.u-strasbg.fr>
> >
> > 	* gdb.base/annota1.exp: Remove obsolete match_max increase.
> > 	* gdb.base/annota3.exp: Idem.
> > 	* gdb.base/maint.exp: Idem.
> 
> Thanks for doing this, Pierre. This is approved.

  Thanks for the approval,
patch committed.

match_max is only used in lib/gdb.exp now.


Pierre Muller
Pascal language support maintainer for GDB




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

end of thread, other threads:[~2009-10-06 15:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-02 13:58 [RFA] Testsuite: Change match_max for current also Pierre Muller
2009-10-02 23:20 ` Joel Brobecker
2009-10-06 14:46   ` [RFA] Testsuite: Remove obsolete match_max uses Pierre Muller
2009-10-06 14:57     ` Joel Brobecker
2009-10-06 15:14       ` Pierre Muller

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