From: Eli Schwartz Date: Tue, 3 Jan 2023 14:56:57 +0000 (-0500) Subject: gh-89419: gdb: fix bug causing `AttributeError` in py-locals when no frame is availab... X-Git-Tag: v3.12.0a4~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85869498331f7020e18bb243c89cd694f674b911;p=thirdparty%2FPython%2Fcpython.git gh-89419: gdb: fix bug causing `AttributeError` in py-locals when no frame is available (#100611) --- diff --git a/Misc/NEWS.d/next/Tools-Demos/2022-12-29-19-22-11.bpo-45256.a0ee_H.rst b/Misc/NEWS.d/next/Tools-Demos/2022-12-29-19-22-11.bpo-45256.a0ee_H.rst new file mode 100644 index 000000000000..9c1aa5762583 --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2022-12-29-19-22-11.bpo-45256.a0ee_H.rst @@ -0,0 +1 @@ +Fix a bug that caused an :exc:`AttributeError` to be raised in ``python-gdb.py`` when ``py-locals`` is used without a frame. diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index c003c1ab4a23..6453dff95df4 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -2108,6 +2108,7 @@ class PyLocals(gdb.Command): while True: if not pyop_frame: print(UNABLE_READ_INFO_PYTHON_FRAME) + break if pyop_frame.is_shim(): break