Skip local variables that are optimized out for 'cy exec' (in case user didn't build...
authorMark Florisson <markflorisson88@gmail.com>
Tue, 16 Nov 2010 12:45:45 +0000 (13:45 +0100)
committerMark Florisson <markflorisson88@gmail.com>
Tue, 16 Nov 2010 12:45:45 +0000 (13:45 +0100)
Cython/Debugger/libcython.py

index a781bcf0bf76e3e9d0921593ec09cde66213756e..32f26b7691f6fffe4c177b739f4a3554f8a6b7a8 100644 (file)
@@ -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(