public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: tromey@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  tromey/exception-improvements: add test cases for "catch throw REGEXP"
Date: Mon, 04 Mar 2013 21:35:00 -0000	[thread overview]
Message-ID: <20130304213555.11535.qmail@sourceware.org> (raw)

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 <tromey@redhat.com>
Date:   Mon Mar 4 14:35:30 2013 -0700

    add test cases for "catch throw REGEXP"

commit 1ab94d45059b73f3e5d86b76610bf548f7a4eb5f
Author: Tom Tromey <tromey@redhat.com>
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.


                 reply	other threads:[~2013-03-04 21:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130304213555.11535.qmail@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).