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