Giter Site home page Giter Site logo

Problem with gdbinit about voltron HOT 15 CLOSED

snare avatar snare commented on May 8, 2024
Problem with gdbinit

from voltron.

Comments (15)

gpakosz avatar gpakosz commented on May 8, 2024 2

Well I wasn't sure about opening an issue. The fact that you mentioned again GDB is linked against the system Python made me realize reinstalling it with brew install gdb --with-python rebuilds it and links it against brew's Python.

So it's all good now, and people may find that comment in the current issue.

from voltron.

huawenyu avatar huawenyu commented on May 8, 2024 1

@defau1t Although past one more years, I meet the same problem ''No module named blessed" and found that's python version problem.

1). The error cause by the python version:

  • Show Ubuntu 14.04 publish the gdb with python3-interface
$ gdb
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.

warning: ~/.gdbinit.local: No such file or directory
Exception <class 'ImportError'> raised while loading Voltron: No module named 'blessed'
/home/wilson/.gdbinit:3834: Error in sourced command file:
Undefined command: "voltron".  Try "help".
(gdb) python-interactive
>>> import sys
>>> print sys.version
  File "<stdin>", line 1
    print sys.version
            ^
SyntaxError: Missing parentheses in call to 'print'
>>> import blessed
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'blessed'
>>> print(sys.version)                                                                                                                  
3.4.3 (default, Oct 14 2015, 20:31:36) 
[GCC 4.8.4]
>>> 
(gdb) quit

2). So we should change the setup steps a little:

  • For gdb use python3, so we should install module by pip3, not pip
cd <your-work-dir>
git clone https://github.com/snare/voltron.git
cd voltron
sudo pip3 install flask          <<< used by next voltron setup
sudo python3 setup.py install
sudo pip3 install blessed        <<< used by voltron/dbgentry.py
  1. If voltron view backtrace have connect error, please refer the comment #97.

from voltron.

snare avatar snare commented on May 8, 2024

Hey, that's fine this is definitely the right place :)

There've been issues in the past on Linux with GDB being linked against Python 3.x but the first Python executable in the path being 2.7. So that could be it: #53 (comment)

  1. Make sure blessed is installed (it should have been installed by the setup script):

    $ pip install blessed

  2. Make sure it's accessible from a regular python REPL:

$ python
>>> import sys
>>> print sys.version
2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
>>> import blessed
>>>
  1. See if it's accessible from a script within GDB:
$ gdb
(gdb) python-interactive
>>> import sys
>>> print sys.version
2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]
>>> import blessed
>>>
  1. If #3 fails and the versions are different, try what I suggested in the issue linked above.

from voltron.

defau1t avatar defau1t commented on May 8, 2024

I had already tried the steps you wrote in that post, but I couldn't get lib64readline6-dev installed.

apt tells me there is no such package.

I was able to install everything else in that line, then I changed all the "except EXCEPTION_NAME, e" to "except blahblah as e".

Now the variable named "dereference_response" has a syntax error where it's assigned. Second problem is that "east_asian_width_properties" also has a syntax error. Any ideas?

from voltron.

snare avatar snare commented on May 8, 2024

Can you paste the exact errors?

dereference_response is only used in tests, so you could find that line and comment it out without it causing a problem.

from voltron.

defau1t avatar defau1t commented on May 8, 2024

Here's the first error:

File "/usr/local/lib/python3.2/dist-packages/voltron-0.1-py3.2.egg/tests/common.py", line 71
dereference_response = [[u'pointer', 140734748778168], [u'pointer', 140735677462013], [u'symbol', u'start + 0x1']]
                                      ^
SyntaxError: invalid syntax

The second one is a little longer.....

Traceback (most recent call last):
File "setup.py", line 21, in <module>
dependency_links = ["https://github.com/snarez/scruffy/tarball/master#egg=scruffy"]
File "/usr/lib/python3.2/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.2/distutils/dist.py", line 917, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 73, in run
self.do_egg_install()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 101, in do_egg_install
cmd.run()
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 368, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 588, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 640, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 692, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 576, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 822, in best_match
return self.obtain(req, installer) # try and download/install
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 834, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 608, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 638, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 828, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1105, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1094, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 31, in run_setup
lambda: exec(compile(open(
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 73, in run
return func()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 33, in <lambda>
).read(), "setup.py", 'exec'),
File "setup.py", line 122
east_asian_width_properties=(u'W', u'F',)):
                                ^
SyntaxError: invalid syntax

from voltron.

snare avatar snare commented on May 8, 2024

I can't reproduce the first error on Python 3.4, no idea what's causing that. I'd say just comment that one out and I'll figure it out if it becomes a problem again.

The second one - when is this error occurring? When Voltron is loaded into the debugger or when you're trying to install the package? Maybe try pip install distribute (ensuring you use whatever pip instance is appropriate for the Python instance in question) to install distribute instead of the regular setuptools.

Also you can just install Scruffy manually if that's what's causing the problem.

from voltron.

defau1t avatar defau1t commented on May 8, 2024

Both errors occur when I'm trying to install it. I already installed scruffy, installing distribute says it already exists.

Commenting out the first one removes the error, and I have no idea where to find that second one.

from voltron.

snare avatar snare commented on May 8, 2024

Make sure you install the v0.1 tagged version of scruffy from my github, not the one in PyPi (that's a different project, not mine). I made some recent changes that are currently incompatible with Voltron and changed Voltron's setup.py to reference the tagged version.

If you've got the right Scruffy installed OK just remove it from dependencies in setup.py (and the dependency link). setuptools is such a giant pain in the arse.

from voltron.

defau1t avatar defau1t commented on May 8, 2024

Okay I'm going to recreate my AWS image, might as well restart from scratch. I'll follow what you suggested and get back to you tomorrow. Thanks so much for the help.

from voltron.

snare avatar snare commented on May 8, 2024

No worries. Good luck!

from voltron.

defau1t avatar defau1t commented on May 8, 2024

This renewed my interest in this project. It loads properly now! Just have that connect issue but will comment in that thread. Thanks @huawenyu !

from voltron.

snare avatar snare commented on May 8, 2024

https://github.com/snare/voltron/wiki/Voltron-on-Ubuntu-with-GDB

from voltron.

gpakosz avatar gpakosz commented on May 8, 2024

I'm facing the problem on OSX

I have Python 2.7.11 installed via brew but Apple's Python is 2.7.10.
I installed gdb 7.11 also via brew.

When I launch /usr/local/bin/gdb and I print sys.version, I get back 2.7.10.
Now I don't really know how to make this gdb use brew's python despite usr/local/sbin coming first in path:

(gdb) path
Executable and object file path: /usr/local/bin:/usr/local/sbin:/usr/local/opt/ruby/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/sbin:/usr/local/opt/ruby/bin

from voltron.

snare avatar snare commented on May 8, 2024

Can you open a new issue please? Since GDB is linked against the system Python you're probably best just to install Voltron into the system Python.

from voltron.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.