From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18903 invoked by alias); 9 Oct 2003 21:55:37 -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 18895 invoked from network); 9 Oct 2003 21:55:36 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 9 Oct 2003 21:55:36 -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 h99LtZM00957 for ; Thu, 9 Oct 2003 17:55:35 -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 h99LtXD32604; Thu, 9 Oct 2003 17:55:34 -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 h99LtXi07900; Thu, 9 Oct 2003 14:55:33 -0700 Message-ID: <3F85D955.8000303@redhat.com> Date: Thu, 09 Oct 2003 21:55: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/msg00321.txt.bz2 Roland McGrath wrote: >>I'll step up, since I wrote gcore. I like what you're doing, >>but I'm uncertain about the SOLIB_ADD part. Like you, I don't >>understand why it was the way it was, nor the implications of >>the change. But I think this can be done fairly easily without >>that change. > > > Ok. I would sure like to know why core files work differently this way. > It would be nice if there were any comments in the code, for example! > The comment above update_solib_list says it's used for core files and > attaching, which is true. But it says nothing about why. I don't > understand why anything about this part of the solib handling would be > different for core files than for running. > > >>Does this (rewriting your main loop using ALL_OBJSECTIONS) >>seem reasonable? > > > Sure does. I didn't read enough code to understand exactly what > objfile_find_memory_regions was doing and misread it as doing less. > > Along the way I noticed another difference between gcore-produced and > kernel-produced core dumps. The omitted segments in real core dumps > have nonzero p_memsz but zero p_filesz, which in phdrs indicates that > the memory is occupied but the contents are not available. gcore's > dumps zero the size, which gives a wrong indication of the address space. > I changed that as well, so gcore's dumps now look more like real dumps. > > 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'll go back and look, but meanwhile, this change is approved. Michael