<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp, branch users/mingmingl-llvm/samplefdo-profile-format</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[lldb] Support the Python stable C API in PythonString::AsUTF8 (#152599)</title>
<updated>2025-08-08T20:57:58+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-08-08T20:57:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=412ea0b675522fd161382d5ce437e51f0505337a'/>
<id>412ea0b675522fd161382d5ce437e51f0505337a</id>
<content type='text'>
This conditionally reimplements PythonString::AsUTF8 using
PyUnicode_AsUTF8String instead of PyUnicode_AsUTF8AndSize.

PyUnicode_AsUTF8AndSize caches the UTF-8 representation of the string in
the Unicode object, which makes it more efficient and ties the lifetime
of the data to the Python string. However, it was only added to the
Stable API in Python 3.10. Older versions that want to use the Stable
API must use PyUnicode_AsUTF8String in combination with ConstString.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This conditionally reimplements PythonString::AsUTF8 using
PyUnicode_AsUTF8String instead of PyUnicode_AsUTF8AndSize.

PyUnicode_AsUTF8AndSize caches the UTF-8 representation of the string in
the Unicode object, which makes it more efficient and ties the lifetime
of the data to the Python string. However, it was only added to the
Stable API in Python 3.10. Older versions that want to use the Stable
API must use PyUnicode_AsUTF8String in combination with ConstString.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Eliminate (_)Py_IsFinalizing (NFC) (#152226)</title>
<updated>2025-08-06T16:06:54+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-08-06T16:06:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3686e5b52f2a02c1c19050479d1dd0fd9d1dd4f8'/>
<id>3686e5b52f2a02c1c19050479d1dd0fd9d1dd4f8</id>
<content type='text'>
Looking at the implementation of `pylifecycle.c` in cpython, finalizing
and initialized are set at the same time. Therefore we can eliminate the
call to `Py_IsFinalizing` and only check `Py_IsInitialized`, which is
part of the stable API.

I converted the check to an assert and confirmed that during my test
suite runs, we never got into the if block. Because we check before
taking the lock, there is an opportunity for a race, but that exact same
race exists with the original code.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Looking at the implementation of `pylifecycle.c` in cpython, finalizing
and initialized are set at the same time. Therefore we can eliminate the
call to `Py_IsFinalizing` and only check `Py_IsInitialized`, which is
part of the stable API.

I converted the check to an assert and confirmed that during my test
suite runs, we never got into the if block. Because we check before
taking the lock, there is an opportunity for a race, but that exact same
race exists with the original code.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Drop PY_MINOR_VERSION &gt;= 3 check (NFC)</title>
<updated>2025-08-05T23:21:22+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-08-05T23:19:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4c2d56318fec16d1d5241cd91d38b59cb65bce83'/>
<id>4c2d56318fec16d1d5241cd91d38b59cb65bce83</id>
<content type='text'>
The minimum supported Python version is now 3.8, so there's no supported
configuration where the minor version is less than 3.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The minimum supported Python version is now 3.8, so there's no supported
configuration where the minor version is less than 3.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Use Python Bytes instead of Buffer for Binary I/O (NFC) (#152031)</title>
<updated>2025-08-05T17:58:59+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-08-05T17:58:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=12da87bef12d9545775a5c375cfc22904ca4602d'/>
<id>12da87bef12d9545775a5c375cfc22904ca4602d</id>
<content type='text'>
Binary I/O (also called buffered I/O) expects bytes-like objects and
produces bytes objects [1]. Switch from using a Python buffer to using
Python bytes to read the data. This eliminates calls to functions that
aren't part of the Python stable C API.

[1] https://docs.python.org/3/library/io.html#binary-i-o</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Binary I/O (also called buffered I/O) expects bytes-like objects and
produces bytes objects [1]. Switch from using a Python buffer to using
Python bytes to read the data. This eliminates calls to functions that
aren't part of the Python stable C API.

[1] https://docs.python.org/3/library/io.html#binary-i-o</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Reimplement PythonObject::Dump using the limited API (#152055)</title>
<updated>2025-08-05T15:17:01+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-08-05T15:17:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c4f7d8744ac54bc1ede754e8d10655fb86b47f25'/>
<id>c4f7d8744ac54bc1ede754e8d10655fb86b47f25</id>
<content type='text'>
This reimplements `PythonObject::Dump` using functions that are part of
the limited API, instead of using `PyObject_Print`, which is not.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reimplements `PythonObject::Dump` using functions that are part of
the limited API, instead of using `PyObject_Print`, which is not.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Eliminate PyGILState_Check (NFC) (#152006)</title>
<updated>2025-08-04T17:44:32+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-08-04T17:44:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ad623a813e6d9ffdef62270656245b35ffceda37'/>
<id>ad623a813e6d9ffdef62270656245b35ffceda37</id>
<content type='text'>
Eliminate calls to PyGILState_Check, which is not part of the Python
Limited C API. In the Locker, we can use PyGILState_Ensure directly. We
could do something similar to replace the assert, but I don't think it's
worth it. We don't assert that we hold the GIL anywhere else.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Eliminate calls to PyGILState_Check, which is not part of the Python
Limited C API. In the Locker, we can use PyGILState_Ensure directly. We
could do something similar to replace the assert, but I don't think it's
worth it. We don't assert that we hold the GIL anywhere else.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Use fully qualified name instead of namespace (NFC)</title>
<updated>2025-08-04T16:22:25+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-08-04T16:12:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0f08dc84405796c25c070ef57258309f66017984'/>
<id>0f08dc84405796c25c070ef57258309f66017984</id>
<content type='text'>
In #151761, both Alex and Pavel prefer to use a fully qualified name
instead of opening a namespace. This PR addresses that post-commit
feedback.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In #151761, both Alex and Pavel prefer to use a fully qualified name
instead of opening a namespace. This PR addresses that post-commit
feedback.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Reimplment PyRun_SimpleString using the Python stable C API (#151777)</title>
<updated>2025-08-01T23:18:24+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-08-01T23:18:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4d1ae58d9e1d679cd0f35ce935579df221b14882'/>
<id>4d1ae58d9e1d679cd0f35ce935579df221b14882</id>
<content type='text'>
Reimplment `PyRun_SimpleString` using the Python stable C API and the
`RunString` helper.

Part of https://github.com/llvm/llvm-project/issues/151617</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reimplment `PyRun_SimpleString` using the Python stable C API and the
`RunString` helper.

Part of https://github.com/llvm/llvm-project/issues/151617</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Reimplment PyRun_String using the Python stable C API (#151761)</title>
<updated>2025-08-01T22:27:14+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-08-01T22:27:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=df392b518b7e187f72c036a611feca75ea8b796b'/>
<id>df392b518b7e187f72c036a611feca75ea8b796b</id>
<content type='text'>
Reimplement `PyRun_String` using `Py_CompileString` and`
PyEval_EvalCode`, which are part of the stable C API.

Part of #151617</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reimplement `PyRun_String` using `Py_CompileString` and`
PyEval_EvalCode`, which are part of the stable C API.

Part of #151617</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Replace Python APIs with their stable equivalent (#151618)</title>
<updated>2025-08-01T14:57:34+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2025-08-01T14:57:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5f2a8cd9a685935726421fd28a42b61c303aef27'/>
<id>5f2a8cd9a685935726421fd28a42b61c303aef27</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
