From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22339 invoked by alias); 9 Mar 2011 05:00:16 -0000 Received: (qmail 22329 invoked by uid 22791); 9 Mar 2011 05:00:15 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Mar 2011 05:00:08 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C65972BAFBA; Wed, 9 Mar 2011 00:00:06 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZUDFr5H5VUlV; Wed, 9 Mar 2011 00:00:06 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id AADF72BAF71; Wed, 9 Mar 2011 00:00:04 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 1F57D1459AD; Wed, 9 Mar 2011 08:59:39 +0400 (RET) Date: Wed, 09 Mar 2011 06:27:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org, vladimir@codesourcery.com Subject: GDB/MI design question re: Ada exception catchpoints Message-ID: <20110309045939.GU30306@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2011-03/txt/msg00585.txt.bz2 Hello all, One of the guys at AdaCore would like to use CDT, and noticed that some normal CDT notifications do not get triggered when the program hits an Ada exception catchpoint. We narrowed down the issue to the fact that we don't emit the stop reason: (gdb) ~"\nCatchpoint 2, unhandled CONSTRAINT_ERROR at " *stopped,frame={addr="0x080497f2",func="test",args=[],file="/[...]/test.adb",fullname="/[...]/test.adb",line="21"},thread-id="1",stopped-threads="all",core="1" (gdb) In fact, looking deeper, we get the above, because, well, the "print_it" routine for Ada exception catchpoints does little more than `printf ("Catchpoint %d, %s at")', thus not handling the MI case at all. But once I rewrote a bit the code to follow what other breakpoint "print_it" routines do, I now get the following output: (gdb) *stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0000000000402062",func="foo",args=[],file="foo.adb",fullname="/[...]/foo.adb",line="3"},thread-id="1",stopped-threads="all",core="3" The front-end no longer has as much information as before. The fact that we've just hit an exception catchpoint can probably be deduced from the breakpoint number. But we are missing the exception name. I think that it would be sufficient to add an extra field providing that exception name: *stopped,reason="breakpoint-hit",disp="keep",bkptno="1",exception-name="CONSTRAINT_ERROR",frame={addr="0x0000000000402062",func="foo",args=[],file="foo.adb",fullname="/[...]/foo.adb",line="3"},thread-id="1",stopped-threads="all",core="3" If the field is missing, it means that we were unable to determine that exception name (in the CLI, we print "exception" instead of "CONSTRAINT_ERROR"). Would that be OK? I don't want to change the current code until we address this issue, because CDT apparently works around the current situation by parsing the contents of the console stream output (the `~"..."' stuff). -- Joel