From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4817 invoked by alias); 12 May 2019 04:09:08 -0000 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 Received: (qmail 4803 invoked by uid 89); 12 May 2019 04:09:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=D*embecosm.com, sk:andrew, andrewburgessembecosmcom, sk:andrew. X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 12 May 2019 04:09:06 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPfnL-000598-Pb; Sun, 12 May 2019 00:09:03 -0400 Received: from [176.228.60.248] (port=3018 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hPfnK-0001GK-3a; Sun, 12 May 2019 00:09:02 -0400 Date: Sun, 12 May 2019 04:09:00 -0000 Message-Id: <835zqgco1j.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess CC: gdb-patches@sourceware.org, tom@tromey.com In-reply-to: <20190511234646.4992-1-andrew.burgess@embecosm.com> (message from Andrew Burgess on Sun, 12 May 2019 00:46:46 +0100) Subject: Re: [PATCHv2] gdb/mi: New commands to catch C++ exceptions References: <20190509000500.20536-1-andrew.burgess@embecosm.com> <20190511234646.4992-1-andrew.burgess@embecosm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00288.txt.bz2 > From: Andrew Burgess > Cc: Eli Zaretskii , > Tom Tromey , > Andrew Burgess > Date: Sun, 12 May 2019 00:46:46 +0100 > > Eli, > > This iteration includes updated documentation that fixes almost all of > the issues you raised. The only thing I haven't done is collapse all > of the command sub-sections into a single sub-section. I looked > through most of the existing MI commands and they all seem to be one > command per sub-section, so I wasn't entirely sure how to layout a > merged entry, nor if a merged entry was inline with the style for MI > commands. Understood. > +The following @sc{gdb/mi} commands can be used to create catchpoints > +that stop the execution when C@t{++} exceptions are being throw, rethrown, > +or caught.. ^^ Extra period. > +@smallexample > +-catch-throw -r exception_type > +^done,bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y", > + addr="0x00000000004006c0",what="exception throw", > + catch-type="throw",thread-groups=["i1"], > + regexp="exception_type",times="0"@} > +(gdb) > +-exec-run > +^running > +(gdb) > +~"\n" > +~"Catchpoint 1 (exception thrown), 0x00007ffff7ae00ed > + in __cxa_throw () from /lib64/libstdc++.so.6\n" > +*stopped,bkptno="1",reason="breakpoint-hit",disp="keep", > + frame=@{addr="0x00007ffff7ae00ed",func="__cxa_throw", > + args=[],from="/lib64/libstdc++.so.6",arch="i386:x86-64"@}, > + thread-id="1",stopped-threads="all",core="6" > +(gdb) > +@end smallexample So what GDB shows when the catchpoint triggers doesn't include the exception's type, is that right? That's a pity; I expected it to show the type, which could then be compared against the regexp. Oh well. > +~"Catchpoint 1 (exception thrown), 0x00007ffff7ae00ed It says "thrown" both for "throw" and "rethrow"? So there's no way to distinguish between these two? > +~"Catchpoint 1 (exception thrown), 0x00007ffff7ae00ed And the same here? not "exception caught"? The documentation parts are OK, thanks.