* python.c (gdbpy_print_stack): Ensure output ends with a newline.
authorDoug Evans <dje@google.com>
Wed, 19 May 2010 23:32:24 +0000 (23:32 +0000)
committerDoug Evans <dje@google.com>
Wed, 19 May 2010 23:32:24 +0000 (23:32 +0000)
gdb/ChangeLog
gdb/python/python.c

index 0c827b945d958d1478bf3dcb4abb910a9f3368a6..5cba88b8c5569cef0250e1d8b6f781676eab48d7 100644 (file)
@@ -1,5 +1,7 @@
 2010-05-19  Doug Evans  <dje@google.com>
 
+       * python.c (gdbpy_print_stack): Ensure output ends with a newline.
+
        * python.c (source_python_script): Add comment.
        (source_python_script_for_objfile): Remove unnecessary call to
        gdbpy_print_stack.
index 9c1e8bd485b50c8a8f730ab8a1c8c0d57d4057e9..3110328ea0d9fb8ebee175524afa342596c7caf3 100644 (file)
@@ -416,7 +416,13 @@ void
 gdbpy_print_stack (void)
 {
   if (gdbpy_should_print_stack)
-    PyErr_Print ();
+    {
+      PyErr_Print ();
+      /* PyErr_Print doesn't necessarily end output with a newline.
+        This works because Python's stdout/stderr is fed through
+        printf_filtered.  */
+      begin_line ();
+    }
   else
     PyErr_Clear ();
 }