From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11690 invoked by alias); 4 Mar 2013 21:35:56 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 11552 invoked by uid 306); 4 Mar 2013 21:35:55 -0000 Date: Mon, 04 Mar 2013 21:35:00 -0000 Message-ID: <20130304213555.11535.qmail@sourceware.org> From: tromey@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] tromey/exception-improvements: add test cases for "catch throw REGEXP" X-Git-Refname: refs/heads/tromey/exception-improvements X-Git-Reftype: branch X-Git-Oldrev: 3169700d5559c1de86de44260312218ab06fda9d X-Git-Newrev: 14da3747d266a05e5dc4cb035a4bed27095f45b3 X-SW-Source: 2013-q1/txt/msg00234.txt.bz2 List-Id: The branch, tromey/exception-improvements has been updated via 14da3747d266a05e5dc4cb035a4bed27095f45b3 (commit) via 1ab94d45059b73f3e5d86b76610bf548f7a4eb5f (commit) from 3169700d5559c1de86de44260312218ab06fda9d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 14da3747d266a05e5dc4cb035a4bed27095f45b3 Author: Tom Tromey Date: Mon Mar 4 14:35:30 2013 -0700 add test cases for "catch throw REGEXP" commit 1ab94d45059b73f3e5d86b76610bf548f7a4eb5f Author: Tom Tromey Date: Mon Mar 4 11:42:03 2013 -0700 split libstdc++ probe testing into a new proc ----------------------------------------------------------------------- Summary of changes: gdb/testsuite/gdb.cp/exceptprint.exp | 31 ++++++++++++++++++++++--------- gdb/testsuite/lib/gdb.exp | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+), 9 deletions(-) First 500 lines of diff: diff --git a/gdb/testsuite/gdb.cp/exceptprint.exp b/gdb/testsuite/gdb.cp/exceptprint.exp index 3f993d4..d9f4fd5 100644 --- a/gdb/testsuite/gdb.cp/exceptprint.exp +++ b/gdb/testsuite/gdb.cp/exceptprint.exp @@ -27,15 +27,7 @@ if {![runto_main]} { return -1 } -set ok 0 -gdb_test_multiple "info probe" "check for stap probe in libstdc++" { - -re ".*libstdcxx.*catch.*\r\n$gdb_prompt $" { - set ok 1 - } - -re "\r\n$gdb_prompt $" { - } -} -if {!$ok} { +if {![skip_libstdcxx_probe_tests]} { untested "could not find libstdc++ stap probe" return -1 } @@ -79,3 +71,24 @@ do_exceptprint_tests string "$hex \"hi bob\"" do_exceptprint_tests int 23 do_exceptprint_tests struct "{mv = 77}" do_exceptprint_tests "reference to struct" "{mv = 77}" + + +delete_breakpoints + +if {![runto_main]} { + return -1 +} + +gdb_test "catch catch int if \$_exception == 23" \ + "Catchpoint \[0-9\]+ \\(catch\\)" \ + "catch catch" +gdb_test "catch throw int if \$_exception == 23" \ + "Catchpoint \[0-9\]+ \\(throw\\)" \ + "catch throw" +gdb_test "catch rethrow int if \$_exception == 23" \ + "Catchpoint \[0-9\]+ \\(rethrow\\)" \ + "catch rethrow" + +# This tests both the case where the regular expression does not +# match, and the case where it does. +do_exceptprint_tests int 23 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 8b16b38..2177750 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2240,6 +2240,24 @@ proc skip_unwinder_tests {} { return $ok } +# Return 0 if we should skip tests that require the libstdc++ stap +# probes. This must be invoked while gdb is running, after shared +# libraries have been loaded. + +proc skip_libstdcxx_probe_tests {} { + global gdb_prompt + + set ok 0 + gdb_test_multiple "info probe" "check for stap probe in libstdc++" { + -re ".*libstdcxx.*catch.*\r\n$gdb_prompt $" { + set ok 1 + } + -re "\r\n$gdb_prompt $" { + } + } + return $ok +} + set compiler_info "unknown" set gcc_compiled 0 set hp_cc_compiler 0 hooks/post-receive -- Repository for Project Archer.