scripts: Simplified result->file mapping, dropped collect_dwarf_files

This reverts per-result source file mapping, and tears out of a bunch of
messy dwarf parsing code. Results from the same .o file are now mapped
to the same source file.

This was just way too much complexity for slightly better result->file
mapping, which risked losing results accidentally mapped to the wrong
file.

---

I was originally going to revert all the way back to relying strictly on
the .o name and --build-dir (490e1c4) (this is the simplest solution),
but after poking around in dwarf-info a bit, I realized we do have
access to the original source file in DW_TAG_compile_unit's
DW_AT_comp_dir + DW_AT_name.

This is much simpler/more robust than parsing objdump --dwarf=rawline,
and avoid needing --build-dir in a bunch of scripts.

---

This also reverts stack.py to rely only on the .ci files. These seem as
reliable as DW_TAG_compile_unit while simplifying things significantly.

Symbol mapping used to be a problem, but this was fixed by using the
symbol in the title field instead of the label field (which strips some
optimization suffixes?)
This commit is contained in:
Christopher Haster
2024-12-11 18:45:46 -06:00
parent dad3367e9e
commit 4c87d59c7b
9 changed files with 190 additions and 1222 deletions

View File

@@ -243,6 +243,9 @@ class SymInfo:
def __contains__(self, k):
return self.get(k) is not None
def __bool__(self):
return bool(self.syms)
def __len__(self):
return len(self.syms)
@@ -388,6 +391,9 @@ class LineInfo:
def __contains__(self, k):
return self.get(k) is not None
def __bool__(self):
return bool(self.lines)
def __len__(self):
return len(self.lines)