2009-01-03 05:58:08 +00:00
|
|
|
# Copyright (C) 1998, 2007, 2008, 2009 Free Software Foundation, Inc.
|
1999-08-16 19:57:19 +00:00
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-08-23 18:14:19 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
1999-08-16 19:57:19 +00:00
|
|
|
# (at your option) any later version.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
1999-08-16 19:57:19 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
1999-08-16 19:57:19 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 18:14:19 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1999-08-16 19:57:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
# This file is part of the gdb testsuite
|
|
|
|
|
|
|
|
|
|
|
|
# pxdb.exp Test that gdb calls pxdb on an application
|
|
|
|
# built without it.
|
|
|
|
#
|
|
|
|
if $tracelevel then {
|
|
|
|
strace $tracelevel
|
|
|
|
}
|
|
|
|
|
|
|
|
set prms_id 0
|
|
|
|
set bug_id 0
|
|
|
|
|
|
|
|
if { [skip_hp_tests] } then { continue }
|
|
|
|
|
|
|
|
set testfile pxdb
|
|
|
|
set srcfile ${testfile}.c
|
|
|
|
set objfile ${objdir}/${subdir}/${testfile}.o
|
|
|
|
set binfile ${objdir}/${subdir}/${testfile}
|
|
|
|
|
|
|
|
if [get_compiler_info ${binfile} "c++"] {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if { $gcc_compiled } then { continue }
|
|
|
|
|
|
|
|
# To build a non-pxdb-ed file, use
|
|
|
|
#
|
|
|
|
# <compile to .o file>
|
|
|
|
# export LD_PXDB /dev/null
|
|
|
|
# ld -o hello_no_pxdb hello.o /opt/langtools/lib/end.o /usr/ccs/lib/crt0.o -lc
|
|
|
|
#
|
|
|
|
|
|
|
|
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
|
2006-08-10 05:27:22 +00:00
|
|
|
untested pxdb.exp
|
|
|
|
return -1
|
1999-08-16 19:57:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# use this to debug:
|
|
|
|
#log_user 1
|
|
|
|
|
|
|
|
|
|
|
|
# Following should get the error message:
|
|
|
|
#
|
|
|
|
# ld: (Warning) Can't exec pxdb using path: /dev/null
|
|
|
|
#
|
|
|
|
#execute_anywhere "ksh -c \"export LD_PXDB=/dev/null\""
|
|
|
|
|
2001-12-20 23:37:33 +00:00
|
|
|
if [istarget "hppa64-*-*"] {
|
1999-08-16 19:57:19 +00:00
|
|
|
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\""
|
|
|
|
} else {
|
|
|
|
set cmdline "ksh -c \"LD_PXDB=/dev/null ld -o ${binfile} ${objfile} /usr/ccs/lib/crt0.o /opt/langtools/lib/end.o -lc\""
|
|
|
|
}
|
|
|
|
|
|
|
|
remote_exec build "rm ${binfile}"
|
|
|
|
remote_exec build $cmdline
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
gdb_start
|
|
|
|
gdb_reinitialize_dir $srcdir/$subdir
|
|
|
|
|
|
|
|
# We expect to see this:
|
|
|
|
#
|
|
|
|
# "warning: File not processed by pxdb--about to process now.
|
|
|
|
# "
|
|
|
|
# ".
|
|
|
|
# "Procedures: 7
|
|
|
|
# "Files: 2
|
|
|
|
# "Reading symbols from ~/c_code.dir/hello_no_pxdb...done.
|
|
|
|
# "(gdb)
|
|
|
|
#
|
|
|
|
send_gdb "file ${binfile}\n"
|
|
|
|
gdb_expect {
|
|
|
|
|
|
|
|
-re ".*warning: File not processed by pxdb.*Procedures: \[0-9\]+.*$gdb_prompt $"\
|
|
|
|
{ pass "PXDB call" }
|
|
|
|
|
|
|
|
-re "$gdb_prompt $" {
|
|
|
|
if [istarget hppa*-*-hpux*] {
|
|
|
|
pass "Didn't call pxdb"
|
|
|
|
} else {
|
|
|
|
fail "Didn't call pxdb"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-re ".*$gdb_prompt $" { fail "Some other message" }
|
|
|
|
|
|
|
|
timeout { fail "call pxdb (timeout)" }
|
|
|
|
}
|
|
|
|
|
|
|
|
# Make sure the new data makes sense
|
|
|
|
#
|
|
|
|
if { ![runto callee] } then { return }
|
|
|
|
|
|
|
|
send_gdb "print x\n"
|
|
|
|
gdb_expect {
|
|
|
|
-re ".*= 1.*$gdb_prompt $" { pass "Good data after pxdb call" }
|
|
|
|
-re ".*$gdb_prompt $" { fail "No data after pxdb call" }
|
|
|
|
timeout { fail "(timeout)" }
|
|
|
|
}
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|