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
This commit is contained in:
Peter Collingbourne
2025-04-10 10:38:08 -07:00
committed by GitHub
parent 39562de510
commit a4e6a771a6

View File

@@ -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):