MCPcopy Create free account
hub / github.com/FastLED/FastLED / parse_sections

Function parse_sections

ci/bin_bloat_analysis.py:63–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61
62
63def parse_sections() -> list[Section]:
64 out = subprocess.check_output([str(READELF), "-SW", str(ELF)], text=True)
65 sections: list[Section] = []
66 for line in out.splitlines():
67 m = re.match(
68 r"\s*\[\s*\d+\]\s+(\S+)\s+\S+\s+([0-9a-f]+)\s+[0-9a-f]+\s+([0-9a-f]+)\s+\S+\s+([A-Za-z]*)",
69 line,
70 )
71 if not m:
72 continue
73 name, addr_hex, size_hex, flags = m.groups()
74 addr = int(addr_hex, 16)
75 size = int(size_hex, 16)
76 sections.append(Section(name=name, addr=addr, size=size, flags=flags))
77 return sections
78
79
80def loaded_section_for(addr: int, sections: list[Section]) -> Section | None:

Callers 1

mainFunction · 0.85

Calls 2

SectionClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected