This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch][rfa] sim/testsuite/lib/sim-defs.exp - Allow multiline commentsat the start of test cases
- From: Dave Brolley <brolley at redhat dot com>
- To: gdb-patches <gdb-patches at sources dot redhat dot com>
- Date: Fri, 29 Aug 2003 16:04:17 -0400
- Subject: [patch][rfa] sim/testsuite/lib/sim-defs.exp - Allow multiline commentsat the start of test cases
Hi,
This patch allows simulator test cases to have arbitrary multiline
comments at the beginning of the file, before the test case options. The
current implementation allows only one line.
Tested on frv. ok to commit?
Dave
Index: sim/testsuite/lib/sim-defs.exp
===================================================================
RCS file: /cvs/src/src/sim/testsuite/lib/sim-defs.exp,v
retrieving revision 1.3
diff -c -p -r1.3 sim-defs.exp
*** sim/testsuite/lib/sim-defs.exp 31 Jul 2001 04:59:59 -0000 1.3
--- sim/testsuite/lib/sim-defs.exp 29 Aug 2003 20:00:55 -0000
*************** proc slurp_options { file } {
*** 331,350 ****
# whitespace is ignored anywhere except within the options list;
# option names are alphabetic only
set pat "^#${ws}(\[a-zA-Z\]*)\\(?(\[^):\]*)\\)?$ws:${ws}(.*)$ws\$"
! # Allow comment as first line of file.
! set firstline 1
while { [gets $f line] != -1 } {
set line [string trim $line]
# Whitespace here is space-tab.
if [regexp $pat $line xxx opt_name opt_machs opt_val] {
# match!
lappend opt_array [list $opt_name $opt_machs $opt_val]
} else {
! if { ! $firstline } {
break
}
}
- set firstline 0
}
close $f
return $opt_array
--- 331,350 ----
# whitespace is ignored anywhere except within the options list;
# option names are alphabetic only
set pat "^#${ws}(\[a-zA-Z\]*)\\(?(\[^):\]*)\\)?$ws:${ws}(.*)$ws\$"
! # Allow arbitrary comments as first few lines line of file.
! set seen_opt 0
while { [gets $f line] != -1 } {
set line [string trim $line]
# Whitespace here is space-tab.
if [regexp $pat $line xxx opt_name opt_machs opt_val] {
# match!
lappend opt_array [list $opt_name $opt_machs $opt_val]
+ set seen_opt 1
} else {
! if { $seen_opt } {
break
}
}
}
close $f
return $opt_array