[minicoredumper] Handling of unavailable bytes in minicoredumps by GDB

John Ogness john.ogness at linutronix.de
Mon Jul 4 17:24:11 CEST 2016


On 2016-07-04, Simon Marchi <simon.marchi at ericsson.com> 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.

Any tips would be greatly appreciated.

John Ogness




More information about the minicoredumper mailing list