[libcxx-commits] [libcxx] a4e6a77 - libcxx: In gdb test detect execute_mi with feature check instead of version check.

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 10 10:38:11 PDT 2025


Author: Peter Collingbourne
Date: 2025-04-10T10:38:08-07:00
New Revision: a4e6a771a68660de312aeaaceed0c7d41a680912

URL: https://github.com/llvm/llvm-project/commit/a4e6a771a68660de312aeaaceed0c7d41a680912
DIFF: https://github.com/llvm/llvm-project/commit/a4e6a771a68660de312aeaaceed0c7d41a680912.diff

LOG: 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

Added: 
    

Modified: 
    libcxx/test/libcxx/gdb/gdb_pretty_printer_test.py

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.py b/libcxx/test/libcxx/gdb/gdb_pretty_printer_test.py
index 254a61a8c633e..da09092b690c4 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 @@
 # 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):


        


More information about the libcxx-commits mailing list