From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3957 invoked by alias); 10 Mar 2011 06:47:08 -0000 Received: (qmail 3948 invoked by uid 22791); 10 Mar 2011 06:47:08 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_FAIL X-Spam-Check-By: sourceware.org Received: from gate.lvk.cs.msu.su (HELO mail.lvk.cs.msu.su) (158.250.17.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Mar 2011 06:47:01 +0000 Received: from mail.lvk.cs.msu.su (localhost [127.0.0.1]) by mail.lvk.cs.msu.su (Postfix) with ESMTP id 9D77439E7; Thu, 10 Mar 2011 09:46:56 +0300 (MSK) X-Spam-ASN: Received: from thunder.localnet (h86-62-88-129.ln.rinet.ru [86.62.88.129]) by mail.lvk.cs.msu.su (Postfix) with ESMTPSA id 8E36834B0; Thu, 10 Mar 2011 09:46:56 +0300 (MSK) From: Vladimir Prus To: Joel Brobecker Subject: Re: GDB/MI design question re: Ada exception catchpoints Date: Thu, 10 Mar 2011 10:12:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-27-generic-pae; KDE/4.6.0; i686; ; ) Cc: gdb-patches@sourceware.org References: <20110309045939.GU30306@adacore.com> In-Reply-To: <20110309045939.GU30306@adacore.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103100948.15977.vladimir@codesourcery.com> X-AV-Checked: ClamAV using ClamSMTP 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/msg00629.txt.bz2 On Wednesday, March 09, 2011 07:59:39 Joel Brobecker wrote: > 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="0x0000 > 000000402062",func="foo",args=[],file="foo.adb",fullname="/[...]/foo.adb",l > ine="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="CON > STRAINT_ERROR",frame={addr="0x0000000000402062",func="foo",args=[],file="fo > o.adb",fullname="/[...]/foo.adb",line="3"},thread-id="1",stopped-threads="a > ll",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? That seems totally reasonable for me. I assume that for Ada catchpoints, "-break-list" lists some special type? - Volodya -- Vladimir Prus Mentor Graphics +7 (812) 677-68-40