1 # Copyright (C) 1998, 2007, 2008, 2009, 2010, 2011
2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # This file is part of the gdb testsuite
21 # pxdb.exp Test that gdb calls pxdb on an application
29 if { [skip_hp_tests] } then { continue }
32 set srcfile ${testfile}.c
33 set objfile ${objdir}/${subdir}/${testfile}.o
34 set binfile ${objdir}/${subdir}/${testfile}
36 if [get_compiler_info ${binfile} "c++"] {
40 if { $gcc_compiled } then { continue }
42 # To build a non-pxdb-ed file, use
44 # <compile to .o file>
45 # export LD_PXDB /dev/null
46 # ld -o hello_no_pxdb hello.o /opt/langtools/lib/end.o /usr/ccs/lib/crt0.o -lc
49 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
59 # Following should get the error message:
61 # ld: (Warning) Can't exec pxdb using path: /dev/null
63 #execute_anywhere "ksh -c \"export LD_PXDB=/dev/null\""
65 if [istarget "hppa64-*-*"] {
66 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\""
68 set cmdline "ksh -c \"LD_PXDB=/dev/null ld -o ${binfile} ${objfile} /usr/ccs/lib/crt0.o /opt/langtools/lib/end.o -lc\""
71 remote_exec build "rm ${binfile}"
72 remote_exec build $cmdline
76 gdb_reinitialize_dir $srcdir/$subdir
78 # We expect to see this:
80 # "warning: File not processed by pxdb--about to process now.
85 # "Reading symbols from ~/c_code.dir/hello_no_pxdb...done.
88 send_gdb "file ${binfile}\n"
91 -re ".*warning: File not processed by pxdb.*Procedures: \[0-9\]+.*$gdb_prompt $"\
95 if [istarget hppa*-*-hpux*] {
96 pass "Didn't call pxdb"
98 fail "Didn't call pxdb"
102 -re ".*$gdb_prompt $" { fail "Some other message" }
104 timeout { fail "call pxdb (timeout)" }
107 # Make sure the new data makes sense
109 if { ![runto callee] } then { return }
113 -re ".*= 1.*$gdb_prompt $" { pass "Good data after pxdb call" }
114 -re ".*$gdb_prompt $" { fail "No data after pxdb call" }
115 timeout { fail "(timeout)" }