<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in lldb-python</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>bbef51eb - [lldb] make it easier to find LLDB&apos;s python</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/lldb/bindings/python/lldb-python#bbef51eb</link>
        <description>[lldb] make it easier to find LLDB&apos;s pythonIt is surprisingly difficult to write a simple python script thatcan reliably `import lldb` without failing, or crashing.   I&apos;mcurrently resorting to convolutions like this:    def find_lldb(may_reexec=False):		if prefix := os.environ.get(&apos;LLDB_PYTHON_PREFIX&apos;):			if os.path.realpath(prefix) != os.path.realpath(sys.prefix):				raise Exception(&quot;cannot import lldb.\n&quot;					f&quot;  sys.prefix should be: {prefix}\n&quot;					f&quot;  but it is: {sys.prefix}&quot;)		else:			line1, line2 = subprocess.run(				[&apos;lldb&apos;, &apos;-x&apos;, &apos;-b&apos;, &apos;-o&apos;, &apos;script print(sys.prefix)&apos;],				encoding=&apos;utf8&apos;, stdout=subprocess.PIPE,				check=True).stdout.strip().splitlines()			assert line1.strip() == &apos;(lldb) script print(sys.prefix)&apos;			prefix = line2.strip()			os.environ[&apos;LLDB_PYTHON_PREFIX&apos;] = prefix		if sys.prefix != prefix:			if not may_reexec:				raise Exception(					&quot;cannot import lldb.\n&quot; +					f&quot;  This python, at {sys.prefix}\n&quot;					f&quot;  does not math LLDB&apos;s python at {prefix}&quot;)			os.environ[&apos;LLDB_PYTHON_PREFIX&apos;] = prefix			python_exe = os.path.join(prefix, &apos;bin&apos;, &apos;python3&apos;)			os.execl(python_exe, python_exe, *sys.argv)		lldb_path = subprocess.run([&apos;lldb&apos;, &apos;-P&apos;],			check=True, stdout=subprocess.PIPE,				encoding=&apos;utf8&apos;).stdout.strip()		sys.path = [lldb_path] + sys.pathThis 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&apos;s it.Reviewed By: JDevlieghereDifferential Revision: https://reviews.llvm.org/D112973

            List of files:
            /llvm-project-15.0.7/lldb/bindings/python/lldb-python</description>
        <pubDate>Wed, 10 Nov 2021 18:33:33 +0000</pubDate>
        <dc:creator>Lawrence D&apos;Anna &lt;lawrence_danna@apple.com&gt;</dc:creator>
    </item>
</channel>
</rss>
