From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12108 invoked by alias); 1 Mar 2013 18:13:39 -0000 Received: (qmail 12087 invoked by uid 22791); 1 Mar 2013 18:13:38 -0000 X-SWARE-Spam-Status: No, hits=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_XF X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Mar 2013 18:13:29 +0000 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 r21IDPfM024210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Mar 2013 13:13:25 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r21IDLJk026816; Fri, 1 Mar 2013 13:13:23 -0500 Message-ID: <5130EFC1.3090102@redhat.com> Date: Fri, 01 Mar 2013 18:13:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: "Abid, Hafiz" CC: gdb-patches@sourceware.org, stan@codesourcery.com, yao@codesourcery.com, eliz@gnu.org Subject: zinteger setshow commands broken References: <1362157623.18212.0@abidh-ubunto1104> In-Reply-To: <1362157623.18212.0@abidh-ubunto1104> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2013-03/txt/msg00033.txt.bz2 On 03/01/2013 05:07 PM, Abid, Hafiz wrote: >> >> >> Should probably be a LONGEST too. There's to reason to >> actually limit to 31-bits, right? >> >> > + add_setshow_zinteger_cmd ("trace-buffer-size", no_class, >> > + &trace_buffer_size, _("\ >> >> Oh, I see... add_setshow_zinteger_cmd works with int... > Observed that commands added with add_setshow_zinteger_cmd have problem with -1. For var_zinteger, do_set_command uses unsigned int and it ends up comparing 0xffffffff to INT_MAX. If it sounds like an oversight to you then I will send a patch. Here are those lines for a quick look. > unsigned int val; > ... > val = parse_and_eval_long (arg); > ... > else if (val >= INT_MAX) > error (_("integer %u out of range"), val); > Eh, indeed. Sounds like a regression. We have other commands where -1 is treated specially: (gdb) help set remote hardware-watchpoint-limit Set the maximum number of target hardware watchpoints. Specify a negative limit for unlimited. (gdb) set remote hardware-watchpoint-limit -1 integer 4294967295 out of range This surely worked at some point. BTW, I think the new var_zuinteger_unlimited would be more suitable. The difference is that "show" really shows "unlimited" instead of -1. BTW2, IMO, "set" should accept literal "unlimited" string as well too. -- Pedro Alves