[minicoredumper] Handling of unavailable bytes in minicoredumps by GDB
John Ogness
john.ogness at linutronix.de
Tue Jul 5 09:29:05 CEST 2016
On 2016-07-04, John Ogness <john.ogness at linutronix.de> wrote:
>>> I recently completed this work from the minicoredumper side. A new
>>> ELF section note ".note.minicoredumper.dumplist" is added to the
>>> core file. This provides the same information that your "dumped"
>>> file provided.
>>>
>>> I will modify your test to support retrieving the data from the ELF
>>> section. The change should be relatively simple.
>>
>> If you need any help on the gdb side, let me know.
>
> This task appears more daunting than originally expected. libbfd will
> not allow reading core files as generic ELF files (bfd_object). It
> explicitly rejects core files. In bfd/elfcode.h:elf_object_p() we
> have:
>
> /* Reject ET_CORE (header indicates core file, not object file) */
> if (i_ehdrp->e_type == ET_CORE)
> goto got_wrong_format_error;
>
> By commenting out these 2 lines, I am able to read the new section
> without any problem. But this most likely is not the correct approach.
>
> Since libbfd totally ignores sections for bfd_core, I am at a loss of
> how best to gain access to the new section using libbfd. Adding a new
> backend seems to be the wrong approach. And extending the generic core
> code is probably not acceptable.
After much consideration and various offline discussions I have decided
to modify bfd's generic core file backend to identify and load the new
minicoredumper section note. This seems to be the most appropriate place
for the changes since we are dealing with a generic extension of the
core file format.
John Ogness
More information about the minicoredumper
mailing list