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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
8a10a7ea
Commit
8a10a7ea
authored
Sep 19, 2010
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cygdb script in setup.py (posix and windows)
parent
f88e64b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
50 deletions
+17
-50
bin/cygdb
bin/cygdb
+5
-48
cygdb.py
cygdb.py
+10
-0
setup.py
setup.py
+2
-2
No files found.
bin/cygdb
View file @
8a10a7ea
#!/usr/bin/env python
"""
The Cython debugger
The current directory should contain a directory named 'cython_debug', or a
path to the cython project directory should be given (the parent directory of
cython_debug).
"""
import
os
import
sys
import
glob
import
tempfile
import
subprocess
def
main
(
import_libpython
=
False
,
path_to_debug_info
=
os
.
curdir
):
"""
Start the Cython debugger. This tells gdb to import the Cython and Python
extensions (libpython.py and libcython.py) and it enables gdb's pending
breakpoints
"""
debug_files
=
glob
.
glob
(
os
.
path
.
join
(
os
.
curdir
,
'cython_debug/cython_debug_info_*'
))
if
not
debug_files
:
sys
.
exit
(
'No debug files were found in the current directory. '
'Aborting.'
)
fd
,
tempfilename
=
tempfile
.
mkstemp
()
f
=
os
.
fdopen
(
fd
,
'w'
)
f
.
write
(
'set breakpoint pending on
\
n
'
)
f
.
write
(
'python from Cython.Debugger import libcython
\
n
'
)
if
import_libpython
:
f
.
write
(
'python import libpython'
)
else
:
f
.
write
(
'python from Cython.Debugger import libpython
\
n
'
)
f
.
write
(
'
\
n
'
.
join
(
'cy import %s
\
n
'
%
fn
for
fn
in
debug_files
))
f
.
close
()
p
=
subprocess
.
Popen
([
'gdb'
,
'-command'
,
tempfilename
])
while
True
:
try
:
p
.
wait
()
except
KeyboardInterrupt
:
pass
else
:
break
os
.
remove
(
tempfilename
)
from
Cython.Debugger
import
cygdb
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
if
len
(
sys
.
argv
)
>
1
:
cygdb
.
main
(
path_to_debug_info
=
sys
.
argv
[
1
])
else
:
cygdb
.
main
()
\ No newline at end of file
cygdb.py
0 → 100644
View file @
8a10a7ea
#!/usr/bin/env python
import
sys
from
Cython.Debugger
import
cygdb
if
__name__
==
'__main__'
:
if
len
(
sys
.
argv
)
>
1
:
cygdb
.
main
(
path_to_debug_info
=
sys
.
argv
[
1
])
else
:
cygdb
.
main
()
\ No newline at end of file
setup.py
View file @
8a10a7ea
...
...
@@ -80,9 +80,9 @@ if 'setuptools' in sys.modules:
scripts
=
[]
else
:
if
os
.
name
==
"posix"
:
scripts
=
[
"bin/cython"
]
scripts
=
[
"bin/cython"
,
"bin/cygdb"
]
else
:
scripts
=
[
"cython.py"
]
scripts
=
[
"cython.py"
,
"cygdb.py"
]
def
compile_cython_modules
(
profile
=
False
):
source_root
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
...
...
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