This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Implement new `info core mappings' command


Thanks for the review.  I am still working on the patch, but I have a question.

Jan Kratochvil <> writes:

> On Thu, 03 Nov 2011 21:00:39 +0100, Sergio Durigan Junior wrote:
>> +	  {
>> +	    filename = s->objfile->name;
>> +	    break;
>> +	  }
> I think the logic should be opposite.  Not to find any part of the core
> segment from some file but ensure the whole segment is mapped from that file.
> For ELF core files you should rather check also the ELF segments in
> objfiles->obfd and verify it is fully covered.  (I said off-list something
> different, not seeing the code, sorry.)  That is verify every byte between
> 0x37aa200000 and 0x37aa222000 belongs to any of the segments from such file.
> Otherwise you may print a filename for some core file segment while only part
> of that segment is from that file (it probably will not happen for normal core
> files but GDB is for debugging problems so it should never give inexact
> results).

This one is giving me headaches...  When I implemented the algorithm,
some objfiles were supressed.  Anyway, I'm still working on it (and
that's not the question I wanted to ask).

>> +
>> +      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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]