This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb.python/python.exp: fix up race (PR testsuite/12649)
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Marek Polacek <mpolacek at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 29 Sep 2011 20:12:21 +0200
- Subject: Re: [PATCH] gdb.python/python.exp: fix up race (PR testsuite/12649)
- References: <4E81E688.3020109@redhat.com>
On Tue, 27 Sep 2011 17:06:48 +0200, Marek Polacek wrote:
> so we immediately bail out. I've fixed this by splitting the line into three chunks
> and using `exp_continue'.
There is a similar case in gdb.cp/static-print-quit.exp .
> 2011-09-27 Marek Polacek <mpolacek@redhat.com>
>
> * gdb.python/python.exp: Fix race by splitting the line.
I believe the FSF ChangeLog intention is:
* gdb.python/python.exp (verify pagination beforehand)
(verify pagination afterwards): Fix race by splitting the line.
> --- gdb/gdb/testsuite/gdb.python/python.exp.mp 2011-09-27 10:24:56.712668284 +0200
> +++ gdb/gdb/testsuite/gdb.python/python.exp 2011-09-27 16:26:10.973544539 +0200
> @@ -106,7 +106,13 @@ gdb_test_no_output "set height $lines"
>
> set test "verify pagination beforehand"
> gdb_test_multiple "python print \"\\n\" * $lines" $test {
> - -re "---Type <return> to continue, or q <return> to quit---$ " {
^^
The ending two spaces are excessive here, the patch could not be applied.
> + -re "---Type <return>" {
> + exp_continue
> + }
> + -re " to continue, or q <return>" {
> + exp_continue
> + }
> + -re " to quit---" {
^^
There was originally the end-of-buffer anchor and I do not see why to remove
it:
-re " to quit---$" {
> pass $test
> }
> }
> @@ -116,7 +122,13 @@ gdb_test "python if gdb.execute('python
>
> set test "verify pagination afterwards"
> gdb_test_multiple "python print \"\\n\" * $lines" $test {
> - -re "---Type <return> to continue, or q <return> to quit---$" {
> + -re "---Type <return>" {
> + exp_continue
> + }
> + -re " to continue, or q <return>" {
> + exp_continue
> + }
> + -re " to quit---" {
^^
The same here:
-re " to quit---$" {
> pass $test
> }
>
> Marek
OK with these changes.
Thanks,
Jan