From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15241 invoked by alias); 20 May 2013 14:22:16 -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 15230 invoked by uid 89); 20 May 2013 14:22:16 -0000 X-Spam-SWARE-Status: No, score=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 20 May 2013 14:22:15 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4KEMEvw002661 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 20 May 2013 10:22:14 -0400 Received: from barimba (ovpn-113-72.phx2.redhat.com [10.3.113.72]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4KEMDP0031385 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 20 May 2013 10:22:13 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Subject: Re: [RFA 2/7] API for inhibiting section map updates References: <20130516144340.GA2105@blade.nx> <20130516144813.GC2105@blade.nx> Date: Mon, 20 May 2013 14:22:00 -0000 In-Reply-To: <20130516144813.GC2105@blade.nx> (Gary Benson's message of "Thu, 16 May 2013 15:48:14 +0100") Message-ID: <87mwrpohnv.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-05/txt/msg00726.txt.bz2 >>>>> "Gary" == Gary Benson writes: Gary> +void Gary> +inhibit_section_map_updates (void) Gary> +{ Gary> + get_objfile_pspace_data (current_program_space)->inhibit_updates = 1; Gary> +} Gary> + Gary> +/* See comments in objfiles.h. */ Gary> + Gary> +void Gary> +resume_section_map_updates (void) Gary> +{ Gary> + get_objfile_pspace_data (current_program_space)->inhibit_updates = 0; Gary> +} Gary> + Gary> +/* See comments in objfiles.h. */ Gary> + Gary> +void Gary> +resume_section_map_updates_cleanup (void *arg) Gary> +{ Gary> + resume_section_map_updates (); Gary> } It seems like it might be slightly safer if these all took the program space as an argument. That way if something happens to change the current program space, then, e.g., the cleanup will still affect the program space for which it was made. What do you think of that? Tom