| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 8 个月前 | ||
[lldb] Format more Python files with black (#65979) By running this from lldb/ $ black --exclude "third_party/|scripts/|utils/" ./ | 2 年前 | |
[lldb] Support a Stable ABI LLDB_PYTHON_EXT_SUFFIX (#166269) When building against the Python Stable API, we should use the abi3 ABI tag. Otherwise, Python will refuse to import the native shared object. This PR adds support for generating a stable ABI compatible suffix when LLDB_ENABLE_PYTHON_LIMITED_API is set. Previously, on Darwin when building against Python 3.14, you would end up with _lldb.cpython-314-darwin.so. Now, when using the stable ABI, you get _lldb.abi3.so instead. A different version of the Python interpreter will not consider loading the former, but will load the latter. | 8 个月前 | |
[lldb] make it easier to find LLDB's python It is surprisingly difficult to write a simple python script that can reliably import lldb without failing, or crashing. I'm currently resorting to convolutions like this: def find_lldb(may_reexec=False): if prefix := os.environ.get('LLDB_PYTHON_PREFIX'): if os.path.realpath(prefix) != os.path.realpath(sys.prefix): raise Exception("cannot import lldb.\n" f" sys.prefix should be: {prefix}\n" f" but it is: {sys.prefix}") else: line1, line2 = subprocess.run( ['lldb', '-x', '-b', '-o', 'script print(sys.prefix)'], encoding='utf8', stdout=subprocess.PIPE, check=True).stdout.strip().splitlines() assert line1.strip() == '(lldb) script print(sys.prefix)' prefix = line2.strip() os.environ['LLDB_PYTHON_PREFIX'] = prefix if sys.prefix != prefix: if not may_reexec: raise Exception( "cannot import lldb.\n" + f" This python, at {sys.prefix}\n" f" does not math LLDB's python at {prefix}") os.environ['LLDB_PYTHON_PREFIX'] = prefix python_exe = os.path.join(prefix, 'bin', 'python3') os.execl(python_exe, python_exe, *sys.argv) lldb_path = subprocess.run(['lldb', '-P'], check=True, stdout=subprocess.PIPE, encoding='utf8').stdout.strip() sys.path = [lldb_path] + sys.path This patch aims to replace all that with: #!/usr/bin/env lldb-python import lldb ... ... by adding the following features: * new command line option: --print-script-interpreter-info. This prints language-specific information about the script interpreter in JSON format. * new tool (unix only): lldb-python which finds python and exec's it. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D112973 | 4 年前 | |
[lldb] Add support for displaying __float128 variables (#98369) | 11 个月前 | |
[lldb/Interpreter] Implement ScriptedFrameProvider{,Python}Interface (#166662) This patch implements the base and python interface for the ScriptedFrameProvider class. This is necessary to call python APIs from the ScriptedFrameProvider that will come in a follow-up. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> | 8 个月前 | |
[lldb] Drop support for the Buffer Protocol (#168144) This is an alternative solution to the issue described in #167990, which can be summarized as that we cannot target Python 3.8 with the stable API and support building for Python 3.13 and later due to the buffer protocol. The approach taken in this PR, and proposed by Ismail, is to sidesteps the issue by dropping support for the buffer protocol. The only two users are SBFile::Read and SBFile::Write. Instead, we support PyBytes and PyByteArray which are the builtin types that conform to the buffer protocol. Technically, this means a small regression, where those methods could previously take custom types that conform to Python's buffer protocol. Like Ismail, I think this is acceptable given the alternatives. Co-authored-by: Med Ismail Bennani <ismail@bennani.ma> | 8 个月前 | |
[lldb] Enforce Py_LIMITED_API in the SWIG typemaps (#168147) We missed a handful of uses of the Python private API in the SWIG typemaps because they are included before we include the Python header that defines Py_LIMITED_API. This fixes that and guards the last private use on whether or not you're targeting the limited API. Unfortunately there doesn't appear to be an alternative, so we have to resort to being slightly less defensive. | 8 个月前 | |
| 8 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 8 个月前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 4 年前 | ||
| 11 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 |