OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gdb/] [gdb-6.8/] [gdb-6.8.openrisc-2.1/] [gdb/] [testsuite/] [gdb.hp/] [gdb.base-hp/] [pxdb.exp] - Diff between revs 24 and 33

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.