diff options
author | Yao Qi <yao@codesourcery.com> | 2011-06-28 08:36:18 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2011-06-28 08:36:18 +0000 |
commit | af69a5cef74c0fee461cf1dcae8abfe28dd0ca05 (patch) | |
tree | f200cebc7039c7906418721db03734ca42cc7d64 /gdb/testsuite/gdb.cp/exception.cc | |
parent | 9b02d212412d53a8d7e85f5824b1813a9f0a18eb (diff) | |
download | gdb-af69a5cef74c0fee461cf1dcae8abfe28dd0ca05.zip gdb-af69a5cef74c0fee461cf1dcae8abfe28dd0ca05.tar.gz gdb-af69a5cef74c0fee461cf1dcae8abfe28dd0ca05.tar.bz2 |
2011-06-28 Yao Qi <yao@codesourcery.com>
* gdb.cp/exception.cc: Don't include iostream.
(bar): Remove print statement.
(catcher): New.
(main): Remove print statements. Call function catcher.
* gdb.cp/exception.exp : Don't match inferior's output in regexp.
Set breakpoint on catcher, and check the value of parameter.
Diffstat (limited to 'gdb/testsuite/gdb.cp/exception.cc')
-rw-r--r-- | gdb/testsuite/gdb.cp/exception.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.cp/exception.cc b/gdb/testsuite/gdb.cp/exception.cc index 4ce7756..003afbb 100644 --- a/gdb/testsuite/gdb.cp/exception.cc +++ b/gdb/testsuite/gdb.cp/exception.cc @@ -21,7 +21,6 @@ // Test file for exception handling support. -#include <iostream> using namespace std; int foo (int i) @@ -36,10 +35,14 @@ extern "C" int bar (int k, unsigned long eharg, int flag); int bar (int k, unsigned long eharg, int flag) { - cout << "k is " << k << " eharg is " << eharg << " flag is " << flag << endl; return 1; } +int catcher (int x) +{ + return x; +} + int main() { int j; @@ -48,7 +51,7 @@ int main() j = foo (20); } catch (int x) { - cout << "Got an except " << x << endl; + catcher (x); } try { @@ -56,12 +59,12 @@ int main() j = foo (20); } catch (int x) { - cout << "Got an except " << x << endl; + catcher (x); throw; } } catch (int y) { - cout << "Got an except (rethrown) " << y << endl; + catcher (y); } // Not caught |