bpo-34007: Skip traceback tests if the Program Counter is not available. (GH-9018)

https://github.com/python/cpython/commit/4da71814b327cb2ad47a01710360cd21ba6... commit: 4da71814b327cb2ad47a01710360cd21ba636352 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> committer: GitHub <noreply@github.com> date: 2018-08-31T18:47:20-04:00 summary: bpo-34007: Skip traceback tests if the Program Counter is not available. (GH-9018) 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. (cherry picked from commit f2ef51f8bec525b21e52988880c8a029642795ed) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> files: M Lib/test/test_gdb.py diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 9e0eaea8c8f6..c2ca57a4a04f 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -206,6 +206,15 @@ def get_stack_trace(self, source=None, script=None, 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)
participants (1)
-
Miss Islington (bot)