bpo-32962: python-gdb catchs ValueError on read_var() (GH-7692) · python/cpython@019d33b (original) (raw)

File tree

2 files changed

lines changed

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 +python-gdb now catchs ValueError on read_var(): when Python has no debug
2 +symbols for example.
Original file line number Diff line number Diff line change
@@ -1552,15 +1552,22 @@ def is_other_python_frame(self):
1552 1552 # Use the prettyprinter for the func:
1553 1553 func = frame.read_var(arg_name)
1554 1554 return str(func)
1555 +except ValueError:
1556 +return ('PyCFunction invocation (unable to read %s: '
1557 +'missing debuginfos?)' % arg_name)
1555 1558 except RuntimeError:
1556 1559 return 'PyCFunction invocation (unable to read %s)' % arg_name
1557 1560
1558 1561 if caller == 'wrapper_call':
1562 +arg_name = 'wp'
1559 1563 try:
1560 -func = frame.read_var('wp')
1564 +func = frame.read_var(arg_name)
1561 1565 return str(func)
1566 +except ValueError:
1567 +return ('<wrapper_call invocation (unable to read %s: '
1568 +'missing debuginfos?)>' % arg_name)
1562 1569 except RuntimeError:
1563 -return '<wrapper_call invocation>'
1570 +return '<wrapper_call invocation (unable to read %s)>' % arg_name
1564 1571
1565 1572 # This frame isn't worth reporting:
1566 1573 return False