]> granicus.if.org Git - python/commitdiff
bpo-34007: Skip traceback tests if the Program Counter is not available. (GH-9018)
authorPablo Galindo <Pablogsal@gmail.com>
Fri, 31 Aug 2018 22:04:47 +0000 (23:04 +0100)
committerGitHub <noreply@github.com>
Fri, 31 Aug 2018 22:04:47 +0000 (23:04 +0100)
Sometimes some versions of the shared libraries that are part of the
traceback are compiled in optimised mode and the Program Counter (PC)
is not present, not allowing gdb to walk the frames back. When this
happens, the Python bindings of gdb raise an exception, making the
test impossible to succeed.

Lib/test/test_gdb.py

index 9e0eaea8c8f69219285318c9dd00c2855ebf0238..c2ca57a4a04f6f6eaeb3c207bb083156f42b2e51 100644 (file)
@@ -206,6 +206,15 @@ class DebuggerTests(unittest.TestCase):
         for line in errlines:
             if not line:
                 continue
+            # bpo34007: Sometimes some versions of the shared libraries that
+            # are part of the traceback are compiled in optimised mode and the
+            # Program Counter (PC) is not present, not allowing gdb to walk the
+            # frames back. When this happens, the Python bindings of gdb raise
+            # an exception, making the test impossible to succeed.
+            if "PC not saved" in line:
+                raise unittest.SkipTest("gdb cannot walk the frame object"
+                                        " because the Program Counter is"
+                                        " not present")
             if not line.startswith(ignore_patterns):
                 unexpected_errlines.append(line)