Skip to content

Commit 4da7181

Browse files
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 f2ef51f) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
1 parent 5df3658 commit 4da7181

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Lib/test/test_gdb.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,15 @@ def get_stack_trace(self, source=None, script=None,
206206
for line in errlines:
207207
if not line:
208208
continue
209+
# bpo34007: Sometimes some versions of the shared libraries that
210+
# are part of the traceback are compiled in optimised mode and the
211+
# Program Counter (PC) is not present, not allowing gdb to walk the
212+
# frames back. When this happens, the Python bindings of gdb raise
213+
# an exception, making the test impossible to succeed.
214+
if "PC not saved" in line:
215+
raise unittest.SkipTest("gdb cannot walk the frame object"
216+
" because the Program Counter is"
217+
" not present")
209218
if not line.startswith(ignore_patterns):
210219
unexpected_errlines.append(line)
211220

0 commit comments

Comments
 (0)