This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch][python] Fix python/14513


This patch fixes a bug for silent parameters that do not print anything
when a parameter is set.  Currently if a parameter is silent, a
newline will be erroneously outputted.

E.g.

(gdb) set extended-prompt (New Prompt)

(New Prompt)

Parameters normally report what the value has been set too:

(gdb) set foobar 5
foobar has been set to 5.

This patch just checks the string length of the output string before
printing it.

OK?

Cheers,

Phil

2013-09-18  Phil Muldoon  <pmuldoon@redhat.com>

        PR python/14513

	* python/py-param.c (get_set_value): Check doc_string length
	before outputting to console.

--

diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c
index 9f56c3a..921acae 100644
--- a/gdb/python/py-param.c
+++ b/gdb/python/py-param.c
@@ -389,7 +389,9 @@ get_set_value (char *args, int from_tty,
     }
 
   make_cleanup (xfree, set_doc_string);
-  fprintf_filtered (gdb_stdout, "%s\n", set_doc_string);
+
+  if (strlen (set_doc_string) > 0)
+    fprintf_filtered (gdb_stdout, "%s\n", set_doc_string);
 
   Py_XDECREF (set_doc_func);
   do_cleanups (cleanup);

	


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]