Issue 89621
Summary In py3.11 SBThread.frames says 'SBThread' object is not iterable
Labels new issue
Assignees
Reporter santhoshkumar-mani
    In py3.11 SBThread.frames says 'SBThread' object is not iterable, same works fine in 3.8 

Am using lldb version 8.0.1, is there any fix in recent versions ? i want to know if its worth upgrading 

```
```
File "/usr/local/llvm80/lib/python3.11/site-packages/lldb/_init_.py", line 10506, in get_thread_frames
    for frame in self:
TypeError: 'SBThread' object is not iterable
```
coming from here : /usr/local/llvm80/lib/python3.11/site-packages/lldb/{}init{}.py

```
 10503     def get_thread_frames(self):
  10504         '''An accessor function that returns a list() that contains all frames in a lldb.SBThread object.'''
  10505         frames = []
  10506         for frame in self:
  10507             frames.append(frame)
  10508         return frames   
```
```

Same code in 3.8 returns SBThread as list, but not in 3.11 

Swig is generating this file from lldb i guess

```
root# head -7 /usr/local/llvm80/lib/python3.11/site-packages/lldb/__init__.py
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.1.1
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.
swig_version = (4, 1, 1)
Dont see any problem in swig 4.1.1 generated code, as it supports py3.11 : [https://swig.org/#:~:text=Python%203.9%2D3.11%20support%20added., ](https://swig.org/#:~:text=Python%203.9%2D3.11%20support%20added.)unless its a open defect

```
Or py3.11 [improvisation](https://docs.python.org/3.11/whatsnew/3.11.html#:~:text=Old%2Dstyle%20frame%20objects%20are%20now%20created%20only%20when%20requested%20by%20debuggers%20or%20by%20Python%20introspection%20functions%20such%20as%20sys._getframe()%20and%20inspect.currentframe(), isnt allowing frames to be returned ?, lldb manual is clear though SBThread.frames should return the frames 

https://lldb.llvm.org/python_api/lldb.SBThread.html#lldb.SBThread.frames
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to