old-cross-binutils/gdb/testsuite/gdb.base/langs.exp
Tom Tromey fda326dd1d gdb
* infrun.c (print_exited_reason): Include inferior id and pid in
	message.
gdb/testsuite
	* lib/opencl.exp (skip_opencl_tests): Update for exit message
	change.
	* lib/mi-support.exp (mi_gdb_test): Update for exit message
	change.
	* lib/gdb.exp (gdb_test_multiple): Update comment.  Update for
	exit message change.
	(skip_altivec_tests): Update for exit message change.
	(skip_vsx_tests): Likewise.
	(gdb_continue_to_end): Likewise.  Add 'command' argument.
	* lib/cell.exp (skip_cell_tests): Update for exit message change.
	* gdb.threads/tls.exp: Update for exit message change.
	* gdb.threads/thread-unwindonsignal.exp: Use
	gdb_continue_to_end.
	* gdb.threads/step.exp (step_it): Update for exit message change.
	(continue_all): Likewise.
	* gdb.threads/print-threads.exp (test_all_threads): Update for
	exit message change.
	* gdb.threads/interrupted-hand-call.exp: Use
	gdb_continue_to_end.
	* gdb.threads/execl.exp: Use gdb_continue_to_end.
	* gdb.python/py-prettyprint.exp (run_lang_tests): Use
	gdb_continue_to_end.
	* gdb.hp/gdb.objdbg/objdbg02.exp: Use gdb_continue_to_end.
	* gdb.hp/gdb.objdbg/objdbg01.exp: Use gdb_continue_to_end.
	* gdb.hp/gdb.defects/solib-d.exp: Update for exit message change.
	* gdb.cp/method.exp: Update for exit message change.
	* gdb.cp/mb-templates.exp: Update for exit message change.
	* gdb.cp/mb-inline.exp: Use gdb_continue_to_end.
	* gdb.cp/annota3.exp: Update for exit message change.
	* gdb.cp/annota2.exp: Update for exit message change.
	* gdb.cell/fork.exp: Use gdb_continue_to_end.
	* gdb.base/term.exp: Update for exit message change.
	* gdb.base/step-test.exp (test_i): Update for exit message change.
	* gdb.base/sigstep.exp (advance): Update for exit message change.
	(advancei): Likewise.
	* gdb.base/siginfo.exp: Update for exit message change.
	* gdb.base/shlib-call.exp: Use gdb_continue_to_end.
	* gdb.base/reread.exp: Use gdb_continue_to_end.
	* gdb.base/langs.exp: Use gdb_continue_to_end.
	* gdb.base/interrupt.exp: Update for exit message change.
	* gdb.base/gdb1555.exp: Update for exit message change.
	* gdb.base/exe-lock.exp: Use gdb_continue_to_end.
	* gdb.base/ending-run.exp: Update for exit message change.
	* gdb.base/chng-syms.exp: Update for exit message change.
	* gdb.base/checkpoint.exp: Update for exit message change.
	* gdb.base/catch-syscall.exp (check_for_program_end): Use
	gdb_continue_to_end.
	(test_catch_syscall_with_wrong_args): Likewise.
	* gdb.base/call-signal-resume.exp: Use gdb_continue_to_end.
	* gdb.base/break-interp.exp (test_ld): Update for exit message
	change.
	* gdb.base/bang.exp: Update for exit message change.
	* gdb.base/attach.exp (do_attach_tests): Use gdb_continue_to_end.
	(do_call_attach_tests): Likewise.
	* gdb.base/a2-run.exp: Update for exit message change.
	* gdb.arch/ppc-dfp.exp: Update for exit message change.
	* gdb.ada/tasks.exp: Use gdb_continue_to_end.
	* gdb.ada/catch_ex.exp: Use gdb_continue_to_end.
2011-03-07 16:03:04 +00:00

164 lines
5 KiB
Text

