1 # Copyright (C) 1998-2015 Free Software Foundation, Inc.
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
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
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.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # This file is part of the gdb testsuite
20 # pxdb.exp Test that gdb calls pxdb on an application
24 if { [skip_hp_tests] } then { continue }
27 set srcfile ${testfile}.c
28 set objfile ${objdir}/${subdir}/${testfile}.o
29 set binfile ${objdir}/${subdir}/${testfile}
31 if [get_compiler_info "c++"] {
35 if { $gcc_compiled } then { continue }
37 # To build a non-pxdb-ed file, use
39 # <compile to .o file>
40 # export LD_PXDB /dev/null
41 # ld -o hello_no_pxdb hello.o /opt/langtools/lib/end.o /usr/ccs/lib/crt0.o -lc
44 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
54 # Following should get the error message:
56 # ld: (Warning) Can't exec pxdb using path: /dev/null
58 #execute_anywhere "ksh -c \"export LD_PXDB=/dev/null\""
60 if [istarget "hppa64-*-*"] {
61 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\""
63 set cmdline "ksh -c \"LD_PXDB=/dev/null ld -o ${binfile} ${objfile} /usr/ccs/lib/crt0.o /opt/langtools/lib/end.o -lc\""
66 remote_exec build "rm ${binfile}"
67 remote_exec build $cmdline
71 gdb_reinitialize_dir $srcdir/$subdir
73 # We expect to see this:
75 # "warning: File not processed by pxdb--about to process now.
80 # "Reading symbols from ~/c_code.dir/hello_no_pxdb...done.
83 send_gdb "file ${binfile}\n"
86 -re ".*warning: File not processed by pxdb.*Procedures: \[0-9\]+.*$gdb_prompt $"\
90 if [istarget hppa*-*-hpux*] {
91 pass "Didn't call pxdb"
93 fail "Didn't call pxdb"
97 -re ".*$gdb_prompt $" { fail "Some other message" }
99 timeout { fail "call pxdb (timeout)" }
102 # Make sure the new data makes sense
104 if { ![runto callee] } then { return }
108 -re ".*= 1.*$gdb_prompt $" { pass "Good data after pxdb call" }
109 -re ".*$gdb_prompt $" { fail "No data after pxdb call" }
110 timeout { fail "(timeout)" }