Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace cxxfilt with itanium_demangler #4

Merged
merged 6 commits into from
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 python-setuptools
klemens-morgenstern marked this conversation as resolved.
Show resolved Hide resolved
# 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
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
argparse~=1.4.0
pcpp~=1.21
pyelftools~=0.26
cxxfilt~=0.2.1
setuptools~=39.0.1
itanium_demangler~=1.0
klemens-morgenstern marked this conversation as resolved.
Show resolved Hide resolved
twine~=3.1.1
setuptools~=39.0.1
setuptools~=39.0.1
klemens-morgenstern marked this conversation as resolved.
Show resolved Hide resolved
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