From 8f1e30513b8dd19ef2a82f4759bd5bc7fe5ccf87 Mon Sep 17 00:00:00 2001 From: Mark Florisson Date: Sat, 26 Mar 2011 15:36:26 +0100 Subject: [PATCH] Debugger: Better output when halting on watchpoints --- Cython/Debugger/libpython.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Cython/Debugger/libpython.py b/Cython/Debugger/libpython.py index 43e15e10..02250fc7 100644 --- a/Cython/Debugger/libpython.py +++ b/Cython/Debugger/libpython.py @@ -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): """ -- 2.26.2