]> git.lizzy.rs Git - rust.git/commitdiff
[rust-gdb] relax the GDB version regex
authorJosh Stone <jistone@redhat.com>
Tue, 15 Jan 2019 23:14:17 +0000 (15:14 -0800)
committerJosh Stone <jistone@redhat.com>
Tue, 15 Jan 2019 23:14:17 +0000 (15:14 -0800)
The pretty-printer script is checking `gdb.VERSION` to see if it's at
least 8.1 for some features. With `re.match`, it will only find the
version at the beginning of that string, but in Fedora the string is
something like "Fedora 8.2-5.fc29". Using `re.search` instead will find
the first location that matches anywhere, so it will find my 8.2.

src/etc/gdb_rust_pretty_printing.py

index 08ae289d60374a51e42db4a7d42be5ee2fbbd97e..b9413563fd9ff41f7a57c8821aa8df145ca2ea5c 100755 (executable)
@@ -16,7 +16,7 @@ rust_enabled = 'set language rust' in gdb.execute('complete set language ru', to
 # This fix went in 8.1, so check for that.
 # See https://github.com/rust-lang/rust/issues/56730
 gdb_81 = False
-_match = re.match('([0-9]+)\\.([0-9]+)', gdb.VERSION)
+_match = re.search('([0-9]+)\\.([0-9]+)', gdb.VERSION)
 if _match:
     if int(_match.group(1)) > 8 or (int(_match.group(1)) == 8 and int(_match.group(2)) >= 1):
         gdb_81 = True