aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-parameter.exp
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2023-01-19 21:15:56 +0000
committerMaciej W. Rozycki <macro@embecosm.com>2023-01-19 21:15:56 +0000
commit77519ab324b0a417411ce0fd172aee0fa8349643 (patch)
tree121383c4ca5737cccead495dd1ad4dd1282e0030 /gdb/testsuite/gdb.python/py-parameter.exp
parent76b58849c5fc433f71ad7ec18f9f47f782643bc6 (diff)
downloadbinutils-77519ab324b0a417411ce0fd172aee0fa8349643.zip
binutils-77519ab324b0a417411ce0fd172aee0fa8349643.tar.gz
binutils-77519ab324b0a417411ce0fd172aee0fa8349643.tar.bz2
GDB/testsuite: Expand for character string limiting options
Modify test cases that verify the operation of the array element limit with character strings such that they are executed twice, once with the `set print characters' option set to `elements' and the limit controlled with the `set print elements' option, and then again with the limit controlled with the `set print characters' option instead. Similarly with the `-elements' and `-characters' options for the `print' command. Additionally verify that said `print' command options combined yield the expected result. Verify correct $_gdb_setting and $_gdb_setting_str values for the `print characters' setting, in particular the `void' value for the `elements' default, which has no corresponding integer value exposed. Add Guile and Python coverage for the `print characters' GDB setting. There are new tests for Ada and Pascal, as the string printing code for these languages is different than the generic string printing code used by other languages. Modula2 also has different string printing code, but (a) this is similar to Pascal, and (b) there are no existing modula2 tests written in Modula2, so I'm not sure how I'd even test the Modula2 string printing. Co-Authored-By: Maciej W. Rozycki <macro@embecosm.com> Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/testsuite/gdb.python/py-parameter.exp')
-rw-r--r--gdb/testsuite/gdb.python/py-parameter.exp13
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.python/py-parameter.exp b/gdb/testsuite/gdb.python/py-parameter.exp
index bec1c61..09a0308 100644
--- a/gdb/testsuite/gdb.python/py-parameter.exp
+++ b/gdb/testsuite/gdb.python/py-parameter.exp
@@ -337,6 +337,7 @@ proc_with_prefix test_gdb_parameter { } {
"listsize"
"print elements"
"max-completions"
+ "print characters"
} {
clean_restart
@@ -349,7 +350,8 @@ proc_with_prefix test_gdb_parameter { } {
set param_get_unlimited None
set param_set_minus_one ""
}
- "print elements" {
+ "print elements" -
+ "print characters" {
set param_get_zero None
set param_get_minus_one None
set param_get_none None
@@ -398,6 +400,15 @@ proc_with_prefix test_gdb_parameter { } {
gdb_test "python print(gdb.parameter('$param'))" \
$param_get_unlimited "test value of 'unlimited'"
+
+ if {$param == "print characters"} {
+ gdb_test_no_output \
+ "python gdb.set_parameter('$param', 'elements')" \
+ "test set to 'elements'"
+
+ gdb_test "python print(gdb.parameter('$param'))" \
+ elements "test value of 'elements'"
+ }
}
clean_restart