Debugger: Better output when halting on watchpoints
authorMark Florisson <markflorisson88@gmail.com>
Sat, 26 Mar 2011 14:36:26 +0000 (15:36 +0100)
committerMark Florisson <markflorisson88@gmail.com>
Sat, 26 Mar 2011 14:36:26 +0000 (15:36 +0100)
Cython/Debugger/libpython.py

index 43e15e1061f383614b30bfbeff0bd36b8e2dc07f..02250fc71e875d2a9c4cb5eb4229488e3199e7ad 100644 (file)
@@ -1961,11 +1961,11 @@ class ExecutionControlCommandBase(gdb.Command):
             (r'^Program received signal .*', reflags|re.DOTALL),
             (r'.*[Ww]arning.*', 0),
             (r'^Program exited .*', reflags),
+            (r'^(Old|New) value = .*', reflags)
         ]
 
         for regex, flags in regexes:
-            match = re.search(regex, result, flags)
-            if match:
+            for match in re.finditer(regex, result, flags):
                 output.append(match.group(0))
 
         return '\n'.join(output)
@@ -1985,13 +1985,17 @@ class ExecutionControlCommandBase(gdb.Command):
             print result.strip()
         else:
             frame = gdb.selected_frame()
+            source_line = self.lang_info.get_source_line(frame)
             if self.lang_info.is_relevant_function(frame):
                 raised_exception = self.lang_info.exc_info(frame)
                 if raised_exception:
                     print raised_exception
-                print self.lang_info.get_source_line(frame) or result
+                print source_line or result
             else:
-                print result
+                if result.rstrip():
+                    print result.rstrip()
+                if source_line:
+                    print source_line
 
     def _finish(self):
         """