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.
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\""]
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
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\""]