From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42106 invoked by alias); 30 Apr 2018 13:01:48 -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 42095 invoked by uid 89); 30 Apr 2018 13:01:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=respective, State X-HELO: mail-wr0-f180.google.com Received: from mail-wr0-f180.google.com (HELO mail-wr0-f180.google.com) (209.85.128.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Apr 2018 13:01:46 +0000 Received: by mail-wr0-f180.google.com with SMTP id v5-v6so7964767wrf.9 for ; Mon, 30 Apr 2018 06:01:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ffORPByF0hc9IoN/gVyCH9jqQl3jsIph9FHI9Nmljyw=; b=BSNbT+MYBnPNfFi32gwxbdRYM+3VUuFlZwcIU94gKrFga30vsLbmNMUGmi/6fFu06T JjuHVrM9EZSR1uURcTc+GDxG3peISdcNffXNqHu40MsD4S8oImgNA5s4qtrzjr0KP9d+ rfAnlgj4iJkj72JL6sN5slXut3iWok7rUag3YCBfvCYLiEWhYrx/3olgOHROSPQoNTDC MK/Pcq2w6fFYDR/ixJeFFJ2xZfzP8EN4P46vttNx70PTZ7GEif/4QgTStRTe3825aSuT WiLcJGOcGjo5OU4QLxv0ynQxhv8NJjVkqEzLwnRxG46FHKpNJXb8SXGhQO46h4cRehBr 3dRQ== X-Gm-Message-State: ALQs6tBj61jSVu8+wEmz15FcKKq7+T0Ic12404DDlnk9ZDZasiSB8D+b GiKHElTgrsvWsH8MlP8+ivLuAVuguUQ= X-Google-Smtp-Source: AB8JxZq4PAiTFyMQ1JTRCsXuoNbVkuf1Z6zVTnTNvdz7PT+8FiEzJi/h27nQ52lL/eehTo+ry+li4w== X-Received: by 2002:adf:aa04:: with SMTP id p4-v6mr8115971wrd.226.1525093303958; Mon, 30 Apr 2018 06:01:43 -0700 (PDT) Received: from ?IPv6:2a02:c7f:ae6a:ed00:4685:ff:fe66:9f4? ([2a02:c7f:ae6a:ed00:4685:ff:fe66:9f4]) by smtp.gmail.com with ESMTPSA id m16sm11473637wmb.42.2018.04.30.06.01.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Apr 2018 06:01:43 -0700 (PDT) Subject: Re: [RFA] Fix "set" handling of Python parameters To: Tom Tromey , gdb-patches@sourceware.org References: <20180426225140.18640-1-tom@tromey.com> From: Phil Muldoon Message-ID: <378a36ea-d6fa-e0c0-e264-bb977e71b2cf@redhat.com> Date: Mon, 30 Apr 2018 13:01:00 -0000 MIME-Version: 1.0 In-Reply-To: <20180426225140.18640-1-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00619.txt.bz2 On 26/04/18 23:51, Tom Tromey wrote: > diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c > index 0f8d9b6b42..77311ad1bd 100644 > --- a/gdb/python/py-param.c > +++ b/gdb/python/py-param.c > @@ -381,15 +381,10 @@ get_set_value (const char *args, int from_tty, > return; > } > } > - else > - { > - /* We have to preserve the existing < GDB 7.3 API. If a > - callback function does not exist, then attempt to read the > - set_doc attribute. */ > - set_doc_string = get_doc_string (obj, set_doc_cst); > - } > > - fprintf_filtered (gdb_stdout, "%s\n", set_doc_string.get ()); > + const char *str = set_doc_string.get (); > + if (str != nullptr && str[0] != '\0') > + fprintf_filtered (gdb_stdout, "%s\n", str); > } > > /* A callback function that is registered against the respective > diff --git a/gdb/testsuite/gdb.python/py-parameter.exp b/gdb/testsuite/gdb.python/py-parameter.exp > index 3cd1198462..f52d737dbc 100644 > --- a/gdb/testsuite/gdb.python/py-parameter.exp > +++ b/gdb/testsuite/gdb.python/py-parameter.exp > @@ -151,7 +151,7 @@ gdb_py_test_multiple "Simple gdb booleanparameter" \ > "end" > > gdb_test "show print test-nodoc-param" "This command is not documented.*" "show parameter on" > -gdb_test "set print test-nodoc-param off" "This command is not documented.*" "turn off parameter" > +gdb_test_no_output "set print test-nodoc-param off" "turn off parameter" > gdb_test "show print test-nodoc-param" "This command is not documented.*.*" "show parameter off" > gdb_test "python print (test_nodoc_param.value)" "False" "test parameter value" > gdb_test "help show print test-nodoc-param" "This command is not documented.*" "test show help" > @@ -173,7 +173,7 @@ gdb_py_test_multiple "Simple gdb booleanparameter" \ > > gdb_test "python print (test_param.value)" "True" "test parameter value" > gdb_test "show print test-param" "State of the Test Parameter on.*" "show parameter on" > -gdb_test "set print test-param off" "Set the state of the Test Parameter.*" "turn off parameter" > +gdb_test_no_output "set print test-param off" "turn off parameter" > gdb_test "show print test-param" "State of the Test Parameter off.*" "show parameter off" > gdb_test "python print (test_param.value)" "False" "test parameter value" > gdb_test "help show print test-param" "State of the Test Parameter.*" "test show help" I have no comments other than I read the patch and it LGTM. Cheers Phil