Commit | Line | Data |
---|---|---|
9b254dd1 | 1 | # Copyright (C) 1998, 2007, 2008 Free Software Foundation, Inc. |
7be570e7 JM |
2 | |
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
e22f8b7c | 5 | # the Free Software Foundation; either version 3 of the License, or |
7be570e7 | 6 | # (at your option) any later version. |
e22f8b7c | 7 | # |
7be570e7 JM |
8 | # This program is distributed in the hope that it will be useful, |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
e22f8b7c | 12 | # |
7be570e7 | 13 | # You should have received a copy of the GNU General Public License |
e22f8b7c | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
7be570e7 JM |
15 | |
16 | # Please email any bugs, comments, and/or additions to this file to: | |
17 | # bug-gdb@prep.ai.mit.edu | |
18 | ||
19 | ||
20 | # This file is part of the gdb testsuite | |
21 | ||
22 | ||
23 | # pxdb.exp Test that gdb calls pxdb on an application | |
24 | # built without it. | |
25 | # | |
26 | if $tracelevel then { | |
27 | strace $tracelevel | |
28 | } | |
29 | ||
30 | set prms_id 0 | |
31 | set bug_id 0 | |
32 | ||
33 | if { [skip_hp_tests] } then { continue } | |
34 | ||
35 | set testfile pxdb | |
36 | set srcfile ${testfile}.c | |
37 | set objfile ${objdir}/${subdir}/${testfile}.o | |
38 | set binfile ${objdir}/${subdir}/${testfile} | |
39 | ||
40 | if [get_compiler_info ${binfile} "c++"] { | |
41 | return -1; | |
42 | } | |
43 | ||
44 | if { $gcc_compiled } then { continue } | |
45 | ||
46 | # To build a non-pxdb-ed file, use | |
47 | # | |
48 | # <compile to .o file> | |
49 | # export LD_PXDB /dev/null | |
50 | # ld -o hello_no_pxdb hello.o /opt/langtools/lib/end.o /usr/ccs/lib/crt0.o -lc | |
51 | # | |
52 | ||
53 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } { | |
b60f0898 JB |
54 | untested pxdb.exp |
55 | return -1 | |
7be570e7 JM |
56 | } |
57 | ||
58 | # | |
59 | # use this to debug: | |
60 | #log_user 1 | |
61 | ||
62 | ||
63 | # Following should get the error message: | |
64 | # | |
65 | # ld: (Warning) Can't exec pxdb using path: /dev/null | |
66 | # | |
67 | #execute_anywhere "ksh -c \"export LD_PXDB=/dev/null\"" | |
68 | ||
ca344dff | 69 | if [istarget "hppa64-*-*"] { |
7be570e7 JM |
70 | set cmdline "ksh -c \"LD_PXDB=/dev/null ld -o ${binfile} ${objfile} /opt/langtools/lib/pa20_64/crt0.o /opt/langtools/lib/pa20_64/end.o -lc\"" |
71 | } else { | |
72 | set cmdline "ksh -c \"LD_PXDB=/dev/null ld -o ${binfile} ${objfile} /usr/ccs/lib/crt0.o /opt/langtools/lib/end.o -lc\"" | |
73 | } | |
74 | ||
75 | remote_exec build "rm ${binfile}" | |
76 | remote_exec build $cmdline | |
77 | ||
78 | gdb_exit | |
79 | gdb_start | |
80 | gdb_reinitialize_dir $srcdir/$subdir | |
81 | ||
82 | # We expect to see this: | |
83 | # | |
84 | # "warning: File not processed by pxdb--about to process now. | |
85 | # " | |
86 | # ". | |
87 | # "Procedures: 7 | |
88 | # "Files: 2 | |
89 | # "Reading symbols from ~/c_code.dir/hello_no_pxdb...done. | |
90 | # "(gdb) | |
91 | # | |
92 | send_gdb "file ${binfile}\n" | |
93 | gdb_expect { | |
94 | ||
95 | -re ".*warning: File not processed by pxdb.*Procedures: \[0-9\]+.*$gdb_prompt $"\ | |
96 | { pass "PXDB call" } | |
97 | ||
98 | -re "$gdb_prompt $" { | |
99 | if [istarget hppa*-*-hpux*] { | |
100 | pass "Didn't call pxdb" | |
101 | } else { | |
102 | fail "Didn't call pxdb" | |
103 | } | |
104 | } | |
105 | ||
106 | -re ".*$gdb_prompt $" { fail "Some other message" } | |
107 | ||
108 | timeout { fail "call pxdb (timeout)" } | |
109 | } | |
110 | ||
111 | # Make sure the new data makes sense | |
112 | # | |
113 | if { ![runto callee] } then { return } | |
114 | ||
115 | send_gdb "print x\n" | |
116 | gdb_expect { | |
117 | -re ".*= 1.*$gdb_prompt $" { pass "Good data after pxdb call" } | |
118 | -re ".*$gdb_prompt $" { fail "No data after pxdb call" } | |
119 | timeout { fail "(timeout)" } | |
120 | } | |
121 | ||
122 | gdb_exit | |
123 | return 0 | |
124 | ||
125 | ||
126 | ||
127 | ||
128 |