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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.hp/] [gdb.base-hp/] [pxdb.exp] - Blame information for rev 227

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
# Copyright (C) 1998, 2007, 2008, 2009, 2010 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 3 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, see .
15
 
16
 
17
# This file is part of the gdb testsuite
18
 
19
 
20
# pxdb.exp   Test that gdb calls pxdb on an application
21
#            built without it.
22
#
23
if $tracelevel then {
24
        strace $tracelevel
25
}
26
 
27
set prms_id 0
28
set bug_id 0
29
 
30
if { [skip_hp_tests] } then { continue }
31
 
32
set testfile pxdb
33
set srcfile ${testfile}.c
34
set objfile ${objdir}/${subdir}/${testfile}.o
35
set binfile ${objdir}/${subdir}/${testfile}
36
 
37
if [get_compiler_info ${binfile} "c++"] {
38
    return -1;
39
}
40
 
41
if { $gcc_compiled } then { continue }
42
 
43
# To build a non-pxdb-ed file, use
44
#
45
#     
46
#     export LD_PXDB /dev/null
47
#     ld -o hello_no_pxdb hello.o /opt/langtools/lib/end.o /usr/ccs/lib/crt0.o -lc
48
#
49
 
50
if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
51
    untested pxdb.exp
52
    return -1
53
}
54
 
55
#
56
# use this to debug:
57
#log_user 1
58
 
59
 
60
# Following should get the error message:
61
#
62
#      ld: (Warning) Can't exec pxdb using path: /dev/null
63
#
64
#execute_anywhere "ksh -c \"export LD_PXDB=/dev/null\""
65
 
66
if [istarget "hppa64-*-*"] {
67
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\""
68
} else {
69
set cmdline  "ksh -c \"LD_PXDB=/dev/null ld -o ${binfile} ${objfile} /usr/ccs/lib/crt0.o /opt/langtools/lib/end.o -lc\""
70
}
71
 
72
remote_exec build "rm ${binfile}"
73
remote_exec build $cmdline
74
 
75
gdb_exit
76
gdb_start
77
gdb_reinitialize_dir $srcdir/$subdir
78
 
79
# We expect to see this:
80
#
81
#  "warning: File not processed by pxdb--about to process now.
82
#  "
83
#  ".
84
#  "Procedures: 7
85
#  "Files: 2
86
#  "Reading symbols from ~/c_code.dir/hello_no_pxdb...done.
87
#  "(gdb)
88
#
89
send_gdb "file ${binfile}\n"
90
gdb_expect {
91
 
92
    -re ".*warning: File not processed by pxdb.*Procedures: \[0-9\]+.*$gdb_prompt $"\
93
                            { pass "PXDB call"        }
94
 
95
    -re "$gdb_prompt $" {
96
      if [istarget hppa*-*-hpux*] {
97
        pass "Didn't call pxdb"
98
      } else {
99
        fail "Didn't call pxdb"
100
      }
101
    }
102
 
103
    -re ".*$gdb_prompt $"       { fail "Some other message" }
104
 
105
    timeout                 { fail "call pxdb (timeout)" }
106
}
107
 
108
# Make sure the new data makes sense
109
#
110
if { ![runto callee] } then { return }
111
 
112
send_gdb "print x\n"
113
gdb_expect {
114
   -re ".*= 1.*$gdb_prompt $"    { pass "Good data after pxdb call" }
115
   -re ".*$gdb_prompt $"         { fail "No data after pxdb call" }
116
   timeout { fail "(timeout)" }
117
}
118
 
119
gdb_exit
120
return 0
121
 
122
 
123
 
124
 
125
 

powered by: WebSVN 2.1.0

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