Dwarf cache skips .c files when mAreaCnt resolves to 0
I have observed some inconsistencies with the files shown in the DWARFCache cache->mFileInfoHash when attempting to load debug info from a elf file with the tcf-agent in comparison to what is shown with gdb for the same elf. This seems to be caused by an optimization step in compute_reverse_lookup_indices where files with file->mAreaCnt == 0 is skipped causing in some edge cases some .c files to be omitted from the dwarf cache. Commenting out this line fixes the inconsistency with gdb making the files match one to one.
Is it possible we can remove this line or would this break something?
gdb command:
gdb -q (elf file) -ex "info sources" -ex quit
agent/tcf/services/dwarfcache.c
static void compute_reverse_lookup_indices(DWARFCache * Cache, CompUnit * Unit) {
...
if (file->mAreaCnt == 0) continue;
Edited by Ole Sivert Aarhaug