From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id 8FB1F3856DF8 for ; Fri, 21 Oct 2022 08:03:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8FB1F3856DF8 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-lj1-x229.google.com with SMTP id x18so2688842ljm.1 for ; Fri, 21 Oct 2022 01:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=qkyjgt2raq4vmBqzdsUZiyaY2ZhqMFquA/tqNpWSZHA=; b=T8jVGdab9bXl2sUTzGIDMRsozgBs0FONbOi/XCMOezhSuIoe06WNIiW/roBGvqNB+w qgWBxAtCaq9PRBjeODrHffoyxojZomBL3lC5F5CnSczbmrlcsmkGCiX4x6EqzZ92fnj9 d9qusrHe2Ri9YKvjO5SvGvEBRJonRz3phN8rpABIFefDIndUNn1OXBBX6TKPOKaGKhyU 33DjoXhpWyW0UrzljK9wck0yXX5lRfPmwHm2BlZd7G1N2FJX4YQ/qvYccfcOJMre9s0l JN5sMIwmhRu/v2M8gYDoSCjMO0jHMATDY+yqqOYJcpP9NSYMdrWtAjKRjmmdob44rIo9 KguA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qkyjgt2raq4vmBqzdsUZiyaY2ZhqMFquA/tqNpWSZHA=; b=jxA3bBRiqDuwltrxyMiGMUfMctwDFctdHYayyWDl/YkbZ2OSO0gxoKWna3dmSkgxeh 7aMaEp9OUpPANBV2Qh+55RVP6TEBjFFaK4tmyPh+tOOlPMacGLAlSTxoOW4Q9FkNqVHh DacBu4DeezA+sey4dV08YPAdnzFZI+OS1Xww6kKF4G3qOUPmSNNyMcOCzm2tyQzAmaHp MLbWpZ8H4XccMRJkQ/jy8fH4m0jYR4XaXKSVV/oUV4T3Z9Xa1j5RnVZEKUJP2eZHlxRb et7aYHoBjlr5ZplkKaoFVWEc7W+RdJfP+DOeN3Wfw2NBO2Dq1/JB7HZwVoga1FK5bSNm as2Q== X-Gm-Message-State: ACrzQf1z4JstZw9qlZQ6BB+zfl6kDxFxoTmDjn3Hd14JCZa43l9V7zCl v+HXbhSeOo1k1v2ImKgfcUJFaQ== X-Google-Smtp-Source: AMsMyM7ri5MXDfoqnbIXIa+Tn+4QyivDZjN/DUqR5kP/dmXxNma5zlcbNnebH4ojaMSSDkYq0tdsAg== X-Received: by 2002:a2e:940f:0:b0:26f:c160:6ddc with SMTP id i15-20020a2e940f000000b0026fc1606ddcmr6520152ljh.164.1666339388190; Fri, 21 Oct 2022 01:03:08 -0700 (PDT) Received: from [192.168.219.3] ([78.8.192.131]) by smtp.gmail.com with ESMTPSA id m1-20020a056512114100b00494716e4f23sm3064546lfg.111.2022.10.21.01.03.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Oct 2022 01:03:07 -0700 (PDT) Date: Fri, 21 Oct 2022 09:03:05 +0100 (BST) From: "Maciej W. Rozycki" To: Simon Marchi cc: gdb-patches@sourceware.org, Andrew Burgess , Tom Tromey , Simon Sobisch Subject: Re: [PATCH v6 4/8] GDB/Python: Make `None' stand for `unlimited' in setting integer parameters In-Reply-To: <769967d8-d2df-5f65-aed8-0c37c7efffc6@polymtl.ca> Message-ID: References: <769967d8-d2df-5f65-aed8-0c37c7efffc6@polymtl.ca> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2022 08:03:28 -0000 On Mon, 17 Oct 2022, Simon Marchi wrote: > > Similarly to booleans and following the fix for PR python/29217 make > > `gdb.parameter' accept `None' for `unlimited' with parameters of the > > PARAM_UINTEGER, PARAM_INTEGER, and PARAM_ZUINTEGER_UNLIMITED types, as > > `None' is already returned by parameters of the two former types, so > > one might expect to be able to feed it back. It also makes it possible > > to avoid the need to know what the internal integer representation is > > for the special setting of `unlimited'. > > If I understand correctly, assigning None used to just raise an > exception, and now it will be accepted for those kinds of parameters. Yes, we currently have: (gdb) python gdb.set_parameter('listsize', None) Traceback (most recent call last): File "", line 1, in File ".../gdb/data-directory/python/gdb/__init__.py", line 245, in set_parameter execute("set " + name + " " + str(value), to_string=True) gdb.error: No symbol table is loaded. Use the "file" command. Error while executing Python code. (gdb) python test_param_PARAM_UINTEGER.value = None Traceback (most recent call last): File "", line 1, in RuntimeError: The value must be integer. Error while executing Python code. (gdb) etc. With my change in place these commands silently succeed. The only concern I can think of might be where there is an actual symbol called `None' in the debuggee. I guess it can be handled by assigning its value to a convenience variable outside Python. > So, I don't think there are backwards compatibility concerns here. If > so: > > Approved-By: Simon Marchi I have also committed this change then, thanks! Maciej