Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [rfa/testsuite] gdb.base/selftest.exp: work with optimization
@ 2002-12-11 14:19 Michael Elizabeth Chastain
  2002-12-11 14:31 ` David Carlton
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-11 14:19 UTC (permalink / raw)
  To: carlton, gdb-patches; +Cc: fnasser

David Carlton writes:
> Digging further, it happens during the part of the test that steps
> through captured_main; when GDB is compiled with optimization, GDB
> sometimes stops on the opening brace.

I see that too.

gdb.base/selftest.exp needs to be a lot more careful about its
regexp's, because it is operating on a test program which changes
outside of its control, rather than a small defined test program.

+	# "current_directory initialization" possibilities happen to
+	# me with GCC 3.1 on i686-pc-linux-gnu when I compile with
+	# optimization.

That is twice today you said "gcc 3.1" -- is that a think for gcc 3.2.1,
or are you really testing with gcc 3.1?

Michael C


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

* Re: [rfa/testsuite] gdb.base/selftest.exp: work with optimization
  2002-12-11 14:19 [rfa/testsuite] gdb.base/selftest.exp: work with optimization Michael Elizabeth Chastain
@ 2002-12-11 14:31 ` David Carlton
  0 siblings, 0 replies; 7+ messages in thread
From: David Carlton @ 2002-12-11 14:31 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: gdb-patches, fnasser

On Wed, 11 Dec 2002 16:15:52 -0600, Michael Elizabeth Chastain <mec@shout.net> said:
> David Carlton writes:

> +	# "current_directory initialization" possibilities happen to
> +	# me with GCC 3.1 on i686-pc-linux-gnu when I compile with
> +	# optimization.

> That is twice today you said "gcc 3.1" -- is that a think for gcc 3.2.1,
> or are you really testing with gcc 3.1?

I really am testing with GCC 3.1 most of the time: on my work machine,
that's what's installed in /usr/local/bin (though other GCC's are
installed elsewhere, and they sometimes get used).

Obviously it's not the most important version of GCC to test with, but
I haven't yet run into a compelling reason to upgrade to a more recent
version; and it probably doesn't hurt to have somebody testing GDB
with compilers other than 2.95-variants and 3.2.1.  (Though your test
matrix now handles that issue quite nicely.)  In the comment quoted
above, I have no reason to believe that the problem is specific to
3.1, but it seemed like a situation where it was worthwhile mentioning
the compiler that I happened to be using.

David Carlton
carlton@math.stanford.edu


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

* Re: [rfa/testsuite] gdb.base/selftest.exp: work with optimization
  2002-12-22 10:25 ` Fernando Nasser
@ 2002-12-23  9:08   ` David Carlton
  0 siblings, 0 replies; 7+ messages in thread
From: David Carlton @ 2002-12-23  9:08 UTC (permalink / raw)
  To: Fernando Nasser; +Cc: gdb-patches

On Sun, 22 Dec 2002 06:54:13 -0500, Fernando Nasser <fnasser@redhat.com> said:

> Approved.

Committed.

David Carlton
carlton@math.stanford.edu


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

* Re: [rfa/testsuite] gdb.base/selftest.exp: work with optimization
  2002-12-11 13:24 David Carlton
  2002-12-11 15:22 ` Andrew Cagney
@ 2002-12-22 10:25 ` Fernando Nasser
  2002-12-23  9:08   ` David Carlton
  1 sibling, 1 reply; 7+ messages in thread
From: Fernando Nasser @ 2002-12-22 10:25 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb-patches

Approved.

Fernando

David Carlton wrote:
> I recently happened to compare the outputs of gdb.base/selftest.exp
> when GDB is compiled with and without optimization, and noticed that
> it failed only in the optimized case.  Digging further, it happens
> during the part of the test that steps through captured_main; when GDB
> is compiled with optimization, GDB sometimes stops on the opening
> brace.  That's not an error, but the regexps in question didn't allow
> that.
> 
> When I added a regexp to allow that, I found that GDB also sometimes
> stopped on the line 'current_directory = gdb_dirbuf', even though it's
> after the dirarg initialization line that we're looking for.  This
> looks like a reordering by the optimizer (or perhaps misleading
> location information from the optimizer), so it's not a GDB bug
> either.
> 
> Here's a patch to selftest.exp to allow those possibilities; with this
> patch, all the tests in that file pass whether or not GDB is compiled
> with optimization.
> 
> David Carlton
> carlton@math.stanford.edu
> 
> 2002-12-11  David Carlton  <carlton@math.stanford.edu>
> 
> 	* gdb.base/selftest.exp (do_steps_and_nexts): Allow initial brace
> 	and current_directory initialization.
> 
> Index: selftest.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/selftest.exp,v
> retrieving revision 1.5
> diff -u -p -r1.5 selftest.exp
> --- selftest.exp	4 Dec 2002 03:15:27 -0000	1.5
> +++ selftest.exp	11 Dec 2002 21:08:19 -0000
> @@ -54,6 +54,10 @@ proc do_steps_and_nexts {} {
>  
>      for {set count 0} {$count < 26} {incr count} {
>  	send_gdb "list\n"
> +	# NOTE: carlton/2002-12-11: The "initial brace" and
> +	# "current_directory initialization" possibilities happen to
> +	# me with GCC 3.1 on i686-pc-linux-gnu when I compile with
> +	# optimization.
>  	gdb_expect {
>  	    -re ".*context = data.*$gdb_prompt $" {
>  		set description "step over context initialization"
> @@ -157,6 +161,14 @@ proc do_steps_and_nexts {} {
>  	    -re ".*textdomain .PACKAGE.;.*$gdb_prompt $" {
>  		set description "next over textdomain PACKAGE"
>  		set command "next"
> +	    }
> +	    -re "\[0-9\]*\t\{\r\n$gdb_prompt $" {
> +		set description "step over initial brace"
> +		set command "step"
> +	    }
> +	    -re ".*current_directory = gdb_dirbuf.*$gdb_prompt $" {
> +		set description "step over current_directory initialization"
> +		set command "step"
>  	    }
>  	    -re "\[ \t\]+\{\r\n$gdb_prompt $" {
>  		setup_xfail "mips-*-irix5*"
> 


-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


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

* Re: [rfa/testsuite] gdb.base/selftest.exp: work with optimization
@ 2002-12-11 21:52 Michael Elizabeth Chastain
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-11 21:52 UTC (permalink / raw)
  To: carlton; +Cc: fnasser, gdb-patches

David Carlton wrote:
> Obviously it's not the most important version of GCC to test with, but
> I haven't yet run into a compelling reason to upgrade to a more recent
> version; and it probably doesn't hurt to have somebody testing GDB
> with compilers other than 2.95-variants and 3.2.1.  (Though your test
> matrix now handles that issue quite nicely.)

Diversity is good.  I was just kinda surprised.

I'm planning to prune my own test bed in the next few days by
dropping gcc 3.0.4, gcc 3.1, gcc 3.1.1, and gcc 3.2.  I just need
one clean monster run and then an hour or two of table-spelunking.

There are result changes from 3.0.4 to 3.1 (mostly good, some bad),
but I haven't seen any substantive changes from 3.1 to 3.2.1.

Michael C


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

* Re: [rfa/testsuite] gdb.base/selftest.exp: work with optimization
  2002-12-11 13:24 David Carlton
@ 2002-12-11 15:22 ` Andrew Cagney
  2002-12-22 10:25 ` Fernando Nasser
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Cagney @ 2002-12-11 15:22 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb-patches, Fernando Nasser

Hey, that reminds me.  Anyone want to move this to the gdb.gdb/ directory?

Andrew

> I recently happened to compare the outputs of gdb.base/selftest.exp
> when GDB is compiled with and without optimization, and noticed that
> it failed only in the optimized case.  Digging further, it happens
> during the part of the test that steps through captured_main; when GDB
> is compiled with optimization, GDB sometimes stops on the opening
> brace.  That's not an error, but the regexps in question didn't allow
> that.
> 
> When I added a regexp to allow that, I found that GDB also sometimes
> stopped on the line 'current_directory = gdb_dirbuf', even though it's
> after the dirarg initialization line that we're looking for.  This
> looks like a reordering by the optimizer (or perhaps misleading
> location information from the optimizer), so it's not a GDB bug
> either.
> 
> Here's a patch to selftest.exp to allow those possibilities; with this
> patch, all the tests in that file pass whether or not GDB is compiled
> with optimization.
> 
> David Carlton
> carlton@math.stanford.edu
> 
> 2002-12-11  David Carlton  <carlton@math.stanford.edu>
> 
> 	* gdb.base/selftest.exp (do_steps_and_nexts): Allow initial brace
> 	and current_directory initialization.
> 
> Index: selftest.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/selftest.exp,v
> retrieving revision 1.5
> diff -u -p -r1.5 selftest.exp
> --- selftest.exp	4 Dec 2002 03:15:27 -0000	1.5
> +++ selftest.exp	11 Dec 2002 21:08:19 -0000
> @@ -54,6 +54,10 @@ proc do_steps_and_nexts {} {
>  
>      for {set count 0} {$count < 26} {incr count} {
>  	send_gdb "list\n"
> +	# NOTE: carlton/2002-12-11: The "initial brace" and
> +	# "current_directory initialization" possibilities happen to
> +	# me with GCC 3.1 on i686-pc-linux-gnu when I compile with
> +	# optimization.
>  	gdb_expect {
>  	    -re ".*context = data.*$gdb_prompt $" {
>  		set description "step over context initialization"
> @@ -157,6 +161,14 @@ proc do_steps_and_nexts {} {
>  	    -re ".*textdomain .PACKAGE.;.*$gdb_prompt $" {
>  		set description "next over textdomain PACKAGE"
>  		set command "next"
> +	    }
> +	    -re "\[0-9\]*\t\{\r\n$gdb_prompt $" {
> +		set description "step over initial brace"
> +		set command "step"
> +	    }
> +	    -re ".*current_directory = gdb_dirbuf.*$gdb_prompt $" {
> +		set description "step over current_directory initialization"
> +		set command "step"
>  	    }
>  	    -re "\[ \t\]+\{\r\n$gdb_prompt $" {
>  		setup_xfail "mips-*-irix5*"
> 



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

* [rfa/testsuite] gdb.base/selftest.exp: work with optimization
@ 2002-12-11 13:24 David Carlton
  2002-12-11 15:22 ` Andrew Cagney
  2002-12-22 10:25 ` Fernando Nasser
  0 siblings, 2 replies; 7+ messages in thread
From: David Carlton @ 2002-12-11 13:24 UTC (permalink / raw)
  To: gdb-patches; +Cc: Fernando Nasser

I recently happened to compare the outputs of gdb.base/selftest.exp
when GDB is compiled with and without optimization, and noticed that
it failed only in the optimized case.  Digging further, it happens
during the part of the test that steps through captured_main; when GDB
is compiled with optimization, GDB sometimes stops on the opening
brace.  That's not an error, but the regexps in question didn't allow
that.

When I added a regexp to allow that, I found that GDB also sometimes
stopped on the line 'current_directory = gdb_dirbuf', even though it's
after the dirarg initialization line that we're looking for.  This
looks like a reordering by the optimizer (or perhaps misleading
location information from the optimizer), so it's not a GDB bug
either.

Here's a patch to selftest.exp to allow those possibilities; with this
patch, all the tests in that file pass whether or not GDB is compiled
with optimization.

David Carlton
carlton@math.stanford.edu

2002-12-11  David Carlton  <carlton@math.stanford.edu>

	* gdb.base/selftest.exp (do_steps_and_nexts): Allow initial brace
	and current_directory initialization.

Index: selftest.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/selftest.exp,v
retrieving revision 1.5
diff -u -p -r1.5 selftest.exp
--- selftest.exp	4 Dec 2002 03:15:27 -0000	1.5
+++ selftest.exp	11 Dec 2002 21:08:19 -0000
@@ -54,6 +54,10 @@ proc do_steps_and_nexts {} {
 
     for {set count 0} {$count < 26} {incr count} {
 	send_gdb "list\n"
+	# NOTE: carlton/2002-12-11: The "initial brace" and
+	# "current_directory initialization" possibilities happen to
+	# me with GCC 3.1 on i686-pc-linux-gnu when I compile with
+	# optimization.
 	gdb_expect {
 	    -re ".*context = data.*$gdb_prompt $" {
 		set description "step over context initialization"
@@ -157,6 +161,14 @@ proc do_steps_and_nexts {} {
 	    -re ".*textdomain .PACKAGE.;.*$gdb_prompt $" {
 		set description "next over textdomain PACKAGE"
 		set command "next"
+	    }
+	    -re "\[0-9\]*\t\{\r\n$gdb_prompt $" {
+		set description "step over initial brace"
+		set command "step"
+	    }
+	    -re ".*current_directory = gdb_dirbuf.*$gdb_prompt $" {
+		set description "step over current_directory initialization"
+		set command "step"
 	    }
 	    -re "\[ \t\]+\{\r\n$gdb_prompt $" {
 		setup_xfail "mips-*-irix5*"


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

end of thread, other threads:[~2002-12-23 16:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-11 14:19 [rfa/testsuite] gdb.base/selftest.exp: work with optimization Michael Elizabeth Chastain
2002-12-11 14:31 ` David Carlton
  -- strict thread matches above, loose matches on Subject: below --
2002-12-11 21:52 Michael Elizabeth Chastain
2002-12-11 13:24 David Carlton
2002-12-11 15:22 ` Andrew Cagney
2002-12-22 10:25 ` Fernando Nasser
2002-12-23  9:08   ` David Carlton

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