1 |
From 9430423cab6909792fb1b3a850f1c3c8974a5111 Mon Sep 17 00:00:00 2001 |
2 |
From: Josh Stone <jistone@redhat.com> |
3 |
Date: Tue, 15 Jan 2019 15:14:17 -0800 |
4 |
Subject: [PATCH] [rust-gdb] relax the GDB version regex |
5 |
|
6 |
The pretty-printer script is checking `gdb.VERSION` to see if it's at |
7 |
least 8.1 for some features. With `re.match`, it will only find the |
8 |
version at the beginning of that string, but in Fedora the string is |
9 |
something like "Fedora 8.2-5.fc29". Using `re.search` instead will find |
10 |
the first location that matches anywhere, so it will find my 8.2. |
11 |
--- |
12 |
src/etc/gdb_rust_pretty_printing.py | 2 +- |
13 |
1 file changed, 1 insertion(+), 1 deletion(-) |
14 |
|
15 |
diff --git a/src/etc/gdb_rust_pretty_printing.py b/src/etc/gdb_rust_pretty_printing.py |
16 |
index 08ae289d6037..b9413563fd9f 100755 |
17 |
--- a/src/etc/gdb_rust_pretty_printing.py |
18 |
+++ b/src/etc/gdb_rust_pretty_printing.py |
19 |
@@ -16,7 +16,7 @@ rust_enabled = 'set language rust' in gdb.execute('complete set language ru', to |
20 |
# This fix went in 8.1, so check for that. |
21 |
# See https://github.com/rust-lang/rust/issues/56730 |
22 |
gdb_81 = False |
23 |
-_match = re.match('([0-9]+)\\.([0-9]+)', gdb.VERSION) |
24 |
+_match = re.search('([0-9]+)\\.([0-9]+)', gdb.VERSION) |
25 |
if _match: |
26 |
if int(_match.group(1)) > 8 or (int(_match.group(1)) == 8 and int(_match.group(2)) >= 1): |
27 |
gdb_81 = True |
28 |
-- |
29 |
2.20.1 |
30 |
|