Commit | Line | Data |
---|---|---|
06c87bef FF |
1 | if $tracelevel then { |
2 | strace $tracelevel | |
3 | } | |
4 | ||
5 | set prms_id 0 | |
6 | set bug_id 0 | |
7 | ||
8 | set binfile $objdir/$subdir/langs | |
9 | ||
10 | if ![file exists $binfile] then { | |
11 | perror "$binfile does not exist." | |
12 | return 0 | |
13 | } | |
14 | ||
15 | gdb_exit | |
16 | gdb_start | |
17 | gdb_reinitialize_dir $srcdir/$subdir | |
18 | gdb_load $binfile | |
19 | ||
ce102e96 FF |
20 | source gdb.base/langs0.ci |
21 | ||
06c87bef FF |
22 | gdb_test "b langs0" {Function "langs0" not defined\.} \ |
23 | "break on nonexistent function in langs.exp" | |
24 | ||
25 | if [runto csub] then { | |
26 | gdb_test "show language" "currently c\".*" \ | |
27 | "show language at csub in langs.exp" | |
28 | # On some machines, foo doesn't get demangled because the N_SOL for | |
29 | # langs2.cxx is seen only after the function stab for foo. So | |
30 | # the following regexps are kludged to accept foo__Fi as well as foo, | |
31 | # even though only the latter is correct. I haven't tried to xfail it | |
32 | # because it depends on details of the compiler. | |
33 | 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" | |
34 | ||
ce102e96 | 35 | if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" } |
06c87bef FF |
36 | setup_xfail "i*86-*-sysv4*" |
37 | gdb_test "up" ".* in (foo|foo__Fi) .* at langs2\\.cxx.*return csub \\(.*" \ | |
38 | "up to foo in langs.exp" | |
39 | setup_xfail "i*86-*-sysv4*" | |
40 | gdb_test "show language" "currently c\\+\\+.*" \ | |
41 | "show language at foo in langs.exp" | |
42 | ||
43 | setup_xfail "i*86-*-sysv4*" | |
ce102e96 | 44 | if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" } |
06c87bef FF |
45 | gdb_test "up" ".* in cppsub_ .* at langs2\\.cxx.*return foo \\(.*" \ |
46 | "up to cppsub_ in langs.exp" | |
47 | setup_xfail "i*86-*-sysv4*" | |
48 | gdb_test "show language" "currently c\\+\\+.*" \ | |
49 | "show language at cppsub_ in langs.exp" | |
50 | ||
51 | setup_xfail "i*86-*-sysv4*" | |
ce102e96 | 52 | if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" } |
06c87bef FF |
53 | gdb_test "up" ".* in fsub.* at langs1\\.f.*return \\(cppsub .*" \ |
54 | "up to fsub in langs.exp" | |
55 | setup_xfail "i*86-*-sysv4*" | |
56 | gdb_test "show language" "currently fortran.*" \ | |
57 | "show language at fsub in langs.exp" | |
58 | ||
59 | gdb_test "up" ".* in langs0__2do .* at .*langs0\\.c.*return fsub.*" \ | |
60 | "up to langs0__2do in langs.exp" | |
61 | gdb_test "show language" "currently c\".*" \ | |
62 | "show language at langs0__2do in langs.exp" | |
63 | ||
64 | gdb_test "up" ".* in main .* at .*langs0\\.c.*if \\(langs0__2do \\(.*" \ | |
65 | "up to main in langs.exp" | |
66 | gdb_test "show language" "currently c\".*" \ | |
67 | "show language at main in langs.exp" | |
68 | ||
69 | gdb_test "cont" "Program exited normally\\." \ | |
70 | "continue to exit in langs.exp" | |
71 | } | |
72 | ||
73 | return 0 |