]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-89419: gdb: fix bug causing `AttributeError` in py-locals when no frame is availab...
authorEli Schwartz <eschwartz93@gmail.com>
Tue, 3 Jan 2023 14:56:57 +0000 (09:56 -0500)
committerGitHub <noreply@github.com>
Tue, 3 Jan 2023 14:56:57 +0000 (20:26 +0530)
Misc/NEWS.d/next/Tools-Demos/2022-12-29-19-22-11.bpo-45256.a0ee_H.rst [new file with mode: 0644]
Tools/gdb/libpython.py

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 (file)
index 0000000..9c1aa57
--- /dev/null
@@ -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.
index c003c1ab4a23bd9a84c28ef82cda9101c98c86d9..6453dff95df4a3d7878ea23ddf9b8c1885fe2af6 100755 (executable)
@@ -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