]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - 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
1 # Copyright (C) 1998, 2007, 2008, 2009, 2010, 2011
2 # Free Software Foundation, Inc.
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
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
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.
13 #
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/>.
16
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 #
24 if $tracelevel then {
25 strace $tracelevel
26 }
27
28
29 if { [skip_hp_tests] } then { continue }
30
31 set testfile pxdb
32 set srcfile ${testfile}.c
33 set objfile ${objdir}/${subdir}/${testfile}.o
34 set binfile ${objdir}/${subdir}/${testfile}
35
36 if [get_compiler_info ${binfile} "c++"] {
37 return -1;
38 }
39
40 if { $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
49 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
50 untested pxdb.exp
51 return -1
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
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\""
67 } else {
68 set cmdline "ksh -c \"LD_PXDB=/dev/null ld -o ${binfile} ${objfile} /usr/ccs/lib/crt0.o /opt/langtools/lib/end.o -lc\""
69 }
70
71 remote_exec build "rm ${binfile}"
72 remote_exec build $cmdline
73
74 gdb_exit
75 gdb_start
76 gdb_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 #
88 send_gdb "file ${binfile}\n"
89 gdb_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 #
109 if { ![runto callee] } then { return }
110
111 send_gdb "print x\n"
112 gdb_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
118 gdb_exit
119 return 0
120
121
122
123
124