From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103454 invoked by alias); 2 May 2018 16:25:21 -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 103434 invoked by uid 89); 2 May 2018 16:25:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=Hx-languages-length:636 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 May 2018 16:25:05 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id D5CA71171FC; Wed, 2 May 2018 12:25:03 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9nLScUbINOZI; Wed, 2 May 2018 12:25:03 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id B00AF11726D; Wed, 2 May 2018 12:25:01 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 066F483055; Wed, 2 May 2018 09:25:00 -0700 (PDT) Date: Wed, 02 May 2018 16:25:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Handle var_zuinteger and var_zuinteger_unlimited from Python Message-ID: <20180502162459.pj4jzejpwopne32b@adacore.com> References: <20180426222003.9059-1-tom@tromey.com> <20180430215210.ngeru74jibhlgxul@adacore.com> <87wowm59hu.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wowm59hu.fsf@tromey.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2018-05/txt/msg00019.txt.bz2 > Yeah, that bit is really unclear in the patch, but clearer (IMO) in the > code: > > case var_uinteger: > if (l == 0) > l = UINT_MAX; > /* Fall through. */ > case var_zuinteger: > ok = (l >= 0 && l <= UINT_MAX); > break; That's also how I ended up reviewing the patch :). > Joel> One thought: How about testing the value of the setting after setting > Joel> its value to -1? > > I've added a test like so: > > gdb_test "python print(gdb.parameter('test-$kind'))" "-1" \ > "check that PARAM_ZUINTEGER value is -1 after setting" Looks good! Thanks Tom, -- Joel