Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 019d33b

Browse files
authored
bpo-32962: python-gdb catchs ValueError on read_var() (GH-7692)
python-gdb now catchs ValueError on read_var(): when Python has no debug symbols for example.
1 parent 4ffe9c2 commit 019d33b

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
python-gdb now catchs ValueError on read_var(): when Python has no debug
2+
symbols for example.

Tools/gdb/libpython.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,15 +1552,22 @@ def is_other_python_frame(self):
15521552
# Use the prettyprinter for the func:
15531553
func = frame.read_var(arg_name)
15541554
return str(func)
1555+
except ValueError:
1556+
return ('PyCFunction invocation (unable to read %s: '
1557+
'missing debuginfos?)' % arg_name)
15551558
except RuntimeError:
15561559
return 'PyCFunction invocation (unable to read %s)' % arg_name
15571560

15581561
if caller == 'wrapper_call':
1562+
arg_name = 'wp'
15591563
try:
1560-
func = frame.read_var('wp')
1564+
func = frame.read_var(arg_name)
15611565
return str(func)
1566+
except ValueError:
1567+
return ('<wrapper_call invocation (unable to read %s: '
1568+
'missing debuginfos?)>' % arg_name)
15621569
except RuntimeError:
1563-
return '<wrapper_call invocation>'
1570+
return '<wrapper_call invocation (unable to read %s)>' % arg_name
15641571

15651572
# This frame isn't worth reporting:
15661573
return False

0 commit comments

Comments
 (0)