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] Fix segfault on empty else


On Thu, Jul 06, 2006 at 05:18:46PM +0100, Andrew STUBBS wrote:
> #    with true condition
> if {[gdb_test_multiple "if 1\nend\necho got here\\n" "if 1 with empty body" {
> 	-re ".*got here.*$gdb_prompt $" {pass "if 1 with empty body"}
>      }] != 0} {
>     gdb_exit
>     gdb_start
> }

Does this work better?

set message "if 1 with empty body"
gdb_test_multiple "if 1\nend\necho got here\n" $message {
  -re "got here.*$gdb_prompt $" {
    pass $message
  }
  eof {
    fail $message
    gdb_exit
    gdb_start
  }
}


-- 
Daniel Jacobowitz
CodeSourcery


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