Remove Cell Broadband Engine debugging support
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / overlays.exp
index 2fba0e7b60f469d994a80c355a898899bdc77fca..388b87f0269d6cd55da6ec85009907b0c263491f 100644 (file)
@@ -1,39 +1,29 @@
-# Copyright 1997, 1998, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright 1997-2019 Free Software Foundation, Inc.
 # 
 # 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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # 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.
-# 
+#
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
-# 
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
-# 
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
 # This file was written by Michael Snyder (msnyder@cygnus.com)
 
-if $tracelevel then {
-    strace $tracelevel
-}
-
 #
 # test running programs
 #
 
-set prms_id 0
-set bug_id 0
 
-if [istarget "d10v-*-*"] then {
-    set linker_script "${srcdir}/${subdir}/d10v.ld";
-} elseif [istarget "m32r-*-*"] then {
-    set linker_script "${srcdir}/${subdir}/m32r.ld";
+set data_overlays 1
+
+if [istarget "m32r-*-*"] then {
+    set linker_script "${srcdir}/${subdir}/m32r.ld"
 } else {
     verbose "Skipping overlay test -- not implemented for this target."
     return 
@@ -44,37 +34,12 @@ if [istarget "*-*-linux*"] then {
     return 
 }
 
-set testfile "overlays"
-set binfile ${objdir}/${subdir}/${testfile}
-set srcfile ${testfile}.c
-
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {debug}] != ""} then {
-     untested overlays.exp
-     return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/ovlymgr.c" ovlymgr.o object {debug}] != ""} then {
-     untested overlays.exp
-     return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/foo.c" foo.o object {debug} ] != ""} then {
-     untested overlays.exp
-     return -1
-}
+standard_testfile overlays.c ovlymgr.c foo.c bar.c baz.c grbx.c
 
