From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28508 invoked by alias); 26 Jan 2017 18:06:29 -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 28497 invoked by uid 89); 26 Jan 2017 18:06:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=H*MI:sk:a755dd9, H*f:sk:a755dd9, H*i:sk:a755dd9 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Jan 2017 18:06:18 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1cWoR6-0002tE-Ji from Luis_Gustavo@mentor.com ; Thu, 26 Jan 2017 10:06:16 -0800 Received: from [172.30.8.148] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 26 Jan 2017 10:06:13 -0800 Reply-To: Luis Machado Subject: Re: [PATCH] Harden tests that deal with memory regions References: <1485206680-4402-1-git-send-email-lgustavo@codesourcery.com> <830534b5-d820-d6dd-3d80-3644fcf50f5e@redhat.com> <91ac79a4-986c-38f5-8ee1-16c764b8c563@codesourcery.com> To: Pedro Alves , From: Luis Machado Message-ID: <2eb78fe3-6473-9ccd-adfb-2dd2fdb86928@codesourcery.com> Date: Thu, 26 Jan 2017 18:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00598.txt.bz2 On 01/26/2017 11:47 AM, Pedro Alves wrote: > On 01/26/2017 05:37 PM, Luis Machado wrote: >> On 01/26/2017 07:17 AM, Pedro Alves wrote: >>> On 01/23/2017 09:24 PM, Luis Machado wrote: >>> >>>> 2017-01-23 Luis Machado >>>> >>>> * lib/gdb-memory.exp: New file. >>> >>> Do we need "gdb-" in the file name? >>> >>> What other procedures to you envision being placed here? Should >>> this have "regions" in the file name, like "memory-regions.exp"? >>> The file's intro comment talks about memory regions. >>> >> >> I guess we don't really need the gdb prefix. I originally envisioned >> this particular file storing all proc's dealing with memory checks and >> manipulation (though i ended up describing it in a different way). > > So can you drop it? > >> I wanted to avoid having to add more helper functions to lib/gdb.exp. >> But maybe it wouldn't be a big problem? My instinct is to modularize it. > > Sure, I'm not arguing against modularizing. Only against calling it "memory", > but describing it as "memory ranges". I'm arguing for picking one > and being consistent throughout. > Great. I've picked lib/memory.exp as the name in v3. >> On second thought, i've pulled these comments from the test files. The >> updated proc documentation should be enough. What do you think? > > I don't think so. The important detail is that you call it > _here_, right after starting the target to get rid of > any target-supplied memory region. While the procedure could > be called at any other point, to delete user-defined regions, > even. > I've reverted this in v3 and adjusted the comments to be more sensible depending on the context of the call. >>>> + >>>> +# This file holds functions and data dealing with memory regions >>>> manipulation. >>>> + >>>> +# Deletes all the memory regions GDB currently knows about. >>>> + >>>> +proc delete_memory_regions {} { >> >> I've added the target-supplied bit to this as well. > > That doesn't sound right. The procedure deletes all memory > regions, either target-supplied, or user defined. > > Thanks, > Pedro Alves > Fixed. Thanks, Luis