From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108853 invoked by alias); 7 Jul 2018 02:31:35 -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 108618 invoked by uid 89); 7 Jul 2018 02:31:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=hacks 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; Sat, 07 Jul 2018 02:30:39 +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 6C6411E08D; Fri, 6 Jul 2018 22:30:14 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1530930614; bh=ySz0SZ2ilY2g07UpOereXrO8hupSIsy6kMqBG7wywik=; h=Subject:To:References:From:Date:In-Reply-To:From; b=udzLgWnGCwBdiF1zNSSpImBDpACcalLaKEm+pPxGSpeFgIESr49f+vuS2dpR9Z8y1 WGUz45e25/YhnMGzOKianlGqZojZZQmeXRfKsZ6bmqIRkqU7sL4F45wNfKfLCzwmBS jYqnY8K8lN0d05mUeyeMVzOWHmCNLW9qdte9HyUA= Subject: Re: [RFA 01/42] Use new and delete for buildsym_compunit To: Keith Seitz , Tom Tromey , gdb-patches@sourceware.org References: <20180523045851.11660-1-tom@tromey.com> <20180523045851.11660-2-tom@tromey.com> <8a3cd7f5-f328-55c8-2762-3aa315e339c1@redhat.com> From: Simon Marchi Message-ID: <1e70cc05-bec1-a752-843f-dae3fd3a951c@simark.ca> Date: Sat, 07 Jul 2018 02:31:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <8a3cd7f5-f328-55c8-2762-3aa315e339c1@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-07/txt/msg00162.txt.bz2 On 2018-07-05 02:49 PM, Keith Seitz wrote: > Hi, Tom, > > I've got one general question: > > On 05/22/2018 09:58 PM, Tom Tromey wrote: >> This changes buildsym_compunit to use new and delete. >> >> diff --git a/gdb/buildsym.c b/gdb/buildsym.c >> index 5d38cb250f..9863e4ea1e 100644 >> --- a/gdb/buildsym.c >> +++ b/gdb/buildsym.c >> @@ -107,24 +136,24 @@ struct buildsym_compunit >> Files are added to the front of the list. >> This is important mostly for the language determination hacks we use, >> which iterate over previously added files. */ >> - struct subfile *subfiles; >> + struct subfile *subfiles = nullptr; >> >> /* The subfile of the main source file. */ >> - struct subfile *main_subfile; >> + struct subfile *main_subfile = nullptr; >> >> /* E.g., DW_AT_comp_dir if DWARF. Space for this is malloc'd. */ >> char *comp_dir; >> >> /* Space for this is not malloc'd, and is assumed to have at least >> the same lifetime as objfile. */ >> - const char *producer; >> + const char *producer = nullptr; >> >> /* Space for this is not malloc'd, and is assumed to have at least >> the same lifetime as objfile. */ >> - const char *debugformat; >> + const char *debugformat = nullptr; >> >> /* The compunit we are building. */ >> - struct compunit_symtab *compunit_symtab; >> + struct compunit_symtab *compunit_symtab = nullptr; >> >> /* Language of this compunit_symtab. */ >> enum language language; > > By the end of the series, this struct declaration is moved to buildsym.h and a bunch of new, private data is added. All those data members are named "m_XYZ" whereas the above variable names are never receive the "m_" treatment. > > Since these variables will later become private, should they not also (some time) be renamed? > [I think this should/could be a follow-on patch -- no changes needed here.] In any case, this patch on its own LGTM, since the fields are still public. Simon