tools/mkallsyms: add exception handle

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2023-05-10 11:46:02 +08:00 committed by Xiang Xiao
parent c497576ebf
commit 416cd2da35

View File

@ -99,8 +99,11 @@ class SymbolTables(object):
symtable = self.get_symtable()
for nsym, symbol in enumerate(symtable.iter_symbols()):
if self.symbol_filter(symbol) is not None:
symbol_name = cxxfilt.demangle(symbol.name)
func_name = re.sub(r"\(.*$", "", symbol_name)
try:
symbol_name = cxxfilt.demangle(symbol.name)
func_name = re.sub(r"\(.*$", "", symbol_name)
except cxxfilt.InvalidName:
symbol_name = symbol.name
self.symbol_list.append((symbol["st_value"] & ~0x01, func_name))
self.symbol_list = sorted(self.symbol_list, key=lambda item: item[0])