Skip to content
Browse files

Document 'cy exec'

  • Loading branch information...
1 parent 4d8fd39 commit b011acd890698e2df9e162755bf634bf3326428c Mark Florisson committed Nov 13, 2010
Showing with 24 additions and 0 deletions.
  1. +24 −0 src/userguide/debugging.rst
24 src/userguide/debugging.rst
@@ -168,6 +168,30 @@ 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.
+.. function:: cy exec code
+
+ Execute code in the current Python or Cython frame. This works like
+ Python's interactive interpreter.
+
+ For Python frames it uses the globals and locals from the Python frame,
+ for Cython frames it uses the dict of globals used on the Cython module
+ and a new dict filled with the local Cython variables.
+
+.. note:: ``cy exec`` modifies state and executes code in the debuggee and is
+ therefore potentially dangerous.
+
+Example::
+
+ (gdb) cy exec x + 1
+ 2
+ (gdb) cy exec import sys; print sys.version_info
+ (2, 6, 5, 'final', 0)
+ (gdb) cy exec
+ >global foo
+ >
+ >foo = 'something'
+ >end
+
Convenience functions
=====================
The following functions are gdb functions, which means they can be used in a

0 comments on commit b011acd

Please sign in to comment.
Something went wrong with that request. Please try again.