unnamed.py: Add completion percentage

People love percentages. Gotta show our powerlevel.
This commit is contained in:
mid-kid 2019-01-01 11:41:48 +01:00
parent 3b97a15ea3
commit 9fde0912c3

View File

@ -47,6 +47,7 @@ if args.rootdir:
exit(1) exit(1)
# Scan all unnamed symbols from the symfile # Scan all unnamed symbols from the symfile
symbols_total = 0
symbols = set() symbols = set()
for line in args.symfile: for line in args.symfile:
line = line.split(";")[0].strip() line = line.split(";")[0].strip()
@ -54,12 +55,15 @@ for line in args.symfile:
if len(split) < 2: if len(split) < 2:
continue continue
symbols_total += 1
symbol = " ".join(split[1:]).strip() symbol = " ".join(split[1:]).strip()
if symbol[-3:].lower() == split[0][-3:].lower(): if symbol[-3:].lower() == split[0][-3:].lower():
symbols.add(symbol) symbols.add(symbol)
# If no object files were provided, just print what we know and exit # If no object files were provided, just print what we know and exit
print("Unnamed symbols: %d" % len(symbols)) print("Unnamed symbols: %d (%.2f%% complete)" % (len(symbols),
(symbols_total - len(symbols)) / symbols_total * 100))
if not objects: if not objects:
for sym in symbols: for sym in symbols:
print(sym) print(sym)