diff options
author | Eli Schwartz <eschwartz93@gmail.com> | 2023-01-04 07:59:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-04 07:59:21 (GMT) |
commit | d8073ee6f318773c2600f1e486ccab2504a03cdd (patch) | |
tree | 6c2be61425a4365acbfad1ba2c8a25ab78ed73c2 /Tools | |
parent | b93bd153d5b12df021d5677a56aafb6034850cc6 (diff) | |
download | cpython-d8073ee6f318773c2600f1e486ccab2504a03cdd.zip cpython-d8073ee6f318773c2600f1e486ccab2504a03cdd.tar.gz cpython-d8073ee6f318773c2600f1e486ccab2504a03cdd.tar.bz2 |
[3.11] gh-89419: gdb: fix bug causing AttributeError in py-locals when no frame is available (GH-100611) (#100738)
gh-89419: gdb: fix bug causing AttributeError in py-locals when no frame is available (GH-100611)
```
Unable to read information on python frame
Python Exception <class 'AttributeError'>: 'NoneType' object has no attribute 'co_name'
```
Regression in commit b4903afd4debbbd71dc49a2c8fefa74a3b6c6832. While
refactoring the code into a while loop, the previous early return when
no frame exists went missing. We have just printed a message that we
cannot get information about this, so the frame will be None, and we
cannot attempt to use it.
Discovered on python 3.11, in python 3.12a2 this should error out with
`.is_shim()` instead of `co_name`.
(cherry picked from commit 85869498331f7020e18bb243c89cd694f674b911)
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/gdb/libpython.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 857e52f..a99ce94 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -2126,6 +2126,7 @@ class PyLocals(gdb.Command): while True: if not pyop_frame: print(UNABLE_READ_INFO_PYTHON_FRAME) + break sys.stdout.write('Locals for %s\n' % (pyop_frame.co_name.proxyval(set()))) |