Friendly error if no Cython or Python stack is there and inferior is running
authorMark Florisson <eggy.nospam@gmail.com>
Sat, 13 Nov 2010 00:45:37 +0000 (01:45 +0100)
committerMark Florisson <eggy.nospam@gmail.com>
Sat, 13 Nov 2010 00:45:37 +0000 (01:45 +0100)
Cython/Debugger/libpython.py

index c4173b647070075fb4e5480f7b2e0e81f375e377..67ec163edce9f086e680d95ba79d11b54b0a389b 100644 (file)
@@ -1980,7 +1980,7 @@ class PythonCodeExecutor(object):
         globalsp = pointervalue(global_dict)
         localsp = pointervalue(local_dict)
         
-        if globalp == 0 or localp == 0:
+        if globalsp == 0 or localsp == 0:
             raise gdb.GdbError("Unable to obtain or create locals or globals.")
         
         code = """
@@ -2058,7 +2058,8 @@ class FixGdbCommand(gdb.Command):
     
         Program exited normally.
         """
-        warnings.filterwarnings('ignore', r'.*', RuntimeWarning, re.escape(__name__))
+        warnings.filterwarnings('ignore', r'.*', RuntimeWarning, 
+                                re.escape(__name__))
         try:
             long(gdb.parse_and_eval("(void *) 0")) == 0
         except RuntimeError:
@@ -2067,7 +2068,10 @@ class FixGdbCommand(gdb.Command):
     
     def invoke(self, args, from_tty):
         self.fix_gdb()
-        gdb.execute('%s %s' % (self.actual_command, args))
+        try:
+            gdb.execute('%s %s' % (self.actual_command, args))
+        except RuntimeError, e:
+            raise gdb.GdbError(str(e))
         self.fix_gdb()