]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gdbhooks: regex syntax error
authorJason Merrill <jason@redhat.com>
Mon, 5 Feb 2024 16:49:41 +0000 (11:49 -0500)
committerJason Merrill <jason@redhat.com>
Fri, 16 Feb 2024 16:07:38 +0000 (11:07 -0500)
Recent python complains about this pattern with
  SyntaxWarning: invalid escape sequence '\s'
because \s in a regular string just means 's'; for it to mean whitespace,
you need \\ or for the pattern to be a raw string.

Curiously, break-on-pass completion works for me either with or without this
change, but at least this avoids the warning.

gcc/ChangeLog:

* gdbhooks.py: Fix regex syntax.

gcc/gdbhooks.py

index 3fa62652c61c69c3c625d3d271a063c8289d24d2..92e38880a70a64ed1baca233b29a350d053690ea 100644 (file)
@@ -642,7 +642,7 @@ class PassNames:
         self.names = []
         with open(os.path.join(srcdir, 'passes.def')) as f:
             for line in f:
-                m = re.match('\s*NEXT_PASS \(([^,]+).*\);', line)
+                m = re.match(r'\s*NEXT_PASS \(([^,]+).*\);', line)
                 if m:
                     self.names.append(m.group(1))