From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42915 invoked by alias); 5 Jun 2017 08:54:01 -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 42889 invoked by uid 89); 5 Jun 2017 08:54:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Jun 2017 08:53:59 +0000 Received: by simark.ca (Postfix, from userid 33) id ACFE51E5A3; Mon, 5 Jun 2017 04:54:01 -0400 (EDT) To: Tom Tromey Subject: Re: [RFA 2/2] C++-ify break-catch-throw X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 05 Jun 2017 08:54:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org In-Reply-To: <20170604225353.18008-3-tom@tromey.com> References: <20170604225353.18008-1-tom@tromey.com> <20170604225353.18008-3-tom@tromey.com> Message-ID: <2ab77f7b8d7bd7454be1fe232e2b28fd@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.5 X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00101.txt.bz2 > --- a/gdb/break-catch-throw.c > +++ b/gdb/break-catch-throw.c > @@ -82,15 +82,15 @@ struct exception_catchpoint : public breakpoint > > enum exception_event_kind kind; > > - /* If non-NULL, an xmalloc'd string holding the source form of the > - regular expression to match against. */ > + /* If not empty, a string holding the source form of the regular > + expression to match against. */ > > - char *exception_rx; > + std::string exception_rx; > > - /* If non-NULL, an xmalloc'd, compiled regular expression which is > + /* If non-NULL, a compiled regular expression which is > used to determine which exceptions to stop on. */ > > - regex_t *pattern; > + std::unique_ptr pattern; From what I understand, we were freeing the regex with regfree, but we weren't freeing the regex_t object, which is allocated separately, is that right? Or what is freed in handle_gnu_v3_exceptions by the cleanup, and then referenced later? Either way your code LGTM. Simon