Last active
February 2, 2021 04:08
-
-
Save tyhoff/7a286945ef75947ad49a347dbc8708ca to your computer and use it in GitHub Desktop.
.lldbinit modifications for using a Virtual/Conda environment with LLDB Python scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source the python path fix | |
command script import ~/lldbinit.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update LLDB's Python paths with the `sys.path` values of the local Python installation, | |
# whether that is brew'ed Python, a virtualenv, or another system python. | |
import os,subprocess,sys | |
# Execute a Python using the user's shell and pull out the sys.path (for site-packages) | |
paths = subprocess.check_output('python -c "import os,sys;print(os.linesep.join(sys.path).strip())"',shell=True).decode("utf-8").split() | |
# Extend LLDB's Python's search path | |
sys.path.extend(paths) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was created for users to get around the "Caveat #3" for Python mentioned in LLDB's documentation.
https://lldb.llvm.org/resources/caveats.html#id1