Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Elizabeth Chastain <chastain@cygnus.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] testsuite/gdb.c++/ref-types.exp: use runto
Date: Sun, 04 Mar 2001 15:25:00 -0000	[thread overview]
Message-ID: <200103042325.PAA17357@bosch.cygnus.com> (raw)

This is Sunday Project Patch #5 (try #2).  This is unchanged from
the previous version, submitted 2001-02024, which received no response.

gdb.c++/ref-types.exp has several places with control logic like this:

  send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"

      send_gdb "cont\n"
      gdb_expect {
	  -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
	      send_gdb "up\n"
	      gdb_expect {
		  -re ".*main.*$gdb_prompt $" {
		    pass "up from marker1"
		}
		  -re ".*$gdb_prompt $" {
		    fail "up from marker1"
		}
		  timeout { fail "up from marker1 (timeout)" }
	      }
	  }
	  -re "$gdb_prompt $" { fail "continue to marker1"  }
	  timeout { fail "(timeout) continue to marker1"  }
      }

With FSF g++ v3, I am getting output like this:

  Breakpoint 2, marker1() () at /vittone/fsf/2001-02-21/source-src/gdb/testsuite/gdb.c++/ref-types.cc:6
  6	}
  (gdb) FAIL: gdb.c++/ref-types.exp: continue to marker1

So the test script never issues the "up" command, the test script goes
off the rails, and every test FAILs.

The "marker1() ()" output is a v3 bug and I have filed PR gdb/34 about it.

This patch changes the test script to:

  if ![runto 'marker1'] then {
      perror "couldn't run to marker1"
      continue
  }

  gdb_test "up" ".*main.*" "up from marker1"

... which is shorter and cleaner anyways.  This enables the test script
to run its real tests, which proceed to PASS.  This fixes 60 FAILs,
leaving no FAILs for this test script.

Testing: tested on Red Hat Linux 6.2 native and Solaris 2.6 native with
g++ v2 and g++ v3.

OK to apply?

Michael

===

2001-02-24  Michael Chastain  <chastain@redhat.com>

	* gdb.c++/ref-types.exp: Change handwritten code to library
	function 'runto'.

===

Index: gdb/testsuite/gdb.c++/ref-types.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/ref-types.exp,v
retrieving revision 1.3
diff -c -3 -p -r1.3 ref-types.exp
*** gdb/testsuite/gdb.c++/ref-types.exp	2000/12/05 23:57:36	1.3
--- gdb/testsuite/gdb.c++/ref-types.exp	2001/02/24 05:49:52
*************** if ![runto_main] then {
*** 54,123 ****
      continue
  }
  
! send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
! 
!     send_gdb "cont\n"
!     gdb_expect {
!         -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
!             send_gdb "up\n"
!             gdb_expect {
!                 -re ".*main.*$gdb_prompt $" {
! 		    pass "up from marker1"
! 		}
!                 -re ".*$gdb_prompt $" {
! 		    fail "up from marker1"
! 		}
!                 timeout { fail "up from marker1 (timeout)" }
!             }
!         }
!         -re "$gdb_prompt $" { fail "continue to marker1"  }
!         timeout { fail "(timeout) continue to marker1"  }
!     }
! 
! 
! proc gdb_start_again {} {
! global srcdir
! global subdir
! global binfile
! global gdb_prompt
! global decimal
! 
! gdb_start
! gdb_reinitialize_dir $srcdir/$subdir
! gdb_load ${binfile}
! 
! source ${binfile}.ci
! 
! #
! # set it up at a breakpoint so we can play with the variable values
! #
! if ![runto_main] then {
!     perror "couldn't run to breakpoint"
      continue
  }
  
! send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
  
!     send_gdb "cont\n"
!     gdb_expect {
!         -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
!             send_gdb "up\n"
!             gdb_expect {
!                 -re ".*main.*$gdb_prompt $" {
! 		    pass "up from marker1"
! 		}
!                 -re ".*$gdb_prompt $" {
! 		    fail "up from marker1"
! 		}
!                 timeout { fail "up from marker1 (timeout)" }
!             }
!         }
!         -re "$gdb_prompt $" { fail "continue to marker1"  }
!         timeout { fail "(timeout) continue to marker1"  }
      }
- }
  
  
  
  
  
