From 89f8e850a1a2ddabe5125251fa44c4bddc172869 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Sat, 20 Sep 2025 14:48:57 +0200 Subject: [PATCH] [gdb/testsuite] Fix hardcoded constant in gdb.python/py-pp-maint.exp In test-case gdb.python/py-pp-maint.exp, I came across: ... gdb_test "disable pretty-printer global lookup_function_lookup_test" \ "1 printer disabled.*[expr $num_pp - 1] of $num_pp printers enabled" gdb_test "disable pretty-printer global pp-test;.*" \ "[expr 5] printers disabled.*0 of $num_pp printers enabled" ... The "[expr 5]" can simply be rewritten as "5", but instead use the construct used in the previous gdb_test: [expr {$num_pp - 1}], given that the numbers should match. Tested on x86_64-linux. --- gdb/testsuite/gdb.python/py-pp-maint.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.python/py-pp-maint.exp b/gdb/testsuite/gdb.python/py-pp-maint.exp index 74d8e76c608..c87f30da975 100644 --- a/gdb/testsuite/gdb.python/py-pp-maint.exp +++ b/gdb/testsuite/gdb.python/py-pp-maint.exp @@ -75,7 +75,7 @@ gdb_test "disable pretty-printer global lookup_function_lookup_test" \ "1 printer disabled.*[expr $num_pp - 1] of $num_pp printers enabled" gdb_test "disable pretty-printer global pp-test;.*" \ - "[expr 5] printers disabled.*0 of $num_pp printers enabled" + "[expr {$num_pp - 1}] printers disabled.*0 of $num_pp printers enabled" gdb_test "info pretty-printer global .*function" \ {.*function_lookup_test \[disabled\].*} \ -- 2.47.3