OLD | NEW |
1 # Copyright 1997-1998, 2001-2004, 2007-2012 Free Software Foundation, | 1 # Copyright 1997-2013 Free Software Foundation, Inc. |
2 # Inc. | |
3 # | 2 # |
4 # This program is free software; you can redistribute it and/or modify | 3 # 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 | 4 # 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 | 5 # the Free Software Foundation; either version 3 of the License, or |
7 # (at your option) any later version. | 6 # (at your option) any later version. |
8 # | 7 # |
9 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
13 # | 12 # |
14 # You should have received a copy of the GNU General Public License | 13 # 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/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 # | 15 # |
17 # This file was written by Michael Snyder (msnyder@cygnus.com) | 16 # This file was written by Michael Snyder (msnyder@cygnus.com) |
18 | 17 |
19 # | 18 # |
20 # test running programs | 19 # test running programs |
21 # | 20 # |
22 | 21 |
23 | 22 |
24 set data_overlays 1 | 23 set data_overlays 1 |
25 | 24 |
26 if [istarget "d10v-*-*"] then { | 25 if [istarget "d10v-*-*"] then { |
27 set linker_script "${srcdir}/${subdir}/d10v.ld"; | 26 set linker_script "${srcdir}/${subdir}/d10v.ld" |
28 } elseif [istarget "m32r-*-*"] then { | 27 } elseif [istarget "m32r-*-*"] then { |
29 set linker_script "${srcdir}/${subdir}/m32r.ld"; | 28 set linker_script "${srcdir}/${subdir}/m32r.ld" |
30 } elseif [istarget "spu-*-*"] then { | 29 } elseif [istarget "spu-*-*"] then { |
31 set linker_script "${srcdir}/${subdir}/spu.ld"; | 30 set linker_script "${srcdir}/${subdir}/spu.ld" |
32 set data_overlays 0 | 31 set data_overlays 0 |
33 } else { | 32 } else { |
34 verbose "Skipping overlay test -- not implemented for this target." | 33 verbose "Skipping overlay test -- not implemented for this target." |
35 return | 34 return |
36 } | 35 } |
37 | 36 |
38 if [istarget "*-*-linux*"] then { | 37 if [istarget "*-*-linux*"] then { |
39 verbose "Skipping overlay test -- Linux doesn't support overlayed programs." | 38 verbose "Skipping overlay test -- Linux doesn't support overlayed programs." |
40 return | 39 return |
41 } | 40 } |
42 | 41 |
43 set testfile "overlays" | 42 standard_testfile overlays.c ovlymgr.c foo.c bar.c baz.c grbx.c |
44 set binfile ${objdir}/${subdir}/${testfile} | |
45 set srcfile ${testfile}.c | |
46 | 43 |
47 if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {debug}
] != ""} then { | 44 if {[build_executable $testfile.exp $testfile \ |
| 45 » [list $srcfile $srcfile2 $srcfile3 $srcfile4 $srcfile5 $srcfile6] \ |
| 46 » {debug ldscript=-Wl,-T$linker_script}] == -1} { |
48 untested overlays.exp | 47 untested overlays.exp |
49 return -1 | 48 return -1 |
50 } | 49 } |
51 if {[gdb_compile "${srcdir}/${subdir}/ovlymgr.c" ovlymgr.o object {debug}] != ""
} then { | |
52 untested overlays.exp | |
53 return -1 | |
54 } | |
55 if {[gdb_compile "${srcdir}/${subdir}/foo.c" foo.o object {debug} ] != ""} then
{ | |
56 untested overlays.exp | |
57 return -1 | |
58 } | |
59 | |
60 if {[gdb_compile "${srcdir}/${subdir}/bar.c" bar.o object {debug}] != ""} then { | |
61 untested overlays.exp | |
62 return -1 | |
63 } | |
64 if {[gdb_compile "${srcdir}/${subdir}/baz.c" baz.o object {debug}] != ""} then { | |
65 untested overlays.exp | |
66 return -1 | |
67 } | |
68 if {[gdb_compile "${srcdir}/${subdir}/grbx.c" grbx.o object {debug}] != ""} then
{ | |
69 untested overlays.exp | |
70 return -1 | |
71 } | |
72 if {[gdb_compile "${testfile}.o ovlymgr.o foo.o bar.o baz.o grbx.o" ${binfile}
executable "ldscript=-Wl,-T$linker_script"] != "" } { | |
73 untested overlays.exp | |
74 return -1 | |
75 } | |
76 | 50 |
77 remote_exec build "mv ${testfile}.o foo.o bar.o baz.o grbx.o ovlymgr.o ${objdir}
/${subdir}" | 51 remote_exec build "mv ${testfile}.o foo.o bar.o baz.o grbx.o ovlymgr.o ${objdir}
/${subdir}" |
78 | 52 |
79 | 53 |
80 gdb_start | 54 gdb_start |
81 gdb_reinitialize_dir $srcdir/$subdir | 55 gdb_reinitialize_dir $srcdir/$subdir |
82 gdb_load ${binfile} | 56 gdb_load ${binfile} |
83 | 57 |
84 # | 58 # |
85 # set it up at a breakpoint so we can play with the variable values | 59 # set it up at a breakpoint so we can play with the variable values |
86 # | 60 # |
87 | 61 |
88 if ![runto_main] then { | 62 if ![runto_main] then { |
89 gdb_suppress_tests; | 63 gdb_suppress_tests |
90 } | 64 } |
91 | 65 |
92 # couple of convenience variables | 66 # couple of convenience variables |
93 set fptrcast [string_to_regexp "{int (int)}"] | 67 set fptrcast [string_to_regexp "{int (int)}"] |
94 set iptrcast [string_to_regexp "(int *)"] | 68 set iptrcast [string_to_regexp "(int *)"] |
95 set hexx "0x\[0-9abcdefABCDEF\]+" | 69 set hexx "0x\[0-9abcdefABCDEF\]+" |
96 | 70 |
97 gdb_test_no_output "overlay manual" | 71 gdb_test_no_output "overlay manual" |
98 gdb_test "overlay list" "No sections are mapped." "List with none mapped" | 72 gdb_test "overlay list" "No sections are mapped." "List with none mapped" |
99 | 73 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 timeout { fail "(timeout) hit grbx" } | 274 timeout { fail "(timeout) hit grbx" } |
301 } | 275 } |
302 | 276 |
303 send_gdb "backtrace\n" | 277 send_gdb "backtrace\n" |
304 gdb_expect { | 278 gdb_expect { |
305 -re "#0 .*grbx .*#1 .*main .*$gdb_prompt $" { pass "BT grbx" } | 279 -re "#0 .*grbx .*#1 .*main .*$gdb_prompt $" { pass "BT grbx" } |
306 -re ".*$gdb_prompt $" { fail "BT grbx" } | 280 -re ".*$gdb_prompt $" { fail "BT grbx" } |
307 timeout { fail "(timeout) BT grbx" } | 281 timeout { fail "(timeout) BT grbx" } |
308 } | 282 } |
309 | 283 |
OLD | NEW |