]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.exp
run copyright.sh for 2011.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.hp / gdb.base-hp / pxdb.exp
CommitLineData
7b6bb8da
JB
1# Copyright (C) 1998, 2007, 2008, 2009, 2010, 2011
2# Free Software Foundation, Inc.
7be570e7
JM
3
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
e22f8b7c 6# the Free Software Foundation; either version 3 of the License, or
7be570e7 7# (at your option) any later version.
e22f8b7c 8#
7be570e7
JM
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.
e22f8b7c 13#
7be570e7 14# You should have received a copy of the GNU General Public License
e22f8b7c 15# along with this program. If not, see <http://www.gnu.org/licenses/>.
7be570e7 16
7be570e7
JM
17
18# This file is part of the gdb testsuite
19
20
21# pxdb.exp Test that gdb calls pxdb on an application
22# built without it.
23#
24if $tracelevel then {
25 strace $tracelevel
26}
27
7be570e7
JM
28
29if { [skip_hp_tests] } then { continue }
30
31set testfile pxdb
32set srcfile ${testfile}.c
33set objfile ${objdir}/${subdir}/${testfile}.o
34set binfile ${objdir}/${subdir}/${testfile}
35
36if [get_compiler_info ${binfile} "c++"] {
37 return -1;
38}
39
40if { $gcc_compiled } then { continue }
41
42# To build a non-pxdb-ed file, use
43#
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
47#
48
49if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
b60f0898
JB
50 untested pxdb.exp
51 return -1
7be570e7
JM
52}
53
54#
55# use this to debug:
56#log_user 1
57
58
59# Following should get the error message:
60#
61# ld: (Warning) Can't exec pxdb using path: /dev/null
62#
63#execute_anywhere "ksh -c \"export LD_PXDB=/dev/null\""
64
ca344dff 65if [istarget "hppa64-*-*"] {
7be570e7
JM
66set 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\""
67} else {
68set cmdline "ksh -c \"LD_PXDB=/dev/null ld -o ${binfile} ${objfile} /usr/ccs/lib/crt0.o /opt/langtools/lib/end.o -lc\""
69}
70
71remote_exec build "rm ${binfile}"
72remote_exec build $cmdline
73
74gdb_exit
75gdb_start
76gdb_reinitialize_dir $srcdir/$subdir
77
78# We expect to see this:
79#
80# "warning: File not processed by pxdb--about to process now.
81# "
82# ".
83# "Procedures: 7
84# "Files: 2
85# "Reading symbols from ~/c_code.dir/hello_no_pxdb...done.
86# "(gdb)
87#
88send_gdb "file ${binfile}\n"
89gdb_expect {
90
91 -re ".*warning: File not processed by pxdb.*Procedures: \[0-9\]+.*$gdb_prompt $"\
92 { pass "PXDB call" }
93
94 -re "$gdb_prompt $" {
95 if [istarget hppa*-*-hpux*] {
96 pass "Didn't call pxdb"
97 } else {
98 fail "Didn't call pxdb"
99 }
100 }
101
102 -re ".*$gdb_prompt $" { fail "Some other message" }
103
104 timeout { fail "call pxdb (timeout)" }
105}
106
107# Make sure the new data makes sense
108#
109if { ![runto callee] } then { return }
110
111send_gdb "print x\n"
112gdb_expect {
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)" }
116}
117
118gdb_exit
119return 0
120
121
122
123
124