This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH] Implement new `info core mappings' command
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 8 Nov 2011 22:47:09 +0100
- Subject: Re: [PATCH] Implement new `info core mappings' command
- References: <email@example.com> <20111031001117.GA11608@host1.jankratochvil.net> <firstname.lastname@example.org> <20111031070012.GA32610@host1.jankratochvil.net> <email@example.com> <20111104162648.GA30571@host1.jankratochvil.net> <firstname.lastname@example.org>
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:
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
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.
printf_filtered ("\t%#10lx %#10lx %#10x %7s\n",
I think \t should be removed, screen width is scarce.
%7s should be %s.
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.