From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eGGJGntv7mCsIgAAWB0awg (envelope-from ) for ; Wed, 14 Jul 2021 01:00:43 -0400 Received: by simark.ca (Postfix, from userid 112) id 69E3C1EDEE; Wed, 14 Jul 2021 01:00:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 C65231E54D for ; Wed, 14 Jul 2021 01:00:42 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7F52F3972016 for ; Wed, 14 Jul 2021 05:00:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F52F3972016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626238842; bh=A8KlD9MToeT/NN8p4HlpLyDYYUfzqTx/U2k6z9GGdxM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Bw1JXTP85ez2LLy6kWw8oq6ZRe2NNtrpm8/2tzyvYueymOJuX9KVD7UtesXtmDPbO Qklj5XUqhQamltJXy6hwWa+TQxaZYtjrQUwoYI5ZP9N+/+zHE8SK+HmD3T8ozuDsuL sH993EVQ8hCfv7gHU1V3ThPW8SnTG96jQj90ftXQ= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id BB22F3972017 for ; Wed, 14 Jul 2021 04:57:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB22F3972017 X-ASG-Debug-ID: 1626238642-0c856e67e219ef340001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id ZwVPhWfBODwFMFni (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Jul 2021 00:57:22 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) by smtp.ebox.ca (Postfix) with ESMTP id 11623441D64; Wed, 14 Jul 2021 00:57:22 -0400 (EDT) X-Barracuda-RBL-IP: 192.222.157.6 X-Barracuda-Effective-Source-IP: 192-222-157-6.qc.cable.ebox.net[192.222.157.6] X-Barracuda-Apparent-Source-IP: 192.222.157.6 To: gdb-patches@sourceware.org Subject: [PATCH 14/16] gdb/testsuite: test get/set value of unregistered Guile parameter Date: Wed, 14 Jul 2021 00:55:18 -0400 X-ASG-Orig-Subj: [PATCH 14/16] gdb/testsuite: test get/set value of unregistered Guile parameter Message-Id: <20210714045520.1623120-15-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210714045520.1623120-1-simon.marchi@polymtl.ca> References: <20210714045520.1623120-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1626238642 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 1700 X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.91193 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M 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" 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. -- 2.32.0