Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [patch][python] Fix python/14513
Date: Wed, 18 Sep 2013 13:17:00 -0000	[thread overview]
Message-ID: <5239A7E9.8010202@redhat.com> (raw)


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);

	


             reply	other threads:[~2013-09-18 13:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18 13:17 Phil Muldoon [this message]
2013-09-18 20:26 ` Tom Tromey
2013-09-18 20:34   ` Phil Muldoon
2013-09-18 20:40     ` Tom Tromey
2013-10-02  9:30       ` Phil Muldoon
2013-10-21 21:58         ` Tom Tromey
2013-10-30  9:01           ` Phil Muldoon
2013-11-08  3:18             ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5239A7E9.8010202@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox