From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [RFA] Add support for catch Ada exceptions (take 2)
Date: Tue, 02 Jan 2007 06:06:00 -0000 [thread overview]
Message-ID: <20070102060712.GG17211@adacore.com> (raw)
In-Reply-To: <20070101161914.GA13508@nevyn.them.org>
> > Hiding the condition is not a big deal. If needed, I can use a bit
> > from the breakpoint flag, don't you think.
>
> I didn't even know that was there. Yes, that would be fine. I would
> recommend separating it into a bitfield, too.
Actually, I found a way without using the flag. I figured using a flag
might be convenient, but is is redundant. I can identify the catchpoints
using their OPS field!
Here is a new iteration of the patch that should be much better. As you
predicted, it made most of the changes to breakpoint.c go away, at a
slight cost in ada-lang.c. The size of the patch is almost identical,
but most of it is contained in one place inside ada-lang.o. Perhaps
we should split this off into a different file, even, but I think this
would make the patch even bigger for little gain for now.
It occurred to me during a last second check that is_known_support_routine
could be simplified a bit. Please do not pay attention to the pc_after_call
and decrement-pc-by-one stuff. I took this code straight of our tree and
it predates a bit all the functions we wrote (I even wrote one of them!).
It's inelegant, but it works. I'll clean this up another rainy day.
Apart from that, I'm pretty happy the way the exercise turned out.
2007-01-02 Joel Brobecker <brobecker@adacore.com>
* ada-lang.h (ada_find_printable_frame): Remove.
(ada_exception_catchpoint_p): Add declaration.
(ada_decode_exception_location): Add declaration.
(ada_decode_assert_location): Add declaration.
* ada-lang.c: Add include of annotate.h and valprint.h.
(exception_catchpoint_kind): New enum.
(function_name_from_pc): New function.
(is_known_support_routine): New function.
(ada_find_printable_frame): New function.
(ada_unhandled_exception_name_addr): New function.
(ada_exception_name_addr_1): New function.
(ada_exception_name_addr): New function.
(print_it_exception): New function.
(print_one_exception): New function.
(print_mention_exception): New function.
(print_it_catch_exception): New function.
(print_one_catch_exception): New function.
(print_mention_catch_exception): New function.
(catch_exception_breakpoint_ops): New global variable.
(print_it_catch_exception_unhandled): New function.
(print_one_catch_exception_unhandled): New function.
(print_mention_catch_exception_unhandled): New function.
(catch_exception_unhandled_breakpoint_ops): New global variable.
(print_it_catch_assert): New function.
(print_one_catch_assert): New function.
(print_mention_catch_assert): New function.
(catch_assert_breakpoint_ops): New global variable.
(ada_exception_catchpoint_p): New function.
(error_breakpoint_runtime_sym_not_found): New function.
(ada_get_next_arg): New function.
(catch_ada_exception_command_split): New function.
(ada_exception_sym_name): New function.
(ada_exception_breakption_ops): New function.
(ada_exception_catchpoint_cond_string): New function.
(ada_parse_catchpoint_condition): New function.
(ada_exception_sal): New function.
(ada_decode_exception_location): New function.
(ada_decode_assert_location): New function.
* breakpoint.c: Add include of ada-lang.h.
(print_one_breakpoint): Do not print the condition for Ada
exception catchpoints.
(create_ada_exception_breakpoint): New function.
(catch_ada_exception_command): New function.
(catch_assert_command): New function.
(catch_command_1): Add support for the new "catch exception" and
"catch assert" commands.
(_initialize_breakpoint): Add help description for the new catch
commands.
* Makefile.in (ada-lang.o): Add dependency on annotate.h and
valprint.h.
(breakpoint.o): Add dependency on ada-lang.h.
The new testcase:
2006-01-02 Joel Brobecker <brobecker@adacore.com>
* gdb.ada/catch_ex/foo.adb: New file.
* gdb.ada/catch_ex.exp: New testcase.
Tested on x86-linux. No regression.
OK to apply? NEWS entry and documentation will follow shortly after
approval.
Thank you,
--
Joel
next prev parent reply other threads:[~2007-01-02 6:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-30 3:20 [RFC/RFA] Add support for catch Ada exceptions Joel Brobecker
2006-12-30 15:55 ` Eli Zaretskii
2006-12-31 4:39 ` Joel Brobecker
2006-12-31 21:37 ` Daniel Jacobowitz
2007-01-01 4:42 ` Joel Brobecker
2007-01-01 16:19 ` Daniel Jacobowitz
2007-01-02 6:06 ` Joel Brobecker [this message]
2007-01-02 6:15 ` [RFA] Add support for catch Ada exceptions (take 2) Joel Brobecker
2007-01-03 2:47 ` Daniel Jacobowitz
2007-01-04 5:32 ` Joel Brobecker
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=20070102060712.GG17211@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@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