From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17746 invoked by alias); 6 Apr 2018 21:31:21 -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 17686 invoked by uid 89); 6 Apr 2018 21:31:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=readable X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.145.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Apr 2018 21:31:08 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway33.websitewelcome.com (Postfix) with ESMTP id ADE8FBBD29D for ; Fri, 6 Apr 2018 16:31:06 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 4YwsfyCnmQUwq4YwsfmO2L; Fri, 06 Apr 2018 16:31:06 -0500 Received: from 75-166-37-45.hlrn.qwest.net ([75.166.37.45]:47862 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1f4Yws-003mEu-E5; Fri, 06 Apr 2018 16:31:06 -0500 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA 02/12] Change breakpoints to use value_ref_ptr References: <20180405211507.6103-1-tom@tromey.com> <20180405211507.6103-3-tom@tromey.com> Date: Fri, 06 Apr 2018 21:31:00 -0000 In-Reply-To: (Pedro Alves's message of "Fri, 6 Apr 2018 20:31:31 +0100") Message-ID: <87fu483tuu.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Source-L: No X-Exim-ID: 1f4Yws-003mEu-E5 X-Source-Sender: 75-166-37-45.hlrn.qwest.net (bapiya) [75.166.37.45]:47862 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2018-04/txt/msg00106.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: >> + b->val.reset (nullptr); Pedro> Just OOC, wouldn't the old "b->val = NULL;" work the same as the Pedro> reset call? Yeah. I reverted the two spots where I changed this. >> + if (wp->val_valid && wp->val.get ()) Pedro> Nit, about this get(): I wonder whether we should add an Pedro> explicit operator bool() Pedro> implementation to gdb_ref_ptr to avoid it. Pedro> I guess we should instead write the explicit: Pedro> if (wp->val_valid && wp->val != nullptr) Pedro> making that moot. I did this. I'm on the fence about the operator bool thing. I think 'bool (wp)" and "wp != nullptr" are both about as explicit and readable. But, the latter is currently used more widely. Tom