From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19600 invoked by alias); 18 Sep 2013 13:17:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 19568 invoked by uid 89); 18 Sep 2013 13:17:33 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2013 13:17:33 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8IDHVgU003626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Sep 2013 09:17:31 -0400 Received: from localhost.localdomain (ovpn-112-31.ams2.redhat.com [10.36.112.31]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r8IDHUL0011169 for ; Wed, 18 Sep 2013 09:17:30 -0400 Message-ID: <5239A7E9.8010202@redhat.com> Date: Wed, 18 Sep 2013 13:17:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: [patch][python] Fix python/14513 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00584.txt.bz2 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 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);