From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2011 invoked by alias); 2 May 2018 16:05:06 -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 1996 invoked by uid 89); 2 May 2018 16:05:05 -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,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=brain, spend, H*RU:100.42.49.4, Hx-spam-relays-external:100.42.49.4 X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.50.71) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 May 2018 16:05:04 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 08CBEBD7B for ; Wed, 2 May 2018 11:05:03 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id DuFbfxTHE6il3DuFbfvdqn; Wed, 02 May 2018 11:05:03 -0500 X-Authority-Reason: nr=8 Received: from 97-122-176-117.hlrn.qwest.net ([97.122.176.117]:58450 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fDuFa-003HF3-Pa; Wed, 02 May 2018 11:05:02 -0500 From: Tom Tromey To: Joel Brobecker Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA] Handle var_zuinteger and var_zuinteger_unlimited from Python References: <20180426222003.9059-1-tom@tromey.com> <20180430215210.ngeru74jibhlgxul@adacore.com> Date: Wed, 02 May 2018 16:05:00 -0000 In-Reply-To: <20180430215210.ngeru74jibhlgxul@adacore.com> (Joel Brobecker's message of "Mon, 30 Apr 2018 14:52:10 -0700") Message-ID: <87wowm59hu.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fDuFa-003HF3-Pa X-Source-Sender: 97-122-176-117.hlrn.qwest.net (bapiya) [97.122.176.117]:58450 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2018-05/txt/msg00016.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> This patch looks good to me, and you can push as is. It was surprisingly Joel> harder to read (I picked this patch as a way to spend my time constructively, Joel> while I wait for a build to finish ;-)), in particular the part with Joel> the fall through in the case statement, but that's probably me having Joel> a slightly different type of brain... I managed to convince myself Joel> that the patch looks correct to me. 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; 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" Tom