From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28649 invoked by alias); 4 Mar 2013 13:19:58 -0000 Received: (qmail 28355 invoked by uid 22791); 4 Mar 2013 13:19:55 -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 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; Mon, 04 Mar 2013 13:19:46 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r24DJiEI025034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 4 Mar 2013 08:19:44 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r24DJgGM012732; Mon, 4 Mar 2013 08:19:43 -0500 Message-ID: <51349F6E.8020101@redhat.com> Date: Mon, 04 Mar 2013 13:19:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH 1/2] use zuinteger_unlimited for some remote commands References: <1360934868-5807-1-git-send-email-yao@codesourcery.com> <1360934868-5807-2-git-send-email-yao@codesourcery.com> In-Reply-To: <1360934868-5807-2-git-send-email-yao@codesourcery.com> 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/msg00082.txt.bz2 On 02/15/2013 01:27 PM, Yao Qi wrote: > -int remote_hw_watchpoint_limit = -1; > -int remote_hw_watchpoint_length_limit = -1; > -int remote_hw_breakpoint_limit = -1; > +static unsigned int remote_hw_watchpoint_limit = UINT_MAX; > +static unsigned int remote_hw_watchpoint_length_limit = UINT_MAX; > +static unsigned int remote_hw_breakpoint_limit = UINT_MAX; ... > @@ -8259,7 +8255,7 @@ remote_check_watch_resources (int type, int cnt, int ot) > { > if (remote_hw_watchpoint_limit == 0) > return 0; > - else if (remote_hw_watchpoint_limit < 0) > + else if (remote_hw_watchpoint_limit == UINT_MAX) This made me notice something with var_zuinteger_unlimited. What's the point of making it work with unsigned variables, and UINT_MAX, if the contents of the variable are actually treated as int everywhere in cli-setshow.c? (and val is still cut at INT_MAX). Vis, e.g., case var_zuinteger_unlimited: { LONGEST val; if (arg == NULL) error_no_arg (_("integer to set it to.")); val = parse_and_eval_long (arg); if (val >= INT_MAX) error (_("integer %s out of range"), plongest (val)); else if (val < -1) error (_("only -1 is allowed to set as unlimited")); if (*(int *) c->var != val) { *(int *) c->var = val; option_changed = 1; } If reads like cli-setshow.c's handling of var_zuinteger_unlimited was never fully finished? -- Pedro Alves