From bd490c4c7b8679666eb085d1156635e97c65f4b2 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Wed, 6 Jan 2021 11:30:40 -0800 Subject: [PATCH] [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. --- scripts/build_symbol_table.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/build_symbol_table.py b/scripts/build_symbol_table.py index 2095d34..516a072 100755 --- a/scripts/build_symbol_table.py +++ b/scripts/build_symbol_table.py @@ -19,15 +19,19 @@ def parse_syms(infile): representing the symbols in the text segment of the binary. Returns a list of (address, symbol_name).""" - from cxxfilt import demangle + from cxxfilt import demangle, InvalidName syms = [] for line in sys.stdin: addr, t, mangled = line.split() if t not in "tTvVwW": continue + try: + name = demangle(mangled) + except InvalidName: + continue + addr = int(addr, base=16) - name = demangle(mangled) syms.append((addr, name)) return sorted(syms)