From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27165 invoked by alias); 9 Oct 2003 22:17:19 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 27155 invoked from network); 9 Oct 2003 22:17:17 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 9 Oct 2003 22:17:17 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h99MHFM08706 for ; Thu, 9 Oct 2003 18:17:16 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h99MHED01440; Thu, 9 Oct 2003 18:17:15 -0400 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h99MHEi09046; Thu, 9 Oct 2003 15:17:14 -0700 Message-ID: <3F85DE6A.5040101@redhat.com> Date: Thu, 09 Oct 2003 22:17:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Roland McGrath CC: gdb-patches@sources.redhat.com Subject: Re: [PATCH] make gcore dump read-only sections not from files References: <200310090244.h992io72028917@magilla.sf.frob.com> In-Reply-To: <200310090244.h992io72028917@magilla.sf.frob.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-10/txt/msg00324.txt.bz2 Roland McGrath wrote: > This works well enough. However, I think that making the determination > based on the kernel-supplied indication of anonymous vs file-backed may > make more sense. (Linux 2.6's behavior may be changing in this regard, > and using that as a determining factor rather than just permission > bits.) That would require changing the to_find_memory_regions interface > as I described earlier. Can you comment on that? I guess you mean this? > Note that this patch makes gcore dump more regions than the Linux kernel > does even with my change to its behavior. In particular, read-only mmap'd > portions of files are dumped by gcore but not by the kernel. This is a > real common issue in practice, as your average GNU/Linux process nowadays > has the large locale-archive file mapped in, and some processes may be > mapping huge files in read-only. An alternative change would be to change > the to_find_memory_regions callback interface to add a flag argument saying > whether the memory region came from a file. Then gcore_create_callback > could simply test !write && !anonymous and be wholly consistent with the > kernel core dumping (assuming my change to it), and the infrun.c change is > not required Sounds reasonable -- is it portable? A portable testcase for the testsuite would make the change fairly easy to evaluate / approve.