From 8bc85fe298625d958dbe7ae4413abc370382f54f Mon Sep 17 00:00:00 2001 From: Mark Florisson Date: Tue, 16 Nov 2010 13:45:45 +0100 Subject: [PATCH] Skip local variables that are optimized out for 'cy exec' (in case user didn't build with Cython's build_ext) --- Cython/Debugger/libcython.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cython/Debugger/libcython.py b/Cython/Debugger/libcython.py index a781bcf0..32f26b76 100644 --- a/Cython/Debugger/libcython.py +++ b/Cython/Debugger/libcython.py @@ -1141,6 +1141,14 @@ class CyExec(CythonCommand, libpython.PyExec): if (cyvar.type == PythonObject and self.is_initialized(cython_func, name)): + try: + val = gdb.parse_and_eval(cyvar.cname) + except RuntimeError: + continue + else: + if val.is_optimized_out: + continue + pystringp = executor.alloc_pystring(name) code = ''' PyDict_SetItem( -- 2.26.2