From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8299 invoked by alias); 29 Aug 2003 20:03:45 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8262 invoked from network); 29 Aug 2003 20:03:44 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 29 Aug 2003 20:03:44 -0000 Received: from redhat.com (vpn50-63.rdu.redhat.com [172.16.50.63]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 84ECD80033C for ; Fri, 29 Aug 2003 16:03:37 -0400 (EDT) Message-ID: <3F4FB1C1.4090306@redhat.com> Date: Fri, 29 Aug 2003 20:03:00 -0000 From: Dave Brolley User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021216 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches Subject: [patch][rfa] sim/testsuite/lib/sim-defs.exp - Allow multiline comments at the start of test cases Content-Type: multipart/mixed; boundary="------------000505010903060109060208" X-SW-Source: 2003-08/txt/msg00544.txt.bz2 This is a multi-part message in MIME format. --------------000505010903060109060208 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 228 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 --------------000505010903060109060208 Content-Type: text/plain; name="sim-testsuite.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sim-testsuite.patch.txt" Content-length: 1696 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 --------------000505010903060109060208--