Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
91473013
Commit
91473013
authored
May 18, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
activate virtualenv inside of cygdb if it was enabled outside
parent
369b75e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
CHANGES.rst
CHANGES.rst
+3
-0
Cython/Debugger/Cygdb.py
Cython/Debugger/Cygdb.py
+20
-3
No files found.
CHANGES.rst
View file @
91473013
...
@@ -9,6 +9,9 @@ Latest
...
@@ -9,6 +9,9 @@ Latest
Features added
Features added
--------------
--------------
* When cygdb is run in a virtualenv, it enables the same virtualenv
inside of the debugger. Patch by Marc Abramowitz.
* PEP 465: dedicated infix operator for matrix multiplication (A @ B).
* PEP 465: dedicated infix operator for matrix multiplication (A @ B).
* HTML output of annotated code uses Pygments for code highlighting
* HTML output of annotated code uses Pygments for code highlighting
...
...
Cython/Debugger/Cygdb.py
View file @
91473013
...
@@ -37,9 +37,26 @@ def make_command_file(path_to_debug_info, prefix_code='', no_import=False):
...
@@ -37,9 +37,26 @@ def make_command_file(path_to_debug_info, prefix_code='', no_import=False):
f
=
os
.
fdopen
(
fd
,
'w'
)
f
=
os
.
fdopen
(
fd
,
'w'
)
try
:
try
:
f
.
write
(
prefix_code
)
f
.
write
(
prefix_code
)
f
.
write
(
'set breakpoint pending on
\
n
'
)
f
.
write
(
textwrap
.
dedent
(
'''
\
f
.
write
(
"set print pretty on
\
n
"
)
# This is a gdb command file
f
.
write
(
'python from Cython.Debugger import libcython, libpython
\
n
'
)
# See https://sourceware.org/gdb/onlinedocs/gdb/Command-Files.html
set breakpoint pending on
set print pretty on
python
# Activate virtualenv, if we were launched from one
import os
virtualenv = os.getenv('VIRTUAL_ENV')
if virtualenv:
path_to_activate_this_py = os.path.join(virtualenv, 'bin', 'activate_this.py')
print("gdb command file: Activating virtualenv: %s; path_to_activate_this_py: %s"
% (virtualenv, path_to_activate_this_py,))
execfile(path_to_activate_this_py, dict(__file__=path_to_activate_this_py))
from Cython.Debugger import libcython, libpython
end
'''
))
if
no_import
:
if
no_import
:
# don't do this, this overrides file command in .gdbinit
# don't do this, this overrides file command in .gdbinit
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment