From a4e6a771a68660de312aeaaceed0c7d41a680912 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 10 Apr 2025 10:38:08 -0700 Subject: [PATCH] libcxx: In gdb test detect execute_mi with feature check instead of version check. The existing version check can lead to test failures on some distribution packages of gdb where not all components of the version number are integers, such as Fedora where gdb.VERSION can be something like "15.2-4.fc41". Fix it by replacing the version check with a feature check. Reviewers: philnik777 Reviewed By: philnik777 Pull Request: https://github.com/llvm/llvm-project/pull/132291 --- libcxx/test/libcxx/gdb/gdb_pretty_printer_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.py b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.py index 254a61a8c633..da09092b690c 100644 --- a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.py +++ b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.py @@ -30,7 +30,8 @@ test_failures = 0 # we exit. has_run_tests = False -has_execute_mi = tuple(map(int, gdb.VERSION.split("."))) >= (14, 2) +has_execute_mi = getattr(gdb, "execute_mi", None) is not None + class CheckResult(gdb.Command): def __init__(self):