From 3daa07e31108703152b53ac08c1159fb5ffca6b7 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Tue, 10 Nov 2020 01:31:23 -0800 Subject: [PATCH] [scripts] Fix demangle error On my laptop, a few symbol names raise errors as invalid when attempting to demangle them. This should not stop the rest of the symbol table from building. --- scripts/build_symbol_table.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/build_symbol_table.py b/scripts/build_symbol_table.py index 2095d34..f373518 100755 --- a/scripts/build_symbol_table.py +++ b/scripts/build_symbol_table.py @@ -19,16 +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 - addr = int(addr, base=16) - name = demangle(mangled) - syms.append((addr, name)) + try: + addr = int(addr, base=16) + name = demangle(mangled) + syms.append((addr, name)) + except InvalidName: + pass return sorted(syms)