This is the mail archive of the gdb-patches@sourceware.org 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]

Re: [PATCH] Remove unneeded pattern matching in gdb.base/maint.exp


On 12/02/2016 05:05 PM, Luis Machado wrote:
> This gets rid of more useless pattern matching cases in gdb.base/maint.exp. It
> is a follow-on to the previous patch that only removed the timeouts.
> 
> Regression-checked by running gdb.base/maint.exp.
> 
> gdb/testsuite/ChangeLog:
> 
> 2016-12-02  Luis Machado  <lgustavo@codesourcery.com>
> 
> 	* gdb.base/maint.exp: Remove gdb_prompt and timeout handling in
> 	gdb_test_multiple calls.
> 	Use gdb_test instead of gdb_test_multiple when possible.
> ---
>  gdb/testsuite/gdb.base/maint.exp | 27 ++++++++-------------------
>  1 file changed, 8 insertions(+), 19 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
> index 17c606b..9d08ff1 100644
> --- a/gdb/testsuite/gdb.base/maint.exp
> +++ b/gdb/testsuite/gdb.base/maint.exp
> @@ -71,7 +71,7 @@ gdb_test "maint print registers" "Name.*Nr.*Rel.*Offset.*Size.*Type.*"
>  gdb_test_no_output "mt set per on" "mt set per on for expand-symtabs"
>  gdb_test_multiple "mt expand-symtabs $subdir/break\[.\]c$" \
>      "mt expand-symtabs" {
> -	-re "#compunits: (1|2) \\(\[+\](0|1|2)\\),.*$gdb_prompt $" {
> +	-re "#compunits: (1|2) \\(\[+\](0|1|2)\\),.*" {

Why are you removing this ...

>  	    # This should expand at most two primary symtabs.
>  	    # "Normally" it will not expand any, because the symtab
>  	    # holding "main" will already have been expanded, but if the
> @@ -93,7 +93,7 @@ if ![runto_main] then {
>  # If we're using .gdb_index there will be no psymtabs.
>  set have_gdb_index 0
>  gdb_test_multiple "maint info sections .gdb_index" "check for .gdb_index" {
> -    -re ": .gdb_index.*$gdb_prompt $" {
> +    -re ": .gdb_index.*" {
>  	set have_gdb_index 1
>      }

... and this ...

>      -re ".*$gdb_prompt $" {
> @@ -287,29 +287,18 @@ gdb_test "cd [standard_output_file {}]" \
>      "cd to objdir"
>  
>  gdb_test_multiple "maint print msymbols msymbols_output2 ${testfile}" "maint print msymbols" {
> -    -re "^maint print msymbols msymbols_output2 \[^\n\]*\r\n$gdb_prompt $" {
> +    -re "^maint print msymbols msymbols_output2 \[^\n\]*\r\n" {

... and this?

>      	gdb_test_multiple "shell ls msymbols_output2" "maint print msymbols" {
>  	    -re "msymbols_output2\r\n$gdb_prompt $" {
> -	    	gdb_test_multiple "shell grep factorial msymbols_output2" "maint print msymbols" {
> -		    -re "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex \\.?factorial.*$gdb_prompt $" {
> -		    	pass "maint print msymbols"
> -		    }
> -		    -re ".*$gdb_prompt $" {
> -		        fail "maint print msymbols"
> -		    }
> -		}
> -		gdb_test "shell rm -f msymbols_output2" ".*" \
> -		    "shell rm -f msymbols_output2"
> -	    }
> -	    -re ".*$gdb_prompt $" {
> -		fail "maint print msymbols"
> +		gdb_test "shell grep factorial msymbols_output2" \
> +		    "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex \\.?factorial.*" \
> +		    "maint print msymbols"
> +		gdb_test "shell rm -f msymbols_output2" ".*"
>  	    }
>  	}
>      }
> -    -re ".*$gdb_prompt $" {
> -	fail "maint print msymbols"
> -    }
>  }
> +
>  gdb_test "cd ${mydir}" \
>      "Working directory [string_to_regexp ${mydir}]\..*" \
>      "cd to mydir"
> 

This part looks OK.

Thanks,
Pedro Alves


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