Support for shared lineprograms
Moving from bitbucket issue #22:
Attached is an ELF file for which readelf from pyelftools behaves differently than GNU readelf.
The reason is that the file consists of multiple compilation units that share a single lineprogram. When executing readelf --debug-dump=decodedline
Should we treat lineprograms as entities that are independent of compilation units?
My comments:
Yeah, I can reproduce the difference... Though it's just different behavior from readelf; all information seems to be parsed correctly. I'll take a look at how to make it behave similarly.
[...]
OK, I see what the problem is.
pyelftools enumerates line programs by following each CU and looking at its line program. readelf just goes over the line program section, and extracts the CU name from the line program itself.
This shouldn't be hard to fix by adding a method to DWARFInfo that enumerates line programs in order from the section and not looking up by CU.
Patches welcome!
Here's the file: https://dl.dropboxusercontent.com/u/15602400/caller
Fixed in recent pull request #56, I believe
Unfortunately #56 has nothing to do with this one (afaik). The link was caused by the unittest output using hash-sign+digit in it's output :-(