Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch][rfa] sim/testsuite/lib/sim-defs.exp - Allow multiline comments at the start of test cases
@ 2003-08-29 20:03 Dave Brolley
       [not found] ` <mailpost.1062187467.27373@news-sj1-1>
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Brolley @ 2003-08-29 20:03 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

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

[-- Attachment #2: sim-testsuite.patch.txt --]
[-- Type: text/plain, Size: 1696 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch][rfa] sim/testsuite/lib/sim-defs.exp - Allow multiline comments at the start of test cases
       [not found] ` <mailpost.1062187467.27373@news-sj1-1>
@ 2003-08-29 20:07   ` cgd
  2003-08-29 20:24     ` Dave Brolley
  2003-09-04 17:08     ` Dave Brolley
  0 siblings, 2 replies; 5+ messages in thread
From: cgd @ 2003-08-29 20:07 UTC (permalink / raw)
  To: brolley; +Cc: gdb-patches

At Fri, 29 Aug 2003 20:04:27 +0000 (UTC), "Dave Brolley" wrote:
> !     # Allow arbitrary comments as first few lines line of file.
> !     set seen_opt 0

err, it's not just the "first few lines" (even w/o the extra "line")
is it?

It's "Allow comments until the first option is seen." or some such, right?



cgd


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch][rfa] sim/testsuite/lib/sim-defs.exp - Allow multiline comments at the start of test cases
  2003-08-29 20:07   ` cgd
@ 2003-08-29 20:24     ` Dave Brolley
  2003-09-04 17:08     ` Dave Brolley
  1 sibling, 0 replies; 5+ messages in thread
From: Dave Brolley @ 2003-08-29 20:24 UTC (permalink / raw)
  To: cgd; +Cc: gdb-patches



cgd@broadcom.com wrote:

>At Fri, 29 Aug 2003 20:04:27 +0000 (UTC), "Dave Brolley" wrote:
>  
>
>>!     # Allow arbitrary comments as first few lines line of file.
>>!     set seen_opt 0
>>    
>>
>
>err, it's not just the "first few lines" (even w/o the extra "line")
>is it?
>
>It's "Allow comments until the first option is seen." or some such, right?
>  
>
ok. Changed.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch][rfa] sim/testsuite/lib/sim-defs.exp - Allow multiline comments at the start of test cases
  2003-08-29 20:07   ` cgd
  2003-08-29 20:24     ` Dave Brolley
@ 2003-09-04 17:08     ` Dave Brolley
  2003-09-09 22:50       ` Dave Brolley
  1 sibling, 1 reply; 5+ messages in thread
From: Dave Brolley @ 2003-09-04 17:08 UTC (permalink / raw)
  To: gdb-patches

cgd@broadcom.com wrote:

>At Fri, 29 Aug 2003 20:04:27 +0000 (UTC), "Dave Brolley" wrote:
>  
>
>>!     # Allow arbitrary comments as first few lines line of file.
>>!     set seen_opt 0
>>    
>>
>
>err, it's not just the "first few lines" (even w/o the extra "line")
>is it?
>
>It's "Allow comments until the first option is seen." or some such, right?
>  
>
Any more comments on this patch? I would like to commit it.

Dave



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch][rfa] sim/testsuite/lib/sim-defs.exp - Allow multiline comments at the start of test cases
  2003-09-04 17:08     ` Dave Brolley
@ 2003-09-09 22:50       ` Dave Brolley
  0 siblings, 0 replies; 5+ messages in thread
From: Dave Brolley @ 2003-09-09 22:50 UTC (permalink / raw)
  To: Dave Brolley; +Cc: gdb-patches



Dave Brolley wrote:

> cgd@broadcom.com wrote:
>
>> At Fri, 29 Aug 2003 20:04:27 +0000 (UTC), "Dave Brolley" wrote:
>>  
>>
>>> !     # Allow arbitrary comments as first few lines line of file.
>>> !     set seen_opt 0
>>>   
>>
>>
>> err, it's not just the "first few lines" (even w/o the extra "line")
>> is it?
>>
>> It's "Allow comments until the first option is seen." or some such, 
>> right?
>>  
>>
> Any more comments on this patch? I would like to commit it. 

I've commited this as something obvious and useful.

Dave



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-09-09 22:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-29 20:03 [patch][rfa] sim/testsuite/lib/sim-defs.exp - Allow multiline comments at the start of test cases Dave Brolley
     [not found] ` <mailpost.1062187467.27373@news-sj1-1>
2003-08-29 20:07   ` cgd
2003-08-29 20:24     ` Dave Brolley
2003-09-04 17:08     ` Dave Brolley
2003-09-09 22:50       ` Dave Brolley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox