This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH/RFA] Add new readline.exp test for operate-and-get-next


See http://sources.redhat.com/ml/gdb-patches/2002-08/msg00486.html for
the problem description and patch.

OK to apply?

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* top.c (gdb_rl_operate_and_get_next): Make sure
	operate-and-get-next functions correctly even when the history
	list is completely filled.

Index: testsuite/gdb.base/readline.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/readline.exp,v
retrieving revision 1.1
diff -u -p -r1.1 readline.exp
--- testsuite/gdb.base/readline.exp 13 Aug 2002 22:10:18 -0000 1.1
+++ testsuite/gdb.base/readline.exp 17 Aug 2002 10:07:36 -0000
@@ -169,7 +169,7 @@ 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 2" ".* = 2" \
   "p 3" ".* = 3"
 
 # Test operate-and-get-next with a secondary prompt.
@@ -179,11 +179,43 @@ operate_and_get_next "operate-and-get-ne
   "end" ".* = 5"
 
 
+# Now repeat the first test with a history file that fills the entire
+# history list.
+
+if [info exists env(GDBHISTFILE)] {
+    set old_gdbhistfile $env(GDBHISTFILE)
+}
+if [info exists env(HISTSIZE)] {
+    set old_histsize $env(HISTSIZE)
+}
+set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
+set env(HISTSIZE) "10"
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+operate_and_get_next "Simple operate-and-get-next" \
+  "p 7" ".* = 7" \
+  "p 8" ".* = 8" \
+  "p 9" ".* = 9"
+
+
 # Restore globals modified in this test...
 if [info exists old_inputrc] {
     set env(INPUTRC) $old_inputrc
 } else {
     unset env(INPUTRC)
+}
+if [info exists old_gdbhistfile] {
+    set env(GDBHISTFILE) $old_gdbhistfile
+} else {
+    unset env(GDBHISTFILE)
+}
+if [info exists old_histsize] {
+    set env(HISTSIZE) $old_histsize
+} else {
+    unset env(HISTSIZE)
 }
 set timeout $oldtimeout1
 
--- /dev/null	Sat Aug 17 12:08:16 2002
+++ testsuite/gdb.base/gdb_history	Sat Aug 17 11:44:24 2002
@@ -0,0 +1,256 @@
+add-symbol-file
+append
+append binary
+append memory
+append value
+append binary memory
+append binary value
+attach
+break
+b
+br
+bre
+brea
+backtrace
+bt
+ba
+bac
+continue
+c
+call
+catch
+cd
+clear
+commands
+condition
+core-file
+d
+delete
+define
+delete breakpoints
+delete display
+detach
+directory
+dis
+disa
+disable
+disable breakpoints
+disable display
+disassemble
+display
+do
+document
+down
+down-silently
+dump
+dump binary
+dump ihex
+dump memory
+dump srec
+dump tekhex
+dump value
+dump binary memory
+dump binary value
+dump ihex memory
+dump ihex value
+dump srec memory
+dump srec value
+dump tekhex memory
+dump tekhex value
+echo
+enable breakpoints delete
+enable breakpoints once
+enable breakpoints
+enable delete
+enable display
+enable once
+enable
+exec-file
+f
+frame
+fg
+file
+finish
+forward-search
+gcore
+generate-core-file
+h
+help
+handle
+i
+info
+ignore
+info address
+info all-registers
+info args
+info bogus-gdb-command
+info breakpoints
+info catch
+info copying
+info display
+info f
+info frame
+info files
+info float
+info functions
+info locals
+info program
+info registers
+info s
+info stack
+info set
+info symbol
+info source
+info sources
+info target
+info terminal
+info types
+info variables
+info warranty
+info watchpoints
+inspect
+jump
+kill
+l
+list
+load
+n
+next
+ni
+nexti
+output
+overlay
+overlay on
+overlay manual
+overlay auto
+overlay off
+overlay list
+overlay map
+overlay unmap
+overlay manual
+overlay map
+overlay unmap
+p
+print
+printf
+ptype
+pwd
+r
+run
+rbreak
+restore
+return
+reverse-search
+s
+step
+search
+section
+set annotate
+set args
+set c
+set ch
+set check
+set check range
+set check type
+set complaints
+set confirm
+set environment
+set height
+set history expansion
+set history filename
+set history save
+set history size
+set history
+set language
+set listsize
+set p
+set pr
+set print
+set print address
+set print array
+set print asm-demangle
+set print demangle
+set print elements
+set print object
+set print pretty
+set print sevenbit-strings
+set print union
+set print vtbl
+set radix
+set symbol-reloading
+set variable
+set verbose
+set width
+set write
+set
+shell echo Hi dad!
+show annotate
+show args
+show c
+show ch
+show check
+show check range
+show check type
+show commands
+show complaints
+show confirm
+show convenience
+show directories
+show editing
+show height
+show history expansion
+show history filename
+show history save
+show history size
+show history
+show language
+show listsize
+show p
+show pr
+show print
+show paths
+show print address
+show print array
+show print asm-demangle
+show print demangle
+show print elements
+show print object
+show print pretty
+show print sevenbit-strings
+show print union
+show print vtbl
+show prompt
+show radix
+show symbol-reloading
+show user
+show values
+show verbose
+show version
+show width
+show write
+show
+si
+stepi
+signal
+source
+s
+step
+symbol-file
+target child
+target procfs
+target core
+target exec
+target remote
+target
+tbreak
+tty
+u
+until
+undisplay
+unset environment
+unset
+up-silently
+watch
+whatis
+where
+x


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]