From 60a7f60cd4b5d56e953c4d179cbe122a3f7cf7c5 Mon Sep 17 00:00:00 2001 From: disinvite Date: Mon, 29 Jan 2024 16:23:50 -0500 Subject: [PATCH] Include more modules in the list --- tools/roadmap/roadmap.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/roadmap/roadmap.py b/tools/roadmap/roadmap.py index 6fa7f1ba..1d91c91a 100644 --- a/tools/roadmap/roadmap.py +++ b/tools/roadmap/roadmap.py @@ -38,6 +38,13 @@ def __init__(self, pdb, binfile) -> None: if binfile.is_valid_section(sizeref.section) ] + def get_all_cmake_modules(self) -> List[str]: + return [ + obj + for (_, (__, obj)) in self.module_lookup.items() + if obj.startswith("CMakeFiles") + ] + def get_module(self, addr: int) -> Optional[str]: for start, size, module_id in self.section_contrib: if start <= addr < start + size: @@ -132,14 +139,14 @@ def read_row(self, row: RoadmapRow): self.disp_map[row.module].append(row.displacement) -def suggest_order(results: List[RoadmapRow], match_type: str): +def suggest_order(results: List[RoadmapRow], cmake_modules: List[str], match_type: str): """Suggest the order of modules for CMakeLists.txt""" dc = DeltaCollector(match_type) for row in results: dc.read_row(row) - leftover_modules = set(mod for mod in dc.seen if mod.startswith("CMakeFiles")) + leftover_modules = set(cmake_modules) # A little convoluted, but we want to take the first two tokens # of the string with '/' as the delimiter. @@ -358,7 +365,7 @@ def to_roadmap_row(match): results = list(map(to_roadmap_row, engine.get_all())) if args.order is not None: - suggest_order(results, args.order) + suggest_order(results, module_map.get_all_cmake_modules(), args.order) return if args.csv is None: