cs01 / gdbgui

Browser-based frontend to gdb (gnu debugger). Add breakpoints, view the stack, visualize data structures, and more in C, C++, Go, Rust, and Fortran. Run gdbgui from the terminal and a new tab will open in your browser.
https://gdbgui.com
GNU General Public License v3.0
9.91k stars 499 forks source link

UnicodeDecodeError #130

Open tgzhou98 opened 7 years ago

tgzhou98 commented 7 years ago

I have install gdbgui through pip when open gdbgui in terminal,it dosen't work

File "/anaconda/bin/gdbgui", line 7, in from gdbgui.backend import main File "/anaconda/lib/python3.6/site-packages/gdbgui/backend.py", line 30, in from flask_socketio import SocketIO, emit File "/anaconda/lib/python3.6/site-packages/flask_socketio/init.py", line 7, in from socketio import socketio_manage File "/anaconda/lib/python3.6/site-packages/socketio/init.py", line 8, in from .zmq_manager import ZmqManager File "/anaconda/lib/python3.6/site-packages/socketio/zmq_manager.py", line 5, in import eventlet.green.zmq as zmq File "/anaconda/lib/python3.6/site-packages/eventlet/init.py", line 10, in from eventlet import convenience File "/anaconda/lib/python3.6/site-packages/eventlet/convenience.py", line 6, in from eventlet.green import socket File "/anaconda/lib/python3.6/site-packages/eventlet/green/socket.py", line 21, in from eventlet.support import greendns File "/anaconda/lib/python3.6/site-packages/eventlet/support/greendns.py", line 390, in resolver = ResolverProxy(hosts_resolver=HostsResolver()) File "/anaconda/lib/python3.6/site-packages/eventlet/support/greendns.py", line 171, in init self._load() File "/anaconda/lib/python3.6/site-packages/eventlet/support/greendns.py", line 198, in _load lines = self._readlines() File "/anaconda/lib/python3.6/site-packages/eventlet/support/greendns.py", line 184, in _readlines for line in fp: File "/anaconda/lib/python3.6/codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 5518: invalid start byte

pip freeze output

anaconda-client==1.6.5 anaconda-navigator==1.6.8 anaconda-project==0.8.0 appnope==0.1.0 appscript==1.0.1 asn1crypto==0.22.0 astroid==1.5.3 astropy==2.0.2 autopep8==1.3.2 Babel==2.5.0 backports.shutil-get-terminal-size==1.0.0 beautifulsoup4==4.6.0 bitarray==0.8.1 bkcharts==0.2 blaze==0.11.3 bleach==2.0.0 bokeh==0.12.7 boto==2.48.0 Bottleneck==1.2.1 certifi==2017.7.27.1 cffi==1.10.0 chardet==3.0.4 click==6.7 cloudpickle==0.4.0 clyent==1.2.2 colorama==0.3.9 conda==4.3.30 contextlib2==0.5.5 cryptography==2.0.3 cycler==0.10.0 Cython==0.26.1 cytoolz==0.8.2 dask==0.15.2 datashape==0.5.4 decorator==4.1.2 distributed==1.18.3 docutils==0.14 entrypoints==0.2.3 enum-compat==0.0.2 et-xmlfile==1.0.1 eventlet==0.21.0 fastcache==1.0.2 filelock==2.0.12 flake8==3.3.0 Flask==0.12.2 Flask-Cors==3.0.3 Flask-SocketIO==2.9.2 gdbgui==0.8.0.3 gevent==1.2.2 glob2==0.5 glueviz==0.9.1 gmpy2==2.0.8 greenlet==0.4.12 h5py==2.7.0 heapdict==1.0.0 html5lib==0.999999999 idna==2.6 imageio==2.2.0 imagesize==0.7.1 ipykernel==4.6.1 ipython==6.1.0 ipython-genutils==0.2.0 ipywidgets==7.0.0 isort==4.2.15 itsdangerous==0.24 jdcal==1.3 jedi==0.10.2 Jinja2==2.10 jsonschema==2.6.0 jupyter-client==5.1.0 jupyter-console==5.2.0 jupyter-core==4.3.0 jupyterlab==0.27.0 jupyterlab-launcher==0.4.0 lazy-object-proxy==1.3.1 llvmlite==0.20.0 locket==0.2.0 lxml==3.8.0 Markdown==2.6.9 MarkupSafe==1.0 matplotlib==2.0.2 mccabe==0.6.1 mistune==0.7.4 mpmath==0.19 msgpack-python==0.4.8 multipledispatch==0.4.9 navigator-updater==0.1.0 nbconvert==5.3.1 nbformat==4.4.0 networkx==1.11 nltk==3.2.4 nose==1.3.7 notebook==5.0.0 numba==0.35.0+6.gaa35fb1 numexpr==2.6.2 numpy==1.13.1 numpydoc==0.7.0 odo==0.5.1 olefile==0.44 openpyxl==2.4.8 packaging==16.8 pandas==0.20.3 pandocfilters==1.4.2 partd==0.3.8 path.py==10.3.1 pathlib2==2.3.0 patsy==0.4.1 pep8==1.7.0 pexpect==4.2.1 pickleshare==0.7.4 Pillow==4.2.1 pkginfo==1.4.1 ply==3.10 prompt-toolkit==1.0.15 protobuf==3.4.0 psutil==5.2.2 ptyprocess==0.5.2 py==1.4.34 pycodestyle==2.3.1 pycosat==0.6.2 pycparser==2.18 pycrypto==2.6.1 pycurl==7.43.0 pyflakes==1.5.0 pygdbmi==0.7.4.3 Pygments==2.2.0 pylint==1.7.2 pyodbc==4.0.17 pyOpenSSL==17.2.0 pyparsing==2.2.0 pypugjs==4.2.2 PySocks==1.6.7 pytest==3.2.1 python-dateutil==2.6.1 python-engineio==1.7.0 python-socketio==1.8.1 pytz==2017.2 PyWavelets==0.5.2 PyYAML==3.12 pyzmq==16.0.2 QtAwesome==0.4.4 qtconsole==4.3.1 QtPy==1.3.1 requests==2.18.4 rope==0.10.5 ruamel-yaml==0.11.14 scikit-image==0.13.0 scikit-learn==0.19.0 scipy==0.19.1 seaborn==0.8 simplegeneric==0.8.1 singledispatch==3.4.0.3 six==1.11.0 snowballstemmer==1.2.1 sortedcollections==0.5.3 sortedcontainers==1.5.7 Sphinx==1.6.3 sphinxcontrib-websupport==1.0.1 spyder==3.2.3 SQLAlchemy==1.1.13 statsmodels==0.8.0 sympy==1.1.1 tables==3.4.2 tblib==1.3.2 tensorflow==1.3.0 tensorflow-tensorboard==0.1.6 terminado==0.6 testpath==0.3.1 toolz==0.8.2 tornado==4.5.2 traitlets==4.3.2 typing==3.6.2 unicodecsv==0.14.1 Unidecode==0.4.21 urllib3==1.22 wcwidth==0.1.7 webencodings==0.5.1 Werkzeug==0.12.2 widgetsnbextension==3.0.2 wrapt==1.10.11 xlrd==1.1.0 XlsxWriter==0.9.8 xlwings==0.11.4 xlwt==1.2.0 zict==0.1.2

when check the gdbgui version,i get the same info as the former File "/anaconda/bin/gdbgui", line 7, in from gdbgui.backend import main File "/anaconda/lib/python3.6/site-packages/gdbgui/backend.py", line 30, in from flask_socketio import SocketIO, emit File "/anaconda/lib/python3.6/site-packages/flask_socketio/init.py", line 7, in from socketio import socketio_manage File "/anaconda/lib/python3.6/site-packages/socketio/init.py", line 8, in from .zmq_manager import ZmqManager File "/anaconda/lib/python3.6/site-packages/socketio/zmq_manager.py", line 5, in import eventlet.green.zmq as zmq File "/anaconda/lib/python3.6/site-packages/eventlet/init.py", line 10, in from eventlet import convenience File "/anaconda/lib/python3.6/site-packages/eventlet/convenience.py", line 6, in from eventlet.green import socket File "/anaconda/lib/python3.6/site-packages/eventlet/green/socket.py", line 21, in from eventlet.support import greendns File "/anaconda/lib/python3.6/site-packages/eventlet/support/greendns.py", line 390, in resolver = ResolverProxy(hosts_resolver=HostsResolver()) File "/anaconda/lib/python3.6/site-packages/eventlet/support/greendns.py", line 171, in init self._load() File "/anaconda/lib/python3.6/site-packages/eventlet/support/greendns.py", line 198, in _load lines = self._readlines() File "/anaconda/lib/python3.6/site-packages/eventlet/support/greendns.py", line 184, in _readlines for line in fp: File "/anaconda/lib/python3.6/codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 5518: invalid start byte

gdb version

Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-apple-darwin15.6.0". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word".

I'm use OS X EI Caption 10.11.6 and Google Chrome

anyone get some ideas?

cs01 commented 6 years ago

gdb's output somehow wrote an invalid utf-8 character code. Are you using utf-8? Character encoding is assumed to be utf-8, though it could be changed to be a command line option.

Looks like two changes need to occur:

  1. pygdbmi needs to add a try around the decoding of gdb output
  2. gdbgui and pygdbmi possibly need to have a character encoding option added