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