Remove Cell Broadband Engine debugging support
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / exception.exp
index 04dd6de2d2ee9ddaa6631f8bc06f7dc4e476529b..13631df1290ba988821f005da602b84e6d1b0e8a 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright 1997-1998, 2004-2005, 2007-2012 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
@@ -36,28 +35,12 @@ set nl      "\[\r\n\]+"
 
 if { [skip_stl_tests] } { continue }
 
-# On SPU this test fails because the executable exceeds local storage size.
-if { [istarget "spu*-*-*"] } {
-        return 0
-}
-
-set testfile "exception"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .cc
  
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-     untested exception.exp
-     return -1
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
+    return -1
 }
 
-# Start with a fresh gdb
-
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 # Set a catch catchpoint
 
 gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)" \
@@ -68,20 +51,20 @@ gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)" \
 gdb_test "catch throw" "Catchpoint \[0-9\]+ \\(throw\\)" \
     "catch throw (before inferior run)"
 
+# Set a rethrow catchpoint
+
+gdb_test "catch rethrow" "Catchpoint \[0-9\]+ \\(rethrow\\)" \
+    "catch rethrow (before inferior run)"
+
 
-# The catchpoints should be listed in the list of breakpoints.
-# In case of a statically linked test, we won't have a pending breakpoint.
-# Hence we allow for both an address or "<PENDING>". If we ever become able
-# to tell whether the target is linked statically or not, we can be more
-# precise and require exact output.
-set addr "\(<PENDING>|$hex\)"
 set re_head    "Num${ws}Type${ws}Disp${ws}Enb${ws}Address${ws}What"
-set re_2_bp    "1${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception catch"
-set re_3_bp    "2${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception throw"
+set re_2_bp    "1${ws}catchpoint${ws}keep${ws}y${ws}exception catch"
+set re_3_bp    "2${ws}catchpoint${ws}keep${ws}y${ws}exception throw"
+set re_4_bp    "3${ws}catchpoint${ws}keep${ws}y${ws}exception rethrow"
 
 set name "info breakpoints (before inferior run)"
 gdb_test_multiple "info breakpoints" $name {
-    -re "$re_head${ws}$re_2_bp${ws}$re_3_bp\r\n$gdb_prompt $" {
+    -re "$re_head${ws}$re_2_bp${ws}$re_3_bp${ws}$re_4_bp\r\n$gdb_prompt $" {
        pass $name
     }
     -re ".*$gdb_prompt $"
@@ -90,14 +73,14 @@ gdb_test_multiple "info breakpoints" $name {
       }
 }
 
-gdb_test "tbreak main" "Temporary breakpoint 3.*" \
+gdb_test "tbreak main" "Temporary breakpoint 4.*" \
     "Set temporary breakpoint at main"
 
 set ok 0
 gdb_run_cmd
-gdb_test_multiple "" "Run to main" {
-    -re "Temporary breakpoint 3,.*$gdb_prompt $" {
-       pass "Run to main"
+gdb_test_multiple "" "run to main" {
+    -re "Temporary breakpoint 4,.*$gdb_prompt $" {
+       pass "run to main"
        set ok 1
     }
 }
@@ -106,14 +89,9 @@ if { !$ok } {
     continue
 }
 
-set addr "$hex"
-set re_head    "Num${ws}Type${ws}Disp${ws}Enb${ws}Address${ws}What"
-set re_2_bp    "1${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception catch"
-set re_3_bp    "2${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception throw"
-
 set name "info breakpoints (after inferior run)"
 gdb_test_multiple "info breakpoints" $name {
-    -re "$re_head${ws}$re_2_bp${ws}$re_3_bp\r\n$gdb_prompt $" {
+    -re "$re_head${ws}$re_2_bp${ws}$re_3_bp${ws}$re_4_bp\r\n$gdb_prompt $" {
        pass $name
     }
     -re ".*$gdb_prompt $"
@@ -221,16 +199,8 @@ gdb_test_multiple "backtrace" $name {
 # Continue to breakpoint on catcher.
 gdb_test "continue" ".*catcher \\(x=13\\).*" "continue to catcher for the second time"
 
-# That is all for now.
-# 
-# The original code had:
-#
-#    continue to re-throw ; backtrace
-#    continue to catch    ; backtrace
-#    continue to throw out of main
-#
-# The problem is that "re-throw" does not show a throw; only a catch.
-# I do not know if this is because of a bug, or because the generated
-# code is optimized for a throw into the same function.
-#
-# -- chastain 2004-01-09
+
+# Continue to the re-throw.
+
+gdb_test "continue" "Catchpoint \[0-9\]+.*exception rethrown.*" \
+    "continue to rethrow"
This page took 0.025298 seconds and 4 git commands to generate.