# Copyright (C) 1997, 1998, 2007, 2008, 2009, 2010, 2011
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if $tracelevel then {
strace $tracelevel
}
set testfile langs
set binfile ${objdir}/${subdir}/${testfile}
if [is_remote host] {
remote_download host ${srcdir}/${subdir}/langs1.f
remote_download host ${srcdir}/${subdir}/langs2.cxx
}
if { [gdb_compile "${srcdir}/${subdir}/langs0.c" "${binfile}0.o" object {debug}] != "" } {
untested langs.exp
return -1
}
if { [gdb_compile "${srcdir}/${subdir}/langs1.c" "${binfile}1.o" object {debug}] != "" } {
untested langs.exp
return -1
}
if { [gdb_compile "${srcdir}/${subdir}/langs2.c" "${binfile}2.o" object {debug}] != "" } {
untested langs.exp
return -1
}
if { [gdb_compile "${binfile}0.o ${binfile}1.o ${binfile}2.o" ${binfile} executable {debug}] != "" } {
untested langs.exp
return -1
}
set oldtimeout $timeout
set timeout 10
# Create and source the file that provides information about the compiler
# used to compile the test case.
if [get_compiler_info ${binfile}] {
return -1;
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
gdb_test_multiple "b langs0" "break on nonexistent function in langs.exp" {
-re "Function \"langs0\" not defined\..*Make breakpoint pending on future shared library load.*y or .n.. $" {
gdb_test "n" "" "break on nonexistent function in langs.exp"
}
-re "Breakpoint .* (deferred).*$gdb_prompt $" {
pass "break on nonexistent function in langs.exp"
}
}
if {$hp_aCC_compiler} {
set isfixed 1
set lang c\\+\\+
set ext cxx
set foo_func foo__Fi__Fi
set do_func do::langs0
} else {
if {$hp_cc_compiler} {
set isfixed 1
set lang c
set ext c
} else {
set isfixed 0
}
set foo_func foo__Fi
set do_func langs0__2do
}
if [runto csub] then {
if { !$isfixed } { set lang c }
gdb_test "show language" "currently $lang\".*" \
"show language at csub in langs.exp"
# On some machines, foo doesn't get demangled because the N_SOL for
# langs2.cxx is seen only after the function stab for foo. So
# the following regexps are kludged to accept foo__Fi as well as foo,
# even though only the latter is correct. I haven't tried to xfail it
# because it depends on details of the compiler.
# Take out xfail. This test has been passing for some time now.
#if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
gdb_test "bt" "#0.*csub.*#1.*(foo|$foo_func) \\(.*#2.*cppsub_ .*#3.*fsub.*#4.*$do_func \\(.*#5 \[0-9a-fx\]* in main.*" "backtrace in langs.exp"
if { !$isfixed } { set lang c\\+\\+; set ext cxx }
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "up" ".* in (foo|$foo_func).* at langs2\\.$ext.*return csub \\(.*" \
"up to foo in langs.exp"
gdb_test "show language" "currently $lang.*" \
"show language at foo in langs.exp"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "up" ".* in cppsub_ .* at langs2\\.$ext.*return foo \\(.*" \
"up to cppsub_ in langs.exp"
gdb_test "show language" "currently $lang.*" \
"show language at cppsub_ in langs.exp"
if { !$isfixed } { set lang fortran }
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "up" ".* in fsub.* at langs1\\.f.*" \
"up to fsub in langs.exp"
gdb_test "show language" "currently $lang.*" \
"show language at fsub in langs.exp"
# Take out xfail. This test has been passing for sometime now.
#if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
if { !$isfixed } { set lang c }
gdb_test "up" ".* in $do_func .* at .*langs0\\.c.*return fsub.*" \
"up to langs0__2do in langs.exp"
gdb_test "show language" "currently $lang\".*" \
"show language at langs0__2do in langs.exp"
gdb_test "up" ".* in main .* at .*langs0\\.c.*if \\(langs0__2do \\(.*" \
"up to main in langs.exp"
gdb_test "show language" "currently $lang\".*" \
"show language at main in langs.exp"
if [target_info exists gdb,noresults] { return }
gdb_continue_to_end "langs.exp"
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load $binfile
# Try exercising the "minimal" language a bit...
if [runto csub] then {
gdb_test "set lang minimal" \
"Warning: the current language does not match this frame." \
"set lang to minimal"
gdb_test "print x" " = 5000" "print parameter value"
}
set timeout $oldtimeout
return 0