Skip to content

Commit

Permalink
[rust-gdb] relax the GDB version regex
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cuviper authored and Vardhan Thigle committed Jan 31, 2019
1 parent d0f4695 commit 5494559
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/etc/gdb_rust_pretty_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# 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
Expand Down

0 comments on commit 5494559

Please sign in to comment.