Implib.so: Fix issue with trailing newline in c++filt output

This commit is contained in:
Boris Korzun 2023-09-20 15:25:42 +03:00
parent aa1d005cc5
commit 4419cd6bec
1 changed files with 3 additions and 0 deletions

View File

@ -95,6 +95,8 @@ def collect_syms(f):
elif toc is not None:
sym = parse_row(words, toc, ["Value"])
name = sym["Name"]
if not name:
continue
if name in syms_set:
continue
syms_set.add(name)
@ -115,6 +117,7 @@ def collect_syms(f):
# Also collected demangled names
if syms:
out, _ = run(["c++filt"], "\n".join((sym["Name"] for sym in syms)))
out = out.rstrip("\n") # Some c++filts append newlines at the end
for i, name in enumerate(out.split("\n")):
syms[i]["Demangled Name"] = name