diff options
author | Tom Tromey <tromey@adacore.com> | 2019-05-31 14:50:23 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-10-02 09:53:17 -0600 |
commit | 37f6a7f456a8da051698dcd753cc0b026f92e054 (patch) | |
tree | 2bb33381b3da98477f726ce03998e045bc0a9e3b /gdb/testsuite | |
parent | fccf9de11fe6757afd3ad2dca4e0ea781b50ae37 (diff) | |
download | gdb-37f6a7f456a8da051698dcd753cc0b026f92e054.zip gdb-37f6a7f456a8da051698dcd753cc0b026f92e054.tar.gz gdb-37f6a7f456a8da051698dcd753cc0b026f92e054.tar.bz2 |
Add $_ada_exception convenience variable
This adds the $_ada_exception convenience variable. It is set by the
Ada exception catchpoints, and holds the address of the exception
currently being thrown. This is useful because it allows more
fine-grained filtering of exceptions than is possible using the
existing "catch" syntax.
This also simplifies Ada catchpoints somewhat; because the catchpoint
must now carry the "kind", it's possible to remove many helper
functions.
gdb/ChangeLog
2019-10-02 Tom Tromey <tromey@adacore.com>
* NEWS: Add $_ada_exception entry.
* ada-lang.c (struct ada_catchpoint): Add constructor.
<m_kind>: New member.
(allocate_location_exception, re_set_exception): Remove
"ex" parameter.
(should_stop_exception): Compute $_ada_exception.
(check_status_exception, print_it_exception)
(print_one_exception, print_mention_exception): Remove
"ex" parameter.
(allocate_location_catch_exception, re_set_catch_exception)
(check_status_exception, print_it_catch_exception)
(print_one_catch_exception, print_mention_catch_exception)
(print_recreate_catch_exception)
(allocate_location_catch_exception_unhandled)
(re_set_catch_exception_unhandled)
(check_status_exception, print_it_catch_exception_unhandled)
(print_one_catch_exception_unhandled)
(print_mention_catch_exception_unhandled)
(print_recreate_catch_exception_unhandled)
(allocate_location_catch_assert, re_set_catch_assert)
(check_status_assert, print_it_catch_assert)
(print_one_catch_assert, print_mention_catch_assert)
(print_recreate_catch_assert)
(allocate_location_catch_handlers, re_set_catch_handlers)
(check_status_handlers, print_it_catch_handlers)
(print_one_catch_handlers, print_mention_catch_handlers)
(print_recreate_catch_handlers): Remove.
(create_ada_exception_catchpoint): Update.
(initialize_ada_catchpoint_ops): Update.
gdb/doc/ChangeLog
2019-10-02 Tom Tromey <tromey@adacore.com>
* gdb.texinfo (Set Catchpoints, Convenience Vars): Document
$_ada_exception.
gdb/testsuite/ChangeLog
2019-10-02 Tom Tromey <tromey@adacore.com>
* gdb.ada/catch_ex_std.exp: Add $_ada_exception test.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/catch_ex_std.exp | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 524133c..b6667f0 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-10-02 Tom Tromey <tromey@adacore.com> + + * gdb.ada/catch_ex_std.exp: Add $_ada_exception test. + 2019-10-02 Pedro Alves <palves@redhat.com> Andrew Burgess <andrew.burgess@embecosm.com> diff --git a/gdb/testsuite/gdb.ada/catch_ex_std.exp b/gdb/testsuite/gdb.ada/catch_ex_std.exp index 63714a8..839d0bb 100644 --- a/gdb/testsuite/gdb.ada/catch_ex_std.exp +++ b/gdb/testsuite/gdb.ada/catch_ex_std.exp @@ -101,3 +101,6 @@ gdb_test "catch exception some_kind_of_error" \ gdb_test "cont" \ "Catchpoint \[0-9\]+, .* at .*foo\.adb:\[0-9\]+.*" \ "caught the exception" + +gdb_test "print \$_ada_exception = some_package.some_kind_of_error'Address" \ + " = true" |