Skip to content

Commit

Permalink
Merge pull request #4 from cHemingway/itanium_demangler
Browse files Browse the repository at this point in the history
Replace cxxfilt with itanium_demangler
  • Loading branch information
klemens-morgenstern authored Sep 7, 2020
2 parents a33a6c1 + 3bb9ec1 commit 312dfbe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
steps:
- name: Install gdb
run: sudo apt-get install gdb
# Install python-setuptools system wide
- name: Install python-setuptools
run: sudo apt-get install python3-setuptools
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Pip install
Expand Down
8 changes: 6 additions & 2 deletions metal/serial/elfreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
from elftools.elf.elffile import ELFFile
from elftools.elf.sections import SymbolTableSection

import cxxfilt
# Ignore SyntaxWarning for itanium_demangler
import warnings
warnings.filterwarnings("ignore",category=SyntaxWarning,module=r".*itanium_demangler")

import itanium_demangler

class Symbol:
name: str
Expand All @@ -21,7 +25,7 @@ def __init__(self, name: str, address: int, symbol_type: str, demangled_name: Op

if demangled_name is None:
try:
self.demangled_name = cxxfilt.demangle(name.split('@')[0])
self.demangled_name = str(itanium_demangler.parse(name.split('@')[0]))
except:
self.demangled_name = demangled_name
else:
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
argparse~=1.4.0
pcpp~=1.21
pyelftools~=0.26
cxxfilt~=0.2.1
setuptools~=39.0.1
itanium_demangler~=1.0
twine~=3.1.1
setuptools~=39.0.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def package_files(directory):
url='http://pypi.python.org/pypi/metal_test',
packages=['metal', 'metal.gdb', 'metal.serial'],
package_data={'metal': package_files('src') + package_files('include')},
install_requires=['argparse', 'pcpp', 'pyelftools', 'cxxfilt'],
install_requires=['argparse', 'pcpp', 'pyelftools', 'itanium_demangler'],
long_description=long_description,
long_description_content_type='text/markdown',
entry_points={
Expand Down

0 comments on commit 312dfbe

Please sign in to comment.