Re: Pull header reading code into libdwP.h

2021-02-12 Thread Mark Wielaard
Hi Timm, On Tue, 2021-02-09 at 12:45 +0100, Timm Bäder via Elfutils-devel wrote: > There is quite a bit of code duplication between src/readelf.c and > libdw/dwarf_getsrclines.c when parsing header_length, unit_length, > etc. > > Pull the code out into libdwP.h and use it in both of those files.

Pull header reading code into libdwP.h

2021-02-09 Thread Timm Bäder via Elfutils-devel
There is quite a bit of code duplication between src/readelf.c and libdw/dwarf_getsrclines.c when parsing header_length, unit_length, etc. Pull the code out into libdwP.h and use it in both of those files. It doesn't save a much code as I'd hoped and I'm not sure about the naming, but here's the

[PATCH] Pull header reading code into libdwP.h

2021-02-09 Thread Timm Bäder via Elfutils-devel
From: Timm Bäder src/readelf.c and libdw/dwarf_getsrclines.c contain the same code to read header_length, unit_length, minimum_instr_len, etc. Pull this code out into libdwP.h and into a header_state struct that goes with the line_state struct in dwarf_getsrclines.c. Signed-off-by: Timm Bäder -