Skip to content

Commit

Permalink
bugfix: don't crash when c++filt is not available in the toolchain
Browse files Browse the repository at this point in the history
The PIC xc16 toolchain does not include any c++ tools and puncover
crashed while trying to open the elf file. This fixes it.
  • Loading branch information
sarfata committed May 11, 2020
1 parent 706dcc5 commit 35805d8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion puncover/gcc_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ def chunks(l):
for i in range(0, len(l), chunk_size):
yield l[i:i + chunk_size]

lines_list = [self.gcc_tool_lines('c++filt', c) for c in chunks(symbol_names)]
lines_list = [c for c in chunks(symbol_names)]
try:
lines_list = [self.gcc_tool_lines(
'c++filt', c) for c in chunks(symbol_names)]
except Exception as e:
print("Unable to demangle C++ symbol names: {}".format(e))
lines = list(itertools.chain.from_iterable(lines_list))
demangled = list(s.rstrip() for s in lines)

Expand Down

0 comments on commit 35805d8

Please sign in to comment.