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: [RFA] gdb.base a*.exp b*.exp send_gdb vs gdb_test


> 2010-05-22  Michael Snyder  <msnyder@vmware.com>
> 
> 	* gdb.base/a2-run.exp: Replace send_gdb with gdb_test.
> 	* gdb.base/all-bin.exp: Replace send_gdb with gdb_test.
> 	* gdb.base/annota1.exp: Replace send_gdb with gdb_test.
> 	* gdb.base/annota3.exp: Replace send_gdb with gdb_test.
> 	* gdb.base/assign.exp: Replace send_gdb with gdb_test.
> 	* gdb.base/attach.exp: Replace send_gdb with gdb_test.
> 	* gdb.base/bitfields.exp: Replace send_gdb with gdb_test.
> 	* gdb.base/bitfields2.exp: Replace send_gdb with gdb_test.
> 	* gdb.base/bitops.exp: Replace send_gdb with gdb_test.

One general question:

> -gdb_expect {
> +gdb_test_multiple "run" "run until main breakpoint" {
>      -re "\r\n\032\032post-prompt\r\nStarting program: $binexp \(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)+\r\n\r\n\032\032starting\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped.*$gdb_prompt$" {
>  	pass "run until main breakpoint" 
>      }
> -    -re ".*$gdb_prompt$" { 
> -	fail "run until main breakpoint" 
> -    }
> -    timeout { 
> -	fail "run until main breakpoint (timeout)" 
> -    }
> -  }
> +}

It looks to me that this one could have been written using a simple
gdb_test, since I don't see us using the output at all?

> -send_gdb "next\n" 
> -gdb_expect {
> -    -re ".*$gdb_prompt$" { pass "go after array init line" }
> -    timeout { fail "go after array init line (timeout)" }
> +gdb_test_multiple "next" "go after array init line" {
> +    -re "source .*annota1.c.*$gdb_prompt$" {
> +	pass "go after array init line"
> +    }
>  }

Same for this one?

In fact, starting from here, you suddendly started using gdb_test_multiple
even when there was only one regexp used. I'm probably missing someting...?
Is it something in the output that make it unsuitable for gdb_test?



-- 
Joel


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