[minicoredumper] Handling of unavailable bytes in minicoredumps by GDB

Simon Marchi simon.marchi at ericsson.com
Mon Jul 4 15:23:26 CEST 2016


On 16-07-04 05:56 AM, John Ogness wrote:
> Hi Simon,
> 
> On 2015-10-23, Simon Marchi <simon.marchi at ericsson.com> wrote:
>> I'd like to show you a prototype of GDB that handles the bytes that
>> are unavailable in the minicoredump (which are read as zeros
>> currently).
>>
>> The principle is very similar to the GDB tracepoints, where you also
>> have the concept of unavailable bytes.  Since a lot of work has been
>> done to put the infrastructure in place for tracepoints, it's not so
>> bad to do it now for the minicoredumps.
>>
>> I made some minimal modifications to minicoredumper, in order to save
>> what memory was collected as part of the minicoredump.  I am saving
>> the data in a file called "dumped" which is next to the core dump.
>> Having this data directly in the core dump, in a section of its own,
>> would be much better.
> 
> 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.

Nice!

> Because of a bug in libelf, using this feature currently requires HEAD
> of the elfutils repository. In particular this patch [0] is
> needed. Minicoredumper checks for version 0.167 of libelf, which should
> be the next released version.
>
>> To get a feel of it, I invite you to build the following branch of
>> gdb:
>>
>>   https://github.com/simark/binutils-gdb/tree/minicore-for-linutronix
>>
>> It's a simple ./configure && make.  The gdb binary will be in the gdb
>> directory.
>>
>> You can then find the modified version of minicoredumper in the
>> following branch:
>>
>>   https://github.com/simark/minicoredumper/tree/collected-for-linutronix
> 
> I will modify your test to support retrieving the data from the ELF
> section. The change should be relatively simple.
> 
> John Ogness
> 
> [0] https://git.fedorahosted.org/cgit/elfutils.git/commit/?id=96e140f6687922606657a76f185a73cf47908ef2

Awesome.  If you need any help on the gdb side, let me know.

Simon




More information about the minicoredumper mailing list