OLD | NEW |
1 # Copyright 1997-1998, 2004-2005, 2007-2012 Free Software Foundation, | 1 # Copyright 1997-1998, 2004-2005, 2007-2012 Free Software Foundation, |
2 # Inc. | 2 # Inc. |
3 | 3 |
4 # This program is free software; you can redistribute it and/or modify | 4 # 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 | 5 # 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 | 6 # the Free Software Foundation; either version 3 of the License, or |
7 # (at your option) any later version. | 7 # (at your option) any later version. |
8 # | 8 # |
9 # This program is distributed in the hope that it will be useful, | 9 # This program is distributed in the hope that it will be useful, |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 16 matching lines...) Expand all Loading... |
27 # The interesting compiler flags are: "aCC +A -Wl,-a,-archive" . | 27 # The interesting compiler flags are: "aCC +A -Wl,-a,-archive" . |
28 # Static-linked executables use a different mechanism to get the | 28 # Static-linked executables use a different mechanism to get the |
29 # address of the notification hook in the C++ support library. | 29 # address of the notification hook in the C++ support library. |
30 | 30 |
31 # TODO: this file has many absolute line numbers. | 31 # TODO: this file has many absolute line numbers. |
32 # Replace them with gdb_get_line_number. | 32 # Replace them with gdb_get_line_number. |
33 | 33 |
34 set ws "\[\r\n\t \]+" | 34 set ws "\[\r\n\t \]+" |
35 set nl "\[\r\n\]+" | 35 set nl "\[\r\n\]+" |
36 | 36 |
37 if $tracelevel then { | |
38 strace $tracelevel | |
39 } | |
40 | |
41 if { [skip_stl_tests] } { continue } | 37 if { [skip_stl_tests] } { continue } |
42 | 38 |
43 # On SPU this test fails because the executable exceeds local storage size. | 39 # On SPU this test fails because the executable exceeds local storage size. |
44 if { [istarget "spu*-*-*"] } { | 40 if { [istarget "spu*-*-*"] } { |
45 return 0 | 41 return 0 |
46 } | 42 } |
47 | 43 |
48 set testfile "exception" | 44 standard_testfile .cc |
49 set srcfile ${testfile}.cc | |
50 set binfile ${objdir}/${subdir}/${testfile} | |
51 | 45 |
52 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
g c++}] != "" } { | 46 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { |
53 untested exception.exp | 47 return -1 |
54 return -1 | |
55 } | 48 } |
56 | 49 |
57 # Start with a fresh gdb | |
58 | |
59 | |
60 gdb_exit | |
61 gdb_start | |
62 gdb_reinitialize_dir $srcdir/$subdir | |
63 gdb_load ${binfile} | |
64 | |
65 # Set a catch catchpoint | 50 # Set a catch catchpoint |
66 | 51 |
67 gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)" \ | 52 gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)" \ |
68 "catch catch (before inferior run)" | 53 "catch catch (before inferior run)" |
69 | 54 |
70 # Set a throw catchpoint | 55 # Set a throw catchpoint |
71 | 56 |
72 gdb_test "catch throw" "Catchpoint \[0-9\]+ \\(throw\\)" \ | 57 gdb_test "catch throw" "Catchpoint \[0-9\]+ \\(throw\\)" \ |
73 "catch throw (before inferior run)" | 58 "catch throw (before inferior run)" |
74 | 59 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 # | 216 # |
232 # continue to re-throw ; backtrace | 217 # continue to re-throw ; backtrace |
233 # continue to catch ; backtrace | 218 # continue to catch ; backtrace |
234 # continue to throw out of main | 219 # continue to throw out of main |
235 # | 220 # |
236 # The problem is that "re-throw" does not show a throw; only a catch. | 221 # The problem is that "re-throw" does not show a throw; only a catch. |
237 # I do not know if this is because of a bug, or because the generated | 222 # I do not know if this is because of a bug, or because the generated |
238 # code is optimized for a throw into the same function. | 223 # code is optimized for a throw into the same function. |
239 # | 224 # |
240 # -- chastain 2004-01-09 | 225 # -- chastain 2004-01-09 |
OLD | NEW |