]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.hp/pxdb.exp
Initial creation of sourceware repository
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.hp / pxdb.exp
1 # Copyright (C) 1998 Free Software Foundation, Inc.
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 #
27 if $tracelevel then {
28 strace $tracelevel
29 }
30
31 set prms_id 0
32 set bug_id 0
33
34 set testfile pxdb
35 set srcfile ${testfile}.c
36 set objfile ${objdir}/${subdir}/${testfile}.o
37 set binfile ${objdir}/${subdir}/${testfile}
38
39 if [get_compiler_info ${binfile} "c++"] {
40 return -1;
41 }
42
43
44 if {[skip_hp_tests $gcc_compiled]} then { continue }
45
46 # To build a non-pxdb-ed file, use
47 #
48 # <compile to .o file>
49 # export LD_PXDB /dev/null
50 # ld -o hello_no_pxdb hello.o /opt/langtools/lib/end.o /usr/ccs/lib/crt0.o -lc
51 #
52
53 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
54 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
55 }
56
57 #
58 # use this to debug:
59 #log_user 1
60
61
62 # Following should get the error message:
63 #
64 # ld: (Warning) Can't exec pxdb using path: /dev/null
65 #
66
67 set cmdline "ksh -c \"LD_PXDB=/dev/null ld -o ${binfile} ${objfile} /usr/ccs/lib/crt0.o /opt/langtools/lib/end.o -lc\""
68
69 remote_exec build "rm ${binfile}"
70 remote_exec build $cmdline
71
72 gdb_exit
73 gdb_start
74 gdb_reinitialize_dir $srcdir/$subdir
75
76 # We expect to see this:
77 #
78 # "warning: File not processed by pxdb--about to process now.
79 # "
80 # ".
81 # "Procedures: 7
82 # "Files: 2
83 # "Reading symbols from ~/c_code.dir/hello_no_pxdb...done.
84 # "(gdb)
85 #
86 send_gdb "file ${binfile}\n"
87 gdb_expect {
88
89 -re ".*warning: File not processed by pxdb.*Procedures: \[0-9\]+.*done.*$gdb_prompt $"\
90 { pass "PXDB call" }
91
92 -re "$gdb_prompt $" { fail "Didn't call pxdb" }
93
94 timeout { fail "call pxdb (timeout)" }
95 }
96
97 # Make sure the new data makes sense
98 #
99 if { ![runto callee] } then { return }
100
101 send_gdb "print x\n"
102 gdb_expect {
103 -re ".*= 1.*$gdb_prompt $" { pass "Good data after pxdb call" }
104 -re ".*$gdb_prompt $" { fail "No data after pxdb call" }
105 timeout { fail "(timeout)" }
106 }
107
108 gdb_exit
109 return 0
110
111
112
113
114