From 0bf0f8c4cd47073fe38adb1053787fe10d66b5d3 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Wed, 19 May 2010 23:32:24 +0000 Subject: [PATCH] * python.c (gdbpy_print_stack): Ensure output ends with a newline. --- gdb/ChangeLog | 2 ++ gdb/python/python.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0c827b945d9..5cba88b8c55 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2010-05-19 Doug Evans + * 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. diff --git a/gdb/python/python.c b/gdb/python/python.c index 9c1e8bd485b..3110328ea0d 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -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 (); } -- 2.30.2