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
Gwenaël Samain
cython
Commits
278a4440
Commit
278a4440
authored
May 30, 2013
by
Mark Florisson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #237 from anotherthomas/master
added an option to set the gdb executable
parents
adbe80ea
60dff160
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
Cython/Debugger/Cygdb.py
Cython/Debugger/Cygdb.py
+13
-6
No files found.
Cython/Debugger/Cygdb.py
View file @
278a4440
...
...
@@ -17,8 +17,7 @@ import glob
import
tempfile
import
textwrap
import
subprocess
usage
=
"Usage: cygdb [PATH [GDB_ARGUMENTS]]"
import
optparse
def
make_command_file
(
path_to_debug_info
,
prefix_code
=
''
,
no_import
=
False
):
if
not
no_import
:
...
...
@@ -63,6 +62,8 @@ def make_command_file(path_to_debug_info, prefix_code='', no_import=False):
return
tempfilename
usage
=
"Usage: cygdb [options] [PATH [GDB_ARGUMENTS]]"
def
main
(
path_to_debug_info
=
None
,
gdb_argv
=
None
,
no_import
=
False
):
"""
Start the Cython debugger. This tells gdb to import the Cython and Python
...
...
@@ -73,20 +74,26 @@ def main(path_to_debug_info=None, gdb_argv=None, no_import=False):
gdb_argv is the list of options to gdb
no_import tells cygdb whether it should import debug information
"""
parser
=
optparse
.
OptionParser
(
usage
=
usage
)
parser
.
add_option
(
"--gdb-executable"
,
dest
=
"gdb"
,
default
=
'gdb'
,
help
=
"gdb executable to use [default: gdb]"
)
(
options
,
args
)
=
parser
.
parse_args
()
if
path_to_debug_info
is
None
:
if
len
(
sys
.
argv
)
>
1
:
path_to_debug_info
=
sys
.
argv
[
1
]
if
len
(
args
)
>
1
:
path_to_debug_info
=
args
[
1
]
else
:
path_to_debug_info
=
os
.
curdir
if
gdb_argv
is
None
:
gdb_argv
=
sys
.
argv
[
2
:]
gdb_argv
=
args
[
2
:]
if
path_to_debug_info
==
'--'
:
no_import
=
True
tempfilename
=
make_command_file
(
path_to_debug_info
,
no_import
=
no_import
)
p
=
subprocess
.
Popen
([
'gdb'
,
'-command'
,
tempfilename
]
+
gdb_argv
)
p
=
subprocess
.
Popen
([
options
.
gdb
,
'-command'
,
tempfilename
]
+
gdb_argv
)
while
True
:
try
:
p
.
wait
()
...
...
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