From: Michael Snyder Date: Wed, 26 May 2010 18:34:12 +0000 (+0000) Subject: 2010-05-26 Michael Snyder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=23de6b34102ea355f05aaa1bfb4ebac1510f3407;p=binutils-gdb.git 2010-05-26 Michael Snyder * gdb.java/jmisc.exp: Replace send_gdb with gdb_test. * gdb.java/jprint.exp: Replace send_gdb with gdb_test. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c9aaa2978d2..3b83ec00588 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2010-05-26 Michael Snyder + * 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 32a7443a864..d1cf2cb4957 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 178c80a5a5f..18ff7ed12b8 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\""]