From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2348 invoked by alias); 8 Nov 2011 21:47:48 -0000 Received: (qmail 2339 invoked by uid 22791); 8 Nov 2011 21:47:47 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Nov 2011 21:47:30 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA8LlUTF023393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 8 Nov 2011 16:47:30 -0500 Received: from host1.jankratochvil.net (ovpn-116-24.ams2.redhat.com [10.36.116.24]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pA8LlJvr023940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 8 Nov 2011 16:47:29 -0500 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id pA8LlF2k026000; Tue, 8 Nov 2011 22:47:15 +0100 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id pA8Ll9vd025999; Tue, 8 Nov 2011 22:47:09 +0100 Date: Tue, 08 Nov 2011 21:47:00 -0000 From: Jan Kratochvil To: Sergio Durigan Junior Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Implement new `info core mappings' command Message-ID: <20111108214709.GA25354@host1.jankratochvil.net> References: <20111031001117.GA11608@host1.jankratochvil.net> <20111031070012.GA32610@host1.jankratochvil.net> <20111104162648.GA30571@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 X-SW-Source: 2011-11/txt/msg00211.txt.bz2 On Tue, 08 Nov 2011 02:48:54 +0100, Sergio Durigan Junior wrote: > >> + if (bitness == 32) > >> + printf_filtered ("\t%#10lx %#10lx %#10x %7s\n", > >> + start, > >> + end, > >> + (int) size, > >> + filename ? filename : ""); > > > > Could you print all the info readelf -Wa prints? I would use rather readelf > > to see the protection bits, also I guess the file size vs. mem size may > > suggest if it is a data segment or code segment, up to you how to display it, > > even some indicator "from core file" (memsize==filesize) vs. "from local file" > > (filesize==0) vs. "partial" (others, e.g. filesize==0x1000) could be > > enough. > > When you say "all the info", what do you mean? I am not sure I > understood your sentence above. Currently you display: Start Addr End Addr Size objfile 0x37aa200000 0x37aa222000 0x22000 /lib64/ld-2.14.90.so FYI max width: 0xffffffffffffffff 0xffffffffffffffff I see now the formatstring is a copy from `info proc mappings'. The readelf -Wl output is: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0xa6c000 0x00007f9623a5b000 0x0000000000000000 0x001000 0x015000 R E 0x1000 Flg must be there. It suggests whether that part is about segment with .text or with .data etc. Somehow both FileSiz MemSiz should be there. I would find OK (this is RFC) to put there just MemSiz together with single-character column: C if FileSiz == MemSiz I if FileSiz == pagesize (that is only the build-id header is present) F if FileSiz == 0 ? otherwise But not sure if one gets used to this format. It is questionable whether Offset should be there. I use that value but probably when one starts editing/searching etc. corefile one can run separate readelf anyway and it would be just redundant in the GDB output. So I do not want Offset there. 32: printf_filtered ("\t%#10lx %#10lx %#10x %7s\n", I think \t should be removed, screen width is scarce. %7s should be %s. 64: printf_filtered (" %#18lx %#18lx %#10x %7s\n", I think " " should be removed, screen width is scarce. %7s should be %s. Feel free to disagree, this is more about bikeshedding, just expressing my opinions with reasons for discussion. Thanks, Jan