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

gdb Python extensions not properly linked into new virtualenv #644

Closed
zbuc opened this issue Aug 28, 2014 · 6 comments
Closed

gdb Python extensions not properly linked into new virtualenv #644

zbuc opened this issue Aug 28, 2014 · 6 comments

Comments

@zbuc
Copy link

zbuc commented Aug 28, 2014

I was playing around with virtualenv and gdb for debugging Python apps(that call out to some C libraries I wanted to inspect).

System:

$ virtualenv --version
1.11.4
$ uname -a
Linux virtual-machine 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ /usr/bin/python2.7-dbg --version
Python 2.7.6
$ gdb --version
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7

Setup of virtual environment:

$ virtualenv -p /usr/bin/python2.7-dbg debugenv
$ source debugenv/bin/activate

Testing gdb Python extended commands(fails):

(debugenv)$ gdb --args python
(gdb) py-bt
Undefined command: "py-bt".  Try "help".

This person on StackOverflow had a solution posted:
http://stackoverflow.com/questions/22931774/how-to-use-gdb-python-debugging-extension-inside-virtualenv

(debugenv)$ ln -s /usr/lib/debug/usr/bin/python2.7-gdb.py /path/to/debugenv/bin/python2.7-dbg-gdb.py
(debugenv)$ gdb --args python
(gdb) py-bt
Python Exception <class 'gdb.error'> No frame is currently selected.: 
Error occurred in Python command: No frame is currently selected.

I'm not sure if this should be implemented in virtualenv itself if it detects a Python debug executable is being used, but this was slightly annoying/confusing to deal with and wanted to make the virtualenv team aware.

@delijati
Copy link

delijati commented Apr 9, 2015

Sweet i run into that same problem, thanks so far. If it doesn't hurt it should be added.

@loopmocker
Copy link

loopmocker commented Apr 28, 2018

I meet this error, when import libpython and use py-bt: "Error occurred in Python command: init() takes exactly 3 arguments (2 given)"

@davidalbertonogueira
Copy link

This is still an issue?

I got the same problem:

(gdb) py-list
Undefined command: "py-list"

@stale
Copy link

stale bot commented Jan 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 14, 2019
@xantoz
Copy link

xantoz commented Jan 21, 2019

Still a problem with python3.6-dbg on ubuntu 18.10

@gaborbernat
Copy link
Contributor

Seems no longer an issue as no one reported it in 3 years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants