Blame SOURCES/00338-fix-test_gdb-for-LTO.patch

3d909f
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
3d909f
index 9c15fca..c972409 100644
3d909f
--- a/Lib/test/test_gdb.py
3d909f
+++ b/Lib/test/test_gdb.py
3d909f
@@ -279,8 +279,15 @@ class DebuggerTests(unittest.TestCase):
3d909f
         # gdb can insert additional '\n' and space characters in various places
3d909f
         # in its output, depending on the width of the terminal it's connected
3d909f
         # to (using its "wrap_here" function)
3d909f
-        m = re.match(r'.*#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)\)\s+at\s+\S*Python/bltinmodule.c.*',
3d909f
-                     gdb_output, re.DOTALL)
3d909f
+        m = re.search(
3d909f
+            # Match '#0 builtin_id(self=..., v=...)'
3d909f
+            r'#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)?\)'
3d909f
+            # Match ' at Python/bltinmodule.c'.
3d909f
+            # bpo-38239: builtin_id() is defined in Python/bltinmodule.c,
3d909f
+            # but accept any "Directory\file.c" to support Link Time
3d909f
+            # Optimization (LTO).
3d909f
+            r'\s+at\s+\S*[A-Za-z]+/[A-Za-z0-9_-]+\.c',
3d909f
+            gdb_output, re.DOTALL)
3d909f
         if not m:
3d909f
             self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
3d909f
         return m.group(1), gdb_output