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
Boxiang Sun
cython
Commits
3c930a48
Commit
3c930a48
authored
Nov 10, 2010
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documented parameters and added 'cy print' example
parent
dc04ede1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
2 deletions
+72
-2
src/userguide/debugging.rst
src/userguide/debugging.rst
+72
-2
No files found.
src/userguide/debugging.rst
View file @
3c930a48
...
...
@@ -142,8 +142,18 @@ of these commands are analogous to their respective gdb command.
.. function:: cy print varname
Print a local or global Cython, Python or C variable (depending on the
context).
context). Variables may also be dereferenced::
(gdb) cy print x
x = 1
(gdb) cy print *x
*x = (PyObject) {
_ob_next = 0x93efd8,
_ob_prev = 0x93ef88,
ob_refcnt = 65,
ob_type = 0x83a3e0
}
.. function:: cy list
List the source code surrounding the current line.
...
...
@@ -158,3 +168,63 @@ of these commands are analogous to their respective gdb command.
Import debug information from files given as arguments. The easiest way to
import debug information is to use the cygdb command line tool.
Convenience functions
=====================
The following functions are gdb functions, which means they can be used in a
gdb expression.
.. function:: cy_cname(varname)
Returns the C variable name of a Cython variable. For global
variables this may not be actually valid.
.. function:: cy_cvalue(varname)
Returns the value of a Cython variable.
.. function:: cy_lineno()
Returns the current line number in the selected Cython frame.
Example::
(gdb) print $cy_cname("
x
")
$1 = "
__pyx_v_x
"
(gdb) watch $cy_cvalue("
x
")
Hardware watchpoint 13: $cy_cvalue("
x
")
(gdb) print $cy_lineno()
$2 = 12
Configuring the Debugger
========================
A few aspects of the debugger are configurable with gdb parameters. For
instance, colors can be disabled, the terminal background color
and breakpoint autocompletion can be configured.
.. c:macro:: cy_complete_unqualified
Tells the Cython debugger whether ``cy break`` should also complete
plain function names, i.e. not prefixed by their module name.
E.g. if you have a function named ``spam``,
in module ``M``, it tells whether to only complete ``M.spam`` or also just
``spam``.
The default is true.
.. c:macro:: cy_colorize_code
Tells the debugger whether to colorize source code. The default is true.
.. c:macro:: cy_terminal_background_color
Tells the debugger about the terminal background color, which affects
source code coloring. The default is "
dark
", another valid option is
"
light
".
This is how these parameters can be used::
(gdb) set cy_complete_unqualified off
(gdb) set cy_terminal_background_color light
(gdb) show cy_colorize_code
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