-if {[gdb_compile "${srcdir}/${subdir}/bar.c" bar.o object {debug}] != ""} then {
-     untested overlays.exp
-     return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/baz.c" baz.o object {debug}] != ""} then {
-     untested overlays.exp
-     return -1
-}
-if {[gdb_compile "${srcdir}/${subdir}/grbx.c" grbx.o object {debug}] != ""} then {
-     untested overlays.exp
-     return -1
-}
-if  {[gdb_compile "${testfile}.o ovlymgr.o foo.o bar.o baz.o grbx.o" ${binfile} executable "ldscript=-Wl,-T$linker_script"] != "" } {
-     untested overlays.exp
+if {[build_executable $testfile.exp $testfile \
+        [list $srcfile $srcfile2 $srcfile3 $srcfile4 $srcfile5 $srcfile6] \
+        {debug ldscript=-Wl,-T$linker_script}] == -1} {
+     untested "failed to compile"
      return -1
 }
 
@@ -90,7 +55,8 @@ gdb_load ${binfile}
 #
 
 if ![runto_main] then {
-    gdb_suppress_tests;
+    fail "can't run to main"
+    return 0
 }
 
 # couple of convenience variables
@@ -98,8 +64,8 @@ set fptrcast [string_to_regexp "{int (int)}"]
 set iptrcast [string_to_regexp "(int *)"]
 set hexx "0x\[0-9abcdefABCDEF\]+"
 
-gdb_test "overlay manual" "" 
-gdb_test "overlay list" "No sections are mapped." "List with none mapped"
+gdb_test_no_output "overlay manual"
+gdb_test "overlay list" "No sections are mapped." "list with none mapped"
 
 # capture the LMA addresses of [foo bar baz grbx foox barx bazx grbxx]
 
@@ -130,64 +96,69 @@ set bar_lma  [get_func_address "bar"  "\\*bar\\*"  "bar  load address"]
 set baz_lma  [get_func_address "baz"  "\\*baz\\*"  "baz  load address"]
 set grbx_lma [get_func_address "grbx" "\\*grbx\\*" "grbx load address"]
 
-gdb_test "print \$foox_lma = &foox" \
+if $data_overlays then {
+    gdb_test "print \$foox_lma = &foox" \
        ".* $iptrcast 0x.*"  "foox load addr"
-gdb_test "print \$barx_lma = &barx" \
+    gdb_test "print \$barx_lma = &barx" \
        ".* $iptrcast 0x.*"  "barx load addr"
-gdb_test "print \$bazx_lma = &bazx" \
+    gdb_test "print \$bazx_lma = &bazx" \
        ".* $iptrcast 0x.*"  "bazx load addr"
-gdb_test "print \$grbxx_lma = &grbxx" \
+    gdb_test "print \$grbxx_lma = &grbxx" \
        ".* $iptrcast 0x.*" "grbxx load addr"
+}
 
 # map each overlay successively, and
 # capture the VMA addresses of [foo bar baz grbx foox barx bazx grbxx]
 
 gdb_test "overlay map .ovly0" "" 
-gdb_test "overlay list" "Section .ovly0, loaded at.*, mapped at.*" "List ovly0"
+gdb_test "overlay list" "Section .ovly0, loaded at.*, mapped at.*" "list ovly0"
 set foo_vma [get_func_address "foo"  "foo"  "foo  runtime address"]
 
 gdb_test "overlay map .ovly1" "" 
-gdb_test "overlay list" "Section .ovly1, loaded at.*, mapped at.*" "List ovly1"
+gdb_test "overlay list" "Section .ovly1, loaded at.*, mapped at.*" "list ovly1"
 set bar_vma [get_func_address "bar"  "bar"  "bar  runtime address"]
 
 gdb_test "overlay map .ovly2" "" 
-gdb_test "overlay list" "Section .ovly2, loaded at.*, mapped at.*" "List ovly2"
+gdb_test "overlay list" "Section .ovly2, loaded at.*, mapped at.*" "list ovly2"
 set baz_vma [get_func_address "baz"  "baz"  "baz  runtime address"]
 
 gdb_test "overlay map .ovly3" "" 
-gdb_test "overlay list" "Section .ovly3, loaded at.*, mapped at.*" "List ovly3"
+gdb_test "overlay list" "Section .ovly3, loaded at.*, mapped at.*" "list ovly3"
 set grbx_vma [get_func_address "grbx" "grbx" "grbx runtime address"]
 
-gdb_test "overlay map .data00" "" 
-gdb_test "overlay list" "Section .data00, loaded .*, mapped .*" "List data00"
-gdb_test "print \$foox_vma = &foox" \
+if $data_overlays then {
+    gdb_test "overlay map .data00" "" 
+    gdb_test "overlay list" "Section .data00, loaded .*, mapped .*" "list data00"
+    gdb_test "print \$foox_vma = &foox" \
        ".* $iptrcast 0x.*"  "foox runtime addr"
 
-gdb_test "overlay map .data01" "" 
-gdb_test "overlay list" "Section .data01, loaded .*, mapped .*" "List data01"
-gdb_test "print \$barx_vma = &barx" \
+    gdb_test "overlay map .data01" "" 
+    gdb_test "overlay list" "Section .data01, loaded .*, mapped .*" "list data01"
+    gdb_test "print \$barx_vma = &barx" \
        ".* $iptrcast 0x.*"  "barx runtime addr"
 
-gdb_test "overlay map .data02" "" 
-gdb_test "overlay list" "Section .data02, loaded .*, mapped .*" "List data02"
-gdb_test "print \$bazx_vma = &bazx" \
+    gdb_test "overlay map .data02" "" 
+    gdb_test "overlay list" "Section .data02, loaded .*, mapped .*" "list data02"
+    gdb_test "print \$bazx_vma = &bazx" \
        ".* $iptrcast 0x.*"  "bazx runtime addr"
 
-gdb_test "overlay map .data03" "" 
-gdb_test "overlay list" "Section .data03, loaded .*, mapped .*" "List data03"
-gdb_test "print \$grbxx_vma = &grbxx" \
+    gdb_test "overlay map .data03" "" 
+    gdb_test "overlay list" "Section .data03, loaded .*, mapped .*" "list data03"
+    gdb_test "print \$grbxx_vma = &grbxx" \
        ".* $iptrcast 0x.*"  "grbxx runtime addr"
-
+}
 # Verify that LMA != VMA
 
 gdb_test "print $foo_lma   != $foo_vma" ".* = 1"   "foo's LMA   != VMA"
 gdb_test "print $bar_lma   != $bar_vma" ".* = 1"   "bar's LMA   != VMA"
 gdb_test "print $baz_lma   != $baz_vma" ".* = 1"   "baz's LMA   != VMA"
 gdb_test "print $grbx_lma  != $grbx_vma" ".* = 1"  "grbx's LMA  != VMA"
-gdb_test "print \$foox_lma  != \$foox_vma" ".* = 1"  "foox's LMA  != VMA"
-gdb_test "print \$barx_lma  != \$barx_vma" ".* = 1"  "barx's LMA  != VMA"
-gdb_test "print \$bazx_lma  != \$bazx_vma" ".* = 1"  "bazx's LMA  != VMA"
-gdb_test "print \$grbxx_lma != \$grbxx_vma" ".* = 1" "grbxx's LMA != VMA"
+if $data_overlays then {
+    gdb_test "print \$foox_lma  != \$foox_vma" ".* = 1"  "foox's LMA  != VMA"
+    gdb_test "print \$barx_lma  != \$barx_vma" ".* = 1"  "barx's LMA  != VMA"
+    gdb_test "print \$bazx_lma  != \$bazx_vma" ".* = 1"  "bazx's LMA  != VMA"
+    gdb_test "print \$grbxx_lma != \$grbxx_vma" ".* = 1" "grbxx's LMA != VMA"
+}
 
 # Verify that early-mapped overlays have been bumped out 
 # by later-mapped overlays layed over in the same VMA range.
@@ -198,7 +169,7 @@ gdb_expect {
     -re ".*ovly2, "            { fail ".ovly2  not unmapped by .ovly3"  }
     -re ".*data00,"            { fail ".data00 not unmapped by .data01" }
     -re ".*data02,"            { fail ".data02 not unmapped by .data03" }
-    -re ".*$gdb_prompt $"      { pass "Automatic unmapping"             }
+    -re ".*$gdb_prompt $"      { pass "automatic unmapping"             }
     timeout                    { fail "(timeout) Automatic unmapping"   }
 }
 
@@ -233,15 +204,17 @@ simultaneous_pair .ovly0 .ovly3
 simultaneous_pair .ovly1 .ovly2
 simultaneous_pair .ovly1 .ovly3
 
-simultaneous_pair .data00 .data02
-simultaneous_pair .data00 .data03
-simultaneous_pair .data01 .data02
-simultaneous_pair .data01 .data03
+if $data_overlays then {
+    simultaneous_pair .data00 .data02
+    simultaneous_pair .data00 .data03
+    simultaneous_pair .data01 .data02
+    simultaneous_pair .data01 .data03
+}
 
 # test automatic mode
 
-gdb_test "overlay auto" ""
-gdb_test "overlay list" "No sections are mapped." "List none mapped (auto)"
+gdb_test_no_output "overlay auto"
+gdb_test "overlay list" "No sections are mapped." "list none mapped (auto)"
 gdb_test "break foo"  "Breakpoint .*at .*file .*foo.c.*"  "break foo"
 gdb_test "break bar"  "Breakpoint .*at .*file .*bar.c.*"  "break bar"
 gdb_test "break baz"  "Breakpoint .*at .*file .*baz.c.*"  "break baz"
This page took 0.028385 seconds and 4 git commands to generate.