This is the mail archive of the
mailing list for the elfutils project.
List of source files
- From: Bruce Dawson <bruced at valvesoftware dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 04 Jun 2013 21:47:25 +0000
- Subject: List of source files
I want to get a list of all of the source files and header files used to create a particular shared object. I can do this with "objdump -Wl" in order to get the Directory Table and the File Name Table, but this also emits an enormous volume of other data. The volume of data is large enough that filtering through it (some combination of the time that objdump spends printing it and the time that I spend parsing it) is inconveniently long -- it noticeably increases our build time.
I found the display_debug_lines_raw() function in dwarf.c and I modified it to just print the Directory Table and File Name Table arrays, and that works quite nicely for my purposes. There is still a lot of redundancy (the same files listed many times) but the volume of data is 15-20x smaller so the printing and parsing is no longer a problem.
Does it seem worthwhile to add a new objdump command line option to just dump this information? I could see it being useful for others. Perhaps -WS for Source.
The actual change would be simple (an extra flag to display_debug_lines_raw), but I don't know if it is desirable for the population at large. If not then I'll continue using our custom version.