From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47112 invoked by alias); 11 Sep 2017 20:34:30 -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 47103 invoked by uid 89); 11 Sep 2017 20:34:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=our X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Sep 2017 20:34:25 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v8BKYIhe010824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 11 Sep 2017 16:34:23 -0400 Received: by simark.ca (Postfix, from userid 112) id 7EA391ECB9; Mon, 11 Sep 2017 16:34:18 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 29E911EA19; Mon, 11 Sep 2017 16:34:18 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 11 Sep 2017 20:34:00 -0000 From: Simon Marchi To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFA 8/8] Remove make_show_memory_breakpoints_cleanup In-Reply-To: <20170910215037.24329-9-tom@tromey.com> References: <20170910215037.24329-1-tom@tromey.com> <20170910215037.24329-9-tom@tromey.com> Message-ID: <08f270609a1af66f0608f3ca7c1976db@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 11 Sep 2017 20:34:18 +0000 X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00313.txt.bz2 > @@ -9009,14 +9008,13 @@ program_breakpoint_here_p (struct gdbarch > *gdbarch, CORE_ADDR address) > /* Enable the automatic memory restoration from breakpoints while > we read the memory. Otherwise we could say about our temporary > breakpoints they are permanent. */ > - cleanup = make_show_memory_breakpoints_cleanup (0); > + scoped_restore restore_memory > + = make_scoped_restore_show_memory_breakpoints (0); > > if (target_read_memory (address, target_mem, len) == 0 > && memcmp (target_mem, bpoint, len) == 0) > retval = 1; > > - do_cleanups (cleanup); > - > return retval; > } I think the retval variable can be removed in favor of returning directly. Simon