Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [RFA] gdb.java/*.exp send_gdb vs. gdb_test
Date: Wed, 26 May 2010 00:36:00 -0000	[thread overview]
Message-ID: <4BFC60BA.2070808@vmware.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: java.exp.txt --]
[-- Type: text/plain, Size: 3786 bytes --]

2010-05-25  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.

Index: jmisc.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.java/jmisc.exp,v
retrieving revision 1.17
diff -u -p -r1.17 jmisc.exp
--- jmisc.exp	5 May 2010 18:07:01 -0000	1.17
+++ jmisc.exp	25 May 2010 23:39:47 -0000
@@ -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
Index: jprint.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.java/jprint.exp,v
retrieving revision 1.14
diff -u -p -r1.14 jprint.exp
--- jprint.exp	5 May 2010 18:07:01 -0000	1.14
+++ jprint.exp	25 May 2010 23:39:47 -0000
@@ -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\""]

             reply	other threads:[~2010-05-25 23:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-26  0:36 Michael Snyder [this message]
2010-05-26 18:17 ` Joel Brobecker
2010-05-26 18:46   ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BFC60BA.2070808@vmware.com \
    --to=msnyder@vmware.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox