aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-06-12 11:36:08 -0600
committerTom Tromey <tom@tromey.com>2022-07-08 13:56:56 -0600
commitfa17a6814113ac22d8059d61514aa2c6e29b0aae (patch)
tree8b4349d43b605434454c9905578e472608861ffa /gdb/testsuite/gdb.python
parent57f8fe908bec51c40ec686294460ec979b140843 (diff)
downloadgdb-fa17a6814113ac22d8059d61514aa2c6e29b0aae.zip
gdb-fa17a6814113ac22d8059d61514aa2c6e29b0aae.tar.gz
gdb-fa17a6814113ac22d8059d61514aa2c6e29b0aae.tar.bz2
Handle bool specially in gdb.set_parameter
PR python/29217 points out that gdb.parameter will return bool values, but gdb.set_parameter will not properly accept them. This patch fixes the problem by adding a special case to set_parameter. I looked at a fix involving rewriting set_parameter in C++. However, this one is simpler. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29217
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r--gdb/testsuite/gdb.python/py-parameter.exp4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-parameter.exp b/gdb/testsuite/gdb.python/py-parameter.exp
index db158dd..d6db6ac 100644
--- a/gdb/testsuite/gdb.python/py-parameter.exp
+++ b/gdb/testsuite/gdb.python/py-parameter.exp
@@ -126,6 +126,10 @@ proc_with_prefix test_boolean_parameter { } {
"The state of the Test Parameter is off.*" "show parameter off"
gdb_test "python print (test_param.value)" "False" \
"test boolean parameter value is False"
+ gdb_test_no_output "python gdb.set_parameter('print test-param', True)" \
+ "set boolean parameter using set_parameter"
+ gdb_test "python print(gdb.parameter('print test-param'))" "True" \
+ "get boolean parameter using gdb.parameter"
gdb_test "help show print test-param" \
[multi_line \
"Show the state of the boolean test-param" \