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