diff options
-rw-r--r-- | gdb/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jmisc.exp | 38 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jprint.exp | 6 |
3 files changed, 18 insertions, 29 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c9aaa29..3b83ec0 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2010-05-26 Michael Snyder <msnyder@msnyder-server.eng.vmware.com> + * gdb.java/jmisc.exp: Replace send_gdb with gdb_test. + * gdb.java/jprint.exp: Replace send_gdb with gdb_test. + * gdb.gdb/complaints.exp: Replace send_gdb with gdb_test. * gdb.gdb/selftest.exp: Replace send_gdb with gdb_test. * gdb.gdb/xfullpath.exp: Replace send_gdb with gdb_test. diff --git a/gdb/testsuite/gdb.java/jmisc.exp b/gdb/testsuite/gdb.java/jmisc.exp index 32a7443..d1cf2cb 100644 --- a/gdb/testsuite/gdb.java/jmisc.exp +++ b/gdb/testsuite/gdb.java/jmisc.exp @@ -42,11 +42,7 @@ proc set_lang_java {} { verbose "loading file '$binfile'" gdb_load $binfile - send_gdb "set language java\n" - gdb_expect { - -re ".*$gdb_prompt $" {} - timeout { fail "set language java (timeout)" ; return 0 } - } + gdb_test_no_output "set language java" return [gdb_test "show language" ".* source language is \"java\".*" \ "set language to \"java\""] @@ -73,33 +69,27 @@ if ![set_lang_java] then { gdb_breakpoint "${function}void" { allow-pending } gdb_continue_to_breakpoint $function - send_gdb "ptype jmisc\n" - gdb_expect { - -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+jmisc\\(\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $" - { pass "ptype jmisc" } - -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+jmisc\\(\\);\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $" - { pass "ptype jmisc" } - -re ".*$gdb_prompt $" { fail "ptype jmisc" } - timeout { fail "ptype jmisc (timeout)" ; return } + gdb_test_multiple "ptype jmisc" "ptype jmisc" { + -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+jmisc\\(\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $" { + pass "ptype jmisc" + } + -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+jmisc\\(\\);\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $" { + pass "ptype jmisc" + } } - send_gdb "p args\n" - gdb_expect { - -re "\\\$1 = java\.lang\.String\\\[]@\[a-f0-9]+\[\r\n\ \t]+$gdb_prompt $" { pass "p args" } - -re ".*$gdb_prompt $" { fail "p args" } - timeout { fail "p args (timeout)" ; return } - } + gdb_test "p args" \ + "\\\$1 = java\.lang\.String\\\[]@\[a-f0-9]+" - send_gdb "p *args\n" - gdb_expect { - -re "\\\$2 = \{length: 0\}\[\r\n\ \t]+$gdb_prompt $" { pass "p *args" } + gdb_test_multiple "p *args\n" "p *args\n" { + -re "\\\$2 = \{length: 0\}\[\r\n\ \t]+$gdb_prompt $" { + pass "p *args" + } -re "\\\$2 = cannot find java.lang.Object.*$gdb_prompt $" { # Sometimes GCC 4.x does not emit the necessary information # about java.lang.Object. kfail "p *args" gdb/2214 } - -re ".*$gdb_prompt $" { fail "p *args" } - timeout { fail "p *args (timeout)" ; return } } # The idea of running to 'exit' is that 'exit' is in a different diff --git a/gdb/testsuite/gdb.java/jprint.exp b/gdb/testsuite/gdb.java/jprint.exp index 178c80a..18ff7ed 100644 --- a/gdb/testsuite/gdb.java/jprint.exp +++ b/gdb/testsuite/gdb.java/jprint.exp @@ -41,11 +41,7 @@ proc set_lang_java {} { verbose "loading file '$binfile'" gdb_load $binfile - send_gdb "set language java\n" - gdb_expect { - -re ".*$gdb_prompt $" {} - timeout { fail "set language java (timeout)" ; return 0 } - } + gdb_test_no_output "set language java" return [gdb_test "show language" ".* source language is \"java\".*" \ "set language to \"java\""] |