From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IMplHtEb+2DEdwAAWB0awg (envelope-from ) for ; Fri, 23 Jul 2021 15:43:13 -0400 Received: by simark.ca (Postfix, from userid 112) id 6D59B1EDFB; Fri, 23 Jul 2021 15:43:13 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B7ECF1E813 for ; Fri, 23 Jul 2021 15:43:12 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4193239AD828 for ; Fri, 23 Jul 2021 19:43:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4193239AD828 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627069392; bh=7sbuf+v1MYd5IRlq6EQlCsw0Dobf83X2ywfR9kfup2g=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Q9Uu855Ywq6ttlzcqmo6YnI0DRGQEY7fUdcde9+ZmlVE6yIyVxRNSw4wWHxw3s4RB jxOE0d3qe70m2z3ze6PE4BqAbNDocpxDcix4PEBXfNdX7uPy6FLsFSlICd+bDmW+4V JX3ZK0s3NcYhjR8o8fQ1pz6iCBHfuwnhD52cWKCk= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id D9F91399E00D for ; Fri, 23 Jul 2021 19:42:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D9F91399E00D Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 16NJg6QK030261 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 23 Jul 2021 15:42:11 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 16NJg6QK030261 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 6AF9D1E813 for ; Fri, 23 Jul 2021 15:42:06 -0400 (EDT) Subject: Re: [PATCH 14/16] gdb/testsuite: test get/set value of unregistered Guile parameter To: gdb-patches@sourceware.org References: <20210714045520.1623120-1-simon.marchi@polymtl.ca> <20210714045520.1623120-15-simon.marchi@polymtl.ca> Message-ID: Date: Fri, 23 Jul 2021 15:42:06 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210714045520.1623120-15-simon.marchi@polymtl.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 23 Jul 2021 19:42:06 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-07-14 12:55 a.m., Simon Marchi wrote: > When creating a parameter in Guile, you have to create it using > make-parameter and then register it with GDB with register-parameter!. > In between, it's still possible (though not documented) to set the > parameter's value. I broke this use case by mistake while writing this > series, so thought it would be good to have a test for it. > > I suppose that people could use this "feature" to give their parameter > an initial value, even though make-parameter has an initial-value > parameter for this. Nevertheless, changing this behavior could break > some scripts, which is why I think it's important for it to be tested. > > Change-Id: I5b2103e3cec0cfdcccf7ffb00eb05fed8626e66d > --- > gdb/testsuite/gdb.guile/scm-parameter.exp | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/gdb/testsuite/gdb.guile/scm-parameter.exp b/gdb/testsuite/gdb.guile/scm-parameter.exp > index 67120b233664..5a2fb42503d0 100644 > --- a/gdb/testsuite/gdb.guile/scm-parameter.exp > +++ b/gdb/testsuite/gdb.guile/scm-parameter.exp > @@ -176,6 +176,14 @@ with_test_prefix "test-restricted-param" { > gdb_test "guile (register-parameter! (make-parameter \"height\"))" \ > "ERROR.*is already defined.*" "error registering existing parameter" > > +# Test printing and setting the value of an unregistered parameter. > +gdb_test "guile (print (parameter-value (make-parameter \"foo\")))" \ > + "= #f" > +gdb_test "guile (define myparam (make-parameter \"foo\"))" > +gdb_test_no_output "guile (set-parameter-value! myparam #t)" > +gdb_test "guile (print (parameter-value myparam))" \ > + "= #t" > + > # Test registering a parameter named with what was an ambiguous spelling > # of existing parameters. > > I pushed everything up to this point. Simon