[scripts] Ignore demangle errors building sym table

For some reason, cxxfilt fails to demangle some names on some systems.
Instead of failing the build process, just skip those symbols.
This commit is contained in:
Justin C. Miller
2021-01-06 11:30:40 -08:00
parent 3a67e461de
commit bd490c4c7b

View File

@@ -19,15 +19,19 @@ def parse_syms(infile):
representing the symbols in the text segment of the binary. Returns representing the symbols in the text segment of the binary. Returns
a list of (address, symbol_name).""" a list of (address, symbol_name)."""
from cxxfilt import demangle from cxxfilt import demangle, InvalidName
syms = [] syms = []
for line in sys.stdin: for line in sys.stdin:
addr, t, mangled = line.split() addr, t, mangled = line.split()
if t not in "tTvVwW": continue if t not in "tTvVwW": continue
try:
name = demangle(mangled)
except InvalidName:
continue
addr = int(addr, base=16) addr = int(addr, base=16)
name = demangle(mangled)
syms.append((addr, name)) syms.append((addr, name))
return sorted(syms) return sorted(syms)