--- 54,94 ----
      continue
  }
  
! if ![runto 'marker1'] then {
!     perror "couldn't run to marker1"
      continue
  }
  
! gdb_test "up" ".*main.*" "up from marker1 1"
  
! proc gdb_start_again {} {
!     global srcdir
!     global subdir
!     global binfile
!     global gdb_prompt
!     global decimal
! 
!     gdb_start
!     gdb_reinitialize_dir $srcdir/$subdir
!     gdb_load ${binfile}
! 
!     source ${binfile}.ci
! 
!     #
!     # set it up at a breakpoint so we can play with the variable values
!     #
!     if ![runto_main] then {
! 	perror "couldn't run to breakpoint"
! 	continue
      }
  
+     if ![runto 'marker1'] then {
+ 	perror "couldn't run to marker1"
+ 	continue
+     }
  
+     gdb_test "up" ".*main.*" "up from marker1 2"
+ }
  
  
  
*************** gdb_expect {
*** 289,315 ****
      timeout           { fail "(timeout) print value of ras\[3\]" }
    }
  
- 
- send_gdb "break f\n" ; gdb_expect -re ".*$gdb_prompt $"
  
!     send_gdb "cont\n"
!     gdb_expect {
!         -re "Break.* f \\(\\) at .*:$decimal.*$gdb_prompt $" {
!             send_gdb "up\n"
!             gdb_expect {
!                 -re ".*main2.*$gdb_prompt $" {
! 		    pass "up from f" 
! 		}
!                 -re ".*$gdb_prompt $" {
! 		    fail "up from f" 
! 		}
!                 timeout { fail "up from f (timeout)" }
!             }
!         }
!         -re "$gdb_prompt $" { fail "continue to f"  }
!         timeout { fail "(timeout) continue to f"  }
!     }
  
  
  send_gdb "print C\n"
  gdb_expect {
--- 260,272 ----
      timeout           { fail "(timeout) print value of ras\[3\]" }
    }
  
  
! if ![runto 'f'] then {
!     perror "couldn't run to f"
!     continue
! }
  
+ gdb_test "up" ".main2.*" "up from f"
  
  send_gdb "print C\n"
  gdb_expect {


             reply	other threads:[~2001-03-04 15:25 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-04 15:25 Michael Elizabeth Chastain [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-03-17 14:37 Michael Elizabeth Chastain
2001-03-17 12:42 Michael Elizabeth Chastain
2001-03-17 15:31 ` Daniel Berlin
2001-03-17 12:35 Michael Elizabeth Chastain
2001-03-17 14:23 ` Daniel Berlin
2001-03-16 21:00 Michael Elizabeth Chastain
2001-03-17 11:12 ` Daniel Berlin
2001-03-16 16:03 Michael Elizabeth Chastain
2001-03-16 14:50 Michael Elizabeth Chastain
2001-03-16 14:55 ` Daniel Berlin
2001-03-16 14:49 Michael Elizabeth Chastain
2001-03-16 14:55 ` Daniel Berlin
     [not found] ` <20010316215907.A3607@redhat.com>
2001-03-17 11:59   ` Daniel Berlin
2001-03-16 14:35 Michael Elizabeth Chastain
2001-03-16 14:40 ` Fernando Nasser
2001-03-16 14:43 ` Daniel Berlin
2001-03-16 14:44 ` Daniel Berlin
2001-03-16 13:15 Michael Elizabeth Chastain
2001-03-16 13:21 ` Fernando Nasser
2001-03-16 15:14   ` Peter.Schauer
2001-03-16 15:17     ` Daniel Berlin
2001-03-16 15:45       ` Michael Snyder
2001-03-16 15:49         ` Daniel Berlin
2001-03-16 15:19   ` Andrew Cagney
2001-03-16 15:21     ` Daniel Berlin
2001-03-17  7:56   ` Daniel Berlin
     [not found] <200103161807.KAA06081@bosch.cygnus.com>
2001-03-16 12:00 ` Fernando Nasser
2001-03-16 13:00 ` Daniel Berlin
2001-03-16 14:29   ` Michael Snyder
2001-02-24  0:16 Michael Elizabeth Chastain

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=200103042325.PAA17357@bosch.cygnus.com \
    --to=chastain@cygnus.com \
    --cc=gdb-patches@sources.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