From: Tom de Vries Date: Sat, 20 Sep 2025 12:48:57 +0000 (+0200) Subject: [gdb/testsuite] Fix hardcoded constant in gdb.python/py-pp-maint.exp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89f8e850a1a2ddabe5125251fa44c4bddc172869;p=thirdparty%2Fbinutils-gdb.git [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. --- 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\].*} \