From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3625 invoked by alias); 2 Jan 2007 06:06:39 -0000 Received: (qmail 3615 invoked by uid 22791); 2 Jan 2007 06:06:38 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 02 Jan 2007 06:06:33 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id 5557F48CBDA for ; Tue, 2 Jan 2007 01:06:31 -0500 (EST) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15193-01-4 for ; Tue, 2 Jan 2007 01:06:31 -0500 (EST) Received: from takamaka.act-europe.fr (AStDenis-105-1-58-225.w80-8.abo.wanadoo.fr [80.8.155.225]) by nile.gnat.com (Postfix) with ESMTP id 0B1F348CBCB for ; Tue, 2 Jan 2007 01:06:25 -0500 (EST) Received: by takamaka.act-europe.fr (Postfix, from userid 1000) id 6C52734C099; Tue, 2 Jan 2007 10:07:12 +0400 (RET) Date: Tue, 02 Jan 2007 06:06:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA] Add support for catch Ada exceptions (take 2) Message-ID: <20070102060712.GG17211@adacore.com> References: <20061230032111.GB27642@adacore.com> <20061231213707.GA26604@nevyn.them.org> <20070101044301.GF3428@adacore.com> <20070101161914.GA13508@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070101161914.GA13508@nevyn.them.org> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00043.txt.bz2 > > 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 * 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 * 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