From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99418 invoked by alias); 21 May 2018 00:20:17 -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 99389 invoked by uid 89); 21 May 2018 00:20:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=responsibility 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, 21 May 2018 00:20:13 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8767B1E4F7; Sun, 20 May 2018 20:20:11 -0400 (EDT) Subject: Re: [RFA 3/3] Change ada_catchpoint::excep_string to be a std::string To: Tom Tromey , gdb-patches@sourceware.org References: <20180519160606.19969-1-tom@tromey.com> <20180519160606.19969-4-tom@tromey.com> From: Simon Marchi Message-ID: Date: Mon, 21 May 2018 01:12:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180519160606.19969-4-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-05/txt/msg00454.txt.bz2 On 2018-05-19 12:06 PM, Tom Tromey wrote: > This changes ada_catchpoint::excep_string to be a std::string and then > fixes up all t he users. > > This found a memory leak in catch_ada_exception_command_split, where > "cond" was copied but never freed. > > I changed the type of the "cond_string" argument to > catch_ada_exception_command_split to follow the rule that out > parameters should be pointers and not references. It wasn't a rule yet (AFAIK), but it is now. https://sourceware.org/ml/gdb-patches/2018-05/msg00450.html The patch LGTM, with some nits. > > This patch enables the removal of some cleanups and also the function > ada_get_next_arg. You can remove the ada_catchpoint destructor I think. > @@ -13333,13 +13286,11 @@ ada_exception_sal (enum ada_exception_catchpoint_kind ex, char *excep_string, > > EX_KIND is the kind of exception catchpoint to be created. > > - If EXCEPT_STRING is NULL, this catchpoint is expected to trigger > + If EXCEPT_STRING is empty, this catchpoint is expected to trigger > for all exceptions. Otherwise, EXCEPT_STRING indicates the name > - of the exception to which this catchpoint applies. When not NULL, > - the string must be allocated on the heap, and its deallocation > - is no longer the responsibility of the caller. > + of the exception to which this catchpoint applies. > > - COND_STRING, if not NULL, is the catchpoint condition. This string > + COND_STRING, if not empty, is the catchpoint condition. This string > must be allocated on the heap, and its deallocation is no longer > the responsibility of the caller. The last part of this paragraph is probably no longer valid. Simon