* [RFA/TESTSUITE]: readline tests
@ 2002-07-24 12:08 Tom Tromey
2002-08-13 13:10 ` Fernando Nasser
0 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2002-07-24 12:08 UTC (permalink / raw)
To: gdb-patches
This adds a new file of readline tests. Currently it only checks
operate-and-get-next; Elena wanted some tests for a recent patch in
that area.
Ok?
Tom
Index: testsuite/ChangeLog
from Tom Tromey <tromey@redhat.com>
* gdb.base/readline.exp: New file.
Index: testsuite/gdb.base/readline.exp
===================================================================
RCS file: testsuite/gdb.base/readline.exp
diff -N testsuite/gdb.base/readline.exp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/gdb.base/readline.exp 24 Jul 2002 17:59:10 -0000
@@ -0,0 +1,190 @@
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Tom Tromey <tromey@redhat.com>
+
+# This file is part of the gdb testsuite.
+
+#
+# Tests for readline operations.
+#
+
+# This function is used to test operate-and-get-next.
+# NAME is the name of the test.
+# ARGS is a list of alternating commands and expected results.
+proc operate_and_get_next {name args} {
+ global gdb_prompt
+
+ set my_gdb_prompt "($gdb_prompt| >)"
+
+ set reverse {}
+ foreach {item result} $args {
+ verbose "sending $item"
+ sleep 1
+
+ # We can't use gdb_test here because we might see a " >" prompt.
+ set status 0
+ send_gdb "$item\n"
+ gdb_expect {
+ -re "$item" {
+ # Ok
+ }
+ timeout {
+ set status 1
+ }
+ }
+
+ if {! $status} {
+ gdb_expect {
+ -re "$result" {
+ # Ok.
+ }
+ timeout {
+ set status 1
+ }
+ }
+ }
+
+ if {$status} {
+ fail "$name - send $item"
+ return 0
+ }
+ pass "$name - send $item"
+
+ set reverse [linsert $reverse 0 $item $result]
+ }
+
+ # Now use C-p to go back to the start.
+ foreach {item result} $reverse {
+ # Actually send C-p followed by C-l. This lets us recognize the
+ # command when gdb prints it again.
+ send_gdb "\x10\x0c"
+ set status 0
+ gdb_expect {
+ -re "$item" {
+ # Ok
+ }
+ timeout {
+ set status 1
+ }
+ }
+ if {$status} {
+ fail "$name - C-p to $item"
+ return 0
+ }
+ pass "$name - C-p to $item"
+ }
+
+ # Now C-o through the list. Don't send the command, since it is
+ # already there. Strip off the first command from the list so we
+ # can see the next command inside the loop.
+ set count 0
+ foreach {item result} $args {
+ set status 0
+
+ # If this isn't the first item, make sure we see the command at
+ # the prompt.
+ if {$count > 0} {
+ gdb_expect {
+ -re ".*$item" {
+ # Ok
+ }
+ timeout {
+ set status 1
+ }
+ }
+ }
+
+ if {! $status} {
+ # For the last item, send a simple \n instead of C-o.
+ if {$count == [llength $args] - 2} {
+ send_gdb "\n"
+ } else {
+ # 15 is C-o.
+ send_gdb [format %c 15]
+ }
+ set status 0
+ gdb_expect {
+ -re "$result" {
+ # Ok
+ }
+ timeout {
+ set status 1
+ }
+ }
+ }
+
+ if {$status} {
+ fail "$name - C-o for $item"
+ return 0
+ }
+ pass "$name - C-o for $item"
+
+ set count [expr {$count + 2}]
+ }
+
+ return 1
+}
+
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+# Don't let a .inputrc file or an existing setting of INPUTRC mess up
+# the test results. Even if /dev/null doesn't exist on the particular
+# platform, the readline library will use the default setting just by
+# failing to open the file. OTOH, opening /dev/null successfully will
+# also result in the default settings being used since nothing will be
+# read from this file.
+global env
+if [info exists env(INPUTRC)] {
+ set old_inputrc $env(INPUTRC)
+}
+set env(INPUTRC) "/dev/null"
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+set oldtimeout1 $timeout
+set timeout 30
+
+
+# A simple test of operate-and-get-next.
+operate_and_get_next "Simple operate-and-get-next" \
+ "p 1" ".* = 1" \
+ "p 2" ".* = 2"\
+ "p 3" ".* = 3"
+
+# Test operate-and-get-next with a secondary prompt.
+operate_and_get_next "operate-and-get-next with secondary prompt" \
+ "if 1 > 0" "" \
+ "p 5" "" \
+ "end" ".* = 5"
+
+
+# Restore globals modified in this test...
+if [info exists old_inputrc] {
+ set env(INPUTRC) $old_inputrc
+} else {
+ unset env(INPUTRC)
+}
+set timeout $oldtimeout1
+
+return 0
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [RFA/TESTSUITE]: readline tests
2002-07-24 12:08 [RFA/TESTSUITE]: readline tests Tom Tromey
@ 2002-08-13 13:10 ` Fernando Nasser
2002-08-13 13:13 ` Elena Zannoni
0 siblings, 1 reply; 9+ messages in thread
From: Fernando Nasser @ 2002-08-13 13:10 UTC (permalink / raw)
To: tromey; +Cc: gdb-patches, Elena Zannoni
Sorry for the delay Tom.
New tests are always welcome.
Elena, is it OK with you? Can we check it in?
Regards to all.
Fernando
Tom Tromey wrote:
>
> This adds a new file of readline tests. Currently it only checks
> operate-and-get-next; Elena wanted some tests for a recent patch in
> that area.
>
> Ok?
>
> Tom
>
> Index: testsuite/ChangeLog
> from Tom Tromey <tromey@redhat.com>
>
> * gdb.base/readline.exp: New file.
>
> Index: testsuite/gdb.base/readline.exp
> ===================================================================
> RCS file: testsuite/gdb.base/readline.exp
> diff -N testsuite/gdb.base/readline.exp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ testsuite/gdb.base/readline.exp 24 Jul 2002 17:59:10 -0000
> @@ -0,0 +1,190 @@
> +# Copyright 2002 Free Software Foundation, Inc.
> +
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
> +
> +# Please email any bugs, comments, and/or additions to this file to:
> +# bug-gdb@prep.ai.mit.edu
> +
> +# This file was written by Tom Tromey <tromey@redhat.com>
> +
> +# This file is part of the gdb testsuite.
> +
> +#
> +# Tests for readline operations.
> +#
> +
> +# This function is used to test operate-and-get-next.
> +# NAME is the name of the test.
> +# ARGS is a list of alternating commands and expected results.
> +proc operate_and_get_next {name args} {
> + global gdb_prompt
> +
> + set my_gdb_prompt "($gdb_prompt| >)"
> +
> + set reverse {}
> + foreach {item result} $args {
> + verbose "sending $item"
> + sleep 1
> +
> + # We can't use gdb_test here because we might see a " >" prompt.
> + set status 0
> + send_gdb "$item\n"
> + gdb_expect {
> + -re "$item" {
> + # Ok
> + }
> + timeout {
> + set status 1
> + }
> + }
> +
> + if {! $status} {
> + gdb_expect {
> + -re "$result" {
> + # Ok.
> + }
> + timeout {
> + set status 1
> + }
> + }
> + }
> +
> + if {$status} {
> + fail "$name - send $item"
> + return 0
> + }
> + pass "$name - send $item"
> +
> + set reverse [linsert $reverse 0 $item $result]
> + }
> +
> + # Now use C-p to go back to the start.
> + foreach {item result} $reverse {
> + # Actually send C-p followed by C-l. This lets us recognize the
> + # command when gdb prints it again.
> + send_gdb "\x10\x0c"
> + set status 0
> + gdb_expect {
> + -re "$item" {
> + # Ok
> + }
> + timeout {
> + set status 1
> + }
> + }
> + if {$status} {
> + fail "$name - C-p to $item"
> + return 0
> + }
> + pass "$name - C-p to $item"
> + }
> +
> + # Now C-o through the list. Don't send the command, since it is
> + # already there. Strip off the first command from the list so we
> + # can see the next command inside the loop.
> + set count 0
> + foreach {item result} $args {
> + set status 0
> +
> + # If this isn't the first item, make sure we see the command at
> + # the prompt.
> + if {$count > 0} {
> + gdb_expect {
> + -re ".*$item" {
> + # Ok
> + }
> + timeout {
> + set status 1
> + }
> + }
> + }
> +
> + if {! $status} {
> + # For the last item, send a simple \n instead of C-o.
> + if {$count == [llength $args] - 2} {
> + send_gdb "\n"
> + } else {
> + # 15 is C-o.
> + send_gdb [format %c 15]
> + }
> + set status 0
> + gdb_expect {
> + -re "$result" {
> + # Ok
> + }
> + timeout {
> + set status 1
> + }
> + }
> + }
> +
> + if {$status} {
> + fail "$name - C-o for $item"
> + return 0
> + }
> + pass "$name - C-o for $item"
> +
> + set count [expr {$count + 2}]
> + }
> +
> + return 1
> +}
> +
> +
> +if $tracelevel {
> + strace $tracelevel
> +}
> +
> +# Don't let a .inputrc file or an existing setting of INPUTRC mess up
> +# the test results. Even if /dev/null doesn't exist on the particular
> +# platform, the readline library will use the default setting just by
> +# failing to open the file. OTOH, opening /dev/null successfully will
> +# also result in the default settings being used since nothing will be
> +# read from this file.
> +global env
> +if [info exists env(INPUTRC)] {
> + set old_inputrc $env(INPUTRC)
> +}
> +set env(INPUTRC) "/dev/null"
> +
> +gdb_start
> +gdb_reinitialize_dir $srcdir/$subdir
> +
> +set oldtimeout1 $timeout
> +set timeout 30
> +
> +
> +# A simple test of operate-and-get-next.
> +operate_and_get_next "Simple operate-and-get-next" \
> + "p 1" ".* = 1" \
> + "p 2" ".* = 2"\
> + "p 3" ".* = 3"
> +
> +# Test operate-and-get-next with a secondary prompt.
> +operate_and_get_next "operate-and-get-next with secondary prompt" \
> + "if 1 > 0" "" \
> + "p 5" "" \
> + "end" ".* = 5"
> +
> +
> +# Restore globals modified in this test...
> +if [info exists old_inputrc] {
> + set env(INPUTRC) $old_inputrc
> +} else {
> + unset env(INPUTRC)
> +}
> +set timeout $oldtimeout1
> +
> +return 0
--
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] 9+ messages in thread* Re: [RFA/TESTSUITE]: readline tests
2002-08-13 13:10 ` Fernando Nasser
@ 2002-08-13 13:13 ` Elena Zannoni
2002-08-13 13:23 ` Fernando Nasser
0 siblings, 1 reply; 9+ messages in thread
From: Elena Zannoni @ 2002-08-13 13:13 UTC (permalink / raw)
To: Fernando Nasser; +Cc: tromey, gdb-patches, Elena Zannoni
Fernando Nasser writes:
> Sorry for the delay Tom.
>
> New tests are always welcome.
>
> Elena, is it OK with you? Can we check it in?
>
> Regards to all.
>
> Fernando
>
yes yes.
Elena
>
>
> Tom Tromey wrote:
> >
> > This adds a new file of readline tests. Currently it only checks
> > operate-and-get-next; Elena wanted some tests for a recent patch in
> > that area.
> >
> > Ok?
> >
> > Tom
> >
> > Index: testsuite/ChangeLog
> > from Tom Tromey <tromey@redhat.com>
> >
> > * gdb.base/readline.exp: New file.
> >
> > Index: testsuite/gdb.base/readline.exp
> > ===================================================================
> > RCS file: testsuite/gdb.base/readline.exp
> > diff -N testsuite/gdb.base/readline.exp
> > --- /dev/null 1 Jan 1970 00:00:00 -0000
> > +++ testsuite/gdb.base/readline.exp 24 Jul 2002 17:59:10 -0000
> > @@ -0,0 +1,190 @@
> > +# Copyright 2002 Free Software Foundation, Inc.
> > +
> > +# This program is free software; you can redistribute it and/or modify
> > +# it under the terms of the GNU General Public License as published by
> > +# the Free Software Foundation; either version 2 of the License, or
> > +# (at your option) any later version.
> > +#
> > +# This program is distributed in the hope that it will be useful,
> > +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > +# GNU General Public License for more details.
> > +#
> > +# You should have received a copy of the GNU General Public License
> > +# along with this program; if not, write to the Free Software
> > +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
> > +
> > +# Please email any bugs, comments, and/or additions to this file to:
> > +# bug-gdb@prep.ai.mit.edu
> > +
> > +# This file was written by Tom Tromey <tromey@redhat.com>
> > +
> > +# This file is part of the gdb testsuite.
> > +
> > +#
> > +# Tests for readline operations.
> > +#
> > +
> > +# This function is used to test operate-and-get-next.
> > +# NAME is the name of the test.
> > +# ARGS is a list of alternating commands and expected results.
> > +proc operate_and_get_next {name args} {
> > + global gdb_prompt
> > +
> > + set my_gdb_prompt "($gdb_prompt| >)"
> > +
> > + set reverse {}
> > + foreach {item result} $args {
> > + verbose "sending $item"
> > + sleep 1
> > +
> > + # We can't use gdb_test here because we might see a " >" prompt.
> > + set status 0
> > + send_gdb "$item\n"
> > + gdb_expect {
> > + -re "$item" {
> > + # Ok
> > + }
> > + timeout {
> > + set status 1
> > + }
> > + }
> > +
> > + if {! $status} {
> > + gdb_expect {
> > + -re "$result" {
> > + # Ok.
> > + }
> > + timeout {
> > + set status 1
> > + }
> > + }
> > + }
> > +
> > + if {$status} {
> > + fail "$name - send $item"
> > + return 0
> > + }
> > + pass "$name - send $item"
> > +
> > + set reverse [linsert $reverse 0 $item $result]
> > + }
> > +
> > + # Now use C-p to go back to the start.
> > + foreach {item result} $reverse {
> > + # Actually send C-p followed by C-l. This lets us recognize the
> > + # command when gdb prints it again.
> > + send_gdb "\x10\x0c"
> > + set status 0
> > + gdb_expect {
> > + -re "$item" {
> > + # Ok
> > + }
> > + timeout {
> > + set status 1
> > + }
> > + }
> > + if {$status} {
> > + fail "$name - C-p to $item"
> > + return 0
> > + }
> > + pass "$name - C-p to $item"
> > + }
> > +
> > + # Now C-o through the list. Don't send the command, since it is
> > + # already there. Strip off the first command from the list so we
> > + # can see the next command inside the loop.
> > + set count 0
> > + foreach {item result} $args {
> > + set status 0
> > +
> > + # If this isn't the first item, make sure we see the command at
> > + # the prompt.
> > + if {$count > 0} {
> > + gdb_expect {
> > + -re ".*$item" {
> > + # Ok
> > + }
> > + timeout {
> > + set status 1
> > + }
> > + }
> > + }
> > +
> > + if {! $status} {
> > + # For the last item, send a simple \n instead of C-o.
> > + if {$count == [llength $args] - 2} {
> > + send_gdb "\n"
> > + } else {
> > + # 15 is C-o.
> > + send_gdb [format %c 15]
> > + }
> > + set status 0
> > + gdb_expect {
> > + -re "$result" {
> > + # Ok
> > + }
> > + timeout {
> > + set status 1
> > + }
> > + }
> > + }
> > +
> > + if {$status} {
> > + fail "$name - C-o for $item"
> > + return 0
> > + }
> > + pass "$name - C-o for $item"
> > +
> > + set count [expr {$count + 2}]
> > + }
> > +
> > + return 1
> > +}
> > +
> > +
> > +if $tracelevel {
> > + strace $tracelevel
> > +}
> > +
> > +# Don't let a .inputrc file or an existing setting of INPUTRC mess up
> > +# the test results. Even if /dev/null doesn't exist on the particular
> > +# platform, the readline library will use the default setting just by
> > +# failing to open the file. OTOH, opening /dev/null successfully will
> > +# also result in the default settings being used since nothing will be
> > +# read from this file.
> > +global env
> > +if [info exists env(INPUTRC)] {
> > + set old_inputrc $env(INPUTRC)
> > +}
> > +set env(INPUTRC) "/dev/null"
> > +
> > +gdb_start
> > +gdb_reinitialize_dir $srcdir/$subdir
> > +
> > +set oldtimeout1 $timeout
> > +set timeout 30
> > +
> > +
> > +# A simple test of operate-and-get-next.
> > +operate_and_get_next "Simple operate-and-get-next" \
> > + "p 1" ".* = 1" \
> > + "p 2" ".* = 2"\
> > + "p 3" ".* = 3"
> > +
> > +# Test operate-and-get-next with a secondary prompt.
> > +operate_and_get_next "operate-and-get-next with secondary prompt" \
> > + "if 1 > 0" "" \
> > + "p 5" "" \
> > + "end" ".* = 5"
> > +
> > +
> > +# Restore globals modified in this test...
> > +if [info exists old_inputrc] {
> > + set env(INPUTRC) $old_inputrc
> > +} else {
> > + unset env(INPUTRC)
> > +}
> > +set timeout $oldtimeout1
> > +
> > +return 0
>
> --
> 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] 9+ messages in thread* Re: [RFA/TESTSUITE]: readline tests
2002-08-13 13:13 ` Elena Zannoni
@ 2002-08-13 13:23 ` Fernando Nasser
2002-08-13 15:10 ` Tom Tromey
0 siblings, 1 reply; 9+ messages in thread
From: Fernando Nasser @ 2002-08-13 13:23 UTC (permalink / raw)
To: Elena Zannoni; +Cc: tromey, gdb-patches, Elena Zannoni
Please check them in Tom.
Thanks for the tests and
again, my apologies for the delay.
Best regards,
Fernando
--
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] 9+ messages in thread
* Re: [RFA/TESTSUITE]: readline tests
2002-08-13 13:23 ` Fernando Nasser
@ 2002-08-13 15:10 ` Tom Tromey
2002-08-15 11:19 ` Mark Kettenis
0 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2002-08-13 15:10 UTC (permalink / raw)
To: Fernando Nasser; +Cc: Elena Zannoni, gdb-patches, Elena Zannoni
>>>>> "Fernando" == Fernando Nasser <fnasser@redhat.com> writes:
Fernando> Please check them in Tom.
Fernando> Thanks for the tests and
Fernando> again, my apologies for the delay.
I've checked in the new test file.
The delay is no problem; I've been on vacation.
Tom
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFA/TESTSUITE]: readline tests
2002-08-13 15:10 ` Tom Tromey
@ 2002-08-15 11:19 ` Mark Kettenis
2002-08-16 10:54 ` Tom Tromey
0 siblings, 1 reply; 9+ messages in thread
From: Mark Kettenis @ 2002-08-15 11:19 UTC (permalink / raw)
To: tromey; +Cc: Fernando Nasser, Elena Zannoni, gdb-patches
Tom Tromey <tromey@redhat.com> writes:
> >>>>> "Fernando" == Fernando Nasser <fnasser@redhat.com> writes:
>
> Fernando> Please check them in Tom.
> Fernando> Thanks for the tests and
> Fernando> again, my apologies for the delay.
>
> I've checked in the new test file.
> The delay is no problem; I've been on vacation.
>
> Tom
Hmm, two of the new tests are failing on my FreeBSD system:
Running ../../../../src/src/gdb/testsuite/gdb.base/readline.exp ...
FAIL: gdb.base/readline.exp: Simple operate-and-get-next - C-o for p 1
FAIL: gdb.base/readline.exp: operate-and-get-next with secondary prompt - send end
Since I'm failing to understand how the test work :-(, can you shed
some light on this Tom? Here's the relevant part of gdb.log:
Running ../../../../src/src/gdb/testsuite/gdb.base/readline.exp ...
spawn /usr/home/kettenis/obj/gdb/gdb/testsuite/../../gdb/gdb -nw -nx
GNU gdb 2002-08-15-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd4.6".
(gdb) set height 0
(gdb) set width 0
(gdb) dir
Reinitialize source path to empty? (y or n) y
Source directories searched: $cdir:$cwd
(gdb) dir ../../../../src/src/gdb/testsuite/gdb.base
Source directories searched: /usr/home/kettenis/obj/gdb/gdb/testsuite/../../../../src/src/gdb/testsuite/gdb.base:$cdir:$cwd
(gdb) p 1
$1 = 1
PASS: gdb.base/readline.exp: Simple operate-and-get-next - send p 1
(gdb) p 2
$2 = 2
PASS: gdb.base/readline.exp: Simple operate-and-get-next - send p 2
(gdb) p 3
$3 = 3
PASS: gdb.base/readline.exp: Simple operate-and-get-next - send p 3
(gdb) p 3ESC[HESC[J(gdb) p 3PASS: gdb.base/readline.exp: Simple operate-and-get-next - C-p to p 3
2ESC[HESC[J(gdb) p 2PASS: gdb.base/readline.exp: Simple operate-and-get-next - C-p to p 2
1ESC[HESC[J(gdb) p 1PASS: gdb.base/readline.exp: Simple operate-and-get-next - C-p to p 1
FAIL: gdb.base/readline.exp: Simple operate-and-get-next - C-o for p 1
if 1 > 0
PASS: gdb.base/readline.exp: operate-and-get-next with secondary prompt - send if 1 > 0
Invalid number "1if".
p 5
PASS: gdb.base/readline.exp: operate-and-get-next with secondary prompt - send p 5
(gdb) p 5
$4 = 5
(gdb) end
This command cannot be used at the top level.
(gdb) FAIL: gdb.base/readline.exp: operate-and-get-next with secondary prompt - send end
testcase ../../../../src/src/gdb/testsuite/gdb.base/readline.exp completed in 66 seconds
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFA/TESTSUITE]: readline tests
2002-08-15 11:19 ` Mark Kettenis
@ 2002-08-16 10:54 ` Tom Tromey
2002-08-16 12:20 ` Andreas Schwab
0 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2002-08-16 10:54 UTC (permalink / raw)
To: Mark Kettenis; +Cc: Fernando Nasser, Elena Zannoni, gdb-patches
>>>>> "Mark" == Mark Kettenis <kettenis@chello.nl> writes:
Mark> FAIL: gdb.base/readline.exp: Simple operate-and-get-next - C-o for p 1
I think this means that sending C-o didn't cause an operate-and-get-next.
The subsequent problems are caused by this.
Does operate-and-get-next work on your system?
You can find out by starting gdb and doing something like this:
p 1
p 2
<C-p C-p> -> should display "p 1"
<C-o> -> Should execute "p 1" and display "p 2"
Tom
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFA/TESTSUITE]: readline tests
2002-08-16 10:54 ` Tom Tromey
@ 2002-08-16 12:20 ` Andreas Schwab
2002-08-16 17:47 ` Mark Kettenis
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2002-08-16 12:20 UTC (permalink / raw)
To: tromey; +Cc: Mark Kettenis, Fernando Nasser, Elena Zannoni, gdb-patches
Tom Tromey <tromey@redhat.com> writes:
|> >>>>> "Mark" == Mark Kettenis <kettenis@chello.nl> writes:
|>
|> Mark> FAIL: gdb.base/readline.exp: Simple operate-and-get-next - C-o for p 1
|>
|> I think this means that sending C-o didn't cause an operate-and-get-next.
|> The subsequent problems are caused by this.
Note that C-o is typically also allocated to the tty flush (DISCARD)
character. Since readline does not reset the IEXTEN flag the flush
character may still be intercepted by the tty driver even in non-canonical
input.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [RFA/TESTSUITE]: readline tests
2002-08-16 12:20 ` Andreas Schwab
@ 2002-08-16 17:47 ` Mark Kettenis
0 siblings, 0 replies; 9+ messages in thread
From: Mark Kettenis @ 2002-08-16 17:47 UTC (permalink / raw)
To: schwab; +Cc: tromey, fnasser, ezannoni, gdb-patches
From: Andreas Schwab <schwab@suse.de>
Date: Fri, 16 Aug 2002 21:20:26 +0200
User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.3.50 (ia64-suse-linux)
Content-Type: text/plain; charset=iso-8859-1
Tom Tromey <tromey@redhat.com> writes:
|> I think this means that sending C-o didn't cause an operate-and-get-next.
|> The subsequent problems are caused by this.
Note that C-o is typically also allocated to the tty flush (DISCARD)
character. Since readline does not reset the IEXTEN flag the flush
character may still be intercepted by the tty driver even in non-canonical
input.
Yup, that's what's happening. After
$ stty discard ^Y
operate-and-get-next works fine. So we should either reset the IEXTEN
or set DISCARD to _POSIX_VDISABLE, either in readline or GDB. I'm
inclined to make the attached patch to readline, since something
similar is already done for LNEXT. Should I submit it to the readline
maintainer?
PS Something strange is still happening. Some operate-and-get-next
tests still fail when a .gdb_history file is present in the current
directory that has more than 254 lines. If no .gdb_history file is
present or if it contains less than 255 lines, the tests succeed.
Unfortunately a test that gets run earlier produces just that; a
.gdb_history file with 257 lines. Anyway, it seems that I've found a
bug in the history code. I'll see if I can find it.
Index: rltty.c
===================================================================
RCS file: /cvs/src/src/readline/rltty.c,v
retrieving revision 1.5
diff -u -p -r1.5 rltty.c
--- rltty.c 8 Jan 2001 14:57:30 -0000 1.5
+++ rltty.c 17 Aug 2002 00:25:48 -0000
@@ -598,6 +598,10 @@ prepare_terminal_settings (meta_flag, ot
be necessary. */
#if defined (TERMIOS_TTY_DRIVER) && defined (_POSIX_VDISABLE)
+#if defined (VDISCARD)
+ tiop->c_cc[VDISCARD] = _POSIX_VDISABLE;
+#endif
+
#if defined (VLNEXT)
tiop->c_cc[VLNEXT] = _POSIX_VDISABLE;
#endif
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2002-08-17 0:47 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-24 12:08 [RFA/TESTSUITE]: readline tests Tom Tromey
2002-08-13 13:10 ` Fernando Nasser
2002-08-13 13:13 ` Elena Zannoni
2002-08-13 13:23 ` Fernando Nasser
2002-08-13 15:10 ` Tom Tromey
2002-08-15 11:19 ` Mark Kettenis
2002-08-16 10:54 ` Tom Tromey
2002-08-16 12:20 ` Andreas Schwab
2002-08-16 17:47 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox