* gdb.base/nodebug.exp: Don't try to do an inferior function
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / langs.exp
CommitLineData
06c87bef
FF
1if $tracelevel then {
2 strace $tracelevel
3}
4
5set prms_id 0
6set bug_id 0
7
1b5b9581
FF
8set testfile langs
9set binfile ${objdir}/${subdir}/${testfile}
787f6220
BM
10
11if [is_remote host] {
12 remote_download host ${srcdir}/${subdir}/langs1.f
13 remote_download host ${srcdir}/${subdir}/langs2.cxx
1b5b9581 14}
787f6220
BM
15
16if { [gdb_compile "${srcdir}/${subdir}/langs0.c ${srcdir}/${subdir}/langs1.c ${srcdir}/${subdir}/langs2.c" "${binfile}" executable {debug}] != "" } {
1b5b9581
FF
17 perror "Couldn't link langs."
18 return -1
19}
06c87bef 20
787f6220
BM
21# Create and source the file that provides information about the compiler
22# used to compile the test case.
23if [get_compiler_info ${binfile}] {
24 return -1;
06c87bef
FF
25}
26
27gdb_exit
28gdb_start
29gdb_reinitialize_dir $srcdir/$subdir
30gdb_load $binfile
31
32gdb_test "b langs0" {Function "langs0" not defined\.} \
33 "break on nonexistent function in langs.exp"
34
35if [runto csub] then {
1b5b9581
FF
36 global noresults
37
06c87bef
FF
38 gdb_test "show language" "currently c\".*" \
39 "show language at csub in langs.exp"
40 # On some machines, foo doesn't get demangled because the N_SOL for
41 # langs2.cxx is seen only after the function stab for foo. So
42 # the following regexps are kludged to accept foo__Fi as well as foo,
43 # even though only the latter is correct. I haven't tried to xfail it
44 # because it depends on details of the compiler.
1b5b9581
FF
45
46 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
06c87bef
FF
47 gdb_test "bt" "#0.*csub.*#1.*(foo|foo__Fi) \\(.*#2.*cppsub_ .*#3.*fsub.*#4.*langs0__2do \\(.*#5 \[0-9a-fx\]* in main.*" "backtrace in langs.exp"
48
ce102e96 49 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
06c87bef
FF
50 gdb_test "up" ".* in (foo|foo__Fi) .* at langs2\\.cxx.*return csub \\(.*" \
51 "up to foo in langs.exp"
06c87bef
FF
52 gdb_test "show language" "currently c\\+\\+.*" \
53 "show language at foo in langs.exp"
54
ce102e96 55 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
06c87bef
FF
56 gdb_test "up" ".* in cppsub_ .* at langs2\\.cxx.*return foo \\(.*" \
57 "up to cppsub_ in langs.exp"
06c87bef
FF
58 gdb_test "show language" "currently c\\+\\+.*" \
59 "show language at cppsub_ in langs.exp"
60
ce102e96 61 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
06c87bef
FF
62 gdb_test "up" ".* in fsub.* at langs1\\.f.*return \\(cppsub .*" \
63 "up to fsub in langs.exp"
06c87bef
FF
64 gdb_test "show language" "currently fortran.*" \
65 "show language at fsub in langs.exp"
66
1b5b9581 67 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
06c87bef
FF
68 gdb_test "up" ".* in langs0__2do .* at .*langs0\\.c.*return fsub.*" \
69 "up to langs0__2do in langs.exp"
70 gdb_test "show language" "currently c\".*" \
71 "show language at langs0__2do in langs.exp"
72
73 gdb_test "up" ".* in main .* at .*langs0\\.c.*if \\(langs0__2do \\(.*" \
74 "up to main in langs.exp"
75 gdb_test "show language" "currently c\".*" \
76 "show language at main in langs.exp"
77
1b5b9581
FF
78 if $noresults==1 then { return }
79
787f6220
BM
80 if [target_info exists use_gdb_stub] {
81 gdb_test "cont" "Breakpoint .*exit.*" "continue to exit in langs.exp"
82 } else {
83 gdb_test "cont" "Program exited normally\\." \
84 "continue to exit in langs.exp"
85 }
06c87bef
FF
86}
87
88return 0
This page took 0.092047 seconds and 4 git commands to generate.