From f1208f9e0a164d55b91416876a5881321d3851b7 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Wed, 18 Aug 2010 16:37:22 +0000 Subject: [PATCH] * gdb.base/call-ar-st.exp (set_lang_c): Delete, unused. * gdb.base/callfuncs.exp (set_lang_c): Delete, set c language directly. * gdb.base/printcmds.exp (set_lang_c): Delete, set c language directly. Simplify, early exit if runto_main fails. * gdb.fortran/exprs.exp: load_lib fortran.exp. (set_lang_fortran): Moved to lib/fortran.exp. * gdb.fortran/types.exp: load_lib fortran.exp. (set_lang_fortran): Moved to lib/fortran.exp. * gdb.java/jmisc.exp (set_lang_java): Moved to lib/java.exp. * gdb.java/jprint.exp (set_lang_java): Ditto. * gdb.java/jv-exp.exp: load_lib java.exp. If set_lang_java fails, issue a warning instead of failure to be consistent with other set_lang_foo uses. (set_lang_java): Moved to lib/java.exp. * gdb.java/jv-print.exp (set_lang_java): Moved to lib/java.exp. If set_lang_java fails, issue a warning instead of failure to be consistent with other set_lang_foo uses. * gdb.pascal/types.exp: load_lib pascal.exp. (set_lang_pascal): Moved to lib/pascal.exp. * lib/fortran.exp: New file. * lib/java.exp (set_lang_java): New function. * lib/pascal.exp (set_lang_pascal): New function. --- gdb/testsuite/ChangeLog | 25 +++++++++ gdb/testsuite/gdb.base/call-ar-st.exp | 24 --------- gdb/testsuite/gdb.base/callfuncs.exp | 27 +--------- gdb/testsuite/gdb.base/printcmds.exp | 77 +++++++++++---------------- gdb/testsuite/gdb.fortran/exprs.exp | 20 +------ gdb/testsuite/gdb.fortran/types.exp | 20 +------ gdb/testsuite/gdb.java/jmisc.exp | 19 +------ gdb/testsuite/gdb.java/jprint.exp | 19 +------ gdb/testsuite/gdb.java/jv-exp.exp | 19 +------ gdb/testsuite/gdb.java/jv-print.exp | 19 +------ gdb/testsuite/gdb.pascal/types.exp | 18 +------ gdb/testsuite/lib/fortran.exp | 30 +++++++++++ gdb/testsuite/lib/java.exp | 14 +++++ gdb/testsuite/lib/pascal.exp | 13 +++++ 14 files changed, 126 insertions(+), 218 deletions(-) create mode 100644 gdb/testsuite/lib/fortran.exp diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 83edb7566fd..5490e7e4ed7 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,28 @@ +2010-08-18 Doug Evans + + * gdb.base/call-ar-st.exp (set_lang_c): Delete, unused. + * gdb.base/callfuncs.exp (set_lang_c): Delete, set c language directly. + * gdb.base/printcmds.exp (set_lang_c): Delete, set c language directly. + Simplify, early exit if runto_main fails. + * gdb.fortran/exprs.exp: load_lib fortran.exp. + (set_lang_fortran): Moved to lib/fortran.exp. + * gdb.fortran/types.exp: load_lib fortran.exp. + (set_lang_fortran): Moved to lib/fortran.exp. + * gdb.java/jmisc.exp (set_lang_java): Moved to lib/java.exp. + * gdb.java/jprint.exp (set_lang_java): Ditto. + * gdb.java/jv-exp.exp: load_lib java.exp. + If set_lang_java fails, issue a warning instead of failure to be + consistent with other set_lang_foo uses. + (set_lang_java): Moved to lib/java.exp. + * gdb.java/jv-print.exp (set_lang_java): Moved to lib/java.exp. + If set_lang_java fails, issue a warning instead of failure to be + consistent with other set_lang_foo uses. + * gdb.pascal/types.exp: load_lib pascal.exp. + (set_lang_pascal): Moved to lib/pascal.exp. + * lib/fortran.exp: New file. + * lib/java.exp (set_lang_java): New function. + * lib/pascal.exp (set_lang_pascal): New function. + 2010-08-18 Yao Qi . + +# Auxiliary function to set the language to fortran. +# The result is 1 (true) for success, 0 (false) for failure. + +proc set_lang_fortran {} { + if [gdb_test_no_output "set language fortran"] { + return 0 + } + if [gdb_test "show language" ".* source language is \"fortran\"." \ + "set language to \"fortran\""] { + return 0 + } + return 1; +} diff --git a/gdb/testsuite/lib/java.exp b/gdb/testsuite/lib/java.exp index fc56ba570c1..f552be9ee50 100644 --- a/gdb/testsuite/lib/java.exp +++ b/gdb/testsuite/lib/java.exp @@ -105,6 +105,20 @@ proc compile_java_from_source { srcfile binfile compile_args } { return $result } +# Auxiliary function to set the language to java. +# The result is 1 (true) for success, 0 (false) for failure. + +proc set_lang_java {} { + if [gdb_test_no_output "set language java"] { + return 0 + } + if [gdb_test "show language" ".* source language is \"java\"." \ + "set language to \"java\""] { + return 0 + } + return 1; +} + # Local Variables: # tcl-indent-level:4 # End: diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp index 9691bc1a734..af0b00db7e8 100644 --- a/gdb/testsuite/lib/pascal.exp +++ b/gdb/testsuite/lib/pascal.exp @@ -150,3 +150,16 @@ proc gdb_compile_pascal {source dest type options} { } } +# Auxiliary function to set the language to pascal. +# The result is 1 (true) for success, 0 (false) for failure. + +proc set_lang_pascal {} { + if [gdb_test_no_output "set language pascal"] { + return 0 + } + if [gdb_test "show language" ".* source language is \"pascal\"." \ + "set language to \"pascal\""] { + return 0 + } + return 1; +} -- 2.30.2