From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5512 invoked by alias); 6 Oct 2011 11:51:49 -0000 Received: (qmail 5501 invoked by uid 22791); 6 Oct 2011 11:51:48 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TW_BJ X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Oct 2011 11:51:29 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RBmU4-0004KN-S4 from pedro_alves@mentor.com ; Thu, 06 Oct 2011 04:51:29 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 6 Oct 2011 12:51:24 +0100 From: Pedro Alves To: Doug Evans Subject: Re: program spaces vs exec Date: Thu, 06 Oct 2011 11:51:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.1; x86_64; ; ) Cc: gdb@sourceware.org References: <20111005181526.B6CCA2461D1@ruffy.mtv.corp.google.com> In-Reply-To: <20111005181526.B6CCA2461D1@ruffy.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201110061251.22983.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00030.txt.bz2 On Wednesday 05 October 2011 19:15:26, Doug Evans wrote: > Hi. > > Question: Why does the program space remain unchanged across an exec? > [for reference sake, target = amd64-linux] > > Is it just expediency? Or is there a functional reason? That preserved better how gdb behaved before there were multiple program spaces. E.g., breakpoints are supposed to reset/resolve after the exec, and since the breakpoint symbol search scope is currently tied to a program space, keeping the same program space keeps that working the same. For exec, I don't have a strong feeling either way, we could say that there's a new address/program space attached to the inferior, or we could say that the inferior's address/program spaces have been refreshed with a new set of pages. I chose the latter approach originally. > I ask because, for example, registering pretty-printers > with a particular progspace doesn't work as one would expect > in this case. E.g., One needs the pretty-printers from the > previous program to be gone when the new one loads. Not sure the program space is the real problem. How do pretty-printers from a shared library that unloads go away? We should treat pretty printers of the main program and pretty printers of shared libraries similarly. > This concerns more than just exec of course. > E.g., Any time the "main" objfile is changed (e.g., "file foo") I'd intuitively > expect a new program space. Changing the main file does not necessarily invalidate or get rid of the loaded shared library list, so I think we should not create a new program space for this. -- Pedro Alves