From 2358a9326ee9d030ab88157cbbf84355cc5b4101 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 14 Jun 2018 16:13:20 +0200 Subject: [PATCH 1/2] bpo-32962: python-gdb catchs ValueError on read_var() python-gdb now catchs ValueError on read_var(): when Python has no debug symbols for example. --- Tools/gdb/libpython.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 7df7c9bd541672..41cbba2f10f351 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -1552,15 +1552,22 @@ def is_other_python_frame(self): # Use the prettyprinter for the func: func = frame.read_var(arg_name) return str(func) + except ValueError: + return ('PyCFunction invocation (unable to read %s: ' + 'missing debuginfos?)' % arg_name) except RuntimeError: return 'PyCFunction invocation (unable to read %s)' % arg_name if caller == 'wrapper_call': + arg_name = 'wp' try: - func = frame.read_var('wp') + func = frame.read_var(arg_name) return str(func) + except ValueError: + return ('' % arg_name) except RuntimeError: - return '' + return '' % arg_name # This frame isn't worth reporting: return False From 62764ff10d4214df1d2f3cc0608c186f89316c3a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 14 Jun 2018 16:16:56 +0200 Subject: [PATCH 2/2] Add NEWS entry --- .../next/Tools-Demos/2018-06-14-16-16-53.bpo-32962.2YfdwI.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Tools-Demos/2018-06-14-16-16-53.bpo-32962.2YfdwI.rst diff --git a/Misc/NEWS.d/next/Tools-Demos/2018-06-14-16-16-53.bpo-32962.2YfdwI.rst b/Misc/NEWS.d/next/Tools-Demos/2018-06-14-16-16-53.bpo-32962.2YfdwI.rst new file mode 100644 index 00000000000000..de40070795e953 --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2018-06-14-16-16-53.bpo-32962.2YfdwI.rst @@ -0,0 +1,2 @@ +python-gdb now catchs ValueError on read_var(): when Python has no debug +symbols for example.